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