Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / widget / gtk / wayland / xdg-activation-v1-client-protocol.h
blob9bebcb6ec23bb10b509e12003042b188b3a4fbbe
1 /* Generated by wayland-scanner 1.19.0 */
3 #ifndef XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
4 #define XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 /**
15 * @page page_xdg_activation_v1 The xdg_activation_v1 protocol
16 * Protocol for requesting activation of surfaces
18 * @section page_desc_xdg_activation_v1 Description
20 * The way for a client to pass focus to another toplevel is as follows.
22 * The client that intends to activate another toplevel uses the
23 * xdg_activation_v1.get_activation_token request to get an activation token.
24 * This token is then forwarded to the client, which is supposed to activate
25 * one of its surfaces, through a separate band of communication.
27 * One established way of doing this is through the XDG_ACTIVATION_TOKEN
28 * environment variable of a newly launched child process. The child process
29 * should unset the environment variable again right after reading it out in
30 * order to avoid propagating it to other child processes.
32 * Another established way exists for Applications implementing the D-Bus
33 * interface org.freedesktop.Application, which should get their token under
34 * XDG_ACTIVATION_TOKEN on their platform_data.
36 * In general activation tokens may be transferred across clients through
37 * means not described in this protocol.
39 * The client to be activated will then pass the token
40 * it received to the xdg_activation_v1.activate request. The compositor can
41 * then use this token to decide how to react to the activation request.
43 * The token the activating client gets may be ineffective either already at
44 * the time it receives it, for example if it was not focused, for focus
45 * stealing prevention. The activating client will have no way to discover
46 * the validity of the token, and may still forward it to the to be activated
47 * client.
49 * The created activation token may optionally get information attached to it
50 * that can be used by the compositor to identify the application that we
51 * intend to activate. This can for example be used to display a visual hint
52 * about what application is being started.
54 * Warning! The protocol described in this file is currently in the testing
55 * phase. Backward compatible changes may be added together with the
56 * corresponding interface version bump. Backward incompatible changes can
57 * only be done by creating a new major version of the extension.
59 * @section page_ifaces_xdg_activation_v1 Interfaces
60 * - @subpage page_iface_xdg_activation_v1 - interface for activating surfaces
61 * - @subpage page_iface_xdg_activation_token_v1 - an exported activation handle
62 * @section page_copyright_xdg_activation_v1 Copyright
63 * <pre>
65 * Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
66 * Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
68 * Permission is hereby granted, free of charge, to any person obtaining a
69 * copy of this software and associated documentation files (the "Software"),
70 * to deal in the Software without restriction, including without limitation
71 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
72 * and/or sell copies of the Software, and to permit persons to whom the
73 * Software is furnished to do so, subject to the following conditions:
75 * The above copyright notice and this permission notice (including the next
76 * paragraph) shall be included in all copies or substantial portions of the
77 * Software.
79 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
82 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
84 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
85 * DEALINGS IN THE SOFTWARE.
86 * </pre>
88 struct wl_seat;
89 struct wl_surface;
90 struct xdg_activation_token_v1;
91 struct xdg_activation_v1;
93 #ifndef XDG_ACTIVATION_V1_INTERFACE
94 # define XDG_ACTIVATION_V1_INTERFACE
95 /**
96 * @page page_iface_xdg_activation_v1 xdg_activation_v1
97 * @section page_iface_xdg_activation_v1_desc Description
99 * A global interface used for informing the compositor about applications
100 * being activated or started, or for applications to request to be
101 * activated.
102 * @section page_iface_xdg_activation_v1_api API
103 * See @ref iface_xdg_activation_v1.
106 * @defgroup iface_xdg_activation_v1 The xdg_activation_v1 interface
108 * A global interface used for informing the compositor about applications
109 * being activated or started, or for applications to request to be
110 * activated.
112 extern const struct wl_interface xdg_activation_v1_interface;
113 #endif
114 #ifndef XDG_ACTIVATION_TOKEN_V1_INTERFACE
115 # define XDG_ACTIVATION_TOKEN_V1_INTERFACE
117 * @page page_iface_xdg_activation_token_v1 xdg_activation_token_v1
118 * @section page_iface_xdg_activation_token_v1_desc Description
120 * An object for setting up a token and receiving a token handle that can
121 * be passed as an activation token to another client.
123 * The object is created using the xdg_activation_v1.get_activation_token
124 * request. This object should then be populated with the app_id, surface
125 * and serial information and committed. The compositor shall then issue a
126 * done event with the token. In case the request's parameters are invalid,
127 * the compositor will provide an invalid token.
128 * @section page_iface_xdg_activation_token_v1_api API
129 * See @ref iface_xdg_activation_token_v1.
132 * @defgroup iface_xdg_activation_token_v1 The xdg_activation_token_v1 interface
134 * An object for setting up a token and receiving a token handle that can
135 * be passed as an activation token to another client.
137 * The object is created using the xdg_activation_v1.get_activation_token
138 * request. This object should then be populated with the app_id, surface
139 * and serial information and committed. The compositor shall then issue a
140 * done event with the token. In case the request's parameters are invalid,
141 * the compositor will provide an invalid token.
143 extern const struct wl_interface xdg_activation_token_v1_interface;
144 #endif
146 #define XDG_ACTIVATION_V1_DESTROY 0
147 #define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN 1
148 #define XDG_ACTIVATION_V1_ACTIVATE 2
151 * @ingroup iface_xdg_activation_v1
153 #define XDG_ACTIVATION_V1_DESTROY_SINCE_VERSION 1
155 * @ingroup iface_xdg_activation_v1
157 #define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN_SINCE_VERSION 1
159 * @ingroup iface_xdg_activation_v1
161 #define XDG_ACTIVATION_V1_ACTIVATE_SINCE_VERSION 1
163 /** @ingroup iface_xdg_activation_v1 */
164 static inline void xdg_activation_v1_set_user_data(
165 struct xdg_activation_v1* xdg_activation_v1, void* user_data) {
166 wl_proxy_set_user_data((struct wl_proxy*)xdg_activation_v1, user_data);
169 /** @ingroup iface_xdg_activation_v1 */
170 static inline void* xdg_activation_v1_get_user_data(
171 struct xdg_activation_v1* xdg_activation_v1) {
172 return wl_proxy_get_user_data((struct wl_proxy*)xdg_activation_v1);
175 static inline uint32_t xdg_activation_v1_get_version(
176 struct xdg_activation_v1* xdg_activation_v1) {
177 return wl_proxy_get_version((struct wl_proxy*)xdg_activation_v1);
181 * @ingroup iface_xdg_activation_v1
183 * Notify the compositor that the xdg_activation object will no longer be
184 * used.
186 * The child objects created via this interface are unaffected and should
187 * be destroyed separately.
189 static inline void xdg_activation_v1_destroy(
190 struct xdg_activation_v1* xdg_activation_v1) {
191 wl_proxy_marshal((struct wl_proxy*)xdg_activation_v1,
192 XDG_ACTIVATION_V1_DESTROY);
194 wl_proxy_destroy((struct wl_proxy*)xdg_activation_v1);
198 * @ingroup iface_xdg_activation_v1
200 * Creates an xdg_activation_token_v1 object that will provide
201 * the initiating client with a unique token for this activation. This
202 * token should be offered to the clients to be activated.
204 static inline struct xdg_activation_token_v1*
205 xdg_activation_v1_get_activation_token(
206 struct xdg_activation_v1* xdg_activation_v1) {
207 struct wl_proxy* id;
209 id = wl_proxy_marshal_constructor((struct wl_proxy*)xdg_activation_v1,
210 XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN,
211 &xdg_activation_token_v1_interface, NULL);
213 return (struct xdg_activation_token_v1*)id;
217 * @ingroup iface_xdg_activation_v1
219 * Requests surface activation. It's up to the compositor to display
220 * this information as desired, for example by placing the surface above
221 * the rest.
223 * The compositor may know who requested this by checking the activation
224 * token and might decide not to follow through with the activation if it's
225 * considered unwanted.
227 * Compositors can ignore unknown activation tokens when an invalid
228 * token is passed.
230 static inline void xdg_activation_v1_activate(
231 struct xdg_activation_v1* xdg_activation_v1, const char* token,
232 struct wl_surface* surface) {
233 wl_proxy_marshal((struct wl_proxy*)xdg_activation_v1,
234 XDG_ACTIVATION_V1_ACTIVATE, token, surface);
237 #ifndef XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
238 # define XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
239 enum xdg_activation_token_v1_error {
241 * The token has already been used previously
243 XDG_ACTIVATION_TOKEN_V1_ERROR_ALREADY_USED = 0,
245 #endif /* XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM */
248 * @ingroup iface_xdg_activation_token_v1
249 * @struct xdg_activation_token_v1_listener
251 struct xdg_activation_token_v1_listener {
253 * the exported activation token
255 * The 'done' event contains the unique token of this activation
256 * request and notifies that the provider is done.
257 * @param token the exported activation token
259 void (*done)(void* data,
260 struct xdg_activation_token_v1* xdg_activation_token_v1,
261 const char* token);
265 * @ingroup iface_xdg_activation_token_v1
267 static inline int xdg_activation_token_v1_add_listener(
268 struct xdg_activation_token_v1* xdg_activation_token_v1,
269 const struct xdg_activation_token_v1_listener* listener, void* data) {
270 return wl_proxy_add_listener((struct wl_proxy*)xdg_activation_token_v1,
271 (void (**)(void))listener, data);
274 #define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL 0
275 #define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID 1
276 #define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE 2
277 #define XDG_ACTIVATION_TOKEN_V1_COMMIT 3
278 #define XDG_ACTIVATION_TOKEN_V1_DESTROY 4
281 * @ingroup iface_xdg_activation_token_v1
283 #define XDG_ACTIVATION_TOKEN_V1_DONE_SINCE_VERSION 1
286 * @ingroup iface_xdg_activation_token_v1
288 #define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL_SINCE_VERSION 1
290 * @ingroup iface_xdg_activation_token_v1
292 #define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID_SINCE_VERSION 1
294 * @ingroup iface_xdg_activation_token_v1
296 #define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE_SINCE_VERSION 1
298 * @ingroup iface_xdg_activation_token_v1
300 #define XDG_ACTIVATION_TOKEN_V1_COMMIT_SINCE_VERSION 1
302 * @ingroup iface_xdg_activation_token_v1
304 #define XDG_ACTIVATION_TOKEN_V1_DESTROY_SINCE_VERSION 1
306 /** @ingroup iface_xdg_activation_token_v1 */
307 static inline void xdg_activation_token_v1_set_user_data(
308 struct xdg_activation_token_v1* xdg_activation_token_v1, void* user_data) {
309 wl_proxy_set_user_data((struct wl_proxy*)xdg_activation_token_v1, user_data);
312 /** @ingroup iface_xdg_activation_token_v1 */
313 static inline void* xdg_activation_token_v1_get_user_data(
314 struct xdg_activation_token_v1* xdg_activation_token_v1) {
315 return wl_proxy_get_user_data((struct wl_proxy*)xdg_activation_token_v1);
318 static inline uint32_t xdg_activation_token_v1_get_version(
319 struct xdg_activation_token_v1* xdg_activation_token_v1) {
320 return wl_proxy_get_version((struct wl_proxy*)xdg_activation_token_v1);
324 * @ingroup iface_xdg_activation_token_v1
326 * Provides information about the seat and serial event that requested the
327 * token.
329 * The serial can come from an input or focus event. For instance, if a
330 * click triggers the launch of a third-party client, the launcher client
331 * should send a set_serial request with the serial and seat from the
332 * wl_pointer.button event.
334 * Some compositors might refuse to activate toplevels when the token
335 * doesn't have a valid and recent enough event serial.
337 * Must be sent before commit. This information is optional.
339 static inline void xdg_activation_token_v1_set_serial(
340 struct xdg_activation_token_v1* xdg_activation_token_v1, uint32_t serial,
341 struct wl_seat* seat) {
342 wl_proxy_marshal((struct wl_proxy*)xdg_activation_token_v1,
343 XDG_ACTIVATION_TOKEN_V1_SET_SERIAL, serial, seat);
347 * @ingroup iface_xdg_activation_token_v1
349 * The requesting client can specify an app_id to associate the token
350 * being created with it.
352 * Must be sent before commit. This information is optional.
354 static inline void xdg_activation_token_v1_set_app_id(
355 struct xdg_activation_token_v1* xdg_activation_token_v1,
356 const char* app_id) {
357 wl_proxy_marshal((struct wl_proxy*)xdg_activation_token_v1,
358 XDG_ACTIVATION_TOKEN_V1_SET_APP_ID, app_id);
362 * @ingroup iface_xdg_activation_token_v1
364 * This request sets the surface requesting the activation. Note, this is
365 * different from the surface that will be activated.
367 * Some compositors might refuse to activate toplevels when the token
368 * doesn't have a requesting surface.
370 * Must be sent before commit. This information is optional.
372 static inline void xdg_activation_token_v1_set_surface(
373 struct xdg_activation_token_v1* xdg_activation_token_v1,
374 struct wl_surface* surface) {
375 wl_proxy_marshal((struct wl_proxy*)xdg_activation_token_v1,
376 XDG_ACTIVATION_TOKEN_V1_SET_SURFACE, surface);
380 * @ingroup iface_xdg_activation_token_v1
382 * Requests an activation token based on the different parameters that
383 * have been offered through set_serial, set_surface and set_app_id.
385 static inline void xdg_activation_token_v1_commit(
386 struct xdg_activation_token_v1* xdg_activation_token_v1) {
387 wl_proxy_marshal((struct wl_proxy*)xdg_activation_token_v1,
388 XDG_ACTIVATION_TOKEN_V1_COMMIT);
392 * @ingroup iface_xdg_activation_token_v1
394 * Notify the compositor that the xdg_activation_token_v1 object will no
395 * longer be used.
397 static inline void xdg_activation_token_v1_destroy(
398 struct xdg_activation_token_v1* xdg_activation_token_v1) {
399 wl_proxy_marshal((struct wl_proxy*)xdg_activation_token_v1,
400 XDG_ACTIVATION_TOKEN_V1_DESTROY);
402 wl_proxy_destroy((struct wl_proxy*)xdg_activation_token_v1);
405 #ifdef __cplusplus
407 #endif
409 #endif