aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_vg_container.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-06-16 16:28:19 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-08-21 16:40:31 +0200
commit7cb92ff35d3e49c53368b6fe4ade1d2a732018fc (patch)
tree90628a6c6b4e62f507a78ad7a4d8b1e754a453b8 /src/lib/evas/canvas/evas_vg_container.c
parentevas: add an unique name for each Efl.VG.Base object and make it possible to ... (diff)
downloadefl-7cb92ff35d3e49c53368b6fe4ade1d2a732018fc.tar.gz
evas: add support for interpolating Efl_VG_Node tree.
Diffstat (limited to 'src/lib/evas/canvas/evas_vg_container.c')
-rw-r--r--src/lib/evas/canvas/evas_vg_container.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/evas_vg_container.c b/src/lib/evas/canvas/evas_vg_container.c
index e31126015b..683f5ce152 100644
--- a/src/lib/evas/canvas/evas_vg_container.c
+++ b/src/lib/evas/canvas/evas_vg_container.c
@@ -97,6 +97,44 @@ _efl_vg_container_children_get(Eo *obj EINA_UNUSED, Efl_VG_Container_Data *pd)
return eina_list_iterator_new(pd->children);
}
+static Eina_Bool
+_efl_vg_container_efl_vg_base_interpolate(Eo *obj,
+ Efl_VG_Container_Data *pd,
+ const Efl_VG_Base *from, const Efl_VG_Base *to,
+ double pos_map)
+{
+ Efl_VG_Container_Data *fd;
+ Efl_VG_Container_Data *td;
+ Eina_Iterator *it;
+ Eina_Hash_Tuple *tuple;
+ Eina_Bool r;
+
+ eo_do_super(obj, EFL_VG_CONTAINER_CLASS, r = efl_vg_interpolate(from, to, pos_map));
+
+ if (!r) return EINA_FALSE;
+
+ fd = eo_data_scope_get(from, EFL_VG_CONTAINER_CLASS);
+ td = eo_data_scope_get(to, EFL_VG_CONTAINER_CLASS);
+
+ it = eina_hash_iterator_tuple_new(pd->names);
+ EINA_ITERATOR_FOREACH(it, tuple)
+ {
+ Eo *fromc, *toc;
+ Eo *cc = tuple->data;
+
+ fromc = eina_hash_find(fd->names, tuple->key);
+ toc = eina_hash_find(td->names, tuple->key);
+
+ if (!toc || !fromc) continue ;
+ if (eo_class_get(toc) != eo_class_get(fromc)) continue ;
+
+ eo_do(cc, r &= efl_vg_interpolate(fromc, toc, pos_map));
+ }
+ eina_iterator_free(it);
+
+ return r;
+}
+
EAPI Efl_VG*
evas_vg_container_add(Efl_VG *parent)
{