efl: Add precise_position for input events
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 11:42:52 +0000 (20:42 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
The previous commit removed useless delta

src/lib/eo/eina_types.eot
src/lib/evas/canvas/efl_input_pointer.c
src/lib/evas/canvas/efl_input_pointer.eo

index f340ef3..d483fe8 100644 (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]]
index 2d30ddb..6e95a11 100644 (file)
@@ -224,6 +224,20 @@ _efl_input_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd)
 }
 
 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)
 {
    _efl_input_value_mark(pd, EFL_INPUT_VALUE_PREVIOUS_X);
index dd8ccd2..1519e93 100644 (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.