summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Makefile_Elementary.am1
-rw-r--r--src/bin/elementary/Makefile.am1
-rw-r--r--src/bin/elementary/test.c2
-rw-r--r--src/bin/elementary/test_efl_anim_start_delay.c160
-rw-r--r--src/lib/evas/Evas_Internal.h3
-rw-r--r--src/lib/evas/canvas/efl_animation.c23
-rw-r--r--src/lib/evas/canvas/efl_animation.eo9
-rw-r--r--src/lib/evas/canvas/efl_animation_alpha.c3
-rw-r--r--src/lib/evas/canvas/efl_animation_group_parallel.c7
-rw-r--r--src/lib/evas/canvas/efl_animation_group_sequential.c7
-rw-r--r--src/lib/evas/canvas/efl_animation_object.c57
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_parallel.c17
-rw-r--r--src/lib/evas/canvas/efl_animation_object_group_sequential.c23
-rw-r--r--src/lib/evas/canvas/efl_animation_object_private.h3
-rw-r--r--src/lib/evas/canvas/efl_animation_private.h2
-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
18 files changed, 319 insertions, 8 deletions
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 8d45eb3312..bcf39cce8e 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -806,6 +806,7 @@ bin/elementary/test_efl_anim_group_sequential.c \
806bin/elementary/test_efl_anim_event_anim.c \ 806bin/elementary/test_efl_anim_event_anim.c \
807bin/elementary/test_efl_anim_pause.c \ 807bin/elementary/test_efl_anim_pause.c \
808bin/elementary/test_efl_anim_repeat.c \ 808bin/elementary/test_efl_anim_repeat.c \
809bin/elementary/test_efl_anim_start_delay.c \
809bin/elementary/test_eio.c \ 810bin/elementary/test_eio.c \
810bin/elementary/test_entry.c \ 811bin/elementary/test_entry.c \
811bin/elementary/test_entry_anchor.c \ 812bin/elementary/test_entry_anchor.c \
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
index a9fb32668f..ce87962c3c 100644
--- a/src/bin/elementary/Makefile.am
+++ b/src/bin/elementary/Makefile.am
@@ -41,6 +41,7 @@ test_efl_anim_group_sequential.c \
41test_efl_anim_event_anim.c \ 41test_efl_anim_event_anim.c \
42test_efl_anim_pause.c \ 42test_efl_anim_pause.c \
43test_efl_anim_repeat.c \ 43test_efl_anim_repeat.c \
44test_efl_anim_start_delay.c \
44test_application_server.c \ 45test_application_server.c \
45test_bg.c \ 46test_bg.c \
46test_box.c \ 47test_box.c \
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index e86b78df8b..095eee5186 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -336,6 +336,7 @@ void test_efl_anim_group_sequential(void *data, Evas_Object *obj, void *event_in
336void test_efl_anim_event_anim(void *data, Evas_Object *obj, void *event_info); 336void test_efl_anim_event_anim(void *data, Evas_Object *obj, void *event_info);
337void test_efl_anim_pause(void *data, Evas_Object *obj, void *event_info); 337void test_efl_anim_pause(void *data, Evas_Object *obj, void *event_info);
338void test_efl_anim_repeat(void *data, Evas_Object *obj, void *event_info); 338void test_efl_anim_repeat(void *data, Evas_Object *obj, void *event_info);
339void test_efl_anim_start_delay(void *data, Evas_Object *obj, void *event_info);
339 340
340Evas_Object *win, *tbx; // TODO: refactoring 341Evas_Object *win, *tbx; // TODO: refactoring
341void *tt; 342void *tt;
@@ -819,6 +820,7 @@ add_tests:
819 ADD_TEST(NULL, "Effects", "Efl Animation Event Animation", test_efl_anim_event_anim); 820 ADD_TEST(NULL, "Effects", "Efl Animation Event Animation", test_efl_anim_event_anim);
820 ADD_TEST(NULL, "Effects", "Efl Animation Pause", test_efl_anim_pause); 821 ADD_TEST(NULL, "Effects", "Efl Animation Pause", test_efl_anim_pause);
821 ADD_TEST(NULL, "Effects", "Efl Animation Repeat", test_efl_anim_repeat); 822 ADD_TEST(NULL, "Effects", "Efl Animation Repeat", test_efl_anim_repeat);
823 ADD_TEST(NULL, "Effects", "Efl Animation Start Delay", test_efl_anim_start_delay);
822 824
823 //------------------------------// 825 //------------------------------//
824 ADD_TEST(NULL, "Edje External", "ExtButton", test_external_button); 826 ADD_TEST(NULL, "Edje External", "ExtButton", test_external_button);
diff --git a/src/bin/elementary/test_efl_anim_start_delay.c b/src/bin/elementary/test_efl_anim_start_delay.c
new file mode 100644
index 0000000000..63cab0f18e
--- /dev/null
+++ b/src/bin/elementary/test_efl_anim_start_delay.c
@@ -0,0 +1,160 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6typedef struct _App_Data
7{
8 Efl_Animation *show_anim;
9 Efl_Animation *hide_anim;
10 Efl_Animation_Object *anim_obj;
11
12 Evas_Object *start_delay_spin;
13
14 Eina_Bool is_btn_visible;
15} App_Data;
16
17static void
18_anim_started_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
19{
20 printf("Animation has been started!\n");
21}
22
23static void
24_anim_ended_cb(void *data, const Efl_Event *event EINA_UNUSED)
25{
26 App_Data *ad = data;
27
28 printf("Animation has been ended!\n");
29
30 elm_object_disabled_set(ad->start_delay_spin, EINA_FALSE);
31
32 ad->anim_obj = NULL;
33}
34
35static void
36_anim_running_cb(void *data EINA_UNUSED, const Efl_Event *event)
37{
38 Efl_Animation_Object_Running_Event_Info *event_info = event->info;
39 double progress = event_info->progress;
40 printf("Animation is running! Current progress(%lf)\n", progress);
41}
42
43static void
44_start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
45{
46 App_Data *ad = data;
47
48 if (ad->anim_obj)
49 efl_animation_object_cancel(ad->anim_obj);
50
51 ad->is_btn_visible = !(ad->is_btn_visible);
52
53 double start_delay = elm_spinner_value_get(ad->start_delay_spin);
54 elm_object_disabled_set(ad->start_delay_spin, EINA_TRUE);
55
56 if (ad->is_btn_visible)
57 {
58 //Set animation start delay
59 efl_animation_start_delay_set(ad->show_anim, start_delay);
60
61 //Create Animation Object from Animation
62 ad->anim_obj = efl_animation_object_create(ad->show_anim);
63 elm_object_text_set(obj, "Start Alpha Animation from 1.0 to 0.0");
64 }
65 else
66 {
67 //Set animation start delay
68 efl_animation_start_delay_set(ad->hide_anim, start_delay);
69
70 //Create Animation Object from Animation
71 ad->anim_obj = efl_animation_object_create(ad->hide_anim);
72 elm_object_text_set(obj, "Start Alpha Animation from 0.0 to 1.0");
73 }
74
75 //Register callback called when animation starts
76 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_STARTED, _anim_started_cb, NULL);
77
78 //Register callback called when animation ends
79 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_ENDED, _anim_ended_cb, ad);
80
81 //Register callback called while animation is executed
82 efl_event_callback_add(ad->anim_obj, EFL_ANIMATION_OBJECT_EVENT_RUNNING, _anim_running_cb, NULL);
83
84 //Let Animation Object start animation
85 efl_animation_object_start(ad->anim_obj);
86}
87
88static void
89_win_del_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
90{
91 App_Data *ad = data;
92 free(ad);
93}
94
95void
96test_efl_anim_start_delay(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
97{
98 App_Data *ad = calloc(1, sizeof(App_Data));
99 if (!ad) return;
100
101 Evas_Object *win = elm_win_add(NULL, "Efl Animation Start Delay", ELM_WIN_BASIC);
102 elm_win_title_set(win, "Efl Animation Start Delay");
103 elm_win_autodel_set(win, EINA_TRUE);
104 evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ad);
105
106 //Button to be animated
107 Evas_Object *btn = elm_button_add(win);
108 elm_object_text_set(btn, "Button");
109 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
110 evas_object_resize(btn, 200, 200);
111 evas_object_move(btn, 100, 50);
112 evas_object_show(btn);
113
114 //Show Animation
115 Efl_Animation *show_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
116 efl_animation_alpha_set(show_anim, 0.0, 1.0);
117 efl_animation_duration_set(show_anim, 1.0);
118 efl_animation_target_set(show_anim, btn);
119 efl_animation_final_state_keep_set(show_anim, EINA_TRUE);
120
121 //Hide Animation
122 Efl_Animation *hide_anim = efl_add(EFL_ANIMATION_ALPHA_CLASS, NULL);
123 efl_animation_alpha_set(hide_anim, 1.0, 0.0);
124 efl_animation_duration_set(hide_anim, 1.0);
125 efl_animation_target_set(hide_anim, btn);
126 efl_animation_final_state_keep_set(hide_anim, EINA_TRUE);
127
128
129 //Button to start animation
130 Evas_Object *start_btn = elm_button_add(win);
131 elm_object_text_set(start_btn, "Start Alpha Animation from 1.0 to 0.0");
132 evas_object_smart_callback_add(start_btn, "clicked", _start_btn_clicked_cb, ad);
133 evas_object_size_hint_weight_set(start_btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
134 evas_object_resize(start_btn, 200, 50);
135 evas_object_move(start_btn, 100, 300);
136 evas_object_show(start_btn);
137
138 //Spinner to set animation start delay
139 Evas_Object *start_delay_spin = elm_spinner_add(win);
140 elm_spinner_label_format_set(start_delay_spin, "Start Delay: %.1f second");
141 elm_spinner_editable_set(start_delay_spin, EINA_FALSE);
142 elm_spinner_min_max_set(start_delay_spin, 0.0, 10.0);
143 elm_spinner_step_set(start_delay_spin, 0.5);
144 elm_spinner_value_set(start_delay_spin, 0.0);
145 evas_object_resize(start_delay_spin, 200, 50);
146 evas_object_move(start_delay_spin, 100, 350);
147 evas_object_show(start_delay_spin);
148
149
150 //Initialize App Data
151 ad->show_anim = show_anim;
152 ad->hide_anim = hide_anim;
153 ad->anim_obj = NULL;
154 ad->start_delay_spin = start_delay_spin;
155 ad->is_btn_visible = EINA_TRUE;
156
157
158 evas_object_resize(win, 400, 450);
159 evas_object_show(win);
160}
diff --git a/src/lib/evas/Evas_Internal.h b/src/lib/evas/Evas_Internal.h
index 45057bd1a3..e57b60163c 100644
--- a/src/lib/evas/Evas_Internal.h
+++ b/src/lib/evas/Evas_Internal.h
@@ -98,6 +98,9 @@ EOAPI void efl_animation_object_duration_only_set(Eo *obj, double duration);
98EOAPI void efl_animation_object_total_duration_set(Eo *obj, double total_duration); 98EOAPI void efl_animation_object_total_duration_set(Eo *obj, double total_duration);
99EOAPI double efl_animation_object_total_duration_get(const Eo *obj); 99EOAPI double efl_animation_object_total_duration_get(const Eo *obj);
100 100
101EOAPI void efl_animation_object_start_delay_set(Eo *obj, double delay_time);
102EOAPI double efl_animation_object_start_delay_get(const Eo *obj);
103
101EOAPI void efl_animation_object_repeat_count_set(Eo *obj, int count); 104EOAPI void efl_animation_object_repeat_count_set(Eo *obj, int count);
102EOAPI int efl_animation_object_repeat_count_get(const Eo *obj); 105EOAPI int efl_animation_object_repeat_count_get(const Eo *obj);
103 106
diff --git a/src/lib/evas/canvas/efl_animation.c b/src/lib/evas/canvas/efl_animation.c
index 3ab7434195..583cbf86a3 100644
--- a/src/lib/evas/canvas/efl_animation.c
+++ b/src/lib/evas/canvas/efl_animation.c
@@ -154,6 +154,27 @@ _efl_animation_repeat_count_get(Eo *eo_obj, Efl_Animation_Data *pd)
154 return pd->repeat_count; 154 return pd->repeat_count;
155} 155}
156 156
157EOLIAN static void
158_efl_animation_start_delay_set(Eo *eo_obj,
159 Efl_Animation_Data *pd,
160 double delay_time)
161{
162 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj);
163
164 if (delay_time < 0.0) return;
165
166 pd->start_delay_time = delay_time;
167}
168
169EOLIAN static double
170_efl_animation_start_delay_get(Eo *eo_obj,
171 Efl_Animation_Data *pd)
172{
173 EFL_ANIMATION_CHECK_OR_RETURN(eo_obj, 0.0);
174
175 return pd->start_delay_time;
176}
177
157EOLIAN static Efl_Object * 178EOLIAN static Efl_Object *
158_efl_animation_efl_object_constructor(Eo *eo_obj, 179_efl_animation_efl_object_constructor(Eo *eo_obj,
159 Efl_Animation_Data *pd) 180 Efl_Animation_Data *pd)
@@ -164,6 +185,8 @@ _efl_animation_efl_object_constructor(Eo *eo_obj,
164 185
165 pd->duration = 0.0; 186 pd->duration = 0.0;
166 187
188 pd->start_delay_time = 0.0;
189
167 pd->repeat_count = 0; 190 pd->repeat_count = 0;
168 191
169 pd->is_deleted = EINA_FALSE; 192 pd->is_deleted = EINA_FALSE;
diff --git a/src/lib/evas/canvas/efl_animation.eo b/src/lib/evas/canvas/efl_animation.eo
index d071100dee..7178cb6373 100644
--- a/src/lib/evas/canvas/efl_animation.eo
+++ b/src/lib/evas/canvas/efl_animation.eo
@@ -56,6 +56,15 @@ class Efl.Animation (Efl.Object)
56 count: int; [[Repeat count. EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely.]] 56 count: int; [[Repeat count. EFL_ANIMATION_REPEAT_INFINITE repeats animation infinitely.]]
57 } 57 }
58 } 58 }
59 @property start_delay {
60 set {
61 }
62 get {
63 }
64 values {
65 delay_time: double; [[Delay time, in seconds, from when the animation starts until the animation is animated]]
66 }
67 }
59 is_deleted @protected { 68 is_deleted @protected {
60 return: bool; [[$true if animation is deleted, $false otherwise.]] 69 return: bool; [[$true if animation is deleted, $false otherwise.]]
61 } 70 }
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c
index 763788d4bc..f04c410334 100644
--- a/src/lib/evas/canvas/efl_animation_alpha.c
+++ b/src/lib/evas/canvas/efl_animation_alpha.c
@@ -47,6 +47,9 @@ _efl_animation_alpha_efl_animation_object_create(Eo *eo_obj,
47 double total_duration = efl_animation_total_duration_get(eo_obj); 47 double total_duration = efl_animation_total_duration_get(eo_obj);
48 efl_animation_object_total_duration_set(anim_obj, total_duration); 48 efl_animation_object_total_duration_set(anim_obj, total_duration);
49 49
50 double start_delay_time = efl_animation_start_delay_get(eo_obj);
51 efl_animation_object_start_delay_set(anim_obj, start_delay_time);
52
50 int repeat_count = efl_animation_repeat_count_get(eo_obj); 53 int repeat_count = efl_animation_repeat_count_get(eo_obj);
51 efl_animation_object_repeat_count_set(anim_obj, repeat_count); 54 efl_animation_object_repeat_count_set(anim_obj, repeat_count);
52 55
diff --git a/src/lib/evas/canvas/efl_animation_group_parallel.c b/src/lib/evas/canvas/efl_animation_group_parallel.c
index 9c02c8c907..869d4ccbbe 100644
--- a/src/lib/evas/canvas/efl_animation_group_parallel.c
+++ b/src/lib/evas/canvas/efl_animation_group_parallel.c
@@ -59,6 +59,10 @@ _efl_animation_group_parallel_efl_animation_total_duration_get(Eo *eo_obj,
59 { 59 {
60 double child_total_duration = efl_animation_total_duration_get(anim); 60 double child_total_duration = efl_animation_total_duration_get(anim);
61 61
62 double start_delay = efl_animation_start_delay_get(anim);
63 if (start_delay > 0.0)
64 child_total_duration += start_delay;
65
62 int child_repeat_count = efl_animation_repeat_count_get(anim); 66 int child_repeat_count = efl_animation_repeat_count_get(anim);
63 if (child_repeat_count > 0) 67 if (child_repeat_count > 0)
64 child_total_duration *= (child_repeat_count + 1); 68 child_total_duration *= (child_repeat_count + 1);
@@ -102,6 +106,9 @@ _efl_animation_group_parallel_efl_animation_object_create(Eo *eo_obj,
102 double total_duration = efl_animation_total_duration_get(eo_obj); 106 double total_duration = efl_animation_total_duration_get(eo_obj);
103 efl_animation_object_total_duration_set(group_anim_obj, total_duration); 107 efl_animation_object_total_duration_set(group_anim_obj, total_duration);
104 108
109 double start_delay_time = efl_animation_start_delay_get(eo_obj);
110 efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
111
105 int repeat_count = efl_animation_repeat_count_get(eo_obj); 112 int repeat_count = efl_animation_repeat_count_get(eo_obj);
106 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count); 113 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
107 114
diff --git a/src/lib/evas/canvas/efl_animation_group_sequential.c b/src/lib/evas/canvas/efl_animation_group_sequential.c
index b29599bd25..e5a6c53e26 100644
--- a/src/lib/evas/canvas/efl_animation_group_sequential.c
+++ b/src/lib/evas/canvas/efl_animation_group_sequential.c
@@ -54,6 +54,10 @@ _efl_animation_group_sequential_efl_animation_total_duration_get(Eo *eo_obj,
54 { 54 {
55 double child_total_duration = efl_animation_total_duration_get(anim); 55 double child_total_duration = efl_animation_total_duration_get(anim);
56 56
57 double start_delay = efl_animation_start_delay_get(anim);
58 if (start_delay > 0.0)
59 child_total_duration += start_delay;
60
57 int child_repeat_count = efl_animation_repeat_count_get(anim); 61 int child_repeat_count = efl_animation_repeat_count_get(anim);
58 if (child_repeat_count > 0) 62 if (child_repeat_count > 0)
59 child_total_duration *= (child_repeat_count + 1); 63 child_total_duration *= (child_repeat_count + 1);
@@ -96,6 +100,9 @@ _efl_animation_group_sequential_efl_animation_object_create(Eo *eo_obj,
96 double total_duration = efl_animation_total_duration_get(eo_obj); 100 double total_duration = efl_animation_total_duration_get(eo_obj);
97 efl_animation_object_total_duration_set(group_anim_obj, total_duration); 101 efl_animation_object_total_duration_set(group_anim_obj, total_duration);
98 102
103 double start_delay_time = efl_animation_start_delay_get(eo_obj);
104 efl_animation_object_start_delay_set(group_anim_obj, start_delay_time);
105
99 int repeat_count = efl_animation_repeat_count_get(eo_obj); 106 int repeat_count = efl_animation_repeat_count_get(eo_obj);
100 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count); 107 efl_animation_object_repeat_count_set(group_anim_obj, repeat_count);
101 108
diff --git a/src/lib/evas/canvas/efl_animation_object.c b/src/lib/evas/canvas/efl_animation_object.c
index 619af19895..17a1508135 100644
--- a/src/lib/evas/canvas/efl_animation_object.c
+++ b/src/lib/evas/canvas/efl_animation_object.c
@@ -127,6 +127,28 @@ _efl_animation_object_repeat_count_get(const Eo *eo_obj,
127 return pd->repeat_count; 127 return pd->repeat_count;
128} 128}
129 129
130EOLIAN static void
131_efl_animation_object_start_delay_set(Eo *eo_obj,
132 Efl_Animation_Object_Data *pd,
133 double delay_time)
134{
135 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
136
137 if (delay_time < 0.0) return;
138
139 pd->start_delay_time = delay_time;
140}
141
142EOLIAN static double
143_efl_animation_object_start_delay_get(Eo *eo_obj,
144 Efl_Animation_Object_Data *pd)
145{
146 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj, 0.0);
147
148 return pd->start_delay_time;
149}
150
151
130EOLIAN static Eina_Bool 152EOLIAN static Eina_Bool
131_efl_animation_object_is_deleted(Eo *eo_obj, 153_efl_animation_object_is_deleted(Eo *eo_obj,
132 Efl_Animation_Object_Data *pd) 154 Efl_Animation_Object_Data *pd)
@@ -329,7 +351,6 @@ _start(Eo *eo_obj, Efl_Animation_Object_Data *pd)
329 pd->is_started = EINA_TRUE; 351 pd->is_started = EINA_TRUE;
330 pd->is_cancelled = EINA_FALSE; 352 pd->is_cancelled = EINA_FALSE;
331 pd->is_ended = EINA_FALSE; 353 pd->is_ended = EINA_FALSE;
332 pd->is_paused = EINA_FALSE;
333 354
334 pd->paused_time = 0.0; 355 pd->paused_time = 0.0;
335 356
@@ -350,12 +371,34 @@ _start(Eo *eo_obj, Efl_Animation_Object_Data *pd)
350 _animator_cb(eo_obj); 371 _animator_cb(eo_obj);
351} 372}
352 373
374static Eina_Bool
375_start_delay_timer_cb(void *data)
376{
377 Eo *eo_obj = data;
378 EFL_ANIMATION_OBJECT_DATA_GET(eo_obj, pd);
379
380 pd->start_delay_timer = NULL;
381
382 _start(eo_obj, pd);
383
384 return ECORE_CALLBACK_CANCEL;
385}
386
353EOLIAN static void 387EOLIAN static void
354_efl_animation_object_start(Eo *eo_obj, 388_efl_animation_object_start(Eo *eo_obj,
355 Efl_Animation_Object_Data *pd) 389 Efl_Animation_Object_Data *pd)
356{ 390{
357 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj); 391 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
358 392
393 if (pd->start_delay_timer) return;
394
395 if (pd->start_delay_time > 0.0)
396 {
397 pd->start_delay_timer = ecore_timer_add(pd->start_delay_time,
398 _start_delay_timer_cb, eo_obj);
399 return;
400 }
401
359 _start(eo_obj, pd); 402 _start(eo_obj, pd);
360} 403}
361 404
@@ -365,6 +408,9 @@ _efl_animation_object_cancel(Eo *eo_obj,
365{ 408{
366 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj); 409 EFL_ANIMATION_OBJECT_CHECK_OR_RETURN(eo_obj);
367 410
411 ecore_timer_del(pd->start_delay_timer);
412 pd->start_delay_timer = NULL;
413
368 pd->is_cancelled = EINA_TRUE; 414 pd->is_cancelled = EINA_TRUE;
369 pd->is_ended = EINA_TRUE; 415 pd->is_ended = EINA_TRUE;
370 416
@@ -411,6 +457,8 @@ _efl_animation_object_pause(Eo *eo_obj,
411 457
412 pd->is_paused = EINA_TRUE; 458 pd->is_paused = EINA_TRUE;
413 459
460 if (pd->start_delay_timer) return;
461
414 ecore_animator_del(pd->animator); 462 ecore_animator_del(pd->animator);
415 pd->animator = NULL; 463 pd->animator = NULL;
416 464
@@ -429,6 +477,8 @@ _efl_animation_object_resume(Eo *eo_obj,
429 477
430 pd->is_paused = EINA_FALSE; 478 pd->is_paused = EINA_FALSE;
431 479
480 if (pd->start_delay_timer) return;
481
432 pd->paused_time += (ecore_loop_time_get() - pd->time.pause_begin); 482 pd->paused_time += (ecore_loop_time_get() - pd->time.pause_begin);
433 483
434 pd->animator = ecore_animator_add(_animator_cb, eo_obj); 484 pd->animator = ecore_animator_add(_animator_cb, eo_obj);
@@ -506,6 +556,9 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_duration_only_set, EFL_FUNC_CALL(
506EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_total_duration_set, EFL_FUNC_CALL(total_duration), double total_duration); 556EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_total_duration_set, EFL_FUNC_CALL(total_duration), double total_duration);
507EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_total_duration_get, double, 0); 557EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_total_duration_get, double, 0);
508 558
559EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_start_delay_set, EFL_FUNC_CALL(delay_time), double delay_time);
560EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_start_delay_get, double, 0);
561
509EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_count_set, EFL_FUNC_CALL(count), int count); 562EOAPI EFL_VOID_FUNC_BODYV(efl_animation_object_repeat_count_set, EFL_FUNC_CALL(count), int count);
510EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0); 563EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0);
511 564
@@ -519,6 +572,8 @@ EOAPI EFL_FUNC_BODY_CONST(efl_animation_object_repeat_count_get, int, 0);
519 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_only_set, _efl_animation_object_duration_only_set), \ 572 EFL_OBJECT_OP_FUNC(efl_animation_object_duration_only_set, _efl_animation_object_duration_only_set), \
520 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_set, _efl_animation_object_total_duration_set), \ 573 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_set, _efl_animation_object_total_duration_set), \
521 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_total_duration_get), \ 574 EFL_OBJECT_OP_FUNC(efl_animation_object_total_duration_get, _efl_animation_object_total_duration_get), \
575 EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_set, _efl_animation_object_start_delay_set), \
576 EFL_OBJECT_OP_FUNC(efl_animation_object_start_delay_get, _efl_animation_object_start_delay_get), \
522 EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_set, _efl_animation_object_repeat_count_set), \ 577 EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_set, _efl_animation_object_repeat_count_set), \
523 EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_get, _efl_animation_object_repeat_count_get) 578 EFL_OBJECT_OP_FUNC(efl_animation_object_repeat_count_get, _efl_animation_object_repeat_count_get)
524 579
diff --git a/src/lib/evas/canvas/efl_animation_object_group_parallel.c b/src/lib/evas/canvas/efl_animation_object_group_parallel.c
index 7e23b73877..6d58e39247 100644
--- a/src/lib/evas/canvas/efl_animation_object_group_parallel.c
+++ b/src/lib/evas/canvas/efl_animation_object_group_parallel.c
@@ -119,6 +119,10 @@ _efl_animation_object_group_parallel_efl_animation_object_total_duration_get(Eo
119 double child_total_duration = 119 double child_total_duration =
120 efl_animation_object_total_duration_get(anim_obj); 120 efl_animation_object_total_duration_get(anim_obj);
121 121
122 double start_delay = efl_animation_object_start_delay_get(anim_obj);
123 if (start_delay > 0.0)
124 child_total_duration += start_delay;
125
122 int child_repeat_count = 126 int child_repeat_count =
123 efl_animation_object_repeat_count_get(anim_obj); 127 efl_animation_object_repeat_count_get(anim_obj);
124 if (child_repeat_count > 0) 128 if (child_repeat_count > 0)
@@ -177,18 +181,27 @@ _efl_animation_object_group_parallel_efl_animation_object_progress_set(Eo *eo_ob
177 { 181 {
178 double total_duration = 182 double total_duration =
179 efl_animation_object_total_duration_get(anim_obj); 183 efl_animation_object_total_duration_get(anim_obj);
184 double start_delay = efl_animation_object_start_delay_get(anim_obj);
180 double anim_obj_progress; 185 double anim_obj_progress;
181 186
182 if (total_duration == 0.0) 187 if (total_duration == 0.0)
183 anim_obj_progress = 1.0; 188 anim_obj_progress = 1.0;
184 else 189 else
185 { 190 {
191 double elapsed_time_without_delay;
192
186 //If object is repeated, then recalculate progress. 193 //If object is repeated, then recalculate progress.
187 int repeated_count = _repeated_count_get(pd, anim_obj); 194 int repeated_count = _repeated_count_get(pd, anim_obj);
188 if (repeated_count > 0) 195 if (repeated_count > 0)
189 anim_obj_progress = (elapsed_time - (total_duration * repeated_count)) / total_duration; 196 elapsed_time_without_delay =
197 (elapsed_time - ((total_duration + start_delay) * repeated_count)) - start_delay;
190 else 198 else
191 anim_obj_progress = elapsed_time / total_duration; 199 elapsed_time_without_delay = elapsed_time - start_delay;
200
201 //Object should not start to wait for start delay time.
202 if (elapsed_time_without_delay < 0.0) continue;
203
204 anim_obj_progress = elapsed_time_without_delay / total_duration;
192 205
193 if (anim_obj_progress > 1.0) 206 if (anim_obj_progress > 1.0)
194 anim_obj_progress = 1.0; 207 anim_obj_progress = 1.0;
diff --git a/src/lib/evas/canvas/efl_animation_object_group_sequential.c b/src/lib/evas/canvas/efl_animation_object_group_sequential.c
index 9dcbd2a7ac..3b288248ef 100644
--- a/src/lib/evas/canvas/efl_animation_object_group_sequential.c
+++ b/src/lib/evas/canvas/efl_animation_object_group_sequential.c
@@ -121,6 +121,10 @@ _efl_animation_object_group_sequential_efl_animation_object_total_duration_get(E
121 double child_total_duration = 121 double child_total_duration =
122 efl_animation_object_total_duration_get(anim_obj); 122 efl_animation_object_total_duration_get(anim_obj);
123 123
124 double start_delay = efl_animation_object_start_delay_get(anim_obj);
125 if (start_delay > 0.0)
126 child_total_duration += start_delay;
127
124 int child_repeat_count = 128 int child_repeat_count =
125 efl_animation_object_repeat_count_get(anim_obj); 129 efl_animation_object_repeat_count_get(anim_obj);
126 if (child_repeat_count > 0) 130 if (child_repeat_count > 0)
@@ -183,6 +187,7 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_
183 //Sum the current total duration 187 //Sum the current total duration
184 double total_duration = 188 double total_duration =
185 efl_animation_object_total_duration_get(anim_obj); 189 efl_animation_object_total_duration_get(anim_obj);
190 double start_delay = efl_animation_object_start_delay_get(anim_obj);
186 double anim_obj_progress; 191 double anim_obj_progress;
187 192
188 if (total_duration == 0.0) 193 if (total_duration == 0.0)
@@ -192,10 +197,17 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_
192 //If object is repeated, then recalculate progress. 197 //If object is repeated, then recalculate progress.
193 int repeated_count = _repeated_count_get(pd, anim_obj); 198 int repeated_count = _repeated_count_get(pd, anim_obj);
194 if (repeated_count > 0) 199 if (repeated_count > 0)
195 sum_prev_total_duration += (total_duration * repeated_count); 200 sum_prev_total_duration +=
201 ((total_duration + start_delay) * repeated_count);
202
203 double elapsed_time_without_delay =
204 elapsed_time - sum_prev_total_duration - start_delay;
205
206 //Object should not start to wait for start delay time.
207 if (elapsed_time_without_delay < 0.0) break;
208
209 anim_obj_progress = elapsed_time_without_delay / total_duration;
196 210
197 anim_obj_progress =
198 (elapsed_time - sum_prev_total_duration) / total_duration;
199 if (anim_obj_progress > 1.0) 211 if (anim_obj_progress > 1.0)
200 anim_obj_progress = 1.0; 212 anim_obj_progress = 1.0;
201 213
@@ -218,8 +230,9 @@ _efl_animation_object_group_sequential_efl_animation_object_progress_set(Eo *eo_
218 } 230 }
219 } 231 }
220 232
221 //Update the sum of the previous objects' total durations 233 /* Update the sum of the previous objects' total durations and start
222 sum_prev_total_duration += total_duration; 234 * delays */
235 sum_prev_total_duration += (total_duration + start_delay);
223 236
224 if ((anim_obj_progress == 1.0) && 237 if ((anim_obj_progress == 1.0) &&
225 !efl_animation_object_final_state_keep_get(anim_obj)) 238 !efl_animation_object_final_state_keep_get(anim_obj))
diff --git a/src/lib/evas/canvas/efl_animation_object_private.h b/src/lib/evas/canvas/efl_animation_object_private.h
index f82d24fc40..e27990a309 100644
--- a/src/lib/evas/canvas/efl_animation_object_private.h
+++ b/src/lib/evas/canvas/efl_animation_object_private.h
@@ -19,6 +19,9 @@ typedef struct _Efl_Animation_Object_Data
19{ 19{
20 Ecore_Animator *animator; 20 Ecore_Animator *animator;
21 21
22 Ecore_Timer *start_delay_timer;
23 double start_delay_time;
24
22 struct { 25 struct {
23 double begin; 26 double begin;
24 double current; 27 double current;
diff --git a/src/lib/evas/canvas/efl_animation_private.h b/src/lib/evas/canvas/efl_animation_private.h
index 49e635c22a..6c993f4bd3 100644
--- a/src/lib/evas/canvas/efl_animation_private.h
+++ b/src/lib/evas/canvas/efl_animation_private.h
@@ -12,6 +12,8 @@ typedef struct _Efl_Animation_Data
12 double duration; 12 double duration;
13 double total_duration; 13 double total_duration;
14 14
15 double start_delay_time;
16
15 int repeat_count; 17 int repeat_count;
16 18
17 Eina_Bool is_deleted : 1; 19 Eina_Bool is_deleted : 1;
diff --git a/src/lib/evas/canvas/efl_animation_rotate.c b/src/lib/evas/canvas/efl_animation_rotate.c
index 362464c917..7e3851769b 100644
--- a/src/lib/evas/canvas/efl_animation_rotate.c
+++ b/src/lib/evas/canvas/efl_animation_rotate.c
@@ -195,6 +195,9 @@ _efl_animation_rotate_efl_animation_object_create(Eo *eo_obj,
195 double total_duration = efl_animation_total_duration_get(eo_obj); 195 double total_duration = efl_animation_total_duration_get(eo_obj);
196 efl_animation_object_total_duration_set(anim_obj, total_duration); 196 efl_animation_object_total_duration_set(anim_obj, total_duration);
197 197
198 double start_delay_time = efl_animation_start_delay_get(eo_obj);
199 efl_animation_object_start_delay_set(anim_obj, start_delay_time);
200
198 int repeat_count = efl_animation_repeat_count_get(eo_obj); 201 int repeat_count = efl_animation_repeat_count_get(eo_obj);
199 efl_animation_object_repeat_count_set(anim_obj, repeat_count); 202 efl_animation_object_repeat_count_set(anim_obj, repeat_count);
200 203
diff --git a/src/lib/evas/canvas/efl_animation_scale.c b/src/lib/evas/canvas/efl_animation_scale.c
index dad906e987..2c3ba7c445 100644
--- a/src/lib/evas/canvas/efl_animation_scale.c
+++ b/src/lib/evas/canvas/efl_animation_scale.c
@@ -221,6 +221,9 @@ _efl_animation_scale_efl_animation_object_create(Eo *eo_obj,
221 double total_duration = efl_animation_total_duration_get(eo_obj); 221 double total_duration = efl_animation_total_duration_get(eo_obj);
222 efl_animation_object_total_duration_set(anim_obj, total_duration); 222 efl_animation_object_total_duration_set(anim_obj, total_duration);
223 223
224 double start_delay_time = efl_animation_start_delay_get(eo_obj);
225 efl_animation_object_start_delay_set(anim_obj, start_delay_time);
226
224 int repeat_count = efl_animation_repeat_count_get(eo_obj); 227 int repeat_count = efl_animation_repeat_count_get(eo_obj);
225 efl_animation_object_repeat_count_set(anim_obj, repeat_count); 228 efl_animation_object_repeat_count_set(anim_obj, repeat_count);
226 229
diff --git a/src/lib/evas/canvas/efl_animation_translate.c b/src/lib/evas/canvas/efl_animation_translate.c
index 5623fb0e33..2ffc158452 100644
--- a/src/lib/evas/canvas/efl_animation_translate.c
+++ b/src/lib/evas/canvas/efl_animation_translate.c
@@ -163,6 +163,9 @@ _efl_animation_translate_efl_animation_object_create(Eo *eo_obj,
163 double total_duration = efl_animation_total_duration_get(eo_obj); 163 double total_duration = efl_animation_total_duration_get(eo_obj);
164 efl_animation_object_total_duration_set(anim_obj, total_duration); 164 efl_animation_object_total_duration_set(anim_obj, total_duration);
165 165
166 double start_delay_time = efl_animation_start_delay_get(eo_obj);
167 efl_animation_object_start_delay_set(anim_obj, start_delay_time);
168
166 int repeat_count = efl_animation_repeat_count_get(eo_obj); 169 int repeat_count = efl_animation_repeat_count_get(eo_obj);
167 efl_animation_object_repeat_count_set(anim_obj, repeat_count); 170 efl_animation_object_repeat_count_set(anim_obj, repeat_count);
168 171