forked from enlightenment/efl
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>
This commit is contained in:
parent
b3b5999847
commit
26cd65cfcb
|
@ -1608,7 +1608,7 @@ EAPI int edje_edit_state_min_w_get(Evas_Object *obj, const char *part, const cha
|
|||
* @param value The state value.
|
||||
* @param min_w Minimum width value.
|
||||
*/
|
||||
EAPI void edje_edit_state_min_w_set(Evas_Object *obj, const char *part, const char *state, double value, int min_w);
|
||||
EAPI Eina_Bool edje_edit_state_min_w_set(Evas_Object *obj, const char *part, const char *state, double value, int min_w);
|
||||
|
||||
/** Get the minimum height value of a part state.
|
||||
*
|
||||
|
@ -1629,7 +1629,7 @@ EAPI int edje_edit_state_min_h_get(Evas_Object *obj, const char *part, const cha
|
|||
* @param value The state value.
|
||||
* @param min_h Minimum height value.
|
||||
*/
|
||||
EAPI void edje_edit_state_min_h_set(Evas_Object *obj, const char *part, const char *state, double value, int min_h);
|
||||
EAPI Eina_Bool edje_edit_state_min_h_set(Evas_Object *obj, const char *part, const char *state, double value, int min_h);
|
||||
|
||||
/** Get the maximum width value of a part state.
|
||||
*
|
||||
|
@ -1650,7 +1650,7 @@ EAPI int edje_edit_state_max_w_get(Evas_Object *obj, const char *part, const cha
|
|||
* @param value The state value.
|
||||
* @param max_w Maximum width value.
|
||||
*/
|
||||
EAPI void edje_edit_state_max_w_set(Evas_Object *obj, const char *part, const char *state, double value, int max_w);
|
||||
EAPI Eina_Bool edje_edit_state_max_w_set(Evas_Object *obj, const char *part, const char *state, double value, int max_w);
|
||||
|
||||
/** Get the maximum height value of a part state.
|
||||
*
|
||||
|
@ -1671,7 +1671,7 @@ EAPI int edje_edit_state_max_h_get(Evas_Object *obj, const char *part, const cha
|
|||
* @param value The state value.
|
||||
* @param max_h Maximum height value.
|
||||
*/
|
||||
EAPI void edje_edit_state_max_h_set(Evas_Object *obj, const char *part, const char *state, double value, int max_h);
|
||||
EAPI Eina_Bool edje_edit_state_max_h_set(Evas_Object *obj, const char *part, const char *state, double value, int max_h);
|
||||
|
||||
/** Get the minimum aspect value of a part state.
|
||||
*
|
||||
|
|
|
@ -3346,27 +3346,31 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state
|
|||
edje_object_calc_force(obj); \
|
||||
}
|
||||
|
||||
#define FUNC_STATE_INT(Class, Value) \
|
||||
#define FUNC_STATE_INT(Class, Value, Min) \
|
||||
EAPI int \
|
||||
edje_edit_state_##Class##_##Value##_get(Evas_Object *obj, const char *part, const char *state, double value) \
|
||||
{ \
|
||||
GET_PD_OR_RETURN(0); \
|
||||
return pd->Class.Value; \
|
||||
} \
|
||||
EAPI void \
|
||||
EAPI Eina_Bool \
|
||||
edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, int v) \
|
||||
{ \
|
||||
GET_PD_OR_RETURN(); \
|
||||
if ((!obj) || (!part) || (!state)) \
|
||||
return EINA_FALSE; \
|
||||
if (v < Min) return EINA_FALSE; \
|
||||
GET_PD_OR_RETURN(EINA_FALSE); \
|
||||
pd->Class.Value = v; \
|
||||
edje_object_calc_force(obj); \
|
||||
return EINA_TRUE; \
|
||||
}
|
||||
|
||||
FUNC_STATE_DOUBLE(align, x);
|
||||
FUNC_STATE_DOUBLE(align, y);
|
||||
FUNC_STATE_INT(min, w);
|
||||
FUNC_STATE_INT(min, h);
|
||||
FUNC_STATE_INT(max, w);
|
||||
FUNC_STATE_INT(max, h);
|
||||
FUNC_STATE_INT(min, w, 0);
|
||||
FUNC_STATE_INT(min, h, 0);
|
||||
FUNC_STATE_INT(max, w, -1);
|
||||
FUNC_STATE_INT(max, h, -1);
|
||||
FUNC_STATE_DOUBLE(aspect, min);
|
||||
FUNC_STATE_DOUBLE(aspect, max);
|
||||
|
||||
|
|
Loading…
Reference in New Issue