summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2015-05-27 14:39:37 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2015-05-27 14:39:37 +0900
commitc5f0eea83d3259dd225ed09a805877853a4275e5 (patch)
treecf31d5b3aaf442d0e544592640cc2a4839ef3c65 /src
parent684c51360f1591de4b8aee1f52d4edf8e8353822 (diff)
ecore_imf/wayland: support autocapital mode in wayland text input
@feature
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecore_imf/wayland/wayland_imcontext.c20
-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, 23 insertions, 2 deletions
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c
index adc5367a9e..3e1308133c 100644
--- a/src/modules/ecore_imf/wayland/wayland_imcontext.c
+++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c
@@ -76,6 +76,7 @@ struct _WaylandIMContext
76 uint32_t serial; 76 uint32_t serial;
77 uint32_t reset_serial; 77 uint32_t reset_serial;
78 uint32_t content_purpose; 78 uint32_t content_purpose;
79 uint32_t content_hint;
79}; 80};
80 81
81static unsigned int 82static unsigned int
@@ -646,7 +647,7 @@ wayland_im_context_focus_in(Ecore_IMF_Context *ctx)
646 ecore_wl_window_surface_get(imcontext->window)); 647 ecore_wl_window_surface_get(imcontext->window));
647 648
648 wl_text_input_set_content_type(imcontext->text_input, 649 wl_text_input_set_content_type(imcontext->text_input,
649 WL_TEXT_INPUT_CONTENT_HINT_NONE, 650 imcontext->content_hint,
650 imcontext->content_purpose); 651 imcontext->content_purpose);
651 } 652 }
652} 653}
@@ -818,6 +819,23 @@ wayland_im_context_cursor_location_set(Ecore_IMF_Context *ctx, int x, int y, int
818 } 819 }
819} 820}
820 821
822EAPI void wayland_im_context_autocapital_type_set(Ecore_IMF_Context *ctx,
823 Ecore_IMF_Autocapital_Type autocapital_type)
824{
825 WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx);
826
827 imcontext->content_hint &= ~(WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION |
828 WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE |
829 WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE);
830
831 if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE)
832 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION;
833 else if (autocapital_type == ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER)
834 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_UPPERCASE;
835 else
836 imcontext->content_hint |= WL_TEXT_INPUT_CONTENT_HINT_LOWERCASE;
837}
838
821EAPI void 839EAPI void
822wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout) 840wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
823{ 841{
diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.h b/src/modules/ecore_imf/wayland/wayland_imcontext.h
index 111dd5f010..9ec9f30bc2 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_autocapital_type_set(Ecore_IMF_Context *ctx,
64 Ecore_IMF_Autocapital_Type autocapital_type);
65
63EAPI void wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx, 66EAPI void wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx,
64 Ecore_IMF_Input_Panel_Layout layout); 67 Ecore_IMF_Input_Panel_Layout layout);
65 68
diff --git a/src/modules/ecore_imf/wayland/wayland_module.c b/src/modules/ecore_imf/wayland/wayland_module.c
index d189d6b59f..3e83f74097 100644
--- a/src/modules/ecore_imf/wayland/wayland_module.c
+++ b/src/modules/ecore_imf/wayland/wayland_module.c
@@ -61,7 +61,7 @@ static Ecore_IMF_Context_Class wayland_imf_class =
61 wayland_im_context_filter_event, /* filter_event */ 61 wayland_im_context_filter_event, /* filter_event */
62 wayland_im_context_preedit_string_with_attributes_get, /* preedit_string_with_attribute_get */ 62 wayland_im_context_preedit_string_with_attributes_get, /* preedit_string_with_attribute_get */
63 NULL, /* prediction_allow_set */ 63 NULL, /* prediction_allow_set */
64 NULL, /* autocapital_type_set */ 64 wayland_im_context_autocapital_type_set, /* autocapital_type_set */
65 NULL, /* control panel show */ 65 NULL, /* control panel show */
66 NULL, /* control panel hide */ 66 NULL, /* control panel hide */
67 wayland_im_context_input_panel_layout_set, /* input_panel_layout_set */ 67 wayland_im_context_input_panel_layout_set, /* input_panel_layout_set */