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.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10645
This commit is contained in:
Xavi Artigas 2019-11-11 16:38:08 +00:00 committed by Marcel Hollerbach
parent db68e45fed
commit 9bb2df9966
13 changed files with 25 additions and 23 deletions

View File

@ -513,7 +513,7 @@ _animation_cb(void *data, const Efl_Event *ev)
{
Params *params = data;
efl_ui_spotlight_manager_animation_enabled_set(efl_ui_spotlight_manager_get(params->spotlight), efl_ui_selectable_selected_get(ev->object));
efl_ui_spotlight_manager_animated_transition_set(efl_ui_spotlight_manager_get(params->spotlight), efl_ui_selectable_selected_get(ev->object));
}
static void
@ -536,7 +536,7 @@ view_animation_cb(void *data,
ck = efl_add(EFL_UI_CHECK_CLASS, box);
efl_event_callback_add(ck, EFL_UI_EVENT_SELECTED_CHANGED, _animation_cb, params);
efl_ui_selectable_selected_set(ck, efl_ui_spotlight_manager_animation_enabled_get(efl_ui_spotlight_manager_get(params->spotlight)));
efl_ui_selectable_selected_set(ck, efl_ui_spotlight_manager_animated_transition_get(efl_ui_spotlight_manager_get(params->spotlight)));
efl_text_set(ck, "Animation");
efl_pack_end(box, ck);
efl_gfx_entity_visible_set(ck, 1);

View File

@ -320,7 +320,7 @@ _efl_canvas_layout_efl_layout_signal_signal_emit(Eo *obj EINA_UNUSED, Edje *ed,
/* FIXDOC: Verify/Expand */
EOLIAN void
_efl_canvas_layout_animation_set(Eo *obj, Edje *ed, Eina_Bool on)
_efl_canvas_layout_animated_set(Eo *obj, Edje *ed, Eina_Bool on)
{
Eina_List *l;
unsigned short i;
@ -390,7 +390,7 @@ break_prog:
}
EOLIAN Eina_Bool
_efl_canvas_layout_animation_get(const Eo *obj EINA_UNUSED, Edje *ed)
_efl_canvas_layout_animated_get(const Eo *obj EINA_UNUSED, Edje *ed)
{
if (!ed) return EINA_FALSE;
if (ed->delete_me) return EINA_FALSE;

View File

@ -10,7 +10,7 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl.
event_c_prefix: efl_layout;
data: Edje;
methods {
@property animation {
@property animated {
[[Whether this object is animating or not.
This property indicates whether animations are stopped or not.

View File

@ -2,13 +2,13 @@
EAPI void
edje_object_animation_set(Efl_Canvas_Layout *obj, Eina_Bool on)
{
efl_canvas_layout_animation_set(obj, on);
efl_canvas_layout_animated_set(obj, on);
}
EAPI Eina_Bool
edje_object_animation_get(const Efl_Canvas_Layout *obj)
{
return efl_canvas_layout_animation_get(obj);
return efl_canvas_layout_animated_get(obj);
}
EAPI Efl_Input_Device *

View File

@ -229,7 +229,7 @@ _efl_ui_spotlight_container_efl_object_finalize(Eo *obj, Efl_Ui_Spotlight_Contai
}
else
{
efl_ui_spotlight_manager_animation_enabled_set(manager, EINA_TRUE);
efl_ui_spotlight_manager_animated_transition_set(manager, EINA_TRUE);
}
return obj;
@ -619,7 +619,7 @@ _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Cont
//the api indicates that the caller passes ownership to this function, so we need to unref here
efl_unref(pd->transition);
//disable animation when not finalized yet, this help reducing the overhead of scheduling a animation that will not be displayed
efl_ui_spotlight_manager_animation_enabled_set(pd->transition, efl_finalized_get(obj));
efl_ui_spotlight_manager_animated_transition_set(pd->transition, efl_finalized_get(obj));
efl_ui_spotlight_manager_bind(pd->transition, obj,
pd->page_root);
efl_ui_spotlight_manager_size_set(pd->transition, pd->page_spec.sz);

View File

@ -55,10 +55,12 @@ abstract @beta Efl.Ui.Spotlight.Manager extends Efl.Object {
size : Eina.Size2D; [[The new size of the sub-widgets.]]
}
}
@property animation_enabled @pure_virtual {
[[This flag can be used to disable animations.]]
@property animated_transition @pure_virtual {
[[When this flag is $true the transition from the previous element to the new one will be animated whenever
@Efl.Ui.Spotlight.Container.active_element changes.]]
values {
enable : bool; [[$true if you want animations to happen, $false otherwise.]]
enable : bool; [[$true to enable animated transitions. If $false, the new active element is shown
immediately.]]
}
}
}

View File

@ -157,13 +157,13 @@ _efl_ui_spotlight_manager_plain_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_
}
EOLIAN static void
_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)
_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)
{
pd->animation = animation;
}
EOLIAN static Eina_Bool
_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
_efl_ui_spotlight_manager_plain_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Plain_Data *pd)
{
return pd->animation;
}

View File

@ -6,7 +6,7 @@ class @beta Efl.Ui.Spotlight.Manager_Plain extends Efl.Ui.Spotlight.Manager
Efl.Ui.Spotlight.Manager.content_del;
Efl.Ui.Spotlight.Manager.switch_to;
Efl.Ui.Spotlight.Manager.size {set;}
Efl.Ui.Spotlight.Manager.animation_enabled {set; get;}
Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
Efl.Object.destructor;
}
}

View File

@ -305,7 +305,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_size_set(Eo *obj EINA_
}
EOLIAN static void
_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)
_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)
{
pd->animation = animation;
if (pd->transition.active && !animation)
@ -317,7 +317,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_set(
}
EOLIAN static Eina_Bool
_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd)
_efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Scroll_Data *pd)
{
return pd->animation;
}

View File

@ -21,7 +21,7 @@ class @beta Efl.Ui.Spotlight.Manager_Scroll extends Efl.Ui.Spotlight.Manager
Efl.Ui.Spotlight.Manager.content_del;
Efl.Ui.Spotlight.Manager.switch_to;
Efl.Ui.Spotlight.Manager.size {set;}
Efl.Ui.Spotlight.Manager.animation_enabled {set; get;}
Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
Efl.Object.invalidate;
}
}

View File

@ -262,7 +262,7 @@ _reset_player(Efl_Animation_Player *player, Eina_Bool vis)
}
EOLIAN static void
_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)
_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)
{
_reset_player(pd->hide, EINA_FALSE);
_reset_player(pd->show, EINA_TRUE);
@ -270,7 +270,7 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animation_enabled_set(E
}
EOLIAN static Eina_Bool
_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animation_enabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd)
_efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_animated_transition_get(const Eo *obj EINA_UNUSED, Efl_Ui_Spotlight_Manager_Stack_Data *pd)
{
return pd->animation;
}

View File

@ -6,7 +6,7 @@ class @beta Efl.Ui.Spotlight.Manager_Stack extends Efl.Ui.Spotlight.Manager
Efl.Ui.Spotlight.Manager.content_del;
Efl.Ui.Spotlight.Manager.switch_to;
Efl.Ui.Spotlight.Manager.size {set;}
Efl.Ui.Spotlight.Manager.animation_enabled {set; get;}
Efl.Ui.Spotlight.Manager.animated_transition {set; get;}
Efl.Object.invalidate;
}
}

View File

@ -197,8 +197,8 @@ _transition_animation_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED)
}
EFL_OPS_DEFINE(transition_tracker,
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animation_enabled_set, _transition_animation_set),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animation_enabled_get, _transition_animation_get),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animated_transition_set, _transition_animation_set),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_animated_transition_get, _transition_animation_get),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_add, _transition_content_add),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_content_del, _transition_content_del),
EFL_OBJECT_OP_FUNC(efl_ui_spotlight_manager_switch_to, _transition_request_switch),