efl/src/lib/elementary/efl_ui_vg_animation.eo

177 lines
5.8 KiB
Plaintext

enum Efl.Ui.Vg_Animation_State
{
[[State of vg_animation
@since 1.24
]]
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 Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player, Efl.Playable
{
[[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.
@since 1.24
]]
event_c_prefix: efl_ui_vg_animation;
methods {
@property frame {
[[Number of current frame.
Ranges from 0 to @.frame_count - 1.
]]
set {
}
get {
}
values {
frame_num: int; [[Current frame number.]]
}
}
@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.
]]
}
}
playing_sector @beta {
[[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.]]
}
value_provider_override @beta {
[[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; }
Efl.Playable.length { get; }
Efl.Playable.playable { get; }
Efl.Playable.seekable { get; }
Efl.Player.autoplay { set; get; }
Efl.Player.playback_loop { set; get; }
}
}