1 | /* Generated by wayland-scanner 1.16.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 | /** |
69 | * @page page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1 zwp_keyboard_shortcuts_inhibit_manager_v1 |
70 | * @section page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1_desc Description |
71 | * |
72 | * A global interface used for inhibiting the compositor keyboard shortcuts. |
73 | * @section page_iface_zwp_keyboard_shortcuts_inhibit_manager_v1_api API |
74 | * See @ref iface_zwp_keyboard_shortcuts_inhibit_manager_v1. |
75 | */ |
76 | /** |
77 | * @defgroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 The zwp_keyboard_shortcuts_inhibit_manager_v1 interface |
78 | * |
79 | * A global interface used for inhibiting the compositor keyboard shortcuts. |
80 | */ |
81 | extern const struct wl_interface zwp_keyboard_shortcuts_inhibit_manager_v1_interface; |
82 | /** |
83 | * @page page_iface_zwp_keyboard_shortcuts_inhibitor_v1 zwp_keyboard_shortcuts_inhibitor_v1 |
84 | * @section page_iface_zwp_keyboard_shortcuts_inhibitor_v1_desc Description |
85 | * |
86 | * A keyboard shortcuts inhibitor instructs the compositor to ignore |
87 | * its own keyboard shortcuts when the associated surface has keyboard |
88 | * focus. As a result, when the surface has keyboard focus on the given |
89 | * seat, it will receive all key events originating from the specified |
90 | * seat, even those which would normally be caught by the compositor for |
91 | * its own shortcuts. |
92 | * |
93 | * The Wayland compositor is however under no obligation to disable |
94 | * all of its shortcuts, and may keep some special key combo for its own |
95 | * use, including but not limited to one allowing the user to forcibly |
96 | * restore normal keyboard events routing in the case of an unwilling |
97 | * client. The compositor may also use the same key combo to reactivate |
98 | * an existing shortcut inhibitor that was previously deactivated on |
99 | * user request. |
100 | * |
101 | * When the compositor restores its own keyboard shortcuts, an |
102 | * "inactive" event is emitted to notify the client that the keyboard |
103 | * shortcuts inhibitor is not effectively active for the surface and |
104 | * seat any more, and the client should not expect to receive all |
105 | * keyboard events. |
106 | * |
107 | * When the keyboard shortcuts inhibitor is inactive, the client has |
108 | * no way to forcibly reactivate the keyboard shortcuts inhibitor. |
109 | * |
110 | * The user can chose to re-enable a previously deactivated keyboard |
111 | * shortcuts inhibitor using any mechanism the compositor may offer, |
112 | * in which case the compositor will send an "active" event to notify |
113 | * the client. |
114 | * |
115 | * If the surface is destroyed, unmapped, or loses the seat's keyboard |
116 | * focus, the keyboard shortcuts inhibitor becomes irrelevant and the |
117 | * compositor will restore its own keyboard shortcuts but no "inactive" |
118 | * event is emitted in this case. |
119 | * @section page_iface_zwp_keyboard_shortcuts_inhibitor_v1_api API |
120 | * See @ref iface_zwp_keyboard_shortcuts_inhibitor_v1. |
121 | */ |
122 | /** |
123 | * @defgroup iface_zwp_keyboard_shortcuts_inhibitor_v1 The zwp_keyboard_shortcuts_inhibitor_v1 interface |
124 | * |
125 | * A keyboard shortcuts inhibitor instructs the compositor to ignore |
126 | * its own keyboard shortcuts when the associated surface has keyboard |
127 | * focus. As a result, when the surface has keyboard focus on the given |
128 | * seat, it will receive all key events originating from the specified |
129 | * seat, even those which would normally be caught by the compositor for |
130 | * its own shortcuts. |
131 | * |
132 | * The Wayland compositor is however under no obligation to disable |
133 | * all of its shortcuts, and may keep some special key combo for its own |
134 | * use, including but not limited to one allowing the user to forcibly |
135 | * restore normal keyboard events routing in the case of an unwilling |
136 | * client. The compositor may also use the same key combo to reactivate |
137 | * an existing shortcut inhibitor that was previously deactivated on |
138 | * user request. |
139 | * |
140 | * When the compositor restores its own keyboard shortcuts, an |
141 | * "inactive" event is emitted to notify the client that the keyboard |
142 | * shortcuts inhibitor is not effectively active for the surface and |
143 | * seat any more, and the client should not expect to receive all |
144 | * keyboard events. |
145 | * |
146 | * When the keyboard shortcuts inhibitor is inactive, the client has |
147 | * no way to forcibly reactivate the keyboard shortcuts inhibitor. |
148 | * |
149 | * The user can chose to re-enable a previously deactivated keyboard |
150 | * shortcuts inhibitor using any mechanism the compositor may offer, |
151 | * in which case the compositor will send an "active" event to notify |
152 | * the client. |
153 | * |
154 | * If the surface is destroyed, unmapped, or loses the seat's keyboard |
155 | * focus, the keyboard shortcuts inhibitor becomes irrelevant and the |
156 | * compositor will restore its own keyboard shortcuts but no "inactive" |
157 | * event is emitted in this case. |
158 | */ |
159 | extern const struct wl_interface zwp_keyboard_shortcuts_inhibitor_v1_interface; |
160 | |
161 | #ifndef ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM |
162 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM |
163 | enum zwp_keyboard_shortcuts_inhibit_manager_v1_error { |
164 | /** |
165 | * the shortcuts are already inhibited for this surface |
166 | */ |
167 | ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ALREADY_INHIBITED = 0, |
168 | }; |
169 | #endif /* ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_ERROR_ENUM */ |
170 | |
171 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY 0 |
172 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS 1 |
173 | |
174 | |
175 | /** |
176 | * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 |
177 | */ |
178 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY_SINCE_VERSION 1 |
179 | /** |
180 | * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 |
181 | */ |
182 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS_SINCE_VERSION 1 |
183 | |
184 | /** @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 */ |
185 | static inline void |
186 | 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) |
187 | { |
188 | wl_proxy_set_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1, user_data); |
189 | } |
190 | |
191 | /** @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 */ |
192 | static inline void * |
193 | zwp_keyboard_shortcuts_inhibit_manager_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1) |
194 | { |
195 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1); |
196 | } |
197 | |
198 | static inline uint32_t |
199 | zwp_keyboard_shortcuts_inhibit_manager_v1_get_version(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1) |
200 | { |
201 | return wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1); |
202 | } |
203 | |
204 | /** |
205 | * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 |
206 | * |
207 | * Destroy the keyboard shortcuts inhibitor manager. |
208 | */ |
209 | static inline void |
210 | zwp_keyboard_shortcuts_inhibit_manager_v1_destroy(struct zwp_keyboard_shortcuts_inhibit_manager_v1 *zwp_keyboard_shortcuts_inhibit_manager_v1) |
211 | { |
212 | wl_proxy_marshal((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1, |
213 | ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_DESTROY); |
214 | |
215 | wl_proxy_destroy((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1); |
216 | } |
217 | |
218 | /** |
219 | * @ingroup iface_zwp_keyboard_shortcuts_inhibit_manager_v1 |
220 | * |
221 | * Create a new keyboard shortcuts inhibitor object associated with |
222 | * the given surface for the given seat. |
223 | * |
224 | * If shortcuts are already inhibited for the specified seat and surface, |
225 | * a protocol error "already_inhibited" is raised by the compositor. |
226 | */ |
227 | static inline struct zwp_keyboard_shortcuts_inhibitor_v1 * |
228 | 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) |
229 | { |
230 | struct wl_proxy *id; |
231 | |
232 | id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_keyboard_shortcuts_inhibit_manager_v1, |
233 | ZWP_KEYBOARD_SHORTCUTS_INHIBIT_MANAGER_V1_INHIBIT_SHORTCUTS, &zwp_keyboard_shortcuts_inhibitor_v1_interface, NULL, surface, seat); |
234 | |
235 | return (struct zwp_keyboard_shortcuts_inhibitor_v1 *) id; |
236 | } |
237 | |
238 | /** |
239 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
240 | * @struct zwp_keyboard_shortcuts_inhibitor_v1_listener |
241 | */ |
242 | struct zwp_keyboard_shortcuts_inhibitor_v1_listener { |
243 | /** |
244 | * shortcuts are inhibited |
245 | * |
246 | * This event indicates that the shortcut inhibitor is active. |
247 | * |
248 | * The compositor sends this event every time compositor shortcuts |
249 | * are inhibited on behalf of the surface. When active, the client |
250 | * may receive input events normally reserved by the compositor |
251 | * (see zwp_keyboard_shortcuts_inhibitor_v1). |
252 | * |
253 | * This occurs typically when the initial request |
254 | * "inhibit_shortcuts" first becomes active or when the user |
255 | * instructs the compositor to re-enable and existing shortcuts |
256 | * inhibitor using any mechanism offered by the compositor. |
257 | */ |
258 | void (*active)(void *data, |
259 | struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1); |
260 | /** |
261 | * shortcuts are restored |
262 | * |
263 | * This event indicates that the shortcuts inhibitor is inactive, |
264 | * normal shortcuts processing is restored by the compositor. |
265 | */ |
266 | void (*inactive)(void *data, |
267 | struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1); |
268 | }; |
269 | |
270 | /** |
271 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
272 | */ |
273 | static inline int |
274 | zwp_keyboard_shortcuts_inhibitor_v1_add_listener(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1, |
275 | const struct zwp_keyboard_shortcuts_inhibitor_v1_listener *listener, void *data) |
276 | { |
277 | return wl_proxy_add_listener((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1, |
278 | (void (**)(void)) listener, data); |
279 | } |
280 | |
281 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY 0 |
282 | |
283 | /** |
284 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
285 | */ |
286 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_ACTIVE_SINCE_VERSION 1 |
287 | /** |
288 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
289 | */ |
290 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_INACTIVE_SINCE_VERSION 1 |
291 | |
292 | /** |
293 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
294 | */ |
295 | #define ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY_SINCE_VERSION 1 |
296 | |
297 | /** @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 */ |
298 | static inline void |
299 | zwp_keyboard_shortcuts_inhibitor_v1_set_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1, void *user_data) |
300 | { |
301 | wl_proxy_set_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1, user_data); |
302 | } |
303 | |
304 | /** @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 */ |
305 | static inline void * |
306 | zwp_keyboard_shortcuts_inhibitor_v1_get_user_data(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1) |
307 | { |
308 | return wl_proxy_get_user_data((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1); |
309 | } |
310 | |
311 | static inline uint32_t |
312 | zwp_keyboard_shortcuts_inhibitor_v1_get_version(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1) |
313 | { |
314 | return wl_proxy_get_version((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1); |
315 | } |
316 | |
317 | /** |
318 | * @ingroup iface_zwp_keyboard_shortcuts_inhibitor_v1 |
319 | * |
320 | * Remove the keyboard shortcuts inhibitor from the associated wl_surface. |
321 | */ |
322 | static inline void |
323 | zwp_keyboard_shortcuts_inhibitor_v1_destroy(struct zwp_keyboard_shortcuts_inhibitor_v1 *zwp_keyboard_shortcuts_inhibitor_v1) |
324 | { |
325 | wl_proxy_marshal((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1, |
326 | ZWP_KEYBOARD_SHORTCUTS_INHIBITOR_V1_DESTROY); |
327 | |
328 | wl_proxy_destroy((struct wl_proxy *) zwp_keyboard_shortcuts_inhibitor_v1); |
329 | } |
330 | |
331 | #ifdef __cplusplus |
332 | } |
333 | #endif |
334 | |
335 | #endif |
336 | |