efl: Add precise_position for input events

The previous commit removed useless delta
This commit is contained in:
Jean-Philippe Andre 2017-09-18 20:42:52 +09:00
parent e28aba0542
commit 986e5e8827
3 changed files with 36 additions and 4 deletions

View File

@ -21,6 +21,12 @@ struct @extern Eina.Size2D {
struct @extern Eina.File; [[Eina file data structure]]
struct @extern Eina.Vector2 {
[[A simple 2D vector type using floating point values.]]
x: double; [[X coordinate.]]
y: double; [[Y coordinate.]]
}
struct @extern Eina.Matrix3 {
[[Eina 3x3 Matrix]]
xx: double; [[XX matrix value]]

View File

@ -223,6 +223,20 @@ _efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
return EINA_POSITION2D((int) pd->cur.x, (int) pd->cur.y);
}
EOLIAN static void
_efl_input_pointer_precise_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Vector2 pos)
{
_efl_input_value_mark(pd, EFL_INPUT_VALUE_X);
_efl_input_value_mark(pd, EFL_INPUT_VALUE_Y);
pd->cur = pos;
}
EOLIAN static Eina_Vector2
_efl_input_pointer_precise_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
{
return pd->cur;
}
EOLIAN static void
_efl_input_pointer_previous_position_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Eina_Position2D pos)
{

View File

@ -70,15 +70,27 @@ class Efl.Input.Pointer (Efl.Object, Efl.Input.Event, Efl.Input.State)
@property position {
[[Position where the event happened, relative to the window.
This position, in integers, is an approximation of
@.value.get($x), @.value.get($y). Use @.position if you need
simple pixel positions, but prefer the generic interface
if you need precise coordinates.
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.