summaryrefslogtreecommitdiff
path: root/legacy/edje/src/lib/edje_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/edje/src/lib/edje_entry.c')
-rw-r--r--legacy/edje/src/lib/edje_entry.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/legacy/edje/src/lib/edje_entry.c b/legacy/edje/src/lib/edje_entry.c
index a39d8e1..6b94f75 100644
--- a/legacy/edje/src/lib/edje_entry.c
+++ b/legacy/edje/src/lib/edje_entry.c
@@ -1062,12 +1062,14 @@ _range_del_emit(Edje *ed, Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __
1062 _edje_emit(ed, "entry,changed", en->rp->part->name); 1062 _edje_emit(ed, "entry,changed", en->rp->part->name);
1063 _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info, 1063 _edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info,
1064 _free_entry_change_info); 1064 _free_entry_change_info);
1065 _sel_clear(en->cursor, en->rp->object, en);
1065} 1066}
1066 1067
1067static void 1068static void
1068_range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en) 1069_range_del(Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __UNUSED__, Entry *en)
1069{ 1070{
1070 evas_textblock_cursor_range_delete(en->sel_start, en->sel_end); 1071 evas_textblock_cursor_range_delete(en->sel_start, en->sel_end);
1072 _sel_clear(en->cursor, en->rp->object, en);
1071} 1073}
1072 1074
1073static void 1075static void
@@ -1441,7 +1443,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
1441 _range_del_emit(ed, en->cursor, rp->object, en); 1443 _range_del_emit(ed, en->cursor, rp->object, en);
1442 info->merge = EINA_TRUE; 1444 info->merge = EINA_TRUE;
1443 } 1445 }
1444 _sel_clear(en->cursor, rp->object, en);
1445 info->change.insert.pos = 1446 info->change.insert.pos =
1446 evas_textblock_cursor_pos_get(en->cursor); 1447 evas_textblock_cursor_pos_get(en->cursor);
1447 info->change.insert.content = eina_stringshare_add("<tab/>"); 1448 info->change.insert.content = eina_stringshare_add("<tab/>");
@@ -1506,7 +1507,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
1506 _range_del_emit(ed, en->cursor, rp->object, en); 1507 _range_del_emit(ed, en->cursor, rp->object, en);
1507 info->merge = EINA_TRUE; 1508 info->merge = EINA_TRUE;
1508 } 1509 }
1509 _sel_clear(en->cursor, rp->object, en);
1510 1510
1511 info->change.insert.pos = 1511 info->change.insert.pos =
1512 evas_textblock_cursor_pos_get(en->cursor); 1512 evas_textblock_cursor_pos_get(en->cursor);
@@ -1549,7 +1549,6 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
1549 _range_del_emit(ed, en->cursor, rp->object, en); 1549 _range_del_emit(ed, en->cursor, rp->object, en);
1550 info->merge = EINA_TRUE; 1550 info->merge = EINA_TRUE;
1551 } 1551 }
1552 _sel_clear(en->cursor, rp->object, en);
1553 1552
1554 info->change.insert.pos = 1553 info->change.insert.pos =
1555 evas_textblock_cursor_pos_get(en->cursor); 1554 evas_textblock_cursor_pos_get(en->cursor);
@@ -2320,7 +2319,6 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text)
2320 // prepend markup @ cursor pos 2319 // prepend markup @ cursor pos
2321 if (en->have_selection) 2320 if (en->have_selection)
2322 _range_del(en->cursor, rp->object, en); 2321 _range_del(en->cursor, rp->object, en);
2323 _sel_clear(en->cursor, rp->object, en);
2324 //xx 2322 //xx
2325// evas_object_textblock_text_markup_prepend(en->cursor, text); 2323// evas_object_textblock_text_markup_prepend(en->cursor, text);
2326 _text_filter_markup_prepend(en, en->cursor, text); 2324 _text_filter_markup_prepend(en, en->cursor, text);
@@ -2524,6 +2522,35 @@ _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Coord *
2524} 2522}
2525 2523
2526void 2524void
2525_edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
2526{
2527 Entry *en = rp->entry_data;
2528 Edje_Entry_Change_Info *info = calloc(1, sizeof(*info));
2529 info->insert = EINA_TRUE;
2530 info->change.insert.plain_length = 1;
2531 info->change.insert.content = eina_stringshare_add(text);
2532 {
2533 char *tmp;
2534 tmp = evas_textblock_text_markup_to_utf8(rp->object,
2535 info->change.insert.content);
2536 info->change.insert.plain_length = eina_unicode_utf8_get_len(tmp);
2537 free(tmp);
2538 }
2539
2540 if (en->have_selection)
2541 {
2542 _range_del_emit(rp->edje, en->cursor, rp->object, en);
2543 info->merge = EINA_TRUE;
2544 }
2545 info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor);
2546 _text_filter_text_prepend(en, en->cursor, text);
2547 _edje_emit(rp->edje, "entry,changed", rp->part->name);
2548 _edje_emit_full(rp->edje, "entry,changed,user", rp->part->name,
2549 info, _free_entry_change_info);
2550 _edje_emit(rp->edje, "cursor,changed", rp->part->name);
2551}
2552
2553void
2527_edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow) 2554_edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow)
2528{ 2555{
2529 Entry *en = rp->entry_data; 2556 Entry *en = rp->entry_data;
@@ -3247,7 +3274,6 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN
3247 { 3274 {
3248 /* delete selected characters */ 3275 /* delete selected characters */
3249 _range_del_emit(ed, en->cursor, rp->object, en); 3276 _range_del_emit(ed, en->cursor, rp->object, en);
3250 _sel_clear(en->cursor, rp->object, en);
3251 } 3277 }
3252 3278
3253 /* delete preedit characters */ 3279 /* delete preedit characters */