summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-18 17:55:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-19 10:51:48 +0900
commit686366a03b2352f81d6ea4a79c6608d1bd5e1590 (patch)
tree9eaa2abad9b78658b2313ea26009e6f17f36477a
parentbfd9487b94a39421639a0c65fa2b43067cb090b6 (diff)
evas: Use Eina.Rect for object list functions
- objects_at_xy_get - object_top_at_xy_get - objects_in_rectangle_get - object_top_in_rectangle_get
-rw-r--r--src/lib/efl/interfaces/efl_canvas.eo28
-rw-r--r--src/lib/elementary/efl_ui_win.c20
2 files changed, 14 insertions, 34 deletions
diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas.eo
index 15cb2ef45f..10776b7bd6 100644
--- a/src/lib/efl/interfaces/efl_canvas.eo
+++ b/src/lib/efl/interfaces/efl_canvas.eo
@@ -45,8 +45,7 @@ interface Efl.Canvas ()
45 The list of objects that are over the given position in $e. 45 The list of objects that are over the given position in $e.
46 ]] 46 ]]
47 params { 47 params {
48 @in x: int; [[The horizontal coordinate of the position.]] 48 @in pos: Eina.Position2D; [[The pixel position.]]
49 @in y: int; [[The vertical coordinate of the position.]]
50 @in include_pass_events_objects: bool; [[ 49 @in include_pass_events_objects: bool; [[
51 Boolean flag to include or not objects which pass events 50 Boolean flag to include or not objects which pass events
52 in this calculation. 51 in this calculation.
@@ -72,8 +71,7 @@ interface Efl.Canvas ()
72 ]] 71 ]]
73 return: Efl.Gfx @warn_unused; [[The Evas object that is over all other objects at the given position.]] 72 return: Efl.Gfx @warn_unused; [[The Evas object that is over all other objects at the given position.]]
74 params { 73 params {
75 @in x: int; [[The horizontal coordinate of the position.]] 74 @in pos: Eina.Position2D; [[The pixel position.]]
76 @in y: int; [[The vertical coordinate of the position.]]
77 @in include_pass_events_objects: bool; [[ 75 @in include_pass_events_objects: bool; [[
78 Boolean flag to include or not objects which pass events 76 Boolean flag to include or not objects which pass events
79 in this calculation. 77 in this calculation.
@@ -100,16 +98,7 @@ interface Efl.Canvas ()
100 ]] 98 ]]
101 return: iterator<Efl.Gfx> @owned @warn_unused; [[Iterator to objects]] 99 return: iterator<Efl.Gfx> @owned @warn_unused; [[Iterator to objects]]
102 params { 100 params {
103 @in x: int; [[ 101 @in rect: Eina.Rect; [[The rectangular region.]]
104 The top left corner's horizontal coordinate for the
105 rectangular region.
106 ]]
107 @in y: int; [[
108 The top left corner's vertical coordinate for the
109 rectangular region.
110 ]]
111 @in w: int; [[The width of the rectangular region.]]
112 @in h: int; [[The height of the rectangular region.]]
113 @in include_pass_events_objects: bool; [[ 102 @in include_pass_events_objects: bool; [[
114 Boolean flag to include or not objects which pass events 103 Boolean flag to include or not objects which pass events
115 in this calculation. 104 in this calculation.
@@ -139,16 +128,7 @@ interface Efl.Canvas ()
139 rectangular region. 128 rectangular region.
140 ]] 129 ]]
141 params { 130 params {
142 @in x: int; [[ 131 @in rect: Eina.Rect; [[The rectangular region.]]
143 The top left corner's horizontal coordinate for the
144 rectangular region.
145 ]]
146 @in y: int; [[
147 The top left corner's vertical coordinate for the
148 rectangular region.
149 ]]
150 @in w: int; [[The width of the rectangular region.]]
151 @in h: int; [[The height of the rectangular region.]]
152 @in include_pass_events_objects: bool; [[ 132 @in include_pass_events_objects: bool; [[
153 Boolean flag to include or not objects which pass events 133 Boolean flag to include or not objects which pass events
154 in this calculation. 134 in this calculation.
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 967a3ed440..7cf004a405 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2489,31 +2489,31 @@ _efl_ui_win_efl_canvas_smart_objects_calculate(Eo *obj EINA_UNUSED, Efl_Ui_Win_D
2489} 2489}
2490 2490
2491EOLIAN static Eina_Iterator * 2491EOLIAN static Eina_Iterator *
2492_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) 2492_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)
2493{ 2493{
2494 Eina_List *objs = NULL; 2494 Eina_List *objs = NULL;
2495 objs = evas_objects_at_xy_get(sd->evas, x, y, include_pass_events_objects, include_hidden_objects); 2495 objs = evas_objects_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
2496 return eina_list_iterator_new(objs); 2496 return eina_list_iterator_new(objs); // FIXME: This leaks the list!
2497} 2497}
2498 2498
2499EOLIAN static Efl_Gfx * 2499EOLIAN static Efl_Gfx *
2500_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) 2500_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)
2501{ 2501{
2502 return evas_object_top_at_xy_get(sd->evas, x, y, include_pass_events_objects, include_hidden_objects); 2502 return evas_object_top_at_xy_get(sd->evas, pos.x, pos.y, include_pass_events_objects, include_hidden_objects);
2503} 2503}
2504 2504
2505EOLIAN static Eina_Iterator * 2505EOLIAN static Eina_Iterator *
2506_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) 2506_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)
2507{ 2507{
2508 Eina_List *objs = NULL; 2508 Eina_List *objs = NULL;
2509 objs = evas_objects_in_rectangle_get(sd->evas, x, y, w, h, include_pass_events_objects, include_hidden_objects); 2509 objs = evas_objects_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
2510 return eina_list_iterator_new(objs); 2510 return eina_list_iterator_new(objs); // FIXME: This leaks the list!
2511} 2511}
2512 2512
2513EOLIAN static Efl_Gfx * 2513EOLIAN static Efl_Gfx *
2514_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) 2514_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)
2515{ 2515{
2516 return evas_object_top_in_rectangle_get(sd->evas, x, y, w, h, include_pass_events_objects, include_hidden_objects); 2516 return evas_object_top_in_rectangle_get(sd->evas, r.x, r.y, r.w, r.h, include_pass_events_objects, include_hidden_objects);
2517} 2517}
2518 2518
2519EOLIAN static Efl_Input_Device * 2519EOLIAN static Efl_Input_Device *