1 /* Generated by wayland-scanner 1.19.0 */
2 
3 #ifndef GTK_TEXT_INPUT_CLIENT_PROTOCOL_H
4 #define GTK_TEXT_INPUT_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_gtk_text_input The gtk_text_input protocol
16  * @section page_ifaces_gtk_text_input Interfaces
17  * - @subpage page_iface_gtk_text_input - text input
18  * - @subpage page_iface_gtk_text_input_manager - text input manager
19  * @section page_copyright_gtk_text_input Copyright
20  * <pre>
21  *
22  * Copyright © 2012, 2013 Intel Corporation
23  * Copyright © 2015, 2016 Jan Arne Petersen
24  *
25  * Permission to use, copy, modify, distribute, and sell this
26  * software and its documentation for any purpose is hereby granted
27  * without fee, provided that the above copyright notice appear in
28  * all copies and that both that copyright notice and this permission
29  * notice appear in supporting documentation, and that the name of
30  * the copyright holders not be used in advertising or publicity
31  * pertaining to distribution of the software without specific,
32  * written prior permission.  The copyright holders make no
33  * representations about the suitability of this software for any
34  * purpose.  It is provided "as is" without express or implied
35  * warranty.
36  *
37  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
38  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
39  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
40  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
41  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
42  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43  * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
44  * THIS SOFTWARE.
45  * </pre>
46  */
47 struct gtk_text_input;
48 struct gtk_text_input_manager;
49 struct wl_seat;
50 struct wl_surface;
51 
52 #ifndef GTK_TEXT_INPUT_INTERFACE
53 #define GTK_TEXT_INPUT_INTERFACE
54 /**
55  * @page page_iface_gtk_text_input gtk_text_input
56  * @section page_iface_gtk_text_input_desc Description
57  *
58  * The gtk_text_input interface represents text input and input methods
59  * associated with a seat. It provides enter/leave events to follow the
60  * text input focus for a seat.
61  *
62  * Requests are used to enable/disable the text-input object and set
63  * state information like surrounding and selected text or the content type.
64  * The information about the entered text is sent to the text-input object
65  * via the pre-edit and commit_string events. Using this interface removes
66  * the need for applications to directly process hardware key events and
67  * compose text out of them.
68  *
69  * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
70  * have to always point to the first byte of an UTF-8 encoded code point.
71  * Lengths are not allowed to contain just a part of an UTF-8 encoded code
72  * point.
73  *
74  * Focus moving throughout surfaces will result in the emission of
75  * gtk_text_input.enter and gtk_text_input.leave events. The focused
76  * surface must perform gtk_text_input.enable and
77  * gtk_text_input.disable requests as the keyboard focus moves across
78  * editable and non-editable elements of the UI. Those two requests are not
79  * expected to be paired with each other, the compositor must be able to
80  * handle consecutive series of the same request.
81  *
82  * State is sent by the state requests (set_surrounding_text,
83  * set_content_type and set_cursor_rectangle) and a commit request.
84  * After an enter event or disable request all state information is
85  * invalidated and needs to be resent by the client.
86  *
87  * This protocol defines requests and events necessary for regular clients
88  * to communicate with an input method. The gtk_input_method protocol
89  * defines the interfaces necessary to implement standalone input methods.
90  * If a compositor implements both interfaces, it will be the arbiter of the
91  * communication between both.
92  *
93  * Warning! The protocol described in this file is experimental and
94  * backward incompatible changes may be made. Backward compatible changes
95  * may be added together with the corresponding interface version bump.
96  * Backward incompatible changes are done by bumping the version number in
97  * the protocol and interface names and resetting the interface version.
98  * Once the protocol is to be declared stable, the 'z' prefix and the
99  * version number in the protocol and interface names are removed and the
100  * interface version number is reset.
101  * @section page_iface_gtk_text_input_api API
102  * See @ref iface_gtk_text_input.
103  */
104 /**
105  * @defgroup iface_gtk_text_input The gtk_text_input interface
106  *
107  * The gtk_text_input interface represents text input and input methods
108  * associated with a seat. It provides enter/leave events to follow the
109  * text input focus for a seat.
110  *
111  * Requests are used to enable/disable the text-input object and set
112  * state information like surrounding and selected text or the content type.
113  * The information about the entered text is sent to the text-input object
114  * via the pre-edit and commit_string events. Using this interface removes
115  * the need for applications to directly process hardware key events and
116  * compose text out of them.
117  *
118  * Text is valid UTF-8 encoded, indices and lengths are in bytes. Indices
119  * have to always point to the first byte of an UTF-8 encoded code point.
120  * Lengths are not allowed to contain just a part of an UTF-8 encoded code
121  * point.
122  *
123  * Focus moving throughout surfaces will result in the emission of
124  * gtk_text_input.enter and gtk_text_input.leave events. The focused
125  * surface must perform gtk_text_input.enable and
126  * gtk_text_input.disable requests as the keyboard focus moves across
127  * editable and non-editable elements of the UI. Those two requests are not
128  * expected to be paired with each other, the compositor must be able to
129  * handle consecutive series of the same request.
130  *
131  * State is sent by the state requests (set_surrounding_text,
132  * set_content_type and set_cursor_rectangle) and a commit request.
133  * After an enter event or disable request all state information is
134  * invalidated and needs to be resent by the client.
135  *
136  * This protocol defines requests and events necessary for regular clients
137  * to communicate with an input method. The gtk_input_method protocol
138  * defines the interfaces necessary to implement standalone input methods.
139  * If a compositor implements both interfaces, it will be the arbiter of the
140  * communication between both.
141  *
142  * Warning! The protocol described in this file is experimental and
143  * backward incompatible changes may be made. Backward compatible changes
144  * may be added together with the corresponding interface version bump.
145  * Backward incompatible changes are done by bumping the version number in
146  * the protocol and interface names and resetting the interface version.
147  * Once the protocol is to be declared stable, the 'z' prefix and the
148  * version number in the protocol and interface names are removed and the
149  * interface version number is reset.
150  */
151 extern const struct wl_interface gtk_text_input_interface;
152 #endif
153 #ifndef GTK_TEXT_INPUT_MANAGER_INTERFACE
154 #define GTK_TEXT_INPUT_MANAGER_INTERFACE
155 /**
156  * @page page_iface_gtk_text_input_manager gtk_text_input_manager
157  * @section page_iface_gtk_text_input_manager_desc Description
158  *
159  * A factory for text-input objects. This object is a global singleton.
160  * @section page_iface_gtk_text_input_manager_api API
161  * See @ref iface_gtk_text_input_manager.
162  */
163 /**
164  * @defgroup iface_gtk_text_input_manager The gtk_text_input_manager interface
165  *
166  * A factory for text-input objects. This object is a global singleton.
167  */
168 extern const struct wl_interface gtk_text_input_manager_interface;
169 #endif
170 
171 #ifndef GTK_TEXT_INPUT_ENABLE_FLAGS_ENUM
172 #define GTK_TEXT_INPUT_ENABLE_FLAGS_ENUM
173 /**
174  * @ingroup iface_gtk_text_input
175  * enable flags
176  *
177  * Content hint is a bitmask to allow to modify the behavior of the text
178  * input.
179  */
180 enum gtk_text_input_enable_flags {
181 	/**
182 	 * no special behaviour
183 	 */
184 	GTK_TEXT_INPUT_ENABLE_FLAGS_NONE = 0x0,
185 	/**
186 	 * hints that the UI is capable of showing pre-edit text
187 	 */
188 	GTK_TEXT_INPUT_ENABLE_FLAGS_CAN_SHOW_PREEDIT = 0x1,
189 	/**
190 	 * requests toggling input panel (eg. on-screen keyboard)
191 	 */
192 	GTK_TEXT_INPUT_ENABLE_FLAGS_TOGGLE_INPUT_PANEL = 0x2,
193 };
194 #endif /* GTK_TEXT_INPUT_ENABLE_FLAGS_ENUM */
195 
196 #ifndef GTK_TEXT_INPUT_CONTENT_HINT_ENUM
197 #define GTK_TEXT_INPUT_CONTENT_HINT_ENUM
198 /**
199  * @ingroup iface_gtk_text_input
200  * content hint
201  *
202  * Content hint is a bitmask to allow to modify the behavior of the text
203  * input.
204  */
205 enum gtk_text_input_content_hint {
206 	/**
207 	 * no special behaviour
208 	 */
209 	GTK_TEXT_INPUT_CONTENT_HINT_NONE = 0x0,
210 	/**
211 	 * suggest word completions
212 	 */
213 	GTK_TEXT_INPUT_CONTENT_HINT_COMPLETION = 0x1,
214 	/**
215 	 * suggest word corrections
216 	 */
217 	GTK_TEXT_INPUT_CONTENT_HINT_SPELLCHECK = 0x2,
218 	/**
219 	 * switch to uppercase letters at the start of a sentence
220 	 */
221 	GTK_TEXT_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 0x4,
222 	/**
223 	 * prefer lowercase letters
224 	 */
225 	GTK_TEXT_INPUT_CONTENT_HINT_LOWERCASE = 0x8,
226 	/**
227 	 * prefer uppercase letters
228 	 */
229 	GTK_TEXT_INPUT_CONTENT_HINT_UPPERCASE = 0x10,
230 	/**
231 	 * prefer casing for titles and headings (can be language dependent)
232 	 */
233 	GTK_TEXT_INPUT_CONTENT_HINT_TITLECASE = 0x20,
234 	/**
235 	 * characters should be hidden
236 	 */
237 	GTK_TEXT_INPUT_CONTENT_HINT_HIDDEN_TEXT = 0x40,
238 	/**
239 	 * typed text should not be stored
240 	 */
241 	GTK_TEXT_INPUT_CONTENT_HINT_SENSITIVE_DATA = 0x80,
242 	/**
243 	 * just latin characters should be entered
244 	 */
245 	GTK_TEXT_INPUT_CONTENT_HINT_LATIN = 0x100,
246 	/**
247 	 * the text input is multiline
248 	 */
249 	GTK_TEXT_INPUT_CONTENT_HINT_MULTILINE = 0x200,
250 };
251 #endif /* GTK_TEXT_INPUT_CONTENT_HINT_ENUM */
252 
253 #ifndef GTK_TEXT_INPUT_CONTENT_PURPOSE_ENUM
254 #define GTK_TEXT_INPUT_CONTENT_PURPOSE_ENUM
255 /**
256  * @ingroup iface_gtk_text_input
257  * content purpose
258  *
259  * The content purpose allows to specify the primary purpose of a text
260  * input.
261  *
262  * This allows an input method to show special purpose input panels with
263  * extra characters or to disallow some characters.
264  */
265 enum gtk_text_input_content_purpose {
266 	/**
267 	 * default input, allowing all characters
268 	 */
269 	GTK_TEXT_INPUT_CONTENT_PURPOSE_NORMAL = 0,
270 	/**
271 	 * allow only alphabetic characters
272 	 */
273 	GTK_TEXT_INPUT_CONTENT_PURPOSE_ALPHA = 1,
274 	/**
275 	 * allow only digits
276 	 */
277 	GTK_TEXT_INPUT_CONTENT_PURPOSE_DIGITS = 2,
278 	/**
279 	 * input a number (including decimal separator and sign)
280 	 */
281 	GTK_TEXT_INPUT_CONTENT_PURPOSE_NUMBER = 3,
282 	/**
283 	 * input a phone number
284 	 */
285 	GTK_TEXT_INPUT_CONTENT_PURPOSE_PHONE = 4,
286 	/**
287 	 * input an URL
288 	 */
289 	GTK_TEXT_INPUT_CONTENT_PURPOSE_URL = 5,
290 	/**
291 	 * input an email address
292 	 */
293 	GTK_TEXT_INPUT_CONTENT_PURPOSE_EMAIL = 6,
294 	/**
295 	 * input a name of a person
296 	 */
297 	GTK_TEXT_INPUT_CONTENT_PURPOSE_NAME = 7,
298 	/**
299 	 * input a password (combine with password or sensitive_data hint)
300 	 */
301 	GTK_TEXT_INPUT_CONTENT_PURPOSE_PASSWORD = 8,
302 	/**
303 	 * input is a numeric password (combine with password or sensitive_data hint)
304 	 */
305 	GTK_TEXT_INPUT_CONTENT_PURPOSE_PIN = 9,
306 	/**
307 	 * input a date
308 	 */
309 	GTK_TEXT_INPUT_CONTENT_PURPOSE_DATE = 10,
310 	/**
311 	 * input a time
312 	 */
313 	GTK_TEXT_INPUT_CONTENT_PURPOSE_TIME = 11,
314 	/**
315 	 * input a date and time
316 	 */
317 	GTK_TEXT_INPUT_CONTENT_PURPOSE_DATETIME = 12,
318 	/**
319 	 * input for a terminal
320 	 */
321 	GTK_TEXT_INPUT_CONTENT_PURPOSE_TERMINAL = 13,
322 };
323 #endif /* GTK_TEXT_INPUT_CONTENT_PURPOSE_ENUM */
324 
325 /**
326  * @ingroup iface_gtk_text_input
327  * @struct gtk_text_input_listener
328  */
329 struct gtk_text_input_listener {
330 	/**
331 	 * enter event
332 	 *
333 	 * Notification that this seat's text-input focus is on a certain
334 	 * surface.
335 	 *
336 	 * When the seat has the keyboard capability the text-input focus
337 	 * follows the keyboard focus.
338 	 * @param serial serial
339 	 */
340 	void (*enter)(void *data,
341 		      struct gtk_text_input *gtk_text_input,
342 		      uint32_t serial,
343 		      struct wl_surface *surface);
344 	/**
345 	 * leave event
346 	 *
347 	 * Notification that this seat's text-input focus is no longer on
348 	 * a certain surface. The client should reset any preedit string
349 	 * previously set.
350 	 *
351 	 * The leave notification is sent before the enter notification for
352 	 * the new focus.
353 	 *
354 	 * When the seat has the keyboard capability the text-input focus
355 	 * follows the keyboard focus.
356 	 */
357 	void (*leave)(void *data,
358 		      struct gtk_text_input *gtk_text_input,
359 		      uint32_t serial,
360 		      struct wl_surface *surface);
361 	/**
362 	 * pre-edit
363 	 *
364 	 * Notify when a new composing text (pre-edit) should be set
365 	 * around the current cursor position. Any previously set composing
366 	 * text should be removed.
367 	 */
368 	void (*preedit_string)(void *data,
369 			       struct gtk_text_input *gtk_text_input,
370 			       const char *text,
371 			       uint32_t cursor);
372 	/**
373 	 * text commit
374 	 *
375 	 * Notify when text should be inserted into the editor widget.
376 	 * The text to commit could be either just a single character after
377 	 * a key press or the result of some composing (pre-edit).
378 	 *
379 	 * The text argument could be also null if some text is removed
380 	 * (see gtk_text_input.delete_surrounding_text).
381 	 *
382 	 * Any previously set composing text should be removed.
383 	 */
384 	void (*commit_string)(void *data,
385 			      struct gtk_text_input *gtk_text_input,
386 			      const char *text);
387 	/**
388 	 * delete surrounding text
389 	 *
390 	 * Notify when the text around the current cursor position should
391 	 * be deleted. Before_length and after_length is the length (in
392 	 * bytes) of text before and after the current cursor position
393 	 * (excluding the selection) to delete.
394 	 *
395 	 * This event should be handled as part of a following
396 	 * commit_string or preedit_string event.
397 	 * @param before_length length of text before current cursor position
398 	 * @param after_length length of text after current cursor position
399 	 */
400 	void (*delete_surrounding_text)(void *data,
401 					struct gtk_text_input *gtk_text_input,
402 					uint32_t before_length,
403 					uint32_t after_length);
404 };
405 
406 /**
407  * @ingroup iface_gtk_text_input
408  */
409 static inline int
gtk_text_input_add_listener(struct gtk_text_input * gtk_text_input,const struct gtk_text_input_listener * listener,void * data)410 gtk_text_input_add_listener(struct gtk_text_input *gtk_text_input,
411 			    const struct gtk_text_input_listener *listener, void *data)
412 {
413 	return wl_proxy_add_listener((struct wl_proxy *) gtk_text_input,
414 				     (void (**)(void)) listener, data);
415 }
416 
417 #define GTK_TEXT_INPUT_DESTROY 0
418 #define GTK_TEXT_INPUT_ENABLE 1
419 #define GTK_TEXT_INPUT_DISABLE 2
420 #define GTK_TEXT_INPUT_SET_SURROUNDING_TEXT 3
421 #define GTK_TEXT_INPUT_SET_CONTENT_TYPE 4
422 #define GTK_TEXT_INPUT_SET_CURSOR_RECTANGLE 5
423 #define GTK_TEXT_INPUT_COMMIT 6
424 
425 /**
426  * @ingroup iface_gtk_text_input
427  */
428 #define GTK_TEXT_INPUT_ENTER_SINCE_VERSION 1
429 /**
430  * @ingroup iface_gtk_text_input
431  */
432 #define GTK_TEXT_INPUT_LEAVE_SINCE_VERSION 1
433 /**
434  * @ingroup iface_gtk_text_input
435  */
436 #define GTK_TEXT_INPUT_PREEDIT_STRING_SINCE_VERSION 1
437 /**
438  * @ingroup iface_gtk_text_input
439  */
440 #define GTK_TEXT_INPUT_COMMIT_STRING_SINCE_VERSION 1
441 /**
442  * @ingroup iface_gtk_text_input
443  */
444 #define GTK_TEXT_INPUT_DELETE_SURROUNDING_TEXT_SINCE_VERSION 1
445 
446 /**
447  * @ingroup iface_gtk_text_input
448  */
449 #define GTK_TEXT_INPUT_DESTROY_SINCE_VERSION 1
450 /**
451  * @ingroup iface_gtk_text_input
452  */
453 #define GTK_TEXT_INPUT_ENABLE_SINCE_VERSION 1
454 /**
455  * @ingroup iface_gtk_text_input
456  */
457 #define GTK_TEXT_INPUT_DISABLE_SINCE_VERSION 1
458 /**
459  * @ingroup iface_gtk_text_input
460  */
461 #define GTK_TEXT_INPUT_SET_SURROUNDING_TEXT_SINCE_VERSION 1
462 /**
463  * @ingroup iface_gtk_text_input
464  */
465 #define GTK_TEXT_INPUT_SET_CONTENT_TYPE_SINCE_VERSION 1
466 /**
467  * @ingroup iface_gtk_text_input
468  */
469 #define GTK_TEXT_INPUT_SET_CURSOR_RECTANGLE_SINCE_VERSION 1
470 /**
471  * @ingroup iface_gtk_text_input
472  */
473 #define GTK_TEXT_INPUT_COMMIT_SINCE_VERSION 1
474 
475 /** @ingroup iface_gtk_text_input */
476 static inline void
gtk_text_input_set_user_data(struct gtk_text_input * gtk_text_input,void * user_data)477 gtk_text_input_set_user_data(struct gtk_text_input *gtk_text_input, void *user_data)
478 {
479 	wl_proxy_set_user_data((struct wl_proxy *) gtk_text_input, user_data);
480 }
481 
482 /** @ingroup iface_gtk_text_input */
483 static inline void *
gtk_text_input_get_user_data(struct gtk_text_input * gtk_text_input)484 gtk_text_input_get_user_data(struct gtk_text_input *gtk_text_input)
485 {
486 	return wl_proxy_get_user_data((struct wl_proxy *) gtk_text_input);
487 }
488 
489 static inline uint32_t
gtk_text_input_get_version(struct gtk_text_input * gtk_text_input)490 gtk_text_input_get_version(struct gtk_text_input *gtk_text_input)
491 {
492 	return wl_proxy_get_version((struct wl_proxy *) gtk_text_input);
493 }
494 
495 /**
496  * @ingroup iface_gtk_text_input
497  *
498  * Destroy the wp_text_input object. Also disables all surfaces enabled
499  * through this wp_text_input object
500  */
501 static inline void
gtk_text_input_destroy(struct gtk_text_input * gtk_text_input)502 gtk_text_input_destroy(struct gtk_text_input *gtk_text_input)
503 {
504 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
505 			 GTK_TEXT_INPUT_DESTROY);
506 
507 	wl_proxy_destroy((struct wl_proxy *) gtk_text_input);
508 }
509 
510 /**
511  * @ingroup iface_gtk_text_input
512  *
513  * Requests text input on a surface. The serial provided must be the one
514  * received on gtk_text_input.enter.
515  */
516 static inline void
gtk_text_input_enable(struct gtk_text_input * gtk_text_input,uint32_t serial,uint32_t show_input_panel)517 gtk_text_input_enable(struct gtk_text_input *gtk_text_input, uint32_t serial, uint32_t show_input_panel)
518 {
519 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
520 			 GTK_TEXT_INPUT_ENABLE, serial, show_input_panel);
521 }
522 
523 /**
524  * @ingroup iface_gtk_text_input
525  *
526  * Explicitly disable text input in a surface (typically when there is no
527  * focus on any text entry inside the surface).
528  */
529 static inline void
gtk_text_input_disable(struct gtk_text_input * gtk_text_input)530 gtk_text_input_disable(struct gtk_text_input *gtk_text_input)
531 {
532 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
533 			 GTK_TEXT_INPUT_DISABLE);
534 }
535 
536 /**
537  * @ingroup iface_gtk_text_input
538  *
539  * Sets the plain surrounding text around the input position. Text is
540  * UTF-8 encoded. Cursor is the byte offset within the surrounding text.
541  * Anchor is the byte offset of the selection anchor within the
542  * surrounding text. If there is no selected text, anchor is the same as
543  * cursor.
544  *
545  * Make sure to always send some text before and after the cursor
546  * except when the cursor is at the beginning or end of text.
547  *
548  * When there was a configure_surrounding_text event take the
549  * before_cursor and after_cursor arguments into account for picking how
550  * much surrounding text to send.
551  *
552  * There is a maximum length of wayland messages so text can not be
553  * longer than 4000 bytes.
554  */
555 static inline void
gtk_text_input_set_surrounding_text(struct gtk_text_input * gtk_text_input,const char * text,int32_t cursor,int32_t anchor)556 gtk_text_input_set_surrounding_text(struct gtk_text_input *gtk_text_input, const char *text, int32_t cursor, int32_t anchor)
557 {
558 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
559 			 GTK_TEXT_INPUT_SET_SURROUNDING_TEXT, text, cursor, anchor);
560 }
561 
562 /**
563  * @ingroup iface_gtk_text_input
564  *
565  * Sets the content purpose and content hint. While the purpose is the
566  * basic purpose of an input field, the hint flags allow to modify some
567  * of the behavior.
568  *
569  * When no content type is explicitly set, a normal content purpose with
570  * none hint should be assumed.
571  */
572 static inline void
gtk_text_input_set_content_type(struct gtk_text_input * gtk_text_input,uint32_t hint,uint32_t purpose)573 gtk_text_input_set_content_type(struct gtk_text_input *gtk_text_input, uint32_t hint, uint32_t purpose)
574 {
575 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
576 			 GTK_TEXT_INPUT_SET_CONTENT_TYPE, hint, purpose);
577 }
578 
579 /**
580  * @ingroup iface_gtk_text_input
581  *
582  * Sets the cursor outline as a x, y, width, height rectangle in surface
583  * local coordinates.
584  *
585  * Allows the compositor to put a window with word suggestions near the
586  * cursor.
587  */
588 static inline void
gtk_text_input_set_cursor_rectangle(struct gtk_text_input * gtk_text_input,int32_t x,int32_t y,int32_t width,int32_t height)589 gtk_text_input_set_cursor_rectangle(struct gtk_text_input *gtk_text_input, int32_t x, int32_t y, int32_t width, int32_t height)
590 {
591 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
592 			 GTK_TEXT_INPUT_SET_CURSOR_RECTANGLE, x, y, width, height);
593 }
594 
595 /**
596  * @ingroup iface_gtk_text_input
597  *
598  * Allows to atomically send state updates from client. The previous
599  * set_surrounding_text, set_content_type and set_cursor_rectangle
600  * become effective after this call.
601  *
602  * Serial should be set to the serial from the last wp_text_input.enter
603  * event.
604  *
605  * To make sure to not receive outdated input method events after a
606  * state update, wl_display_sync() should be called after making this
607  * request.
608  */
609 static inline void
gtk_text_input_commit(struct gtk_text_input * gtk_text_input)610 gtk_text_input_commit(struct gtk_text_input *gtk_text_input)
611 {
612 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input,
613 			 GTK_TEXT_INPUT_COMMIT);
614 }
615 
616 #define GTK_TEXT_INPUT_MANAGER_DESTROY 0
617 #define GTK_TEXT_INPUT_MANAGER_GET_TEXT_INPUT 1
618 
619 
620 /**
621  * @ingroup iface_gtk_text_input_manager
622  */
623 #define GTK_TEXT_INPUT_MANAGER_DESTROY_SINCE_VERSION 1
624 /**
625  * @ingroup iface_gtk_text_input_manager
626  */
627 #define GTK_TEXT_INPUT_MANAGER_GET_TEXT_INPUT_SINCE_VERSION 1
628 
629 /** @ingroup iface_gtk_text_input_manager */
630 static inline void
gtk_text_input_manager_set_user_data(struct gtk_text_input_manager * gtk_text_input_manager,void * user_data)631 gtk_text_input_manager_set_user_data(struct gtk_text_input_manager *gtk_text_input_manager, void *user_data)
632 {
633 	wl_proxy_set_user_data((struct wl_proxy *) gtk_text_input_manager, user_data);
634 }
635 
636 /** @ingroup iface_gtk_text_input_manager */
637 static inline void *
gtk_text_input_manager_get_user_data(struct gtk_text_input_manager * gtk_text_input_manager)638 gtk_text_input_manager_get_user_data(struct gtk_text_input_manager *gtk_text_input_manager)
639 {
640 	return wl_proxy_get_user_data((struct wl_proxy *) gtk_text_input_manager);
641 }
642 
643 static inline uint32_t
gtk_text_input_manager_get_version(struct gtk_text_input_manager * gtk_text_input_manager)644 gtk_text_input_manager_get_version(struct gtk_text_input_manager *gtk_text_input_manager)
645 {
646 	return wl_proxy_get_version((struct wl_proxy *) gtk_text_input_manager);
647 }
648 
649 /**
650  * @ingroup iface_gtk_text_input_manager
651  *
652  * Destroy the wp_text_input_manager object.
653  */
654 static inline void
gtk_text_input_manager_destroy(struct gtk_text_input_manager * gtk_text_input_manager)655 gtk_text_input_manager_destroy(struct gtk_text_input_manager *gtk_text_input_manager)
656 {
657 	wl_proxy_marshal((struct wl_proxy *) gtk_text_input_manager,
658 			 GTK_TEXT_INPUT_MANAGER_DESTROY);
659 
660 	wl_proxy_destroy((struct wl_proxy *) gtk_text_input_manager);
661 }
662 
663 /**
664  * @ingroup iface_gtk_text_input_manager
665  *
666  * Creates a new text-input object for a given seat.
667  */
668 static inline struct gtk_text_input *
gtk_text_input_manager_get_text_input(struct gtk_text_input_manager * gtk_text_input_manager,struct wl_seat * seat)669 gtk_text_input_manager_get_text_input(struct gtk_text_input_manager *gtk_text_input_manager, struct wl_seat *seat)
670 {
671 	struct wl_proxy *id;
672 
673 	id = wl_proxy_marshal_constructor((struct wl_proxy *) gtk_text_input_manager,
674 			 GTK_TEXT_INPUT_MANAGER_GET_TEXT_INPUT, &gtk_text_input_interface, NULL, seat);
675 
676 	return (struct gtk_text_input *) id;
677 }
678 
679 #ifdef  __cplusplus
680 }
681 #endif
682 
683 #endif
684