From 63afd50b38065dc022ba2f0edcb6a524818604d2 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Fri, 10 Feb 2017 13:53:45 +0900 Subject: [PATCH] Support input_context_reset and language_request callback Change-Id: Ie9bb443a340d2307d12e7de4eff707534facbb22 Signed-off-by: Jihoon Kim --- src/ise.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ise.cpp b/src/ise.cpp index 6041d97..8e68ae2 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -1937,12 +1937,22 @@ static void ime_app_return_key_state_set_cb(bool disabled, void *user_data) g_core_event_callback.on_set_return_key_disable(disabled); } +static void ime_app_input_context_reset_cb(void *user_data) +{ + ise_reset_input_context(); +} + static void ime_app_cursor_position_updated_cb(int cursor_pos, void *user_data) { LOGD("cursor position : %d\n", cursor_pos); g_core_event_callback.on_update_cursor_position(g_ic, "", cursor_pos); } +static void ime_app_language_requested_cb(void *user_data, char **lang_code) +{ + ise_get_language_locale(lang_code); +} + static void ime_app_surrounding_text_updated_cb(int context_id, const char *text, int cursor_pos, void *user_data) { LOGD("cursor position : %d\n", cursor_pos); @@ -2029,6 +2039,7 @@ static void ime_app_lookup_table_changed_cb(Eina_List *list, void *user_data) } } + g_softcandidate_string = candidate_strings; ise_update_table(candidate_strings); } @@ -2152,15 +2163,15 @@ EXPORTED void ime_app_main(int argc, char **argv) ime_event_set_accessibility_state_changed_cb(ime_app_accessibility_state_changed_cb, NULL); ime_event_set_layout_set_cb(ime_app_layout_set_cb, NULL); ime_event_set_caps_mode_changed_cb(ime_app_caps_mode_changed_cb, NULL); - ime_event_set_cursor_position_updated_cb(ime_app_cursor_position_updated_cb, NULL); ime_event_set_surrounding_text_updated_cb(ime_app_surrounding_text_updated_cb, NULL); ime_event_set_return_key_type_set_cb(ime_app_return_key_type_set_cb, NULL); ime_event_set_return_key_state_set_cb(ime_app_return_key_state_set_cb, NULL); ime_event_set_imdata_set_cb(ime_app_imdata_set_cb, NULL); + ime_event_set_process_key_event_cb(ime_app_process_key_event_cb, NULL); + ime_event_set_option_window_created_cb(ime_app_option_window_created_cb, NULL); ime_event_set_option_window_destroyed_cb(ime_app_option_window_destroyed_cb, NULL); - ime_event_set_process_key_event_cb(ime_app_process_key_event_cb, NULL); ime_event_set_candidate_show_cb(ime_app_candidate_show_cb, NULL); ime_event_set_candidate_hide_cb(ime_app_candidate_hide_cb, NULL); @@ -2170,6 +2181,9 @@ EXPORTED void ime_app_main(int argc, char **argv) ime_event_set_process_input_device_event_cb(ime_app_process_input_device_event_cb, NULL); #endif + ime_event_set_input_context_reset_cb(ime_app_input_context_reset_cb, NULL); + ime_event_set_language_requested_cb(ime_app_language_requested_cb, NULL); + ime_run(&basic_callback, NULL); } #ifdef __cplusplus -- 2.7.4