efl/src/lib/elementary/efl_ui_vg_animation.eo

226 lines
7.7 KiB
Plaintext

enum @beta Efl.Ui.Vg_Animation_State
{
[[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 [[Vg Animation successfully loaded a file then readied for playing.
Otherwise after finished animation or stopped forcibly by request.]]
}
class @beta Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player
{
[[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.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_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 vg animation opened file successfully,
yet to play it plus when the object is visible.
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.
Warning: This auto play will be only affected to the next animation source.
So must be called before setting animation file.
]]
set {
}
get {
}
values {
autoplay: bool(false); [[Auto play mode.]]
}
}
@property autorepeat {
[[Turn on/off animation looping.
If @.autorepeat is $true, it repeats animation when animation frame is reached to
end. This auto repeat mode is valid to both playing and playing_backwards cases.
$true Enable auto play mode, disable otherwise.
]]
set {
}
get {
}
values {
autorepeat: bool; [[Loop mode, Default is $false.]]
}
}
@property duration_time {
[[Get the duration of animation in seconds.
This API returns total duration time of current animation in the seconds.
If current animation source isn't animatable, it returns zero.
]]
get {
}
values {
frame_duration: double; [[duration time in the seconds]]
}
}
@property frame {
[[Number of current frame.
Ranges from 0 to @.frame_count - 1.
]]
set {
}
get {
}
values {
frame_num: int; [[Current frame number.]]
}
}
playing_sector {
[[Play animation of sector one time instantly when it's available.
If end sector is NULL, only start sector is referenced.
If both the start and end sectors are valid,
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 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.
]]
params {
@in start: string; [[ The name of start sector ]]
@in end: string; [[ The name of end sector ]]
}
return: bool; [[$true when it's successful. $false otherwise.]]
}
@property default_view_size {
[[The default view size that specified from vector resource.
]]
get {
}
values {
size: Eina.Size2D;
}
}
@property state {
[[Current vg animation state.
See @Efl.Ui.Vg_Animation_State
]]
get{
}
values {
state: Efl.Ui.Vg_Animation_State; [[Current vg animation state]]
}
}
@property frame_count {
[[The index of end frame of the vg animation, if it's animated.
Note : frame number starts with 0.
]]
get {
}
values {
frame_count: int; [[The number of frames. 0, if it's not animated.]]
}
}
@property min_progress {
[[The start progress of the play.
]]
set {
}
get {
}
values {
min_progress: double(0.0); [[The minimum progress. Value must be 0 ~ 1.]]
}
}
@property max_progress {
[[The last progress of the play.
]]
set {
}
get {
}
values {
max_progress: double(1.0); [[The maximum progress. Value must be 0 ~ 1.]]
}
}
@property min_frame {
[[The start frame of the play.
]]
set {
}
get {
}
values {
min_frame: int(0); [[The minimum frame for play. Value must be 0 ~ @.max_frame]]
}
}
@property max_frame {
[[The last frame of the play.
]]
set {
}
get {
}
values {
max_frame: int; [[The maximum frame for play. Value must be @.min_frame ~ (@.frame_count - 1).
The default value is @.frame_count - 1.
]]
}
}
value_provider_override{
[[Override each value of the animation object.
Values can be properties of Efl.Gfx.Vg.Value_provider such as color and matrix information.
Example:
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_vg_animation, vg);
See @Efl.Gfx.Vg.Value_Provider
]]
params {
value_provider: Efl.Gfx.Vg.Value_Provider; [[ Override the values of the animation object. this should have keypath infomation. See @Efl.Gfx.Vg.Value_Provider ]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.destructor;
Efl.File.load;
Efl.File.unload;
Efl.Gfx.Entity.visible { set; }
Efl.Gfx.Entity.position { set; }
Efl.Gfx.Entity.size { set; }
Efl.Gfx.View.view_size { set; get; }
Efl.Player.playing { set; get; }
Efl.Player.paused { set; get; }
Efl.Player.playback_position { set; get; }
Efl.Player.playback_progress { get; set; }
Efl.Player.playback_speed { set; get; }
}
events {
play,start: void; [[Called when animation is just started]]
play,repeat: void; [[Called when animation is just repeated]]
play,done: void; [[Called when animation is just finished]]
play,pause: void; [[Called when animation is just paused]]
play,resume: void; [[Called when animation is just resumed]]
play,stop: void; [[Called when animation is just stopped]]
play,update: void; [[Called when animation is just updated]]
}
}