From d0518f73253f8da27c8335fabb642a477434055d Mon Sep 17 00:00:00 2001 From: Cedric Bail Date: Sun, 3 Dec 2017 16:20:20 -0800 Subject: [PATCH] ecore: remove efl_loop_timeout. --- src/lib/ecore/ecore_main.c | 58 -------------------------------------- src/lib/ecore/efl_loop.eo | 8 ------ 2 files changed, 66 deletions(-) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index c5544e4fe7..be6ef32c19 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -3172,9 +3172,6 @@ ecore_loop_arguments_send(int argc, const char **argv) efl_future_then(job, _efl_loop_arguments_send, _efl_loop_arguments_cancel, NULL, arga); } -static void _efl_loop_timeout_force_cancel_cb(void *data, const Efl_Event *event EINA_UNUSED); -static void _efl_loop_timeout_cb(void *data, const Efl_Event *event EINA_UNUSED); - // Only one main loop handle for now void ecore_loop_future_register(Efl_Loop *l EINA_UNUSED, Efl_Future *f) @@ -3200,10 +3197,6 @@ ecore_loop_promise_unregister(Efl_Loop *l EINA_UNUSED, Efl_Promise *p) _pending_promises = eina_list_remove(_pending_promises, p); } -EFL_CALLBACKS_ARRAY_DEFINE(timeout, - { EFL_LOOP_TIMER_EVENT_TICK, _efl_loop_timeout_cb }, - { EFL_EVENT_DEL, _efl_loop_timeout_force_cancel_cb }); - static Eina_Future * _efl_loop_Eina_FutureXXX_job(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED) { @@ -3302,26 +3295,8 @@ _efl_loop_Eina_FutureXXX_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double /* This event will be triggered when the main loop is destroyed and destroy its timers along */ static void _efl_loop_internal_cancel(Efl_Internal_Promise *p); -static void -_efl_loop_timeout_force_cancel_cb(void *data, const Efl_Event *event EINA_UNUSED) -{ - _efl_loop_internal_cancel(data); -} - static void _efl_loop_job_cancel(void* data, const Efl_Event *ev EINA_UNUSED); -static void -_efl_loop_timeout_cb(void *data, const Efl_Event *event EINA_UNUSED) -{ - Efl_Internal_Promise *t = data; - - efl_promise_value_set(t->promise, (void*) t->data, NULL); - efl_del(t->promise); - - efl_event_callback_array_del(t->u.timer, timeout(), t); - efl_del(t->u.timer); -} - static void _efl_loop_internal_cancel(Efl_Internal_Promise *p) { @@ -3339,11 +3314,6 @@ _efl_loop_job_cancel(void* data, const Efl_Event *ev EINA_UNUSED) { ecore_job_del(j->u.job); } - else - { - efl_event_callback_array_del(j->u.timer, timeout(), j); - efl_del(j->u.timer); - } _efl_loop_internal_cancel(j); } @@ -3389,34 +3359,6 @@ _efl_loop_job(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, const void *data) return NULL; } -static Efl_Future * -_efl_loop_timeout(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, double time, const void *data) -{ - Efl_Internal_Promise *t; - Efl_Object *promise; - - promise = efl_add(EFL_PROMISE_CLASS, obj); - if (!promise) return NULL; - - t = _efl_internal_promise_new(promise, data); - if (!t) goto on_error; - - t->job_is = EINA_FALSE; - t->u.timer = efl_add(EFL_LOOP_TIMER_CLASS, obj, - efl_loop_timer_interval_set(efl_added, time), - efl_event_callback_array_add(efl_added, timeout(), t)); - - if (!t->u.timer) goto on_error; - - return efl_promise_future_get(promise); - - on_error: - efl_del(promise); - free(t); - - return NULL; -} - static Eina_Bool _efl_loop_register(Eo *obj EINA_UNUSED, Efl_Loop_Data *pd, const Efl_Class *klass, const Efl_Object *provider) { diff --git a/src/lib/ecore/efl_loop.eo b/src/lib/ecore/efl_loop.eo index 99fb734f94..f1aa491bce 100644 --- a/src/lib/ecore/efl_loop.eo +++ b/src/lib/ecore/efl_loop.eo @@ -102,14 +102,6 @@ class Efl.Loop (Efl.Object) } return: future; [[The promise that will be triggered.]] } - timeout { - [[Will trigger this promise when the specified timeout occur.]] - params { - @in time: double; [[The time from now in second that the main loop will wait before triggering it.]] - @in data: const(void_ptr) @optional; [[The data to be given when the promise is done.]] - } - return: future; [[The promise that will be triggered.]] - } register { [[Will register a manager of a specific class to be answered by eo.provider_find.]] params {