summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-11-12 14:30:25 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2019-11-12 14:30:25 +0900
commit7d97abc05b0a7a4fd146bffb29e3d9a4c9ecc567 (patch)
tree6d4794202ee41ca94431c0c87d176e9c459afa10 /src/lib/elementary
parentbcfffc07cfdae0a95cd5ce6a5d7ca1f402b52210 (diff)
Efl.Ui.Animation_View: Implement sector playing featureHEADmaster
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
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_animation_view.c31
-rw-r--r--src/lib/elementary/efl_ui_animation_view.eo19
2 files changed, 50 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_animation_view.c b/src/lib/elementary/efl_ui_animation_view.c
index 82aba0f..074ebfd 100644
--- a/src/lib/elementary/efl_ui_animation_view.c
+++ b/src/lib/elementary/efl_ui_animation_view.c
@@ -468,6 +468,37 @@ _efl_ui_animation_view_play(Eo *obj, Efl_Ui_Animation_View_Data *pd)
468 return EINA_TRUE; 468 return EINA_TRUE;
469} 469}
470 470
471Eina_Bool _efl_ui_animation_view_play_sector(Eo *obj, Efl_Ui_Animation_View_Data *pd, const char *start, const char *end)
472{
473 int start_frame = 0;
474 int end_frame = evas_object_vg_animated_frame_count_get(pd->vg) - 1;
475
476 if (start && end)
477 {
478 efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, NULL);
479 efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL);
480 }
481 else
482 {
483 if (start)
484 {
485 efl_gfx_frame_controller_sector_get(pd->vg, start, &start_frame, &end_frame);
486 }
487 else if (end)
488 {
489 efl_gfx_frame_controller_sector_get(pd->vg, end, &end_frame, NULL);
490 }
491 }
492
493 efl_ui_animation_view_min_frame_set(obj, start_frame);
494 if (start_frame < end_frame)
495 efl_ui_animation_view_max_frame_set(obj, end_frame);
496
497 if (!efl_ui_animation_view_play(obj))
498 return EINA_FALSE;
499 return EINA_TRUE;
500}
501
471EOLIAN static Eina_Bool 502EOLIAN static Eina_Bool
472_efl_ui_animation_view_stop(Eo *obj, Efl_Ui_Animation_View_Data *pd) 503_efl_ui_animation_view_stop(Eo *obj, Efl_Ui_Animation_View_Data *pd)
473{ 504{
diff --git a/src/lib/elementary/efl_ui_animation_view.eo b/src/lib/elementary/efl_ui_animation_view.eo
index 2d090bb..f06c9b1 100644
--- a/src/lib/elementary/efl_ui_animation_view.eo
+++ b/src/lib/elementary/efl_ui_animation_view.eo
@@ -135,6 +135,25 @@ class @beta Efl.Ui.Animation_View extends Efl.Ui.Widget implements Efl.Gfx.View,
135 135
136 return: bool; [[$true when it's successful. $false otherwise.]] 136 return: bool; [[$true when it's successful. $false otherwise.]]
137 } 137 }
138 play_sector {
139 [[Play animation of sector one time instantly when it's available.
140
141 If end sector is NULL, only start sector is referenced.
142 If both the start and end sectors are valid,
143 Play is played and stoped at starting point of each sector.
144
145 If start is null and end is valid, playback starts from 0 frame to the start frame of the end sector.
146 If both sectors start and end are invalid. Play from 0 frame to the last frame of animation view object.
147
148 Note: This method use to @.min_frame, @.max_frame (@.min_progress, @.max_progress) internally.
149 So if you have changed the min or max frame(progress) it can be changed to the sector frame.
150 ]]
151 params {
152 @in start: string; [[ The name of start sector ]]
153 @in end: string; [[ The name of end sector ]]
154 }
155 return: bool; [[$true when it's successful. $false otherwise.]]
156 }
138 play_back { 157 play_back {
139 [[Play back animation one time instantly when it's available. 158 [[Play back animation one time instantly when it's available.
140 159