diff --git a/src/lib/efl/interfaces/efl_canvas.eo b/src/lib/efl/interfaces/efl_canvas.eo index 1cbbb79be9..683f493d50 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), 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), 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 0256465cbb..f68bb88cfe 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 3ed902e1d1..c5497a827c 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;