wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/wayland-xdg-output-unstable-v1-client-protocol.h
raw symbols SCIP| 1 | /* Generated by wayland-scanner 1.16.0 */ |
| 2 | |
| 3 | #ifndef XDG_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H |
| 4 | #define XDG_OUTPUT_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_xdg_output_unstable_v1 The xdg_output_unstable_v1 protocol |
| 16 | * Protocol to describe output regions |
| 17 | * |
| 18 | * @section page_desc_xdg_output_unstable_v1 Description |
| 19 | * |
| 20 | * This protocol aims at describing outputs in a way which is more in line |
| 21 | * with the concept of an output on desktop oriented systems. |
| 22 | * |
| 23 | * Some information are more specific to the concept of an output for |
| 24 | * a desktop oriented system and may not make sense in other applications, |
| 25 | * such as IVI systems for example. |
| 26 | * |
| 27 | * Typically, the global compositor space on a desktop system is made of |
| 28 | * a contiguous or overlapping set of rectangular regions. |
| 29 | * |
| 30 | * Some of the information provided in this protocol might be identical |
| 31 | * to their counterparts already available from wl_output, in which case |
| 32 | * the information provided by this protocol should be preferred to their |
| 33 | * equivalent in wl_output. The goal is to move the desktop specific |
| 34 | * concepts (such as output location within the global compositor space, |
| 35 | * the connector name and types, etc.) out of the core wl_output protocol. |
| 36 | * |
| 37 | * Warning! The protocol described in this file is experimental and |
| 38 | * backward incompatible changes may be made. Backward compatible |
| 39 | * changes may be added together with the corresponding interface |
| 40 | * version bump. |
| 41 | * Backward incompatible changes are done by bumping the version |
| 42 | * number in the protocol and interface names and resetting the |
| 43 | * interface version. Once the protocol is to be declared stable, |
| 44 | * the 'z' prefix and the version number in the protocol and |
| 45 | * interface names are removed and the interface version number is |
| 46 | * reset. |
| 47 | * |
| 48 | * @section page_ifaces_xdg_output_unstable_v1 Interfaces |
| 49 | * - @subpage page_iface_zxdg_output_manager_v1 - manage xdg_output objects |
| 50 | * - @subpage page_iface_zxdg_output_v1 - compositor logical output region |
| 51 | * @section page_copyright_xdg_output_unstable_v1 Copyright |
| 52 | * <pre> |
| 53 | * |
| 54 | * Copyright © 2017 Red Hat Inc. |
| 55 | * |
| 56 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 57 | * copy of this software and associated documentation files (the "Software"), |
| 58 | * to deal in the Software without restriction, including without limitation |
| 59 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 60 | * and/or sell copies of the Software, and to permit persons to whom the |
| 61 | * Software is furnished to do so, subject to the following conditions: |
| 62 | * |
| 63 | * The above copyright notice and this permission notice (including the next |
| 64 | * paragraph) shall be included in all copies or substantial portions of the |
| 65 | * Software. |
| 66 | * |
| 67 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 68 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 69 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 70 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 71 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 72 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 73 | * DEALINGS IN THE SOFTWARE. |
| 74 | * </pre> |
| 75 | */ |
| 76 | struct wl_output; |
| 77 | struct zxdg_output_manager_v1; |
| 78 | struct zxdg_output_v1; |
| 79 | |
| 80 | /** |
| 81 | * @page page_iface_zxdg_output_manager_v1 zxdg_output_manager_v1 |
| 82 | * @section page_iface_zxdg_output_manager_v1_desc Description |
| 83 | * |
| 84 | * A global factory interface for xdg_output objects. |
| 85 | * @section page_iface_zxdg_output_manager_v1_api API |
| 86 | * See @ref iface_zxdg_output_manager_v1. |
| 87 | */ |
| 88 | /** |
| 89 | * @defgroup iface_zxdg_output_manager_v1 The zxdg_output_manager_v1 interface |
| 90 | * |
| 91 | * A global factory interface for xdg_output objects. |
| 92 | */ |
| 93 | extern const struct wl_interface zxdg_output_manager_v1_interface; |
| 94 | /** |
| 95 | * @page page_iface_zxdg_output_v1 zxdg_output_v1 |
| 96 | * @section page_iface_zxdg_output_v1_desc Description |
| 97 | * |
| 98 | * An xdg_output describes part of the compositor geometry. |
| 99 | * |
| 100 | * This typically corresponds to a monitor that displays part of the |
| 101 | * compositor space. |
| 102 | * @section page_iface_zxdg_output_v1_api API |
| 103 | * See @ref iface_zxdg_output_v1. |
| 104 | */ |
| 105 | /** |
| 106 | * @defgroup iface_zxdg_output_v1 The zxdg_output_v1 interface |
| 107 | * |
| 108 | * An xdg_output describes part of the compositor geometry. |
| 109 | * |
| 110 | * This typically corresponds to a monitor that displays part of the |
| 111 | * compositor space. |
| 112 | */ |
| 113 | extern const struct wl_interface zxdg_output_v1_interface; |
| 114 | |
| 115 | #define ZXDG_OUTPUT_MANAGER_V1_DESTROY 0 |
| 116 | #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT 1 |
| 117 | |
| 118 | |
| 119 | /** |
| 120 | * @ingroup iface_zxdg_output_manager_v1 |
| 121 | */ |
| 122 | #define ZXDG_OUTPUT_MANAGER_V1_DESTROY_SINCE_VERSION 1 |
| 123 | /** |
| 124 | * @ingroup iface_zxdg_output_manager_v1 |
| 125 | */ |
| 126 | #define ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT_SINCE_VERSION 1 |
| 127 | |
| 128 | /** @ingroup iface_zxdg_output_manager_v1 */ |
| 129 | static inline void |
| 130 | zxdg_output_manager_v1_set_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, void *user_data) |
| 131 | { |
| 132 | wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_manager_v1, user_data); |
| 133 | } |
| 134 | |
| 135 | /** @ingroup iface_zxdg_output_manager_v1 */ |
| 136 | static inline void * |
| 137 | zxdg_output_manager_v1_get_user_data(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) |
| 138 | { |
| 139 | return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_manager_v1); |
| 140 | } |
| 141 | |
| 142 | static inline uint32_t |
| 143 | zxdg_output_manager_v1_get_version(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) |
| 144 | { |
| 145 | return wl_proxy_get_version((struct wl_proxy *) zxdg_output_manager_v1); |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * @ingroup iface_zxdg_output_manager_v1 |
| 150 | * |
| 151 | * Using this request a client can tell the server that it is not |
| 152 | * going to use the xdg_output_manager object anymore. |
| 153 | * |
| 154 | * Any objects already created through this instance are not affected. |
| 155 | */ |
| 156 | static inline void |
| 157 | zxdg_output_manager_v1_destroy(struct zxdg_output_manager_v1 *zxdg_output_manager_v1) |
| 158 | { |
| 159 | wl_proxy_marshal((struct wl_proxy *) zxdg_output_manager_v1, |
| 160 | ZXDG_OUTPUT_MANAGER_V1_DESTROY); |
| 161 | |
| 162 | wl_proxy_destroy((struct wl_proxy *) zxdg_output_manager_v1); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @ingroup iface_zxdg_output_manager_v1 |
| 167 | * |
| 168 | * This creates a new xdg_output object for the given wl_output. |
| 169 | */ |
| 170 | static inline struct zxdg_output_v1 * |
| 171 | zxdg_output_manager_v1_get_xdg_output(struct zxdg_output_manager_v1 *zxdg_output_manager_v1, struct wl_output *output) |
| 172 | { |
| 173 | struct wl_proxy *id; |
| 174 | |
| 175 | id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_output_manager_v1, |
| 176 | ZXDG_OUTPUT_MANAGER_V1_GET_XDG_OUTPUT, &zxdg_output_v1_interface, NULL, output); |
| 177 | |
| 178 | return (struct zxdg_output_v1 *) id; |
| 179 | } |
| 180 | |
| 181 | /** |
| 182 | * @ingroup iface_zxdg_output_v1 |
| 183 | * @struct zxdg_output_v1_listener |
| 184 | */ |
| 185 | struct zxdg_output_v1_listener { |
| 186 | /** |
| 187 | * position of the output within the global compositor space |
| 188 | * |
| 189 | * The position event describes the location of the wl_output |
| 190 | * within the global compositor space. |
| 191 | * |
| 192 | * The logical_position event is sent after creating an xdg_output |
| 193 | * (see xdg_output_manager.get_xdg_output) and whenever the |
| 194 | * location of the output changes within the global compositor |
| 195 | * space. |
| 196 | * @param x x position within the global compositor space |
| 197 | * @param y y position within the global compositor space |
| 198 | */ |
| 199 | void (*logical_position)(void *data, |
| 200 | struct zxdg_output_v1 *zxdg_output_v1, |
| 201 | int32_t x, |
| 202 | int32_t y); |
| 203 | /** |
| 204 | * size of the output in the global compositor space |
| 205 | * |
| 206 | * The logical_size event describes the size of the output in the |
| 207 | * global compositor space. |
| 208 | * |
| 209 | * For example, a surface without any buffer scale, transformation |
| 210 | * nor rotation set, with the size matching the logical_size will |
| 211 | * have the same size as the corresponding output when displayed. |
| 212 | * |
| 213 | * Most regular Wayland clients should not pay attention to the |
| 214 | * logical size and would rather rely on xdg_shell interfaces. |
| 215 | * |
| 216 | * Some clients such as Xwayland, however, need this to configure |
| 217 | * their surfaces in the global compositor space as the compositor |
| 218 | * may apply a different scale from what is advertised by the |
| 219 | * output scaling property (to achieve fractional scaling, for |
| 220 | * example). |
| 221 | * |
| 222 | * For example, for a wl_output mode 3840×2160 and a scale factor |
| 223 | * 2: |
| 224 | * |
| 225 | * - A compositor not scaling the surface buffers will advertise a |
| 226 | * logical size of 3840×2160, |
| 227 | * |
| 228 | * - A compositor automatically scaling the surface buffers will |
| 229 | * advertise a logical size of 1920×1080, |
| 230 | * |
| 231 | * - A compositor using a fractional scale of 1.5 will advertise a |
| 232 | * logical size to 2560×1620. |
| 233 | * |
| 234 | * For example, for a wl_output mode 1920×1080 and a 90 degree |
| 235 | * rotation, the compositor will advertise a logical size of |
| 236 | * 1080x1920. |
| 237 | * |
| 238 | * The logical_size event is sent after creating an xdg_output (see |
| 239 | * xdg_output_manager.get_xdg_output) and whenever the logical size |
| 240 | * of the output changes, either as a result of a change in the |
| 241 | * applied scale or because of a change in the corresponding output |
| 242 | * mode(see wl_output.mode) or transform (see wl_output.transform). |
| 243 | * @param width width in global compositor space |
| 244 | * @param height height in global compositor space |
| 245 | */ |
| 246 | void (*logical_size)(void *data, |
| 247 | struct zxdg_output_v1 *zxdg_output_v1, |
| 248 | int32_t width, |
| 249 | int32_t height); |
| 250 | /** |
| 251 | * all information about the output have been sent |
| 252 | * |
| 253 | * This event is sent after all other properties of an xdg_output |
| 254 | * have been sent. |
| 255 | * |
| 256 | * This allows changes to the xdg_output properties to be seen as |
| 257 | * atomic, even if they happen via multiple events. |
| 258 | */ |
| 259 | void (*done)(void *data, |
| 260 | struct zxdg_output_v1 *zxdg_output_v1); |
| 261 | /** |
| 262 | * name of this output |
| 263 | * |
| 264 | * Many compositors will assign names to their outputs, show them |
| 265 | * to the user, allow them to be configured by name, etc. The |
| 266 | * client may wish to know this name as well to offer the user |
| 267 | * similar behaviors. |
| 268 | * |
| 269 | * The naming convention is compositor defined, but limited to |
| 270 | * alphanumeric characters and dashes (-). Each name is unique |
| 271 | * among all wl_output globals, but if a wl_output global is |
| 272 | * destroyed the same name may be reused later. The names will also |
| 273 | * remain consistent across sessions with the same hardware and |
| 274 | * software configuration. |
| 275 | * |
| 276 | * Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. |
| 277 | * However, do not assume that the name is a reflection of an |
| 278 | * underlying DRM connector, X11 connection, etc. |
| 279 | * |
| 280 | * The name event is sent after creating an xdg_output (see |
| 281 | * xdg_output_manager.get_xdg_output). This event is only sent once |
| 282 | * per xdg_output, and the name does not change over the lifetime |
| 283 | * of the wl_output global. |
| 284 | * @param name output name |
| 285 | * @since 2 |
| 286 | */ |
| 287 | void (*name)(void *data, |
| 288 | struct zxdg_output_v1 *zxdg_output_v1, |
| 289 | const char *name); |
| 290 | /** |
| 291 | * human-readable description of this output |
| 292 | * |
| 293 | * Many compositors can produce human-readable descriptions of |
| 294 | * their outputs. The client may wish to know this description as |
| 295 | * well, to communicate the user for various purposes. |
| 296 | * |
| 297 | * The description is a UTF-8 string with no convention defined for |
| 298 | * its contents. Examples might include 'Foocorp 11" Display' or |
| 299 | * 'Virtual X11 output via :1'. |
| 300 | * |
| 301 | * The description event is sent after creating an xdg_output (see |
| 302 | * xdg_output_manager.get_xdg_output). This event is only sent once |
| 303 | * per xdg_output, and the description does not change over the |
| 304 | * lifetime of the wl_output global. The description is optional, |
| 305 | * and may not be sent at all. |
| 306 | * @param description output description |
| 307 | * @since 2 |
| 308 | */ |
| 309 | void (*description)(void *data, |
| 310 | struct zxdg_output_v1 *zxdg_output_v1, |
| 311 | const char *description); |
| 312 | }; |
| 313 | |
| 314 | /** |
| 315 | * @ingroup iface_zxdg_output_v1 |
| 316 | */ |
| 317 | static inline int |
| 318 | zxdg_output_v1_add_listener(struct zxdg_output_v1 *zxdg_output_v1, |
| 319 | const struct zxdg_output_v1_listener *listener, void *data) |
| 320 | { |
| 321 | return wl_proxy_add_listener((struct wl_proxy *) zxdg_output_v1, |
| 322 | (void (**)(void)) listener, data); |
| 323 | } |
| 324 | |
| 325 | #define ZXDG_OUTPUT_V1_DESTROY 0 |
| 326 | |
| 327 | /** |
| 328 | * @ingroup iface_zxdg_output_v1 |
| 329 | */ |
| 330 | #define ZXDG_OUTPUT_V1_LOGICAL_POSITION_SINCE_VERSION 1 |
| 331 | /** |
| 332 | * @ingroup iface_zxdg_output_v1 |
| 333 | */ |
| 334 | #define ZXDG_OUTPUT_V1_LOGICAL_SIZE_SINCE_VERSION 1 |
| 335 | /** |
| 336 | * @ingroup iface_zxdg_output_v1 |
| 337 | */ |
| 338 | #define ZXDG_OUTPUT_V1_DONE_SINCE_VERSION 1 |
| 339 | /** |
| 340 | * @ingroup iface_zxdg_output_v1 |
| 341 | */ |
| 342 | #define ZXDG_OUTPUT_V1_NAME_SINCE_VERSION 2 |
| 343 | /** |
| 344 | * @ingroup iface_zxdg_output_v1 |
| 345 | */ |
| 346 | #define ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION 2 |
| 347 | |
| 348 | /** |
| 349 | * @ingroup iface_zxdg_output_v1 |
| 350 | */ |
| 351 | #define ZXDG_OUTPUT_V1_DESTROY_SINCE_VERSION 1 |
| 352 | |
| 353 | /** @ingroup iface_zxdg_output_v1 */ |
| 354 | static inline void |
| 355 | zxdg_output_v1_set_user_data(struct zxdg_output_v1 *zxdg_output_v1, void *user_data) |
| 356 | { |
| 357 | wl_proxy_set_user_data((struct wl_proxy *) zxdg_output_v1, user_data); |
| 358 | } |
| 359 | |
| 360 | /** @ingroup iface_zxdg_output_v1 */ |
| 361 | static inline void * |
| 362 | zxdg_output_v1_get_user_data(struct zxdg_output_v1 *zxdg_output_v1) |
| 363 | { |
| 364 | return wl_proxy_get_user_data((struct wl_proxy *) zxdg_output_v1); |
| 365 | } |
| 366 | |
| 367 | static inline uint32_t |
| 368 | zxdg_output_v1_get_version(struct zxdg_output_v1 *zxdg_output_v1) |
| 369 | { |
| 370 | return wl_proxy_get_version((struct wl_proxy *) zxdg_output_v1); |
| 371 | } |
| 372 | |
| 373 | /** |
| 374 | * @ingroup iface_zxdg_output_v1 |
| 375 | * |
| 376 | * Using this request a client can tell the server that it is not |
| 377 | * going to use the xdg_output object anymore. |
| 378 | */ |
| 379 | static inline void |
| 380 | zxdg_output_v1_destroy(struct zxdg_output_v1 *zxdg_output_v1) |
| 381 | { |
| 382 | wl_proxy_marshal((struct wl_proxy *) zxdg_output_v1, |
| 383 | ZXDG_OUTPUT_V1_DESTROY); |
| 384 | |
| 385 | wl_proxy_destroy((struct wl_proxy *) zxdg_output_v1); |
| 386 | } |
| 387 | |
| 388 | #ifdef __cplusplus |
| 389 | } |
| 390 | #endif |
| 391 | |
| 392 | #endif |