EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE,
EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET,
EVAS_CANVAS_SUB_ID_RENDER_ASYNC,
+ EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET,
EVAS_CANVAS_SUB_ID_LAST
};
* @see evas_event_refeed_event
*/
#define evas_canvas_event_refeed_event(event_copy, event_type) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_EVENT_REFEED_EVENT), EO_TYPECHECK(void *, event_copy), EO_TYPECHECK(Evas_Callback_Type, event_type)
+
+/**
+ * @def evas_canvas_tree_objects_at_xy_get
+ * @since 1.8
+ *
+ * Retrieve a list of Evas objects lying over a given position in
+ * a canvas.
+ *
+ * @param[in] stop An Evas Object where to stop searching.
+ * @param[in] x The horizontal coordinate of the position.
+ * @param[in] y The vertical coordinate of the position.
+ * @param[out] list of Evas Objects.
+ *
+ * @see evas_tree_objects_at_xy_get
+ */
+#define evas_canvas_tree_objects_at_xy_get(stop, x, y, ret) EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET), EO_TYPECHECK(Evas_Object *, stop), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(Eina_List **, ret)
+
/**
* @}
*/
*/
EAPI void evas_event_refeed_event(Evas *e, void *event_copy, Evas_Callback_Type event_type) EINA_ARG_NONNULL(1);
+/**
+ * Retrieve a list of Evas objects lying over a given position in
+ * a canvas.
+ *
+ * @param e A handle to the canvas.
+ * @param stop An Evas Object where to stop searching.
+ * @param x The horizontal coordinate of the position.
+ * @param y The vertical coordinate of the 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. It will enter the smart objects.
+ * It will not append to the list pass events as hidden objects.
+ * Call eina_list_free on the returned list after usage.
+ *
+ */
+EAPI Eina_List *evas_tree_objects_at_xy_get(Evas *eo_e, Evas_Object *stop, int x, int y) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
+
/**
* @}
*/
no_rep, source);
}
-Eina_List *
-evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
+static Eina_List *
+_evas_event_objects_event_list_no_frozen_check(Evas *eo_e, Evas_Object *stop, int x, int y)
{
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
Evas_Layer *lay;
Eina_List *in = NULL;
- if ((!e->layers) || (e->is_frozen)) return NULL;
+ if (!e->layers) return NULL;
EINA_INLIST_REVERSE_FOREACH((EINA_INLIST_GET(e->layers)), lay)
{
return in;
}
+EAPI Eina_List *
+evas_tree_objects_at_xy_get(Evas *eo_e, Evas_Object *stop, int x, int y)
+{
+ MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
+ return NULL;
+ MAGIC_CHECK_END();
+ Eina_List *list = NULL;
+ eo_do(eo_e, evas_canvas_tree_objects_at_xy_get(stop, x, y, &list));
+ return list;
+}
+
+void
+_canvas_tree_objects_at_xy_get(Eo *eo_e, void *_pd EINA_UNUSED, va_list *list)
+{
+ Evas_Object *stop = va_arg(*list, Evas_Object *);
+ int x = va_arg(*list, int);
+ int y = va_arg(*list, int);
+ Eina_List **in = va_arg(*list, Eina_List **);
+
+ *in = _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
+}
+
+Eina_List *
+evas_event_objects_event_list(Evas *eo_e, Evas_Object *stop, int x, int y)
+{
+ Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CLASS);
+
+ if ((!e->layers) || (e->is_frozen)) return NULL;
+ return _evas_event_objects_event_list_no_frozen_check(eo_e, stop, x, y);
+}
+
static Eina_List *
evas_event_list_copy(Eina_List *list)
{
EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE), _canvas_smart_objects_calculate),
EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET), _canvas_smart_objects_calculate_count_get),
EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_RENDER_ASYNC), _canvas_render_async),
+ EO_OP_FUNC(EVAS_CANVAS_ID(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET), _canvas_tree_objects_at_xy_get),
EO_OP_FUNC_SENTINEL
};
EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE, "Call user-provided calculate() smart functions."),
EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SMART_OBJECTS_CALCULATE_COUNT_GET, "Get the internal counter that counts the number of smart calculations."),
EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_ASYNC, "Renders the canvas asynchronously."),
+ EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_TREE_OBJECTS_AT_XY_GET, "Retrieve a list of Evas objects lying over a given position in a canvas."),
EO_OP_DESCRIPTION_SENTINEL
};
void _canvas_event_feed_hold(Eo *e, void *_pd, va_list *list);
void _canvas_event_refeed_event(Eo *e, void *_pd, va_list *list);
void _canvas_event_down_count_get(Eo *e, void *_pd, va_list *list);
+void _canvas_tree_objects_at_xy_get(Eo *e, void *_pd, va_list *list);
void _canvas_focus_get(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_clear(Eo *e, void *_pd, va_list *list);
void _canvas_font_path_append(Eo *e, void *_pd, va_list *list);