hermet pushed a commit to branch master.

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

commit 98a3dcd94e43e7d172d1609523467edcaed02c1c
Author: Hermet Park <[email protected]>
Date:   Mon Nov 18 12:57:18 2019 +0900

    Revert "evas: migrate the vg json example"
    
    This reverts commit a1f1cd6dd67de8eac0e302d47ce2aebf44aead16.
    
    Eeek, this shouldn't be pushed yet.
---
 src/examples/evas/evas-vg-json.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/examples/evas/evas-vg-json.c b/src/examples/evas/evas-vg-json.c
index cf0519f6f3..248dcb1054 100644
--- a/src/examples/evas/evas-vg-json.c
+++ b/src/examples/evas/evas-vg-json.c
@@ -35,9 +35,10 @@
 static Eo *gvg[5];
 
 static void
-_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
+running_cb(void *data EINA_UNUSED, const Efl_Event *event)
 {
-   double progress = *((double*)event->info);
+   Efl_Canvas_Animation_Player_Event_Running *event_running = event->info;
+   double progress = event_running->progress;
 
    int i;
    for (i = 0; i < 5; i++)
@@ -119,8 +120,11 @@ main(void)
    //Play custom animation
    Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas);
    efl_animation_duration_set(anim, 
efl_gfx_frame_controller_frame_duration_get(vg, 0, 0));
-   efl_event_callback_add(vg, 
EFL_CANVAS_OBJECT_ANIMATION_EVENT_ANIMATION_PROGRESS_UPDATED, _running_cb, 
NULL);
-   efl_canvas_object_animation_start(vg, anim, 1.0, 0.0);
+
+   Eo *player = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, evas);
+   efl_animation_player_animation_set(player, anim);
+   efl_event_callback_add(player, EFL_ANIMATION_PLAYER_EVENT_RUNNING, 
running_cb, NULL);
+   efl_player_playing_set(player, EINA_TRUE);
 
    ecore_main_loop_begin();
    ecore_evas_shutdown();

-- 


Reply via email to