diff options
author | Vorobiov Vitalii <vi.vorobiov@samsung.com> | 2013-11-01 11:01:37 +0900 |
---|---|---|
committer | Cedric Bail <cedric.bail@samsung.com> | 2013-11-01 11:01:42 +0900 |
commit | 848cc1d1ea1fc99bf5c8181a6735a414c178076f (patch) | |
tree | 245593c1a9a6e6c2f833507d921e2fe171b28c47 /src | |
parent | cf452cc419b5c4449d0538a9638f79b898f10025 (diff) |
edje: make functions in edje_edit API return Eina_Bool.
Make the following functions return Eina_Bool so the caller can detect errors:
edje_edit_state_visible_set
edje_edit_state_color_class_set
Removed unnecessary check in edje_edit_state_image_border_fill_set.
Reviewers: cedric, seoz
Reviewed By: cedric
CC: reutskiy.v.v
Differential Revision: https://phab.enlightenment.org/D305
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/edje/Edje_Edit.h | 8 | ||||
-rw-r--r-- | src/lib/edje/edje_edit.c | 24 |
2 files changed, 22 insertions, 10 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 77dfff9d79..ab7bda6ff7 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h | |||
@@ -1987,8 +1987,10 @@ EAPI Eina_Bool edje_edit_state_visible_get(Evas_Object *obj, const char *part, c | |||
1987 | * @param state The name of the state to set visibility (not including the state value). | 1987 | * @param state The name of the state to set visibility (not including the state value). |
1988 | * @param value The state value. | 1988 | * @param value The state value. |
1989 | * @param visible To set state visible (EINA_TRUE if the state is visible, EINA_FALSE otherwise) | 1989 | * @param visible To set state visible (EINA_TRUE if the state is visible, EINA_FALSE otherwise) |
1990 | * | ||
1991 | * @return EINA_TRUE if successful, EINA_FALSE otherwise. | ||
1990 | */ | 1992 | */ |
1991 | EAPI void edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible); | 1993 | EAPI Eina_Bool edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible); |
1992 | 1994 | ||
1993 | /** Get the color class of the given part state. | 1995 | /** Get the color class of the given part state. |
1994 | * | 1996 | * |
@@ -2010,8 +2012,10 @@ EAPI const char *edje_edit_state_color_class_get(Evas_Object *obj, const char *p | |||
2010 | * @param state The name of the state to set color class (not including the state value). | 2012 | * @param state The name of the state to set color class (not including the state value). |
2011 | * @param value The state value. | 2013 | * @param value The state value. |
2012 | * @param color_class The color class to assign. | 2014 | * @param color_class The color class to assign. |
2015 | * | ||
2016 | * @return EINA_TRUE if successful, EINA_FALSE otherwise. | ||
2013 | */ | 2017 | */ |
2014 | EAPI void edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class); | 2018 | EAPI Eina_Bool edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class); |
2015 | 2019 | ||
2016 | /** Get the list of parameters for an external part. | 2020 | /** Get the list of parameters for an external part. |
2017 | * | 2021 | * |
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 34dfb45cc2..2699604d1b 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c | |||
@@ -3533,14 +3533,18 @@ edje_edit_state_visible_get(Evas_Object *obj, const char *part, const char *stat | |||
3533 | return pd->visible; | 3533 | return pd->visible; |
3534 | } | 3534 | } |
3535 | 3535 | ||
3536 | EAPI void | 3536 | EAPI Eina_Bool |
3537 | edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible) | 3537 | edje_edit_state_visible_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool visible) |
3538 | { | 3538 | { |
3539 | GET_PD_OR_RETURN(); | 3539 | if ((!obj) || (!part) || (!state)) |
3540 | //printf("Set state visible flag of part: %s state: %s to: %d\n", part, state, visible); | 3540 | return EINA_FALSE; |
3541 | GET_PD_OR_RETURN(EINA_FALSE); | ||
3542 | |||
3541 | if (visible) pd->visible = 1; | 3543 | if (visible) pd->visible = 1; |
3542 | else pd->visible = 0; | 3544 | else pd->visible = 0; |
3545 | |||
3543 | edje_object_calc_force(obj); | 3546 | edje_object_calc_force(obj); |
3547 | return EINA_TRUE; | ||
3544 | } | 3548 | } |
3545 | 3549 | ||
3546 | EAPI unsigned char | 3550 | EAPI unsigned char |
@@ -3569,13 +3573,17 @@ edje_edit_state_color_class_get(Evas_Object *obj, const char *part, const char * | |||
3569 | return eina_stringshare_add(pd->color_class); | 3573 | return eina_stringshare_add(pd->color_class); |
3570 | } | 3574 | } |
3571 | 3575 | ||
3572 | EAPI void | 3576 | EAPI Eina_Bool |
3573 | edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class) | 3577 | edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *state, double value, const char *color_class) |
3574 | { | 3578 | { |
3575 | GET_PD_OR_RETURN(); | 3579 | if ((!obj) || (!part) || (!state)) |
3576 | //printf("Set ColorClass of part: %s state: %s [to: %s]\n", part, state, color_class); | 3580 | return EINA_FALSE; |
3581 | GET_PD_OR_RETURN(EINA_FALSE); | ||
3582 | |||
3577 | _edje_if_string_free(ed, pd->color_class); | 3583 | _edje_if_string_free(ed, pd->color_class); |
3578 | pd->color_class = (char*)eina_stringshare_add(color_class); | 3584 | |
3585 | pd->color_class = (char *)eina_stringshare_add(color_class); | ||
3586 | return EINA_TRUE; | ||
3579 | } | 3587 | } |
3580 | 3588 | ||
3581 | EAPI const Eina_List * | 3589 | EAPI const Eina_List * |
@@ -4798,7 +4806,7 @@ edje_edit_state_image_border_fill_set(Evas_Object *obj, const char *part, const | |||
4798 | 4806 | ||
4799 | if ((!obj) || (!part) || (!state)) | 4807 | if ((!obj) || (!part) || (!state)) |
4800 | return EINA_FALSE; | 4808 | return EINA_FALSE; |
4801 | if ((fill < 0) || (fill > 2)) | 4809 | if (fill > 2) |
4802 | return EINA_FALSE; | 4810 | return EINA_FALSE; |
4803 | 4811 | ||
4804 | eina_error_set(0); | 4812 | eina_error_set(0); |