evas: Use Eina.Rect for object list functions
authorJean-Philippe Andre <jp.andre@samsung.com>
Mon, 18 Sep 2017 08:55:50 +0000 (17:55 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 19 Sep 2017 01:51:48 +0000 (10:51 +0900)
- objects_at_xy_get
- object_top_at_xy_get
- objects_in_rectangle_get
- object_top_in_rectangle_get

src/lib/efl/interfaces/efl_canvas.eo
src/lib/elementary/efl_ui_win.c

index 15cb2ef..10776b7 100644 (file)
@@ -45,8 +45,7 @@ interface Efl.Canvas ()
             The list of objects that are over the given position in $e.
          ]]
          params {
-            @in x: int; [[The horizontal coordinate of the position.]]
-            @in y: int; [[The vertical coordinate of the position.]]
+            @in pos: Eina.Position2D; [[The pixel position.]]
             @in include_pass_events_objects: bool; [[
                Boolean flag to include or not objects which pass events
                in this calculation.
@@ -72,8 +71,7 @@ interface Efl.Canvas ()
          ]]
          return: Efl.Gfx @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 pos: Eina.Position2D; [[The pixel position.]]
             @in include_pass_events_objects: bool; [[
                Boolean flag to include or not objects which pass events
                in this calculation.
@@ -100,16 +98,7 @@ interface Efl.Canvas ()
          ]]
          return: iterator<Efl.Gfx> @owned @warn_unused; [[Iterator to objects]] 
          params {
-            @in x: int; [[
-               The top left corner's horizontal coordinate for the
-               rectangular region.
-            ]]
-            @in y: int; [[
-               The top left corner's vertical coordinate for the
-               rectangular region.
-            ]]
-            @in w: int; [[The width of the rectangular region.]]
-            @in h: int; [[The height of the rectangular region.]]
+            @in rect: Eina.Rect; [[The rectangular region.]]
             @in include_pass_events_objects: bool; [[
                Boolean flag to include or not objects which pass events
                in this calculation.
@@ -139,16 +128,7 @@ interface Efl.Canvas ()
             rectangular region.
          ]]
          params {
-            @in x: int; [[
-               The top left corner's horizontal coordinate for the
-               rectangular region.
-            ]]
-            @in y: int; [[
-               The top left corner's vertical coordinate for the
-               rectangular region.
-            ]]
-            @in w: int; [[The width of the rectangular region.]]
-            @in h: int; [[The height of the rectangular region.]]
+            @in rect: Eina.Rect; [[The rectangular region.]]
             @in include_pass_events_objects: bool; [[
                Boolean flag to include or not objects which pass events
                in this calculation.
index 967a3ed..7cf004a 100644 (file)
@@ -2489,31 +2489,31 @@ _efl_ui_win_efl_canvas_smart_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_D
 }
 
 EOLIAN static Eina_Iterator *
-_efl_ui_win_efl_canvas_objects_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_objects_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
 {
    Eina_List *objs = NULL;
-   objs = evas_objects_at_xy_get(sd->evas, x, y, include_pass_events_objects, include_hidden_objects);
-   return eina_list_iterator_new(objs);
+   objs = evas_objects_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
+   return eina_list_iterator_new(objs); // FIXME: This leaks the list!
 }
 
 EOLIAN static Efl_Gfx *
-_efl_ui_win_efl_canvas_object_top_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int x, int y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_object_top_at_xy_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Position2D pos, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
 {
-   return evas_object_top_at_xy_get(sd->evas, x, y, include_pass_events_objects, include_hidden_objects);
+   return evas_object_top_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
 }
 
 EOLIAN static Eina_Iterator *
-_efl_ui_win_efl_canvas_objects_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_objects_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
 {
    Eina_List *objs = NULL;
-   objs = evas_objects_in_rectangle_get(sd->evas, x, y, w, h, include_pass_events_objects, include_hidden_objects);
-   return eina_list_iterator_new(objs);
+   objs = evas_objects_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
+   return eina_list_iterator_new(objs); // FIXME: This leaks the list!
 }
 
 EOLIAN static Efl_Gfx *
-_efl_ui_win_efl_canvas_object_top_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, int x, int y, int w, int h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
+_efl_ui_win_efl_canvas_object_top_in_rectangle_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *sd, Eina_Rect r, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
 {
-   return evas_object_top_in_rectangle_get(sd->evas, x, y, w, h, include_pass_events_objects, include_hidden_objects);
+   return evas_object_top_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
 }
 
 EOLIAN static Efl_Input_Device *