rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=89adcde11660c2aeb02a5a9ed2b6bc2e901218c0
commit 89adcde11660c2aeb02a5a9ed2b6bc2e901218c0 Author: Vitalii Vorobiov <[email protected]> Date: Thu Sep 29 18:28:19 2016 +0300 editor: add EDITOR_PART_ITEM_INDEX_USHORT for edje_edit_part_item_index_ --- src/bin/editor/diff.c | 12 ++++++++++++ src/bin/editor/diff.h | 6 ++++++ src/bin/editor/editor.h | 12 ++++++++++++ src/bin/editor/editor_macro.h | 41 +++++++++++++++++++++++++++++++++++++++++ src/bin/editor/editor_part.c | 5 +++++ 5 files changed, 76 insertions(+) diff --git a/src/bin/editor/diff.c b/src/bin/editor/diff.c index 82e1697..4f85a34 100644 --- a/src/bin/editor/diff.c +++ b/src/bin/editor/diff.c @@ -68,6 +68,8 @@ typedef Eina_Bool (* function_type_string_uint_int) (Evas_Object *, Change*, Ein const char *, unsigned int, int); typedef Eina_Bool (* function_type_string_string_ushort) (Evas_Object *, Change*, Eina_Bool, Eina_Bool, const char *, const char *, unsigned short); +typedef Eina_Bool (* function_type_string_uint_ushort) (Evas_Object *, Change*, Eina_Bool, Eina_Bool, + const char *, unsigned int, unsigned short); typedef Eina_Bool (* function_type_string_string_string) (Evas_Object *, Change*, Eina_Bool, Eina_Bool, const char *, const char *, const char *); typedef Eina_Bool (* function_type_string_string_int_int_int_int) (Evas_Object *, Change*, Eina_Bool, Eina_Bool, @@ -167,6 +169,9 @@ _apply(Evas_Object *obj, Function_Info *fi) case FUNCTION_TYPE_STRING_STRING_USHORT: return ((function_type_string_string_ushort)fi->function)(obj, NULL, false, true, fi->args.type_ssus.s1, fi->args.type_ssus.s2, fi->args.type_ssus.us3); + case FUNCTION_TYPE_STRING_UINT_USHORT: + return ((function_type_string_uint_ushort)fi->function)(obj, NULL, false, true, + fi->args.type_suius.s1, fi->args.type_suius.ui2, fi->args.type_suius.us3); case FUNCTION_TYPE_STRING_STRING_STRING: return ((function_type_string_string_string)fi->function)(obj, NULL, false, true, fi->args.type_sss.s1, fi->args.type_sss.s2, fi->args.type_sss.s3); @@ -368,6 +373,10 @@ diff_update(Diff *diff, Diff *new_diff) eina_stringshare_ref(new_diff->redo.args.type_ssus.s1); eina_stringshare_ref(new_diff->redo.args.type_ssus.s2); break; + case FUNCTION_TYPE_STRING_UINT_USHORT: + eina_stringshare_del(diff->redo.args.type_suius.s1); + eina_stringshare_ref(new_diff->redo.args.type_suius.s1); + break; case FUNCTION_TYPE_STRING_STRING_STRING: eina_stringshare_del(diff->redo.args.type_sss.s1); eina_stringshare_del(diff->redo.args.type_sss.s2); @@ -516,6 +525,9 @@ diff_free(Diff *diff) eina_stringshare_del(diff->redo.args.type_ssus.s1); eina_stringshare_del(diff->redo.args.type_ssus.s2); break; + case FUNCTION_TYPE_STRING_UINT_USHORT: + eina_stringshare_del(diff->redo.args.type_suius.s1); + break; case FUNCTION_TYPE_STRING_STRING_STRING: eina_stringshare_del(diff->redo.args.type_sss.s1); eina_stringshare_del(diff->redo.args.type_sss.s2); diff --git a/src/bin/editor/diff.h b/src/bin/editor/diff.h index 293acbc..45e844d 100644 --- a/src/bin/editor/diff.h +++ b/src/bin/editor/diff.h @@ -48,6 +48,7 @@ typedef enum { FUNCTION_TYPE_STRING_STRING_INT, FUNCTION_TYPE_STRING_UINT_INT, FUNCTION_TYPE_STRING_STRING_USHORT, + FUNCTION_TYPE_STRING_UINT_USHORT, FUNCTION_TYPE_STRING_STRING_STRING, FUNCTION_TYPE_STRING_STRING_INT_INT_INT_INT, FUNCTION_TYPE_STRING_EDJEEDITSELECTMODE, @@ -182,6 +183,11 @@ struct _Function_Info { } type_ssus; struct { Eina_Stringshare *s1; + unsigned int ui2; + unsigned short us3; + } type_suius; + struct { + Eina_Stringshare *s1; Eina_Stringshare *s2; Eina_Stringshare *s3; } type_sss; diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h index 79541cc..61ad0e3 100644 --- a/src/bin/editor/editor.h +++ b/src/bin/editor/editor.h @@ -721,6 +721,18 @@ Eina_Bool editor_part_item_position_row_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, const char *item_name, unsigned short new_val) EINA_WARN_UNUSED_RESULT; Eina_Bool +editor_part_item_index_span_col_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index, + unsigned short new_val) EINA_WARN_UNUSED_RESULT; +Eina_Bool +editor_part_item_index_span_row_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index, + unsigned short new_val) EINA_WARN_UNUSED_RESULT; +Eina_Bool +editor_part_item_index_position_col_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index, + unsigned short new_val) EINA_WARN_UNUSED_RESULT; +Eina_Bool +editor_part_item_index_position_row_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, unsigned int index, + unsigned short new_val) EINA_WARN_UNUSED_RESULT; +Eina_Bool editor_part_item_source_set(Evas_Object *obj, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, const char *item_name, const char * new_val) EINA_WARN_UNUSED_RESULT; Eina_Bool diff --git a/src/bin/editor/editor_macro.h b/src/bin/editor/editor_macro.h index 5f8832d..56d1899 100644 --- a/src/bin/editor/editor_macro.h +++ b/src/bin/editor/editor_macro.h @@ -761,6 +761,47 @@ editor_part_item_## FUNC ##_set(Evas_Object *edit_object, Change *change, Eina_B return true; \ } +#define EDITOR_PART_ITEM_INDEX_USHORT(FUNC, RM_ATTRIBUTE, SAVE) \ +Eina_Bool \ +editor_part_item_index_## FUNC ##_set(Evas_Object *edit_object, Change *change, Eina_Bool merge, Eina_Bool apply, \ + const char *part_name, unsigned int index, unsigned short new_val) \ +{ \ + Diff *diff; \ + Editor_Attribute_Change send; \ + send.edit_object = edit_object; \ + \ + send.attribute = RM_ATTRIBUTE; \ + assert(edit_object != NULL); \ + assert(part_name != NULL); \ + if (change) \ + { \ + unsigned short old_value = edje_edit_part_item_index_## FUNC ##_get(edit_object, part_name, index); \ + diff = mem_calloc(1, sizeof(Diff)); \ + diff->redo.type = FUNCTION_TYPE_STRING_UINT_USHORT; \ + diff->redo.function = editor_part_item_index_## FUNC ##_set; \ + diff->redo.args.type_suius.s1 = eina_stringshare_add(part_name); \ + diff->redo.args.type_suius.ui2 = index; \ + diff->redo.args.type_suius.us3 = new_val; \ + diff->undo.type = FUNCTION_TYPE_STRING_UINT_USHORT; \ + diff->undo.function = editor_part_item_index_## FUNC ##_set; \ + diff->undo.args.type_suius.s1 = eina_stringshare_add(part_name); \ + diff->undo.args.type_suius.ui2 = index; \ + diff->undo.args.type_suius.us3 = old_value; \ + if (merge) \ + change_diff_merge_add(change, diff); \ + else \ + change_diff_add(change, diff); \ + } \ + if (apply) \ + { \ + CRIT_ON_FAIL(edje_edit_part_item_index_## FUNC ##_set(edit_object, part_name, index, new_val)); \ + if (SAVE) 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; \ +} + #define EDITOR_STATE_INT(FUNC, RM_ATTRIBUTE) \ Eina_Bool \ editor_state_## FUNC ##_set(Evas_Object *edit_object, Change *change, Eina_Bool merge, Eina_Bool apply, \ diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c index 6232288..fbf7d4d 100644 --- a/src/bin/editor/editor_part.c +++ b/src/bin/editor/editor_part.c @@ -330,6 +330,11 @@ EDITOR_PART_ITEM_USHORT(span_row, RM_ATTRIBUTE_PART_ITEM_SPAN_ROW, true); EDITOR_PART_ITEM_USHORT(position_col, RM_ATTRIBUTE_PART_ITEM_POSITION_COL, true); EDITOR_PART_ITEM_USHORT(position_row, RM_ATTRIBUTE_PART_ITEM_POSITION_ROW, true); +EDITOR_PART_ITEM_INDEX_USHORT(span_col, RM_ATTRIBUTE_PART_ITEM_SPAN_COL, true); +EDITOR_PART_ITEM_INDEX_USHORT(span_row, RM_ATTRIBUTE_PART_ITEM_SPAN_ROW, true); +EDITOR_PART_ITEM_INDEX_USHORT(position_col, RM_ATTRIBUTE_PART_ITEM_POSITION_COL, true); +EDITOR_PART_ITEM_INDEX_USHORT(position_row, RM_ATTRIBUTE_PART_ITEM_POSITION_ROW, true); + Eina_Bool editor_part_item_source_set(Evas_Object *edit_object, Change *change, Eina_Bool merge, Eina_Bool apply, const char *part_name, const char *item_name, const char *new_val) --
