summaryrefslogtreecommitdiff
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
parentd595324a8dbccabf80d13d8f22e59c6166b4c2b6 (diff)
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 e311260..683f5ce 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)
97 return eina_list_iterator_new(pd->children); 97 return eina_list_iterator_new(pd->children);
98} 98}
99 99
100static Eina_Bool
101_efl_vg_container_efl_vg_base_interpolate(Eo *obj,
102 Efl_VG_Container_Data *pd,
103 const Efl_VG_Base *from, const Efl_VG_Base *to,
104 double pos_map)
105{
106 Efl_VG_Container_Data *fd;
107 Efl_VG_Container_Data *td;
108 Eina_Iterator *it;
109 Eina_Hash_Tuple *tuple;
110 Eina_Bool r;
111
112 eo_do_super(obj, EFL_VG_CONTAINER_CLASS, r = efl_vg_interpolate(from, to, pos_map));
113
114 if (!r) return EINA_FALSE;
115
116 fd = eo_data_scope_get(from, EFL_VG_CONTAINER_CLASS);
117 td = eo_data_scope_get(to, EFL_VG_CONTAINER_CLASS);
118
119 it = eina_hash_iterator_tuple_new(pd->names);
120 EINA_ITERATOR_FOREACH(it, tuple)
121 {
122 Eo *fromc, *toc;
123 Eo *cc = tuple->data;
124
125 fromc = eina_hash_find(fd->names, tuple->key);
126 toc = eina_hash_find(td->names, tuple->key);
127
128 if (!toc || !fromc) continue ;
129 if (eo_class_get(toc) != eo_class_get(fromc)) continue ;
130
131 eo_do(cc, r &= efl_vg_interpolate(fromc, toc, pos_map));
132 }
133 eina_iterator_free(it);
134
135 return r;
136}
137
100EAPI Efl_VG* 138EAPI Efl_VG*
101evas_vg_container_add(Efl_VG *parent) 139evas_vg_container_add(Efl_VG *parent)
102{ 140{