From ebe945c8d878787df8ef68dcd93d12ec45e69404 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 31 Oct 2017 16:23:07 +0900 Subject: [PATCH] evas: Remove specific pointer_inside API This is a name clash. It doesn't matter too much since Evas.Canvas isn't meant to be exposed to the EO API. --- src/lib/efl/interfaces/efl_canvas.eo | 5 ++++- src/lib/evas/Evas_Legacy.h | 24 ++++++++++++++++++++++++ src/lib/evas/canvas/evas_canvas.eo | 31 +------------------------------ src/lib/evas/canvas/evas_main.c | 10 +++++++++- 4 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas.eo index 6655dab..2711111 100644 --- a/src/lib/efl/interfaces/efl_canvas.eo +++ b/src/lib/efl/interfaces/efl_canvas.eo @@ -209,7 +209,10 @@ interface Efl.Canvas () A canvas begins with the mouse being assumed outside ($false). ]] } - /* FIXME: missing keys { seat } */ + /* 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/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index ddfb67f..32ef78e 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -1033,6 +1033,30 @@ EAPI const Evas_Lock *evas_key_lock_get(const Evas *obj) EINA_WARN_UNUSED_RESULT */ /** + * @brief Returns whether the default mouse pointer is logically inside the + * canvas. + * + * When this function is called it will return a value of either @c false or + * @c true, depending on if event_feed_mouse_in or event_feed_mouse_out have + * been called to feed in a mouse enter event into the canvas. + * + * A return value of @c true indicates the mouse is logically inside the + * canvas, and @c false implies it is logically outside the canvas. + * + * A canvas begins with the mouse being assumed outside ($false). + * + * If @c e is not a valid canvas, the return value is undefined. + * + * @param[in] obj The object. + * + * @return @c true if the mouse pointer is inside the canvas, @c false + * otherwise + * + * @ingroup Evas_Canvas + */ +EAPI Eina_Bool evas_pointer_inside_get(const Evas *obj) EINA_WARN_UNUSED_RESULT; + +/** * @defgroup Evas_Touch_Point_List Touch Point List Functions * * Functions to get information of touched points in the Evas. diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index b43c3ba..cb6b902 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -280,36 +280,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, in: bool; [[$true if the pointer is inside, $false otherwise.]] } } - @property pointer_inside { - get { - [[Returns whether the default mouse pointer is logically inside the - canvas. - - When this function is called it will return a value of either - $false or $true, depending on if event_feed_mouse_in or - event_feed_mouse_out have been called to feed in a mouse - enter event into the canvas. - - A return value of $true indicates the mouse is logically - inside the canvas, and $false implies it is logically - outside the canvas. - - A canvas begins with the mouse being assumed outside ($false). - - If $e is not a valid canvas, the return value is undefined. - ]] - /* FIXME-doc - Example: - @code - extern Evas *evas; - - if (evas_pointer_inside_get(evas)) printf("Mouse is in!\n"); - else printf("Mouse is out!\n"); - @endcode - */ - return: bool @warn_unused; [[$true if the mouse pointer is inside the canvas, $false otherwise]] - } - } @property image_max_size { get { [[Get the maximum image size evas can possibly handle. @@ -1170,6 +1140,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, Efl.Object.provider_find; Efl.Loop_User.loop { get; } //Efl.Canvas.seats; + Efl.Canvas.pointer_inside { get; } Efl.Canvas.device { get; } Efl.Canvas.seat { get; } } diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 9efd0ca..3266af1 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -662,7 +662,7 @@ _evas_canvas_pointer_button_down_mask_get(Eo *eo_e, Evas_Public_Data *e) } EOLIAN static Eina_Bool -_evas_canvas_pointer_inside_get(Eo *eo_e, Evas_Public_Data *e) +_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); } @@ -1295,6 +1295,14 @@ _evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj, return list; } +/* Legacy EAPI */ + +EAPI Eina_Bool +evas_pointer_inside_get(const Evas *obj) +{ + return efl_canvas_pointer_inside_get(obj); +} + /* Internal EO APIs */ EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE = -- 2.7.4