summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_vg_animation.eo
blob: d1d3796c17a7337b545907a6265649603a1edc50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

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; }
   }
}