rimmed pushed a commit to branch master.

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

commit b6cd3137e5d7566eafc9b4d5d7aa7e0c288d2f46
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Wed Jan 6 12:11:35 2016 +0200

    editor: add EDITOR_PROGRAM_DOUBLE methods
---
 src/bin/editor/editor.h         | 46 ++++++++++++++++++++++++++++++++++++++++-
 src/bin/editor/editor_macro.h   | 33 +++++++++++++++++++++++++++++
 src/bin/editor/editor_program.c | 12 +++++++++++
 src/bin/ui/property_group.c     | 11 ++++++++++
 4 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index ecaefd9..60d1d87 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -148,7 +148,18 @@ typedef enum {
    ATTRIBUTE_PROGRAM_TRANSITION_TYPE,
    ATTRIBUTE_PROGRAM_TRANSITION_FROM_CURRENT,
    ATTRIBUTE_PROGRAM_ACTION,
-   ATTRIBUTE_PROGRAM_CHANNEL
+   ATTRIBUTE_PROGRAM_CHANNEL,
+   ATTRIBUTE_PROGRAM_TONE_DURATION,
+   ATTRIBUTE_PROGRAM_IN_FROM,
+   ATTRIBUTE_PROGRAM_IN_RANGE,
+   ATTRIBUTE_PROGRAM_TRANSITION_TIME,
+   ATTRIBUTE_PROGRAM_SAMPLE_SPEED,
+   ATTRIBUTE_PROGRAM_VALUE2,
+   ATTRIBUTE_PROGRAM_VALUE,
+   ATTRIBUTE_PROGRAM_TRANSITION_VALUE1,
+   ATTRIBUTE_PROGRAM_TRANSITION_VALUE2,
+   ATTRIBUTE_PROGRAM_TRANSITION_VALUE3,
+   ATTRIBUTE_PROGRAM_TRANSITION_VALUE4,
 } Attribute;
 
 void
@@ -616,5 +627,38 @@ editor_program_action_set(Evas_Object *edit_object, Change 
*change, Eina_Bool me
 Eina_Bool
 editor_program_channel_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
                            const char *program, Edje_Channel new_val);
+Eina_Bool
+editor_program_tone_duration_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                 const char *program, double new_val);
+Eina_Bool
+editor_program_in_from_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                           const char *program, double new_val);
+Eina_Bool
+editor_program_in_range_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                            const char *program, double new_val);
+Eina_Bool
+editor_program_transition_time_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                   const char *program, double new_val);
+Eina_Bool
+editor_program_sample_speed_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                const char *program, double new_val);
+Eina_Bool
+editor_program_value2_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                          const char *program, double new_val);
+Eina_Bool
+editor_program_value_set(Evas_Object *edit_object, Change *change, Eina_Bool 
merge,
+                         const char *program, double new_val);
+Eina_Bool
+editor_program_transition_value1_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                     const char *program, double new_val);
+Eina_Bool
+editor_program_transition_value2_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                     const char *program, double new_val);
+Eina_Bool
+editor_program_transition_value3_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                     const char *program, double new_val);
+Eina_Bool
+editor_program_transition_value4_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge,
+                                     const char *program, double new_val);
 
 #endif /* EDITOR_H */
diff --git a/src/bin/editor/editor_macro.h b/src/bin/editor/editor_macro.h
index 2b38839..aa6f2fc 100644
--- a/src/bin/editor/editor_macro.h
+++ b/src/bin/editor/editor_macro.h
@@ -591,3 +591,36 @@ editor_state_## FUNC ##_set(Evas_Object *edit_object, 
Change *change, Eina_Bool
    if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_ATTRIBUTE_CHANGED, &attribute); \
    return true; \
 }
+
+#define EDITOR_PROGRAM_DOUBLE(FUNC, ATTRIBUTE) \
+Eina_Bool \
+editor_program_## FUNC ##_set(Evas_Object *edit_object, Change *change, 
Eina_Bool merge, \
+                           const char *program, double new_val) \
+{ \
+   Diff *diff; \
+   Attribute attribute = ATTRIBUTE; \
+   assert(edit_object != NULL); \
+   assert(program != NULL); \
+   if (change) \
+     { \
+        double old_value = edje_edit_program_## FUNC ##_get(edit_object, 
program); \
+        diff = mem_calloc(1, sizeof(Diff)); \
+        diff->redo.type = FUNCTION_TYPE_STRING_DOUBLE; \
+        diff->redo.function = editor_program_## FUNC ##_set; \
+        diff->redo.args.type_sd.s1 = eina_stringshare_add(program); \
+        diff->redo.args.type_sd.d2 = new_val; \
+        diff->undo.type = FUNCTION_TYPE_STRING_DOUBLE; \
+        diff->undo.function = editor_program_## FUNC ##_set; \
+        diff->undo.args.type_sd.s1 = eina_stringshare_add(program); \
+        diff->undo.args.type_sd.d2 = 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 24172c6..4f117c5 100644
--- a/src/bin/editor/editor_program.c
+++ b/src/bin/editor/editor_program.c
@@ -181,3 +181,15 @@ editor_program_channel_set(Evas_Object *edit_object, 
Change *change, Eina_Bool m
    if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_ATTRIBUTE_CHANGED, &attribute);
    return true;
 }
+
+EDITOR_PROGRAM_DOUBLE(tone_duration, ATTRIBUTE_PROGRAM_TONE_DURATION);
+EDITOR_PROGRAM_DOUBLE(in_from, ATTRIBUTE_PROGRAM_IN_FROM);
+EDITOR_PROGRAM_DOUBLE(in_range, ATTRIBUTE_PROGRAM_IN_RANGE);
+EDITOR_PROGRAM_DOUBLE(transition_time, ATTRIBUTE_PROGRAM_TRANSITION_TIME);
+EDITOR_PROGRAM_DOUBLE(sample_speed, ATTRIBUTE_PROGRAM_SAMPLE_SPEED);
+EDITOR_PROGRAM_DOUBLE(value2, ATTRIBUTE_PROGRAM_VALUE2);
+EDITOR_PROGRAM_DOUBLE(value, ATTRIBUTE_PROGRAM_VALUE);
+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);
diff --git a/src/bin/ui/property_group.c b/src/bin/ui/property_group.c
index b571f7f..48af3cb 100644
--- a/src/bin/ui/property_group.c
+++ b/src/bin/ui/property_group.c
@@ -887,6 +887,17 @@ _on_editor_attribute_changed(void *data,
       case ATTRIBUTE_PROGRAM_TRANSITION_FROM_CURRENT:
       case ATTRIBUTE_PROGRAM_ACTION:
       case ATTRIBUTE_PROGRAM_CHANNEL:
+      case ATTRIBUTE_PROGRAM_TONE_DURATION:
+      case ATTRIBUTE_PROGRAM_IN_FROM:
+      case ATTRIBUTE_PROGRAM_IN_RANGE:
+      case ATTRIBUTE_PROGRAM_TRANSITION_TIME:
+      case ATTRIBUTE_PROGRAM_SAMPLE_SPEED:
+      case ATTRIBUTE_PROGRAM_VALUE2:
+      case ATTRIBUTE_PROGRAM_VALUE:
+      case ATTRIBUTE_PROGRAM_TRANSITION_VALUE1:
+      case ATTRIBUTE_PROGRAM_TRANSITION_VALUE2:
+      case ATTRIBUTE_PROGRAM_TRANSITION_VALUE3:
+      case ATTRIBUTE_PROGRAM_TRANSITION_VALUE4:
          TODO("implement");
          break;
          /* Don't add 'default:'. Compiler must warn about missing cases */

-- 


Reply via email to