win: Use Eina.Size2D for pointer position
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 12:54:55 +0000 (21:54 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
Also rename the function for more consistency.

src/lib/elementary/efl_ui_win.c
src/lib/elementary/efl_ui_win.eo
src/lib/evas/canvas/efl_input_interface.eo

index 86b04d4..d7dab7c 100644 (file)
@@ -2366,10 +2366,12 @@ _efl_ui_win_efl_gfx_visible_set(Eo *obj, Efl_Ui_Win_Data *sd, Eina_Bool vis)
    else _efl_ui_win_hide(obj, sd);
 }
 
-EOLIAN static void
-_efl_ui_win_efl_input_interface_pointer_xy_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int *x, int *y)
+EOLIAN static Eina_Position2D
+_efl_ui_win_efl_input_interface_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd)
 {
-   evas_pointer_canvas_xy_get(sd->evas, x, y);
+   Eina_Position2D pos;
+   evas_pointer_canvas_xy_get(sd->evas, &pos.x, &pos.y);
+   return pos;
 }
 
 EOLIAN static Eina_Bool
index 6fd70db..2cae3d7 100644 (file)
@@ -849,7 +849,7 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, Efl.Access.Window,
       Efl.Gfx.Size.Hint.hint_aspect { set; }
       Efl.Gfx.Size.Hint.hint_max { set; }
       Efl.Text.text { get; set; }
-      Efl.Input.Interface.pointer_xy { get; }
+      Efl.Input.Interface.pointer_position { get; }
       Efl.Input.Interface.pointer_inside { get; }
       Efl.Input.Interface.pointer_iterate;
       Efl.Canvas.image_max_size { get; }
index 5ee9782..2db729c 100644 (file)
@@ -1,3 +1,5 @@
+import eina_types;
+
 interface Efl.Input.Interface ()
 {
    [[An object implementing this interface can send pointer events.
@@ -24,19 +26,16 @@ interface Efl.Input.Interface ()
    eo_prefix: efl_input;
    event_prefix: efl;
    methods {
-      @property pointer_xy {
+      @property pointer_position {
          get {
             [[This function returns the current known pointer coordinates
 
-              This function returns the current known canvas unit
-              coordinates of the mouse pointer and sets the contents of
-              the Evas_Coords pointed to by $x and $y to contain these
-              coordinates.
+              This function returns the current position of the main input
+              pointer (mouse, pen, etc...).
             ]]
          }
          values {
-            x: int; [[The pointer to hold the return value of pointer's x position.]]
-            y: int; [[The pointer to hold the return value of pointer's y position.]]
+            pos: Eina.Position2D; [[The pointer position in pixels.]]
          }
       }
       @property pointer_inside {