1
2enum Efl.Ui.Vg_Animation_State
3{
4   [[State of vg_animation
5
6     @since 1.24
7   ]]
8   not_ready, [[Animation is not ready to play. (Probably, it didn't file set yet or failed to read file.]]
9   playing, [[Animation is playing.]]
10   playing_backwards, [[Animation is playing backwards (rewinding).]]
11   paused, [[Animation has been paused.]]
12   stopped [[Vg Animation successfully loaded a file then readied for playing.
13          Otherwise after finished animation or stopped forcibly by request.]]
14}
15
16class Efl.Ui.Vg_Animation extends Efl.Ui.Widget implements Efl.Gfx.View, Efl.File, Efl.Player, Efl.Playable
17{
18   [[Elementary Vector Graphcis Animation class.
19     Vg Animation is designed to show and play animation of
20     vector graphics based content. It hides all @Efl.Canvas.Vg.Object details
21     but just open an API to read vector data from file. Also, it implements
22     details of animation control methods of Vector.
23
24     Vector data could contain static or animatable vector elements including
25     animation information. Available vector data file formats are SVG, JSON and EET.
26     @Efl.Ui.Vg_Animation currently only supports the animation information contained in
27     JSON (known as Lottie file as well) and EET files.
28
29     @since 1.24
30   ]]
31   event_c_prefix: efl_ui_vg_animation;
32   methods {
33      @property frame {
34         [[Number of current frame.
35
36           Ranges from 0 to @.frame_count - 1.
37         ]]
38         set {
39         }
40         get {
41         }
42         values {
43            frame_num: int; [[Current frame number.]]
44         }
45      }
46      @property default_view_size {
47         [[The default view size that specified from vector resource.
48         ]]
49         get {
50         }
51         values {
52            size: Eina.Size2D;
53         }
54      }
55      @property state {
56         [[Current vg animation state.
57           See @Efl.Ui.Vg_Animation_State
58         ]]
59         get{
60         }
61         values {
62            state: Efl.Ui.Vg_Animation_State; [[Current vg animation state]]
63         }
64      }
65      @property frame_count {
66         [[The index of end frame of the vg animation, if it's animated.
67           Note : frame number starts with 0.
68         ]]
69         get {
70         }
71         values {
72            frame_count: int; [[The number of frames. 0, if it's not animated.]]
73         }
74      }
75      @property min_progress {
76         [[The start progress of the play.
77         ]]
78         set {
79         }
80         get {
81         }
82         values {
83            min_progress: double(0.0); [[The minimum progress. Value must be 0 ~ 1.]]
84         }
85      }
86      @property max_progress {
87         [[The last progress of the play.
88         ]]
89         set {
90         }
91         get {
92         }
93         values {
94            max_progress: double(1.0); [[The maximum progress. Value must be 0 ~ 1.]]
95         }
96      }
97      @property min_frame {
98         [[The start frame of the play.
99         ]]
100         set {
101         }
102         get {
103         }
104         values {
105            min_frame: int(0); [[The minimum frame for play. Value must be 0 ~ @.max_frame]]
106         }
107      }
108      @property max_frame {
109         [[The last frame of the play.
110         ]]
111         set {
112         }
113         get {
114         }
115         values {
116            max_frame: int; [[The maximum frame for play. Value must be @.min_frame ~ (@.frame_count - 1).
117                              The default value is @.frame_count - 1.
118                            ]]
119         }
120      }
121      playing_sector @beta {
122         [[Play animation of sector one time instantly when it's available.
123
124           If end sector is NULL, only start sector is referenced.
125           If both the start and end sectors are valid,
126           Play is played and stoped at starting point of each sector.
127
128           If start is null and end is valid, playback starts from 0 frame to the start frame of the end sector.
129           If both sectors start and end are invalid. Play from 0 frame to the last frame of vg animation object.
130
131           Note: This method use to @.min_frame, @.max_frame (@.min_progress, @.max_progress) internally.
132                 So if you have changed the min or max frame(progress) it can be changed to the sector frame.
133         ]]
134         params {
135            @in start: string; [[ The name of start sector ]]
136            @in end: string; [[ The name of end sector ]]
137         }
138         return: bool; [[$true when it's successful. $false otherwise.]]
139      }
140      value_provider_override @beta {
141         [[Override each value of the animation object.
142           Values can be properties of Efl.Gfx.Vg.Value_provider such as color and matrix information.
143
144           Example:
145           Eo *vp = efl_add(EFL_GFX_VG_VALUE_PROVIDER_CLASS, NULL);
146           @Efl.Gfx.Vg.Value_Provider.keypath.set(vp, "SomeLayer:SomeObject:SomeContents");
147           // Set vp property
148           @.value_provider_override(target_vg_animation, vg);
149           See @Efl.Gfx.Vg.Value_Provider
150         ]]
151         params {
152            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 ]]
153         }
154      }
155   }
156   implements {
157      Efl.Object.constructor;
158      Efl.Object.destructor;
159      Efl.File.load;
160      Efl.File.unload;
161      Efl.Gfx.Entity.visible { set; }
162      Efl.Gfx.Entity.position { set; }
163      Efl.Gfx.Entity.size { set; }
164      Efl.Gfx.View.view_size { set; get; }
165      Efl.Player.playing { set; get; }
166      Efl.Player.paused { set; get; }
167      Efl.Player.playback_position { set; get; }
168      Efl.Player.playback_progress { get; set; }
169      Efl.Player.playback_speed { set; get; }
170      Efl.Playable.length { get; }
171      Efl.Playable.playable { get; }
172      Efl.Playable.seekable { get; }
173      Efl.Player.autoplay { set; get; }
174      Efl.Player.playback_loop { set; get; }
175   }
176}
177