From a272f18d985d002e8fb2a0d790b7223c0273ad43 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 28 May 2015 19:29:25 +0900 Subject: [PATCH] support input hint in wayland Change-Id: Id87cc7ff371b936eaf34a3872be4b879a6e810c6 --- ism/extras/efl_wsc/isf_wsc_context.cpp | 20 ++++++++++++++++++++ ism/extras/efl_wsc/isf_wsc_context.h | 1 + ism/extras/efl_wsc/isf_wsc_control_ui.cpp | 2 ++ 3 files changed, 23 insertions(+) diff --git a/ism/extras/efl_wsc/isf_wsc_context.cpp b/ism/extras/efl_wsc/isf_wsc_context.cpp index 1b00f3f..cb1505e 100644 --- a/ism/extras/efl_wsc/isf_wsc_context.cpp +++ b/ism/extras/efl_wsc/isf_wsc_context.cpp @@ -1343,6 +1343,26 @@ bool wsc_context_input_panel_password_mode_get (weescim *ctx) return false; } +Ecore_IMF_Input_Hints wsc_context_input_hint_get (weescim *ctx) +{ + int input_hint = ECORE_IMF_INPUT_HINT_NONE; + + if (!ctx) + return (Ecore_IMF_Input_Hints)input_hint; + + if (ctx->content_hint & WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA) + input_hint |= ECORE_IMF_INPUT_HINT_SENSITIVE_DATA; + else + input_hint &= ~ECORE_IMF_INPUT_HINT_SENSITIVE_DATA; + + if (ctx->content_hint & WL_TEXT_INPUT_CONTENT_HINT_AUTO_COMPLETION) + input_hint |= ECORE_IMF_INPUT_HINT_AUTO_COMPLETE; + else + input_hint &= ~ECORE_IMF_INPUT_HINT_AUTO_COMPLETE; + + return (Ecore_IMF_Input_Hints)input_hint; +} + void wsc_context_delete_surrounding (weescim *ctx, int offset, int len) { if (!ctx) diff --git a/ism/extras/efl_wsc/isf_wsc_context.h b/ism/extras/efl_wsc/isf_wsc_context.h index b65a372..96e96c9 100644 --- a/ism/extras/efl_wsc/isf_wsc_context.h +++ b/ism/extras/efl_wsc/isf_wsc_context.h @@ -109,6 +109,7 @@ void wsc_context_delete_surrounding (weescim *ctx, int offset, int len); Ecore_IMF_Autocapital_Type wsc_context_autocapital_type_get (weescim *ctx); Ecore_IMF_Input_Panel_Lang wsc_context_input_panel_language_get (weescim *ctx); bool wsc_context_input_panel_password_mode_get (weescim *ctx); +Ecore_IMF_Input_Hints wsc_context_input_hint_get (weescim *ctx); void wsc_context_commit_preedit_string(weescim *ctx); void wsc_context_commit_string(weescim *ctx, const char *str); void wsc_context_send_preedit_string(weescim *ctx); diff --git a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp index 0a5b134..8cb2edf 100644 --- a/ism/extras/efl_wsc/isf_wsc_control_ui.cpp +++ b/ism/extras/efl_wsc/isf_wsc_control_ui.cpp @@ -147,6 +147,8 @@ void isf_wsc_context_input_panel_show (WSCContextISF* ctx) iseContext.autocapital_type = wsc_context_autocapital_type_get (ctx->ctx); + iseContext.input_hint = wsc_context_input_hint_get (ctx->ctx); + LOGD ("ctx : %p, layout : %d, layout variation : %d\n", ctx, iseContext.layout, iseContext.layout_variation); LOGD ("language : %d, cursor position : %d, caps mode : %d\n", iseContext.language, iseContext.cursor_pos, iseContext.caps_mode); LOGD ("return_key_type : %d, return_key_disabled : %d, autocapital type : %d\n", iseContext.return_key_type, iseContext.return_key_disabled, iseContext.autocapital_type); -- 2.7.4