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 EINA_TRUE, so let's make sure it's
176 * set on the immodule */
177 ecore_imf_context_use_preedit_set(ctx, EINA_TRUE);
179 /* default prediction is EINA_TRUE, so let's make sure it's
180 * set on the immodule */
181 ecore_imf_context_prediction_allow_set(ctx, EINA_TRUE);
183 /* default autocapital type is SENTENCE type, so let's make sure it's
184 * set on the immodule */
185 ecore_imf_context_autocapital_type_set(ctx, ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE);
187 /* default input panel enabled status is EINA_TRUE, so let's make sure it's
188 * set on the immodule */
189 ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
191 /* default input panel layout type is NORMAL type, so let's make sure it's
192 * set on the immodule */
193 ecore_imf_context_input_panel_layout_set(ctx, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL);
195 /* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's
196 * set on the immodule */
197 ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL);
202 * Retrieve the info for the given Input Method Context.
204 * @param ctx An #Ecore_IMF_Context.
205 * @return Return a #Ecore_IMF_Context_Info for the given Input Method Context;
206 * on failure it returns NULL.
207 * @ingroup Ecore_IMF_Context_Group
209 EAPI const Ecore_IMF_Context_Info *
210 ecore_imf_context_info_get(Ecore_IMF_Context *ctx)
212 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
214 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
215 "ecore_imf_context_info_get");
218 return ctx->module->info;
222 * Delete the given Input Method Context and free its memory.
224 * @param ctx An #Ecore_IMF_Context.
225 * @ingroup Ecore_IMF_Context_Group
228 ecore_imf_context_del(Ecore_IMF_Context *ctx)
230 Ecore_IMF_Func_Node *fn;
232 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
234 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
235 "ecore_imf_context_del");
238 if (ctx->klass->del) ctx->klass->del(ctx);
242 EINA_LIST_FREE(ctx->callbacks, fn)
246 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
251 * Set the client window for the Input Method Context; this is the
252 * Ecore_X_Window when using X11, Ecore_Win32_Window when using Win32, etc.
253 * This window is used in order to correctly position status windows, and may
254 * also be used for purposes internal to the Input Method Context.
256 * @param ctx An #Ecore_IMF_Context.
257 * @param window The client window. This may be NULL to indicate
258 * that the previous client window no longer exists.
259 * @ingroup Ecore_IMF_Context_Group
262 ecore_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
264 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
266 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
267 "ecore_imf_context_client_window_set");
270 if (ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
271 ctx->window = window;
275 * Get the client window of the Input Method Context
277 * See @ref ecore_imf_context_client_window_set for more details.
279 * @param ctx An #Ecore_IMF_Context.
280 * @return Return the client window.
281 * @ingroup Ecore_IMF_Context_Group
285 ecore_imf_context_client_window_get(Ecore_IMF_Context *ctx)
287 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
289 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
290 "ecore_imf_context_client_window_get");
297 * Set the client canvas for the Input Method Context; this is the
298 * canvas in which the input appears.
299 * The canvas type can be determined by using the context canvas type.
300 * Actually only canvas with type "evas" (Evas *) is supported.
301 * This canvas may be used in order to correctly position status windows, and may
302 * also be used for purposes internal to the Input Method Context.
304 * @param ctx An #Ecore_IMF_Context.
305 * @param canvas The client canvas. This may be NULL to indicate
306 * that the previous client canvas no longer exists.
307 * @ingroup Ecore_IMF_Context_Group
310 ecore_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
312 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
314 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
315 "ecore_imf_context_client_canvas_set");
318 if (ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
319 ctx->client_canvas = canvas;
323 * Get the client canvas of the Input Method Context.
325 * See @ref ecore_imf_context_client_canvas_set for more details.
327 * @param ctx An #Ecore_IMF_Context.
328 * @return Return the client canvas.
329 * @ingroup Ecore_IMF_Context_Group
333 ecore_imf_context_client_canvas_get(Ecore_IMF_Context *ctx)
335 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
337 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
338 "ecore_imf_context_client_canvas_get");
341 return ctx->client_canvas;
345 * Ask the Input Method Context to show itself.
347 * @param ctx An #Ecore_IMF_Context.
348 * @ingroup Ecore_IMF_Context_Group
351 ecore_imf_context_show(Ecore_IMF_Context *ctx)
353 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
355 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
356 "ecore_imf_context_show");
359 if (ctx->klass->show) ctx->klass->show(ctx);
363 * Ask the Input Method Context to hide itself.
365 * @param ctx An #Ecore_IMF_Context.
366 * @ingroup Ecore_IMF_Context_Group
369 ecore_imf_context_hide(Ecore_IMF_Context *ctx)
371 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
373 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
374 "ecore_imf_context_hide");
377 if (ctx->klass->hide) ctx->klass->hide(ctx);
381 * Retrieve the current preedit string and cursor position
382 * for the Input Method Context.
384 * @param ctx An #Ecore_IMF_Context.
385 * @param str Location to store the retrieved string. The
386 * string retrieved must be freed with free().
387 * @param cursor_pos Location to store position of cursor (in characters)
388 * within the preedit string.
389 * @ingroup Ecore_IMF_Context_Group
392 ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cursor_pos)
394 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
396 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
397 "ecore_imf_context_preedit_string_get");
400 if (ctx->klass->preedit_string_get)
401 ctx->klass->preedit_string_get(ctx, str, cursor_pos);
404 if (str) *str = strdup("");
405 if (cursor_pos) *cursor_pos = 0;
410 * Retrieve the current preedit string, atrributes and
411 * cursor position for the Input Method Context.
413 * @param ctx An #Ecore_IMF_Context.
414 * @param str Location to store the retrieved string. The
415 * string retrieved must be freed with free().
416 * @param attrs an Eina_List of attributes
417 * @param cursor_pos Location to store position of cursor (in characters)
418 * within the preedit string.
419 * @ingroup Ecore_IMF_Context_Group
423 ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos)
425 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
427 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
428 "ecore_imf_context_preedit_string_with_attributes_get");
431 if (ctx->klass->preedit_string_with_attributes_get)
432 ctx->klass->preedit_string_with_attributes_get(ctx, str, attrs, cursor_pos);
435 if (str) *str = strdup("");
436 if (attrs) *attrs = NULL;
437 if (cursor_pos) *cursor_pos = 0;
442 * Notify the Input Method Context that the widget to which its
443 * correspond has gained focus.
445 * @param ctx An #Ecore_IMF_Context.
446 * @ingroup Ecore_IMF_Context_Group
449 ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
451 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
453 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
454 "ecore_imf_context_focus_in");
457 if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
461 * Notify the Input Method Context that the widget to which its
462 * correspond has lost focus.
464 * @param ctx An #Ecore_IMF_Context.
465 * @ingroup Ecore_IMF_Context_Group
468 ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
470 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
472 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
473 "ecore_imf_context_focus_out");
476 if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
480 * Notify the Input Method Context that a change such as a
481 * change in cursor position has been made. This will typically
482 * cause the Input Method Context to clear the preedit state.
484 * @param ctx An #Ecore_IMF_Context.
485 * @ingroup Ecore_IMF_Context_Group
488 ecore_imf_context_reset(Ecore_IMF_Context *ctx)
490 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
492 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
493 "ecore_imf_context_reset");
496 if (ctx->klass->reset) ctx->klass->reset(ctx);
500 * Notify the Input Method Context that a change in the cursor
501 * position has been made.
503 * @param ctx An #Ecore_IMF_Context.
504 * @param cursor_pos New cursor position in characters.
505 * @ingroup Ecore_IMF_Context_Group
508 ecore_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
510 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
512 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
513 "ecore_imf_context_cursor_position_set");
516 if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
520 * Notify the Input Method Context that a change in the cursor
521 * location has been made. The location is relative to the canvas.
522 * The cursor location can be used to determine the position of
523 * candidate word window in the immodule.
525 * @param ctx An #Ecore_IMF_Context.
526 * @param x cursor x position.
527 * @param y cursor y position.
528 * @param w cursor width.
529 * @param h cursor height.
530 * @ingroup Ecore_IMF_Context_Group
534 ecore_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int w, int h)
536 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
538 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
539 "ecore_imf_context_cursor_location_set");
542 if (ctx->klass->cursor_location_set) ctx->klass->cursor_location_set(ctx, x, y, w, h);
546 * Set whether the IM context should use the preedit string
547 * to display feedback. If @c use_preedit is EINA_FALSE (default
548 * is EINA_TRUE), then the IM context may use some other method to display
549 * feedback, such as displaying it in a child of the root window.
551 * @param ctx An #Ecore_IMF_Context.
552 * @param use_preedit Whether the IM context should use the preedit string.
553 * @ingroup Ecore_IMF_Context_Group
556 ecore_imf_context_use_preedit_set(Ecore_IMF_Context *ctx, Eina_Bool use_preedit)
558 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
560 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
561 "ecore_imf_context_use_preedit_set");
564 if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
568 * Set whether the IM context should allow to use the text prediction.
569 * If @c prediction is EINA_FALSE (default is EINA_TRUE), then the IM context will not display the text prediction window.
571 * @param ctx An #Ecore_IMF_Context.
572 * @param prediction Whether the IM context should allow to use the text prediction.
573 * @ingroup Ecore_IMF_Context_Group
577 ecore_imf_context_prediction_allow_set(Ecore_IMF_Context *ctx, Eina_Bool prediction)
579 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
581 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
582 "ecore_imf_context_prediction_allow_set");
586 ctx->allow_prediction = prediction;
588 if (ctx->klass->prediction_allow_set)
589 ctx->klass->prediction_allow_set(ctx, prediction);
593 * Get whether the IM context should allow to use the text prediction.
595 * @param ctx An #Ecore_IMF_Context.
596 * @return EINA_TRUE if it allows to use the text prediction, otherwise EINA_FALSE.
597 * @ingroup Ecore_IMF_Context_Group
601 ecore_imf_context_prediction_allow_get(Ecore_IMF_Context *ctx)
603 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
605 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
606 "ecore_imf_context_prediction_allow_get");
610 return ctx->allow_prediction;
614 * Set the autocapitalization type on the immodule.
616 * @param ctx An #Ecore_IMF_Context.
617 * @param autocapital_type the autocapitalization type.
618 * @ingroup Ecore_IMF_Context_Group
622 ecore_imf_context_autocapital_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Autocapital_Type autocapital_type)
624 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
626 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
627 "ecore_imf_context_autocapital_type_set");
631 ctx->autocapital_type = autocapital_type;
633 if (ctx->klass->autocapital_type_set) ctx->klass->autocapital_type_set(ctx, autocapital_type);
637 * Get the autocapitalization type.
639 * @param ctx An #Ecore_IMF_Context.
640 * @return The autocapital type being used by @p ctx.
641 * @ingroup Ecore_IMF_Context_Group
644 EAPI Ecore_IMF_Autocapital_Type
645 ecore_imf_context_autocapital_type_get(Ecore_IMF_Context *ctx)
647 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
649 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
650 "ecore_imf_context_autocapital_allow_get");
651 return ECORE_IMF_AUTOCAPITAL_TYPE_NONE;
654 return ctx->autocapital_type;
658 * Set the callback to be used on get_surrounding request.
660 * This callback will be called when the Input Method Context
661 * module requests the surrounding context.
663 * @param ctx An #Ecore_IMF_Context.
664 * @param func The callback to be called.
665 * @param data The data pointer to be passed to @p func
666 * @ingroup Ecore_IMF_Context_Group
669 ecore_imf_context_retrieve_surrounding_callback_set(Ecore_IMF_Context *ctx, Eina_Bool (*func)(void *data, Ecore_IMF_Context *ctx, char **text, int *cursor_pos), const void *data)
671 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
673 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
674 "ecore_imf_context_retrieve_surrounding_callback_set");
678 ctx->retrieve_surrounding_func = func;
679 ctx->retrieve_surrounding_data = (void *) data;
683 * Set the input mode used by the Ecore Input Context.
685 * The input mode can be one of the input modes defined in
686 * #Ecore_IMF_Input_Mode. The default input mode is
687 * ECORE_IMF_INPUT_MODE_FULL.
689 * @param ctx An #Ecore_IMF_Context.
690 * @param input_mode The input mode to be used by @p ctx.
691 * @ingroup Ecore_IMF_Context_Group
694 ecore_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode input_mode)
696 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
698 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
699 "ecore_imf_context_input_mode_set");
702 if (ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
703 ctx->input_mode = input_mode;
707 * Get the input mode being used by the Ecore Input Context.
709 * See @ref ecore_imf_context_input_mode_set for more details.
711 * @param ctx An #Ecore_IMF_Context.
712 * @return The input mode being used by @p ctx.
713 * @ingroup Ecore_IMF_Context_Group
715 EAPI Ecore_IMF_Input_Mode
716 ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
718 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
720 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
721 "ecore_imf_context_input_mode_set");
724 return ctx->input_mode;
728 * Allow an Ecore Input Context to internally handle an event.
729 * If this function returns EINA_TRUE, then no further processing
730 * should be done for this event.
732 * Input methods must be able to accept all types of events (simply
733 * returning EINA_FALSE if the event was not handled), but there is no
734 * obligation of any events to be submitted to this function.
736 * @param ctx An #Ecore_IMF_Context.
737 * @param type The type of event defined by #Ecore_IMF_Event_Type.
738 * @param event The event itself.
739 * @return EINA_TRUE if the event was handled; otherwise EINA_FALSE.
740 * @ingroup Ecore_IMF_Context_Group
743 ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
745 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
747 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
748 "ecore_imf_context_filter_event");
751 if (ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
756 * @defgroup Ecore_IMF_Context_Module_Group Ecore Input Method Context Module Functions
758 * Functions that should be used by Ecore Input Method Context modules.
762 * Creates a new Input Method Context with klass specified by @p ctxc.
764 * This method should be used by modules implementing the Input
765 * Method Context interface.
767 * @param ctxc An #Ecore_IMF_Context_Class.
768 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
769 * @ingroup Ecore_IMF_Context_Module_Group
771 EAPI Ecore_IMF_Context *
772 ecore_imf_context_new(const Ecore_IMF_Context_Class *ctxc)
774 Ecore_IMF_Context *ctx;
776 if (!ctxc) return NULL;
777 ctx = calloc(1, sizeof(Ecore_IMF_Context));
778 if (!ctx) return NULL;
779 ECORE_MAGIC_SET(ctx, ECORE_MAGIC_CONTEXT);
782 ctx->retrieve_surrounding_func = NULL;
783 ctx->retrieve_surrounding_data = NULL;
788 * Set the Input Method Context specific data.
790 * Note that this method should be used by modules to set
791 * the Input Method Context specific data and it's not meant to
792 * be used by applications to store application specific data.
794 * @param ctx An #Ecore_IMF_Context.
795 * @param data The Input Method Context specific data.
796 * @return A new #Ecore_IMF_Context; on failure it returns NULL.
797 * @ingroup Ecore_IMF_Context_Module_Group
800 ecore_imf_context_data_set(Ecore_IMF_Context *ctx, void *data)
802 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
804 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
805 "ecore_imf_context_data_set");
812 * Get the Input Method Context specific data.
814 * See @ref ecore_imf_context_data_set for more details.
816 * @param ctx An #Ecore_IMF_Context.
817 * @return The Input Method Context specific data.
818 * @ingroup Ecore_IMF_Context_Module_Group
820 EAPI void *ecore_imf_context_data_get(Ecore_IMF_Context *ctx)
822 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
824 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
825 "ecore_imf_context_data_get");
832 * Retrieve context around insertion point.
834 * This function is implemented by calling the
835 * Ecore_IMF_Context::retrieve_surrounding_func (
836 * set using #ecore_imf_context_retrieve_surrounding_callback_set).
838 * There is no obligation for a widget to respond to the
839 * ::retrieve_surrounding_func, so input methods must be prepared
840 * to function without context.
842 * @param ctx An #Ecore_IMF_Context.
843 * @param text Location to store a UTF-8 encoded string of text
844 * holding context around the insertion point.
845 * If the function returns EINA_TRUE, then you must free
846 * the result stored in this location with free().
847 * @param cursor_pos Location to store the position in characters of
848 * the insertion cursor within @text.
849 * @return EINA_TRUE if surrounding text was provided; otherwise EINA_FALSE.
850 * @ingroup Ecore_IMF_Context_Module_Group
853 ecore_imf_context_surrounding_get(Ecore_IMF_Context *ctx, char **text, int *cursor_pos)
855 int result = EINA_FALSE;
857 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
859 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
860 "ecore_imf_context_surrounding_get");
864 if (ctx->retrieve_surrounding_func)
866 result = ctx->retrieve_surrounding_func(ctx->retrieve_surrounding_data, ctx, text, cursor_pos);
869 if (text) *text = NULL;
870 if (cursor_pos) *cursor_pos = 0;
877 _ecore_imf_event_free_preedit(void *data __UNUSED__, void *event)
883 * Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
885 * ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
887 * @param ctx An #Ecore_IMF_Context.
888 * @ingroup Ecore_IMF_Context_Module_Group
891 ecore_imf_context_preedit_start_event_add(Ecore_IMF_Context *ctx)
893 Ecore_IMF_Event_Commit *ev;
895 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
897 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
898 "ecore_imf_context_preedit_start_event_add");
902 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start));
904 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START,
905 ev, _ecore_imf_event_free_preedit, NULL);
909 * Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
911 * ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
913 * @param ctx An #Ecore_IMF_Context.
914 * @ingroup Ecore_IMF_Context_Module_Group
917 ecore_imf_context_preedit_end_event_add(Ecore_IMF_Context *ctx)
919 Ecore_IMF_Event_Commit *ev;
921 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
923 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
924 "ecore_imf_context_preedit_end_event_add");
928 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End));
930 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END,
931 ev, _ecore_imf_event_free_preedit, NULL);
935 * Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
937 * @param ctx An #Ecore_IMF_Context.
938 * @ingroup Ecore_IMF_Context_Module_Group
941 ecore_imf_context_preedit_changed_event_add(Ecore_IMF_Context *ctx)
943 Ecore_IMF_Event_Commit *ev;
945 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
947 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
948 "ecore_imf_context_preedit_changed_event_add");
952 ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed));
954 ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED,
955 ev, _ecore_imf_event_free_preedit, NULL);
959 _ecore_imf_event_free_commit(void *data __UNUSED__, void *event)
961 Ecore_IMF_Event_Commit *ev;
964 if (ev->str) free(ev->str);
969 * Adds ECORE_IMF_EVENT_COMMIT to the event queue.
971 * @param ctx An #Ecore_IMF_Context.
972 * @param str The committed string.
973 * @ingroup Ecore_IMF_Context_Module_Group
976 ecore_imf_context_commit_event_add(Ecore_IMF_Context *ctx, const char *str)
978 Ecore_IMF_Event_Commit *ev;
980 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
982 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
983 "ecore_imf_context_commit_event_add");
987 ev = malloc(sizeof(Ecore_IMF_Event_Commit));
989 ev->str = str ? strdup(str) : NULL;
990 ecore_event_add(ECORE_IMF_EVENT_COMMIT,
991 ev, _ecore_imf_event_free_commit, NULL);
996 _ecore_imf_event_free_delete_surrounding(void *data __UNUSED__, void *event)
1002 * Adds ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1004 * Asks the widget that the input context is attached to to delete characters around the cursor position
1005 * by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
1006 * Note that offset and n_chars are in characters not in bytes.
1008 * @param ctx An #Ecore_IMF_Context.
1009 * @param offset The start offset of surrounding to be deleted.
1010 * @param n_chars The number of characters to be deleted.
1011 * @ingroup Ecore_IMF_Context_Module_Group
1014 ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offset, int n_chars)
1016 Ecore_IMF_Event_Delete_Surrounding *ev;
1018 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1020 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1021 "ecore_imf_context_delete_surrounding_event_add");
1025 ev = malloc(sizeof(Ecore_IMF_Event_Delete_Surrounding));
1027 ev->offset = offset;
1028 ev->n_chars = n_chars;
1029 ecore_event_add(ECORE_IMF_EVENT_DELETE_SURROUNDING,
1030 ev, _ecore_imf_event_free_delete_surrounding, NULL);
1034 * Add (register) a callback function to a given context event.
1036 * This function adds a function callback to the context @p ctx when the
1037 * event of type @p type occurs on it. The function pointer is @p
1040 * The event type @p type to trigger the function may be one of
1041 * #ECORE_IMF_CALLBACK_PREEDIT_START, #ECORE_IMF_CALLBACK_PREEDIT_END,
1042 * #ECORE_IMF_CALLBACK_PREEDIT_CHANGED, #ECORE_IMF_CALLBACK_COMMIT and
1043 * #ECORE_IMF_CALLBACK_DELETE_SURROUNDING.
1045 * @param ctx Ecore_IMF_Context to attach a callback to.
1046 * @param type The type of event that will trigger the callback
1047 * @param func The (callback) function to be called when the event is
1049 * @param data The data pointer to be passed to @p func
1050 * @ingroup Ecore_IMF_Context_Group
1054 ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)
1056 Ecore_IMF_Func_Node *fn = NULL;
1058 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1060 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1061 "ecore_imf_context_event_callback_add");
1067 fn = calloc(1, sizeof (Ecore_IMF_Func_Node));
1074 ctx->callbacks = eina_list_append(ctx->callbacks, fn);
1078 * Delete (unregister) a callback function registered to a given
1081 * This function removes a function callback from the context @p ctx when the
1082 * event of type @p type occurs on it. The function pointer is @p
1085 * @see ecore_imf_context_event_callback_add() for more details
1087 * @param ctx Ecore_IMF_Context to remove a callback from.
1088 * @param type The type of event that was trigerring the callback
1089 * @param func The (callback) function that was to be called when the event was triggered
1090 * @return the data pointer
1091 * @ingroup Ecore_IMF_Context_Group
1095 ecore_imf_context_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func)
1097 Eina_List *l = NULL;
1098 Eina_List *l_next = NULL;
1099 Ecore_IMF_Func_Node *fn = NULL;
1101 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1103 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1104 "ecore_imf_context_event_callback_del");
1108 if (!func) return NULL;
1109 if (!ctx->callbacks) return NULL;
1111 EINA_LIST_FOREACH_SAFE(ctx->callbacks, l, l_next, fn)
1113 if ((fn) && (fn->func == func) && (fn->type == type))
1115 void *tmp = (void *)fn->data;
1117 ctx->callbacks = eina_list_remove_list(ctx->callbacks, l);
1125 * Call a given callback on the context @p ctx.
1127 * ecore_imf_context_preedit_start_event_add, ecore_imf_context_preedit_end_event_add,
1128 * ecore_imf_context_preedit_changed_event_add, ecore_imf_context_commit_event_add and
1129 * ecore_imf_context_delete_surrounding_event_add APIs are asynchronous
1130 * because those API adds each event to the event queue.
1132 * This API provides the way to call each callback function immediately.
1134 * @param ctx Ecore_IMF_Context.
1135 * @param type The type of event that will trigger the callback
1136 * @param event_info The pointer to event specific struct or information to
1137 * pass to the callback functions registered on this event
1138 * @ingroup Ecore_IMF_Context_Module_Group
1142 ecore_imf_context_event_callback_call(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, void *event_info)
1144 Ecore_IMF_Func_Node *fn = NULL;
1145 Eina_List *l = NULL;
1147 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1149 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1150 "ecore_imf_context_event_callback_call");
1154 EINA_LIST_FOREACH(ctx->callbacks, l, fn)
1156 if ((fn) && (fn->type == type) && (fn->func))
1157 fn->func(fn->data, ctx, event_info);
1162 * Ask the Input Method Context to show the control panel of using Input Method.
1164 * @param ctx An #Ecore_IMF_Context.
1165 * @ingroup Ecore_IMF_Context_Group
1169 ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
1171 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1173 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1174 "ecore_imf_context_control_panel_show");
1178 if (ctx->klass->control_panel_show) ctx->klass->control_panel_show(ctx);
1182 * Ask the Input Method Context to hide the control panel of using Input Method.
1184 * @param ctx An #Ecore_IMF_Context.
1185 * @ingroup Ecore_IMF_Context_Group
1189 ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
1191 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1193 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1194 "ecore_imf_context_control_panel_hide");
1198 if (ctx->klass->control_panel_hide) ctx->klass->control_panel_hide(ctx);
1202 * Ask the Input Method Context to show the input panel (virtual keyboard).
1204 * @param ctx An #Ecore_IMF_Context.
1205 * @ingroup Ecore_IMF_Context_Group
1209 ecore_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
1211 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1213 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1214 "ecore_imf_context_input_panel_show");
1218 if (ctx->klass->show) ctx->klass->show(ctx);
1222 * Ask the Input Method Context to hide the input panel.
1224 * @param ctx An #Ecore_IMF_Context.
1225 * @ingroup Ecore_IMF_Context_Group
1229 ecore_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
1231 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1233 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1234 "ecore_imf_context_input_panel_hide");
1238 if (ctx->klass->hide) ctx->klass->hide(ctx);
1242 * Set the layout of the input panel.
1244 * @param ctx An #Ecore_IMF_Context.
1245 * @param layout see #Ecore_IMF_Input_Panel_Layout
1246 * @ingroup Ecore_IMF_Context_Group
1250 ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
1252 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1254 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1255 "ecore_imf_context_input_panel_layout_set");
1259 if (ctx->klass->input_panel_layout_set)
1260 ctx->klass->input_panel_layout_set(ctx, layout);
1262 ctx->input_panel_layout = layout;
1266 * Get the layout of the current active input panel.
1268 * @param ctx An #Ecore_IMF_Context.
1269 * @return layout see #Ecore_IMF_Input_Panel_Layout
1270 * @ingroup Ecore_IMF_Context_Group
1273 EAPI Ecore_IMF_Input_Panel_Layout
1274 ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
1276 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1278 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1279 "ecore_imf_context_input_panel_layout_get");
1280 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
1283 if (ctx->klass->input_panel_layout_get)
1284 return ctx->input_panel_layout;
1286 return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
1290 * Set the language of the input panel.
1291 * This API can be used when you want to show the English keyboard.
1293 * @param ctx An #Ecore_IMF_Context.
1294 * @param lang the language to be set to the input panel.
1295 * @ingroup Ecore_IMF_Context_Group
1299 ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
1301 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1303 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1304 "ecore_imf_context_input_panel_language_set");
1308 if (ctx->klass->input_panel_language_set) ctx->klass->input_panel_language_set(ctx, lang);
1309 ctx->input_panel_lang = lang;
1313 * Get the language of the input panel.
1315 * See @ref ecore_imf_context_input_panel_language_set for more details.
1317 * @param ctx An #Ecore_IMF_Context.
1318 * @return Ecore_IMF_Input_Panel_Lang
1319 * @ingroup Ecore_IMF_Context_Group
1322 EAPI Ecore_IMF_Input_Panel_Lang
1323 ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx)
1325 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1327 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1328 "ecore_imf_context_input_panel_language_get");
1329 return ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC;
1332 return ctx->input_panel_lang;
1336 * Set whether the Input Method Context should request to show the input panel automatically
1337 * when the widget has focus.
1339 * @param ctx An #Ecore_IMF_Context.
1340 * @param enabled If true, the input panel will be shown when the widget is clicked or has focus.
1341 * @ingroup Ecore_IMF_Context_Group
1345 ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx,
1348 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1350 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1351 "ecore_imf_context_input_panel_enabled_set");
1355 ctx->input_panel_enabled = enabled;
1359 * Get whether the Input Method Context requests to show the input panel automatically.
1361 * @param ctx An #Ecore_IMF_Context.
1362 * @return Return the attribute to show the input panel automatically
1363 * @ingroup Ecore_IMF_Context_Group
1367 ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx)
1369 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1371 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1372 "ecore_imf_context_input_panel_enabled_get");
1376 return ctx->input_panel_enabled;
1380 * Set the input panel-specific data to deliver to the input panel.
1381 * this API is used by applications to deliver specific data to the input panel.
1382 * the data format MUST be negotiated by both application and the input panel.
1383 * The size and format of data are defined by the input panel.
1385 * @param ctx An #Ecore_IMF_Context.
1386 * @param data The specific data to be set to the input panel.
1387 * @param len the length of data, in bytes, to send to the input panel
1388 * @ingroup Ecore_IMF_Context_Group
1392 ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len)
1394 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1396 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1397 "ecore_imf_context_input_panel_imdata_set");
1403 if (ctx->klass->input_panel_imdata_set)
1404 ctx->klass->input_panel_imdata_set(ctx, data, len);
1408 * Get the specific data of the current active input panel.
1410 * @param ctx An #Ecore_IMF_Context.
1411 * @param data The specific data to be got from the input panel
1412 * @param len The length of data
1413 * @ingroup Ecore_IMF_Context_Group
1417 ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len)
1419 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1421 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1422 "ecore_imf_context_input_panel_imdata_get");
1428 if (ctx->klass->input_panel_imdata_get)
1429 ctx->klass->input_panel_imdata_get(ctx, data, len);
1433 * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
1435 * An input panel displays the string or icon associated with this type
1437 * @param ctx An #Ecore_IMF_Context.
1438 * @param return_key_type The type of "return" key on the input panel
1439 * @ingroup Ecore_IMF_Context_Group
1443 ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type)
1445 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1447 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1448 "ecore_imf_context_input_panel_return_key_type_set");
1452 ctx->input_panel_return_key_type = return_key_type;
1453 if (ctx->klass->input_panel_return_key_type_set) ctx->klass->input_panel_return_key_type_set(ctx, return_key_type);
1457 * Get the "return" key type.
1459 * @see ecore_imf_context_input_panel_return_key_type_set() for more details
1461 * @param ctx An #Ecore_IMF_Context.
1462 * @return The type of "return" key on the input panel
1463 * @ingroup Ecore_IMF_Context_Group
1466 EAPI Ecore_IMF_Input_Panel_Return_Key_Type
1467 ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx)
1469 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1471 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1472 "ecore_imf_context_input_panel_return_key_type_get");
1476 return ctx->input_panel_return_key_type;
1480 * Set the return key on the input panel to be disabled.
1482 * @param ctx An #Ecore_IMF_Context.
1483 * @param disabled The state
1484 * @ingroup Ecore_IMF_Context_Group
1488 ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled)
1490 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1492 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1493 "ecore_imf_context_input_panel_return_key_disabled_set");
1497 ctx->input_panel_return_key_disabled = disabled;
1498 if (ctx->klass->input_panel_return_key_disabled_set) ctx->klass->input_panel_return_key_disabled_set(ctx, disabled);
1502 * Get whether the return key on the input panel should be disabled or not.
1504 * @param ctx An #Ecore_IMF_Context.
1505 * @return EINA_TRUE if it should be disabled
1506 * @ingroup Ecore_IMF_Context_Group
1510 ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx)
1512 if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
1514 ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
1515 "ecore_imf_context_input_panel_return_key_disabled_get");
1519 return ctx->input_panel_return_key_disabled;