aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-12-27 19:21:25 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2018-01-15 11:35:27 +0900
commitbe8618319aba4f9de06b9fb6f66772f28d435eb8 (patch)
treea2dfc060163c997a3be5f254203281b0554bdf2b
parentefl_animation: implements Efl.Player and Efl.Playable interfaces. (diff)
downloadefl-be8618319aba4f9de06b9fb6f66772f28d435eb8.tar.gz
efl_animation_player: move target_set from Efl.Animation
-rw-r--r--src/bin/elementary/test_efl_anim_alpha.c5
-rw-r--r--src/bin/elementary/test_efl_anim_event_anim.c2
-rw-r--r--src/bin/elementary/test_efl_anim_group_parallel.c5
-rw-r--r--src/bin/elementary/test_efl_anim_group_sequential.c8
-rw-r--r--src/bin/elementary/test_efl_anim_interpolator.c4
-rw-r--r--src/bin/elementary/test_efl_anim_pause.c5
-rw-r--r--src/bin/elementary/test_efl_anim_repeat.c5
-rw-r--r--src/bin/elementary/test_efl_anim_rotate.c17
-rw-r--r--src/bin/elementary/test_efl_anim_scale.c15
-rw-r--r--src/bin/elementary/test_efl_anim_start_delay.c5
-rw-r--r--src/bin/elementary/test_efl_anim_translate.c10
-rw-r--r--src/lib/efl/interfaces/efl_playable.eo6
-rw-r--r--src/lib/evas/canvas/efl_animation.c56
-rw-r--r--src/lib/evas/canvas/efl_animation.eo19
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c17
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_group.c21
-rw-r--r--src/lib/evas/canvas/efl_animation_group.eo1
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.c20
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.c20
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_player.c31
-rw-r--r--src/lib/evas/canvas/efl_animation_player.eo10
-rw-r--r--src/lib/evas/canvas/efl_animation_player_private.h1
-rw-r--r--src/lib/evas/canvas/efl_animation_private.h3
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c112
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.c113
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.eo2
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.c84
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.eo2
-rw-r--r--src/lib/evas/canvas/evas_object_main.c40
33 files changed, 196 insertions, 451 deletions
diff --git a/src/bin/elementary/test_efl_anim_alpha.c b/src/bin/elementary/test_efl_anim_alpha.c
index f96db1175e..856b024781 100644
--- a/src/bin/elementary/test_efl_anim_alpha.c
+++ b/src/bin/elementary/test_efl_anim_alpha.c
@@ -86,20 +86,19 @@ test_efl_anim_alpha(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
diff --git a/src/bin/elementary/test_efl_anim_event_anim.c b/src/bin/elementary/test_efl_anim_event_anim.c
index 86531c35d5..dd24c92ed6 100644
--- a/src/bin/elementary/test_efl_anim_event_anim.c
+++ b/src/bin/elementary/test_efl_anim_event_anim.c
@@ -60,7 +60,6 @@ test_efl_anim_event_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_SHOW, show_anim);
@@ -71,7 +70,6 @@ test_efl_anim_event_anim(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
efl_canvas_object_event_animation_set(btn, EFL_GFX_EVENT_HIDE, hide_anim);
diff --git a/src/bin/elementary/test_efl_anim_group_parallel.c b/src/bin/elementary/test_efl_anim_group_parallel.c
index 5cb23158b1..d9a34031e3 100644
--- a/src/bin/elementary/test_efl_anim_group_parallel.c
+++ b/src/bin/elementary/test_efl_anim_group_parallel.c
@@ -99,7 +99,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Show Parallel Group Animation
Efl_Animation *parallel_show_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
efl_animation_duration_set(parallel_show_anim, 1.0);
- efl_animation_target_set(parallel_show_anim, btn);
efl_animation_final_state_keep_set(parallel_show_anim, EINA_TRUE);
//Add animations to group animation
@@ -123,7 +122,6 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Hide Parallel Group Animation
Efl_Animation *parallel_hide_anim = efl_add(EFL_ANIMATION_GROUP_PARALLEL_CLASS, NULL);
efl_animation_duration_set(parallel_hide_anim, 1.0);
- efl_animation_target_set(parallel_hide_anim, btn);
efl_animation_final_state_keep_set(parallel_hide_anim, EINA_TRUE);
//Add animations to group animation
@@ -135,7 +133,8 @@ test_efl_anim_group_parallel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
//Initialize App Data
ad->parallel_show_anim = parallel_show_anim;
ad->parallel_hide_anim = parallel_hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
diff --git a/src/bin/elementary/test_efl_anim_group_sequential.c b/src/bin/elementary/test_efl_anim_group_sequential.c
index bd951b03f7..567390a292 100644
--- a/src/bin/elementary/test_efl_anim_group_sequential.c
+++ b/src/bin/elementary/test_efl_anim_group_sequential.c
@@ -87,22 +87,18 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
//Rotate from 0 to 45 degrees Animation
Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
- efl_animation_target_set(cw_45_degrees_anim, btn);
//Scale Animation to zoom in
Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
- efl_animation_target_set(scale_double_anim, btn);
//Hide Animation
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
- efl_animation_target_set(hide_anim, btn);
//Hide Sequential Group Animation
Efl_Animation *sequential_hide_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL);
efl_animation_duration_set(sequential_hide_anim, 1.0);
- efl_animation_target_set(sequential_hide_anim, btn);
efl_animation_final_state_keep_set(sequential_hide_anim, EINA_TRUE);
//Add animations to group animation
@@ -129,7 +125,6 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
//Show Sequential Group Animation
Efl_Animation *sequential_show_anim = efl_add(EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS, NULL);
- efl_animation_target_set(sequential_show_anim, btn);
efl_animation_final_state_keep_set(sequential_show_anim, EINA_TRUE);
//efl_animation_duration_set() is called for each animation not to set the same duration
@@ -143,7 +138,8 @@ test_efl_anim_group_sequential(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
//Initialize App Data
ad->sequential_show_anim = sequential_show_anim;
ad->sequential_hide_anim = sequential_hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c
index 198ff0bbcf..e3dbb68139 100644
--- a/src/bin/elementary/test_efl_anim_interpolator.c
+++ b/src/bin/elementary/test_efl_anim_interpolator.c
@@ -187,7 +187,6 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Efl_Animation *anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0);
efl_animation_duration_set(anim, 2.0);
- efl_animation_target_set(anim, btn);
efl_animation_final_state_keep_set(anim, EINA_FALSE);
Efl_Interpolator *interp = _interpolator_create(i);
@@ -196,7 +195,8 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
//Create Animation Object from Animation
Efl_Animation_Player *anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, NULL,
- efl_animation_player_animation_set(efl_added, anim));
+ efl_animation_player_animation_set(efl_added, anim),
+ efl_animation_player_target_set(efl_added, btn));
ad->anim_obj[i] = anim_obj;
//Register callback called when animation starts
diff --git a/src/bin/elementary/test_efl_anim_pause.c b/src/bin/elementary/test_efl_anim_pause.c
index 8508868a75..5bd382cc0d 100644
--- a/src/bin/elementary/test_efl_anim_pause.c
+++ b/src/bin/elementary/test_efl_anim_pause.c
@@ -123,14 +123,12 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 2.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 2.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -158,7 +156,8 @@ test_efl_anim_pause(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad);
diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c
index 7fcae37d1e..310ff5221d 100644
--- a/src/bin/elementary/test_efl_anim_repeat.c
+++ b/src/bin/elementary/test_efl_anim_repeat.c
@@ -139,14 +139,12 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -185,7 +183,8 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
diff --git a/src/bin/elementary/test_efl_anim_rotate.c b/src/bin/elementary/test_efl_anim_rotate.c
index befcdb7cfc..6914514c59 100644
--- a/src/bin/elementary/test_efl_anim_rotate.c
+++ b/src/bin/elementary/test_efl_anim_rotate.c
@@ -84,23 +84,22 @@ test_efl_anim_rotate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
//Rotate from 0 to 45 degrees Animation
Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
- efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, NULL, 0.5, 0.5);
+ efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0,NULL, 0.5, 0.5);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, NULL, 0.5, 0.5);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
@@ -154,20 +153,19 @@ test_efl_anim_rotate_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_set(cw_45_degrees_anim, 0.0, 45.0, pivot, 0.5, 0.5);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_set(ccw_45_degrees_anim, 45.0, 0.0, pivot, 0.5, 0.5);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
@@ -223,20 +221,19 @@ test_efl_anim_rotate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUS
Efl_Animation *cw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_absolute_set(cw_45_degrees_anim, 0.0, 45.0, 0, 0);
efl_animation_duration_set(cw_45_degrees_anim, 1.0);
- efl_animation_target_set(cw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(cw_45_degrees_anim, EINA_TRUE);
//Rotate from 45 to 0 degrees Animation
Efl_Animation *ccw_45_degrees_anim = efl_add(EFL_ANIMATION_ROTATE_CLASS, NULL);
efl_animation_rotate_absolute_set(ccw_45_degrees_anim, 45.0, 0.0, 0, 0);
efl_animation_duration_set(ccw_45_degrees_anim, 1.0);
- efl_animation_target_set(ccw_45_degrees_anim, btn);
efl_animation_final_state_keep_set(ccw_45_degrees_anim, EINA_TRUE);
//Initialize App Data
ad->cw_45_degrees_anim = cw_45_degrees_anim;
ad->ccw_45_degrees_anim = ccw_45_degrees_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
diff --git a/src/bin/elementary/test_efl_anim_scale.c b/src/bin/elementary/test_efl_anim_scale.c
index a24be13b04..258c847cf6 100644
--- a/src/bin/elementary/test_efl_anim_scale.c
+++ b/src/bin/elementary/test_efl_anim_scale.c
@@ -86,20 +86,19 @@ test_efl_anim_scale(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *
Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, NULL, 0.5, 0.5);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, NULL, 0.5, 0.5);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, NULL);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, NULL,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
@@ -156,20 +155,19 @@ test_efl_anim_scale_relative(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, pivot, 0.5, 0.5);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, pivot, 0.5, 0.5);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
@@ -223,20 +221,19 @@ test_efl_anim_scale_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
Efl_Animation *scale_double_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_absolute_set(scale_double_anim, 1.0, 1.0, 2.0, 2.0, 0, 0);
efl_animation_duration_set(scale_double_anim, 1.0);
- efl_animation_target_set(scale_double_anim, btn);
efl_animation_final_state_keep_set(scale_double_anim, EINA_TRUE);
//Scale Animation to zoom out
Efl_Animation *scale_half_anim = efl_add(EFL_ANIMATION_SCALE_CLASS, NULL);
efl_animation_scale_absolute_set(scale_half_anim, 2.0, 2.0, 1.0, 1.0, 0, 0);
efl_animation_duration_set(scale_half_anim, 1.0);
- efl_animation_target_set(scale_half_anim, btn);
efl_animation_final_state_keep_set(scale_half_anim, EINA_TRUE);
//Initialize App Data
ad->scale_double_anim = scale_double_anim;
ad->scale_half_anim = scale_half_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
diff --git a/src/bin/elementary/test_efl_anim_start_delay.c b/src/bin/elementary/test_efl_anim_start_delay.c
index ccdce35dfb..b2f9b34da9 100644
--- a/src/bin/elementary/test_efl_anim_start_delay.c
+++ b/src/bin/elementary/test_efl_anim_start_delay.c
@@ -101,14 +101,12 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(show_anim, 0.0, 1.0);
efl_animation_duration_set(show_anim, 1.0);
- efl_animation_target_set(show_anim, btn);
efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
//Hide Animation
Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
efl_animation_alpha_set(hide_anim, 1.0, 0.0);
efl_animation_duration_set(hide_anim, 1.0);
- efl_animation_target_set(hide_anim, btn);
efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
@@ -136,7 +134,8 @@ test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
//Initialize App Data
ad->show_anim = show_anim;
ad->hide_anim = hide_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
diff --git a/src/bin/elementary/test_efl_anim_translate.c b/src/bin/elementary/test_efl_anim_translate.c
index d732e7002d..972d3e46cc 100644
--- a/src/bin/elementary/test_efl_anim_translate.c
+++ b/src/bin/elementary/test_efl_anim_translate.c
@@ -86,20 +86,19 @@ test_efl_anim_translate(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
efl_animation_translate_set(translate_rb_anim, 0, 0, 100, 100);
efl_animation_duration_set(translate_rb_anim, 1.0);
- efl_animation_target_set(translate_rb_anim, btn);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top relatively
Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
efl_animation_translate_set(translate_lt_anim, 100, 100, 0, 0);
efl_animation_duration_set(translate_lt_anim, 1.0);
- efl_animation_target_set(translate_lt_anim, btn);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
//Initialize App Data
ad->translate_rb_anim = translate_rb_anim;
ad->translate_lt_anim = translate_lt_anim;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
@@ -153,21 +152,20 @@ test_efl_anim_translate_absolute(void *data EINA_UNUSED, Evas_Object *obj EINA_U
Efl_Animation *translate_rb_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
efl_animation_translate_absolute_set(translate_rb_anim, 0, 0, 100, 100);
efl_animation_duration_set(translate_rb_anim, 1.0);
- efl_animation_target_set(translate_rb_anim, btn);
efl_animation_final_state_keep_set(translate_rb_anim, EINA_TRUE);
//Translate Animation to left top absolutely
Efl_Animation *translate_lt_anim = efl_add(EFL_ANIMATION_TRANSLATE_CLASS, NULL);
efl_animation_translate_absolute_set(translate_lt_anim, 100, 100, 0, 0);
efl_animation_duration_set(translate_lt_anim, 1.0);
- efl_animation_target_set(translate_lt_anim, btn);
efl_animation_final_state_keep_set(translate_lt_anim, EINA_TRUE);
//Initialize App Data
ad->translate_rb_anim = translate_rb_anim;
ad->translate_lt_anim = translate_lt_anim;
ad->is_btn_translated = EINA_FALSE;
- ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win);
+ ad->anim_obj = efl_add(EFL_ANIMATION_PLAYER_CLASS, win,
+ efl_animation_player_target_set(efl_added, btn));
//Register callback called when animation starts
efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, NULL);
//Register callback called when animation ends
diff --git a/src/lib/efl/interfaces/efl_playable.eo b/src/lib/efl/interfaces/efl_playable.eo
index bffc6b34ba..56dbc9e51b 100644
--- a/src/lib/efl/interfaces/efl_playable.eo
+++ b/src/lib/efl/interfaces/efl_playable.eo
@@ -25,11 +25,5 @@ interface Efl.Playable
seekable: bool; [[$true if seekable.]]
}
}
- @property progress {
- [[ TODO: need to be protected. ]]
- values {
- progress: double;
- }
- }
}
}
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
index 0d5260d859..f1ad508517 100644
--- a/src/lib/evas/canvas/efl_animation.c
+++ b/src/lib/evas/canvas/efl_animation.c
@@ -2,32 +2,6 @@
#define MY_CLASS EFL_ANIMATION_CLASS
-static void
-_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Eo *eo_obj = data;
-
- EFL_ANIMATION_DATA_GET(eo_obj, pd);
-
- pd->target = NULL;
-}
-
-EOLIAN static void
-_efl_animation_target_set(Eo *eo_obj,
- Efl_Animation_Data *pd,
- Efl_Canvas_Object *target)
-{
- efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
-
- pd->target = target;
-}
-
-EOLIAN static Efl_Canvas_Object *
-_efl_animation_target_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->target;
-}
-
EOLIAN static void
_efl_animation_duration_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Data *pd,
@@ -124,29 +98,17 @@ _efl_animation_interpolator_get(Eo *eo_obj EINA_UNUSED,
return pd->interpolator;
}
-EOLIAN static void
-_efl_animation_efl_playable_progress_set(Eo *eo_obj, Efl_Animation_Data *pd, double progress)
+EOLIAN static double
+_efl_animation_animation_apply(Eo *eo_obj,
+ Efl_Animation_Data *pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target EINA_UNUSED)
{
Efl_Interpolator *interpolator = efl_animation_interpolator_get(eo_obj);
if (interpolator)
- pd->progress = efl_interpolator_interpolate(interpolator, progress);
- else
- pd->progress = progress;
-}
-
-EOLIAN static double
-_efl_animation_efl_playable_progress_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
-{
- return pd->progress;
-}
-
-EOLIAN static void
-_efl_animation_efl_object_destructor(Eo *eo_obj, Efl_Animation_Data *pd)
-{
- if (pd->target)
- efl_event_callback_del(pd->target, EFL_EVENT_DEL, _target_del_cb, eo_obj);
+ progress = efl_interpolator_interpolate(interpolator, progress);
- efl_destructor(efl_super(eo_obj, MY_CLASS));
+ return progress;
}
EOLIAN static double
@@ -162,9 +124,9 @@ _efl_animation_efl_playable_length_get(Eo *eo_obj, Efl_Animation_Data *pd EINA_U
}
EOLIAN static Eina_Bool
-_efl_animation_efl_playable_playable_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd)
+_efl_animation_efl_playable_playable_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Data *pd EINA_UNUSED)
{
- return !!(pd->target);
+ return EINA_TRUE;
}
EOLIAN static Eina_Bool
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo
index 4162673f0e..35f5739f0d 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_animation.eo
@@ -4,16 +4,6 @@ class Efl.Animation (Efl.Object, Efl.Playable)
{
[[Efl animation class]]
methods {
- @property target {
- [[Target object property]]
- set {
- }
- get {
- }
- values {
- target: Efl.Canvas.Object; [[Target object which is applied animation.]]
- }
- }
@property final_state_keep {
[[Keep final state property]]
set {
@@ -74,12 +64,17 @@ class Efl.Animation (Efl.Object, Efl.Playable)
interpolator: Efl.Object; [[Interpolator which indicates interpolation fucntion. Efl_Interpolator is required.]]
}
}
+ animation_apply {
+ params {
+ @in progress: double;
+ @in target: Efl.Canvas.Object;
+ }
+ return: double; [[Final applied progress.]]
+ }
}
implements {
- Efl.Object.destructor;
Efl.Playable.length { get; }
Efl.Playable.seekable { get; }
Efl.Playable.playable { get; }
- Efl.Playable.progress { get; set; }
}
}
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index 5ed646e311..4da7165bac 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -25,19 +25,18 @@ _efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED,
}
-EOLIAN static void
-_efl_animation_alpha_efl_playable_progress_set(Eo *eo_obj,
- Efl_Animation_Alpha_Data *pd EINA_UNUSED,
- double progress)
+EOLIAN static double
+_efl_animation_alpha_efl_animation_animation_apply(Eo *eo_obj,
+ Efl_Animation_Alpha_Data *pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
{
double from_alpha, to_alpha;
int cur_alpha;
int i;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (!target) return;
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
efl_animation_alpha_get(eo_obj, &from_alpha, &to_alpha);
cur_alpha = (int)(GET_STATUS(from_alpha, to_alpha, progress) * 255);
@@ -46,6 +45,8 @@ _efl_animation_alpha_efl_playable_progress_set(Eo *eo_obj,
{
efl_gfx_map_color_set(target, i, cur_alpha, cur_alpha, cur_alpha, cur_alpha);
}
+
+ return progress;
}
EOLIAN static Efl_Object *
diff --git a/src/lib/evas/canvas/efl_animation_alpha.eo b/src/lib/evas/canvas/efl_animation_alpha.eo
index 8579b57482..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)
}
implements {
Efl.Object.constructor;
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_group.c b/src/lib/evas/canvas/efl_animation_group.c
index 233a5ecf40..d7b9e1b57a 100644
--- a/src/lib/evas/canvas/efl_animation_group.c
+++ b/src/lib/evas/canvas/efl_animation_group.c
@@ -7,12 +7,6 @@ _efl_animation_group_animation_add(Eo *eo_obj,
{
if (!animation) return;
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
-
- //TODO: check when child target is different.
- if (target)
- efl_animation_target_set(animation, target);
-
double duration = efl_animation_duration_get(efl_super(eo_obj, MY_CLASS));
/* if group animation duration is available value, then the duration is
* propagated to its child. */
@@ -43,21 +37,6 @@ _efl_animation_group_animations_get(Eo *eo_obj EINA_UNUSED,
}
EOLIAN static void
-_efl_animation_group_efl_animation_target_set(Eo *eo_obj,
- Efl_Animation_Group_Data *pd,
- Efl_Canvas_Object *target)
-{
- Eina_List *l;
- Efl_Animation *anim;
- EINA_LIST_FOREACH(pd->animations, l, anim)
- {
- efl_animation_target_set(anim, target);
- }
-
- efl_animation_target_set(efl_super(eo_obj, MY_CLASS), target);
-}
-
-EOLIAN static void
_efl_animation_group_efl_animation_duration_set(Eo *eo_obj,
Efl_Animation_Group_Data *pd,
double duration)
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)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
- Efl.Animation.target { set; }
Efl.Animation.duration { set; }
Efl.Animation.final_state_keep { set; }
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 ef63ebefc9..d85d527412 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel.c
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.c
@@ -2,19 +2,19 @@
#define MY_CLASS EFL_ANIMATION_GROUP_PARALLEL_CLASS
-EOLIAN static void
-_efl_animation_group_parallel_efl_playable_progress_set(Eo *eo_obj,
- void *_pd EINA_UNUSED,
- double progress)
+EOLIAN static double
+_efl_animation_group_parallel_efl_animation_animation_apply(Eo *eo_obj,
+ void *_pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
{
double group_length, group_elapsed_time;
double anim_length, anim_duration, anim_start_delay, anim_progress, anim_elapsed_time;
int anim_repeated_count;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
- if (!group_anim) return;
+ if (!group_anim) return progress;
group_length = efl_playable_length_get(eo_obj);
group_elapsed_time = group_length * progress;
@@ -35,7 +35,7 @@ _efl_animation_group_parallel_efl_playable_progress_set(Eo *eo_obj,
anim_progress = 1.0;
else
anim_progress = 0.0;
- efl_playable_progress_set(anim, anim_progress);
+ efl_animation_apply(anim, anim_progress, target);
continue;
}
@@ -46,8 +46,10 @@ _efl_animation_group_parallel_efl_playable_progress_set(Eo *eo_obj,
if (FINAL_STATE_IS_REVERSE(anim))
anim_progress = 1.0 - anim_progress;
- efl_playable_progress_set(anim, anim_progress);
+ efl_animation_apply(anim, anim_progress, target);
}
+
+ return progress;
}
EOLIAN static double
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.eo b/src/lib/evas/canvas/efl_animation_group_parallel.eo
index fa709964fb..944e2ad451 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel.eo
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.eo
@@ -8,6 +8,6 @@ class Efl.Animation.Group.Parallel (Efl.Animation.Group)
}
implements {
Efl.Animation.duration { get; }
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.c b/src/lib/evas/canvas/efl_animation_group_sequential.c
index 42e29038af..8bc83848a3 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential.c
+++ b/src/lib/evas/canvas/efl_animation_group_sequential.c
@@ -2,10 +2,11 @@
#define MY_CLASS EFL_ANIMATION_GROUP_SEQUENTIAL_CLASS
-EOLIAN static void
-_efl_animation_group_sequential_efl_playable_progress_set(Eo *eo_obj,
- void *_pd EINA_UNUSED,
- double progress)
+EOLIAN static double
+_efl_animation_group_sequential_efl_animation_animation_apply(Eo *eo_obj,
+ void *_pd EINA_UNUSED,
+ double progress,
+ Efl_Canvas_Object *target)
{
double group_length, group_elapsed_time;
double anim_length, anim_duration, anim_start_delay, anim_progress, anim_play_time, anim_position;
@@ -13,10 +14,9 @@ _efl_animation_group_sequential_efl_playable_progress_set(Eo *eo_obj,
double temp;
int anim_repeated_count;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
Eina_List *group_anim = efl_animation_group_animations_get(eo_obj);
- if (!group_anim) return;
+ if (!group_anim) return progress;
group_length = efl_playable_length_get(eo_obj);
group_elapsed_time = group_length * progress;
@@ -37,7 +37,7 @@ _efl_animation_group_sequential_efl_playable_progress_set(Eo *eo_obj,
anim_progress = 1.0;
else
anim_progress = 0.0;
- efl_playable_progress_set(anim, anim_progress);
+ efl_animation_apply(anim, anim_progress, target);
total_anim_elapsed_time = temp;
continue;
}
@@ -49,10 +49,12 @@ _efl_animation_group_sequential_efl_playable_progress_set(Eo *eo_obj,
anim_progress = MIN((anim_position / anim_duration), 1.0);
if (FINAL_STATE_IS_REVERSE(anim))
anim_progress = 1.0 - anim_progress;
- efl_playable_progress_set(anim, anim_progress);
+ efl_animation_apply(anim, anim_progress, target);
break;
}
+
+ return progress;
}
EOLIAN static double
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.eo b/src/lib/evas/canvas/efl_animation_group_sequential.eo
index 792bccdc93..2124f23494 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential.eo
+++ b/src/lib/evas/canvas/efl_animation_group_sequential.eo
@@ -8,6 +8,6 @@ class Efl.Animation.Group.Sequential (Efl.Animation.Group)
}
implements {
Efl.Animation.duration { get; }
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_player.c b/src/lib/evas/canvas/efl_animation_player.c
index 08bd380eb8..491014c8c7 100644
--- a/src/lib/evas/canvas/efl_animation_player.c
+++ b/src/lib/evas/canvas/efl_animation_player.c
@@ -1,5 +1,28 @@
#include "efl_animation_player_private.h"
+static void
+_target_del_cb(void *data, const Efl_Event *event EINA_UNUSED)
+{
+ Efl_Animation_Player_Data *pd = data;
+ pd->target = NULL;
+}
+
+EOLIAN static void
+_efl_animation_player_target_set(Eo *eo_obj EINA_UNUSED,
+ Efl_Animation_Player_Data *pd,
+ Efl_Canvas_Object *target)
+{
+ efl_event_callback_add(target, EFL_EVENT_DEL, _target_del_cb, pd);
+
+ pd->target = target;
+}
+
+EOLIAN static Efl_Canvas_Object *
+_efl_animation_player_target_get(Eo *eo_obj EINA_UNUSED, Efl_Animation_Player_Data *pd)
+{
+ return pd->target;
+}
+
EOLIAN static void
_efl_animation_player_auto_del_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Player_Data *pd,
@@ -76,7 +99,7 @@ _animator_cb(void *data)
pd->progress = (double)(pd->is_direction_forward);
}
- efl_playable_progress_set(anim, pd->progress);
+ efl_animation_apply(anim, pd->progress, efl_animation_player_target_get(eo_obj));
Efl_Animation_Player_Running_Event_Info event_info;
event_info.progress = pd->progress;
@@ -170,6 +193,7 @@ _efl_animation_player_efl_player_start(Eo *eo_obj,
_start(eo_obj, pd);
}
+
EOLIAN static void
_efl_animation_player_efl_player_stop(Eo *eo_obj,
Efl_Animation_Player_Data *pd)
@@ -195,7 +219,7 @@ _efl_animation_player_efl_player_stop(Eo *eo_obj,
{
pd->progress = 0.0;
}
- efl_playable_progress_set(anim, pd->progress);
+ efl_animation_apply(anim, pd->progress, efl_animation_player_target_get(eo_obj));
if (play)
efl_event_callback_call(eo_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, NULL);
@@ -268,7 +292,8 @@ _efl_animation_player_efl_player_position_set(Eo *eo_obj,
EFL_ANIMATION_PLAYER_ANIMATION_GET(eo_obj, anim);
double length = efl_player_length_get(anim);
- efl_playable_progress_set(anim, sec/ length );
+ pd->progress = sec / length;
+ efl_animation_apply(anim, pd->progress, efl_animation_player_target_get(eo_obj));
}
EOLIAN static double
diff --git a/src/lib/evas/canvas/efl_animation_player.eo b/src/lib/evas/canvas/efl_animation_player.eo
index 37537dd32d..b4df306d7e 100644
--- a/src/lib/evas/canvas/efl_animation_player.eo
+++ b/src/lib/evas/canvas/efl_animation_player.eo
@@ -21,6 +21,16 @@ class Efl.Animation.Player (Efl.Object, Efl.Player)
auto_del: bool; [[$true to delete animation object automatically when animation is finished or animation is cancelled, $false otherwise.]]
}
}
+ @property target {
+ [[Target object property]]
+ set {
+ }
+ get {
+ }
+ values {
+ target: Efl.Canvas.Object; [[Target object which is applied animation.]]
+ }
+ }
}
implements {
Efl.Object.constructor;
diff --git a/src/lib/evas/canvas/efl_animation_player_private.h b/src/lib/evas/canvas/efl_animation_player_private.h
index 30092e8dec..9b1a1fa3a5 100644
--- a/src/lib/evas/canvas/efl_animation_player_private.h
+++ b/src/lib/evas/canvas/efl_animation_player_private.h
@@ -30,6 +30,7 @@ typedef struct _Efl_Animation_Player_Data
} time;
Efl_Animation *animation;
+ Efl_Canvas_Object *target;
double progress;
double play_speed;
diff --git a/src/lib/evas/canvas/efl_animation_private.h b/src/lib/evas/canvas/efl_animation_private.h
index 88246a50de..bcadf35c1a 100644
--- a/src/lib/evas/canvas/efl_animation_private.h
+++ b/src/lib/evas/canvas/efl_animation_private.h
@@ -5,10 +5,7 @@
typedef struct _Efl_Animation_Data
{
- Efl_Canvas_Object *target;
-
double duration;
- double progress;
double start_delay_time;
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
index 01dbbb881f..72d30dc158 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_rotate.c
@@ -16,7 +16,7 @@ _rotation_get(Eo *target)
}
EOLIAN static void
-_efl_animation_rotate_rotate_set(Eo *eo_obj,
+_efl_animation_rotate_rotate_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Rotate_Data *pd,
double from_degree,
double to_degree,
@@ -27,33 +27,15 @@ _efl_animation_rotate_rotate_set(Eo *eo_obj,
pd->from.degree = from_degree;
pd->to.degree = to_degree;
+ //TODO: check whether ref for pivot should be added.
pd->rel_pivot.obj = pivot;
pd->rel_pivot.cx = cx;
pd->rel_pivot.cy = cy;
-
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
pd->use_rel_pivot = EINA_TRUE;
}
EOLIAN static void
-_efl_animation_rotate_rotate_get(Eo *eo_obj,
+_efl_animation_rotate_rotate_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Rotate_Data *pd,
double *from_degree,
double *to_degree,
@@ -61,27 +43,10 @@ _efl_animation_rotate_rotate_get(Eo *eo_obj,
double *cx,
double *cy)
{
- //Update relative pivot based on absolute pivot
if (!pd->use_rel_pivot)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
+ ERR("Animation is done in absolute value.");
+ return;
}
if (from_degree)
@@ -101,7 +66,7 @@ _efl_animation_rotate_rotate_get(Eo *eo_obj,
}
EOLIAN static void
-_efl_animation_rotate_rotate_absolute_set(Eo *eo_obj,
+_efl_animation_rotate_rotate_absolute_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Rotate_Data *pd,
double from_degree,
double to_degree,
@@ -113,59 +78,21 @@ _efl_animation_rotate_rotate_absolute_set(Eo *eo_obj,
pd->abs_pivot.cx = cx;
pd->abs_pivot.cy = cy;
-
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
pd->use_rel_pivot = EINA_FALSE;
}
EOLIAN static void
-_efl_animation_rotate_rotate_absolute_get(Eo *eo_obj,
+_efl_animation_rotate_rotate_absolute_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Rotate_Data *pd,
double *from_degree,
double *to_degree,
Evas_Coord *cx,
Evas_Coord *cy)
{
- //Update relative pivot based on absolute pivot
if (pd->use_rel_pivot)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
+ ERR("Animation is done in relative value.");
+ return;
}
if (from_degree)
@@ -181,20 +108,17 @@ _efl_animation_rotate_rotate_absolute_get(Eo *eo_obj,
*cy = pd->abs_pivot.cy;
}
-EOLIAN static void
-_efl_animation_rotate_efl_playable_progress_set(Eo *eo_obj,
- Efl_Animation_Rotate_Data *pd,
- double progress)
+EOLIAN static double
+_efl_animation_rotate_efl_animation_animation_apply(Eo *eo_obj,
+ Efl_Animation_Rotate_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
{
- Efl_Canvas_Object *target;
double new_degree;
double prev_degree;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
-
- target = efl_animation_target_get(eo_obj);
- if (!target) return;
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
prev_degree = _rotation_get(target);
new_degree = GET_STATUS(pd->from.degree, pd->to.degree, progress);
@@ -203,7 +127,7 @@ _efl_animation_rotate_efl_playable_progress_set(Eo *eo_obj,
{
efl_gfx_map_rotate(target,
new_degree - prev_degree,
- pd->rel_pivot.obj,
+ (pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
pd->rel_pivot.cx, pd->rel_pivot.cy);
}
else
@@ -212,6 +136,8 @@ _efl_animation_rotate_efl_playable_progress_set(Eo *eo_obj,
new_degree - prev_degree,
pd->abs_pivot.cx, pd->abs_pivot.cy);
}
+
+ return progress;
}
EOLIAN static Efl_Object *
diff --git a/src/lib/evas/canvas/efl_animation_rotate.eo b/src/lib/evas/canvas/efl_animation_rotate.eo
index 6e735fd15f..14c9901f2f 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.eo
+++ b/src/lib/evas/canvas/efl_animation_rotate.eo
@@ -35,6 +35,6 @@ class Efl.Animation.Rotate (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c
index d975336707..dbb4b765a4 100644
--- a/src/lib/evas/canvas/efl_animation_scale.c
+++ b/src/lib/evas/canvas/efl_animation_scale.c
@@ -24,7 +24,7 @@ _scale_get(Eo *target)
}
EOLIAN static void
-_efl_animation_scale_scale_set(Eo *eo_obj,
+_efl_animation_scale_scale_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Scale_Data *pd,
double from_scale_x,
double from_scale_y,
@@ -44,29 +44,11 @@ _efl_animation_scale_scale_set(Eo *eo_obj,
pd->rel_pivot.cx = cx;
pd->rel_pivot.cy = cy;
- //Update absolute pivot based on relative pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pivot)
- evas_object_geometry_get(pivot, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * cx);
- pd->abs_pivot.cy = y + (h * cy);
-
pd->use_rel_pivot = EINA_TRUE;
}
EOLIAN static void
-_efl_animation_scale_scale_get(Eo *eo_obj,
+_efl_animation_scale_scale_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Scale_Data *pd,
double *from_scale_x,
double *from_scale_y,
@@ -76,27 +58,10 @@ _efl_animation_scale_scale_get(Eo *eo_obj,
double *cx,
double *cy)
{
- //Update relative pivot based on absolute pivot
if (!pd->use_rel_pivot)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(pd->abs_pivot.cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(pd->abs_pivot.cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
+ ERR("Animation is done in absolute value.");
+ return;
}
if (from_scale_x)
@@ -122,7 +87,7 @@ _efl_animation_scale_scale_get(Eo *eo_obj,
}
EOLIAN static void
-_efl_animation_scale_scale_absolute_set(Eo *eo_obj,
+_efl_animation_scale_scale_absolute_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Scale_Data *pd,
double from_scale_x,
double from_scale_y,
@@ -140,33 +105,11 @@ _efl_animation_scale_scale_absolute_set(Eo *eo_obj,
pd->abs_pivot.cx = cx;
pd->abs_pivot.cy = cy;
- //Update relative pivot based on absolute pivot
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
-
- pd->rel_pivot.obj = NULL;
-
- if (w != 0)
- pd->rel_pivot.cx = (double)(cx - x) / w;
- else
- pd->rel_pivot.cx = 0.0;
-
- if (h != 0)
- pd->rel_pivot.cy = (double)(cy - y) / h;
- else
- pd->rel_pivot.cy = 0.0;
-
pd->use_rel_pivot = EINA_FALSE;
}
EOLIAN static void
-_efl_animation_scale_scale_absolute_get(Eo *eo_obj,
+_efl_animation_scale_scale_absolute_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Scale_Data *pd,
double *from_scale_x,
double *from_scale_y,
@@ -175,25 +118,10 @@ _efl_animation_scale_scale_absolute_get(Eo *eo_obj,
Evas_Coord *cx,
Evas_Coord *cy)
{
- //Update absolute pivot based on relative pivot
if (pd->use_rel_pivot)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
- Evas_Coord w = 0;
- Evas_Coord h = 0;
-
- if (pd->rel_pivot.obj)
- evas_object_geometry_get(pd->rel_pivot.obj, &x, &y, &w, &h);
- else
- {
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, &w, &h);
- }
-
- pd->abs_pivot.cx = x + (w * pd->rel_pivot.cx);
- pd->abs_pivot.cy = y + (h * pd->rel_pivot.cy);
+ ERR("Animation is done in relative value.");
+ return;
}
if (from_scale_x)
@@ -215,18 +143,17 @@ _efl_animation_scale_scale_absolute_get(Eo *eo_obj,
*cy = pd->abs_pivot.cy;
}
-EOLIAN static void
-_efl_animation_scale_efl_playable_progress_set(Eo *eo_obj,
- Efl_Animation_Scale_Data *pd,
- double progress)
+EOLIAN static double
+_efl_animation_scale_efl_animation_animation_apply(Eo *eo_obj,
+ Efl_Animation_Scale_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
{
Efl_Animation_Scale_Property prev_scale;
Efl_Animation_Scale_Property new_scale;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (!target) return;
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
prev_scale = _scale_get(target);
new_scale.scale_x = GET_STATUS(pd->from.scale_x, pd->to.scale_x, progress);
@@ -235,16 +162,20 @@ _efl_animation_scale_efl_playable_progress_set(Eo *eo_obj,
if (pd->use_rel_pivot)
{
efl_gfx_map_zoom(target,
- new_scale.scale_x / prev_scale.scale_x, new_scale.scale_y / prev_scale.scale_y,
- pd->rel_pivot.obj,
+ new_scale.scale_x / prev_scale.scale_x,
+ new_scale.scale_y / prev_scale.scale_y,
+ (pd->rel_pivot.obj) ? pd->rel_pivot.obj : target,
pd->rel_pivot.cx, pd->rel_pivot.cy);
}
else
{
efl_gfx_map_zoom_absolute(target,
- new_scale.scale_x / prev_scale.scale_x, new_scale.scale_y / prev_scale.scale_y,
+ new_scale.scale_x / prev_scale.scale_x,
+ new_scale.scale_y / prev_scale.scale_y,
pd->abs_pivot.cx, pd->abs_pivot.cy);
}
+
+ return progress;
}
EOLIAN static Efl_Object *
diff --git a/src/lib/evas/canvas/efl_animation_scale.eo b/src/lib/evas/canvas/efl_animation_scale.eo
index 80dad17336..312ac4e041 100644
--- a/src/lib/evas/canvas/efl_animation_scale.eo
+++ b/src/lib/evas/canvas/efl_animation_scale.eo
@@ -39,6 +39,6 @@ class Efl.Animation.Scale (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c
index 45e379a462..4464c59e6a 100644
--- a/src/lib/evas/canvas/efl_animation_translate.c
+++ b/src/lib/evas/canvas/efl_animation_translate.c
@@ -26,7 +26,7 @@ _translation_get(Eo *target)
}
EOLIAN static void
-_efl_animation_translate_translate_set(Eo *eo_obj,
+_efl_animation_translate_translate_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Translate_Data *pd,
Evas_Coord from_x,
Evas_Coord from_y,
@@ -39,46 +39,21 @@ _efl_animation_translate_translate_set(Eo *eo_obj,
pd->to.move_x = to_x;
pd->to.move_y = to_y;
- //Update absolute coordinate based on relative move
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
-
pd->use_rel_move = EINA_TRUE;
}
EOLIAN static void
-_efl_animation_translate_translate_get(Eo *eo_obj,
+_efl_animation_translate_translate_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Translate_Data *pd,
Evas_Coord *from_x,
Evas_Coord *from_y,
Evas_Coord *to_x,
Evas_Coord *to_y)
{
- //Update relative move based on absolute coordinate
if (!pd->use_rel_move)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
+ ERR("Animation is done in absolute value.");
+ return;
}
if (from_x)
@@ -93,7 +68,7 @@ _efl_animation_translate_translate_get(Eo *eo_obj,
}
EOLIAN static void
-_efl_animation_translate_translate_absolute_set(Eo *eo_obj,
+_efl_animation_translate_translate_absolute_set(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Translate_Data *pd,
Evas_Coord from_x,
Evas_Coord from_y,
@@ -106,46 +81,21 @@ _efl_animation_translate_translate_absolute_set(Eo *eo_obj,
pd->to.x = to_x;
pd->to.y = to_y;
- //Update relative move based on absolute coordinate
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.move_x = pd->from.x - x;
- pd->from.move_y = pd->from.y - y;
-
- pd->to.move_x = pd->to.x - x;
- pd->to.move_y = pd->to.y - y;
-
pd->use_rel_move = EINA_FALSE;
}
EOLIAN static void
-_efl_animation_translate_translate_absolute_get(Eo *eo_obj,
+_efl_animation_translate_translate_absolute_get(Eo *eo_obj EINA_UNUSED,
Efl_Animation_Translate_Data *pd,
Evas_Coord *from_x,
Evas_Coord *from_y,
Evas_Coord *to_x,
Evas_Coord *to_y)
{
- //Update absolute coordinate based on relative move
if (pd->use_rel_move)
{
- Evas_Coord x = 0;
- Evas_Coord y = 0;
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (target)
- evas_object_geometry_get(target, &x, &y, NULL, NULL);
-
- pd->from.x = pd->from.move_x + x;
- pd->from.y = pd->from.move_y + y;
-
- pd->to.x = pd->to.move_x + x;
- pd->to.y = pd->to.move_y + y;
+ ERR("Animation is done in absolute value.");
+ return;
}
if (from_x)
@@ -159,19 +109,17 @@ _efl_animation_translate_translate_absolute_get(Eo *eo_obj,
*to_y = pd->to.y;
}
-EOLIAN static void
-_efl_animation_translate_efl_playable_progress_set(Eo *eo_obj,
- Efl_Animation_Translate_Data *pd,
- double progress)
+EOLIAN static double
+_efl_animation_translate_efl_animation_animation_apply(Eo *eo_obj,
+ Efl_Animation_Translate_Data *pd,
+ double progress,
+ Efl_Canvas_Object *target)
{
_Translate_Property_Double prev;
_Translate_Property_Double new;
- efl_playable_progress_set(efl_super(eo_obj, MY_CLASS), progress);
- progress = efl_playable_progress_get(eo_obj);
-
- Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
- if (!target) return;
+ progress = efl_animation_apply(efl_super(eo_obj, MY_CLASS), progress, target);
+ if (!target) return progress;
prev = _translation_get(target);
if (pd->use_rel_move)
@@ -186,6 +134,8 @@ _efl_animation_translate_efl_playable_progress_set(Eo *eo_obj,
}
efl_gfx_map_translate(target, new.x - prev.x, new.y - prev.y, 0.0);
+
+ return progress;
}
EOLIAN static Efl_Object *
diff --git a/src/lib/evas/canvas/efl_animation_translate.eo b/src/lib/evas/canvas/efl_animation_translate.eo
index a71c94d450..59e0c5e649 100644
--- a/src/lib/evas/canvas/efl_animation_translate.eo
+++ b/src/lib/evas/canvas/efl_animation_translate.eo
@@ -34,6 +34,6 @@ class Efl.Animation.Translate (Efl.Animation)
}
implements {
Efl.Object.constructor;
- Efl.Playable.progress { set; }
+ Efl.Animation.animation_apply;
}
}
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c
index 2e4efe4a4f..bcc853534e 100644
--- a/src/lib/evas/canvas/evas_object_main.c
+++ b/src/lib/evas/canvas/evas_object_main.c
@@ -177,17 +177,18 @@ static void _animation_intercept_hide(void *data, Evas_Object *eo_obj);
static void _hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
static void
-_animation_end_cb(void *data, const Efl_Event *event EINA_UNUSED)
+_animation_end_cb(void *data, const Efl_Event *event)
{
- Event_Animation *event_anim = data;
- Evas_Object *target = efl_animation_target_get(event_anim->anim);
- Evas_Object_Protected_Data *obj = EVAS_OBJECT_DATA_SAFE_GET(target);
+ Evas_Object_Protected_Data *obj;
+ Event_Animation *event_anim = data;
+ obj = EVAS_OBJECT_DATA_SAFE_GET(efl_animation_player_target_get(event->object));
if (!obj) return;
- if (efl_animation_player_animation_get(obj->anim_player) != event_anim->anim)
+
+ if (efl_animation_player_animation_get(event->object) != event_anim->anim)
return;
- _hide(target, obj);
+ _hide(obj->object, obj);
}
static void
@@ -213,18 +214,14 @@ _event_anim_free(Event_Animation *event_anim, Evas_Object_Protected_Data *obj)
//Deallocate memory and Unset callbacks for Hide event
if (event_anim->desc == EFL_GFX_EVENT_HIDE)
{
- Efl_Canvas_Object *target =
- efl_animation_target_get(event_anim->anim);
-
- evas_object_intercept_hide_callback_del(target,
+ evas_object_intercept_hide_callback_del(obj->object,
_animation_intercept_hide);
efl_event_callback_del(obj->anim_player,
EFL_ANIMATION_PLAYER_EVENT_ENDED,
_animation_end_cb,
event_anim);
- double progress = efl_playable_progress_get(event_anim->anim);
- if (progress > 0.0 && (1.0 - progress) > DBL_EPSILON)
- efl_gfx_visible_set(target, EINA_FALSE);
+ if (efl_player_play_get(obj->anim_player))
+ efl_gfx_visible_set(obj->object, EINA_FALSE);
}
}
@@ -1121,8 +1118,7 @@ _efl_canvas_object_efl_object_event_callback_call(Eo *eo_obj,
//Start animation corresponding to the current event
if (desc)
{
- if (desc != EFL_GFX_EVENT_HIDE)
- //if (!_efl_animation_event_type_is_inform_call(desc))
+ if ((desc != EFL_GFX_EVENT_HIDE) && desc != (EFL_GFX_EVENT_SHOW))
{
Event_Animation *event_anim = _event_animation_find(obj, desc);
if (event_anim)
@@ -1151,8 +1147,7 @@ _efl_canvas_object_efl_object_event_callback_legacy_call(Eo *eo_obj,
//Start animation corresponding to the current event
if (desc)
{
- if (desc != EFL_GFX_EVENT_HIDE)
- //if (!_efl_animation_event_type_is_inform_call(desc))
+ if ((desc != EFL_GFX_EVENT_HIDE) && desc != (EFL_GFX_EVENT_SHOW))
{
Event_Animation *event_anim = _event_animation_find(obj, desc);
if (event_anim)
@@ -2669,7 +2664,8 @@ _efl_canvas_object_event_animation_set(Eo *eo_obj,
if (!pd->anim_player)
{
- pd->anim_player = efl_add(EFL_ANIMATION_PLAYER_CLASS, eo_obj);
+ pd->anim_player = efl_add(EFL_ANIMATION_PLAYER_CLASS, eo_obj,
+ efl_animation_player_target_set(efl_added, eo_obj));
}
if (event_anim)
@@ -2687,16 +2683,10 @@ _efl_canvas_object_event_animation_set(Eo *eo_obj,
event_anim = calloc(1, sizeof(Event_Animation));
- //Set target object for the given animation
- Efl_Canvas_Object *target = efl_animation_target_get(animation);
- if (!target)
- target = eo_obj;
- efl_animation_target_set(animation, target);
-
//Set callback for Hide event
if (desc == EFL_GFX_EVENT_HIDE)
{
- evas_object_intercept_hide_callback_add(target,
+ evas_object_intercept_hide_callback_add(eo_obj,
_animation_intercept_hide,
event_anim);
efl_event_callback_add(pd->anim_player,