summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
diff options
context:
space:
mode:
authorJihoon Kim <imfine98@gmail.com>2012-03-16 06:44:05 +0000
committerJihoon Kim <imfine98@gmail.com>2012-03-16 06:44:05 +0000
commitbb9620f3e082927d459516fbe5e2ca4d1c88c379 (patch)
treed37298bac5a36aef3d14b14001673988f25aed49 /legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
parenta15108fbd68ff9eef243e4e8c2c88087e6df24f2 (diff)
ecore_imf: add example code in doxygen
SVN revision: 69449
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c131
1 files changed, 131 insertions, 0 deletions
diff --git a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
index 8cd76bd1dd..947de616fb 100644
--- a/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
+++ b/legacy/ecore/src/lib/ecore_imf/ecore_imf_context.c
@@ -143,6 +143,32 @@ ecore_imf_context_default_id_by_canvas_type_get(const char *canvas_type)
143 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id; 143 * @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
144 * on failure it returns NULL. 144 * on failure it returns NULL.
145 * @ingroup Ecore_IMF_Context_Group 145 * @ingroup Ecore_IMF_Context_Group
146 *
147 * Example
148 * @code
149 *
150 * const char *ctx_id;
151 * const Ecore_IMF_Context_Info *ctx_info;
152 * Ecore_IMF_Context *imf_context;
153 * ctx_id = ecore_imf_context_default_id_get();
154 * if (ctx_id)
155 * {
156 * ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
157 * if (!ctx_info->canvas_type ||
158 * strcmp(ctx_info->canvas_type, "evas") == 0)
159 * {
160 * imf_context = ecore_imf_context_add(ctx_id);
161 * }
162 * else
163 * {
164 * ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
165 * if (ctx_id)
166 * {
167 * imf_context = ecore_imf_context_add(ctx_id);
168 * }
169 * }
170 * }
171 * @endcode
146 */ 172 */
147EAPI const Ecore_IMF_Context_Info * 173EAPI const Ecore_IMF_Context_Info *
148ecore_imf_context_info_by_id_get(const char *id) 174ecore_imf_context_info_by_id_get(const char *id)
@@ -417,6 +443,41 @@ ecore_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char **str, int *cu
417 * @param cursor_pos Location to store position of cursor (in characters) 443 * @param cursor_pos Location to store position of cursor (in characters)
418 * within the preedit string. 444 * within the preedit string.
419 * @ingroup Ecore_IMF_Context_Group 445 * @ingroup Ecore_IMF_Context_Group
446 *
447 * Example
448 * @code
449 * char *preedit_string;
450 * int cursor_pos;
451 * Eina_List *attrs = NULL, *l = NULL;
452 * Ecore_IMF_Preedit_Attr *attr;
453 *
454 * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
455 * &preedit_string,
456 * &attrs, &cursor_pos);
457 * if (!preedit_string) return;
458 *
459 * if (strlen(preedit_string) > 0)
460 * {
461 * if (attrs)
462 * {
463 * EINA_LIST_FOREACH(attrs, l, attr)
464 * {
465 * if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
466 * {
467 * // Something to do
468 * }
469 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
470 * {
471 * // Something to do
472 * }
473 * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
474 * {
475 * // Something to do
476 * }
477 * }
478 * }
479 * }
480 * @endcode
420 * @since 1.1.0 481 * @since 1.1.0
421 */ 482 */
422EAPI void 483EAPI void
@@ -444,6 +505,18 @@ ecore_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, cha
444 * 505 *
445 * @param ctx An #Ecore_IMF_Context. 506 * @param ctx An #Ecore_IMF_Context.
446 * @ingroup Ecore_IMF_Context_Group 507 * @ingroup Ecore_IMF_Context_Group
508 *
509 * Example
510 * @code
511 * static void
512 * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
513 * {
514 * ecore_imf_context_reset(imf_context);
515 * ecore_imf_context_focus_in(imf_context);
516 * }
517 *
518 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, ed);
519 * @endcode
447 */ 520 */
448EAPI void 521EAPI void
449ecore_imf_context_focus_in(Ecore_IMF_Context *ctx) 522ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
@@ -463,6 +536,18 @@ ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
463 * 536 *
464 * @param ctx An #Ecore_IMF_Context. 537 * @param ctx An #Ecore_IMF_Context.
465 * @ingroup Ecore_IMF_Context_Group 538 * @ingroup Ecore_IMF_Context_Group
539 *
540 * Example
541 * @code
542 * static void
543 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
544 * {
545 * ecore_imf_context_reset(imf_context);
546 * ecore_imf_context_focus_out(imf_context);
547 * }
548 *
549 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
550 * @endcode
466 */ 551 */
467EAPI void 552EAPI void
468ecore_imf_context_focus_out(Ecore_IMF_Context *ctx) 553ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
@@ -483,6 +568,18 @@ ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
483 * 568 *
484 * @param ctx An #Ecore_IMF_Context. 569 * @param ctx An #Ecore_IMF_Context.
485 * @ingroup Ecore_IMF_Context_Group 570 * @ingroup Ecore_IMF_Context_Group
571 *
572 * Example
573 * @code
574 * static void
575 * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
576 * {
577 * ecore_imf_context_reset(imf_context);
578 * ecore_imf_context_focus_out(imf_context);
579 * }
580 *
581 * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
582 * @endcode
486 */ 583 */
487EAPI void 584EAPI void
488ecore_imf_context_reset(Ecore_IMF_Context *ctx) 585ecore_imf_context_reset(Ecore_IMF_Context *ctx)
@@ -738,6 +835,28 @@ ecore_imf_context_input_mode_get(Ecore_IMF_Context *ctx)
738 * @param event The event itself. 835 * @param event The event itself.
739 * @return EINA_TRUE if the event was handled; otherwise EINA_FALSE. 836 * @return EINA_TRUE if the event was handled; otherwise EINA_FALSE.
740 * @ingroup Ecore_IMF_Context_Group 837 * @ingroup Ecore_IMF_Context_Group
838 *
839 * Example
840 * @code
841 * static void
842 * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
843 * {
844 * Evas_Event_Key_Down *ev = event_info;
845 * if (!ev->keyname) return;
846 *
847 * if (imf_context)
848 * {
849 * Ecore_IMF_Event_Key_Down ecore_ev;
850 * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
851 * if (ecore_imf_context_filter_event(imf_context,
852 * ECORE_IMF_EVENT_KEY_DOWN,
853 * (Ecore_IMF_Event *)&ecore_ev))
854 * return;
855 * }
856 * }
857 *
858 * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
859 * @endcode
741 */ 860 */
742EAPI Eina_Bool 861EAPI Eina_Bool
743ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event) 862ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
@@ -1062,6 +1181,18 @@ ecore_imf_context_delete_surrounding_event_add(Ecore_IMF_Context *ctx, int offse
1062 * @param data The data pointer to be passed to @p func 1181 * @param data The data pointer to be passed to @p func
1063 * @ingroup Ecore_IMF_Context_Group 1182 * @ingroup Ecore_IMF_Context_Group
1064 * @since 1.2.0 1183 * @since 1.2.0
1184 *
1185 * Example
1186 * @code
1187 * static void
1188 * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
1189 * {
1190 * char *commit_str = event_info;
1191 * // something to do
1192 * }
1193 *
1194 * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
1195 * @endcode
1065 */ 1196 */
1066EAPI void 1197EAPI void
1067ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data) 1198ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)