summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-12 19:45:43 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-06-30 17:28:36 +0900
commit9d0f278ca70ce2ece777c9b613b55dca87016cd7 (patch)
treea72a1666a1b577cddefc1c97af12651bd459d83a
parentcd87a7aebc7b1c29adf8434a5cc1d3a2ce65d962 (diff)
downloadefl-9d0f278ca70ce2ece777c9b613b55dca87016cd7.tar.gz
efl_animation: Add group parallel animation
-rw-r--r--src/Makefile_Evas.am4
-rw-r--r--src/lib/evas/Evas_Eo.h2
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.c89
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.eo14
-rw-r--r--src/lib/evas/canvas/efl_animation_instance.c47
-rw-r--r--src/lib/evas/canvas/efl_animation_instance.eo7
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group.c14
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group.eo1
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group_parallel.c162
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group_parallel.eo14
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group_sequential.c77
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_group_sequential.eo1
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_rotate.c3
-rw-r--r--src/lib/evas/canvas/efl_animation_instance_scale.c3
-rw-r--r--src/lib/evas/include/evas_private.h2
15 files changed, 423 insertions, 17 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index c43fa83159..661aac33c1 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -57,6 +57,7 @@ evas_eolian_pub_files = \
lib/evas/canvas/efl_animation_translate.eo \
lib/evas/canvas/efl_animation_group.eo \
lib/evas/canvas/efl_animation_group_sequential.eo \
+ lib/evas/canvas/efl_animation_group_parallel.eo \
lib/evas/canvas/efl_animation_instance.eo \
lib/evas/canvas/efl_animation_instance_alpha.eo \
lib/evas/canvas/efl_animation_instance_rotate.eo \
@@ -64,6 +65,7 @@ evas_eolian_pub_files = \
lib/evas/canvas/efl_animation_instance_translate.eo \
lib/evas/canvas/efl_animation_instance_group.eo \
lib/evas/canvas/efl_animation_instance_group_sequential.eo \
+ lib/evas/canvas/efl_animation_instance_group_parallel.eo \
$(NULL)
evas_eolian_legacy_files = \
@@ -235,6 +237,7 @@ lib/evas/canvas/efl_animation_scale.c \
lib/evas/canvas/efl_animation_translate.c \
lib/evas/canvas/efl_animation_group.c \
lib/evas/canvas/efl_animation_group_sequential.c \
+lib/evas/canvas/efl_animation_group_parallel.c \
lib/evas/canvas/efl_animation_instance.c \
lib/evas/canvas/efl_animation_instance_alpha.c \
lib/evas/canvas/efl_animation_instance_rotate.c \
@@ -242,6 +245,7 @@ lib/evas/canvas/efl_animation_instance_scale.c \
lib/evas/canvas/efl_animation_instance_translate.c \
lib/evas/canvas/efl_animation_instance_group.c \
lib/evas/canvas/efl_animation_instance_group_sequential.c \
+lib/evas/canvas/efl_animation_instance_group_parallel.c \
$(NULL)
EXTRA_DIST2 += \
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index 81c34c92bf..ba70df554d 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -73,6 +73,7 @@
#include "canvas/efl_animation_translate.eo.h"
#include "canvas/efl_animation_group.eo.h"
#include "canvas/efl_animation_group_sequential.eo.h"
+#include "canvas/efl_animation_group_parallel.eo.h"
#include "canvas/efl_animation_instance.eo.h"
#include "canvas/efl_animation_instance_alpha.eo.h"
#include "canvas/efl_animation_instance_rotate.eo.h"
@@ -80,6 +81,7 @@
#include "canvas/efl_animation_instance_translate.eo.h"
#include "canvas/efl_animation_instance_group.eo.h"
#include "canvas/efl_animation_instance_group_sequential.eo.h"
+#include "canvas/efl_animation_instance_group_parallel.eo.h"
#endif /* EFL_EO_API_SUPPORT */
#if defined(EFL_BETA_API_SUPPORT) && defined(EFL_EO_API_SUPPORT)
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.c b/src/lib/evas/canvas/efl_animation_group_parallel.c
new file mode 100644
index 0000000000..551de0b43a
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.c
@@ -0,0 +1,89 @@
+#define EFL_ANIMATION_PROTECTED
+
+#include "evas_common_private.h"
+#include "evas_private.h"
+
+#define MY_CLASS EFL_ANIMATION_GROUP_PARALLEL_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#define EFL_ANIMATION_GROUP_PARALLEL_CHECK_OR_RETURN(anim, ...) \
+do { \
+ if (!anim) { \
+ CRI("Efl_Animation " # anim " is NULL!"); \
+ return __VA_ARGS__; \
+ } \
+ if (efl_animation_is_deleted(anim)) { \
+ ERR("Efl_Animation " # anim " has already been deleted!"); \
+ return __VA_ARGS__; \
+ } \
+} while (0)
+
+#define EFL_ANIMATION_GROUP_PARALLEL_DATA_GET(o, pd) \
+ Evas_Object_Animation_Group_Parallel_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_PARALLEL_CLASS)
+
+struct _Evas_Object_Animation_Group_Parallel_Data
+{
+};
+
+EOLIAN static Efl_Animation *
+_efl_animation_group_parallel_efl_animation_dup(Eo *eo_obj, Evas_Object_Animation_Group_Parallel_Data *pd EINA_UNUSED)
+{
+ EFL_ANIMATION_GROUP_PARALLEL_CHECK_OR_RETURN(eo_obj, NULL);
+
+ Efl_Animation *animation = efl_add(MY_CLASS, NULL);
+
+ double duration = efl_animation_duration_get(eo_obj);
+ efl_animation_duration_set(animation, duration);
+
+ Eo *target = efl_animation_target_get(eo_obj);
+ efl_animation_target_set(animation, target);
+
+ Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
+ efl_animation_final_state_keep_set(animation, state_keep);
+
+ Eina_List *animations = efl_animation_group_animations_get(eo_obj);
+ Eina_List *l;
+ Efl_Animation *child_anim;
+ EINA_LIST_FOREACH(animations, l, child_anim)
+ {
+ efl_animation_group_animation_add(animation, child_anim);
+ }
+
+ return animation;
+}
+
+EOLIAN static Efl_Animation_Instance *
+_efl_animation_group_parallel_efl_animation_instance_create(Eo *eo_obj, Evas_Object_Animation_Group_Parallel_Data *pd)
+{
+ EFL_ANIMATION_GROUP_PARALLEL_CHECK_OR_RETURN(eo_obj, NULL);
+
+ Efl_Animation_Instance_Group_Parallel *instance
+ = efl_add(EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CLASS, NULL);
+
+ Eo *target = efl_animation_target_get(eo_obj);
+ efl_animation_instance_target_set(instance, target);
+
+ Eina_Bool state_keep = efl_animation_final_state_keep_get(eo_obj);
+ efl_animation_instance_final_state_keep_set(instance, state_keep);
+
+ double duration = efl_animation_duration_get(eo_obj);
+ efl_animation_instance_duration_set(instance, duration);
+
+ Efl_Animation_Instance_Group_Parallel *group_inst
+ = efl_add(EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CLASS, NULL);
+
+ Eina_List *animations = efl_animation_group_animations_get(eo_obj);
+ Eina_List *l;
+ Efl_Animation *child_anim;
+ Efl_Animation_Instance *child_inst;
+
+ EINA_LIST_FOREACH(animations, l, child_anim)
+ {
+ child_inst = efl_animation_instance_create(child_anim);
+ efl_animation_instance_group_instance_add(group_inst, child_inst);
+ }
+
+ return group_inst;
+}
+
+#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
new file mode 100644
index 0000000000..982c8c910c
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.eo
@@ -0,0 +1,14 @@
+import efl_animation_types;
+
+class Efl.Animation.Group.Parallel (Efl.Animation.Group)
+{
+ [[Efl group parallel animation class]]
+ legacy_prefix: evas_object_animation;
+ data: Evas_Object_Animation_Group_Parallel_Data;
+ methods {
+ }
+ implements {
+ Efl.Animation.dup;
+ Efl.Animation.instance_create;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_animation_instance.c b/src/lib/evas/canvas/efl_animation_instance.c
index dd5a106afd..16a92e24ca 100644
--- a/src/lib/evas/canvas/efl_animation_instance.c
+++ b/src/lib/evas/canvas/efl_animation_instance.c
@@ -57,6 +57,7 @@ struct _Evas_Object_Animation_Instance_Data
Eina_Bool cancelled : 1;
Eina_Bool ended : 1;
Eina_Bool state_keep : 1;
+ Eina_Bool is_group_member : 1;
};
static void
@@ -188,6 +189,13 @@ _animator_cb(void *data)
Efl_Animation_Animate_Event_Info event_info;
event_info.progress = pd->progress;
+ if (!pd->is_group_member)
+ {
+ //Reset previous map effect before apply map effect
+ if (efl_gfx_map_has(pd->target))
+ efl_gfx_map_reset(pd->target);
+ }
+
//pre animate event is supported within class only (protected event)
efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
&event_info);
@@ -217,11 +225,9 @@ end:
return ECORE_CALLBACK_CANCEL;
}
-EOLIAN static Eina_Bool
-_efl_animation_instance_start(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
+static Eina_Bool
+_start(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
{
- EFL_ANIMATION_INSTANCE_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
-
if (pd->duration <= 0.0)
return EINA_FALSE;
@@ -250,6 +256,26 @@ _efl_animation_instance_start(Eo *eo_obj, Evas_Object_Animation_Instance_Data *p
}
EOLIAN static Eina_Bool
+_efl_animation_instance_start(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
+
+ pd->is_group_member = EINA_FALSE;
+
+ return _start(eo_obj, pd);
+}
+
+EOLIAN static Eina_Bool
+_efl_animation_instance_member_start(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
+
+ pd->is_group_member = EINA_TRUE;
+
+ return _start(eo_obj, pd);
+}
+
+EOLIAN static Eina_Bool
_efl_animation_instance_cancel(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
{
EFL_ANIMATION_INSTANCE_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
@@ -288,6 +314,19 @@ _efl_animation_instance_state_get(Eo *eo_obj, Evas_Object_Animation_Instance_Dat
return EFL_ANIMATION_STATE_STOPPED;
}
+EOLIAN static void
+_efl_animation_instance_map_reset(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_CHECK_OR_RETURN(eo_obj);
+
+ Efl_Canvas_Object *target = efl_animation_instance_target_get(eo_obj);
+ if (target)
+ {
+ if (efl_gfx_map_has(target))
+ efl_gfx_map_reset(target);
+ }
+}
+
EOLIAN static Efl_Object *
_efl_animation_instance_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_Instance_Data *pd)
{
diff --git a/src/lib/evas/canvas/efl_animation_instance.eo b/src/lib/evas/canvas/efl_animation_instance.eo
index 6f2972ffe4..103973b10d 100644
--- a/src/lib/evas/canvas/efl_animation_instance.eo
+++ b/src/lib/evas/canvas/efl_animation_instance.eo
@@ -41,6 +41,10 @@ abstract Efl.Animation.Instance (Efl.Object)
[[Start animation.]]
return: bool; [[$true on success, $false otherwise]]
}
+ member_start @protected /* @internal */ {
+ [[Start group member instance. To display instances as one instance, map effect should not be reset per group member instance. Therefore, group instance calls this method not to reset map effect automatically and resets map effect after all group member instances are animated.]]
+ return: bool; [[$true on success, $false otherwise]]
+ }
cancel {
[[Cancel animation.]]
return: bool; [[$true on success, $false otherwise]]
@@ -49,6 +53,9 @@ abstract Efl.Animation.Instance (Efl.Object)
[[Get the state of animation]]
return: Efl.Animation.State; [[Animation state]]
}
+ map_reset @protected /* @internal */ {
+ [[Reset map effect.]]
+ }
}
implements {
Efl.Object.constructor;
diff --git a/src/lib/evas/canvas/efl_animation_instance_group.c b/src/lib/evas/canvas/efl_animation_instance_group.c
index de01d259c1..0c01d856b8 100644
--- a/src/lib/evas/canvas/efl_animation_instance_group.c
+++ b/src/lib/evas/canvas/efl_animation_instance_group.c
@@ -54,6 +54,20 @@ _efl_animation_instance_group_instances_get(Eo *eo_obj, Evas_Object_Animation_In
return pd->instances;
}
+EOLIAN static void
+_efl_animation_instance_group_efl_animation_instance_map_reset(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_GROUP_CHECK_OR_RETURN(eo_obj);
+
+ Eina_List *l;
+ Efl_Animation_Instance *inst;
+
+ EINA_LIST_FOREACH(pd->instances, l, inst)
+ {
+ efl_animation_instance_map_reset(inst);
+ }
+}
+
EOLIAN static Efl_Object *
_efl_animation_instance_group_efl_object_constructor(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Data *pd)
{
diff --git a/src/lib/evas/canvas/efl_animation_instance_group.eo b/src/lib/evas/canvas/efl_animation_instance_group.eo
index bd9cbc973f..7b58417912 100644
--- a/src/lib/evas/canvas/efl_animation_instance_group.eo
+++ b/src/lib/evas/canvas/efl_animation_instance_group.eo
@@ -26,5 +26,6 @@ abstract Efl.Animation.Instance.Group (Efl.Animation.Instance)
implements {
Efl.Object.constructor;
Efl.Object.destructor;
+ Efl.Animation.Instance.map_reset;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_instance_group_parallel.c b/src/lib/evas/canvas/efl_animation_instance_group_parallel.c
new file mode 100644
index 0000000000..1c965372ab
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_instance_group_parallel.c
@@ -0,0 +1,162 @@
+#define EFL_ANIMATION_INSTANCE_PROTECTED
+
+#include "evas_common_private.h"
+#include "evas_private.h"
+
+#define MY_CLASS EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CLASS
+#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
+
+#define EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CHECK_OR_RETURN(anim, ...) \
+do { \
+ if (!anim) { \
+ CRI("Efl_Animation_Instance " # anim " is NULL!"); \
+ return __VA_ARGS__; \
+ } \
+ if (efl_animation_instance_is_deleted(anim)) { \
+ ERR("Efl_Animation_Instance " # anim " has already been deleted!"); \
+ return __VA_ARGS__; \
+ } \
+} while (0)
+
+#define EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_DATA_GET(o, pd) \
+ Evas_Object_Animation_Instance_Group_Parallel_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CLASS)
+
+struct _Evas_Object_Animation_Instance_Group_Parallel_Data
+{
+ int count;
+ int animate_count;
+ int end_count;
+
+ Eina_Bool is_group_member : 1;
+};
+
+static void
+_pre_animate_cb(void *data, const Efl_Event *event)
+{
+ Eo *eo_obj = data;
+
+ EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_DATA_GET(eo_obj, pd);
+
+ pd->animate_count++;
+
+ if (pd->animate_count == pd->count)
+ {
+ if (!pd->is_group_member)
+ {
+ Eina_List *insts
+ = efl_animation_instance_group_instances_get(eo_obj);
+ Eina_List *l;
+ Efl_Animation_Instance *inst;
+
+ //Reset previous map effect of all instances
+ EINA_LIST_FOREACH(insts, l, inst)
+ {
+ efl_animation_instance_map_reset(inst);
+ }
+ }
+
+ pd->animate_count = 0;
+
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ event->info);
+ }
+}
+
+static void
+_post_end_cb(void *data, const Efl_Event *event)
+{
+ Eo *eo_obj = data;
+
+ EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_DATA_GET(eo_obj, pd);
+
+ efl_event_callback_del(event->object,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
+ efl_event_callback_del(event->object, EFL_ANIMATION_INSTANCE_EVENT_POST_END,
+ _post_end_cb, eo_obj);
+
+ pd->end_count++;
+
+ if (pd->count == pd->end_count)
+ {
+ //pre end event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_PRE_END, NULL);
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_END, NULL);
+ //post end event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_POST_END, NULL);
+ }
+}
+
+static Eina_Bool
+_start(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Parallel_Data *pd)
+{
+ pd->count = 0;
+ pd->animate_count = 0;
+ pd->end_count = 0;
+
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_START, NULL);
+
+ Eina_Bool ret = EINA_FALSE;
+
+ Eina_List *animations = efl_animation_instance_group_instances_get(eo_obj);
+ Eina_List *l;
+ Efl_Animation *anim;
+ EINA_LIST_FOREACH(animations, l, anim)
+ {
+ //Data should be registered before animation starts
+ pd->count++;
+
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
+ //post end event is supported within class only (protected event)
+ efl_event_callback_add(anim, EFL_ANIMATION_INSTANCE_EVENT_POST_END,
+ _post_end_cb, eo_obj);
+
+ if (efl_animation_instance_member_start(anim))
+ {
+ ret = EINA_TRUE;
+ }
+ else
+ {
+ pd->count--;
+
+ efl_event_callback_del(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
+ efl_event_callback_del(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_POST_END,
+ _post_end_cb, eo_obj);
+ }
+ }
+
+ return ret;
+}
+
+EOLIAN static Eina_Bool
+_efl_animation_instance_group_parallel_efl_animation_instance_start(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Parallel_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
+
+ pd->is_group_member = EINA_FALSE;
+
+ return _start(eo_obj, pd);
+}
+
+EOLIAN static Eina_Bool
+_efl_animation_instance_group_parallel_efl_animation_instance_member_start(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Parallel_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_GROUP_PARALLEL_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
+
+ pd->is_group_member = EINA_TRUE;
+
+ return _start(eo_obj, pd);
+}
+
+#include "efl_animation_instance_group_parallel.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_instance_group_parallel.eo b/src/lib/evas/canvas/efl_animation_instance_group_parallel.eo
new file mode 100644
index 0000000000..087884b4a0
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_instance_group_parallel.eo
@@ -0,0 +1,14 @@
+import efl_animation_types;
+
+class Efl.Animation.Instance.Group.Parallel (Efl.Animation.Instance.Group)
+{
+ [[Efl group parallel animation instance class]]
+ legacy_prefix: evas_object_animation_instance;
+ data: Evas_Object_Animation_Instance_Group_Parallel_Data;
+ methods {
+ }
+ implements {
+ Efl.Animation.Instance.start;
+ Efl.Animation.Instance.member_start;
+ }
+}
diff --git a/src/lib/evas/canvas/efl_animation_instance_group_sequential.c b/src/lib/evas/canvas/efl_animation_instance_group_sequential.c
index 0f3666a0cc..7429f07090 100644
--- a/src/lib/evas/canvas/efl_animation_instance_group_sequential.c
+++ b/src/lib/evas/canvas/efl_animation_instance_group_sequential.c
@@ -23,18 +23,39 @@ do { \
struct _Evas_Object_Animation_Instance_Group_Sequential_Data
{
- int current_index;
+ int current_index;
+
+ Eina_Bool is_group_member : 1;
};
static Eina_Bool _index_animation_start(Eo *eo_obj, int index);
static void
+_pre_animate_cb(void *data, const Efl_Event *event)
+{
+ Eo *eo_obj = data;
+
+ EFL_ANIMATION_INSTANCE_GROUP_SEQUENTIAL_DATA_GET(eo_obj, pd);
+ if (!pd->is_group_member)
+ efl_animation_instance_map_reset(event->object);
+
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_call(eo_obj,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ event->info);
+}
+
+static void
_post_end_cb(void *data, const Efl_Event *event)
{
Eo *eo_obj = data;
EFL_ANIMATION_INSTANCE_GROUP_SEQUENTIAL_DATA_GET(eo_obj, pd);
+ efl_event_callback_del(event->object,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
efl_event_callback_del(event->object, EFL_ANIMATION_INSTANCE_EVENT_POST_END,
_post_end_cb, eo_obj);
@@ -60,16 +81,50 @@ _post_end_cb(void *data, const Efl_Event *event)
static Eina_Bool
_index_animation_start(Eo *eo_obj, int index)
{
+ EFL_ANIMATION_INSTANCE_GROUP_SEQUENTIAL_DATA_GET(eo_obj, pd);
+
Efl_Animation_Instance *anim =
eina_list_nth(efl_animation_instance_group_instances_get(eo_obj), index);
if (!anim || efl_animation_instance_is_deleted(anim))
return EINA_FALSE;
+ Eina_Bool ret = EINA_FALSE;
+
+ //pre animate event is supported within class only (protected event)
+ efl_event_callback_add(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
//post end event is supported within class only (protected event)
- efl_event_callback_add(anim, EFL_ANIMATION_INSTANCE_EVENT_POST_END, _post_end_cb,
- eo_obj);
+ efl_event_callback_add(anim, EFL_ANIMATION_INSTANCE_EVENT_POST_END,
+ _post_end_cb, eo_obj);
- return efl_animation_instance_start(anim);
+ if (efl_animation_instance_member_start(anim))
+ {
+ ret = EINA_TRUE;
+ }
+ else
+ {
+ efl_event_callback_del(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_PRE_ANIMATE,
+ _pre_animate_cb, eo_obj);
+
+ efl_event_callback_del(anim,
+ EFL_ANIMATION_INSTANCE_EVENT_POST_END,
+ _post_end_cb, eo_obj);
+ }
+
+ return ret;
+}
+
+static Eina_Bool
+_start(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Sequential_Data *pd)
+{
+ pd->current_index = 0;
+
+ efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_START, NULL);
+
+ return _index_animation_start(eo_obj, pd->current_index);
}
EOLIAN static Eina_Bool
@@ -77,11 +132,19 @@ _efl_animation_instance_group_sequential_efl_animation_instance_start(Eo *eo_obj
{
EFL_ANIMATION_INSTANCE_GROUP_SEQUENTIAL_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
- pd->current_index = 0;
+ pd->is_group_member = EINA_FALSE;
- efl_event_callback_call(eo_obj, EFL_ANIMATION_INSTANCE_EVENT_START, NULL);
+ return _start(eo_obj, pd);
+}
- return _index_animation_start(eo_obj, pd->current_index);
+EOLIAN static Eina_Bool
+_efl_animation_instance_group_sequential_efl_animation_instance_member_start(Eo *eo_obj, Evas_Object_Animation_Instance_Group_Sequential_Data *pd)
+{
+ EFL_ANIMATION_INSTANCE_GROUP_SEQUENTIAL_CHECK_OR_RETURN(eo_obj, EINA_FALSE);
+
+ pd->is_group_member = EINA_TRUE;
+
+ return _start(eo_obj, pd);
}
#include "efl_animation_instance_group_sequential.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_instance_group_sequential.eo b/src/lib/evas/canvas/efl_animation_instance_group_sequential.eo
index 8f680c5fba..7abfa0a46a 100644
--- a/src/lib/evas/canvas/efl_animation_instance_group_sequential.eo
+++ b/src/lib/evas/canvas/efl_animation_instance_group_sequential.eo
@@ -9,5 +9,6 @@ class Efl.Animation.Instance.Group.Sequential (Efl.Animation.Instance.Group)
}
implements {
Efl.Animation.Instance.start;
+ Efl.Animation.Instance.member_start;
}
}
diff --git a/src/lib/evas/canvas/efl_animation_instance_rotate.c b/src/lib/evas/canvas/efl_animation_instance_rotate.c
index e05c1df550..9501321c4f 100644
--- a/src/lib/evas/canvas/efl_animation_instance_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_instance_rotate.c
@@ -214,9 +214,6 @@ _pre_animate_cb(void *data, const Efl_Event *event)
double degree =
(pd->from.degree * (1.0 - progress)) + (pd->to.degree * progress);
- if (efl_gfx_map_has(target))
- efl_gfx_map_reset(target);
-
if (pd->use_rel_pivot)
{
efl_gfx_map_rotate(target,
diff --git a/src/lib/evas/canvas/efl_animation_instance_scale.c b/src/lib/evas/canvas/efl_animation_instance_scale.c
index c758f7e344..f6907f37da 100644
--- a/src/lib/evas/canvas/efl_animation_instance_scale.c
+++ b/src/lib/evas/canvas/efl_animation_instance_scale.c
@@ -235,9 +235,6 @@ _pre_animate_cb(void *data EINA_UNUSED, const Efl_Event *event)
double scale_y =
(pd->from.scale_y * (1.0 - progress)) + (pd->to.scale_y * progress);
- if (efl_gfx_map_has(target))
- efl_gfx_map_reset(target);
-
if (pd->use_rel_pivot)
{
efl_gfx_map_zoom(target,
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index f208bbb03f..2ab7f88c4c 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -114,6 +114,7 @@ typedef struct _Evas_Object_Animation_Scale_Data Evas_Objec
typedef struct _Evas_Object_Animation_Translate_Data Evas_Object_Animation_Translate_Data;
typedef struct _Evas_Object_Animation_Group_Data Evas_Object_Animation_Group_Data;
typedef struct _Evas_Object_Animation_Group_Sequential_Data Evas_Object_Animation_Group_Sequential_Data;
+typedef struct _Evas_Object_Animation_Group_Parallel_Data Evas_Object_Animation_Group_Parallel_Data;
typedef struct _Evas_Object_Animation_Data Evas_Object_Animation_Data;
typedef struct _Evas_Object_Animation_Instance_Alpha_Data Evas_Object_Animation_Instance_Alpha_Data;
typedef struct _Evas_Object_Animation_Instance_Rotate_Data Evas_Object_Animation_Instance_Rotate_Data;
@@ -121,6 +122,7 @@ typedef struct _Evas_Object_Animation_Instance_Scale_Data Evas_Objec
typedef struct _Evas_Object_Animation_Instance_Translate_Data Evas_Object_Animation_Instance_Translate_Data;
typedef struct _Evas_Object_Animation_Instance_Group_Data Evas_Object_Animation_Instance_Group_Data;
typedef struct _Evas_Object_Animation_Instance_Group_Sequential_Data Evas_Object_Animation_Instance_Group_Sequential_Data;
+typedef struct _Evas_Object_Animation_Instance_Group_Parallel_Data Evas_Object_Animation_Instance_Group_Parallel_Data;
typedef struct _Evas_Object_Animation_Instance_Data Evas_Object_Animation_Instance_Data;
//These macros are matched to Efl_Animation_Event_Type enum values.