forked from enlightenment/efl
Efl.Ui.Animation_View : Change class name to Efl.Ui.Vg_Animation
Summary: Since "View" is a reserved word for MVVM, change the class name appropriately. Efl.Ui.Animation_View => Efl.Ui.Vg_Animation ref T8476 Depends on D10931 Test Plan: elementary_test -> "Vector Graphcis Animation" Reviewers: Hermet, bu5hm4n, kimcinoo, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8476 Differential Revision: https://phab.enlightenment.org/D10939
This commit is contained in:
parent
3dc3deba62
commit
43288c7ace
|
@ -161,7 +161,7 @@ elementary_test_src = [
|
|||
'test_ui_collection_view.c',
|
||||
'test_ui_items.c',
|
||||
'test_ui_frame.c',
|
||||
'test_efl_ui_animation_view.c',
|
||||
'test_efl_ui_vg_animation.c',
|
||||
'test_efl_gfx_vg_value_provider.c',
|
||||
'test.h'
|
||||
]
|
||||
|
|
|
@ -407,7 +407,7 @@ void test_efl_ui_collection_view(void *data, Evas_Object *obj, void *event_info)
|
|||
void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info);
|
||||
void test_ui_frame(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED);
|
||||
|
||||
void test_efl_ui_animation_view(void *data, Evas_Object *obj, void *event_info);
|
||||
void test_efl_ui_vg_animation(void *data, Evas_Object *obj, void *event_info);
|
||||
void test_efl_gfx_vg_value_provider(void *data, Evas_Object *obj, void *event_info);
|
||||
|
||||
static void _list_udpate(void);
|
||||
|
@ -1305,7 +1305,7 @@ add_tests:
|
|||
ADD_TEST_EO(NULL, "Widgets Part", "Part Shadow", test_part_shadow);
|
||||
|
||||
//------------------------------//
|
||||
ADD_TEST_EO(NULL, "Vector Animation", "Animation View", test_efl_ui_animation_view);
|
||||
ADD_TEST_EO(NULL, "Vector Animation", "Vector Graphics Animation", test_efl_ui_vg_animation);
|
||||
ADD_TEST_EO(NULL, "Vector Animation", "Value Provider", test_efl_gfx_vg_value_provider);
|
||||
|
||||
#undef ADD_TEST
|
||||
|
|
|
@ -51,7 +51,7 @@ add_value_provider(char* new_path, char* new_type, char* new_values)
|
|||
}
|
||||
|
||||
|
||||
efl_ui_animation_view_value_provider_override(anim_view, vp);
|
||||
efl_ui_vg_animation_value_provider_override(anim_view, vp);
|
||||
}
|
||||
if (!strcmp(type, "StrokeWidth"))
|
||||
{
|
||||
|
@ -61,7 +61,7 @@ add_value_provider(char* new_path, char* new_type, char* new_values)
|
|||
char* v = (char*)efl_text_get(values[0]);
|
||||
if (v) width = strtod(v, NULL);
|
||||
efl_gfx_vg_value_provider_stroke_width_set(vp, width);
|
||||
efl_ui_animation_view_value_provider_override(anim_view, vp);
|
||||
efl_ui_vg_animation_value_provider_override(anim_view, vp);
|
||||
evas_object_show(anim_view);
|
||||
sprintf(new_path, "%s", path);
|
||||
sprintf(new_type, "StrokeWidth");
|
||||
|
@ -104,7 +104,7 @@ btn_clicked_cb(void *data , const Efl_Event *ev )
|
|||
{
|
||||
char buf[255];
|
||||
//TODO: Even if there is the same path as the existing item, it is added without updating.
|
||||
// In efl_ui_animation_view, duplicate paths are managed.
|
||||
// In efl_ui_vg_animation, duplicate paths are managed.
|
||||
// However, animator (lottie) does not have an implementation that manages overridden values.
|
||||
/*Eina_List *items = (Eina_List*)elm_list_items_get(list);
|
||||
Eina_List *l;
|
||||
|
@ -153,7 +153,7 @@ static void
|
|||
check_changed_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
efl_ui_animation_view_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -169,18 +169,18 @@ static void
|
|||
limit_frame_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
int frame_count = efl_ui_animation_view_frame_count_get(anim_view);
|
||||
int frame_count = efl_ui_vg_animation_frame_count_get(anim_view);
|
||||
printf("Total Frame Count : %d\n", frame_count);
|
||||
if (efl_ui_selectable_selected_get(event->object))
|
||||
{
|
||||
efl_ui_animation_view_min_frame_set(anim_view, 5);
|
||||
efl_ui_animation_view_max_frame_set(anim_view, 10);
|
||||
efl_ui_vg_animation_min_frame_set(anim_view, 5);
|
||||
efl_ui_vg_animation_max_frame_set(anim_view, 10);
|
||||
printf("Frames to show 5-10 only\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
efl_ui_animation_view_min_frame_set(anim_view, 0);
|
||||
efl_ui_animation_view_max_frame_set(anim_view, frame_count);
|
||||
efl_ui_vg_animation_min_frame_set(anim_view, 0);
|
||||
efl_ui_vg_animation_max_frame_set(anim_view, frame_count);
|
||||
printf("Showing all frames now\n");
|
||||
}
|
||||
}
|
||||
|
@ -188,24 +188,24 @@ limit_frame_cb(void *data, const Efl_Event *event)
|
|||
static void
|
||||
update_anim_view_state(Evas_Object *anim_view, Evas_Object *label)
|
||||
{
|
||||
Efl_Ui_Animation_View_State state = efl_ui_animation_view_state_get(anim_view);
|
||||
Efl_Ui_Vg_Animation_State state = efl_ui_vg_animation_state_get(anim_view);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_NOT_READY:
|
||||
case EFL_UI_VG_ANIMATION_STATE_NOT_READY:
|
||||
efl_text_set(label, "State = Not Ready");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING:
|
||||
efl_text_set(label, "State = Playing");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS:
|
||||
efl_text_set(label, "State = Playing Backwards");
|
||||
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PAUSED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PAUSED:
|
||||
efl_text_set(label, "State = Paused");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_STOPPED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_STOPPED:
|
||||
efl_text_set(label, "State = Stopped");
|
||||
break;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
|
|||
|
||||
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
||||
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
|
||||
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
|
||||
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
|
||||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
|
||||
// Create a box in Canvas
|
||||
|
@ -326,7 +326,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
|
|||
|
||||
//Create Animation View to play animation directly from JSON file
|
||||
snprintf(buf, sizeof(buf), "%s/images/three_box.json", elm_app_data_dir_get());
|
||||
anim_view = efl_add(EFL_UI_ANIMATION_VIEW_CLASS, win,
|
||||
anim_view = efl_add(EFL_UI_VG_ANIMATION_CLASS, win,
|
||||
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
|
||||
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
|
||||
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
|
||||
|
@ -487,7 +487,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
|
|||
|
||||
|
||||
//Duration Text
|
||||
snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_animation_view_duration_time_get(anim_view));
|
||||
snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_vg_animation_duration_time_get(anim_view));
|
||||
efl_add(EFL_UI_TEXTBOX_CLASS, box_sub,
|
||||
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
|
||||
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
|
||||
|
@ -584,7 +584,7 @@ test_efl_gfx_vg_value_provider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNU
|
|||
|
||||
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
||||
efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC),
|
||||
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
|
||||
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
|
||||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
|
||||
// Create a box
|
||||
|
|
|
@ -46,7 +46,7 @@ static void
|
|||
check_changed_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
efl_ui_animation_view_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
efl_ui_vg_animation_autorepeat_set(anim_view, efl_ui_selectable_selected_get(event->object));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -62,18 +62,18 @@ static void
|
|||
limit_frame_cb(void *data, const Efl_Event *event)
|
||||
{
|
||||
Evas_Object *anim_view = data;
|
||||
int frame_count = efl_ui_animation_view_frame_count_get(anim_view);
|
||||
int frame_count = efl_ui_vg_animation_frame_count_get(anim_view);
|
||||
printf("Total Frame Count : %d\n", frame_count);
|
||||
if (efl_ui_selectable_selected_get(event->object))
|
||||
{
|
||||
efl_ui_animation_view_min_frame_set(anim_view, 5);
|
||||
efl_ui_animation_view_max_frame_set(anim_view, 10);
|
||||
efl_ui_vg_animation_min_frame_set(anim_view, 5);
|
||||
efl_ui_vg_animation_max_frame_set(anim_view, 10);
|
||||
printf("Frames to show 5-10 only\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
efl_ui_animation_view_min_frame_set(anim_view, 0);
|
||||
efl_ui_animation_view_max_frame_set(anim_view, frame_count);
|
||||
efl_ui_vg_animation_min_frame_set(anim_view, 0);
|
||||
efl_ui_vg_animation_max_frame_set(anim_view, frame_count);
|
||||
printf("Showing all frames now\n");
|
||||
}
|
||||
}
|
||||
|
@ -81,23 +81,23 @@ limit_frame_cb(void *data, const Efl_Event *event)
|
|||
static void
|
||||
update_anim_view_state(Evas_Object *anim_view, Evas_Object *label)
|
||||
{
|
||||
Efl_Ui_Animation_View_State state = efl_ui_animation_view_state_get(anim_view);
|
||||
Efl_Ui_Vg_Animation_State state = efl_ui_vg_animation_state_get(anim_view);
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_NOT_READY:
|
||||
case EFL_UI_VG_ANIMATION_STATE_NOT_READY:
|
||||
efl_text_set(label, "State = Not Ready");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING:
|
||||
efl_text_set(label, "State = Playing");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS:
|
||||
efl_text_set(label, "State = Playing Backwards");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PAUSED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PAUSED:
|
||||
efl_text_set(label, "State = Paused");
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_STOPPED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_STOPPED:
|
||||
efl_text_set(label, "State = Stopped");
|
||||
break;
|
||||
}
|
||||
|
@ -144,13 +144,13 @@ _slider_reset(void *data, Evas_Object *obj EINA_UNUSED, void *ev EINA_UNUSED)
|
|||
}
|
||||
|
||||
void
|
||||
test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
test_efl_ui_vg_animation(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Eo *win, *box, *box2, *box3, *box4, *label, *anim_view, *check, *slider;
|
||||
char buf[255];
|
||||
|
||||
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
||||
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
|
||||
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
|
||||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
|
||||
// Create a box in Canvas
|
||||
|
@ -166,7 +166,7 @@ test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
//Create Animation View to play animation directly from JSON file
|
||||
snprintf(buf, sizeof(buf), "%s/images/emoji_wink.json", elm_app_data_dir_get());
|
||||
anim_view = efl_add(EFL_UI_ANIMATION_VIEW_CLASS, win,
|
||||
anim_view = efl_add(EFL_UI_VG_ANIMATION_CLASS, win,
|
||||
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, EFL_GFX_HINT_EXPAND),
|
||||
efl_gfx_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL),
|
||||
efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(600, 600)),
|
||||
|
@ -208,7 +208,7 @@ test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
|
||||
|
||||
//Duration Text
|
||||
snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_animation_view_duration_time_get(anim_view));
|
||||
snprintf(buf, sizeof(buf), "Duration: %1.2fs", efl_ui_vg_animation_duration_time_get(anim_view));
|
||||
efl_add(EFL_UI_TEXTBOX_CLASS, box2,
|
||||
efl_gfx_hint_weight_set(efl_added, EFL_GFX_HINT_EXPAND, 0),
|
||||
efl_gfx_hint_fill_set(efl_added, EINA_FALSE, EINA_FALSE),
|
||||
|
@ -298,13 +298,13 @@ test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
|
|||
#else
|
||||
|
||||
void
|
||||
test_efl_ui_animation_view(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
test_efl_ui_vg_animation(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||
{
|
||||
Eo *win, *box;
|
||||
char buf[255];
|
||||
|
||||
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
||||
efl_text_set(efl_added, "Efl_Ui_Animation_View demo"),
|
||||
efl_text_set(efl_added, "Efl_Ui_Vg_Animation demo"),
|
||||
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||
|
||||
// Create a box
|
|
@ -229,7 +229,7 @@ typedef void (*Context_Item_Clicked_Cb)(void *data, Eo *obj, void *event_info);
|
|||
# include <efl_ui_textbox.eo.h>
|
||||
# include <efl_ui_textbox_async.eo.h>
|
||||
|
||||
# include <efl_ui_animation_view.eo.h>
|
||||
# include <efl_ui_vg_animation.eo.h>
|
||||
# include <efl_ui_clock.eo.h>
|
||||
# include <efl_ui_video.eo.h>
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ EAPI extern Elm_Version *elm_version;
|
|||
#include <elm_cache.h>
|
||||
#include <elm_calendar.h>
|
||||
/* this is elm_animation_view */
|
||||
#include <efl_ui_animation_view.h>
|
||||
#include <efl_ui_vg_animation.h>
|
||||
#include <elm_check.h>
|
||||
#include <elm_clock.h>
|
||||
#include <elm_cnp.h>
|
||||
|
|
|
@ -1,166 +0,0 @@
|
|||
|
||||
EAPI void
|
||||
elm_animation_view_auto_play_set(Efl_Ui_Animation_View *obj, Eina_Bool auto_play)
|
||||
{
|
||||
efl_ui_animation_view_autoplay_set(obj, auto_play);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_auto_play_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_autoplay_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_auto_repeat_set(Efl_Ui_Animation_View *obj, Eina_Bool autorepeat)
|
||||
{
|
||||
efl_ui_animation_view_autorepeat_set(obj, autorepeat);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_auto_repeat_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_autorepeat_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_speed_set(Efl_Ui_Animation_View *obj, double speed)
|
||||
{
|
||||
if (!obj) return EINA_FALSE;
|
||||
efl_player_playback_speed_set(obj, speed);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_speed_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_playback_speed_get(obj);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_duration_time_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_duration_time_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_progress_set(Efl_Ui_Animation_View *obj, double progress)
|
||||
{
|
||||
efl_player_playback_progress_set(obj, progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_progress_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_playback_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_frame_set(Efl_Ui_Animation_View *obj, int frame_num)
|
||||
{
|
||||
efl_ui_animation_view_frame_set(obj, frame_num);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_frame_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_frame_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_play(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_playing_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_play_back(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
double speed = efl_player_playback_speed_get(obj);
|
||||
efl_player_playback_speed_set(obj, speed < 0 ? speed * -1 : speed);
|
||||
return efl_player_playing_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_pause(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_paused_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_resume(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_paused_set(obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_stop(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_player_playing_set(obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
EAPI Eina_Size2D
|
||||
elm_animation_view_default_size_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_default_view_size_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_is_playing_back(Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return (efl_ui_animation_view_state_get(obj) == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_frame_count_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_frame_count_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_min_progress_set(Efl_Ui_Animation_View *obj, double min_progress)
|
||||
{
|
||||
efl_ui_animation_view_min_progress_set(obj, min_progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_min_progress_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_min_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_max_progress_set(Efl_Ui_Animation_View *obj, double max_progress)
|
||||
{
|
||||
efl_ui_animation_view_max_progress_set(obj, max_progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_max_progress_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_max_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_min_frame_set(Efl_Ui_Animation_View *obj, int min_frame)
|
||||
{
|
||||
efl_ui_animation_view_min_frame_set(obj, min_frame);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_min_frame_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_min_frame_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_max_frame_set(Efl_Ui_Animation_View *obj, int max_frame)
|
||||
{
|
||||
efl_ui_animation_view_max_frame_set(obj, max_frame);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_max_frame_get(const Efl_Ui_Animation_View *obj)
|
||||
{
|
||||
return efl_ui_animation_view_max_frame_get(obj);
|
||||
}
|
|
@ -7,12 +7,12 @@
|
|||
#include <Elementary.h>
|
||||
|
||||
#include "elm_priv.h"
|
||||
#include "efl_ui_animation_view_private.h"
|
||||
#include "efl_ui_vg_animation_private.h"
|
||||
|
||||
#define MY_CLASS EFL_UI_ANIMATION_VIEW_CLASS
|
||||
#define MY_CLASS EFL_UI_VG_ANIMATION_CLASS
|
||||
|
||||
#define MY_CLASS_NAME "Efl_Ui_Animation_View"
|
||||
#define MY_CLASS_NAME_LEGACY "efl_ui_animation_view"
|
||||
#define MY_CLASS_NAME "Efl_Ui_Vg_Animation"
|
||||
#define MY_CLASS_NAME_LEGACY "efl_ui_vg_animation"
|
||||
|
||||
static const char SIG_FOCUSED[] = "focused";
|
||||
static const char SIG_UNFOCUSED[] = "unfocused";
|
||||
|
@ -24,7 +24,7 @@ static const char SIG_PLAY_RESUME[] = "play,resume";
|
|||
static const char SIG_PLAY_STOP[] = "play,stop";
|
||||
static const char SIG_PLAY_UPDATE[] = "play,update";
|
||||
|
||||
/* smart callbacks coming from Efl_Ui_Animation_View objects: */
|
||||
/* smart callbacks coming from Efl_Ui_Vg_Animation objects: */
|
||||
static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
||||
{SIG_FOCUSED, ""},
|
||||
{SIG_UNFOCUSED, ""},
|
||||
|
@ -41,7 +41,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
|
|||
static void
|
||||
_sizing_eval(Eo *obj, void *data)
|
||||
{
|
||||
Efl_Ui_Animation_View_Data *pd = data;
|
||||
Efl_Ui_Vg_Animation_Data *pd = data;
|
||||
if (!efl_file_loaded_get(obj)) return;
|
||||
|
||||
double hw,hh;
|
||||
|
@ -63,13 +63,13 @@ _size_hint_event_cb(void *data, const Efl_Event *event)
|
|||
}
|
||||
|
||||
static void
|
||||
_transit_go_facade(Eo* obj, Efl_Ui_Animation_View_Data *pd)
|
||||
_transit_go_facade(Eo* obj, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
pd->repeat_times = 0;
|
||||
if (pd->playing_reverse)
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
||||
else
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_START, NULL);
|
||||
if (pd->transit) elm_transit_go(pd->transit);}
|
||||
|
||||
|
@ -98,20 +98,20 @@ _visible_check(Eo *obj)
|
|||
}
|
||||
|
||||
static void
|
||||
_autoplay(Eo *obj, Efl_Ui_Animation_View_Data *pd, Eina_Bool vis)
|
||||
_autoplay(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool vis)
|
||||
{
|
||||
if (!pd->autoplay || !pd->transit) return;
|
||||
|
||||
//Resume Animation
|
||||
if (vis)
|
||||
{
|
||||
if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PAUSED && pd->autoplay_pause)
|
||||
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED && pd->autoplay_pause)
|
||||
{
|
||||
elm_transit_paused_set(pd->transit, EINA_FALSE);
|
||||
if (pd->playing_reverse)
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
||||
else
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
||||
pd->autoplay_pause = EINA_FALSE;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_RESUME, NULL);
|
||||
}
|
||||
|
@ -119,11 +119,11 @@ _autoplay(Eo *obj, Efl_Ui_Animation_View_Data *pd, Eina_Bool vis)
|
|||
//Pause Animation
|
||||
else
|
||||
{
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING) ||
|
||||
(pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS))
|
||||
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING) ||
|
||||
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS))
|
||||
{
|
||||
elm_transit_paused_set(pd->transit, EINA_TRUE);
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PAUSED;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
||||
pd->autoplay_pause = EINA_TRUE;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
||||
}
|
||||
|
@ -134,21 +134,21 @@ static void
|
|||
_transit_del_cb(Elm_Transit_Effect *effect, Elm_Transit *transit)
|
||||
{
|
||||
Eo *obj = (Eo *) effect;
|
||||
EFL_UI_ANIMATION_VIEW_DATA_GET(obj, pd);
|
||||
EFL_UI_VG_ANIMATION_DATA_GET(obj, pd);
|
||||
if (!pd) return;
|
||||
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING && pd->progress == 1) ||
|
||||
(pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS && pd->progress == 0))
|
||||
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING && pd->progress == 1) ||
|
||||
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS && pd->progress == 0))
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_DONE, NULL);
|
||||
|
||||
if (pd->transit != transit) return;
|
||||
|
||||
Efl_Ui_Animation_View_State prev_state = pd->state;
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_STOPPED;
|
||||
Efl_Ui_Vg_Animation_State prev_state = pd->state;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
||||
pd->transit = NULL;
|
||||
pd->autoplay_pause = EINA_FALSE;
|
||||
|
||||
if (prev_state != EFL_UI_ANIMATION_VIEW_STATE_STOPPED)
|
||||
if (prev_state != EFL_UI_VG_ANIMATION_STATE_STOPPED)
|
||||
{
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_STOP, NULL);
|
||||
pd->progress = 0;
|
||||
|
@ -159,11 +159,11 @@ static void
|
|||
_transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
||||
{
|
||||
Eo *obj = (Eo *) effect;
|
||||
EFL_UI_ANIMATION_VIEW_DATA_GET(obj, pd);
|
||||
EFL_UI_VG_ANIMATION_DATA_GET(obj, pd);
|
||||
|
||||
if (!pd || !pd->vg)
|
||||
{
|
||||
ERR("Vector Object is removed in wrong way!, Efl_Ui_Animation_View = %p", obj);
|
||||
ERR("Vector Object is removed in wrong way!, Efl_Ui_Vg_Animation = %p", obj);
|
||||
elm_transit_del(transit);
|
||||
return;
|
||||
}
|
||||
|
@ -180,10 +180,10 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|||
|
||||
if (pd->playing_reverse)
|
||||
{
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
||||
progress = 1 - progress;
|
||||
}
|
||||
else pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING;
|
||||
else pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
||||
|
||||
pd->progress = progress;
|
||||
int minframe = (pd->frame_cnt - 1) * pd->min_progress;
|
||||
|
@ -214,7 +214,7 @@ _transit_cb(Elm_Transit_Effect *effect, Elm_Transit *transit, double progress)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Animation_View_Data *priv)
|
||||
_efl_ui_vg_animation_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Vg_Animation_Data *priv)
|
||||
{
|
||||
efl_canvas_group_add(efl_super(obj, MY_CLASS));
|
||||
elm_widget_sub_object_parent_add(obj);
|
||||
|
@ -232,7 +232,7 @@ _efl_ui_animation_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Animation_View
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
|
||||
_efl_ui_vg_animation_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
||||
{
|
||||
if (pd->transit)
|
||||
{
|
||||
|
@ -240,14 +240,14 @@ _efl_ui_animation_view_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Animation_View
|
|||
pd->transit = NULL; //Skip perform transit_del_cb()
|
||||
elm_transit_del(transit);
|
||||
}
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_NOT_READY;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_NOT_READY;
|
||||
|
||||
efl_canvas_group_del(efl_super(obj, MY_CLASS));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_object_destructor(Eo *obj,
|
||||
Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
|
||||
_efl_ui_vg_animation_efl_object_destructor(Eo *obj,
|
||||
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Gfx_Vg_Value_Provider *vp;
|
||||
EINA_LIST_FREE(pd->vp_list, vp)
|
||||
|
@ -258,8 +258,8 @@ _efl_ui_animation_view_efl_object_destructor(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
_efl_ui_animation_view_efl_object_constructor(Eo *obj,
|
||||
Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
|
||||
_efl_ui_vg_animation_efl_object_constructor(Eo *obj,
|
||||
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
||||
{
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
|
||||
|
@ -269,7 +269,7 @@ _efl_ui_animation_view_efl_object_constructor(Eo *obj,
|
|||
}
|
||||
|
||||
static void
|
||||
_update_frame_duration(Efl_Ui_Animation_View_Data *pd)
|
||||
_update_frame_duration(Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
||||
int min_frame = (frame_count - 1) * pd->min_progress;
|
||||
|
@ -283,10 +283,10 @@ _update_frame_duration(Efl_Ui_Animation_View_Data *pd)
|
|||
}
|
||||
|
||||
static Eina_Bool
|
||||
_ready_play(Eo *obj, Efl_Ui_Animation_View_Data *pd)
|
||||
_ready_play(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
pd->autoplay_pause = EINA_FALSE;
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_STOPPED;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
||||
|
||||
if (pd->transit) elm_transit_del(pd->transit);
|
||||
|
||||
|
@ -314,16 +314,16 @@ _ready_play(Eo *obj, Efl_Ui_Animation_View_Data *pd)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_file_unload(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_NOT_READY;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_NOT_READY;
|
||||
pd->frame_cnt = 0;
|
||||
pd->frame_duration = 0;
|
||||
if (pd->transit) elm_transit_del(pd->transit);
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Error
|
||||
_efl_ui_animation_view_efl_file_load(Eo *obj, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_file_load(Eo *obj, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
Eina_Error err;
|
||||
Eina_Bool ret;
|
||||
|
@ -357,7 +357,7 @@ _efl_ui_animation_view_efl_file_load(Eo *obj, Efl_Ui_Animation_View_Data *pd)
|
|||
if (!_visible_check(obj))
|
||||
{
|
||||
elm_transit_paused_set(pd->transit, EINA_TRUE);
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PAUSED;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
||||
pd->autoplay_pause = EINA_TRUE;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
||||
}
|
||||
|
@ -366,8 +366,8 @@ _efl_ui_animation_view_efl_file_load(Eo *obj, Efl_Ui_Animation_View_Data *pd)
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_gfx_entity_position_set(Eo *obj,
|
||||
Efl_Ui_Animation_View_Data *pd,
|
||||
_efl_ui_vg_animation_efl_gfx_entity_position_set(Eo *obj,
|
||||
Efl_Ui_Vg_Animation_Data *pd,
|
||||
Eina_Position2D pos EINA_UNUSED)
|
||||
{
|
||||
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
|
||||
|
@ -379,8 +379,8 @@ _efl_ui_animation_view_efl_gfx_entity_position_set(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_gfx_entity_size_set(Eo *obj,
|
||||
Efl_Ui_Animation_View_Data *pd,
|
||||
_efl_ui_vg_animation_efl_gfx_entity_size_set(Eo *obj,
|
||||
Efl_Ui_Vg_Animation_Data *pd,
|
||||
Eina_Size2D size)
|
||||
{
|
||||
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
|
||||
|
@ -394,8 +394,8 @@ _efl_ui_animation_view_efl_gfx_entity_size_set(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_gfx_entity_visible_set(Eo *obj,
|
||||
Efl_Ui_Animation_View_Data *pd,
|
||||
_efl_ui_vg_animation_efl_gfx_entity_visible_set(Eo *obj,
|
||||
Efl_Ui_Vg_Animation_Data *pd,
|
||||
Eina_Bool vis)
|
||||
{
|
||||
if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_VISIBLE, 0, vis))
|
||||
|
@ -407,8 +407,8 @@ _efl_ui_animation_view_efl_gfx_entity_visible_set(Eo *obj,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Animation_View_Data *pd,
|
||||
_efl_ui_vg_animation_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Vg_Animation_Data *pd,
|
||||
Eina_Size2D size)
|
||||
{
|
||||
Eina_Rect viewbox;
|
||||
|
@ -420,8 +420,8 @@ _efl_ui_animation_view_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
EOLIAN Eina_Size2D
|
||||
_efl_ui_animation_view_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
Eina_Rect viewbox = efl_canvas_vg_object_viewbox_get(pd->vg);
|
||||
|
||||
|
@ -429,7 +429,7 @@ _efl_ui_animation_view_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_autorepeat_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, Eina_Bool autorepeat)
|
||||
_efl_ui_vg_animation_autorepeat_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool autorepeat)
|
||||
{
|
||||
if (pd->autorepeat == autorepeat) return;
|
||||
pd->autorepeat = autorepeat;
|
||||
|
@ -441,13 +441,13 @@ _efl_ui_animation_view_autorepeat_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_autorepeat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_autorepeat_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->autorepeat;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd,
|
||||
_efl_ui_vg_animation_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd,
|
||||
Eina_Bool autoplay)
|
||||
{
|
||||
pd->autoplay = autoplay;
|
||||
|
@ -455,12 +455,12 @@ _efl_ui_animation_view_autoplay_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_D
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->autoplay;
|
||||
}
|
||||
|
||||
Eina_Bool _efl_ui_animation_view_playing_sector(Eo *obj, Efl_Ui_Animation_View_Data *pd, const char *start, const char *end)
|
||||
Eina_Bool _efl_ui_vg_animation_playing_sector(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, const char *start, const char *end)
|
||||
{
|
||||
int start_frame = 0;
|
||||
int end_frame = evas_object_vg_animated_frame_count_get(pd->vg) - 1;
|
||||
|
@ -482,9 +482,9 @@ Eina_Bool _efl_ui_animation_view_playing_sector(Eo *obj, Efl_Ui_Animation_View_D
|
|||
}
|
||||
}
|
||||
|
||||
efl_ui_animation_view_min_frame_set(obj, start_frame);
|
||||
efl_ui_vg_animation_min_frame_set(obj, start_frame);
|
||||
if (start_frame < end_frame)
|
||||
efl_ui_animation_view_max_frame_set(obj, end_frame);
|
||||
efl_ui_vg_animation_max_frame_set(obj, end_frame);
|
||||
|
||||
if (!efl_player_playing_set(obj, EINA_TRUE))
|
||||
return EINA_FALSE;
|
||||
|
@ -492,62 +492,62 @@ Eina_Bool _efl_ui_animation_view_playing_sector(Eo *obj, Efl_Ui_Animation_View_D
|
|||
}
|
||||
|
||||
Eina_Bool
|
||||
_playing_stop(Eo* obj, Efl_Ui_Animation_View_Data *pd)
|
||||
_playing_stop(Eo* obj, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
if (!pd->transit) return EINA_FALSE;
|
||||
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_NOT_READY) ||
|
||||
(pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOPPED))
|
||||
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_NOT_READY) ||
|
||||
(pd->state == EFL_UI_VG_ANIMATION_STATE_STOPPED))
|
||||
return EINA_FALSE;
|
||||
|
||||
evas_object_vg_animated_frame_set(pd->vg, 0);
|
||||
pd->progress = 0;
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_STOPPED;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_STOPPED;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_STOP, NULL);
|
||||
elm_transit_del(pd->transit);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int frame_num)
|
||||
_efl_ui_vg_animation_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int frame_num)
|
||||
{
|
||||
efl_player_playback_progress_set(obj, (double) frame_num / (double) (evas_object_vg_animated_frame_count_get(pd->vg) - 1));
|
||||
}
|
||||
|
||||
EOLIAN static int
|
||||
_efl_ui_animation_view_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
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 double
|
||||
_efl_ui_animation_view_duration_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_duration_time_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->frame_duration;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Size2D
|
||||
_efl_ui_animation_view_default_view_size_get(const Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Animation_View_Data *pd EINA_UNUSED)
|
||||
_efl_ui_vg_animation_default_view_size_get(const Eo *obj EINA_UNUSED,
|
||||
Efl_Ui_Vg_Animation_Data *pd EINA_UNUSED)
|
||||
{
|
||||
return efl_canvas_vg_object_default_size_get(pd->vg);
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Ui_Animation_View_State
|
||||
_efl_ui_animation_view_state_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
EOLIAN static Efl_Ui_Vg_Animation_State
|
||||
_efl_ui_vg_animation_state_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->state;
|
||||
}
|
||||
|
||||
EOLIAN static int
|
||||
_efl_ui_animation_view_frame_count_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_frame_count_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return efl_gfx_frame_controller_frame_count_get(pd->vg);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_min_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double min_progress)
|
||||
_efl_ui_vg_animation_min_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double min_progress)
|
||||
{
|
||||
if (min_progress < 0.0 || min_progress > 1.0 || min_progress > pd->max_progress) return;
|
||||
|
||||
|
@ -556,13 +556,13 @@ _efl_ui_animation_view_min_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_Vi
|
|||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_ui_animation_view_min_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_min_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->min_progress;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_max_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double max_progress)
|
||||
_efl_ui_vg_animation_max_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double max_progress)
|
||||
{
|
||||
if (max_progress < 0.0 || max_progress > 1.0 || max_progress < pd->min_progress) return;
|
||||
|
||||
|
@ -571,13 +571,13 @@ _efl_ui_animation_view_max_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_Vi
|
|||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_ui_animation_view_max_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_max_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->max_progress;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_min_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int min_frame)
|
||||
_efl_ui_vg_animation_min_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int min_frame)
|
||||
{
|
||||
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
||||
if (min_frame < 0) min_frame = 0;
|
||||
|
@ -592,13 +592,13 @@ _efl_ui_animation_view_min_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_
|
|||
}
|
||||
|
||||
EOLIAN static int
|
||||
_efl_ui_animation_view_min_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_min_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->min_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_max_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, int max_frame)
|
||||
_efl_ui_vg_animation_max_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, int max_frame)
|
||||
{
|
||||
int frame_count = evas_object_vg_animated_frame_count_get(pd->vg);
|
||||
if (max_frame > frame_count - 1) max_frame = frame_count - 1;
|
||||
|
@ -613,13 +613,13 @@ _efl_ui_animation_view_max_frame_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_
|
|||
}
|
||||
|
||||
EOLIAN static int
|
||||
_efl_ui_animation_view_max_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_max_frame_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->max_progress * (evas_object_vg_animated_frame_count_get(pd->vg) - 1);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, Efl_Gfx_Vg_Value_Provider *value_provider)
|
||||
_efl_ui_vg_animation_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Efl_Gfx_Vg_Value_Provider *value_provider)
|
||||
{
|
||||
if (!value_provider) return;
|
||||
|
||||
|
@ -651,17 +651,17 @@ _efl_ui_animation_view_value_provider_override(Eo *obj EINA_UNUSED, Efl_Ui_Anima
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_efl_player_playing_set(Eo *obj, Efl_Ui_Animation_View_Data *pd, Eina_Bool playing)
|
||||
_efl_ui_vg_animation_efl_player_playing_set(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool playing)
|
||||
{
|
||||
if (playing)
|
||||
{
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING && pd->playback_speed > 0)
|
||||
|| (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS && pd->playback_speed <= 0))
|
||||
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))
|
||||
return EINA_FALSE;
|
||||
|
||||
Eina_Bool rewind = EINA_FALSE;
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING && pd->playback_speed <= 0)
|
||||
|| (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS && pd->playback_speed > 0))
|
||||
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))
|
||||
rewind = EINA_TRUE;
|
||||
|
||||
if (pd->playback_speed <= 0)
|
||||
|
@ -675,7 +675,7 @@ _efl_ui_animation_view_efl_player_playing_set(Eo *obj, Efl_Ui_Animation_View_Dat
|
|||
if (!pd->transit && !_ready_play(obj, pd)) return EINA_FALSE;
|
||||
|
||||
|
||||
if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_STOPPED)
|
||||
if (pd->state == EFL_UI_VG_ANIMATION_STATE_STOPPED)
|
||||
{
|
||||
if (pd->playing_reverse && pd->progress == 0) pd->progress = 1.0;
|
||||
_transit_go_facade(obj, pd);
|
||||
|
@ -694,37 +694,37 @@ _efl_ui_animation_view_efl_player_playing_set(Eo *obj, Efl_Ui_Animation_View_Dat
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_efl_player_playing_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_player_playing_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING)
|
||||
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING)
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_efl_player_paused_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, Eina_Bool paused)
|
||||
_efl_ui_vg_animation_efl_player_paused_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, Eina_Bool paused)
|
||||
{
|
||||
|
||||
if (paused)
|
||||
{
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING) ||
|
||||
(pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS))
|
||||
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING) ||
|
||||
(pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS))
|
||||
{
|
||||
elm_transit_paused_set(pd->transit, paused);
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PAUSED;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PAUSED;
|
||||
pd->autoplay_pause = EINA_FALSE;
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_PAUSE, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pd->transit && pd->state == EFL_UI_ANIMATION_VIEW_STATE_PAUSED)
|
||||
if (pd->transit && pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED)
|
||||
{
|
||||
elm_transit_paused_set(pd->transit, paused);
|
||||
if (pd->playing_reverse)
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS;
|
||||
else
|
||||
pd->state = EFL_UI_ANIMATION_VIEW_STATE_PLAYING;
|
||||
pd->state = EFL_UI_VG_ANIMATION_STATE_PLAYING;
|
||||
pd->autoplay_pause = EINA_FALSE;
|
||||
|
||||
evas_object_smart_callback_call(obj, SIG_PLAY_RESUME, NULL);
|
||||
|
@ -734,15 +734,15 @@ _efl_ui_animation_view_efl_player_paused_set(Eo *obj EINA_UNUSED, Efl_Ui_Animati
|
|||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_animation_view_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_player_paused_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
if (pd->state == EFL_UI_ANIMATION_VIEW_STATE_PAUSED)
|
||||
if (pd->state == EFL_UI_VG_ANIMATION_STATE_PAUSED)
|
||||
return EINA_TRUE;
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_player_playback_position_set(Eo *obj, Efl_Ui_Animation_View_Data *pd, double sec)
|
||||
_efl_ui_vg_animation_efl_player_playback_position_set(Eo *obj, Efl_Ui_Vg_Animation_Data *pd, double sec)
|
||||
{
|
||||
EINA_SAFETY_ON_TRUE_RETURN(sec < 0);
|
||||
EINA_SAFETY_ON_TRUE_RETURN(sec > pd->frame_duration);
|
||||
|
@ -751,19 +751,19 @@ _efl_ui_animation_view_efl_player_playback_position_set(Eo *obj, Efl_Ui_Animatio
|
|||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_ui_animation_view_efl_player_playback_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_player_playback_position_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->frame_duration * pd->progress;
|
||||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_ui_animation_view_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_player_playback_progress_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->progress;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double progress)
|
||||
_efl_ui_vg_animation_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double progress)
|
||||
{
|
||||
if (progress < 0) progress = 0;
|
||||
else if (progress > 1) progress = 1;
|
||||
|
@ -784,11 +784,11 @@ _efl_ui_animation_view_efl_player_playback_progress_set(Eo *obj EINA_UNUSED, Efl
|
|||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_animation_view_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd, double speed)
|
||||
_efl_ui_vg_animation_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd, double speed)
|
||||
{
|
||||
// pd->playback_direction_changed is used only during playback.
|
||||
if ((pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING ||
|
||||
pd->state == EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS)
|
||||
if ((pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING ||
|
||||
pd->state == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS)
|
||||
&& ((pd->playback_speed > 0 && speed < 0) || (pd->playback_speed < 0 && speed > 0)))
|
||||
pd->playback_direction_changed = EINA_TRUE;
|
||||
|
||||
|
@ -799,7 +799,7 @@ _efl_ui_animation_view_efl_player_playback_speed_set(Eo *obj EINA_UNUSED, Efl_Ui
|
|||
}
|
||||
|
||||
EOLIAN static double
|
||||
_efl_ui_animation_view_efl_player_playback_speed_get(const Eo *obj EINA_UNUSED, Efl_Ui_Animation_View_Data *pd)
|
||||
_efl_ui_vg_animation_efl_player_playback_speed_get(const Eo *obj EINA_UNUSED, Efl_Ui_Vg_Animation_Data *pd)
|
||||
{
|
||||
return pd->playback_speed;
|
||||
}
|
||||
|
@ -822,21 +822,21 @@ elm_animation_view_state_get(Elm_Animation_View *obj)
|
|||
{
|
||||
Elm_Animation_View_State state = ELM_ANIMATION_VIEW_STATE_NOT_READY;
|
||||
|
||||
switch (efl_ui_animation_view_state_get(obj))
|
||||
switch (efl_ui_vg_animation_state_get(obj))
|
||||
{
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING:
|
||||
state = ELM_ANIMATION_VIEW_STATE_PLAY;
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PLAYING_BACKWARDS:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS:
|
||||
state = ELM_ANIMATION_VIEW_STATE_PLAY_BACK;
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_PAUSED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_PAUSED:
|
||||
state = ELM_ANIMATION_VIEW_STATE_PAUSE;
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_STOPPED:
|
||||
case EFL_UI_VG_ANIMATION_STATE_STOPPED:
|
||||
state = ELM_ANIMATION_VIEW_STATE_STOP;
|
||||
break;
|
||||
case EFL_UI_ANIMATION_VIEW_STATE_NOT_READY:
|
||||
case EFL_UI_VG_ANIMATION_STATE_NOT_READY:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -845,8 +845,8 @@ elm_animation_view_state_get(Elm_Animation_View *obj)
|
|||
|
||||
/* Internal EO APIs and hidden overrides */
|
||||
|
||||
#define EFL_UI_ANIMATION_VIEW_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_animation_view)
|
||||
#define EFL_UI_VG_ANIMATION_EXTRA_OPS \
|
||||
EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_vg_animation)
|
||||
|
||||
#include "efl_ui_animation_view_eo.legacy.c"
|
||||
#include "efl_ui_animation_view.eo.c"
|
||||
#include "efl_ui_vg_animation_eo.legacy.c"
|
||||
#include "efl_ui_vg_animation.eo.c"
|
|
@ -1,37 +1,37 @@
|
|||
|
||||
enum @beta Efl.Ui.Animation_View_State
|
||||
enum @beta Efl.Ui.Vg_Animation_State
|
||||
{
|
||||
[[State of animation view]]
|
||||
[[State of vg_animation]]
|
||||
not_ready, [[Animation is not ready to play. (Probably, it didn't file set yet or failed to read file.]]
|
||||
playing, [[Animation is playing.]]
|
||||
playing_backwards, [[Animation is playing backwards (rewinding).]]
|
||||
paused, [[Animation has been paused.]]
|
||||
stopped [[Animation view successfully loaded a file then readied for playing.
|
||||
stopped [[Vg Animation successfully loaded a file then readied for playing.
|
||||
Otherwise after finished animation or stopped forcibly by request.]]
|
||||
}
|
||||
|
||||
class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player
|
||||
class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player
|
||||
{
|
||||
[[Elementary Animation view class.
|
||||
Animation view is designed to show and play animation of
|
||||
[[Elementary Vector Graphcis Animation class.
|
||||
Vg Animation is designed to show and play animation of
|
||||
vector graphics based content. It hides all @Efl.Canvas.Vg.Object details
|
||||
but just open an API to read vector data from file. Also, it implements
|
||||
details of animation control methods of Vector.
|
||||
|
||||
Vector data could contain static or animatable vector elements including
|
||||
animation information. Available vector data file formats are SVG, JSON and EET.
|
||||
@Efl.Ui.Animation_View currently only supports the animation information contained in
|
||||
@Efl.Ui.Vg_Animation currently only supports the animation information contained in
|
||||
JSON (known as Lottie file as well) and EET files.
|
||||
]]
|
||||
event_c_prefix: efl_ui_animation_view;
|
||||
event_c_prefix: efl_ui_vg_animation;
|
||||
methods {
|
||||
@property autoplay {
|
||||
[[Animation will be started automatically when it's possible.
|
||||
|
||||
If @.autoplay is $true, animation will be started when it's readied.
|
||||
The condition of $auto play is when animation view opened file successfully,
|
||||
The condition of $auto play is when vg animation opened file successfully,
|
||||
yet to play it plus when the object is visible.
|
||||
If animation view is disabled, invisible,
|
||||
If vg animation is disabled, invisible,
|
||||
it turns to pause state then resume animation when it's visible again.
|
||||
|
||||
$true Enable auto play mode, disable otherwise.
|
||||
|
@ -96,7 +96,7 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
|
|||
Play is played and stoped at starting point of each sector.
|
||||
|
||||
If start is null and end is valid, playback starts from 0 frame to the start frame of the end sector.
|
||||
If both sectors start and end are invalid. Play from 0 frame to the last frame of animation view object.
|
||||
If both sectors start and end are invalid. Play from 0 frame to the last frame of vg animation object.
|
||||
|
||||
Note: This method use to @.min_frame, @.max_frame (@.min_progress, @.max_progress) internally.
|
||||
So if you have changed the min or max frame(progress) it can be changed to the sector frame.
|
||||
|
@ -117,17 +117,17 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
|
|||
}
|
||||
}
|
||||
@property state {
|
||||
[[Current animation view state.
|
||||
See @Efl.Ui.Animation_View_State
|
||||
[[Current vg animation state.
|
||||
See @Efl.Ui.Vg_Animation_State
|
||||
]]
|
||||
get{
|
||||
}
|
||||
values {
|
||||
state: Efl.Ui.Animation_View_State; [[Current animation view state]]
|
||||
state: Efl.Ui.Vg_Animation_State; [[Current vg animation state]]
|
||||
}
|
||||
}
|
||||
@property frame_count {
|
||||
[[The index of end frame of the animation view, if it's animated.
|
||||
[[The index of end frame of the vg animation, if it's animated.
|
||||
Note : frame number starts with 0.
|
||||
]]
|
||||
get {
|
||||
|
@ -190,7 +190,7 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
|
|||
Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, NULL);
|
||||
@Efl.Gfx.Vg.Value_Provider.keypath.set(vp, "SomeLayer:SomeObject:SomeContents");
|
||||
// Set vp property
|
||||
@.value_provider_override(target_animation_view, vg);
|
||||
@.value_provider_override(target_vg_animation, vg);
|
||||
See @Efl.Gfx.Vg.Value_Provider
|
||||
]]
|
||||
params {
|
|
@ -26,7 +26,7 @@
|
|||
* @ingroup Elm_Animation_View
|
||||
*/
|
||||
#ifndef EFL_NOLEGACY_API_SUPPORT
|
||||
#include "efl_ui_animation_view_legacy.h"
|
||||
#include "efl_ui_vg_animation_legacy.h"
|
||||
#endif
|
||||
/**
|
||||
* @}
|
|
@ -0,0 +1,166 @@
|
|||
|
||||
EAPI void
|
||||
elm_animation_view_auto_play_set(Efl_Ui_Vg_Animation *obj, Eina_Bool auto_play)
|
||||
{
|
||||
efl_ui_vg_animation_autoplay_set(obj, auto_play);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_auto_play_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_autoplay_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_auto_repeat_set(Efl_Ui_Vg_Animation *obj, Eina_Bool autorepeat)
|
||||
{
|
||||
efl_ui_vg_animation_autorepeat_set(obj, autorepeat);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_auto_repeat_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_autorepeat_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_speed_set(Efl_Ui_Vg_Animation *obj, double speed)
|
||||
{
|
||||
if (!obj) return EINA_FALSE;
|
||||
efl_player_playback_speed_set(obj, speed);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_speed_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_playback_speed_get(obj);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_duration_time_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_duration_time_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_progress_set(Efl_Ui_Vg_Animation *obj, double progress)
|
||||
{
|
||||
efl_player_playback_progress_set(obj, progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_progress_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_playback_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_frame_set(Efl_Ui_Vg_Animation *obj, int frame_num)
|
||||
{
|
||||
efl_ui_vg_animation_frame_set(obj, frame_num);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_frame_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_frame_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_play(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_playing_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_play_back(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
double speed = efl_player_playback_speed_get(obj);
|
||||
efl_player_playback_speed_set(obj, speed < 0 ? speed * -1 : speed);
|
||||
return efl_player_playing_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_pause(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_paused_set(obj, EINA_TRUE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_resume(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_paused_set(obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_stop(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_player_playing_set(obj, EINA_FALSE);
|
||||
}
|
||||
|
||||
EAPI Eina_Size2D
|
||||
elm_animation_view_default_size_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_default_view_size_get(obj);
|
||||
}
|
||||
|
||||
EAPI Eina_Bool
|
||||
elm_animation_view_is_playing_back(Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return (efl_ui_vg_animation_state_get(obj) == EFL_UI_VG_ANIMATION_STATE_PLAYING_BACKWARDS);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_frame_count_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_frame_count_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_min_progress_set(Efl_Ui_Vg_Animation *obj, double min_progress)
|
||||
{
|
||||
efl_ui_vg_animation_min_progress_set(obj, min_progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_min_progress_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_min_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_max_progress_set(Efl_Ui_Vg_Animation *obj, double max_progress)
|
||||
{
|
||||
efl_ui_vg_animation_max_progress_set(obj, max_progress);
|
||||
}
|
||||
|
||||
EAPI double
|
||||
elm_animation_view_max_progress_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_max_progress_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_min_frame_set(Efl_Ui_Vg_Animation *obj, int min_frame)
|
||||
{
|
||||
efl_ui_vg_animation_min_frame_set(obj, min_frame);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_min_frame_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_min_frame_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_animation_view_max_frame_set(Efl_Ui_Vg_Animation *obj, int max_frame)
|
||||
{
|
||||
efl_ui_vg_animation_max_frame_set(obj, max_frame);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
elm_animation_view_max_frame_get(const Efl_Ui_Vg_Animation *obj)
|
||||
{
|
||||
return efl_ui_vg_animation_max_frame_get(obj);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
#include "efl_ui_animation_view_eo.legacy.h"
|
||||
#include "efl_ui_vg_animation_eo.legacy.h"
|
||||
|
||||
/**
|
||||
* Add a new animation view widget to the parent's canvas
|
|
@ -1,15 +1,15 @@
|
|||
#ifndef EFL_UI_ANIMATION_VIEW_PRIVATE_H
|
||||
#define EFL_UI_ANIMATION_VIEW_PRIVATE_H
|
||||
#ifndef EFL_UI_VG_ANIMATION_PRIVATE_H
|
||||
#define EFL_UI_VG_ANIMATION_PRIVATE_H
|
||||
|
||||
#include "Elementary.h"
|
||||
#include "efl_ui_animation_view.eo.h"
|
||||
#include "efl_ui_vg_animation.eo.h"
|
||||
|
||||
typedef struct _Efl_Ui_Animation_View_Data Efl_Ui_Animation_View_Data;
|
||||
typedef struct _Efl_Ui_Vg_Animation_Data Efl_Ui_Vg_Animation_Data;
|
||||
|
||||
struct _Efl_Ui_Animation_View_Data
|
||||
struct _Efl_Ui_Vg_Animation_Data
|
||||
{
|
||||
Eo* vg; //Evas_Object_Vg
|
||||
Efl_Ui_Animation_View_State state;
|
||||
Efl_Ui_Vg_Animation_State state;
|
||||
Elm_Transit *transit;
|
||||
Eina_Stringshare *file;
|
||||
double playback_speed;
|
||||
|
@ -28,11 +28,11 @@ struct _Efl_Ui_Animation_View_Data
|
|||
Eina_Bool playback_direction_changed : 1;
|
||||
};
|
||||
|
||||
#define EFL_UI_ANIMATION_VIEW_DATA_GET(o, sd) \
|
||||
Efl_Ui_Animation_View_Data * sd = efl_data_scope_safe_get(o, EFL_UI_ANIMATION_VIEW_CLASS)
|
||||
#define EFL_UI_VG_ANIMATION_DATA_GET(o, sd) \
|
||||
Efl_Ui_Vg_Animation_Data * sd = efl_data_scope_safe_get(o, EFL_UI_VG_ANIMATION_CLASS)
|
||||
|
||||
#define EFL_UI_ANIMATION_VIEW_DATA_GET_OR_RETURN(o, ptr) \
|
||||
EFL_UI_ANIMATION_VIEW_DATA_GET(o, ptr); \
|
||||
#define EFL_UI_VG_ANIMATION_DATA_GET_OR_RETURN(o, ptr) \
|
||||
EFL_UI_VG_ANIMATION_DATA_GET(o, ptr); \
|
||||
if (EINA_UNLIKELY(!ptr)) \
|
||||
{ \
|
||||
ERR("No widget data for object %p (%s)", \
|
|
@ -39,7 +39,7 @@ endforeach
|
|||
pub_eo_files = [
|
||||
'efl_ui_widget.eo',
|
||||
'efl_ui_widget_scrollable_content.eo',
|
||||
'efl_ui_animation_view.eo',
|
||||
'efl_ui_vg_animation.eo',
|
||||
'efl_ui_bg.eo',
|
||||
'efl_ui_button.eo',
|
||||
'efl_ui_calendar.eo',
|
||||
|
@ -301,7 +301,7 @@ elementary_headers_unstable = [
|
|||
'efl_ui_widget_flip.h',
|
||||
'elm_widget_flipselector.h',
|
||||
'efl_ui_widget_frame.h',
|
||||
'efl_ui_animation_view_private.h',
|
||||
'efl_ui_vg_animation_private.h',
|
||||
'elm_widget_gengrid.h',
|
||||
'elm_widget_genlist.h',
|
||||
'elm_widget_glview.h',
|
||||
|
@ -401,8 +401,8 @@ elementary_pub_headers = [
|
|||
'elc_naviframe_common.h',
|
||||
'elc_popup.h',
|
||||
'elc_popup_legacy.h',
|
||||
'efl_ui_animation_view.h',
|
||||
'efl_ui_animation_view_legacy.h',
|
||||
'efl_ui_vg_animation.h',
|
||||
'efl_ui_vg_animation_legacy.h',
|
||||
'elm_access.h',
|
||||
'elm_actionslider.h',
|
||||
'elm_actionslider_legacy.h',
|
||||
|
@ -592,7 +592,7 @@ elementary_pub_headers = [
|
|||
'elm_win_legacy.h',
|
||||
'elm_helper.h',
|
||||
'elm_part_helper.h',
|
||||
'efl_ui_animation_view_eo.legacy.h',
|
||||
'efl_ui_vg_animation_eo.legacy.h',
|
||||
'efl_ui_bg_eo.legacy.h',
|
||||
'efl_ui_bg_legacy_eo.legacy.h',
|
||||
'efl_ui_button_eo.legacy.h',
|
||||
|
@ -731,7 +731,7 @@ elementary_src = [
|
|||
'elc_popup.c',
|
||||
'elc_scrolled_entry.c',
|
||||
'elm_access.c',
|
||||
'efl_ui_animation_view.c',
|
||||
'efl_ui_vg_animation.c',
|
||||
'elm_actionslider.c',
|
||||
'elm_atspi_app_object.c',
|
||||
'elm_atspi_bridge.c',
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"Efl.Ui.Timepicker",
|
||||
"Efl.Ui.Navigation_Bar",
|
||||
"Efl.Ui.Relative_Container",
|
||||
"Efl.Ui.Animation_View",
|
||||
"Efl.Ui.Vg_Animation",
|
||||
"Efl.Ui.Table",
|
||||
"Efl.Ui.Flip",
|
||||
"Efl.Ui.Stack",
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
/* spec-meta-start
|
||||
{"test-interface":"Efl.Gfx.View",
|
||||
"test-widgets": ["Efl.Ui.Animation_View"]}
|
||||
"test-widgets": ["Efl.Ui.Vg_Animation"]}
|
||||
spec-meta-end */
|
||||
|
||||
EFL_START_TEST(view_size)
|
||||
|
|
Loading…
Reference in New Issue