diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas.eo index 2711111c73..98da146f5f 100644 --- a/src/lib/efl/interfaces/efl_canvas.eo +++ b/src/lib/efl/interfaces/efl_canvas.eo @@ -209,10 +209,10 @@ interface Efl.Canvas () A canvas begins with the mouse being assumed outside ($false). ]] } - /* keys { + keys { seat: Efl.Input.Device @optional; [[The seat to consider, if $null then the default seat will be used.]] - } */ + } values { inside: bool; [[$true if the mouse pointer is inside the canvas, $false otherwise]] diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 09615f78f8..58b7fc1171 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -2363,9 +2363,9 @@ _efl_ui_win_efl_canvas_pointer_position_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data } EOLIAN static Eina_Bool -_efl_ui_win_efl_canvas_pointer_inside_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd) +_efl_ui_win_efl_canvas_pointer_inside_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eo *dev) { - return evas_pointer_inside_get(sd->evas); + return efl_canvas_pointer_inside_get(sd->evas, dev); } /* multi touch support */ diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 32ef78e4c1..e900090b88 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -1032,6 +1032,20 @@ EAPI const Evas_Lock *evas_key_lock_get(const Evas *obj) EINA_WARN_UNUSED_RESULT * @} */ +/** + * @brief Returns whether the mouse pointer is logically inside the canvas. + * + * @param[in] obj The object. + * @param[in] dev The pointer device. + * + * @return @c true if the pointer is inside, @c false otherwise. + * + * @since 1.19 + * + * @ingroup Evas_Canvas + */ +EAPI Eina_Bool evas_pointer_inside_by_device_get(const Evas *obj, Efl_Input_Device *dev); + /** * @brief Returns whether the default mouse pointer is logically inside the * canvas. diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index cb6b902738..6da7eef058 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -269,17 +269,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, y: int; [[The pointer to an integer to be filled in.]] } } - @property pointer_inside_by_device { - [[Returns whether the mouse pointer is logically inside the - canvas. @since 1.19]] - keys { - dev: Efl.Input.Device; [[The pointer device.]] - } - get {} - values { - in: bool; [[$true if the pointer is inside, $false otherwise.]] - } - } @property image_max_size { get { [[Get the maximum image size evas can possibly handle. diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 3266af17ad..04c6cb06a7 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -634,9 +634,9 @@ _evas_canvas_pointer_button_down_mask_by_device_get(Eo *eo_e EINA_UNUSED, } EOLIAN static Eina_Bool -_evas_canvas_pointer_inside_by_device_get(Eo *eo_e EINA_UNUSED, - Evas_Public_Data *e, - Efl_Input_Device *dev) +_evas_canvas_efl_canvas_pointer_inside_get(Eo *eo_e EINA_UNUSED, + Evas_Public_Data *e, + Eo *dev) { Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, dev); if (!pdata) return EINA_FALSE; @@ -661,12 +661,6 @@ _evas_canvas_pointer_button_down_mask_get(Eo *eo_e, Evas_Public_Data *e) return _evas_canvas_pointer_button_down_mask_by_device_get(eo_e, e, NULL); } -EOLIAN static Eina_Bool -_evas_canvas_efl_canvas_pointer_inside_get(Eo *eo_e, Evas_Public_Data *e) -{ - return _evas_canvas_pointer_inside_by_device_get(eo_e, e, NULL); -} - EOLIAN static void _evas_canvas_data_attach_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, void *data) { @@ -1300,7 +1294,13 @@ _evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj, EAPI Eina_Bool evas_pointer_inside_get(const Evas *obj) { - return efl_canvas_pointer_inside_get(obj); + return efl_canvas_pointer_inside_get(obj, NULL); +} + +EAPI Eina_Bool +evas_pointer_inside_by_device_get(const Evas *obj, Eo *dev) +{ + return efl_canvas_pointer_inside_get(obj, dev); } /* Internal EO APIs */ diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index 45855647ba..62315ff60b 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -349,7 +349,7 @@ _inputs_timer3_cb(void *data) eina_iterator_free(it); fail_if(cnt != 2); // 2 moves (in the list), 2 ups (gone) - fail_if(!efl_canvas_pointer_inside_get(win)); + fail_if(!efl_canvas_pointer_inside_get(win, NULL)); pos = efl_canvas_pointer_position_get(win); ck_assert_int_eq(pos.x, points[1][0].x); ck_assert_int_eq(pos.y, points[1][0].y);