From: Jean-Philippe Andre Date: Mon, 18 Sep 2017 12:54:55 +0000 (+0900) Subject: win: Use Eina.Size2D for pointer position X-Git-Tag: submit/sandbox/upgrade/efl120/20180319.053334~2587 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3617053547dd130115af7c79346339ca86375679;p=platform%2Fupstream%2Fefl.git win: Use Eina.Size2D for pointer position Also rename the function for more consistency. --- diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 86b04d4..d7dab7c 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -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 diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo index 6fd70db..2cae3d7 100644 --- a/src/lib/elementary/efl_ui_win.eo +++ b/src/lib/elementary/efl_ui_win.eo @@ -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; } diff --git a/src/lib/evas/canvas/efl_input_interface.eo b/src/lib/evas/canvas/efl_input_interface.eo index 5ee9782..2db729c 100644 --- a/src/lib/evas/canvas/efl_input_interface.eo +++ b/src/lib/evas/canvas/efl_input_interface.eo @@ -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 {