evas: migrate the vg json example

Summary:
i was not able to run the example before this commit, nor after this
commit. However, i had to migrate this, as i want to remove the player
object.
Depends on D10637

Reviewers: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10666
This commit is contained in:
Marcel Hollerbach 2019-11-18 11:44:15 +09:00 committed by Hermet Park
parent 75301b3a1a
commit a1f1cd6dd6
1 changed files with 4 additions and 8 deletions

View File

@ -35,10 +35,9 @@
static Eo *gvg[5]; static Eo *gvg[5];
static void static void
running_cb(void *data EINA_UNUSED, const Efl_Event *event) _running_cb(void *data EINA_UNUSED, const Efl_Event *event)
{ {
Efl_Canvas_Animation_Player_Event_Running *event_running = event->info; double progress = *((double*)event->info);
double progress = event_running->progress;
int i; int i;
for (i = 0; i < 5; i++) for (i = 0; i < 5; i++)
@ -120,11 +119,8 @@ main(void)
//Play custom animation //Play custom animation
Eo *anim = efl_add(EFL_CANVAS_ANIMATION_CLASS, evas); 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_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);
Eo *player = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, evas); efl_canvas_object_animation_start(vg, anim, 1.0, 0.0);
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_main_loop_begin();
ecore_evas_shutdown(); ecore_evas_shutdown();