diff options
author | Daniel Hirt <daniel.hirt@samsung.com> | 2016-06-09 15:21:19 +0000 |
---|---|---|
committer | Daniel Hirt <daniel.hirt@samsung.com> | 2016-06-09 15:21:37 +0000 |
commit | 8a805f85daaa877d7d7dcb696e6eba4f061656a7 (patch) | |
tree | 7f92af98521602f6402b306864834b4d55dfe40c | |
parent | 677e09d66fe2b895ddc5cb215cf4de4078bdd9f7 (diff) | |
download | efl-8a805f85daaa877d7d7dcb696e6eba4f061656a7.tar.gz |
Efl.Ui.Text: fixup build (hopefully)
-rw-r--r-- | src/lib/edje/edje_entry.c | 2 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_text.c | 60 | ||||
-rw-r--r-- | src/lib/elementary/efl_ui_text.h | 2 |
3 files changed, 63 insertions, 1 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 811af394a9..570141fb25 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2842,7 +2842,7 @@ _edje_entry_real_part_configure(Edje *ed, Edje_Real_Part *rp) x = y = w = h = -1; xx = yy = ww = hh = -1; evas_object_geometry_get(rp->object, &x, &y, &w, &h); - bidi_cursor = evas_textblock_cursor_geometry_bidi_get(en->cursor, &xx, &yy, &ww, &hh, &xx2, &yy2, NULL, NULL, cur_type); + bidi_cursor = efl_canvas_text_cursor_geometry_get(en->cursor, cur_type, &xx, &yy, &ww, &hh, &xx2, &yy2, NULL, NULL); if (ww < 1) ww = 1; if (hh < 1) hh = 1; if (en->cursor_bg) diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 7b1a567579..51ec6e4b5a 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -95,6 +95,8 @@ struct _Mod_Api static void _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd); static void _magnifier_move(void *data); +static void _update_decorations(Efl_Ui_Text_Data *sd); +static void _create_text_cursors(Efl_Ui_Text_Data *sd); static Mod_Api * _module_find(Evas_Object *obj EINA_UNUSED) @@ -1094,6 +1096,7 @@ _deferred_recalc_job(void *data) elm_widget_show_region_set(data, cx, cy, cw, ch, EINA_FALSE); } } + _update_decorations(sd); } EOLIAN static void @@ -3811,6 +3814,8 @@ _efl_ui_text_evas_object_smart_add(Eo *obj, Efl_Ui_Text_Data *priv) if (_elm_config->desktop_entry) priv->sel_handler_disabled = EINA_TRUE; + + _create_text_cursors(priv); } static void @@ -5689,6 +5694,61 @@ _efl_ui_text_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Text_Data * return ret ? strdup(ret) : NULL; } +static void +_create_text_cursors(Efl_Ui_Text_Data *sd) +{ + +} + +/** + * General function to be called whenever decorations are requried to be + * updated. Example cases are resizes, key events, change events etc. + */ +static void +_update_text_cursors(Efl_Ui_Text_Data *sd) +{ + Evas_Coord x, y, w, h, xx, yy, ww, hh; + Evas_Coord xx2, yy2, ww2, hh2; + Eo *text_obj; + Eina_Bool bidi_cursor; + + x = y = w = h = -1; + xx = yy = ww = hh = -1; + text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); + evas_object_geometry_get(text_obj, &x, &y, &w, &h); + bidi_cursor = efl_canvas_text_cursor_geometry_get(sd->cursor, + EFL_CANVAS_TEXT_CURSOR_TYPE_BEFORE, &xx, &yy, &ww, &hh, &xx2, &yy2, + NULL, NULL); + if (ww < 1) ww = 1; + if (hh < 1) hh = 1; + if (sd->cursor) + { + evas_object_move(sd->cursor, x + xx, y + yy); + evas_object_resize(sd->cursor, ww, hh); + } + if (sd->cursor_bidi) + { + if (bidi_cursor) + { + evas_object_image_fill_set(sd->cursor_bidi, 0, 0, ww, hh / 2); + evas_object_move(sd->cursor_bidi, x + xx2, y + yy2 + (hh / 2)); + evas_object_resize(sd->cursor, ww, hh / 2); + evas_object_resize(sd->cursor_bidi, ww, hh / 2); + evas_object_show(sd->cursor_bidi); + } + else + { + evas_object_hide(sd->cursor_bidi); + } + } +} + +static void +_update_decorations(Efl_Ui_Text_Data *sd) +{ + _update_text_cursors(sd); +} + #if 0 /* Efl.Part begin */ diff --git a/src/lib/elementary/efl_ui_text.h b/src/lib/elementary/efl_ui_text.h index 840a812b0b..92efc7cdea 100644 --- a/src/lib/elementary/efl_ui_text.h +++ b/src/lib/elementary/efl_ui_text.h @@ -37,6 +37,8 @@ struct _Efl_Ui_Text_Data Evas_Object *mgf_bg; Evas_Object *mgf_clip; Evas_Object *mgf_proxy; + Efl_Canvas_Text_Cursor *cursor; + Efl_Canvas_Text_Cursor *cursor_bidi; Evas_Object *start_handler; Evas_Object *end_handler; Ecore_Job *deferred_recalc_job; |