From a0893fed7eca063bda4bf30624f800d085e830bc Mon Sep 17 00:00:00 2001 From: barbieri Date: Sat, 17 Apr 2010 20:28:22 +0000 Subject: [PATCH] Get a table element with its coordinates. By: Hugo Camboulive git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@48088 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Edje.h | 1 + src/lib/edje_util.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/lib/Edje.h b/src/lib/Edje.h index 90ebff2..efc2399 100644 --- a/src/lib/Edje.h +++ b/src/lib/Edje.h @@ -544,6 +544,7 @@ extern "C" { EAPI Evas_Object *edje_object_part_box_remove (Evas_Object *obj, const char *part, Evas_Object *child); EAPI Evas_Object *edje_object_part_box_remove_at (Evas_Object *obj, const char *part, unsigned int pos); EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Eina_Bool clear); + EAPI Evas_Object *edje_object_part_table_child_get(Evas_Object *obj, const char *part, unsigned int col, unsigned int row); EAPI Eina_Bool edje_object_part_table_pack (Evas_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan); EAPI Eina_Bool edje_object_part_table_unpack (Evas_Object *obj, const char *part, Evas_Object *child_obj); EAPI Eina_Bool edje_object_part_table_col_row_size_get (const Evas_Object *obj, const char *part, int *cols, int *rows); diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 1e5ea92..1a2b04a 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -3673,6 +3673,31 @@ _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child) } /** + * @brief Retrieve a child from a table + * + * @param obj A valid Evas_Object handle + * @param part The part name + * @param col The column of the child to get + * @param row The row of the child to get + * @return The child Evas_Object + */ +EAPI Evas_Object * +edje_object_part_table_child_get(Evas_Object *obj, const char *part, unsigned int col, unsigned int row) +{ + Edje *ed; + Edje_Real_Part *rp; + + ed = _edje_fetch(obj); + if ((!ed) || (!part)) return NULL; + + rp = _edje_real_part_recursive_get(ed, part); + if (!rp) return NULL; + if (rp->part->type != EDJE_PART_TYPE_TABLE) return NULL; + + return evas_object_table_child_get(rp->object, col, row); +} + +/** * @brief Packs an object into the table. * * @param obj A valid Evas_Object handle -- 2.7.4