From 519296191d37da6123f71e7d5dd6048a51293181 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 31 Dec 2008 11:49:42 +0000 Subject: [PATCH] Return success or not for table API. SVN revision: 38381 --- legacy/edje/src/lib/Edje.h | 4 ++-- legacy/edje/src/lib/edje_util.c | 28 ++++++++++++++++++---------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/legacy/edje/src/lib/Edje.h b/legacy/edje/src/lib/Edje.h index fdbb5faa7e..825fcabdc5 100644 --- a/legacy/edje/src/lib/Edje.h +++ b/legacy/edje/src/lib/Edje.h @@ -278,8 +278,8 @@ extern "C" { EAPI Evas_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Evas_Bool clear); EAPI Evas_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 Evas_Bool edje_object_part_table_unpack (Evas_Object *obj, const char *part, Evas_Object *child_obj); - EAPI void edje_object_part_table_col_row_size_get (const Evas_Object *obj, const char *part, int *cols, int *rows); - EAPI void edje_object_part_table_clear (Evas_Object *obj, const char *part, Evas_Bool clear); + EAPI Evas_Bool edje_object_part_table_col_row_size_get (const Evas_Object *obj, const char *part, int *cols, int *rows); + EAPI Evas_Bool edje_object_part_table_clear (Evas_Object *obj, const char *part, Evas_Bool clear); /* edje_message_queue.c */ EAPI void edje_object_message_send (Evas_Object *obj, Edje_Message_Type type, int id, void *msg); diff --git a/legacy/edje/src/lib/edje_util.c b/legacy/edje/src/lib/edje_util.c index 0c12710685..deecee41a9 100644 --- a/legacy/edje/src/lib/edje_util.c +++ b/legacy/edje/src/lib/edje_util.c @@ -2487,22 +2487,26 @@ edje_object_part_table_unpack(Evas_Object *obj, const char *part, Evas_Object *c * @param cols Pointer where to store number of columns (can be NULL) * @param rows Pointer where to store number of rows (can be NULL) * + * @return 1: Successfully get some data.\n + * 0: An error occured. + * * Retrieves the size of the table in number of columns and rows.\n */ -EAPI void +EAPI Evas_Bool edje_object_part_table_col_row_size_get(const Evas_Object *obj, const char *part, int *cols, int *rows) { Edje *ed; Edje_Real_Part *rp; ed = _edje_fetch(obj); - if ((!ed) || (!part)) return; + if ((!ed) || (!part)) return 0; rp = _edje_real_part_recursive_get(ed, part); - if (!rp) return; - if (rp->part->type != EDJE_PART_TYPE_TABLE) return; + if (!rp) return 0; + if (rp->part->type != EDJE_PART_TYPE_TABLE) return 0; - return evas_object_table_col_row_size_get(rp->object, cols, rows); + evas_object_table_col_row_size_get(rp->object, cols, rows); + return 1; } /** Removes all object from the table @@ -2510,23 +2514,27 @@ edje_object_part_table_col_row_size_get(const Evas_Object *obj, const char *part * @param part The part name * @param clear If set, will delete subobjs on remove * + * @return 1: Successfully clear table.\n + * 0: An error occured. + * * Removes all object from the table indicated by part, except * the internal ones set from the theme.\n */ -EAPI void +EAPI Evas_Bool edje_object_part_table_clear(Evas_Object *obj, const char *part, Evas_Bool clear) { Edje *ed; Edje_Real_Part *rp; ed = _edje_fetch(obj); - if ((!ed) || (!part)) return; + if ((!ed) || (!part)) return 0; rp = _edje_real_part_recursive_get(ed, part); - if (!rp) return; - if (rp->part->type != EDJE_PART_TYPE_TABLE) return; + if (!rp) return 0; + if (rp->part->type != EDJE_PART_TYPE_TABLE) return 0; - return _edje_real_part_table_clear(rp, clear); + _edje_real_part_table_clear(rp, clear); + return 1; } Evas_Bool