1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef KEYBOARD_SHORTCUTS_INHIBIT_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define KEYBOARD_SHORTCUTS_INHIBIT_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_keyboard_shortcuts_inhibit_unstable_v1 The keyboard_shortcuts_inhibit_unstable_v1 protocol
16  * Protocol for inhibiting the compositor keyboard shortcuts
17  *
18  * @section page_desc_keyboard_shortcuts_inhibit_unstable_v1 Description
19  *
20  * This protocol specifies a way for a client to request the compositor
21  * to ignore its own keyboard shortcuts for a given seat, so that all
22  * key events from that seat get forwarded to a surface.
23  *
24  * Warning! The protocol described in this file is experimental and
25  * backward incompatible changes may be made. Backward compatible
26  * changes may be added together with the corresponding interface
27  * version bump.
28  * Backward incompatible changes are done by bumping the version
29  * number in the protocol and interface names and resetting the
30  * interface version. Once the protocol is to be declared stable,
31  * the 'z' prefix and the version number in the protocol and
32  * interface names are removed and the interface version number is
33  * reset.
34  *
35  * @section page_ifaces_keyboard_shortcuts_inhibit_unstable_v1 Interfaces
36  * - @subpage page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1 - context object for keyboard grab_manager
37  * - @subpage page_iface_zwp_keyboard_shortcuts_inhibitor_v1 - context object for keyboard shortcuts inhibitor
38  * @section page_copyright_keyboard_shortcuts_inhibit_unstable_v1 Copyright
39  * <pre>
40  *
41  * Copyright © 2017 Red Hat Inc.
42  *
43  * Permission is hereby granted, free of charge, to any person obtaining a
44  * copy of this software and associated documentation files (the "Software"),
45  * to deal in the Software without restriction, including without limitation
46  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
47  * and/or sell copies of the Software, and to permit persons to whom the
48  * Software is furnished to do so, subject to the following conditions:
49  *
50  * The above copyright notice and this permission notice (including the next
51  * paragraph) shall be included in all copies or substantial portions of the
52  * Software.
53  *
54  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
55  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
56  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
57  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
58  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
59  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
60  * DEALINGS IN THE SOFTWARE.
61  * </pre>
62  */
63 struct wl_seat;
64 struct wl_surface;
65 struct zwp_keyboard_shortcuts_inhibit_manager_v1;
66 struct zwp_keyboard_shortcuts_inhibitor_v1;
67 
68 #ifndef ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INTERFACE
69 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INTERFACE
70 /**
71  * @page page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1 zwp_keyboard_shortcuts_inhibit_manager_v1
72  * @section page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1_desc Description
73  *
74  * A global interface used for inhibiting the compositor keyboard shortcuts.
75  * @section page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1_api API
76  * See @ref iface_zwp_keyboard_shortcuts_inhibit_manager_v1.
77  */
78 /**
79  * @defgroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 The zwp_keyboard_shortcuts_inhibit_manager_v1 interface
80  *
81  * A global interface used for inhibiting the compositor keyboard shortcuts.
82  */
83 extern const struct wl_interface zwp_keyboard_shortcuts_inhibit_manager_v1_interface;
84 #endif
85 #ifndef ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_INTERFACE
86 #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_INTERFACE
87 /**
88  * @page page_iface_zwp_keyboard_shortcuts_inhibitor_v1 zwp_keyboard_shortcuts_inhibitor_v1
89  * @section page_iface_zwp_keyboard_shortcuts_inhibitor_v1_desc Description
90  *
91  * A keyboard shortcuts inhibitor instructs the compositor to ignore
92  * its own keyboard shortcuts when the associated surface has keyboard
93  * focus. As a result, when the surface has keyboard focus on the given
94  * seat, it will receive all key events originating from the specified
95  * seat, even those which would normally be caught by the compositor for
96  * its own shortcuts.
97  *
98  * The Wayland compositor is however under no obligation to disable
99  * all of its shortcuts, and may keep some special key combo for its own
100  * use, including but not limited to one allowing the user to forcibly
101  * restore normal keyboard events routing in the case of an unwilling
102  * client. The compositor may also use the same key combo to reactivate
103  * an existing shortcut inhibitor that was previously deactivated on
104  * user request.
105  *
106  * When the compositor restores its own keyboard shortcuts, an
107  * "inactive" event is emitted to notify the client that the keyboard
108  * shortcuts inhibitor is not effectively active for the surface and
109  * seat any more, and the client should not expect to receive all
110  * keyboard events.
111  *
112  * When the keyboard shortcuts inhibitor is inactive, the client has
113  * no way to forcibly reactivate the keyboard shortcuts inhibitor.
114  *
115  * The user can chose to re-enable a previously deactivated keyboard
116  * shortcuts inhibitor using any mechanism the compositor may offer,
117  * in which case the compositor will send an "active" event to notify
118  * the client.
119  *
120  * If the surface is destroyed, unmapped, or loses the seat's keyboard
121  * focus, the keyboard shortcuts inhibitor becomes irrelevant and the
122  * compositor will restore its own keyboard shortcuts but no "inactive"
123  * event is emitted in this case.
124  * @section page_iface_zwp_keyboard_shortcuts_inhibitor_v1_api API
125  * See @ref iface_zwp_keyboard_shortcuts_inhibitor_v1.
126  */
127 /**
128  * @defgroup iface_zwp_keyboard_shortcuts_inhibitor_v1 The zwp_keyboard_shortcuts_inhibitor_v1 interface
129  *
130  * A keyboard shortcuts inhibitor instructs the compositor to ignore
131  * its own keyboard shortcuts when the associated surface has keyboard
132  * focus. As a result, when the surface has keyboard focus on the given
133  * seat, it will receive all key events originating from the specified
134  * seat, even those which would normally be caught by the compositor for
135  * its own shortcuts.
136  *
137  * The Wayland compositor is however under no obligation to disable
138  * all of its shortcuts, and may keep some special key combo for its own
139  * use, including but not limited to one allowing the user to forcibly
140  * restore normal keyboard events routing in the case of an unwilling
141  * client. The compositor may also use the same key combo to reactivate
142  * an existing shortcut inhibitor that was previously deactivated on
143  * user request.
144  *
145  * When the compositor restores its own keyboard shortcuts, an
146  * "inactive" event is emitted to notify the client that the keyboard
147  * shortcuts inhibitor is not effectively active for the surface and
148  * seat any more, and the client should not expect to receive all
149  * keyboard events.
150  *
151  * When the keyboard shortcuts inhibitor is inactive, the client has
152  * no way to forcibly reactivate the keyboard shortcuts inhibitor.
153  *
154  * The user can chose to re-enable a previously deactivated keyboard
155  * shortcuts inhibitor using any mechanism the compositor may offer,
156  * in which case the compositor will send an "active" event to notify
157  * the client.
158  *
159  * If the surface is destroyed, unmapped, or loses the seat's keyboard
160  * focus, the keyboard shortcuts inhibitor becomes irrelevant and the
161  * compositor will restore its own keyboard shortcuts but no "inactive"
162  * event is emitted in this case.
163  */
164 extern const struct wl_interface zwp_keyboard_shortcuts_inhibitor_v1_interface;
165 #endif
166 
167 #ifndef ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM
168 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM
169 enum zwp_keyboard_shortcuts_inhibit_manager_v1_error {
170 	/**
171 	 * the shortcuts are already inhibited for this surface
172 	 */
173 	ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ALREADY_INHIBITED = 0,
174 };
175 #endif /* ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM */
176 
177 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY 0
178 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS 1
179 
180 
181 /**
182  * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1
183  */
184 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY_SINCE_VERSION 1
185 /**
186  * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1
187  */
188 #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS_SINCE_VERSION 1
189 
190 /** @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 */
191 static inline void
zwp_keyboard_shortcuts_inhibit_manager_v1_set_user_data(struct zwp_keyboard_shortcuts_inhibit_manager_v1 * zwp_keyboard_shortcuts_inhibit_manager_v1,void * user_data)192 zwp_keyboard_shortcuts_inhibit_manager_v1_set_user_data(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1, void *user_data)
193 {
194 	wl_proxy_set_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1, user_data);
195 }
196 
197 /** @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 */
198 static inline void *
zwp_keyboard_shortcuts_inhibit_manager_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibit_manager_v1 * zwp_keyboard_shortcuts_inhibit_manager_v1)199 zwp_keyboard_shortcuts_inhibit_manager_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1)
200 {
201 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1);
202 }
203 
204 static inline uint32_t
zwp_keyboard_shortcuts_inhibit_manager_v1_get_version(struct zwp_keyboard_shortcuts_inhibit_manager_v1 * zwp_keyboard_shortcuts_inhibit_manager_v1)205 zwp_keyboard_shortcuts_inhibit_manager_v1_get_version(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1)
206 {
207 	return wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1);
208 }
209 
210 /**
211  * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1
212  *
213  * Destroy the keyboard shortcuts inhibitor manager.
214  */
215 static inline void
zwp_keyboard_shortcuts_inhibit_manager_v1_destroy(struct zwp_keyboard_shortcuts_inhibit_manager_v1 * zwp_keyboard_shortcuts_inhibit_manager_v1)216 zwp_keyboard_shortcuts_inhibit_manager_v1_destroy(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1)
217 {
218 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1,
219 			 ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1), WL_MARSHAL_FLAG_DESTROY);
220 }
221 
222 /**
223  * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1
224  *
225  * Create a new keyboard shortcuts inhibitor object associated with
226  * the given surface for the given seat.
227  *
228  * If shortcuts are already inhibited for the specified seat and surface,
229  * a protocol error "already_inhibited" is raised by the compositor.
230  */
231 static inline struct zwp_keyboard_shortcuts_inhibitor_v1 *
zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(struct zwp_keyboard_shortcuts_inhibit_manager_v1 * zwp_keyboard_shortcuts_inhibit_manager_v1,struct wl_surface * surface,struct wl_seat * seat)232 zwp_keyboard_shortcuts_inhibit_manager_v1_inhibit_shortcuts(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1, struct wl_surface *surface, struct wl_seat *seat)
233 {
234 	struct wl_proxy *id;
235 
236 	id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1,
237 			 ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS, &zwp_keyboard_shortcuts_inhibitor_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1), 0, NULL, surface, seat);
238 
239 	return (struct zwp_keyboard_shortcuts_inhibitor_v1 *) id;
240 }
241 
242 /**
243  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
244  * @struct zwp_keyboard_shortcuts_inhibitor_v1_listener
245  */
246 struct zwp_keyboard_shortcuts_inhibitor_v1_listener {
247 	/**
248 	 * shortcuts are inhibited
249 	 *
250 	 * This event indicates that the shortcut inhibitor is active.
251 	 *
252 	 * The compositor sends this event every time compositor shortcuts
253 	 * are inhibited on behalf of the surface. When active, the client
254 	 * may receive input events normally reserved by the compositor
255 	 * (see zwp_keyboard_shortcuts_inhibitor_v1).
256 	 *
257 	 * This occurs typically when the initial request
258 	 * "inhibit_shortcuts" first becomes active or when the user
259 	 * instructs the compositor to re-enable and existing shortcuts
260 	 * inhibitor using any mechanism offered by the compositor.
261 	 */
262 	void (*active)(void *data,
263 		       struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1);
264 	/**
265 	 * shortcuts are restored
266 	 *
267 	 * This event indicates that the shortcuts inhibitor is inactive,
268 	 * normal shortcuts processing is restored by the compositor.
269 	 */
270 	void (*inactive)(void *data,
271 			 struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1);
272 };
273 
274 /**
275  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
276  */
277 static inline int
zwp_keyboard_shortcuts_inhibitor_v1_add_listener(struct zwp_keyboard_shortcuts_inhibitor_v1 * zwp_keyboard_shortcuts_inhibitor_v1,const struct zwp_keyboard_shortcuts_inhibitor_v1_listener * listener,void * data)278 zwp_keyboard_shortcuts_inhibitor_v1_add_listener(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1,
279 						 const struct zwp_keyboard_shortcuts_inhibitor_v1_listener *listener, void *data)
280 {
281 	return wl_proxy_add_listener((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1,
282 				     (void (**)(void)) listener, data);
283 }
284 
285 #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY 0
286 
287 /**
288  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
289  */
290 #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_ACTIVE_SINCE_VERSION 1
291 /**
292  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
293  */
294 #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_INACTIVE_SINCE_VERSION 1
295 
296 /**
297  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
298  */
299 #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY_SINCE_VERSION 1
300 
301 /** @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 */
302 static inline void
zwp_keyboard_shortcuts_inhibitor_v1_set_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 * zwp_keyboard_shortcuts_inhibitor_v1,void * user_data)303 zwp_keyboard_shortcuts_inhibitor_v1_set_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1, void *user_data)
304 {
305 	wl_proxy_set_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1, user_data);
306 }
307 
308 /** @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 */
309 static inline void *
zwp_keyboard_shortcuts_inhibitor_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 * zwp_keyboard_shortcuts_inhibitor_v1)310 zwp_keyboard_shortcuts_inhibitor_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1)
311 {
312 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1);
313 }
314 
315 static inline uint32_t
zwp_keyboard_shortcuts_inhibitor_v1_get_version(struct zwp_keyboard_shortcuts_inhibitor_v1 * zwp_keyboard_shortcuts_inhibitor_v1)316 zwp_keyboard_shortcuts_inhibitor_v1_get_version(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1)
317 {
318 	return wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1);
319 }
320 
321 /**
322  * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1
323  *
324  * Remove the keyboard shortcuts inhibitor from the associated wl_surface.
325  */
326 static inline void
zwp_keyboard_shortcuts_inhibitor_v1_destroy(struct zwp_keyboard_shortcuts_inhibitor_v1 * zwp_keyboard_shortcuts_inhibitor_v1)327 zwp_keyboard_shortcuts_inhibitor_v1_destroy(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1)
328 {
329 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1,
330 			 ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1), WL_MARSHAL_FLAG_DESTROY);
331 }
332 
333 #ifdef  __cplusplus
334 }
335 #endif
336 
337 #endif
338