rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=9cbd357d5471636bdecaf1c2670ac4b894d7c94a
commit 9cbd357d5471636bdecaf1c2670ac4b894d7c94a Author: Andrii Kroitor <an.kroi...@samsung.com> Date: Thu Oct 29 15:23:10 2015 +0200 editor: add resetters for state int functions --- src/bin/editor/default.c | 36 ++++++++++++++++++++++++++++++ src/bin/editor/default.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/src/bin/editor/default.c b/src/bin/editor/default.c index 677bee8..e07c822 100644 --- a/src/bin/editor/default.c +++ b/src/bin/editor/default.c @@ -61,3 +61,39 @@ EDITOR_STATE_DOUBLE_RESET(container_align_y, 0.5, 0.5) EDITOR_STATE_DOUBLE_RESET(minmul_h, 0.0, 0.0) EDITOR_STATE_DOUBLE_RESET(minmul_w, 0.0, 0.0) +#define EDITOR_INT_DEFAULT_CHECK(FUNC, PROTO_ARGS, ARGS, DEF_VAL) \ +Eina_Bool \ +editor_##FUNC##_default_is(Evas_Object *edit_object, PROTO_ARGS) \ +{ \ + assert(edit_object != NULL); \ + int val = edje_edit_##FUNC##_get(edit_object, ARGS); \ + return val == DEF_VAL; \ +} + +#define EDITOR_INT_RESET(FUNC, PROTO_ARGS, ARGS, RESET_VAL) \ +Eina_Bool \ +editor_##FUNC##_reset(Evas_Object *edit_object, Change *change, PROTO_ARGS) \ +{ \ + assert(edit_object != NULL); \ + if (!editor_##FUNC##_default_is(edit_object, ARGS)) return true; \ + return editor_##FUNC##_set(edit_object, change, false, ARGS, RESET_VAL); \ +} + +#define EDITOR_STATE_INT_RESET(FUNC, DEF_VAL, RESET_VAL) \ +EDITOR_INT_DEFAULT_CHECK(state_##FUNC, EDITOR_STATE_ARGS_PROTO, EDITOR_STATE_ARGS, DEF_VAL) \ +EDITOR_INT_RESET(state_##FUNC, EDITOR_STATE_ARGS_PROTO, EDITOR_STATE_ARGS, RESET_VAL) + +EDITOR_STATE_INT_RESET(rel1_offset_x, 0, 0) +EDITOR_STATE_INT_RESET(rel1_offset_y, 0, 0) +EDITOR_STATE_INT_RESET(rel2_offset_x, -1, -1) +EDITOR_STATE_INT_RESET(rel2_offset_y, -1, -1) +EDITOR_STATE_INT_RESET(max_w, -1, -1) +EDITOR_STATE_INT_RESET(max_h, -1, -1) +EDITOR_STATE_INT_RESET(min_w, 0, 0) +EDITOR_STATE_INT_RESET(min_h, 0, 0) +EDITOR_STATE_INT_RESET(fill_origin_offset_x, 0, 0) +EDITOR_STATE_INT_RESET(fill_origin_offset_y, 0, 0) +EDITOR_STATE_INT_RESET(fill_size_offset_x, -1, -1) +EDITOR_STATE_INT_RESET(fill_size_offset_y, -1, -1) +EDITOR_STATE_INT_RESET(container_padding_x, 0, 0) +EDITOR_STATE_INT_RESET(container_padding_y, 0, 0) diff --git a/src/bin/editor/default.h b/src/bin/editor/default.h index 4acb55a..e99cc71 100644 --- a/src/bin/editor/default.h +++ b/src/bin/editor/default.h @@ -87,4 +87,62 @@ Eina_Bool editor_minmul_w_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); Eina_Bool editor_minmul_w_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); + + +Eina_Bool +editor_rel1_offset_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel1_offset_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel1_offset_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel1_offset_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel2_offset_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel2_offset_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel2_offset_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_rel2_offset_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_max_w_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_max_w_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_max_h_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_max_h_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_min_w_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_min_w_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_min_h_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_min_h_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_origin_offset_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_origin_offset_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_origin_offset_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_origin_offset_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_size_offset_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_size_offset_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_size_offset_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_fill_size_offset_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_container_padding_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_container_padding_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_container_padding_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val); +Eina_Bool +editor_container_padding_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val); #endif /* DEFAULT_H */ --