summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-11-22 17:11:54 -0800
committerCedric BAIL <cedric@osg.samsung.com>2018-11-30 14:58:14 -0800
commit31eab2cff96d5bca6dc27c4ad720c07ac8dbab4d (patch)
treeab3f77876440eb240c56bd919ba091b63895d803 /src/lib/ecore
parentcc801e2e2aa625d282e60073eba17faa750e1f3c (diff)
ecore: add an helper on Efl.Loop_Consumer to build resolved and rejected future more easily.
This make all object that inherit from Efl.Loop_Consumer have an easy ability to create a future from their link to a loop provider. This way there is no need to further lookup for a scheduler. This can by applied after the patch series from T7471. Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D7337
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_loop_consumer.c14
-rw-r--r--src/lib/ecore/efl_loop_consumer.eo12
2 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/ecore/efl_loop_consumer.c b/src/lib/ecore/efl_loop_consumer.c
index 795b5fcfd0..29e94ed52d 100644
--- a/src/lib/ecore/efl_loop_consumer.c
+++ b/src/lib/ecore/efl_loop_consumer.c
@@ -36,4 +36,18 @@ _efl_loop_consumer_efl_object_parent_set(Eo *obj, Efl_Loop_Consumer_Data *pd EIN
36 efl_parent_set(efl_super(obj, EFL_LOOP_CONSUMER_CLASS), parent); 36 efl_parent_set(efl_super(obj, EFL_LOOP_CONSUMER_CLASS), parent);
37} 37}
38 38
39static Eina_Future *
40_efl_loop_consumer_future_resolved(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED,
41 Eina_Value result)
42{
43 return eina_future_resolved(efl_loop_future_scheduler_get(obj), result);
44}
45
46static Eina_Future *
47_efl_loop_consumer_future_rejected(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED,
48 Eina_Error error)
49{
50 return eina_future_rejected(efl_loop_future_scheduler_get(obj), error);
51}
52
39#include "efl_loop_consumer.eo.c" 53#include "efl_loop_consumer.eo.c"
diff --git a/src/lib/ecore/efl_loop_consumer.eo b/src/lib/ecore/efl_loop_consumer.eo
index e486567ed5..4d7484e13c 100644
--- a/src/lib/ecore/efl_loop_consumer.eo
+++ b/src/lib/ecore/efl_loop_consumer.eo
@@ -14,6 +14,18 @@ class Efl.Loop_Consumer (Efl.Object)
14 loop: Efl.Loop; [[Efl loop]] 14 loop: Efl.Loop; [[Efl loop]]
15 } 15 }
16 } 16 }
17 future_resolved {
18 params {
19 result: any_value;
20 }
21 return: future<any_value>;
22 }
23 future_rejected {
24 params {
25 error: Eina.Error;
26 }
27 return: future<Eina.Error>;
28 }
17 } 29 }
18 implements { 30 implements {
19 Efl.Object.parent { set; } 31 Efl.Object.parent { set; }