edje_edit: Add getters and setters for fixed param

Reviewers: cedric, seoz, raster

Reviewed By: raster

CC: cedric

Differential Revision: https://phab.enlightenment.org/D339
This commit is contained in:
Vyacheslav Reutskiy 2013-12-02 14:54:28 +09:00 committed by Carsten Haitzler (Rasterman)
parent e97504a669
commit 40d4acd77e
2 changed files with 66 additions and 0 deletions

View File

@ -1773,6 +1773,52 @@ EAPI int edje_edit_state_max_h_get(Evas_Object *obj, const char *part, const cha
*/
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 fixed width value of a part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to get fixed width value (not including the state value).
* @param value The state value.
*
* @return The fixed width value.
*/
EAPI Eina_Bool edje_edit_state_fixed_w_get(Evas_Object *obj, const char *part, const char *state, double value);
/** Set the fixed width value of a part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to set fixed width value (not including the state value).
* @param value The state value.
* @param fixed Fixed width value.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
EAPI Eina_Bool edje_edit_state_fixed_w_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool fixed);
/** Get the fixed height value of a part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to get fixed height value (not including the state value).
* @param value The state value.
*
* @return The fixed height value.
*/
EAPI Eina_Bool edje_edit_state_fixed_h_get(Evas_Object *obj, const char *part, const char *state, double value);
/** Set the fixed height value of a part state.
*
* @param obj Object being edited.
* @param part Part that contain state.
* @param state The name of the state to set maximum height (not including the state value).
* @param value The state value.
* @param fixed Fixed height value.
*
* @return EINA_TRUE if successful, EINA_FALSE otherwise.
*/
EAPI Eina_Bool edje_edit_state_fixed_h_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool fixed);
/** Get the minimum aspect value of a part state.
*
* @param obj Object being edited.

View File

@ -3387,12 +3387,32 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state
return EINA_TRUE; \
}
#define FUNC_STATE_BOOL(Class, Value) \
EAPI Eina_Bool \
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 Eina_Bool \
edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool v) \
{ \
if ((!obj) || (!part) || (!state)) \
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, 0);
FUNC_STATE_INT(min, h, 0);
FUNC_STATE_INT(max, w, -1);
FUNC_STATE_INT(max, h, -1);
FUNC_STATE_BOOL(fixed, w);
FUNC_STATE_BOOL(fixed, h);
FUNC_STATE_DOUBLE(aspect, min);
FUNC_STATE_DOUBLE(aspect, max);