1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef TEXT_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define TEXT_INPUT_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_text_input_unstable_v1 The text_input_unstable_v1 protocol
16  * @section page_ifaces_text_input_unstable_v1 Interfaces
17  * - @subpage page_iface_zwp_text_input_v1 - text input
18  * - @subpage page_iface_zwp_text_input_manager_v1 - text input manager
19  * @section page_copyright_text_input_unstable_v1 Copyright
20  * <pre>
21  *
22  * Copyright © 2012, 2013 Intel Corporation
23  *
24  * Permission is hereby granted, free of charge, to any person obtaining a
25  * copy of this software and associated documentation files (the "Software"),
26  * to deal in the Software without restriction, including without limitation
27  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28  * and/or sell copies of the Software, and to permit persons to whom the
29  * Software is furnished to do so, subject to the following conditions:
30  *
31  * The above copyright notice and this permission notice (including the next
32  * paragraph) shall be included in all copies or substantial portions of the
33  * Software.
34  *
35  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
38  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41  * DEALINGS IN THE SOFTWARE.
42  * </pre>
43  */
44 struct wl_seat;
45 struct wl_surface;
46 struct zwp_text_input_manager_v1;
47 struct zwp_text_input_v1;
48 
49 #ifndef ZWP_TEXT_INPUT_V1_INTERFACE
50 #define ZWP_TEXT_INPUT_V1_INTERFACE
51 /**
52  * @page page_iface_zwp_text_input_v1 zwp_text_input_v1
53  * @section page_iface_zwp_text_input_v1_desc Description
54  *
55  * An object used for text input. Adds support for text input and input
56  * methods to applications. A text_input object is created from a
57  * wl_text_input_manager and corresponds typically to a text entry in an
58  * application.
59  *
60  * Requests are used to activate/deactivate the text_input object and set
61  * state information like surrounding and selected text or the content type.
62  * The information about entered text is sent to the text_input object via
63  * the pre-edit and commit events. Using this interface removes the need
64  * for applications to directly process hardware key events and compose text
65  * out of them.
66  *
67  * Text is generally UTF-8 encoded, indices and lengths are in bytes.
68  *
69  * Serials are used to synchronize the state between the text input and
70  * an input method. New serials are sent by the text input in the
71  * commit_state request and are used by the input method to indicate
72  * the known text input state in events like preedit_string, commit_string,
73  * and keysym. The text input can then ignore events from the input method
74  * which are based on an outdated state (for example after a reset).
75  *
76  * Warning! The protocol described in this file is experimental and
77  * backward incompatible changes may be made. Backward compatible changes
78  * may be added together with the corresponding interface version bump.
79  * Backward incompatible changes are done by bumping the version number in
80  * the protocol and interface names and resetting the interface version.
81  * Once the protocol is to be declared stable, the 'z' prefix and the
82  * version number in the protocol and interface names are removed and the
83  * interface version number is reset.
84  * @section page_iface_zwp_text_input_v1_api API
85  * See @ref iface_zwp_text_input_v1.
86  */
87 /**
88  * @defgroup iface_zwp_text_input_v1 The zwp_text_input_v1 interface
89  *
90  * An object used for text input. Adds support for text input and input
91  * methods to applications. A text_input object is created from a
92  * wl_text_input_manager and corresponds typically to a text entry in an
93  * application.
94  *
95  * Requests are used to activate/deactivate the text_input object and set
96  * state information like surrounding and selected text or the content type.
97  * The information about entered text is sent to the text_input object via
98  * the pre-edit and commit events. Using this interface removes the need
99  * for applications to directly process hardware key events and compose text
100  * out of them.
101  *
102  * Text is generally UTF-8 encoded, indices and lengths are in bytes.
103  *
104  * Serials are used to synchronize the state between the text input and
105  * an input method. New serials are sent by the text input in the
106  * commit_state request and are used by the input method to indicate
107  * the known text input state in events like preedit_string, commit_string,
108  * and keysym. The text input can then ignore events from the input method
109  * which are based on an outdated state (for example after a reset).
110  *
111  * Warning! The protocol described in this file is experimental and
112  * backward incompatible changes may be made. Backward compatible changes
113  * may be added together with the corresponding interface version bump.
114  * Backward incompatible changes are done by bumping the version number in
115  * the protocol and interface names and resetting the interface version.
116  * Once the protocol is to be declared stable, the 'z' prefix and the
117  * version number in the protocol and interface names are removed and the
118  * interface version number is reset.
119  */
120 extern const struct wl_interface zwp_text_input_v1_interface;
121 #endif
122 #ifndef ZWP_TEXT_INPUT_MANAGER_V1_INTERFACE
123 #define ZWP_TEXT_INPUT_MANAGER_V1_INTERFACE
124 /**
125  * @page page_iface_zwp_text_input_manager_v1 zwp_text_input_manager_v1
126  * @section page_iface_zwp_text_input_manager_v1_desc Description
127  *
128  * A factory for text_input objects. This object is a global singleton.
129  * @section page_iface_zwp_text_input_manager_v1_api API
130  * See @ref iface_zwp_text_input_manager_v1.
131  */
132 /**
133  * @defgroup iface_zwp_text_input_manager_v1 The zwp_text_input_manager_v1 interface
134  *
135  * A factory for text_input objects. This object is a global singleton.
136  */
137 extern const struct wl_interface zwp_text_input_manager_v1_interface;
138 #endif
139 
140 #ifndef ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM
141 #define ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM
142 /**
143  * @ingroup iface_zwp_text_input_v1
144  * content hint
145  *
146  * Content hint is a bitmask to allow to modify the behavior of the text
147  * input.
148  */
149 enum zwp_text_input_v1_content_hint {
150 	/**
151 	 * no special behaviour
152 	 */
153 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_NONE = 0x0,
154 	/**
155 	 * auto completion, correction and capitalization
156 	 */
157 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_DEFAULT = 0x7,
158 	/**
159 	 * hidden and sensitive text
160 	 */
161 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_PASSWORD = 0xc0,
162 	/**
163 	 * suggest word completions
164 	 */
165 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_COMPLETION = 0x1,
166 	/**
167 	 * suggest word corrections
168 	 */
169 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CORRECTION = 0x2,
170 	/**
171 	 * switch to uppercase letters at the start of a sentence
172 	 */
173 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
174 	/**
175 	 * prefer lowercase letters
176 	 */
177 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_LOWERCASE = 0x8,
178 	/**
179 	 * prefer uppercase letters
180 	 */
181 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_UPPERCASE = 0x10,
182 	/**
183 	 * prefer casing for titles and headings (can be language dependent)
184 	 */
185 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_TITLECASE = 0x20,
186 	/**
187 	 * characters should be hidden
188 	 */
189 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_HIDDEN_TEXT = 0x40,
190 	/**
191 	 * typed text should not be stored
192 	 */
193 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_SENSITIVE_DATA = 0x80,
194 	/**
195 	 * just latin characters should be entered
196 	 */
197 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_LATIN = 0x100,
198 	/**
199 	 * the text input is multiline
200 	 */
201 	ZWP_TEXT_INPUT_V1_CONTENT_HINT_MULTILINE = 0x200,
202 };
203 #endif /* ZWP_TEXT_INPUT_V1_CONTENT_HINT_ENUM */
204 
205 #ifndef ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM
206 #define ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM
207 /**
208  * @ingroup iface_zwp_text_input_v1
209  * content purpose
210  *
211  * The content purpose allows to specify the primary purpose of a text
212  * input.
213  *
214  * This allows an input method to show special purpose input panels with
215  * extra characters or to disallow some characters.
216  */
217 enum zwp_text_input_v1_content_purpose {
218 	/**
219 	 * default input, allowing all characters
220 	 */
221 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NORMAL = 0,
222 	/**
223 	 * allow only alphabetic characters
224 	 */
225 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ALPHA = 1,
226 	/**
227 	 * allow only digits
228 	 */
229 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DIGITS = 2,
230 	/**
231 	 * input a number (including decimal separator and sign)
232 	 */
233 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NUMBER = 3,
234 	/**
235 	 * input a phone number
236 	 */
237 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PHONE = 4,
238 	/**
239 	 * input an URL
240 	 */
241 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_URL = 5,
242 	/**
243 	 * input an email address
244 	 */
245 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_EMAIL = 6,
246 	/**
247 	 * input a name of a person
248 	 */
249 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_NAME = 7,
250 	/**
251 	 * input a password (combine with password or sensitive_data hint)
252 	 */
253 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_PASSWORD = 8,
254 	/**
255 	 * input a date
256 	 */
257 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATE = 9,
258 	/**
259 	 * input a time
260 	 */
261 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TIME = 10,
262 	/**
263 	 * input a date and time
264 	 */
265 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_DATETIME = 11,
266 	/**
267 	 * input for a terminal
268 	 */
269 	ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_TERMINAL = 12,
270 };
271 #endif /* ZWP_TEXT_INPUT_V1_CONTENT_PURPOSE_ENUM */
272 
273 #ifndef ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM
274 #define ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM
275 enum zwp_text_input_v1_preedit_style {
276 	/**
277 	 * default style for composing text
278 	 */
279 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_DEFAULT = 0,
280 	/**
281 	 * style should be the same as in non-composing text
282 	 */
283 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_NONE = 1,
284 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ACTIVE = 2,
285 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INACTIVE = 3,
286 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_HIGHLIGHT = 4,
287 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_UNDERLINE = 5,
288 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_SELECTION = 6,
289 	ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_INCORRECT = 7,
290 };
291 #endif /* ZWP_TEXT_INPUT_V1_PREEDIT_STYLE_ENUM */
292 
293 #ifndef ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM
294 #define ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM
295 enum zwp_text_input_v1_text_direction {
296 	/**
297 	 * automatic text direction based on text and language
298 	 */
299 	ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_AUTO = 0,
300 	/**
301 	 * left-to-right
302 	 */
303 	ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_LTR = 1,
304 	/**
305 	 * right-to-left
306 	 */
307 	ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_RTL = 2,
308 };
309 #endif /* ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_ENUM */
310 
311 /**
312  * @ingroup iface_zwp_text_input_v1
313  * @struct zwp_text_input_v1_listener
314  */
315 struct zwp_text_input_v1_listener {
316 	/**
317 	 * enter event
318 	 *
319 	 * Notify the text_input object when it received focus. Typically
320 	 * in response to an activate request.
321 	 */
322 	void (*enter)(void *data,
323 		      struct zwp_text_input_v1 *zwp_text_input_v1,
324 		      struct wl_surface *surface);
325 	/**
326 	 * leave event
327 	 *
328 	 * Notify the text_input object when it lost focus. Either in
329 	 * response to a deactivate request or when the assigned surface
330 	 * lost focus or was destroyed.
331 	 */
332 	void (*leave)(void *data,
333 		      struct zwp_text_input_v1 *zwp_text_input_v1);
334 	/**
335 	 * modifiers map
336 	 *
337 	 * Transfer an array of 0-terminated modifier names. The position
338 	 * in the array is the index of the modifier as used in the
339 	 * modifiers bitmask in the keysym event.
340 	 */
341 	void (*modifiers_map)(void *data,
342 			      struct zwp_text_input_v1 *zwp_text_input_v1,
343 			      struct wl_array *map);
344 	/**
345 	 * state of the input panel
346 	 *
347 	 * Notify when the visibility state of the input panel changed.
348 	 */
349 	void (*input_panel_state)(void *data,
350 				  struct zwp_text_input_v1 *zwp_text_input_v1,
351 				  uint32_t state);
352 	/**
353 	 * pre-edit
354 	 *
355 	 * Notify when a new composing text (pre-edit) should be set
356 	 * around the current cursor position. Any previously set composing
357 	 * text should be removed.
358 	 *
359 	 * The commit text can be used to replace the preedit text on reset
360 	 * (for example on unfocus).
361 	 *
362 	 * The text input should also handle all preedit_style and
363 	 * preedit_cursor events occurring directly before preedit_string.
364 	 * @param serial serial of the latest known text input state
365 	 */
366 	void (*preedit_string)(void *data,
367 			       struct zwp_text_input_v1 *zwp_text_input_v1,
368 			       uint32_t serial,
369 			       const char *text,
370 			       const char *commit);
371 	/**
372 	 * pre-edit styling
373 	 *
374 	 * Sets styling information on composing text. The style is
375 	 * applied for length bytes from index relative to the beginning of
376 	 * the composing text (as byte offset). Multiple styles can be
377 	 * applied to a composing text by sending multiple preedit_styling
378 	 * events.
379 	 *
380 	 * This event is handled as part of a following preedit_string
381 	 * event.
382 	 */
383 	void (*preedit_styling)(void *data,
384 				struct zwp_text_input_v1 *zwp_text_input_v1,
385 				uint32_t index,
386 				uint32_t length,
387 				uint32_t style);
388 	/**
389 	 * pre-edit cursor
390 	 *
391 	 * Sets the cursor position inside the composing text (as byte
392 	 * offset) relative to the start of the composing text. When index
393 	 * is a negative number no cursor is shown.
394 	 *
395 	 * This event is handled as part of a following preedit_string
396 	 * event.
397 	 */
398 	void (*preedit_cursor)(void *data,
399 			       struct zwp_text_input_v1 *zwp_text_input_v1,
400 			       int32_t index);
401 	/**
402 	 * commit
403 	 *
404 	 * Notify when text should be inserted into the editor widget.
405 	 * The text to commit could be either just a single character after
406 	 * a key press or the result of some composing (pre-edit). It could
407 	 * also be an empty text when some text should be removed (see
408 	 * delete_surrounding_text) or when the input cursor should be
409 	 * moved (see cursor_position).
410 	 *
411 	 * Any previously set composing text should be removed.
412 	 * @param serial serial of the latest known text input state
413 	 */
414 	void (*commit_string)(void *data,
415 			      struct zwp_text_input_v1 *zwp_text_input_v1,
416 			      uint32_t serial,
417 			      const char *text);
418 	/**
419 	 * set cursor to new position
420 	 *
421 	 * Notify when the cursor or anchor position should be modified.
422 	 *
423 	 * This event should be handled as part of a following
424 	 * commit_string event.
425 	 */
426 	void (*cursor_position)(void *data,
427 				struct zwp_text_input_v1 *zwp_text_input_v1,
428 				int32_t index,
429 				int32_t anchor);
430 	/**
431 	 * delete surrounding text
432 	 *
433 	 * Notify when the text around the current cursor position should
434 	 * be deleted.
435 	 *
436 	 * Index is relative to the current cursor (in bytes). Length is
437 	 * the length of deleted text (in bytes).
438 	 *
439 	 * This event should be handled as part of a following
440 	 * commit_string event.
441 	 */
442 	void (*delete_surrounding_text)(void *data,
443 					struct zwp_text_input_v1 *zwp_text_input_v1,
444 					int32_t index,
445 					uint32_t length);
446 	/**
447 	 * keysym
448 	 *
449 	 * Notify when a key event was sent. Key events should not be
450 	 * used for normal text input operations, which should be done with
451 	 * commit_string, delete_surrounding_text, etc. The key event
452 	 * follows the wl_keyboard key event convention. Sym is an XKB
453 	 * keysym, state a wl_keyboard key_state. Modifiers are a mask for
454 	 * effective modifiers (where the modifier indices are set by the
455 	 * modifiers_map event)
456 	 * @param serial serial of the latest known text input state
457 	 */
458 	void (*keysym)(void *data,
459 		       struct zwp_text_input_v1 *zwp_text_input_v1,
460 		       uint32_t serial,
461 		       uint32_t time,
462 		       uint32_t sym,
463 		       uint32_t state,
464 		       uint32_t modifiers);
465 	/**
466 	 * language
467 	 *
468 	 * Sets the language of the input text. The "language" argument
469 	 * is an RFC-3066 format language tag.
470 	 * @param serial serial of the latest known text input state
471 	 */
472 	void (*language)(void *data,
473 			 struct zwp_text_input_v1 *zwp_text_input_v1,
474 			 uint32_t serial,
475 			 const char *language);
476 	/**
477 	 * text direction
478 	 *
479 	 * Sets the text direction of input text.
480 	 *
481 	 * It is mainly needed for showing an input cursor on the correct
482 	 * side of the editor when there is no input done yet and making
483 	 * sure neutral direction text is laid out properly.
484 	 * @param serial serial of the latest known text input state
485 	 */
486 	void (*text_direction)(void *data,
487 			       struct zwp_text_input_v1 *zwp_text_input_v1,
488 			       uint32_t serial,
489 			       uint32_t direction);
490 };
491 
492 /**
493  * @ingroup iface_zwp_text_input_v1
494  */
495 static inline int
zwp_text_input_v1_add_listener(struct zwp_text_input_v1 * zwp_text_input_v1,const struct zwp_text_input_v1_listener * listener,void * data)496 zwp_text_input_v1_add_listener(struct zwp_text_input_v1 *zwp_text_input_v1,
497 			       const struct zwp_text_input_v1_listener *listener, void *data)
498 {
499 	return wl_proxy_add_listener((struct wl_proxy *) zwp_text_input_v1,
500 				     (void (**)(void)) listener, data);
501 }
502 
503 #define ZWP_TEXT_INPUT_V1_ACTIVATE 0
504 #define ZWP_TEXT_INPUT_V1_DEACTIVATE 1
505 #define ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL 2
506 #define ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL 3
507 #define ZWP_TEXT_INPUT_V1_RESET 4
508 #define ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT 5
509 #define ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE 6
510 #define ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE 7
511 #define ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE 8
512 #define ZWP_TEXT_INPUT_V1_COMMIT_STATE 9
513 #define ZWP_TEXT_INPUT_V1_INVOKE_ACTION 10
514 
515 /**
516  * @ingroup iface_zwp_text_input_v1
517  */
518 #define ZWP_TEXT_INPUT_V1_ENTER_SINCE_VERSION 1
519 /**
520  * @ingroup iface_zwp_text_input_v1
521  */
522 #define ZWP_TEXT_INPUT_V1_LEAVE_SINCE_VERSION 1
523 /**
524  * @ingroup iface_zwp_text_input_v1
525  */
526 #define ZWP_TEXT_INPUT_V1_MODIFIERS_MAP_SINCE_VERSION 1
527 /**
528  * @ingroup iface_zwp_text_input_v1
529  */
530 #define ZWP_TEXT_INPUT_V1_INPUT_PANEL_STATE_SINCE_VERSION 1
531 /**
532  * @ingroup iface_zwp_text_input_v1
533  */
534 #define ZWP_TEXT_INPUT_V1_PREEDIT_STRING_SINCE_VERSION 1
535 /**
536  * @ingroup iface_zwp_text_input_v1
537  */
538 #define ZWP_TEXT_INPUT_V1_PREEDIT_STYLING_SINCE_VERSION 1
539 /**
540  * @ingroup iface_zwp_text_input_v1
541  */
542 #define ZWP_TEXT_INPUT_V1_PREEDIT_CURSOR_SINCE_VERSION 1
543 /**
544  * @ingroup iface_zwp_text_input_v1
545  */
546 #define ZWP_TEXT_INPUT_V1_COMMIT_STRING_SINCE_VERSION 1
547 /**
548  * @ingroup iface_zwp_text_input_v1
549  */
550 #define ZWP_TEXT_INPUT_V1_CURSOR_POSITION_SINCE_VERSION 1
551 /**
552  * @ingroup iface_zwp_text_input_v1
553  */
554 #define ZWP_TEXT_INPUT_V1_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
555 /**
556  * @ingroup iface_zwp_text_input_v1
557  */
558 #define ZWP_TEXT_INPUT_V1_KEYSYM_SINCE_VERSION 1
559 /**
560  * @ingroup iface_zwp_text_input_v1
561  */
562 #define ZWP_TEXT_INPUT_V1_LANGUAGE_SINCE_VERSION 1
563 /**
564  * @ingroup iface_zwp_text_input_v1
565  */
566 #define ZWP_TEXT_INPUT_V1_TEXT_DIRECTION_SINCE_VERSION 1
567 
568 /**
569  * @ingroup iface_zwp_text_input_v1
570  */
571 #define ZWP_TEXT_INPUT_V1_ACTIVATE_SINCE_VERSION 1
572 /**
573  * @ingroup iface_zwp_text_input_v1
574  */
575 #define ZWP_TEXT_INPUT_V1_DEACTIVATE_SINCE_VERSION 1
576 /**
577  * @ingroup iface_zwp_text_input_v1
578  */
579 #define ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL_SINCE_VERSION 1
580 /**
581  * @ingroup iface_zwp_text_input_v1
582  */
583 #define ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL_SINCE_VERSION 1
584 /**
585  * @ingroup iface_zwp_text_input_v1
586  */
587 #define ZWP_TEXT_INPUT_V1_RESET_SINCE_VERSION 1
588 /**
589  * @ingroup iface_zwp_text_input_v1
590  */
591 #define ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT_SINCE_VERSION 1
592 /**
593  * @ingroup iface_zwp_text_input_v1
594  */
595 #define ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE_SINCE_VERSION 1
596 /**
597  * @ingroup iface_zwp_text_input_v1
598  */
599 #define ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE_SINCE_VERSION 1
600 /**
601  * @ingroup iface_zwp_text_input_v1
602  */
603 #define ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE_SINCE_VERSION 1
604 /**
605  * @ingroup iface_zwp_text_input_v1
606  */
607 #define ZWP_TEXT_INPUT_V1_COMMIT_STATE_SINCE_VERSION 1
608 /**
609  * @ingroup iface_zwp_text_input_v1
610  */
611 #define ZWP_TEXT_INPUT_V1_INVOKE_ACTION_SINCE_VERSION 1
612 
613 /** @ingroup iface_zwp_text_input_v1 */
614 static inline void
zwp_text_input_v1_set_user_data(struct zwp_text_input_v1 * zwp_text_input_v1,void * user_data)615 zwp_text_input_v1_set_user_data(struct zwp_text_input_v1 *zwp_text_input_v1, void *user_data)
616 {
617 	wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_v1, user_data);
618 }
619 
620 /** @ingroup iface_zwp_text_input_v1 */
621 static inline void *
zwp_text_input_v1_get_user_data(struct zwp_text_input_v1 * zwp_text_input_v1)622 zwp_text_input_v1_get_user_data(struct zwp_text_input_v1 *zwp_text_input_v1)
623 {
624 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_v1);
625 }
626 
627 static inline uint32_t
zwp_text_input_v1_get_version(struct zwp_text_input_v1 * zwp_text_input_v1)628 zwp_text_input_v1_get_version(struct zwp_text_input_v1 *zwp_text_input_v1)
629 {
630 	return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1);
631 }
632 
633 /** @ingroup iface_zwp_text_input_v1 */
634 static inline void
zwp_text_input_v1_destroy(struct zwp_text_input_v1 * zwp_text_input_v1)635 zwp_text_input_v1_destroy(struct zwp_text_input_v1 *zwp_text_input_v1)
636 {
637 	wl_proxy_destroy((struct wl_proxy *) zwp_text_input_v1);
638 }
639 
640 /**
641  * @ingroup iface_zwp_text_input_v1
642  *
643  * Requests the text_input object to be activated (typically when the
644  * text entry gets focus).
645  *
646  * The seat argument is a wl_seat which maintains the focus for this
647  * activation. The surface argument is a wl_surface assigned to the
648  * text_input object and tracked for focus lost. The enter event
649  * is emitted on successful activation.
650  */
651 static inline void
zwp_text_input_v1_activate(struct zwp_text_input_v1 * zwp_text_input_v1,struct wl_seat * seat,struct wl_surface * surface)652 zwp_text_input_v1_activate(struct zwp_text_input_v1 *zwp_text_input_v1, struct wl_seat *seat, struct wl_surface *surface)
653 {
654 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
655 			 ZWP_TEXT_INPUT_V1_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, seat, surface);
656 }
657 
658 /**
659  * @ingroup iface_zwp_text_input_v1
660  *
661  * Requests the text_input object to be deactivated (typically when the
662  * text entry lost focus). The seat argument is a wl_seat which was used
663  * for activation.
664  */
665 static inline void
zwp_text_input_v1_deactivate(struct zwp_text_input_v1 * zwp_text_input_v1,struct wl_seat * seat)666 zwp_text_input_v1_deactivate(struct zwp_text_input_v1 *zwp_text_input_v1, struct wl_seat *seat)
667 {
668 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
669 			 ZWP_TEXT_INPUT_V1_DEACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, seat);
670 }
671 
672 /**
673  * @ingroup iface_zwp_text_input_v1
674  *
675  * Requests input panels (virtual keyboard) to show.
676  */
677 static inline void
zwp_text_input_v1_show_input_panel(struct zwp_text_input_v1 * zwp_text_input_v1)678 zwp_text_input_v1_show_input_panel(struct zwp_text_input_v1 *zwp_text_input_v1)
679 {
680 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
681 			 ZWP_TEXT_INPUT_V1_SHOW_INPUT_PANEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
682 }
683 
684 /**
685  * @ingroup iface_zwp_text_input_v1
686  *
687  * Requests input panels (virtual keyboard) to hide.
688  */
689 static inline void
zwp_text_input_v1_hide_input_panel(struct zwp_text_input_v1 * zwp_text_input_v1)690 zwp_text_input_v1_hide_input_panel(struct zwp_text_input_v1 *zwp_text_input_v1)
691 {
692 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
693 			 ZWP_TEXT_INPUT_V1_HIDE_INPUT_PANEL, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
694 }
695 
696 /**
697  * @ingroup iface_zwp_text_input_v1
698  *
699  * Should be called by an editor widget when the input state should be
700  * reset, for example after the text was changed outside of the normal
701  * input method flow.
702  */
703 static inline void
zwp_text_input_v1_reset(struct zwp_text_input_v1 * zwp_text_input_v1)704 zwp_text_input_v1_reset(struct zwp_text_input_v1 *zwp_text_input_v1)
705 {
706 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
707 			 ZWP_TEXT_INPUT_V1_RESET, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0);
708 }
709 
710 /**
711  * @ingroup iface_zwp_text_input_v1
712  *
713  * Sets the plain surrounding text around the input position. Text is
714  * UTF-8 encoded. Cursor is the byte offset within the
715  * surrounding text. Anchor is the byte offset of the
716  * selection anchor within the surrounding text. If there is no selected
717  * text anchor, then it is the same as cursor.
718  */
719 static inline void
zwp_text_input_v1_set_surrounding_text(struct zwp_text_input_v1 * zwp_text_input_v1,const char * text,uint32_t cursor,uint32_t anchor)720 zwp_text_input_v1_set_surrounding_text(struct zwp_text_input_v1 *zwp_text_input_v1, const char *text, uint32_t cursor, uint32_t anchor)
721 {
722 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
723 			 ZWP_TEXT_INPUT_V1_SET_SURROUNDING_TEXT, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, text, cursor, anchor);
724 }
725 
726 /**
727  * @ingroup iface_zwp_text_input_v1
728  *
729  * Sets the content purpose and content hint. While the purpose is the
730  * basic purpose of an input field, the hint flags allow to modify some
731  * of the behavior.
732  *
733  * When no content type is explicitly set, a normal content purpose with
734  * default hints (auto completion, auto correction, auto capitalization)
735  * should be assumed.
736  */
737 static inline void
zwp_text_input_v1_set_content_type(struct zwp_text_input_v1 * zwp_text_input_v1,uint32_t hint,uint32_t purpose)738 zwp_text_input_v1_set_content_type(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t hint, uint32_t purpose)
739 {
740 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
741 			 ZWP_TEXT_INPUT_V1_SET_CONTENT_TYPE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, hint, purpose);
742 }
743 
744 /**
745  * @ingroup iface_zwp_text_input_v1
746  */
747 static inline void
zwp_text_input_v1_set_cursor_rectangle(struct zwp_text_input_v1 * zwp_text_input_v1,int32_t x,int32_t y,int32_t width,int32_t height)748 zwp_text_input_v1_set_cursor_rectangle(struct zwp_text_input_v1 *zwp_text_input_v1, int32_t x, int32_t y, int32_t width, int32_t height)
749 {
750 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
751 			 ZWP_TEXT_INPUT_V1_SET_CURSOR_RECTANGLE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, x, y, width, height);
752 }
753 
754 /**
755  * @ingroup iface_zwp_text_input_v1
756  *
757  * Sets a specific language. This allows for example a virtual keyboard to
758  * show a language specific layout. The "language" argument is an RFC-3066
759  * format language tag.
760  *
761  * It could be used for example in a word processor to indicate the
762  * language of the currently edited document or in an instant message
763  * application which tracks languages of contacts.
764  */
765 static inline void
zwp_text_input_v1_set_preferred_language(struct zwp_text_input_v1 * zwp_text_input_v1,const char * language)766 zwp_text_input_v1_set_preferred_language(struct zwp_text_input_v1 *zwp_text_input_v1, const char *language)
767 {
768 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
769 			 ZWP_TEXT_INPUT_V1_SET_PREFERRED_LANGUAGE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, language);
770 }
771 
772 /**
773  * @ingroup iface_zwp_text_input_v1
774  */
775 static inline void
zwp_text_input_v1_commit_state(struct zwp_text_input_v1 * zwp_text_input_v1,uint32_t serial)776 zwp_text_input_v1_commit_state(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t serial)
777 {
778 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
779 			 ZWP_TEXT_INPUT_V1_COMMIT_STATE, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, serial);
780 }
781 
782 /**
783  * @ingroup iface_zwp_text_input_v1
784  */
785 static inline void
zwp_text_input_v1_invoke_action(struct zwp_text_input_v1 * zwp_text_input_v1,uint32_t button,uint32_t index)786 zwp_text_input_v1_invoke_action(struct zwp_text_input_v1 *zwp_text_input_v1, uint32_t button, uint32_t index)
787 {
788 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_v1,
789 			 ZWP_TEXT_INPUT_V1_INVOKE_ACTION, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_v1), 0, button, index);
790 }
791 
792 #define ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT 0
793 
794 
795 /**
796  * @ingroup iface_zwp_text_input_manager_v1
797  */
798 #define ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT_SINCE_VERSION 1
799 
800 /** @ingroup iface_zwp_text_input_manager_v1 */
801 static inline void
zwp_text_input_manager_v1_set_user_data(struct zwp_text_input_manager_v1 * zwp_text_input_manager_v1,void * user_data)802 zwp_text_input_manager_v1_set_user_data(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1, void *user_data)
803 {
804 	wl_proxy_set_user_data((struct wl_proxy *) zwp_text_input_manager_v1, user_data);
805 }
806 
807 /** @ingroup iface_zwp_text_input_manager_v1 */
808 static inline void *
zwp_text_input_manager_v1_get_user_data(struct zwp_text_input_manager_v1 * zwp_text_input_manager_v1)809 zwp_text_input_manager_v1_get_user_data(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
810 {
811 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_text_input_manager_v1);
812 }
813 
814 static inline uint32_t
zwp_text_input_manager_v1_get_version(struct zwp_text_input_manager_v1 * zwp_text_input_manager_v1)815 zwp_text_input_manager_v1_get_version(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
816 {
817 	return wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v1);
818 }
819 
820 /** @ingroup iface_zwp_text_input_manager_v1 */
821 static inline void
zwp_text_input_manager_v1_destroy(struct zwp_text_input_manager_v1 * zwp_text_input_manager_v1)822 zwp_text_input_manager_v1_destroy(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
823 {
824 	wl_proxy_destroy((struct wl_proxy *) zwp_text_input_manager_v1);
825 }
826 
827 /**
828  * @ingroup iface_zwp_text_input_manager_v1
829  *
830  * Creates a new text_input object.
831  */
832 static inline struct zwp_text_input_v1 *
zwp_text_input_manager_v1_create_text_input(struct zwp_text_input_manager_v1 * zwp_text_input_manager_v1)833 zwp_text_input_manager_v1_create_text_input(struct zwp_text_input_manager_v1 *zwp_text_input_manager_v1)
834 {
835 	struct wl_proxy *id;
836 
837 	id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_text_input_manager_v1,
838 			 ZWP_TEXT_INPUT_MANAGER_V1_CREATE_TEXT_INPUT, &zwp_text_input_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_text_input_manager_v1), 0, NULL);
839 
840 	return (struct zwp_text_input_v1 *) id;
841 }
842 
843 #ifdef  __cplusplus
844 }
845 #endif
846 
847 #endif
848