aboutsummaryrefslogtreecommitdiffstats
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
parentEvil: fix compilation when MSVC is not available. (diff)
downloadefl-d595324a8dbccabf80d13d8f22e59c6166b4c2b6.tar.gz
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 f3ee7c9962..e31126015b 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,
{
Efl_VG_Base_Data *nd;
+ pd->names = eina_hash_stringshared_new(NULL);
+
obj = eo_do_super_ret(obj, MY_CLASS, obj, eo_constructor());
nd = eo_data_scope_get(obj, EFL_VG_BASE_CLASS);
@@ -45,6 +47,9 @@ _efl_vg_container_eo_base_destructor(Eo *obj,
Efl_VG_Container_Data *pd EINA_UNUSED)
{
eo_do_super(obj, MY_CLASS, eo_destructor());
+
+ eina_hash_free(pd->names);
+ pd->names = NULL;
}
static void
@@ -74,6 +79,24 @@ _efl_vg_container_efl_vg_base_bounds_get(Eo *obj EINA_UNUSED,
}
}
+static Efl_VG_Base *
+_efl_vg_container_child_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd, const char *name)
+{
+ const char *tmp = eina_stringshare_add(name);
+ Efl_VG_Base *r;
+
+ r = eina_hash_find(pd->names, tmp);
+ eina_stringshare_del(tmp);
+
+ return r;
+}
+
+static Eina_Iterator *
+_efl_vg_container_children_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd)
+{
+ return eina_list_iterator_new(pd->children);
+}
+
EAPI Efl_VG*
evas_vg_container_add(Efl_VG *parent)
{