diff --git a/src/bin/e_box.c b/src/bin/e_box.c index a685a8a33..c4a78d7ac 100644 --- a/src/bin/e_box.c +++ b/src/bin/e_box.c @@ -412,6 +412,22 @@ e_box_align_pixel_offset_get(Evas_Object *obj, int *x, int *y) if (y) *y = (sd->min.h - sd->h) * (1.0 - sd->align.y); } +EAPI Evas_Object * +e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y) +{ + E_Smart_Data *sd; + E_Box_Item *bi; + + if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR() NULL; + sd = evas_object_smart_data_get(obj); + if (!sd) return NULL; + EINA_INLIST_FOREACH(EINA_INLIST_GET(sd->items), bi) + { + if (E_INSIDE(x, y, bi->x, bi->y, bi->w, bi->h)) return bi->obj; + } + return NULL; +} + /* local subsystem functions */ static void _e_box_unpack_internal(E_Smart_Data *sd, E_Box_Item *bi) diff --git a/src/bin/e_box.h b/src/bin/e_box.h index 6f6ce95c4..ee6cb13a7 100644 --- a/src/bin/e_box.h +++ b/src/bin/e_box.h @@ -24,6 +24,6 @@ EAPI void e_box_size_max_get (Evas_Object *obj, Evas_Coord *maxw, E EAPI void e_box_align_get (Evas_Object *obj, double *ax, double *ay); EAPI void e_box_align_set (Evas_Object *obj, double ax, double ay); EAPI void e_box_align_pixel_offset_get (Evas_Object *obj, int *x, int *y); - +EAPI Evas_Object *e_box_item_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y); #endif #endif