summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_vg_container.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-06-05 10:54:13 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-21 16:40:31 +0200
commitd595324a8dbccabf80d13d8f22e59c6166b4c2b6 (patch)
tree34159a6dab956ca255443bc986196cf60a2e8c2c /src/lib/evas/canvas/evas_vg_container.c
parentc73ccef4a753bc29e3d6589a38d1e65f462183fd (diff)
evas: add an unique name for each Efl.VG.Base object and make it possible to find it from parent.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_container.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index f3ee7c9..e311260 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -31,6 +31,8 @@ _efl_vg_container_eo_base_constructor(Eo *obj,
31{ 31{
32 Efl_VG_Base_Data *nd; 32 Efl_VG_Base_Data *nd;
33 33
34 pd->names = eina_hash_stringshared_new(NULL);
35
34 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor()); 36 obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
35 37
36 nd = eo_data_scope_get(obj, EFL_VG_BASE_CLASS); 38 nd = eo_data_scope_get(obj, EFL_VG_BASE_CLASS);
@@ -45,6 +47,9 @@ _efl_vg_container_eo_base_destructor(Eo *obj,
45 Efl_VG_Container_Data *pd EINA_UNUSED) 47 Efl_VG_Container_Data *pd EINA_UNUSED)
46{ 48{
47 eo_do_super(obj, MY_CLASS, eo_destructor()); 49 eo_do_super(obj, MY_CLASS, eo_destructor());
50
51 eina_hash_free(pd->names);
52 pd->names = NULL;
48} 53}
49 54
50static void 55static void
@@ -74,6 +79,24 @@ _efl_vg_container_efl_vg_base_bounds_get(Eo *obj EINA_UNUSED,
74 } 79 }
75} 80}
76 81
82static Efl_VG_Base *
83_efl_vg_container_child_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd, const char *name)
84{
85 const char *tmp = eina_stringshare_add(name);
86 Efl_VG_Base *r;
87
88 r = eina_hash_find(pd->names, tmp);
89 eina_stringshare_del(tmp);
90
91 return r;
92}
93
94static Eina_Iterator *
95_efl_vg_container_children_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd)
96{
97 return eina_list_iterator_new(pd->children);
98}
99
77EAPI Efl_VG* 100EAPI Efl_VG*
78evas_vg_container_add(Efl_VG *parent) 101evas_vg_container_add(Efl_VG *parent)
79{ 102{