Eina_Bool had_sel : 1;
#ifdef HAVE_ECORE_IMF
- int comp_len;
- Eina_Bool have_composition : 1;
+ int preedit_len;
+ Eina_Bool have_preedit : 1;
Ecore_IMF_Context *imf_context;
Ecore_Event_Handler *imf_ee_handler_commit;
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_cursor_position_set(en->imf_context, evas_textblock_cursor_pos_get(en->cursor));
ecore_imf_context_focus_out(en->imf_context);
+
+ en->preedit_len = 0;
+ en->have_preedit = EINA_FALSE;
}
#endif
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
- if (en->imf_context)
- {
- ecore_imf_context_reset(en->imf_context);
- ecore_imf_context_cursor_position_set(en->imf_context,
- evas_textblock_cursor_pos_get(en->cursor));
- ecore_imf_context_focus_out(en->imf_context);
- }
+ if (!en->imf_context) return;
+
+ ecore_imf_context_reset(en->imf_context);
+ ecore_imf_context_cursor_position_set(en->imf_context, evas_textblock_cursor_pos_get(en->cursor));
+ ecore_imf_context_focus_out(en->imf_context);
+
+ en->preedit_len = 0;
+ en->have_preedit = EINA_FALSE;
#endif
}
if (!evas_textblock_cursor_format_item_geometry_get
(an->start, &cx, &cy, &cw, &ch))
- continue;
+ continue;
evas_object_move(sel->obj, x + cx, y + cy);
evas_object_resize(sel->obj, cw, ch);
}
range = eina_list_remove_list(range, range);
free(r);
}
- }
+ }
}
}
static char *s = NULL;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
+ if (!c) return NULL;
if (s)
{
free(s);
_sel_clear(en->cursor, rp->object, en);
}
- if (en->have_composition)
+ if (en->have_preedit)
{
- for (i = 0; i < en->comp_len; i++)
+ for (i = 0; i < en->preedit_len; i++)
_backspace(en->cursor, rp->object, en);
- en->have_composition = EINA_FALSE;
+ en->have_preedit = EINA_FALSE;
}
//yy
Edje* ed = data;
Edje_Real_Part *rp = ed->focused_part;
Entry *en;
- int length;
+ int length = 0;
Ecore_IMF_Event_Commit *ev = event;
- int i;
+ int i = 0;
char *preedit_string;
if (!rp) return ECORE_CALLBACK_PASS_ON;
_sel_clear(en->cursor, rp->object, en);
}
- if (en->have_composition)
+ if (en->have_preedit)
{
- // delete the composing characters
- for (i = 0;i < en->comp_len; i++)
+ // delete the preedit characters
+ for (i = 0;i < en->preedit_len; i++)
_backspace(en->cursor, rp->object, en);
}
- en->comp_len = length;
- en->have_composition = EINA_TRUE;
+ en->preedit_len = length;
+ en->have_preedit = EINA_TRUE;
//xx
// evas_object_textblock_text_markup_prepend(en->cursor, preedit_string);