typedef struct _Sel Sel;
typedef struct _Anchor Anchor;
+static void _edje_entry_imf_cursor_info_set(Entry *en);
+static void _edje_entry_imf_context_reset(Entry *en);
+
struct _Entry
{
Edje_Real_Part *rp;
if (evas_object_focus_get(rp->edje->obj))
{
ecore_imf_context_reset(en->imf_context);
+ _edje_entry_imf_cursor_info_set(en);
ecore_imf_context_focus_in(en->imf_context);
}
}
en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,changed", en->rp->part->name);
-
-#ifdef HAVE_ECORE_IMF
- if (!en->imf_context) return;
-
- ecore_imf_context_reset(en->imf_context);
-#endif
+ _edje_entry_imf_context_reset(en);
}
static void
en->selection = NULL;
}
_edje_emit(en->rp->edje, "selection,changed", en->rp->part->name);
-
-#ifdef HAVE_ECORE_IMF
- if (!en->imf_context) return;
- ecore_imf_context_reset(en->imf_context);
-#endif
+ _edje_entry_imf_context_reset(en);
}
static void
if ((old_cur_pos != evas_textblock_cursor_pos_get(en->cursor)) && (!cursor_changed))
_edje_emit(ed, "cursor,changed", rp->part->name);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
if (evas_textblock_cursor_compare(tc, en->cursor))
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
evas_textblock_cursor_free(tc);
-
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
if (ev->button == 2)
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
evas_textblock_cursor_free(tc);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
evas_textblock_cursor_free(tc);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
if (!en->imf_context) goto done;
- ecore_imf_context_client_window_set(en->imf_context, ecore_evas_window_get(ecore_evas_ecore_evas_get(rp->edje->base.evas)));
+ ecore_imf_context_client_window_set
+ (en->imf_context,
+ (void *)ecore_evas_window_get
+ (ecore_evas_ecore_evas_get(rp->edje->base.evas)));
ecore_imf_context_client_canvas_set(en->imf_context, rp->edje->base.evas);
ecore_imf_context_retrieve_surrounding_callback_set(en->imf_context,
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
+
_edje_entry_real_part_configure(rp);
}
if (!en) return;
_curs_start(en->cursor, rp->object, en);
-#ifdef HAVE_ECORE_IMF
- if (en->imf_context)
- ecore_imf_context_cursor_position_set(en->imf_context, 0);
-#endif
+ _edje_entry_imf_cursor_info_set(en);
}
void
if (!en) return;
_curs_end(en->cursor, rp->object, en);
-#ifdef HAVE_ECORE_IMF
- if (en->imf_context)
- ecore_imf_context_cursor_position_set(en->imf_context,
- evas_textblock_cursor_pos_get(en->cursor));
-#endif
+ _edje_entry_imf_cursor_info_set(en);
}
void
_curs_end(en->cursor, rp->object, en);
_sel_extend(en->cursor, rp->object, en);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
_sel_start(en->cursor, rp->object, en);
_sel_extend(en->cursor, rp->object, en);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
if (!en) return;
_sel_extend(en->cursor, rp->object, en);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
{
en->selecting = EINA_FALSE;
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_entry_real_part_configure(rp);
}
}
}
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
ok:
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
return EINA_TRUE;
evas_textblock_cursor_paragraph_first(c);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
_curs_end(c, rp->object, rp->entry_data);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
evas_textblock_cursor_copy(c, d);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_line_char_first(c);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
evas_textblock_cursor_line_char_last(c);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
evas_textblock_cursor_pos_set(c, pos);
_sel_update(c, rp->object, rp->entry_data);
-#ifdef HAVE_ECORE_IMF
- 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));
- }
-#endif
-
+ _edje_entry_imf_context_reset(en);
+ _edje_entry_imf_cursor_info_set(en);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
}
return evas_textblock_cursor_pos_get(c);
}
+static void
+_edje_entry_imf_context_reset(Entry *en)
+{
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ ecore_imf_context_reset(en->imf_context);
+#endif
+}
+
+static void
+_edje_entry_imf_cursor_info_set(Entry *en)
+{
+ Evas_Coord cx, cy, cw, ch;
+ if (!en || !en->rp || !en->imf_context) return;
+
+ _edje_entry_cursor_geometry_get(en->rp, &cx, &cy, &cw, &ch);
+
+#ifdef HAVE_ECORE_IMF
+ ecore_imf_context_cursor_position_set(en->imf_context,
+ evas_textblock_cursor_pos_get(en->cursor));
+ ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch);
+#endif
+}
+
#ifdef HAVE_ECORE_IMF
static Eina_Bool
_edje_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, char **text, int *cursor_pos)
evas_textblock_cursor_free(tc);
+ _edje_entry_imf_cursor_info_set(en);
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_emit(ed, "cursor,changed", rp->part->name);
{
_text_filter_markup_prepend(en, en->cursor, preedit_string);
}
+
if (!preedit_end_state)
{
/* set preedit start cursor */
{
evas_textblock_cursor_char_prev(en->preedit_start);
}
- }
- if (!preedit_end_state)
- {
en->have_preedit = EINA_TRUE;
/* set cursor position */
evas_textblock_cursor_pos_set(en->cursor, preedit_start_pos + cursor_pos);
}
+ _edje_entry_imf_cursor_info_set(en);
_anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "preedit,changed", rp->part->name);
_edje_emit(ed, "cursor,changed", rp->part->name);