From: Ji-hoon Lee Date: Wed, 1 Nov 2017 10:38:28 +0000 (+0900) Subject: Add implementation for finalize_content callback X-Git-Tag: accepted/tizen/unified/20171108.161141~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cb224e7497207fd2f42bd9abcbd75b923fe35314;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Add implementation for finalize_content callback Change-Id: Id4f584a1e2ab463715f7ccad4c0a5f229322894b --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index f84c086..aefb690 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -2012,6 +2012,30 @@ _e_text_input_cb_input_panel_position_set(struct wl_client *client EINA_UNUSED, } static void +_e_text_input_cb_finalize_content(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *text, uint32_t cursor_position) +{ + E_Text_Input *text_input = wl_resource_get_user_data(resource); + E_Input_Method *input_method = NULL; + Eina_List *l = NULL; + + if (!text_input) + { + WTI_WARNING(resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "No Text Input For Resource"); + return; + } + + EINA_LIST_FOREACH(text_input->input_methods, l, input_method) + { + if (!input_method || !input_method->context) continue; + + if (input_method->context->resource) + wl_input_method_context_send_finalized_content(input_method->context->resource, text, cursor_position); + } +} + +static void _e_text_input_cb_resource_destroy(struct wl_resource *resource) { E_Text_Input *text_input = wl_resource_get_user_data(resource); @@ -2079,7 +2103,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = { _e_text_input_cb_set_capital_mode, _e_text_input_cb_prediction_hint_set, _e_text_input_cb_mime_type_accept_set, - _e_text_input_cb_input_panel_position_set + _e_text_input_cb_input_panel_position_set, + _e_text_input_cb_finalize_content }; static void