rimmed pushed a commit to branch master.

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

commit c71a9291fe6117dd9d57d06c2fdc47ee546a9a41
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Wed Jan 6 13:37:18 2016 +0200

    editor: add EDITOR_PROGRAM_STRING methods
---
 src/bin/editor/editor.h         | 40 ++++++++++++++++++++++++++++++++++++++++
 src/bin/editor/editor_macro.h   | 33 +++++++++++++++++++++++++++++++++
 src/bin/editor/editor_program.c | 11 +++++++++++
 src/bin/ui/property_group.c     | 10 ++++++++++
 4 files changed, 94 insertions(+)

diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index 60d1d87..b120b34 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -160,6 +160,16 @@ typedef enum {
    ATTRIBUTE_PROGRAM_TRANSITION_VALUE2,
    ATTRIBUTE_PROGRAM_TRANSITION_VALUE3,
    ATTRIBUTE_PROGRAM_TRANSITION_VALUE4,
+   ATTRIBUTE_PROGRAM_FILTER_PART,
+   ATTRIBUTE_PROGRAM_FILTER_STATE,
+   ATTRIBUTE_PROGRAM_API_NAME,
+   ATTRIBUTE_PROGRAM_API_DESCRIPTION,
+   ATTRIBUTE_PROGRAM_SAMPLE_NAME,
+   ATTRIBUTE_PROGRAM_TONE_NAME,
+   ATTRIBUTE_PROGRAM_SIGNAL,
+   ATTRIBUTE_PROGRAM_SOURCE,
+   ATTRIBUTE_PROGRAM_STATE,
+   ATTRIBUTE_PROGRAM_STATE2,
 } Attribute;
 
 void
@@ -660,5 +670,35 @@ editor_program_transition_value3_set(Evas_Object 
*edit_object, Change *change, E
 Eina_Bool
 editor_program_transition_value4_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
                                      const char *program, double new_val);
+Eina_Bool
+editor_program_filter_part_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                               const char *program, const char *new_val);
+Eina_Bool
+editor_program_filter_state_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                const char *program, const char *new_val);
+Eina_Bool
+editor_program_api_name_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                            const char *program, const char *new_val);
+Eina_Bool
+editor_program_api_description_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                   const char *program, const char *new_val);
+Eina_Bool
+editor_program_sample_name_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                               const char *program, const char *new_val);
+Eina_Bool
+editor_program_tone_name_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                             const char *program, const char *new_val);
+Eina_Bool
+editor_program_signal_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                          const char *program, const char *new_val);
+Eina_Bool
+editor_program_source_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                          const char *program, const char *new_val);
+Eina_Bool
+editor_program_state_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                         const char *program, const char *new_val);
+Eina_Bool
+editor_program_state2_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                          const char *program, const char *new_val);
 
 #endif /* EDITOR_H */
diff --git a/src/bin/editor/editor_macro.h b/src/bin/editor/editor_macro.h
index aa6f2fc..3bec3ab 100644
--- a/src/bin/editor/editor_macro.h
+++ b/src/bin/editor/editor_macro.h
@@ -624,3 +624,36 @@ editor_program_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Boo
    if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_ATTRIBUTE_CHANGED, &attribute); \
    return true; \
 }
+
+#define EDITOR_PROGRAM_STRING(FUNC, ATTRIBUTE) \
+Eina_Bool \
+editor_program_## FUNC ##_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge, \
+                           const char *program, const char *new_val) \
+{ \
+   Diff *diff; \
+   Attribute attribute = ATTRIBUTE; \
+   assert(edit_object != NULL); \
+   assert(program != NULL); \
+   if (change) \
+     { \
+        Eina_Stringshare *old_value = edje_edit_program_## FUNC 
##_get(edit_object, program); \
+        diff = mem_calloc(1, sizeof(Diff)); \
+        diff->redo.type = FUNCTION_TYPE_STRING_STRING; \
+        diff->redo.function = editor_program_## FUNC ##_set; \
+        diff->redo.args.type_ss.s1 = eina_stringshare_add(program); \
+        diff->redo.args.type_ss.s2 = eina_stringshare_add(new_val); \
+        diff->undo.type = FUNCTION_TYPE_STRING_STRING; \
+        diff->undo.function = editor_program_## FUNC ##_set; \
+        diff->undo.args.type_sd.s1 = eina_stringshare_add(program); \
+        diff->undo.args.type_ss.s2 = old_value; \
+        if (merge) \
+          change_diff_merge_add(change, diff); \
+        else \
+          change_diff_add(change, diff); \
+     } \
+   if (!edje_edit_program_## FUNC ##_set(edit_object, program, new_val)) \
+     return false; \
+   _editor_project_changed(); \
+   if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_ATTRIBUTE_CHANGED, &attribute); \
+   return true; \
+}
diff --git a/src/bin/editor/editor_program.c b/src/bin/editor/editor_program.c
index 4f117c5..dd54a06 100644
--- a/src/bin/editor/editor_program.c
+++ b/src/bin/editor/editor_program.c
@@ -193,3 +193,14 @@ EDITOR_PROGRAM_DOUBLE(transition_value1, 
ATTRIBUTE_PROGRAM_TRANSITION_VALUE1);
 EDITOR_PROGRAM_DOUBLE(transition_value2, ATTRIBUTE_PROGRAM_TRANSITION_VALUE2);
 EDITOR_PROGRAM_DOUBLE(transition_value3, ATTRIBUTE_PROGRAM_TRANSITION_VALUE3);
 EDITOR_PROGRAM_DOUBLE(transition_value4, ATTRIBUTE_PROGRAM_TRANSITION_VALUE4);
+
+EDITOR_PROGRAM_STRING(filter_part, ATTRIBUTE_PROGRAM_FILTER_PART);
+EDITOR_PROGRAM_STRING(filter_state, ATTRIBUTE_PROGRAM_FILTER_STATE);
+EDITOR_PROGRAM_STRING(api_name, ATTRIBUTE_PROGRAM_API_NAME);
+EDITOR_PROGRAM_STRING(api_description, ATTRIBUTE_PROGRAM_API_DESCRIPTION);
+EDITOR_PROGRAM_STRING(sample_name, ATTRIBUTE_PROGRAM_SAMPLE_NAME);
+EDITOR_PROGRAM_STRING(tone_name, ATTRIBUTE_PROGRAM_TONE_NAME);
+EDITOR_PROGRAM_STRING(signal, ATTRIBUTE_PROGRAM_SIGNAL);
+EDITOR_PROGRAM_STRING(source, ATTRIBUTE_PROGRAM_SOURCE);
+EDITOR_PROGRAM_STRING(state, ATTRIBUTE_PROGRAM_STATE);
+EDITOR_PROGRAM_STRING(state2, ATTRIBUTE_PROGRAM_STATE2);
diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c
index 48af3cb..74d544a 100644
--- a/src/bin/ui/property_group.c
+++ b/src/bin/ui/property_group.c
@@ -898,6 +898,16 @@ _on_editor_attribute_changed(void *data,
       case ATTRIBUTE_PROGRAM_TRANSITION_VALUE2:
       case ATTRIBUTE_PROGRAM_TRANSITION_VALUE3:
       case ATTRIBUTE_PROGRAM_TRANSITION_VALUE4:
+      case ATTRIBUTE_PROGRAM_FILTER_PART:
+      case ATTRIBUTE_PROGRAM_FILTER_STATE:
+      case ATTRIBUTE_PROGRAM_API_NAME:
+      case ATTRIBUTE_PROGRAM_API_DESCRIPTION:
+      case ATTRIBUTE_PROGRAM_SAMPLE_NAME:
+      case ATTRIBUTE_PROGRAM_TONE_NAME:
+      case ATTRIBUTE_PROGRAM_SIGNAL:
+      case ATTRIBUTE_PROGRAM_SOURCE:
+      case ATTRIBUTE_PROGRAM_STATE:
+      case ATTRIBUTE_PROGRAM_STATE2:
          TODO("implement");
          break;
          /* Don't add 'default:'. Compiler must warn about missing cases */

-- 


Reply via email to