From 919c51de088fb7a3e352e467caf774b20fceb70a Mon Sep 17 00:00:00 2001 From: Andrii Kroitor Date: Wed, 30 Oct 2013 22:11:22 +0900 Subject: [PATCH] edje: make edje_edit_group_*_*_set return Eina_Bool. Make the following function return Eina_Bool so that the caller can detect errors : edje_edit_group_min_w_set edje_edit_group_min_h_set edje_edit_group_max_w_set edje_edit_group_max_h_set Reviewers: cedric, seoz CC: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D291 Signed-off-by: Cedric Bail --- src/lib/edje/Edje_Edit.h | 16 ++++++++++++---- src/lib/edje/edje_edit.c | 29 ++++++++++++++++------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 47285c6920..70621bedb4 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -271,8 +271,10 @@ EAPI int edje_edit_group_min_w_get(Evas_Object *obj); * * @param obj Object being edited. * @param w New minimum width for the group. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_group_min_w_set(Evas_Object *obj, int w); +EAPI Eina_Bool edje_edit_group_min_w_set(Evas_Object *obj, int w); /** Get the group minimum height. * @@ -286,8 +288,10 @@ EAPI int edje_edit_group_min_h_get(Evas_Object *obj); * * @param obj Object being edited. * @param h New minimum height for the group. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_group_min_h_set(Evas_Object *obj, int h); +EAPI Eina_Bool edje_edit_group_min_h_set(Evas_Object *obj, int h); /** Get the group maximum width. * @@ -301,8 +305,10 @@ EAPI int edje_edit_group_max_w_get(Evas_Object *obj); * * @param obj Object being edited. * @param w New maximum width for the group. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_group_max_w_set(Evas_Object *obj, int w); +EAPI Eina_Bool edje_edit_group_max_w_set(Evas_Object *obj, int w); /** Get the group maximum height. * @@ -316,8 +322,10 @@ EAPI int edje_edit_group_max_h_get(Evas_Object *obj); * * @param obj Object being edited. * @param h New maximum height for the group. + * + * @return EINA_TRUE if successful, EINA_FALSE otherwise. */ -EAPI void edje_edit_group_max_h_set(Evas_Object *obj, int h); +EAPI Eina_Bool edje_edit_group_max_h_set(Evas_Object *obj, int h); //@} diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index dabed3a0c2..17e1628040 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -1115,19 +1115,22 @@ edje_edit_group_name_set(Evas_Object *obj, const char *new_name) return EINA_TRUE; } -#define FUNC_GROUP_ACCESSOR(Class, Value) \ - EAPI int \ - edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \ - { \ - GET_ED_OR_RETURN(-1); \ - if (!ed->collection) return -1; \ - return ed->collection->prop.Class.Value; \ - } \ - EAPI void \ - edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \ - { \ - GET_ED_OR_RETURN(); \ - ed->collection->prop.Class.Value = v; \ +#define FUNC_GROUP_ACCESSOR(Class, Value) \ + EAPI int \ + edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \ + { \ + GET_ED_OR_RETURN(-1); \ + if (!ed->collection) return -1; \ + return ed->collection->prop.Class.Value; \ + } \ + EAPI Eina_Bool \ + edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \ + { \ + GET_ED_OR_RETURN(EINA_FALSE); \ + if (!ed->collection) return EINA_FALSE; \ + if (v < 0) return EINA_FALSE; \ + ed->collection->prop.Class.Value = v; \ + return EINA_TRUE; \ } FUNC_GROUP_ACCESSOR(min, w);