efl_animation: Add repeat_mode property
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 5 Sep 2017 02:33:58 +0000 (11:33 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Thu, 12 Oct 2017 12:03:49 +0000 (21:03 +0900)
To not display original state when the reverse repeat starts, the
animators in group parallel and group sequential are deleted.

16 files changed:
src/bin/elementary/test_efl_anim_repeat.c
src/lib/evas/Evas_Internal.h
src/lib/evas/canvas/efl_animation.c
src/lib/evas/canvas/efl_animation.eo
src/lib/evas/canvas/efl_animation_alpha.c
src/lib/evas/canvas/efl_animation_group_parallel.c
src/lib/evas/canvas/efl_animation_group_sequential.c
src/lib/evas/canvas/efl_animation_object.c
src/lib/evas/canvas/efl_animation_object_group_parallel.c
src/lib/evas/canvas/efl_animation_object_group_sequential.c
src/lib/evas/canvas/efl_animation_object_private.h
src/lib/evas/canvas/efl_animation_private.h
src/lib/evas/canvas/efl_animation_rotate.c
src/lib/evas/canvas/efl_animation_scale.c
src/lib/evas/canvas/efl_animation_translate.c
src/lib/evas/canvas/efl_animation_types.eot

index 912b239..b5f7ac3 100644 (file)
@@ -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);
 }
index e57b601..d0eb810 100644 (file)
@@ -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);
 
index 583cbf8..f01a40b 100644 (file)
@@ -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)
index 7178cb6..edcfec0 100644 (file)
@@ -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 {
          }
index f04c410..8dff144 100644 (file)
@@ -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);
 
index 869d4cc..36a2e06 100644 (file)
@@ -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);
 
index e5a6c53..f40b769 100644 (file)
@@ -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);
 
index 17a1508..b9c88f3 100644 (file)
@@ -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)
 
index 6d58e39..2d551bf 100644 (file)
@@ -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);
      }
 
index 3b28824..c83bb88 100644 (file)
@@ -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);
      }
 
index e27990a..9df8b4e 100644 (file)
@@ -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, ...) \
index 6c993f4..1cd84d2 100644 (file)
@@ -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, ...) \
index 7e38517..addfc2e 100644 (file)
@@ -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);
 
index 2c3ba7c..ed7ad3b 100644 (file)
@@ -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);
 
index 2ffc158..6227276 100644 (file)
@@ -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);
 
index a3f4ca4..099efbf 100644 (file)
@@ -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.]]
+}