aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-18 13:43:52 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-18 13:43:52 +0000
commit3eebd1ad4d1c3d327e086000696c521f49a7dd3a (patch)
treeeabc8e5af7eb96d86abbed0ccb004845a301a0c6
parentf36ecd9d3d605ce06a4d01da55a8acf3c131623a (diff)
downloadenlightenment-3eebd1ad4d1c3d327e086000696c521f49a7dd3a.tar.gz
enlightenment-3eebd1ad4d1c3d327e086000696c521f49a7dd3a.tar.xz
enlightenment-3eebd1ad4d1c3d327e086000696c521f49a7dd3a.zip
add e_layout_top_child_get, e_layout_child_below_get and e_layout_child_above_get
SVN revision: 84061
-rw-r--r--ChangeLog1
-rw-r--r--NEWS1
-rw-r--r--src/bin/e_layout.c35
-rw-r--r--src/bin/e_layout.h3
4 files changed, 40 insertions, 0 deletions
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