evas: remove Evas_Canvas.object_top_at_xy_get
authorMike Blumenkrantz <zmike@osg.samsung.com>
Thu, 15 Feb 2018 02:14:52 +0000 (21:14 -0500)
committerWonki Kim <wonki_.kim@samsung.com>
Thu, 5 Apr 2018 18:05:30 +0000 (03:05 +0900)
also implement Efl_Canvas method

src/lib/evas/Evas_Legacy.h
src/lib/evas/canvas/evas_canvas.eo
src/lib/evas/canvas/evas_main.c

index 3e784e4..a69594e 100755 (executable)
@@ -2353,6 +2353,32 @@ EAPI Evas *evas_object_evas_get(const Eo *obj);
  */
  EAPI Eina_List *evas_objects_at_xy_get(Eo *eo_e, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects);
 
+
+/**
+ * @brief Retrieve the object stacked at the top of a given position in a
+ * canvas.
+ *
+ * This function will traverse all the layers of the given canvas, from top to
+ * bottom, querying for objects with areas covering the given position. The
+ * user can remove from the query objects which are hidden and/or which are set
+ * to pass events.
+ *
+ * @warning This function will skip objects parented by smart objects, acting
+ * only on the ones at the "top level", with regard to object parenting.
+ *
+ * @param[in] obj The object.
+ * @param[in] x The pixel position.
+ * @param[in] y The pixel position.
+ * @param[in] include_pass_events_objects Boolean flag to include or not
+ * objects which pass events in this calculation.
+ * @param[in] include_hidden_objects Boolean flag to include or not hidden
+ * objects in this calculation.
+ *
+ * @return The Evas object that is over all other objects at the given
+ * position.
+ */
+ EAPI Evas_Object* evas_object_top_at_xy_get(Eo *eo_e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects);
+
 /**
  * @}
  */
index 2b5f828..1418aba 100644 (file)
@@ -536,33 +536,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
          [[Force the given evas and associated engine to flush its font cache.]]
 
       }
-      object_top_at_xy_get @const {
-         [[Retrieve the Evas object stacked at the top of a given position
-           in a canvas.
-
-           This function will traverse all the layers of the given canvas,
-           from top to bottom, querying for objects with areas covering the
-           given position. The user can remove from the query
-           objects which are hidden and/or which are set to pass events.
-
-           Warning: This function will skip objects parented by smart
-           objects, acting only on the ones at the "top level", with
-           regard to object parenting.
-         ]]
-         return: Efl.Canvas.Object @warn_unused; [[The Evas object that is over all other objects at the given position.]]
-         params {
-            @in x: int; [[The horizontal coordinate of the position.]]
-            @in y: int; [[The vertical coordinate of the position.]]
-            @in include_pass_events_objects: bool; [[
-               Boolean flag to include or not objects which pass events
-               in this calculation.
-            ]]
-            @in include_hidden_objects: bool; [[
-               Boolean flag to include or not hidden objects in this
-               calculation.
-            ]]
-         }
-      }
       key_modifier_on {
          [[Enables or turns on programmatically the modifier key with name
            $keyname for the default seat.
@@ -1085,5 +1058,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
       Efl.Canvas.seat { get; }
       Efl.Canvas.image_max_size { get; }
       Efl.Canvas.objects_at_xy_get;
+      Efl.Canvas.object_top_at_xy_get;
    }
 }
index 0797b9e..1ee7bce 100644 (file)
@@ -1440,14 +1440,14 @@ efl_canvas_iterator_create(Eo *obj, Eina_Iterator *real_iterator, Eina_List *lis
    return &it->iterator;
 }
 
-EOLIAN Evas_Object*
-_evas_canvas_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+EOLIAN static Evas_Object*
+_evas_canvas_efl_canvas_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
 {
    Evas_Layer *lay;
    int xx, yy;
 
-   xx = x;
-   yy = y;
+   xx = pos.x;
+   yy = pos.y;
 ////   xx = evas_coord_world_x_to_screen(eo_e, x);
 ////   yy = evas_coord_world_y_to_screen(eo_e, y);
    EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
@@ -1475,6 +1475,13 @@ _evas_canvas_object_top_at_xy_get(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *
    return NULL;
 }
 
+EAPI Evas_Object*
+evas_object_top_at_xy_get(Eo *eo_e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+{
+   Eina_Position2D pos = {x, y};
+   return efl_canvas_object_top_at_xy_get(eo_e, pos, include_pass_events_objects, include_hidden_objects);
+}
+
 EAPI Evas_Object *
 evas_object_top_at_pointer_get(const Evas *eo_e)
 {
@@ -1484,7 +1491,7 @@ evas_object_top_at_pointer_get(const Evas *eo_e)
 
    Evas_Pointer_Data *pdata = _evas_pointer_data_by_device_get(e, NULL);
    EINA_SAFETY_ON_NULL_RETURN_VAL(pdata, NULL);
-   return evas_canvas_object_top_at_xy_get((Eo *)eo_e, pdata->seat->x, pdata->seat->y, EINA_TRUE, EINA_TRUE);
+   return efl_canvas_object_top_at_xy_get((Eo *)eo_e, EINA_POSITION2D(pdata->seat->x, pdata->seat->y), EINA_TRUE, EINA_TRUE);
 }
 
 EOLIAN Evas_Object*