rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=9882b57eab7629d4a433302a33b24f2077eb4577
commit 9882b57eab7629d4a433302a33b24f2077eb4577 Author: Vitalii Vorobiov <vi.vorob...@samsung.com> Date: Mon Oct 3 20:02:04 2016 +0300 editor_part: Use part_item_index functions and apply new API of items because old doesn't allow empty names to be used --- src/bin/editor/editor_part.c | 2 - src/bin/resource_manager/resource_manager_free.c | 23 +- src/bin/resource_manager/resource_manager_react.c | 10 +- src/bin/ui/property/property_group.c | 245 ++++++++++++---------- src/bin/ui/tabs.c | 8 +- src/bin/ui/workspace/group_navigator.c | 37 ++-- src/bin/ui/workspace/group_navigator.h | 4 +- src/bin/ui/workspace/groupview_calc.c | 40 ++-- src/bin/ui/workspace/workspace.c | 15 +- src/bin/ui/workspace/workspace.h | 10 +- 10 files changed, 208 insertions(+), 186 deletions(-) diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c index 5f48929..146175d 100644 --- a/src/bin/editor/editor_part.c +++ b/src/bin/editor/editor_part.c @@ -1102,8 +1102,6 @@ editor_part_item_index_append(Evas_Object *edit_object, Change *change, Eina_Boo Edje_Part_Type type = edje_edit_part_type_get(edit_object, part_name); CRIT_ON_FAIL(edje_edit_part_item_insert_after_index(edit_object, part_name, item_name, count - 1, source_group)); - if (item_name) - CRIT_ON_FAIL(edje_edit_part_item_index_name_set(edit_object, part_name, count, item_name)); if (type == EDJE_PART_TYPE_TABLE) { diff --git a/src/bin/resource_manager/resource_manager_free.c b/src/bin/resource_manager/resource_manager_free.c index c4d5ee9..3edd13c 100644 --- a/src/bin/resource_manager/resource_manager_free.c +++ b/src/bin/resource_manager/resource_manager_free.c @@ -467,6 +467,15 @@ _resource_part_item_free(Part2 *part, Part_Item2 *item) void _resource_part_item_del(Part2 *part, Part_Item2 *item) { + Eina_List *item_list, *l; + Part_Item2 *item_data; + + item_list = eina_list_data_find_list(part->items, item); + + EINA_LIST_FOREACH(item_list, l, item_data) + { + item_data->common.id--; + } /* item is not used anywhere at all */ _resource_part_item_free(part, item); } @@ -804,13 +813,13 @@ _resource_group_del(Project *pro, Group2 *group) item->part->group, evas_object_evas_get(ap.win)); } - CRIT_ON_FAIL(editor_part_item_source_set(item->part->group->edit_object, - NULL, - false, - true, - item->part->common.name, - item->common.name, - EFLETE_INTERNAL_GROUP_NAME)); + CRIT_ON_FAIL(editor_part_item_index_source_set(item->part->group->edit_object, + NULL, + false, + true, + item->part->common.name, + item->common.id, + EFLETE_INTERNAL_GROUP_NAME)); if (is_opened) resource_group_edit_object_unload(item->part->group); } diff --git a/src/bin/resource_manager/resource_manager_react.c b/src/bin/resource_manager/resource_manager_react.c index 17f98e0..875d62a 100644 --- a/src/bin/resource_manager/resource_manager_react.c +++ b/src/bin/resource_manager/resource_manager_react.c @@ -793,7 +793,7 @@ _editor_part_item_deleted_cb(void *data __UNUSED__, const Editor_Item *editor_item = event_info; Group2 *group = tabs_current_group_get(); Part2 *part = (Part2 *)resource_manager_find(group->parts, editor_item->part_name); - Part_Item2 *item = (Part_Item2 *)resource_manager_find(part->items, editor_item->item_name); + Part_Item2 *item = (Part_Item2 *)resource_manager_id_find(part->items, editor_item->item_index); _resource_part_item_del(part, item); } @@ -864,10 +864,10 @@ _editor_part_item_restacked_cb(void *data __UNUSED__, Part_Item2 *part_item, *relative_part_item; Part2 *part = (Part2 *)resource_manager_find(group->parts, editor_part_item_restack->part_name); - part_item = (Part_Item2 *)resource_manager_find(part->items, - editor_part_item_restack->part_item); - relative_part_item = (Part_Item2 *)resource_manager_find(part->items, - editor_part_item_restack->relative_part_item); + part_item = (Part_Item2 *)resource_manager_id_find(part->items, + editor_part_item_restack->item_index); + relative_part_item = (Part_Item2 *)resource_manager_id_find(part->items, + editor_part_item_restack->relative_item_index); part->items = eina_list_remove(part->items, part_item); diff --git a/src/bin/ui/property/property_group.c b/src/bin/ui/property/property_group.c index 3fbefe2..34c4f87 100644 --- a/src/bin/ui/property/property_group.c +++ b/src/bin/ui/property/property_group.c @@ -266,6 +266,19 @@ _item_name_get(void) return NULL; } +static inline unsigned int +_item_id_get(void) +{ + TODO("change to assert after fixing genlist filters") + if (!group_pd.group->current_selected) + return 0; + + if (group_pd.group->current_selected->common.type == RESOURCE2_TYPE_ITEM) + return group_pd.group->current_selected->common.id; + + return 0; +} + static inline const char * _data_name_get(void) { @@ -295,7 +308,7 @@ _program_name_get(void) #define EDIT_OBJ group_pd.group->edit_object #define PART_ARGS _part_name_get() #define GROUP_DATA_ARGS _data_name_get() -#define ITEM_ARGS PART_ARGS, _item_name_get() +#define ITEM_ARGS PART_ARGS, _item_id_get() #define STATE_ARGS PART_ARGS, _state_name_get(), _state_val_get() #define STATE_SOURCE_ARGS str_val1, _state_name_get(), _state_val_get() #define PROGRAM_ARGS _program_name_get() @@ -1974,105 +1987,105 @@ _update_cb(Property_Attribute *pa, Property_Action *action) return editor_state_table_homogeneous_default_is(EDIT_OBJ, STATE_ARGS); case ATTRIBUTE_PART_ITEM_SOURCE: elm_genlist_clear(action->control); - str_val1 = edje_edit_part_item_source_get(EDIT_OBJ, ITEM_ARGS); + str_val1 = edje_edit_part_item_index_source_get(EDIT_OBJ, ITEM_ARGS); _groups_combobox_fill(action->control, str_val1, false); edje_edit_string_free(str_val1); return true; case ATTRIBUTE_PART_ITEM_MIN_W: - int_val1 = edje_edit_part_item_min_w_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_min_w_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_min_w_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_min_w_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_MIN_H: - int_val1 = edje_edit_part_item_min_h_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_min_h_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_min_h_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_min_h_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_MAX_W: - int_val1 = edje_edit_part_item_max_w_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_max_w_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_max_w_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_max_w_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_MAX_H: - int_val1 = edje_edit_part_item_max_h_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_max_h_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_max_h_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_max_h_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_PREFER_W: - int_val1 = edje_edit_part_item_prefer_w_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_prefer_w_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_prefer_w_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_prefer_w_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_PREFER_H: - int_val1 = edje_edit_part_item_prefer_h_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_prefer_h_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_prefer_h_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_prefer_h_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_WEIGHT_X: - double_val1 = edje_edit_part_item_weight_x_get(EDIT_OBJ, ITEM_ARGS); + double_val1 = edje_edit_part_item_index_weight_x_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, double_val1); - return editor_part_item_weight_x_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_weight_x_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_WEIGHT_Y: - double_val1 = edje_edit_part_item_weight_y_get(EDIT_OBJ, ITEM_ARGS); + double_val1 = edje_edit_part_item_index_weight_y_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, double_val1); - return editor_part_item_weight_y_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_weight_y_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_ALIGN_X: - double_val1 = edje_edit_part_item_align_x_get(EDIT_OBJ, ITEM_ARGS); + double_val1 = edje_edit_part_item_index_align_x_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, double_val1); - return editor_part_item_align_x_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_align_x_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_ALIGN_Y: - double_val1 = edje_edit_part_item_align_y_get(EDIT_OBJ, ITEM_ARGS); + double_val1 = edje_edit_part_item_index_align_y_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, double_val1); - return editor_part_item_align_y_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_align_y_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_ASPECT_MODE: - elm_object_text_set(action->control, item_aspect_mode_strings[(int) edje_edit_part_item_aspect_mode_get(EDIT_OBJ, ITEM_ARGS)]); - return editor_part_item_aspect_mode_default_is(EDIT_OBJ, ITEM_ARGS); + elm_object_text_set(action->control, item_aspect_mode_strings[(int) edje_edit_part_item_index_aspect_mode_get(EDIT_OBJ, ITEM_ARGS)]); + return editor_part_item_index_aspect_mode_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PROGRAM_TRANSITION_TYPE: elm_object_text_set(action->control, transition_type_strings[(int) editor_program_transition_type_get(EDIT_OBJ, PROGRAM_ARGS)]); GENLIST_FILTER_APPLY(pd->genlist); return editor_program_transition_type_default_is(EDIT_OBJ, PROGRAM_ARGS); case ATTRIBUTE_PART_ITEM_ASPECT_W: - int_val1 = edje_edit_part_item_aspect_w_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_aspect_w_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_aspect_w_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_aspect_w_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_ASPECT_H: - int_val1 = edje_edit_part_item_aspect_h_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_aspect_h_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_aspect_h_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_aspect_h_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_SPREAD_W: - int_val1 = edje_edit_part_item_spread_w_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_spread_w_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_spread_w_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_spread_w_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_SPREAD_H: - int_val1 = edje_edit_part_item_spread_h_get(EDIT_OBJ, ITEM_ARGS); + int_val1 = edje_edit_part_item_index_spread_h_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_spread_h_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_spread_h_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_SPAN_COL: - ushort_val1 = edje_edit_part_item_span_col_get(EDIT_OBJ, ITEM_ARGS); + ushort_val1 = edje_edit_part_item_index_span_col_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, ushort_val1); - return editor_part_item_span_col_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_span_col_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_SPAN_ROW: - ushort_val1 = edje_edit_part_item_span_row_get(EDIT_OBJ, ITEM_ARGS); + ushort_val1 = edje_edit_part_item_index_span_row_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, ushort_val1); - return editor_part_item_span_row_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_span_row_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_POSITION_COL: - ushort_val1 = edje_edit_part_item_position_col_get(EDIT_OBJ, ITEM_ARGS); + ushort_val1 = edje_edit_part_item_index_position_col_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, ushort_val1); - return editor_part_item_position_col_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_position_col_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_POSITION_ROW: - ushort_val1 = edje_edit_part_item_position_row_get(EDIT_OBJ, ITEM_ARGS); + ushort_val1 = edje_edit_part_item_index_position_row_get(EDIT_OBJ, ITEM_ARGS); elm_spinner_value_set(action->control, ushort_val1); - return editor_part_item_position_row_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_position_row_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_PADDING_LEFT: - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, &int_val1, NULL, NULL, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, &int_val1, NULL, NULL, NULL); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_padding_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_padding_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_PADDING_RIGHT: - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &int_val1, NULL, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &int_val1, NULL, NULL); elm_spinner_value_set(action->control, int_val1); - return editor_part_item_padding_default_is(EDIT_OBJ, ITEM_ARGS); + return editor_part_item_index_padding_default_is(EDIT_OBJ, ITEM_ARGS); case ATTRIBUTE_PART_ITEM_PADDING_TOP: - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &int_val1, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &int_val1, NULL); elm_spinner_value_set(action->control, int_val1); /* updating two-item attribute: caption should be updated in first item */ property_item_update(&group_pd.items[PROPERTY_GROUP_ITEM_PART_ITEM_PADDING_H]); return true; case ATTRIBUTE_PART_ITEM_PADDING_BOTTOM: - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &int_val1); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &int_val1); elm_spinner_value_set(action->control, int_val1); /* updating two-item attribute: caption should be updated in first item */ property_item_update(&group_pd.items[PROPERTY_GROUP_ITEM_PART_ITEM_PADDING_H]); @@ -3194,52 +3207,52 @@ _start_cb(Property_Attribute *pa, Property_Action *action) case ATTRIBUTE_PART_ITEM_SOURCE: group_pd.history.format = _("item's source changed from \"%s\" to \"%s\""); - STR_VAL(str_val1, edje_edit_part_item_source_get(EDIT_OBJ, ITEM_ARGS)); + STR_VAL(str_val1, edje_edit_part_item_index_source_get(EDIT_OBJ, ITEM_ARGS)); break; case ATTRIBUTE_PART_ITEM_MIN_W: group_pd.history.format = _("part item's min_w changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_min_w_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_min_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MIN_H: group_pd.history.format = _("part item's min_h changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_min_h_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_min_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MAX_W: group_pd.history.format = _("part item's max_w changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_max_w_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_max_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MAX_H: group_pd.history.format = _("part item's max_h changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_max_h_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_max_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PREFER_W: group_pd.history.format = _("part item's prefer_w changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_prefer_w_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_prefer_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PREFER_H: group_pd.history.format = _("part item's prefer_h changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_prefer_h_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_prefer_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_WEIGHT_X: group_pd.history.format = _("part item's weight_x changed from %.2f to %.2f"); - VAL(double_val1) = edje_edit_part_item_weight_x_get(EDIT_OBJ, ITEM_ARGS); + VAL(double_val1) = edje_edit_part_item_index_weight_x_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_WEIGHT_Y: group_pd.history.format = _("part item's weight_y changed from %.2f to %.2f"); - VAL(double_val1) = edje_edit_part_item_weight_y_get(EDIT_OBJ, ITEM_ARGS); + VAL(double_val1) = edje_edit_part_item_index_weight_y_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ALIGN_X: group_pd.history.format = _("part item's align_x changed from %.2f to %.2f"); - VAL(double_val1) = edje_edit_part_item_align_x_get(EDIT_OBJ, ITEM_ARGS); + VAL(double_val1) = edje_edit_part_item_index_align_x_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ALIGN_Y: group_pd.history.format = _("part item's align_y changed from %.2f to %.2f"); - VAL(double_val1) = edje_edit_part_item_align_y_get(EDIT_OBJ, ITEM_ARGS); + VAL(double_val1) = edje_edit_part_item_index_align_y_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ASPECT_MODE: group_pd.history.format = _("part item's aspect mode changed from \"%s\" to \"%s\""); STR_VAL(str_val1, eina_stringshare_add( - item_aspect_mode_strings[edje_edit_part_item_aspect_mode_get(EDIT_OBJ, ITEM_ARGS)])); + item_aspect_mode_strings[edje_edit_part_item_index_aspect_mode_get(EDIT_OBJ, ITEM_ARGS)])); break; case ATTRIBUTE_PROGRAM_TRANSITION_TYPE: group_pd.history.format = _("program's transition type changed from \"%s\" to \"%s\""); @@ -3248,54 +3261,54 @@ _start_cb(Property_Attribute *pa, Property_Action *action) break; case ATTRIBUTE_PART_ITEM_ASPECT_W: group_pd.history.format = _("part item's aspect_w changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_aspect_w_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_aspect_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ASPECT_H: group_pd.history.format = _("part item's aspect_h changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_aspect_h_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_aspect_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPREAD_W: group_pd.history.format = _("part item's spread by rows changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_spread_w_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_spread_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPREAD_H: group_pd.history.format = _("part item's spread by columns changed from %d to %d"); - VAL(int_val1) = edje_edit_part_item_spread_h_get(EDIT_OBJ, ITEM_ARGS); + VAL(int_val1) = edje_edit_part_item_index_spread_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPAN_COL: group_pd.history.format = _("part item's span by columns changed from %hu to %hu"); - VAL(ushort_val1) = edje_edit_part_item_span_col_get(EDIT_OBJ, ITEM_ARGS); + VAL(ushort_val1) = edje_edit_part_item_index_span_col_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPAN_ROW: group_pd.history.format = _("part item's span by rows changed from %hu to %hu"); - VAL(ushort_val1) = edje_edit_part_item_span_row_get(EDIT_OBJ, ITEM_ARGS); + VAL(ushort_val1) = edje_edit_part_item_index_span_row_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_POSITION_COL: group_pd.history.format = _("part item's column position changed from %hu to %hu"); - VAL(ushort_val1) = edje_edit_part_item_position_col_get(EDIT_OBJ, ITEM_ARGS); + VAL(ushort_val1) = edje_edit_part_item_index_position_col_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_POSITION_ROW: group_pd.history.format = _("part item's row position changed from %hu to %hu"); - VAL(ushort_val1) = edje_edit_part_item_position_row_get(EDIT_OBJ, ITEM_ARGS); + VAL(ushort_val1) = edje_edit_part_item_index_position_row_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PADDING_LEFT: group_pd.history.format = _("part item's left padding changed from %d to %d"); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, &int_val1, NULL, NULL, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, &int_val1, NULL, NULL, NULL); VAL(int_val1) = int_val1; break; case ATTRIBUTE_PART_ITEM_PADDING_RIGHT: group_pd.history.format = _("part item's right padding changed from %d to %d"); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &int_val1, NULL, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &int_val1, NULL, NULL); VAL(int_val1) = int_val1; break; case ATTRIBUTE_PART_ITEM_PADDING_TOP: group_pd.history.format = _("part item's top padding changed from %d to %d"); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &int_val1, NULL); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &int_val1, NULL); VAL(int_val1) = int_val1; break; case ATTRIBUTE_PART_ITEM_PADDING_BOTTOM: group_pd.history.format = _("part item's bottom padding changed from %d to %d"); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &int_val1); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &int_val1); VAL(int_val1) = int_val1; break; case ATTRIBUTE_STATE_MAP_PERSPECTIVE: @@ -4224,54 +4237,54 @@ _change_cb(Property_Attribute *pa, Property_Action *action) case ATTRIBUTE_PART_ITEM_SOURCE: assert(cb_item_combo != NULL); str_val1 = eina_stringshare_add(cb_item_combo->data); - CRIT_ON_FAIL(editor_part_item_source_set(EDIT_OBJ, CHANGE_NO_MERGE, ITEM_ARGS, str_val1)); + CRIT_ON_FAIL(editor_part_item_index_source_set(EDIT_OBJ, CHANGE_NO_MERGE, ITEM_ARGS, str_val1)); eina_stringshare_del(group_pd.history.new.str_val1); group_pd.history.new.str_val1 = str_val1; break; case ATTRIBUTE_PART_ITEM_MIN_W: - CRIT_ON_FAIL(editor_part_item_min_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_min_w_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_min_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_min_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MIN_H: - CRIT_ON_FAIL(editor_part_item_min_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_min_h_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_min_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_min_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MAX_W: - CRIT_ON_FAIL(editor_part_item_max_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_max_w_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_max_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_max_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_MAX_H: - CRIT_ON_FAIL(editor_part_item_max_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_max_h_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_max_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_max_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PREFER_W: - CRIT_ON_FAIL(editor_part_item_prefer_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_prefer_w_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_prefer_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_prefer_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PREFER_H: - CRIT_ON_FAIL(editor_part_item_prefer_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_prefer_h_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_prefer_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_prefer_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_WEIGHT_X: - CRIT_ON_FAIL(editor_part_item_weight_x_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.double_val1 = edje_edit_part_item_weight_x_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_weight_x_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.double_val1 = edje_edit_part_item_index_weight_x_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_WEIGHT_Y: - CRIT_ON_FAIL(editor_part_item_weight_y_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.double_val1 = edje_edit_part_item_weight_y_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_weight_y_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.double_val1 = edje_edit_part_item_index_weight_y_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ALIGN_X: - CRIT_ON_FAIL(editor_part_item_align_x_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.double_val1 = edje_edit_part_item_align_x_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_align_x_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.double_val1 = edje_edit_part_item_index_align_x_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ALIGN_Y: - CRIT_ON_FAIL(editor_part_item_align_y_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.double_val1 = edje_edit_part_item_align_y_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_align_y_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.double_val1 = edje_edit_part_item_index_align_y_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ASPECT_MODE: assert(cb_item_combo != NULL); str_val1 = eina_stringshare_add(cb_item_combo->data); - CRIT_ON_FAIL(editor_part_item_aspect_mode_set(EDIT_OBJ, CHANGE_NO_MERGE, ITEM_ARGS, cb_item_combo->index)); + CRIT_ON_FAIL(editor_part_item_index_aspect_mode_set(EDIT_OBJ, CHANGE_NO_MERGE, ITEM_ARGS, cb_item_combo->index)); eina_stringshare_del(group_pd.history.new.str_val1); group_pd.history.new.str_val1 = str_val1; break; @@ -4283,52 +4296,52 @@ _change_cb(Property_Attribute *pa, Property_Action *action) group_pd.history.new.str_val1 = str_val1; break; case ATTRIBUTE_PART_ITEM_ASPECT_W: - CRIT_ON_FAIL(editor_part_item_aspect_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_aspect_w_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_aspect_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_aspect_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_ASPECT_H: - CRIT_ON_FAIL(editor_part_item_aspect_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_aspect_h_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_aspect_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_aspect_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPREAD_W: - CRIT_ON_FAIL(editor_part_item_spread_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_spread_w_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_spread_w_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_spread_w_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPREAD_H: - CRIT_ON_FAIL(editor_part_item_spread_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - group_pd.history.new.int_val1 = edje_edit_part_item_spread_h_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_spread_h_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + group_pd.history.new.int_val1 = edje_edit_part_item_index_spread_h_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPAN_COL: - CRIT_ON_FAIL(editor_part_item_span_col_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); - group_pd.history.new.ushort_val1 = edje_edit_part_item_span_col_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_span_col_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); + group_pd.history.new.ushort_val1 = edje_edit_part_item_index_span_col_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_SPAN_ROW: - CRIT_ON_FAIL(editor_part_item_span_row_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); - group_pd.history.new.ushort_val1 = edje_edit_part_item_span_row_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_span_row_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); + group_pd.history.new.ushort_val1 = edje_edit_part_item_index_span_row_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_POSITION_COL: - CRIT_ON_FAIL(editor_part_item_position_col_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); - group_pd.history.new.ushort_val1 = edje_edit_part_item_position_col_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_position_col_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); + group_pd.history.new.ushort_val1 = edje_edit_part_item_index_position_col_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_POSITION_ROW: - CRIT_ON_FAIL(editor_part_item_position_row_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); - group_pd.history.new.ushort_val1 = edje_edit_part_item_position_row_get(EDIT_OBJ, ITEM_ARGS); + CRIT_ON_FAIL(editor_part_item_index_position_row_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, (int)double_val1)); + group_pd.history.new.ushort_val1 = edje_edit_part_item_index_position_row_get(EDIT_OBJ, ITEM_ARGS); break; case ATTRIBUTE_PART_ITEM_PADDING_TOP: - CRIT_ON_FAIL(editor_part_item_padding_top_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &group_pd.history.new.int_val1, NULL); + CRIT_ON_FAIL(editor_part_item_index_padding_top_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, &group_pd.history.new.int_val1, NULL); break; case ATTRIBUTE_PART_ITEM_PADDING_BOTTOM: - CRIT_ON_FAIL(editor_part_item_padding_bottom_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &group_pd.history.new.int_val1); + CRIT_ON_FAIL(editor_part_item_index_padding_bottom_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, NULL, NULL, &group_pd.history.new.int_val1); break; case ATTRIBUTE_PART_ITEM_PADDING_LEFT: - CRIT_ON_FAIL(editor_part_item_padding_left_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, &group_pd.history.new.int_val1, NULL, NULL, NULL); + CRIT_ON_FAIL(editor_part_item_index_padding_left_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, &group_pd.history.new.int_val1, NULL, NULL, NULL); break; case ATTRIBUTE_PART_ITEM_PADDING_RIGHT: - CRIT_ON_FAIL(editor_part_item_padding_right_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); - edje_edit_part_item_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &group_pd.history.new.int_val1, NULL, NULL); + CRIT_ON_FAIL(editor_part_item_index_padding_right_set(EDIT_OBJ, CHANGE_MERGE, ITEM_ARGS, double_val1)); + edje_edit_part_item_index_padding_get(EDIT_OBJ, ITEM_ARGS, NULL, &group_pd.history.new.int_val1, NULL, NULL); break; case ATTRIBUTE_STATE_MAP_PERSPECTIVE: assert(cb_item_combo != NULL); diff --git a/src/bin/ui/tabs.c b/src/bin/ui/tabs.c index 3f03bf3..e9ad5ce 100644 --- a/src/bin/ui/tabs.c +++ b/src/bin/ui/tabs.c @@ -587,7 +587,9 @@ _editor_part_item_added_cb(void *data __UNUSED__, assert(tabs.current_group != NULL); assert(tabs.current_workspace != NULL); - workspace_part_item_add(tabs.current_workspace, editor_item->part_name, editor_item->item_name); + workspace_part_item_add(tabs.current_workspace, + editor_item->part_name, + editor_item->item_index); } static void @@ -601,7 +603,7 @@ _editor_part_item_deleted_cb(void *data __UNUSED__, assert(tabs.current_group != NULL); assert(tabs.current_workspace != NULL); - workspace_part_item_del(tabs.current_workspace, editor_item->part_name, editor_item->item_name); + workspace_part_item_del(tabs.current_workspace, editor_item->part_name, editor_item->item_index); } static void @@ -663,7 +665,7 @@ _editor_part_item_restacked_cb(void *data __UNUSED__, workspace_part_item_restack(tabs.current_workspace, editor_part_item_restack->part_name, - editor_part_item_restack->part_item, + editor_part_item_restack->item_index, editor_part_item_restack->relative_part_item); } diff --git a/src/bin/ui/workspace/group_navigator.c b/src/bin/ui/workspace/group_navigator.c index 7844a9f..f68e228 100644 --- a/src/bin/ui/workspace/group_navigator.c +++ b/src/bin/ui/workspace/group_navigator.c @@ -1453,14 +1453,14 @@ _popup_add_item_close_cb(void *data, msg = eina_stringshare_printf(_("added new item \"%s\" to part \"%s\""), name, pl->part->common.name); change = change_add(msg); - CRIT_ON_FAIL(editor_part_item_append(pl->group->edit_object, change, false, true, pl->part->common.name, name, pl->popup.item_selected->data)); + CRIT_ON_FAIL(editor_part_item_index_append(pl->group->edit_object, change, false, true, pl->part->common.name, name, pl->popup.item_selected->data)); history_change_add(pl->group->history, change); eina_stringshare_del(msg); } void -group_navigator_part_item_add(Evas_Object *obj, Part2 *part, Eina_Stringshare * item_name) +group_navigator_part_item_add(Evas_Object *obj, Part2 *part, unsigned int index) { Part_List *pl = evas_object_data_get(obj, GROUP_NAVIGATOR_DATA); Elm_Object_Item *part_glit; @@ -1469,13 +1469,12 @@ group_navigator_part_item_add(Evas_Object *obj, Part2 *part, Eina_Stringshare * Part_Item2 *part_item; assert(pl != NULL); - assert(item_name != NULL); part_glit = _part_item_find(pl, part); assert(part_glit != NULL); - part_item = (Part_Item2 *)resource_manager_find(part->items, item_name); + part_item = (Part_Item2 *)resource_manager_id_find(part->items, index); elm_genlist_item_expanded_set(part_glit, true); items_glit = eina_list_data_get(eina_list_last(elm_genlist_item_subitems_get(part_glit))); elm_genlist_item_update(items_glit); @@ -2098,7 +2097,6 @@ _item_del(Part_List *pl, Elm_Object_Item *glit) { Part_Item2 *item; - Eina_Stringshare *item_name; Eina_Stringshare *msg; Change *change; @@ -2114,9 +2112,7 @@ _item_del(Part_List *pl, change = change_add(msg); eina_stringshare_del(msg); - item_name = eina_stringshare_ref(item->common.name); - CRIT_ON_FAIL(editor_part_item_del(pl->group->edit_object, change, false, true, pl->part->common.name, item_name)); - eina_stringshare_del(item_name); + CRIT_ON_FAIL(editor_part_item_index_del(pl->group->edit_object, change, false, true, pl->part->common.name, item->common.id)); history_change_add(pl->group->history, change); } @@ -2295,6 +2291,7 @@ _part_item_restack(Part_List *pl, Elm_Object_Item *glit, Eina_Bool move_up) Eina_Stringshare *msg; Change *change; Part_Item2 *part_item, *rel_part_item; + Eina_Bool flag; assert(pl != NULL); assert(pl->part != NULL); @@ -2323,14 +2320,21 @@ _part_item_restack(Part_List *pl, Elm_Object_Item *glit, Eina_Bool move_up) rel_part_item_name = eina_stringshare_ref(rel_part_item->common.name); if (rel_part_item_name) - msg = eina_stringshare_printf(_("part item \"%s\" placed below part item \"%s\" in the stack"), part_item_name, rel_part_item_name); + { + flag = true; + msg = eina_stringshare_printf(_("part item \"%s\" placed below part item \"%s\" in the stack"), part_item_name, rel_part_item_name); + } else - msg = eina_stringshare_printf(_("part item \"%s\" restacked to the top of the stack"), part_item_name); + { + flag = false; + msg = eina_stringshare_printf(_("part item \"%s\" restacked to the top of the stack"), part_item_name); + } change = change_add(msg); - CRIT_ON_FAIL(editor_part_item_restack(pl->group->edit_object, change, false, true, - pl->part->common.name, - part_item_name, - rel_part_item_name)); + CRIT_ON_FAIL(editor_part_item_index_restack(pl->group->edit_object, change, false, true, + pl->part->common.name, + part_item->common.id, + rel_part_item->common.id, + flag)); history_change_add(pl->group->history, change); eina_stringshare_del(msg); eina_stringshare_del(part_item_name); @@ -2340,7 +2344,7 @@ _part_item_restack(Part_List *pl, Elm_Object_Item *glit, Eina_Bool move_up) void group_navigator_part_item_restack(Evas_Object *obj, Part2 *part, - Eina_Stringshare *item_name, + unsigned int item_index, Eina_Stringshare *relative_part_item __UNUSED__) { Elm_Object_Item *part_glit; @@ -2351,7 +2355,6 @@ group_navigator_part_item_restack(Evas_Object *obj, assert(pl != NULL); assert(part != NULL); - assert(item_name != NULL); glit = _part_item_find(pl, part); assert(glit != NULL); @@ -2360,7 +2363,7 @@ group_navigator_part_item_restack(Evas_Object *obj, assert(part_glit != NULL); - part_item = (Part_Item2 *)resource_manager_find(part->items, item_name); + part_item = (Part_Item2 *)resource_manager_id_find(part->items, item_index); elm_genlist_item_expanded_set(part_glit, true); items_glit = eina_list_data_get(eina_list_last(elm_genlist_item_subitems_get(part_glit))); elm_genlist_item_expanded_set(items_glit, false); diff --git a/src/bin/ui/workspace/group_navigator.h b/src/bin/ui/workspace/group_navigator.h index 2f32596..68bad01 100644 --- a/src/bin/ui/workspace/group_navigator.h +++ b/src/bin/ui/workspace/group_navigator.h @@ -79,7 +79,7 @@ void group_navigator_part_del(Evas_Object *obj, Part2 *part); void -group_navigator_part_item_add(Evas_Object *obj, Part2 *part, Eina_Stringshare * item_name); +group_navigator_part_item_add(Evas_Object *obj, Part2 *part, unsigned int index); void group_navigator_part_item_del(Evas_Object *obj, Part_Item2 *item); @@ -96,7 +96,7 @@ group_navigator_part_restack(Evas_Object *obj, Part2 *part, Part2 *rel_part); void group_navigator_part_item_restack(Evas_Object *obj, Part2 *part, - Eina_Stringshare *part_item, + unsigned int index, Eina_Stringshare *relative_part_item); void diff --git a/src/bin/ui/workspace/groupview_calc.c b/src/bin/ui/workspace/groupview_calc.c index 602378a..f781732 100644 --- a/src/bin/ui/workspace/groupview_calc.c +++ b/src/bin/ui/workspace/groupview_calc.c @@ -224,21 +224,21 @@ _part_select(void *data, } static Evas_Object * -_conteiner_cell_sizer_add(Groupview_Smart_Data *sd, Groupview_Part *gp, const char *item_name) +_conteiner_cell_sizer_add(Groupview_Smart_Data *sd, Groupview_Part *gp, unsigned int index) { Evas_Object *cell_content; Eina_Stringshare *item_source; int min_w, min_h, max_w, max_h, w, h; cell_content = edje_object_add(evas_object_evas_get(sd->obj)); - item_source = edje_edit_part_item_source_get(sd->group->edit_object, gp->part->common.name, item_name); + item_source = edje_edit_part_item_index_source_get(sd->group->edit_object, gp->part->common.name, index); edje_object_file_set(cell_content, ap.project->dev, item_source); eina_stringshare_del(item_source); /* hide this object, it need only for calculate cell size */ evas_object_hide(cell_content); - min_w = edje_edit_part_item_min_w_get(sd->group->edit_object, gp->part->common.name, item_name); - min_h = edje_edit_part_item_min_h_get(sd->group->edit_object, gp->part->common.name, item_name); + min_w = edje_edit_part_item_index_min_w_get(sd->group->edit_object, gp->part->common.name, index); + min_h = edje_edit_part_item_index_min_h_get(sd->group->edit_object, gp->part->common.name, index); // Calculation according to box/table item implementation in efl 1.13 at edje_load.c if ((min_w <= 0) && (min_h <= 0)) @@ -252,8 +252,8 @@ _conteiner_cell_sizer_add(Groupview_Smart_Data *sd, Groupview_Part *gp, const ch else evas_object_size_hint_min_set(cell_content, min_w, min_h); - max_w = edje_edit_part_item_max_w_get(sd->group->edit_object, gp->part->common.name, item_name); - max_h = edje_edit_part_item_max_h_get(sd->group->edit_object, gp->part->common.name, item_name); + max_w = edje_edit_part_item_index_max_w_get(sd->group->edit_object, gp->part->common.name, index); + max_h = edje_edit_part_item_index_max_h_get(sd->group->edit_object, gp->part->common.name, index); evas_object_size_hint_max_set(cell_content, max_w, max_h); return cell_content; @@ -264,7 +264,7 @@ _part_table_items_add(Groupview_Smart_Data *sd, Groupview_Part *gp, Eina_List ** { Evas_Object *cell, *cell_content; Eina_List *l; - Eina_Stringshare *item_name; + Part_Item2 *part_item; int i, j; unsigned char span_col, span_row; Groupview_Item *item; @@ -289,16 +289,16 @@ _part_table_items_add(Groupview_Smart_Data *sd, Groupview_Part *gp, Eina_List ** elm_layout_theme_set(cell, "layout", "groupview", "default"); evas_object_show(cell); elm_object_signal_emit(cell, "border,part_item", "eflete"); - EINA_LIST_FOREACH(items_draw[i][j], l, item_name) + EINA_LIST_FOREACH(items_draw[i][j], l, part_item) { - span_col = edje_edit_part_item_span_col_get(sd->group->edit_object, gp->part->common.name, item_name); - span_row = edje_edit_part_item_span_row_get(sd->group->edit_object, gp->part->common.name, item_name); + span_col = edje_edit_part_item_index_span_col_get(sd->group->edit_object, gp->part->common.name, part_item->common.id); + span_row = edje_edit_part_item_index_span_row_get(sd->group->edit_object, gp->part->common.name, part_item->common.id); - cell_content = _conteiner_cell_sizer_add(sd, gp, item_name); + cell_content = _conteiner_cell_sizer_add(sd, gp, part_item->common.id); evas_object_table_pack(gp->container, cell_content, i, j, span_col, span_row); item = mem_malloc(sizeof(Groupview_Item)); - item->name = eina_stringshare_add(item_name); + item->name = eina_stringshare_add(part_item->common.name); item->layout = cell; gp->items = eina_list_append(gp->items, item); } @@ -330,13 +330,13 @@ _part_table_add(Groupview_Smart_Data *sd, Groupview_Part *gp) items_draw[i] = (Eina_List **)mem_calloc(1, sizeof(Eina_List *) * row); EINA_LIST_FOREACH(gp->part->items, l, item) { - col_pos = edje_edit_part_item_position_col_get(sd->group->edit_object, gp->part->common.name, item->common.name); - row_pos = edje_edit_part_item_position_row_get(sd->group->edit_object, gp->part->common.name, item->common.name); - span_c = edje_edit_part_item_span_col_get(sd->group->edit_object, gp->part->common.name, item->common.name); - span_r = edje_edit_part_item_span_row_get(sd->group->edit_object, gp->part->common.name, item->common.name); + col_pos = edje_edit_part_item_index_position_col_get(sd->group->edit_object, gp->part->common.name, item->common.id); + row_pos = edje_edit_part_item_index_position_row_get(sd->group->edit_object, gp->part->common.name, item->common.id); + span_c = edje_edit_part_item_index_span_col_get(sd->group->edit_object, gp->part->common.name, item->common.id); + span_r = edje_edit_part_item_index_span_row_get(sd->group->edit_object, gp->part->common.name, item->common.id); if (items_draw[col_pos][row_pos] == (Eina_List *)-1) items_draw[col_pos][row_pos] = NULL; - items_draw[col_pos][row_pos] = eina_list_append(items_draw[col_pos][row_pos], item->common.name); + items_draw[col_pos][row_pos] = eina_list_append(items_draw[col_pos][row_pos], item); for (i = col_pos; i < (col_pos + span_c); i++) { for (j = row_pos; j < (row_pos + span_r); j++) @@ -428,8 +428,8 @@ _part_box_add(Groupview_Smart_Data *sd, Groupview_Part *gp) EINA_LIST_FOREACH(gp->part->items, l, part_item) { - spread_w = edje_edit_part_item_spread_w_get(sd->group->edit_object, gp->part->common.name, part_item->common.name); - spread_h = edje_edit_part_item_spread_h_get(sd->group->edit_object, gp->part->common.name, part_item->common.name); + spread_w = edje_edit_part_item_index_spread_w_get(sd->group->edit_object, gp->part->common.name, part_item->common.id); + spread_h = edje_edit_part_item_index_spread_h_get(sd->group->edit_object, gp->part->common.name, part_item->common.id); for (i = 0; i < (spread_w * spread_h); i++) { cell = elm_layout_add(sd->parent); @@ -438,7 +438,7 @@ _part_box_add(Groupview_Smart_Data *sd, Groupview_Part *gp) evas_object_show(cell); elm_object_signal_emit(cell, "border,part_item", "eflete"); - cell_content = _conteiner_cell_sizer_add(sd, gp, part_item->common.name); + cell_content = _conteiner_cell_sizer_add(sd, gp, part_item->common.id); elm_object_content_set(cell, cell_content); evas_object_box_append(gp->container, cell); if (i == 0) diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c index a070e31..da6e01b 100644 --- a/src/bin/ui/workspace/workspace.c +++ b/src/bin/ui/workspace/workspace.c @@ -1790,12 +1790,11 @@ workspace_part_del(Evas_Object *obj, Eina_Stringshare *part_name) void workspace_part_item_add(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *item_name) + unsigned int index) { Part2 *part; WS_DATA_GET(obj); assert(part_name != NULL); - assert(item_name != NULL); part = (Part2 *)resource_manager_find(wd->group->parts, part_name); @@ -1804,26 +1803,25 @@ workspace_part_item_add(Evas_Object *obj, group_navigator_select(wd->group_navi, (Resource2 *)part); groupview_hard_update(wd->normal.content); - group_navigator_part_item_add(wd->group_navi, part, item_name); + group_navigator_part_item_add(wd->group_navi, part, index); } void workspace_part_item_del(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *item_name) + unsigned int index) { Part2 *part; Part_Item2 *item; WS_DATA_GET(obj); assert(part_name != NULL); - assert(item_name != NULL); part = (Part2 *)resource_manager_find(wd->group->parts, part_name); assert((part->type == EDJE_PART_TYPE_TABLE) || (part->type == EDJE_PART_TYPE_BOX)); - item = (Part_Item2 *)resource_manager_find(part->items, item_name); + item = (Part_Item2 *)resource_manager_id_find(part->items, index); assert(item != NULL); @@ -1910,17 +1908,16 @@ workspace_part_restack(Evas_Object *obj, void workspace_part_item_restack(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *part_item_name, + unsigned int item_index, Eina_Stringshare *relative_part_item_name) { Part2 *part; WS_DATA_GET(obj); - assert(part_item_name != NULL); part = (Part2 *)resource_manager_find(wd->group->parts, part_name); group_navigator_select(wd->group_navi, (Resource2 *)part); - group_navigator_part_item_restack(wd->group_navi, part, part_item_name, relative_part_item_name); + group_navigator_part_item_restack(wd->group_navi, part, item_index, relative_part_item_name); groupview_hard_update(wd->normal.content); } diff --git a/src/bin/ui/workspace/workspace.h b/src/bin/ui/workspace/workspace.h index ae4f354..0e0e1ae 100644 --- a/src/bin/ui/workspace/workspace.h +++ b/src/bin/ui/workspace/workspace.h @@ -119,14 +119,14 @@ workspace_part_add(Evas_Object *obj, Eina_Stringshare *part_name); * * @param obj The workspace object. * @param part_name name of part - * @param item_name name of added part_item + * @param index index of added part_item * * @ingroup Workspace */ void workspace_part_item_add(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *item_name); + unsigned int index); /** * Add new program to group_edit and group_navigator. @@ -191,14 +191,14 @@ workspace_part_state_add(Evas_Object *obj, * * @param obj The workspace object. * @param part_name name of part - * @param item_name name of deleted part_item + * @param index Index of part item that is deleted * * @ingroup Workspace */ void workspace_part_item_del(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *item_name); + unsigned int index); /** * Add new part state to group_edit and group_navigator. @@ -267,7 +267,7 @@ workspace_part_restack(Evas_Object *obj, void workspace_part_item_restack(Evas_Object *obj, Eina_Stringshare *part_name, - Eina_Stringshare *part_item_name, + unsigned int item_index, Eina_Stringshare *relative_part_item_name); /** --