summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVorobiov Vitalii <vi.vorobiov@samsung.com>2013-10-30 21:45:00 +0900
committerCedric Bail <cedric.bail@free.fr>2013-10-30 22:30:15 +0900
commit26cd65cfcb7605330133effc841baa8fac9e0131 (patch)
tree013476c3db35bf0d4c1071da45dc0a9069e740da /src
parentb3b5999847a4597fbc8c127970a669d17b0b57de (diff)
edje: Make setters for "edje_edit_state_min/max..." return Eina_Bool
This patch start returning Eina_Bool for state's min and max value setters, so we can now catch error when calling those function. edje_edit_state_min_h_set edje_edit_state_min_w_set edje_edit_state_max_h_set edje_edit_state_max_w_set Reviewers: cedric, seoz Reviewed By: cedric CC: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D298 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/Edje_Edit.h8
-rw-r--r--src/lib/edje/edje_edit.c20
2 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 1a6d037ffe..1c3f24f5ec 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1608,7 +1608,7 @@ EAPI int edje_edit_state_min_w_get(Evas_Object *obj, const char *part, const cha
1608 * @param value The state value. 1608 * @param value The state value.
1609 * @param min_w Minimum width value. 1609 * @param min_w Minimum width value.
1610 */ 1610 */
1611EAPI void edje_edit_state_min_w_set(Evas_Object *obj, const char *part, const char *state, double value, int min_w); 1611EAPI Eina_Bool edje_edit_state_min_w_set(Evas_Object *obj, const char *part, const char *state, double value, int min_w);
1612 1612
1613/** Get the minimum height value of a part state. 1613/** Get the minimum height value of a part state.
1614 * 1614 *
@@ -1629,7 +1629,7 @@ EAPI int edje_edit_state_min_h_get(Evas_Object *obj, const char *part, const cha
1629 * @param value The state value. 1629 * @param value The state value.
1630 * @param min_h Minimum height value. 1630 * @param min_h Minimum height value.
1631 */ 1631 */
1632EAPI void edje_edit_state_min_h_set(Evas_Object *obj, const char *part, const char *state, double value, int min_h); 1632EAPI Eina_Bool edje_edit_state_min_h_set(Evas_Object *obj, const char *part, const char *state, double value, int min_h);
1633 1633
1634/** Get the maximum width value of a part state. 1634/** Get the maximum width value of a part state.
1635 * 1635 *
@@ -1650,7 +1650,7 @@ EAPI int edje_edit_state_max_w_get(Evas_Object *obj, const char *part, const cha
1650 * @param value The state value. 1650 * @param value The state value.
1651 * @param max_w Maximum width value. 1651 * @param max_w Maximum width value.
1652 */ 1652 */
1653EAPI void edje_edit_state_max_w_set(Evas_Object *obj, const char *part, const char *state, double value, int max_w); 1653EAPI Eina_Bool edje_edit_state_max_w_set(Evas_Object *obj, const char *part, const char *state, double value, int max_w);
1654 1654
1655/** Get the maximum height value of a part state. 1655/** Get the maximum height value of a part state.
1656 * 1656 *
@@ -1671,7 +1671,7 @@ EAPI int edje_edit_state_max_h_get(Evas_Object *obj, const char *part, const cha
1671 * @param value The state value. 1671 * @param value The state value.
1672 * @param max_h Maximum height value. 1672 * @param max_h Maximum height value.
1673 */ 1673 */
1674EAPI void edje_edit_state_max_h_set(Evas_Object *obj, const char *part, const char *state, double value, int max_h); 1674EAPI Eina_Bool edje_edit_state_max_h_set(Evas_Object *obj, const char *part, const char *state, double value, int max_h);
1675 1675
1676/** Get the minimum aspect value of a part state. 1676/** Get the minimum aspect value of a part state.
1677 * 1677 *
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 90cb4cf70c..e72cf8ebd8 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3346,27 +3346,31 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state
3346 edje_object_calc_force(obj); \ 3346 edje_object_calc_force(obj); \
3347 } 3347 }
3348 3348
3349#define FUNC_STATE_INT(Class, Value) \ 3349#define FUNC_STATE_INT(Class, Value, Min) \
3350 EAPI int \ 3350 EAPI int \
3351 edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \ 3351 edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
3352 { \ 3352 { \
3353 GET_PD_OR_RETURN(0); \ 3353 GET_PD_OR_RETURN(0); \
3354 return pd->Class.Value; \ 3354 return pd->Class.Value; \
3355 } \ 3355 } \
3356 EAPI void \ 3356 EAPI Eina_Bool \
3357 edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, int v) \ 3357 edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, int v) \
3358 { \ 3358 { \
3359 GET_PD_OR_RETURN(); \ 3359 if ((!obj) || (!part) || (!state)) \
3360 pd->Class.Value = v; \ 3360 return EINA_FALSE; \
3361 if (v < Min) return EINA_FALSE; \
3362 GET_PD_OR_RETURN(EINA_FALSE); \
3363 pd->Class.Value = v; \
3361 edje_object_calc_force(obj); \ 3364 edje_object_calc_force(obj); \
3365 return EINA_TRUE; \
3362 } 3366 }
3363 3367
3364FUNC_STATE_DOUBLE(align, x); 3368FUNC_STATE_DOUBLE(align, x);
3365FUNC_STATE_DOUBLE(align, y); 3369FUNC_STATE_DOUBLE(align, y);
3366FUNC_STATE_INT(min, w); 3370FUNC_STATE_INT(min, w, 0);
3367FUNC_STATE_INT(min, h); 3371FUNC_STATE_INT(min, h, 0);
3368FUNC_STATE_INT(max, w); 3372FUNC_STATE_INT(max, w, -1);
3369FUNC_STATE_INT(max, h); 3373FUNC_STATE_INT(max, h, -1);
3370FUNC_STATE_DOUBLE(aspect, min); 3374FUNC_STATE_DOUBLE(aspect, min);
3371FUNC_STATE_DOUBLE(aspect, max); 3375FUNC_STATE_DOUBLE(aspect, max);
3372 3376