summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2019-04-18 16:15:16 -0700
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-21 11:36:45 +0200
commitef4dde48a035006b9d4dcd083eca836402bc5735 (patch)
tree6aafb7b53ba712537ac1f5ac7d077eee5382f072 /src/lib/ecore
parent0bd3ab825281bffcd9a91a0f1a14835287a21f99 (diff)
ecore: implement reflection for Efl.LoopModel properties.
This enable relying on Eo reflection capabilities to expose Efl.Model properties. Should make API nicer to maintain. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D8652
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_loop_model.c27
-rw-r--r--src/lib/ecore/efl_loop_model.eo1
2 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/ecore/efl_loop_model.c b/src/lib/ecore/efl_loop_model.c
index 0f212f1283..48309a5102 100644
--- a/src/lib/ecore/efl_loop_model.c
+++ b/src/lib/ecore/efl_loop_model.c
@@ -125,6 +125,33 @@ _efl_loop_model_volatile_make(Eo *obj, void *pd EINA_UNUSED)
125 efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref_death, NULL); 125 efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref_death, NULL);
126} 126}
127 127
128static Eina_Future *
129_efl_loop_model_efl_model_property_set(Eo *obj, void *pd EINA_UNUSED,
130 const char *property, Eina_Value *value)
131{
132 Eina_Error err;
133
134 if (!value) return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE);
135 err = efl_property_reflection_set(obj, property, *value);
136 if (err) return efl_loop_future_rejected(obj, err);
137
138 return efl_loop_future_resolved(obj, efl_property_reflection_get(obj, property));
139}
140
141static Eina_Value *
142_efl_loop_model_efl_model_property_get(const Eo *obj, void *pd EINA_UNUSED,
143 const char *property)
144{
145 Eina_Value *r;
146 Eina_Value direct;
147
148 direct = efl_property_reflection_get(obj, property);
149 r = eina_value_dup(&direct);
150 eina_value_flush(&direct);
151
152 return r;
153}
154
128static void 155static void
129_efl_loop_model_efl_object_invalidate(Eo *obj, void *pd EINA_UNUSED) 156_efl_loop_model_efl_object_invalidate(Eo *obj, void *pd EINA_UNUSED)
130{ 157{
diff --git a/src/lib/ecore/efl_loop_model.eo b/src/lib/ecore/efl_loop_model.eo
index 362b8bff09..7d727efbc3 100644
--- a/src/lib/ecore/efl_loop_model.eo
+++ b/src/lib/ecore/efl_loop_model.eo
@@ -14,5 +14,6 @@ abstract @beta Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model
14 implements { 14 implements {
15 Efl.Object.invalidate; 15 Efl.Object.invalidate;
16 Efl.Model.property_ready_get; 16 Efl.Model.property_ready_get;
17 Efl.Model.property { get; set; }
17 } 18 }
18} 19}