image animation functions now work as expected for edje images
authorMike Blumenkrantz <zmike@osg.samsung.com>
Wed, 21 Jan 2015 20:14:20 +0000 (15:14 -0500)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Wed, 21 Jan 2015 20:17:00 +0000 (15:17 -0500)
src/lib/elm_image.c

index e57cccb601c4ef17864d9d9f842b275043168fad..8e12a39a7301f4cf5804c29fa835270b21dc3cfd 100644 (file)
@@ -1398,8 +1398,13 @@ _elm_image_animated_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool anim)
    anim = !!anim;
    if (sd->anim == anim) return;
 
-   if (sd->edje) return;
+   sd->anim = anim;
 
+   if (sd->edje)
+     {
+        edje_object_animation_set(sd->img, anim);
+        return;
+     }
    sd->img = elm_image_object_get(obj);
    if (!evas_object_image_animated_get(sd->img)) return;
 
@@ -1418,7 +1423,6 @@ _elm_image_animated_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool anim)
         sd->cur_frame = -1;
         sd->frame_duration = -1;
      }
-   sd->anim = anim;
 
    return;
 }
@@ -1426,6 +1430,8 @@ _elm_image_animated_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool anim)
 EOLIAN static Eina_Bool
 _elm_image_animated_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
 {
+   if (sd->edje)
+     return edje_object_animation_get(sd->img);
    return sd->anim;
 }
 
@@ -1434,9 +1440,12 @@ _elm_image_animated_play_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool play)
 {
    if (!sd->anim) return;
    if (sd->play == play) return;
-
-   if (sd->edje) return;
-
+   sd->play = play;
+   if (sd->edje)
+     {
+        edje_object_play_set(sd->img, play);
+        return;
+     }
    if (play)
      {
         sd->anim_timer = ecore_timer_add
@@ -1446,12 +1455,13 @@ _elm_image_animated_play_set(Eo *obj, Elm_Image_Data *sd, Eina_Bool play)
      {
         ELM_SAFE_FREE(sd->anim_timer, ecore_timer_del);
      }
-   sd->play = play;
 }
 
 EOLIAN static Eina_Bool
 _elm_image_animated_play_get(Eo *obj EINA_UNUSED, Elm_Image_Data *sd)
 {
+   if (sd->edje)
+     return edje_object_play_get(sd->img);
    return sd->play;
 }