summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Makefile_Evas.am3
-rw-r--r--src/lib/evas/Evas_Common.h9
-rw-r--r--src/lib/evas/Evas_Eo.h1
-rw-r--r--src/lib/evas/Evas_Internal.h5
-rw-r--r--src/lib/evas/canvas/efl_animation.c33
-rw-r--r--src/lib/evas/canvas/efl_animation.eo15
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c3
-rw-r--r--src/lib/evas/canvas/efl_animation_group.c136
-rw-r--r--src/lib/evas/canvas/efl_animation_group.eo32
-rw-r--r--src/lib/evas/canvas/efl_animation_group_private.h26
-rw-r--r--src/lib/evas/canvas/efl_animation_object.c59
-rw-r--r--src/lib/evas/canvas/efl_animation_object_private.h1
-rw-r--r--src/lib/evas/canvas/efl_animation_private.h1
-rw-r--r--src/lib/evas/canvas/efl_animation_rotate.c3
-rw-r--r--src/lib/evas/canvas/efl_animation_scale.c3
-rw-r--r--src/lib/evas/canvas/efl_animation_translate.c3
16 files changed, 323 insertions, 10 deletions
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index ac64a8816a..68c1b1817a 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -49,6 +49,7 @@ evas_eolian_pub_files = \
49 lib/evas/canvas/efl_animation_rotate.eo \ 49 lib/evas/canvas/efl_animation_rotate.eo \
50 lib/evas/canvas/efl_animation_scale.eo \ 50 lib/evas/canvas/efl_animation_scale.eo \
51 lib/evas/canvas/efl_animation_translate.eo \ 51 lib/evas/canvas/efl_animation_translate.eo \
52 lib/evas/canvas/efl_animation_group.eo \
52 lib/evas/canvas/efl_animation_object.eo \ 53 lib/evas/canvas/efl_animation_object.eo \
53 lib/evas/canvas/efl_animation_object_alpha.eo \ 54 lib/evas/canvas/efl_animation_object_alpha.eo \
54 lib/evas/canvas/efl_animation_object_rotate.eo \ 55 lib/evas/canvas/efl_animation_object_rotate.eo \
@@ -137,6 +138,7 @@ lib/evas/canvas/efl_animation_alpha_private.h \
137lib/evas/canvas/efl_animation_rotate_private.h \ 138lib/evas/canvas/efl_animation_rotate_private.h \
138lib/evas/canvas/efl_animation_scale_private.h \ 139lib/evas/canvas/efl_animation_scale_private.h \
139lib/evas/canvas/efl_animation_translate_private.h \ 140lib/evas/canvas/efl_animation_translate_private.h \
141lib/evas/canvas/efl_animation_group_private.h \
140lib/evas/canvas/efl_animation_object_private.h \ 142lib/evas/canvas/efl_animation_object_private.h \
141lib/evas/canvas/efl_animation_object_alpha_private.h \ 143lib/evas/canvas/efl_animation_object_alpha_private.h \
142lib/evas/canvas/efl_animation_object_rotate_private.h \ 144lib/evas/canvas/efl_animation_object_rotate_private.h \
@@ -232,6 +234,7 @@ lib/evas/canvas/efl_animation_alpha.c \
232lib/evas/canvas/efl_animation_rotate.c \ 234lib/evas/canvas/efl_animation_rotate.c \
233lib/evas/canvas/efl_animation_scale.c \ 235lib/evas/canvas/efl_animation_scale.c \
234lib/evas/canvas/efl_animation_translate.c \ 236lib/evas/canvas/efl_animation_translate.c \
237lib/evas/canvas/efl_animation_group.c \
235lib/evas/canvas/efl_animation_object.c \ 238lib/evas/canvas/efl_animation_object.c \
236lib/evas/canvas/efl_animation_object_alpha.c \ 239lib/evas/canvas/efl_animation_object_alpha.c \
237lib/evas/canvas/efl_animation_object_rotate.c \ 240lib/evas/canvas/efl_animation_object_rotate.c \
diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h
index 5407b782ed..7c39fb21df 100644
--- a/src/lib/evas/Evas_Common.h
+++ b/src/lib/evas/Evas_Common.h
@@ -3365,6 +3365,13 @@ typedef Eo Efl_Animation_Translate;
3365 3365
3366#endif 3366#endif
3367 3367
3368#ifndef _EFL_ANIMATION_GROUP_EO_CLASS_TYPE
3369#define _EFL_ANIMATION_GROUP_EO_CLASS_TYPE
3370
3371typedef Eo Efl_Animation_Group;
3372
3373#endif
3374
3368#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3375#ifndef _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
3369#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE 3376#define _EFL_ANIMATION_OBJECT_EO_CLASS_TYPE
3370 3377
@@ -3405,6 +3412,8 @@ struct _Efl_Animation_Object_Running_Event_Info
3405 double progress; 3412 double progress;
3406}; 3413};
3407 3414
3415#define EFL_ANIMATION_GROUP_DURATION_NONE -1
3416
3408/** 3417/**
3409 * @} 3418 * @}
3410 */ 3419 */
diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h
index a2efd4611d..6f52e0c809 100644
--- a/src/lib/evas/Evas_Eo.h
+++ b/src/lib/evas/Evas_Eo.h
@@ -60,6 +60,7 @@
60#include "canvas/efl_animation_rotate.eo.h" 60#include "canvas/efl_animation_rotate.eo.h"
61#include "canvas/efl_animation_scale.eo.h" 61#include "canvas/efl_animation_scale.eo.h"
62#include "canvas/efl_animation_translate.eo.h" 62#include "canvas/efl_animation_translate.eo.h"
63#include "canvas/efl_animation_group.eo.h"
63#include "canvas/efl_animation_object.eo.h" 64#include "canvas/efl_animation_object.eo.h"
64#include "canvas/efl_animation_object_alpha.eo.h" 65#include "canvas/efl_animation_object_alpha.eo.h"
65#include "canvas/efl_animation_object_rotate.eo.h" 66#include "canvas/efl_animation_object_rotate.eo.h"
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index b9b1ce7db0..a406abc5e7 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -93,6 +93,11 @@ EOAPI Eina_Bool efl_animation_object_final_state_keep_get(const Eo *obj);
93EOAPI void efl_animation_object_duration_set(Eo *obj, double duration); 93EOAPI void efl_animation_object_duration_set(Eo *obj, double duration);
94EOAPI double efl_animation_object_duration_get(const Eo *obj); 94EOAPI double efl_animation_object_duration_get(const Eo *obj);
95 95
96EOAPI void efl_animation_object_duration_only_set(Eo *obj, double duration);
97
98EOAPI void efl_animation_object_total_duration_set(Eo *obj, double total_duration);
99EOAPI double efl_animation_object_total_duration_get(const Eo *obj);
100
96EWAPI extern const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED; 101EWAPI extern const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED;
97#define EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED (&(_EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED)) 102#define EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED (&(_EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED))
98/* Efl.Animation.Object END */ 103/* Efl.Animation.Object END */
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
index df5d4e6cad..22466848e7 100644
--- a/src/lib/evas/canvas/efl_animation.c
+++ b/src/lib/evas/canvas/efl_animation.c
@@ -38,6 +38,8 @@ _efl_animation_duration_set(Eo *eo_obj,
38{ 38{
39 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj); 39 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj);
40 40
41 efl_animation_total_duration_set(eo_obj, duration);
42
41 pd->duration = duration; 43 pd->duration = duration;
42} 44}
43 45
@@ -49,6 +51,34 @@ _efl_animation_duration_get(Eo *eo_obj, Efl_Animation_Data *pd)
49 return pd->duration; 51 return pd->duration;
50} 52}
51 53
54EOLIAN static void
55_efl_animation_duration_only_set(Eo *eo_obj,
56 Efl_Animation_Data *pd,
57 double duration)
58{
59 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj);
60
61 pd->duration = duration;
62}
63
64EOLIAN static void
65_efl_animation_total_duration_set(Eo *eo_obj,
66 Efl_Animation_Data *pd,
67 double total_duration)
68{
69 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj);
70
71 pd->total_duration = total_duration;
72}
73
74EOLIAN static double
75_efl_animation_total_duration_get(Eo *eo_obj, Efl_Animation_Data *pd)
76{
77 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj, 0.0);
78
79 return pd->total_duration;
80}
81
52EOLIAN static Eina_Bool 82EOLIAN static Eina_Bool
53_efl_animation_is_deleted(Eo *eo_obj, Efl_Animation_Data *pd) 83_efl_animation_is_deleted(Eo *eo_obj, Efl_Animation_Data *pd)
54{ 84{
@@ -94,6 +124,9 @@ _efl_animation_object_create(Eo *eo_obj, Efl_Animation_Data *pd EINA_UNUSED)
94 double duration = efl_animation_duration_get(eo_obj); 124 double duration = efl_animation_duration_get(eo_obj);
95 efl_animation_object_duration_set(anim_obj, duration); 125 efl_animation_object_duration_set(anim_obj, duration);
96 126
127 double total_duration = efl_animation_total_duration_get(eo_obj);
128 efl_animation_object_total_duration_set(anim_obj, total_duration);
129
97 return anim_obj; 130 return anim_obj;
98} 131}
99 132
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo
index 09c01b6940..be899c4924 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_animation.eo
@@ -32,6 +32,21 @@ class Efl.Animation (Efl.Object)
32 duration: double; [[Duration value.]] 32 duration: double; [[Duration value.]]
33 } 33 }
34 } 34 }
35 duration_only_set @protected {
36 [[Set duration only without setting total duration.]]
37 params {
38 @in duration: double; [[Duration value.]]
39 }
40 }
41 @property total_duration {
42 set @protected {
43 }
44 get {
45 }
46 values {
47 total_duration: double; [[Total duration value.]]
48 }
49 }
35 is_deleted @protected { 50 is_deleted @protected {
36 return: bool; [[$true if animation is deleted, $false otherwise.]] 51 return: bool; [[$true if animation is deleted, $false otherwise.]]
37 } 52 }
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index c0148b6c55..deddafe194 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -44,6 +44,9 @@ _efl_animation_alpha_efl_animation_object_create(Eo *eo_obj,
44 double duration = efl_animation_duration_get(eo_obj); 44 double duration = efl_animation_duration_get(eo_obj);
45 efl_animation_object_duration_set(anim_obj, duration); 45 efl_animation_object_duration_set(anim_obj, duration);
46 46
47 double total_duration = efl_animation_total_duration_get(eo_obj);
48 efl_animation_object_total_duration_set(anim_obj, total_duration);
49
47 efl_animation_object_alpha_set(anim_obj, pd->from.alpha, pd->to.alpha); 50 efl_animation_object_alpha_set(anim_obj, pd->from.alpha, pd->to.alpha);
48 51
49 return anim_obj; 52 return anim_obj;
diff --git a/src/lib/evas/canvas/efl_animation_group.c b/src/lib/evas/canvas/efl_animation_group.c
new file mode 100644
index 0000000000..750a69de9f
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_group.c
@@ -0,0 +1,136 @@
1#include "efl_animation_group_private.h"
2
3EOLIAN static void
4_efl_animation_group_animation_add(Eo *eo_obj,
5 Efl_Animation_Group_Data *pd,
6 Efl_Animation *animation)
7{
8 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj);
9
10 if (!animation) return;
11
12 Efl_Canvas_Object *target = efl_animation_target_get(eo_obj);
13 if (target)
14 efl_animation_target_set(animation, target);
15
16 double duration = efl_animation_duration_get(eo_obj);
17 /* if group animation duration is available value, then the duration is
18 * propagated to its child. */
19 if (duration != EFL_ANIMATION_GROUP_DURATION_NONE)
20 efl_animation_duration_set(animation, duration);
21
22 Eina_Bool keep_final_state = efl_animation_final_state_keep_get(eo_obj);
23 efl_animation_final_state_keep_set(animation, keep_final_state);
24
25 pd->animations = eina_list_append(pd->animations, animation);
26}
27
28EOLIAN static void
29_efl_animation_group_animation_del(Eo *eo_obj,
30 Efl_Animation_Group_Data *pd,
31 Efl_Animation*animation)
32{
33 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj);
34
35 if (!animation) return;
36
37 pd->animations = eina_list_remove(pd->animations, animation);
38}
39
40EOLIAN static Eina_List *
41_efl_animation_group_animations_get(Eo *eo_obj,
42 Efl_Animation_Group_Data *pd)
43{
44 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj, NULL);
45
46 return pd->animations;
47}
48
49EOLIAN static void
50_efl_animation_group_efl_animation_target_set(Eo *eo_obj,
51 Efl_Animation_Group_Data *pd,
52 Efl_Canvas_Object *target)
53{
54 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj);
55
56 Eina_List *l;
57 Efl_Animation *anim;
58 EINA_LIST_FOREACH(pd->animations, l, anim)
59 {
60 efl_animation_target_set(anim, target);
61 }
62
63 efl_animation_target_set(efl_super(eo_obj, MY_CLASS), target);
64}
65
66EOLIAN static void
67_efl_animation_group_efl_animation_duration_set(Eo *eo_obj,
68 Efl_Animation_Group_Data *pd,
69 double duration)
70{
71 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj);
72
73 if (duration == EFL_ANIMATION_GROUP_DURATION_NONE) goto end;
74
75 if (duration < 0.0) return;
76
77 Eina_List *l;
78 Efl_Animation *anim;
79 EINA_LIST_FOREACH(pd->animations, l, anim)
80 {
81 efl_animation_duration_set(anim, duration);
82 }
83
84end:
85 efl_animation_duration_only_set(efl_super(eo_obj, MY_CLASS), duration);
86
87 //efl_animation_total_duration_get() should calculate the new total duration.
88 double total_duration = efl_animation_total_duration_get(eo_obj);
89 efl_animation_total_duration_set(eo_obj, total_duration);
90}
91
92EOLIAN static void
93_efl_animation_group_efl_animation_final_state_keep_set(Eo *eo_obj,
94 Efl_Animation_Group_Data *pd,
95 Eina_Bool keep_final_state)
96{
97 EFL_ANIMATION_GROUP_CHECK_OR_RETURN(eo_obj);
98
99 Eina_List *l;
100 Efl_Animation *anim;
101 EINA_LIST_FOREACH(pd->animations, l, anim)
102 {
103 efl_animation_final_state_keep_set(anim, keep_final_state);
104 }
105
106 efl_animation_final_state_keep_set(efl_super(eo_obj, MY_CLASS), keep_final_state);
107}
108
109EOLIAN static Efl_Object *
110_efl_animation_group_efl_object_constructor(Eo *eo_obj,
111 Efl_Animation_Group_Data *pd)
112{
113 eo_obj = efl_constructor(efl_super(eo_obj, MY_CLASS));
114
115 pd->animations = NULL;
116
117 //group animation does not affect its child duration by default.
118 efl_animation_duration_only_set(efl_super(eo_obj, MY_CLASS),
119 EFL_ANIMATION_GROUP_DURATION_NONE);
120
121 return eo_obj;
122}
123
124EOLIAN static void
125_efl_animation_group_efl_object_destructor(Eo *eo_obj,
126 Efl_Animation_Group_Data *pd)
127{
128 Efl_Animation *anim;
129
130 EINA_LIST_FREE(pd->animations, anim)
131 efl_del(anim);
132
133 efl_destructor(efl_super(eo_obj, MY_CLASS));
134}
135
136#include "efl_animation_group.eo.c"
diff --git a/src/lib/evas/canvas/efl_animation_group.eo b/src/lib/evas/canvas/efl_animation_group.eo
new file mode 100644
index 0000000000..c287490907
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_group.eo
@@ -0,0 +1,32 @@
1import efl_animation_types;
2
3abstract Efl.Animation.Group (Efl.Animation)
4{
5 [[Efl group animation abstract class]]
6 data: Efl_Animation_Group_Data;
7 methods {
8 animation_add {
9 [[Add the given animation to the animation group.]]
10 params {
11 @in animation: Efl.Animation; [[The animation which needs to be added to the animation group]]
12 }
13 }
14 animation_del {
15 [[Delete the given animation from the animation group.]]
16 params {
17 @in animation: Efl.Animation; [[The animation which needs to be deleted from the animation group]]
18 }
19 }
20 animations_get {
21 [[Get the animations of the animation group.]]
22 return: list<Efl.Animation>; [[The animations of the animation group]]
23 }
24 }
25 implements {
26 Efl.Object.constructor;
27 Efl.Object.destructor;
28 Efl.Animation.target { set; }
29 Efl.Animation.duration { set; }
30 Efl.Animation.final_state_keep { set; }
31 }
32}
diff --git a/src/lib/evas/canvas/efl_animation_group_private.h b/src/lib/evas/canvas/efl_animation_group_private.h
new file mode 100644
index 0000000000..0ce4728bf2
--- /dev/null
+++ b/src/lib/evas/canvas/efl_animation_group_private.h
@@ -0,0 +1,26 @@
1#define EFL_ANIMATION_PROTECTED
2
3#include "evas_common_private.h"
4
5#define MY_CLASS EFL_ANIMATION_GROUP_CLASS
6#define MY_CLASS_NAME efl_class_name_get(MY_CLASS)
7
8#define EFL_ANIMATION_GROUP_CHECK_OR_RETURN(anim, ...) \
9 do { \
10 if (!anim) { \
11 CRI("Efl_Animation " # anim " is NULL!"); \
12 return __VA_ARGS__; \
13 } \
14 if (efl_animation_is_deleted(anim)) { \
15 ERR("Efl_Animation " # anim " has already been deleted!"); \
16 return __VA_ARGS__; \
17 } \
18 } while (0)
19
20#define EFL_ANIMATION_GROUP_DATA_GET(o, pd) \
21 Efl_Animation_Group_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_GROUP_CLASS)
22
23typedef struct _Efl_Animation_Group_Data
24{
25 Eina_List *animations;
26} Efl_Animation_Group_Data;
diff --git a/src/lib/evas/canvas/efl_animation_object.c b/src/lib/evas/canvas/efl_animation_object.c
index 6f134d881a..3fe829b0f6 100644
--- a/src/lib/evas/canvas/efl_animation_object.c
+++ b/src/lib/evas/canvas/efl_animation_object.c
@@ -63,6 +63,8 @@ _efl_animation_object_duration_set(Eo *eo_obj,
63{ 63{
64 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj); 64 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
65 65
66 efl_animation_object_total_duration_set(eo_obj, duration);
67
66 pd->duration = duration; 68 pd->duration = duration;
67} 69}
68 70
@@ -75,6 +77,34 @@ _efl_animation_object_duration_get(Eo *eo_obj,
75 return pd->duration; 77 return pd->duration;
76} 78}
77 79
80EOLIAN static void
81_efl_animation_object_duration_only_set(Eo *eo_obj,
82 Efl_Animation_Object_Data *pd,
83 double duration)
84{
85 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
86
87 pd->duration = duration;
88}
89
90EOLIAN static void
91_efl_animation_object_total_duration_set(Eo *eo_obj,
92 Efl_Animation_Object_Data *pd,
93 double total_duration)
94{
95 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
96
97 pd->total_duration = total_duration;
98}
99
100EOLIAN static double
101_efl_animation_object_total_duration_get(Eo *eo_obj, Efl_Animation_Object_Data *pd)
102{
103 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj, 0.0);
104
105 return pd->total_duration;
106}
107
78EOLIAN static Eina_Bool 108EOLIAN static Eina_Bool
79_efl_animation_object_is_deleted(Eo *eo_obj, 109_efl_animation_object_is_deleted(Eo *eo_obj,
80 Efl_Animation_Object_Data *pd) 110 Efl_Animation_Object_Data *pd)
@@ -181,17 +211,17 @@ _animator_cb(void *data)
181 211
182 if (pd->is_cancelled) goto end; 212 if (pd->is_cancelled) goto end;
183 213
184 double elapsed_time, duration; 214 double elapsed_time, total_duration;
185 215
186 pd->time.current = ecore_loop_time_get(); 216 pd->time.current = ecore_loop_time_get();
187 elapsed_time = pd->time.current - pd->time.begin; 217 elapsed_time = pd->time.current - pd->time.begin;
188 duration = pd->duration; 218 total_duration = pd->total_duration;
189 if (elapsed_time > duration) 219 if (elapsed_time > total_duration)
190 elapsed_time = duration; 220 elapsed_time = total_duration;
191 221
192 if (duration < 0.0) goto end; 222 if (total_duration < 0.0) goto end;
193 223
194 if (duration == 0.0) 224 if (total_duration == 0.0)
195 { 225 {
196 ecore_animator_del(pd->animator); 226 ecore_animator_del(pd->animator);
197 pd->animator = NULL; 227 pd->animator = NULL;
@@ -199,7 +229,7 @@ _animator_cb(void *data)
199 pd->progress = 1.0; 229 pd->progress = 1.0;
200 } 230 }
201 else 231 else
202 pd->progress = elapsed_time / duration; 232 pd->progress = elapsed_time / total_duration;
203 233
204 //Reset previous animation effect before applying animation effect 234 //Reset previous animation effect before applying animation effect
205 efl_animation_object_target_state_reset(eo_obj); 235 efl_animation_object_target_state_reset(eo_obj);
@@ -207,7 +237,7 @@ _animator_cb(void *data)
207 efl_animation_object_progress_set(eo_obj, pd->progress); 237 efl_animation_object_progress_set(eo_obj, pd->progress);
208 238
209 //Not end. Keep going. 239 //Not end. Keep going.
210 if (elapsed_time < duration) return ECORE_CALLBACK_RENEW; 240 if (elapsed_time < total_duration) return ECORE_CALLBACK_RENEW;
211 241
212end: 242end:
213 pd->animator = NULL; 243 pd->animator = NULL;
@@ -226,7 +256,7 @@ end:
226static void 256static void
227_start(Eo *eo_obj, Efl_Animation_Object_Data *pd) 257_start(Eo *eo_obj, Efl_Animation_Object_Data *pd)
228{ 258{
229 if (pd->duration < 0.0) return; 259 if (pd->total_duration < 0.0) return;
230 260
231 //Save the current state of the target 261 //Save the current state of the target
232 efl_animation_object_target_state_save(eo_obj); 262 efl_animation_object_target_state_save(eo_obj);
@@ -311,6 +341,7 @@ _efl_animation_object_efl_object_constructor(Eo *eo_obj,
311 pd->progress = 0.0; 341 pd->progress = 0.0;
312 342
313 pd->duration = 0.0; 343 pd->duration = 0.0;
344 pd->total_duration = 0.0;
314 345
315 pd->auto_del = EINA_TRUE; 346 pd->auto_del = EINA_TRUE;
316 pd->is_deleted = EINA_FALSE; 347 pd->is_deleted = EINA_FALSE;
@@ -358,13 +389,21 @@ EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_final_state_keep_get, Eina_Bool,
358EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_duration_set, EFL_FUNC_CALL(duration), double duration); 389EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_duration_set, EFL_FUNC_CALL(duration), double duration);
359EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_duration_get, double, 0); 390EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_duration_get, double, 0);
360 391
392EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_duration_only_set, EFL_FUNC_CALL(duration), double duration);
393
394EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_total_duration_set, EFL_FUNC_CALL(total_duration), double total_duration);
395EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_total_duration_get, double, 0);
396
361#define EFL_ANIMATION_OBJECT_EXTRA_OPS \ 397#define EFL_ANIMATION_OBJECT_EXTRA_OPS \
362 EFL_OBJECT_OP_FUNC(efl_animation_object_target_set, _efl_animation_object_target_set), \ 398 EFL_OBJECT_OP_FUNC(efl_animation_object_target_set, _efl_animation_object_target_set), \
363 EFL_OBJECT_OP_FUNC(efl_animation_object_target_get, _efl_animation_object_target_get), \ 399 EFL_OBJECT_OP_FUNC(efl_animation_object_target_get, _efl_animation_object_target_get), \
364 EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_set, _efl_animation_object_final_state_keep_set), \ 400 EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_set, _efl_animation_object_final_state_keep_set), \
365 EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_get, _efl_animation_object_final_state_keep_get), \ 401 EFL_OBJECT_OP_FUNC(efl_animation_object_final_state_keep_get, _efl_animation_object_final_state_keep_get), \
366 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_set, _efl_animation_object_duration_set), \ 402 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_set, _efl_animation_object_duration_set), \
367 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_get, _efl_animation_object_duration_get) 403 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_get, _efl_animation_object_duration_get), \
404 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_only_set, _efl_animation_object_duration_only_set), \
405 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_set, _efl_animation_object_total_duration_set), \
406 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_total_duration_get)
368 407
369EWAPI const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED = 408EWAPI const Efl_Event_Description _EFL_ANIMATION_OBJECT_EVENT_PRE_STARTED =
370 EFL_EVENT_DESCRIPTION("pre_started"); 409 EFL_EVENT_DESCRIPTION("pre_started");
diff --git a/src/lib/evas/canvas/efl_animation_object_private.h b/src/lib/evas/canvas/efl_animation_object_private.h
index 616d8c6407..3309e31efb 100644
--- a/src/lib/evas/canvas/efl_animation_object_private.h
+++ b/src/lib/evas/canvas/efl_animation_object_private.h
@@ -30,6 +30,7 @@ typedef struct _Efl_Animation_Object_Data
30 double progress; 30 double progress;
31 31
32 double duration; 32 double duration;
33 double total_duration;
33 34
34 Eina_Bool auto_del : 1; 35 Eina_Bool auto_del : 1;
35 Eina_Bool is_deleted : 1; 36 Eina_Bool is_deleted : 1;
diff --git a/src/lib/evas/canvas/efl_animation_private.h b/src/lib/evas/canvas/efl_animation_private.h
index 44c48a0b88..0c3cea17c1 100644
--- a/src/lib/evas/canvas/efl_animation_private.h
+++ b/src/lib/evas/canvas/efl_animation_private.h
@@ -10,6 +10,7 @@ typedef struct _Efl_Animation_Data
10 Efl_Canvas_Object *target; 10 Efl_Canvas_Object *target;
11 11
12 double duration; 12 double duration;
13 double total_duration;
13 14
14 Eina_Bool is_deleted : 1; 15 Eina_Bool is_deleted : 1;
15 Eina_Bool keep_final_state : 1; 16 Eina_Bool keep_final_state : 1;
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
index d92cf2f96a..2d6399f482 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_rotate.c
@@ -192,6 +192,9 @@ _efl_animation_rotate_efl_animation_object_create(Eo *eo_obj,
192 double duration = efl_animation_duration_get(eo_obj); 192 double duration = efl_animation_duration_get(eo_obj);
193 efl_animation_object_duration_set(anim_obj, duration); 193 efl_animation_object_duration_set(anim_obj, duration);
194 194
195 double total_duration = efl_animation_total_duration_get(eo_obj);
196 efl_animation_object_total_duration_set(anim_obj, total_duration);
197
195 if (pd->use_rel_pivot) 198 if (pd->use_rel_pivot)
196 { 199 {
197 efl_animation_object_rotate_set(anim_obj, 200 efl_animation_object_rotate_set(anim_obj,
diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c
index 7dfed311c9..ec04c45d3b 100644
--- a/src/lib/evas/canvas/efl_animation_scale.c
+++ b/src/lib/evas/canvas/efl_animation_scale.c
@@ -218,6 +218,9 @@ _efl_animation_scale_efl_animation_object_create(Eo *eo_obj,
218 double duration = efl_animation_duration_get(eo_obj); 218 double duration = efl_animation_duration_get(eo_obj);
219 efl_animation_object_duration_set(anim_obj, duration); 219 efl_animation_object_duration_set(anim_obj, duration);
220 220
221 double total_duration = efl_animation_total_duration_get(eo_obj);
222 efl_animation_object_total_duration_set(anim_obj, total_duration);
223
221 if (pd->use_rel_pivot) 224 if (pd->use_rel_pivot)
222 { 225 {
223 efl_animation_object_scale_set(anim_obj, 226 efl_animation_object_scale_set(anim_obj,
diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c
index a952a04f67..1b0f0e340e 100644
--- a/src/lib/evas/canvas/efl_animation_translate.c
+++ b/src/lib/evas/canvas/efl_animation_translate.c
@@ -160,6 +160,9 @@ _efl_animation_translate_efl_animation_object_create(Eo *eo_obj,
160 double duration = efl_animation_duration_get(eo_obj); 160 double duration = efl_animation_duration_get(eo_obj);
161 efl_animation_object_duration_set(anim_obj, duration); 161 efl_animation_object_duration_set(anim_obj, duration);
162 162
163 double total_duration = efl_animation_total_duration_get(eo_obj);
164 efl_animation_object_total_duration_set(anim_obj, total_duration);
165
163 if (pd->use_rel_move) 166 if (pd->use_rel_move)
164 { 167 {
165 efl_animation_object_translate_set(anim_obj, 168 efl_animation_object_translate_set(anim_obj,