diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/eo/eina_types.eot | 6 | ||||
-rw-r--r-- | src/lib/evas/canvas/efl_input_pointer.c | 14 | ||||
-rw-r--r-- | src/lib/evas/canvas/efl_input_pointer.eo | 20 |
3 files changed, 36 insertions, 4 deletions
diff --git a/src/lib/eo/eina_types.eot b/src/lib/eo/eina_types.eot index f340ef3b0a..d483fe8eea 100644 --- a/src/lib/eo/eina_types.eot +++ b/src/lib/eo/eina_types.eot | |||
@@ -21,6 +21,12 @@ struct @extern Eina.Size2D { | |||
21 | 21 | ||
22 | struct @extern Eina.File; [[Eina file data structure]] | 22 | struct @extern Eina.File; [[Eina file data structure]] |
23 | 23 | ||
24 | struct @extern Eina.Vector2 { | ||
25 | [[A simple 2D vector type using floating point values.]] | ||
26 | x: double; [[X coordinate.]] | ||
27 | y: double; [[Y coordinate.]] | ||
28 | } | ||
29 | |||
24 | struct @extern Eina.Matrix3 { | 30 | struct @extern Eina.Matrix3 { |
25 | [[Eina 3x3 Matrix]] | 31 | [[Eina 3x3 Matrix]] |
26 | xx: double; [[XX matrix value]] | 32 | xx: double; [[XX matrix value]] |
diff --git a/src/lib/evas/canvas/efl_input_pointer.c b/src/lib/evas/canvas/efl_input_pointer.c index 2d30ddb910..6e95a11bc0 100644 --- a/src/lib/evas/canvas/efl_input_pointer.c +++ b/src/lib/evas/canvas/efl_input_pointer.c | |||
@@ -224,6 +224,20 @@ _efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) | |||
224 | } | 224 | } |
225 | 225 | ||
226 | EOLIAN static void | 226 | EOLIAN static void |
227 | _efl_input_pointer_precise_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Vector2 pos) | ||
228 | { | ||
229 | _efl_input_value_mark(pd, EFL_INPUT_VALUE_X); | ||
230 | _efl_input_value_mark(pd, EFL_INPUT_VALUE_Y); | ||
231 | pd->cur = pos; | ||
232 | } | ||
233 | |||
234 | EOLIAN static Eina_Vector2 | ||
235 | _efl_input_pointer_precise_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd) | ||
236 | { | ||
237 | return pd->cur; | ||
238 | } | ||
239 | |||
240 | EOLIAN static void | ||
227 | _efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Position2D pos) | 241 | _efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Position2D pos) |
228 | { | 242 | { |
229 | _efl_input_value_mark(pd, EFL_INPUT_VALUE_PREVIOUS_X); | 243 | _efl_input_value_mark(pd, EFL_INPUT_VALUE_PREVIOUS_X); |
diff --git a/src/lib/evas/canvas/efl_input_pointer.eo b/src/lib/evas/canvas/efl_input_pointer.eo index dd8ccd210d..1519e93243 100644 --- a/src/lib/evas/canvas/efl_input_pointer.eo +++ b/src/lib/evas/canvas/efl_input_pointer.eo | |||
@@ -70,15 +70,27 @@ class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State) | |||
70 | @property position { | 70 | @property position { |
71 | [[Position where the event happened, relative to the window. | 71 | [[Position where the event happened, relative to the window. |
72 | 72 | ||
73 | This position, in integers, is an approximation of | 73 | See @.precise_position for floating point precision (subpixel |
74 | @.value.get($x), @.value.get($y). Use @.position if you need | 74 | location). |
75 | simple pixel positions, but prefer the generic interface | ||
76 | if you need precise coordinates. | ||
77 | ]] | 75 | ]] |
78 | values { | 76 | values { |
79 | pos: Eina.Position2D; [[The position of the event, in pixels.]] | 77 | pos: Eina.Position2D; [[The position of the event, in pixels.]] |
80 | } | 78 | } |
81 | } | 79 | } |
80 | @property precise_position { | ||
81 | [[Position where the event happened, relative to the window. | ||
82 | |||
83 | This position is in floating point values, for more precise | ||
84 | coordinates, in subpixels. Note that many input devices are unable | ||
85 | to give better precision than a single pixel, so this may be | ||
86 | equal to @.position. | ||
87 | |||
88 | See also @.position. | ||
89 | ]] | ||
90 | values { | ||
91 | pos: Eina.Vector2; [[The position of the event, in pixels.]] | ||
92 | } | ||
93 | } | ||
82 | @property previous_position { | 94 | @property previous_position { |
83 | [[Position of the previous event, valid for move events. | 95 | [[Position of the previous event, valid for move events. |
84 | 96 | ||