From 00d01850f42d8d9e43763188f7de8642585573b2 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Tue, 21 Feb 2012 04:39:15 +0000 Subject: [PATCH] elementary/grid - more API elm_grid_chidren_get SVN revision: 68198 --- legacy/elementary/src/lib/elm_grid.c | 11 +++++++++-- legacy/elementary/src/lib/elm_grid.h | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/legacy/elementary/src/lib/elm_grid.c b/legacy/elementary/src/lib/elm_grid.c index 8c8e9014bb..f1af76bff8 100644 --- a/legacy/elementary/src/lib/elm_grid.c +++ b/legacy/elementary/src/lib/elm_grid.c @@ -79,9 +79,7 @@ elm_grid_add(Evas_Object *parent) Widget_Data *wd; ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL); - ELM_SET_WIDTYPE(widtype, "grid"); - wd->obj = obj; elm_widget_type_set(obj, "grid"); elm_widget_sub_object_add(parent, obj); elm_widget_data_set(obj, wd); @@ -168,3 +166,12 @@ elm_grid_pack_get(Evas_Object *subobj, int *x, int *y, int *w, int *h) if (!wd) return; evas_object_grid_pack_get(wd->grd, subobj, x, y, w, h); } + +EAPI Eina_List * +elm_grid_children_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + return evas_object_grid_children_get(wd->grd); +} diff --git a/legacy/elementary/src/lib/elm_grid.h b/legacy/elementary/src/lib/elm_grid.h index 5efa9c3d28..d458ec3a03 100644 --- a/legacy/elementary/src/lib/elm_grid.h +++ b/legacy/elementary/src/lib/elm_grid.h @@ -93,7 +93,7 @@ EAPI void elm_grid_clear(Evas_Object *obj, Eina_Bool clear); EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); /** - * get packing of a child + * Get packing of a child * * @param subobj The child to query * @param x Pointer to integer to store the virtual x coord @@ -105,6 +105,20 @@ EAPI void elm_grid_pack_set(Evas_Object *subobj, Evas_Coord x, Evas_Coor */ EAPI void elm_grid_pack_get(Evas_Object *subobj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); +/** + * Get the list of the children for the grid. + * + * @param obj The grid object + * + * @note This is a duplicate of the list kept by the grid internally. + It's up to the user to destroy it when it no longer needs it. + It's possible to remove objects from the grid when walking this + list, but these removals won't be reflected on it. + * + * @ingroup Grid + */ +EAPI Eina_List *elm_grid_children_get(const Evas_Object *obj); + /** * @} */