1 <?xml version="1.0" encoding="UTF-8"?>
2 <protocol name="input_method">
4 Copyright © 2012 Intel Corporation
6 Permission to use, copy, modify, distribute, and sell this
7 software and its documentation for any purpose is hereby granted
8 without fee, provided that the above copyright notice appear in
9 all copies and that both that copyright notice and this permission
10 notice appear in supporting documentation, and that the name of
11 the copyright holders not be used in advertising or publicity
12 pertaining to distribution of the software without specific,
13 written prior permission. The copyright holders make no
14 representations about the suitability of this software for any
15 purpose. It is provided "as is" without express or implied
18 THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
19 SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
23 AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
29 <interface name="input_method_context" version="1">
30 <description summary="input method context">
31 Corresponds to a text model on input method side. An input method context
32 is created on text mode activation on the input method side. It allows to
33 receive information about the text model from the application via events.
34 Input method contexts do not keep state after deactivation and should be
35 destroyed after deactivation is handled.
37 <request name="destroy" type="destructor"/>
38 <request name="commit_string">
39 <description summary="commit string">
40 Send the commit string text to the applications text model and
41 set the cursor at index (as byte index) relative to the
42 beginning of inserted text.
44 <arg name="serial" type="uint"/>
45 <arg name="text" type="string"/>
47 <request name="preedit_string">
48 <description summary="pre-edit string">
49 Send the pre-edit string text to the applications text model. The commit
50 text can be used to replace the preedit text on reset (for example on
53 <arg name="serial" type="uint"/>
54 <arg name="text" type="string"/>
55 <arg name="commit" type="string"/>
57 <request name="preedit_styling">
58 <description summary="pre-edit styling">
59 Sets styling information on composing text. The style is applied for
60 length (in bytes) characters from index relative to the beginning of the
61 composing text (as byte index). Multiple styles can be applied to a
64 This request should be sent before sending preedit_string request.
66 <arg name="serial" type="uint"/>
67 <arg name="index" type="uint"/>
68 <arg name="length" type="uint"/>
69 <arg name="style" type="uint"/>
71 <request name="preedit_cursor">
72 <description summary="pre-edit cursor">
73 Sets the cursor position inside the composing text (as byte index)
74 relative to the start of the composing text.
76 This request should be sent before sending preedit_string request.
78 <arg name="serial" type="uint"/>
79 <arg name="index" type="int"/>
81 <request name="delete_surrounding_text">
82 <arg name="serial" type="uint"/>
83 <arg name="index" type="int"/>
84 <arg name="length" type="uint"/>
86 <request name="cursor_position">
87 <arg name="serial" type="uint"/>
88 <arg name="index" type="int"/>
89 <arg name="anchor" type="int"/>
91 <request name="modifiers_map">
92 <arg name="map" type="array"/>
94 <request name="keysym">
95 <description summary="keysym">
96 Notify when a key event was sent. Key events should not be used for
97 normal text input operations, which should be done with commit_string,
98 delete_surrounfing_text, etc. The key event follows the wl_keyboard key
99 event convention. Sym is a XKB keysym, state a wl_keyboard key_state.
101 <arg name="serial" type="uint"/>
102 <arg name="time" type="uint"/>
103 <arg name="sym" type="uint"/>
104 <arg name="state" type="uint"/>
105 <arg name="modifiers" type="uint"/>
107 <request name="grab_keyboard">
108 <description summary="grab hardware keyboard">
109 Allows an input method to receive hardware keyboard input and process
110 key events to generate text events (with pre-edit) over the wire. This
111 allows input methods which compose multiple key events for inputting
112 text like it is done for CJK languages.
114 <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
117 <arg name="serial" type="uint"/>
118 <arg name="time" type="uint"/>
119 <arg name="key" type="uint"/>
120 <arg name="state" type="uint"/>
122 <request name="modifiers">
123 <arg name="serial" type="uint"/>
124 <arg name="mods_depressed" type="uint"/>
125 <arg name="mods_latched" type="uint"/>
126 <arg name="mods_locked" type="uint"/>
127 <arg name="group" type="uint"/>
129 <request name="language">
130 <arg name="serial" type="uint"/>
131 <arg name="language" type="string"/>
133 <request name="text_direction">
134 <arg name="serial" type="uint"/>
135 <arg name="direction" type="uint"/>
137 <event name="surrounding_text">
138 <description summary="surrounding text event">
139 The plain surrounding text around the input position. Cursor is the
140 position in bytes within the surrounding text relative to the beginning
141 of the text. Anchor is the position in bytes of the selection anchor
142 within the surrounding text relative to the beginning of the text. If
143 there is no selected text anchor is the same as cursor.
145 <arg name="text" type="string"/>
146 <arg name="cursor" type="uint"/>
147 <arg name="anchor" type="uint"/>
150 <arg name="serial" type="uint"/>
152 <event name="content_type">
153 <arg name="hint" type="uint"/>
154 <arg name="purpose" type="uint"/>
156 <event name="invoke_action">
157 <arg name="button" type="uint"/>
158 <arg name="index" type="uint"/>
160 <event name="commit"/>
161 <event name="preferred_language">
162 <arg name="language" type="string"/>
166 <interface name="input_method" version="1">
167 <description summary="input method">
168 An input method object is responsible to compose text in response to
169 input from hardware or virtual keyboards. There is one input method
170 object per seat. On activate there is a new input method context object
171 created which allows the input method to communicate with the text model.
173 <event name="activate">
174 <description summary="activate event">
175 A text model was activated. Creates an input method context object
176 which allows communication with the text model.
178 <arg name="id" type="new_id" interface="input_method_context"/>
179 <arg name="serial" type="uint"/>
181 <event name="deactivate">
182 <description summary="activate event">
183 The text model corresponding to the context argument was deactivated.
184 The input method context should be destroyed after deactivation is
187 <arg name="context" type="object" interface="input_method_context"/>
191 <interface name="input_panel" version="1">
192 <description summary="interface for implementing keyboards">
193 Only one client can bind this interface at a time.
196 <request name="get_input_panel_surface">
197 <arg name="id" type="new_id" interface="input_panel_surface"/>
198 <arg name="surface" type="object" interface="wl_surface"/>
202 <interface name="input_panel_surface" version="1">
203 <enum name="position">
204 <entry name="center_bottom" value="0"/>
207 <request name="set_toplevel">
208 <description summary="set the surface type as a keyboard">
209 A keybaord surface is only shown, when a text model is active
211 <arg name="position" type="uint"/>
214 <request name="set_panel">