summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrii Kroitor <an.kroitor@samsung.com>2013-10-30 22:11:22 +0900
committerCedric Bail <cedric.bail@free.fr>2013-10-30 22:30:16 +0900
commit919c51de088fb7a3e352e467caf774b20fceb70a (patch)
treec67c6dde582ab06be4b5fec519a664e6451c45b5 /src
parent6af736860250f1f57c8fdd959495cc6be71b15ad (diff)
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 <cedric.bail@free.fr>
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/Edje_Edit.h16
-rw-r--r--src/lib/edje/edje_edit.c29
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);
271 * 271 *
272 * @param obj Object being edited. 272 * @param obj Object being edited.
273 * @param w New minimum width for the group. 273 * @param w New minimum width for the group.
274 *
275 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
274 */ 276 */
275EAPI void edje_edit_group_min_w_set(Evas_Object *obj, int w); 277EAPI Eina_Bool edje_edit_group_min_w_set(Evas_Object *obj, int w);
276 278
277/** Get the group minimum height. 279/** Get the group minimum height.
278 * 280 *
@@ -286,8 +288,10 @@ EAPI int edje_edit_group_min_h_get(Evas_Object *obj);
286 * 288 *
287 * @param obj Object being edited. 289 * @param obj Object being edited.
288 * @param h New minimum height for the group. 290 * @param h New minimum height for the group.
291 *
292 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
289 */ 293 */
290EAPI void edje_edit_group_min_h_set(Evas_Object *obj, int h); 294EAPI Eina_Bool edje_edit_group_min_h_set(Evas_Object *obj, int h);
291 295
292/** Get the group maximum width. 296/** Get the group maximum width.
293 * 297 *
@@ -301,8 +305,10 @@ EAPI int edje_edit_group_max_w_get(Evas_Object *obj);
301 * 305 *
302 * @param obj Object being edited. 306 * @param obj Object being edited.
303 * @param w New maximum width for the group. 307 * @param w New maximum width for the group.
308 *
309 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
304 */ 310 */
305EAPI void edje_edit_group_max_w_set(Evas_Object *obj, int w); 311EAPI Eina_Bool edje_edit_group_max_w_set(Evas_Object *obj, int w);
306 312
307/** Get the group maximum height. 313/** Get the group maximum height.
308 * 314 *
@@ -316,8 +322,10 @@ EAPI int edje_edit_group_max_h_get(Evas_Object *obj);
316 * 322 *
317 * @param obj Object being edited. 323 * @param obj Object being edited.
318 * @param h New maximum height for the group. 324 * @param h New maximum height for the group.
325 *
326 * @return EINA_TRUE if successful, EINA_FALSE otherwise.
319 */ 327 */
320EAPI void edje_edit_group_max_h_set(Evas_Object *obj, int h); 328EAPI Eina_Bool edje_edit_group_max_h_set(Evas_Object *obj, int h);
321 329
322 330
323//@} 331//@}
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)
1115 return EINA_TRUE; 1115 return EINA_TRUE;
1116} 1116}
1117 1117
1118#define FUNC_GROUP_ACCESSOR(Class, Value) \ 1118#define FUNC_GROUP_ACCESSOR(Class, Value) \
1119 EAPI int \ 1119 EAPI int \
1120 edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \ 1120 edje_edit_group_##Class##_##Value##_get(Evas_Object *obj) \
1121 { \ 1121 { \
1122 GET_ED_OR_RETURN(-1); \ 1122 GET_ED_OR_RETURN(-1); \
1123 if (!ed->collection) return -1; \ 1123 if (!ed->collection) return -1; \
1124 return ed->collection->prop.Class.Value; \ 1124 return ed->collection->prop.Class.Value; \
1125 } \ 1125 } \
1126 EAPI void \ 1126 EAPI Eina_Bool \
1127 edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \ 1127 edje_edit_group_##Class##_##Value##_set(Evas_Object *obj, int v) \
1128 { \ 1128 { \
1129 GET_ED_OR_RETURN(); \ 1129 GET_ED_OR_RETURN(EINA_FALSE); \
1130 ed->collection->prop.Class.Value = v; \ 1130 if (!ed->collection) return EINA_FALSE; \
1131 if (v < 0) return EINA_FALSE; \
1132 ed->collection->prop.Class.Value = v; \
1133 return EINA_TRUE; \
1131 } 1134 }
1132 1135
1133FUNC_GROUP_ACCESSOR(min, w); 1136FUNC_GROUP_ACCESSOR(min, w);