forked from enlightenment/efl
Efl.Ui.Vg_Animation: Change property name autorepeat to looping
Summary: autoplay and autorepeat look similar and can be confusing. so change autorepeat to looping. ref T8476 Depends on D11022 Test Plan: N/A Reviewers: Hermet, bu5hm4n, kimcinoo, segfaultxavi, zmike Reviewed By: Hermet, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8476 Differential Revision: https://phab.enlightenment.org/D11061
This commit is contained in:
parent
05bb02cbb0
commit
2f4ca46544
|
@ -159,7 +159,7 @@ static void
|
|||
check_changed_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -52,7 +52,7 @@ static void
|
|||
check_changed_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
efl_ui_vg_animation_looping_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -217,7 +217,7 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|||
|
||||
evas_object_vg_animated_frame_set(pd->vg, update_frame);
|
||||
|
||||
if (pd->autorepeat)
|
||||
if (pd->looping)
|
||||
{
|
||||
int repeat_times = elm_transit_current_repeat_times_get(pd->transit);
|
||||
if (pd->repeat_times != repeat_times)
|
||||
|
@ -327,7 +327,7 @@ _ready_play(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
|
|||
double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed;
|
||||
Elm_Transit *transit = elm_transit_add();
|
||||
elm_transit_object_add(transit, pd->vg);
|
||||
if (pd->autorepeat) elm_transit_repeat_times_set(transit, -1);
|
||||
if (pd->looping) elm_transit_repeat_times_set(transit, -1);
|
||||
elm_transit_effect_add(transit, _transit_cb, obj, _transit_del_cb);
|
||||
elm_transit_progress_value_set(transit, pd->progress);
|
||||
elm_transit_objects_final_state_keep_set(transit, EINA_TRUE);
|
||||
|
@ -462,21 +462,21 @@ _efl_ui_vg_animation_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_vg_animation_autorepeat_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool autorepeat)
|
||||
_efl_ui_vg_animation_looping_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool looping)
|
||||
{
|
||||
if (pd->autorepeat == autorepeat) return;
|
||||
pd->autorepeat = autorepeat;
|
||||
if (pd->looping == looping) return;
|
||||
pd->looping = looping;
|
||||
if (pd->transit)
|
||||
{
|
||||
if (autorepeat) elm_transit_repeat_times_set(pd->transit, -1);
|
||||
if (looping) elm_transit_repeat_times_set(pd->transit, -1);
|
||||
else elm_transit_repeat_times_set(pd->transit, 0);
|
||||
}
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_vg_animation_autorepeat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
_efl_ui_vg_animation_looping_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->autorepeat;
|
||||
return pd->looping;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
|
|
|
@ -47,20 +47,20 @@ class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, E
|
|||
autoplay: bool(false); [[Auto play mode.]]
|
||||
}
|
||||
}
|
||||
@property autorepeat {
|
||||
@property looping {
|
||||
[[Turn on/off animation looping.
|
||||
|
||||
If @.autorepeat is $true, it repeats animation when animation frame is reached to
|
||||
end. This auto repeat mode is valid to both playing and playing_backwards cases.
|
||||
When $true, animation is restarted when it reaches the last frame.
|
||||
This works both when playing forward and backward.
|
||||
|
||||
$true Enable auto play mode, disable otherwise.
|
||||
$true Enable loop mode, disable otherwise.
|
||||
]]
|
||||
set {
|
||||
}
|
||||
get {
|
||||
}
|
||||
values {
|
||||
autorepeat: bool; [[Loop mode, Default is $false.]]
|
||||
looping: bool; [[Loop mode, Default is $false.]]
|
||||
}
|
||||
}
|
||||
@property frame {
|
||||
|
|
|
@ -14,13 +14,13 @@ elm_animation_view_auto_play_get(const Efl_Ui_Vg_Animation *obj)
|
|||
EAPI void
|
||||
elm_animation_view_auto_repeat_set(Efl_Ui_Vg_Animation *obj, Eina_Bool autorepeat)
|
||||
{
|
||||
efl_ui_vg_animation_autorepeat_set(obj, autorepeat);
|
||||
efl_ui_vg_animation_looping_set(obj, autorepeat);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_auto_repeat_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_autorepeat_get(obj);
|
||||
return efl_ui_vg_animation_looping_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
|
|
|
@ -24,7 +24,7 @@ struct _Efl_Ui_Vg_Animation_Data
|
|||
Eina_Bool playing_reverse : 1;
|
||||
Eina_Bool autoplay : 1;
|
||||
Eina_Bool autoplay_pause: 1;
|
||||
Eina_Bool autorepeat : 1;
|
||||
Eina_Bool looping : 1;
|
||||
Eina_Bool playback_direction_changed : 1;
|
||||
};
|
||||
|
||||
|
|
|
@ -50,8 +50,8 @@ EFL_START_TEST(vg_anim_playing_control)
|
|||
ck_assert_int_eq(efl_ui_vg_animation_state_get(vg_anim), EFL_UI_VG_ANIMATION_STATE_STOPPED);
|
||||
|
||||
// Auto repeat
|
||||
efl_ui_vg_animation_autorepeat_set(vg_anim, EINA_TRUE);
|
||||
ck_assert_int_eq(efl_ui_vg_animation_autorepeat_get(vg_anim), EINA_TRUE);
|
||||
efl_ui_vg_animation_looping_set(vg_anim, EINA_TRUE);
|
||||
ck_assert_int_eq(efl_ui_vg_animation_looping_get(vg_anim), EINA_TRUE);
|
||||
|
||||
// Auto play
|
||||
efl_ui_vg_animation_autoplay_set(vg_anim, EINA_TRUE);
|
||||
|
|
Loading…
Reference in New Issue