AtlatestRepositorysigil-ui
1
/* Generated by wayland-scanner 1.24.0 */3
#ifndef XDG_DECORATION_UNSTABLE_V1_CLIENT_PROTOCOL_H4
#define XDG_DECORATION_UNSTABLE_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_decoration_unstable_v1 The xdg_decoration_unstable_v1 protocol16
* @section page_ifaces_xdg_decoration_unstable_v1 Interfaces17
* - @subpage page_iface_zxdg_decoration_manager_v1 - window decoration manager18
* - @subpage page_iface_zxdg_toplevel_decoration_v1 - decoration object for a toplevel surface19
* @section page_copyright_xdg_decoration_unstable_v1 Copyright20
* <pre>21
*22
* Copyright © 2018 Simon Ser23
*24
* Permission is hereby granted, free of charge, to any person obtaining a25
* copy of this software and associated documentation files (the "Software"),26
* to deal in the Software without restriction, including without limitation27
* the rights to use, copy, modify, merge, publish, distribute, sublicense,28
* and/or sell copies of the Software, and to permit persons to whom the29
* Software is furnished to do so, subject to the following conditions:30
*31
* The above copyright notice and this permission notice (including the next32
* paragraph) shall be included in all copies or substantial portions of the33
* Software.34
*35
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR36
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,37
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL38
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER39
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING40
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER41
* DEALINGS IN THE SOFTWARE.42
* </pre>43
*/44
struct xdg_toplevel;45
struct zxdg_decoration_manager_v1;46
struct zxdg_toplevel_decoration_v1;48
#ifndef ZXDG_DECORATION_MANAGER_V1_INTERFACE49
#define ZXDG_DECORATION_MANAGER_V1_INTERFACE50
/**51
* @page page_iface_zxdg_decoration_manager_v1 zxdg_decoration_manager_v152
* @section page_iface_zxdg_decoration_manager_v1_desc Description53
*54
* This interface allows a compositor to announce support for server-side55
* decorations.56
*57
* A window decoration is a set of window controls as deemed appropriate by58
* the party managing them, such as user interface components used to move,59
* resize and change a window's state.60
*61
* A client can use this protocol to request being decorated by a supporting62
* compositor.63
*64
* If compositor and client do not negotiate the use of a server-side65
* decoration using this protocol, clients continue to self-decorate as they66
* see fit.67
*68
* Warning! The protocol described in this file is experimental and69
* backward incompatible changes may be made. Backward compatible changes70
* may be added together with the corresponding interface version bump.71
* Backward incompatible changes are done by bumping the version number in72
* the protocol and interface names and resetting the interface version.73
* Once the protocol is to be declared stable, the 'z' prefix and the74
* version number in the protocol and interface names are removed and the75
* interface version number is reset.76
* @section page_iface_zxdg_decoration_manager_v1_api API77
* See @ref iface_zxdg_decoration_manager_v1.78
*/79
/**80
* @defgroup iface_zxdg_decoration_manager_v1 The zxdg_decoration_manager_v1 interface81
*82
* This interface allows a compositor to announce support for server-side83
* decorations.84
*85
* A window decoration is a set of window controls as deemed appropriate by86
* the party managing them, such as user interface components used to move,87
* resize and change a window's state.88
*89
* A client can use this protocol to request being decorated by a supporting90
* compositor.91
*92
* If compositor and client do not negotiate the use of a server-side93
* decoration using this protocol, clients continue to self-decorate as they94
* see fit.95
*96
* Warning! The protocol described in this file is experimental and97
* backward incompatible changes may be made. Backward compatible changes98
* may be added together with the corresponding interface version bump.99
* Backward incompatible changes are done by bumping the version number in100
* the protocol and interface names and resetting the interface version.101
* Once the protocol is to be declared stable, the 'z' prefix and the102
* version number in the protocol and interface names are removed and the103
* interface version number is reset.104
*/105
extern const struct wl_interface zxdg_decoration_manager_v1_interface;106
#endif107
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE108
#define ZXDG_TOPLEVEL_DECORATION_V1_INTERFACE109
/**110
* @page page_iface_zxdg_toplevel_decoration_v1 zxdg_toplevel_decoration_v1111
* @section page_iface_zxdg_toplevel_decoration_v1_desc Description112
*113
* The decoration object allows the compositor to toggle server-side window114
* decorations for a toplevel surface. The client can request to switch to115
* another mode.116
*117
* The xdg_toplevel_decoration object must be destroyed before its118
* xdg_toplevel.119
* @section page_iface_zxdg_toplevel_decoration_v1_api API120
* See @ref iface_zxdg_toplevel_decoration_v1.121
*/122
/**123
* @defgroup iface_zxdg_toplevel_decoration_v1 The zxdg_toplevel_decoration_v1 interface124
*125
* The decoration object allows the compositor to toggle server-side window126
* decorations for a toplevel surface. The client can request to switch to127
* another mode.128
*129
* The xdg_toplevel_decoration object must be destroyed before its130
* xdg_toplevel.131
*/132
extern const struct wl_interface zxdg_toplevel_decoration_v1_interface;133
#endif135
#define ZXDG_DECORATION_MANAGER_V1_DESTROY 0136
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION 1139
/**140
* @ingroup iface_zxdg_decoration_manager_v1141
*/142
#define ZXDG_DECORATION_MANAGER_V1_DESTROY_SINCE_VERSION 1143
/**144
* @ingroup iface_zxdg_decoration_manager_v1145
*/146
#define ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION_SINCE_VERSION 1148
/** @ingroup iface_zxdg_decoration_manager_v1 */149
static inline void150
zxdg_decoration_manager_v1_set_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, void *user_data)151
{152
wl_proxy_set_user_data((struct wl_proxy *) zxdg_decoration_manager_v1, user_data);153
}155
/** @ingroup iface_zxdg_decoration_manager_v1 */156
static inline void *157
zxdg_decoration_manager_v1_get_user_data(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)158
{159
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_decoration_manager_v1);160
}162
static inline uint32_t163
zxdg_decoration_manager_v1_get_version(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)164
{165
return wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1);166
}168
/**169
* @ingroup iface_zxdg_decoration_manager_v1170
*171
* Destroy the decoration manager. This doesn't destroy objects created172
* with the manager.173
*/174
static inline void175
zxdg_decoration_manager_v1_destroy(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1)176
{177
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,178
ZXDG_DECORATION_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), WL_MARSHAL_FLAG_DESTROY);179
}181
/**182
* @ingroup iface_zxdg_decoration_manager_v1183
*184
* Create a new decoration object associated with the given toplevel.185
*186
* Creating an xdg_toplevel_decoration from an xdg_toplevel which has a187
* buffer attached or committed is a client error, and any attempts by a188
* client to attach or manipulate a buffer prior to the first189
* xdg_toplevel_decoration.configure event must also be treated as190
* errors.191
*/192
static inline struct zxdg_toplevel_decoration_v1 *193
zxdg_decoration_manager_v1_get_toplevel_decoration(struct zxdg_decoration_manager_v1 *zxdg_decoration_manager_v1, struct xdg_toplevel *toplevel)194
{195
struct wl_proxy *id;197
id = wl_proxy_marshal_flags((struct wl_proxy *) zxdg_decoration_manager_v1,198
ZXDG_DECORATION_MANAGER_V1_GET_TOPLEVEL_DECORATION, &zxdg_toplevel_decoration_v1_interface, wl_proxy_get_version((struct wl_proxy *) zxdg_decoration_manager_v1), 0, NULL, toplevel);200
return (struct zxdg_toplevel_decoration_v1 *) id;201
}203
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM204
#define ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM205
enum zxdg_toplevel_decoration_v1_error {206
/**207
* xdg_toplevel has a buffer attached before configure208
*/209
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_UNCONFIGURED_BUFFER = 0,210
/**211
* xdg_toplevel already has a decoration object212
*/213
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ALREADY_CONSTRUCTED = 1,214
/**215
* xdg_toplevel destroyed before the decoration object216
*/217
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ORPHANED = 2,218
/**219
* invalid mode220
*/221
ZXDG_TOPLEVEL_DECORATION_V1_ERROR_INVALID_MODE = 3,222
};223
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_ERROR_ENUM */225
#ifndef ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM226
#define ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM227
/**228
* @ingroup iface_zxdg_toplevel_decoration_v1229
* window decoration modes230
*231
* These values describe window decoration modes.232
*/233
enum zxdg_toplevel_decoration_v1_mode {234
/**235
* no server-side window decoration236
*/237
ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,238
/**239
* server-side window decoration240
*/241
ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,242
};243
#endif /* ZXDG_TOPLEVEL_DECORATION_V1_MODE_ENUM */245
/**246
* @ingroup iface_zxdg_toplevel_decoration_v1247
* @struct zxdg_toplevel_decoration_v1_listener248
*/249
struct zxdg_toplevel_decoration_v1_listener {250
/**251
* notify a decoration mode change252
*253
* The configure event configures the effective decoration mode.254
* The configured state should not be applied immediately. Clients255
* must send an ack_configure in response to this event. See256
* xdg_surface.configure and xdg_surface.ack_configure for details.257
*258
* A configure event can be sent at any time. The specified mode259
* must be obeyed by the client.260
* @param mode the decoration mode261
*/262
void (*configure)(void *data,263
struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,264
uint32_t mode);265
};267
/**268
* @ingroup iface_zxdg_toplevel_decoration_v1269
*/270
static inline int271
zxdg_toplevel_decoration_v1_add_listener(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1,272
const struct zxdg_toplevel_decoration_v1_listener *listener, void *data)273
{274
return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_decoration_v1,275
(void (**)(void)) listener, data);276
}278
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY 0279
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE 1280
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE 2282
/**283
* @ingroup iface_zxdg_toplevel_decoration_v1284
*/285
#define ZXDG_TOPLEVEL_DECORATION_V1_CONFIGURE_SINCE_VERSION 1287
/**288
* @ingroup iface_zxdg_toplevel_decoration_v1289
*/290
#define ZXDG_TOPLEVEL_DECORATION_V1_DESTROY_SINCE_VERSION 1291
/**292
* @ingroup iface_zxdg_toplevel_decoration_v1293
*/294
#define ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE_SINCE_VERSION 1295
/**296
* @ingroup iface_zxdg_toplevel_decoration_v1297
*/298
#define ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE_SINCE_VERSION 1300
/** @ingroup iface_zxdg_toplevel_decoration_v1 */301
static inline void302
zxdg_toplevel_decoration_v1_set_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, void *user_data)303
{304
wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1, user_data);305
}307
/** @ingroup iface_zxdg_toplevel_decoration_v1 */308
static inline void *309
zxdg_toplevel_decoration_v1_get_user_data(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)310
{311
return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_decoration_v1);312
}314
static inline uint32_t315
zxdg_toplevel_decoration_v1_get_version(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)316
{317
return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1);318
}320
/**321
* @ingroup iface_zxdg_toplevel_decoration_v1322
*323
* Switch back to a mode without any server-side decorations at the next324
* commit.325
*/326
static inline void327
zxdg_toplevel_decoration_v1_destroy(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)328
{329
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,330
ZXDG_TOPLEVEL_DECORATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), WL_MARSHAL_FLAG_DESTROY);331
}333
/**334
* @ingroup iface_zxdg_toplevel_decoration_v1335
*336
* Set the toplevel surface decoration mode. This informs the compositor337
* that the client prefers the provided decoration mode.338
*339
* After requesting a decoration mode, the compositor will respond by340
* emitting an xdg_surface.configure event. The client should then update341
* its content, drawing it without decorations if the received mode is342
* server-side decorations. The client must also acknowledge the configure343
* when committing the new content (see xdg_surface.ack_configure).344
*345
* The compositor can decide not to use the client's mode and enforce a346
* different mode instead.347
*348
* Clients whose decoration mode depend on the xdg_toplevel state may send349
* a set_mode request in response to an xdg_surface.configure event and wait350
* for the next xdg_surface.configure event to prevent unwanted state.351
* Such clients are responsible for preventing configure loops and must352
* make sure not to send multiple successive set_mode requests with the353
* same decoration mode.354
*355
* If an invalid mode is supplied by the client, the invalid_mode protocol356
* error is raised by the compositor.357
*/358
static inline void359
zxdg_toplevel_decoration_v1_set_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1, uint32_t mode)360
{361
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,362
ZXDG_TOPLEVEL_DECORATION_V1_SET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0, mode);363
}365
/**366
* @ingroup iface_zxdg_toplevel_decoration_v1367
*368
* Unset the toplevel surface decoration mode. This informs the compositor369
* that the client doesn't prefer a particular decoration mode.370
*371
* This request has the same semantics as set_mode.372
*/373
static inline void374
zxdg_toplevel_decoration_v1_unset_mode(struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1)375
{376
wl_proxy_marshal_flags((struct wl_proxy *) zxdg_toplevel_decoration_v1,377
ZXDG_TOPLEVEL_DECORATION_V1_UNSET_MODE, NULL, wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_decoration_v1), 0);378
}380
#ifdef __cplusplus381
}382
#endif384
#endif