From 8f52305f28ab7a054fe504679631151b4a06a161 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 6 Jul 2015 21:56:31 +0900 Subject: [PATCH] ecore-imf: support input panel state callback Change-Id: I32b101c4deec7bb7c53ec97876158298415eb261 --- .../ecore_imf/wayland/text-client-protocol.h | 9 +++++++++ .../ecore_imf/wayland/wayland_imcontext.c | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/modules/ecore_imf/wayland/text-client-protocol.h b/src/modules/ecore_imf/wayland/text-client-protocol.h index bcad325fce..f6f42f680e 100644 --- a/src/modules/ecore_imf/wayland/text-client-protocol.h +++ b/src/modules/ecore_imf/wayland/text-client-protocol.h @@ -157,6 +157,15 @@ enum wl_text_input_text_direction }; #endif /* WL_TEXT_INPUT_TEXT_DIRECTION_ENUM */ +#ifndef WL_TEXT_INPUT_INPUT_PANEL_STATE_ENUM +#define WL_TEXT_INPUT_INPUT_PANEL_STATE_ENUM +enum wl_text_input_input_panel_state +{ + WL_TEXT_INPUT_INPUT_PANEL_STATE_HIDE = 0, + WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW = 1, +}; +#endif /* WL_TEXT_INPUT_INPUT_PANEL_STATE_ENUM */ + /** * wl_text_input - text input * @enter: enter event diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index aebebf2906..a4b8ae6816 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -588,6 +588,25 @@ text_input_input_panel_state(void *data EINA_UNUSED, struct wl_text_input *text_input EINA_UNUSED, uint32_t state EINA_UNUSED) { + WaylandIMContext *imcontext = (WaylandIMContext *)data; + Ecore_IMF_Input_Panel_State ecore_imf_input_panel_state; + + switch (state) + { + case WL_TEXT_INPUT_INPUT_PANEL_STATE_HIDE: + ecore_imf_input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE; + break; + case WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW: + ecore_imf_input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_SHOW; + break; + default: + ecore_imf_input_panel_state = (Ecore_IMF_Input_Panel_State)state; + break; + } + + ecore_imf_context_input_panel_event_callback_call(imcontext->ctx, + ECORE_IMF_INPUT_PANEL_STATE_EVENT, + ecore_imf_input_panel_state); } static void -- 2.34.1