summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2018-01-16 20:31:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2018-01-16 22:04:55 +0900
commit588995da317520fc92660b89b0864bb1f25abc09 (patch)
tree18105ad544539753c5cddea93224bb8c3f2bd8c4
parent1da72770f385489c259f3200df3ba72adedb2471 (diff)
efl_playable: split Efl.Player interface to Efl.Playable interface
Summary: Efl.Player interface simply provides play functions, but another interface which indicates Efl.Player will play is also needed. Test Plan: Run elementary_test->Efl.Animation tests Reviewers: woohyun, conr2d, Jaehyun_Cho, jpeg, cedric Differential Revision: https://phab.enlightenment.org/D5662
-rw-r--r--src/Makefile_Efl.am1
-rw-r--r--src/Makefile_Evas.am27
-rw-r--r--src/bin/elementary/test_efl_anim_alpha.c48
-rw-r--r--src/bin/elementary/test_efl_anim_event_anim.c10
-rw-r--r--src/bin/elementary/test_efl_anim_group_parallel.c60
-rw-r--r--src/bin/elementary/test_efl_anim_group_sequential.c86
-rw-r--r--src/bin/elementary/test_efl_anim_interpolator.c55
-rw-r--r--src/bin/elementary/test_efl_anim_pause.c49
-rw-r--r--src/bin/elementary/test_efl_anim_repeat.c44
-rw-r--r--src/bin/elementary/test_efl_anim_rotate.c86
-rw-r--r--src/bin/elementary/test_efl_anim_scale.c83
-rw-r--r--src/bin/elementary/test_efl_anim_start_delay.c45
-rw-r--r--src/bin/elementary/test_efl_anim_translate.c65
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c1
-rw-r--r--src/lib/efl/interfaces/efl_playable.eo29
-rw-r--r--src/lib/efl/interfaces/efl_player.eo8
-rw-r--r--src/lib/elementary/efl_ui_video.c66
-rw-r--r--src/lib/elementary/efl_ui_video.eo22
-rw-r--r--src/lib/elementary/efl_ui_video_legacy.h32
-rw-r--r--src/lib/evas/Evas_Common.h42
-rw-r--r--src/lib/evas/Evas_Eo.h9
-rw-r--r--src/lib/evas/Evas_Internal.h77
-rw-r--r--src/lib/evas/canvas/efl_animation.c117
-rw-r--r--src/lib/evas/canvas/efl_animation.eo41
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c47
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha_private.h4
-rw-r--r--src/lib/evas/canvas/efl_animation_group.c41
-rw-r--r--src/lib/evas/canvas/efl_animation_group.eo1
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.c129
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.eo8
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel_private.h11
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.c129
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.eo8
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential_private.h11
-rw-r--r--src/lib/evas/canvas/efl_animation_object.c585
-rw-r--r--src/lib/evas/canvas/efl_animation_object.eo46
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha.c84
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_alpha_private.h24
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group.c200
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel.c256
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel.eo12
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel_private.h23
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_private.h15
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential.c269
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential.eo12
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential_private.h23
-rw-r--r--src/lib/evas/canvas/efl_animation_object_private.h56
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate.c243
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_rotate_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale.c272
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_scale_private.h37
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate.c240
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate.eo11
-rw-r--r--src/lib/evas/canvas/efl_animation_object_translate_private.h25
-rw-r--r--src/lib/evas/canvas/efl_animation_player.c384
-rw-r--r--src/lib/evas/canvas/efl_animation_player.eo55
-rw-r--r--src/lib/evas/canvas/efl_animation_player_private.h52
-rw-r--r--src/lib/evas/canvas/efl_animation_private.h12
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c162
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate_private.h4
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.c170
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_scale_private.h4
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.c145
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_translate_private.h4
-rw-r--r--src/lib/evas/canvas/efl_animation_types.eot2
-rw-r--r--src/lib/evas/canvas/evas_object_intercept.c6
-rw-r--r--src/lib/evas/canvas/evas_object_main.c232
-rw-r--r--src/lib/evas/include/evas_private.h6
77 files changed, 1350 insertions, 3903 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index 30b6cdb040..c91a250f33 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -24,6 +24,7 @@ efl_eolian_files = \
24 lib/efl/interfaces/efl_file.eo \ 24 lib/efl/interfaces/efl_file.eo \
25 lib/efl/interfaces/efl_image_load.eo \ 25 lib/efl/interfaces/efl_image_load.eo \
26 lib/efl/interfaces/efl_part.eo \ 26 lib/efl/interfaces/efl_part.eo \
27 lib/efl/interfaces/efl_playable.eo \
27 lib/efl/interfaces/efl_player.eo \ 28 lib/efl/interfaces/efl_player.eo \
28 lib/efl/interfaces/efl_text.eo \ 29 lib/efl/interfaces/efl_text.eo \
29 lib/efl/interfaces/efl_text_font.eo \ 30 lib/efl/interfaces/efl_text_font.eo \
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index cf8a6606a3..36298162a2 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -50,14 +50,7 @@ evas_canvas_eolian_pub_files = \
50 lib/evas/canvas/efl_animation_group.eo \ 50 lib/evas/canvas/efl_animation_group.eo \
51 lib/evas/canvas/efl_animation_group_parallel.eo \ 51 lib/evas/canvas/efl_animation_group_parallel.eo \
52 lib/evas/canvas/efl_animation_group_sequential.eo \ 52 lib/evas/canvas/efl_animation_group_sequential.eo \
53 lib/evas/canvas/efl_animation_object.eo \ 53 lib/evas/canvas/efl_animation_player.eo \
54 lib/evas/canvas/efl_animation_object_alpha.eo \
55 lib/evas/canvas/efl_animation_object_rotate.eo \
56 lib/evas/canvas/efl_animation_object_scale.eo \
57 lib/evas/canvas/efl_animation_object_translate.eo \
58 lib/evas/canvas/efl_animation_object_group.eo \
59 lib/evas/canvas/efl_animation_object_group_parallel.eo \
60 lib/evas/canvas/efl_animation_object_group_sequential.eo \
61 $(NULL) 54 $(NULL)
62 55
63evas_gesture_eolian_pub_files = \ 56evas_gesture_eolian_pub_files = \
@@ -186,14 +179,7 @@ lib/evas/canvas/efl_animation_translate_private.h \
186lib/evas/canvas/efl_animation_group_private.h \ 179lib/evas/canvas/efl_animation_group_private.h \
187lib/evas/canvas/efl_animation_group_parallel_private.h \ 180lib/evas/canvas/efl_animation_group_parallel_private.h \
188lib/evas/canvas/efl_animation_group_sequential_private.h \ 181lib/evas/canvas/efl_animation_group_sequential_private.h \
189lib/evas/canvas/efl_animation_object_private.h \ 182lib/evas/canvas/efl_animation_player_private.h \
190lib/evas/canvas/efl_animation_object_alpha_private.h \
191lib/evas/canvas/efl_animation_object_rotate_private.h \
192lib/evas/canvas/efl_animation_object_scale_private.h \
193lib/evas/canvas/efl_animation_object_translate_private.h \
194lib/evas/canvas/efl_animation_object_group_private.h \
195lib/evas/canvas/efl_animation_object_group_parallel_private.h \
196lib/evas/canvas/efl_animation_object_group_sequential_private.h \
197lib/evas/gesture/efl_gesture_private.h 183lib/evas/gesture/efl_gesture_private.h
198 184
199# Linebreak 185# Linebreak
@@ -288,14 +274,7 @@ lib/evas/canvas/efl_animation_translate.c \
288lib/evas/canvas/efl_animation_group.c \ 274lib/evas/canvas/efl_animation_group.c \
289lib/evas/canvas/efl_animation_group_parallel.c \ 275lib/evas/canvas/efl_animation_group_parallel.c \
290lib/evas/canvas/efl_animation_group_sequential.c \ 276lib/evas/canvas/efl_animation_group_sequential.c \
291lib/evas/canvas/efl_animation_object.c \ 277lib/evas/canvas/efl_animation_player.c \
292lib/evas/canvas/efl_animation_object_alpha.c \
293lib/evas/canvas/efl_animation_object_rotate.c \
294lib/evas/canvas/efl_animation_object_scale.c \
295lib/evas/canvas/efl_animation_object_translate.c \
296lib/evas/canvas/efl_animation_object_group.c \
297lib/evas/canvas/efl_animation_object_group_parallel.c \
298lib/evas/canvas/efl_animation_object_group_sequential.c \
299lib/evas/gesture/efl_gesture_touch.c \ 278lib/evas/gesture/efl_gesture_touch.c \
300lib/evas/gesture/efl_gesture.c \ 279lib/evas/gesture/efl_gesture.c \
301lib/evas/gesture/efl_gesture_tap.c \ 280lib/evas/gesture/efl_gesture_tap.c \
diff --git a/src/bin/elementary/test_efl_anim_alpha.c b/src/bin/elementary/test_efl_anim_alpha.c
index e225ae3fbf..90e0f43fc8 100644
--- a/src/bin/elementary/test_efl_anim_alpha.c
+++ b/src/bin/elementary/test_efl_anim_alpha.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *show_anim; 8 Efl_Animation *show_anim;
9 Efl_Animation *hide_anim; 9 Efl_Animation *hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_visible; 12 Eina_Bool is_btn_visible;
13} App_Data; 13} App_Data;
@@ -19,19 +19,15 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27
28 ad->anim_obj = NULL;
29} 25}
30 26
31static void 27static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 28_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 29{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 30 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 31 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 32 printf("Animation is running! Current progress(%lf)\n", progress);
37} 33}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 37{
42 App_Data *ad = data; 38 App_Data *ad = data;
43 39
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_visible = !(ad->is_btn_visible); 40 ad->is_btn_visible = !(ad->is_btn_visible);
48 41
49 if (ad->is_btn_visible) 42 if (ad->is_btn_visible)
50 { 43 {
51 //Create Animation Object from Animation 44 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->show_anim); 45 efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
53 elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0"); 46 efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
54 } 47 }
55 else 48 else
56 { 49 {
57 //Create Animation Object from Animation 50 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->hide_anim); 51 efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
59 elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0"); 52 efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
60 } 53 }
61 54
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 55 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 56 efl_player_start(ad->anim_obj);
73} 57}
74 58
75static void 59static void
@@ -99,23 +83,29 @@ test_efl_anim_alpha(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
99 evas_object_show(btn); 83 evas_object_show(btn);
100 84
101 //Show Animation 85 //Show Animation
102 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 86 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
103 efl_animation_alpha_set(show_anim, 0.0, 1.0); 87 efl_animation_alpha_set(show_anim, 0.0, 1.0);
104 efl_animation_duration_set(show_anim, 1.0); 88 efl_animation_duration_set(show_anim, 1.0);
105 efl_animation_target_set(show_anim, btn);
106 efl_animation_final_state_keep_set(show_anim, EINA_TRUE); 89 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
107 90
108 //Hide Animation 91 //Hide Animation
109 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 92 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
110 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 93 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
111 efl_animation_duration_set(hide_anim, 1.0); 94 efl_animation_duration_set(hide_anim, 1.0);
112 efl_animation_target_set(hide_anim, btn);
113 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE); 95 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
114 96
115 //Initialize App Data 97 //Initialize App Data
116 ad->show_anim = show_anim; 98 ad->show_anim = show_anim;
117 ad->hide_anim = hide_anim; 99 ad->hide_anim = hide_anim;
118 ad->anim_obj = NULL; 100 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
101 efl_animation_player_target_set(efl_added, btn));
102
103 //Register callback called when animation starts
104 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
105 //Register callback called when animation ends
106 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
107 //Register callback called while animation is executed
108 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
119 ad->is_btn_visible = EINA_TRUE; 109 ad->is_btn_visible = EINA_TRUE;
120 110
121 //Button to start animation 111 //Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_event_anim.c b/src/bin/elementary/test_efl_anim_event_anim.c
index f68ee8ccac..88c465ef03 100644
--- a/src/bin/elementary/test_efl_anim_event_anim.c
+++ b/src/bin/elementary/test_efl_anim_event_anim.c
@@ -5,7 +5,7 @@
5 5
6typedef struct _App_Data 6typedef struct _App_Data
7{ 7{
8 Efl_Animation_Object *target; 8 Efl_Animation_Player *target;
9 9
10 Eina_Bool is_btn_visible; 10 Eina_Bool is_btn_visible;
11} App_Data; 11} App_Data;
@@ -57,20 +57,20 @@ test_efl_anim_event_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
57 evas_object_move(btn, 100, 50); 57 evas_object_move(btn, 100, 50);
58 58
59 //Show Animation 59 //Show Animation
60 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 60 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
61 efl_animation_alpha_set(show_anim, 0.0, 1.0); 61 efl_animation_alpha_set(show_anim, 0.0, 1.0);
62 efl_animation_duration_set(show_anim, 1.0); 62 efl_animation_duration_set(show_anim, 1.0);
63 efl_animation_target_set(show_anim, btn); 63 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
64 efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_SHOW, show_anim); 64 efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_SHOW, show_anim);
65 65
66 //Show button after setting event animation to show animation for show event 66 //Show button after setting event animation to show animation for show event
67 evas_object_show(btn); 67 evas_object_show(btn);
68 68
69 //Hide Animation 69 //Hide Animation
70 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 70 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
71 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 71 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
72 efl_animation_duration_set(hide_anim, 1.0); 72 efl_animation_duration_set(hide_anim, 1.0);
73 efl_animation_target_set(hide_anim, btn); 73 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
74 efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_HIDE, hide_anim); 74 efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_HIDE, hide_anim);
75 75
76 //Initialize App Data 76 //Initialize App Data
diff --git a/src/bin/elementary/test_efl_anim_group_parallel.c b/src/bin/elementary/test_efl_anim_group_parallel.c
index a2182bf144..1250d223ca 100644
--- a/src/bin/elementary/test_efl_anim_group_parallel.c
+++ b/src/bin/elementary/test_efl_anim_group_parallel.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *parallel_show_anim; 8 Efl_Animation *parallel_show_anim;
9 Efl_Animation *parallel_hide_anim; 9 Efl_Animation *parallel_hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_visible; 12 Eina_Bool is_btn_visible;
13} App_Data; 13} App_Data;
@@ -19,19 +19,16 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27 25
28 ad->anim_obj = NULL;
29} 26}
30 27
31static void 28static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 29_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 30{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 31 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 32 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 33 printf("Animation is running! Current progress(%lf)\n", progress);
37} 34}
@@ -41,35 +38,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 38{
42 App_Data *ad = data; 39 App_Data *ad = data;
43 40
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_visible = !(ad->is_btn_visible); 41 ad->is_btn_visible = !(ad->is_btn_visible);
48 42
49 if (ad->is_btn_visible) 43 if (ad->is_btn_visible)
50 { 44 {
51 //Create Animation Object from Animation 45 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->parallel_show_anim); 46 efl_animation_player_animation_set(ad->anim_obj, ad->parallel_show_anim);
53 elm_object_text_set(obj, "Start Parallel Group Animation to hide button"); 47 efl_text_set(obj, "Start Parallel Group Animation to hide button");
54 } 48 }
55 else 49 else
56 { 50 {
57 //Create Animation Object from Animation 51 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->parallel_hide_anim); 52 efl_animation_player_animation_set(ad->anim_obj, ad->parallel_hide_anim);
59 elm_object_text_set(obj, "Start Parallel Group Animation to show button"); 53 efl_text_set(obj, "Start Parallel Group Animation to show button");
60 } 54 }
61 55
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 56 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 57 efl_player_start(ad->anim_obj);
73} 58}
74 59
75static void 60static void
@@ -100,21 +85,20 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
100 85
101 86
102 //Show Animation 87 //Show Animation
103 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 88 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
104 efl_animation_alpha_set(show_anim, 0.0, 1.0); 89 efl_animation_alpha_set(show_anim, 0.0, 1.0);
105 90
106 //Rotate from 45 to 0 degrees Animation 91 //Rotate from 45 to 0 degrees Animation
107 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 92 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
108 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5); 93 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
109 94
110 //Scale Animation to zoom out 95 //Scale Animation to zoom out
111 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 96 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
112 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5); 97 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
113 98
114 //Show Parallel Group Animation 99 //Show Parallel Group Animation
115 Efl_Animation *parallel_show_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL); 100 Efl_Animation *parallel_show_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, win);
116 efl_animation_duration_set(parallel_show_anim, 1.0); 101 efl_animation_duration_set(parallel_show_anim, 1.0);
117 efl_animation_target_set(parallel_show_anim, btn);
118 efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE); 102 efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE);
119 103
120 //Add animations to group animation 104 //Add animations to group animation
@@ -124,21 +108,20 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
124 108
125 109
126 //Hide Animation 110 //Hide Animation
127 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 111 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
128 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 112 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
129 113
130 //Rotate from 0 to 45 degrees Animation 114 //Rotate from 0 to 45 degrees Animation
131 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 115 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
132 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5); 116 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
133 117
134 //Scale Animation to zoom in 118 //Scale Animation to zoom in
135 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 119 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
136 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5); 120 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
137 121
138 //Hide Parallel Group Animation 122 //Hide Parallel Group Animation
139 Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL); 123 Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, win);
140 efl_animation_duration_set(parallel_hide_anim, 1.0); 124 efl_animation_duration_set(parallel_hide_anim, 1.0);
141 efl_animation_target_set(parallel_hide_anim, btn);
142 efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE); 125 efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE);
143 126
144 //Add animations to group animation 127 //Add animations to group animation
@@ -150,7 +133,16 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
150 //Initialize App Data 133 //Initialize App Data
151 ad->parallel_show_anim = parallel_show_anim; 134 ad->parallel_show_anim = parallel_show_anim;
152 ad->parallel_hide_anim = parallel_hide_anim; 135 ad->parallel_hide_anim = parallel_hide_anim;
153 ad->anim_obj = NULL; 136 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
137 efl_animation_player_target_set(efl_added, btn));
138
139 //Register callback called when animation starts
140 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
141 //Register callback called when animation ends
142 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
143 //Register callback called while animation is executed
144 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
145
154 ad->is_btn_visible = EINA_TRUE; 146 ad->is_btn_visible = EINA_TRUE;
155 147
156 //Button to start animation 148 //Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_group_sequential.c b/src/bin/elementary/test_efl_anim_group_sequential.c
index 219cd6df29..abb6056f01 100644
--- a/src/bin/elementary/test_efl_anim_group_sequential.c
+++ b/src/bin/elementary/test_efl_anim_group_sequential.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *sequential_show_anim; 8 Efl_Animation *sequential_show_anim;
9 Efl_Animation *sequential_hide_anim; 9 Efl_Animation *sequential_hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_visible; 12 Eina_Bool is_btn_visible;
13} App_Data; 13} App_Data;
@@ -19,19 +19,15 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27
28 ad->anim_obj = NULL;
29} 25}
30 26
31static void 27static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 28_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 29{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 30 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 31 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 32 printf("Animation is running! Current progress(%lf)\n", progress);
37} 33}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 37{
42 App_Data *ad = data; 38 App_Data *ad = data;
43 39
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_visible = !(ad->is_btn_visible); 40 ad->is_btn_visible = !(ad->is_btn_visible);
48 41
49 if (ad->is_btn_visible) 42 if (ad->is_btn_visible)
50 { 43 {
51 //Create Animation Object from Animation 44 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->sequential_show_anim); 45 efl_animation_player_animation_set(ad->anim_obj, ad->sequential_show_anim);
53 elm_object_text_set(obj, "Start Sequential Group Animation to hide button"); 46 efl_text_set(obj, "Start Sequential Group Animation to hide button");
54 } 47 }
55 else 48 else
56 { 49 {
57 //Create Animation Object from Animation 50 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->sequential_hide_anim); 51 efl_animation_player_animation_set(ad->anim_obj, ad->sequential_hide_anim);
59 elm_object_text_set(obj, "Start Sequential Group Animation to show button"); 52 efl_text_set(obj, "Start Sequential Group Animation to show button");
60 } 53 }
61 54
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 55 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 56 efl_player_start(ad->anim_obj);
73} 57}
74 58
75static void 59static void
@@ -101,21 +85,20 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
101 85
102 /* Animations to hide button */ 86 /* Animations to hide button */
103 //Rotate from 0 to 45 degrees Animation 87 //Rotate from 0 to 45 degrees Animation
104 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 88 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
105 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5); 89 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
106 90
107 //Scale Animation to zoom in 91 //Scale Animation to zoom in
108 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 92 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
109 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5); 93 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
110 94
111 //Hide Animation 95 //Hide Animation
112 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 96 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
113 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 97 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
114 98
115 //Hide Sequential Group Animation 99 //Hide Sequential Group Animation
116 Efl_Animation *sequential_hide_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL); 100 Efl_Animation *sequential_hide_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, win);
117 efl_animation_duration_set(sequential_hide_anim, 1.0); 101 efl_animation_duration_set(sequential_hide_anim, 1.0);
118 efl_animation_target_set(sequential_hide_anim, btn);
119 efl_animation_final_state_keep_set(sequential_hide_anim, EINA_TRUE); 102 efl_animation_final_state_keep_set(sequential_hide_anim, EINA_TRUE);
120 103
121 //Add animations to group animation 104 //Add animations to group animation
@@ -124,51 +107,29 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
124 efl_animation_group_animation_add(sequential_hide_anim, hide_anim); 107 efl_animation_group_animation_add(sequential_hide_anim, hide_anim);
125 108
126 109
127 /* Animations of initial state to show button */
128 //Rotate from 0 to 45 degrees Animation
129 Efl_Animation *cw_45_degrees_anim2 = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
130 efl_animation_rotate_set(cw_45_degrees_anim2, 0.0, 45.0, NULL, 0.5, 0.5);
131
132 //Scale Animation to zoom in
133 Efl_Animation *scale_double_anim2 = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
134 efl_animation_scale_set(scale_double_anim2, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
135
136 //Hide Parallel Group Animation
137 Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
138 efl_animation_duration_set(parallel_hide_anim, 0.0);
139 efl_animation_target_set(parallel_hide_anim, btn);
140 efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE);
141
142 //Add animations to group animation
143 efl_animation_group_animation_add(parallel_hide_anim, cw_45_degrees_anim2);
144 efl_animation_group_animation_add(parallel_hide_anim, scale_double_anim2);
145
146
147 /* Animations to show button */ 110 /* Animations to show button */
148 //Show Animation 111 //Show Animation
149 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 112 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
150 efl_animation_alpha_set(show_anim, 0.0, 1.0); 113 efl_animation_alpha_set(show_anim, 0.0, 1.0);
151 efl_animation_duration_set(show_anim, 1.0); 114 efl_animation_duration_set(show_anim, 1.0);
152 115
153 //Scale Animation to zoom out 116 //Scale Animation to zoom out
154 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 117 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
155 efl_animation_scale_set(scale_half_anim, 1.0, 1.0, 0.5, 0.5, NULL, 0.5, 0.5); 118 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
156 efl_animation_duration_set(scale_half_anim, 1.0); 119 efl_animation_duration_set(scale_half_anim, 1.0);
157 120
158 //Rotate from 45 to 0 degrees Animation 121 //Rotate from 45 to 0 degrees Animation
159 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 122 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
160 efl_animation_rotate_set(ccw_45_degrees_anim, 0.0, -45.0, NULL, 0.5, 0.5); 123 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
161 efl_animation_duration_set(ccw_45_degrees_anim, 1.0); 124 efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
162 125
163 //Show Sequential Group Animation 126 //Show Sequential Group Animation
164 Efl_Animation *sequential_show_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL); 127 Efl_Animation *sequential_show_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, win);
165 efl_animation_target_set(sequential_show_anim, btn);
166 efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE); 128 efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE);
167 //efl_animation_duration_set() is called for each animation not to set the same duration 129 //efl_animation_duration_set() is called for each animation not to set the same duration
168 130
169 //Add animations to group animation 131 //Add animations to group animation
170 //First, parallel_hide_anim is added with duration 0 to set the initial state 132 //First, parallel_hide_anim is added with duration 0 to set the initial state
171 efl_animation_group_animation_add(sequential_show_anim, parallel_hide_anim);
172 efl_animation_group_animation_add(sequential_show_anim, show_anim); 133 efl_animation_group_animation_add(sequential_show_anim, show_anim);
173 efl_animation_group_animation_add(sequential_show_anim, scale_half_anim); 134 efl_animation_group_animation_add(sequential_show_anim, scale_half_anim);
174 efl_animation_group_animation_add(sequential_show_anim, ccw_45_degrees_anim); 135 efl_animation_group_animation_add(sequential_show_anim, ccw_45_degrees_anim);
@@ -177,7 +138,16 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
177 //Initialize App Data 138 //Initialize App Data
178 ad->sequential_show_anim = sequential_show_anim; 139 ad->sequential_show_anim = sequential_show_anim;
179 ad->sequential_hide_anim = sequential_hide_anim; 140 ad->sequential_hide_anim = sequential_hide_anim;
180 ad->anim_obj = NULL; 141 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
142 efl_animation_player_target_set(efl_added, btn));
143
144 //Register callback called when animation starts
145 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
146 //Register callback called when animation ends
147 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
148 //Register callback called while animation is executed
149 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
150
181 ad->is_btn_visible = EINA_TRUE; 151 ad->is_btn_visible = EINA_TRUE;
182 152
183 //Button to start animation 153 //Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c
index 732d217e43..097d030b98 100644
--- a/src/bin/elementary/test_efl_anim_interpolator.c
+++ b/src/bin/elementary/test_efl_anim_interpolator.c
@@ -13,7 +13,7 @@
13typedef struct _App_Data 13typedef struct _App_Data
14{ 14{
15 Efl_Animation *anim[INTERP_NUM]; 15 Efl_Animation *anim[INTERP_NUM];
16 Efl_Animation_Object *anim_obj[INTERP_NUM]; 16 Efl_Animation_Player *anim_obj[INTERP_NUM];
17 17
18 Evas_Object *btn[INTERP_NUM]; 18 Evas_Object *btn[INTERP_NUM];
19 Evas_Object *start_all_btn; 19 Evas_Object *start_all_btn;
@@ -88,7 +88,6 @@ _anim_ended_cb(void *data, const Efl_Event *event)
88 { 88 {
89 if (ad->anim_obj[i] == event->object) 89 if (ad->anim_obj[i] == event->object)
90 { 90 {
91 ad->anim_obj[i] = NULL;
92 elm_object_disabled_set(ad->btn[i], EINA_FALSE); 91 elm_object_disabled_set(ad->btn[i], EINA_FALSE);
93 break; 92 break;
94 } 93 }
@@ -101,7 +100,7 @@ _anim_ended_cb(void *data, const Efl_Event *event)
101static void 100static void
102_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 101_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
103{ 102{
104 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 103 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
105 double progress = event_info->progress; 104 double progress = event_info->progress;
106 printf("Animation is running! Current progress(%lf)\n", progress); 105 printf("Animation is running! Current progress(%lf)\n", progress);
107} 106}
@@ -113,21 +112,8 @@ _anim_start(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
113 112
114 int index = (uintptr_t)evas_object_data_get(obj, "index"); 113 int index = (uintptr_t)evas_object_data_get(obj, "index");
115 114
116 //Create Animation Object from Animation
117 Efl_Animation_Object *anim_obj = efl_animation_object_create(ad->anim[index]);
118 ad->anim_obj[index] = anim_obj;
119
120 //Register callback called when animation starts
121 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
122
123 //Register callback called when animation ends
124 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
125
126 //Register callback called while animation is executed
127 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
128
129 //Let Animation Object start animation 115 //Let Animation Object start animation
130 efl_animation_object_start(anim_obj); 116 efl_player_start(ad->anim_obj[index]);
131 117
132 elm_object_disabled_set(obj, EINA_TRUE); 118 elm_object_disabled_set(obj, EINA_TRUE);
133 elm_object_disabled_set(ad->start_all_btn, EINA_TRUE); 119 elm_object_disabled_set(ad->start_all_btn, EINA_TRUE);
@@ -141,22 +127,8 @@ _anim_start_all(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
141 int i; 127 int i;
142 for (i = 0; i < INTERP_NUM; i++) 128 for (i = 0; i < INTERP_NUM; i++)
143 { 129 {
144 //Create Animation Object from Animation
145 Efl_Animation_Object *anim_obj = efl_animation_object_create(ad->anim[i]);
146 ad->anim_obj[i] = anim_obj;
147
148 //Register callback called when animation starts
149 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
150
151 //Register callback called when animation ends
152 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
153
154 //Register callback called while animation is executed
155 efl_event_callback_add(anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
156
157 //Let Animation Object start animation 130 //Let Animation Object start animation
158 efl_animation_object_start(anim_obj); 131 efl_player_start(ad->anim_obj[i]);
159
160 elm_object_disabled_set(ad->btn[i], EINA_TRUE); 132 elm_object_disabled_set(ad->btn[i], EINA_TRUE);
161 } 133 }
162 134
@@ -212,14 +184,29 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
212 evas_object_smart_callback_add(btn, "clicked", _anim_start, ad); 184 evas_object_smart_callback_add(btn, "clicked", _anim_start, ad);
213 ad->btn[i] = btn; 185 ad->btn[i] = btn;
214 186
215 Efl_Animation *anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL); 187 Efl_Animation *anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, win);
216 efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0); 188 efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0);
217 efl_animation_duration_set(anim, 2.0); 189 efl_animation_duration_set(anim, 2.0);
218 efl_animation_target_set(anim, btn); 190 efl_animation_final_state_keep_set(anim, EINA_FALSE);
219 191
220 Efl_Interpolator *interp = _interpolator_create(i); 192 Efl_Interpolator *interp = _interpolator_create(i);
221 efl_animation_interpolator_set(anim, interp); 193 efl_animation_interpolator_set(anim, interp);
222 ad->anim[i] = anim; 194 ad->anim[i] = anim;
195
196 //Create Animation Object from Animation
197 Efl_Animation_Player *anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, NULL,
198 efl_animation_player_animation_set(efl_added, anim),
199 efl_animation_player_target_set(efl_added, btn));
200 ad->anim_obj[i] = anim_obj;
201
202 //Register callback called when animation starts
203 efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad);
204
205 //Register callback called when animation ends
206 efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
207
208 //Register callback called while animation is executed
209 efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
223 } 210 }
224 211
225 ad->running_anim_cnt = 0; 212 ad->running_anim_cnt = 0;
diff --git a/src/bin/elementary/test_efl_anim_pause.c b/src/bin/elementary/test_efl_anim_pause.c
index 9ca97430d4..ae5b3a50ed 100644
--- a/src/bin/elementary/test_efl_anim_pause.c
+++ b/src/bin/elementary/test_efl_anim_pause.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *show_anim; 8 Efl_Animation *show_anim;
9 Efl_Animation *hide_anim; 9 Efl_Animation *hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Evas_Object *pause_btn; 12 Evas_Object *pause_btn;
13 13
@@ -33,14 +33,12 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
33 printf("Animation has been ended!\n"); 33 printf("Animation has been ended!\n");
34 34
35 elm_object_disabled_set(ad->pause_btn, EINA_TRUE); 35 elm_object_disabled_set(ad->pause_btn, EINA_TRUE);
36
37 ad->anim_obj = NULL;
38} 36}
39 37
40static void 38static void
41_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 39_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
42{ 40{
43 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 41 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
44 double progress = event_info->progress; 42 double progress = event_info->progress;
45 printf("Animation is running! Current progress(%lf)\n", progress); 43 printf("Animation is running! Current progress(%lf)\n", progress);
46} 44}
@@ -54,8 +52,6 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
54 { 52 {
55 ad->is_anim_paused = EINA_FALSE; 53 ad->is_anim_paused = EINA_FALSE;
56 elm_object_text_set(ad->pause_btn, "Pause Animation"); 54 elm_object_text_set(ad->pause_btn, "Pause Animation");
57
58 efl_animation_object_cancel(ad->anim_obj);
59 } 55 }
60 56
61 ad->is_btn_visible = !(ad->is_btn_visible); 57 ad->is_btn_visible = !(ad->is_btn_visible);
@@ -63,27 +59,17 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
63 if (ad->is_btn_visible) 59 if (ad->is_btn_visible)
64 { 60 {
65 //Create Animation Object from Animation 61 //Create Animation Object from Animation
66 ad->anim_obj = efl_animation_object_create(ad->show_anim); 62 efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
67 elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0"); 63 efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
68 } 64 }
69 else 65 else
70 { 66 {
71 //Create Animation Object from Animation 67 //Create Animation Object from Animation
72 ad->anim_obj = efl_animation_object_create(ad->hide_anim); 68 efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
73 elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0"); 69 efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
74 } 70 }
75
76 //Register callback called when animation starts
77 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, ad);
78
79 //Register callback called when animation ends
80 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
81
82 //Register callback called while animation is executed
83 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
84
85 //Let Animation Object start animation 71 //Let Animation Object start animation
86 efl_animation_object_start(ad->anim_obj); 72 efl_player_start(ad->anim_obj);
87} 73}
88 74
89static void 75static void
@@ -96,13 +82,13 @@ _pause_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
96 if (ad->is_anim_paused) 82 if (ad->is_anim_paused)
97 { 83 {
98 //Pause animation 84 //Pause animation
99 efl_animation_object_pause(ad->anim_obj); 85 efl_player_play_set(ad->anim_obj, EINA_FALSE);
100 elm_object_text_set(obj, "Resume Animation"); 86 elm_object_text_set(obj, "Resume Animation");
101 } 87 }
102 else 88 else
103 { 89 {
104 //Resume animation 90 //Resume animation
105 efl_animation_object_resume(ad->anim_obj); 91 efl_player_play_set(ad->anim_obj, EINA_TRUE);
106 elm_object_text_set(obj, "Pause Animation"); 92 elm_object_text_set(obj, "Pause Animation");
107 } 93 }
108} 94}
@@ -134,17 +120,15 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
134 evas_object_show(btn); 120 evas_object_show(btn);
135 121
136 //Show Animation 122 //Show Animation
137 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 123 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
138 efl_animation_alpha_set(show_anim, 0.0, 1.0); 124 efl_animation_alpha_set(show_anim, 0.0, 1.0);
139 efl_animation_duration_set(show_anim, 2.0); 125 efl_animation_duration_set(show_anim, 2.0);
140 efl_animation_target_set(show_anim, btn);
141 efl_animation_final_state_keep_set(show_anim, EINA_TRUE); 126 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
142 127
143 //Hide Animation 128 //Hide Animation
144 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 129 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
145 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 130 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
146 efl_animation_duration_set(hide_anim, 2.0); 131 efl_animation_duration_set(hide_anim, 2.0);
147 efl_animation_target_set(hide_anim, btn);
148 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE); 132 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
149 133
150 134
@@ -172,7 +156,16 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
172 //Initialize App Data 156 //Initialize App Data
173 ad->show_anim = show_anim; 157 ad->show_anim = show_anim;
174 ad->hide_anim = hide_anim; 158 ad->hide_anim = hide_anim;
175 ad->anim_obj = NULL; 159 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
160 efl_animation_player_target_set(efl_added, btn));
161
162 //Register callback called when animation starts
163 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad);
164 //Register callback called when animation ends
165 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
166 //Register callback called while animation is executed
167 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
168
176 ad->pause_btn = pause_btn; 169 ad->pause_btn = pause_btn;
177 ad->is_btn_visible = EINA_TRUE; 170 ad->is_btn_visible = EINA_TRUE;
178 ad->is_anim_paused = EINA_FALSE; 171 ad->is_anim_paused = EINA_FALSE;
diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c
index b5f7ac3ce1..47da4f1a92 100644
--- a/src/bin/elementary/test_efl_anim_repeat.c
+++ b/src/bin/elementary/test_efl_anim_repeat.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *show_anim; 8 Efl_Animation *show_anim;
9 Efl_Animation *hide_anim; 9 Efl_Animation *hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Evas_Object *start_btn; 12 Evas_Object *start_btn;
13 Evas_Object *repeat_count_spin; 13 Evas_Object *repeat_count_spin;
@@ -57,14 +57,12 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
57 57
58 elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE); 58 elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE);
59 elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE); 59 elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE);
60
61 ad->anim_obj = NULL;
62} 60}
63 61
64static void 62static void
65_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 63_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
66{ 64{
67 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 65 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
68 double progress = event_info->progress; 66 double progress = event_info->progress;
69 printf("Animation is running! Current progress(%lf)\n", progress); 67 printf("Animation is running! Current progress(%lf)\n", progress);
70} 68}
@@ -74,9 +72,6 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
74{ 72{
75 App_Data *ad = data; 73 App_Data *ad = data;
76 74
77 if (ad->anim_obj)
78 efl_animation_object_cancel(ad->anim_obj);
79
80 ad->is_btn_visible = !(ad->is_btn_visible); 75 ad->is_btn_visible = !(ad->is_btn_visible);
81 76
82 int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); 77 int repeat_count = elm_spinner_value_get(ad->repeat_count_spin);
@@ -94,8 +89,8 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
94 efl_animation_repeat_mode_set(ad->show_anim, repeat_mode); 89 efl_animation_repeat_mode_set(ad->show_anim, repeat_mode);
95 90
96 //Create Animation Object from Animation 91 //Create Animation Object from Animation
97 ad->anim_obj = efl_animation_object_create(ad->show_anim); 92 efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
98 elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0"); 93 efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
99 } 94 }
100 else 95 else
101 { 96 {
@@ -106,21 +101,12 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
106 efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode); 101 efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode);
107 102
108 //Create Animation Object from Animation 103 //Create Animation Object from Animation
109 ad->anim_obj = efl_animation_object_create(ad->hide_anim); 104 efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
110 elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0"); 105 efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
111 } 106 }
112 107
113 //Register callback called when animation starts
114 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
115
116 //Register callback called when animation ends
117 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
118
119 //Register callback called while animation is executed
120 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
121
122 //Let Animation Object start animation 108 //Let Animation Object start animation
123 efl_animation_object_start(ad->anim_obj); 109 efl_player_start(ad->anim_obj);
124} 110}
125 111
126static void 112static void
@@ -150,17 +136,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
150 evas_object_show(btn); 136 evas_object_show(btn);
151 137
152 //Show Animation 138 //Show Animation
153 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 139 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
154 efl_animation_alpha_set(show_anim, 0.0, 1.0); 140 efl_animation_alpha_set(show_anim, 0.0, 1.0);
155 efl_animation_duration_set(show_anim, 1.0); 141 efl_animation_duration_set(show_anim, 1.0);
156 efl_animation_target_set(show_anim, btn);
157 efl_animation_final_state_keep_set(show_anim, EINA_TRUE); 142 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
158 143
159 //Hide Animation 144 //Hide Animation
160 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 145 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
161 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 146 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
162 efl_animation_duration_set(hide_anim, 1.0); 147 efl_animation_duration_set(hide_anim, 1.0);
163 efl_animation_target_set(hide_anim, btn);
164 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE); 148 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
165 149
166 150
@@ -199,7 +183,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
199 //Initialize App Data 183 //Initialize App Data
200 ad->show_anim = show_anim; 184 ad->show_anim = show_anim;
201 ad->hide_anim = hide_anim; 185 ad->hide_anim = hide_anim;
202 ad->anim_obj = NULL; 186 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
187 efl_animation_player_target_set(efl_added, btn));
188 //Register callback called when animation starts
189 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
190 //Register callback called when animation ends
191 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
192 //Register callback called while animation is executed
193 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
194
203 ad->start_btn = start_btn; 195 ad->start_btn = start_btn;
204 ad->repeat_count_spin = repeat_count_spin; 196 ad->repeat_count_spin = repeat_count_spin;
205 ad->repeat_mode_spin = repeat_mode_spin; 197 ad->repeat_mode_spin = repeat_mode_spin;
diff --git a/src/bin/elementary/test_efl_anim_rotate.c b/src/bin/elementary/test_efl_anim_rotate.c
index 7fda359375..888e7ef1e4 100644
--- a/src/bin/elementary/test_efl_anim_rotate.c
+++ b/src/bin/elementary/test_efl_anim_rotate.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *cw_45_degrees_anim; 8 Efl_Animation *cw_45_degrees_anim;
9 Efl_Animation *ccw_45_degrees_anim; 9 Efl_Animation *ccw_45_degrees_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_rotated; 12 Eina_Bool is_btn_rotated;
13} App_Data; 13} App_Data;
@@ -19,19 +19,15 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27
28 ad->anim_obj = NULL;
29} 25}
30 26
31static void 27static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 28_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 29{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 30 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 31 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 32 printf("Animation is running! Current progress(%lf)\n", progress);
37} 33}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 37{
42 App_Data *ad = data; 38 App_Data *ad = data;
43 39
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_rotated = !(ad->is_btn_rotated); 40 ad->is_btn_rotated = !(ad->is_btn_rotated);
48 41
49 if (ad->is_btn_rotated) 42 if (ad->is_btn_rotated)
50 { 43 {
51 //Create Animation Object from Animation 44 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->cw_45_degrees_anim); 45 efl_animation_player_animation_set(ad->anim_obj, ad->cw_45_degrees_anim);
53 elm_object_text_set(obj, "Start Rotate Animation from 45 to 0 degrees"); 46 efl_text_set(obj, "Start Rotate Animation from 45 to 0 degrees");
54 } 47 }
55 else 48 else
56 { 49 {
57 //Create Animation Object from Animation 50 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->ccw_45_degrees_anim); 51 efl_animation_player_animation_set(ad->anim_obj, ad->ccw_45_degrees_anim);
59 elm_object_text_set(obj, "Start Rotate Animation from 0 to 45 degrees"); 52 efl_text_set(obj, "Start Rotate Animation from 0 to 45 degrees");
60 } 53 }
61 54
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 55 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 56 efl_player_start(ad->anim_obj);
73} 57}
74 58
75static void 59static void
@@ -99,23 +83,30 @@ test_efl_anim_rotate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
99 evas_object_show(btn); 83 evas_object_show(btn);
100 84
101 //Rotate from 0 to 45 degrees Animation 85 //Rotate from 0 to 45 degrees Animation
102 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 86 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
103 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5); 87 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0,NULL, 0.5, 0.5);
104 efl_animation_duration_set(cw_45_degrees_anim, 1.0); 88 efl_animation_duration_set(cw_45_degrees_anim, 1.0);
105 efl_animation_target_set(cw_45_degrees_anim, btn);
106 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE); 89 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
107 90
108 //Rotate from 45 to 0 degrees Animation 91 //Rotate from 45 to 0 degrees Animation
109 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 92 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
110 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5); 93 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
111 efl_animation_duration_set(ccw_45_degrees_anim, 1.0); 94 efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
112 efl_animation_target_set(ccw_45_degrees_anim, btn);
113 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE); 95 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
114 96
115 //Initialize App Data 97 //Initialize App Data
116 ad->cw_45_degrees_anim = cw_45_degrees_anim; 98 ad->cw_45_degrees_anim = cw_45_degrees_anim;
117 ad->ccw_45_degrees_anim = ccw_45_degrees_anim; 99 ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
118 ad->anim_obj = NULL; 100
101 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
102 efl_animation_player_target_set(efl_added, btn));
103 //Register callback called when animation starts
104 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
105 //Register callback called when animation ends
106 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
107 //Register callback called while animation is executed
108 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
109
119 ad->is_btn_rotated = EINA_FALSE; 110 ad->is_btn_rotated = EINA_FALSE;
120 111
121 //Button to start animation 112 //Button to start animation
@@ -159,23 +150,31 @@ test_efl_anim_rotate_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
159 evas_object_show(pivot); 150 evas_object_show(pivot);
160 151
161 //Rotate from 0 to 45 degrees Animation 152 //Rotate from 0 to 45 degrees Animation
162 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 153 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
163 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, 0.5, 0.5); 154 efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, 0.5, 0.5);
164 efl_animation_duration_set(cw_45_degrees_anim, 1.0); 155 efl_animation_duration_set(cw_45_degrees_anim, 1.0);
165 efl_animation_target_set(cw_45_degrees_anim, btn);
166 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE); 156 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
167 157
168 //Rotate from 45 to 0 degrees Animation 158 //Rotate from 45 to 0 degrees Animation
169 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 159 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
170 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, 0.5, 0.5); 160 efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, 0.5, 0.5);
171 efl_animation_duration_set(ccw_45_degrees_anim, 1.0); 161 efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
172 efl_animation_target_set(ccw_45_degrees_anim, btn);
173 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE); 162 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
174 163
175 //Initialize App Data 164 //Initialize App Data
176 ad->cw_45_degrees_anim = cw_45_degrees_anim; 165 ad->cw_45_degrees_anim = cw_45_degrees_anim;
177 ad->ccw_45_degrees_anim = ccw_45_degrees_anim; 166 ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
178 ad->anim_obj = NULL; 167 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
168 efl_animation_player_target_set(efl_added, btn));
169
170 //Register callback called when animation starts
171 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
172
173 //Register callback called when animation ends
174 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
175
176 //Register callback called while animation is executed
177 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
179 ad->is_btn_rotated = EINA_FALSE; 178 ad->is_btn_rotated = EINA_FALSE;
180 179
181 //Button to start animation 180 //Button to start animation
@@ -219,23 +218,30 @@ test_efl_anim_rotate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
219 evas_object_show(abs_center); 218 evas_object_show(abs_center);
220 219
221 //Rotate from 0 to 45 degrees Animation 220 //Rotate from 0 to 45 degrees Animation
222 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 221 Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
223 efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, 0, 0); 222 efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, 0, 0);
224 efl_animation_duration_set(cw_45_degrees_anim, 1.0); 223 efl_animation_duration_set(cw_45_degrees_anim, 1.0);
225 efl_animation_target_set(cw_45_degrees_anim, btn);
226 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE); 224 efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
227 225
228 //Rotate from 45 to 0 degrees Animation 226 //Rotate from 45 to 0 degrees Animation
229 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL); 227 Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, win);
230 efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, 0, 0); 228 efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, 0, 0);
231 efl_animation_duration_set(ccw_45_degrees_anim, 1.0); 229 efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
232 efl_animation_target_set(ccw_45_degrees_anim, btn);
233 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE); 230 efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
234 231
235 //Initialize App Data 232 //Initialize App Data
236 ad->cw_45_degrees_anim = cw_45_degrees_anim; 233 ad->cw_45_degrees_anim = cw_45_degrees_anim;
237 ad->ccw_45_degrees_anim = ccw_45_degrees_anim; 234 ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
238 ad->anim_obj = NULL; 235 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
236 efl_animation_player_target_set(efl_added, btn));
237
238 //Register callback called when animation starts
239 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
240 //Register callback called when animation ends
241 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
242 //Register callback called while animation is executed
243 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
244
239 ad->is_btn_rotated = EINA_FALSE; 245 ad->is_btn_rotated = EINA_FALSE;
240 246
241 //Button to start animation 247 //Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_scale.c b/src/bin/elementary/test_efl_anim_scale.c
index 02ba39c922..41d1c88b60 100644
--- a/src/bin/elementary/test_efl_anim_scale.c
+++ b/src/bin/elementary/test_efl_anim_scale.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *scale_double_anim; 8 Efl_Animation *scale_double_anim;
9 Efl_Animation *scale_half_anim; 9 Efl_Animation *scale_half_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_scaled; 12 Eina_Bool is_btn_scaled;
13} App_Data; 13} App_Data;
@@ -19,19 +19,15 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27
28 ad->anim_obj = NULL;
29} 25}
30 26
31static void 27static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 28_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 29{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 30 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 31 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 32 printf("Animation is running! Current progress(%lf)\n", progress);
37} 33}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 37{
42 App_Data *ad = data; 38 App_Data *ad = data;
43 39
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_scaled = !(ad->is_btn_scaled); 40 ad->is_btn_scaled = !(ad->is_btn_scaled);
48 41
49 if (ad->is_btn_scaled) 42 if (ad->is_btn_scaled)
50 { 43 {
51 //Create Animation Object from Animation 44 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->scale_double_anim); 45 efl_animation_player_animation_set(ad->anim_obj, ad->scale_double_anim);
53 elm_object_text_set(obj, "Start Scale Animation to zoom out"); 46 efl_text_set(obj, "Start Scale Animation to zoom out");
54 } 47 }
55 else 48 else
56 { 49 {
57 //Create Animation Object from Animation 50 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->scale_half_anim); 51 efl_animation_player_animation_set(ad->anim_obj, ad->scale_half_anim);
59 elm_object_text_set(obj, "Start Scale Animation to zoom in"); 52 efl_text_set(obj, "Start Scale Animation to zoom in");
60 } 53 }
61 54
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 55 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 56 efl_player_start(ad->anim_obj);
73} 57}
74 58
75static void 59static void
@@ -99,23 +83,32 @@ test_efl_anim_scale(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
99 evas_object_show(btn); 83 evas_object_show(btn);
100 84
101 //Scale Animation to zoom in 85 //Scale Animation to zoom in
102 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 86 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
103 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5); 87 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
104 efl_animation_duration_set(scale_double_anim, 1.0); 88 efl_animation_duration_set(scale_double_anim, 1.0);
105 efl_animation_target_set(scale_double_anim, btn);
106 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE); 89 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
107 90
108 //Scale Animation to zoom out 91 //Scale Animation to zoom out
109 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 92 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
110 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5); 93 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
111 efl_animation_duration_set(scale_half_anim, 1.0); 94 efl_animation_duration_set(scale_half_anim, 1.0);
112 efl_animation_target_set(scale_half_anim, btn);
113 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE); 95 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
114 96
115 //Initialize App Data 97 //Initialize App Data
116 ad->scale_double_anim = scale_double_anim; 98 ad->scale_double_anim = scale_double_anim;
117 ad->scale_half_anim = scale_half_anim; 99 ad->scale_half_anim = scale_half_anim;
118 ad->anim_obj = NULL; 100 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, NULL,
101 efl_animation_player_target_set(efl_added, btn));
102
103 //Register callback called when animation starts
104 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
105
106 //Register callback called when animation ends
107 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
108
109 //Register callback called while animation is executed
110 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
111
119 ad->is_btn_scaled = EINA_FALSE; 112 ad->is_btn_scaled = EINA_FALSE;
120 113
121 //Button to start animation 114 //Button to start animation
@@ -159,23 +152,29 @@ test_efl_anim_scale_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
159 evas_object_show(pivot); 152 evas_object_show(pivot);
160 153
161 //Scale Animation to zoom in 154 //Scale Animation to zoom in
162 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 155 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
163 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, pivot, 0.5, 0.5); 156 efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, pivot, 0.5, 0.5);
164 efl_animation_duration_set(scale_double_anim, 1.0); 157 efl_animation_duration_set(scale_double_anim, 1.0);
165 efl_animation_target_set(scale_double_anim, btn);
166 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE); 158 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
167 159
168 //Scale Animation to zoom out 160 //Scale Animation to zoom out
169 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 161 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
170 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, pivot, 0.5, 0.5); 162 efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, pivot, 0.5, 0.5);
171 efl_animation_duration_set(scale_half_anim, 1.0); 163 efl_animation_duration_set(scale_half_anim, 1.0);
172 efl_animation_target_set(scale_half_anim, btn);
173 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE); 164 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
174 165
175 //Initialize App Data 166 //Initialize App Data
176 ad->scale_double_anim = scale_double_anim; 167 ad->scale_double_anim = scale_double_anim;
177 ad->scale_half_anim = scale_half_anim; 168 ad->scale_half_anim = scale_half_anim;
178 ad->anim_obj = NULL; 169 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
170 efl_animation_player_target_set(efl_added, btn));
171 //Register callback called when animation starts
172 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
173 //Register callback called when animation ends
174 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
175 //Register callback called while animation is executed
176 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
177
179 ad->is_btn_scaled = EINA_FALSE; 178 ad->is_btn_scaled = EINA_FALSE;
180 179
181 //Button to start animation 180 //Button to start animation
@@ -219,23 +218,29 @@ test_efl_anim_scale_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
219 evas_object_show(abs_center); 218 evas_object_show(abs_center);
220 219
221 //Scale Animation to zoom in 220 //Scale Animation to zoom in
222 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 221 Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
223 efl_animation_scale_absolute_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, 0, 0); 222 efl_animation_scale_absolute_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, 0, 0);
224 efl_animation_duration_set(scale_double_anim, 1.0); 223 efl_animation_duration_set(scale_double_anim, 1.0);
225 efl_animation_target_set(scale_double_anim, btn);
226 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE); 224 efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
227 225
228 //Scale Animation to zoom out 226 //Scale Animation to zoom out
229 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL); 227 Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, win);
230 efl_animation_scale_absolute_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, 0, 0); 228 efl_animation_scale_absolute_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, 0, 0);
231 efl_animation_duration_set(scale_half_anim, 1.0); 229 efl_animation_duration_set(scale_half_anim, 1.0);
232 efl_animation_target_set(scale_half_anim, btn);
233 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE); 230 efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
234 231
235 //Initialize App Data 232 //Initialize App Data
236 ad->scale_double_anim = scale_double_anim; 233 ad->scale_double_anim = scale_double_anim;
237 ad->scale_half_anim = scale_half_anim; 234 ad->scale_half_anim = scale_half_anim;
238 ad->anim_obj = NULL; 235 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
236 efl_animation_player_target_set(efl_added, btn));
237 //Register callback called when animation starts
238 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
239 //Register callback called when animation ends
240 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
241 //Register callback called while animation is executed
242 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
243
239 ad->is_btn_scaled = EINA_FALSE; 244 ad->is_btn_scaled = EINA_FALSE;
240 245
241 //Button to start animation 246 //Button to start animation
diff --git a/src/bin/elementary/test_efl_anim_start_delay.c b/src/bin/elementary/test_efl_anim_start_delay.c
index 63cab0f18e..06101e2eeb 100644
--- a/src/bin/elementary/test_efl_anim_start_delay.c
+++ b/src/bin/elementary/test_efl_anim_start_delay.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *show_anim; 8 Efl_Animation *show_anim;
9 Efl_Animation *hide_anim; 9 Efl_Animation *hide_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Evas_Object *start_delay_spin; 12 Evas_Object *start_delay_spin;
13 13
@@ -28,14 +28,12 @@ _anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
28 printf("Animation has been ended!\n"); 28 printf("Animation has been ended!\n");
29 29
30 elm_object_disabled_set(ad->start_delay_spin, EINA_FALSE); 30 elm_object_disabled_set(ad->start_delay_spin, EINA_FALSE);
31
32 ad->anim_obj = NULL;
33} 31}
34 32
35static void 33static void
36_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 34_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
37{ 35{
38 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 36 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
39 double progress = event_info->progress; 37 double progress = event_info->progress;
40 printf("Animation is running! Current progress(%lf)\n", progress); 38 printf("Animation is running! Current progress(%lf)\n", progress);
41} 39}
@@ -45,9 +43,6 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
45{ 43{
46 App_Data *ad = data; 44 App_Data *ad = data;
47 45
48 if (ad->anim_obj)
49 efl_animation_object_cancel(ad->anim_obj);
50
51 ad->is_btn_visible = !(ad->is_btn_visible); 46 ad->is_btn_visible = !(ad->is_btn_visible);
52 47
53 double start_delay = elm_spinner_value_get(ad->start_delay_spin); 48 double start_delay = elm_spinner_value_get(ad->start_delay_spin);
@@ -59,8 +54,8 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
59 efl_animation_start_delay_set(ad->show_anim, start_delay); 54 efl_animation_start_delay_set(ad->show_anim, start_delay);
60 55
61 //Create Animation Object from Animation 56 //Create Animation Object from Animation
62 ad->anim_obj = efl_animation_object_create(ad->show_anim); 57 efl_animation_player_animation_set(ad->anim_obj, ad->show_anim);
63 elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0"); 58 efl_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
64 } 59 }
65 else 60 else
66 { 61 {
@@ -68,21 +63,12 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
68 efl_animation_start_delay_set(ad->hide_anim, start_delay); 63 efl_animation_start_delay_set(ad->hide_anim, start_delay);
69 64
70 //Create Animation Object from Animation 65 //Create Animation Object from Animation
71 ad->anim_obj = efl_animation_object_create(ad->hide_anim); 66 efl_animation_player_animation_set(ad->anim_obj, ad->hide_anim);
72 elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0"); 67 efl_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
73 } 68 }
74 69
75 //Register callback called when animation starts
76 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
77
78 //Register callback called when animation ends
79 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
80
81 //Register callback called while animation is executed
82 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
83
84 //Let Animation Object start animation 70 //Let Animation Object start animation
85 efl_animation_object_start(ad->anim_obj); 71 efl_player_start(ad->anim_obj);
86} 72}
87 73
88static void 74static void
@@ -112,17 +98,15 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
112 evas_object_show(btn); 98 evas_object_show(btn);
113 99
114 //Show Animation 100 //Show Animation
115 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 101 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
116 efl_animation_alpha_set(show_anim, 0.0, 1.0); 102 efl_animation_alpha_set(show_anim, 0.0, 1.0);
117 efl_animation_duration_set(show_anim, 1.0); 103 efl_animation_duration_set(show_anim, 1.0);
118 efl_animation_target_set(show_anim, btn);
119 efl_animation_final_state_keep_set(show_anim, EINA_TRUE); 104 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
120 105
121 //Hide Animation 106 //Hide Animation
122 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL); 107 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, win);
123 efl_animation_alpha_set(hide_anim, 1.0, 0.0); 108 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
124 efl_animation_duration_set(hide_anim, 1.0); 109 efl_animation_duration_set(hide_anim, 1.0);
125 efl_animation_target_set(hide_anim, btn);
126 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE); 110 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
127 111
128 112
@@ -150,7 +134,16 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
150 //Initialize App Data 134 //Initialize App Data
151 ad->show_anim = show_anim; 135 ad->show_anim = show_anim;
152 ad->hide_anim = hide_anim; 136 ad->hide_anim = hide_anim;
153 ad->anim_obj = NULL; 137 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
138 efl_animation_player_target_set(efl_added, btn));
139
140 //Register callback called when animation starts
141 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
142 //Register callback called when animation ends
143 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad);
144 //Register callback called while animation is executed
145 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
146
154 ad->start_delay_spin = start_delay_spin; 147 ad->start_delay_spin = start_delay_spin;
155 ad->is_btn_visible = EINA_TRUE; 148 ad->is_btn_visible = EINA_TRUE;
156 149
diff --git a/src/bin/elementary/test_efl_anim_translate.c b/src/bin/elementary/test_efl_anim_translate.c
index d76e927f67..2ba1ff4e19 100644
--- a/src/bin/elementary/test_efl_anim_translate.c
+++ b/src/bin/elementary/test_efl_anim_translate.c
@@ -7,7 +7,7 @@ typedef struct _App_Data
7{ 7{
8 Efl_Animation *translate_rb_anim; 8 Efl_Animation *translate_rb_anim;
9 Efl_Animation *translate_lt_anim; 9 Efl_Animation *translate_lt_anim;
10 Efl_Animation_Object *anim_obj; 10 Efl_Animation_Player *anim_obj;
11 11
12 Eina_Bool is_btn_translated; 12 Eina_Bool is_btn_translated;
13} App_Data; 13} App_Data;
@@ -19,19 +19,15 @@ _anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19} 19}
20 20
21static void 21static void
22_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED) 22_anim_ended_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
23{ 23{
24 App_Data *ad = data;
25
26 printf("Animation has been ended!\n"); 24 printf("Animation has been ended!\n");
27
28 ad->anim_obj = NULL;
29} 25}
30 26
31static void 27static void
32_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event) 28_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
33{ 29{
34 Efl_Animation_Object_Running_Event_Info *event_info = event->info; 30 Efl_Animation_Player_Running_Event_Info *event_info = event->info;
35 double progress = event_info->progress; 31 double progress = event_info->progress;
36 printf("Animation is running! Current progress(%lf)\n", progress); 32 printf("Animation is running! Current progress(%lf)\n", progress);
37} 33}
@@ -41,35 +37,23 @@ _btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
41{ 37{
42 App_Data *ad = data; 38 App_Data *ad = data;
43 39
44 if (ad->anim_obj)
45 efl_animation_object_cancel(ad->anim_obj);
46
47 ad->is_btn_translated = !(ad->is_btn_translated); 40 ad->is_btn_translated = !(ad->is_btn_translated);
48 41
49 if (ad->is_btn_translated) 42 if (ad->is_btn_translated)
50 { 43 {
51 //Create Animation Object from Animation 44 //Create Animation Object from Animation
52 ad->anim_obj = efl_animation_object_create(ad->translate_rb_anim); 45 efl_animation_player_animation_set(ad->anim_obj, ad->translate_rb_anim);
53 elm_object_text_set(obj, "Start Translate Animation to left top"); 46 efl_text_set(obj, "Start Translate Animation to left top");
54 } 47 }
55 else 48 else
56 { 49 {
57 //Create Animation Object from Animation 50 //Create Animation Object from Animation
58 ad->anim_obj = efl_animation_object_create(ad->translate_lt_anim); 51 efl_animation_player_animation_set(ad->anim_obj, ad->translate_lt_anim);
59 elm_object_text_set(obj, "Start Translate Animation to right bottom"); 52 efl_text_set(obj, "Start Translate Animation to right bottom");
60 } 53 }
61 54
62 //Register callback called when animation starts
63 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
64
65 //Register callback called when animation ends
66 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
67
68 //Register callback called while animation is executed
69 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
70
71 //Let Animation Object start animation 55 //Let Animation Object start animation
72 efl_animation_object_start(ad->anim_obj); 56 efl_player_start(ad->anim_obj);
73} 57}
74 58
75static void 59static void
@@ -99,23 +83,29 @@ test_efl_anim_translate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
99 evas_object_show(btn); 83 evas_object_show(btn);
100 84
101 //Translate Animation to right bottom relatively 85 //Translate Animation to right bottom relatively
102 Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL); 86 Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, win);
103 efl_animation_translate_set(translate_rb_anim, 0, 0, 100, 100); 87 efl_animation_translate_set(translate_rb_anim, 0, 0, 100, 100);
104 efl_animation_duration_set(translate_rb_anim, 1.0); 88 efl_animation_duration_set(translate_rb_anim, 1.0);
105 efl_animation_target_set(translate_rb_anim, btn);
106 efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE); 89 efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
107 90
108 //Translate Animation to left top relatively 91 //Translate Animation to left top relatively
109 Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL); 92 Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, win);
110 efl_animation_translate_set(translate_lt_anim, 100, 100, 0, 0); 93 efl_animation_translate_set(translate_lt_anim, 100, 100, 0, 0);
111 efl_animation_duration_set(translate_lt_anim, 1.0); 94 efl_animation_duration_set(translate_lt_anim, 1.0);
112 efl_animation_target_set(translate_lt_anim, btn);
113 efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE); 95 efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
114 96
115 //Initialize App Data 97 //Initialize App Data
116 ad->translate_rb_anim = translate_rb_anim; 98 ad->translate_rb_anim = translate_rb_anim;
117 ad->translate_lt_anim = translate_lt_anim; 99 ad->translate_lt_anim = translate_lt_anim;
118 ad->anim_obj = NULL; 100 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
101 efl_animation_player_target_set(efl_added, btn));
102 //Register callback called when animation starts
103 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
104 //Register callback called when animation ends
105 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
106 //Register callback called while animation is executed
107 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
108
119 ad->is_btn_translated = EINA_FALSE; 109 ad->is_btn_translated = EINA_FALSE;
120 110
121 //Button to start animation 111 //Button to start animation
@@ -159,24 +149,29 @@ test_efl_anim_translate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_U
159 evas_object_show(abs_center); 149 evas_object_show(abs_center);
160 150
161 //Translate Animation to right bottom absolutely 151 //Translate Animation to right bottom absolutely
162 Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL); 152 Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, win);
163 efl_animation_translate_absolute_set(translate_rb_anim, 0, 0, 100, 100); 153 efl_animation_translate_absolute_set(translate_rb_anim, 0, 0, 100, 100);
164 efl_animation_duration_set(translate_rb_anim, 1.0); 154 efl_animation_duration_set(translate_rb_anim, 1.0);
165 efl_animation_target_set(translate_rb_anim, btn);
166 efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE); 155 efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
167 156
168 //Translate Animation to left top absolutely 157 //Translate Animation to left top absolutely
169 Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL); 158 Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, win);
170 efl_animation_translate_absolute_set(translate_lt_anim, 100, 100, 0, 0); 159 efl_animation_translate_absolute_set(translate_lt_anim, 100, 100, 0, 0);
171 efl_animation_duration_set(translate_lt_anim, 1.0); 160 efl_animation_duration_set(translate_lt_anim, 1.0);
172 efl_animation_target_set(translate_lt_anim, btn);
173 efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE); 161 efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
174 162
175 //Initialize App Data 163 //Initialize App Data
176 ad->translate_rb_anim = translate_rb_anim; 164 ad->translate_rb_anim = translate_rb_anim;
177 ad->translate_lt_anim = translate_lt_anim; 165 ad->translate_lt_anim = translate_lt_anim;
178 ad->anim_obj = NULL;
179 ad->is_btn_translated = EINA_FALSE; 166 ad->is_btn_translated = EINA_FALSE;
167 ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
168 efl_animation_player_target_set(efl_added, btn));
169 //Register callback called when animation starts
170 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
171 //Register callback called when animation ends
172 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, NULL);
173 //Register callback called while animation is executed
174 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL);
180 175
181 //Button to start animation 176 //Button to start animation
182 Evas_Object *btn2 = elm_button_add(win); 177 Evas_Object *btn2 = elm_button_add(win);
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 8505afa176..fac7a995aa 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -82,6 +82,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
82#include "interfaces/efl_image_animated.eo.h" 82#include "interfaces/efl_image_animated.eo.h"
83#include "interfaces/efl_image_load.eo.h" 83#include "interfaces/efl_image_load.eo.h"
84#include "interfaces/efl_part.eo.h" 84#include "interfaces/efl_part.eo.h"
85#include "interfaces/efl_playable.eo.h"
85#include "interfaces/efl_player.eo.h" 86#include "interfaces/efl_player.eo.h"
86#include "interfaces/efl_text.eo.h" 87#include "interfaces/efl_text.eo.h"
87#include "interfaces/efl_text_types.eot.h" 88#include "interfaces/efl_text_types.eot.h"
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index af61237416..a203c338d5 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -15,6 +15,7 @@
15#include "interfaces/efl_image_animated.eo.c" 15#include "interfaces/efl_image_animated.eo.c"
16#include "interfaces/efl_image_load.eo.c" 16#include "interfaces/efl_image_load.eo.c"
17#include "interfaces/efl_part.eo.c" 17#include "interfaces/efl_part.eo.c"
18#include "interfaces/efl_playable.eo.c"
18#include "interfaces/efl_player.eo.c" 19#include "interfaces/efl_player.eo.c"
19#include "interfaces/efl_text.eo.c" 20#include "interfaces/efl_text.eo.c"
20#include "interfaces/efl_text_properties.eo.c" 21#include "interfaces/efl_text_properties.eo.c"
diff --git a/src/lib/efl/interfaces/efl_playable.eo b/src/lib/efl/interfaces/efl_playable.eo
new file mode 100644
index 0000000000..56dbc9e51b
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_playable.eo
@@ -0,0 +1,29 @@
1interface Efl.Playable
2{
3 [[Efl media playable interface]]
4 methods {
5 @property length {
6 [[Get the length of play for the media file.]]
7 get {
8 }
9 values {
10 length: double; [[The length of the stream in seconds.]]
11 }
12 }
13 @property playable {
14 get {
15 }
16 values {
17 playable: bool;
18 }
19 }
20 @property seekable {
21 [[Get whether the media file is seekable.]]
22 get {
23 }
24 values {
25 seekable: bool; [[$true if seekable.]]
26 }
27 }
28 }
29}
diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo
index 86c2c5296c..2e977d94be 100644
--- a/src/lib/efl/interfaces/efl_player.eo
+++ b/src/lib/efl/interfaces/efl_player.eo
@@ -2,8 +2,14 @@ interface Efl.Player
2{ 2{
3 [[Efl media player interface]] 3 [[Efl media player interface]]
4 methods { 4 methods {
5 start {
6 [[Start a playing playable object.]]
7 }
8 stop {
9 [[Stop playable object.]]
10 }
5 @property playable { 11 @property playable {
6 [[Whether or not the object data can be played.]] 12 [[Whether or not the playable can be played.]]
7 get { 13 get {
8 } 14 }
9 values { 15 values {
diff --git a/src/lib/elementary/efl_ui_video.c b/src/lib/elementary/efl_ui_video.c
index 9046777b07..9d19b8ad4d 100644
--- a/src/lib/elementary/efl_ui_video.c
+++ b/src/lib/elementary/efl_ui_video.c
@@ -99,7 +99,7 @@ _key_action_move(Evas_Object *obj, const char *params)
99static Eina_Bool 99static Eina_Bool
100_key_action_play(Evas_Object *obj, const char *params EINA_UNUSED) 100_key_action_play(Evas_Object *obj, const char *params EINA_UNUSED)
101{ 101{
102 if (elm_video_is_playing_get(obj)) 102 if (efl_player_play_get(obj))
103 elm_video_pause(obj); 103 elm_video_pause(obj);
104 else 104 else
105 elm_video_play(obj); 105 elm_video_play(obj);
@@ -305,33 +305,39 @@ _efl_ui_video_emotion_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
305} 305}
306 306
307EOLIAN static void 307EOLIAN static void
308_efl_ui_video_play(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd) 308_efl_ui_video_efl_player_start(Eo *obj, Efl_Ui_Video_Data *sd EINA_UNUSED)
309{ 309{
310 if (emotion_object_play_get(sd->emotion)) return; 310 efl_player_position_set(obj, 0.0);
311 311 efl_player_play_set(obj, EINA_TRUE);
312 ELM_SAFE_FREE(sd->timer, ecore_timer_del);
313 sd->stop = EINA_FALSE;
314 emotion_object_play_set(sd->emotion, EINA_TRUE);
315 elm_layout_signal_emit(obj, "elm,video,play", "elm");
316} 312}
317 313
318/* FIXME: pause will setup timer and go into sleep or
319 * hibernate after a while without activity.
320 */
321EOLIAN static void 314EOLIAN static void
322_efl_ui_video_pause(Eo *obj, Efl_Ui_Video_Data *sd) 315_efl_ui_video_efl_player_play_set(Eo *obj, Efl_Ui_Video_Data *sd, Eina_Bool play)
323{ 316{
324 if (!emotion_object_play_get(sd->emotion)) return; 317 if (emotion_object_play_get(sd->emotion) == !!play) return;
325 318
326 if (!sd->timer) sd->timer = ecore_timer_add(20.0, _suspend_cb, obj); 319 if (play)
327 emotion_object_play_set(sd->emotion, EINA_FALSE); 320 {
328 elm_layout_signal_emit(obj, "elm,video,pause", "elm"); 321 ELM_SAFE_FREE(sd->timer, ecore_timer_del);
322 sd->stop = EINA_FALSE;
323 emotion_object_play_set(sd->emotion, EINA_TRUE);
324 elm_layout_signal_emit(obj, "elm,video,play", "elm");
325 }
326 else
327 {
328 /* FIXME: pause will setup timer and go into sleep or
329 * hibernate after a while without activity.
330 */
331 if (!sd->timer) sd->timer = ecore_timer_add(20.0, _suspend_cb, obj);
332 emotion_object_play_set(sd->emotion, EINA_FALSE);
333 elm_layout_signal_emit(obj, "elm,video,pause", "elm");
334 }
329} 335}
330 336
331/* FIXME: stop should go into hibernate state directly. 337/* FIXME: stop should go into hibernate state directly.
332 */ 338 */
333EOLIAN static void 339EOLIAN static void
334_efl_ui_video_stop(Eo *obj, Efl_Ui_Video_Data *sd) 340_efl_ui_video_efl_player_stop(Eo *obj, Efl_Ui_Video_Data *sd)
335{ 341{
336 if (!emotion_object_play_get(sd->emotion) && sd->stop) return; 342 if (!emotion_object_play_get(sd->emotion) && sd->stop) return;
337 343
@@ -344,7 +350,7 @@ _efl_ui_video_stop(Eo *obj, Efl_Ui_Video_Data *sd)
344} 350}
345 351
346EOLIAN static Eina_Bool 352EOLIAN static Eina_Bool
347_efl_ui_video_is_playing_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd) 353_efl_ui_video_efl_player_play_get(Eo *obj EINA_UNUSED, Efl_Ui_Video_Data *sd)
348{ 354{
349 return emotion_object_play_get(sd->emotion); 355 return emotion_object_play_get(sd->emotion);
350} 356}
@@ -445,6 +451,30 @@ elm_video_play_position_get(const Evas_Object *obj)
445 return efl_player_position_get(obj); 451 return efl_player_position_get(obj);
446} 452}
447 453
454EAPI Eina_Bool
455elm_video_is_playing_get(Evas_Object *obj)
456{
457 return efl_player_play_get(obj);
458}
459
460EAPI void
461elm_video_play(Evas_Object *obj)
462{
463 efl_player_play_set(obj, EINA_TRUE);
464}
465
466EAPI void
467elm_video_stop(Evas_Object *obj)
468{
469 efl_player_stop(obj);
470}
471
472EAPI void
473elm_video_pause(Evas_Object *obj)
474{
475 efl_player_play_set(obj, EINA_FALSE);
476}
477
448/* Internal EO APIs and hidden overrides */ 478/* Internal EO APIs and hidden overrides */
449 479
450ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data) 480ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_video, Efl_Ui_Video_Data)
diff --git a/src/lib/elementary/efl_ui_video.eo b/src/lib/elementary/efl_ui_video.eo
index 87d4b586b3..5971f26df4 100644
--- a/src/lib/elementary/efl_ui_video.eo
+++ b/src/lib/elementary/efl_ui_video.eo
@@ -23,16 +23,6 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
23 remember: bool; [[$true when the object can remember the last position, $false otherwise]] 23 remember: bool; [[$true when the object can remember the last position, $false otherwise]]
24 } 24 }
25 } 25 }
26 @property is_playing {
27 get {
28 [[Is the video actually playing.
29
30 You should consider watching event on the object instead of
31 polling the object state.
32 ]]
33 return: bool; [[$true if the video is playing, $false otherwise]]
34 }
35 }
36 @property emotion { 26 @property emotion {
37 get { 27 get {
38 [[Get the underlying Emotion object.]] 28 [[Get the underlying Emotion object.]]
@@ -50,15 +40,6 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
50 return: string; [[A string containing the title.]] 40 return: string; [[A string containing the title.]]
51 } 41 }
52 } 42 }
53 play {
54 [[Start playing a video.]]
55 }
56 pause {
57 [[Pause a video.]]
58 }
59 stop {
60 [[Stop a video.]]
61 }
62 } 43 }
63 implements { 44 implements {
64 class.constructor; 45 class.constructor;
@@ -66,5 +47,8 @@ class Efl.Ui.Video (Efl.Ui.Layout, Efl.File,
66 Efl.File.file { get; set; } 47 Efl.File.file { get; set; }
67 Efl.Ui.Widget.widget_event; 48 Efl.Ui.Widget.widget_event;
68 Efl.Access.Widget.Action.elm_actions { get; } 49 Efl.Access.Widget.Action.elm_actions { get; }
50 Efl.Player.start;
51 Efl.Player.stop;
52 Efl.Player.play { get; set; }
69 } 53 }
70} 54}
diff --git a/src/lib/elementary/efl_ui_video_legacy.h b/src/lib/elementary/efl_ui_video_legacy.h
index 0cc087b02b..a92a1e3284 100644
--- a/src/lib/elementary/efl_ui_video_legacy.h
+++ b/src/lib/elementary/efl_ui_video_legacy.h
@@ -135,4 +135,36 @@ EAPI void elm_video_play_position_set(Evas_Object *obj, double position);
135 */ 135 */
136EAPI double elm_video_play_position_get(const Evas_Object *obj); 136EAPI double elm_video_play_position_get(const Evas_Object *obj);
137 137
138/**
139 * @brief Get whether the video actually playing.
140 * You should consider watching event on the object instead of
141 * polling the object state.
142 *
143 * @return @c true if the video is playing, @c false otherwise.
144 *
145 * @ingroup Elm_Video
146 */
147EAPI Eina_Bool elm_video_is_playing_get(Evas_Object *obj);
148
149/**
150 * @brief Start playing a video.
151 *
152 * @ingroup Elm_Video
153 */
154EAPI void elm_video_play(Evas_Object *obj);
155
156/**
157 * @brief Stop a video.
158 *
159 * @ingroup Elm_Video
160 */
161EAPI void elm_video_stop(Evas_Object *obj);
162
163/**
164 * @brief Pause a video.
165 *
166 * @ingroup Elm_Video
167 */
168EAPI void elm_video_pause(Evas_Object *obj);
169
138#include "efl_ui_video.eo.legacy.h" 170#include "efl_ui_video.eo.legacy.h"
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 356edc7c3a..fd745ce1be 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3386,45 +3386,45 @@ typedef Eo Efl_Animation_Group_Sequential;
3386 3386
3387#endif 3387#endif
3388 3388
3389#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3389#ifndef _EFL_ANIMATION_PLAYER_EO_CLASS_TYPE
3390#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3390#define _EFL_ANIMATION_PLAYER_EO_CLASS_TYPE
3391 3391
3392typedef Eo Efl_Animation_Object; 3392typedef Eo Efl_Animation_Player;
3393 3393
3394#endif 3394#endif
3395 3395
3396#ifndef _EFL_ANIMATION_OBJECT_ALPHA_EO_CLASS_TYPE 3396#ifndef _EFL_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
3397#define _EFL_ANIMATION_OBJECT_ALPHA_EO_CLASS_TYPE 3397#define _EFL_ANIMATION_PLAYER_ALPHA_EO_CLASS_TYPE
3398 3398
3399typedef Eo Efl_Animation_Object_Alpha; 3399typedef Eo Efl_Animation_Player_Alpha;
3400 3400
3401#endif 3401#endif
3402 3402
3403#ifndef _EFL_ANIMATION_OBJECT_ROTATE_EO_CLASS_TYPE 3403#ifndef _EFL_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
3404#define _EFL_ANIMATION_OBJECT_ROTATE_EO_CLASS_TYPE 3404#define _EFL_ANIMATION_PLAYER_ROTATE_EO_CLASS_TYPE
3405 3405
3406typedef Eo Efl_Animation_Object_Rotate; 3406typedef Eo Efl_Animation_Player_Rotate;
3407 3407
3408#endif 3408#endif
3409 3409
3410#ifndef _EFL_ANIMATION_OBJECT_SCALE_EO_CLASS_TYPE 3410#ifndef _EFL_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
3411#define _EFL_ANIMATION_OBJECT_SCALE_EO_CLASS_TYPE 3411#define _EFL_ANIMATION_PLAYER_SCALE_EO_CLASS_TYPE
3412 3412
3413typedef Eo Efl_Animation_Object_Scale; 3413typedef Eo Efl_Animation_Player_Scale;
3414 3414
3415#endif 3415#endif
3416 3416
3417#ifndef _EFL_ANIMATION_OBJECT_TRANSLATE_EO_CLASS_TYPE 3417#ifndef _EFL_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
3418#define _EFL_ANIMATION_OBJECT_TRANSLATE_EO_CLASS_TYPE 3418#define _EFL_ANIMATION_PLAYER_TRANSLATE_EO_CLASS_TYPE
3419 3419
3420typedef Eo Efl_Animation_Object_Translate; 3420typedef Eo Efl_Animation_Player_Translate;
3421 3421
3422#endif 3422#endif
3423 3423
3424#ifndef _EFL_ANIMATION_OBJECT_GROUP_EO_CLASS_TYPE 3424#ifndef _EFL_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
3425#define _EFL_ANIMATION_OBJECT_GROUP_EO_CLASS_TYPE 3425#define _EFL_ANIMATION_PLAYER_GROUP_EO_CLASS_TYPE
3426 3426
3427typedef Eo Efl_Animation_Object_Group; 3427typedef Eo Efl_Animation_Player_Group;
3428 3428
3429#endif 3429#endif
3430 3430
@@ -3442,16 +3442,16 @@ typedef Eo Efl_Animation_Group_Sequential;
3442 3442
3443#endif 3443#endif
3444 3444
3445struct _Efl_Animation_Object_Running_Event_Info 3445struct _Efl_Animation_Player_Running_Event_Info
3446{ 3446{
3447 double progress; 3447 double progress;
3448}; 3448};
3449 3449
3450#define EFL_ANIMATION_GROUP_DURATION_NONE -1 3450#define EFL_ANIMATION_GROUP_DURATION_NONE -1
3451#define EFL_ANIMATION_OBJECT_GROUP_DURATION_NONE -1 3451#define EFL_ANIMATION_PLAYER_GROUP_DURATION_NONE -1
3452 3452
3453#define EFL_ANIMATION_REPEAT_INFINITE -1 3453#define EFL_ANIMATION_REPEAT_INFINITE -1
3454#define EFL_ANIMATION_OBJECT_REPEAT_INFINITE -1 3454#define EFL_ANIMATION_PLAYER_REPEAT_INFINITE -1
3455 3455
3456/** 3456/**
3457 * @} 3457 * @}
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index fcc7fc67fe..d6664a2ddd 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -61,14 +61,7 @@
61#include "canvas/efl_animation_group.eo.h" 61#include "canvas/efl_animation_group.eo.h"
62#include "canvas/efl_animation_group_parallel.eo.h" 62#include "canvas/efl_animation_group_parallel.eo.h"
63#include "canvas/efl_animation_group_sequential.eo.h" 63#include "canvas/efl_animation_group_sequential.eo.h"
64#include "canvas/efl_animation_object.eo.h" 64#include "canvas/efl_animation_player.eo.h"
65#include "canvas/efl_animation_object_alpha.eo.h"
66#include "canvas/efl_animation_object_rotate.eo.h"
67#include "canvas/efl_animation_object_scale.eo.h"
68#include "canvas/efl_animation_object_translate.eo.h"
69#include "canvas/efl_animation_object_group.eo.h"
70#include "canvas/efl_animation_object_group_parallel.eo.h"
71#include "canvas/efl_animation_object_group_sequential.eo.h"
72 65
73#endif /* EFL_EO_API_SUPPORT */ 66#endif /* EFL_EO_API_SUPPORT */
74 67
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index 5dcf351066..a8a0361a9d 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -89,79 +89,10 @@ EWAPI extern const Efl_Event_Description _EVAS_CANVAS_EVENT_VIEWPORT_RESIZE;
89#define EFL_CANVAS_GROUP_ADD_OPS(kls) EFL_OBJECT_OP_FUNC(efl_canvas_group_add, _##kls##_efl_canvas_group_group_add) 89#define EFL_CANVAS_GROUP_ADD_OPS(kls) EFL_OBJECT_OP_FUNC(efl_canvas_group_add, _##kls##_efl_canvas_group_group_add)
90#define EFL_CANVAS_GROUP_ADD_DEL_OPS(kls) EFL_CANVAS_GROUP_ADD_OPS(kls), EFL_CANVAS_GROUP_DEL_OPS(kls) 90#define EFL_CANVAS_GROUP_ADD_DEL_OPS(kls) EFL_CANVAS_GROUP_ADD_OPS(kls), EFL_CANVAS_GROUP_DEL_OPS(kls)
91 91
92/* Efl.Animation.Object */ 92/* Efl.Animation.Player */
93EOAPI void efl_animation_object_target_set(Eo *obj, Efl_Canvas_Object *target); 93EWAPI extern const Efl_Event_Description _EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED;
94EOAPI Efl_Canvas_Object *efl_animation_object_target_get(const Eo *obj); 94#define EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED (&(_EFL_ANIMATION_PLAYER_EVENT_PRE_STARTED))
95 95/* Efl.Animation.Player END */
96EOAPI void efl_animation_object_final_state_keep_set(Eo *obj, Eina_Bool state_keep);
97EOAPI Eina_Bool efl_animation_object_final_state_keep_get(const Eo *obj);
98
99EOAPI void efl_animation_object_duration_set(Eo *obj, double duration);
100EOAPI double efl_animation_object_duration_get(const Eo *obj);
101
102EOAPI double efl_animation_object_total_duration_get(const Eo *obj);
103
104EOAPI void efl_animation_object_start_delay_set(Eo *obj, double delay_time);
105EOAPI double efl_animation_object_start_delay_get(const Eo *obj);
106
107typedef enum
108{
109 EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART = 0,
110 EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE
111} Efl_Animation_Object_Repeat_Mode;
112
113EOAPI void efl_animation_object_repeat_mode_set(Eo *obj, Efl_Animation_Object_Repeat_Mode mode);
114EOAPI Efl_Animation_Object_Repeat_Mode efl_animation_object_repeat_mode_get(const Eo *obj);
115
116EOAPI void efl_animation_object_repeat_count_set(Eo *obj, int count);
117EOAPI int efl_animation_object_repeat_count_get(const Eo *obj);
118
119EOAPI void efl_animation_object_interpolator_set(Eo *obj, Efl_Object *interpolator);
120EOAPI Efl_Object *efl_animation_object_interpolator_get(const Eo *obj);
121
122EOAPI void efl_animation_object_target_state_save(Eo *obj);
123EOAPI void efl_animation_object_target_state_reset(Eo *obj);
124EOAPI void efl_animation_object_target_map_reset(Eo *obj);
125
126EWAPI extern const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED;
127#define EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED (&(_EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED))
128/* Efl.Animation.Object END */
129
130/* Efl.Animation.Object.Alpha */
131EOAPI void efl_animation_object_alpha_set(Eo *obj, double from_alpha, double to_alpha);
132EOAPI void efl_animation_object_alpha_get(const Eo *obj, double *from_alpha, double *to_alpha);
133/* Efl.Animation.Object.Alpha END */
134
135/* Efl.Animation.Object.Rotate */
136EOAPI void efl_animation_object_rotate_set(Eo *obj, double from_degree, double to_degree, Efl_Canvas_Object *pivot, double cx, double cy);
137EOAPI void efl_animation_object_rotate_get(const Eo *obj, double *from_degree, double *to_degree, Efl_Canvas_Object **pivot, double *cx, double *cy);
138
139EOAPI void efl_animation_object_rotate_absolute_set(Eo *obj, double from_degree, double to_degree, int cx, int cy);
140EOAPI void efl_animation_object_rotate_absolute_get(const Eo *obj, double *from_degree, double *to_degree, int *cx, int *cy);
141/* Efl.Animation.Object.Rotate END */
142
143/* Efl.Animation.Object.Scale */
144EOAPI void efl_animation_object_scale_set(Eo *obj, double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, Efl_Canvas_Object *pivot, double cx, double cy);
145EOAPI void efl_animation_object_scale_get(const Eo *obj, double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, Efl_Canvas_Object **pivot, double *cx, double *cy);
146
147EOAPI void efl_animation_object_scale_absolute_set(Eo *obj, double from_scale_x, double from_scale_y, double to_scale_x, double to_scale_y, int cx, int cy);
148EOAPI void efl_animation_object_scale_absolute_get(const Eo *obj, double *from_scale_x, double *from_scale_y, double *to_scale_x, double *to_scale_y, int *cx, int *cy);
149/* Efl.Animation.Object.Scale END */
150
151/* Efl.Animation.Object.Translate */
152EOAPI void efl_animation_object_translate_set(Eo *obj, int from_x, int from_y, int to_x, int to_y);
153EOAPI void efl_animation_object_translate_get(const Eo *obj, int *from_x, int *from_y, int *to_x, int *to_y);
154
155EOAPI void efl_animation_object_translate_absolute_set(Eo *obj, int from_x, int from_y, int to_x, int to_y);
156EOAPI void efl_animation_object_translate_absolute_get(const Eo *obj, int *from_x, int *from_y, int *to_x, int *to_y);
157/* Efl.Animation.Object.Translate END */
158
159/* Efl.Animation.Object.Group */
160EOAPI void efl_animation_object_group_object_add(Eo *obj, Efl_Animation_Object *anim_obj);
161EOAPI void efl_animation_object_group_object_del(Eo *obj, Efl_Animation_Object *anim_obj);
162
163EOAPI Eina_List *efl_animation_object_group_objects_get(Eo *obj);
164/* Efl.Animation.Object.Group END */
165 96
166#ifdef __cplusplus 97#ifdef __cplusplus
167} 98}
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
index c5c461e0b1..f1ad508517 100644
--- a/src/lib/evas/canvas/efl_animation.c
+++ b/src/lib/evas/canvas/efl_animation.c
@@ -1,37 +1,13 @@
1#include "efl_animation_private.h" 1#include "efl_animation_private.h"
2 2
3static void 3#define MY_CLASS EFL_ANIMATION_CLASS
4_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
5{
6 Eo *eo_obj = data;
7
8 EFL_ANIMATION_DATA_GET(eo_obj, pd);
9
10 pd->target = NULL;
11}
12
13EOLIAN static void
14_efl_animation_target_set(Eo *eo_obj,
15 Efl_Animation_Data *pd,
16 Efl_Canvas_Object *target)
17{
18 efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
19
20 pd->target = target;
21}
22
23EOLIAN static Efl_Canvas_Object *
24_efl_animation_target_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
25{
26 return pd->target;
27}
28 4
29EOLIAN static void 5EOLIAN static void
30_efl_animation_duration_set(Eo *eo_obj EINA_UNUSED, 6_efl_animation_duration_set(Eo *eo_obj EINA_UNUSED,
31 Efl_Animation_Data *pd, 7 Efl_Animation_Data *pd,
32 double duration) 8 double sec)
33{ 9{
34 pd->duration = duration; 10 pd->duration = sec;
35} 11}
36 12
37EOLIAN static double 13EOLIAN static double
@@ -40,21 +16,14 @@ _efl_animation_duration_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
40 return pd->duration; 16 return pd->duration;
41} 17}
42 18
43EOLIAN static double
44_efl_animation_total_duration_get(Eo *eo_obj EINA_UNUSED,
45 Efl_Animation_Data *pd)
46{
47 return pd->duration;
48}
49
50EOLIAN static void 19EOLIAN static void
51_efl_animation_final_state_keep_set(Eo *eo_obj EINA_UNUSED, 20_efl_animation_final_state_keep_set(Eo *eo_obj EINA_UNUSED,
52 Efl_Animation_Data *pd, 21 Efl_Animation_Data *pd,
53 Eina_Bool keep_final_state) 22 Eina_Bool keep)
54{ 23{
55 if (pd->keep_final_state == keep_final_state) return; 24 if (pd->keep_final_state == keep) return;
56 25
57 pd->keep_final_state = !!keep_final_state; 26 pd->keep_final_state = !!keep;
58} 27}
59 28
60EOLIAN static Eina_Bool 29EOLIAN static Eina_Bool
@@ -64,27 +33,6 @@ _efl_animation_final_state_keep_get(Eo *eo_obj EINA_UNUSED,
64 return pd->keep_final_state; 33 return pd->keep_final_state;
65} 34}
66 35
67EOLIAN static Efl_Animation_Object *
68_efl_animation_object_create(Eo *eo_obj, Efl_Animation_Data *pd EINA_UNUSED)
69{
70 Efl_Animation_Object *anim_obj
71 = efl_add(EFL_ANIMATION_OBJECT_CLASS, NULL);
72
73 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
74 efl_animation_object_target_set(anim_obj, target);
75
76 Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
77 efl_animation_object_final_state_keep_set(anim_obj, state_keep);
78
79 double duration = efl_animation_duration_get(eo_obj);
80 efl_animation_object_duration_set(anim_obj, duration);
81
82 int repeat_count = efl_animation_repeat_count_get(eo_obj);
83 efl_animation_object_repeat_count_set(anim_obj, repeat_count);
84
85 return anim_obj;
86}
87
88EOLIAN static void 36EOLIAN static void
89_efl_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED, 37_efl_animation_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
90 Efl_Animation_Data *pd, 38 Efl_Animation_Data *pd,
@@ -121,11 +69,11 @@ _efl_animation_repeat_count_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
121EOLIAN static void 69EOLIAN static void
122_efl_animation_start_delay_set(Eo *eo_obj EINA_UNUSED, 70_efl_animation_start_delay_set(Eo *eo_obj EINA_UNUSED,
123 Efl_Animation_Data *pd, 71 Efl_Animation_Data *pd,
124 double delay_time) 72 double sec)
125{ 73{
126 if (delay_time < 0.0) return; 74 if (sec < 0.0) return;
127 75
128 pd->start_delay_time = delay_time; 76 pd->start_delay_time = sec;
129} 77}
130 78
131EOLIAN static double 79EOLIAN static double
@@ -150,34 +98,41 @@ _efl_animation_interpolator_get(Eo *eo_obj EINA_UNUSED,
150 return pd->interpolator; 98 return pd->interpolator;
151} 99}
152 100
153EOLIAN static Efl_Object * 101EOLIAN static double
154_efl_animation_efl_object_constructor(Eo *eo_obj, 102_efl_animation_animation_apply(Eo *eo_obj,
155 Efl_Animation_Data *pd) 103 Efl_Animation_Data *pd EINA_UNUSED,
104 double progress,
105 Efl_Canvas_Object *target EINA_UNUSED)
156{ 106{
157 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS)); 107 Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
158 108 if (interpolator)
159 pd->target = NULL; 109 progress = efl_interpolator_interpolate(interpolator, progress);
160
161 pd->duration = 0.0;
162
163 pd->start_delay_time = 0.0;
164 110
165 pd->repeat_count = 0; 111 return progress;
166 112}
167 pd->interpolator = NULL;
168 113
169 pd->keep_final_state = EINA_FALSE; 114EOLIAN static double
115_efl_animation_efl_playable_length_get(Eo *eo_obj, Efl_Animation_Data *pd EINA_UNUSED)
116{
117 if (efl_animation_repeat_count_get(eo_obj) == EFL_ANIMATION_REPEAT_INFINITE)
118 {
119 //TODO: what's correct?
120 return (double)EFL_ANIMATION_REPEAT_INFINITE;
121 }
170 122
171 return eo_obj; 123 return (efl_animation_duration_get(eo_obj) * (efl_animation_repeat_count_get(eo_obj) + 1));
172} 124}
173 125
174EOLIAN static void 126EOLIAN static Eina_Bool
175_efl_animation_efl_object_destructor(Eo *eo_obj, Efl_Animation_Data *pd) 127_efl_animation_efl_playable_playable_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd EINA_UNUSED)
176{ 128{
177 if (pd->target) 129 return EINA_TRUE;
178 efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj); 130}
179 131
180 efl_destructor(efl_super(eo_obj, MY_CLASS)); 132EOLIAN static Eina_Bool
133_efl_animation_efl_playable_seekable_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd EINA_UNUSED)
134{
135 return EINA_TRUE;
181} 136}
182 137
183#include "efl_animation.eo.c" 138#include "efl_animation.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo
index d8a728d3b9..35f5739f0d 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_animation.eo
@@ -1,20 +1,9 @@
1import efl_animation_types; 1import efl_animation_types;
2 2
3class Efl.Animation (Efl.Object) 3class Efl.Animation (Efl.Object, Efl.Playable)
4{ 4{
5 [[Efl animation class]] 5 [[Efl animation class]]
6 data: Efl_Animation_Data;
7 methods { 6 methods {
8 @property target {
9 [[Target object property]]
10 set {
11 }
12 get {
13 }
14 values {
15 target: Efl.Canvas.Object; [[Target object which is applied animation.]]
16 }
17 }
18 @property final_state_keep { 7 @property final_state_keep {
19 [[Keep final state property]] 8 [[Keep final state property]]
20 set { 9 set {
@@ -22,7 +11,7 @@ class Efl.Animation (Efl.Object)
22 get { 11 get {
23 } 12 }
24 values { 13 values {
25 keep_final_state: bool; [[$true to keep final state, $false otherwise.]] 14 keep: bool; [[$true to keep final state, $false otherwise.]]
26 } 15 }
27 } 16 }
28 @property duration { 17 @property duration {
@@ -32,15 +21,7 @@ class Efl.Animation (Efl.Object)
32 get { 21 get {
33 } 22 }
34 values { 23 values {
35 duration: double; [[Duration value.]] 24 sec: double; [[Duration value.]]
36 }
37 }
38 @property total_duration {
39 [[Total duration property]]
40 get {
41 }
42 values {
43 total_duration: double; [[Total duration value.]]
44 } 25 }
45 } 26 }
46 @property repeat_mode { 27 @property repeat_mode {
@@ -70,7 +51,7 @@ class Efl.Animation (Efl.Object)
70 get { 51 get {
71 } 52 }
72 values { 53 values {
73 delay_time: double; [[Delay time, in seconds, from when the animation starts until the animation is animated]] 54 sec: double; [[Delay time, in seconds, from when the animation starts until the animation is animated]]
74 } 55 }
75 } 56 }
76 @property interpolator { 57 @property interpolator {
@@ -83,13 +64,17 @@ class Efl.Animation (Efl.Object)
83 interpolator: Efl.Object; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]] 64 interpolator: Efl.Object; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]]
84 } 65 }
85 } 66 }
86 object_create { 67 animation_apply {
87 [[Create object of the animation.]] 68 params {
88 return: Efl.Animation.Object; [[Created object of the animation]] 69 @in progress: double;
70 @in target: Efl.Canvas.Object;
71 }
72 return: double; [[Final applied progress.]]
89 } 73 }
90 } 74 }
91 implements { 75 implements {
92 Efl.Object.constructor; 76 Efl.Playable.length { get; }
93 Efl.Object.destructor; 77 Efl.Playable.seekable { get; }
78 Efl.Playable.playable { get; }
94 } 79 }
95} 80}
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index d077120881..4da7165bac 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -1,5 +1,7 @@
1#include "efl_animation_alpha_private.h" 1#include "efl_animation_alpha_private.h"
2 2
3#define MY_CLASS EFL_ANIMATION_ALPHA_CLASS
4
3EOLIAN static void 5EOLIAN static void
4_efl_animation_alpha_alpha_set(Eo *eo_obj EINA_UNUSED, 6_efl_animation_alpha_alpha_set(Eo *eo_obj EINA_UNUSED,
5 Efl_Animation_Alpha_Data *pd, 7 Efl_Animation_Alpha_Data *pd,
@@ -22,38 +24,29 @@ _efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED,
22 *to_alpha = pd->to.alpha; 24 *to_alpha = pd->to.alpha;
23} 25}
24 26
25EOLIAN static Efl_Animation_Object *
26_efl_animation_alpha_efl_animation_object_create(Eo *eo_obj,
27 Efl_Animation_Alpha_Data *pd)
28{
29 Efl_Animation_Object_Alpha *anim_obj
30 = efl_add(EFL_ANIMATION_OBJECT_ALPHA_CLASS, NULL);
31
32 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
33 efl_animation_object_target_set(anim_obj, target);
34
35 Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
36 efl_animation_object_final_state_keep_set(anim_obj, state_keep);
37 27
38 double duration = efl_animation_duration_get(eo_obj); 28EOLIAN static double
39 efl_animation_object_duration_set(anim_obj, duration); 29_efl_animation_alpha_efl_animation_animation_apply(Eo *eo_obj,
40 30 Efl_Animation_Alpha_Data *pd EINA_UNUSED,
41 double start_delay_time = efl_animation_start_delay_get(eo_obj); 31 double progress,
42 efl_animation_object_start_delay_set(anim_obj, start_delay_time); 32 Efl_Canvas_Object *target)
43 33{
44 Efl_Animation_Object_Repeat_Mode repeat_mode = 34 double from_alpha, to_alpha;
45 (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj); 35 int cur_alpha;
46 efl_animation_object_repeat_mode_set(anim_obj, repeat_mode); 36 int i;
47 37
48 int repeat_count = efl_animation_repeat_count_get(eo_obj); 38 progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
49 efl_animation_object_repeat_count_set(anim_obj, repeat_count); 39 if (!target) return progress;
50 40
51 Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj); 41 efl_animation_alpha_get(eo_obj, &from_alpha, &to_alpha);
52 efl_animation_object_interpolator_set(anim_obj, interpolator); 42 cur_alpha = (int)(GET_STATUS(from_alpha, to_alpha, progress) * 255);
53 43
54 efl_animation_object_alpha_set(anim_obj, pd->from.alpha, pd->to.alpha); 44 for (i = 0; i < 4; i++)
45 {
46 efl_gfx_map_color_set(target, i, cur_alpha, cur_alpha, cur_alpha, cur_alpha);
47 }
55 48
56 return anim_obj; 49 return progress;
57} 50}
58 51
59EOLIAN static Efl_Object * 52EOLIAN static Efl_Object *
diff --git a/src/lib/evas/canvas/efl_animation_alpha.eo b/src/lib/evas/canvas/efl_animation_alpha.eo
index d5da203d19..ab10138b13 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.eo
+++ b/src/lib/evas/canvas/efl_animation_alpha.eo
@@ -19,6 +19,6 @@ class Efl.Animation.Alpha (Efl.Animation)
19 } 19 }
20 implements { 20 implements {
21 Efl.Object.constructor; 21 Efl.Object.constructor;
22 Efl.Animation.object_create; 22 Efl.Animation.animation_apply;
23 } 23 }
24} 24}
diff --git a/src/lib/evas/canvas/efl_animation_alpha_private.h b/src/lib/evas/canvas/efl_animation_alpha_private.h
index 9350fd1d77..d1861df092 100644
--- a/src/lib/evas/canvas/efl_animation_alpha_private.h
+++ b/src/lib/evas/canvas/efl_animation_alpha_private.h
@@ -2,9 +2,7 @@
2 2
3#include "evas_common_private.h" 3#include "evas_common_private.h"
4#include <Ecore.h> 4#include <Ecore.h>
5 5#include "efl_animation_private.h"
6#define MY_CLASS EFL_ANIMATION_ALPHA_CLASS
7#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
8 6
9#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \ 7#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \
10 Efl_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS) 8 Efl_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS)
diff --git a/src/lib/evas/canvas/efl_animation_group.c b/src/lib/evas/canvas/efl_animation_group.c
index 2e657e67f1..0aef2eac51 100644
--- a/src/lib/evas/canvas/efl_animation_group.c
+++ b/src/lib/evas/canvas/efl_animation_group.c
@@ -7,11 +7,7 @@ _efl_animation_group_animation_add(Eo *eo_obj,
7{ 7{
8 if (!animation) return; 8 if (!animation) return;
9 9
10 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj); 10 double duration = efl_animation_duration_get(efl_super(eo_obj, MY_CLASS));
11 if (target)
12 efl_animation_target_set(animation, target);
13
14 double duration = efl_animation_duration_get(eo_obj);
15 /* if group animation duration is available value, then the duration is 11 /* if group animation duration is available value, then the duration is
16 * propagated to its child. */ 12 * propagated to its child. */
17 if (duration != EFL_ANIMATION_GROUP_DURATION_NONE) 13 if (duration != EFL_ANIMATION_GROUP_DURATION_NONE)
@@ -21,6 +17,7 @@ _efl_animation_group_animation_add(Eo *eo_obj,
21 efl_animation_final_state_keep_set(animation, keep_final_state); 17 efl_animation_final_state_keep_set(animation, keep_final_state);
22 18
23 pd->animations = eina_list_append(pd->animations, animation); 19 pd->animations = eina_list_append(pd->animations, animation);
20 efl_ref(animation);
24} 21}
25 22
26EOLIAN static void 23EOLIAN static void
@@ -28,9 +25,19 @@ _efl_animation_group_animation_del(Eo *eo_obj EINA_UNUSED,
28 Efl_Animation_Group_Data *pd, 25 Efl_Animation_Group_Data *pd,
29 Efl_Animation*animation) 26 Efl_Animation*animation)
30{ 27{
28 Eina_List *list;
31 if (!animation) return; 29 if (!animation) return;
32 30
33 pd->animations = eina_list_remove(pd->animations, animation); 31 list = eina_list_data_find_list(pd->animations, animation);
32 if (list)
33 {
34 pd->animations = eina_list_remove_list(pd->animations, list);
35 efl_unref(animation);
36 }
37 else
38 {
39 ERR("Animation(%p) is not in the group animation.");
40 }
34} 41}
35 42
36EOLIAN static Eina_List * 43EOLIAN static Eina_List *
@@ -41,21 +48,6 @@ _efl_animation_group_animations_get(Eo *eo_obj EINA_UNUSED,
41} 48}
42 49
43EOLIAN static void 50EOLIAN static void
44_efl_animation_group_efl_animation_target_set(Eo *eo_obj,
45 Efl_Animation_Group_Data *pd,
46 Efl_Canvas_Object *target)
47{
48 Eina_List *l;
49 Efl_Animation *anim;
50 EINA_LIST_FOREACH(pd->animations, l, anim)
51 {
52 efl_animation_target_set(anim, target);
53 }
54
55 efl_animation_target_set(efl_super(eo_obj, MY_CLASS), target);
56}
57
58EOLIAN static void
59_efl_animation_group_efl_animation_duration_set(Eo *eo_obj, 51_efl_animation_group_efl_animation_duration_set(Eo *eo_obj,
60 Efl_Animation_Group_Data *pd, 52 Efl_Animation_Group_Data *pd,
61 double duration) 53 double duration)
@@ -114,8 +106,7 @@ _efl_animation_group_efl_object_constructor(Eo *eo_obj,
114 pd->animations = NULL; 106 pd->animations = NULL;
115 107
116 //group animation does not affect its child duration by default. 108 //group animation does not affect its child duration by default.
117 efl_animation_duration_set(efl_super(eo_obj, MY_CLASS), 109 efl_animation_duration_set(eo_obj, EFL_ANIMATION_GROUP_DURATION_NONE);
118 EFL_ANIMATION_GROUP_DURATION_NONE);
119 110
120 return eo_obj; 111 return eo_obj;
121} 112}
@@ -126,8 +117,8 @@ _efl_animation_group_efl_object_destructor(Eo *eo_obj,
126{ 117{
127 Efl_Animation *anim; 118 Efl_Animation *anim;
128 119
129 EINA_LIST_FREE(pd->animations, anim) 120 EINA_LIST_FREE(pd->animations, anim);
130 efl_del(anim); 121 efl_unref(anim);
131 122
132 efl_destructor(efl_super(eo_obj, MY_CLASS)); 123 efl_destructor(efl_super(eo_obj, MY_CLASS));
133} 124}
diff --git a/src/lib/evas/canvas/efl_animation_group.eo b/src/lib/evas/canvas/efl_animation_group.eo
index a431e39737..ab42604821 100644
--- a/src/lib/evas/canvas/efl_animation_group.eo
+++ b/src/lib/evas/canvas/efl_animation_group.eo
@@ -25,7 +25,6 @@ abstract Efl.Animation.Group (Efl.Animation)
25 implements { 25 implements {
26 Efl.Object.constructor; 26 Efl.Object.constructor;
27 Efl.Object.destructor; 27 Efl.Object.destructor;
28 Efl.Animation.target { set; }
29 Efl.Animation.duration { set; } 28 Efl.Animation.duration { set; }
30 Efl.Animation.final_state_keep { set; } 29 Efl.Animation.final_state_keep { set; }
31 Efl.Animation.interpolator { set; } 30 Efl.Animation.interpolator { set; }
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.c b/src/lib/evas/canvas/efl_animation_group_parallel.c
index 0e401614e8..d85d527412 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel.c
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.c
@@ -1,98 +1,77 @@
1#include "efl_animation_group_parallel_private.h" 1#include "efl_animation_group_parallel_private.h"
2 2
3EOLIAN static void 3#define MY_CLASS EFL_ANIMATION_GROUP_PARALLEL_CLASS
4_efl_animation_group_parallel_efl_animation_group_animation_add(Eo *eo_obj,
5 Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED,
6 Efl_Animation *animation)
7{
8 if (!animation) return;
9
10 efl_animation_group_animation_add(efl_super(eo_obj, MY_CLASS),
11 animation);
12}
13 4
14EOLIAN static void 5EOLIAN static double
15_efl_animation_group_parallel_efl_animation_group_animation_del(Eo *eo_obj, 6_efl_animation_group_parallel_efl_animation_animation_apply(Eo *eo_obj,
16 Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED, 7 void *_pd EINA_UNUSED,
17 Efl_Animation *animation) 8 double progress,
9 Efl_Canvas_Object *target)
18{ 10{
19 if (!animation) return; 11 double group_length, group_elapsed_time;
12 double anim_length, anim_duration, anim_start_delay, anim_progress, anim_elapsed_time;
13 int anim_repeated_count;
20 14
21 efl_animation_group_animation_del(efl_super(eo_obj, MY_CLASS), 15 progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
22 animation); 16 Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
23} 17 if (!group_anim) return progress;
24 18
25EOLIAN static double 19 group_length = efl_playable_length_get(eo_obj);
26_efl_animation_group_parallel_efl_animation_total_duration_get(Eo *eo_obj, 20 group_elapsed_time = group_length * progress;
27 Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED)
28{
29 Eina_List *animations =
30 efl_animation_group_animations_get(eo_obj);
31 if (!animations) return 0.0;
32 21
33 double total_duration = 0.0;
34 Eina_List *l; 22 Eina_List *l;
35 Efl_Animation *anim; 23 Efl_Animation *anim;
36 EINA_LIST_FOREACH(animations, l, anim) 24 EINA_LIST_FOREACH(group_anim, l, anim)
37 { 25 {
38 double child_total_duration = efl_animation_total_duration_get(anim); 26 anim_length = efl_playable_length_get(anim);
39 27 anim_duration = efl_animation_duration_get(anim);
40 double start_delay = efl_animation_start_delay_get(anim); 28 anim_start_delay = efl_animation_start_delay_get(anim);
41 if (start_delay > 0.0) 29
42 child_total_duration += start_delay; 30 anim_repeated_count = (int)(group_elapsed_time / anim_length);
43 31
44 int child_repeat_count = efl_animation_repeat_count_get(anim); 32 if ((anim_length + anim_start_delay) <= group_elapsed_time)
45 if (child_repeat_count > 0) 33 {
46 child_total_duration *= (child_repeat_count + 1); 34 if (efl_animation_final_state_keep_get(anim) && (!FINAL_STATE_IS_REVERSE(anim)))
47 35 anim_progress = 1.0;
48 if (child_total_duration > total_duration) 36 else
49 total_duration = child_total_duration; 37 anim_progress = 0.0;
38 efl_animation_apply(anim, anim_progress, target);
39
40 continue;
41 }
42
43 anim_elapsed_time =
44 MAX(((group_elapsed_time - (anim_length * anim_repeated_count)) - anim_start_delay), 0.0);
45 anim_progress = MIN((anim_elapsed_time / anim_duration), 1.0);
46 if (FINAL_STATE_IS_REVERSE(anim))
47 anim_progress = 1.0 - anim_progress;
48
49 efl_animation_apply(anim, anim_progress, target);
50 } 50 }
51 return total_duration; 51
52 return progress;
52} 53}
53 54
54EOLIAN static Efl_Animation_Object * 55EOLIAN static double
55_efl_animation_group_parallel_efl_animation_object_create(Eo *eo_obj, 56_efl_animation_group_parallel_efl_animation_duration_get(Eo *eo_obj, void *_pd EINA_UNUSED)
56 Efl_Animation_Group_Parallel_Data *pd EINA_UNUSED)
57{ 57{
58 Efl_Animation_Object_Group_Parallel *group_anim_obj 58 double child_total_duration;
59 = efl_add(EFL_ANIMATION_OBJECT_GROUP_PARALLEL_CLASS, NULL); 59 double total_duration = 0.0;
60 60
61 Eina_List *animations = efl_animation_group_animations_get(eo_obj); 61 Eina_List *animations = efl_animation_group_animations_get(eo_obj);
62 Eina_List *l; 62 if (!animations) return 0.0;
63 Efl_Animation *child_anim;
64 Efl_Animation_Object *child_anim_obj;
65 63
66 EINA_LIST_FOREACH(animations, l, child_anim) 64 Eina_List *l;
65 Efl_Animation *anim;
66 EINA_LIST_FOREACH(animations, l, anim)
67 { 67 {
68 child_anim_obj = efl_animation_object_create(child_anim); 68 child_total_duration = efl_playable_length_get(anim);
69 efl_animation_object_group_object_add(group_anim_obj, child_anim_obj); 69 child_total_duration += efl_animation_start_delay_get(anim);
70 if (child_total_duration > total_duration)
71 total_duration = child_total_duration;
70 } 72 }
71 73
72 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj); 74 return total_duration;
73 if (target)
74 efl_animation_object_target_set(group_anim_obj, target);
75
76 Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
77 efl_animation_object_final_state_keep_set(group_anim_obj, state_keep);
78
79 double duration = efl_animation_duration_get(eo_obj);
80 efl_animation_object_duration_set(group_anim_obj, duration);
81
82 double start_delay_time = efl_animation_start_delay_get(eo_obj);
83 efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
84
85 Efl_Animation_Object_Repeat_Mode repeat_mode =
86 (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
87 efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode);
88
89 int repeat_count = efl_animation_repeat_count_get(eo_obj);
90 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
91
92 Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
93 efl_animation_object_interpolator_set(group_anim_obj, interpolator);
94
95 return group_anim_obj;
96} 75}
97 76
98#include "efl_animation_group_parallel.eo.c" 77#include "efl_animation_group_parallel.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.eo b/src/lib/evas/canvas/efl_animation_group_parallel.eo
index ca0beb6478..944e2ad451 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel.eo
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.eo
@@ -3,13 +3,11 @@ import efl_animation_types;
3class Efl.Animation.Group.Parallel (Efl.Animation.Group) 3class Efl.Animation.Group.Parallel (Efl.Animation.Group)
4{ 4{
5 [[Efl group parallel animation class]] 5 [[Efl group parallel animation class]]
6 data: Efl_Animation_Group_Parallel_Data; 6 data: null;
7 methods { 7 methods {
8 } 8 }
9 implements { 9 implements {
10 Efl.Animation.object_create; 10 Efl.Animation.duration { get; }
11 Efl.Animation.Group.animation_add; 11 Efl.Animation.animation_apply;
12 Efl.Animation.Group.animation_del;
13 Efl.Animation.total_duration { get; }
14 } 12 }
15} 13}
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel_private.h b/src/lib/evas/canvas/efl_animation_group_parallel_private.h
index 963a8adf74..c3498a7569 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel_private.h
+++ b/src/lib/evas/canvas/efl_animation_group_parallel_private.h
@@ -2,13 +2,4 @@
2 2
3#include "evas_common_private.h" 3#include "evas_common_private.h"
4#include <Ecore.h> 4#include <Ecore.h>
5 5#include "efl_animation_private.h"
6#define MY_CLASS EFL_ANIMATION_GROUP_PARALLEL_CLASS
7#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
8
9#define EFL_ANIMATION_GROUP_PARALLEL_DATA_GET(o, pd) \
10 Efl_Animation_Group_Parallel_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_PARALLEL_CLASS)
11
12typedef struct _Efl_Animation_Group_Parallel_Data
13{
14} Efl_Animation_Group_Parallel_Data;
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.c b/src/lib/evas/canvas/efl_animation_group_sequential.c
index 8db4928ff4..8bc83848a3 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential.c
+++ b/src/lib/evas/canvas/efl_animation_group_sequential.c
@@ -1,94 +1,81 @@
1#include "efl_animation_group_sequential_private.h" 1#include "efl_animation_group_sequential_private.h"
2 2
3EOLIAN static void 3#define MY_CLASS EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS
4_efl_animation_group_sequential_efl_animation_group_animation_add(Eo *eo_obj,
5 Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED,
6 Efl_Animation *animation)
7{
8 if (!animation) return;
9
10 efl_animation_group_animation_add(efl_super(eo_obj, MY_CLASS), animation);
11}
12 4
13EOLIAN static void 5EOLIAN static double
14_efl_animation_group_sequential_efl_animation_group_animation_del(Eo *eo_obj, 6_efl_animation_group_sequential_efl_animation_animation_apply(Eo *eo_obj,
15 Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED, 7 void *_pd EINA_UNUSED,
16 Efl_Animation *animation) 8 double progress,
9 Efl_Canvas_Object *target)
17{ 10{
18 if (!animation) return; 11 double group_length, group_elapsed_time;
12 double anim_length, anim_duration, anim_start_delay, anim_progress, anim_play_time, anim_position;
13 double total_anim_elapsed_time = 0.0;
14 double temp;
15 int anim_repeated_count;
19 16
20 efl_animation_group_animation_del(efl_super(eo_obj, MY_CLASS), animation); 17 progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
21} 18 Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
19 if (!group_anim) return progress;
22 20
23EOLIAN static double 21 group_length = efl_playable_length_get(eo_obj);
24_efl_animation_group_sequential_efl_animation_total_duration_get(Eo *eo_obj, 22 group_elapsed_time = group_length * progress;
25 Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED)
26{
27 Eina_List *animations = efl_animation_group_animations_get(eo_obj);
28 if (!animations) return 0.0;
29 23
30 double total_duration = 0.0;
31 Eina_List *l; 24 Eina_List *l;
32 Efl_Animation *anim; 25 Efl_Animation *anim;
33 EINA_LIST_FOREACH(animations, l, anim) 26 EINA_LIST_FOREACH(group_anim, l, anim)
34 { 27 {
35 double child_total_duration = efl_animation_total_duration_get(anim); 28 anim_start_delay = efl_animation_start_delay_get(anim);
36 29 anim_length = efl_playable_length_get(anim) + anim_start_delay;
37 double start_delay = efl_animation_start_delay_get(anim); 30 anim_duration = efl_animation_duration_get(anim);
38 if (start_delay > 0.0) 31
39 child_total_duration += start_delay; 32 //Check whether this animation is playing.
40 33 temp = total_anim_elapsed_time + anim_length + anim_start_delay;
41 int child_repeat_count = efl_animation_repeat_count_get(anim); 34 if (temp <= group_elapsed_time)
42 if (child_repeat_count > 0) 35 {
43 child_total_duration *= (child_repeat_count + 1); 36 if (efl_animation_final_state_keep_get(anim) && (!FINAL_STATE_IS_REVERSE(anim)))
44 37 anim_progress = 1.0;
45 total_duration += child_total_duration; 38 else
39 anim_progress = 0.0;
40 efl_animation_apply(anim, anim_progress, target);
41 total_anim_elapsed_time = temp;
42 continue;
43 }
44
45 anim_play_time = group_elapsed_time - total_anim_elapsed_time - anim_start_delay;
46 //TODO: check infinite repeat
47 anim_repeated_count = (int)(anim_play_time / anim_length);
48 anim_position = MAX(((anim_play_time - anim_duration * anim_repeated_count)), 0.0);
49 anim_progress = MIN((anim_position / anim_duration), 1.0);
50 if (FINAL_STATE_IS_REVERSE(anim))
51 anim_progress = 1.0 - anim_progress;
52 efl_animation_apply(anim, anim_progress, target);
53
54 break;
46 } 55 }
47 return total_duration; 56
57 return progress;
48} 58}
49 59
50EOLIAN static Efl_Animation_Object * 60EOLIAN static double
51_efl_animation_group_sequential_efl_animation_object_create(Eo *eo_obj, 61_efl_animation_group_sequential_efl_animation_duration_get(Eo *eo_obj, void *_pd EINA_UNUSED)
52 Efl_Animation_Group_Sequential_Data *pd EINA_UNUSED)
53{ 62{
54 Efl_Animation_Object_Group_Sequential *group_anim_obj 63 double total_duration = 0.0;
55 = efl_add(EFL_ANIMATION_OBJECT_GROUP_SEQUENTIAL_CLASS, NULL); 64 double child_total_duration;
56 65
57 Eina_List *animations = efl_animation_group_animations_get(eo_obj); 66 Eina_List *animations = efl_animation_group_animations_get(eo_obj);
58 Eina_List *l; 67 if (!animations) return 0.0;
59 Efl_Animation *child_anim;
60 Efl_Animation_Object *child_anim_obj;
61 68
62 EINA_LIST_FOREACH(animations, l, child_anim) 69 Eina_List *l;
70 Efl_Animation *anim;
71 EINA_LIST_FOREACH(animations, l, anim)
63 { 72 {
64 child_anim_obj = efl_animation_object_create(child_anim); 73 child_total_duration = efl_playable_length_get(anim);
65 efl_animation_object_group_object_add(group_anim_obj, child_anim_obj); 74 child_total_duration += efl_animation_start_delay_get(anim);
75 total_duration += child_total_duration;
66 } 76 }
67 77
68 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj); 78 return total_duration;
69 if (target)
70 efl_animation_object_target_set(group_anim_obj, target);
71
72 Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
73 efl_animation_object_final_state_keep_set(group_anim_obj, state_keep);
74
75 double duration = efl_animation_duration_get(eo_obj);
76 efl_animation_object_duration_set(group_anim_obj, duration);
77
78 double start_delay_time = efl_animation_start_delay_get(eo_obj);
79 efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
80
81 Efl_Animation_Object_Repeat_Mode repeat_mode =
82 (Efl_Animation_Object_Repeat_Mode)efl_animation_repeat_mode_get(eo_obj);
83 efl_animation_object_repeat_mode_set(group_anim_obj, repeat_mode);
84
85 int repeat_count = efl_animation_repeat_count_get(eo_obj);
86 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
87
88 Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
89 efl_animation_object_interpolator_set(group_anim_obj, interpolator);
90
91 return group_anim_obj;
92} 79}
93 80
94#include "efl_animation_group_sequential.eo.c" 81#include "efl_animation_group_sequential.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.eo b/src/lib/evas/canvas/efl_animation_group_sequential.eo
index 650b017b71..2124f23494 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential.eo
+++ b/src/lib/evas/canvas/efl_animation_group_sequential.eo
@@ -3,13 +3,11 @@ import efl_animation_types;
3class Efl.Animation.Group.Sequential (Efl.Animation.Group) 3class Efl.Animation.Group.Sequential (Efl.Animation.Group)
4{ 4{
5 [[Efl group sequential animation class]] 5 [[Efl group sequential animation class]]
6 data: Efl_Animation_Group_Sequential_Data; 6 data: null;
7 methods { 7 methods {
8 } 8 }
9 implements { 9 implements {
10 Efl.Animation.object_create; 10 Efl.Animation.duration { get; }
11 Efl.Animation.Group.animation_add; 11 Efl.Animation.animation_apply;
12 Efl.Animation.Group.animation_del;
13 Efl.Animation.total_duration { get; }
14 } 12 }
15} 13}
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential_private.h b/src/lib/evas/canvas/efl_animation_group_sequential_private.h
index 69503e9751..c3498a7569 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential_private.h
+++ b/src/lib/evas/canvas/efl_animation_group_sequential_private.h
@@ -2,13 +2,4 @@
2 2
3#include "evas_common_private.h" 3#include "evas_common_private.h"
4#include <Ecore.h> 4#include <Ecore.h>
5 5#include "efl_animation_private.h"
6#define MY_CLASS EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS
7#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
8
9#define EFL_ANIMATION_GROUP_SEQUENTIAL_DATA_GET(o, pd) \
10 Efl_Animation_Group_Sequential_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS)
11
12typedef struct _Efl_Animation_Group_Sequential_Data
13{
14} Efl_Animation_Group_Sequential_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object.c b/src/lib/evas/canvas/efl_animation_object.c
deleted file mode 100644
index 87d1988c91..0000000000
--- a/src/lib/evas/canvas/efl_animation_object.c
+++ /dev/null
@@ -1,585 +0,0 @@
1#include "efl_animation_object_private.h"
2
3EOLIAN static void
4_efl_animation_object_auto_del_set(Eo *eo_obj EINA_UNUSED,
5 Efl_Animation_Object_Data *pd,
6 Eina_Bool auto_del)
7{
8 pd->auto_del = auto_del;
9}
10
11EOLIAN static Eina_Bool
12_efl_animation_object_auto_del_get(Eo *eo_obj EINA_UNUSED,
13 Efl_Animation_Object_Data *pd)
14{
15 return pd->auto_del;
16}
17
18static void
19_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
20{
21 Eo *eo_obj = data;
22
23 EFL_ANIMATION_OBJECT_DATA_GET(eo_obj, pd);
24
25 pd->target = NULL;
26 efl_animation_object_cancel(eo_obj);
27}
28
29EOLIAN static void
30_efl_animation_object_target_set(Eo *eo_obj,
31 Efl_Animation_Object_Data *pd,
32 Efl_Canvas_Object *target)
33{
34 if (pd->target == target) return;
35
36 if (pd->target)
37 efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
38
39 efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
40
41 pd->target = target;
42}
43
44EOLIAN static Efl_Canvas_Object *
45_efl_animation_object_target_get(Eo *eo_obj EINA_UNUSED,
46 Efl_Animation_Object_Data *pd)
47{
48 return pd->target;
49}
50
51EOLIAN static void
52_efl_animation_object_duration_set(Eo *eo_obj EINA_UNUSED,
53 Efl_Animation_Object_Data *pd,
54 double duration)
55{
56 pd->duration = duration;
57}
58
59EOLIAN static double
60_efl_animation_object_duration_get(Eo *eo_obj EINA_UNUSED,
61 Efl_Animation_Object_Data *pd)
62{
63 return pd->duration;
64}
65
66EOLIAN static double
67_efl_animation_object_total_duration_get(Eo *eo_obj EINA_UNUSED,
68 Efl_Animation_Object_Data *pd)
69{
70 return pd->duration;
71}
72
73EOLIAN static void
74_efl_animation_object_repeat_mode_set(Eo *eo_obj EINA_UNUSED,
75 Efl_Animation_Object_Data *pd,
76 Efl_Animation_Object_Repeat_Mode mode)
77{
78 if ((mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_RESTART) ||
79 (mode == EFL_ANIMATION_OBJECT_REPEAT_MODE_REVERSE))
80 pd->repeat_mode = mode;
81}
82
83EOLIAN static Efl_Animation_Object_Repeat_Mode
84_efl_animation_object_repeat_mode_get(const Eo *eo_obj EINA_UNUSED,
85 Efl_Animation_Object_Data *pd)
86{
87 return pd->repeat_mode;
88}
89
90EOLIAN static void
91_efl_animation_object_repeat_count_set(Eo *eo_obj EINA_UNUSED,
92 Efl_Animation_Object_Data *pd,
93 int count)
94{
95 //EFL_ANIMATION_OBJECT_REPEAT_INFINITE repeats animation infinitely
96 if ((count < 0) && (count != EFL_ANIMATION_OBJECT_REPEAT_INFINITE)) return;
97
98 pd->repeat_count = count;
99}
100
101EOLIAN static int
102_efl_animation_object_repeat_count_get(const Eo *eo_obj EINA_UNUSED,
103 Efl_Animation_Object_Data *pd)
104{
105 return pd->repeat_count;
106}
107
108EOLIAN static void
109_efl_animation_object_start_delay_set(Eo *eo_obj EINA_UNUSED,
110 Efl_Animation_Object_Data *pd,
111 double delay_time)
112{
113 if (delay_time < 0.0) return;
114
115 pd->start_delay_time = delay_time;
116}
117
118EOLIAN static double
119_efl_animation_object_start_delay_get(Eo *eo_obj EINA_UNUSED,
120 Efl_Animation_Object_Data *pd)
121{
122 return pd->start_delay_time;
123}
124
125EOLIAN static void
126_efl_animation_object_interpolator_set(Eo *eo_obj EINA_UNUSED,
127 Efl_Animation_Object_Data *pd,
128 Efl_Interpolator *interpolator)
129{
130 pd->interpolator = interpolator;
131}
132
133EOLIAN static Efl_Interpolator *
134_efl_animation_object_interpolator_get(Eo *eo_obj EINA_UNUSED,
135 Efl_Animation_Object_Data *pd)
136{
137 return pd->interpolator;
138}
139
140EOLIAN static void
141_efl_animation_object_target_state_save(Eo *eo_obj EINA_UNUSED,
142 Efl_Animation_Object_Data *pd)
143{
144 if (!pd->target || !pd->target_state) return;
145
146 Evas_Coord x, y, w, h;
147 evas_object_geometry_get(pd->target, &x, &y, &w, &h);
148
149 pd->target_state->x = x;
150 pd->target_state->y = y;
151 pd->target_state->w = w;
152 pd->target_state->h = h;
153
154 int r, g, b, a;
155 evas_object_color_get(pd->target, &r, &g, &b, &a);
156
157 pd->target_state->r = r;
158 pd->target_state->g = g;
159 pd->target_state->b = b;
160 pd->target_state->a = a;
161
162 Evas_Map *map = evas_map_dup(evas_object_map_get(pd->target));
163 pd->target_state->map = map;
164
165 Eina_Bool enable_map = evas_object_map_enable_get(pd->target);
166 pd->target_state->enable_map = enable_map;
167}
168
169EOLIAN static void
170_efl_animation_object_target_state_reset(Eo *eo_obj EINA_UNUSED,
171 Efl_Animation_Object_Data *pd)
172{
173 if (!pd->target) return;
174
175 if (efl_gfx_map_has(pd->target))
176 efl_gfx_map_reset(pd->target);
177