1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef INPUT_METHOD_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define INPUT_METHOD_UNSTABLE_V1_CLIENT_PROTOCOL_H
5 
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9 
10 #ifdef  __cplusplus
11 extern "C" {
12 #endif
13 
14 /**
15  * @page page_input_method_unstable_v1 The input_method_unstable_v1 protocol
16  * @section page_ifaces_input_method_unstable_v1 Interfaces
17  * - @subpage page_iface_zwp_input_method_context_v1 - input method context
18  * - @subpage page_iface_zwp_input_method_v1 - input method
19  * - @subpage page_iface_zwp_input_panel_v1 - interface for implementing keyboards
20  * - @subpage page_iface_zwp_input_panel_surface_v1 -
21  * @section page_copyright_input_method_unstable_v1 Copyright
22  * <pre>
23  *
24  * Copyright © 2012, 2013 Intel Corporation
25  *
26  * Permission is hereby granted, free of charge, to any person obtaining a
27  * copy of this software and associated documentation files (the "Software"),
28  * to deal in the Software without restriction, including without limitation
29  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
30  * and/or sell copies of the Software, and to permit persons to whom the
31  * Software is furnished to do so, subject to the following conditions:
32  *
33  * The above copyright notice and this permission notice (including the next
34  * paragraph) shall be included in all copies or substantial portions of the
35  * Software.
36  *
37  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
38  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
39  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
40  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
41  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
43  * DEALINGS IN THE SOFTWARE.
44  * </pre>
45  */
46 struct wl_keyboard;
47 struct wl_output;
48 struct wl_surface;
49 struct zwp_input_method_context_v1;
50 struct zwp_input_method_v1;
51 struct zwp_input_panel_surface_v1;
52 struct zwp_input_panel_v1;
53 
54 #ifndef ZWP_INPUT_METHOD_CONTEXT_V1_INTERFACE
55 #define ZWP_INPUT_METHOD_CONTEXT_V1_INTERFACE
56 /**
57  * @page page_iface_zwp_input_method_context_v1 zwp_input_method_context_v1
58  * @section page_iface_zwp_input_method_context_v1_desc Description
59  *
60  * Corresponds to a text input on the input method side. An input method context
61  * is created on text input activation on the input method side. It allows
62  * receiving information about the text input from the application via events.
63  * Input method contexts do not keep state after deactivation and should be
64  * destroyed after deactivation is handled.
65  *
66  * Text is generally UTF-8 encoded, indices and lengths are in bytes.
67  *
68  * Serials are used to synchronize the state between the text input and
69  * an input method. New serials are sent by the text input in the
70  * commit_state request and are used by the input method to indicate
71  * the known text input state in events like preedit_string, commit_string,
72  * and keysym. The text input can then ignore events from the input method
73  * which are based on an outdated state (for example after a reset).
74  *
75  * Warning! The protocol described in this file is experimental and
76  * backward incompatible changes may be made. Backward compatible changes
77  * may be added together with the corresponding interface version bump.
78  * Backward incompatible changes are done by bumping the version number in
79  * the protocol and interface names and resetting the interface version.
80  * Once the protocol is to be declared stable, the 'z' prefix and the
81  * version number in the protocol and interface names are removed and the
82  * interface version number is reset.
83  * @section page_iface_zwp_input_method_context_v1_api API
84  * See @ref iface_zwp_input_method_context_v1.
85  */
86 /**
87  * @defgroup iface_zwp_input_method_context_v1 The zwp_input_method_context_v1 interface
88  *
89  * Corresponds to a text input on the input method side. An input method context
90  * is created on text input activation on the input method side. It allows
91  * receiving information about the text input from the application via events.
92  * Input method contexts do not keep state after deactivation and should be
93  * destroyed after deactivation is handled.
94  *
95  * Text is generally UTF-8 encoded, indices and lengths are in bytes.
96  *
97  * Serials are used to synchronize the state between the text input and
98  * an input method. New serials are sent by the text input in the
99  * commit_state request and are used by the input method to indicate
100  * the known text input state in events like preedit_string, commit_string,
101  * and keysym. The text input can then ignore events from the input method
102  * which are based on an outdated state (for example after a reset).
103  *
104  * Warning! The protocol described in this file is experimental and
105  * backward incompatible changes may be made. Backward compatible changes
106  * may be added together with the corresponding interface version bump.
107  * Backward incompatible changes are done by bumping the version number in
108  * the protocol and interface names and resetting the interface version.
109  * Once the protocol is to be declared stable, the 'z' prefix and the
110  * version number in the protocol and interface names are removed and the
111  * interface version number is reset.
112  */
113 extern const struct wl_interface zwp_input_method_context_v1_interface;
114 #endif
115 #ifndef ZWP_INPUT_METHOD_V1_INTERFACE
116 #define ZWP_INPUT_METHOD_V1_INTERFACE
117 /**
118  * @page page_iface_zwp_input_method_v1 zwp_input_method_v1
119  * @section page_iface_zwp_input_method_v1_desc Description
120  *
121  * An input method object is responsible for composing text in response to
122  * input from hardware or virtual keyboards. There is one input method
123  * object per seat. On activate there is a new input method context object
124  * created which allows the input method to communicate with the text input.
125  * @section page_iface_zwp_input_method_v1_api API
126  * See @ref iface_zwp_input_method_v1.
127  */
128 /**
129  * @defgroup iface_zwp_input_method_v1 The zwp_input_method_v1 interface
130  *
131  * An input method object is responsible for composing text in response to
132  * input from hardware or virtual keyboards. There is one input method
133  * object per seat. On activate there is a new input method context object
134  * created which allows the input method to communicate with the text input.
135  */
136 extern const struct wl_interface zwp_input_method_v1_interface;
137 #endif
138 #ifndef ZWP_INPUT_PANEL_V1_INTERFACE
139 #define ZWP_INPUT_PANEL_V1_INTERFACE
140 /**
141  * @page page_iface_zwp_input_panel_v1 zwp_input_panel_v1
142  * @section page_iface_zwp_input_panel_v1_desc Description
143  *
144  * Only one client can bind this interface at a time.
145  * @section page_iface_zwp_input_panel_v1_api API
146  * See @ref iface_zwp_input_panel_v1.
147  */
148 /**
149  * @defgroup iface_zwp_input_panel_v1 The zwp_input_panel_v1 interface
150  *
151  * Only one client can bind this interface at a time.
152  */
153 extern const struct wl_interface zwp_input_panel_v1_interface;
154 #endif
155 #ifndef ZWP_INPUT_PANEL_SURFACE_V1_INTERFACE
156 #define ZWP_INPUT_PANEL_SURFACE_V1_INTERFACE
157 /**
158  * @page page_iface_zwp_input_panel_surface_v1 zwp_input_panel_surface_v1
159  * @section page_iface_zwp_input_panel_surface_v1_api API
160  * See @ref iface_zwp_input_panel_surface_v1.
161  */
162 /**
163  * @defgroup iface_zwp_input_panel_surface_v1 The zwp_input_panel_surface_v1 interface
164  */
165 extern const struct wl_interface zwp_input_panel_surface_v1_interface;
166 #endif
167 
168 /**
169  * @ingroup iface_zwp_input_method_context_v1
170  * @struct zwp_input_method_context_v1_listener
171  */
172 struct zwp_input_method_context_v1_listener {
173 	/**
174 	 * surrounding text event
175 	 *
176 	 * The plain surrounding text around the input position. Cursor
177 	 * is the position in bytes within the surrounding text relative to
178 	 * the beginning of the text. Anchor is the position in bytes of
179 	 * the selection anchor within the surrounding text relative to the
180 	 * beginning of the text. If there is no selected text then anchor
181 	 * is the same as cursor.
182 	 */
183 	void (*surrounding_text)(void *data,
184 				 struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
185 				 const char *text,
186 				 uint32_t cursor,
187 				 uint32_t anchor);
188 	/**
189 	 */
190 	void (*reset)(void *data,
191 		      struct zwp_input_method_context_v1 *zwp_input_method_context_v1);
192 	/**
193 	 */
194 	void (*content_type)(void *data,
195 			     struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
196 			     uint32_t hint,
197 			     uint32_t purpose);
198 	/**
199 	 */
200 	void (*invoke_action)(void *data,
201 			      struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
202 			      uint32_t button,
203 			      uint32_t index);
204 	/**
205 	 * @param serial serial of text input state
206 	 */
207 	void (*commit_state)(void *data,
208 			     struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
209 			     uint32_t serial);
210 	/**
211 	 */
212 	void (*preferred_language)(void *data,
213 				   struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
214 				   const char *language);
215 };
216 
217 /**
218  * @ingroup iface_zwp_input_method_context_v1
219  */
220 static inline int
zwp_input_method_context_v1_add_listener(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,const struct zwp_input_method_context_v1_listener * listener,void * data)221 zwp_input_method_context_v1_add_listener(struct zwp_input_method_context_v1 *zwp_input_method_context_v1,
222 					 const struct zwp_input_method_context_v1_listener *listener, void *data)
223 {
224 	return wl_proxy_add_listener((struct wl_proxy *) zwp_input_method_context_v1,
225 				     (void (**)(void)) listener, data);
226 }
227 
228 #define ZWP_INPUT_METHOD_CONTEXT_V1_DESTROY 0
229 #define ZWP_INPUT_METHOD_CONTEXT_V1_COMMIT_STRING 1
230 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STRING 2
231 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STYLING 3
232 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_CURSOR 4
233 #define ZWP_INPUT_METHOD_CONTEXT_V1_DELETE_SURROUNDING_TEXT 5
234 #define ZWP_INPUT_METHOD_CONTEXT_V1_CURSOR_POSITION 6
235 #define ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS_MAP 7
236 #define ZWP_INPUT_METHOD_CONTEXT_V1_KEYSYM 8
237 #define ZWP_INPUT_METHOD_CONTEXT_V1_GRAB_KEYBOARD 9
238 #define ZWP_INPUT_METHOD_CONTEXT_V1_KEY 10
239 #define ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS 11
240 #define ZWP_INPUT_METHOD_CONTEXT_V1_LANGUAGE 12
241 #define ZWP_INPUT_METHOD_CONTEXT_V1_TEXT_DIRECTION 13
242 
243 /**
244  * @ingroup iface_zwp_input_method_context_v1
245  */
246 #define ZWP_INPUT_METHOD_CONTEXT_V1_SURROUNDING_TEXT_SINCE_VERSION 1
247 /**
248  * @ingroup iface_zwp_input_method_context_v1
249  */
250 #define ZWP_INPUT_METHOD_CONTEXT_V1_RESET_SINCE_VERSION 1
251 /**
252  * @ingroup iface_zwp_input_method_context_v1
253  */
254 #define ZWP_INPUT_METHOD_CONTEXT_V1_CONTENT_TYPE_SINCE_VERSION 1
255 /**
256  * @ingroup iface_zwp_input_method_context_v1
257  */
258 #define ZWP_INPUT_METHOD_CONTEXT_V1_INVOKE_ACTION_SINCE_VERSION 1
259 /**
260  * @ingroup iface_zwp_input_method_context_v1
261  */
262 #define ZWP_INPUT_METHOD_CONTEXT_V1_COMMIT_STATE_SINCE_VERSION 1
263 /**
264  * @ingroup iface_zwp_input_method_context_v1
265  */
266 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREFERRED_LANGUAGE_SINCE_VERSION 1
267 
268 /**
269  * @ingroup iface_zwp_input_method_context_v1
270  */
271 #define ZWP_INPUT_METHOD_CONTEXT_V1_DESTROY_SINCE_VERSION 1
272 /**
273  * @ingroup iface_zwp_input_method_context_v1
274  */
275 #define ZWP_INPUT_METHOD_CONTEXT_V1_COMMIT_STRING_SINCE_VERSION 1
276 /**
277  * @ingroup iface_zwp_input_method_context_v1
278  */
279 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STRING_SINCE_VERSION 1
280 /**
281  * @ingroup iface_zwp_input_method_context_v1
282  */
283 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STYLING_SINCE_VERSION 1
284 /**
285  * @ingroup iface_zwp_input_method_context_v1
286  */
287 #define ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_CURSOR_SINCE_VERSION 1
288 /**
289  * @ingroup iface_zwp_input_method_context_v1
290  */
291 #define ZWP_INPUT_METHOD_CONTEXT_V1_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
292 /**
293  * @ingroup iface_zwp_input_method_context_v1
294  */
295 #define ZWP_INPUT_METHOD_CONTEXT_V1_CURSOR_POSITION_SINCE_VERSION 1
296 /**
297  * @ingroup iface_zwp_input_method_context_v1
298  */
299 #define ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS_MAP_SINCE_VERSION 1
300 /**
301  * @ingroup iface_zwp_input_method_context_v1
302  */
303 #define ZWP_INPUT_METHOD_CONTEXT_V1_KEYSYM_SINCE_VERSION 1
304 /**
305  * @ingroup iface_zwp_input_method_context_v1
306  */
307 #define ZWP_INPUT_METHOD_CONTEXT_V1_GRAB_KEYBOARD_SINCE_VERSION 1
308 /**
309  * @ingroup iface_zwp_input_method_context_v1
310  */
311 #define ZWP_INPUT_METHOD_CONTEXT_V1_KEY_SINCE_VERSION 1
312 /**
313  * @ingroup iface_zwp_input_method_context_v1
314  */
315 #define ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS_SINCE_VERSION 1
316 /**
317  * @ingroup iface_zwp_input_method_context_v1
318  */
319 #define ZWP_INPUT_METHOD_CONTEXT_V1_LANGUAGE_SINCE_VERSION 1
320 /**
321  * @ingroup iface_zwp_input_method_context_v1
322  */
323 #define ZWP_INPUT_METHOD_CONTEXT_V1_TEXT_DIRECTION_SINCE_VERSION 1
324 
325 /** @ingroup iface_zwp_input_method_context_v1 */
326 static inline void
zwp_input_method_context_v1_set_user_data(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,void * user_data)327 zwp_input_method_context_v1_set_user_data(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, void *user_data)
328 {
329 	wl_proxy_set_user_data((struct wl_proxy *) zwp_input_method_context_v1, user_data);
330 }
331 
332 /** @ingroup iface_zwp_input_method_context_v1 */
333 static inline void *
zwp_input_method_context_v1_get_user_data(struct zwp_input_method_context_v1 * zwp_input_method_context_v1)334 zwp_input_method_context_v1_get_user_data(struct zwp_input_method_context_v1 *zwp_input_method_context_v1)
335 {
336 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_method_context_v1);
337 }
338 
339 static inline uint32_t
zwp_input_method_context_v1_get_version(struct zwp_input_method_context_v1 * zwp_input_method_context_v1)340 zwp_input_method_context_v1_get_version(struct zwp_input_method_context_v1 *zwp_input_method_context_v1)
341 {
342 	return wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1);
343 }
344 
345 /**
346  * @ingroup iface_zwp_input_method_context_v1
347  */
348 static inline void
zwp_input_method_context_v1_destroy(struct zwp_input_method_context_v1 * zwp_input_method_context_v1)349 zwp_input_method_context_v1_destroy(struct zwp_input_method_context_v1 *zwp_input_method_context_v1)
350 {
351 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
352 			 ZWP_INPUT_METHOD_CONTEXT_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), WL_MARSHAL_FLAG_DESTROY);
353 }
354 
355 /**
356  * @ingroup iface_zwp_input_method_context_v1
357  *
358  * Send the commit string text for insertion to the application.
359  *
360  * The text to commit could be either just a single character after a key
361  * press or the result of some composing (pre-edit). It could be also an
362  * empty text when some text should be removed (see
363  * delete_surrounding_text) or when the input cursor should be moved (see
364  * cursor_position).
365  *
366  * Any previously set composing text will be removed.
367  */
368 static inline void
zwp_input_method_context_v1_commit_string(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,const char * text)369 zwp_input_method_context_v1_commit_string(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, const char *text)
370 {
371 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
372 			 ZWP_INPUT_METHOD_CONTEXT_V1_COMMIT_STRING, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, text);
373 }
374 
375 /**
376  * @ingroup iface_zwp_input_method_context_v1
377  *
378  * Send the pre-edit string text to the application text input.
379  *
380  * The commit text can be used to replace the pre-edit text on reset (for
381  * example on unfocus).
382  *
383  * Previously sent preedit_style and preedit_cursor requests are also
384  * processed by the text_input.
385  */
386 static inline void
zwp_input_method_context_v1_preedit_string(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,const char * text,const char * commit)387 zwp_input_method_context_v1_preedit_string(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, const char *text, const char *commit)
388 {
389 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
390 			 ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STRING, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, text, commit);
391 }
392 
393 /**
394  * @ingroup iface_zwp_input_method_context_v1
395  *
396  * Set the styling information on composing text. The style is applied for
397  * length in bytes from index relative to the beginning of
398  * the composing text (as byte offset). Multiple styles can
399  * be applied to a composing text.
400  *
401  * This request should be sent before sending a preedit_string request.
402  */
403 static inline void
zwp_input_method_context_v1_preedit_styling(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t index,uint32_t length,uint32_t style)404 zwp_input_method_context_v1_preedit_styling(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t index, uint32_t length, uint32_t style)
405 {
406 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
407 			 ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_STYLING, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, index, length, style);
408 }
409 
410 /**
411  * @ingroup iface_zwp_input_method_context_v1
412  *
413  * Set the cursor position inside the composing text (as byte offset)
414  * relative to the start of the composing text.
415  *
416  * When index is negative no cursor should be displayed.
417  *
418  * This request should be sent before sending a preedit_string request.
419  */
420 static inline void
zwp_input_method_context_v1_preedit_cursor(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,int32_t index)421 zwp_input_method_context_v1_preedit_cursor(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, int32_t index)
422 {
423 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
424 			 ZWP_INPUT_METHOD_CONTEXT_V1_PREEDIT_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, index);
425 }
426 
427 /**
428  * @ingroup iface_zwp_input_method_context_v1
429  *
430  * Remove the surrounding text.
431  *
432  * This request will be handled on the text_input side directly following
433  * a commit_string request.
434  */
435 static inline void
zwp_input_method_context_v1_delete_surrounding_text(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,int32_t index,uint32_t length)436 zwp_input_method_context_v1_delete_surrounding_text(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, int32_t index, uint32_t length)
437 {
438 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
439 			 ZWP_INPUT_METHOD_CONTEXT_V1_DELETE_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, index, length);
440 }
441 
442 /**
443  * @ingroup iface_zwp_input_method_context_v1
444  *
445  * Set the cursor and anchor to a new position. Index is the new cursor
446  * position in bytes (when >= 0 this is relative to the end of the inserted text,
447  * otherwise it is relative to the beginning of the inserted text). Anchor is
448  * the new anchor position in bytes (when >= 0 this is relative to the end of the
449  * inserted text, otherwise it is relative to the beginning of the inserted
450  * text). When there should be no selected text, anchor should be the same
451  * as index.
452  *
453  * This request will be handled on the text_input side directly following
454  * a commit_string request.
455  */
456 static inline void
zwp_input_method_context_v1_cursor_position(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,int32_t index,int32_t anchor)457 zwp_input_method_context_v1_cursor_position(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, int32_t index, int32_t anchor)
458 {
459 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
460 			 ZWP_INPUT_METHOD_CONTEXT_V1_CURSOR_POSITION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, index, anchor);
461 }
462 
463 /**
464  * @ingroup iface_zwp_input_method_context_v1
465  */
466 static inline void
zwp_input_method_context_v1_modifiers_map(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,struct wl_array * map)467 zwp_input_method_context_v1_modifiers_map(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, struct wl_array *map)
468 {
469 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
470 			 ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS_MAP, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, map);
471 }
472 
473 /**
474  * @ingroup iface_zwp_input_method_context_v1
475  *
476  * Notify when a key event was sent. Key events should not be used for
477  * normal text input operations, which should be done with commit_string,
478  * delete_surrounding_text, etc. The key event follows the wl_keyboard key
479  * event convention. Sym is an XKB keysym, state is a wl_keyboard key_state.
480  */
481 static inline void
zwp_input_method_context_v1_keysym(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,uint32_t time,uint32_t sym,uint32_t state,uint32_t modifiers)482 zwp_input_method_context_v1_keysym(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, uint32_t time, uint32_t sym, uint32_t state, uint32_t modifiers)
483 {
484 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
485 			 ZWP_INPUT_METHOD_CONTEXT_V1_KEYSYM, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, time, sym, state, modifiers);
486 }
487 
488 /**
489  * @ingroup iface_zwp_input_method_context_v1
490  *
491  * Allow an input method to receive hardware keyboard input and process
492  * key events to generate text events (with pre-edit) over the wire. This
493  * allows input methods which compose multiple key events for inputting
494  * text like it is done for CJK languages.
495  */
496 static inline struct wl_keyboard *
zwp_input_method_context_v1_grab_keyboard(struct zwp_input_method_context_v1 * zwp_input_method_context_v1)497 zwp_input_method_context_v1_grab_keyboard(struct zwp_input_method_context_v1 *zwp_input_method_context_v1)
498 {
499 	struct wl_proxy *keyboard;
500 
501 	keyboard = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
502 			 ZWP_INPUT_METHOD_CONTEXT_V1_GRAB_KEYBOARD, &wl_keyboard_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, NULL);
503 
504 	return (struct wl_keyboard *) keyboard;
505 }
506 
507 /**
508  * @ingroup iface_zwp_input_method_context_v1
509  *
510  * Forward a wl_keyboard::key event to the client that was not processed
511  * by the input method itself. Should be used when filtering key events
512  * with grab_keyboard.  The arguments should be the ones from the
513  * wl_keyboard::key event.
514  *
515  * For generating custom key events use the keysym request instead.
516  */
517 static inline void
zwp_input_method_context_v1_key(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,uint32_t time,uint32_t key,uint32_t state)518 zwp_input_method_context_v1_key(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
519 {
520 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
521 			 ZWP_INPUT_METHOD_CONTEXT_V1_KEY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, time, key, state);
522 }
523 
524 /**
525  * @ingroup iface_zwp_input_method_context_v1
526  *
527  * Forward a wl_keyboard::modifiers event to the client that was not
528  * processed by the input method itself.  Should be used when filtering
529  * key events with grab_keyboard. The arguments should be the ones
530  * from the wl_keyboard::modifiers event.
531  */
532 static inline void
zwp_input_method_context_v1_modifiers(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,uint32_t mods_depressed,uint32_t mods_latched,uint32_t mods_locked,uint32_t group)533 zwp_input_method_context_v1_modifiers(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
534 {
535 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
536 			 ZWP_INPUT_METHOD_CONTEXT_V1_MODIFIERS, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, mods_depressed, mods_latched, mods_locked, group);
537 }
538 
539 /**
540  * @ingroup iface_zwp_input_method_context_v1
541  */
542 static inline void
zwp_input_method_context_v1_language(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,const char * language)543 zwp_input_method_context_v1_language(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, const char *language)
544 {
545 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
546 			 ZWP_INPUT_METHOD_CONTEXT_V1_LANGUAGE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, language);
547 }
548 
549 /**
550  * @ingroup iface_zwp_input_method_context_v1
551  */
552 static inline void
zwp_input_method_context_v1_text_direction(struct zwp_input_method_context_v1 * zwp_input_method_context_v1,uint32_t serial,uint32_t direction)553 zwp_input_method_context_v1_text_direction(struct zwp_input_method_context_v1 *zwp_input_method_context_v1, uint32_t serial, uint32_t direction)
554 {
555 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_method_context_v1,
556 			 ZWP_INPUT_METHOD_CONTEXT_V1_TEXT_DIRECTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_method_context_v1), 0, serial, direction);
557 }
558 
559 /**
560  * @ingroup iface_zwp_input_method_v1
561  * @struct zwp_input_method_v1_listener
562  */
563 struct zwp_input_method_v1_listener {
564 	/**
565 	 * activate event
566 	 *
567 	 * A text input was activated. Creates an input method context
568 	 * object which allows communication with the text input.
569 	 */
570 	void (*activate)(void *data,
571 			 struct zwp_input_method_v1 *zwp_input_method_v1,
572 			 struct zwp_input_method_context_v1 *id);
573 	/**
574 	 * deactivate event
575 	 *
576 	 * The text input corresponding to the context argument was
577 	 * deactivated. The input method context should be destroyed after
578 	 * deactivation is handled.
579 	 */
580 	void (*deactivate)(void *data,
581 			   struct zwp_input_method_v1 *zwp_input_method_v1,
582 			   struct zwp_input_method_context_v1 *context);
583 };
584 
585 /**
586  * @ingroup iface_zwp_input_method_v1
587  */
588 static inline int
zwp_input_method_v1_add_listener(struct zwp_input_method_v1 * zwp_input_method_v1,const struct zwp_input_method_v1_listener * listener,void * data)589 zwp_input_method_v1_add_listener(struct zwp_input_method_v1 *zwp_input_method_v1,
590 				 const struct zwp_input_method_v1_listener *listener, void *data)
591 {
592 	return wl_proxy_add_listener((struct wl_proxy *) zwp_input_method_v1,
593 				     (void (**)(void)) listener, data);
594 }
595 
596 /**
597  * @ingroup iface_zwp_input_method_v1
598  */
599 #define ZWP_INPUT_METHOD_V1_ACTIVATE_SINCE_VERSION 1
600 /**
601  * @ingroup iface_zwp_input_method_v1
602  */
603 #define ZWP_INPUT_METHOD_V1_DEACTIVATE_SINCE_VERSION 1
604 
605 
606 /** @ingroup iface_zwp_input_method_v1 */
607 static inline void
zwp_input_method_v1_set_user_data(struct zwp_input_method_v1 * zwp_input_method_v1,void * user_data)608 zwp_input_method_v1_set_user_data(struct zwp_input_method_v1 *zwp_input_method_v1, void *user_data)
609 {
610 	wl_proxy_set_user_data((struct wl_proxy *) zwp_input_method_v1, user_data);
611 }
612 
613 /** @ingroup iface_zwp_input_method_v1 */
614 static inline void *
zwp_input_method_v1_get_user_data(struct zwp_input_method_v1 * zwp_input_method_v1)615 zwp_input_method_v1_get_user_data(struct zwp_input_method_v1 *zwp_input_method_v1)
616 {
617 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_method_v1);
618 }
619 
620 static inline uint32_t
zwp_input_method_v1_get_version(struct zwp_input_method_v1 * zwp_input_method_v1)621 zwp_input_method_v1_get_version(struct zwp_input_method_v1 *zwp_input_method_v1)
622 {
623 	return wl_proxy_get_version((struct wl_proxy *) zwp_input_method_v1);
624 }
625 
626 /** @ingroup iface_zwp_input_method_v1 */
627 static inline void
zwp_input_method_v1_destroy(struct zwp_input_method_v1 * zwp_input_method_v1)628 zwp_input_method_v1_destroy(struct zwp_input_method_v1 *zwp_input_method_v1)
629 {
630 	wl_proxy_destroy((struct wl_proxy *) zwp_input_method_v1);
631 }
632 
633 #define ZWP_INPUT_PANEL_V1_GET_INPUT_PANEL_SURFACE 0
634 
635 
636 /**
637  * @ingroup iface_zwp_input_panel_v1
638  */
639 #define ZWP_INPUT_PANEL_V1_GET_INPUT_PANEL_SURFACE_SINCE_VERSION 1
640 
641 /** @ingroup iface_zwp_input_panel_v1 */
642 static inline void
zwp_input_panel_v1_set_user_data(struct zwp_input_panel_v1 * zwp_input_panel_v1,void * user_data)643 zwp_input_panel_v1_set_user_data(struct zwp_input_panel_v1 *zwp_input_panel_v1, void *user_data)
644 {
645 	wl_proxy_set_user_data((struct wl_proxy *) zwp_input_panel_v1, user_data);
646 }
647 
648 /** @ingroup iface_zwp_input_panel_v1 */
649 static inline void *
zwp_input_panel_v1_get_user_data(struct zwp_input_panel_v1 * zwp_input_panel_v1)650 zwp_input_panel_v1_get_user_data(struct zwp_input_panel_v1 *zwp_input_panel_v1)
651 {
652 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_panel_v1);
653 }
654 
655 static inline uint32_t
zwp_input_panel_v1_get_version(struct zwp_input_panel_v1 * zwp_input_panel_v1)656 zwp_input_panel_v1_get_version(struct zwp_input_panel_v1 *zwp_input_panel_v1)
657 {
658 	return wl_proxy_get_version((struct wl_proxy *) zwp_input_panel_v1);
659 }
660 
661 /** @ingroup iface_zwp_input_panel_v1 */
662 static inline void
zwp_input_panel_v1_destroy(struct zwp_input_panel_v1 * zwp_input_panel_v1)663 zwp_input_panel_v1_destroy(struct zwp_input_panel_v1 *zwp_input_panel_v1)
664 {
665 	wl_proxy_destroy((struct wl_proxy *) zwp_input_panel_v1);
666 }
667 
668 /**
669  * @ingroup iface_zwp_input_panel_v1
670  */
671 static inline struct zwp_input_panel_surface_v1 *
zwp_input_panel_v1_get_input_panel_surface(struct zwp_input_panel_v1 * zwp_input_panel_v1,struct wl_surface * surface)672 zwp_input_panel_v1_get_input_panel_surface(struct zwp_input_panel_v1 *zwp_input_panel_v1, struct wl_surface *surface)
673 {
674 	struct wl_proxy *id;
675 
676 	id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_panel_v1,
677 			 ZWP_INPUT_PANEL_V1_GET_INPUT_PANEL_SURFACE, &zwp_input_panel_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_panel_v1), 0, NULL, surface);
678 
679 	return (struct zwp_input_panel_surface_v1 *) id;
680 }
681 
682 #ifndef ZWP_INPUT_PANEL_SURFACE_V1_POSITION_ENUM
683 #define ZWP_INPUT_PANEL_SURFACE_V1_POSITION_ENUM
684 enum zwp_input_panel_surface_v1_position {
685 	ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM = 0,
686 };
687 #endif /* ZWP_INPUT_PANEL_SURFACE_V1_POSITION_ENUM */
688 
689 #define ZWP_INPUT_PANEL_SURFACE_V1_SET_TOPLEVEL 0
690 #define ZWP_INPUT_PANEL_SURFACE_V1_SET_OVERLAY_PANEL 1
691 
692 
693 /**
694  * @ingroup iface_zwp_input_panel_surface_v1
695  */
696 #define ZWP_INPUT_PANEL_SURFACE_V1_SET_TOPLEVEL_SINCE_VERSION 1
697 /**
698  * @ingroup iface_zwp_input_panel_surface_v1
699  */
700 #define ZWP_INPUT_PANEL_SURFACE_V1_SET_OVERLAY_PANEL_SINCE_VERSION 1
701 
702 /** @ingroup iface_zwp_input_panel_surface_v1 */
703 static inline void
zwp_input_panel_surface_v1_set_user_data(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1,void * user_data)704 zwp_input_panel_surface_v1_set_user_data(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1, void *user_data)
705 {
706 	wl_proxy_set_user_data((struct wl_proxy *) zwp_input_panel_surface_v1, user_data);
707 }
708 
709 /** @ingroup iface_zwp_input_panel_surface_v1 */
710 static inline void *
zwp_input_panel_surface_v1_get_user_data(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1)711 zwp_input_panel_surface_v1_get_user_data(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1)
712 {
713 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_panel_surface_v1);
714 }
715 
716 static inline uint32_t
zwp_input_panel_surface_v1_get_version(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1)717 zwp_input_panel_surface_v1_get_version(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1)
718 {
719 	return wl_proxy_get_version((struct wl_proxy *) zwp_input_panel_surface_v1);
720 }
721 
722 /** @ingroup iface_zwp_input_panel_surface_v1 */
723 static inline void
zwp_input_panel_surface_v1_destroy(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1)724 zwp_input_panel_surface_v1_destroy(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1)
725 {
726 	wl_proxy_destroy((struct wl_proxy *) zwp_input_panel_surface_v1);
727 }
728 
729 /**
730  * @ingroup iface_zwp_input_panel_surface_v1
731  *
732  * Set the input_panel_surface type to keyboard.
733  *
734  * A keyboard surface is only shown when a text input is active.
735  */
736 static inline void
zwp_input_panel_surface_v1_set_toplevel(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1,struct wl_output * output,uint32_t position)737 zwp_input_panel_surface_v1_set_toplevel(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1, struct wl_output *output, uint32_t position)
738 {
739 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_panel_surface_v1,
740 			 ZWP_INPUT_PANEL_SURFACE_V1_SET_TOPLEVEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_panel_surface_v1), 0, output, position);
741 }
742 
743 /**
744  * @ingroup iface_zwp_input_panel_surface_v1
745  *
746  * Set the input_panel_surface to be an overlay panel.
747  *
748  * This is shown near the input cursor above the application window when
749  * a text input is active.
750  */
751 static inline void
zwp_input_panel_surface_v1_set_overlay_panel(struct zwp_input_panel_surface_v1 * zwp_input_panel_surface_v1)752 zwp_input_panel_surface_v1_set_overlay_panel(struct zwp_input_panel_surface_v1 *zwp_input_panel_surface_v1)
753 {
754 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_panel_surface_v1,
755 			 ZWP_INPUT_PANEL_SURFACE_V1_SET_OVERLAY_PANEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_panel_surface_v1), 0);
756 }
757 
758 #ifdef  __cplusplus
759 }
760 #endif
761 
762 #endif
763