aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/bin/editor/default.c38
-rw-r--r--src/bin/editor/default.h30
2 files changed, 68 insertions, 0 deletions
diff --git a/src/bin/editor/default.c b/src/bin/editor/default.c
index 097ab5447..d714753c8 100644
--- a/src/bin/editor/default.c
+++ b/src/bin/editor/default.c
@@ -126,3 +126,41 @@ EDITOR_STATE_BOOL_RESET(fill_smooth, true, true)
EDITOR_STATE_BOOL_RESET(visible, true, true)
EDITOR_STATE_BOOL_RESET(container_min_h, false, false)
EDITOR_STATE_BOOL_RESET(container_min_v, false, false)
+
+#define EDITOR_NULL_STRING_DEFAULT_CHECK(FUNC, PROTO_ARGS, ARGS) \
+Eina_Bool \
+editor_##FUNC##_default_is(Evas_Object *edit_object, PROTO_ARGS) \
+{ \
+ Eina_Bool res; \
+ assert(edit_object != NULL); \
+ Eina_Stringshare *val = edje_edit_##FUNC##_get(edit_object, ARGS); \
+ if (val != NULL) \
+ { \
+ res = val == NULL; \
+ eina_stringshare_del(val); \
+ } \
+ else \
+ res = true; \
+ return res; \
+}
+
+#define EDITOR_NULL_STRING_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_NULL_STRING_RESET(FUNC, RESET_VAL) \
+EDITOR_NULL_STRING_DEFAULT_CHECK(state_##FUNC, EDITOR_STATE_ARGS_PROTO, EDITOR_STATE_ARGS) \
+EDITOR_NULL_STRING_RESET(state_##FUNC, EDITOR_STATE_ARGS_PROTO, EDITOR_STATE_ARGS, RESET_VAL)
+
+EDITOR_STATE_NULL_STRING_RESET(rel1_to_x, NULL)
+EDITOR_STATE_NULL_STRING_RESET(rel1_to_y, NULL)
+EDITOR_STATE_NULL_STRING_RESET(rel2_to_x, NULL)
+EDITOR_STATE_NULL_STRING_RESET(rel2_to_y, NULL)
+EDITOR_STATE_NULL_STRING_RESET(proxy_source, NULL)
+EDITOR_STATE_NULL_STRING_RESET(color_class, NULL)
+EDITOR_STATE_NULL_STRING_RESET(image, "")
diff --git a/src/bin/editor/default.h b/src/bin/editor/default.h
index 3067c5fcd..73959cb3f 100644
--- a/src/bin/editor/default.h
+++ b/src/bin/editor/default.h
@@ -171,4 +171,34 @@ Eina_Bool
editor_state_container_min_v_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
Eina_Bool
editor_state_container_min_v_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+
+
+Eina_Bool
+editor_state_rel1_to_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel1_to_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel1_to_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel1_to_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel2_to_x_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel2_to_x_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel2_to_y_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_rel2_to_y_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_proxy_source_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_proxy_source_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_color_class_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_color_class_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_image_default_is(Evas_Object *edit_object, const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_image_reset(Evas_Object *edit_object, Change *change, const char *part_name, const char *state_name, double state_val);
#endif /* DEFAULT_H */