From: InHong Han Date: Mon, 12 Jun 2017 11:56:48 +0000 (+0900) Subject: Added input_panel_position_set interface X-Git-Tag: accepted/tizen/unified/20170706.193240~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F134042%2F5;p=platform%2Fcore%2Fuifw%2Fisf.git Added input_panel_position_set interface Change-Id: I650377a71e29492ebef9a2d6c8a3651b83d7479e --- diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index d00c790..92fd65f 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -217,6 +217,12 @@ struct _WaylandIMContext Eina_Bool has_conformant; char *prediction_hint; char *mime_type; + + struct + { + int x; + int y; + } input_panel_position; // }; @@ -1654,6 +1660,10 @@ show_input_panel(Ecore_IMF_Context *ctx) if (imcontext->mime_type) wl_text_input_set_mime_type(imcontext->text_input, imcontext->mime_type); + if (imcontext->input_panel_position.x >= 0 && imcontext->input_panel_position.y >= 0) + wl_text_input_set_input_panel_position(imcontext->text_input, + imcontext->input_panel_position.x, imcontext->input_panel_position.y); + SECURE_LOGD ("ctx : %p, layout : %d, layout variation : %d\n", ctx, layout, layout_variation); SECURE_LOGD ("language : %d, cursor position : %d, input hint : %#x, bidi direction : %d\n", @@ -1669,6 +1679,8 @@ show_input_panel(Ecore_IMF_Context *ctx) ecore_imf_context_client_window_get (ctx), (imcontext->content_hint & WL_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA) ? 1 : 0, ecore_imf_context_prediction_allow_get (ctx)); + SECURE_LOGD ("mime_type : %s, input panel position x : %d, y : %d\n", + imcontext->mime_type, imcontext->input_panel_position.x, imcontext->input_panel_position.y); if (_active_context_canvas && !evas_focus_state_get (_active_context_canvas)) { LOGW ("Canvas does not have focus!\n"); @@ -2567,6 +2579,9 @@ wayland_im_context_add(Ecore_IMF_Context *ctx) imcontext->caps_mask = MOD_CAPS_MASK; imcontext->num_mask = MOD_NUM_MASK; + imcontext->input_panel_position.x = -1; + imcontext->input_panel_position.y = -1; + imcontext->text_input = wl_text_input_manager_create_text_input(imcontext->text_input_manager); @@ -2698,6 +2713,10 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx) if (imcontext->mime_type) wl_text_input_set_mime_type(imcontext->text_input, imcontext->mime_type); + + if (imcontext->input_panel_position.x >= 0 && imcontext->input_panel_position.y >= 0) + wl_text_input_set_input_panel_position(imcontext->text_input, + imcontext->input_panel_position.x, imcontext->input_panel_position.y); } if (ecore_imf_context_input_panel_enabled_get(ctx)) @@ -3460,6 +3479,24 @@ wayland_im_context_mime_type_accept_set (Ecore_IMF_Context *ctx, const char *mim } } +void +wayland_im_context_input_panel_position_set (Ecore_IMF_Context *ctx, int x, int y) +{ + WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); + if (!imcontext) return; + + if ((imcontext->input_panel_position.x != x) || (imcontext->input_panel_position.y != y)) { + imcontext->input_panel_position.x = x; + imcontext->input_panel_position.y = y; + } + + if (imcontext->input && imcontext->text_input) { + LOGD ("ctx : %p, x = %d, y = %d\n", ctx, x, y); + wl_text_input_set_input_panel_position(imcontext->text_input, + imcontext->input_panel_position.x, imcontext->input_panel_position.y); + } +} + WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager) { WaylandIMContext *context = calloc(1, sizeof(WaylandIMContext)); diff --git a/ism/extras/wayland_immodule/wayland_imcontext.h b/ism/extras/wayland_immodule/wayland_imcontext.h index ffd3c16..ae16469 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.h +++ b/ism/extras/wayland_immodule/wayland_imcontext.h @@ -128,6 +128,9 @@ wayland_im_context_prediction_hint_set (Ecore_IMF_Context *ctx, const char *pred void wayland_im_context_mime_type_accept_set (Ecore_IMF_Context *ctx, const char *mime_type); +void +wayland_im_context_input_panel_position_set (Ecore_IMF_Context *ctx, int x, int y); + WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager); extern int _ecore_imf_wayland_log_dom; diff --git a/ism/extras/wayland_immodule/wayland_module.c b/ism/extras/wayland_immodule/wayland_module.c index 3d7b744..01d0ee6 100644 --- a/ism/extras/wayland_immodule/wayland_module.c +++ b/ism/extras/wayland_immodule/wayland_module.c @@ -81,7 +81,8 @@ static Ecore_IMF_Context_Class wayland_imf_class = wayland_im_context_bidi_direction_set, /* bidi_direction_set */ wayland_im_context_input_panel_keyboard_mode_get, /* input_panel_keyboard_mode_get */ wayland_im_context_prediction_hint_set, /* prediction_hint_set */ - wayland_im_context_mime_type_accept_set /* mime_type_accept_set */ + wayland_im_context_mime_type_accept_set, /* mime_type_accept_set */ + wayland_im_context_input_panel_position_set/* input_panel_position_set */ }; static struct wl_text_input_manager *text_input_manager = NULL;