1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef XWAYLAND_KEYBOARD_GRAB_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define XWAYLAND_KEYBOARD_GRAB_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_xwayland_keyboard_grab_unstable_v1 The xwayland_keyboard_grab_unstable_v1 protocol
16 * Protocol for grabbing the keyboard from Xwayland
17 *
18 * @section page_desc_xwayland_keyboard_grab_unstable_v1 Description
19 *
20 * This protocol is application-specific to meet the needs of the X11
21 * protocol through Xwayland. It provides a way for Xwayland to request
22 * all keyboard events to be forwarded to a surface even when the
23 * surface does not have keyboard focus.
24 *
25 * In the X11 protocol, a client may request an "active grab" on the
26 * keyboard. On success, all key events are reported only to the
27 * grabbing X11 client. For details, see XGrabKeyboard(3).
28 *
29 * The core Wayland protocol does not have a notion of an active
30 * keyboard grab. When running in Xwayland, X11 applications may
31 * acquire an active grab inside Xwayland but that cannot be translated
32 * to the Wayland compositor who may set the input focus to some other
33 * surface. In doing so, it breaks the X11 client assumption that all
34 * key events are reported to the grabbing client.
35 *
36 * This protocol specifies a way for Xwayland to request all keyboard
37 * be directed to the given surface. The protocol does not guarantee
38 * that the compositor will honor this request and it does not
39 * prescribe user interfaces on how to handle the respond. For example,
40 * a compositor may inform the user that all key events are now
41 * forwarded to the given client surface, or it may ask the user for
42 * permission to do so.
43 *
44 * Compositors are required to restrict access to this application
45 * specific protocol to Xwayland alone.
46 *
47 * Warning! The protocol described in this file is experimental and
48 * backward incompatible changes may be made. Backward compatible
49 * changes may be added together with the corresponding interface
50 * version bump.
51 * Backward incompatible changes are done by bumping the version
52 * number in the protocol and interface names and resetting the
53 * interface version. Once the protocol is to be declared stable,
54 * the 'z' prefix and the version number in the protocol and
55 * interface names are removed and the interface version number is
56 * reset.
57 *
58 * @section page_ifaces_xwayland_keyboard_grab_unstable_v1 Interfaces
59 * - @subpage page_iface_zwp_xwayland_keyboard_grab_manager_v1 - context object for keyboard grab manager
60 * - @subpage page_iface_zwp_xwayland_keyboard_grab_v1 - interface for grabbing the keyboard
61 * @section page_copyright_xwayland_keyboard_grab_unstable_v1 Copyright
62 * <pre>
63 *
64 * Copyright © 2017 Red Hat Inc.
65 *
66 * Permission is hereby granted, free of charge, to any person obtaining a
67 * copy of this software and associated documentation files (the "Software"),
68 * to deal in the Software without restriction, including without limitation
69 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
70 * and/or sell copies of the Software, and to permit persons to whom the
71 * Software is furnished to do so, subject to the following conditions:
72 *
73 * The above copyright notice and this permission notice (including the next
74 * paragraph) shall be included in all copies or substantial portions of the
75 * Software.
76 *
77 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
78 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
79 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
80 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
81 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
82 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
83 * DEALINGS IN THE SOFTWARE.
84 * </pre>
85 */
86 struct wl_seat;
87 struct wl_surface;
88 struct zwp_xwayland_keyboard_grab_manager_v1;
89 struct zwp_xwayland_keyboard_grab_v1;
90
91 #ifndef ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_INTERFACE
92 #define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_INTERFACE
93 /**
94 * @page page_iface_zwp_xwayland_keyboard_grab_manager_v1 zwp_xwayland_keyboard_grab_manager_v1
95 * @section page_iface_zwp_xwayland_keyboard_grab_manager_v1_desc Description
96 *
97 * A global interface used for grabbing the keyboard.
98 * @section page_iface_zwp_xwayland_keyboard_grab_manager_v1_api API
99 * See @ref iface_zwp_xwayland_keyboard_grab_manager_v1.
100 */
101 /**
102 * @defgroup iface_zwp_xwayland_keyboard_grab_manager_v1 The zwp_xwayland_keyboard_grab_manager_v1 interface
103 *
104 * A global interface used for grabbing the keyboard.
105 */
106 extern const struct wl_interface zwp_xwayland_keyboard_grab_manager_v1_interface;
107 #endif
108 #ifndef ZWP_XWAYLAND_KEYBOARD_GRAB_V1_INTERFACE
109 #define ZWP_XWAYLAND_KEYBOARD_GRAB_V1_INTERFACE
110 /**
111 * @page page_iface_zwp_xwayland_keyboard_grab_v1 zwp_xwayland_keyboard_grab_v1
112 * @section page_iface_zwp_xwayland_keyboard_grab_v1_desc Description
113 *
114 * A global interface used for grabbing the keyboard.
115 * @section page_iface_zwp_xwayland_keyboard_grab_v1_api API
116 * See @ref iface_zwp_xwayland_keyboard_grab_v1.
117 */
118 /**
119 * @defgroup iface_zwp_xwayland_keyboard_grab_v1 The zwp_xwayland_keyboard_grab_v1 interface
120 *
121 * A global interface used for grabbing the keyboard.
122 */
123 extern const struct wl_interface zwp_xwayland_keyboard_grab_v1_interface;
124 #endif
125
126 #define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY 0
127 #define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD 1
128
129
130 /**
131 * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1
132 */
133 #define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY_SINCE_VERSION 1
134 /**
135 * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1
136 */
137 #define ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD_SINCE_VERSION 1
138
139 /** @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 */
140 static inline void
zwp_xwayland_keyboard_grab_manager_v1_set_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 * zwp_xwayland_keyboard_grab_manager_v1,void * user_data)141 zwp_xwayland_keyboard_grab_manager_v1_set_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1, void *user_data)
142 {
143 wl_proxy_set_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1, user_data);
144 }
145
146 /** @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1 */
147 static inline void *
zwp_xwayland_keyboard_grab_manager_v1_get_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 * zwp_xwayland_keyboard_grab_manager_v1)148 zwp_xwayland_keyboard_grab_manager_v1_get_user_data(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1)
149 {
150 return wl_proxy_get_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1);
151 }
152
153 static inline uint32_t
zwp_xwayland_keyboard_grab_manager_v1_get_version(struct zwp_xwayland_keyboard_grab_manager_v1 * zwp_xwayland_keyboard_grab_manager_v1)154 zwp_xwayland_keyboard_grab_manager_v1_get_version(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1)
155 {
156 return wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1);
157 }
158
159 /**
160 * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1
161 *
162 * Destroy the keyboard grab manager.
163 */
164 static inline void
zwp_xwayland_keyboard_grab_manager_v1_destroy(struct zwp_xwayland_keyboard_grab_manager_v1 * zwp_xwayland_keyboard_grab_manager_v1)165 zwp_xwayland_keyboard_grab_manager_v1_destroy(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1)
166 {
167 wl_proxy_marshal_flags((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1,
168 ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1), WL_MARSHAL_FLAG_DESTROY);
169 }
170
171 /**
172 * @ingroup iface_zwp_xwayland_keyboard_grab_manager_v1
173 *
174 * The grab_keyboard request asks for a grab of the keyboard, forcing
175 * the keyboard focus for the given seat upon the given surface.
176 *
177 * The protocol provides no guarantee that the grab is ever satisfied,
178 * and does not require the compositor to send an error if the grab
179 * cannot ever be satisfied. It is thus possible to request a keyboard
180 * grab that will never be effective.
181 *
182 * The protocol:
183 *
184 * * does not guarantee that the grab itself is applied for a surface,
185 * the grab request may be silently ignored by the compositor,
186 * * does not guarantee that any events are sent to this client even
187 * if the grab is applied to a surface,
188 * * does not guarantee that events sent to this client are exhaustive,
189 * a compositor may filter some events for its own consumption,
190 * * does not guarantee that events sent to this client are continuous,
191 * a compositor may change and reroute keyboard events while the grab
192 * is nominally active.
193 */
194 static inline struct zwp_xwayland_keyboard_grab_v1 *
zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(struct zwp_xwayland_keyboard_grab_manager_v1 * zwp_xwayland_keyboard_grab_manager_v1,struct wl_surface * surface,struct wl_seat * seat)195 zwp_xwayland_keyboard_grab_manager_v1_grab_keyboard(struct zwp_xwayland_keyboard_grab_manager_v1 *zwp_xwayland_keyboard_grab_manager_v1, struct wl_surface *surface, struct wl_seat *seat)
196 {
197 struct wl_proxy *id;
198
199 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1,
200 ZWP_XWAYLAND_KEYBOARD_GRAB_MANAGER_V1_GRAB_KEYBOARD, &zwp_xwayland_keyboard_grab_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_manager_v1), 0, NULL, surface, seat);
201
202 return (struct zwp_xwayland_keyboard_grab_v1 *) id;
203 }
204
205 #define ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY 0
206
207
208 /**
209 * @ingroup iface_zwp_xwayland_keyboard_grab_v1
210 */
211 #define ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY_SINCE_VERSION 1
212
213 /** @ingroup iface_zwp_xwayland_keyboard_grab_v1 */
214 static inline void
zwp_xwayland_keyboard_grab_v1_set_user_data(struct zwp_xwayland_keyboard_grab_v1 * zwp_xwayland_keyboard_grab_v1,void * user_data)215 zwp_xwayland_keyboard_grab_v1_set_user_data(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1, void *user_data)
216 {
217 wl_proxy_set_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1, user_data);
218 }
219
220 /** @ingroup iface_zwp_xwayland_keyboard_grab_v1 */
221 static inline void *
zwp_xwayland_keyboard_grab_v1_get_user_data(struct zwp_xwayland_keyboard_grab_v1 * zwp_xwayland_keyboard_grab_v1)222 zwp_xwayland_keyboard_grab_v1_get_user_data(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1)
223 {
224 return wl_proxy_get_user_data((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1);
225 }
226
227 static inline uint32_t
zwp_xwayland_keyboard_grab_v1_get_version(struct zwp_xwayland_keyboard_grab_v1 * zwp_xwayland_keyboard_grab_v1)228 zwp_xwayland_keyboard_grab_v1_get_version(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1)
229 {
230 return wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1);
231 }
232
233 /**
234 * @ingroup iface_zwp_xwayland_keyboard_grab_v1
235 *
236 * Destroy the grabbed keyboard object. If applicable, the compositor
237 * will ungrab the keyboard.
238 */
239 static inline void
zwp_xwayland_keyboard_grab_v1_destroy(struct zwp_xwayland_keyboard_grab_v1 * zwp_xwayland_keyboard_grab_v1)240 zwp_xwayland_keyboard_grab_v1_destroy(struct zwp_xwayland_keyboard_grab_v1 *zwp_xwayland_keyboard_grab_v1)
241 {
242 wl_proxy_marshal_flags((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1,
243 ZWP_XWAYLAND_KEYBOARD_GRAB_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_xwayland_keyboard_grab_v1), WL_MARSHAL_FLAG_DESTROY);
244 }
245
246 #ifdef __cplusplus
247 }
248 #endif
249
250 #endif
251