summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2018-11-23 16:25:19 +0000
committerCedric BAIL <cedric@osg.samsung.com>2018-11-23 10:13:58 -0800
commitd4d44d76f3efef4d61edb4cce7152284915a12d2 (patch)
tree502779c9047c6a8e02c8466f81ddc8616887fa50 /src/lib/ecore
parentaac7d099a17d69f5989481f8999a43d4173005bd (diff)
efl: make Efl.Model.properties_get return an Iterator<string>.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D7289
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/efl_model_composite.c2
-rw-r--r--src/lib/ecore/efl_model_composite_boolean.c19
-rw-r--r--src/lib/ecore/efl_model_container.c14
-rw-r--r--src/lib/ecore/efl_model_container_item.c2
-rw-r--r--src/lib/ecore/efl_model_item.c8
5 files changed, 14 insertions, 31 deletions
diff --git a/src/lib/ecore/efl_model_composite.c b/src/lib/ecore/efl_model_composite.c
index 90cd8adc84..dfb3019cbd 100644
--- a/src/lib/ecore/efl_model_composite.c
+++ b/src/lib/ecore/efl_model_composite.c
@@ -69,7 +69,7 @@ _efl_model_composite_efl_model_property_get(const Eo *obj EINA_UNUSED, Efl_Model
69 return efl_model_property_get(pd->source, property); 69 return efl_model_property_get(pd->source, property);
70} 70}
71 71
72static Eina_Array * 72static Eina_Iterator *
73_efl_model_composite_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd) 73_efl_model_composite_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Composite_Data *pd)
74{ 74{
75 return efl_model_properties_get(pd->source); 75 return efl_model_properties_get(pd->source);
diff --git a/src/lib/ecore/efl_model_composite_boolean.c b/src/lib/ecore/efl_model_composite_boolean.c
index 98dbbe5bb1..ef9ec433a5 100644
--- a/src/lib/ecore/efl_model_composite_boolean.c
+++ b/src/lib/ecore/efl_model_composite_boolean.c
@@ -67,23 +67,20 @@ _efl_model_composite_boolean_children_efl_object_finalize(Eo *obj,
67 return obj; 67 return obj;
68} 68}
69 69
70static Eina_Array * 70static Eina_Iterator *
71_efl_model_composite_boolean_children_efl_model_properties_get(const Eo *obj, 71_efl_model_composite_boolean_children_efl_model_properties_get(const Eo *obj,
72 Efl_Model_Composite_Boolean_Children_Data *pd) 72 Efl_Model_Composite_Boolean_Children_Data *pd)
73{ 73{
74 Eina_Iterator *it; 74 Eina_Iterator *its;
75 Eina_Stringshare *s; 75 Eina_Iterator *itr;
76 Eina_Array *r;
77 76
78 r = efl_model_properties_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS)); 77 its = efl_model_properties_get(efl_super(obj, EFL_MODEL_COMPOSITE_BOOLEAN_CHILDREN_CLASS));
79 if (!r) r = eina_array_new(1); 78 itr = eina_hash_iterator_key_new(pd->parent->values);
80 79
81 it = eina_hash_iterator_key_new(pd->parent->values); 80 if (!its) return itr;
82 EINA_ITERATOR_FOREACH(it, s) 81 if (!itr) return its;
83 eina_array_push(r, s);
84 eina_array_push(r, "child.index");
85 82
86 return r; 83 return eina_multi_iterator_new(its, itr);
87} 84}
88 85
89static Eina_Value * 86static Eina_Value *
diff --git a/src/lib/ecore/efl_model_container.c b/src/lib/ecore/efl_model_container.c
index 0832a2f0dc..5449ae4307 100644
--- a/src/lib/ecore/efl_model_container.c
+++ b/src/lib/ecore/efl_model_container.c
@@ -225,20 +225,10 @@ _efl_model_container_child_property_add(Eo *obj,
225 return EINA_FALSE; 225 return EINA_FALSE;
226} 226}
227 227
228static Eina_Array * 228static Eina_Iterator *
229_efl_model_container_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd) 229_efl_model_container_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Data *sd)
230{ 230{
231 Eina_Iterator *it; 231 return eina_hash_iterator_key_new(sd->properties);
232 Eina_Array *r;
233 Eina_Stringshare *s;
234
235 r = eina_array_new(1);
236 it = eina_hash_iterator_key_new(sd->properties);
237 EINA_ITERATOR_FOREACH(it, s)
238 eina_array_push(r, eina_stringshare_ref(s));
239 eina_iterator_free(it);
240
241 return r;
242} 232}
243 233
244static Eina_Future * 234static Eina_Future *
diff --git a/src/lib/ecore/efl_model_container_item.c b/src/lib/ecore/efl_model_container_item.c
index b87558a3b3..c3fa8d0c90 100644
--- a/src/lib/ecore/efl_model_container_item.c
+++ b/src/lib/ecore/efl_model_container_item.c
@@ -25,7 +25,7 @@ _efl_model_container_item_efl_object_invalidate(Eo *obj, Efl_Model_Container_Ite
25 sd->index = 0; 25 sd->index = 0;
26} 26}
27 27
28static Eina_Array * 28static Eina_Iterator *
29_efl_model_container_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd) 29_efl_model_container_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Container_Item_Data *sd)
30{ 30{
31 // FIXME: Not to sure here, shouldn't we extend a child of the parent actually ? 31 // FIXME: Not to sure here, shouldn't we extend a child of the parent actually ?
diff --git a/src/lib/ecore/efl_model_item.c b/src/lib/ecore/efl_model_item.c
index e5058c10ff..104125a705 100644
--- a/src/lib/ecore/efl_model_item.c
+++ b/src/lib/ecore/efl_model_item.c
@@ -13,7 +13,6 @@ typedef struct _Efl_Model_Item_Data Efl_Model_Item_Data;
13struct _Efl_Model_Item_Data 13struct _Efl_Model_Item_Data
14{ 14{
15 Eina_Hash *properties; 15 Eina_Hash *properties;
16 Eina_Array *defined_properties;
17 Eina_List *childrens; 16 Eina_List *childrens;
18}; 17};
19 18
@@ -38,7 +37,6 @@ _efl_model_item_efl_object_constructor(Eo *obj, Efl_Model_Item_Data *sd)
38 return NULL; 37 return NULL;
39 38
40 sd->properties = eina_hash_stringshared_new(_item_value_free_cb); 39 sd->properties = eina_hash_stringshared_new(_item_value_free_cb);
41 sd->defined_properties = eina_array_new(8);
42 40
43 return obj; 41 return obj;
44} 42}
@@ -57,15 +55,13 @@ _efl_model_item_efl_object_destructor(Eo *obj, Efl_Model_Item_Data *sd)
57 eina_hash_foreach(sd->properties, _stringshared_keys_free, NULL); 55 eina_hash_foreach(sd->properties, _stringshared_keys_free, NULL);
58 eina_hash_free(sd->properties); 56 eina_hash_free(sd->properties);
59 57
60 eina_array_free(sd->defined_properties);
61
62 efl_destructor(efl_super(obj, MY_CLASS)); 58 efl_destructor(efl_super(obj, MY_CLASS));
63} 59}
64 60
65static Eina_Array * 61static Eina_Iterator *
66_efl_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd) 62_efl_model_item_efl_model_properties_get(const Eo *obj EINA_UNUSED, Efl_Model_Item_Data *pd)
67{ 63{
68 return pd->defined_properties; 64 return eina_hash_iterator_key_new(pd->properties);
69} 65}
70 66
71static Eina_Future * 67static Eina_Future *