summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2015-05-20 18:47:58 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2015-05-20 18:47:58 +0900
commit21106fd5f0bb96229f5fc6ff6ccb10eb2d57db3d (patch)
tree50bb9a1b56befcd7041f3ad837a8e36757459182 /src
parente41d1f2cb4bac7a7e33b3f2d5b5abac0222498b8 (diff)
ecore_imf/wayland: support feature to change layout of virtual keyboard
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c46
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.h3
-rw-r--r--src/modules/ecore_imf/wayland/wayland_module.c2
3 files changed, 50 insertions, 1 deletions
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index d6679bddd7..adc5367a9e 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -75,6 +75,7 @@ struct _WaylandIMContext
75 75
76 uint32_t serial; 76 uint32_t serial;
77 uint32_t reset_serial; 77 uint32_t reset_serial;
78 uint32_t content_purpose;
78}; 79};
79 80
80static unsigned int 81static unsigned int
@@ -643,6 +644,10 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
643 wl_text_input_show_input_panel(imcontext->text_input); 644 wl_text_input_show_input_panel(imcontext->text_input);
644 wl_text_input_activate(imcontext->text_input, seat, 645 wl_text_input_activate(imcontext->text_input, seat,
645 ecore_wl_window_surface_get(imcontext->window)); 646 ecore_wl_window_surface_get(imcontext->window));
647
648 wl_text_input_set_content_type(imcontext->text_input,
649 WL_TEXT_INPUT_CONTENT_HINT_NONE,
650 imcontext->content_purpose);
646 } 651 }
647} 652}
648 653
@@ -813,6 +818,47 @@ wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
813 } 818 }
814} 819}
815 820
821EAPI void
822wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
823{
824 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
825
826 switch (layout) {
827 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBER:
828 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
829 break;
830 case ECORE_IMF_INPUT_PANEL_LAYOUT_EMAIL:
831 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_EMAIL;
832 break;
833 case ECORE_IMF_INPUT_PANEL_LAYOUT_URL:
834 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_URL;
835 break;
836 case ECORE_IMF_INPUT_PANEL_LAYOUT_PHONENUMBER:
837 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PHONE;
838 break;
839 case ECORE_IMF_INPUT_PANEL_LAYOUT_IP:
840 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
841 break;
842 case ECORE_IMF_INPUT_PANEL_LAYOUT_MONTH:
843 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATE;
844 break;
845 case ECORE_IMF_INPUT_PANEL_LAYOUT_NUMBERONLY:
846 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS;
847 break;
848 case ECORE_IMF_INPUT_PANEL_LAYOUT_TERMINAL:
849 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL;
850 break;
851 case ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD:
852 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD;
853 break;
854 case ECORE_IMF_INPUT_PANEL_LAYOUT_DATETIME:
855 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_DATETIME;
856 break;
857 default:
858 imcontext->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
859 break;
860 }
861}
816 862
817WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager) 863WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager)
818{ 864{
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.h b/src/modules/ecore_imf/wayland/wayland_imcontext.h
index fb6906c2e8..111dd5f010 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.h
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.h
@@ -60,6 +60,9 @@ EAPI void wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx,
60 int width, 60 int width,
61 int height); 61 int height);
62 62
63EAPI void wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx,
64 Ecore_IMF_Input_Panel_Layout layout);
65
63WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager); 66WaylandIMContext *wayland_im_context_new (struct wl_text_input_manager *text_input_manager);
64 67
65extern int _ecore_imf_wayland_log_dom; 68extern int _ecore_imf_wayland_log_dom;
diff --git a/src/modules/ecore_imf/wayland/wayland_module.c b/src/modules/ecore_imf/wayland/wayland_module.c
index 13d09f257b..d189d6b59f 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -64,7 +64,7 @@ static Ecore_IMF_Context_Class wayland_imf_class =
64 NULL, /* autocapital_type_set */ 64 NULL, /* autocapital_type_set */
65 NULL, /* control panel show */ 65 NULL, /* control panel show */
66 NULL, /* control panel hide */ 66 NULL, /* control panel hide */
67 NULL, /* input_panel_layout_set */ 67 wayland_im_context_input_panel_layout_set, /* input_panel_layout_set */
68 NULL, /* input_panel_layout_get, */ 68 NULL, /* input_panel_layout_get, */
69 NULL, /* input_panel_language_set, */ 69 NULL, /* input_panel_language_set, */
70 NULL, /* input_panel_language_get, */ 70 NULL, /* input_panel_language_get, */