summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_event_pointer.eo
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-08-23 18:12:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-26 10:18:01 +0900
commit8938d8d557393b009d4db1058bcc3e342a1a9008 (patch)
tree57e642f2cc0f8617fd3df9ddf24e0d7be8557111 /src/lib/evas/canvas/efl_event_pointer.eo
parentef4859d5bdab3a9d8c5d7e2114c1d42bcc94f50f (diff)
evas events: Rename properties and introduce generic value
This paves the way to a merge of pointer and axis events into the class Efl.Event.Pointer.
Diffstat (limited to 'src/lib/evas/canvas/efl_event_pointer.eo')
-rw-r--r--src/lib/evas/canvas/efl_event_pointer.eo102
1 files changed, 68 insertions, 34 deletions
diff --git a/src/lib/evas/canvas/efl_event_pointer.eo b/src/lib/evas/canvas/efl_event_pointer.eo
index e73866a..2722d1c 100644
--- a/src/lib/evas/canvas/efl_event_pointer.eo
+++ b/src/lib/evas/canvas/efl_event_pointer.eo
@@ -3,7 +3,7 @@ import efl_event_types;
3 3
4class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input) 4class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input)
5{ 5{
6 [[Event data carried over with any pointer event (mouse, touch, ...) 6 [[Event data carried over with any pointer event (mouse, touch, pen, ...)
7 7
8 @since 1.18 8 @since 1.18
9 ]] 9 ]]
@@ -14,14 +14,52 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input
14 act: Efl.Pointer.Action; 14 act: Efl.Pointer.Action;
15 } 15 }
16 } 16 }
17 @property value_has {
18 [[$true if this event carries a valid value for the specified $key.]]
19 get {}
20 keys {
21 key: Efl.Input.Value;
22 }
23 values {
24 has: bool;
25 }
26 }
27 @property value {
28 [[Represents a generic value for this event.
29
30 Refer to the documentation of @Efl.Input.Value for each value's
31 meaning, type and range. Call @.value_has.get to determine whether
32 the returned value is valid or not for this event.
33
34 Most values are precise floating point values, usually in pixels,
35 radians, or in a range of [-1, 1] or [0, 1]. Some values are
36 discrete values (integers) and thus should preferably be queried
37 with the other methods of this class.
38 ]]
39 set {
40 return: bool; [[$false if the value could not be set (eg. delta).]]
41 }
42 get {}
43 keys {
44 key: Efl.Input.Value;
45 }
46 values {
47 val: double;
48 }
49 }
17 @property button { 50 @property button {
18 [[The mouse button that triggered the event.]] 51 [[The mouse button that triggered the event.
52
53 Valid if and only if @.value_has($button) is $true.
54 ]]
19 values { 55 values {
20 but: int; [[1 to 32, 0 if not a button event.]] 56 but: int; [[1 to 32, 0 if not a button event.]]
21 } 57 }
22 } 58 }
23 @property button_pressed { 59 @property button_pressed {
24 [[Whether a mouse button is pressed at the moment of the event.]] 60 [[Whether a mouse button is pressed at the moment of the event.
61
62 Valid if and only if @.value_has($button_pressed) is $true.]]
25 keys { 63 keys {
26 button: int; 64 button: int;
27 } 65 }
@@ -30,59 +68,53 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input
30 } 68 }
31 } 69 }
32 @property position { 70 @property position {
33 [[Position where the event happened, relative to the window.]] 71 [[Position where the event happened, relative to the window.
34 values {
35 x: int;
36 y: int;
37 }
38 }
39 @property position_precise {
40 [[Position where the event happened, with subpixel precision
41 72
42 Note: Same value as @.position, relative to the window. 73 This position, in integers, is an approximation of
74 @.value.get($x), @.value.get($y). Use @.position if you need
75 simple pixel positions, but prefer the generic interface
76 if you need precise coordinates.
43 ]] 77 ]]
44 values { 78 values {
45 x: double; 79 x: int;
46 y: double; 80 y: int;
47 } 81 }
48 } 82 }
49 @property previous_position { 83 @property previous_position {
50 [[Position of the previous event, valid for move events. 84 [[Position of the previous event, valid for move events.
51 85
52 Relative to the window. May be equal to @.position. 86 Relative to the window. May be equal to @.position (by default).
87
88 This position, in integers, is an approximation of
89 @.value.get($previous_x), @.value.get($previous_y).
90 Use @.previous_position if you need simple pixel positions,
91 but prefer the generic interface if you need precise coordinates.
53 ]] 92 ]]
54 values { 93 values {
55 x: int; 94 x: int;
56 y: int; 95 y: int;
57 } 96 }
58 } 97 }
59 @property previous_position_precise { 98 @property delta {
60 [[Position of the previous event, with subpixel precision. 99 [[Position delta, or movement, since the last event.
61 100
62 Valid for move events, may not be valid for other events. 101 This position, in integers, is an approximation of
63 Relative to the window. May be equal to @.position_precise. 102 @.value.get($dx), @.value.get($dy). Use @.delta if you need
103 simple pixel positions, but prefer the generic interface
104 if you need precise coordinates.
64 ]] 105 ]]
106 get {}
65 values { 107 values {
66 x: double; 108 dx: int;
67 y: double; 109 dy: int;
68 } 110 }
69 } 111 }
70 @property finger { 112 @property tool {
71 [[Finger ID in case of a multi touch event.]] 113 [[ID of the tool (eg. pen) that triggered this event.]]
72 values { 114 values {
73 id: int; 115 id: int;
74 } 116 }
75 } 117 }
76 @property touch {
77 [[Touch information about a specific finger or pointer.]]
78 values {
79 radius: double;
80 rad_x: double;
81 rad_y: double;
82 pressure: double;
83 angle: double;
84 }
85 }
86 @property source { 118 @property source {
87 [[The object where this event first originated, in case of 119 [[The object where this event first originated, in case of
88 propagation or repetition of the event. 120 propagation or repetition of the event.
@@ -116,11 +148,13 @@ class Efl.Event.Pointer (Efl.Object, Efl.Event, Efl.Input.State, Efl.Event.Input
116 } 148 }
117 } 149 }
118 @property wheel_direction { 150 @property wheel_direction {
151 [[Direction of the wheel.]]
119 values { 152 values {
120 dir: Efl.Orient; [[Horizontal or Vertical only.]] 153 dir: Efl.Orient; [[Horizontal or Vertical only.]]
121 } 154 }
122 } 155 }
123 @property wheel_distance { 156 @property wheel_delta {
157 [[Delta movement of the wheel in discrete steps.]]
124 values { 158 values {
125 dist: int; 159 dist: int;
126 } 160 }