2 <interface name="text_model" version="1">
3 <description summary="text model">
4 A model for text input. Adds support for text input and input methods to
5 applications. A text_model object is created from a text_model_factory and
6 corresponds typically to a text entry in an application. Requests are used
7 to activate/deactivate the model and set information like surrounding and
8 selected text or the content type. The information about entered text is
9 sent to the model via the pre-edit and commit events. Using this interface
10 removes the need for applications to directly process hardware key events
11 and compose text out of them.
13 <request name="set_surrounding_text">
14 <description summary="sets the surrounding text">
15 Sets the plain surrounding text around the input position. Cursor is the
16 position within the surrounding text. Anchor is the position of the
17 selection anchor within the surrounding text. If there is no selected
18 text anchor is the same as cursor.
20 <arg name="text" type="string"/>
21 <arg name="cursor" type="uint"/>
22 <arg name="anchor" type="uint"/>
24 <request name="activate">
25 <description summary="request activation">
26 Requests the model to be activated (typically when the text entry gets
27 focus). The seat argument is a wl_seat which maintains the focus for
28 this activation. The surface argument is a wl_surface assigned to the
29 model and tracked for focus lost. The activated event is emitted on
30 successful activation.
32 <arg name="seat" type="object" interface="wl_seat"/>
33 <arg name="surface" type="object" interface="wl_surface"/>
35 <request name="deactivate">
36 <description summary="request deactivation">
37 Requests the model to be deactivated (typically when the text entry
38 lost focus). The seat argument is a wl_seat which was used for
41 <arg name="seat" type="object" interface="wl_seat"/>
43 <request name="set_micro_focus">
44 <arg name="x" type="int"/>
45 <arg name="y" type="int"/>
46 <arg name="width" type="int"/>
47 <arg name="height" type="int"/>
49 <request name="set_preedit"/>
50 <request name="set_content_type"/>
52 <event name="commit_string">
53 <arg name="text" type="string"/>
54 <arg name="index" type="uint"/>
56 <event name="preedit_string">
57 <arg name="text" type="string"/>
58 <arg name="index" type="uint"/>
60 <event name="preedit_styling"/>
62 <event name="selection_replacement"/>
63 <event name="direction"/>
64 <event name="locale"/>
65 <event name="activated">
66 <description summary="activated event">
67 Notify the model when it is activated. Typically in response to an
71 <event name="deactivated">
72 <description summary="deactivated event">
73 Notify the model when it is deactivated. Either in response to a
74 deactivate request or when the assigned surface lost focus or was
80 <interface name="text_model_factory" version="1">
81 <description summary="text model factory">
82 A factory for text models. This object is a singleton global.
84 <request name="create_text_model">
85 <description summary="create text model">
86 Creates a new text model object.
88 <arg name="id" type="new_id" interface="text_model"/>
92 <interface name="input_method_context" version="1">
93 <description summary="input method context">
94 Corresponds to a text model on input method side. An input method context
95 is created on text mode activation on the input method side. It allows to
96 receive information about the text model from the application via events.
97 Input method contexts do not keep state after deactivation and should be
98 destroyed after deactivation is handled.
100 <request name="destroy" type="destructor"/>
101 <request name="commit_string">
102 <description summary="commit string">
103 Send the commit string text to the applications text model.
105 <arg name="text" type="string"/>
106 <arg name="index" type="uint"/>
108 <event name="surrounding_text">
109 <description summary="surrounding text event">
110 The plain surrounding text around the input position. Cursor is the
111 position within the surrounding text. Anchor is the position of the
112 selection anchor within the surrounding text. If there is no selected
113 text anchor is the same as cursor.
115 <arg name="text" type="string"/>
116 <arg name="cursor" type="uint"/>
117 <arg name="anchor" type="uint"/>
121 <interface name="input_method" version="1">
122 <description summary="input method">
123 An input method object is responsible to compose text in response to
124 input from hardware or virtual keyboards. There is one input method
125 object per seat. On activate there is a new input method context object
126 created which allows the input method to communicate with the text model.
128 <event name="activate">
129 <description summary="activate event">
130 A text model was activated. Creates an input method context object
131 which allows communication with the text model.
133 <arg name="id" type="new_id" interface="input_method_context"/>
135 <event name="deactivate">
136 <description summary="activate event">
137 The text model corresponding to the context argument was deactivated.
138 The input method context should be destroyed after deactivation is
141 <arg name="context" type="object" interface="input_method_context"/>