lib/efl/interfaces/efl_text_font.eo \
lib/efl/interfaces/efl_text_style.eo \
lib/efl/interfaces/efl_text_format.eo \
+ lib/efl/interfaces/efl_text_cursor.eo \
lib/efl/interfaces/efl_text_properties.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
lib/efl/interfaces/efl_gfx_view.eo \
{
Efl_Canvas_Text_Cursor *start, *end;
- start = efl_canvas_text_cursor_get(obj);
- end = efl_canvas_text_cursor_get(obj);
+ start = efl_text_cursor_get(obj);
+ end = efl_text_cursor_get(obj);
- efl_canvas_text_cursor_position_set(obj, start, start_pos);
- efl_canvas_text_cursor_position_set(obj, end, end_pos);
+ efl_text_cursor_position_set(obj, start, start_pos);
+ efl_text_cursor_position_set(obj, end, end_pos);
efl_canvas_text_annotation_insert(obj, start, end, style);
}
const char *s = efl_canvas_text_range_text_get(data, sel_start, sel_end);
printf("SELECTION REGION: %d - %d\n",
- efl_canvas_text_cursor_position_get(obj, sel_start),
- efl_canvas_text_cursor_position_get(obj, sel_end));
+ efl_text_cursor_position_get(obj, sel_start),
+ efl_text_cursor_position_get(obj, sel_end));
printf("SELECTION:\n");
if (s) printf("%s\n", s);
}
my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *en = data;
- efl_canvas_text_cursor_object_item_insert(obj, efl_canvas_text_cursor_get(en),
+ efl_canvas_text_cursor_object_item_insert(obj, efl_text_cursor_get(en),
"size=32x32 href=emoticon");
}
efl_text_font_width_set(en, EFL_TEXT_FONT_WIDTH_ULTRACONDENSED);
efl_text_style_normal_color_set(en, 255, 255, 255, 255);
- main_cur = efl_canvas_text_cursor_get(en);
- cur = efl_canvas_text_cursor_new(en);
+ main_cur = efl_text_cursor_get(en);
+ cur = efl_text_cursor_new(en);
- efl_canvas_text_cursor_position_set(en, cur, 2);
+ efl_text_cursor_position_set(en, cur, 2);
efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
- efl_canvas_text_cursor_position_set(en, cur, 50);
+ efl_text_cursor_position_set(en, cur, 50);
efl_canvas_text_cursor_object_item_insert(en, cur, "size=32x32 href=emoticon");
- efl_canvas_text_cursor_position_set(en, main_cur, 5);
- efl_canvas_text_cursor_position_set(en, cur, 20);
+ efl_text_cursor_position_set(en, main_cur, 5);
+ efl_text_cursor_position_set(en, cur, 20);
efl_canvas_text_annotation_insert(en, main_cur, cur, "a href=#hello");
#include "interfaces/efl_text_font.eo.h"
#include "interfaces/efl_text_style.eo.h"
#include "interfaces/efl_text_format.eo.h"
+#include "interfaces/efl_text_cursor.eo.h"
#else
#include "interfaces/efl_text_font.eo.c"
#include "interfaces/efl_text_style.eo.c"
#include "interfaces/efl_text_format.eo.c"
+#include "interfaces/efl_text_cursor.eo.c"
#include "interfaces/efl_gfx.eo.c"
#include "interfaces/efl_gfx_buffer.eo.c"
--- /dev/null
+import eina_types;
+import efl_text_types;
+
+interface Efl.Text.Cursor {
+ [[Cursor API
+
+ @since 1.20
+ ]]
+ methods {
+ // Cursor
+ @property cursor {
+ [[The object's main cursor.
+
+ @since 1.18
+ ]]
+ get {
+ legacy: null;
+ return: ptr(Efl.Text.Cursor.Cursor_Data); [[Text cursor object]]
+ }
+ }
+ @property cursor_position {
+ set { legacy: null; }
+ get { legacy: null; }
+ values {
+ position: int;
+ }
+ keys {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ @property cursor_content {
+ [[The content of the cursor (the character under the cursor)]]
+ get {
+ legacy: null;
+ }
+ values {
+ content: Eina.Unicode; [[The unicode codepoint of the character]]
+ }
+ keys {
+ cur: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ }
+ }
+ @property cursor_geometry {
+ [[Returns the geometry of two cursors ("split cursor"), if logical cursor is
+ between LTR/RTL text, also considering paragraph direction.
+ Upper cursor is shown for the text of the same direction as paragraph,
+ lower cursor - for opposite.
+
+ Split cursor geometry is valid only in '|' cursor mode.
+ In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set.
+ ]]
+ get {
+ legacy: null;
+ return: bool; [[ $true if split cursor, $false otherwise.]]
+ }
+ keys {
+ cur: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ ctype: Efl.Text.Cursor.Cursor_Type; [[The type of the cursor.]]
+ }
+ values {
+ cx: int; [[The x of the cursor (or upper cursor)]]
+ cy: int; [[The y of the cursor (or upper cursor)]]
+ cw: int; [[The width of the cursor (or upper cursor)]]
+ ch: int; [[The height of the cursor (or upper cursor)]]
+ cx2: int; [[The x of the lower cursor]]
+ cy2: int; [[The y of the lower cursor]]
+ cw2: int; [[The width of the lower cursor]]
+ ch2: int; [[The height of the lower cursor]]
+ }
+ }
+ cursor_new {
+ legacy: null;
+ return: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ cursor_free {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_equal {
+ legacy: null;
+ params {
+ cur1: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ cur2: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ }
+ return: bool;
+ }
+ cursor_compare {
+ legacy: null;
+ params {
+ cur1: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ cur2: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ }
+ return: int;
+ }
+ cursor_copy {
+ legacy: null;
+ params {
+ dst: ptr(Efl.Text.Cursor.Cursor_Data);
+ src: ptr(const(Efl.Text.Cursor.Cursor_Data));
+ }
+ }
+ cursor_char_next {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_char_prev {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_char_first {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_char_last {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_word_start {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_word_end {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_line_char_first {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_line_char_last {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_first {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_last {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_next {
+ [[Advances to the start of the next text node]]
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_paragraph_prev {
+ [[Advances to the end of the previous text node]]
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ cursor_line_jump_by {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ by: int;
+ }
+ }
+ cursor_coord_set {
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ @in x: int; [[X coord to set by.]]
+ @in y: int; [[Y coord to set by.]]
+ }
+ }
+ cursor_text_insert {
+ [[Adds text to the current cursor position and set the cursor to
+ *after* the start of the text just added.
+ ]]
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ @in text: string; [[Text to append (UTF-8 format).]]
+ }
+ return: int; [[Length of the appended text.]]
+ }
+ cursor_char_delete {
+ [[Deletes a single character from position pointed by given cursor.]]
+ legacy: null;
+ params {
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
+ }
+ }
+ }
+}
}
struct Efl.Canvas.Text.Annotation; [[EFL text annotations data structure]]
-struct Efl.Canvas.Text.Cursor; [[Text cursor data structure]]
+
+struct Efl.Text.Cursor.Cursor_Data; [[Text cursor data structure]]
+
+enum Efl.Text.Cursor.Cursor_Type
+{
+ [[Text cursor types]]
+ legacy: efl_text_cursor_type;
+ before, [[Cursor type before]]
+ under [[Cursor type under]]
+}
+
{
if (!en || !en->have_preedit) return;
if (!en->preedit_start || !en->preedit_end) return;
- if (efl_canvas_text_cursor_equal(obj, en->preedit_start, en->preedit_end)) return;
+ if (efl_text_cursor_equal(obj, en->preedit_start, en->preedit_end)) return;
/* delete the preedit characters */
evas_textblock_cursor_range_delete(en->preedit_start, en->preedit_end);
_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos)
{
Efl_Canvas_Text *obj = data;
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
const char *str;
if (text)
_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED)
{
Efl_Canvas_Text *obj = data;
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
int cursor_pos;
int preedit_start_pos, preedit_end_pos;
_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
Efl_Canvas_Text *obj = data;
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
Evas_Textblock_Cursor *del_start, *del_end;
_entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
{
Efl_Canvas_Text *obj = data;
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Ecore_IMF_Event_Selection *ev = event_info;
if (ev->start == ev->end)
{
- efl_canvas_text_cursor_position_set(obj, cur, ev->start);
+ efl_text_cursor_position_set(obj, cur, ev->start);
}
else
{
Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0;
if (!en->imf_context) return;
- efl_canvas_text_cursor_geometry_get(obj, cur, EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE, &cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL);
+ efl_text_cursor_geometry_get(obj, cur, EFL_TEXT_CURSOR_TYPE_BEFORE, &cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL);
ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch);
// FIXME: ecore_imf_context_bidi_direction_set(en->imf_context, (Ecore_IMF_BiDi_Direction)dir);
#else
if (!en->imf_context) return;
- cur = efl_canvas_text_cursor_get(obj);
+ cur = efl_text_cursor_get(obj);
ecore_imf_context_focus_in(en->imf_context);
_entry_imf_cursor_info_set(obj, cur, en);
#endif
{
if (!en->sel_end) return;
_sel_enable(c, o, en);
- if (efl_canvas_text_cursor_equal(o, c, en->sel_end)) return;
+ if (efl_text_cursor_equal(o, c, en->sel_end)) return;
evas_textblock_cursor_copy(c, en->sel_end);
{
en->have_selection = EINA_FALSE;
- efl_canvas_text_cursor_copy(o, en->sel_start, en->sel_end);
+ efl_text_cursor_copy(o, en->sel_start, en->sel_end);
}
}
{
Efl_Ui_Text_Interactive_Change_Info info = { NULL, 0, 0, 0, 0 };
Eina_Unicode content[2];
- content[0] = efl_canvas_text_cursor_content_get(obj, c);
+ content[0] = efl_text_cursor_content_get(obj, c);
content[1] = 0;
if (!content[0])
return;
/* FIXME: Maybe allow selctions to happen even when not editable. */
if (!en->editable) return;
- cur = efl_canvas_text_cursor_get(obj);
+ cur = efl_text_cursor_get(obj);
old_cur_pos = evas_textblock_cursor_pos_get(cur);
control = evas_key_modifier_is_set(ev->modifiers, "Control");
{
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
- efl_canvas_text_cursor_line_jump_by(obj, cur, -1);
+ efl_text_cursor_line_jump_by(obj, cur, -1);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_key_down_sel_post(obj, cur, en, shift);
{
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
- efl_canvas_text_cursor_line_jump_by(obj, cur, 1);
+ efl_text_cursor_line_jump_by(obj, cur, 1);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_key_down_sel_post(obj, cur, en, shift);
_compose_seq_reset(en);
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
- efl_canvas_text_cursor_char_prev(obj, cur);
+ efl_text_cursor_char_prev(obj, cur);
#if defined(__APPLE__) && defined(__MACH__)
- if (altgr) efl_canvas_text_cursor_word_start(cur);
+ if (altgr) efl_text_cursor_word_start(cur);
#else
/* If control is pressed, go to the start of the word */
- if (control) efl_canvas_text_cursor_word_start(obj, cur);
+ if (control) efl_text_cursor_word_start(obj, cur);
#endif
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
#if defined(__APPLE__) && defined(__MACH__)
- if (altgr) efl_canvas_text_cursor_word_end(cur);
+ if (altgr) efl_text_cursor_word_end(cur);
#else
/* If control is pressed, go to the end of the word */
- if (control) efl_canvas_text_cursor_word_end(obj, cur);
+ if (control) efl_text_cursor_word_end(obj, cur);
#endif
- efl_canvas_text_cursor_char_next(obj, cur);
+ efl_text_cursor_char_next(obj, cur);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_key_down_sel_post(obj, cur, en, shift);
// del to start of previous word
Evas_Textblock_Cursor *tc = evas_object_textblock_cursor_new(obj);
- efl_canvas_text_cursor_copy(obj, tc, cur);
+ efl_text_cursor_copy(obj, tc, cur);
evas_textblock_cursor_char_prev(cur);
evas_textblock_cursor_word_start(cur);
_range_del_emit(obj, cur, tc);
//efl_del(tc);
- efl_canvas_text_cursor_free(obj, tc);
+ efl_text_cursor_free(obj, tc);
}
else if ((alt) && (shift))
{
// del to end of next word
Evas_Textblock_Cursor *tc = evas_object_textblock_cursor_new(obj);
- efl_canvas_text_cursor_copy(obj, tc, cur);
+ efl_text_cursor_copy(obj, tc, cur);
evas_textblock_cursor_word_end(cur);
evas_textblock_cursor_char_next(cur);
_range_del_emit(obj, cur, tc);
//efl_del(tc);
- efl_canvas_text_cursor_free(obj, tc);
+ efl_text_cursor_free(obj, tc);
}
else if (shift)
{
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
if ((control) && (multiline))
- efl_canvas_text_cursor_paragraph_first(obj, cur);
+ efl_text_cursor_paragraph_first(obj, cur);
else
- efl_canvas_text_cursor_line_char_first(obj, cur);
+ efl_text_cursor_line_char_first(obj, cur);
_key_down_sel_post(obj, cur, en, shift);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
if ((control) && (multiline))
- efl_canvas_text_cursor_paragraph_last(obj, cur);
+ efl_text_cursor_paragraph_last(obj, cur);
else
- efl_canvas_text_cursor_line_char_last(obj, cur);
+ efl_text_cursor_line_char_last(obj, cur);
_key_down_sel_post(obj, cur, en, shift);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_compose_seq_reset(en);
_key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
- efl_canvas_text_cursor_line_jump_by(obj, cur, -10);
+ efl_text_cursor_line_jump_by(obj, cur, -10);
_key_down_sel_post(obj, cur, en, shift);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
_compose_seq_reset(en);
_key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
- efl_canvas_text_cursor_line_jump_by(obj, cur, 10);
+ efl_text_cursor_line_jump_by(obj, cur, 10);
_key_down_sel_post(obj, cur, en, shift);
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
}
info.insert = EINA_TRUE;
info.content = string;
- info.position = efl_canvas_text_cursor_position_get(obj, cur);
+ info.position = efl_text_cursor_position_get(obj, cur);
info.length = eina_unicode_utf8_get_len(string);
- efl_canvas_text_cursor_text_insert(obj, cur, string);
+ efl_text_cursor_text_insert(obj, cur, string);
efl_event_callback_legacy_call(obj,
EFL_UI_TEXT_INTERACTIVE_EVENT_CHANGED_USER, &info);
Evas_Coord cx, cy;
Evas_Event_Mouse_Down *ev = event_info;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Evas_Textblock_Cursor *tc = NULL;
Eina_Bool dosel = EINA_FALSE;
Eina_Bool shift;
{
Evas_Coord cx, cy;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Evas_Event_Mouse_Up *ev = event_info;
if ((!ev) || (ev->button != 1)) return;
if (en->select_allow)
{
- efl_canvas_text_cursor_copy(obj, en->sel_end, cur);
+ efl_text_cursor_copy(obj, en->sel_end, cur);
}
if (en->selecting)
{
{
Evas_Coord cx, cy;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
- Efl_Canvas_Text_Cursor *cur = efl_canvas_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord x, y, w, h;
Evas_Textblock_Cursor *tc;
if (multiline)
{
- efl_canvas_text_cursor_coord_set(obj, cur, cx, cy);
+ efl_text_cursor_coord_set(obj, cur, cx, cy);
}
else
{
Evas_Coord lx, ly, lw, lh;
evas_textblock_cursor_paragraph_first(cur);
evas_textblock_cursor_line_geometry_get(cur, &lx, &ly, &lw, &lh);
- efl_canvas_text_cursor_coord_set(obj, cur, cx, ly + (lh / 2));
+ efl_text_cursor_coord_set(obj, cur, cx, ly + (lh / 2));
}
if (en->select_allow)
{
_sel_extend(cur, obj, en);
- if (!efl_canvas_text_cursor_equal(obj, en->sel_start, en->sel_end))
+ if (!efl_text_cursor_equal(obj, en->sel_start, en->sel_end))
_sel_enable(cur, obj, en);
}
evas_textblock_cursor_free(tc);
evas_object_geometry_get(sd->entry_edje, &ent_x, &ent_y, NULL, NULL);
- efl_canvas_text_cursor_geometry_get(obj, sel_start,
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE,
+ efl_text_cursor_geometry_get(obj, sel_start,
+ EFL_TEXT_CURSOR_TYPE_BEFORE,
&sx, &sy, NULL, &sh,
NULL, NULL, NULL, NULL);
hx = ent_x + sx;
sd->start_handler_shown = EINA_FALSE;
}
- efl_canvas_text_cursor_geometry_get(obj, sel_end,
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE,
+ efl_text_cursor_geometry_get(obj, sel_end,
+ EFL_TEXT_CURSOR_TYPE_BEFORE,
&ex, &ey, NULL, &eh,
NULL, NULL, NULL, NULL);
hx = ent_x + ex;
{
Efl_Canvas_Text_Cursor *cur, *start, *end;
efl_ui_text_interactive_selection_cursors_get(obj, &start, &end);
- if (!efl_canvas_text_cursor_equal(obj, start, end))
+ if (!efl_text_cursor_equal(obj, start, end))
{
efl_canvas_text_range_delete(obj, start, end);
}
- cur = efl_canvas_text_cursor_get(obj);
- efl_canvas_text_cursor_text_insert(obj, cur, buf);
+ cur = efl_text_cursor_get(obj);
+ efl_text_cursor_text_insert(obj, cur, buf);
}
free(buf);
(sd->entry_edje, "elm.text", EINA_FALSE);
elm_object_text_set(obj, t);
+ efl_text_set(obj, t);
eina_stringshare_del(t);
if (elm_widget_disabled_get(obj))
x = y = w = h = 0;
Efl_Canvas_Text_Cursor *main_cur =
- efl_canvas_text_cursor_get(obj);
+ efl_text_cursor_get(obj);
- efl_canvas_text_cursor_geometry_get(obj, main_cur,
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE,
+ efl_text_cursor_geometry_get(obj, main_cur,
+ EFL_TEXT_CURSOR_TYPE_BEFORE,
&cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL);
edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0);
if (cw < 1) cw = 1;
EFL_UI_TEXT_DATA_GET(obj, sd);
evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL);
- efl_canvas_text_cursor_geometry_get(obj,
- efl_canvas_text_cursor_get(obj),
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE,
+ efl_text_cursor_geometry_get(obj,
+ efl_text_cursor_get(obj),
+ EFL_TEXT_CURSOR_TYPE_BEFORE,
&cx, &cy, &cw, &ch,
NULL, NULL, NULL, NULL);
edje_object_size_min_calc(handler, NULL, &hh);
/* Get the cursors */
efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
- main_cur = efl_canvas_text_cursor_get(text_obj);
+ main_cur = efl_text_cursor_get(text_obj);
- start_pos = efl_canvas_text_cursor_position_get(obj, sel_start);
- end_pos = efl_canvas_text_cursor_position_get(obj, sel_end);
+ start_pos = efl_text_cursor_position_get(obj, sel_start);
+ end_pos = efl_text_cursor_position_get(obj, sel_end);
if (start_pos <= end_pos)
{
pos = end_pos;
sd->sel_handler_cursor = sel_end;
}
- efl_canvas_text_cursor_position_set(obj, main_cur, pos);
+ efl_text_cursor_position_set(obj, main_cur, pos);
_selection_handlers_offset_calc(data, sd->start_handler, ev->canvas.x, ev->canvas.y);
}
cy = ev->cur.canvas.y - sd->oy - ey;
if (cx <= 0) cx = 1;
- efl_canvas_text_cursor_coord_set(obj, sd->sel_handler_cursor, cx, cy);
- pos = efl_canvas_text_cursor_position_get(obj, sd->sel_handler_cursor);
+ efl_text_cursor_coord_set(obj, sd->sel_handler_cursor, cx, cy);
+ pos = efl_text_cursor_position_get(obj, sd->sel_handler_cursor);
/* Set the main cursor. */
- efl_canvas_text_cursor_position_set(obj, efl_canvas_text_cursor_get(data), pos);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(data), pos);
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
sd->long_pressed = EINA_FALSE;
Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
- main_cur = efl_canvas_text_cursor_get(text_obj);
+ main_cur = efl_text_cursor_get(text_obj);
- start_pos = efl_canvas_text_cursor_position_get(obj, sel_start);
- end_pos = efl_canvas_text_cursor_position_get(obj, sel_end);
+ start_pos = efl_text_cursor_position_get(obj, sel_start);
+ end_pos = efl_text_cursor_position_get(obj, sel_end);
if (start_pos < end_pos)
{
sd->sel_handler_cursor = sel_start;
}
- efl_canvas_text_cursor_position_set(obj, main_cur, pos);
+ efl_text_cursor_position_set(obj, main_cur, pos);
_selection_handlers_offset_calc(data, sd->end_handler, ev->canvas.x, ev->canvas.y);
}
cy = ev->cur.canvas.y - sd->oy - ey;
if (cx <= 0) cx = 1;
- efl_canvas_text_cursor_coord_set(obj, sd->sel_handler_cursor, cx, cy);
- pos = efl_canvas_text_cursor_position_get(obj, sd->sel_handler_cursor);
+ efl_text_cursor_coord_set(obj, sd->sel_handler_cursor, cx, cy);
+ pos = efl_text_cursor_position_get(obj, sd->sel_handler_cursor);
/* Set the main cursor. */
- efl_canvas_text_cursor_position_set(obj, efl_canvas_text_cursor_get(data), pos);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(data), pos);
ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del);
sd->long_pressed = EINA_FALSE;
if (_elm_config->magnifier_enable)
static void
_efl_ui_text_entry_insert(Eo *obj, Efl_Ui_Text_Data *sd, const char *entry)
{
- Efl_Canvas_Text_Cursor *cur_obj = efl_canvas_text_cursor_get(obj);
- efl_canvas_text_cursor_text_insert(obj, cur_obj, entry);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj);
+ efl_text_cursor_text_insert(obj, cur_obj, entry);
sd->changed = EINA_TRUE;
elm_layout_sizing_eval(obj);
}
efl_ui_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
- efl_canvas_text_cursor_position_set(obj, sel_start, start);
- efl_canvas_text_cursor_position_set(obj, sel_end, end);
+ efl_text_cursor_position_set(obj, sel_start, start);
+ efl_text_cursor_position_set(obj, sel_end, end);
}
EOLIAN static void
EOLIAN static int
_efl_ui_text_elm_interface_atspi_text_caret_offset_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
- return efl_canvas_text_cursor_position_get(obj, efl_canvas_text_cursor_get(obj));
+ return efl_text_cursor_position_get(obj, efl_text_cursor_get(obj));
}
EOLIAN static Eina_Bool
_efl_ui_text_elm_interface_atspi_text_caret_offset_set(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int offset)
{
- efl_canvas_text_cursor_position_set(obj, efl_canvas_text_cursor_get(obj), offset);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(obj), offset);
return EINA_TRUE;
}
Efl_Canvas_Text_Annotation *an;
/* Retrieve all annotations in the text. */
- start = efl_canvas_text_cursor_new(obj);
- end = efl_canvas_text_cursor_new(obj);
+ start = efl_text_cursor_new(obj);
+ end = efl_text_cursor_new(obj);
- efl_canvas_text_cursor_paragraph_first(obj, start);
- efl_canvas_text_cursor_paragraph_last(obj, end);
+ efl_text_cursor_paragraph_first(obj, start);
+ efl_text_cursor_paragraph_last(obj, end);
annotations = efl_canvas_text_range_annotations_get(obj, start, end);
EOLIAN static Eina_Bool
_efl_ui_text_elm_interface_atspi_text_editable_insert(Eo *obj, Efl_Ui_Text_Data *pd, const char *string, int position)
{
- Efl_Canvas_Text_Cursor *cur_obj = efl_canvas_text_cursor_get(obj);
- efl_canvas_text_cursor_position_set(obj, cur_obj, position);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj);
+ efl_text_cursor_position_set(obj, cur_obj, position);
_efl_ui_text_entry_insert(obj, pd, string);
return EINA_TRUE;
EOLIAN static Eina_Bool
_efl_ui_text_elm_interface_atspi_text_editable_paste(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, int position)
{
- Efl_Canvas_Text_Cursor *cur_obj = efl_canvas_text_cursor_get(obj);
- efl_canvas_text_cursor_position_set(obj, cur_obj, position);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj);
+ efl_text_cursor_position_set(obj, cur_obj, position);
efl_ui_text_selection_paste(obj);
return EINA_TRUE;
}
_efl_ui_text_cursor_new(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd EINA_UNUSED)
{
Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
- return efl_canvas_text_cursor_new(text_obj);
+ return efl_text_cursor_new(text_obj);
}
static void
x = y = w = h = -1;
xx = yy = ww = hh = -1;
_decoration_calc_offset(sd, &x, &y);
- bidi_cursor = efl_canvas_text_cursor_geometry_get(obj,
- efl_canvas_text_cursor_get(text_obj),
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE, &xx, &yy, &ww, &hh, &xx2, &yy2,
+ bidi_cursor = efl_text_cursor_geometry_get(obj,
+ efl_text_cursor_get(text_obj),
+ EFL_TEXT_CURSOR_TYPE_BEFORE, &xx, &yy, &ww, &hh, &xx2, &yy2,
NULL, NULL);
if (ww < 1) ww = 1;
if (hh < 1) hh = 1;
Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
_anchors_clear_all(obj, sd);
- start = efl_canvas_text_cursor_new(text_obj);
- end = efl_canvas_text_cursor_new(text_obj);
+ start = efl_text_cursor_new(text_obj);
+ end = efl_text_cursor_new(text_obj);
/* Retrieve all annotations in the text. */
- efl_canvas_text_cursor_paragraph_first(obj, start);
- efl_canvas_text_cursor_paragraph_last(obj, end);
+ efl_text_cursor_paragraph_first(obj, start);
+ efl_text_cursor_paragraph_last(obj, end);
it = efl_canvas_text_range_annotations_get(obj, start, end);
- efl_canvas_text_cursor_free(text_obj, start);
- efl_canvas_text_cursor_free(text_obj, end);
+ efl_text_cursor_free(text_obj, start);
+ efl_text_cursor_free(text_obj, end);
EINA_ITERATOR_FOREACH(it, anchor)
{
Eina_List *range_list;
Eina_Rectangle *r;
- start = efl_canvas_text_cursor_new(o);
- end = efl_canvas_text_cursor_new(o);
+ start = efl_text_cursor_new(o);
+ end = efl_text_cursor_new(o);
efl_canvas_text_annotation_positions_get(o, an->annotation,
start, end);
}
cursor_new {
[[Creates and returns a new cursor for the text.]]
- return: ptr(Efl.Canvas.Text.Cursor); [[Text cursor]]
+ return: ptr(Efl.Text.Cursor.Cursor_Data); [[Text cursor]]
}
}
implements {
]]
get {}
values {
- start: ptr(Efl.Canvas.Text.Cursor); [[The start of the selection]]
- end: ptr(Efl.Canvas.Text.Cursor); [[The end of the selection]]
+ start: ptr(Efl.Text.Cursor.Cursor_Data); [[The start of the selection]]
+ end: ptr(Efl.Text.Cursor.Cursor_Data); [[The end of the selection]]
}
}
@property editable {
-struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
+import efl_text_types;
-enum Efl.Canvas.Text.Cursor.Type
-{
- [[Text cursor types]]
- before, [[Cursor type before]]
- under [[Cursor type under]]
-}
+struct Efl.Canvas.Text.Style; [[EFL text style data structure]]
class Efl.Canvas.Text (Efl.Canvas.Object, Efl.Text, Efl.Text.Properties, Efl.Canvas.Filter.Internal,
-Efl.Text.Font, Efl.Text.Style, Efl.Text.Format)
+Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor)
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
]]
return: bool; [[$true on success, $false otherwise]]
params {
- @in start: ptr(Efl.Canvas.Text.Cursor); [[Range start position]]
- @in end: ptr(Efl.Canvas.Text.Cursor); [[Range end position]]
+ @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Range start position]]
+ @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[Range end position]]
}
}
@property style_insets {
legacy: null;
return: own(ptr(char)); [[The text in the given range]]
params {
- @in cur1: const(ptr(Efl.Canvas.Text.Cursor)); [[Start of range]]
- @in cur2: const(ptr(Efl.Canvas.Text.Cursor)); [[End of range]]
+ @in cur1: const(ptr(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
+ @in cur2: const(ptr(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
}
}
range_geometry_get {
]]
legacy: null;
params {
- @in cur1: const(ptr(Efl.Canvas.Text.Cursor)); [[Start of range]]
- @in cur2: const(ptr(Efl.Canvas.Text.Cursor)); [[End of range]]
+ @in cur1: const(ptr(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
+ @in cur2: const(ptr(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
}
return: free(own(iterator<Eina.Rectangle>),
eina_iterator_free); [[Iterator on all geoemtries of
]]
legacy: null;
params {
- @in cur1: ptr(const(Efl.Canvas.Text.Cursor)); [[Start of range]]
- @in cur2: ptr(const(Efl.Canvas.Text.Cursor)); [[End of range]]
+ @in cur1: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
+ @in cur2: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
}
return: free(own(iterator<Eina.Rectangle>),
eina_iterator_free); [[Iterator on all simple
]]
legacy: null;
params {
- @in cur1: ptr(Efl.Canvas.Text.Cursor); [[Range start position]]
- @in cur2: ptr(Efl.Canvas.Text.Cursor); [[Range end position]]
+ @in cur1: ptr(Efl.Text.Cursor.Cursor_Data); [[Range start position]]
+ @in cur2: ptr(Efl.Text.Cursor.Cursor_Data); [[Range end position]]
}
}
// Obstacles
]]
legacy: null;
params {
- @in start: ptr(const(Efl.Canvas.Text.Cursor)); [[Start of range]]
- @in end: ptr(const(Efl.Canvas.Text.Cursor)); [[End of range]]
+ @in start: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[Start of range]]
+ @in end: ptr(const(Efl.Text.Cursor.Cursor_Data)); [[End of range]]
}
return: free(own(iterator<ptr(Efl.Canvas.Text.Annotation)>),
eina_iterator_free); [[Handle of the Annotation]]
]]
legacy: null;
params {
- @in start: ptr(Efl.Canvas.Text.Cursor); [[Start of range]]
- @in end: ptr(Efl.Canvas.Text.Cursor); [[End of range]]
+ @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Start of range]]
+ @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[End of range]]
@in format: string; [[Annotation format]]
}
return: ptr(Efl.Canvas.Text.Annotation); [[Handle of inserted annotation]]
params {
@in annotation: ptr(const(Efl.Canvas.Text.Annotation)); [[Annotation
handle to query]]
- @in start: ptr(Efl.Canvas.Text.Cursor); [[Cursor to be set to the start
+ @in start: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the start
position of the annotation in the text]]
- @in end: ptr(Efl.Canvas.Text.Cursor); [[Cursor to be set to the end
+ @in end: ptr(Efl.Text.Cursor.Cursor_Data); [[Cursor to be set to the end
position of the annotation in the text]]
}
}
// Cursor
- @property cursor {
- [[The object's main cursor.
-
- @since 1.18
- ]]
- get {
- return: ptr(Efl.Canvas.Text.Cursor); [[Text cursor object]]
- }
- }
- @property cursor_position {
- set { legacy: null; }
- get { legacy: null; }
- values {
- position: int;
- }
- keys {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- @property cursor_content {
- [[The content of the cursor (the character under the cursor)]]
- get {
- legacy: null;
- }
- values {
- content: Eina.Unicode; [[The unicode codepoint of the character]]
- }
- keys {
- cur: ptr(const(Efl.Canvas.Text.Cursor));
- }
- }
- @property cursor_geometry {
- [[Returns the geometry of two cursors ("split cursor"), if logical cursor is
- between LTR/RTL text, also considering paragraph direction.
- Upper cursor is shown for the text of the same direction as paragraph,
- lower cursor - for opposite.
-
- Split cursor geometry is valid only in '|' cursor mode.
- In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set.
- ]]
- get {
- legacy: null;
- return: bool; [[ $true if split cursor, $false otherwise.]]
- }
- keys {
- cur: ptr(const(Efl.Canvas.Text.Cursor));
- ctype: Efl.Canvas.Text.Cursor.Type; [[The type of the cursor.]]
- }
- values {
- cx: int; [[The x of the cursor (or upper cursor)]]
- cy: int; [[The y of the cursor (or upper cursor)]]
- cw: int; [[The width of the cursor (or upper cursor)]]
- ch: int; [[The height of the cursor (or upper cursor)]]
- cx2: int; [[The x of the lower cursor]]
- cy2: int; [[The y of the lower cursor]]
- cw2: int; [[The width of the lower cursor]]
- ch2: int; [[The height of the lower cursor]]
- }
- }
@property cursor_object_item_annotation {
[[The object-item annotation at the cursor's position.]]
get {
annotation: ptr(Efl.Canvas.Text.Annotation); [[Annotation]]
}
keys {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_new {
- legacy: null;
- return: ptr(Efl.Canvas.Text.Cursor);
- }
- cursor_free {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_equal {
- legacy: null;
- params {
- cur1: ptr(const(Efl.Canvas.Text.Cursor));
- cur2: ptr(const(Efl.Canvas.Text.Cursor));
- }
- return: bool;
- }
- cursor_compare {
- legacy: null;
- params {
- cur1: ptr(const(Efl.Canvas.Text.Cursor));
- cur2: ptr(const(Efl.Canvas.Text.Cursor));
- }
- return: int;
- }
- cursor_copy {
- legacy: null;
- params {
- dst: ptr(Efl.Canvas.Text.Cursor);
- src: ptr(const(Efl.Canvas.Text.Cursor));
- }
- }
- cursor_char_next {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_char_prev {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_char_first {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_char_last {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_word_start {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_word_end {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_line_char_first {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_line_char_last {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_first {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_last {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_next {
- [[Advances to the start of the next text node]]
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_paragraph_prev {
- [[Advances to the end of the previous text node]]
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- }
- }
- cursor_line_jump_by {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- by: int;
- }
- }
- cursor_coord_set {
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- @in x: int; [[X coord to set by.]]
- @in y: int; [[Y coord to set by.]]
- }
- }
- cursor_text_insert {
- [[Adds text to the current cursor position and set the cursor to
- *after* the start of the text just added.
- ]]
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
- @in text: string; [[Text to append (UTF-8 format).]]
- }
- return: int; [[Length of the appended text.]]
- }
- cursor_char_delete {
- [[Deletes a single character from position pointed by given cursor.]]
- legacy: null;
- params {
- cur: ptr(Efl.Canvas.Text.Cursor);
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
}
}
cursor_object_item_insert {
]]
legacy: null;
params {
- cur: ptr(Efl.Canvas.Text.Cursor);
+ cur: ptr(Efl.Text.Cursor.Cursor_Data);
@in format: string; [[Format of the inserted item.
See Format styles.]]
}
Efl.Text.Format.format_tabstops { get; set; }
Efl.Text.Format.format_password { get; set; }
Efl.Text.Format.format_replacement_char { get; set; }
+ Efl.Text.Cursor.cursor { get; }
+ Efl.Text.Cursor.cursor_position { set; get; }
+ Efl.Text.Cursor.cursor_content { get; }
+ Efl.Text.Cursor.cursor_geometry { get; }
+ Efl.Text.Cursor.cursor_new;
+ Efl.Text.Cursor.cursor_free;
+ Efl.Text.Cursor.cursor_equal;
+ Efl.Text.Cursor.cursor_compare;
+ Efl.Text.Cursor.cursor_copy;
+ Efl.Text.Cursor.cursor_char_next;
+ Efl.Text.Cursor.cursor_char_prev;
+ Efl.Text.Cursor.cursor_paragraph_char_first;
+ Efl.Text.Cursor.cursor_paragraph_char_last;
+ Efl.Text.Cursor.cursor_word_start;
+ Efl.Text.Cursor.cursor_word_end;
+ Efl.Text.Cursor.cursor_line_char_first;
+ Efl.Text.Cursor.cursor_line_char_last;
+ Efl.Text.Cursor.cursor_paragraph_first;
+ Efl.Text.Cursor.cursor_paragraph_last;
+ Efl.Text.Cursor.cursor_paragraph_next;
+ Efl.Text.Cursor.cursor_paragraph_prev;
+ Efl.Text.Cursor.cursor_line_jump_by;
+ Efl.Text.Cursor.cursor_coord_set;
+ Efl.Text.Cursor.cursor_text_insert;
+ Efl.Text.Cursor.cursor_char_delete;
}
events {
cursor,changed;
Eina_Bool delete_me : 1;
};
-struct _Efl_Canvas_Text_Cursor
+struct _Efl_Text_Cursor_Cursor_Data
{
Evas_Object *obj;
size_t pos;
Eina_Bool changed : 1;
};
-//typedef struct _Efl_Canvas_Text_Cursor Efl_Canvas_Text_Cursor_Data;
-typedef struct _Efl_Canvas_Text_Cursor Efl_Canvas_Text_Cursor_Data;
+typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Canvas_Text_Cursor;
+typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Canvas_Text_Cursor_Data;
+typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Text_Cursor_Data;
struct _Efl_Canvas_Text_Annotation
{
evas_object_textblock_cursor_new(Eo *eo_obj)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(eo_obj, NULL);
- return efl_canvas_text_cursor_new(eo_obj);
+ return efl_text_cursor_new(eo_obj);
}
EAPI void
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_paragraph_first(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_paragraph_last(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_next(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Evas_Textblock_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_next(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Evas_Textblock_Cursor *cur)
{
evas_textblock_cursor_paragraph_next(cur);
efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_prev(Eo *obj EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_prev(Eo *obj EINA_UNUSED,
Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
_evas_textblock_cursor_paragraph_prev(cur);
}
EOLIAN static void
-_efl_canvas_text_cursor_word_start(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED)
+_efl_canvas_text_efl_text_cursor_cursor_word_start(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED)
{
evas_textblock_cursor_word_start(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_word_end(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED)
+_efl_canvas_text_efl_text_cursor_cursor_word_end(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED)
{
evas_textblock_cursor_word_end(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_char_next(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_char_next(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_char_next(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_char_prev(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_char_prev(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
_evas_textblock_cursor_char_prev(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_paragraph_char_first(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_paragraph_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_paragraph_char_last(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_line_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_line_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_line_char_last(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_line_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_line_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_line_char_first(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static int
-_efl_canvas_text_cursor_position_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_position_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
Evas_Object_Textblock_Node_Text *n;
size_t npos = 0;
evas_textblock_cursor_pos_get(const Efl_Canvas_Text_Cursor *cur)
{
if (!cur) return -1;
- return efl_canvas_text_cursor_position_get(cur->obj,
+ return efl_text_cursor_position_get(cur->obj,
(Efl_Canvas_Text_Cursor *) cur);
}
}
EOLIAN static void
-_efl_canvas_text_cursor_position_set(Eo *cur_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur, int _pos)
+_efl_canvas_text_efl_text_cursor_cursor_position_set(Eo *cur_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur, int _pos)
{
evas_textblock_cursor_pos_set(cur, _pos);
efl_event_callback_legacy_call(cur_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static void
-_efl_canvas_text_cursor_line_jump_by(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED, int by)
+_efl_canvas_text_efl_text_cursor_cursor_line_jump_by(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED, int by)
{
int ln;
}
EOLIAN static int
-_efl_canvas_text_cursor_compare(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_compare(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
const Efl_Canvas_Text_Cursor *cur1, const Efl_Canvas_Text_Cursor *cur2)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur1->obj, EFL_CANVAS_OBJECT_CLASS);
}
EOLIAN static Eina_Bool
-_efl_canvas_text_cursor_equal(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Canvas_Text_Cursor *cur, const Efl_Canvas_Text_Cursor *cur2)
+_efl_canvas_text_efl_text_cursor_cursor_equal(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Canvas_Text_Cursor *cur, const Efl_Canvas_Text_Cursor *cur2)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
evas_object_async_block(obj);
evas_textblock_cursor_copy(const Evas_Textblock_Cursor *cur_src, Efl_Canvas_Text_Cursor *cur_dest)
{
if (!cur_src || !cur_dest) return;
- efl_canvas_text_cursor_copy(cur_src->obj, cur_dest, cur_src);
+ efl_text_cursor_copy(cur_src->obj, cur_dest, cur_src);
}
static void
}
static EOLIAN void
-_efl_canvas_text_cursor_copy(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_copy(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Canvas_Text_Cursor *dst, const Efl_Canvas_Text_Cursor *src)
{
- if (!efl_canvas_text_cursor_equal(obj, dst, src))
+ if (!efl_text_cursor_equal(obj, dst, src))
{
_evas_textblock_cursor_copy(dst, src);
efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static int
-_efl_canvas_text_cursor_text_insert(Eo *eo_obj,
+_efl_canvas_text_efl_text_cursor_cursor_text_insert(Eo *eo_obj,
Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Canvas_Text_Cursor *cur, const char *_text)
{
}
EOLIAN static void
-_efl_canvas_text_cursor_char_delete(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
+_efl_canvas_text_efl_text_cursor_cursor_char_delete(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_char_delete(cur);
efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
}
EOLIAN static Eina_Unicode
-_efl_canvas_text_cursor_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED,
const Efl_Canvas_Text_Cursor *cur)
{
return eina_ustrbuf_string_get(cur->node->unicode)[cur->pos];
Eina_Unicode buf[2];
char *s;
- buf[0] = efl_canvas_text_cursor_content_get(cur->obj, cur);
+ buf[0] = efl_text_cursor_content_get(cur->obj, cur);
buf[1] = 0;
s = eina_unicode_unicode_to_utf8(buf, NULL);
evas_textblock_cursor_geometry_bidi_get(const Efl_Canvas_Text_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2, Evas_Textblock_Cursor_Type ctype)
{
if (!cur) return EINA_FALSE;
- return efl_canvas_text_cursor_geometry_get(cur->obj, cur,
+ return efl_text_cursor_geometry_get(cur->obj, cur,
(ctype == EVAS_TEXTBLOCK_CURSOR_BEFORE) ?
- EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE : EFL_CANVAS_TEXT_CURSOR_TYPE_UNDER,
+ EFL_TEXT_CURSOR_TYPE_BEFORE : EFL_TEXT_CURSOR_TYPE_UNDER,
cx, cy, cw, ch, cx2, cy2, cw2, ch2);
}
EOLIAN static Eina_Bool
-_efl_canvas_text_cursor_geometry_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Canvas_Text_Cursor *cur, Efl_Canvas_Text_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2)
+_efl_canvas_text_efl_text_cursor_cursor_geometry_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Canvas_Text_Cursor *cur, Efl_Text_Cursor_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2)
{
if (!cur) return EINA_FALSE;
Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
_relayout_if_needed(cur->obj, o);
- if (ctype == EFL_CANVAS_TEXT_CURSOR_TYPE_UNDER)
+ if (ctype == EFL_TEXT_CURSOR_TYPE_UNDER)
{
evas_textblock_cursor_pen_geometry_get(cur, cx, cy, cw, ch);
return EINA_FALSE;
(void) ch2;
#endif
evas_textblock_cursor_geometry_get(cur, cx, cy, cw, ch, NULL,
- (ctype == EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE) ?
+ (ctype == EFL_TEXT_CURSOR_TYPE_BEFORE) ?
EVAS_TEXTBLOCK_CURSOR_BEFORE : EVAS_TEXTBLOCK_CURSOR_UNDER);
return EINA_FALSE;
}
}
EOLIAN static void
-_efl_canvas_text_cursor_coord_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_coord_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Canvas_Text_Cursor *cur EINA_UNUSED,
Evas_Coord x, Evas_Coord y)
{
evas_textblock_cursor_char_coord_set(cur, x, y);
const char *text)
{
evas_object_textblock_text_markup_set(eo_obj, "");
- efl_canvas_text_cursor_text_insert(eo_obj, o->cursor, text);
+ efl_text_cursor_text_insert(eo_obj, o->cursor, text);
printf("canvas_text: eo_obj=%p\n", eo_obj);
efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
}
EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _efl_canvas_text_efl_object_dbg_info_get)
EOLIAN static Efl_Canvas_Text_Cursor *
-_efl_canvas_text_cursor_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_cursor_cursor_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
return o->cursor;
}
+EAPI Efl_Canvas_Text_Cursor *
+evas_object_textblock_cursor_get(Eo *eo_obj EINA_UNUSED)
+{
+ return efl_text_cursor_get(eo_obj);
+}
+
EOLIAN static Efl_Canvas_Text_Cursor *
-_efl_canvas_text_cursor_new(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
+_efl_canvas_text_efl_text_cursor_cursor_new(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
{
Efl_Canvas_Text_Cursor *cur;
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
}
EOLIAN static void
-_efl_canvas_text_cursor_free(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
+_efl_canvas_text_efl_text_cursor_cursor_free(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Canvas_Text_Cursor *cur)
{
evas_textblock_cursor_free(cur);
}
#include "canvas/efl_canvas_text.eo.c"
+#include "efl/interfaces/efl_text_cursor.eo.c"
* @see evas_object_textblock_cursor_new
*
*/
-typedef struct _Efl_Canvas_Text_Cursor Evas_Textblock_Cursor;
+typedef struct _Efl_Text_Cursor_Cursor_Data Evas_Textblock_Cursor;
+typedef struct _Efl_Text_Cursor_Cursor_Data Efl_Canvas_Text_Cursor;
/**
* @typedef Evas_Object_Textblock_Node_Format
EAPI void evas_textblock_cursor_paragraph_char_last(Efl_Canvas_Text_Cursor *cur);
EAPI void evas_textblock_cursor_char_delete(Efl_Canvas_Text_Cursor *cur);
+
+EAPI Efl_Canvas_Text_Cursor *evas_object_textblock_cursor_get(Evas_Object *obj);
//#include "canvas/efl_canvas_text_cursor.eo.legacy.h"
#include "canvas/efl_canvas_text.eo.legacy.h"
/**