rimmed pushed a commit to branch master.

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

commit c7210d2830fa6ea7cf79693cc8f171b2227ed253
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Fri Oct 16 11:36:59 2015 +0300

    editor: add SIGNAL_PART_RENAMED
---
 src/bin/common/signals.h     | 12 ++++++++++++
 src/bin/editor/editor.h      |  3 +++
 src/bin/editor/editor_part.c | 12 ++++++++----
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/src/bin/common/signals.h b/src/bin/common/signals.h
index d04b395..043c0e4 100644
--- a/src/bin/common/signals.h
+++ b/src/bin/common/signals.h
@@ -84,6 +84,18 @@
  */
 #define SIGNAL_PART_DELETED "SIGNAL_PART_DELETED"
 
+typedef struct {
+   const char *old_name;
+   const char *new_name;
+} Rename;
+/**
+ * emited when part is renamed.
+ * eventinfo - pointer to Rename structure
+ *
+ * @ingroup Window
+ */
+#define SIGNAL_PART_RENAMED "SIGNAL_PART_RENAMED"
+
 /**
  * emited when new state is added.
  * eventinfo - pointer to State structure
diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index e336496..df7b593 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -506,6 +506,9 @@ editor_part_drag_y_set(Evas_Object *obj, Change *change, 
Eina_Bool merge, const
 Eina_Bool
 editor_part_drag_step_y_set(Evas_Object *obj, Change *change, Eina_Bool merge, 
const char *part_name,
       int new_val);
+Eina_Bool
+editor_part_name_set(Evas_Object *obj, Change *change, Eina_Bool merge, const 
char *part_name,
+      const char *new_val);
 
 
 Eina_Bool
diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c
index fc1b18f..0ac0c7a 100644
--- a/src/bin/editor/editor_part.c
+++ b/src/bin/editor/editor_part.c
@@ -112,6 +112,7 @@ editor_part_name_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge,
                      const char *name, const char *new_val)
 {
    Diff *diff;
+   Rename ren;
    Attribute attribute = ATTRIBUTE_PART_NAME;
    assert(edit_object != NULL);
    assert(name != NULL);
@@ -121,12 +122,12 @@ editor_part_name_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge,
         diff = mem_calloc(1, sizeof(Diff));
         diff->redo.type = FUNCTION_TYPE_STRING_STRING;
         diff->redo.function = editor_part_name_set;
-        diff->redo.args.type_ssds.s1 = eina_stringshare_add(name);
-        diff->redo.args.type_ssds.s2 = eina_stringshare_add(new_val);
+        diff->redo.args.type_ss.s1 = eina_stringshare_add(name);
+        diff->redo.args.type_ss.s2 = eina_stringshare_add(new_val);
         diff->undo.type = FUNCTION_TYPE_STRING_STRING;
         diff->undo.function = editor_part_name_set;
-        diff->undo.args.type_ssds.s1 = eina_stringshare_add(new_val);
-        diff->undo.args.type_ssds.s2 = eina_stringshare_add(name);
+        diff->undo.args.type_ss.s1 = eina_stringshare_add(new_val);
+        diff->undo.args.type_ss.s2 = eina_stringshare_add(name);
         if (merge)
           change_diff_merge_add(change, diff);
         else
@@ -135,6 +136,9 @@ editor_part_name_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge,
    if (!edje_edit_part_name_set(edit_object, name, new_val))
      return false;
    _editor_project_changed();
+   ren.old_name = name;
+   ren.new_name = new_val;
+   evas_object_smart_callback_call(ap.win, SIGNAL_PART_RENAMED, &ren);
    evas_object_smart_callback_call(ap.win, SIGNAL_EDITOR_ATTRIBUTE_CHANGED, 
&attribute);
    return true;
 }

-- 


Reply via email to