diff --git a/ChangeLog b/ChangeLog index fe83569a2..a4aaaf65c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,7 @@ * e_util_size_debug_set now also prints for object show/hide events * e_gadcon_unpopulate now correctly freezes the container while deleting gadgets * e_popup is now a wrapper for drawing objects onto the compositor canvas + * added e_layout functions for returning objects above or below a layout child 2013-02-13 Deon Thomas diff --git a/NEWS b/NEWS index e8a339ccb..8a6af86bf 100644 --- a/NEWS +++ b/NEWS @@ -28,6 +28,7 @@ Additions: * e_int_border_remember_edit * Added function for getting children of e_layout * added utility function for printing all objects above a given object + * added e_layout functions for returning objects above or below a layout child Config: * Added option for disabling icons in menus * Added option for disabling pointer warping when performing directional focus changes using winlist diff --git a/src/bin/e_layout.c b/src/bin/e_layout.c index 389299ddd..c075184cd 100644 --- a/src/bin/e_layout.c +++ b/src/bin/e_layout.c @@ -154,6 +154,41 @@ e_layout_child_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) if (li->sd->frozen <= 0) _e_layout_smart_move_resize_item(li); } +EAPI Evas_Object * +e_layout_child_above_get(Evas_Object *obj) +{ + E_Layout_Item *li; + + li = evas_object_data_get(obj, "e_layout_data"); + EINA_SAFETY_ON_NULL_RETURN_VAL(li, NULL); + li = (E_Layout_Item*)EINA_INLIST_GET(li)->next; + return li ? li->obj : NULL; +} + +EAPI Evas_Object * +e_layout_child_below_get(Evas_Object *obj) +{ + E_Layout_Item *li; + + li = evas_object_data_get(obj, "e_layout_data"); + EINA_SAFETY_ON_NULL_RETURN_VAL(li, NULL); + li = (E_Layout_Item*)EINA_INLIST_GET(li)->prev; + return li ? li->obj : NULL; +} + +EAPI Evas_Object * +e_layout_top_child_get(Evas_Object *obj) +{ + E_Smart_Data *sd; + E_Layout_Item *li; + + if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERRNR() NULL; + sd = evas_object_smart_data_get(obj); + if (!sd->items) return NULL; + li = (E_Layout_Item*)sd->items->last; + return li->obj; +} + EAPI void e_layout_child_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { diff --git a/src/bin/e_layout.h b/src/bin/e_layout.h index 0e6ef59c2..43a6fdfd5 100644 --- a/src/bin/e_layout.h +++ b/src/bin/e_layout.h @@ -25,5 +25,8 @@ EAPI void e_layout_unpack (Evas_Object *obj); EAPI Eina_List *e_layout_children_get(Evas_Object *obj); EAPI Evas_Object *e_layout_top_child_at_xy_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, const Eina_List *ignore); +EAPI Evas_Object *e_layout_child_below_get(Evas_Object *obj); +EAPI Evas_Object *e_layout_child_above_get(Evas_Object *obj); +EAPI Evas_Object *e_layout_top_child_get(Evas_Object *obj); #endif #endif