From 40d4acd77edb2ade0a03f66b7c7d4af94787b4f6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Reutskiy Date: Mon, 2 Dec 2013 14:54:28 +0900 Subject: [PATCH] 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 --- src/lib/edje/Edje_Edit.h | 46 ++++++++++++++++++++++++++++++++++++++++ src/lib/edje/edje_edit.c | 20 +++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h index 23611da296..542a05d896 100644 --- a/src/lib/edje/Edje_Edit.h +++ b/src/lib/edje/Edje_Edit.h @@ -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. diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index b97f03fcd2..68d95616d3 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -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);