jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e83facfb37dc22ead7d3c5c66c4dcaa33252dd61
commit e83facfb37dc22ead7d3c5c66c4dcaa33252dd61 Author: Jaehyun Cho <jae_hyun....@samsung.com> Date: Tue Sep 5 11:33:58 2017 +0900 efl_animation: Add repeat_mode property To not display original state when the reverse repeat starts, the animators in group parallel and group sequential are deleted. --- src/bin/elementary/test_efl_anim_repeat.c | 54 +++++++++++++++++++++- src/lib/evas/Evas_Internal.h | 9 ++++ src/lib/evas/canvas/efl_animation.c | 21 +++++++++ src/lib/evas/canvas/efl_animation.eo | 9 ++++ src/lib/evas/canvas/efl_animation_alpha.c | 4 ++ src/lib/evas/canvas/efl_animation_group_parallel.c | 4 ++ .../evas/canvas/efl_animation_group_sequential.c | 4 ++ src/lib/evas/canvas/efl_animation_object.c | 49 +++++++++++++++++++- .../canvas/efl_animation_object_group_parallel.c | 19 ++++++++ .../canvas/efl_animation_object_group_sequential.c | 23 ++++++++- src/lib/evas/canvas/efl_animation_object_private.h | 39 ++++++++-------- src/lib/evas/canvas/efl_animation_private.h | 15 +++--- src/lib/evas/canvas/efl_animation_rotate.c | 4 ++ src/lib/evas/canvas/efl_animation_scale.c | 4 ++ src/lib/evas/canvas/efl_animation_translate.c | 4 ++ src/lib/evas/canvas/efl_animation_types.eot | 8 ++++ 16 files changed, 241 insertions(+), 29 deletions(-) diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c index 912b239b2a..b5f7ac3ce1 100644 --- a/src/bin/elementary/test_efl_anim_repeat.c +++ b/src/bin/elementary/test_efl_anim_repeat.c @@ -9,11 +9,24 @@ typedef struct _App_Data Efl_Animation *hide_anim; Efl_Animation_Object *anim_obj; + Evas_Object *start_btn; Evas_Object *repeat_count_spin; + Evas_Object *repeat_mode_spin; Eina_Bool is_btn_visible; } App_Data; +Efl_Animation_Repeat_Mode +_anim_repeat_mode_get(Evas_Object *spinner) +{ + int value = elm_spinner_value_get(spinner); + + if (value == 0) + return EFL_ANIMATION_REPEAT_MODE_RESTART; + else + return EFL_ANIMATION_REPEAT_MODE_REVERSE; +} + static void _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { @@ -27,7 +40,23 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) printf("Animation has been ended!\n"); + Efl_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); + if (repeat_mode == EFL_ANIMATION_REPEAT_MODE_REVERSE) + { + int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); + if (repeat_count % 2 == 1) + { + ad->is_btn_visible = !(ad->is_btn_visible); + + if (ad->is_btn_visible) + elm_object_text_set(ad->start_btn, "Start Alpha Animation from 1.0 to 0.0"); + else + elm_object_text_set(ad->start_btn, "Start Alpha Animation from 0.0 to 1.0"); + } + } + elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE); + elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE); ad->anim_obj = NULL; } @@ -53,11 +82,17 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); elm_object_disabled_set(ad->repeat_count_spin, EINA_TRUE); + Efl_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); + elm_object_disabled_set(ad->repeat_mode_spin, EINA_TRUE); + if (ad->is_btn_visible) { //Set animation repeat count efl_animation_repeat_count_set(ad->show_anim, repeat_count); + //Set animation repeat mode + efl_animation_repeat_mode_set(ad->show_anim, repeat_mode); + //Create Animation Object from Animation ad->anim_obj = efl_animation_object_create(ad->show_anim); elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0"); @@ -67,6 +102,9 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED //Set animation repeat count efl_animation_repeat_count_set(ad->hide_anim, repeat_count); + //Set animation repeat mode + efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode); + //Create Animation Object from Animation ad->anim_obj = efl_animation_object_create(ad->hide_anim); elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0"); @@ -145,15 +183,29 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void evas_object_move(repeat_count_spin, 100, 350); evas_object_show(repeat_count_spin); + //Spinner to set animation repeat mode + Evas_Object *repeat_mode_spin = elm_spinner_add(win); + elm_spinner_label_format_set(repeat_mode_spin, "Repeat Mode: %s"); + elm_spinner_editable_set(repeat_mode_spin, EINA_FALSE); + elm_spinner_min_max_set(repeat_mode_spin, 0, 1); + elm_spinner_value_set(repeat_mode_spin, 0); + elm_spinner_special_value_add(repeat_mode_spin, 0, "Restart"); + elm_spinner_special_value_add(repeat_mode_spin, 1, "Reverse"); + evas_object_resize(repeat_mode_spin, 200, 50); + evas_object_move(repeat_mode_spin, 100, 400); + evas_object_show(repeat_mode_spin); + //Initialize App Data ad->show_anim = show_anim; ad->hide_anim = hide_anim; ad->anim_obj = NULL; + ad->start_btn = start_btn; ad->repeat_count_spin = repeat_count_spin; + ad->repeat_mode_spin = repeat_mode_spin; ad->is_btn_visible = EINA_TRUE; - evas_object_resize(win, 400, 450); + evas_object_resize(win, 400, 500); evas_object_show(win); } diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h index e57b60163c..d0eb810e04 100644 --- a/src/lib/evas/Evas_Internal.h +++ b/src/lib/evas/Evas_Internal.h @@ -101,6 +101,15 @@ EOAPI double efl_animation_object_total_duration_get(const Eo *obj); EOAPI void efl_animation_object_start_delay_set(Eo *obj, double delay_time); EOAPI double efl_animation_object_start_delay_get(const Eo *obj); +typedef enum +{ + EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART = 0, + EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE +} Efl_Animation_Object_Repeat_Mode; + +EOAPI void efl_animation_object_repeat_mode_set(Eo *obj, Efl_Animation_Object_Repeat_Mode mode); +EOAPI Efl_Animation_Object_Repeat_Mode efl_animation_object_repeat_mode_get(const Eo *obj); + EOAPI void efl_animation_object_repeat_count_set(Eo *obj, int count); EOAPI int efl_animation_object_repeat_count_get(const Eo *obj); diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c index 583cbf86a3..f01a40ba67 100644 --- a/src/lib/evas/canvas/efl_animation.c +++ b/src/lib/evas/canvas/efl_animation.c @@ -134,6 +134,27 @@ _efl_animation_object_create(Eo *eo_obj, Efl_Animation_Data *pd EINA_UNUSED) } EOLIAN static void +_efl_animation_repeat_mode_set(Eo *eo_obj, + Efl_Animation_Data *pd, + Efl_Animation_Repeat_Mode mode) +{ + EFL_ANIMATION_CHECK_OR_RETURN(eo_obj); + + if ((mode == EFL_ANIMATION_REPEAT_MODE_RESTART) || + (mode == EFL_ANIMATION_REPEAT_MODE_REVERSE)) + pd->repeat_mode = mode; +} + +EOLIAN static Efl_Animation_Repeat_Mode +_efl_animation_repeat_mode_get(Eo *eo_obj, Efl_Animation_Data *pd) +{ + EFL_ANIMATION_CHECK_OR_RETURN(eo_obj, + EFL_ANIMATION_REPEAT_MODE_RESTART); + + return pd->repeat_mode; +} + +EOLIAN static void _efl_animation_repeat_count_set(Eo *eo_obj, Efl_Animation_Data *pd, int count) diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo index 7178cb6373..edcfec0d67 100644 --- a/src/lib/evas/canvas/efl_animation.eo +++ b/src/lib/evas/canvas/efl_animation.eo @@ -47,6 +47,15 @@ class Efl.Animation (Efl.Object) total_duration: double; [[Total duration value.]] } } + @property repeat_mode { + set { + } + get { + } + values { + mode: Efl.Animation.Repeat_Mode; [[Repeat mode. EFL_ANIMATION_REPEAT_MODE_RESTART restarts animation when the animation ends and EFL_ANIMATION_REPEAT_MODE_REVERSE reverses animation when the animation ends.]] + } + } @property repeat_count { set { } diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c index f04c410334..8dff1442ed 100644 --- a/src/lib/evas/canvas/efl_animation_alpha.c +++ b/src/lib/evas/canvas/efl_animation_alpha.c @@ -50,6 +50,10 @@ _efl_animation_alpha_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.c b/src/lib/evas/canvas/efl_animation_group_parallel.c index 869d4ccbbe..36a2e0653b 100644 --- a/src/lib/evas/canvas/efl_animation_group_parallel.c +++ b/src/lib/evas/canvas/efl_animation_group_parallel.c @@ -109,6 +109,10 @@ _efl_animation_group_parallel_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(group_anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(group_anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.c b/src/lib/evas/canvas/efl_animation_group_sequential.c index e5a6c53e26..f40b769fdd 100644 --- a/src/lib/evas/canvas/efl_animation_group_sequential.c +++ b/src/lib/evas/canvas/efl_animation_group_sequential.c @@ -103,6 +103,10 @@ _efl_animation_group_sequential_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(group_anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(group_anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_object.c b/src/lib/evas/canvas/efl_animation_object.c index 17a1508135..b9c88f350b 100644 --- a/src/lib/evas/canvas/efl_animation_object.c +++ b/src/lib/evas/canvas/efl_animation_object.c @@ -106,6 +106,28 @@ _efl_animation_object_total_duration_get(Eo *eo_obj, Efl_Animation_Object_Data * } EOLIAN static void +_efl_animation_object_repeat_mode_set(Eo *eo_obj, + Efl_Animation_Object_Data *pd, + Efl_Animation_Object_Repeat_Mode mode) +{ + EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj); + + if ((mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART) || + (mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE)) + pd->repeat_mode = mode; +} + +EOLIAN static Efl_Animation_Object_Repeat_Mode +_efl_animation_object_repeat_mode_get(const Eo *eo_obj, + Efl_Animation_Object_Data *pd) +{ + EFL_ANIMATION_OBJECT_CHECK_OR_RETURN((Eo *)eo_obj, + EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART); + + return pd->repeat_mode; +} + +EOLIAN static void _efl_animation_object_repeat_count_set(Eo *eo_obj, Efl_Animation_Object_Data *pd, int count) @@ -295,6 +317,16 @@ _animator_cb(void *data) else pd->progress = (elapsed_time - paused_time) / total_duration; + if (!pd->is_direction_forward) + pd->progress = 1.0 - pd->progress; + + //If the direction is changed, then reset the target state. + if (pd->is_direction_changed) + { + pd->is_direction_changed = EINA_FALSE; + efl_animation_object_target_state_reset(eo_obj); + } + //Reset previous animation effect before applying animation effect /* FIXME: When the target state is saved, it may not be finished to calculate * target geometry. @@ -321,7 +353,11 @@ end: pd->time.begin = ecore_loop_time_get(); pd->paused_time = 0.0; - efl_animation_object_target_state_reset(eo_obj); + if (pd->repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE) + { + pd->is_direction_forward = !pd->is_direction_forward; + pd->is_direction_changed = EINA_TRUE; + } return ECORE_CALLBACK_RENEW; } @@ -351,6 +387,8 @@ _start(Eo *eo_obj, Efl_Animation_Object_Data *pd) pd->is_started = EINA_TRUE; pd->is_cancelled = EINA_FALSE; pd->is_ended = EINA_FALSE; + pd->is_direction_forward = EINA_TRUE; + pd->is_direction_changed = EINA_FALSE; pd->paused_time = 0.0; @@ -438,6 +476,9 @@ _efl_animation_object_progress_set(Eo *eo_obj, if ((progress < 0.0) || (progress > 1.0)) return; + if (!pd->is_direction_forward) + pd->progress = 1.0 - pd->progress; + Efl_Animation_Object_Running_Event_Info event_info; event_info.progress = progress; @@ -503,6 +544,7 @@ _efl_animation_object_efl_object_constructor(Eo *eo_obj, pd->duration = 0.0; pd->total_duration = 0.0; + pd->repeat_mode = EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART; pd->repeat_count = 0; pd->auto_del = EINA_TRUE; @@ -559,6 +601,9 @@ EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_total_duration_get, double, 0); EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_start_delay_set, EFL_FUNC_CALL(delay_time), double delay_time); EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_start_delay_get, double, 0); +EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_mode_set, EFL_FUNC_CALL(mode), Efl_Animation_Object_Repeat_Mode mode); +EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_mode_get, Efl_Animation_Object_Repeat_Mode, 0); + EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_count_set, EFL_FUNC_CALL(count), int count); EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0); @@ -574,6 +619,8 @@ EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0); EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_total_duration_get), \ EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_set, _efl_animation_object_start_delay_set), \ EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_get, _efl_animation_object_start_delay_get), \ + EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_mode_set, _efl_animation_object_repeat_mode_set), \ + EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_mode_get, _efl_animation_object_repeat_mode_get), \ EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_set, _efl_animation_object_repeat_count_set), \ EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_get, _efl_animation_object_repeat_count_get) diff --git a/src/lib/evas/canvas/efl_animation_object_group_parallel.c b/src/lib/evas/canvas/efl_animation_object_group_parallel.c index 6d58e39247..2d551bf166 100644 --- a/src/lib/evas/canvas/efl_animation_object_group_parallel.c +++ b/src/lib/evas/canvas/efl_animation_object_group_parallel.c @@ -184,6 +184,8 @@ _efl_animation_object_group_parallel_efl_animation_object_progress_set(Eo *eo_ob double start_delay = efl_animation_object_start_delay_get(anim_obj); double anim_obj_progress; + Eina_Bool start_repeat = EINA_FALSE; + if (total_duration == 0.0) anim_obj_progress = 1.0; else @@ -220,11 +222,28 @@ _efl_animation_object_group_parallel_efl_animation_object_progress_set(Eo *eo_ob { repeated_count++; _repeated_count_set(pd, anim_obj, repeated_count); + + start_repeat = EINA_TRUE; } } } } + /* If object is repeated with reverse mode, then the progress value + * should be modified as (1.0 - progress). */ + Efl_Animation_Object_Repeat_Mode repeat_mode + = efl_animation_object_repeat_mode_get(anim_obj); + if (repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE) + { + int repeated_count = _repeated_count_get(pd, anim_obj); + if (repeated_count > 0) + { + if ((((repeated_count % 2) == 1) && (!start_repeat)) || + (((repeated_count % 2) == 0) && (start_repeat))) + anim_obj_progress = 1.0 - anim_obj_progress; + } + } + efl_animation_object_progress_set(anim_obj, anim_obj_progress); } diff --git a/src/lib/evas/canvas/efl_animation_object_group_sequential.c b/src/lib/evas/canvas/efl_animation_object_group_sequential.c index 3b288248ef..c83bb8852c 100644 --- a/src/lib/evas/canvas/efl_animation_object_group_sequential.c +++ b/src/lib/evas/canvas/efl_animation_object_group_sequential.c @@ -190,6 +190,8 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_ double start_delay = efl_animation_object_start_delay_get(anim_obj); double anim_obj_progress; + Eina_Bool start_repeat = EINA_FALSE; + if (total_duration == 0.0) anim_obj_progress = 1.0; else @@ -225,6 +227,8 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_ { repeated_count++; _repeated_count_set(pd, anim_obj, repeated_count); + + start_repeat = EINA_TRUE; } } } @@ -234,10 +238,25 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_ * delays */ sum_prev_total_duration += (total_duration + start_delay); - if ((anim_obj_progress == 1.0) && - !efl_animation_object_final_state_keep_get(anim_obj)) + if ((anim_obj_progress == 1.0) && (!start_repeat) && + (!efl_animation_object_final_state_keep_get(anim_obj))) continue; + /* If object is repeated with reverse mode, then the progress value + * should be modified as (1.0 - progress). */ + Efl_Animation_Object_Repeat_Mode repeat_mode + = efl_animation_object_repeat_mode_get(anim_obj); + if (repeat_mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE) + { + int repeated_count = _repeated_count_get(pd, anim_obj); + if (repeated_count > 0) + { + if ((((repeated_count % 2) == 1) && (!start_repeat)) || + (((repeated_count % 2) == 0) && (start_repeat))) + anim_obj_progress = 1.0 - anim_obj_progress; + } + } + efl_animation_object_progress_set(anim_obj, anim_obj_progress); } diff --git a/src/lib/evas/canvas/efl_animation_object_private.h b/src/lib/evas/canvas/efl_animation_object_private.h index e27990a309..9df8b4edca 100644 --- a/src/lib/evas/canvas/efl_animation_object_private.h +++ b/src/lib/evas/canvas/efl_animation_object_private.h @@ -17,10 +17,10 @@ typedef struct _Target_State typedef struct _Efl_Animation_Object_Data { - Ecore_Animator *animator; + Ecore_Animator *animator; - Ecore_Timer *start_delay_timer; - double start_delay_time; + Ecore_Timer *start_delay_timer; + double start_delay_time; struct { double begin; @@ -28,25 +28,28 @@ typedef struct _Efl_Animation_Object_Data double pause_begin; } time; - Efl_Canvas_Object *target; - Target_State *target_state; + Efl_Canvas_Object *target; + Target_State *target_state; - double progress; + double progress; - double duration; - double total_duration; - double paused_time; + double duration; + double total_duration; + double paused_time; - int repeat_count; - int remaining_repeat_count; + Efl_Animation_Object_Repeat_Mode repeat_mode; + int repeat_count; + int remaining_repeat_count; - Eina_Bool auto_del : 1; - Eina_Bool is_deleted : 1; - Eina_Bool is_started : 1; - Eina_Bool is_cancelled : 1; - Eina_Bool is_ended : 1; - Eina_Bool is_paused : 1; - Eina_Bool keep_final_state : 1; + Eina_Bool auto_del : 1; + Eina_Bool is_deleted : 1; + Eina_Bool is_started : 1; + Eina_Bool is_cancelled : 1; + Eina_Bool is_ended : 1; + Eina_Bool is_paused : 1; + Eina_Bool keep_final_state : 1; + Eina_Bool is_direction_forward : 1; + Eina_Bool is_direction_changed : 1; } Efl_Animation_Object_Data; #define EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(anim_obj, ...) \ diff --git a/src/lib/evas/canvas/efl_animation_private.h b/src/lib/evas/canvas/efl_animation_private.h index 6c993f4bd3..1cd84d2a59 100644 --- a/src/lib/evas/canvas/efl_animation_private.h +++ b/src/lib/evas/canvas/efl_animation_private.h @@ -7,17 +7,18 @@ typedef struct _Efl_Animation_Data { - Efl_Canvas_Object *target; + Efl_Canvas_Object *target; - double duration; - double total_duration; + double duration; + double total_duration; - double start_delay_time; + double start_delay_time; - int repeat_count; + Efl_Animation_Repeat_Mode repeat_mode; + int repeat_count; - Eina_Bool is_deleted : 1; - Eina_Bool keep_final_state : 1; + Eina_Bool is_deleted : 1; + Eina_Bool keep_final_state : 1; } Efl_Animation_Data; #define EFL_ANIMATION_CHECK_OR_RETURN(anim, ...) \ diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c index 7e3851769b..addfc2e9bf 100644 --- a/src/lib/evas/canvas/efl_animation_rotate.c +++ b/src/lib/evas/canvas/efl_animation_rotate.c @@ -198,6 +198,10 @@ _efl_animation_rotate_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c index 2c3ba7c445..ed7ad3b142 100644 --- a/src/lib/evas/canvas/efl_animation_scale.c +++ b/src/lib/evas/canvas/efl_animation_scale.c @@ -224,6 +224,10 @@ _efl_animation_scale_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c index 2ffc158452..622727697f 100644 --- a/src/lib/evas/canvas/efl_animation_translate.c +++ b/src/lib/evas/canvas/efl_animation_translate.c @@ -166,6 +166,10 @@ _efl_animation_translate_efl_animation_object_create(Eo *eo_obj, double start_delay_time = efl_animation_start_delay_get(eo_obj); efl_animation_object_start_delay_set(anim_obj, start_delay_time); + Efl_Animation_Object_Repeat_Mode repeat_mode = + (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); + efl_animation_object_repeat_mode_set(anim_obj, repeat_mode); + int repeat_count = efl_animation_repeat_count_get(eo_obj); efl_animation_object_repeat_count_set(anim_obj, repeat_count); diff --git a/src/lib/evas/canvas/efl_animation_types.eot b/src/lib/evas/canvas/efl_animation_types.eot index a3f4ca47b9..099efbfd94 100644 --- a/src/lib/evas/canvas/efl_animation_types.eot +++ b/src/lib/evas/canvas/efl_animation_types.eot @@ -11,3 +11,11 @@ enum Efl.Animation.Event_Type hide = 1, [["hide" event type]] clicked = 2 [["clicked" event type]] } + +enum Efl.Animation.Repeat_Mode +{ + [[Animation repeat mode]] + + restart = 0, [[Restart animation when the animation ends.]] + reverse [[Reverse animation when the animation ends.]] +} --