summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_gfx_frame_controller.eo
blob: dcb54f6eea047e8d7d3874fb38daa6f742a712be (plain) (blame)
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
/* FIXME: invalid type from evas/emile! */
/* type @extern Evas.Animated_Loop_Hint: int; */

enum Efl.Gfx.Frame_Controller_Loop_Hint {
   [[Frame loop modes]]
   none = 0,       [[No looping order specified.]]
   loop = 1,       [[Standard loop: 1->2->3->1->2->3->1]]
   pingpong = 2    [[Ping-pong bouncing loop: 1->2->3->2->1->2->3->1]]
}

interface Efl.Gfx.Frame_Controller
{
   [[Efl frame controller of frame based animated object interface.]]

   methods {
      @property animated {
         get {
            [[Check if an object can be animated (has multiple frames).

              This will be $true for animated object for instance but $false
              for still image.

              @since 1.1
            ]]
         }
         values {
            is_animated: bool; [[$true if the object is animated]]
         }
      }
      @property frame {
         [[Index of the current frame of an animated object.

           Ranges from 1 to @.frame_count. Valid only if @.animated.
         ]]
         set {
            [[Set the frame to current frame of an animated object.

              @since 1.1
            ]]
            return: bool; [[Returns $true if the frame index is valid.]]
         }
         get {}
         values {
            frame_index: int; [[The index of current frame.]]
         }
      }
      @property frame_count {
         get {
            [[Get the total number of frames of the object, if animated.

              Returns -1 if not animated.

              @since 1.1
            ]]
            return: int; [[The number of frames in the animated object.]]
         }
      }
      @property loop_type {
         /* FIXME: external type used from evas / emile */
         get {
            [[Get the kind of looping the animated object does.

              This returns the kind of looping the animated object wants to do.

              If it returns @Efl.Gfx.Frame_Controller_Loop_Hint.loop, you should
              display frames in a sequence like: 1->2->3->1->2->3->1...

              If it returns @Efl.Gfx.Frame_Controller_Loop_Hint.pingpong, it is
              better to display frames in a sequence like:
              1->2->3->2->1->2->3->1...

              The default type is @Efl.Gfx.Frame_Controller_Loop_Hint.loop.

              @since 1.1
            ]]
            return: Efl.Gfx.Frame_Controller_Loop_Hint; [[Loop type of the animated object.]]
         }
      }
      @property loop_count {
         get {
            [[Get the number times the animation of the object loops.

              This returns loop count of animated object. The loop count is the number
              of times the animation will play fully from first to last frame
              until the animation should stop (at the final frame).

              If 0 is returned, then looping should happen indefinitely
              (no limit to the number of times it loops).

              @since 1.1
            ]]
            return: int; [[The number of loop of an animated object.]]
         }
      }
      @property frame_duration {
         get {
            [[Get the duration of a sequence of frames.

              This returns total duration in seconds that the specified
              sequence of frames should take.

              If $start_frame is 1 and $frame_num is 0, this returns the
              duration of frame 1. If $start_frame is 1 and $frame_num is 1,
              this returns the total duration of frame 1 + frame 2.

              @since 1.1
            ]]
         }
         keys {
            start_frame: int; [[The first frame, rangers from 1 to @.frame_count.]]
            frame_num: int; [[Number of frames in the sequence, starts from 0.]]
         }
         values {
            duration: double; [[Duration in seconds]]
         }
      }
   }
}