my_efl_ui_text_bt_4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Evas_Object *en = data;
- efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en),
+ efl_text_cursor_object_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN),
"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_text_cursor_get(en);
+ main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_MAIN);
cur = efl_text_cursor_new(en);
efl_text_cursor_position_set(en, cur, 2);
legacy: null;
return: ptr(Efl.Text.Cursor.Cursor_Data); [[Text cursor object]]
}
+ keys {
+ get_type: Efl.Text.Cursor.Cursor_Get_Type;
+ }
}
@property cursor_position {
set { legacy: null; }
inherit [[Inherit text type]]
}
+enum Efl.Text.Cursor.Cursor_Get_Type {
+ [[All available cursor states]]
+ legacy: efl_text_cursor_get;
+ default = 0, [[Main cursor state (alias to "main")]]
+ main, [[Main cursor state]]
+ selection_begin, [[Selection begin cursor state]]
+ selection_end, [[Selection end cursor state]]
+ preedit_start, [[Pre-edit start cursor state]]
+ preedit_end, [[Pre-edit end cursor starge]]
+ user, [[User cursor state]]
+ user_extra [[User extra cursor state]]
+}
+
struct Efl.Canvas.Text.Annotation; [[EFL text annotations data structure]]
struct Efl.Text.Cursor.Cursor_Data; [[Text cursor data structure]]
_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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
Ecore_IMF_Event_Selection *ev = event_info;
if (!en->imf_context) return;
- cur = efl_text_cursor_get(obj);
+ cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
ecore_imf_context_focus_in(en->imf_context);
_entry_imf_cursor_info_set(obj, cur, en);
#endif
/* FIXME: Maybe allow selctions to happen even when not editable. */
if (!en->editable) return;
- cur = efl_text_cursor_get(obj);
+ cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
old_cur_pos = evas_textblock_cursor_pos_get(cur);
control = evas_key_modifier_is_set(ev->modifiers, "Control");
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
Evas_Event_Mouse_Up *ev = event_info;
if ((!ev) || (ev->button != 1)) return;
{
Evas_Coord cx, cy;
Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
- Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
Evas_Event_Mouse_Move *ev = event_info;
Evas_Coord x, y, w, h;
Evas_Textblock_Cursor *tc;
{
efl_canvas_text_range_delete(obj, start, end);
}
- cur = efl_text_cursor_get(obj);
+ cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_text_insert(obj, cur, buf);
}
free(buf);
x = y = w = h = 0;
Efl_Canvas_Text_Cursor *main_cur =
- efl_text_cursor_get(obj);
+ efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_geometry_get(obj, main_cur,
EFL_TEXT_CURSOR_TYPE_BEFORE,
evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL);
efl_text_cursor_geometry_get(obj,
- efl_text_cursor_get(obj),
+ efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN),
EFL_TEXT_CURSOR_TYPE_BEFORE,
&cx, &cy, &cw, &ch,
NULL, NULL, NULL, NULL);
/* Get the cursors */
efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
- main_cur = efl_text_cursor_get(text_obj);
+ main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN);
start_pos = efl_text_cursor_position_get(obj, sel_start);
end_pos = efl_text_cursor_position_get(obj, sel_end);
pos = efl_text_cursor_position_get(obj, sd->sel_handler_cursor);
/* Set the main cursor. */
- efl_text_cursor_position_set(obj, efl_text_cursor_get(data), pos);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(data, EFL_TEXT_CURSOR_GET_MAIN), 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_text_cursor_get(text_obj);
+ main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN);
start_pos = efl_text_cursor_position_get(obj, sel_start);
end_pos = efl_text_cursor_position_get(obj, sel_end);
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_text_cursor_position_set(obj, efl_text_cursor_get(data), pos);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(data, EFL_TEXT_CURSOR_GET_MAIN), 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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_text_insert(obj, cur_obj, entry);
sd->changed = EINA_TRUE;
elm_layout_sizing_eval(obj);
EOLIAN static int
_efl_ui_text_elm_interface_atspi_text_caret_offset_get(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED)
{
- return efl_text_cursor_position_get(obj, efl_text_cursor_get(obj));
+ return efl_text_cursor_position_get(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN));
}
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_text_cursor_position_set(obj, efl_text_cursor_get(obj), offset);
+ efl_text_cursor_position_set(obj, efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN), offset);
return EINA_TRUE;
}
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_position_set(obj, cur_obj, position);
_efl_ui_text_entry_insert(obj, pd, string);
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_text_cursor_get(obj);
+ Efl_Canvas_Text_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
efl_text_cursor_position_set(obj, cur_obj, position);
efl_ui_text_selection_paste(obj);
return EINA_TRUE;
xx = yy = ww = hh = -1;
_decoration_calc_offset(sd, &x, &y);
bidi_cursor = efl_text_cursor_geometry_get(obj,
- efl_text_cursor_get(text_obj),
+ efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_MAIN),
EFL_TEXT_CURSOR_TYPE_BEFORE, &xx, &yy, &ww, &hh, &xx2, &yy2,
NULL, NULL);
if (ww < 1) ww = 1;
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_efl_text_cursor_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, Efl_Text_Cursor_Cursor_Get_Type get_type)
{
+ if (get_type > EFL_TEXT_CURSOR_GET_MAIN)
+ {
+ ERR("Unsupported cursor types other than main!");
+ }
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);
+ return efl_text_cursor_get(eo_obj, EFL_TEXT_CURSOR_GET_MAIN);
}
EOLIAN static Efl_Canvas_Text_Cursor *