diff options
author | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-12-03 16:00:29 +0100 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2019-12-04 10:29:55 +0100 |
commit | 8daaab65fa24f95cdb1a67ea812f9cec1977bb8a (patch) | |
tree | cdce8e0a71b932fdb3c11b05486b00be566826a3 | |
parent | 8cb0b193ea043bbd0d2a2162fa25f82aafaa50cd (diff) | |
download | efl-8daaab65fa24f95cdb1a67ea812f9cec1977bb8a.tar.gz |
efl_canvas_animation_group: move from list to iterator
we should not use lists directly, ownership issues etc. etc..
This moves it to iterators
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D10787
4 files changed, 17 insertions, 17 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.c b/src/lib/evas/canvas/efl_canvas_animation_group.c index ab88743a26..8673efd01e 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group.c +++ b/src/lib/evas/canvas/efl_canvas_animation_group.c @@ -41,11 +41,11 @@ _efl_canvas_animation_group_animation_del(Eo *eo_obj EINA_UNUSED, } } -EOLIAN static Eina_List * +EOLIAN static Eina_Iterator* _efl_canvas_animation_group_animations_get(const Eo *eo_obj EINA_UNUSED, Efl_Canvas_Animation_Group_Data *pd) { - return pd->animations; + return eina_list_iterator_new(pd->animations); } EOLIAN static void diff --git a/src/lib/evas/canvas/efl_canvas_animation_group.eo b/src/lib/evas/canvas/efl_canvas_animation_group.eo index f9cada25a7..07daa8f554 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group.eo +++ b/src/lib/evas/canvas/efl_canvas_animation_group.eo @@ -23,7 +23,7 @@ abstract @beta Efl.Canvas.Animation_Group extends Efl.Canvas.Animation } animations_get @const { [[Gets the list of animations currently in the animation group.]] - return: list<Efl.Canvas.Animation>; [[List of animations in the group.]] + return: iterator<Efl.Canvas.Animation> @move; [[List of animations in the group.]] } } implements { diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c index 4ec979caff..9960e4105e 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c +++ b/src/lib/evas/canvas/efl_canvas_animation_group_parallel.c @@ -13,15 +13,14 @@ _efl_canvas_animation_group_parallel_efl_canvas_animation_animation_apply(Eo *eo int anim_repeated_count; progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target); - Eina_List *group_anim = efl_animation_group_animations_get(eo_obj); + Eina_Iterator *group_anim = efl_animation_group_animations_get(eo_obj); if (!group_anim) return progress; group_length = efl_playable_length_get(eo_obj); group_elapsed_time = group_length * progress; - Eina_List *l; Efl_Canvas_Animation *anim; - EINA_LIST_FOREACH(group_anim, l, anim) + EINA_ITERATOR_FOREACH(group_anim, anim) { anim_length = efl_playable_length_get(anim); anim_duration = efl_animation_duration_get(anim); @@ -48,6 +47,7 @@ _efl_canvas_animation_group_parallel_efl_canvas_animation_animation_apply(Eo *eo efl_animation_apply(anim, anim_progress, target); } + eina_iterator_free(group_anim); return progress; } @@ -58,18 +58,18 @@ _efl_canvas_animation_group_parallel_efl_canvas_animation_duration_get(const Eo double child_total_duration; double total_duration = 0.0; - Eina_List *animations = efl_animation_group_animations_get(eo_obj); - if (!animations) return 0.0; + Eina_Iterator *group_anim = efl_animation_group_animations_get(eo_obj); + if (!group_anim) return 0.0; - Eina_List *l; Efl_Canvas_Animation *anim; - EINA_LIST_FOREACH(animations, l, anim) + EINA_ITERATOR_FOREACH(group_anim, anim) { child_total_duration = efl_playable_length_get(anim); child_total_duration += efl_animation_start_delay_get(anim); if (child_total_duration > total_duration) total_duration = child_total_duration; } + eina_iterator_free(group_anim); return total_duration; } diff --git a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c index 2a83fc4431..26edb21355 100644 --- a/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c +++ b/src/lib/evas/canvas/efl_canvas_animation_group_sequential.c @@ -15,15 +15,14 @@ _efl_canvas_animation_group_sequential_efl_canvas_animation_animation_apply(Eo * int anim_repeated_count; progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target); - Eina_List *group_anim = efl_animation_group_animations_get(eo_obj); + Eina_Iterator *group_anim = efl_animation_group_animations_get(eo_obj); if (!group_anim) return progress; group_length = efl_playable_length_get(eo_obj); group_elapsed_time = group_length * progress; - Eina_List *l; Efl_Canvas_Animation *anim; - EINA_LIST_FOREACH(group_anim, l, anim) + EINA_ITERATOR_FOREACH(group_anim, anim) { anim_start_delay = efl_animation_start_delay_get(anim); anim_length = efl_playable_length_get(anim) + anim_start_delay; @@ -53,6 +52,7 @@ _efl_canvas_animation_group_sequential_efl_canvas_animation_animation_apply(Eo * break; } + eina_iterator_free(group_anim); return progress; } @@ -63,17 +63,17 @@ _efl_canvas_animation_group_sequential_efl_canvas_animation_duration_get(const E double total_duration = 0.0; double child_total_duration; - Eina_List *animations = efl_animation_group_animations_get(eo_obj); - if (!animations) return 0.0; + Eina_Iterator *group_anim = efl_animation_group_animations_get(eo_obj); + if (!group_anim) return 0.0; - Eina_List *l; Efl_Canvas_Animation *anim; - EINA_LIST_FOREACH(animations, l, anim) + EINA_ITERATOR_FOREACH(group_anim, anim) { child_total_duration = efl_playable_length_get(anim); child_total_duration += efl_animation_start_delay_get(anim); total_duration += child_total_duration; } + eina_iterator_free(group_anim); return total_duration; } |