rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=4a6e4d3890cca211545288a3f09c04823688e73e
commit 4a6e4d3890cca211545288a3f09c04823688e73e Author: Vitalii Vorobiov <vi.vorob...@samsung.com> Date: Mon Oct 3 13:48:23 2016 +0300 editor: value reset functions for edje_edit_part_item_index_... API --- src/bin/editor/default.c | 39 +++++++++++++++ src/bin/editor/default.h | 115 +++++++++++++++++++++++++++++++++++++++++++ src/bin/editor/editor_part.c | 53 +++++++++++++++++++- 3 files changed, 205 insertions(+), 2 deletions(-) diff --git a/src/bin/editor/default.c b/src/bin/editor/default.c index 6d31d31..7d7c97b 100644 --- a/src/bin/editor/default.c +++ b/src/bin/editor/default.c @@ -304,10 +304,17 @@ EDITOR_STATE_SIMPLE_RESET(table_homogeneous, 0) #define EDITOR_PART_ITEM_ARGS_PROTO const char *part_name, const char *item_name #define EDITOR_PART_ITEM_ARGS part_name, item_name +#define EDITOR_PART_ITEM_INDEX_ARGS_PROTO const char *part_name, unsigned int index +#define EDITOR_PART_ITEM_INDEX_ARGS part_name, index + #define EDITOR_PART_ITEM_SIMPLE_RESET(FUNC, DEF_VAL) \ EDITOR_SIMPLE_DEFAULT_CHECK(part_item_##FUNC, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, DEF_VAL) \ EDITOR_RESET(part_item_##FUNC, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, DEF_VAL) +#define EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(FUNC, DEF_VAL) \ +EDITOR_SIMPLE_DEFAULT_CHECK(part_item_index_##FUNC, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, DEF_VAL) \ +EDITOR_RESET(part_item_index_##FUNC, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, DEF_VAL) + EDITOR_PART_ITEM_SIMPLE_RESET(aspect_mode, EDJE_ASPECT_CONTROL_NONE) EDITOR_PART_ITEM_SIMPLE_RESET(aspect_h, 0) EDITOR_PART_ITEM_SIMPLE_RESET(aspect_w, 0) @@ -324,21 +331,53 @@ EDITOR_PART_ITEM_SIMPLE_RESET(span_row, 1) TODO("check item position calculation. there is a type missmatch") EDITOR_PART_ITEM_SIMPLE_RESET(position_col, 0) EDITOR_PART_ITEM_SIMPLE_RESET(position_row, 0) + +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(aspect_mode, EDJE_ASPECT_CONTROL_NONE) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(aspect_h, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(aspect_w, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(max_h, -1) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(max_w, -1) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(min_h, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(min_w, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(prefer_h, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(prefer_w, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(spread_h, 1) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(spread_w, 1) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(span_col, 1) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(span_row, 1) +TODO("check item position calculation. there is a type missmatch") +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(position_col, 0) +EDITOR_PART_ITEM_INDEX_SIMPLE_RESET(position_row, 0) + #define EDITOR_PART_ITEM_DOUBLE_RESET(FUNC, DEF_VAL) \ EDITOR_DOUBLE_DEFAULT_CHECK(part_item_##FUNC, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, DEF_VAL) \ EDITOR_RESET(part_item_##FUNC, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, DEF_VAL) +#define EDITOR_PART_ITEM_INDEX_DOUBLE_RESET(FUNC, DEF_VAL) \ +EDITOR_DOUBLE_DEFAULT_CHECK(part_item_index_##FUNC, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, DEF_VAL) \ +EDITOR_RESET(part_item_index_##FUNC, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, DEF_VAL) + EDITOR_PART_ITEM_DOUBLE_RESET(align_x, 0.5) EDITOR_PART_ITEM_DOUBLE_RESET(align_y, 0.5) EDITOR_PART_ITEM_DOUBLE_RESET(weight_x, 0.0) EDITOR_PART_ITEM_DOUBLE_RESET(weight_y, 0.0) +EDITOR_PART_ITEM_INDEX_DOUBLE_RESET(align_x, 0.5) +EDITOR_PART_ITEM_INDEX_DOUBLE_RESET(align_y, 0.5) +EDITOR_PART_ITEM_INDEX_DOUBLE_RESET(weight_x, 0.0) +EDITOR_PART_ITEM_INDEX_DOUBLE_RESET(weight_y, 0.0) + EDITOR_INT_INT_INT_INT_DEFAULT_CHECK(part_item_padding, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, 0, 0, 0, 0) EDITOR_FOUR_INT_RESET(part_item_padding, top, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, 0) EDITOR_FOUR_INT_RESET(part_item_padding, bottom, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, 0) EDITOR_FOUR_INT_RESET(part_item_padding, left, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, 0) EDITOR_FOUR_INT_RESET(part_item_padding, right, EDITOR_PART_ITEM_ARGS_PROTO, EDITOR_PART_ITEM_ARGS, 0) +EDITOR_INT_INT_INT_INT_DEFAULT_CHECK(part_item_index_padding, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, 0, 0, 0, 0) +EDITOR_FOUR_INT_RESET(part_item_index_padding, top, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, 0) +EDITOR_FOUR_INT_RESET(part_item_index_padding, bottom, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, 0) +EDITOR_FOUR_INT_RESET(part_item_index_padding, left, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, 0) +EDITOR_FOUR_INT_RESET(part_item_index_padding, right, EDITOR_PART_ITEM_INDEX_ARGS_PROTO, EDITOR_PART_ITEM_INDEX_ARGS, 0) TODO("Add stub-group for part items and implement reseter") diff --git a/src/bin/editor/default.h b/src/bin/editor/default.h index 4dba3e2..2f52d66 100644 --- a/src/bin/editor/default.h +++ b/src/bin/editor/default.h @@ -32,6 +32,9 @@ Eina_Bool editor_part_item_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, const char *part_name, const char *item_name); Eina_Bool +editor_part_item_index_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool editor_part_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, const char *part_name); Eina_Bool @@ -500,6 +503,118 @@ Eina_Bool editor_part_item_padding_right_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, const char *part_name, const char *item_name); +/* item index */ +Eina_Bool +editor_part_item_index_aspect_mode_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_aspect_mode_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_aspect_h_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_aspect_h_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_aspect_w_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_aspect_w_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_max_h_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_max_h_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_max_w_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_max_w_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_min_h_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_min_h_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_min_w_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_min_w_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_prefer_h_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_prefer_h_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_prefer_w_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_prefer_w_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_spread_h_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_spread_h_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_spread_w_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_spread_w_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_span_col_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_span_col_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_span_row_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_span_row_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_position_col_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_position_col_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_position_row_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_position_row_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_align_x_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_align_x_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_align_y_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_align_y_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_weight_x_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_weight_x_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_weight_y_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_weight_y_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_padding_default_is(Evas_Object *edit_object, const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_padding_top_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_padding_bottom_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_padding_left_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); +Eina_Bool +editor_part_item_index_padding_right_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index); + + Eina_Bool editor_part_text_effect_default_is(Evas_Object *edit_object, const char *part_name); Eina_Bool diff --git a/src/bin/editor/editor_part.c b/src/bin/editor/editor_part.c index 53b7131..5f48929 100644 --- a/src/bin/editor/editor_part.c +++ b/src/bin/editor/editor_part.c @@ -971,6 +971,55 @@ editor_part_item_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply } Eina_Bool +editor_part_item_index_reset(Evas_Object *edit_object, Change *change, Eina_Bool apply, + const char *part_name, unsigned int index) +{ + Eina_Bool res = true; + assert(edit_object != NULL); + assert(part_name != NULL); + + Edje_Part_Type type = edje_edit_part_type_get(edit_object, part_name); + + assert((type == EDJE_PART_TYPE_TABLE) || (type == EDJE_PART_TYPE_BOX)); + + you_shall_not_pass_editor_signals(change); + + if (type == EDJE_PART_TYPE_TABLE) + { + res = res && editor_part_item_index_span_col_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_span_row_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_position_col_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_position_row_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_spread_h_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_spread_w_reset(edit_object, change, apply, part_name, index); + } + + res = res && editor_part_item_index_aspect_mode_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_aspect_h_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_aspect_w_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_max_h_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_max_w_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_min_h_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_min_w_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_prefer_h_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_prefer_w_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_align_x_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_align_y_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_weight_x_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_weight_y_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_padding_top_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_padding_bottom_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_padding_left_reset(edit_object, change, apply, part_name, index); + res = res && editor_part_item_index_padding_right_reset(edit_object, change, apply, part_name, index); + if (!_part_item_restacking) + res = res && editor_part_item_index_restack(edit_object, change, false, apply, part_name, index, index, false); + + you_shall_pass_editor_signals(change); + + return res; +} + +Eina_Bool editor_part_item_append(Evas_Object *edit_object, Change *change, Eina_Bool merge __UNUSED__, Eina_Bool apply, const char *part_name, const char *item_name, const char *source_group) { @@ -1154,8 +1203,8 @@ editor_part_item_index_del(Evas_Object *edit_object, Change *change, Eina_Bool m if (change) { source_group = edje_edit_part_item_index_source_get(edit_object, part_name, index); -// if (!editor_part_item_index_reset(edit_object, change, apply, part_name, index)) -// return false; + if (!editor_part_item_index_reset(edit_object, change, apply, part_name, index)) + return false; diff = mem_calloc(1, sizeof(Diff)); diff->redo.type = FUNCTION_TYPE_STRING_UINT; diff->redo.function = editor_part_item_index_del; --