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:
Ali Alzyod 2019-12-09 10:49:13 +01:00 committed by Xavi Artigas
parent f8d9dfd74b
commit 9c67a71e00
4 changed files with 15 additions and 15 deletions

View File

@ -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);
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
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);
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
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;
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);
/* Consider a threshold of half the line height */
if (cy > (cly + lh) && cy < (cly + lh + lh / 2))
{
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);
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
{
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);
efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, ly + (lh / 2)));
}

View File

@ -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);
end = efl_ui_text_cursor_create(mobj);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
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);
/* Retrieve all annotations in the text. */
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
efl_text_cursor_move(start, EFL_TEXT_CURSOR_MOVE_TYPE_FIRST);
efl_text_cursor_move(end, EFL_TEXT_CURSOR_MOVE_TYPE_LAST);
it = efl_text_attribute_factory_range_attributes_get(start, end);
efl_del(start);

View File

@ -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))
moved = EINA_TRUE;
break;
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST :
case EFL_TEXT_CURSOR_MOVE_TYPE_FIRST :
evas_textblock_cursor_paragraph_first(pd->handle);
if (pos != evas_textblock_cursor_pos_get(pd->handle))
moved = EINA_TRUE;
break;
case EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST :
case EFL_TEXT_CURSOR_MOVE_TYPE_LAST :
evas_textblock_cursor_paragraph_last(pd->handle);
if (pos != evas_textblock_cursor_pos_get(pd->handle))
moved = EINA_TRUE;

View File

@ -12,14 +12,14 @@ enum @beta Efl.Text.Cursor_Move_Type
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_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_end, [[Advances to the last character in this paragraph.]]
paragraph_start, [[Advances to the first character in current paragraph.]]
paragraph_end, [[Advances to the last character in current paragraph.]]
word_start, [[Advance to current word start.]]
word_end, [[Advance to current word end.]]
line_start, [[Advance to current line first character.]]
line_end, [[Advance to current line last character.]]
paragraph_first, [[Advance to first character in the first paragraph.]]
paragraph_last, [[Advance to last character in the last paragraph.]]
first, [[Advance to first character in the first paragraph.]]
last, [[Advance to last character in the last paragraph.]]
paragraph_next, [[Advances to the start of the next paragraph.]]
paragraph_prev [[Advances to the end of the previous paragraph.]]
}