summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_input_pointer.eo
blob: 03516b62a7413b741a6f2a98c8ea66d2e318383f (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
177
178
179
import efl_input_types;

class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
{
   [[Event data carried over with any pointer event (mouse, touch, pen, ...)

     @since 1.18
   ]]
   methods {
      @property action {
         [[The action represented by this event.]]
         values {
            act: Efl.Pointer.Action; [[Event action]]
         }
      }
      @property value_has {
         [[$true if this event carries a valid value for the specified $key.]]
         get {}
         keys {
            key: Efl.Input.Value; [[Pressed $key]]
         }
         values {
            has: bool; [[$true if input value is valid, $false otherwise]]
         }
      }
      @property value {
         [[Represents a generic value for this event.

           Refer to the documentation of @Efl.Input.Value for each value's
           meaning, type and range. Call @.value_has.get to determine whether
           the returned value is valid or not for this event.

           Most values are precise floating point values, usually in pixels,
           radians, or in a range of [-1, 1] or [0, 1]. Some values are
           discrete values (integers) and thus should preferably be queried
           with the other methods of this class.
         ]]
         set {
            return: bool; [[$false if the value could not be set (eg. delta).]]
         }
         get {}
         keys {
            key: Efl.Input.Value; [[$key]]
         }
         values {
            val: double; [[$key value]]
         }
      }
      @property button {
         [[The mouse button that triggered the event.

           Valid if and only if @.value_has($button) is $true.
         ]]
         values {
            but: int; [[1 to 32, 0 if not a button event.]]
         }
      }
      @property button_pressed {
         [[Whether a mouse button is pressed at the moment of the event.

           Valid if and only if @.value_has($button_pressed) is $true.]]
         keys {
            button: int; [[1 to 32, 0 if not a button event.]]
         }
         values {
            pressed: bool; [[$true when the button was pressed, $false otherwise]]
         }
      }
      @property position {
         [[Position where the event happened, relative to the window.

           See @.precise_position for floating point precision (subpixel
           location).
         ]]
         values {
            pos: Eina.Position2D; [[The position of the event, in pixels.]]
         }
      }
      @property precise_position {
         [[Position where the event happened, relative to the window.

           This position is in floating point values, for more precise
           coordinates, in subpixels. Note that many input devices are unable
           to give better precision than a single pixel, so this may be
           equal to @.position.

           See also @.position.
         ]]
         values {
            pos: Eina.Vector2; [[The position of the event, in pixels.]]
         }
      }
      @property previous_position {
         [[Position of the previous event, valid for move events.

           Relative to the window. May be equal to @.position (by default).

           This position, in integers, is an approximation of
           @.value.get($previous_x), @.value.get($previous_y).
           Use @.previous_position if you need simple pixel positions,
           but prefer the generic interface if you need precise coordinates.
         ]]
         values {
            pos: Eina.Position2D; [[The position of the event, in pixels.]]
         }
      }
      @property tool {
         [[ID of the tool (eg. pen) that triggered this event.]]
         values {
            id: int; [[Tool ID]]
         }
      }
      @property source {
         [[The object where this event first originated, in case of
           propagation or repetition of the event.
         ]]
         values {
            src: Efl.Object; [[Source object: @Efl.Gfx.Entity]]
         }
      }
      @property button_flags {
         [[Double or triple click information.]]
         values {
            flags: Efl.Pointer.Flags; [[Button information flags]]
         }
      }
      @property double_click {
         [[$true if @.button_flags indicates a double click (2nd press).

           This is just a helper function around @.button_flags.
         ]]
         values {
            val: bool; [[$true if the button press was a double click, $false otherwise]]
         }
      }
      @property triple_click {
         [[$true if @.button_flags indicates a triple click (3rd press).

           This is just a helper function around @.button_flags.
         ]]
         values {
            val: bool; [[$true if the button press was a triple click, $false otherwise]]
         }
      }
      @property wheel_horizontal {
         [[Direction of the wheel, usually vertical.]]
         values {
            horizontal: bool(false); [[If $true this was a horizontal wheel.]]
         }
      }
      @property wheel_delta {
         [[Delta movement of the wheel in discrete steps.]]
         values {
            dist: int; [[Wheel movement delta]]
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      class.destructor;
      Efl.Input.Event.reset;
      Efl.Duplicate.duplicate;
         [[Creates a copy of this event. @Efl.Input.Event.fake is $true.

           The returned event object is similar to the given object in most
           ways except that @Efl.Input.Event.fake will be $true.

           Note: A reference is given to the caller. In order to avoid leaks
           the C API users should call $efl_unref() after use.
         ]]
      Efl.Input.Event.timestamp { get; set; }
      Efl.Input.Event.fake { get; }
      Efl.Input.Event.event_flags { get; set; }
      Efl.Input.Event.device { get; set; }
      Efl.Input.State.modifier_enabled { get; }
      Efl.Input.State.lock_enabled { get; }
   }
}