summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_gesture_layer.eo
blob: 6f384ed8d9ae006fa9de130107d455b18186f0ac (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
type Elm_Gesture_Event_Cb: __undefined_type; [[Elementary gesture event callback type]]

enum Elm.Gesture.Type
{
   [[
     Enum of supported gesture types.
   ]]
   legacy: elm_gesture;
   first = 0, [[First type used for iteration over the enum]]
   n_taps, [[N fingers single taps]]
   n_long_taps, [[N fingers single long-taps]]
   n_double_taps, [[N fingers double-single taps]]
   n_triple_taps, [[N fingers triple-single taps]]
   momentum, [[Reports momentum in the direction of move]]
   n_lines, [[N fingers line gesture]]
   n_flicks, [[N fingers flick gesture]]
   zoom, [[Zoom]]
   rotate, [[Rotate]]
   last [[Sentinel value to indicate last enum field during iteration]]
}

enum Elm.Gesture.State
{
   [[
     Enum of gesture states.
   ]]
   undefined = -1, [[Gesture not started]]
   start, [[Gesture started]]
   move, [[Gesture is ongoing]]
   end, [[Gesture completed]]
   abort [[Ongoing gesture was aborted]]
}

class Elm.Gesture_Layer (Efl.Ui.Widget, Efl.Ui.Legacy)
{
   [[Elementary gesture layer class]]
   legacy_prefix: elm_gesture_layer;
   eo_prefix: elm_obj_gesture_layer;
   methods {
      @property zoom_step {
            [[Control step value for zoom action.]]
         set {
            [[When recognizing the zoom gesture, it should be recognized as zooming larger
              than step.
            ]]
         }
         get {
         }
         values {
            step: double; [[The zoom step value.]]
         }
      }
      @property tap_finger_size {
         set {
            [[This function sets the gesture layer finger-size for taps.

              If not set, it's taken from elm_config.
              Set to 0 if you want GLayer to use the system finger size
              value (default).

              @since 1.8
            ]]
         }
         get {
            [[This function returns the gesture layer finger-size for taps

              @since 1.8
            ]]
         }
         values {
            sz: int; [[The finger size.]]
         }
      }
      @property hold_events {
         set {
            [[This function makes gesture-layer repeat events.

              Set this if you like to get the raw events only if gestures
              were not detected.

              Clear this if you like gesture layer to forward events as
              testing gestures.
            ]]
         }
         get {
            [[Get the repeat-events setting.]]
         }
         values {
            hold_events: bool; [[If $true get events only if gesture was not detected, $false otherwise]]
         }
      }
      @property rotate_step {
            [[This function returns step-value for rotate action.]]
         set {
            [[Set to 0 to cancel step setting.

              When recognizing the rotate gesture, the rotated size must be larger
              than step.
            ]]
         }
         get {
         }
         values {
            step: double; [[New rotate step value.]]
         }
      }
      @property cb {
         set {
            [[Set the gesture state change callback.

              When all callbacks for the gesture are set to $null,
              it means this gesture is disabled.
            ]]
         }
         values {
            idx: Elm.Gesture.Type; [[The gesture you want to track state of.]]
            cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]]
            cb: Elm_Gesture_Event_Cb; [[The callback itself.]]
            data: void_ptr @optional; [[Custom data to be passed.]]
         }
      }
      attach {
         [[Attach a gesture layer widget to an Evas object (setting the
           widget's target).

           A gesture layer's target may be any Evas object. This object
           will be used to listen to mouse and key events.
         ]]
         return: bool; [[$true on success, $false otherwise.]]
         params {
            @in target: Efl.Canvas.Object; [[The object to attach.]]
         }
      }
      cb_del {
         [[Remove a gesture callback.]]
         params {
            @in idx: Elm.Gesture.Type; [[The gesture you want to track state of.]]
            @in cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]]
            @in cb: Elm_Gesture_Event_Cb; [[The callback itself.]]
            @in data: void_ptr @nullable; [[Custom callback data.]]
         }
      }
      cb_add {
         [[Add a gesture state change callback.

           When all callbacks for the gesture are set to $null,
           it means this gesture is disabled.

           If a function was already set for this gesture/type/state, it
           will be replaced by the new one. For ABI compat, callbacks
           added by @.cb_add will be removed. It is recommended to
           use only one of these functions for a gesture object.
         ]]
         params {
            @in idx: Elm.Gesture.Type; [[The gesture you want to track state of.]]
            @in cb_type: Elm.Gesture.State; [[The event the callback tracks (START, MOVE, END, ABORT).]]
            @in cb: Elm_Gesture_Event_Cb; [[The callback itself.]]
            @in data: void_ptr @optional; [[Custom data to be passed.]]
         }
      }
   }
   implements {
      class.constructor;
      Efl.Object.constructor;
      Efl.Ui.Widget.on_disabled_update;
   }
}