efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define EFL_ACCESS_OBJECT_PROTECTED
|
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
|
|
|
|
#include "elm_priv.h"
|
2019-12-31 06:53:16 -08:00
|
|
|
#include "efl_ui_vg_animation_private.h"
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
#define MY_CLASS EFL_UI_VG_ANIMATION_CLASS
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
#define MY_CLASS_NAME "Efl_Ui_Vg_Animation"
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
static const char SIG_FOCUSED[] = "focused";
|
|
|
|
static const char SIG_UNFOCUSED[] = "unfocused";
|
|
|
|
static const char SIG_PLAY_START[] = "play,start";
|
|
|
|
static const char SIG_PLAY_REPEAT[] = "play,repeat";
|
|
|
|
static const char SIG_PLAY_DONE[] = "play,done";
|
|
|
|
static const char SIG_PLAY_PAUSE[] = "play,pause";
|
|
|
|
static const char SIG_PLAY_RESUME[] = "play,resume";
|
|
|
|
static const char SIG_PLAY_STOP[] = "play,stop";
|
|
|
|
static const char SIG_PLAY_UPDATE[] = "play,update";
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
/* smart callbacks coming from Efl_Ui_Vg_Animation objects: */
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|
|
|
{SIG_FOCUSED, ""},
|
|
|
|
{SIG_UNFOCUSED, ""},
|
|
|
|
{SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
|
|
|
|
{SIG_PLAY_START, ""},
|
|
|
|
{SIG_PLAY_REPEAT, ""},
|
|
|
|
{SIG_PLAY_DONE, ""},
|
|
|
|
{SIG_PLAY_PAUSE, ""},
|
|
|
|
{SIG_PLAY_RESUME, ""},
|
|
|
|
{SIG_PLAY_STOP, ""},
|
|
|
|
{NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
_sizing_eval(Eo *obj, void *data)
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
Efl_Ui_Vg_Animation_Data *pd = data;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
if (!efl_file_loaded_get(obj)) return;
|
|
|
|
|
|
|
|
double hw,hh;
|
|
|
|
efl_gfx_hint_weight_get(obj, &hw, &hh);
|
|
|
|
|
|
|
|
Eina_Size2D size = efl_canvas_vg_object_default_size_get(pd->vg);
|
|
|
|
|
|
|
|
Eina_Size2D min = {-1, -1};
|
2020-05-09 01:25:21 -07:00
|
|
|
if (EINA_DBL_EQ(hw, 0)) min.w = size.w;
|
|
|
|
if (EINA_DBL_EQ(hh, 0)) min.h = size.h;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
efl_gfx_hint_size_min_set(obj, min);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_size_hint_event_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
_sizing_eval(event->object, data);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_transit_go_facade(Eo* obj, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool playing = EINA_TRUE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->repeat_times = 0;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->playing_reverse)
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
else
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_START, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYING_CHANGED, &playing);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->transit) elm_transit_go(pd->transit);}
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_visible_check(Eo *obj)
|
|
|
|
{
|
|
|
|
if (!efl_gfx_entity_visible_get(obj)) return EINA_FALSE;
|
|
|
|
|
|
|
|
//TODO: Check Smart parents visibilities?
|
|
|
|
|
|
|
|
Eina_Size2D size = efl_gfx_entity_size_get(obj);
|
|
|
|
if (size.w == 0 || size.h == 0) return EINA_FALSE;
|
|
|
|
|
|
|
|
Evas_Coord output_w, output_h;
|
|
|
|
evas_output_size_get(evas_object_evas_get(obj), &output_w, &output_h);
|
|
|
|
|
|
|
|
Eina_Position2D pos = efl_gfx_entity_position_get(obj);
|
|
|
|
|
|
|
|
//Outside viewport
|
|
|
|
if ((pos.x + size.w < 0) || (pos.x > output_w) ||
|
|
|
|
(pos.y + size.h < 0) || (pos.y > output_h))
|
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
//Inside viewport
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_autoplay(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool vis)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (!pd->autoplay || !pd->transit) return;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
//Resume Animation
|
|
|
|
if (vis)
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED && pd->autoplay_pause)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool paused = EINA_FALSE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
elm_transit_paused_set(pd->transit, EINA_FALSE);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->playing_reverse)
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
else
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_RESUME, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PAUSED_CHANGED, &paused);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
//Pause Animation
|
|
|
|
else
|
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool paused = EINA_TRUE;
|
2019-12-31 06:53:16 -08:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING) ||
|
|
|
|
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS))
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
elm_transit_paused_set(pd->transit, EINA_TRUE);
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_TRUE;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PAUSED_CHANGED, &paused);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_transit_del_cb(Elm_Transit_Effect *effect, Elm_Transit *transit)
|
|
|
|
{
|
|
|
|
Eo *obj = (Eo *) effect;
|
2019-12-31 06:53:16 -08:00
|
|
|
EFL_UI_VG_ANIMATION_DATA_GET(obj, pd);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
if (!pd) return;
|
|
|
|
|
2020-05-09 01:25:21 -07:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && EINA_DBL_EQ(pd->progress, 1)) ||
|
|
|
|
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && EINA_DBL_EQ(pd->progress, 0)))
|
2020-01-15 06:24:07 -08:00
|
|
|
{
|
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_DONE, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYBACK_FINISHED, NULL);
|
|
|
|
}
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
if (pd->transit != transit) return;
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
Efl_Ui_Vg_Animation_State prev_state = pd->state;
|
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->transit = NULL;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
if (prev_state != EFL_UI_VG_ANIMATION_STATE_STOPPED)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool playing = EINA_FALSE;
|
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_STOP, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYING_CHANGED, &playing);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->progress = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|
|
|
{
|
|
|
|
Eo *obj = (Eo *) effect;
|
2019-12-31 06:53:16 -08:00
|
|
|
EFL_UI_VG_ANIMATION_DATA_GET(obj, pd);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
if (!pd || !pd->vg)
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
ERR("Vector Object is removed in wrong way!, Efl_Ui_Vg_Animation = %p", obj);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
elm_transit_del(transit);
|
|
|
|
return;
|
|
|
|
}
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->playback_direction_changed)
|
|
|
|
{
|
|
|
|
elm_transit_progress_value_set(pd->transit, 1 - progress);
|
|
|
|
progress = 1 - progress ;
|
|
|
|
|
|
|
|
if (pd->playback_speed <= 0) pd->playing_reverse = EINA_TRUE;
|
|
|
|
else pd->playing_reverse = EINA_FALSE;
|
|
|
|
|
|
|
|
pd->playback_direction_changed = EINA_FALSE;
|
|
|
|
}
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->playing_reverse)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
progress = 1 - progress;
|
|
|
|
}
|
2019-12-31 06:53:16 -08:00
|
|
|
else pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
pd->progress = progress;
|
|
|
|
int minframe = (pd->frame_cnt - 1) * pd->min_progress;
|
|
|
|
int maxframe = (pd->frame_cnt - 1) * pd->max_progress;
|
|
|
|
|
|
|
|
int update_frame = (int)((maxframe - minframe) * progress) + minframe;
|
|
|
|
int current_frame = evas_object_vg_animated_frame_get(pd->vg);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
|
2020-05-09 01:25:21 -07:00
|
|
|
if (EINA_DBL_EQ(pd->playback_speed, 0))
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
update_frame = current_frame;
|
|
|
|
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
evas_object_vg_animated_frame_set(pd->vg, update_frame);
|
|
|
|
|
2020-01-28 07:36:33 -08:00
|
|
|
if (pd->loop)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
int repeat_times = elm_transit_current_repeat_times_get(pd->transit);
|
|
|
|
if (pd->repeat_times != repeat_times)
|
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_REPEAT, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYBACK_REPEATED, &repeat_times);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->repeat_times = repeat_times;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//transit_cb is always called with a progress value 0 ~ 1.
|
|
|
|
//SIG_PLAY_UPDATE callback is called only when there is a real change.
|
2020-01-15 06:24:07 -08:00
|
|
|
if (update_frame == current_frame) return;
|
|
|
|
if (elm_widget_is_legacy(obj))
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_UPDATE, NULL);
|
2020-01-15 06:24:07 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
double position = pd->frame_duration * pd->progress;
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYBACK_POSITION_CHANGED, &position);
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYBACK_PROGRESS_CHANGED, &pd->progress);
|
|
|
|
}
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Vg_Animation_Data *priv)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
|
|
|
elm_widget_sub_object_parent_add(obj);
|
|
|
|
|
|
|
|
// Create vg to render vector animation
|
|
|
|
Eo *vg = evas_object_vg_add(evas_object_evas_get(obj));
|
|
|
|
elm_widget_resize_object_set(obj, vg);
|
|
|
|
efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_hint_event_cb, priv);
|
|
|
|
|
|
|
|
priv->vg = vg;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
priv->playback_speed = 1;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
priv->frame_duration = 0;
|
|
|
|
priv->min_progress = 0.0;
|
|
|
|
priv->max_progress = 1.0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
if (pd->transit)
|
|
|
|
{
|
|
|
|
Elm_Transit *transit = pd->transit;
|
|
|
|
pd->transit = NULL; //Skip perform transit_del_cb()
|
|
|
|
elm_transit_del(transit);
|
|
|
|
}
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_NOT_READY;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_object_destructor(Eo *obj,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2019-10-01 21:21:35 -07:00
|
|
|
Efl_Gfx_Vg_Value_Provider *vp;
|
|
|
|
EINA_LIST_FREE(pd->vp_list, vp)
|
|
|
|
efl_unref(vp);
|
|
|
|
eina_list_free(pd->vp_list);
|
|
|
|
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eo *
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_object_constructor(Eo *obj,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
|
|
|
evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_update_frame_duration(Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
|
|
|
int min_frame = (frame_count - 1) * pd->min_progress;
|
|
|
|
int max_frame = (frame_count - 1) * pd->max_progress;
|
|
|
|
double frame_rate = round((double)frame_count / evas_object_vg_animated_frame_duration_get(pd->vg, 0, 0));
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
pd->frame_duration = (double)(max_frame - min_frame) / frame_rate;
|
|
|
|
if (pd->transit)
|
2020-05-09 01:25:21 -07:00
|
|
|
elm_transit_duration_set(pd->transit, EINA_DBL_NONZERO(speed) ? pd->frame_duration * (1 / speed) : 0);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_ready_play(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
if (pd->transit) elm_transit_del(pd->transit);
|
|
|
|
|
|
|
|
pd->frame_cnt = (double) evas_object_vg_animated_frame_count_get(pd->vg);
|
|
|
|
pd->frame_duration = evas_object_vg_animated_frame_duration_get(pd->vg, 0, 0);
|
|
|
|
evas_object_vg_animated_frame_set(pd->vg, 0);
|
|
|
|
if (pd->frame_duration > 0)
|
|
|
|
{
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
double speed = pd->playback_speed < 0 ? pd->playback_speed * -1 : pd->playback_speed;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
Elm_Transit *transit = elm_transit_add();
|
2020-03-24 03:11:26 -07:00
|
|
|
elm_transit_object_add(transit, obj);
|
2020-01-28 07:36:33 -08:00
|
|
|
if (pd->loop) elm_transit_repeat_times_set(transit, -1);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
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);
|
2020-03-24 03:11:26 -07:00
|
|
|
elm_transit_event_enabled_set(transit, EINA_TRUE);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->transit = transit;
|
2020-05-09 01:25:21 -07:00
|
|
|
if (EINA_DBL_NONZERO(pd->min_progress) || !EINA_DBL_EQ(pd->max_progress, 1.0))
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
_update_frame_duration(pd);
|
|
|
|
else
|
2020-05-09 01:25:21 -07:00
|
|
|
elm_transit_duration_set(transit, EINA_DBL_NONZERO(speed) ? pd->frame_duration * (1 / speed) : 0);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_NOT_READY;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
pd->frame_cnt = 0;
|
|
|
|
pd->frame_duration = 0;
|
|
|
|
if (pd->transit) elm_transit_del(pd->transit);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Error
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_file_load(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
Eina_Error err;
|
|
|
|
Eina_Bool ret;
|
|
|
|
const char *file;
|
|
|
|
const char *key;
|
|
|
|
|
|
|
|
if (efl_file_loaded_get(obj)) return 0;
|
|
|
|
|
|
|
|
err = efl_file_load(efl_super(obj, MY_CLASS));
|
|
|
|
if (err) return err;
|
|
|
|
|
|
|
|
file = efl_file_get(obj);
|
|
|
|
key = efl_file_key_get(obj);
|
|
|
|
ret = efl_file_simple_load(pd->vg, file, key);
|
|
|
|
if (!ret)
|
|
|
|
{
|
|
|
|
efl_file_unload(obj);
|
|
|
|
return eina_error_get();
|
|
|
|
}
|
|
|
|
|
|
|
|
pd->progress = 0;
|
|
|
|
|
|
|
|
_sizing_eval(obj, pd);
|
|
|
|
|
|
|
|
if (!_ready_play(obj, pd)) return 1;
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (pd->autoplay)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
_transit_go_facade(obj, pd);
|
|
|
|
|
|
|
|
if (!_visible_check(obj))
|
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool paused = EINA_TRUE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
elm_transit_paused_set(pd->transit, EINA_TRUE);
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_TRUE;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PAUSED_CHANGED, &paused);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_gfx_entity_position_set(Eo *obj,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd,
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
Eina_Position2D pos EINA_UNUSED)
|
|
|
|
{
|
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
|
|
|
|
return;
|
|
|
|
|
|
|
|
efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
_autoplay(obj, pd, _visible_check(obj));
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_gfx_entity_size_set(Eo *obj,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd,
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
Eina_Size2D size)
|
|
|
|
{
|
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
|
|
|
|
return;
|
|
|
|
|
|
|
|
efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), size);
|
|
|
|
|
|
|
|
_sizing_eval(obj, pd);
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
_autoplay(obj, pd, _visible_check(obj));
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_gfx_entity_visible_set(Eo *obj,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd,
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
Eina_Bool vis)
|
|
|
|
{
|
|
|
|
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
|
|
|
|
return;
|
|
|
|
|
|
|
|
efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis);
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
_autoplay(obj, pd, _visible_check(obj));
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd,
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
Eina_Size2D size)
|
|
|
|
{
|
|
|
|
Eina_Rect viewbox;
|
|
|
|
viewbox.x = viewbox.y =0;
|
|
|
|
viewbox.w = size.w;
|
|
|
|
viewbox.h = size.h;
|
|
|
|
|
|
|
|
efl_canvas_vg_object_viewbox_set(pd->vg, viewbox);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN Eina_Size2D
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
Eina_Rect viewbox = efl_canvas_vg_object_viewbox_get(pd->vg);
|
|
|
|
|
|
|
|
return EINA_SIZE2D(viewbox.w, viewbox.h);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2020-01-28 07:36:33 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_loop_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool loop)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-28 07:36:33 -08:00
|
|
|
if (pd->loop == loop) return;
|
|
|
|
pd->loop = loop;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
if (pd->transit)
|
|
|
|
{
|
2020-01-28 07:36:33 -08:00
|
|
|
if (loop) elm_transit_repeat_times_set(pd->transit, -1);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
else elm_transit_repeat_times_set(pd->transit, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2020-01-28 07:36:33 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_loop_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-28 07:36:33 -08:00
|
|
|
return pd->loop;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2020-01-28 07:36:33 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd,
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
Eina_Bool autoplay)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay = autoplay;
|
|
|
|
if (!autoplay) pd->autoplay_pause = EINA_FALSE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2020-01-28 07:36:33 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
return pd->autoplay;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
Eina_Bool _efl_ui_vg_animation_playing_sector(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, const char *start, const char *end)
|
Efl.Ui.Animation_View: Implement sector playing feature
Summary:
play_sector method is API for playing section.
If the animation object has section information, user can play the section.
Get the start and end section name and get the frame of each section.
And set and play the min and max frames of the current animation object.
Depends on D10506
Test Plan:
For example. Animation objects have "first","second" and "third" sectors.
And sector "second" has duration information.
User can use it like this:
efl_ui_animation_view_play_sector(anim_view, "first", "second");
efl_ui_animation_view_play_sector(anim_view, "second", NULL);
efl_ui_animation_view_play_sector(anim_view, "first", NULL); // first sector ~ end frame of animation object.
efl_ui_animation_view_play_sector(anim_view, "second", "third");
efl_ui_animation_view_play_sector(anim_view, "second", "wrong name");
Reviewers: Hermet, smohanty, kimcinoo
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10507
2019-11-11 21:30:25 -08:00
|
|
|
{
|
|
|
|
int start_frame = 0;
|
|
|
|
int end_frame = evas_object_vg_animated_frame_count_get(pd->vg) - 1;
|
|
|
|
|
|
|
|
if (start && end)
|
|
|
|
{
|
|
|
|
efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, NULL);
|
|
|
|
efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (start)
|
|
|
|
{
|
|
|
|
efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, &end_frame);
|
|
|
|
}
|
|
|
|
else if (end)
|
|
|
|
{
|
|
|
|
efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
efl_ui_vg_animation_min_frame_set(obj, start_frame);
|
Efl.Ui.Animation_View: Implement sector playing feature
Summary:
play_sector method is API for playing section.
If the animation object has section information, user can play the section.
Get the start and end section name and get the frame of each section.
And set and play the min and max frames of the current animation object.
Depends on D10506
Test Plan:
For example. Animation objects have "first","second" and "third" sectors.
And sector "second" has duration information.
User can use it like this:
efl_ui_animation_view_play_sector(anim_view, "first", "second");
efl_ui_animation_view_play_sector(anim_view, "second", NULL);
efl_ui_animation_view_play_sector(anim_view, "first", NULL); // first sector ~ end frame of animation object.
efl_ui_animation_view_play_sector(anim_view, "second", "third");
efl_ui_animation_view_play_sector(anim_view, "second", "wrong name");
Reviewers: Hermet, smohanty, kimcinoo
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10507
2019-11-11 21:30:25 -08:00
|
|
|
if (start_frame < end_frame)
|
2019-12-31 06:53:16 -08:00
|
|
|
efl_ui_vg_animation_max_frame_set(obj, end_frame);
|
Efl.Ui.Animation_View: Implement sector playing feature
Summary:
play_sector method is API for playing section.
If the animation object has section information, user can play the section.
Get the start and end section name and get the frame of each section.
And set and play the min and max frames of the current animation object.
Depends on D10506
Test Plan:
For example. Animation objects have "first","second" and "third" sectors.
And sector "second" has duration information.
User can use it like this:
efl_ui_animation_view_play_sector(anim_view, "first", "second");
efl_ui_animation_view_play_sector(anim_view, "second", NULL);
efl_ui_animation_view_play_sector(anim_view, "first", NULL); // first sector ~ end frame of animation object.
efl_ui_animation_view_play_sector(anim_view, "second", "third");
efl_ui_animation_view_play_sector(anim_view, "second", "wrong name");
Reviewers: Hermet, smohanty, kimcinoo
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10507
2019-11-11 21:30:25 -08:00
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (!efl_player_playing_set(obj, EINA_TRUE))
|
Efl.Ui.Animation_View: Implement sector playing feature
Summary:
play_sector method is API for playing section.
If the animation object has section information, user can play the section.
Get the start and end section name and get the frame of each section.
And set and play the min and max frames of the current animation object.
Depends on D10506
Test Plan:
For example. Animation objects have "first","second" and "third" sectors.
And sector "second" has duration information.
User can use it like this:
efl_ui_animation_view_play_sector(anim_view, "first", "second");
efl_ui_animation_view_play_sector(anim_view, "second", NULL);
efl_ui_animation_view_play_sector(anim_view, "first", NULL); // first sector ~ end frame of animation object.
efl_ui_animation_view_play_sector(anim_view, "second", "third");
efl_ui_animation_view_play_sector(anim_view, "second", "wrong name");
Reviewers: Hermet, smohanty, kimcinoo
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10507
2019-11-11 21:30:25 -08:00
|
|
|
return EINA_FALSE;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_playing_stop(Eo* obj, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
Eina_Bool playing = EINA_FALSE;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
if (!pd->transit) return EINA_FALSE;
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_NOT_READY) ||
|
|
|
|
(pd->state == EFL_UI_VG_ANIMATION_STATE_STOPPED))
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
evas_object_vg_animated_frame_set(pd->vg, 0);
|
|
|
|
pd->progress = 0;
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_STOP, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PLAYING_CHANGED, &playing);
|
|
|
|
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
elm_transit_del(pd->transit);
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int frame_num)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
2019-12-31 06:53:10 -08:00
|
|
|
efl_player_playback_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1));
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
double progress = (pd->progress * (pd->max_progress - pd->min_progress)) + pd->min_progress;
|
|
|
|
return (int) ((double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1) * progress);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Size2D
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_default_view_size_get(const Eo *obj EINA_UNUSED,
|
|
|
|
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return efl_canvas_vg_object_default_size_get(pd->vg);
|
|
|
|
}
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
EOLIAN static Efl_Ui_Vg_Animation_State
|
|
|
|
_efl_ui_vg_animation_state_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return pd->state;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_frame_count_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return efl_gfx_frame_controller_frame_count_get(pd->vg);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_min_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double min_progress)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
if (min_progress < 0.0 || min_progress > 1.0 || min_progress > pd->max_progress) return;
|
|
|
|
|
|
|
|
pd->min_progress = min_progress;
|
|
|
|
_update_frame_duration(pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_min_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return pd->min_progress;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_max_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double max_progress)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
if (max_progress < 0.0 || max_progress > 1.0 || max_progress < pd->min_progress) return;
|
|
|
|
|
|
|
|
pd->max_progress = max_progress;
|
|
|
|
_update_frame_duration(pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_max_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return pd->max_progress;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_min_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int min_frame)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
|
|
|
if (min_frame < 0) min_frame = 0;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int max_frame = (frame_count - 1) * pd->max_progress;
|
|
|
|
if (min_frame > max_frame) min_frame = max_frame;
|
|
|
|
}
|
|
|
|
|
|
|
|
pd->min_progress = (double)min_frame / (double)(frame_count - 1);
|
|
|
|
_update_frame_duration(pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_min_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return pd->min_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_max_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int max_frame)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
|
|
|
if (max_frame > frame_count - 1) max_frame = frame_count - 1;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
int min_frame = (frame_count - 1) * pd->min_progress;
|
|
|
|
if (min_frame > max_frame) max_frame = min_frame;
|
|
|
|
}
|
|
|
|
|
|
|
|
pd->max_progress = (double)max_frame / (double)(frame_count - 1);
|
|
|
|
_update_frame_duration(pd);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static int
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_max_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
{
|
|
|
|
return pd->max_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1);
|
|
|
|
}
|
|
|
|
|
2019-10-01 21:21:35 -07:00
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Efl_Gfx_Vg_Value_Provider *value_provider)
|
2019-10-01 21:21:35 -07:00
|
|
|
{
|
|
|
|
if (!value_provider) return;
|
|
|
|
|
|
|
|
if (pd->vp_list)
|
|
|
|
{
|
|
|
|
const char *keypath1 = efl_gfx_vg_value_provider_keypath_get(value_provider);
|
|
|
|
if (!keypath1)
|
|
|
|
{
|
|
|
|
ERR("Couldn't override Value Provider(%p). Keypath is NULL.", value_provider);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const Eina_List *l;
|
|
|
|
Efl_Gfx_Vg_Value_Provider *_vp;
|
|
|
|
EINA_LIST_FOREACH(pd->vp_list, l, _vp)
|
|
|
|
{
|
|
|
|
const char *keypath2 = efl_gfx_vg_value_provider_keypath_get(_vp);
|
|
|
|
if (!strcmp(keypath1, keypath2))
|
|
|
|
{
|
|
|
|
pd->vp_list = eina_list_remove(pd->vp_list, _vp);
|
|
|
|
efl_unref(_vp);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
efl_ref(value_provider);
|
|
|
|
pd->vp_list = eina_list_append(pd->vp_list, value_provider);
|
vg_common_json: Override value_provider list
Summary:
If value_provider is applied to Efl.Ui.Animation_View, it is passed as vector object.
The passed value_provider list passes to Vg_File_Data.
If there is a value_Provider list in Vg_File_Data,
it apply the property to Lottie_Animation using lottie_animation_property_override api.
Depends on D9874
Test Plan:
...
Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p);
efl_gfx_vg_value_provider_keypath_set(vp, "**");
efl_gfx_vg_value_provider_fill_color_set(vp, 100, 0 ,0 ,255);
efl_ui_animation_view_value_provider_override(anim_view, vp);
vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, p);
efl_gfx_vg_value_provider_keypath_set(vp, "**");
efl_gfx_vg_value_provider_stroke_width_set(vp, 50.0);
efl_gfx_vg_value_provider_stroke_color_set(vp, 0, 255, 0, 100);
efl_ui_animation_view_value_provider_override(anim_view, vp);
...
Reviewers: Hermet, kimcinoo, smohanty
Reviewed By: Hermet
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9897
2019-10-01 22:30:06 -07:00
|
|
|
efl_key_data_set(pd->vg, "_vg_value_providers", pd->vp_list);
|
2019-10-01 21:21:35 -07:00
|
|
|
}
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
EOLIAN static Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playing_set(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool playing)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
if (playing)
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && pd->playback_speed > 0)
|
|
|
|
|| (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && pd->playback_speed <= 0))
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
return EINA_FALSE;
|
|
|
|
|
|
|
|
Eina_Bool rewind = EINA_FALSE;
|
2019-12-31 06:53:16 -08:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && pd->playback_speed <= 0)
|
|
|
|
|| (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && pd->playback_speed > 0))
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
rewind = EINA_TRUE;
|
|
|
|
|
|
|
|
if (pd->playback_speed <= 0)
|
|
|
|
pd->playing_reverse = EINA_TRUE;
|
|
|
|
else
|
|
|
|
pd->playing_reverse = EINA_FALSE;
|
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
|
|
|
|
|
|
|
|
|
|
|
if (!efl_file_loaded_get(obj)) return EINA_FALSE;
|
|
|
|
if (!pd->transit && !_ready_play(obj, pd)) return EINA_FALSE;
|
|
|
|
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
if (pd->state == EFL_UI_VG_ANIMATION_STATE_STOPPED)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
2020-05-09 01:25:21 -07:00
|
|
|
if (pd->playing_reverse && EINA_DBL_EQ(pd->progress, 0)) pd->progress = 1.0;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
_transit_go_facade(obj, pd);
|
|
|
|
}
|
|
|
|
else if (rewind)
|
|
|
|
{
|
|
|
|
elm_transit_progress_value_set(pd->transit, pd->playing_reverse ? 1 - pd->progress : pd->progress);
|
|
|
|
pd->playback_direction_changed = EINA_FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return _playing_stop(obj, pd);
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playing_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_paused_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool paused)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
2020-01-15 06:24:07 -08:00
|
|
|
paused = !!paused;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
if (paused)
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING) ||
|
|
|
|
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS))
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
elm_transit_paused_set(pd->transit, paused);
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PAUSED_CHANGED, &paused);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if (pd->transit && pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
elm_transit_paused_set(pd->transit, paused);
|
|
|
|
if (pd->playing_reverse)
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
else
|
2019-12-31 06:53:16 -08:00
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
pd->autoplay_pause = EINA_FALSE;
|
2020-01-15 06:24:07 -08:00
|
|
|
if (elm_widget_is_legacy(obj))
|
|
|
|
evas_object_smart_callback_call(obj, SIG_PLAY_RESUME, NULL);
|
|
|
|
else
|
|
|
|
efl_event_callback_call(obj, EFL_PLAYER_EVENT_PAUSED_CHANGED, &paused);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
return EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_position_set(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, double sec)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(sec < 0);
|
|
|
|
EINA_SAFETY_ON_TRUE_RETURN(sec > pd->frame_duration);
|
|
|
|
|
2020-05-09 01:25:21 -07:00
|
|
|
efl_player_playback_progress_set(obj, EINA_DBL_NONZERO(pd->frame_duration) ? sec / pd->frame_duration : 0);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
return pd->frame_duration * pd->progress;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
return pd->progress;
|
|
|
|
}
|
|
|
|
|
2019-12-31 06:53:10 -08:00
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double progress)
|
2019-12-31 06:53:10 -08:00
|
|
|
{
|
|
|
|
if (progress < 0) progress = 0;
|
|
|
|
else if (progress > 1) progress = 1;
|
2020-05-09 01:25:21 -07:00
|
|
|
if (EINA_DBL_EQ(pd->progress, progress)) return;
|
2019-12-31 06:53:10 -08:00
|
|
|
|
|
|
|
pd->progress = progress;
|
|
|
|
|
|
|
|
if (pd->frame_cnt > 0)
|
|
|
|
evas_object_vg_animated_frame_set(pd->vg, (int) ((pd->frame_cnt - 1) * progress));
|
|
|
|
|
|
|
|
if (pd->transit)
|
|
|
|
{
|
|
|
|
if (pd->playing_reverse)
|
|
|
|
elm_transit_progress_value_set(pd->transit, 1 - progress);
|
|
|
|
else
|
|
|
|
elm_transit_progress_value_set(pd->transit, progress);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
EOLIAN static void
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double speed)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
2020-01-06 22:52:06 -08:00
|
|
|
Eina_Bool rewind = EINA_FALSE;
|
|
|
|
|
|
|
|
if ((pd->playback_speed > 0 && speed < 0) || (pd->playback_speed < 0 && speed > 0))
|
|
|
|
rewind = EINA_TRUE;
|
|
|
|
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
// pd->playback_direction_changed is used only during playback.
|
2020-01-06 22:52:06 -08:00
|
|
|
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && rewind)
|
|
|
|
{
|
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
|
|
|
pd->playback_direction_changed = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && rewind)
|
|
|
|
{
|
|
|
|
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
|
|
|
pd->playback_direction_changed = EINA_TRUE;
|
|
|
|
}
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
|
|
|
|
pd->playback_speed = speed;
|
|
|
|
speed = speed < 0 ? speed * -1 : speed;
|
|
|
|
if (pd->transit)
|
2020-05-09 01:25:21 -07:00
|
|
|
elm_transit_duration_set(pd->transit, EINA_DBL_NONZERO(pd->playback_speed) ? pd->frame_duration * (1 / speed) : 0);
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static double
|
2019-12-31 06:53:16 -08:00
|
|
|
_efl_ui_vg_animation_efl_player_playback_speed_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
Efl.Ui.Animation_View: Implements Efl.Player interface
Summary:
Chnaged API
.speed.set => Efl.Player.playback_speed.set
.speed.get => Efl.Player.playback_speed.get
.progress.get => Efl.Player.playback_progress.get
.play => Efl.Player.playing.set(true)
.stop => Efl.Player.playing.set(false)
.pause => Efl.Player.paused.set(true)
.resume => Efl.Player.paused.set(false)
.play_sector => .playing_sector
.auto_play => .autoplay
.auto_repeat => .autorepeat
Remove API
.is_playing_back
.playback => (use negative speed value)
New feature API
Efl.Player.playback_position.set
Efl.Player.playback_position.get
Efl.Player.playing.get
Efl.Player.paused.get
ref T8476
Test Plan:
meson_option.txt -> remove json in evas-loaders-disabler option
elementary_test -to "animation view"
Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike
Reviewed By: segfaultxavi, zmike
Subscribers: zmike, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8476
Differential Revision: https://phab.enlightenment.org/D10862
2019-12-31 06:52:56 -08:00
|
|
|
{
|
|
|
|
return pd->playback_speed;
|
|
|
|
}
|
|
|
|
|
2019-12-31 06:53:23 -08:00
|
|
|
EOLIAN static double
|
|
|
|
_efl_ui_vg_animation_efl_playable_length_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
|
|
|
{
|
|
|
|
return pd->frame_duration;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_vg_animation_efl_playable_playable_get(const Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
if (!efl_file_loaded_get(obj)) return EINA_FALSE;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eina_Bool
|
|
|
|
_efl_ui_vg_animation_efl_playable_seekable_get(const Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
if (!efl_file_loaded_get(obj)) return EINA_FALSE;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2020-01-15 06:23:59 -08:00
|
|
|
#define MY_CLASS_NAME_LEGACY "elm_animation_view"
|
|
|
|
|
|
|
|
static void
|
|
|
|
_efl_ui_vg_animation_legacy_class_constructor(Efl_Class *klass)
|
|
|
|
{
|
|
|
|
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Eo *
|
|
|
|
_efl_ui_vg_animation_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
obj = efl_constructor(efl_super(obj, EFL_UI_VG_ANIMATION_LEGACY_CLASS));
|
|
|
|
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
EAPI Elm_Animation_View*
|
|
|
|
elm_animation_view_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
2020-01-15 06:23:59 -08:00
|
|
|
return elm_legacy_add(EFL_UI_VG_ANIMATION_LEGACY_CLASS, parent);
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Eina_Bool
|
|
|
|
elm_animation_view_file_set(Elm_Animation_View *obj, const char *file, const char *key)
|
|
|
|
{
|
|
|
|
return efl_file_simple_load(obj, file, key);
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI Elm_Animation_View_State
|
|
|
|
elm_animation_view_state_get(Elm_Animation_View *obj)
|
|
|
|
{
|
2019-12-31 06:53:03 -08:00
|
|
|
Elm_Animation_View_State state = ELM_ANIMATION_VIEW_STATE_NOT_READY;
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
switch (efl_ui_vg_animation_state_get(obj))
|
2019-12-31 06:53:03 -08:00
|
|
|
{
|
2019-12-31 06:53:16 -08:00
|
|
|
case EFL_UI_VG_ANIMATION_STATE_PLAYING:
|
2019-12-31 06:53:03 -08:00
|
|
|
state = ELM_ANIMATION_VIEW_STATE_PLAY;
|
|
|
|
break;
|
2019-12-31 06:53:16 -08:00
|
|
|
case EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS:
|
2019-12-31 06:53:03 -08:00
|
|
|
state = ELM_ANIMATION_VIEW_STATE_PLAY_BACK;
|
|
|
|
break;
|
2019-12-31 06:53:16 -08:00
|
|
|
case EFL_UI_VG_ANIMATION_STATE_PAUSED:
|
2019-12-31 06:53:03 -08:00
|
|
|
state = ELM_ANIMATION_VIEW_STATE_PAUSE;
|
|
|
|
break;
|
2019-12-31 06:53:16 -08:00
|
|
|
case EFL_UI_VG_ANIMATION_STATE_STOPPED:
|
2019-12-31 06:53:03 -08:00
|
|
|
state = ELM_ANIMATION_VIEW_STATE_STOP;
|
|
|
|
break;
|
2019-12-31 06:53:16 -08:00
|
|
|
case EFL_UI_VG_ANIMATION_STATE_NOT_READY:
|
2019-12-31 06:53:03 -08:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return state;
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
#define EFL_UI_VG_ANIMATION_EXTRA_OPS \
|
|
|
|
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_vg_animation)
|
efl_ui_animation_view: introduce a new widget for controlling vector animation.
Summary:
This is a new convenient ui control that designed to load vector resources
-svg, json-, and control animations if it supports.
Please turn on evas-loaders-json in meson options,
if you'd like to use Lottie Animation.
Co-authored-by: JunsuChoi <jsuya.choi@samsung.com>
@feature
Reviewers: #committers, jsuya, zmike, bu5hm4n
Reviewed By: #committers, bu5hm4n
Subscribers: zmike, bu5hm4n, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9451
2019-08-21 01:39:43 -07:00
|
|
|
|
2019-12-31 06:53:16 -08:00
|
|
|
#include "efl_ui_vg_animation_eo.legacy.c"
|
|
|
|
#include "efl_ui_vg_animation.eo.c"
|