AtlatestRepositorysigil-ui
1
/* Generated by wayland-scanner 1.24.0 */3
#ifndef XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H4
#define XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H6
#include <stdint.h>7
#include <stddef.h>8
#include "wayland-client.h"10
#ifdef __cplusplus11
extern "C" {12
#endif14
/**15
* @page page_xdg_activation_v1 The xdg_activation_v1 protocol16
* Protocol for requesting activation of surfaces17
*18
* @section page_desc_xdg_activation_v1 Description19
*20
* The way for a client to pass focus to another toplevel is as follows.21
*22
* The client that intends to activate another toplevel uses the23
* 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 activate25
* one of its surfaces, through a separate band of communication.26
*27
* One established way of doing this is through the XDG_ACTIVATION_TOKEN28
* environment variable of a newly launched child process. The child process29
* should unset the environment variable again right after reading it out in30
* order to avoid propagating it to other child processes.31
*32
* Another established way exists for Applications implementing the D-Bus33
* interface org.freedesktop.Application, which should get their token under34
* activation-token on their platform_data.35
*36
* In general activation tokens may be transferred across clients through37
* means not described in this protocol.38
*39
* The client to be activated will then pass the token40
* it received to the xdg_activation_v1.activate request. The compositor can41
* then use this token to decide how to react to the activation request.42
*43
* The token the activating client gets may be ineffective either already at44
* the time it receives it, for example if it was not focused, for focus45
* stealing prevention. The activating client will have no way to discover46
* the validity of the token, and may still forward it to the to be activated47
* client.48
*49
* The created activation token may optionally get information attached to it50
* that can be used by the compositor to identify the application that we51
* intend to activate. This can for example be used to display a visual hint52
* about what application is being started.53
*54
* Warning! The protocol described in this file is currently in the testing55
* phase. Backward compatible changes may be added together with the56
* corresponding interface version bump. Backward incompatible changes can57
* only be done by creating a new major version of the extension.58
*59
* @section page_ifaces_xdg_activation_v1 Interfaces60
* - @subpage page_iface_xdg_activation_v1 - interface for activating surfaces61
* - @subpage page_iface_xdg_activation_token_v1 - an exported activation handle62
* @section page_copyright_xdg_activation_v1 Copyright63
* <pre>64
*65
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>66
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>67
*68
* Permission is hereby granted, free of charge, to any person obtaining a69
* copy of this software and associated documentation files (the "Software"),70
* to deal in the Software without restriction, including without limitation71
* the rights to use, copy, modify, merge, publish, distribute, sublicense,72
* and/or sell copies of the Software, and to permit persons to whom the73
* Software is furnished to do so, subject to the following conditions:74
*75
* The above copyright notice and this permission notice (including the next76
* paragraph) shall be included in all copies or substantial portions of the77
* Software.78
*79
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR80
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,81
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL82
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER83
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING84
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER85
* DEALINGS IN THE SOFTWARE.86
* </pre>87
*/88
struct wl_seat;89
struct wl_surface;90
struct xdg_activation_token_v1;91
struct xdg_activation_v1;93
#ifndef XDG_ACTIVATION_V1_INTERFACE94
#define XDG_ACTIVATION_V1_INTERFACE95
/**96
* @page page_iface_xdg_activation_v1 xdg_activation_v197
* @section page_iface_xdg_activation_v1_desc Description98
*99
* A global interface used for informing the compositor about applications100
* being activated or started, or for applications to request to be101
* activated.102
* @section page_iface_xdg_activation_v1_api API103
* See @ref iface_xdg_activation_v1.104
*/105
/**106
* @defgroup iface_xdg_activation_v1 The xdg_activation_v1 interface107
*108
* A global interface used for informing the compositor about applications109
* being activated or started, or for applications to request to be110
* activated.111
*/112
extern const struct wl_interface xdg_activation_v1_interface;113
#endif114
#ifndef XDG_ACTIVATION_TOKEN_V1_INTERFACE115
#define XDG_ACTIVATION_TOKEN_V1_INTERFACE116
/**117
* @page page_iface_xdg_activation_token_v1 xdg_activation_token_v1118
* @section page_iface_xdg_activation_token_v1_desc Description119
*120
* An object for setting up a token and receiving a token handle that can121
* be passed as an activation token to another client.122
*123
* The object is created using the xdg_activation_v1.get_activation_token124
* request. This object should then be populated with the app_id, surface125
* and serial information and committed. The compositor shall then issue a126
* 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 API129
* See @ref iface_xdg_activation_token_v1.130
*/131
/**132
* @defgroup iface_xdg_activation_token_v1 The xdg_activation_token_v1 interface133
*134
* An object for setting up a token and receiving a token handle that can135
* be passed as an activation token to another client.136
*137
* The object is created using the xdg_activation_v1.get_activation_token138
* request. This object should then be populated with the app_id, surface139
* and serial information and committed. The compositor shall then issue a140
* done event with the token. In case the request's parameters are invalid,141
* the compositor will provide an invalid token.142
*/143
extern const struct wl_interface xdg_activation_token_v1_interface;144
#endif146
#define XDG_ACTIVATION_V1_DESTROY 0147
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN 1148
#define XDG_ACTIVATION_V1_ACTIVATE 2151
/**152
* @ingroup iface_xdg_activation_v1153
*/154
#define XDG_ACTIVATION_V1_DESTROY_SINCE_VERSION 1155
/**156
* @ingroup iface_xdg_activation_v1157
*/158
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN_SINCE_VERSION 1159
/**160
* @ingroup iface_xdg_activation_v1161
*/162
#define XDG_ACTIVATION_V1_ACTIVATE_SINCE_VERSION 1164
/** @ingroup iface_xdg_activation_v1 */165
static inline void166
xdg_activation_v1_set_user_data(struct xdg_activation_v1 *xdg_activation_v1, void *user_data)167
{168
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_v1, user_data);169
}171
/** @ingroup iface_xdg_activation_v1 */172
static inline void *173
xdg_activation_v1_get_user_data(struct xdg_activation_v1 *xdg_activation_v1)174
{175
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_v1);176
}178
static inline uint32_t179
xdg_activation_v1_get_version(struct xdg_activation_v1 *xdg_activation_v1)180
{181
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1);182
}184
/**185
* @ingroup iface_xdg_activation_v1186
*187
* Notify the compositor that the xdg_activation object will no longer be188
* used.189
*190
* The child objects created via this interface are unaffected and should191
* be destroyed separately.192
*/193
static inline void194
xdg_activation_v1_destroy(struct xdg_activation_v1 *xdg_activation_v1)195
{196
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,197
XDG_ACTIVATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), WL_MARSHAL_FLAG_DESTROY);198
}200
/**201
* @ingroup iface_xdg_activation_v1202
*203
* Creates an xdg_activation_token_v1 object that will provide204
* the initiating client with a unique token for this activation. This205
* token should be offered to the clients to be activated.206
*/207
static inline struct xdg_activation_token_v1 *208
xdg_activation_v1_get_activation_token(struct xdg_activation_v1 *xdg_activation_v1)209
{210
struct wl_proxy *id;212
id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,213
XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN, &xdg_activation_token_v1_interface, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), 0, NULL);215
return (struct xdg_activation_token_v1 *) id;216
}218
/**219
* @ingroup iface_xdg_activation_v1220
*221
* Requests surface activation. It's up to the compositor to display222
* this information as desired, for example by placing the surface above223
* the rest.224
*225
* The compositor may know who requested this by checking the activation226
* token and might decide not to follow through with the activation if it's227
* considered unwanted.228
*229
* Compositors can ignore unknown activation tokens when an invalid230
* token is passed.231
*/232
static inline void233
xdg_activation_v1_activate(struct xdg_activation_v1 *xdg_activation_v1, const char *token, struct wl_surface *surface)234
{235
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_v1,236
XDG_ACTIVATION_V1_ACTIVATE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1), 0, token, surface);237
}239
#ifndef XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM240
#define XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM241
enum xdg_activation_token_v1_error {242
/**243
* The token has already been used previously244
*/245
XDG_ACTIVATION_TOKEN_V1_ERROR_ALREADY_USED = 0,246
};247
#endif /* XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM */249
/**250
* @ingroup iface_xdg_activation_token_v1251
* @struct xdg_activation_token_v1_listener252
*/253
struct xdg_activation_token_v1_listener {254
/**255
* the exported activation token256
*257
* The 'done' event contains the unique token of this activation258
* request and notifies that the provider is done.259
* @param token the exported activation token260
*/261
void (*done)(void *data,262
struct xdg_activation_token_v1 *xdg_activation_token_v1,263
const char *token);264
};266
/**267
* @ingroup iface_xdg_activation_token_v1268
*/269
static inline int270
xdg_activation_token_v1_add_listener(struct xdg_activation_token_v1 *xdg_activation_token_v1,271
const struct xdg_activation_token_v1_listener *listener, void *data)272
{273
return wl_proxy_add_listener((struct wl_proxy *) xdg_activation_token_v1,274
(void (**)(void)) listener, data);275
}277
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL 0278
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID 1279
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE 2280
#define XDG_ACTIVATION_TOKEN_V1_COMMIT 3281
#define XDG_ACTIVATION_TOKEN_V1_DESTROY 4283
/**284
* @ingroup iface_xdg_activation_token_v1285
*/286
#define XDG_ACTIVATION_TOKEN_V1_DONE_SINCE_VERSION 1288
/**289
* @ingroup iface_xdg_activation_token_v1290
*/291
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL_SINCE_VERSION 1292
/**293
* @ingroup iface_xdg_activation_token_v1294
*/295
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID_SINCE_VERSION 1296
/**297
* @ingroup iface_xdg_activation_token_v1298
*/299
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE_SINCE_VERSION 1300
/**301
* @ingroup iface_xdg_activation_token_v1302
*/303
#define XDG_ACTIVATION_TOKEN_V1_COMMIT_SINCE_VERSION 1304
/**305
* @ingroup iface_xdg_activation_token_v1306
*/307
#define XDG_ACTIVATION_TOKEN_V1_DESTROY_SINCE_VERSION 1309
/** @ingroup iface_xdg_activation_token_v1 */310
static inline void311
xdg_activation_token_v1_set_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1, void *user_data)312
{313
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_token_v1, user_data);314
}316
/** @ingroup iface_xdg_activation_token_v1 */317
static inline void *318
xdg_activation_token_v1_get_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1)319
{320
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_token_v1);321
}323
static inline uint32_t324
xdg_activation_token_v1_get_version(struct xdg_activation_token_v1 *xdg_activation_token_v1)325
{326
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1);327
}329
/**330
* @ingroup iface_xdg_activation_token_v1331
*332
* Provides information about the seat and serial event that requested the333
* token.334
*335
* The serial can come from an input or focus event. For instance, if a336
* click triggers the launch of a third-party client, the launcher client337
* should send a set_serial request with the serial and seat from the338
* wl_pointer.button event.339
*340
* Some compositors might refuse to activate toplevels when the token341
* doesn't have a valid and recent enough event serial.342
*343
* Must be sent before commit. This information is optional.344
*/345
static inline void346
xdg_activation_token_v1_set_serial(struct xdg_activation_token_v1 *xdg_activation_token_v1, uint32_t serial, struct wl_seat *seat)347
{348
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,349
XDG_ACTIVATION_TOKEN_V1_SET_SERIAL, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, serial, seat);350
}352
/**353
* @ingroup iface_xdg_activation_token_v1354
*355
* The requesting client can specify an app_id to associate the token356
* being created with it.357
*358
* Must be sent before commit. This information is optional.359
*/360
static inline void361
xdg_activation_token_v1_set_app_id(struct xdg_activation_token_v1 *xdg_activation_token_v1, const char *app_id)362
{363
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,364
XDG_ACTIVATION_TOKEN_V1_SET_APP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, app_id);365
}367
/**368
* @ingroup iface_xdg_activation_token_v1369
*370
* This request sets the surface requesting the activation. Note, this is371
* different from the surface that will be activated.372
*373
* Some compositors might refuse to activate toplevels when the token374
* doesn't have a requesting surface.375
*376
* Must be sent before commit. This information is optional.377
*/378
static inline void379
xdg_activation_token_v1_set_surface(struct xdg_activation_token_v1 *xdg_activation_token_v1, struct wl_surface *surface)380
{381
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,382
XDG_ACTIVATION_TOKEN_V1_SET_SURFACE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0, surface);383
}385
/**386
* @ingroup iface_xdg_activation_token_v1387
*388
* Requests an activation token based on the different parameters that389
* have been offered through set_serial, set_surface and set_app_id.390
*/391
static inline void392
xdg_activation_token_v1_commit(struct xdg_activation_token_v1 *xdg_activation_token_v1)393
{394
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,395
XDG_ACTIVATION_TOKEN_V1_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), 0);396
}398
/**399
* @ingroup iface_xdg_activation_token_v1400
*401
* Notify the compositor that the xdg_activation_token_v1 object will no402
* longer be used. The received token stays valid.403
*/404
static inline void405
xdg_activation_token_v1_destroy(struct xdg_activation_token_v1 *xdg_activation_token_v1)406
{407
wl_proxy_marshal_flags((struct wl_proxy *) xdg_activation_token_v1,408
XDG_ACTIVATION_TOKEN_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1), WL_MARSHAL_FLAG_DESTROY);409
}411
#ifdef __cplusplus412
}413
#endif415
#endif