jypark pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1f127fe45a566aa3f6689bc6c1568930c10c56b9

commit 1f127fe45a566aa3f6689bc6c1568930c10c56b9
Author: Ji-Youn Park <[email protected]>
Date:   Fri Jun 17 16:02:38 2016 +0830

    efl_ui_win: move some APIs get the object's list in special location to 
efl_ui_win.
    
    The apis to get the object or object list in special location is useful.
    like game app.
    so move these APIs from evas canvas to efl_canvas.
---
 src/lib/efl/interfaces/efl_canvas.eo | 119 +++++++++++++++++++++++++++++++++++
 src/lib/elementary/efl_ui_win.c      |  28 +++++++++
 src/lib/elementary/efl_ui_win.eo     |   4 ++
 3 files changed, 151 insertions(+)

diff --git a/src/lib/efl/interfaces/efl_canvas.eo 
b/src/lib/efl/interfaces/efl_canvas.eo
index 1cbbb79..683f493 100644
--- a/src/lib/efl/interfaces/efl_canvas.eo
+++ b/src/lib/efl/interfaces/efl_canvas.eo
@@ -92,6 +92,125 @@ interface Efl.Canvas ()
            all smart objects in the canvas.
          ]]
       }
+      objects_at_xy_get @const {
+         [[Retrieve a list of objects lying over 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 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: free(own(iterator<Efl.Gfx>), eina_iterator_free) 
@warn_unused; [[
+            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 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.
+            ]]
+         }
+      }
+      object_top_at_xy_get @const {
+         [[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.
+         ]]
+         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 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.
+            ]]
+         }
+      }
+      objects_in_rectangle_get @const {
+         [[Retrieve a list of objects lying over a given
+           rectangular region in a canvas.
+
+           This function will traverse all the layers of the given canvas,
+           from top to bottom, querying for objects with areas overlapping
+           with the given rectangular region inside $e. 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: free(own(iterator<Efl.Gfx>), eina_iterator_free) @warn_unused;
+         params {
+            @in x: int;
+            @in y: int;
+            @in w: int;
+            @in h: int;
+            @in include_pass_events_objects: bool;
+            @in include_hidden_objects: bool;
+         }
+      }
+      object_top_in_rectangle_get @const {
+         [[Retrieve the Evas object stacked at the top of a given
+           rectangular region in a canvas
+
+           This function will traverse all the layers of the given canvas,
+           from top to bottom, querying for objects with areas overlapping
+           with the given rectangular region inside $e. 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.Gfx @warn_unused; [[
+            The object that is over all other objects at the given
+            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 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.
+            ]]
+         }
+      }
    }
    events {
       focus,in;
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 0256465..f68bb88 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -2196,6 +2196,34 @@ _efl_ui_win_efl_canvas_smart_objects_calculate(Eo *obj 
EINA_UNUSED, Efl_Ui_Win_D
    evas_smart_objects_calculate(sd->evas);
 }
 
+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)
+{
+   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);
+}
+
+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)
+{
+   return evas_object_top_at_xy_get(sd->evas, x, 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)
+{
+   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);
+}
+
+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)
+{
+   return evas_object_top_in_rectangle_get(sd->evas, x, y, w, h, 
include_pass_events_objects, include_hidden_objects);
+}
+
 static void
 _elm_win_on_parent_del(void *data,
                        Evas *e EINA_UNUSED,
diff --git a/src/lib/elementary/efl_ui_win.eo b/src/lib/elementary/efl_ui_win.eo
index 3ed902e..c5497a8 100644
--- a/src/lib/elementary/efl_ui_win.eo
+++ b/src/lib/elementary/efl_ui_win.eo
@@ -806,6 +806,10 @@ class Efl.Ui.Win (Elm.Widget, Efl.Canvas, 
Elm.Interface.Atspi.Window,
       Efl.Canvas.font_cache.get;
       Efl.Canvas.font_cache.set;
       Efl.Canvas.smart_objects_calculate;
+      Efl.Canvas.objects_at_xy_get;
+      Efl.Canvas.object_top_at_xy_get;
+      Efl.Canvas.objects_in_rectangle_get;
+      Efl.Canvas.object_top_in_rectangle_get;
    }
    constructors {
       .name;

-- 


Reply via email to