Efl.Gfx.Frame_Controller: Add sector property

Summary:
These APIs to get and set frames for a specific section for playing section.

Depends on D10505

Test Plan: N/A

Reviewers: Hermet, smohanty, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10506
This commit is contained in:
junsu choi 2019-11-12 14:30:10 +09:00
parent 93551ca58e
commit bcfffc07cf
3 changed files with 44 additions and 0 deletions

View File

@ -98,5 +98,24 @@ interface @beta Efl.Gfx.Frame_Controller
duration: double; [[Duration in seconds]]
}
}
@property sector {
[[The sector for playing section.
Returns the start and end frame of the sector specified by the name.
]]
set {
return: bool; [[ Returns $true if sector and frame set success. ]]
}
get {
return: bool; [[ Returns $true if frames get success. ]]
}
keys {
name: string; [[ The name of sector ]]
}
values {
startframe: int; [[ The start frame of sector ]]
endframe: int; [[ The end frame of sector ]]
}
}
}
}

View File

@ -943,6 +943,30 @@ _efl_canvas_vg_object_efl_gfx_frame_controller_frame_duration_get(const Eo *eo_o
return evas_cache_vg_anim_duration_get(pd->vg_entry);
}
Eina_Bool _efl_canvas_vg_object_efl_gfx_frame_controller_sector_set(Eo *obj EINA_UNUSED,
Efl_Canvas_Vg_Object_Data *pd,
const char *name,
int startframe,
int endframe)
{
if (!pd->vg_entry) return EINA_FALSE;
if (!evas_cache_vg_anim_sector_set(pd->vg_entry, name, startframe, endframe))
return EINA_FALSE;
return EINA_TRUE;
}
Eina_Bool _efl_canvas_vg_object_efl_gfx_frame_controller_sector_get(const Eo *obj EINA_UNUSED,
Efl_Canvas_Vg_Object_Data *pd,
const char *name,
int *startframe,
int *endframe)
{
if (!pd->vg_entry) return EINA_FALSE;
if (!evas_cache_vg_anim_sector_get(pd->vg_entry, name, startframe, endframe))
return EINA_FALSE;
return EINA_TRUE;
}
EOLIAN static Eina_Bool
_efl_canvas_vg_object_efl_gfx_frame_controller_frame_set(Eo *eo_obj,
Efl_Canvas_Vg_Object_Data *pd,

View File

@ -89,5 +89,6 @@ class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File,
Efl.Gfx.Frame_Controller.loop_type { get; }
Efl.Gfx.Frame_Controller.loop_count { get; }
Efl.Gfx.Frame_Controller.frame_duration { get; }
Efl.Gfx.Frame_Controller.sector { set; get; }
}
}