From 31b6cc36a9a7dc6975e3023e0c2477c05876cb6d Mon Sep 17 00:00:00 2001 From: raster Date: Fri, 17 Jun 2011 11:34:30 +0000 Subject: [PATCH] allow getting ot table packing child too. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@60447 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 2 +- src/lib/Evas.h | 14 ++++++++++++++ src/lib/canvas/evas_object_table.c | 22 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4d40965..d087dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -407,4 +407,4 @@ * Allow evas table to re-pack the same object without error and just update packing parameters - + * Allow to get packign location of table child diff --git a/src/lib/Evas.h b/src/lib/Evas.h index 79355d1..289d04e 100644 --- a/src/lib/Evas.h +++ b/src/lib/Evas.h @@ -8328,6 +8328,20 @@ EAPI Eina_Bool evas_object_table_mirrored_get (cons /** + * Get packgin location of a child of table + * + * @param o The given table object. + * @param child The child object to add. + * @param col pointer to store relative-horizontal position to place child. + * @param row pointer to store relative-vertical position to place child. + * @param colspan pointer to store how many relative-horizontal position to use for this child. + * @param rowspan pointer to store how many relative-vertical position to use for this child. + * + * @return 1 on success, 0 on failure. + */ +EAPI Eina_Bool evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan); + +/** * Add a new child to a table object. * * @param o The given table object. diff --git a/src/lib/canvas/evas_object_table.c b/src/lib/canvas/evas_object_table.c index 533d9ab..420c25a 100644 --- a/src/lib/canvas/evas_object_table.c +++ b/src/lib/canvas/evas_object_table.c @@ -1046,6 +1046,28 @@ evas_object_table_padding_get(const Evas_Object *o, Evas_Coord *horizontal, Evas } EAPI Eina_Bool +evas_object_table_pack_get(Evas_Object *o, Evas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan) +{ + Evas_Object_Table_Option *opt; + + EVAS_OBJECT_TABLE_DATA_GET_OR_RETURN_VAL(o, priv, 0); + opt = _evas_object_table_option_get(child); + if (!opt) + { + if (col) *col = 0; + if (row) *row = 0; + if (colspan) *colspan = 0; + if (rowspan) *rowspan = 0; + return EINA_FALSE; + } + if (col) *col = opt->col; + if (row) *row = opt->row; + if (colspan) *colspan = opt->colspan; + if (rowspan) *rowspan = opt->rowspan; + return EINA_TRUE; +} + +EAPI Eina_Bool evas_object_table_pack(Evas_Object *o, Evas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan) { Evas_Object_Table_Option *opt; -- 2.7.4