rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=8b06c9b43a45e9b0438463a9572380e90fc6e796

commit 8b06c9b43a45e9b0438463a9572380e90fc6e796
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Oct 30 16:28:01 2015 +0200

    editor: add resetters for state uchar functions
---
 src/bin/editor/default.c | 28 ++++++++++++++++++++++++++++
 src/bin/editor/default.h | 18 ++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/src/bin/editor/default.c b/src/bin/editor/default.c
index 9a3913a..8cad99f 100644
--- a/src/bin/editor/default.c
+++ b/src/bin/editor/default.c
@@ -192,3 +192,31 @@ EDITOR_STATE_INT_INT_INT_INT_RESET(color, 255, 255, 255, 
255)
 EDITOR_STATE_INT_INT_INT_INT_RESET(color2, 0, 0, 0, 255)
 EDITOR_STATE_INT_INT_INT_INT_RESET(color3, 0, 0, 0, 128)
 EDITOR_STATE_INT_INT_INT_INT_RESET(image_border, 0, 0, 0, 0)
+
+
+#define EDITOR_UCHAR_DEFAULT_CHECK(FUNC, PROTO_ARGS, ARGS, DEF_VAL) \
+Eina_Bool \
+editor_##FUNC##_default_is(Evas_Object *edit_object, PROTO_ARGS) \
+{ \
+   assert(edit_object != NULL); \
+   unsigned char val = edje_edit_##FUNC##_get(edit_object, ARGS); \
+   return val == DEF_VAL; \
+}
+
+#define EDITOR_UCHAR_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_UCHAR_RESET(FUNC, DEF_VAL, RESET_VAL) \
+EDITOR_UCHAR_DEFAULT_CHECK(state_##FUNC, EDITOR_STATE_ARGS_PROTO, 
EDITOR_STATE_ARGS, DEF_VAL) \
+EDITOR_UCHAR_RESET(state_##FUNC, EDITOR_STATE_ARGS_PROTO, EDITOR_STATE_ARGS, 
RESET_VAL)
+
+EDITOR_STATE_UCHAR_RESET(image_border_fill, 0, 0)
+EDITOR_STATE_UCHAR_RESET(fill_type, 0, 0)
+EDITOR_STATE_UCHAR_RESET(aspect_pref, 0, 0)
+EDITOR_STATE_UCHAR_RESET(table_homogeneous, 0, 0)
diff --git a/src/bin/editor/default.h b/src/bin/editor/default.h
index c3d1fef..5d59b95 100644
--- a/src/bin/editor/default.h
+++ b/src/bin/editor/default.h
@@ -219,4 +219,22 @@ Eina_Bool
 editor_state_image_border_default_is(Evas_Object *edit_object, const char 
*part_name, const char *state_name, double state_val);
 Eina_Bool
 editor_state_image_border_reset(Evas_Object *edit_object, Change *change, 
const char *part_name, const char *state_name, double state_val);
+
+
+Eina_Bool
+editor_state_image_border_fill_default_is(Evas_Object *edit_object, const char 
*part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_image_border_fill_reset(Evas_Object *edit_object, Change *change, 
const char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_fill_type_default_is(Evas_Object *edit_object, const char 
*part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_fill_type_reset(Evas_Object *edit_object, Change *change, const 
char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_aspect_pref_default_is(Evas_Object *edit_object, const char 
*part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_aspect_pref_reset(Evas_Object *edit_object, Change *change, const 
char *part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_table_homogeneous_default_is(Evas_Object *edit_object, const char 
*part_name, const char *state_name, double state_val);
+Eina_Bool
+editor_state_table_homogeneous_reset(Evas_Object *edit_object, Change *change, 
const char *part_name, const char *state_name, double state_val);
 #endif /* DEFAULT_H */

-- 


Reply via email to