1
<?xml version="1.0" encoding="UTF-8"?>
5
Copyright © 2012, 2013 Intel Corporation
7
Permission to use, copy, modify, distribute, and sell this
8
software and its documentation for any purpose is hereby granted
9
without fee, provided that the above copyright notice appear in
10
all copies and that both that copyright notice and this permission
11
notice appear in supporting documentation, and that the name of
12
the copyright holders not be used in advertising or publicity
13
pertaining to distribution of the software without specific,
14
written prior permission. The copyright holders make no
15
representations about the suitability of this software for any
16
purpose. It is provided "as is" without express or implied
19
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
29
<interface name="wl_text_input" version="1">
30
<description summary="text input">
31
An object used for text input. Adds support for text input and input
32
methods to applications. A text-input object is created from a
33
wl_text_input_manager and corresponds typically to a text entry in an
35
Requests are used to activate/deactivate the text-input object and set
36
state information like surrounding and selected text or the content type.
37
The information about entered text is sent to the text-input object via
38
the pre-edit and commit events. Using this interface removes the need
39
for applications to directly process hardware key events and compose text
42
Text is generally UTF-8 encoded, indices and lengths are in bytes.
44
Serials are used to synchronize the state between the text input and
45
an input method. New serials are sent by the text input in the
46
commit_state request and are used by the input method to indicate
47
the known text input state in events like preedit_string, commit_string,
48
and keysym. The text input can then ignore events from the input method
49
which are based on an outdated state (for example after a reset).
51
<request name="activate">
52
<description summary="request activation">
53
Requests the text-input object to be activated (typically when the
54
text entry gets focus).
55
The seat argument is a wl_seat which maintains the focus for this
56
activation. The surface argument is a wl_surface assigned to the
57
text-input object and tracked for focus lost. The enter event
58
is emitted on successful activation.
60
<arg name="seat" type="object" interface="wl_seat"/>
61
<arg name="surface" type="object" interface="wl_surface"/>
63
<request name="deactivate">
64
<description summary="request deactivation">
65
Requests the text-input object to be deactivated (typically when the
66
text entry lost focus). The seat argument is a wl_seat which was used
69
<arg name="seat" type="object" interface="wl_seat"/>
71
<request name="show_input_panel">
72
<description summary="show input panels">
73
Requests input panels (virtual keyboard) to show.
76
<request name="hide_input_panel">
77
<description summary="hide input panels">
78
Requests input panels (virtual keyboard) to hide.
81
<request name="reset">
82
<description summary="reset">
83
Should be called by an editor widget when the input state should be
84
reset, for example after the text was changed outside of the normal
88
<request name="set_surrounding_text">
89
<description summary="sets the surrounding text">
90
Sets the plain surrounding text around the input position. Text is
91
UTF-8 encoded. Cursor is the byte offset within the
92
surrounding text. Anchor is the byte offset of the
93
selection anchor within the surrounding text. If there is no selected
94
text anchor is the same as cursor.
96
<arg name="text" type="string"/>
97
<arg name="cursor" type="uint"/>
98
<arg name="anchor" type="uint"/>
100
<enum name="content_hint">
101
<description summary="content hint">
102
Content hint is a bitmask to allow to modify the behavior of the text
105
<entry name="none" value="0x0" summary="no special behaviour"/>
106
<entry name="default" value="0x7" summary="auto completion, correction and capitalization"/>
107
<entry name="password" value="0xc0" summary="hidden and sensitive text"/>
108
<entry name="auto_completion" value="0x1" summary="suggest word completions"/>
109
<entry name="auto_correction" value="0x2" summary="suggest word corrections"/>
110
<entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
111
<entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
112
<entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
113
<entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
114
<entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
115
<entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
116
<entry name="latin" value="0x100" summary="just latin characters should be entered"/>
117
<entry name="multiline" value="0x200" summary="the text input is multiline"/>
119
<enum name="content_purpose">
120
<description summary="content purpose">
121
The content purpose allows to specify the primary purpose of a text
124
This allows an input method to show special purpose input panels with
125
extra characters or to disallow some characters.
127
<entry name="normal" value="0" summary="default input, allowing all characters"/>
128
<entry name="alpha" value="1" summary="allow only alphabetic characters"/>
129
<entry name="digits" value="2" summary="allow only digits"/>
130
<entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
131
<entry name="phone" value="4" summary="input a phone number"/>
132
<entry name="url" value="5" summary="input an URL"/>
133
<entry name="email" value="6" summary="input an email address"/>
134
<entry name="name" value="7" summary="input a name of a person"/>
135
<entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/>
136
<entry name="date" value="9" summary="input a date"/>
137
<entry name="time" value="10" summary="input a time"/>
138
<entry name="datetime" value="11" summary="input a date and time"/>
139
<entry name="terminal" value="12" summary="input for a terminal"/>
141
<request name="set_content_type">
142
<description summary="set content purpose and hint">
143
Sets the content purpose and content hint. While the purpose is the
144
basic purpose of an input field, the hint flags allow to modify some
147
When no content type is explicitly set, a normal content purpose with
148
default hints (auto completion, auto correction, auto capitalization)
151
<arg name="hint" type="uint"/>
152
<arg name="purpose" type="uint"/>
154
<request name="set_cursor_rectangle">
155
<arg name="x" type="int"/>
156
<arg name="y" type="int"/>
157
<arg name="width" type="int"/>
158
<arg name="height" type="int"/>
160
<request name="set_preferred_language">
161
<description summary="sets preferred language">
162
Sets a specific language. This allows for example a virtual keyboard to
163
show a language specific layout. The "language" argument is a RFC-3066
166
It could be used for example in a word processor to indicate language of
167
currently edited document or in an instant message application which tracks
168
languages of contacts.
170
<arg name="language" type="string"/>
172
<request name="commit_state">
173
<arg name="serial" type="uint" summary="used to identify the known state"/>
175
<request name="invoke_action">
176
<arg name="button" type="uint"/>
177
<arg name="index" type="uint"/>
180
<description summary="enter event">
181
Notify the text-input object when it received focus. Typically in
182
response to an activate request.
184
<arg name="surface" type="object" interface="wl_surface"/>
187
<description summary="leave event">
188
Notify the text-input object when it lost focus. Either in response
189
to a deactivate request or when the assigned surface lost focus or was
193
<event name="modifiers_map">
194
<description summary="modifiers map">
195
Transfer an array of 0-terminated modifiers names. The position in
196
the array is the index of the modifier as used in the modifiers
197
bitmask in the keysym event.
199
<arg name="map" type="array"/>
201
<event name="input_panel_state">
202
<description summary="state of the input panel">
203
Notify when the visibility state of the input panel changed.
205
<arg name="state" type="uint"/>
207
<event name="preedit_string">
208
<description summary="pre-edit">
209
Notify when a new composing text (pre-edit) should be set around the
210
current cursor position. Any previously set composing text should
213
The commit text can be used to replace the preedit text on reset
214
(for example on unfocus).
216
The text input should also handle all preedit_style and preedit_cursor
217
events occuring directly before preedit_string.
219
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
220
<arg name="text" type="string"/>
221
<arg name="commit" type="string"/>
223
<enum name="preedit_style">
224
<entry name="default" value="0" summary="default style for composing text"/>
225
<entry name="none" value="1" summary="style should be the same as in non-composing text"/>
226
<entry name="active" value="2"/>
227
<entry name="inactive" value="3"/>
228
<entry name="highlight" value="4"/>
229
<entry name="underline" value="5"/>
230
<entry name="selection" value="6"/>
231
<entry name="incorrect" value="7"/>
233
<event name="preedit_styling">
234
<description summary="pre-edit styling">
235
Sets styling information on composing text. The style is applied for
236
length bytes from index relative to the beginning of the composing
237
text (as byte offset). Multiple styles can
238
be applied to a composing text by sending multiple preedit_styling
241
This event is handled as part of a following preedit_string event.
243
<arg name="index" type="uint"/>
244
<arg name="length" type="uint"/>
245
<arg name="style" type="uint"/>
247
<event name="preedit_cursor">
248
<description summary="pre-edit cursor">
249
Sets the cursor position inside the composing text (as byte
250
offset) relative to the start of the composing text. When index is a
251
negative number no cursor is shown.
253
This event is handled as part of a following preedit_string event.
255
<arg name="index" type="int"/>
257
<event name="commit_string">
258
<description summary="commit">
259
Notify when text should be inserted into the editor widget. The text to
260
commit could be either just a single character after a key press or the
261
result of some composing (pre-edit). It could be also an empty text
262
when some text should be removed (see delete_surrounding_text) or when
263
the input cursor should be moved (see cursor_position).
265
Any previously set composing text should be removed.
267
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
268
<arg name="text" type="string"/>
270
<event name="cursor_position">
271
<description summary="set cursor to new position">
272
Notify when the cursor or anchor position should be modified.
274
This event should be handled as part of a following commit_string
277
<arg name="index" type="int"/>
278
<arg name="anchor" type="int"/>
280
<event name="delete_surrounding_text">
281
<description summary="delete surrounding text">
282
Notify when the text around the current cursor position should be
285
Index is relative to the current cursor (in bytes).
286
Length is the length of deleted text (in bytes).
288
This event should be handled as part of a following commit_string
291
<arg name="index" type="int"/>
292
<arg name="length" type="uint"/>
294
<event name="keysym">
295
<description summary="keysym">
296
Notify when a key event was sent. Key events should not be used
297
for normal text input operations, which should be done with
298
commit_string, delete_surrounding_text, etc. The key event follows
299
the wl_keyboard key event convention. Sym is a XKB keysym, state a
300
wl_keyboard key_state. Modifiers are a mask for effective modifiers
301
(where the modifier indices are set by the modifiers_map event)
303
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
304
<arg name="time" type="uint"/>
305
<arg name="sym" type="uint"/>
306
<arg name="state" type="uint"/>
307
<arg name="modifiers" type="uint"/>
309
<event name="language">
310
<description summary="language">
311
Sets the language of the input text. The "language" argument is a RFC-3066
314
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
315
<arg name="language" type="string"/>
317
<enum name="text_direction">
318
<entry name="auto" value="0" summary="automatic text direction based on text and language"/>
319
<entry name="ltr" value="1" summary="left-to-right"/>
320
<entry name="rtl" value="2" summary="right-to-left"/>
322
<event name="text_direction">
323
<description summary="text direction">
324
Sets the text direction of input text.
326
It is mainly needed for showing input cursor on correct side of the
327
editor when there is no input yet done and making sure neutral
328
direction text is laid out properly.
330
<arg name="serial" type="uint" summary="serial of the latest known text input state"/>
331
<arg name="direction" type="uint"/>
335
<interface name="wl_text_input_manager" version="1">
336
<description summary="text input manager">
337
A factory for text-input objects. This object is a global singleton.
339
<request name="create_text_input">
340
<description summary="create text input">
341
Creates a new text-input object.
343
<arg name="id" type="new_id" interface="wl_text_input"/>