forked from enlightenment/efl
efl_text_cursor: rename enums
Summary: rename two movement enums **paragraph_first**: to just **first** this will move the cursor to the beginning of the text **paragraph_last**: to just **last** this will move the cursor to the end of the text These two are not directly related to paragraph the will move the cursor depending on the whole content or maybe **start** and **end** what do you think ? Reviewers: woohyun, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10810
This commit is contained in:
parent
f8d9dfd74b
commit
9c67a71e00
|
@ -1265,7 +1265,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
|
||||||
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
|
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
|
||||||
|
|
||||||
if ((control) && (multiline))
|
if ((control) && (multiline))
|
||||||
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
|
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
|
||||||
else
|
else
|
||||||
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
|
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
|
||||||
|
|
||||||
|
@ -1280,7 +1280,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
|
||||||
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
|
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
|
||||||
|
|
||||||
if ((control) && (multiline))
|
if ((control) && (multiline))
|
||||||
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
|
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
|
||||||
else
|
else
|
||||||
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
|
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
|
||||||
|
|
||||||
|
@ -1480,14 +1480,14 @@ _cursor_char_coord_set(Efl_Canvas_Text *obj, Efl_Text_Cursor *cur, Evas_Coord ca
|
||||||
cy = canvasy - y;
|
cy = canvasy - y;
|
||||||
|
|
||||||
line_cur = efl_canvas_text_cursor_create(obj);
|
line_cur = efl_canvas_text_cursor_create(obj);
|
||||||
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
|
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
|
||||||
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, &lh);
|
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, &lh);
|
||||||
/* Consider a threshold of half the line height */
|
/* Consider a threshold of half the line height */
|
||||||
if (cy > (cly + lh) && cy < (cly + lh + lh / 2))
|
if (cy > (cly + lh) && cy < (cly + lh + lh / 2))
|
||||||
{
|
{
|
||||||
cy = cly + lh - 1; // Make it inside Textblock
|
cy = cly + lh - 1; // Make it inside Textblock
|
||||||
}
|
}
|
||||||
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
|
efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
|
||||||
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, NULL);
|
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, NULL);
|
||||||
|
|
||||||
if (cy < cly && cy > (cly - lh / 2))
|
if (cy < cly && cy > (cly - lh / 2))
|
||||||
|
@ -1692,7 +1692,7 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Evas_Coord lx, ly, lw, lh;
|
Evas_Coord lx, ly, lw, lh;
|
||||||
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
|
efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
|
||||||
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(cur), &lx, &ly, &lw, &lh);
|
evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(cur), &lx, &ly, &lw, &lh);
|
||||||
efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, ly + (lh / 2)));
|
efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, ly + (lh / 2)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2921,8 +2921,8 @@ _efl_ui_text_efl_access_text_default_attributes_get(const Eo *obj, Efl_Ui_Text_D
|
||||||
start = efl_ui_text_cursor_create(mobj);
|
start = efl_ui_text_cursor_create(mobj);
|
||||||
end = efl_ui_text_cursor_create(mobj);
|
end = efl_ui_text_cursor_create(mobj);
|
||||||
|
|
||||||
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
|
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
|
||||||
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
|
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
|
||||||
|
|
||||||
annotations = efl_text_attribute_factory_range_attributes_get(start, end);
|
annotations = efl_text_attribute_factory_range_attributes_get(start, end);
|
||||||
|
|
||||||
|
@ -3341,8 +3341,8 @@ _anchors_update(Eo *obj, Efl_Ui_Text_Data *sd)
|
||||||
end = efl_canvas_text_cursor_create(sd->text_obj);
|
end = efl_canvas_text_cursor_create(sd->text_obj);
|
||||||
|
|
||||||
/* Retrieve all annotations in the text. */
|
/* Retrieve all annotations in the text. */
|
||||||
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
|
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
|
||||||
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
|
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
|
||||||
|
|
||||||
it = efl_text_attribute_factory_range_attributes_get(start, end);
|
it = efl_text_attribute_factory_range_attributes_get(start, end);
|
||||||
efl_del(start);
|
efl_del(start);
|
||||||
|
|
|
@ -168,12 +168,12 @@ _efl_text_cursor_move(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, Efl_Text_Cu
|
||||||
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
||||||
moved = EINA_TRUE;
|
moved = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST :
|
case EFL_TEXT_CURSOR_MOVE_TYPE_FIRST :
|
||||||
evas_textblock_cursor_paragraph_first(pd->handle);
|
evas_textblock_cursor_paragraph_first(pd->handle);
|
||||||
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
||||||
moved = EINA_TRUE;
|
moved = EINA_TRUE;
|
||||||
break;
|
break;
|
||||||
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST :
|
case EFL_TEXT_CURSOR_MOVE_TYPE_LAST :
|
||||||
evas_textblock_cursor_paragraph_last(pd->handle);
|
evas_textblock_cursor_paragraph_last(pd->handle);
|
||||||
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
if (pos != evas_textblock_cursor_pos_get(pd->handle))
|
||||||
moved = EINA_TRUE;
|
moved = EINA_TRUE;
|
||||||
|
|
|
@ -12,14 +12,14 @@ enum @beta Efl.Text.Cursor_Move_Type
|
||||||
char_prev, [[Advances to the previous character.]]
|
char_prev, [[Advances to the previous character.]]
|
||||||
cluster_next, [[Advances to the next grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
|
cluster_next, [[Advances to the next grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
|
||||||
cluster_prev, [[Advances to the previous grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
|
cluster_prev, [[Advances to the previous grapheme cluster (A character sequence rendered together. See https://unicode.org/reports/tr29/).]]
|
||||||
paragraph_start, [[Advances to the first character in this paragraph.]]
|
paragraph_start, [[Advances to the first character in current paragraph.]]
|
||||||
paragraph_end, [[Advances to the last character in this paragraph.]]
|
paragraph_end, [[Advances to the last character in current paragraph.]]
|
||||||
word_start, [[Advance to current word start.]]
|
word_start, [[Advance to current word start.]]
|
||||||
word_end, [[Advance to current word end.]]
|
word_end, [[Advance to current word end.]]
|
||||||
line_start, [[Advance to current line first character.]]
|
line_start, [[Advance to current line first character.]]
|
||||||
line_end, [[Advance to current line last character.]]
|
line_end, [[Advance to current line last character.]]
|
||||||
paragraph_first, [[Advance to first character in the first paragraph.]]
|
first, [[Advance to first character in the first paragraph.]]
|
||||||
paragraph_last, [[Advance to last character in the last paragraph.]]
|
last, [[Advance to last character in the last paragraph.]]
|
||||||
paragraph_next, [[Advances to the start of the next paragraph.]]
|
paragraph_next, [[Advances to the start of the next paragraph.]]
|
||||||
paragraph_prev [[Advances to the end of the previous paragraph.]]
|
paragraph_prev [[Advances to the end of the previous paragraph.]]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue