rimmed pushed a commit to branch master.

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

commit 004d9f3549913a6953e00da0444c7873c85f1e1f
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Fri Sep 30 14:04:11 2016 +0300

    editor: add part_item_index_padding function
---
 src/bin/editor/editor.h      |  12 ++++
 src/bin/editor/editor_part.c | 166 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 178 insertions(+)

diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h
index 457b63a..6ea39a0 100644
--- a/src/bin/editor/editor.h
+++ b/src/bin/editor/editor.h
@@ -758,6 +758,18 @@ Eina_Bool
 editor_part_item_padding_right_set(Evas_Object *obj, Change *change, Eina_Bool 
merge, Eina_Bool apply, const char *part_name, const char *item_name,
       int new_val1) EINA_WARN_UNUSED_RESULT;
 Eina_Bool
+editor_part_item_index_padding_bottom_set(Evas_Object *obj, Change *change, 
Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index,
+      int new_val1) EINA_WARN_UNUSED_RESULT;
+Eina_Bool
+editor_part_item_index_padding_top_set(Evas_Object *obj, Change *change, 
Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index,
+      int new_val1) EINA_WARN_UNUSED_RESULT;
+Eina_Bool
+editor_part_item_index_padding_left_set(Evas_Object *obj, Change *change, 
Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index,
+      int new_val1) EINA_WARN_UNUSED_RESULT;
+Eina_Bool
+editor_part_item_index_padding_right_set(Evas_Object *obj, Change *change, 
Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index,
+      int new_val1) EINA_WARN_UNUSED_RESULT;
+Eina_Bool
 editor_part_scale_set(Evas_Object *obj, Change *change, Eina_Bool merge, 
Eina_Bool apply, const char *part_name,
       Eina_Bool new_val) EINA_WARN_UNUSED_RESULT;
 Eina_Bool
diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c
index 1915184..1d600b6 100644
--- a/src/bin/editor/editor_part.c
+++ b/src/bin/editor/editor_part.c
@@ -433,6 +433,172 @@ editor_part_item_index_source_set(Evas_Object 
*edit_object, Change *change, Eina
    return true;
 }
 
+/* INDEX PADDINGS */
+
+Eina_Bool
+editor_part_item_index_padding_left_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge, Eina_Bool apply,
+                                  const char *part_name, unsigned int index, 
int n3)
+{
+   Diff *diff;
+   int o3, o4, o5, o6;
+   Editor_Attribute_Change send;
+   send.edit_object = edit_object;
+
+   send.attribute = RM_ATTRIBUTE_PART_ITEM_PADDING_LEFT;
+   assert(edit_object != NULL);
+   assert(part_name != NULL);
+   edje_edit_part_item_index_padding_get(edit_object, part_name, index, &o3, 
&o4, &o5, &o6);
+   if (change)
+     {
+        diff = mem_calloc(1, sizeof(Diff));
+        diff->redo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->redo.function = editor_part_item_index_padding_left_set;
+        diff->redo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->redo.args.type_suii.ui2 = index;
+        diff->redo.args.type_suii.i3 = n3;
+        diff->undo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->undo.function = editor_part_item_index_padding_left_set;
+        diff->undo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->undo.args.type_suii.ui2 = index;
+        diff->undo.args.type_suii.i3 = o3;
+        if (merge)
+          change_diff_merge_add(change, diff);
+        else
+          change_diff_add(change, diff);
+     }
+   if (apply)
+     {
+        CRIT_ON_FAIL(edje_edit_part_item_index_padding_set(edit_object, 
part_name, index, n3, o4, o5, o6));
+        CRIT_ON_FAIL(editor_save(edit_object));
+        _editor_project_changed();
+        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send);
+     }
+   return true;
+}
+
+Eina_Bool
+editor_part_item_index_padding_right_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge, Eina_Bool apply,
+                                   const char *part_name, unsigned int index, 
int n4)
+{
+   Diff *diff;
+   int o3, o4, o5, o6;
+   Editor_Attribute_Change send;
+   send.edit_object = edit_object;
+
+   send.attribute = RM_ATTRIBUTE_PART_ITEM_PADDING_RIGHT;
+   assert(edit_object != NULL);
+   assert(part_name != NULL);
+   edje_edit_part_item_index_padding_get(edit_object, part_name, index, &o3, 
&o4, &o5, &o6);
+   if (change)
+     {
+        diff = mem_calloc(1, sizeof(Diff));
+        diff->redo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->redo.function = editor_part_item_index_padding_right_set;
+        diff->redo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->redo.args.type_suii.ui2 = index;
+        diff->redo.args.type_suii.i3 = n4;
+        diff->undo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->undo.function = editor_part_item_index_padding_right_set;
+        diff->undo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->undo.args.type_suii.ui2 = index;
+        diff->undo.args.type_suii.i3 = o4;
+        if (merge)
+          change_diff_merge_add(change, diff);
+        else
+          change_diff_add(change, diff);
+     }
+   if (apply)
+     {
+        CRIT_ON_FAIL(edje_edit_part_item_index_padding_set(edit_object, 
part_name, index, o3, n4, o5, o6));
+        CRIT_ON_FAIL(editor_save(edit_object));
+        _editor_project_changed();
+        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send);
+     }
+   return true;
+}
+
+Eina_Bool
+editor_part_item_index_padding_top_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge, Eina_Bool apply,
+                                 const char *part_name, unsigned int index, 
int n5)
+{
+   Diff *diff;
+   int o3, o4, o5, o6;
+   Editor_Attribute_Change send;
+   send.edit_object = edit_object;
+
+   send.attribute = RM_ATTRIBUTE_PART_ITEM_PADDING_TOP;
+   assert(edit_object != NULL);
+   assert(part_name != NULL);
+   edje_edit_part_item_index_padding_get(edit_object, part_name, index, &o3, 
&o4, &o5, &o6);
+   if (change)
+     {
+        diff = mem_calloc(1, sizeof(Diff));
+        diff->redo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->redo.function = editor_part_item_index_padding_top_set;
+        diff->redo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->redo.args.type_suii.ui2 = index;
+        diff->redo.args.type_suii.i3 = n5;
+        diff->undo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->undo.function = editor_part_item_index_padding_top_set;
+        diff->undo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->undo.args.type_suii.ui2 = index;
+        diff->undo.args.type_suii.i3 = o5;
+        if (merge)
+          change_diff_merge_add(change, diff);
+        else
+          change_diff_add(change, diff);
+     }
+   if (apply)
+     {
+        CRIT_ON_FAIL(edje_edit_part_item_index_padding_set(edit_object, 
part_name, index, o3, o4, n5, o6));
+        CRIT_ON_FAIL(editor_save(edit_object));
+        _editor_project_changed();
+        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send);
+     }
+   return true;
+}
+
+Eina_Bool
+editor_part_item_index_padding_bottom_set(Evas_Object *edit_object, Change 
*change, Eina_Bool merge, Eina_Bool apply,
+                                    const char *part_name, unsigned int index, 
int n6)
+{
+   Diff *diff;
+   int o3, o4, o5, o6;
+   Editor_Attribute_Change send;
+   send.edit_object = edit_object;
+
+   send.attribute = RM_ATTRIBUTE_PART_ITEM_PADDING_BOTTOM;
+   assert(edit_object != NULL);
+   assert(part_name != NULL);
+   edje_edit_part_item_index_padding_get(edit_object, part_name, index, &o3, 
&o4, &o5, &o6);
+   if (change)
+     {
+        diff = mem_calloc(1, sizeof(Diff));
+        diff->redo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->redo.function = editor_part_item_index_padding_bottom_set;
+        diff->redo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->redo.args.type_suii.ui2 = index;
+        diff->redo.args.type_suii.i3 = n6;
+        diff->undo.type = FUNCTION_TYPE_STRING_UINT_INT;
+        diff->undo.function = editor_part_item_index_padding_bottom_set;
+        diff->undo.args.type_suii.s1 = eina_stringshare_add(part_name);
+        diff->undo.args.type_suii.ui2 = index;
+        diff->undo.args.type_suii.i3 = o6;
+        if (merge)
+          change_diff_merge_add(change, diff);
+        else
+          change_diff_add(change, diff);
+     }
+   if (apply)
+     {
+        CRIT_ON_FAIL(edje_edit_part_item_index_padding_set(edit_object, 
part_name, index, o3, o4, o5, n6));
+        CRIT_ON_FAIL(editor_save(edit_object));
+        _editor_project_changed();
+        if (!_editor_signals_blocked) evas_object_smart_callback_call(ap.win, 
SIGNAL_EDITOR_RM_ATTRIBUTE_CHANGED, &send);
+     }
+   return true;
+}
+
 /* PADDINGS */
 
 Eina_Bool

-- 


Reply via email to