forked from enlightenment/efl
efl.loop_timer: rename all methods/properties/events
Summary: avoid potential future conflict by not using conflict-able names ref T7731 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7731 Differential Revision: https://phab.enlightenment.org/D8256
This commit is contained in:
parent
cf200a7d28
commit
632bd45825
|
@ -53,11 +53,11 @@ _th_read_change(void *data EINA_UNUSED, const Efl_Event *ev)
|
|||
if (!strcmp(s, "one"))
|
||||
efl_add(EFL_LOOP_TIMER_CLASS, obj,
|
||||
efl_loop_timer_interval_set(efl_added, 2.0),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _th_timeout, obj));
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _th_timeout, obj));
|
||||
else
|
||||
efl_add(EFL_LOOP_TIMER_CLASS, obj,
|
||||
efl_loop_timer_interval_set(efl_added, 1.0),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _th_timeout, obj));
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _th_timeout, obj));
|
||||
eina_accessor_free(args_access);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ ecore_init(void)
|
|||
efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
|
||||
efl_loop_timer_interval_set(efl_added, sec / 2),
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_systemd_watchdog_cb, NULL));
|
||||
unsetenv("WATCHDOG_USEC");
|
||||
|
||||
|
|
|
@ -858,7 +858,7 @@ _impl_ecore_exe_kill(Ecore_Exe *obj EINA_UNUSED, Ecore_Exe_Data *exe)
|
|||
efl_del(exe->doomsday_clock);
|
||||
exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, obj,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_ecore_exe_make_sure_its_really_dead,
|
||||
obj),
|
||||
efl_loop_timer_interval_set(efl_added, 10.0));
|
||||
|
@ -896,7 +896,7 @@ _ecore_exe_make_sure_its_dead(void *data, const Efl_Event *event)
|
|||
INF("Sending KILL signal to allegedly dead PID %d.", exe->pid);
|
||||
exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, exe_obj,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_ecore_exe_make_sure_its_really_dead,
|
||||
exe_obj),
|
||||
efl_loop_timer_interval_set(efl_added, 10.0));
|
||||
|
@ -1295,7 +1295,7 @@ _ecore_exe_dead_attach(Ecore_Exe *obj)
|
|||
if (exe->doomsday_clock) return;
|
||||
exe->doomsday_clock = efl_add(EFL_LOOP_TIMER_CLASS, obj,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_ecore_exe_make_sure_its_dead,
|
||||
obj),
|
||||
efl_loop_timer_interval_set(efl_added, 10.0));
|
||||
|
|
|
@ -447,7 +447,7 @@ _ecore_signal_waitpid(Eina_Bool once, siginfo_t info)
|
|||
efl_add(EFL_LOOP_TIMER_CLASS, ML_OBJ,
|
||||
efl_loop_timer_interval_set(efl_added, 0.1),
|
||||
efl_event_callback_add
|
||||
(efl_added, EFL_LOOP_TIMER_EVENT_TICK,
|
||||
(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_ecore_signal_exe_exit_delay, e));
|
||||
_ecore_exe_doomsday_clock_set(e->exe, doomsday_clock);
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ _check_timer_event_catcher_add(void *data, const Efl_Event *event)
|
|||
|
||||
for (i = 0; array[i].desc != NULL; i++)
|
||||
{
|
||||
if (array[i].desc == EFL_LOOP_TIMER_EVENT_TICK)
|
||||
if (array[i].desc == EFL_LOOP_TIMER_EVENT_TIMER_TICK)
|
||||
{
|
||||
if (timer->listening++ > 0) return;
|
||||
_efl_loop_timer_util_instanciate(timer->loop_data, timer);
|
||||
|
@ -99,7 +99,7 @@ _check_timer_event_catcher_del(void *data, const Efl_Event *event)
|
|||
|
||||
for (i = 0; array[i].desc != NULL; i++)
|
||||
{
|
||||
if (array[i].desc == EFL_LOOP_TIMER_EVENT_TICK)
|
||||
if (array[i].desc == EFL_LOOP_TIMER_EVENT_TIMER_TICK)
|
||||
{
|
||||
if ((--timer->listening) > 0) return;
|
||||
_efl_loop_timer_util_instanciate(timer->loop_data, timer);
|
||||
|
@ -164,7 +164,7 @@ _ecore_timer_legacy_tick(void *data, const Efl_Event *event)
|
|||
}
|
||||
|
||||
EFL_CALLBACKS_ARRAY_DEFINE(legacy_timer,
|
||||
{ EFL_LOOP_TIMER_EVENT_TICK, _ecore_timer_legacy_tick },
|
||||
{ EFL_LOOP_TIMER_EVENT_TIMER_TICK, _ecore_timer_legacy_tick },
|
||||
{ EFL_EVENT_DEL, _ecore_timer_legacy_del });
|
||||
|
||||
EAPI Ecore_Timer *
|
||||
|
@ -240,26 +240,26 @@ ecore_timer_del(Ecore_Timer *timer)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_loop_timer_interval_set(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer, double in)
|
||||
_efl_loop_timer_timer_interval_set(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer, double in)
|
||||
{
|
||||
if (in < 0.0) in = 0.0;
|
||||
timer->in = in;
|
||||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_loop_timer_interval_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
_efl_loop_timer_timer_interval_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
{
|
||||
return timer->in;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_loop_timer_delay(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *pd, double add)
|
||||
_efl_loop_timer_timer_delay(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *pd, double add)
|
||||
{
|
||||
_efl_loop_timer_util_delay(pd, add);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_loop_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
_efl_loop_timer_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
{
|
||||
double now, add;
|
||||
|
||||
|
@ -280,7 +280,7 @@ _efl_loop_timer_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_loop_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
_efl_loop_timer_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
{
|
||||
double now, add;
|
||||
|
||||
|
@ -301,7 +301,7 @@ _efl_loop_timer_loop_reset(Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
|||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_loop_timer_pending_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
_efl_loop_timer_time_pending_get(const Eo *obj EINA_UNUSED, Efl_Loop_Timer_Data *timer)
|
||||
{
|
||||
double now, ret = 0.0;
|
||||
|
||||
|
@ -639,7 +639,7 @@ _efl_loop_timer_expired_call(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, double when
|
|||
|
||||
efl_ref(timer->object);
|
||||
eina_evlog("+timer", timer, 0.0, NULL);
|
||||
efl_event_callback_call(timer->object, EFL_LOOP_TIMER_EVENT_TICK, NULL);
|
||||
efl_event_callback_call(timer->object, EFL_LOOP_TIMER_EVENT_TIMER_TICK, NULL);
|
||||
eina_evlog("-timer", timer, 0.0, NULL);
|
||||
|
||||
// may have changed in recursive main loops
|
||||
|
|
|
@ -192,7 +192,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
|
|||
pd->poll_high = efl_add
|
||||
(EFL_LOOP_TIMER_CLASS, event->object,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_poll_trigger,
|
||||
EFL_LOOP_EVENT_POLL_HIGH),
|
||||
efl_loop_timer_interval_set(efl_added, 1.0 / 60.0));
|
||||
|
@ -206,7 +206,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
|
|||
pd->poll_medium = efl_add
|
||||
(EFL_LOOP_TIMER_CLASS, event->object,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_poll_trigger,
|
||||
EFL_LOOP_EVENT_POLL_MEDIUM),
|
||||
efl_loop_timer_interval_set(efl_added, 6));
|
||||
|
@ -220,7 +220,7 @@ _check_event_catcher_add(void *data, const Efl_Event *event)
|
|||
pd->poll_low = efl_add
|
||||
(EFL_LOOP_TIMER_CLASS, event->object,
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_poll_trigger,
|
||||
EFL_LOOP_EVENT_POLL_LOW),
|
||||
efl_loop_timer_interval_set(efl_added, 66));
|
||||
|
@ -493,7 +493,7 @@ _efl_loop_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double tim)
|
|||
d->timer = efl_add(EFL_LOOP_TIMER_CLASS, obj,
|
||||
efl_loop_timer_interval_set(efl_added, tim),
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_LOOP_TIMER_EVENT_TICK,
|
||||
EFL_LOOP_TIMER_EVENT_TIMER_TICK,
|
||||
_efl_loop_timeout_done, d),
|
||||
efl_event_callback_add(efl_added,
|
||||
EFL_EVENT_DEL,
|
||||
|
|
|
@ -10,7 +10,7 @@ class @beta Efl.Loop_Timer extends Efl.Loop_Consumer
|
|||
The @Efl.Object.event_freeze and @Efl.Object.event_thaw calls are used to pause and unpause the timer.
|
||||
]]
|
||||
methods {
|
||||
@property interval {
|
||||
@property timer_interval {
|
||||
[[Interval the timer ticks on.]]
|
||||
set {
|
||||
[[If set during a timer call this will affect the next interval.]]
|
||||
|
@ -21,13 +21,13 @@ class @beta Efl.Loop_Timer extends Efl.Loop_Consumer
|
|||
in: double(-1.0); [[The new interval in seconds]]
|
||||
}
|
||||
}
|
||||
@property pending {
|
||||
@property time_pending {
|
||||
[[Pending time regarding a timer.]]
|
||||
get {
|
||||
return: double; [[Pending time]]
|
||||
}
|
||||
}
|
||||
reset {
|
||||
timer_reset {
|
||||
[[Resets a timer to its full interval. This effectively makes the
|
||||
timer start ticking off from zero now.
|
||||
|
||||
|
@ -36,12 +36,12 @@ class @beta Efl.Loop_Timer extends Efl.Loop_Consumer
|
|||
@since 1.2
|
||||
]]
|
||||
}
|
||||
loop_reset {
|
||||
timer_loop_reset {
|
||||
[[This effectively resets a timer but based on the time when this iteration of the main loop started.
|
||||
@since 1.18
|
||||
]]
|
||||
}
|
||||
delay {
|
||||
timer_delay {
|
||||
[[Adds a delay to the next occurrence of a timer.
|
||||
This doesn't affect the timer interval.
|
||||
]]
|
||||
|
@ -51,10 +51,10 @@ class @beta Efl.Loop_Timer extends Efl.Loop_Consumer
|
|||
}
|
||||
}
|
||||
events {
|
||||
tick: void; [[Event triggered when the specified time as passed.]]
|
||||
timer,tick: void; [[Event triggered when the specified time as passed.]]
|
||||
}
|
||||
constructors {
|
||||
.interval;
|
||||
.timer_interval;
|
||||
}
|
||||
implements {
|
||||
Efl.Object.constructor;
|
||||
|
|
|
@ -14,7 +14,7 @@ ecore_timer_interval_get(const Efl_Loop_Timer *obj)
|
|||
EAPI double
|
||||
ecore_timer_pending_get(const Efl_Loop_Timer *obj)
|
||||
{
|
||||
return efl_loop_timer_pending_get(obj);
|
||||
return efl_loop_timer_time_pending_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -369,7 +369,7 @@ _efl_net_dialer_http_curlm_timer_schedule(CURLM *multi EINA_UNUSED, long timeout
|
|||
{
|
||||
cm->timer = efl_add(EFL_LOOP_TIMER_CLASS, cm->loop,
|
||||
efl_loop_timer_interval_set(efl_added, seconds),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _efl_net_dialer_http_curlm_timer_do, cm));
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _efl_net_dialer_http_curlm_timer_do, cm));
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(cm->timer, -1);
|
||||
}
|
||||
|
||||
|
|
|
@ -413,7 +413,7 @@ class TestEolianEvent(unittest.TestCase):
|
|||
ev = cls.event_by_name_get('tick')
|
||||
self.assertIsInstance(ev, eolian.Event)
|
||||
self.assertEqual(ev.name, 'tick')
|
||||
self.assertEqual(ev.c_name, 'EFL_LOOP_TIMER_EVENT_TICK')
|
||||
self.assertEqual(ev.c_name, 'EFL_LOOP_TIMER_EVENT_TIMER_TICK')
|
||||
self.assertIsNone(ev.type) # TODO is this correct
|
||||
self.assertIsInstance(ev.documentation, eolian.Documentation)
|
||||
self.assertEqual(ev.scope, eolian.Eolian_Object_Scope.PUBLIC)
|
||||
|
|
|
@ -79,11 +79,11 @@ EFL_START_TEST(efl_app_test_efl_loop_concentric)
|
|||
efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE_ENTER, loop_idle_enter, NULL);
|
||||
timer = efl_add(EFL_LOOP_TIMER_CLASS, loop2,
|
||||
efl_loop_timer_interval_set(efl_added, 0.01),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, loop_timer_tick, loop)
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, loop_timer_tick, loop)
|
||||
);
|
||||
timer2 = efl_add(EFL_LOOP_TIMER_CLASS, loop,
|
||||
efl_loop_timer_interval_set(efl_added, 0.5),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, efl_app_test_efl_loop_concentric_fail, NULL)
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, efl_app_test_efl_loop_concentric_fail, NULL)
|
||||
);
|
||||
exitcode = efl_loop_exit_code_process(efl_loop_begin(loop));
|
||||
ck_assert_int_eq(exitcode, 0);
|
||||
|
|
|
@ -47,7 +47,7 @@ EFL_START_TEST(ecore_test_timer_lifecycle)
|
|||
efl_event_callback_add((Eo*) t, EFL_EVENT_DEL, _test_death_cb, &dl);
|
||||
|
||||
et = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _test_run_cb, &re),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _test_run_cb, &re),
|
||||
efl_event_callback_add(efl_added, EFL_EVENT_DEL, _test_death_cb, &de),
|
||||
efl_loop_timer_interval_set(efl_added, 1.0));
|
||||
efl_ref(et);
|
||||
|
|
|
@ -176,7 +176,7 @@ _future_get(PromiseCtx *ctx, double timeout)
|
|||
f = eina_future_new(ctx->p);
|
||||
fail_if(!f);
|
||||
ctx->t = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _simple_timeout, ctx),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _simple_timeout, ctx),
|
||||
efl_loop_timer_interval_set(efl_added, timeout));
|
||||
fail_if(!ctx->t);
|
||||
return f;
|
||||
|
|
|
@ -298,7 +298,7 @@ EFL_START_TEST(efl_ui_grid_scroll)
|
|||
item = efl_pack_content_get(grid, 50);
|
||||
|
||||
timer = efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, grid_timer_cb, NULL),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, grid_timer_cb, NULL),
|
||||
efl_loop_timer_loop_reset(efl_added),
|
||||
efl_loop_timer_interval_set(efl_added, 3.0));
|
||||
|
||||
|
|
|
@ -187,7 +187,7 @@ _elm_suite_win_create()
|
|||
timer = efl_add(EFL_LOOP_TIMER_CLASS, loop,
|
||||
efl_loop_timer_interval_set(efl_added, BUFFER_RENDER_INTERVAL),
|
||||
efl_event_freeze(efl_added),
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TICK, _win_manual_render, win)
|
||||
efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _win_manual_render, win)
|
||||
);
|
||||
evas_object_data_set(win, "timer", timer);
|
||||
ecore_evas_manual_render_set(ecore_evas_ecore_evas_get(evas_object_evas_get(win)), EINA_TRUE);
|
||||
|
|
Loading…
Reference in New Issue