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

enum Efl.Image.Animated.Loop_Hint {
   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]]
}

/* FIXME: rename to Efl.Image.Animated when eo/eolian are fixed */

interface Efl.Image.Animated ()
{
   legacy_prefix: null;
   eo_prefix: efl_image;

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

              This will be $true for animated Gif files for instance but $false
              for still images.

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

           Ranges from 1 to @.animated_frame_count. Valid only if @.animated.
         ]]
         set {
            [[Set the frame to current frame of an image 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 animated_frame_count {
         get {
            [[Get the total number of frames of the image, if animated.

              Returns -1 if not animated.

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

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

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

              If it returns @Efl.Image.Animated.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.Image.Animated.Loop_Hint.loop.

              @since 1.1
            ]]
            return: Efl.Image.Animated.Loop_Hint; [[Loop type of the image object.]]
         }
      }
      @property animated_loop_count {
         get {
            [[Get the number times the animation of the object loops.

              This returns loop count of image. 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 image object.]]
         }
      }
      @property animated_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 @.animated_frame_count.]]
            frame_num: int; [[Number of frames in the sequence, starts from 0.]]
         }
         values {
            duration: double;
         }
      }
   }
}