1 <?xml version="1.0" encoding="UTF-8"?>
5 Copyright © 2012 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="text_model" version="1">
30 <description summary="text model">
31 A model for text input. Adds support for text input and input methods to
32 applications. A text_model object is created from a text_model_factory and
33 corresponds typically to a text entry in an application. Requests are used
34 to activate/deactivate the model and set information like surrounding and
35 selected text or the content type. The information about entered text is
36 sent to the model via the pre-edit and commit events. Using this interface
37 removes the need for applications to directly process hardware key events
38 and compose text out of them.
40 <request name="set_surrounding_text">
41 <description summary="sets the surrounding text">
42 Sets the plain surrounding text around the input position. Cursor is the
43 byte index within the surrounding text. Anchor is the byte index of the
44 selection anchor within the surrounding text. If there is no selected
45 text anchor is the same as cursor.
47 <arg name="text" type="string"/>
48 <arg name="cursor" type="uint"/>
49 <arg name="anchor" type="uint"/>
51 <request name="activate">
52 <description summary="request activation">
53 Requests the model to be activated (typically when the text entry gets
54 focus). The seat argument is a wl_seat which maintains the focus for
55 this activation. The surface argument is a wl_surface assigned to the
56 model and tracked for focus lost. The activated event is emitted on
57 successful activation.
59 <arg name="seat" type="object" interface="wl_seat"/>
60 <arg name="surface" type="object" interface="wl_surface"/>
62 <request name="deactivate">
63 <description summary="request deactivation">
64 Requests the model to be deactivated (typically when the text entry
65 lost focus). The seat argument is a wl_seat which was used for
68 <arg name="seat" type="object" interface="wl_seat"/>
70 <request name="reset">
71 <description summary="reset">
72 Should be called by an editor widget when the input state should
73 be reseted, for example after the text was changed outside of the
74 normal input method flow.
77 <request name="set_micro_focus">
78 <arg name="x" type="int"/>
79 <arg name="y" type="int"/>
80 <arg name="width" type="int"/>
81 <arg name="height" type="int"/>
83 <request name="set_preedit"/>
84 <request name="set_content_type"/>
86 <event name="commit_string">
87 <description summary="commit">
88 Notify when text should be inserted into the editor widget. The text
89 to commit could be either just a single character after a key press
90 or the result of some composing (pre-edit). It also sets the new
91 cursor position (as byte index) relative to the inserted text.
93 <arg name="text" type="string"/>
94 <arg name="index" type="uint"/>
96 <event name="preedit_string">
97 <description summary="pre-edit">
98 Notify when a new composing text (pre-edit) should be set around the
99 current cursor position. Any previously set composing text should
100 be removed. It also sets the cursor position (as byte index) relative
101 to the start of the composing text.
103 <arg name="text" type="string"/>
104 <arg name="index" type="uint"/>
106 <event name="delete_surrounding_text">
107 <description summary="delete surrounding text">
108 Notify when the text around the current cursor position should be
109 deleted. Index is relative to the current cursor (as byte index).
110 Length is the length of deleted text (as bytes).
112 <arg name="index" type="int"/>
113 <arg name="length" type="uint"/>
115 <event name="preedit_styling"/>
117 <description summary="key">
118 Notify when a key event was sent. Key events should not be used
119 for normal text input operations, which should be done with
120 commit_string, delete_surrounfing_text, etc. The key event follows
121 the wl_keyboard key event convention. Key is a XKB keycode, state a
122 wl_keyboard key_state.
124 <arg name="key" type="uint"/>
125 <arg name="state" type="uint"/>
127 <event name="selection_replacement"/>
128 <event name="direction"/>
129 <event name="locale"/>
131 <description summary="enter event">
132 Notify the model when it is activated. Typically in response to an
135 <arg name="surface" type="object" interface="wl_surface"/>
138 <description summary="leave event">
139 Notify the model when it is deactivated. Either in response to a
140 deactivate request or when the assigned surface lost focus or was
146 <interface name="text_model_factory" version="1">
147 <description summary="text model factory">
148 A factory for text models. This object is a singleton global.
150 <request name="create_text_model">
151 <description summary="create text model">
152 Creates a new text model object.
154 <arg name="id" type="new_id" interface="text_model"/>