10 #include <ecore_private.h>
12 #include "Ecore_IMF.h"
13 #include "ecore_imf_private.h"
16 * @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
18 * Functions that operate on Ecore Input Method Context objects.
22 * Get the list of the available Input Method Context ids.
24 * Note that the caller is responsible for freeing the Eina_List
25 * when finished with it. There is no need to finish the list strings.
27 * @return Return an EIna_List of strings;
28 * on failure it returns NULL.
29 * @ingroup Ecore_IMF_Context_Group
32 ecore_imf_context_available_ids_get(void)
34 return ecore_imf_module_context_ids_get();
38 ecore_imf_context_available_ids_by_canvas_type_get(const char *canvas_type)
40 return ecore_imf_module_context_ids_by_canvas_type_get(canvas_type);
44 * Match @locale against @against.
46 * 'en_US' against 'en_US' => 4
47 * 'en_US' against 'en' => 3
48 * 'en', 'en_UK' against 'en_US' => 2
49 * all locales, against '*' => 1
52 _ecore_imf_context_match_locale(const char *locale, const char *against, int against_len)
54 if (strcmp(against, "*") == 0)
57 if (strcasecmp(locale, against) == 0)
60 if (strncasecmp(locale, against, 2) == 0)
61 return (against_len == 2) ? 3 : 2;
67 * Get the id of the default Input Method Context.
68 * The id may to used to create a new instance of an Input Method
71 * @return Return a string containing the id of the default Input
72 * Method Context; on failure it returns NULL.
73 * @ingroup Ecore_IMF_Context_Group
76 ecore_imf_context_default_id_get(void)
78 return ecore_imf_context_default_id_by_canvas_type_get(NULL);
82 ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type)
86 Ecore_IMF_Module *module;
89 int best_goodness = 0;
91 id = getenv("ECORE_IMF_MODULE");
94 if (strcmp(id, "none") == 0) return NULL;
95 if (ecore_imf_module_get(id)) return id;
98 modules = ecore_imf_module_available_get();
99 if (!modules) return NULL;
101 locale = setlocale(LC_CTYPE, NULL);
102 if (!locale) return NULL;
104 locale = strdup(locale);
106 tmp = strchr(locale, '.');
107 if (tmp) *tmp = '\0';
108 tmp = strchr(locale, '@');
109 if (tmp) *tmp = '\0';
113 EINA_LIST_FREE(modules, module)
116 strcmp(module->info->canvas_type, canvas_type) == 0)
119 const char *p = module->info->default_locales;
122 const char *q = strchr(p, ':');
123 int goodness = _ecore_imf_context_match_locale(locale, p, q ? (size_t)(q - p) : strlen (p));
125 if (goodness > best_goodness)
127 id = module->info->id;
128 best_goodness = goodness;
131 p = q ? q + 1 : NULL;
140 * Retrieve the info for the Input Method Context with @p id.
142 * @param id The Input Method Context id to query for.
143 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
144 * on failure it returns NULL.
145 * @ingroup Ecore_IMF_Context_Group
147 EAPI const Ecore_IMF_Context_Info *
148 ecore_imf_context_info_by_id_get(const char *id)
150 Ecore_IMF_Module *module;
152 if (!id) return NULL;
153 module = ecore_imf_module_get(id);
154 if (!module) return NULL;
159 * Create a new Input Method Context defined by the given id.
161 * @param id The Input Method Context id.
162 * @return A newly allocated Input Method Context;
163 * on failure it returns NULL.
164 * @ingroup Ecore_IMF_Context_Group
166 EAPI Ecore_IMF_Context *
167 ecore_imf_context_add(const char *id)
169 Ecore_IMF_Context *ctx;
171 if (!id) return NULL;
172 ctx = ecore_imf_module_context_create(id);
173 if (!ctx || !ctx->klass) return NULL;
174 if (ctx->klass->add) ctx->klass->add(ctx);
175 /* default use_preedit is 1, so let's make sure it's
176 * set on the immodule */
177 ecore_imf_context_use_preedit_set(ctx, 1);
178 /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's
179 * set on the immodule */
180 ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL);
185 * Retrieve the info for the given Input Method Context.
187 * @param ctx An #Ecore_IMF_Context.
188 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
189 * on failure it returns NULL.
190 * @ingroup Ecore_IMF_Context_Group
192 EAPI const Ecore_IMF_Context_Info *
193 ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
195 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
197 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
198 "ecore_imf_context_info_get");
201 return ctx->module->info;
205 * Delete the given Input Method Context and free its memory.
207 * @param ctx An #Ecore_IMF_Context.
208 * @ingroup Ecore_IMF_Context_Group
211 ecore_imf_context_del(Ecore_IMF_Context *ctx)
213 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
215 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
216 "ecore_imf_context_del");
219 if (ctx->klass->del) ctx->klass->del(ctx);
220 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
225 * Set the client window for the Input Method Context; this is the
226 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
227 * This window is used in order to correctly position status windows, and may
228 * also be used for purposes internal to the Input Method Context.
230 * @param ctx An #Ecore_IMF_Context.
231 * @param window The client window. This may be NULL to indicate
232 * that the previous client window no longer exists.
233 * @ingroup Ecore_IMF_Context_Group
236 ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
238 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
240 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
241 "ecore_imf_context_client_window_set");
244 if (ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
248 * Set the client canvas for the Input Method Context; this is the
249 * canvas in which the input appears.
250 * The canvas type can be determined by using the context canvas type.
251 * Actually only canvas with type "evas" (Evas *) is supported.
252 * This canvas may be used in order to correctly position status windows, and may
253 * also be used for purposes internal to the Input Method Context.
255 * @param ctx An #Ecore_IMF_Context.
256 * @param canas The client canvas. This may be NULL to indicate
257 * that the previous client canvas no longer exists.
258 * @ingroup Ecore_IMF_Context_Group
261 ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
263 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
265 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
266 "ecore_imf_context_client_window_set");
269 if (ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
273 * Ask the Input Method Context to show itself.
275 * @param ctx An #Ecore_IMF_Context.
276 * @ingroup Ecore_IMF_Context_Group
279 ecore_imf_context_show(Ecore_IMF_Context *ctx)
281 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
283 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
284 "ecore_imf_context_show");
287 if (ctx->klass->show) ctx->klass->show(ctx);
291 * Ask the Input Method Context to hide itself.
293 * @param ctx An #Ecore_IMF_Context.
294 * @ingroup Ecore_IMF_Context_Group
297 ecore_imf_context_hide(Ecore_IMF_Context *ctx)
299 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
301 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
302 "ecore_imf_context_hide");
305 if (ctx->klass->hide) ctx->klass->hide(ctx);
309 * Retrieve the current preedit string and cursor position
310 * for the Input Method Context.
312 * @param ctx An #Ecore_IMF_Context.
313 * @param str Location to store the retrieved string. The
314 * string retrieved must be freed with free().
315 * @param cursor_pos Location to store position of cursor (in characters)
316 * within the preedit string.
317 * @ingroup Ecore_IMF_Context_Group
320 ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos)
322 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
324 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
325 "ecore_imf_context_preedit_string_get");
328 if (ctx->klass->preedit_string_get)
329 ctx->klass->preedit_string_get(ctx, str, cursor_pos);
332 if (str) *str = strdup("");
333 if (cursor_pos) *cursor_pos = 0;
338 * Notify the Input Method Context that the widget to which its
339 * correspond has gained focus.
341 * @param ctx An #Ecore_IMF_Context.
342 * @ingroup Ecore_IMF_Context_Group
345 ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
347 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
349 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
350 "ecore_imf_context_focus_in");
353 if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
357 * Notify the Input Method Context that the widget to which its
358 * correspond has lost focus.
360 * @param ctx An #Ecore_IMF_Context.
361 * @ingroup Ecore_IMF_Context_Group
364 ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
366 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
368 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
369 "ecore_imf_context_focus_out");
372 if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
376 * Notify the Input Method Context that a change such as a
377 * change in cursor position has been made. This will typically
378 * cause the Input Method Context to clear the preedit state.
380 * @param ctx An #Ecore_IMF_Context.
381 * @ingroup Ecore_IMF_Context_Group
384 ecore_imf_context_reset(Ecore_IMF_Context *ctx)
386 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
388 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
389 "ecore_imf_context_reset");
392 if (ctx->klass->reset) ctx->klass->reset(ctx);
396 * Notify the Input Method Context that a change in the cursor
397 * position has been made.
399 * @param ctx An #Ecore_IMF_Context.
400 * @param cursor_pos New cursor position in characters.
401 * @ingroup Ecore_IMF_Context_Group
404 ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
406 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
408 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
409 "ecore_imf_context_cursor_position_set");
412 if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
416 * Set whether the IM context should use the preedit string
417 * to display feedback. If @use_preedit is 0 (default
418 * is 1), then the IM context may use some other method to display
419 * feedback, such as displaying it in a child of the root window.
421 * @param ctx An #Ecore_IMF_Context.
422 * @param use_preedit Whether the IM context should use the preedit string.
423 * @ingroup Ecore_IMF_Context_Group
426 ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, int use_preedit)
428 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
430 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
431 "ecore_imf_context_use_preedit_set");
434 if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
438 * Set the callback to be used on get_surrounding request.
440 * This callback will be called when the Input Method Context
441 * module requests the surrounding context.
443 * @param ctx An #Ecore_IMF_Context.
444 * @param func The callback to be called.
445 * @param data The data pointer to be passed to @p func
446 * @ingroup Ecore_IMF_Context_Group
449 ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, int (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data)
451 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
453 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
454 "ecore_imf_context_retrieve_surrounding_callback_set");
458 ctx->retrieve_surrounding_func = func;
459 ctx->retrieve_surrounding_data = (void *) data;
463 * Set the input mode used by the Ecore Input Context.
465 * The input mode can be one of the input modes defined in
466 * #Ecore_IMF_Input_Mode. The default input mode is
467 * ECORE_IMF_INPUT_MODE_FULL.
469 * @param ctx An #Ecore_IMF_Context.
470 * @param input_mode The input mode to be used by @p ctx.
471 * @ingroup Ecore_IMF_Context_Group
474 ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
476 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
478 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
479 "ecore_imf_context_input_mode_set");
482 if (ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
483 ctx->input_mode = input_mode;
487 * Get the input mode being used by the Ecore Input Context.
489 * See @ref ecore_imf_context_input_mode_set for more details.
491 * @param ctx An #Ecore_IMF_Context.
492 * @return The input mode being used by @p ctx.
493 * @ingroup Ecore_IMF_Context_Group
495 EAPI Ecore_IMF_Input_Mode
496 ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
498 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
500 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
501 "ecore_imf_context_input_mode_set");
504 return ctx->input_mode;
508 * Allow an Ecore Input Context to internally handle an event.
509 * If this function returns 1, then no further processing
510 * should be done for this event.
512 * Input methods must be able to accept all types of events (simply
513 * returning 0 if the event was not handled), but there is no
514 * obligation of any events to be submitted to this function.
516 * @param ctx An #Ecore_IMF_Context.
517 * @param type The type of event defined by #Ecore_IMF_Event_Type.
518 * @param event The event itself.
519 * @return 1 if the event was handled; otherwise 0.
520 * @ingroup Ecore_IMF_Context_Group
523 ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
525 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
527 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
528 "ecore_imf_context_filter_event");
531 if (ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
536 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
538 * Functions that should be used by Ecore Input Method Context modules.
542 * Creates a new Input Method Context with klass specified by @p ctxc.
544 * This method should be used by modules implementing the Input
545 * Method Context interface.
547 * @param ctxc An #Ecore_IMF_Context_Class.
548 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
549 * @ingroup Ecore_IMF_Context_Module_Group
551 EAPI Ecore_IMF_Context *
552 ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc)
554 Ecore_IMF_Context *ctx;
556 if (!ctxc) return NULL;
557 ctx = malloc(sizeof(Ecore_IMF_Context));
558 if (!ctx) return NULL;
559 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_CONTEXT);
562 ctx->retrieve_surrounding_func = NULL;
563 ctx->retrieve_surrounding_data = NULL;
568 * Set the Input Method Context specific data.
570 * Note that this method should be used by modules to set
571 * the Input Method Context specific data and it's not meant to
572 * be used by applications to store application specific data.
574 * @param ctx An #Ecore_IMF_Context.
575 * @param data The Input Method Context specific data.
576 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
577 * @ingroup Ecore_IMF_Context_Module_Group
580 ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data)
582 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
584 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
585 "ecore_imf_context_data_set");
592 * Get the Input Method Context specific data.
594 * See @ref ecore_imf_context_data_set for more details.
596 * @param ctx An #Ecore_IMF_Context.
597 * @return The Input Method Context specific data.
598 * @ingroup Ecore_IMF_Context_Module_Group
600 EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx)
602 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
604 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
605 "ecore_imf_context_data_get");
612 * Retrieve context around insertion point.
614 * This function is implemented by calling the
615 * Ecore_IMF_Context::retrieve_surrounding_func (
616 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
618 * There is no obligation for a widget to respond to the
619 * ::retrieve_surrounding_func, so input methods must be prepared
620 * to function without context.
622 * @param ctx An #Ecore_IMF_Context.
623 * @param text Location to store a UTF-8 encoded string of text
624 * holding context around the insertion point.
625 * If the function returns 1, then you must free
626 * the result stored in this location with free().
627 * @param cursor_pos Location to store the position in characters of
628 * the insertion cursor within @text.
629 * @return 1 if surrounding text was provided; otherwise 0.
630 * @ingroup Ecore_IMF_Context_Module_Group
633 ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
637 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
639 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
640 "ecore_imf_context_surrounding_get");
644 if (ctx->retrieve_surrounding_func)
646 result = ctx->retrieve_surrounding_func(ctx->retrieve_surrounding_data, ctx, text, cursor_pos);
649 if (text) *text = NULL;
650 if (cursor_pos) *cursor_pos = 0;
657 _ecore_imf_event_free_preedit(void *data __UNUSED__, void *event)
663 * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
665 * @param ctx An #Ecore_IMF_Context.
666 * @ingroup Ecore_IMF_Context_Module_Group
669 ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx)
671 Ecore_IMF_Event_Commit *ev;
673 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
675 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
676 "ecore_imf_context_preedit_start_event_add");
680 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start));
682 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START,
683 ev, _ecore_imf_event_free_preedit, NULL);
687 * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
689 * @param ctx An #Ecore_IMF_Context.
690 * @ingroup Ecore_IMF_Context_Module_Group
693 ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx)
695 Ecore_IMF_Event_Commit *ev;
697 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
699 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
700 "ecore_imf_context_preedit_end_event_add");
704 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End));
706 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END,
707 ev, _ecore_imf_event_free_preedit, NULL);
711 * Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
713 * @param ctx An #Ecore_IMF_Context.
714 * @ingroup Ecore_IMF_Context_Module_Group
717 ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx)
719 Ecore_IMF_Event_Commit *ev;
721 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
723 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
724 "ecore_imf_context_preedit_changed_event_add");
728 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed));
730 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED,
731 ev, _ecore_imf_event_free_preedit, NULL);
735 _ecore_imf_event_free_commit(void *data __UNUSED__, void *event)
737 Ecore_IMF_Event_Commit *ev;
740 if (ev->str) free(ev->str);
745 * Adds ECORE_IMF_EVENT_COMMIT to the event queue.
747 * @param ctx An #Ecore_IMF_Context.
748 * @param str The committed string.
749 * @ingroup Ecore_IMF_Context_Module_Group
752 ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str)
754 Ecore_IMF_Event_Commit *ev;
756 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
758 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
759 "ecore_imf_context_commit_event_add");
763 ev = malloc(sizeof(Ecore_IMF_Event_Commit));
765 ev->str = str ? strdup(str) : NULL;
766 ecore_event_add(ECORE_IMF_EVENT_COMMIT,
767 ev, _ecore_imf_event_free_commit, NULL);
772 _ecore_imf_event_free_delete_surrounding(void *data __UNUSED__, void *event)
778 * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
780 * @param ctx An #Ecore_IMF_Context.
781 * @param offset The start offset of surrounding to be deleted.
782 * @param n_chars The number of characters to be deleted.
783 * @ingroup Ecore_IMF_Context_Module_Group
786 ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars)
788 Ecore_IMF_Event_Delete_Surrounding *ev;
790 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
792 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
793 "ecore_imf_context_delete_surrounding_event_add");
797 ev = malloc(sizeof(Ecore_IMF_Event_Delete_Surrounding));
800 ev->n_chars = n_chars;
801 ecore_event_add(ECORE_IMF_EVENT_DELETE_SURROUNDING,
802 ev, _ecore_imf_event_free_delete_surrounding, NULL);