- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Finding Objects
Generic Object Functions

Functions that allows finding objects by their position, name or other properties. More...

#define | evas_canvas_focus_get(ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_FOCUS_GET), EO_TYPECHECK(Evas_Object **, ret)
#define | evas_canvas_object_name_find(name, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_NAME_FIND),EO_TYPECHECK(const char *, name), EO_TYPECHECK(Evas_Object **, ret)
#define | evas_obj_name_child_find(name, recurse, child) EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_NAME_CHILD_FIND), EO_TYPECHECK(const char *, name), EO_TYPECHECK(int, recurse), EO_TYPECHECK(Evas_Object **, child)
#define | evas_canvas_object_top_at_xy_get(x, y, include_pass_events_objects, include_hidden_objects, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_AT_XY_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Evas_Object **, ret)
#define | evas_canvas_object_top_in_rectangle_get(x, y, w, h, include_pass_events_objects, include_hidden_objects, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_IN_RECTANGLE_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Evas_Object **, ret)
#define | evas_canvas_objects_at_xy_get(x, y, include_pass_events_objects, include_hidden_objects, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECTS_AT_XY_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Eina_List **, ret)
#define | evas_canvas_objects_in_rectangle_get(x, y, w, h, include_pass_events_objects, include_hidden_objects, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECTS_IN_RECTANGLE_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Eina_List **, ret)
#define | evas_canvas_object_bottom_get(ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_BOTTOM_GET), EO_TYPECHECK(Evas_Object **, ret)
#define | evas_canvas_object_top_get(ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_GET), EO_TYPECHECK(Evas_Object **, ret)
Evas_Object * | evas_focus_get (const Evas *e)
| Retrieve the object that currently has focus. More...
Evas_Object * | evas_object_name_find (const Evas *e, const char *name)
| Retrieves the object on the given evas with the given name. More...
Evas_Object * | evas_object_name_child_find (const Evas_Object *obj, const char *name, int recurse)
| Retrieves the object from children of the given object with the given name. More...
Evas_Object * | evas_object_top_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
| Retrieve the Evas object stacked at the top of a given position in a canvas. More...
Evas_Object * | evas_object_top_at_pointer_get (const Evas *e)
| Retrieve the Evas object stacked at the top at the position of the mouse cursor, over a given canvas. More...
Evas_Object * | evas_object_top_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
| Retrieve the Evas object stacked at the top of a given rectangular region in a canvas. More...
Eina_List * | evas_objects_at_xy_get (const Evas *e, Evas_Coord x, Evas_Coord y, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
| Retrieve a list of Evas objects lying over a given position in a canvas. More...
Eina_List * | evas_objects_in_rectangle_get (const Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Eina_Bool include_pass_events_objects, Eina_Bool include_hidden_objects)
| Retrieves the objects in the given rectangle region. More...
Evas_Object * | evas_object_bottom_get (const Evas *e)
| Get the lowest (stacked) Evas object on the canvas `e`. More...
Evas_Object * | evas_object_top_get (const Evas *e)
| Get the highest (stacked) Evas object on the canvas `e`. More...

## Detailed Description

Functions that allows finding objects by their position, name or other properties.

## Macro Definition Documentation

#define evas_canvas_focus_get | ( |  | ret | ) | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_FOCUS_GET), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Retrieve the object that currently has focus.

Parameters

  [out] | ret |

See Also
  evas_focus_get

Referenced by evas_focus_get().

#define evas_canvas_object_name_find | ( |  | name,
|  |  | ret
| ) |  | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_NAME_FIND),EO_TYPECHECK(const char *, name), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Retrieves the object on the given evas with the given name.

Parameters

  [in] | name |
  [out] | ret |

See Also
  evas_object_name_find

Referenced by evas_object_name_find().

#define evas_obj_name_child_find | ( |  | name,
|  |  | recurse,
|  |  | child
| ) |  | EVAS_OBJ_ID(EVAS_OBJ_SUB_ID_NAME_CHILD_FIND), EO_TYPECHECK(const char *, name), EO_TYPECHECK(int, recurse), EO_TYPECHECK(Evas_Object **, child)

Since
  1.8

Retrieves the object from children of the given object with the given name.

Parameters

  [in] | name | in
  [in] | recurse | in
  [out] | child | out

See Also
  evas_object_name_child_find

Referenced by evas_object_name_child_find().

#define evas_canvas_object_top_at_xy_get | ( |  | x,
|  |  | y,
|  |  | include_pass_events_objects,
|  |  | include_hidden_objects,
|  |  | ret
| ) |  | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_AT_XY_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Retrieve the Evas object stacked at the top of a given position in a canvas.

Parameters

  [in] | x |
  [in] | y |
  [in] | include_pass_events_objects |
  [in] | include_hidden_objects |
  [out] | ret |

See Also
  evas_object_top_at_xy_get

Referenced by evas_object_top_at_pointer_get(), and evas_object_top_at_xy_get().

#define evas_canvas_object_top_in_rectangle_get | ( |  | x,
|  |  | y,
|  |  | w,
|  |  | h,
|  |  | include_pass_events_objects,
|  |  | include_hidden_objects,
|  |  | ret
| ) |  | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_IN_RECTANGLE_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Retrieve the Evas object stacked at the top of a given rectangular region in a canvas.

Parameters

  [in] | x |
  [in] | y |
  [in] | w |
  [in] | h |
  [in] | include_pass_events_objects |
  [in] | include_hidden_objects |
  [out] | ret |

See Also
  evas_object_top_in_rectangle_get

Referenced by evas_object_top_in_rectangle_get().

#define evas_canvas_objects_at_xy_get | ( |  | x,
|  |  | y,
|  |  | include_pass_events_objects,
|  |  | include_hidden_objects,
|  |  | ret
| ) |  | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECTS_AT_XY_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Eina_List **, ret)

Since
  1.8

Retrieve a list of Evas objects lying over a given position in a canvas.

Parameters

  [in] | x |
  [in] | y |
  [in] | include_pass_events_objects |
  [in] | include_hidden_objects |
  [out] | ret |

See Also
  evas_objects_at_xy_get

Referenced by evas_objects_at_xy_get().

#define evas_canvas_objects_in_rectangle_get | ( |  | x,
|  |  | y,
|  |  | w,
|  |  | h,
|  |  | include_pass_events_objects,
|  |  | include_hidden_objects,
|  |  | ret
| ) |  | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECTS_IN_RECTANGLE_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(Evas_Coord, w), EO_TYPECHECK(Evas_Coord, h), EO_TYPECHECK(Eina_Bool, include_pass_events_objects), EO_TYPECHECK(Eina_Bool, include_hidden_objects), EO_TYPECHECK(Eina_List **, ret)

Since
  1.8

Parameters

  [in] | x |
  [in] | y |
  [in] | w |
  [in] | h |
  [in] | include_pass_events_objects |
  [in] | include_hidden_objects |
  [out] | ret |

See Also
  evas_objects_in_rectangle_get

Referenced by evas_objects_in_rectangle_get().

#define evas_canvas_object_bottom_get | ( |  | ret | ) | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_BOTTOM_GET), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Get the lowest (stacked) Evas object on the canvas e.

Parameters

  [out] | ret |

See Also
  evas_object_bottom_get

Referenced by evas_object_bottom_get().

#define evas_canvas_object_top_get | ( |  | ret | ) | EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_OBJECT_TOP_GET), EO_TYPECHECK(Evas_Object **, ret)

Since
  1.8

Get the highest (stacked) Evas object on the canvas e.

Parameters

  [out] | ret |

See Also
  evas_object_top_get

Referenced by evas_object_top_get().

## Function Documentation

Evas_Object* evas_focus_get | ( | const Evas * | e | ) |

Retrieve the object that currently has focus.

Parameters

  e | The Evas canvas to query for focused object on.

Returns
  The object that has focus or `NULL` if there is not one.

Evas can have (at most) one of its objects focused at a time. Focused objects will be the ones having key events delivered to, which the programmer can act upon by means of evas_object_event_callback_add() usage.

Note
  Most users wouldn't be dealing directly with Evas' focused objects. Instead, they would be using a higher level library for that (like a toolkit, as Elementary) to handle focus and who's receiving input for them.

This call returns the object that currently has focus on the canvas `e` or `NULL`, if none.

See Also
  evas_object_focus_set
  evas_object_focus_get
  evas_object_key_grab
  evas_object_key_ungrab

Example:

evas_event_callback_add(d.canvas, EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
_object_focus_in_cb, NULL);
if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
{
fprintf(stderr, "ERROR: Callback registering failed! Aborting.\n");
goto panic;
} /* two canvas event callbacks */
d.bg = evas_object_rectangle_add(d.canvas);
evas_object_name_set(d.bg, "our dear rectangle");
evas_object_color_set(d.bg, 255, 255, 255, 255); /* white bg */
evas_object_move(d.bg, 0, 0); /* at canvas' origin */
evas_object_resize(d.bg, WIDTH, HEIGHT); /* covers full canvas */
evas_object_show(d.bg);
evas_object_focus_set(d.bg, EINA_TRUE); /* so we get input events */
/* called when our rectangle gets focus */
static void
_object_focus_in_cb(void *data EINA_UNUSED,
Evas *e,
void *event_info)
{
fprintf(stdout, "An object got focused: %s\n",
evas_object_name_get(event_info));
fprintf(stdout, "Let's recheck it: %s\n",
evas_object_name_get(evas_focus_get(e)));
fprintf(stdout, "And again: %s\n", evas_object_focus_get(event_info) ?
"OK!" : "Oops, something is bad.");
}

In this example the `event_info` is exactly a pointer to that focused rectangle. See the full example.

References evas_canvas_focus_get.

Evas_Object* evas_object_name_find | ( | const Evas * | e,
|  | const char * | name
| ) |  |

Retrieves the object on the given evas with the given name.

Parameters

  e | The given evas.
  name | The given name.

Returns
  If successful, the Evas object with the given name. Otherwise, `NULL`.

This looks for the evas object given a name by evas_object_name_set(). If the name is not unique canvas-wide, then which one of the many objects with that name is returned is undefined, so only use this if you can ensure the object name is unique.

References evas_canvas_object_name_find.

Referenced by edje_evas_global_perspective_get(), and edje_perspective_global_set().

Evas_Object* evas_object_name_child_find | ( | const Evas_Object * | obj,
|  | const char * | name,
|  | int | recurse
| ) |  |

Retrieves the object from children of the given object with the given name.

Parameters

  obj | The parent (smart) object whose children to search.
  name | The given name.
  recurse | Set to the number of child levels to recurse (0 == don't recurse, 1 == only look at the children of `obj` or their immediate children, but no further etc.).

Returns
  If successful, the Evas object with the given name. Otherwise, `NULL`.

This looks for the evas object given a name by evas_object_name_set(), but it ONLY looks at the children of the object *p obj, and will only recurse into those children if `recurse` is greater than 0. If the name is not unique within immediate children (or the whole child tree) then it is not defined which child object will be returned. If `recurse` is set to -1 then it will recurse without limit.

Since
  1.2

References evas_obj_name_child_find.

Evas_Object* evas_object_top_at_xy_get | ( | const Evas * | e,
|  | Evas_Coord | x,
|  | Evas_Coord | y,
|  | Eina_Bool | include_pass_events_objects,
|  | Eina_Bool | include_hidden_objects
| ) |  |

Retrieve the Evas object stacked at the top of a given position in a canvas.

Parameters

  e | A handle to the canvas.
  x | The horizontal coordinate of the position
  y | The vertical coordinate of the position
  include_pass_events_objects | Boolean flag to include or not objects which pass events in this calculation
  include_hidden_objects | Boolean flag to include or not hidden objects in this calculation

Returns
  The Evas object that is over all other objects at the given position.

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.

References evas_canvas_object_top_at_xy_get.

Evas_Object* evas_object_top_at_pointer_get | ( | const Evas * | e | ) |

Retrieve the Evas object stacked at the top at the position of the mouse cursor, over a given canvas.

Parameters

  e | A handle to the canvas.

Returns
  The Evas object that is over all other objects at the mouse pointer's position

This function will traverse all the layers of the given canvas, from top to bottom, querying for objects with areas covering the mouse pointer's position, over `e`.

Warning
  This function will skip objects parented by smart objects, acting only on the ones at the "top level", with regard to object parenting.

References EINA_TRUE, and evas_canvas_object_top_at_xy_get.

Evas_Object* evas_object_top_in_rectangle_get | ( | const Evas * | e,
|  | Evas_Coord | x,
|  | Evas_Coord | y,
|  | Evas_Coord | w,
|  | Evas_Coord | h,
|  | Eina_Bool | include_pass_events_objects,
|  | Eina_Bool | include_hidden_objects
| ) |  |

Retrieve the Evas object stacked at the top of a given rectangular region in a canvas.

Parameters

  e | A handle to the canvas.
  x | The top left corner's horizontal coordinate for the rectangular region
  y | The top left corner's vertical coordinate for the rectangular region
  w | The width of the rectangular region
  h | The height of the rectangular region
  include_pass_events_objects | Boolean flag to include or not objects which pass events in this calculation
  include_hidden_objects | Boolean flag to include or not hidden objects in this calculation

Returns
  The Evas object that is over all other objects at the given rectangular region.

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.

References evas_canvas_object_top_in_rectangle_get.

Eina_List* evas_objects_at_xy_get | ( | const Evas * | e,
|  | Evas_Coord | x,
|  | Evas_Coord | y,
|  | Eina_Bool | include_pass_events_objects,
|  | Eina_Bool | include_hidden_objects
| ) |  |

Retrieve a list of Evas objects lying over a given position in a canvas.

Parameters

  e | A handle to the canvas.
  x | The horizontal coordinate of the position
  y | The vertical coordinate of the position
  include_pass_events_objects | Boolean flag to include or not objects which pass events in this calculation
  include_hidden_objects | Boolean flag to include or not hidden objects in this calculation

Returns
  The list of Evas objects that are over the given position in `e`

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.

References evas_canvas_objects_at_xy_get.

Eina_List* evas_objects_in_rectangle_get | ( | const Evas * | eo_e,
|  | Evas_Coord | x,
|  | Evas_Coord | y,
|  | Evas_Coord | w,
|  | Evas_Coord | h,
|  | Eina_Bool | include_pass_events_objects,
|  | Eina_Bool | include_hidden_objects
| ) |  |

Retrieves the objects in the given rectangle region.

Parameters

  eo_e | The given evas object.
  x | The horizontal coordinate.
  y | The vertical coordinate.
  w | The width size.
  h | The height size.
  include_pass_events_objects | Boolean Flag to include or not pass events objects
  include_hidden_objects | Boolean Flag to include or not hidden objects

Returns
  The list of evas object in the rectangle region.

References evas_canvas_objects_in_rectangle_get.

Evas_Object* evas_object_bottom_get | ( | const Evas * | e | ) |

Get the lowest (stacked) Evas object on the canvas `e`.

Parameters

  e | a valid canvas pointer

Returns
  a pointer to the lowest object on it, if any, or `NULL`, otherwise

This function will take all populated layers in the canvas into account, getting the lowest object for the lowest layer, naturally.

See Also
  evas_object_layer_get()
  evas_object_layer_set()
  evas_object_below_get()
  evas_object_above_get()

Warning
  This function will skip objects parented by smart objects, acting only on the ones at the "top level", with regard to object parenting.

References evas_canvas_object_bottom_get.

Evas_Object* evas_object_top_get | ( | const Evas * | e | ) |

Get the highest (stacked) Evas object on the canvas `e`.

Parameters

  e | a valid canvas pointer

Returns
  a pointer to the highest object on it, if any, or `NULL`, otherwise

This function will take all populated layers in the canvas into account, getting the highest object for the highest layer, naturally.

See Also
  evas_object_layer_get()
  evas_object_layer_set()
  evas_object_below_get()
  evas_object_above_get()

Warning
  This function will skip objects parented by smart objects, acting only on the ones at the "top level", with regard to object parenting.

Examples:
  evas-stacking.c.

References evas_canvas_object_top_get.