summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-11-11 16:38:08 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-11-18 14:40:46 +0100
commit7fc52c63613b963da65ce5b93b60cc881d4d4745 (patch)
tree2d4171053dce16f54a3d46cd2309b3836851760b
parentc30176e7ffac0ab70b8ef92cb0fce62b75499181 (diff)
Unify "animated" flags
There exist several flags to indicate whether an object should be animated, with inconsistent names: Efl.Canvas.Layout.animation: bool indicating if Edje animations should be played Efl.Ui.Spotlight_Manager.animation_enabled: bool indicating if page transitions should be animated Efl.Canvas.Animation_Player.animation: Efl.Canvas.Animation object This commit unifies all of them: "animated" is now a flag, and "animation" is an object. Note: Animation_Player is in the process of being replaced by an "animation" property in the Efl.Canvas.Object, hence the need for non-clashing animation flags. Differential Revision: https://phab.enlightenment.org/D10645
-rw-r--r--src/bin/elementary/test_ui_spotlight.c4
-rw-r--r--src/lib/edje/edje_program.c4
-rw-r--r--src/lib/edje/efl_canvas_layout.eo2
-rw-r--r--src/lib/edje/efl_canvas_layout_eo.legacy.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_container.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager.eo8
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_plain.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_plain.eo2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_scroll.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_scroll.eo2
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_stack.c4
-rw-r--r--src/lib/elementary/efl_ui_spotlight_manager_stack.eo2
-rw-r--r--src/tests/elementary/efl_ui_test_spotlight.c4
13 files changed, 25 insertions, 23 deletions
diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c
index a41ab69be5..fe095ab879 100644
--- a/src/bin/elementary/test_ui_spotlight.c
+++ b/src/bin/elementary/test_ui_spotlight.c
@@ -513,7 +513,7 @@ _animation_cb(void *data, const Efl_Event *ev)
513{ 513{
514 Params *params = data; 514 Params *params = data;
515 515
516 efl_ui_spotlight_manager_animation_enabled_set(efl_ui_spotlight_manager_get(params->spotlight), efl_ui_selectable_selected_get(ev->object)); 516 efl_ui_spotlight_manager_animated_transition_set(efl_ui_spotlight_manager_get(params->spotlight), efl_ui_selectable_selected_get(ev->object));
517} 517}
518 518
519static void 519static void
@@ -536,7 +536,7 @@ view_animation_cb(void *data,
536 536
537 ck = efl_add(EFL_UI_CHECK_CLASS, box); 537 ck = efl_add(EFL_UI_CHECK_CLASS, box);
538 efl_event_callback_add(ck, EFL_UI_EVENT_SELECTED_CHANGED, _animation_cb, params); 538 efl_event_callback_add(ck, EFL_UI_EVENT_SELECTED_CHANGED, _animation_cb, params);
539 efl_ui_selectable_selected_set(ck, efl_ui_spotlight_manager_animation_enabled_get(efl_ui_spotlight_manager_get(params->spotlight))); 539 efl_ui_selectable_selected_set(ck, efl_ui_spotlight_manager_animated_transition_get(efl_ui_spotlight_manager_get(params->spotlight)));
540 efl_text_set(ck, "Animation"); 540 efl_text_set(ck, "Animation");
541 efl_pack_end(box, ck); 541 efl_pack_end(box, ck);
542 efl_gfx_entity_visible_set(ck, 1); 542 efl_gfx_entity_visible_set(ck, 1);
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index b047031da1..b1edd1fa2b 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -320,7 +320,7 @@ _efl_canvas_layout_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Edje *ed,
320 320
321/* FIXDOC: Verify/Expand */ 321/* FIXDOC: Verify/Expand */
322EOLIAN void 322EOLIAN void
323_efl_canvas_layout_animation_set(Eo *obj, Edje *ed, Eina_Bool on) 323_efl_canvas_layout_animated_set(Eo *obj, Edje *ed, Eina_Bool on)
324{ 324{
325 Eina_List *l; 325 Eina_List *l;
326 unsigned short i; 326 unsigned short i;
@@ -390,7 +390,7 @@ break_prog:
390} 390}
391 391
392EOLIAN Eina_Bool 392EOLIAN Eina_Bool
393_efl_canvas_layout_animation_get(const Eo *obj EINA_UNUSED, Edje *ed) 393_efl_canvas_layout_animated_get(const Eo *obj EINA_UNUSED, Edje *ed)
394{ 394{
395 if (!ed) return EINA_FALSE; 395 if (!ed) return EINA_FALSE;
396 if (ed->delete_me) return EINA_FALSE; 396 if (ed->delete_me) return EINA_FALSE;
diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo
index bed3439d36..ef33c5bd8f 100644
--- a/src/lib/edje/efl_canvas_layout.eo
+++ b/src/lib/edje/efl_canvas_layout.eo
@@ -10,7 +10,7 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.
10 event_c_prefix: efl_layout; 10 event_c_prefix: efl_layout;
11 data: Edje; 11 data: Edje;
12 methods { 12 methods {
13 @property animation { 13 @property animated {
14 [[Whether this object is animating or not. 14 [[Whether this object is animating or not.
15 15
16 This property indicates whether animations are stopped or not. 16 This property indicates whether animations are stopped or not.
diff --git a/src/lib/edje/efl_canvas_layout_eo.legacy.c b/src/lib/edje/efl_canvas_layout_eo.legacy.c
index f55e5d5f4b..ec6eb8930d 100644
--- a/src/lib/edje/efl_canvas_layout_eo.legacy.c
+++ b/src/lib/edje/efl_canvas_layout_eo.legacy.c
@@ -2,13 +2,13 @@
2EAPI void 2EAPI void
3edje_object_animation_set(Efl_Canvas_Layout *obj, Eina_Bool on) 3edje_object_animation_set(Efl_Canvas_Layout *obj, Eina_Bool on)
4{ 4{
5 efl_canvas_layout_animation_set(obj, on); 5 efl_canvas_layout_animated_set(obj, on);
6} 6}
7 7
8EAPI Eina_Bool 8EAPI Eina_Bool
9edje_object_animation_get(const Efl_Canvas_Layout *obj) 9edje_object_animation_get(const Efl_Canvas_Layout *obj)
10{ 10{
11 return efl_canvas_layout_animation_get(obj); 11 return efl_canvas_layout_animated_get(obj);
12} 12}
13 13
14EAPI Efl_Input_Device * 14EAPI Efl_Input_Device *
diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c
index 608aca1d3c..f725f4830c 100644
--- a/src/lib/elementary/efl_ui_spotlight_container.c
+++ b/src/lib/elementary/efl_ui_spotlight_container.c
@@ -229,7 +229,7 @@ _efl_ui_spotlight_container_efl_object_finalize(Eo *obj, Efl_Ui_Spotlight_Contai
229 } 229 }
230 else 230 else
231 { 231 {
232 efl_ui_spotlight_manager_animation_enabled_set(manager, EINA_TRUE); 232 efl_ui_spotlight_manager_animated_transition_set(manager, EINA_TRUE);
233 } 233 }
234 234
235 return obj; 235 return obj;
@@ -619,7 +619,7 @@ _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Cont
619 //the api indicates that the caller passes ownership to this function, so we need to unref here 619 //the api indicates that the caller passes ownership to this function, so we need to unref here
620 efl_unref(pd->transition); 620 efl_unref(pd->transition);
621 //disable animation when not finalized yet, this help reducing the overhead of scheduling a animation that will not be displayed 621 //disable animation when not finalized yet, this help reducing the overhead of scheduling a animation that will not be displayed
622 efl_ui_spotlight_manager_animation_enabled_set(pd->transition, efl_finalized_get(obj)); 622 efl_ui_spotlight_manager_animated_transition_set(pd->transition, efl_finalized_get(obj));
623 efl_ui_spotlight_manager_bind(pd->transition, obj, 623 efl_ui_spotlight_manager_bind(pd->transition, obj,
624 pd->page_root); 624 pd->page_root);
625 efl_ui_spotlight_manager_size_set(pd->transition, pd->page_spec.sz); 625 efl_ui_spotlight_manager_size_set(pd->transition, pd->page_spec.sz);
diff --git a/src/lib/elementary/efl_ui_spotlight_manager.eo b/src/lib/elementary/efl_ui_spotlight_manager.eo
index 03f0e4fc35..ddb1ac1041 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager.eo
@@ -55,10 +55,12 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
55 size : Eina.Size2D; [[The new size of the sub-widgets.]] 55 size : Eina.Size2D; [[The new size of the sub-widgets.]]
56 } 56 }
57 } 57 }
58 @property animation_enabled @pure_virtual { 58 @property animated_transition @pure_virtual {
59 [[This flag can be used to disable animations.]] 59 [[When this flag is $true the transition from the previous element to the new one will be animated whenever
60 @Efl.Ui.Spotlight.Container.active_element changes.]]
60 values { 61 values {
61 enable : bool; [[$true if you want animations to happen, $false otherwise.]] 62 enable : bool; [[$true to enable animated transitions. If $false, the new active element is shown
63 immediately.]]
62 } 64 }
63 } 65 }
64 } 66 }
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.c b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
index f7d81335d6..50371ed3fc 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_plain.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.c
@@ -157,13 +157,13 @@ _efl_ui_spotlight_manager_plain_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_
157} 157}
158 158
159EOLIAN static void 159EOLIAN static void
160_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animation_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Eina_Bool animation) 160_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd, Eina_Bool animation)
161{ 161{
162 pd->animation = animation; 162 pd->animation = animation;
163} 163}
164 164
165EOLIAN static Eina_Bool 165EOLIAN static Eina_Bool
166_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd) 166_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
167{ 167{
168 return pd->animation; 168 return pd->animation;
169} 169}
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo b/src/lib/elementary/efl_ui_spotlight_manager_plain.eo
index 3556145da2..fd4f5d9664 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_plain.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager_plain.eo
@@ -6,7 +6,7 @@ class @beta Efl.Ui.Spotlight.Manager_Plain extends Efl.Ui.Spotlight.Manager
6 Efl.Ui.Spotlight.Manager.content_del; 6 Efl.Ui.Spotlight.Manager.content_del;
7 Efl.Ui.Spotlight.Manager.switch_to; 7 Efl.Ui.Spotlight.Manager.switch_to;
8 Efl.Ui.Spotlight.Manager.size {set;} 8 Efl.Ui.Spotlight.Manager.size {set;}
9 Efl.Ui.Spotlight.Manager.animation_enabled {set; get;} 9 Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
10 Efl.Object.destructor; 10 Efl.Object.destructor;
11 } 11 }
12} 12}
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
index 1728c269d1..34baa3fbfb 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c
@@ -305,7 +305,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_size_set(Eo *obj EINA_
305} 305}
306 306
307EOLIAN static void 307EOLIAN static void
308_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Eina_Bool animation) 308_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd, Eina_Bool animation)
309{ 309{
310 pd->animation = animation; 310 pd->animation = animation;
311 if (pd->transition.active && !animation) 311 if (pd->transition.active && !animation)
@@ -317,7 +317,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_set(
317} 317}
318 318
319EOLIAN static Eina_Bool 319EOLIAN static Eina_Bool
320_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd) 320_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd)
321{ 321{
322 return pd->animation; 322 return pd->animation;
323} 323}
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo
index 16ba58db2f..c9a8e7ad34 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo
@@ -21,7 +21,7 @@ class @beta Efl.Ui.Spotlight.Manager_Scroll extends Efl.Ui.Spotlight.Manager
21 Efl.Ui.Spotlight.Manager.content_del; 21 Efl.Ui.Spotlight.Manager.content_del;
22 Efl.Ui.Spotlight.Manager.switch_to; 22 Efl.Ui.Spotlight.Manager.switch_to;
23 Efl.Ui.Spotlight.Manager.size {set;} 23 Efl.Ui.Spotlight.Manager.size {set;}
24 Efl.Ui.Spotlight.Manager.animation_enabled {set; get;} 24 Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
25 Efl.Object.invalidate; 25 Efl.Object.invalidate;
26 } 26 }
27} 27}
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
index 811a686194..16e721560f 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c
+++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c
@@ -262,7 +262,7 @@ _reset_player(Efl_Animation_Player *player, Eina_Bool vis)
262} 262}
263 263
264EOLIAN static void 264EOLIAN static void
265_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animation_enabled_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Eina_Bool animation) 265_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_set(Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd, Eina_Bool animation)
266{ 266{
267 _reset_player(pd->hide, EINA_FALSE); 267 _reset_player(pd->hide, EINA_FALSE);
268 _reset_player(pd->show, EINA_TRUE); 268 _reset_player(pd->show, EINA_TRUE);
@@ -270,7 +270,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animation_enabled_set(E
270} 270}
271 271
272EOLIAN static Eina_Bool 272EOLIAN static Eina_Bool
273_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd) 273_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd)
274{ 274{
275 return pd->animation; 275 return pd->animation;
276} 276}
diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo b/src/lib/elementary/efl_ui_spotlight_manager_stack.eo
index c18fe31a8a..2275eb8ff0 100644
--- a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo
+++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.eo
@@ -6,7 +6,7 @@ class @beta Efl.Ui.Spotlight.Manager_Stack extends Efl.Ui.Spotlight.Manager
6 Efl.Ui.Spotlight.Manager.content_del; 6 Efl.Ui.Spotlight.Manager.content_del;
7 Efl.Ui.Spotlight.Manager.switch_to; 7 Efl.Ui.Spotlight.Manager.switch_to;
8 Efl.Ui.Spotlight.Manager.size {set;} 8 Efl.Ui.Spotlight.Manager.size {set;}
9 Efl.Ui.Spotlight.Manager.animation_enabled {set; get;} 9 Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
10 Efl.Object.invalidate; 10 Efl.Object.invalidate;
11 } 11 }
12} 12}
diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c
index c093efb46b..02edfcb652 100644
--- a/src/tests/elementary/efl_ui_test_spotlight.c
+++ b/src/tests/elementary/efl_ui_test_spotlight.c
@@ -197,8 +197,8 @@ _transition_animation_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
197} 197}
198 198
199EFL_OPS_DEFINE(transition_tracker, 199EFL_OPS_DEFINE(transition_tracker,
200 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animation_enabled_set, _transition_animation_set), 200 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animated_transition_set, _transition_animation_set),
201 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animation_enabled_get, _transition_animation_get), 201 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animated_transition_get, _transition_animation_get),
202 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_add, _transition_content_add), 202 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_add, _transition_content_add),
203 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_del, _transition_content_del), 203 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_del, _transition_content_del),
204 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_switch_to, _transition_request_switch), 204 EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_switch_to, _transition_request_switch),