zmike pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e3b77fcff8e9ed822fb747d815807ab43f1ddae9

commit e3b77fcff8e9ed822fb747d815807ab43f1ddae9
Author: JunsuChoi <[email protected]>
Date:   Tue Dec 31 09:53:23 2019 -0500

    Efl.Ui.Vg_Animation: Implaments Efl.Playable interface
    
    Summary:
    Change API
    .duration_time => Efl.Playable.length.get
    
    ref T8476
    Depends on D10939
    
    Test Plan: N/A
    
    Reviewers: Hermet, bu5hm4n, kimcinoo, segfaultxavi, zmike
    
    Reviewed By: segfaultxavi, zmike
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Maniphest Tasks: T8476
    
    Differential Revision: https://phab.enlightenment.org/D10953
---
 .../elementary/test_efl_gfx_vg_value_provider.c    |  2 +-
 src/bin/elementary/test_efl_ui_vg_animation.c      |  2 +-
 src/lib/elementary/efl_ui_vg_animation.c           | 26 +++++++++++++++++-----
 src/lib/elementary/efl_ui_vg_animation.eo          | 17 ++++----------
 src/lib/elementary/efl_ui_vg_animation_eo.legacy.c |  2 +-
 5 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/src/bin/elementary/test_efl_gfx_vg_value_provider.c 
b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
index 697c255241..c8f55c85b7 100644
--- a/src/bin/elementary/test_efl_gfx_vg_value_provider.c
+++ b/src/bin/elementary/test_efl_gfx_vg_value_provider.c
@@ -487,7 +487,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNU
 
 
    //Duration Text
-   snprintf(buf, sizeof(buf), "Duration: %1.2fs", 
efl_ui_vg_animation_duration_time_get(anim_view));
+   snprintf(buf, sizeof(buf), "Duration(Length): %1.2fs", 
efl_playable_length_get(anim_view));
    efl_add(EFL_UI_TEXTBOX_CLASS, box_sub,
            efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
            efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
diff --git a/src/bin/elementary/test_efl_ui_vg_animation.c 
b/src/bin/elementary/test_efl_ui_vg_animation.c
index 6ab7a082a4..8c6f38d8a6 100644
--- a/src/bin/elementary/test_efl_ui_vg_animation.c
+++ b/src/bin/elementary/test_efl_ui_vg_animation.c
@@ -208,7 +208,7 @@ test_efl_ui_vg_animation(void *data EINA_UNUSED, 
Evas_Object *obj EINA_UNUSED, v
 
 
    //Duration Text
-   snprintf(buf, sizeof(buf), "Duration: %1.2fs", 
efl_ui_vg_animation_duration_time_get(anim_view));
+   snprintf(buf, sizeof(buf), "Duration(Length): %1.2fs", 
efl_playable_length_get(anim_view));
    efl_add(EFL_UI_TEXTBOX_CLASS, box2,
            efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
            efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
diff --git a/src/lib/elementary/efl_ui_vg_animation.c 
b/src/lib/elementary/efl_ui_vg_animation.c
index d693ad8e0a..72d54cdcad 100644
--- a/src/lib/elementary/efl_ui_vg_animation.c
+++ b/src/lib/elementary/efl_ui_vg_animation.c
@@ -521,12 +521,6 @@ _efl_ui_vg_animation_frame_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Vg_Animation_Da
    return (int) ((double) (evas_object_vg_animated_frame_count_get(pd->vg) - 
1) * progress);
 }
 
-EOLIAN static double
-_efl_ui_vg_animation_duration_time_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Vg_Animation_Data *pd)
-{
-   return pd->frame_duration;
-}
-
 EOLIAN static Eina_Size2D
 _efl_ui_vg_animation_default_view_size_get(const Eo *obj EINA_UNUSED,
                                              Efl_Ui_Vg_Animation_Data *pd 
EINA_UNUSED)
@@ -804,6 +798,26 @@ _efl_ui_vg_animation_efl_player_playback_speed_get(const 
Eo *obj EINA_UNUSED, Ef
    return pd->playback_speed;
 }
 
+EOLIAN static double
+_efl_ui_vg_animation_efl_playable_length_get(const Eo *obj EINA_UNUSED, 
Efl_Ui_Vg_Animation_Data *pd)
+{
+   return pd->frame_duration;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_vg_animation_efl_playable_playable_get(const Eo *obj, 
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
+{
+   if (!efl_file_loaded_get(obj)) return EINA_FALSE;
+   return EINA_TRUE;
+}
+
+EOLIAN static Eina_Bool
+_efl_ui_vg_animation_efl_playable_seekable_get(const Eo *obj, 
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
+{
+   if (!efl_file_loaded_get(obj)) return EINA_FALSE;
+   return EINA_TRUE;
+}
+
 EAPI Elm_Animation_View*
 elm_animation_view_add(Evas_Object *parent)
 {
diff --git a/src/lib/elementary/efl_ui_vg_animation.eo 
b/src/lib/elementary/efl_ui_vg_animation.eo
index b8931b6fac..69971f95c2 100644
--- a/src/lib/elementary/efl_ui_vg_animation.eo
+++ b/src/lib/elementary/efl_ui_vg_animation.eo
@@ -10,7 +10,7 @@ enum @beta Efl.Ui.Vg_Animation_State
           Otherwise after finished animation or stopped forcibly by request.]]
 }
 
-class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, 
Efl.File, Efl.Player
+class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, 
Efl.File, Efl.Player, Efl.Playable
 {
    [[Elementary Vector Graphcis Animation class.
      Vg Animation is designed to show and play animation of
@@ -63,18 +63,6 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget 
implements Efl.Gfx.View, E
             autorepeat: bool; [[Loop mode, Default is $false.]]
          }
       }
-      @property duration_time {
-         [[Get the duration of animation in seconds.
-
-           This API returns total duration time of current animation in the 
seconds.
-           If current animation source isn't animatable, it returns zero.
-         ]]
-         get {
-         }
-         values {
-            frame_duration: double; [[duration time in the seconds]]
-         }
-      }
       @property frame {
          [[Number of current frame.
 
@@ -212,6 +200,9 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget 
implements Efl.Gfx.View, E
       Efl.Player.playback_position { set; get; }
       Efl.Player.playback_progress { get; set; }
       Efl.Player.playback_speed { set; get; }
+      Efl.Playable.length { get; }
+      Efl.Playable.playable { get; }
+      Efl.Playable.seekable { get; }
    }
    events {
       play,start: void; [[Called when animation is just started]]
diff --git a/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c 
b/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
index 9c62645ac9..eca7abf616 100644
--- a/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
+++ b/src/lib/elementary/efl_ui_vg_animation_eo.legacy.c
@@ -40,7 +40,7 @@ elm_animation_view_speed_get(const Efl_Ui_Vg_Animation *obj)
 EAPI double
 elm_animation_view_duration_time_get(const Efl_Ui_Vg_Animation *obj)
 {
-   return efl_ui_vg_animation_duration_time_get(obj);
+   return efl_playable_length_get(obj);
 }
 
 EAPI void

-- 


Reply via email to