1*6c119a46SAndroid Build Coastguard Worker<?xml version="1.0" encoding="UTF-8"?>
2*6c119a46SAndroid Build Coastguard Worker
3*6c119a46SAndroid Build Coastguard Worker<protocol name="text_input_unstable_v3">
4*6c119a46SAndroid Build Coastguard Worker  <copyright>
5*6c119a46SAndroid Build Coastguard Worker    Copyright © 2012, 2013 Intel Corporation
6*6c119a46SAndroid Build Coastguard Worker    Copyright © 2015, 2016 Jan Arne Petersen
7*6c119a46SAndroid Build Coastguard Worker    Copyright © 2017, 2018 Red Hat, Inc.
8*6c119a46SAndroid Build Coastguard Worker    Copyright © 2018       Purism SPC
9*6c119a46SAndroid Build Coastguard Worker
10*6c119a46SAndroid Build Coastguard Worker    Permission to use, copy, modify, distribute, and sell this
11*6c119a46SAndroid Build Coastguard Worker    software and its documentation for any purpose is hereby granted
12*6c119a46SAndroid Build Coastguard Worker    without fee, provided that the above copyright notice appear in
13*6c119a46SAndroid Build Coastguard Worker    all copies and that both that copyright notice and this permission
14*6c119a46SAndroid Build Coastguard Worker    notice appear in supporting documentation, and that the name of
15*6c119a46SAndroid Build Coastguard Worker    the copyright holders not be used in advertising or publicity
16*6c119a46SAndroid Build Coastguard Worker    pertaining to distribution of the software without specific,
17*6c119a46SAndroid Build Coastguard Worker    written prior permission.  The copyright holders make no
18*6c119a46SAndroid Build Coastguard Worker    representations about the suitability of this software for any
19*6c119a46SAndroid Build Coastguard Worker    purpose.  It is provided "as is" without express or implied
20*6c119a46SAndroid Build Coastguard Worker    warranty.
21*6c119a46SAndroid Build Coastguard Worker
22*6c119a46SAndroid Build Coastguard Worker    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
23*6c119a46SAndroid Build Coastguard Worker    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
24*6c119a46SAndroid Build Coastguard Worker    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
25*6c119a46SAndroid Build Coastguard Worker    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26*6c119a46SAndroid Build Coastguard Worker    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27*6c119a46SAndroid Build Coastguard Worker    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
28*6c119a46SAndroid Build Coastguard Worker    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
29*6c119a46SAndroid Build Coastguard Worker    THIS SOFTWARE.
30*6c119a46SAndroid Build Coastguard Worker  </copyright>
31*6c119a46SAndroid Build Coastguard Worker
32*6c119a46SAndroid Build Coastguard Worker  <description summary="Protocol for composing text">
33*6c119a46SAndroid Build Coastguard Worker    This protocol allows compositors to act as input methods and to send text
34*6c119a46SAndroid Build Coastguard Worker    to applications. A text input object is used to manage state of what are
35*6c119a46SAndroid Build Coastguard Worker    typically text entry fields in the application.
36*6c119a46SAndroid Build Coastguard Worker
37*6c119a46SAndroid Build Coastguard Worker    This document adheres to the RFC 2119 when using words like "must",
38*6c119a46SAndroid Build Coastguard Worker    "should", "may", etc.
39*6c119a46SAndroid Build Coastguard Worker
40*6c119a46SAndroid Build Coastguard Worker    Warning! The protocol described in this file is experimental and
41*6c119a46SAndroid Build Coastguard Worker    backward incompatible changes may be made. Backward compatible changes
42*6c119a46SAndroid Build Coastguard Worker    may be added together with the corresponding interface version bump.
43*6c119a46SAndroid Build Coastguard Worker    Backward incompatible changes are done by bumping the version number in
44*6c119a46SAndroid Build Coastguard Worker    the protocol and interface names and resetting the interface version.
45*6c119a46SAndroid Build Coastguard Worker    Once the protocol is to be declared stable, the 'z' prefix and the
46*6c119a46SAndroid Build Coastguard Worker    version number in the protocol and interface names are removed and the
47*6c119a46SAndroid Build Coastguard Worker    interface version number is reset.
48*6c119a46SAndroid Build Coastguard Worker  </description>
49*6c119a46SAndroid Build Coastguard Worker
50*6c119a46SAndroid Build Coastguard Worker  <interface name="zwp_text_input_v3" version="1">
51*6c119a46SAndroid Build Coastguard Worker    <description summary="text input">
52*6c119a46SAndroid Build Coastguard Worker      The zwp_text_input_v3 interface represents text input and input methods
53*6c119a46SAndroid Build Coastguard Worker      associated with a seat. It provides enter/leave events to follow the
54*6c119a46SAndroid Build Coastguard Worker      text input focus for a seat.
55*6c119a46SAndroid Build Coastguard Worker
56*6c119a46SAndroid Build Coastguard Worker      Requests are used to enable/disable the text-input object and set
57*6c119a46SAndroid Build Coastguard Worker      state information like surrounding and selected text or the content type.
58*6c119a46SAndroid Build Coastguard Worker      The information about the entered text is sent to the text-input object
59*6c119a46SAndroid Build Coastguard Worker      via the preedit_string and commit_string events.
60*6c119a46SAndroid Build Coastguard Worker
61*6c119a46SAndroid Build Coastguard Worker      Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
62*6c119a46SAndroid Build Coastguard Worker      must not point to middle bytes inside a code point: they must either
63*6c119a46SAndroid Build Coastguard Worker      point to the first byte of a code point or to the end of the buffer.
64*6c119a46SAndroid Build Coastguard Worker      Lengths must be measured between two valid indices.
65*6c119a46SAndroid Build Coastguard Worker
66*6c119a46SAndroid Build Coastguard Worker      Focus moving throughout surfaces will result in the emission of
67*6c119a46SAndroid Build Coastguard Worker      zwp_text_input_v3.enter and zwp_text_input_v3.leave events. The focused
68*6c119a46SAndroid Build Coastguard Worker      surface must commit zwp_text_input_v3.enable and
69*6c119a46SAndroid Build Coastguard Worker      zwp_text_input_v3.disable requests as the keyboard focus moves across
70*6c119a46SAndroid Build Coastguard Worker      editable and non-editable elements of the UI. Those two requests are not
71*6c119a46SAndroid Build Coastguard Worker      expected to be paired with each other, the compositor must be able to
72*6c119a46SAndroid Build Coastguard Worker      handle consecutive series of the same request.
73*6c119a46SAndroid Build Coastguard Worker
74*6c119a46SAndroid Build Coastguard Worker      State is sent by the state requests (set_surrounding_text,
75*6c119a46SAndroid Build Coastguard Worker      set_content_type and set_cursor_rectangle) and a commit request. After an
76*6c119a46SAndroid Build Coastguard Worker      enter event or disable request all state information is invalidated and
77*6c119a46SAndroid Build Coastguard Worker      needs to be resent by the client.
78*6c119a46SAndroid Build Coastguard Worker    </description>
79*6c119a46SAndroid Build Coastguard Worker
80*6c119a46SAndroid Build Coastguard Worker    <request name="destroy" type="destructor">
81*6c119a46SAndroid Build Coastguard Worker      <description summary="Destroy the wp_text_input">
82*6c119a46SAndroid Build Coastguard Worker        Destroy the wp_text_input object. Also disables all surfaces enabled
83*6c119a46SAndroid Build Coastguard Worker        through this wp_text_input object.
84*6c119a46SAndroid Build Coastguard Worker      </description>
85*6c119a46SAndroid Build Coastguard Worker    </request>
86*6c119a46SAndroid Build Coastguard Worker
87*6c119a46SAndroid Build Coastguard Worker    <request name="enable">
88*6c119a46SAndroid Build Coastguard Worker      <description summary="Request text input to be enabled">
89*6c119a46SAndroid Build Coastguard Worker        Requests text input on the surface previously obtained from the enter
90*6c119a46SAndroid Build Coastguard Worker        event.
91*6c119a46SAndroid Build Coastguard Worker
92*6c119a46SAndroid Build Coastguard Worker        This request must be issued every time the active text input changes
93*6c119a46SAndroid Build Coastguard Worker        to a new one, including within the current surface. Use
94*6c119a46SAndroid Build Coastguard Worker        zwp_text_input_v3.disable when there is no longer any input focus on
95*6c119a46SAndroid Build Coastguard Worker        the current surface.
96*6c119a46SAndroid Build Coastguard Worker
97*6c119a46SAndroid Build Coastguard Worker        Clients must not enable more than one text input on the single seat
98*6c119a46SAndroid Build Coastguard Worker        and should disable the current text input before enabling the new one.
99*6c119a46SAndroid Build Coastguard Worker        At most one instance of text input may be in enabled state per instance,
100*6c119a46SAndroid Build Coastguard Worker        Requests to enable the another text input when some text input is active
101*6c119a46SAndroid Build Coastguard Worker        must be ignored by compositor.
102*6c119a46SAndroid Build Coastguard Worker
103*6c119a46SAndroid Build Coastguard Worker        This request resets all state associated with previous enable, disable,
104*6c119a46SAndroid Build Coastguard Worker        set_surrounding_text, set_text_change_cause, set_content_type, and
105*6c119a46SAndroid Build Coastguard Worker        set_cursor_rectangle requests, as well as the state associated with
106*6c119a46SAndroid Build Coastguard Worker        preedit_string, commit_string, and delete_surrounding_text events.
107*6c119a46SAndroid Build Coastguard Worker
108*6c119a46SAndroid Build Coastguard Worker        The set_surrounding_text, set_content_type and set_cursor_rectangle
109*6c119a46SAndroid Build Coastguard Worker        requests must follow if the text input supports the necessary
110*6c119a46SAndroid Build Coastguard Worker        functionality.
111*6c119a46SAndroid Build Coastguard Worker
112*6c119a46SAndroid Build Coastguard Worker        State set with this request is double-buffered. It will get applied on
113*6c119a46SAndroid Build Coastguard Worker        the next zwp_text_input_v3.commit request, and stay valid until the
114*6c119a46SAndroid Build Coastguard Worker        next committed enable or disable request.
115*6c119a46SAndroid Build Coastguard Worker
116*6c119a46SAndroid Build Coastguard Worker        The changes must be applied by the compositor after issuing a
117*6c119a46SAndroid Build Coastguard Worker        zwp_text_input_v3.commit request.
118*6c119a46SAndroid Build Coastguard Worker      </description>
119*6c119a46SAndroid Build Coastguard Worker    </request>
120*6c119a46SAndroid Build Coastguard Worker
121*6c119a46SAndroid Build Coastguard Worker    <request name="disable">
122*6c119a46SAndroid Build Coastguard Worker      <description summary="Disable text input on a surface">
123*6c119a46SAndroid Build Coastguard Worker        Explicitly disable text input on the current surface (typically when
124*6c119a46SAndroid Build Coastguard Worker        there is no focus on any text entry inside the surface).
125*6c119a46SAndroid Build Coastguard Worker
126*6c119a46SAndroid Build Coastguard Worker        State set with this request is double-buffered. It will get applied on
127*6c119a46SAndroid Build Coastguard Worker        the next zwp_text_input_v3.commit request.
128*6c119a46SAndroid Build Coastguard Worker      </description>
129*6c119a46SAndroid Build Coastguard Worker    </request>
130*6c119a46SAndroid Build Coastguard Worker
131*6c119a46SAndroid Build Coastguard Worker    <request name="set_surrounding_text">
132*6c119a46SAndroid Build Coastguard Worker      <description summary="sets the surrounding text">
133*6c119a46SAndroid Build Coastguard Worker        Sets the surrounding plain text around the input, excluding the preedit
134*6c119a46SAndroid Build Coastguard Worker        text.
135*6c119a46SAndroid Build Coastguard Worker
136*6c119a46SAndroid Build Coastguard Worker        The client should notify the compositor of any changes in any of the
137*6c119a46SAndroid Build Coastguard Worker        values carried with this request, including changes caused by handling
138*6c119a46SAndroid Build Coastguard Worker        incoming text-input events as well as changes caused by other
139*6c119a46SAndroid Build Coastguard Worker        mechanisms like keyboard typing.
140*6c119a46SAndroid Build Coastguard Worker
141*6c119a46SAndroid Build Coastguard Worker        If the client is unaware of the text around the cursor, it should not
142*6c119a46SAndroid Build Coastguard Worker        issue this request, to signify lack of support to the compositor.
143*6c119a46SAndroid Build Coastguard Worker
144*6c119a46SAndroid Build Coastguard Worker        Text is UTF-8 encoded, and should include the cursor position, the
145*6c119a46SAndroid Build Coastguard Worker        complete selection and additional characters before and after them.
146*6c119a46SAndroid Build Coastguard Worker        There is a maximum length of wayland messages, so text can not be
147*6c119a46SAndroid Build Coastguard Worker        longer than 4000 bytes.
148*6c119a46SAndroid Build Coastguard Worker
149*6c119a46SAndroid Build Coastguard Worker        Cursor is the byte offset of the cursor within text buffer.
150*6c119a46SAndroid Build Coastguard Worker
151*6c119a46SAndroid Build Coastguard Worker        Anchor is the byte offset of the selection anchor within text buffer.
152*6c119a46SAndroid Build Coastguard Worker        If there is no selected text, anchor is the same as cursor.
153*6c119a46SAndroid Build Coastguard Worker
154*6c119a46SAndroid Build Coastguard Worker        If any preedit text is present, it is replaced with a cursor for the
155*6c119a46SAndroid Build Coastguard Worker        purpose of this event.
156*6c119a46SAndroid Build Coastguard Worker
157*6c119a46SAndroid Build Coastguard Worker        Values set with this request are double-buffered. They will get applied
158*6c119a46SAndroid Build Coastguard Worker        on the next zwp_text_input_v3.commit request, and stay valid until the
159*6c119a46SAndroid Build Coastguard Worker        next committed enable or disable request.
160*6c119a46SAndroid Build Coastguard Worker
161*6c119a46SAndroid Build Coastguard Worker        The initial state for affected fields is empty, meaning that the text
162*6c119a46SAndroid Build Coastguard Worker        input does not support sending surrounding text. If the empty values
163*6c119a46SAndroid Build Coastguard Worker        get applied, subsequent attempts to change them may have no effect.
164*6c119a46SAndroid Build Coastguard Worker      </description>
165*6c119a46SAndroid Build Coastguard Worker      <arg name="text" type="string"/>
166*6c119a46SAndroid Build Coastguard Worker      <arg name="cursor" type="int"/>
167*6c119a46SAndroid Build Coastguard Worker      <arg name="anchor" type="int"/>
168*6c119a46SAndroid Build Coastguard Worker    </request>
169*6c119a46SAndroid Build Coastguard Worker
170*6c119a46SAndroid Build Coastguard Worker    <enum name="change_cause">
171*6c119a46SAndroid Build Coastguard Worker      <description summary="text change reason">
172*6c119a46SAndroid Build Coastguard Worker        Reason for the change of surrounding text or cursor posision.
173*6c119a46SAndroid Build Coastguard Worker      </description>
174*6c119a46SAndroid Build Coastguard Worker      <entry name="input_method" value="0" summary="input method caused the change"/>
175*6c119a46SAndroid Build Coastguard Worker      <entry name="other" value="1" summary="something else than the input method caused the change"/>
176*6c119a46SAndroid Build Coastguard Worker    </enum>
177*6c119a46SAndroid Build Coastguard Worker
178*6c119a46SAndroid Build Coastguard Worker    <request name="set_text_change_cause">
179*6c119a46SAndroid Build Coastguard Worker      <description summary="indicates the cause of surrounding text change">
180*6c119a46SAndroid Build Coastguard Worker        Tells the compositor why the text surrounding the cursor changed.
181*6c119a46SAndroid Build Coastguard Worker
182*6c119a46SAndroid Build Coastguard Worker        Whenever the client detects an external change in text, cursor, or
183*6c119a46SAndroid Build Coastguard Worker        anchor posision, it must issue this request to the compositor. This
184*6c119a46SAndroid Build Coastguard Worker        request is intended to give the input method a chance to update the
185*6c119a46SAndroid Build Coastguard Worker        preedit text in an appropriate way, e.g. by removing it when the user
186*6c119a46SAndroid Build Coastguard Worker        starts typing with a keyboard.
187*6c119a46SAndroid Build Coastguard Worker
188*6c119a46SAndroid Build Coastguard Worker        cause describes the source of the change.
189*6c119a46SAndroid Build Coastguard Worker
190*6c119a46SAndroid Build Coastguard Worker        The value set with this request is double-buffered. It must be applied
191*6c119a46SAndroid Build Coastguard Worker        and reset to initial at the next zwp_text_input_v3.commit request.
192*6c119a46SAndroid Build Coastguard Worker
193*6c119a46SAndroid Build Coastguard Worker        The initial value of cause is input_method.
194*6c119a46SAndroid Build Coastguard Worker      </description>
195*6c119a46SAndroid Build Coastguard Worker      <arg name="cause" type="uint" enum="change_cause"/>
196*6c119a46SAndroid Build Coastguard Worker    </request>
197*6c119a46SAndroid Build Coastguard Worker
198*6c119a46SAndroid Build Coastguard Worker    <enum name="content_hint" bitfield="true">
199*6c119a46SAndroid Build Coastguard Worker      <description summary="content hint">
200*6c119a46SAndroid Build Coastguard Worker        Content hint is a bitmask to allow to modify the behavior of the text
201*6c119a46SAndroid Build Coastguard Worker        input.
202*6c119a46SAndroid Build Coastguard Worker      </description>
203*6c119a46SAndroid Build Coastguard Worker      <entry name="none" value="0x0" summary="no special behavior"/>
204*6c119a46SAndroid Build Coastguard Worker      <entry name="completion" value="0x1" summary="suggest word completions"/>
205*6c119a46SAndroid Build Coastguard Worker      <entry name="spellcheck" value="0x2" summary="suggest word corrections"/>
206*6c119a46SAndroid Build Coastguard Worker      <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
207*6c119a46SAndroid Build Coastguard Worker      <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
208*6c119a46SAndroid Build Coastguard Worker      <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
209*6c119a46SAndroid Build Coastguard Worker      <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
210*6c119a46SAndroid Build Coastguard Worker      <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
211*6c119a46SAndroid Build Coastguard Worker      <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
212*6c119a46SAndroid Build Coastguard Worker      <entry name="latin" value="0x100" summary="just Latin characters should be entered"/>
213*6c119a46SAndroid Build Coastguard Worker      <entry name="multiline" value="0x200" summary="the text input is multiline"/>
214*6c119a46SAndroid Build Coastguard Worker    </enum>
215*6c119a46SAndroid Build Coastguard Worker
216*6c119a46SAndroid Build Coastguard Worker    <enum name="content_purpose">
217*6c119a46SAndroid Build Coastguard Worker      <description summary="content purpose">
218*6c119a46SAndroid Build Coastguard Worker        The content purpose allows to specify the primary purpose of a text
219*6c119a46SAndroid Build Coastguard Worker        input.
220*6c119a46SAndroid Build Coastguard Worker
221*6c119a46SAndroid Build Coastguard Worker        This allows an input method to show special purpose input panels with
222*6c119a46SAndroid Build Coastguard Worker        extra characters or to disallow some characters.
223*6c119a46SAndroid Build Coastguard Worker      </description>
224*6c119a46SAndroid Build Coastguard Worker      <entry name="normal" value="0" summary="default input, allowing all characters"/>
225*6c119a46SAndroid Build Coastguard Worker      <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
226*6c119a46SAndroid Build Coastguard Worker      <entry name="digits" value="2" summary="allow only digits"/>
227*6c119a46SAndroid Build Coastguard Worker      <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
228*6c119a46SAndroid Build Coastguard Worker      <entry name="phone" value="4" summary="input a phone number"/>
229*6c119a46SAndroid Build Coastguard Worker      <entry name="url" value="5" summary="input an URL"/>
230*6c119a46SAndroid Build Coastguard Worker      <entry name="email" value="6" summary="input an email address"/>
231*6c119a46SAndroid Build Coastguard Worker      <entry name="name" value="7" summary="input a name of a person"/>
232*6c119a46SAndroid Build Coastguard Worker      <entry name="password" value="8" summary="input a password (combine with sensitive_data hint)"/>
233*6c119a46SAndroid Build Coastguard Worker      <entry name="pin" value="9" summary="input is a numeric password (combine with sensitive_data hint)"/>
234*6c119a46SAndroid Build Coastguard Worker      <entry name="date" value="10" summary="input a date"/>
235*6c119a46SAndroid Build Coastguard Worker      <entry name="time" value="11" summary="input a time"/>
236*6c119a46SAndroid Build Coastguard Worker      <entry name="datetime" value="12" summary="input a date and time"/>
237*6c119a46SAndroid Build Coastguard Worker      <entry name="terminal" value="13" summary="input for a terminal"/>
238*6c119a46SAndroid Build Coastguard Worker    </enum>
239*6c119a46SAndroid Build Coastguard Worker
240*6c119a46SAndroid Build Coastguard Worker    <request name="set_content_type">
241*6c119a46SAndroid Build Coastguard Worker      <description summary="set content purpose and hint">
242*6c119a46SAndroid Build Coastguard Worker        Sets the content purpose and content hint. While the purpose is the
243*6c119a46SAndroid Build Coastguard Worker        basic purpose of an input field, the hint flags allow to modify some of
244*6c119a46SAndroid Build Coastguard Worker        the behavior.
245*6c119a46SAndroid Build Coastguard Worker
246*6c119a46SAndroid Build Coastguard Worker        Values set with this request are double-buffered. They will get applied
247*6c119a46SAndroid Build Coastguard Worker        on the next zwp_text_input_v3.commit request.
248*6c119a46SAndroid Build Coastguard Worker        Subsequent attempts to update them may have no effect. The values
249*6c119a46SAndroid Build Coastguard Worker        remain valid until the next committed enable or disable request.
250*6c119a46SAndroid Build Coastguard Worker
251*6c119a46SAndroid Build Coastguard Worker        The initial value for hint is none, and the initial value for purpose
252*6c119a46SAndroid Build Coastguard Worker        is normal.
253*6c119a46SAndroid Build Coastguard Worker      </description>
254*6c119a46SAndroid Build Coastguard Worker      <arg name="hint" type="uint" enum="content_hint"/>
255*6c119a46SAndroid Build Coastguard Worker      <arg name="purpose" type="uint" enum="content_purpose"/>
256*6c119a46SAndroid Build Coastguard Worker    </request>
257*6c119a46SAndroid Build Coastguard Worker
258*6c119a46SAndroid Build Coastguard Worker    <request name="set_cursor_rectangle">
259*6c119a46SAndroid Build Coastguard Worker      <description summary="set cursor position">
260*6c119a46SAndroid Build Coastguard Worker        Marks an area around the cursor as a x, y, width, height rectangle in
261*6c119a46SAndroid Build Coastguard Worker        surface local coordinates.
262*6c119a46SAndroid Build Coastguard Worker
263*6c119a46SAndroid Build Coastguard Worker        Allows the compositor to put a window with word suggestions near the
264*6c119a46SAndroid Build Coastguard Worker        cursor, without obstructing the text being input.
265*6c119a46SAndroid Build Coastguard Worker
266*6c119a46SAndroid Build Coastguard Worker        If the client is unaware of the position of edited text, it should not
267*6c119a46SAndroid Build Coastguard Worker        issue this request, to signify lack of support to the compositor.
268*6c119a46SAndroid Build Coastguard Worker
269*6c119a46SAndroid Build Coastguard Worker        Values set with this request are double-buffered. They will get applied
270*6c119a46SAndroid Build Coastguard Worker        on the next zwp_text_input_v3.commit request, and stay valid until the
271*6c119a46SAndroid Build Coastguard Worker        next committed enable or disable request.
272*6c119a46SAndroid Build Coastguard Worker
273*6c119a46SAndroid Build Coastguard Worker        The initial values describing a cursor rectangle are empty. That means
274*6c119a46SAndroid Build Coastguard Worker        the text input does not support describing the cursor area. If the
275*6c119a46SAndroid Build Coastguard Worker        empty values get applied, subsequent attempts to change them may have
276*6c119a46SAndroid Build Coastguard Worker        no effect.
277*6c119a46SAndroid Build Coastguard Worker      </description>
278*6c119a46SAndroid Build Coastguard Worker      <arg name="x" type="int"/>
279*6c119a46SAndroid Build Coastguard Worker      <arg name="y" type="int"/>
280*6c119a46SAndroid Build Coastguard Worker      <arg name="width" type="int"/>
281*6c119a46SAndroid Build Coastguard Worker      <arg name="height" type="int"/>
282*6c119a46SAndroid Build Coastguard Worker    </request>
283*6c119a46SAndroid Build Coastguard Worker
284*6c119a46SAndroid Build Coastguard Worker    <request name="commit">
285*6c119a46SAndroid Build Coastguard Worker      <description summary="commit state">
286*6c119a46SAndroid Build Coastguard Worker        Atomically applies state changes recently sent to the compositor.
287*6c119a46SAndroid Build Coastguard Worker
288*6c119a46SAndroid Build Coastguard Worker        The commit request establishes and updates the state of the client, and
289*6c119a46SAndroid Build Coastguard Worker        must be issued after any changes to apply them.
290*6c119a46SAndroid Build Coastguard Worker
291*6c119a46SAndroid Build Coastguard Worker        Text input state (enabled status, content purpose, content hint,
292*6c119a46SAndroid Build Coastguard Worker        surrounding text and change cause, cursor rectangle) is conceptually
293*6c119a46SAndroid Build Coastguard Worker        double-buffered within the context of a text input, i.e. between a
294*6c119a46SAndroid Build Coastguard Worker        committed enable request and the following committed enable or disable
295*6c119a46SAndroid Build Coastguard Worker        request.
296*6c119a46SAndroid Build Coastguard Worker
297*6c119a46SAndroid Build Coastguard Worker        Protocol requests modify the pending state, as opposed to the current
298*6c119a46SAndroid Build Coastguard Worker        state in use by the input method. A commit request atomically applies
299*6c119a46SAndroid Build Coastguard Worker        all pending state, replacing the current state. After commit, the new
300*6c119a46SAndroid Build Coastguard Worker        pending state is as documented for each related request.
301*6c119a46SAndroid Build Coastguard Worker
302*6c119a46SAndroid Build Coastguard Worker        Requests are applied in the order of arrival.
303*6c119a46SAndroid Build Coastguard Worker
304*6c119a46SAndroid Build Coastguard Worker        Neither current nor pending state are modified unless noted otherwise.
305*6c119a46SAndroid Build Coastguard Worker
306*6c119a46SAndroid Build Coastguard Worker        The compositor must count the number of commit requests coming from
307*6c119a46SAndroid Build Coastguard Worker        each zwp_text_input_v3 object and use the count as the serial in done
308*6c119a46SAndroid Build Coastguard Worker        events.
309*6c119a46SAndroid Build Coastguard Worker      </description>
310*6c119a46SAndroid Build Coastguard Worker    </request>
311*6c119a46SAndroid Build Coastguard Worker
312*6c119a46SAndroid Build Coastguard Worker    <event name="enter">
313*6c119a46SAndroid Build Coastguard Worker      <description summary="enter event">
314*6c119a46SAndroid Build Coastguard Worker        Notification that this seat's text-input focus is on a certain surface.
315*6c119a46SAndroid Build Coastguard Worker
316*6c119a46SAndroid Build Coastguard Worker        If client has created multiple text input objects, compositor must send
317*6c119a46SAndroid Build Coastguard Worker        this event to all of them.
318*6c119a46SAndroid Build Coastguard Worker
319*6c119a46SAndroid Build Coastguard Worker        When the seat has the keyboard capability the text-input focus follows
320*6c119a46SAndroid Build Coastguard Worker        the keyboard focus. This event sets the current surface for the
321*6c119a46SAndroid Build Coastguard Worker        text-input object.
322*6c119a46SAndroid Build Coastguard Worker      </description>
323*6c119a46SAndroid Build Coastguard Worker      <arg name="surface" type="object" interface="wl_surface"/>
324*6c119a46SAndroid Build Coastguard Worker    </event>
325*6c119a46SAndroid Build Coastguard Worker
326*6c119a46SAndroid Build Coastguard Worker    <event name="leave">
327*6c119a46SAndroid Build Coastguard Worker      <description summary="leave event">
328*6c119a46SAndroid Build Coastguard Worker        Notification that this seat's text-input focus is no longer on a
329*6c119a46SAndroid Build Coastguard Worker        certain surface. The client should reset any preedit string previously
330*6c119a46SAndroid Build Coastguard Worker        set.
331*6c119a46SAndroid Build Coastguard Worker
332*6c119a46SAndroid Build Coastguard Worker        The leave notification clears the current surface. It is sent before
333*6c119a46SAndroid Build Coastguard Worker        the enter notification for the new focus. After leave event, compositor
334*6c119a46SAndroid Build Coastguard Worker        must ignore requests from any text input instances until next enter
335*6c119a46SAndroid Build Coastguard Worker        event.
336*6c119a46SAndroid Build Coastguard Worker
337*6c119a46SAndroid Build Coastguard Worker        When the seat has the keyboard capability the text-input focus follows
338*6c119a46SAndroid Build Coastguard Worker        the keyboard focus.
339*6c119a46SAndroid Build Coastguard Worker      </description>
340*6c119a46SAndroid Build Coastguard Worker      <arg name="surface" type="object" interface="wl_surface"/>
341*6c119a46SAndroid Build Coastguard Worker    </event>
342*6c119a46SAndroid Build Coastguard Worker
343*6c119a46SAndroid Build Coastguard Worker    <event name="preedit_string">
344*6c119a46SAndroid Build Coastguard Worker      <description summary="pre-edit">
345*6c119a46SAndroid Build Coastguard Worker        Notify when a new composing text (pre-edit) should be set at the
346*6c119a46SAndroid Build Coastguard Worker        current cursor position. Any previously set composing text must be
347*6c119a46SAndroid Build Coastguard Worker        removed. Any previously existing selected text must be removed.
348*6c119a46SAndroid Build Coastguard Worker
349*6c119a46SAndroid Build Coastguard Worker        The argument text contains the pre-edit string buffer.
350*6c119a46SAndroid Build Coastguard Worker
351*6c119a46SAndroid Build Coastguard Worker        The parameters cursor_begin and cursor_end are counted in bytes
352*6c119a46SAndroid Build Coastguard Worker        relative to the beginning of the submitted text buffer. Cursor should
353*6c119a46SAndroid Build Coastguard Worker        be hidden when both are equal to -1.
354*6c119a46SAndroid Build Coastguard Worker
355*6c119a46SAndroid Build Coastguard Worker        They could be represented by the client as a line if both values are
356*6c119a46SAndroid Build Coastguard Worker        the same, or as a text highlight otherwise.
357*6c119a46SAndroid Build Coastguard Worker
358*6c119a46SAndroid Build Coastguard Worker        Values set with this event are double-buffered. They must be applied
359*6c119a46SAndroid Build Coastguard Worker        and reset to initial on the next zwp_text_input_v3.done event.
360*6c119a46SAndroid Build Coastguard Worker
361*6c119a46SAndroid Build Coastguard Worker        The initial value of text is an empty string, and cursor_begin,
362*6c119a46SAndroid Build Coastguard Worker        cursor_end and cursor_hidden are all 0.
363*6c119a46SAndroid Build Coastguard Worker      </description>
364*6c119a46SAndroid Build Coastguard Worker      <arg name="text" type="string" allow-null="true"/>
365*6c119a46SAndroid Build Coastguard Worker      <arg name="cursor_begin" type="int"/>
366*6c119a46SAndroid Build Coastguard Worker      <arg name="cursor_end" type="int"/>
367*6c119a46SAndroid Build Coastguard Worker    </event>
368*6c119a46SAndroid Build Coastguard Worker
369*6c119a46SAndroid Build Coastguard Worker    <event name="commit_string">
370*6c119a46SAndroid Build Coastguard Worker      <description summary="text commit">
371*6c119a46SAndroid Build Coastguard Worker        Notify when text should be inserted into the editor widget. The text to
372*6c119a46SAndroid Build Coastguard Worker        commit could be either just a single character after a key press or the
373*6c119a46SAndroid Build Coastguard Worker        result of some composing (pre-edit).
374*6c119a46SAndroid Build Coastguard Worker
375*6c119a46SAndroid Build Coastguard Worker        Values set with this event are double-buffered. They must be applied
376*6c119a46SAndroid Build Coastguard Worker        and reset to initial on the next zwp_text_input_v3.done event.
377*6c119a46SAndroid Build Coastguard Worker
378*6c119a46SAndroid Build Coastguard Worker        The initial value of text is an empty string.
379*6c119a46SAndroid Build Coastguard Worker      </description>
380*6c119a46SAndroid Build Coastguard Worker      <arg name="text" type="string" allow-null="true"/>
381*6c119a46SAndroid Build Coastguard Worker    </event>
382*6c119a46SAndroid Build Coastguard Worker
383*6c119a46SAndroid Build Coastguard Worker    <event name="delete_surrounding_text">
384*6c119a46SAndroid Build Coastguard Worker      <description summary="delete surrounding text">
385*6c119a46SAndroid Build Coastguard Worker        Notify when the text around the current cursor position should be
386*6c119a46SAndroid Build Coastguard Worker        deleted.
387*6c119a46SAndroid Build Coastguard Worker
388*6c119a46SAndroid Build Coastguard Worker        Before_length and after_length are the number of bytes before and after
389*6c119a46SAndroid Build Coastguard Worker        the current cursor index (excluding the selection) to delete.
390*6c119a46SAndroid Build Coastguard Worker
391*6c119a46SAndroid Build Coastguard Worker        If a preedit text is present, in effect before_length is counted from
392*6c119a46SAndroid Build Coastguard Worker        the beginning of it, and after_length from its end (see done event
393*6c119a46SAndroid Build Coastguard Worker        sequence).
394*6c119a46SAndroid Build Coastguard Worker
395*6c119a46SAndroid Build Coastguard Worker        Values set with this event are double-buffered. They must be applied
396*6c119a46SAndroid Build Coastguard Worker        and reset to initial on the next zwp_text_input_v3.done event.
397*6c119a46SAndroid Build Coastguard Worker
398*6c119a46SAndroid Build Coastguard Worker        The initial values of both before_length and after_length are 0.
399*6c119a46SAndroid Build Coastguard Worker      </description>
400*6c119a46SAndroid Build Coastguard Worker      <arg name="before_length" type="uint" summary="length of text before current cursor position"/>
401*6c119a46SAndroid Build Coastguard Worker      <arg name="after_length" type="uint" summary="length of text after current cursor position"/>
402*6c119a46SAndroid Build Coastguard Worker    </event>
403*6c119a46SAndroid Build Coastguard Worker
404*6c119a46SAndroid Build Coastguard Worker    <event name="done">
405*6c119a46SAndroid Build Coastguard Worker      <description summary="apply changes">
406*6c119a46SAndroid Build Coastguard Worker        Instruct the application to apply changes to state requested by the
407*6c119a46SAndroid Build Coastguard Worker        preedit_string, commit_string and delete_surrounding_text events. The
408*6c119a46SAndroid Build Coastguard Worker        state relating to these events is double-buffered, and each one
409*6c119a46SAndroid Build Coastguard Worker        modifies the pending state. This event replaces the current state with
410*6c119a46SAndroid Build Coastguard Worker        the pending state.
411*6c119a46SAndroid Build Coastguard Worker
412*6c119a46SAndroid Build Coastguard Worker        The application must proceed by evaluating the changes in the following
413*6c119a46SAndroid Build Coastguard Worker        order:
414*6c119a46SAndroid Build Coastguard Worker
415*6c119a46SAndroid Build Coastguard Worker        1. Replace existing preedit string with the cursor.
416*6c119a46SAndroid Build Coastguard Worker        2. Delete requested surrounding text.
417*6c119a46SAndroid Build Coastguard Worker        3. Insert commit string with the cursor at its end.
418*6c119a46SAndroid Build Coastguard Worker        4. Calculate surrounding text to send.
419*6c119a46SAndroid Build Coastguard Worker        5. Insert new preedit text in cursor position.
420*6c119a46SAndroid Build Coastguard Worker        6. Place cursor inside preedit text.
421*6c119a46SAndroid Build Coastguard Worker
422*6c119a46SAndroid Build Coastguard Worker        The serial number reflects the last state of the zwp_text_input_v3
423*6c119a46SAndroid Build Coastguard Worker        object known to the compositor. The value of the serial argument must
424*6c119a46SAndroid Build Coastguard Worker        be equal to the number of commit requests already issued on that object.
425*6c119a46SAndroid Build Coastguard Worker        When the client receives a done event with a serial different than the
426*6c119a46SAndroid Build Coastguard Worker        number of past commit requests, it must proceed as normal, except it
427*6c119a46SAndroid Build Coastguard Worker        should not change the current state of the zwp_text_input_v3 object.
428*6c119a46SAndroid Build Coastguard Worker      </description>
429*6c119a46SAndroid Build Coastguard Worker      <arg name="serial" type="uint"/>
430*6c119a46SAndroid Build Coastguard Worker    </event>
431*6c119a46SAndroid Build Coastguard Worker  </interface>
432*6c119a46SAndroid Build Coastguard Worker
433*6c119a46SAndroid Build Coastguard Worker  <interface name="zwp_text_input_manager_v3" version="1">
434*6c119a46SAndroid Build Coastguard Worker    <description summary="text input manager">
435*6c119a46SAndroid Build Coastguard Worker      A factory for text-input objects. This object is a global singleton.
436*6c119a46SAndroid Build Coastguard Worker    </description>
437*6c119a46SAndroid Build Coastguard Worker
438*6c119a46SAndroid Build Coastguard Worker    <request name="destroy" type="destructor">
439*6c119a46SAndroid Build Coastguard Worker      <description summary="Destroy the wp_text_input_manager">
440*6c119a46SAndroid Build Coastguard Worker        Destroy the wp_text_input_manager object.
441*6c119a46SAndroid Build Coastguard Worker      </description>
442*6c119a46SAndroid Build Coastguard Worker    </request>
443*6c119a46SAndroid Build Coastguard Worker
444*6c119a46SAndroid Build Coastguard Worker    <request name="get_text_input">
445*6c119a46SAndroid Build Coastguard Worker      <description summary="create a new text input object">
446*6c119a46SAndroid Build Coastguard Worker        Creates a new text-input object for a given seat.
447*6c119a46SAndroid Build Coastguard Worker      </description>
448*6c119a46SAndroid Build Coastguard Worker      <arg name="id" type="new_id" interface="zwp_text_input_v3"/>
449*6c119a46SAndroid Build Coastguard Worker      <arg name="seat" type="object" interface="wl_seat"/>
450*6c119a46SAndroid Build Coastguard Worker    </request>
451*6c119a46SAndroid Build Coastguard Worker  </interface>
452*6c119a46SAndroid Build Coastguard Worker</protocol>
453