summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-05-19 13:18:55 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-30 17:28:34 +0900
commit14ced7cdf50a4bf1719c839830b0f627b4169762 (patch)
treede92991eeb860591f0a09413c0e2f0930f2a6606
parent91a84f83766b3f41522969a2b5239b51818ddfbb (diff)
downloadefl-14ced7cdf50a4bf1719c839830b0f627b4169762.tar.gz
efl_animation: Add pre_animate event
To remove duplicate event calls with outside of class, pre_animate event is used instead of animate event within class. pre_animate event happens before animate event happens.
-rw-r--r--src/lib/evas/canvas/efl_animation.c3
-rw-r--r--src/lib/evas/canvas/efl_animation.eo1
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c6
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c5
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.c5
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.c5
6 files changed, 17 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
index 62ed59bf79..b91ce98daf 100644
--- a/src/lib/evas/canvas/efl_animation.c
+++ b/src/lib/evas/canvas/efl_animation.c
@@ -185,6 +185,9 @@ _animator_cb(void *data)
Efl_Animation_Animate_Event_Info event_info;
event_info.progress = pd->progress;
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_EVENT_PRE_ANIMATE,
+ &event_info);
efl_event_callback_call(eo_obj, EFL_ANIMATION_EVENT_ANIMATE, &event_info);
/* Not end. Keep going. */
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo
index 5848efc72b..36018c02c5 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_animation.eo
@@ -57,5 +57,6 @@ abstract Efl.Animation (Efl.Object)
events {
animate; [[Animation is animated.]]
end; [[Animation ended]]
+ pre_animate @protected; /* @internal */ [[Animate is animated, but this event happens before animate event. To remove duplicate event calls with outside of class, pre_animate event is used instead of animate event within class.]]
}
}
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index f6c8914322..65b144415b 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -53,7 +53,7 @@ _efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Animation_Alp
}
static void
-_animate_cb(void *data EINA_UNUSED, const Efl_Event *event)
+_pre_animate_cb(void *data EINA_UNUSED, const Efl_Event *event)
{
EFL_ANIMATION_ALPHA_DATA_GET(event->object, pd);
Efl_Animation_Animate_Event_Info *event_info = event->info;
@@ -77,7 +77,9 @@ _efl_animation_alpha_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_Al
pd->from.alpha = 1.0;
pd->to.alpha = 1.0;
- efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_ANIMATE, _animate_cb, NULL);
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, NULL);
return eo_obj;
}
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
index 4dd0ab0e54..02550675bd 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_rotate.c
@@ -120,7 +120,7 @@ _efl_animation_rotate_absolute_pivot_get(Eo *eo_obj, Evas_Object_Animation_Rotat
}
static void
-_animate_cb(void *data, const Efl_Event *event)
+_pre_animate_cb(void *data, const Efl_Event *event)
{
Efl_Animation_Animate_Event_Info *event_info = event->info;
}
@@ -143,7 +143,8 @@ _efl_animation_rotate_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_R
pd->use_rel_pivot = EINA_TRUE;
- efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_ANIMATE, _animate_cb, NULL);
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_PRE_ANIMATE, _pre_animate_cb, NULL);
return eo_obj;
}
diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c
index 3fe0d3b4d9..9fa76a2a9c 100644
--- a/src/lib/evas/canvas/efl_animation_scale.c
+++ b/src/lib/evas/canvas/efl_animation_scale.c
@@ -122,7 +122,7 @@ _efl_animation_scale_scale_z_get(Eo *eo_obj, Evas_Object_Animation_Scale_Data *p
}
static void
-_animate_cb(void *data, const Efl_Event *event)
+_pre_animate_cb(void *data, const Efl_Event *event)
{
Efl_Animation_Animate_Event_Info *event_info = event->info;
}
@@ -136,7 +136,8 @@ _efl_animation_scale_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_Sc
pd->from.scale_y = 1.0;
pd->from.scale_z = 1.0;
- efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_ANIMATE, _animate_cb, NULL);
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_PRE_ANIMATE, _pre_animate_cb, NULL);
return eo_obj;
}
diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c
index 5b09effb45..2670ac344e 100644
--- a/src/lib/evas/canvas/efl_animation_translate.c
+++ b/src/lib/evas/canvas/efl_animation_translate.c
@@ -231,7 +231,7 @@ _efl_animation_translate_coordinate_z_get(Eo *eo_obj, Evas_Object_Animation_Tran
}
static void
-_animate_cb(void *data, const Efl_Event *event)
+_pre_animate_cb(void *data, const Efl_Event *event)
{
Efl_Animation_Animate_Event_Info *event_info = event->info;
}
@@ -257,7 +257,8 @@ _efl_animation_translate_efl_object_constructor(Eo *eo_obj, Evas_Object_Animatio
pd->to.y = 0;
pd->to.z = 0;
- efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_ANIMATE, _animate_cb, NULL);
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(eo_obj, EFL_ANIMATION_EVENT_PRE_ANIMATE, _pre_animate_cb, NULL);
return eo_obj;
}