| 1 | /* Generated by wayland-scanner 1.16.0 */ |
| 2 | |
| 3 | #ifndef WAYLAND_SERVER_PROTOCOL_H |
| 4 | #define WAYLAND_SERVER_PROTOCOL_H |
| 5 | |
| 6 | #include <stdint.h> |
| 7 | #include <stddef.h> |
| 8 | #include "wayland-server.h" |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | struct wl_client; |
| 15 | struct wl_resource; |
| 16 | |
| 17 | /** |
| 18 | * @page page_wayland The wayland protocol |
| 19 | * @section page_ifaces_wayland Interfaces |
| 20 | * - @subpage page_iface_wl_display - core global object |
| 21 | * - @subpage page_iface_wl_registry - global registry object |
| 22 | * - @subpage page_iface_wl_callback - callback object |
| 23 | * - @subpage page_iface_wl_compositor - the compositor singleton |
| 24 | * - @subpage page_iface_wl_shm_pool - a shared memory pool |
| 25 | * - @subpage page_iface_wl_shm - shared memory support |
| 26 | * - @subpage page_iface_wl_buffer - content for a wl_surface |
| 27 | * - @subpage page_iface_wl_data_offer - offer to transfer data |
| 28 | * - @subpage page_iface_wl_data_source - offer to transfer data |
| 29 | * - @subpage page_iface_wl_data_device - data transfer device |
| 30 | * - @subpage page_iface_wl_data_device_manager - data transfer interface |
| 31 | * - @subpage page_iface_wl_shell - create desktop-style surfaces |
| 32 | * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface |
| 33 | * - @subpage page_iface_wl_surface - an onscreen surface |
| 34 | * - @subpage page_iface_wl_seat - group of input devices |
| 35 | * - @subpage page_iface_wl_pointer - pointer input device |
| 36 | * - @subpage page_iface_wl_keyboard - keyboard input device |
| 37 | * - @subpage page_iface_wl_touch - touchscreen input device |
| 38 | * - @subpage page_iface_wl_output - compositor output region |
| 39 | * - @subpage page_iface_wl_region - region interface |
| 40 | * - @subpage page_iface_wl_subcompositor - sub-surface compositing |
| 41 | * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface |
| 42 | * @section page_copyright_wayland Copyright |
| 43 | * <pre> |
| 44 | * |
| 45 | * Copyright © 2008-2011 Kristian Høgsberg |
| 46 | * Copyright © 2010-2011 Intel Corporation |
| 47 | * Copyright © 2012-2013 Collabora, Ltd. |
| 48 | * |
| 49 | * Permission is hereby granted, free of charge, to any person |
| 50 | * obtaining a copy of this software and associated documentation files |
| 51 | * (the "Software"), to deal in the Software without restriction, |
| 52 | * including without limitation the rights to use, copy, modify, merge, |
| 53 | * publish, distribute, sublicense, and/or sell copies of the Software, |
| 54 | * and to permit persons to whom the Software is furnished to do so, |
| 55 | * subject to the following conditions: |
| 56 | * |
| 57 | * The above copyright notice and this permission notice (including the |
| 58 | * next paragraph) shall be included in all copies or substantial |
| 59 | * portions of the Software. |
| 60 | * |
| 61 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 62 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 63 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 64 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 65 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 66 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 67 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 68 | * SOFTWARE. |
| 69 | * </pre> |
| 70 | */ |
| 71 | struct wl_buffer; |
| 72 | struct wl_callback; |
| 73 | struct wl_compositor; |
| 74 | struct wl_data_device; |
| 75 | struct wl_data_device_manager; |
| 76 | struct wl_data_offer; |
| 77 | struct wl_data_source; |
| 78 | struct wl_display; |
| 79 | struct wl_keyboard; |
| 80 | struct wl_output; |
| 81 | struct wl_pointer; |
| 82 | struct wl_region; |
| 83 | struct wl_registry; |
| 84 | struct wl_seat; |
| 85 | struct wl_shell; |
| 86 | struct wl_shell_surface; |
| 87 | struct wl_shm; |
| 88 | struct wl_shm_pool; |
| 89 | struct wl_subcompositor; |
| 90 | struct wl_subsurface; |
| 91 | struct wl_surface; |
| 92 | struct wl_touch; |
| 93 | |
| 94 | /** |
| 95 | * @page page_iface_wl_display wl_display |
| 96 | * @section page_iface_wl_display_desc Description |
| 97 | * |
| 98 | * The core global object. This is a special singleton object. It |
| 99 | * is used for internal Wayland protocol features. |
| 100 | * @section page_iface_wl_display_api API |
| 101 | * See @ref iface_wl_display. |
| 102 | */ |
| 103 | /** |
| 104 | * @defgroup iface_wl_display The wl_display interface |
| 105 | * |
| 106 | * The core global object. This is a special singleton object. It |
| 107 | * is used for internal Wayland protocol features. |
| 108 | */ |
| 109 | extern const struct wl_interface wl_display_interface; |
| 110 | /** |
| 111 | * @page page_iface_wl_registry wl_registry |
| 112 | * @section page_iface_wl_registry_desc Description |
| 113 | * |
| 114 | * The singleton global registry object. The server has a number of |
| 115 | * global objects that are available to all clients. These objects |
| 116 | * typically represent an actual object in the server (for example, |
| 117 | * an input device) or they are singleton objects that provide |
| 118 | * extension functionality. |
| 119 | * |
| 120 | * When a client creates a registry object, the registry object |
| 121 | * will emit a global event for each global currently in the |
| 122 | * registry. Globals come and go as a result of device or |
| 123 | * monitor hotplugs, reconfiguration or other events, and the |
| 124 | * registry will send out global and global_remove events to |
| 125 | * keep the client up to date with the changes. To mark the end |
| 126 | * of the initial burst of events, the client can use the |
| 127 | * wl_display.sync request immediately after calling |
| 128 | * wl_display.get_registry. |
| 129 | * |
| 130 | * A client can bind to a global object by using the bind |
| 131 | * request. This creates a client-side handle that lets the object |
| 132 | * emit events to the client and lets the client invoke requests on |
| 133 | * the object. |
| 134 | * @section page_iface_wl_registry_api API |
| 135 | * See @ref iface_wl_registry. |
| 136 | */ |
| 137 | /** |
| 138 | * @defgroup iface_wl_registry The wl_registry interface |
| 139 | * |
| 140 | * The singleton global registry object. The server has a number of |
| 141 | * global objects that are available to all clients. These objects |
| 142 | * typically represent an actual object in the server (for example, |
| 143 | * an input device) or they are singleton objects that provide |
| 144 | * extension functionality. |
| 145 | * |
| 146 | * When a client creates a registry object, the registry object |
| 147 | * will emit a global event for each global currently in the |
| 148 | * registry. Globals come and go as a result of device or |
| 149 | * monitor hotplugs, reconfiguration or other events, and the |
| 150 | * registry will send out global and global_remove events to |
| 151 | * keep the client up to date with the changes. To mark the end |
| 152 | * of the initial burst of events, the client can use the |
| 153 | * wl_display.sync request immediately after calling |
| 154 | * wl_display.get_registry. |
| 155 | * |
| 156 | * A client can bind to a global object by using the bind |
| 157 | * request. This creates a client-side handle that lets the object |
| 158 | * emit events to the client and lets the client invoke requests on |
| 159 | * the object. |
| 160 | */ |
| 161 | extern const struct wl_interface wl_registry_interface; |
| 162 | /** |
| 163 | * @page page_iface_wl_callback wl_callback |
| 164 | * @section page_iface_wl_callback_desc Description |
| 165 | * |
| 166 | * Clients can handle the 'done' event to get notified when |
| 167 | * the related request is done. |
| 168 | * @section page_iface_wl_callback_api API |
| 169 | * See @ref iface_wl_callback. |
| 170 | */ |
| 171 | /** |
| 172 | * @defgroup iface_wl_callback The wl_callback interface |
| 173 | * |
| 174 | * Clients can handle the 'done' event to get notified when |
| 175 | * the related request is done. |
| 176 | */ |
| 177 | extern const struct wl_interface wl_callback_interface; |
| 178 | /** |
| 179 | * @page page_iface_wl_compositor wl_compositor |
| 180 | * @section page_iface_wl_compositor_desc Description |
| 181 | * |
| 182 | * A compositor. This object is a singleton global. The |
| 183 | * compositor is in charge of combining the contents of multiple |
| 184 | * surfaces into one displayable output. |
| 185 | * @section page_iface_wl_compositor_api API |
| 186 | * See @ref iface_wl_compositor. |
| 187 | */ |
| 188 | /** |
| 189 | * @defgroup iface_wl_compositor The wl_compositor interface |
| 190 | * |
| 191 | * A compositor. This object is a singleton global. The |
| 192 | * compositor is in charge of combining the contents of multiple |
| 193 | * surfaces into one displayable output. |
| 194 | */ |
| 195 | extern const struct wl_interface wl_compositor_interface; |
| 196 | /** |
| 197 | * @page page_iface_wl_shm_pool wl_shm_pool |
| 198 | * @section page_iface_wl_shm_pool_desc Description |
| 199 | * |
| 200 | * The wl_shm_pool object encapsulates a piece of memory shared |
| 201 | * between the compositor and client. Through the wl_shm_pool |
| 202 | * object, the client can allocate shared memory wl_buffer objects. |
| 203 | * All objects created through the same pool share the same |
| 204 | * underlying mapped memory. Reusing the mapped memory avoids the |
| 205 | * setup/teardown overhead and is useful when interactively resizing |
| 206 | * a surface or for many small buffers. |
| 207 | * @section page_iface_wl_shm_pool_api API |
| 208 | * See @ref iface_wl_shm_pool. |
| 209 | */ |
| 210 | /** |
| 211 | * @defgroup iface_wl_shm_pool The wl_shm_pool interface |
| 212 | * |
| 213 | * The wl_shm_pool object encapsulates a piece of memory shared |
| 214 | * between the compositor and client. Through the wl_shm_pool |
| 215 | * object, the client can allocate shared memory wl_buffer objects. |
| 216 | * All objects created through the same pool share the same |
| 217 | * underlying mapped memory. Reusing the mapped memory avoids the |
| 218 | * setup/teardown overhead and is useful when interactively resizing |
| 219 | * a surface or for many small buffers. |
| 220 | */ |
| 221 | extern const struct wl_interface wl_shm_pool_interface; |
| 222 | /** |
| 223 | * @page page_iface_wl_shm wl_shm |
| 224 | * @section page_iface_wl_shm_desc Description |
| 225 | * |
| 226 | * A singleton global object that provides support for shared |
| 227 | * memory. |
| 228 | * |
| 229 | * Clients can create wl_shm_pool objects using the create_pool |
| 230 | * request. |
| 231 | * |
| 232 | * At connection setup time, the wl_shm object emits one or more |
| 233 | * format events to inform clients about the valid pixel formats |
| 234 | * that can be used for buffers. |
| 235 | * @section page_iface_wl_shm_api API |
| 236 | * See @ref iface_wl_shm. |
| 237 | */ |
| 238 | /** |
| 239 | * @defgroup iface_wl_shm The wl_shm interface |
| 240 | * |
| 241 | * A singleton global object that provides support for shared |
| 242 | * memory. |
| 243 | * |
| 244 | * Clients can create wl_shm_pool objects using the create_pool |
| 245 | * request. |
| 246 | * |
| 247 | * At connection setup time, the wl_shm object emits one or more |
| 248 | * format events to inform clients about the valid pixel formats |
| 249 | * that can be used for buffers. |
| 250 | */ |
| 251 | extern const struct wl_interface wl_shm_interface; |
| 252 | /** |
| 253 | * @page page_iface_wl_buffer wl_buffer |
| 254 | * @section page_iface_wl_buffer_desc Description |
| 255 | * |
| 256 | * A buffer provides the content for a wl_surface. Buffers are |
| 257 | * created through factory interfaces such as wl_drm, wl_shm or |
| 258 | * similar. It has a width and a height and can be attached to a |
| 259 | * wl_surface, but the mechanism by which a client provides and |
| 260 | * updates the contents is defined by the buffer factory interface. |
| 261 | * @section page_iface_wl_buffer_api API |
| 262 | * See @ref iface_wl_buffer. |
| 263 | */ |
| 264 | /** |
| 265 | * @defgroup iface_wl_buffer The wl_buffer interface |
| 266 | * |
| 267 | * A buffer provides the content for a wl_surface. Buffers are |
| 268 | * created through factory interfaces such as wl_drm, wl_shm or |
| 269 | * similar. It has a width and a height and can be attached to a |
| 270 | * wl_surface, but the mechanism by which a client provides and |
| 271 | * updates the contents is defined by the buffer factory interface. |
| 272 | */ |
| 273 | extern const struct wl_interface wl_buffer_interface; |
| 274 | /** |
| 275 | * @page page_iface_wl_data_offer wl_data_offer |
| 276 | * @section page_iface_wl_data_offer_desc Description |
| 277 | * |
| 278 | * A wl_data_offer represents a piece of data offered for transfer |
| 279 | * by another client (the source client). It is used by the |
| 280 | * copy-and-paste and drag-and-drop mechanisms. The offer |
| 281 | * describes the different mime types that the data can be |
| 282 | * converted to and provides the mechanism for transferring the |
| 283 | * data directly from the source client. |
| 284 | * @section page_iface_wl_data_offer_api API |
| 285 | * See @ref iface_wl_data_offer. |
| 286 | */ |
| 287 | /** |
| 288 | * @defgroup iface_wl_data_offer The wl_data_offer interface |
| 289 | * |
| 290 | * A wl_data_offer represents a piece of data offered for transfer |
| 291 | * by another client (the source client). It is used by the |
| 292 | * copy-and-paste and drag-and-drop mechanisms. The offer |
| 293 | * describes the different mime types that the data can be |
| 294 | * converted to and provides the mechanism for transferring the |
| 295 | * data directly from the source client. |
| 296 | */ |
| 297 | extern const struct wl_interface wl_data_offer_interface; |
| 298 | /** |
| 299 | * @page page_iface_wl_data_source wl_data_source |
| 300 | * @section page_iface_wl_data_source_desc Description |
| 301 | * |
| 302 | * The wl_data_source object is the source side of a wl_data_offer. |
| 303 | * It is created by the source client in a data transfer and |
| 304 | * provides a way to describe the offered data and a way to respond |
| 305 | * to requests to transfer the data. |
| 306 | * @section page_iface_wl_data_source_api API |
| 307 | * See @ref iface_wl_data_source. |
| 308 | */ |
| 309 | /** |
| 310 | * @defgroup iface_wl_data_source The wl_data_source interface |
| 311 | * |
| 312 | * The wl_data_source object is the source side of a wl_data_offer. |
| 313 | * It is created by the source client in a data transfer and |
| 314 | * provides a way to describe the offered data and a way to respond |
| 315 | * to requests to transfer the data. |
| 316 | */ |
| 317 | extern const struct wl_interface wl_data_source_interface; |
| 318 | /** |
| 319 | * @page page_iface_wl_data_device wl_data_device |
| 320 | * @section page_iface_wl_data_device_desc Description |
| 321 | * |
| 322 | * There is one wl_data_device per seat which can be obtained |
| 323 | * from the global wl_data_device_manager singleton. |
| 324 | * |
| 325 | * A wl_data_device provides access to inter-client data transfer |
| 326 | * mechanisms such as copy-and-paste and drag-and-drop. |
| 327 | * @section page_iface_wl_data_device_api API |
| 328 | * See @ref iface_wl_data_device. |
| 329 | */ |
| 330 | /** |
| 331 | * @defgroup iface_wl_data_device The wl_data_device interface |
| 332 | * |
| 333 | * There is one wl_data_device per seat which can be obtained |
| 334 | * from the global wl_data_device_manager singleton. |
| 335 | * |
| 336 | * A wl_data_device provides access to inter-client data transfer |
| 337 | * mechanisms such as copy-and-paste and drag-and-drop. |
| 338 | */ |
| 339 | extern const struct wl_interface wl_data_device_interface; |
| 340 | /** |
| 341 | * @page page_iface_wl_data_device_manager wl_data_device_manager |
| 342 | * @section page_iface_wl_data_device_manager_desc Description |
| 343 | * |
| 344 | * The wl_data_device_manager is a singleton global object that |
| 345 | * provides access to inter-client data transfer mechanisms such as |
| 346 | * copy-and-paste and drag-and-drop. These mechanisms are tied to |
| 347 | * a wl_seat and this interface lets a client get a wl_data_device |
| 348 | * corresponding to a wl_seat. |
| 349 | * |
| 350 | * Depending on the version bound, the objects created from the bound |
| 351 | * wl_data_device_manager object will have different requirements for |
| 352 | * functioning properly. See wl_data_source.set_actions, |
| 353 | * wl_data_offer.accept and wl_data_offer.finish for details. |
| 354 | * @section page_iface_wl_data_device_manager_api API |
| 355 | * See @ref iface_wl_data_device_manager. |
| 356 | */ |
| 357 | /** |
| 358 | * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface |
| 359 | * |
| 360 | * The wl_data_device_manager is a singleton global object that |
| 361 | * provides access to inter-client data transfer mechanisms such as |
| 362 | * copy-and-paste and drag-and-drop. These mechanisms are tied to |
| 363 | * a wl_seat and this interface lets a client get a wl_data_device |
| 364 | * corresponding to a wl_seat. |
| 365 | * |
| 366 | * Depending on the version bound, the objects created from the bound |
| 367 | * wl_data_device_manager object will have different requirements for |
| 368 | * functioning properly. See wl_data_source.set_actions, |
| 369 | * wl_data_offer.accept and wl_data_offer.finish for details. |
| 370 | */ |
| 371 | extern const struct wl_interface wl_data_device_manager_interface; |
| 372 | /** |
| 373 | * @page page_iface_wl_shell wl_shell |
| 374 | * @section page_iface_wl_shell_desc Description |
| 375 | * |
| 376 | * This interface is implemented by servers that provide |
| 377 | * desktop-style user interfaces. |
| 378 | * |
| 379 | * It allows clients to associate a wl_shell_surface with |
| 380 | * a basic surface. |
| 381 | * |
| 382 | * Note! This protocol is deprecated and not intended for production use. |
| 383 | * For desktop-style user interfaces, use xdg_shell. |
| 384 | * @section page_iface_wl_shell_api API |
| 385 | * See @ref iface_wl_shell. |
| 386 | */ |
| 387 | /** |
| 388 | * @defgroup iface_wl_shell The wl_shell interface |
| 389 | * |
| 390 | * This interface is implemented by servers that provide |
| 391 | * desktop-style user interfaces. |
| 392 | * |
| 393 | * It allows clients to associate a wl_shell_surface with |
| 394 | * a basic surface. |
| 395 | * |
| 396 | * Note! This protocol is deprecated and not intended for production use. |
| 397 | * For desktop-style user interfaces, use xdg_shell. |
| 398 | */ |
| 399 | extern const struct wl_interface wl_shell_interface; |
| 400 | /** |
| 401 | * @page page_iface_wl_shell_surface wl_shell_surface |
| 402 | * @section page_iface_wl_shell_surface_desc Description |
| 403 | * |
| 404 | * An interface that may be implemented by a wl_surface, for |
| 405 | * implementations that provide a desktop-style user interface. |
| 406 | * |
| 407 | * It provides requests to treat surfaces like toplevel, fullscreen |
| 408 | * or popup windows, move, resize or maximize them, associate |
| 409 | * metadata like title and class, etc. |
| 410 | * |
| 411 | * On the server side the object is automatically destroyed when |
| 412 | * the related wl_surface is destroyed. On the client side, |
| 413 | * wl_shell_surface_destroy() must be called before destroying |
| 414 | * the wl_surface object. |
| 415 | * @section page_iface_wl_shell_surface_api API |
| 416 | * See @ref iface_wl_shell_surface. |
| 417 | */ |
| 418 | /** |
| 419 | * @defgroup iface_wl_shell_surface The wl_shell_surface interface |
| 420 | * |
| 421 | * An interface that may be implemented by a wl_surface, for |
| 422 | * implementations that provide a desktop-style user interface. |
| 423 | * |
| 424 | * It provides requests to treat surfaces like toplevel, fullscreen |
| 425 | * or popup windows, move, resize or maximize them, associate |
| 426 | * metadata like title and class, etc. |
| 427 | * |
| 428 | * On the server side the object is automatically destroyed when |
| 429 | * the related wl_surface is destroyed. On the client side, |
| 430 | * wl_shell_surface_destroy() must be called before destroying |
| 431 | * the wl_surface object. |
| 432 | */ |
| 433 | extern const struct wl_interface wl_shell_surface_interface; |
| 434 | /** |
| 435 | * @page page_iface_wl_surface wl_surface |
| 436 | * @section page_iface_wl_surface_desc Description |
| 437 | * |
| 438 | * A surface is a rectangular area that is displayed on the screen. |
| 439 | * It has a location, size and pixel contents. |
| 440 | * |
| 441 | * The size of a surface (and relative positions on it) is described |
| 442 | * in surface-local coordinates, which may differ from the buffer |
| 443 | * coordinates of the pixel content, in case a buffer_transform |
| 444 | * or a buffer_scale is used. |
| 445 | * |
| 446 | * A surface without a "role" is fairly useless: a compositor does |
| 447 | * not know where, when or how to present it. The role is the |
| 448 | * purpose of a wl_surface. Examples of roles are a cursor for a |
| 449 | * pointer (as set by wl_pointer.set_cursor), a drag icon |
| 450 | * (wl_data_device.start_drag), a sub-surface |
| 451 | * (wl_subcompositor.get_subsurface), and a window as defined by a |
| 452 | * shell protocol (e.g. wl_shell.get_shell_surface). |
| 453 | * |
| 454 | * A surface can have only one role at a time. Initially a |
| 455 | * wl_surface does not have a role. Once a wl_surface is given a |
| 456 | * role, it is set permanently for the whole lifetime of the |
| 457 | * wl_surface object. Giving the current role again is allowed, |
| 458 | * unless explicitly forbidden by the relevant interface |
| 459 | * specification. |
| 460 | * |
| 461 | * Surface roles are given by requests in other interfaces such as |
| 462 | * wl_pointer.set_cursor. The request should explicitly mention |
| 463 | * that this request gives a role to a wl_surface. Often, this |
| 464 | * request also creates a new protocol object that represents the |
| 465 | * role and adds additional functionality to wl_surface. When a |
| 466 | * client wants to destroy a wl_surface, they must destroy this 'role |
| 467 | * object' before the wl_surface. |
| 468 | * |
| 469 | * Destroying the role object does not remove the role from the |
| 470 | * wl_surface, but it may stop the wl_surface from "playing the role". |
| 471 | * For instance, if a wl_subsurface object is destroyed, the wl_surface |
| 472 | * it was created for will be unmapped and forget its position and |
| 473 | * z-order. It is allowed to create a wl_subsurface for the same |
| 474 | * wl_surface again, but it is not allowed to use the wl_surface as |
| 475 | * a cursor (cursor is a different role than sub-surface, and role |
| 476 | * switching is not allowed). |
| 477 | * @section page_iface_wl_surface_api API |
| 478 | * See @ref iface_wl_surface. |
| 479 | */ |
| 480 | /** |
| 481 | * @defgroup iface_wl_surface The wl_surface interface |
| 482 | * |
| 483 | * A surface is a rectangular area that is displayed on the screen. |
| 484 | * It has a location, size and pixel contents. |
| 485 | * |
| 486 | * The size of a surface (and relative positions on it) is described |
| 487 | * in surface-local coordinates, which may differ from the buffer |
| 488 | * coordinates of the pixel content, in case a buffer_transform |
| 489 | * or a buffer_scale is used. |
| 490 | * |
| 491 | * A surface without a "role" is fairly useless: a compositor does |
| 492 | * not know where, when or how to present it. The role is the |
| 493 | * purpose of a wl_surface. Examples of roles are a cursor for a |
| 494 | * pointer (as set by wl_pointer.set_cursor), a drag icon |
| 495 | * (wl_data_device.start_drag), a sub-surface |
| 496 | * (wl_subcompositor.get_subsurface), and a window as defined by a |
| 497 | * shell protocol (e.g. wl_shell.get_shell_surface). |
| 498 | * |
| 499 | * A surface can have only one role at a time. Initially a |
| 500 | * wl_surface does not have a role. Once a wl_surface is given a |
| 501 | * role, it is set permanently for the whole lifetime of the |
| 502 | * wl_surface object. Giving the current role again is allowed, |
| 503 | * unless explicitly forbidden by the relevant interface |
| 504 | * specification. |
| 505 | * |
| 506 | * Surface roles are given by requests in other interfaces such as |
| 507 | * wl_pointer.set_cursor. The request should explicitly mention |
| 508 | * that this request gives a role to a wl_surface. Often, this |
| 509 | * request also creates a new protocol object that represents the |
| 510 | * role and adds additional functionality to wl_surface. When a |
| 511 | * client wants to destroy a wl_surface, they must destroy this 'role |
| 512 | * object' before the wl_surface. |
| 513 | * |
| 514 | * Destroying the role object does not remove the role from the |
| 515 | * wl_surface, but it may stop the wl_surface from "playing the role". |
| 516 | * For instance, if a wl_subsurface object is destroyed, the wl_surface |
| 517 | * it was created for will be unmapped and forget its position and |
| 518 | * z-order. It is allowed to create a wl_subsurface for the same |
| 519 | * wl_surface again, but it is not allowed to use the wl_surface as |
| 520 | * a cursor (cursor is a different role than sub-surface, and role |
| 521 | * switching is not allowed). |
| 522 | */ |
| 523 | extern const struct wl_interface wl_surface_interface; |
| 524 | /** |
| 525 | * @page page_iface_wl_seat wl_seat |
| 526 | * @section page_iface_wl_seat_desc Description |
| 527 | * |
| 528 | * A seat is a group of keyboards, pointer and touch devices. This |
| 529 | * object is published as a global during start up, or when such a |
| 530 | * device is hot plugged. A seat typically has a pointer and |
| 531 | * maintains a keyboard focus and a pointer focus. |
| 532 | * @section page_iface_wl_seat_api API |
| 533 | * See @ref iface_wl_seat. |
| 534 | */ |
| 535 | /** |
| 536 | * @defgroup iface_wl_seat The wl_seat interface |
| 537 | * |
| 538 | * A seat is a group of keyboards, pointer and touch devices. This |
| 539 | * object is published as a global during start up, or when such a |
| 540 | * device is hot plugged. A seat typically has a pointer and |
| 541 | * maintains a keyboard focus and a pointer focus. |
| 542 | */ |
| 543 | extern const struct wl_interface wl_seat_interface; |
| 544 | /** |
| 545 | * @page page_iface_wl_pointer wl_pointer |
| 546 | * @section page_iface_wl_pointer_desc Description |
| 547 | * |
| 548 | * The wl_pointer interface represents one or more input devices, |
| 549 | * such as mice, which control the pointer location and pointer_focus |
| 550 | * of a seat. |
| 551 | * |
| 552 | * The wl_pointer interface generates motion, enter and leave |
| 553 | * events for the surfaces that the pointer is located over, |
| 554 | * and button and axis events for button presses, button releases |
| 555 | * and scrolling. |
| 556 | * @section page_iface_wl_pointer_api API |
| 557 | * See @ref iface_wl_pointer. |
| 558 | */ |
| 559 | /** |
| 560 | * @defgroup iface_wl_pointer The wl_pointer interface |
| 561 | * |
| 562 | * The wl_pointer interface represents one or more input devices, |
| 563 | * such as mice, which control the pointer location and pointer_focus |
| 564 | * of a seat. |
| 565 | * |
| 566 | * The wl_pointer interface generates motion, enter and leave |
| 567 | * events for the surfaces that the pointer is located over, |
| 568 | * and button and axis events for button presses, button releases |
| 569 | * and scrolling. |
| 570 | */ |
| 571 | extern const struct wl_interface wl_pointer_interface; |
| 572 | /** |
| 573 | * @page page_iface_wl_keyboard wl_keyboard |
| 574 | * @section page_iface_wl_keyboard_desc Description |
| 575 | * |
| 576 | * The wl_keyboard interface represents one or more keyboards |
| 577 | * associated with a seat. |
| 578 | * @section page_iface_wl_keyboard_api API |
| 579 | * See @ref iface_wl_keyboard. |
| 580 | */ |
| 581 | /** |
| 582 | * @defgroup iface_wl_keyboard The wl_keyboard interface |
| 583 | * |
| 584 | * The wl_keyboard interface represents one or more keyboards |
| 585 | * associated with a seat. |
| 586 | */ |
| 587 | extern const struct wl_interface wl_keyboard_interface; |
| 588 | /** |
| 589 | * @page page_iface_wl_touch wl_touch |
| 590 | * @section page_iface_wl_touch_desc Description |
| 591 | * |
| 592 | * The wl_touch interface represents a touchscreen |
| 593 | * associated with a seat. |
| 594 | * |
| 595 | * Touch interactions can consist of one or more contacts. |
| 596 | * For each contact, a series of events is generated, starting |
| 597 | * with a down event, followed by zero or more motion events, |
| 598 | * and ending with an up event. Events relating to the same |
| 599 | * contact point can be identified by the ID of the sequence. |
| 600 | * @section page_iface_wl_touch_api API |
| 601 | * See @ref iface_wl_touch. |
| 602 | */ |
| 603 | /** |
| 604 | * @defgroup iface_wl_touch The wl_touch interface |
| 605 | * |
| 606 | * The wl_touch interface represents a touchscreen |
| 607 | * associated with a seat. |
| 608 | * |
| 609 | * Touch interactions can consist of one or more contacts. |
| 610 | * For each contact, a series of events is generated, starting |
| 611 | * with a down event, followed by zero or more motion events, |
| 612 | * and ending with an up event. Events relating to the same |
| 613 | * contact point can be identified by the ID of the sequence. |
| 614 | */ |
| 615 | extern const struct wl_interface wl_touch_interface; |
| 616 | /** |
| 617 | * @page page_iface_wl_output wl_output |
| 618 | * @section page_iface_wl_output_desc Description |
| 619 | * |
| 620 | * An output describes part of the compositor geometry. The |
| 621 | * compositor works in the 'compositor coordinate system' and an |
| 622 | * output corresponds to a rectangular area in that space that is |
| 623 | * actually visible. This typically corresponds to a monitor that |
| 624 | * displays part of the compositor space. This object is published |
| 625 | * as global during start up, or when a monitor is hotplugged. |
| 626 | * @section page_iface_wl_output_api API |
| 627 | * See @ref iface_wl_output. |
| 628 | */ |
| 629 | /** |
| 630 | * @defgroup iface_wl_output The wl_output interface |
| 631 | * |
| 632 | * An output describes part of the compositor geometry. The |
| 633 | * compositor works in the 'compositor coordinate system' and an |
| 634 | * output corresponds to a rectangular area in that space that is |
| 635 | * actually visible. This typically corresponds to a monitor that |
| 636 | * displays part of the compositor space. This object is published |
| 637 | * as global during start up, or when a monitor is hotplugged. |
| 638 | */ |
| 639 | extern const struct wl_interface wl_output_interface; |
| 640 | /** |
| 641 | * @page page_iface_wl_region wl_region |
| 642 | * @section page_iface_wl_region_desc Description |
| 643 | * |
| 644 | * A region object describes an area. |
| 645 | * |
| 646 | * Region objects are used to describe the opaque and input |
| 647 | * regions of a surface. |
| 648 | * @section page_iface_wl_region_api API |
| 649 | * See @ref iface_wl_region. |
| 650 | */ |
| 651 | /** |
| 652 | * @defgroup iface_wl_region The wl_region interface |
| 653 | * |
| 654 | * A region object describes an area. |
| 655 | * |
| 656 | * Region objects are used to describe the opaque and input |
| 657 | * regions of a surface. |
| 658 | */ |
| 659 | extern const struct wl_interface wl_region_interface; |
| 660 | /** |
| 661 | * @page page_iface_wl_subcompositor wl_subcompositor |
| 662 | * @section page_iface_wl_subcompositor_desc Description |
| 663 | * |
| 664 | * The global interface exposing sub-surface compositing capabilities. |
| 665 | * A wl_surface, that has sub-surfaces associated, is called the |
| 666 | * parent surface. Sub-surfaces can be arbitrarily nested and create |
| 667 | * a tree of sub-surfaces. |
| 668 | * |
| 669 | * The root surface in a tree of sub-surfaces is the main |
| 670 | * surface. The main surface cannot be a sub-surface, because |
| 671 | * sub-surfaces must always have a parent. |
| 672 | * |
| 673 | * A main surface with its sub-surfaces forms a (compound) window. |
| 674 | * For window management purposes, this set of wl_surface objects is |
| 675 | * to be considered as a single window, and it should also behave as |
| 676 | * such. |
| 677 | * |
| 678 | * The aim of sub-surfaces is to offload some of the compositing work |
| 679 | * within a window from clients to the compositor. A prime example is |
| 680 | * a video player with decorations and video in separate wl_surface |
| 681 | * objects. This should allow the compositor to pass YUV video buffer |
| 682 | * processing to dedicated overlay hardware when possible. |
| 683 | * @section page_iface_wl_subcompositor_api API |
| 684 | * See @ref iface_wl_subcompositor. |
| 685 | */ |
| 686 | /** |
| 687 | * @defgroup iface_wl_subcompositor The wl_subcompositor interface |
| 688 | * |
| 689 | * The global interface exposing sub-surface compositing capabilities. |
| 690 | * A wl_surface, that has sub-surfaces associated, is called the |
| 691 | * parent surface. Sub-surfaces can be arbitrarily nested and create |
| 692 | * a tree of sub-surfaces. |
| 693 | * |
| 694 | * The root surface in a tree of sub-surfaces is the main |
| 695 | * surface. The main surface cannot be a sub-surface, because |
| 696 | * sub-surfaces must always have a parent. |
| 697 | * |
| 698 | * A main surface with its sub-surfaces forms a (compound) window. |
| 699 | * For window management purposes, this set of wl_surface objects is |
| 700 | * to be considered as a single window, and it should also behave as |
| 701 | * such. |
| 702 | * |
| 703 | * The aim of sub-surfaces is to offload some of the compositing work |
| 704 | * within a window from clients to the compositor. A prime example is |
| 705 | * a video player with decorations and video in separate wl_surface |
| 706 | * objects. This should allow the compositor to pass YUV video buffer |
| 707 | * processing to dedicated overlay hardware when possible. |
| 708 | */ |
| 709 | extern const struct wl_interface wl_subcompositor_interface; |
| 710 | /** |
| 711 | * @page page_iface_wl_subsurface wl_subsurface |
| 712 | * @section page_iface_wl_subsurface_desc Description |
| 713 | * |
| 714 | * An additional interface to a wl_surface object, which has been |
| 715 | * made a sub-surface. A sub-surface has one parent surface. A |
| 716 | * sub-surface's size and position are not limited to that of the parent. |
| 717 | * Particularly, a sub-surface is not automatically clipped to its |
| 718 | * parent's area. |
| 719 | * |
| 720 | * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied |
| 721 | * and the parent surface is mapped. The order of which one happens |
| 722 | * first is irrelevant. A sub-surface is hidden if the parent becomes |
| 723 | * hidden, or if a NULL wl_buffer is applied. These rules apply |
| 724 | * recursively through the tree of surfaces. |
| 725 | * |
| 726 | * The behaviour of a wl_surface.commit request on a sub-surface |
| 727 | * depends on the sub-surface's mode. The possible modes are |
| 728 | * synchronized and desynchronized, see methods |
| 729 | * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized |
| 730 | * mode caches the wl_surface state to be applied when the parent's |
| 731 | * state gets applied, and desynchronized mode applies the pending |
| 732 | * wl_surface state directly. A sub-surface is initially in the |
| 733 | * synchronized mode. |
| 734 | * |
| 735 | * Sub-surfaces have also other kind of state, which is managed by |
| 736 | * wl_subsurface requests, as opposed to wl_surface requests. This |
| 737 | * state includes the sub-surface position relative to the parent |
| 738 | * surface (wl_subsurface.set_position), and the stacking order of |
| 739 | * the parent and its sub-surfaces (wl_subsurface.place_above and |
| 740 | * .place_below). This state is applied when the parent surface's |
| 741 | * wl_surface state is applied, regardless of the sub-surface's mode. |
| 742 | * As the exception, set_sync and set_desync are effective immediately. |
| 743 | * |
| 744 | * The main surface can be thought to be always in desynchronized mode, |
| 745 | * since it does not have a parent in the sub-surfaces sense. |
| 746 | * |
| 747 | * Even if a sub-surface is in desynchronized mode, it will behave as |
| 748 | * in synchronized mode, if its parent surface behaves as in |
| 749 | * synchronized mode. This rule is applied recursively throughout the |
| 750 | * tree of surfaces. This means, that one can set a sub-surface into |
| 751 | * synchronized mode, and then assume that all its child and grand-child |
| 752 | * sub-surfaces are synchronized, too, without explicitly setting them. |
| 753 | * |
| 754 | * If the wl_surface associated with the wl_subsurface is destroyed, the |
| 755 | * wl_subsurface object becomes inert. Note, that destroying either object |
| 756 | * takes effect immediately. If you need to synchronize the removal |
| 757 | * of a sub-surface to the parent surface update, unmap the sub-surface |
| 758 | * first by attaching a NULL wl_buffer, update parent, and then destroy |
| 759 | * the sub-surface. |
| 760 | * |
| 761 | * If the parent wl_surface object is destroyed, the sub-surface is |
| 762 | * unmapped. |
| 763 | * @section page_iface_wl_subsurface_api API |
| 764 | * See @ref iface_wl_subsurface. |
| 765 | */ |
| 766 | /** |
| 767 | * @defgroup iface_wl_subsurface The wl_subsurface interface |
| 768 | * |
| 769 | * An additional interface to a wl_surface object, which has been |
| 770 | * made a sub-surface. A sub-surface has one parent surface. A |
| 771 | * sub-surface's size and position are not limited to that of the parent. |
| 772 | * Particularly, a sub-surface is not automatically clipped to its |
| 773 | * parent's area. |
| 774 | * |
| 775 | * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied |
| 776 | * and the parent surface is mapped. The order of which one happens |
| 777 | * first is irrelevant. A sub-surface is hidden if the parent becomes |
| 778 | * hidden, or if a NULL wl_buffer is applied. These rules apply |
| 779 | * recursively through the tree of surfaces. |
| 780 | * |
| 781 | * The behaviour of a wl_surface.commit request on a sub-surface |
| 782 | * depends on the sub-surface's mode. The possible modes are |
| 783 | * synchronized and desynchronized, see methods |
| 784 | * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized |
| 785 | * mode caches the wl_surface state to be applied when the parent's |
| 786 | * state gets applied, and desynchronized mode applies the pending |
| 787 | * wl_surface state directly. A sub-surface is initially in the |
| 788 | * synchronized mode. |
| 789 | * |
| 790 | * Sub-surfaces have also other kind of state, which is managed by |
| 791 | * wl_subsurface requests, as opposed to wl_surface requests. This |
| 792 | * state includes the sub-surface position relative to the parent |
| 793 | * surface (wl_subsurface.set_position), and the stacking order of |
| 794 | * the parent and its sub-surfaces (wl_subsurface.place_above and |
| 795 | * .place_below). This state is applied when the parent surface's |
| 796 | * wl_surface state is applied, regardless of the sub-surface's mode. |
| 797 | * As the exception, set_sync and set_desync are effective immediately. |
| 798 | * |
| 799 | * The main surface can be thought to be always in desynchronized mode, |
| 800 | * since it does not have a parent in the sub-surfaces sense. |
| 801 | * |
| 802 | * Even if a sub-surface is in desynchronized mode, it will behave as |
| 803 | * in synchronized mode, if its parent surface behaves as in |
| 804 | * synchronized mode. This rule is applied recursively throughout the |
| 805 | * tree of surfaces. This means, that one can set a sub-surface into |
| 806 | * synchronized mode, and then assume that all its child and grand-child |
| 807 | * sub-surfaces are synchronized, too, without explicitly setting them. |
| 808 | * |
| 809 | * If the wl_surface associated with the wl_subsurface is destroyed, the |
| 810 | * wl_subsurface object becomes inert. Note, that destroying either object |
| 811 | * takes effect immediately. If you need to synchronize the removal |
| 812 | * of a sub-surface to the parent surface update, unmap the sub-surface |
| 813 | * first by attaching a NULL wl_buffer, update parent, and then destroy |
| 814 | * the sub-surface. |
| 815 | * |
| 816 | * If the parent wl_surface object is destroyed, the sub-surface is |
| 817 | * unmapped. |
| 818 | */ |
| 819 | extern const struct wl_interface wl_subsurface_interface; |
| 820 | |
| 821 | #ifndef WL_DISPLAY_ERROR_ENUM |
| 822 | #define WL_DISPLAY_ERROR_ENUM |
| 823 | /** |
| 824 | * @ingroup iface_wl_display |
| 825 | * global error values |
| 826 | * |
| 827 | * These errors are global and can be emitted in response to any |
| 828 | * server request. |
| 829 | */ |
| 830 | enum wl_display_error { |
| 831 | /** |
| 832 | * server couldn't find object |
| 833 | */ |
| 834 | WL_DISPLAY_ERROR_INVALID_OBJECT = 0, |
| 835 | /** |
| 836 | * method doesn't exist on the specified interface |
| 837 | */ |
| 838 | WL_DISPLAY_ERROR_INVALID_METHOD = 1, |
| 839 | /** |
| 840 | * server is out of memory |
| 841 | */ |
| 842 | WL_DISPLAY_ERROR_NO_MEMORY = 2, |
| 843 | }; |
| 844 | #endif /* WL_DISPLAY_ERROR_ENUM */ |
| 845 | |
| 846 | /** |
| 847 | * @ingroup iface_wl_display |
| 848 | * @struct wl_display_interface |
| 849 | */ |
| 850 | struct wl_display_interface { |
| 851 | /** |
| 852 | * asynchronous roundtrip |
| 853 | * |
| 854 | * The sync request asks the server to emit the 'done' event on |
| 855 | * the returned wl_callback object. Since requests are handled |
| 856 | * in-order and events are delivered in-order, this can be used as |
| 857 | * a barrier to ensure all previous requests and the resulting |
| 858 | * events have been handled. |
| 859 | * |
| 860 | * The object returned by this request will be destroyed by the |
| 861 | * compositor after the callback is fired and as such the client |
| 862 | * must not attempt to use it after that point. |
| 863 | * |
| 864 | * The callback_data passed in the callback is the event serial. |
| 865 | * @param callback callback object for the sync request |
| 866 | */ |
| 867 | void (*sync)(struct wl_client *client, |
| 868 | struct wl_resource *resource, |
| 869 | uint32_t callback); |
| 870 | /** |
| 871 | * get global registry object |
| 872 | * |
| 873 | * This request creates a registry object that allows the client |
| 874 | * to list and bind the global objects available from the |
| 875 | * compositor. |
| 876 | * |
| 877 | * It should be noted that the server side resources consumed in |
| 878 | * response to a get_registry request can only be released when the |
| 879 | * client disconnects, not when the client side proxy is destroyed. |
| 880 | * Therefore, clients should invoke get_registry as infrequently as |
| 881 | * possible to avoid wasting memory. |
| 882 | * @param registry global registry object |
| 883 | */ |
| 884 | void (*get_registry)(struct wl_client *client, |
| 885 | struct wl_resource *resource, |
| 886 | uint32_t registry); |
| 887 | }; |
| 888 | |
| 889 | #define WL_DISPLAY_ERROR 0 |
| 890 | #define WL_DISPLAY_DELETE_ID 1 |
| 891 | |
| 892 | /** |
| 893 | * @ingroup iface_wl_display |
| 894 | */ |
| 895 | #define WL_DISPLAY_ERROR_SINCE_VERSION 1 |
| 896 | /** |
| 897 | * @ingroup iface_wl_display |
| 898 | */ |
| 899 | #define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1 |
| 900 | |
| 901 | /** |
| 902 | * @ingroup iface_wl_display |
| 903 | */ |
| 904 | #define WL_DISPLAY_SYNC_SINCE_VERSION 1 |
| 905 | /** |
| 906 | * @ingroup iface_wl_display |
| 907 | */ |
| 908 | #define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1 |
| 909 | |
| 910 | /** |
| 911 | * @ingroup iface_wl_registry |
| 912 | * @struct wl_registry_interface |
| 913 | */ |
| 914 | struct wl_registry_interface { |
| 915 | /** |
| 916 | * bind an object to the display |
| 917 | * |
| 918 | * Binds a new, client-created object to the server using the |
| 919 | * specified name as the identifier. |
| 920 | * @param name unique numeric name of the object |
| 921 | * @param interface name of the objects interface |
| 922 | * @param version version of the objects interface |
| 923 | * @param id bounded object |
| 924 | */ |
| 925 | void (*bind)(struct wl_client *client, |
| 926 | struct wl_resource *resource, |
| 927 | uint32_t name, |
| 928 | const char *interface, uint32_t version, uint32_t id); |
| 929 | }; |
| 930 | |
| 931 | #define WL_REGISTRY_GLOBAL 0 |
| 932 | #define WL_REGISTRY_GLOBAL_REMOVE 1 |
| 933 | |
| 934 | /** |
| 935 | * @ingroup iface_wl_registry |
| 936 | */ |
| 937 | #define WL_REGISTRY_GLOBAL_SINCE_VERSION 1 |
| 938 | /** |
| 939 | * @ingroup iface_wl_registry |
| 940 | */ |
| 941 | #define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1 |
| 942 | |
| 943 | /** |
| 944 | * @ingroup iface_wl_registry |
| 945 | */ |
| 946 | #define WL_REGISTRY_BIND_SINCE_VERSION 1 |
| 947 | |
| 948 | /** |
| 949 | * @ingroup iface_wl_registry |
| 950 | * Sends an global event to the client owning the resource. |
| 951 | * @param resource_ The client's resource |
| 952 | * @param name numeric name of the global object |
| 953 | * @param interface interface implemented by the object |
| 954 | * @param version interface version |
| 955 | */ |
| 956 | static inline void |
| 957 | wl_registry_send_global(struct wl_resource *resource_, uint32_t name, const char *interface, uint32_t version) |
| 958 | { |
| 959 | wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL, name, interface, version); |
| 960 | } |
| 961 | |
| 962 | /** |
| 963 | * @ingroup iface_wl_registry |
| 964 | * Sends an global_remove event to the client owning the resource. |
| 965 | * @param resource_ The client's resource |
| 966 | * @param name numeric name of the global object |
| 967 | */ |
| 968 | static inline void |
| 969 | wl_registry_send_global_remove(struct wl_resource *resource_, uint32_t name) |
| 970 | { |
| 971 | wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL_REMOVE, name); |
| 972 | } |
| 973 | |
| 974 | #define WL_CALLBACK_DONE 0 |
| 975 | |
| 976 | /** |
| 977 | * @ingroup iface_wl_callback |
| 978 | */ |
| 979 | #define WL_CALLBACK_DONE_SINCE_VERSION 1 |
| 980 | |
| 981 | |
| 982 | /** |
| 983 | * @ingroup iface_wl_callback |
| 984 | * Sends an done event to the client owning the resource. |
| 985 | * @param resource_ The client's resource |
| 986 | * @param callback_data request-specific data for the callback |
| 987 | */ |
| 988 | static inline void |
| 989 | wl_callback_send_done(struct wl_resource *resource_, uint32_t callback_data) |
| 990 | { |
| 991 | wl_resource_post_event(resource_, WL_CALLBACK_DONE, callback_data); |
| 992 | } |
| 993 | |
| 994 | /** |
| 995 | * @ingroup iface_wl_compositor |
| 996 | * @struct wl_compositor_interface |
| 997 | */ |
| 998 | struct wl_compositor_interface { |
| 999 | /** |
| 1000 | * create new surface |
| 1001 | * |
| 1002 | * Ask the compositor to create a new surface. |
| 1003 | * @param id the new surface |
| 1004 | */ |
| 1005 | void (*create_surface)(struct wl_client *client, |
| 1006 | struct wl_resource *resource, |
| 1007 | uint32_t id); |
| 1008 | /** |
| 1009 | * create new region |
| 1010 | * |
| 1011 | * Ask the compositor to create a new region. |
| 1012 | * @param id the new region |
| 1013 | */ |
| 1014 | void (*create_region)(struct wl_client *client, |
| 1015 | struct wl_resource *resource, |
| 1016 | uint32_t id); |
| 1017 | }; |
| 1018 | |
| 1019 | |
| 1020 | /** |
| 1021 | * @ingroup iface_wl_compositor |
| 1022 | */ |
| 1023 | #define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1 |
| 1024 | /** |
| 1025 | * @ingroup iface_wl_compositor |
| 1026 | */ |
| 1027 | #define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1 |
| 1028 | |
| 1029 | /** |
| 1030 | * @ingroup iface_wl_shm_pool |
| 1031 | * @struct wl_shm_pool_interface |
| 1032 | */ |
| 1033 | struct wl_shm_pool_interface { |
| 1034 | /** |
| 1035 | * create a buffer from the pool |
| 1036 | * |
| 1037 | * Create a wl_buffer object from the pool. |
| 1038 | * |
| 1039 | * The buffer is created offset bytes into the pool and has width |
| 1040 | * and height as specified. The stride argument specifies the |
| 1041 | * number of bytes from the beginning of one row to the beginning |
| 1042 | * of the next. The format is the pixel format of the buffer and |
| 1043 | * must be one of those advertised through the wl_shm.format event. |
| 1044 | * |
| 1045 | * A buffer will keep a reference to the pool it was created from |
| 1046 | * so it is valid to destroy the pool immediately after creating a |
| 1047 | * buffer from it. |
| 1048 | * @param id buffer to create |
| 1049 | * @param offset buffer byte offset within the pool |
| 1050 | * @param width buffer width, in pixels |
| 1051 | * @param height buffer height, in pixels |
| 1052 | * @param stride number of bytes from the beginning of one row to the beginning of the next row |
| 1053 | * @param format buffer pixel format |
| 1054 | */ |
| 1055 | void (*create_buffer)(struct wl_client *client, |
| 1056 | struct wl_resource *resource, |
| 1057 | uint32_t id, |
| 1058 | int32_t offset, |
| 1059 | int32_t width, |
| 1060 | int32_t height, |
| 1061 | int32_t stride, |
| 1062 | uint32_t format); |
| 1063 | /** |
| 1064 | * destroy the pool |
| 1065 | * |
| 1066 | * Destroy the shared memory pool. |
| 1067 | * |
| 1068 | * The mmapped memory will be released when all buffers that have |
| 1069 | * been created from this pool are gone. |
| 1070 | */ |
| 1071 | void (*destroy)(struct wl_client *client, |
| 1072 | struct wl_resource *resource); |
| 1073 | /** |
| 1074 | * change the size of the pool mapping |
| 1075 | * |
| 1076 | * This request will cause the server to remap the backing memory |
| 1077 | * for the pool from the file descriptor passed when the pool was |
| 1078 | * created, but using the new size. This request can only be used |
| 1079 | * to make the pool bigger. |
| 1080 | * @param size new size of the pool, in bytes |
| 1081 | */ |
| 1082 | void (*resize)(struct wl_client *client, |
| 1083 | struct wl_resource *resource, |
| 1084 | int32_t size); |
| 1085 | }; |
| 1086 | |
| 1087 | |
| 1088 | /** |
| 1089 | * @ingroup iface_wl_shm_pool |
| 1090 | */ |
| 1091 | #define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1 |
| 1092 | /** |
| 1093 | * @ingroup iface_wl_shm_pool |
| 1094 | */ |
| 1095 | #define WL_SHM_POOL_DESTROY_SINCE_VERSION 1 |
| 1096 | /** |
| 1097 | * @ingroup iface_wl_shm_pool |
| 1098 | */ |
| 1099 | #define WL_SHM_POOL_RESIZE_SINCE_VERSION 1 |
| 1100 | |
| 1101 | #ifndef WL_SHM_ERROR_ENUM |
| 1102 | #define WL_SHM_ERROR_ENUM |
| 1103 | /** |
| 1104 | * @ingroup iface_wl_shm |
| 1105 | * wl_shm error values |
| 1106 | * |
| 1107 | * These errors can be emitted in response to wl_shm requests. |
| 1108 | */ |
| 1109 | enum wl_shm_error { |
| 1110 | /** |
| 1111 | * buffer format is not known |
| 1112 | */ |
| 1113 | WL_SHM_ERROR_INVALID_FORMAT = 0, |
| 1114 | /** |
| 1115 | * invalid size or stride during pool or buffer creation |
| 1116 | */ |
| 1117 | WL_SHM_ERROR_INVALID_STRIDE = 1, |
| 1118 | /** |
| 1119 | * mmapping the file descriptor failed |
| 1120 | */ |
| 1121 | WL_SHM_ERROR_INVALID_FD = 2, |
| 1122 | }; |
| 1123 | #endif /* WL_SHM_ERROR_ENUM */ |
| 1124 | |
| 1125 | #ifndef WL_SHM_FORMAT_ENUM |
| 1126 | #define WL_SHM_FORMAT_ENUM |
| 1127 | /** |
| 1128 | * @ingroup iface_wl_shm |
| 1129 | * pixel formats |
| 1130 | * |
| 1131 | * This describes the memory layout of an individual pixel. |
| 1132 | * |
| 1133 | * All renderers should support argb8888 and xrgb8888 but any other |
| 1134 | * formats are optional and may not be supported by the particular |
| 1135 | * renderer in use. |
| 1136 | * |
| 1137 | * The drm format codes match the macros defined in drm_fourcc.h. |
| 1138 | * The formats actually supported by the compositor will be |
| 1139 | * reported by the format event. |
| 1140 | */ |
| 1141 | enum wl_shm_format { |
| 1142 | /** |
| 1143 | * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian |
| 1144 | */ |
| 1145 | WL_SHM_FORMAT_ARGB8888 = 0, |
| 1146 | /** |
| 1147 | * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian |
| 1148 | */ |
| 1149 | WL_SHM_FORMAT_XRGB8888 = 1, |
| 1150 | /** |
| 1151 | * 8-bit color index format, [7:0] C |
| 1152 | */ |
| 1153 | WL_SHM_FORMAT_C8 = 0x20203843, |
| 1154 | /** |
| 1155 | * 8-bit RGB format, [7:0] R:G:B 3:3:2 |
| 1156 | */ |
| 1157 | WL_SHM_FORMAT_RGB332 = 0x38424752, |
| 1158 | /** |
| 1159 | * 8-bit BGR format, [7:0] B:G:R 2:3:3 |
| 1160 | */ |
| 1161 | WL_SHM_FORMAT_BGR233 = 0x38524742, |
| 1162 | /** |
| 1163 | * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian |
| 1164 | */ |
| 1165 | WL_SHM_FORMAT_XRGB4444 = 0x32315258, |
| 1166 | /** |
| 1167 | * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian |
| 1168 | */ |
| 1169 | WL_SHM_FORMAT_XBGR4444 = 0x32314258, |
| 1170 | /** |
| 1171 | * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian |
| 1172 | */ |
| 1173 | WL_SHM_FORMAT_RGBX4444 = 0x32315852, |
| 1174 | /** |
| 1175 | * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian |
| 1176 | */ |
| 1177 | WL_SHM_FORMAT_BGRX4444 = 0x32315842, |
| 1178 | /** |
| 1179 | * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian |
| 1180 | */ |
| 1181 | WL_SHM_FORMAT_ARGB4444 = 0x32315241, |
| 1182 | /** |
| 1183 | * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian |
| 1184 | */ |
| 1185 | WL_SHM_FORMAT_ABGR4444 = 0x32314241, |
| 1186 | /** |
| 1187 | * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian |
| 1188 | */ |
| 1189 | WL_SHM_FORMAT_RGBA4444 = 0x32314152, |
| 1190 | /** |
| 1191 | * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian |
| 1192 | */ |
| 1193 | WL_SHM_FORMAT_BGRA4444 = 0x32314142, |
| 1194 | /** |
| 1195 | * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian |
| 1196 | */ |
| 1197 | WL_SHM_FORMAT_XRGB1555 = 0x35315258, |
| 1198 | /** |
| 1199 | * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian |
| 1200 | */ |
| 1201 | WL_SHM_FORMAT_XBGR1555 = 0x35314258, |
| 1202 | /** |
| 1203 | * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian |
| 1204 | */ |
| 1205 | WL_SHM_FORMAT_RGBX5551 = 0x35315852, |
| 1206 | /** |
| 1207 | * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian |
| 1208 | */ |
| 1209 | WL_SHM_FORMAT_BGRX5551 = 0x35315842, |
| 1210 | /** |
| 1211 | * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian |
| 1212 | */ |
| 1213 | WL_SHM_FORMAT_ARGB1555 = 0x35315241, |
| 1214 | /** |
| 1215 | * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian |
| 1216 | */ |
| 1217 | WL_SHM_FORMAT_ABGR1555 = 0x35314241, |
| 1218 | /** |
| 1219 | * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian |
| 1220 | */ |
| 1221 | WL_SHM_FORMAT_RGBA5551 = 0x35314152, |
| 1222 | /** |
| 1223 | * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian |
| 1224 | */ |
| 1225 | WL_SHM_FORMAT_BGRA5551 = 0x35314142, |
| 1226 | /** |
| 1227 | * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian |
| 1228 | */ |
| 1229 | WL_SHM_FORMAT_RGB565 = 0x36314752, |
| 1230 | /** |
| 1231 | * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian |
| 1232 | */ |
| 1233 | WL_SHM_FORMAT_BGR565 = 0x36314742, |
| 1234 | /** |
| 1235 | * 24-bit RGB format, [23:0] R:G:B little endian |
| 1236 | */ |
| 1237 | WL_SHM_FORMAT_RGB888 = 0x34324752, |
| 1238 | /** |
| 1239 | * 24-bit BGR format, [23:0] B:G:R little endian |
| 1240 | */ |
| 1241 | WL_SHM_FORMAT_BGR888 = 0x34324742, |
| 1242 | /** |
| 1243 | * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian |
| 1244 | */ |
| 1245 | WL_SHM_FORMAT_XBGR8888 = 0x34324258, |
| 1246 | /** |
| 1247 | * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian |
| 1248 | */ |
| 1249 | WL_SHM_FORMAT_RGBX8888 = 0x34325852, |
| 1250 | /** |
| 1251 | * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian |
| 1252 | */ |
| 1253 | WL_SHM_FORMAT_BGRX8888 = 0x34325842, |
| 1254 | /** |
| 1255 | * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian |
| 1256 | */ |
| 1257 | WL_SHM_FORMAT_ABGR8888 = 0x34324241, |
| 1258 | /** |
| 1259 | * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian |
| 1260 | */ |
| 1261 | WL_SHM_FORMAT_RGBA8888 = 0x34324152, |
| 1262 | /** |
| 1263 | * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian |
| 1264 | */ |
| 1265 | WL_SHM_FORMAT_BGRA8888 = 0x34324142, |
| 1266 | /** |
| 1267 | * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian |
| 1268 | */ |
| 1269 | WL_SHM_FORMAT_XRGB2101010 = 0x30335258, |
| 1270 | /** |
| 1271 | * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian |
| 1272 | */ |
| 1273 | WL_SHM_FORMAT_XBGR2101010 = 0x30334258, |
| 1274 | /** |
| 1275 | * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian |
| 1276 | */ |
| 1277 | WL_SHM_FORMAT_RGBX1010102 = 0x30335852, |
| 1278 | /** |
| 1279 | * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian |
| 1280 | */ |
| 1281 | WL_SHM_FORMAT_BGRX1010102 = 0x30335842, |
| 1282 | /** |
| 1283 | * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian |
| 1284 | */ |
| 1285 | WL_SHM_FORMAT_ARGB2101010 = 0x30335241, |
| 1286 | /** |
| 1287 | * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian |
| 1288 | */ |
| 1289 | WL_SHM_FORMAT_ABGR2101010 = 0x30334241, |
| 1290 | /** |
| 1291 | * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian |
| 1292 | */ |
| 1293 | WL_SHM_FORMAT_RGBA1010102 = 0x30334152, |
| 1294 | /** |
| 1295 | * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian |
| 1296 | */ |
| 1297 | WL_SHM_FORMAT_BGRA1010102 = 0x30334142, |
| 1298 | /** |
| 1299 | * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian |
| 1300 | */ |
| 1301 | WL_SHM_FORMAT_YUYV = 0x56595559, |
| 1302 | /** |
| 1303 | * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian |
| 1304 | */ |
| 1305 | WL_SHM_FORMAT_YVYU = 0x55595659, |
| 1306 | /** |
| 1307 | * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian |
| 1308 | */ |
| 1309 | WL_SHM_FORMAT_UYVY = 0x59565955, |
| 1310 | /** |
| 1311 | * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian |
| 1312 | */ |
| 1313 | WL_SHM_FORMAT_VYUY = 0x59555956, |
| 1314 | /** |
| 1315 | * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian |
| 1316 | */ |
| 1317 | WL_SHM_FORMAT_AYUV = 0x56555941, |
| 1318 | /** |
| 1319 | * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane |
| 1320 | */ |
| 1321 | WL_SHM_FORMAT_NV12 = 0x3231564e, |
| 1322 | /** |
| 1323 | * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane |
| 1324 | */ |
| 1325 | WL_SHM_FORMAT_NV21 = 0x3132564e, |
| 1326 | /** |
| 1327 | * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane |
| 1328 | */ |
| 1329 | WL_SHM_FORMAT_NV16 = 0x3631564e, |
| 1330 | /** |
| 1331 | * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane |
| 1332 | */ |
| 1333 | WL_SHM_FORMAT_NV61 = 0x3136564e, |
| 1334 | /** |
| 1335 | * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes |
| 1336 | */ |
| 1337 | WL_SHM_FORMAT_YUV410 = 0x39565559, |
| 1338 | /** |
| 1339 | * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes |
| 1340 | */ |
| 1341 | WL_SHM_FORMAT_YVU410 = 0x39555659, |
| 1342 | /** |
| 1343 | * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes |
| 1344 | */ |
| 1345 | WL_SHM_FORMAT_YUV411 = 0x31315559, |
| 1346 | /** |
| 1347 | * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes |
| 1348 | */ |
| 1349 | WL_SHM_FORMAT_YVU411 = 0x31315659, |
| 1350 | /** |
| 1351 | * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes |
| 1352 | */ |
| 1353 | WL_SHM_FORMAT_YUV420 = 0x32315559, |
| 1354 | /** |
| 1355 | * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes |
| 1356 | */ |
| 1357 | WL_SHM_FORMAT_YVU420 = 0x32315659, |
| 1358 | /** |
| 1359 | * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes |
| 1360 | */ |
| 1361 | WL_SHM_FORMAT_YUV422 = 0x36315559, |
| 1362 | /** |
| 1363 | * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes |
| 1364 | */ |
| 1365 | WL_SHM_FORMAT_YVU422 = 0x36315659, |
| 1366 | /** |
| 1367 | * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes |
| 1368 | */ |
| 1369 | WL_SHM_FORMAT_YUV444 = 0x34325559, |
| 1370 | /** |
| 1371 | * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes |
| 1372 | */ |
| 1373 | WL_SHM_FORMAT_YVU444 = 0x34325659, |
| 1374 | }; |
| 1375 | #endif /* WL_SHM_FORMAT_ENUM */ |
| 1376 | |
| 1377 | /** |
| 1378 | * @ingroup iface_wl_shm |
| 1379 | * @struct wl_shm_interface |
| 1380 | */ |
| 1381 | struct wl_shm_interface { |
| 1382 | /** |
| 1383 | * create a shm pool |
| 1384 | * |
| 1385 | * Create a new wl_shm_pool object. |
| 1386 | * |
| 1387 | * The pool can be used to create shared memory based buffer |
| 1388 | * objects. The server will mmap size bytes of the passed file |
| 1389 | * descriptor, to use as backing memory for the pool. |
| 1390 | * @param id pool to create |
| 1391 | * @param fd file descriptor for the pool |
| 1392 | * @param size pool size, in bytes |
| 1393 | */ |
| 1394 | void (*create_pool)(struct wl_client *client, |
| 1395 | struct wl_resource *resource, |
| 1396 | uint32_t id, |
| 1397 | int32_t fd, |
| 1398 | int32_t size); |
| 1399 | }; |
| 1400 | |
| 1401 | #define WL_SHM_FORMAT 0 |
| 1402 | |
| 1403 | /** |
| 1404 | * @ingroup iface_wl_shm |
| 1405 | */ |
| 1406 | #define WL_SHM_FORMAT_SINCE_VERSION 1 |
| 1407 | |
| 1408 | /** |
| 1409 | * @ingroup iface_wl_shm |
| 1410 | */ |
| 1411 | #define WL_SHM_CREATE_POOL_SINCE_VERSION 1 |
| 1412 | |
| 1413 | /** |
| 1414 | * @ingroup iface_wl_shm |
| 1415 | * Sends an format event to the client owning the resource. |
| 1416 | * @param resource_ The client's resource |
| 1417 | * @param format buffer pixel format |
| 1418 | */ |
| 1419 | static inline void |
| 1420 | wl_shm_send_format(struct wl_resource *resource_, uint32_t format) |
| 1421 | { |
| 1422 | wl_resource_post_event(resource_, WL_SHM_FORMAT, format); |
| 1423 | } |
| 1424 | |
| 1425 | /** |
| 1426 | * @ingroup iface_wl_buffer |
| 1427 | * @struct wl_buffer_interface |
| 1428 | */ |
| 1429 | struct wl_buffer_interface { |
| 1430 | /** |
| 1431 | * destroy a buffer |
| 1432 | * |
| 1433 | * Destroy a buffer. If and how you need to release the backing |
| 1434 | * storage is defined by the buffer factory interface. |
| 1435 | * |
| 1436 | * For possible side-effects to a surface, see wl_surface.attach. |
| 1437 | */ |
| 1438 | void (*destroy)(struct wl_client *client, |
| 1439 | struct wl_resource *resource); |
| 1440 | }; |
| 1441 | |
| 1442 | #define WL_BUFFER_RELEASE 0 |
| 1443 | |
| 1444 | /** |
| 1445 | * @ingroup iface_wl_buffer |
| 1446 | */ |
| 1447 | #define WL_BUFFER_RELEASE_SINCE_VERSION 1 |
| 1448 | |
| 1449 | /** |
| 1450 | * @ingroup iface_wl_buffer |
| 1451 | */ |
| 1452 | #define WL_BUFFER_DESTROY_SINCE_VERSION 1 |
| 1453 | |
| 1454 | /** |
| 1455 | * @ingroup iface_wl_buffer |
| 1456 | * Sends an release event to the client owning the resource. |
| 1457 | * @param resource_ The client's resource |
| 1458 | */ |
| 1459 | static inline void |
| 1460 | wl_buffer_send_release(struct wl_resource *resource_) |
| 1461 | { |
| 1462 | wl_resource_post_event(resource_, WL_BUFFER_RELEASE); |
| 1463 | } |
| 1464 | |
| 1465 | #ifndef WL_DATA_OFFER_ERROR_ENUM |
| 1466 | #define WL_DATA_OFFER_ERROR_ENUM |
| 1467 | enum wl_data_offer_error { |
| 1468 | /** |
| 1469 | * finish request was called untimely |
| 1470 | */ |
| 1471 | WL_DATA_OFFER_ERROR_INVALID_FINISH = 0, |
| 1472 | /** |
| 1473 | * action mask contains invalid values |
| 1474 | */ |
| 1475 | WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1, |
| 1476 | /** |
| 1477 | * action argument has an invalid value |
| 1478 | */ |
| 1479 | WL_DATA_OFFER_ERROR_INVALID_ACTION = 2, |
| 1480 | /** |
| 1481 | * offer doesn't accept this request |
| 1482 | */ |
| 1483 | WL_DATA_OFFER_ERROR_INVALID_OFFER = 3, |
| 1484 | }; |
| 1485 | #endif /* WL_DATA_OFFER_ERROR_ENUM */ |
| 1486 | |
| 1487 | /** |
| 1488 | * @ingroup iface_wl_data_offer |
| 1489 | * @struct wl_data_offer_interface |
| 1490 | */ |
| 1491 | struct wl_data_offer_interface { |
| 1492 | /** |
| 1493 | * accept one of the offered mime types |
| 1494 | * |
| 1495 | * Indicate that the client can accept the given mime type, or |
| 1496 | * NULL for not accepted. |
| 1497 | * |
| 1498 | * For objects of version 2 or older, this request is used by the |
| 1499 | * client to give feedback whether the client can receive the given |
| 1500 | * mime type, or NULL if none is accepted; the feedback does not |
| 1501 | * determine whether the drag-and-drop operation succeeds or not. |
| 1502 | * |
| 1503 | * For objects of version 3 or newer, this request determines the |
| 1504 | * final result of the drag-and-drop operation. If the end result |
| 1505 | * is that no mime types were accepted, the drag-and-drop operation |
| 1506 | * will be cancelled and the corresponding drag source will receive |
| 1507 | * wl_data_source.cancelled. Clients may still use this event in |
| 1508 | * conjunction with wl_data_source.action for feedback. |
| 1509 | * @param serial serial number of the accept request |
| 1510 | * @param mime_type mime type accepted by the client |
| 1511 | */ |
| 1512 | void (*accept)(struct wl_client *client, |
| 1513 | struct wl_resource *resource, |
| 1514 | uint32_t serial, |
| 1515 | const char *mime_type); |
| 1516 | /** |
| 1517 | * request that the data is transferred |
| 1518 | * |
| 1519 | * To transfer the offered data, the client issues this request |
| 1520 | * and indicates the mime type it wants to receive. The transfer |
| 1521 | * happens through the passed file descriptor (typically created |
| 1522 | * with the pipe system call). The source client writes the data in |
| 1523 | * the mime type representation requested and then closes the file |
| 1524 | * descriptor. |
| 1525 | * |
| 1526 | * The receiving client reads from the read end of the pipe until |
| 1527 | * EOF and then closes its end, at which point the transfer is |
| 1528 | * complete. |
| 1529 | * |
| 1530 | * This request may happen multiple times for different mime types, |
| 1531 | * both before and after wl_data_device.drop. Drag-and-drop |
| 1532 | * destination clients may preemptively fetch data or examine it |
| 1533 | * more closely to determine acceptance. |
| 1534 | * @param mime_type mime type desired by receiver |
| 1535 | * @param fd file descriptor for data transfer |
| 1536 | */ |
| 1537 | void (*receive)(struct wl_client *client, |
| 1538 | struct wl_resource *resource, |
| 1539 | const char *mime_type, |
| 1540 | int32_t fd); |
| 1541 | /** |
| 1542 | * destroy data offer |
| 1543 | * |
| 1544 | * Destroy the data offer. |
| 1545 | */ |
| 1546 | void (*destroy)(struct wl_client *client, |
| 1547 | struct wl_resource *resource); |
| 1548 | /** |
| 1549 | * the offer will no longer be used |
| 1550 | * |
| 1551 | * Notifies the compositor that the drag destination successfully |
| 1552 | * finished the drag-and-drop operation. |
| 1553 | * |
| 1554 | * Upon receiving this request, the compositor will emit |
| 1555 | * wl_data_source.dnd_finished on the drag source client. |
| 1556 | * |
| 1557 | * It is a client error to perform other requests than |
| 1558 | * wl_data_offer.destroy after this one. It is also an error to |
| 1559 | * perform this request after a NULL mime type has been set in |
| 1560 | * wl_data_offer.accept or no action was received through |
| 1561 | * wl_data_offer.action. |
| 1562 | * @since 3 |
| 1563 | */ |
| 1564 | void (*finish)(struct wl_client *client, |
| 1565 | struct wl_resource *resource); |
| 1566 | /** |
| 1567 | * set the available/preferred drag-and-drop actions |
| 1568 | * |
| 1569 | * Sets the actions that the destination side client supports for |
| 1570 | * this operation. This request may trigger the emission of |
| 1571 | * wl_data_source.action and wl_data_offer.action events if the |
| 1572 | * compositor needs to change the selected action. |
| 1573 | * |
| 1574 | * This request can be called multiple times throughout the |
| 1575 | * drag-and-drop operation, typically in response to |
| 1576 | * wl_data_device.enter or wl_data_device.motion events. |
| 1577 | * |
| 1578 | * This request determines the final result of the drag-and-drop |
| 1579 | * operation. If the end result is that no action is accepted, the |
| 1580 | * drag source will receive wl_drag_source.cancelled. |
| 1581 | * |
| 1582 | * The dnd_actions argument must contain only values expressed in |
| 1583 | * the wl_data_device_manager.dnd_actions enum, and the |
| 1584 | * preferred_action argument must only contain one of those values |
| 1585 | * set, otherwise it will result in a protocol error. |
| 1586 | * |
| 1587 | * While managing an "ask" action, the destination drag-and-drop |
| 1588 | * client may perform further wl_data_offer.receive requests, and |
| 1589 | * is expected to perform one last wl_data_offer.set_actions |
| 1590 | * request with a preferred action other than "ask" (and optionally |
| 1591 | * wl_data_offer.accept) before requesting wl_data_offer.finish, in |
| 1592 | * order to convey the action selected by the user. If the |
| 1593 | * preferred action is not in the wl_data_offer.source_actions |
| 1594 | * mask, an error will be raised. |
| 1595 | * |
| 1596 | * If the "ask" action is dismissed (e.g. user cancellation), the |
| 1597 | * client is expected to perform wl_data_offer.destroy right away. |
| 1598 | * |
| 1599 | * This request can only be made on drag-and-drop offers, a |
| 1600 | * protocol error will be raised otherwise. |
| 1601 | * @param dnd_actions actions supported by the destination client |
| 1602 | * @param preferred_action action preferred by the destination client |
| 1603 | * @since 3 |
| 1604 | */ |
| 1605 | void (*set_actions)(struct wl_client *client, |
| 1606 | struct wl_resource *resource, |
| 1607 | uint32_t dnd_actions, |
| 1608 | uint32_t preferred_action); |
| 1609 | }; |
| 1610 | |
| 1611 | #define WL_DATA_OFFER_OFFER 0 |
| 1612 | #define WL_DATA_OFFER_SOURCE_ACTIONS 1 |
| 1613 | #define WL_DATA_OFFER_ACTION 2 |
| 1614 | |
| 1615 | /** |
| 1616 | * @ingroup iface_wl_data_offer |
| 1617 | */ |
| 1618 | #define WL_DATA_OFFER_OFFER_SINCE_VERSION 1 |
| 1619 | /** |
| 1620 | * @ingroup iface_wl_data_offer |
| 1621 | */ |
| 1622 | #define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3 |
| 1623 | /** |
| 1624 | * @ingroup iface_wl_data_offer |
| 1625 | */ |
| 1626 | #define WL_DATA_OFFER_ACTION_SINCE_VERSION 3 |
| 1627 | |
| 1628 | /** |
| 1629 | * @ingroup iface_wl_data_offer |
| 1630 | */ |
| 1631 | #define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1 |
| 1632 | /** |
| 1633 | * @ingroup iface_wl_data_offer |
| 1634 | */ |
| 1635 | #define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1 |
| 1636 | /** |
| 1637 | * @ingroup iface_wl_data_offer |
| 1638 | */ |
| 1639 | #define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1 |
| 1640 | /** |
| 1641 | * @ingroup iface_wl_data_offer |
| 1642 | */ |
| 1643 | #define WL_DATA_OFFER_FINISH_SINCE_VERSION 3 |
| 1644 | /** |
| 1645 | * @ingroup iface_wl_data_offer |
| 1646 | */ |
| 1647 | #define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3 |
| 1648 | |
| 1649 | /** |
| 1650 | * @ingroup iface_wl_data_offer |
| 1651 | * Sends an offer event to the client owning the resource. |
| 1652 | * @param resource_ The client's resource |
| 1653 | * @param mime_type offered mime type |
| 1654 | */ |
| 1655 | static inline void |
| 1656 | wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type) |
| 1657 | { |
| 1658 | wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type); |
| 1659 | } |
| 1660 | |
| 1661 | /** |
| 1662 | * @ingroup iface_wl_data_offer |
| 1663 | * Sends an source_actions event to the client owning the resource. |
| 1664 | * @param resource_ The client's resource |
| 1665 | * @param source_actions actions offered by the data source |
| 1666 | */ |
| 1667 | static inline void |
| 1668 | wl_data_offer_send_source_actions(struct wl_resource *resource_, uint32_t source_actions) |
| 1669 | { |
| 1670 | wl_resource_post_event(resource_, WL_DATA_OFFER_SOURCE_ACTIONS, source_actions); |
| 1671 | } |
| 1672 | |
| 1673 | /** |
| 1674 | * @ingroup iface_wl_data_offer |
| 1675 | * Sends an action event to the client owning the resource. |
| 1676 | * @param resource_ The client's resource |
| 1677 | * @param dnd_action action selected by the compositor |
| 1678 | */ |
| 1679 | static inline void |
| 1680 | wl_data_offer_send_action(struct wl_resource *resource_, uint32_t dnd_action) |
| 1681 | { |
| 1682 | wl_resource_post_event(resource_, WL_DATA_OFFER_ACTION, dnd_action); |
| 1683 | } |
| 1684 | |
| 1685 | #ifndef WL_DATA_SOURCE_ERROR_ENUM |
| 1686 | #define WL_DATA_SOURCE_ERROR_ENUM |
| 1687 | enum wl_data_source_error { |
| 1688 | /** |
| 1689 | * action mask contains invalid values |
| 1690 | */ |
| 1691 | WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0, |
| 1692 | /** |
| 1693 | * source doesn't accept this request |
| 1694 | */ |
| 1695 | WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1, |
| 1696 | }; |
| 1697 | #endif /* WL_DATA_SOURCE_ERROR_ENUM */ |
| 1698 | |
| 1699 | /** |
| 1700 | * @ingroup iface_wl_data_source |
| 1701 | * @struct wl_data_source_interface |
| 1702 | */ |
| 1703 | struct wl_data_source_interface { |
| 1704 | /** |
| 1705 | * add an offered mime type |
| 1706 | * |
| 1707 | * This request adds a mime type to the set of mime types |
| 1708 | * advertised to targets. Can be called several times to offer |
| 1709 | * multiple types. |
| 1710 | * @param mime_type mime type offered by the data source |
| 1711 | */ |
| 1712 | void (*offer)(struct wl_client *client, |
| 1713 | struct wl_resource *resource, |
| 1714 | const char *mime_type); |
| 1715 | /** |
| 1716 | * destroy the data source |
| 1717 | * |
| 1718 | * Destroy the data source. |
| 1719 | */ |
| 1720 | void (*destroy)(struct wl_client *client, |
| 1721 | struct wl_resource *resource); |
| 1722 | /** |
| 1723 | * set the available drag-and-drop actions |
| 1724 | * |
| 1725 | * Sets the actions that the source side client supports for this |
| 1726 | * operation. This request may trigger wl_data_source.action and |
| 1727 | * wl_data_offer.action events if the compositor needs to change |
| 1728 | * the selected action. |
| 1729 | * |
| 1730 | * The dnd_actions argument must contain only values expressed in |
| 1731 | * the wl_data_device_manager.dnd_actions enum, otherwise it will |
| 1732 | * result in a protocol error. |
| 1733 | * |
| 1734 | * This request must be made once only, and can only be made on |
| 1735 | * sources used in drag-and-drop, so it must be performed before |
| 1736 | * wl_data_device.start_drag. Attempting to use the source other |
| 1737 | * than for drag-and-drop will raise a protocol error. |
| 1738 | * @param dnd_actions actions supported by the data source |
| 1739 | * @since 3 |
| 1740 | */ |
| 1741 | void (*set_actions)(struct wl_client *client, |
| 1742 | struct wl_resource *resource, |
| 1743 | uint32_t dnd_actions); |
| 1744 | }; |
| 1745 | |
| 1746 | #define WL_DATA_SOURCE_TARGET 0 |
| 1747 | #define WL_DATA_SOURCE_SEND 1 |
| 1748 | #define WL_DATA_SOURCE_CANCELLED 2 |
| 1749 | #define WL_DATA_SOURCE_DND_DROP_PERFORMED 3 |
| 1750 | #define WL_DATA_SOURCE_DND_FINISHED 4 |
| 1751 | #define WL_DATA_SOURCE_ACTION 5 |
| 1752 | |
| 1753 | /** |
| 1754 | * @ingroup iface_wl_data_source |
| 1755 | */ |
| 1756 | #define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1 |
| 1757 | /** |
| 1758 | * @ingroup iface_wl_data_source |
| 1759 | */ |
| 1760 | #define WL_DATA_SOURCE_SEND_SINCE_VERSION 1 |
| 1761 | /** |
| 1762 | * @ingroup iface_wl_data_source |
| 1763 | */ |
| 1764 | #define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1 |
| 1765 | /** |
| 1766 | * @ingroup iface_wl_data_source |
| 1767 | */ |
| 1768 | #define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3 |
| 1769 | /** |
| 1770 | * @ingroup iface_wl_data_source |
| 1771 | */ |
| 1772 | #define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3 |
| 1773 | /** |
| 1774 | * @ingroup iface_wl_data_source |
| 1775 | */ |
| 1776 | #define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3 |
| 1777 | |
| 1778 | /** |
| 1779 | * @ingroup iface_wl_data_source |
| 1780 | */ |
| 1781 | #define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1 |
| 1782 | /** |
| 1783 | * @ingroup iface_wl_data_source |
| 1784 | */ |
| 1785 | #define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1 |
| 1786 | /** |
| 1787 | * @ingroup iface_wl_data_source |
| 1788 | */ |
| 1789 | #define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3 |
| 1790 | |
| 1791 | /** |
| 1792 | * @ingroup iface_wl_data_source |
| 1793 | * Sends an target event to the client owning the resource. |
| 1794 | * @param resource_ The client's resource |
| 1795 | * @param mime_type mime type accepted by the target |
| 1796 | */ |
| 1797 | static inline void |
| 1798 | wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type) |
| 1799 | { |
| 1800 | wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type); |
| 1801 | } |
| 1802 | |
| 1803 | /** |
| 1804 | * @ingroup iface_wl_data_source |
| 1805 | * Sends an send event to the client owning the resource. |
| 1806 | * @param resource_ The client's resource |
| 1807 | * @param mime_type mime type for the data |
| 1808 | * @param fd file descriptor for the data |
| 1809 | */ |
| 1810 | static inline void |
| 1811 | wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, int32_t fd) |
| 1812 | { |
| 1813 | wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd); |
| 1814 | } |
| 1815 | |
| 1816 | /** |
| 1817 | * @ingroup iface_wl_data_source |
| 1818 | * Sends an cancelled event to the client owning the resource. |
| 1819 | * @param resource_ The client's resource |
| 1820 | */ |
| 1821 | static inline void |
| 1822 | wl_data_source_send_cancelled(struct wl_resource *resource_) |
| 1823 | { |
| 1824 | wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED); |
| 1825 | } |
| 1826 | |
| 1827 | /** |
| 1828 | * @ingroup iface_wl_data_source |
| 1829 | * Sends an dnd_drop_performed event to the client owning the resource. |
| 1830 | * @param resource_ The client's resource |
| 1831 | */ |
| 1832 | static inline void |
| 1833 | wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_) |
| 1834 | { |
| 1835 | wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_DROP_PERFORMED); |
| 1836 | } |
| 1837 | |
| 1838 | /** |
| 1839 | * @ingroup iface_wl_data_source |
| 1840 | * Sends an dnd_finished event to the client owning the resource. |
| 1841 | * @param resource_ The client's resource |
| 1842 | */ |
| 1843 | static inline void |
| 1844 | wl_data_source_send_dnd_finished(struct wl_resource *resource_) |
| 1845 | { |
| 1846 | wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_FINISHED); |
| 1847 | } |
| 1848 | |
| 1849 | /** |
| 1850 | * @ingroup iface_wl_data_source |
| 1851 | * Sends an action event to the client owning the resource. |
| 1852 | * @param resource_ The client's resource |
| 1853 | * @param dnd_action action selected by the compositor |
| 1854 | */ |
| 1855 | static inline void |
| 1856 | wl_data_source_send_action(struct wl_resource *resource_, uint32_t dnd_action) |
| 1857 | { |
| 1858 | wl_resource_post_event(resource_, WL_DATA_SOURCE_ACTION, dnd_action); |
| 1859 | } |
| 1860 | |
| 1861 | #ifndef WL_DATA_DEVICE_ERROR_ENUM |
| 1862 | #define WL_DATA_DEVICE_ERROR_ENUM |
| 1863 | enum wl_data_device_error { |
| 1864 | /** |
| 1865 | * given wl_surface has another role |
| 1866 | */ |
| 1867 | WL_DATA_DEVICE_ERROR_ROLE = 0, |
| 1868 | }; |
| 1869 | #endif /* WL_DATA_DEVICE_ERROR_ENUM */ |
| 1870 | |
| 1871 | /** |
| 1872 | * @ingroup iface_wl_data_device |
| 1873 | * @struct wl_data_device_interface |
| 1874 | */ |
| 1875 | struct wl_data_device_interface { |
| 1876 | /** |
| 1877 | * start drag-and-drop operation |
| 1878 | * |
| 1879 | * This request asks the compositor to start a drag-and-drop |
| 1880 | * operation on behalf of the client. |
| 1881 | * |
| 1882 | * The source argument is the data source that provides the data |
| 1883 | * for the eventual data transfer. If source is NULL, enter, leave |
| 1884 | * and motion events are sent only to the client that initiated the |
| 1885 | * drag and the client is expected to handle the data passing |
| 1886 | * internally. |
| 1887 | * |
| 1888 | * The origin surface is the surface where the drag originates and |
| 1889 | * the client must have an active implicit grab that matches the |
| 1890 | * serial. |
| 1891 | * |
| 1892 | * The icon surface is an optional (can be NULL) surface that |
| 1893 | * provides an icon to be moved around with the cursor. Initially, |
| 1894 | * the top-left corner of the icon surface is placed at the cursor |
| 1895 | * hotspot, but subsequent wl_surface.attach request can move the |
| 1896 | * relative position. Attach requests must be confirmed with |
| 1897 | * wl_surface.commit as usual. The icon surface is given the role |
| 1898 | * of a drag-and-drop icon. If the icon surface already has another |
| 1899 | * role, it raises a protocol error. |
| 1900 | * |
| 1901 | * The current and pending input regions of the icon wl_surface are |
| 1902 | * cleared, and wl_surface.set_input_region is ignored until the |
| 1903 | * wl_surface is no longer used as the icon surface. When the use |
| 1904 | * as an icon ends, the current and pending input regions become |
| 1905 | * undefined, and the wl_surface is unmapped. |
| 1906 | * @param source data source for the eventual transfer |
| 1907 | * @param origin surface where the drag originates |
| 1908 | * @param icon drag-and-drop icon surface |
| 1909 | * @param serial serial number of the implicit grab on the origin |
| 1910 | */ |
| 1911 | void (*start_drag)(struct wl_client *client, |
| 1912 | struct wl_resource *resource, |
| 1913 | struct wl_resource *source, |
| 1914 | struct wl_resource *origin, |
| 1915 | struct wl_resource *icon, |
| 1916 | uint32_t serial); |
| 1917 | /** |
| 1918 | * copy data to the selection |
| 1919 | * |
| 1920 | * This request asks the compositor to set the selection to the |
| 1921 | * data from the source on behalf of the client. |
| 1922 | * |
| 1923 | * To unset the selection, set the source to NULL. |
| 1924 | * @param source data source for the selection |
| 1925 | * @param serial serial number of the event that triggered this request |
| 1926 | */ |
| 1927 | void (*set_selection)(struct wl_client *client, |
| 1928 | struct wl_resource *resource, |
| 1929 | struct wl_resource *source, |
| 1930 | uint32_t serial); |
| 1931 | /** |
| 1932 | * destroy data device |
| 1933 | * |
| 1934 | * This request destroys the data device. |
| 1935 | * @since 2 |
| 1936 | */ |
| 1937 | void (*release)(struct wl_client *client, |
| 1938 | struct wl_resource *resource); |
| 1939 | }; |
| 1940 | |
| 1941 | #define WL_DATA_DEVICE_DATA_OFFER 0 |
| 1942 | #define WL_DATA_DEVICE_ENTER 1 |
| 1943 | #define WL_DATA_DEVICE_LEAVE 2 |
| 1944 | #define WL_DATA_DEVICE_MOTION 3 |
| 1945 | #define WL_DATA_DEVICE_DROP 4 |
| 1946 | #define WL_DATA_DEVICE_SELECTION 5 |
| 1947 | |
| 1948 | /** |
| 1949 | * @ingroup iface_wl_data_device |
| 1950 | */ |
| 1951 | #define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1 |
| 1952 | /** |
| 1953 | * @ingroup iface_wl_data_device |
| 1954 | */ |
| 1955 | #define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1 |
| 1956 | /** |
| 1957 | * @ingroup iface_wl_data_device |
| 1958 | */ |
| 1959 | #define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1 |
| 1960 | /** |
| 1961 | * @ingroup iface_wl_data_device |
| 1962 | */ |
| 1963 | #define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1 |
| 1964 | /** |
| 1965 | * @ingroup iface_wl_data_device |
| 1966 | */ |
| 1967 | #define WL_DATA_DEVICE_DROP_SINCE_VERSION 1 |
| 1968 | /** |
| 1969 | * @ingroup iface_wl_data_device |
| 1970 | */ |
| 1971 | #define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1 |
| 1972 | |
| 1973 | /** |
| 1974 | * @ingroup iface_wl_data_device |
| 1975 | */ |
| 1976 | #define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1 |
| 1977 | /** |
| 1978 | * @ingroup iface_wl_data_device |
| 1979 | */ |
| 1980 | #define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1 |
| 1981 | /** |
| 1982 | * @ingroup iface_wl_data_device |
| 1983 | */ |
| 1984 | #define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2 |
| 1985 | |
| 1986 | /** |
| 1987 | * @ingroup iface_wl_data_device |
| 1988 | * Sends an data_offer event to the client owning the resource. |
| 1989 | * @param resource_ The client's resource |
| 1990 | * @param id the new data_offer object |
| 1991 | */ |
| 1992 | static inline void |
| 1993 | wl_data_device_send_data_offer(struct wl_resource *resource_, struct wl_resource *id) |
| 1994 | { |
| 1995 | wl_resource_post_event(resource_, WL_DATA_DEVICE_DATA_OFFER, id); |
| 1996 | } |
| 1997 | |
| 1998 | /** |
| 1999 | * @ingroup iface_wl_data_device |
| 2000 | * Sends an enter event to the client owning the resource. |
| 2001 | * @param resource_ The client's resource |
| 2002 | * @param serial serial number of the enter event |
| 2003 | * @param surface client surface entered |
| 2004 | * @param x surface-local x coordinate |
| 2005 | * @param y surface-local y coordinate |
| 2006 | * @param id source data_offer object |
| 2007 | */ |
| 2008 | static inline void |
| 2009 | wl_data_device_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y, struct wl_resource *id) |
| 2010 | { |
| 2011 | wl_resource_post_event(resource_, WL_DATA_DEVICE_ENTER, serial, surface, x, y, id); |
| 2012 | } |
| 2013 | |
| 2014 | /** |
| 2015 | * @ingroup iface_wl_data_device |
| 2016 | * Sends an leave event to the client owning the resource. |
| 2017 | * @param resource_ The client's resource |
| 2018 | */ |
| 2019 | static inline void |
| 2020 | wl_data_device_send_leave(struct wl_resource *resource_) |
| 2021 | { |
| 2022 | wl_resource_post_event(resource_, WL_DATA_DEVICE_LEAVE); |
| 2023 | } |
| 2024 | |
| 2025 | /** |
| 2026 | * @ingroup iface_wl_data_device |
| 2027 | * Sends an motion event to the client owning the resource. |
| 2028 | * @param resource_ The client's resource |
| 2029 | * @param time timestamp with millisecond granularity |
| 2030 | * @param x surface-local x coordinate |
| 2031 | * @param y surface-local y coordinate |
| 2032 | */ |
| 2033 | static inline void |
| 2034 | wl_data_device_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t x, wl_fixed_t y) |
| 2035 | { |
| 2036 | wl_resource_post_event(resource_, WL_DATA_DEVICE_MOTION, time, x, y); |
| 2037 | } |
| 2038 | |
| 2039 | /** |
| 2040 | * @ingroup iface_wl_data_device |
| 2041 | * Sends an drop event to the client owning the resource. |
| 2042 | * @param resource_ The client's resource |
| 2043 | */ |
| 2044 | static inline void |
| 2045 | wl_data_device_send_drop(struct wl_resource *resource_) |
| 2046 | { |
| 2047 | wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP); |
| 2048 | } |
| 2049 | |
| 2050 | /** |
| 2051 | * @ingroup iface_wl_data_device |
| 2052 | * Sends an selection event to the client owning the resource. |
| 2053 | * @param resource_ The client's resource |
| 2054 | * @param id selection data_offer object |
| 2055 | */ |
| 2056 | static inline void |
| 2057 | wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource *id) |
| 2058 | { |
| 2059 | wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id); |
| 2060 | } |
| 2061 | |
| 2062 | #ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM |
| 2063 | #define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM |
| 2064 | /** |
| 2065 | * @ingroup iface_wl_data_device_manager |
| 2066 | * drag and drop actions |
| 2067 | * |
| 2068 | * This is a bitmask of the available/preferred actions in a |
| 2069 | * drag-and-drop operation. |
| 2070 | * |
| 2071 | * In the compositor, the selected action is a result of matching the |
| 2072 | * actions offered by the source and destination sides. "action" events |
| 2073 | * with a "none" action will be sent to both source and destination if |
| 2074 | * there is no match. All further checks will effectively happen on |
| 2075 | * (source actions ∩ destination actions). |
| 2076 | * |
| 2077 | * In addition, compositors may also pick different actions in |
| 2078 | * reaction to key modifiers being pressed. One common design that |
| 2079 | * is used in major toolkits (and the behavior recommended for |
| 2080 | * compositors) is: |
| 2081 | * |
| 2082 | * - If no modifiers are pressed, the first match (in bit order) |
| 2083 | * will be used. |
| 2084 | * - Pressing Shift selects "move", if enabled in the mask. |
| 2085 | * - Pressing Control selects "copy", if enabled in the mask. |
| 2086 | * |
| 2087 | * Behavior beyond that is considered implementation-dependent. |
| 2088 | * Compositors may for example bind other modifiers (like Alt/Meta) |
| 2089 | * or drags initiated with other buttons than BTN_LEFT to specific |
| 2090 | * actions (e.g. "ask"). |
| 2091 | */ |
| 2092 | enum wl_data_device_manager_dnd_action { |
| 2093 | /** |
| 2094 | * no action |
| 2095 | */ |
| 2096 | WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0, |
| 2097 | /** |
| 2098 | * copy action |
| 2099 | */ |
| 2100 | WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1, |
| 2101 | /** |
| 2102 | * move action |
| 2103 | */ |
| 2104 | WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2, |
| 2105 | /** |
| 2106 | * ask action |
| 2107 | */ |
| 2108 | WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4, |
| 2109 | }; |
| 2110 | #endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */ |
| 2111 | |
| 2112 | /** |
| 2113 | * @ingroup iface_wl_data_device_manager |
| 2114 | * @struct wl_data_device_manager_interface |
| 2115 | */ |
| 2116 | struct wl_data_device_manager_interface { |
| 2117 | /** |
| 2118 | * create a new data source |
| 2119 | * |
| 2120 | * Create a new data source. |
| 2121 | * @param id data source to create |
| 2122 | */ |
| 2123 | void (*create_data_source)(struct wl_client *client, |
| 2124 | struct wl_resource *resource, |
| 2125 | uint32_t id); |
| 2126 | /** |
| 2127 | * create a new data device |
| 2128 | * |
| 2129 | * Create a new data device for a given seat. |
| 2130 | * @param id data device to create |
| 2131 | * @param seat seat associated with the data device |
| 2132 | */ |
| 2133 | void (*get_data_device)(struct wl_client *client, |
| 2134 | struct wl_resource *resource, |
| 2135 | uint32_t id, |
| 2136 | struct wl_resource *seat); |
| 2137 | }; |
| 2138 | |
| 2139 | |
| 2140 | /** |
| 2141 | * @ingroup iface_wl_data_device_manager |
| 2142 | */ |
| 2143 | #define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1 |
| 2144 | /** |
| 2145 | * @ingroup iface_wl_data_device_manager |
| 2146 | */ |
| 2147 | #define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1 |
| 2148 | |
| 2149 | #ifndef WL_SHELL_ERROR_ENUM |
| 2150 | #define WL_SHELL_ERROR_ENUM |
| 2151 | enum wl_shell_error { |
| 2152 | /** |
| 2153 | * given wl_surface has another role |
| 2154 | */ |
| 2155 | WL_SHELL_ERROR_ROLE = 0, |
| 2156 | }; |
| 2157 | #endif /* WL_SHELL_ERROR_ENUM */ |
| 2158 | |
| 2159 | /** |
| 2160 | * @ingroup iface_wl_shell |
| 2161 | * @struct wl_shell_interface |
| 2162 | */ |
| 2163 | struct wl_shell_interface { |
| 2164 | /** |
| 2165 | * create a shell surface from a surface |
| 2166 | * |
| 2167 | * Create a shell surface for an existing surface. This gives the |
| 2168 | * wl_surface the role of a shell surface. If the wl_surface |
| 2169 | * already has another role, it raises a protocol error. |
| 2170 | * |
| 2171 | * Only one shell surface can be associated with a given surface. |
| 2172 | * @param id shell surface to create |
| 2173 | * @param surface surface to be given the shell surface role |
| 2174 | */ |
| 2175 | void (*get_shell_surface)(struct wl_client *client, |
| 2176 | struct wl_resource *resource, |
| 2177 | uint32_t id, |
| 2178 | struct wl_resource *surface); |
| 2179 | }; |
| 2180 | |
| 2181 | |
| 2182 | /** |
| 2183 | * @ingroup iface_wl_shell |
| 2184 | */ |
| 2185 | #define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1 |
| 2186 | |
| 2187 | #ifndef WL_SHELL_SURFACE_RESIZE_ENUM |
| 2188 | #define WL_SHELL_SURFACE_RESIZE_ENUM |
| 2189 | /** |
| 2190 | * @ingroup iface_wl_shell_surface |
| 2191 | * edge values for resizing |
| 2192 | * |
| 2193 | * These values are used to indicate which edge of a surface |
| 2194 | * is being dragged in a resize operation. The server may |
| 2195 | * use this information to adapt its behavior, e.g. choose |
| 2196 | * an appropriate cursor image. |
| 2197 | */ |
| 2198 | enum wl_shell_surface_resize { |
| 2199 | /** |
| 2200 | * no edge |
| 2201 | */ |
| 2202 | WL_SHELL_SURFACE_RESIZE_NONE = 0, |
| 2203 | /** |
| 2204 | * top edge |
| 2205 | */ |
| 2206 | WL_SHELL_SURFACE_RESIZE_TOP = 1, |
| 2207 | /** |
| 2208 | * bottom edge |
| 2209 | */ |
| 2210 | WL_SHELL_SURFACE_RESIZE_BOTTOM = 2, |
| 2211 | /** |
| 2212 | * left edge |
| 2213 | */ |
| 2214 | WL_SHELL_SURFACE_RESIZE_LEFT = 4, |
| 2215 | /** |
| 2216 | * top and left edges |
| 2217 | */ |
| 2218 | WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5, |
| 2219 | /** |
| 2220 | * bottom and left edges |
| 2221 | */ |
| 2222 | WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6, |
| 2223 | /** |
| 2224 | * right edge |
| 2225 | */ |
| 2226 | WL_SHELL_SURFACE_RESIZE_RIGHT = 8, |
| 2227 | /** |
| 2228 | * top and right edges |
| 2229 | */ |
| 2230 | WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9, |
| 2231 | /** |
| 2232 | * bottom and right edges |
| 2233 | */ |
| 2234 | WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10, |
| 2235 | }; |
| 2236 | #endif /* WL_SHELL_SURFACE_RESIZE_ENUM */ |
| 2237 | |
| 2238 | #ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM |
| 2239 | #define WL_SHELL_SURFACE_TRANSIENT_ENUM |
| 2240 | /** |
| 2241 | * @ingroup iface_wl_shell_surface |
| 2242 | * details of transient behaviour |
| 2243 | * |
| 2244 | * These flags specify details of the expected behaviour |
| 2245 | * of transient surfaces. Used in the set_transient request. |
| 2246 | */ |
| 2247 | enum wl_shell_surface_transient { |
| 2248 | /** |
| 2249 | * do not set keyboard focus |
| 2250 | */ |
| 2251 | WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1, |
| 2252 | }; |
| 2253 | #endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */ |
| 2254 | |
| 2255 | #ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM |
| 2256 | #define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM |
| 2257 | /** |
| 2258 | * @ingroup iface_wl_shell_surface |
| 2259 | * different method to set the surface fullscreen |
| 2260 | * |
| 2261 | * Hints to indicate to the compositor how to deal with a conflict |
| 2262 | * between the dimensions of the surface and the dimensions of the |
| 2263 | * output. The compositor is free to ignore this parameter. |
| 2264 | */ |
| 2265 | enum wl_shell_surface_fullscreen_method { |
| 2266 | /** |
| 2267 | * no preference, apply default policy |
| 2268 | */ |
| 2269 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0, |
| 2270 | /** |
| 2271 | * scale, preserve the surface's aspect ratio and center on output |
| 2272 | */ |
| 2273 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1, |
| 2274 | /** |
| 2275 | * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch |
| 2276 | */ |
| 2277 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2, |
| 2278 | /** |
| 2279 | * no upscaling, center on output and add black borders to compensate size mismatch |
| 2280 | */ |
| 2281 | WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3, |
| 2282 | }; |
| 2283 | #endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */ |
| 2284 | |
| 2285 | /** |
| 2286 | * @ingroup iface_wl_shell_surface |
| 2287 | * @struct wl_shell_surface_interface |
| 2288 | */ |
| 2289 | struct wl_shell_surface_interface { |
| 2290 | /** |
| 2291 | * respond to a ping event |
| 2292 | * |
| 2293 | * A client must respond to a ping event with a pong request or |
| 2294 | * the client may be deemed unresponsive. |
| 2295 | * @param serial serial number of the ping event |
| 2296 | */ |
| 2297 | void (*pong)(struct wl_client *client, |
| 2298 | struct wl_resource *resource, |
| 2299 | uint32_t serial); |
| 2300 | /** |
| 2301 | * start an interactive move |
| 2302 | * |
| 2303 | * Start a pointer-driven move of the surface. |
| 2304 | * |
| 2305 | * This request must be used in response to a button press event. |
| 2306 | * The server may ignore move requests depending on the state of |
| 2307 | * the surface (e.g. fullscreen or maximized). |
| 2308 | * @param seat seat whose pointer is used |
| 2309 | * @param serial serial number of the implicit grab on the pointer |
| 2310 | */ |
| 2311 | void (*move)(struct wl_client *client, |
| 2312 | struct wl_resource *resource, |
| 2313 | struct wl_resource *seat, |
| 2314 | uint32_t serial); |
| 2315 | /** |
| 2316 | * start an interactive resize |
| 2317 | * |
| 2318 | * Start a pointer-driven resizing of the surface. |
| 2319 | * |
| 2320 | * This request must be used in response to a button press event. |
| 2321 | * The server may ignore resize requests depending on the state of |
| 2322 | * the surface (e.g. fullscreen or maximized). |
| 2323 | * @param seat seat whose pointer is used |
| 2324 | * @param serial serial number of the implicit grab on the pointer |
| 2325 | * @param edges which edge or corner is being dragged |
| 2326 | */ |
| 2327 | void (*resize)(struct wl_client *client, |
| 2328 | struct wl_resource *resource, |
| 2329 | struct wl_resource *seat, |
| 2330 | uint32_t serial, |
| 2331 | uint32_t edges); |
| 2332 | /** |
| 2333 | * make the surface a toplevel surface |
| 2334 | * |
| 2335 | * Map the surface as a toplevel surface. |
| 2336 | * |
| 2337 | * A toplevel surface is not fullscreen, maximized or transient. |
| 2338 | */ |
| 2339 | void (*set_toplevel)(struct wl_client *client, |
| 2340 | struct wl_resource *resource); |
| 2341 | /** |
| 2342 | * make the surface a transient surface |
| 2343 | * |
| 2344 | * Map the surface relative to an existing surface. |
| 2345 | * |
| 2346 | * The x and y arguments specify the location of the upper left |
| 2347 | * corner of the surface relative to the upper left corner of the |
| 2348 | * parent surface, in surface-local coordinates. |
| 2349 | * |
| 2350 | * The flags argument controls details of the transient behaviour. |
| 2351 | * @param parent parent surface |
| 2352 | * @param x surface-local x coordinate |
| 2353 | * @param y surface-local y coordinate |
| 2354 | * @param flags transient surface behavior |
| 2355 | */ |
| 2356 | void (*set_transient)(struct wl_client *client, |
| 2357 | struct wl_resource *resource, |
| 2358 | struct wl_resource *parent, |
| 2359 | int32_t x, |
| 2360 | int32_t y, |
| 2361 | uint32_t flags); |
| 2362 | /** |
| 2363 | * make the surface a fullscreen surface |
| 2364 | * |
| 2365 | * Map the surface as a fullscreen surface. |
| 2366 | * |
| 2367 | * If an output parameter is given then the surface will be made |
| 2368 | * fullscreen on that output. If the client does not specify the |
| 2369 | * output then the compositor will apply its policy - usually |
| 2370 | * choosing the output on which the surface has the biggest surface |
| 2371 | * area. |
| 2372 | * |
| 2373 | * The client may specify a method to resolve a size conflict |
| 2374 | * between the output size and the surface size - this is provided |
| 2375 | * through the method parameter. |
| 2376 | * |
| 2377 | * The framerate parameter is used only when the method is set to |
| 2378 | * "driver", to indicate the preferred framerate. A value of 0 |
| 2379 | * indicates that the client does not care about framerate. The |
| 2380 | * framerate is specified in mHz, that is framerate of 60000 is |
| 2381 | * 60Hz. |
| 2382 | * |
| 2383 | * A method of "scale" or "driver" implies a scaling operation of |
| 2384 | * the surface, either via a direct scaling operation or a change |
| 2385 | * of the output mode. This will override any kind of output |
| 2386 | * scaling, so that mapping a surface with a buffer size equal to |
| 2387 | * the mode can fill the screen independent of buffer_scale. |
| 2388 | * |
| 2389 | * A method of "fill" means we don't scale up the buffer, however |
| 2390 | * any output scale is applied. This means that you may run into an |
| 2391 | * edge case where the application maps a buffer with the same size |
| 2392 | * of the output mode but buffer_scale 1 (thus making a surface |
| 2393 | * larger than the output). In this case it is allowed to downscale |
| 2394 | * the results to fit the screen. |
| 2395 | * |
| 2396 | * The compositor must reply to this request with a configure event |
| 2397 | * with the dimensions for the output on which the surface will be |
| 2398 | * made fullscreen. |
| 2399 | * @param method method for resolving size conflict |
| 2400 | * @param framerate framerate in mHz |
| 2401 | * @param output output on which the surface is to be fullscreen |
| 2402 | */ |
| 2403 | void (*set_fullscreen)(struct wl_client *client, |
| 2404 | struct wl_resource *resource, |
| 2405 | uint32_t method, |
| 2406 | uint32_t framerate, |
| 2407 | struct wl_resource *output); |
| 2408 | /** |
| 2409 | * make the surface a popup surface |
| 2410 | * |
| 2411 | * Map the surface as a popup. |
| 2412 | * |
| 2413 | * A popup surface is a transient surface with an added pointer |
| 2414 | * grab. |
| 2415 | * |
| 2416 | * An existing implicit grab will be changed to owner-events mode, |
| 2417 | * and the popup grab will continue after the implicit grab ends |
| 2418 | * (i.e. releasing the mouse button does not cause the popup to be |
| 2419 | * unmapped). |
| 2420 | * |
| 2421 | * The popup grab continues until the window is destroyed or a |
| 2422 | * mouse button is pressed in any other client's window. A click in |
| 2423 | * any of the client's surfaces is reported as normal, however, |
| 2424 | * clicks in other clients' surfaces will be discarded and trigger |
| 2425 | * the callback. |
| 2426 | * |
| 2427 | * The x and y arguments specify the location of the upper left |
| 2428 | * corner of the surface relative to the upper left corner of the |
| 2429 | * parent surface, in surface-local coordinates. |
| 2430 | * @param seat seat whose pointer is used |
| 2431 | * @param serial serial number of the implicit grab on the pointer |
| 2432 | * @param parent parent surface |
| 2433 | * @param x surface-local x coordinate |
| 2434 | * @param y surface-local y coordinate |
| 2435 | * @param flags transient surface behavior |
| 2436 | */ |
| 2437 | void (*)(struct wl_client *client, |
| 2438 | struct wl_resource *resource, |
| 2439 | struct wl_resource *seat, |
| 2440 | uint32_t serial, |
| 2441 | struct wl_resource *parent, |
| 2442 | int32_t x, |
| 2443 | int32_t y, |
| 2444 | uint32_t flags); |
| 2445 | /** |
| 2446 | * make the surface a maximized surface |
| 2447 | * |
| 2448 | * Map the surface as a maximized surface. |
| 2449 | * |
| 2450 | * If an output parameter is given then the surface will be |
| 2451 | * maximized on that output. If the client does not specify the |
| 2452 | * output then the compositor will apply its policy - usually |
| 2453 | * choosing the output on which the surface has the biggest surface |
| 2454 | * area. |
| 2455 | * |
| 2456 | * The compositor will reply with a configure event telling the |
| 2457 | * expected new surface size. The operation is completed on the |
| 2458 | * next buffer attach to this surface. |
| 2459 | * |
| 2460 | * A maximized surface typically fills the entire output it is |
| 2461 | * bound to, except for desktop elements such as panels. This is |
| 2462 | * the main difference between a maximized shell surface and a |
| 2463 | * fullscreen shell surface. |
| 2464 | * |
| 2465 | * The details depend on the compositor implementation. |
| 2466 | * @param output output on which the surface is to be maximized |
| 2467 | */ |
| 2468 | void (*set_maximized)(struct wl_client *client, |
| 2469 | struct wl_resource *resource, |
| 2470 | struct wl_resource *output); |
| 2471 | /** |
| 2472 | * set surface title |
| 2473 | * |
| 2474 | * Set a short title for the surface. |
| 2475 | * |
| 2476 | * This string may be used to identify the surface in a task bar, |
| 2477 | * window list, or other user interface elements provided by the |
| 2478 | * compositor. |
| 2479 | * |
| 2480 | * The string must be encoded in UTF-8. |
| 2481 | * @param title surface title |
| 2482 | */ |
| 2483 | void (*set_title)(struct wl_client *client, |
| 2484 | struct wl_resource *resource, |
| 2485 | const char *title); |
| 2486 | /** |
| 2487 | * set surface class |
| 2488 | * |
| 2489 | * Set a class for the surface. |
| 2490 | * |
| 2491 | * The surface class identifies the general class of applications |
| 2492 | * to which the surface belongs. A common convention is to use the |
| 2493 | * file name (or the full path if it is a non-standard location) of |
| 2494 | * the application's .desktop file as the class. |
| 2495 | * @param class_ surface class |
| 2496 | */ |
| 2497 | void (*set_class)(struct wl_client *client, |
| 2498 | struct wl_resource *resource, |
| 2499 | const char *class_); |
| 2500 | }; |
| 2501 | |
| 2502 | #define WL_SHELL_SURFACE_PING 0 |
| 2503 | #define WL_SHELL_SURFACE_CONFIGURE 1 |
| 2504 | #define 2 |
| 2505 | |
| 2506 | /** |
| 2507 | * @ingroup iface_wl_shell_surface |
| 2508 | */ |
| 2509 | #define WL_SHELL_SURFACE_PING_SINCE_VERSION 1 |
| 2510 | /** |
| 2511 | * @ingroup iface_wl_shell_surface |
| 2512 | */ |
| 2513 | #define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1 |
| 2514 | /** |
| 2515 | * @ingroup iface_wl_shell_surface |
| 2516 | */ |
| 2517 | #define 1 |
| 2518 | |
| 2519 | /** |
| 2520 | * @ingroup iface_wl_shell_surface |
| 2521 | */ |
| 2522 | #define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1 |
| 2523 | /** |
| 2524 | * @ingroup iface_wl_shell_surface |
| 2525 | */ |
| 2526 | #define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1 |
| 2527 | /** |
| 2528 | * @ingroup iface_wl_shell_surface |
| 2529 | */ |
| 2530 | #define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1 |
| 2531 | /** |
| 2532 | * @ingroup iface_wl_shell_surface |
| 2533 | */ |
| 2534 | #define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1 |
| 2535 | /** |
| 2536 | * @ingroup iface_wl_shell_surface |
| 2537 | */ |
| 2538 | #define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1 |
| 2539 | /** |
| 2540 | * @ingroup iface_wl_shell_surface |
| 2541 | */ |
| 2542 | #define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1 |
| 2543 | /** |
| 2544 | * @ingroup iface_wl_shell_surface |
| 2545 | */ |
| 2546 | #define 1 |
| 2547 | /** |
| 2548 | * @ingroup iface_wl_shell_surface |
| 2549 | */ |
| 2550 | #define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1 |
| 2551 | /** |
| 2552 | * @ingroup iface_wl_shell_surface |
| 2553 | */ |
| 2554 | #define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1 |
| 2555 | /** |
| 2556 | * @ingroup iface_wl_shell_surface |
| 2557 | */ |
| 2558 | #define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1 |
| 2559 | |
| 2560 | /** |
| 2561 | * @ingroup iface_wl_shell_surface |
| 2562 | * Sends an ping event to the client owning the resource. |
| 2563 | * @param resource_ The client's resource |
| 2564 | * @param serial serial number of the ping |
| 2565 | */ |
| 2566 | static inline void |
| 2567 | wl_shell_surface_send_ping(struct wl_resource *resource_, uint32_t serial) |
| 2568 | { |
| 2569 | wl_resource_post_event(resource_, WL_SHELL_SURFACE_PING, serial); |
| 2570 | } |
| 2571 | |
| 2572 | /** |
| 2573 | * @ingroup iface_wl_shell_surface |
| 2574 | * Sends an configure event to the client owning the resource. |
| 2575 | * @param resource_ The client's resource |
| 2576 | * @param edges how the surface was resized |
| 2577 | * @param width new width of the surface |
| 2578 | * @param height new height of the surface |
| 2579 | */ |
| 2580 | static inline void |
| 2581 | wl_shell_surface_send_configure(struct wl_resource *resource_, uint32_t edges, int32_t width, int32_t height) |
| 2582 | { |
| 2583 | wl_resource_post_event(resource_, WL_SHELL_SURFACE_CONFIGURE, edges, width, height); |
| 2584 | } |
| 2585 | |
| 2586 | /** |
| 2587 | * @ingroup iface_wl_shell_surface |
| 2588 | * Sends an popup_done event to the client owning the resource. |
| 2589 | * @param resource_ The client's resource |
| 2590 | */ |
| 2591 | static inline void |
| 2592 | (struct wl_resource *resource_) |
| 2593 | { |
| 2594 | wl_resource_post_event(resource_, WL_SHELL_SURFACE_POPUP_DONE); |
| 2595 | } |
| 2596 | |
| 2597 | #ifndef WL_SURFACE_ERROR_ENUM |
| 2598 | #define WL_SURFACE_ERROR_ENUM |
| 2599 | /** |
| 2600 | * @ingroup iface_wl_surface |
| 2601 | * wl_surface error values |
| 2602 | * |
| 2603 | * These errors can be emitted in response to wl_surface requests. |
| 2604 | */ |
| 2605 | enum wl_surface_error { |
| 2606 | /** |
| 2607 | * buffer scale value is invalid |
| 2608 | */ |
| 2609 | WL_SURFACE_ERROR_INVALID_SCALE = 0, |
| 2610 | /** |
| 2611 | * buffer transform value is invalid |
| 2612 | */ |
| 2613 | WL_SURFACE_ERROR_INVALID_TRANSFORM = 1, |
| 2614 | }; |
| 2615 | #endif /* WL_SURFACE_ERROR_ENUM */ |
| 2616 | |
| 2617 | /** |
| 2618 | * @ingroup iface_wl_surface |
| 2619 | * @struct wl_surface_interface |
| 2620 | */ |
| 2621 | struct wl_surface_interface { |
| 2622 | /** |
| 2623 | * delete surface |
| 2624 | * |
| 2625 | * Deletes the surface and invalidates its object ID. |
| 2626 | */ |
| 2627 | void (*destroy)(struct wl_client *client, |
| 2628 | struct wl_resource *resource); |
| 2629 | /** |
| 2630 | * set the surface contents |
| 2631 | * |
| 2632 | * Set a buffer as the content of this surface. |
| 2633 | * |
| 2634 | * The new size of the surface is calculated based on the buffer |
| 2635 | * size transformed by the inverse buffer_transform and the inverse |
| 2636 | * buffer_scale. This means that the supplied buffer must be an |
| 2637 | * integer multiple of the buffer_scale. |
| 2638 | * |
| 2639 | * The x and y arguments specify the location of the new pending |
| 2640 | * buffer's upper left corner, relative to the current buffer's |
| 2641 | * upper left corner, in surface-local coordinates. In other words, |
| 2642 | * the x and y, combined with the new surface size define in which |
| 2643 | * directions the surface's size changes. |
| 2644 | * |
| 2645 | * Surface contents are double-buffered state, see |
| 2646 | * wl_surface.commit. |
| 2647 | * |
| 2648 | * The initial surface contents are void; there is no content. |
| 2649 | * wl_surface.attach assigns the given wl_buffer as the pending |
| 2650 | * wl_buffer. wl_surface.commit makes the pending wl_buffer the new |
| 2651 | * surface contents, and the size of the surface becomes the size |
| 2652 | * calculated from the wl_buffer, as described above. After commit, |
| 2653 | * there is no pending buffer until the next attach. |
| 2654 | * |
| 2655 | * Committing a pending wl_buffer allows the compositor to read the |
| 2656 | * pixels in the wl_buffer. The compositor may access the pixels at |
| 2657 | * any time after the wl_surface.commit request. When the |
| 2658 | * compositor will not access the pixels anymore, it will send the |
| 2659 | * wl_buffer.release event. Only after receiving wl_buffer.release, |
| 2660 | * the client may reuse the wl_buffer. A wl_buffer that has been |
| 2661 | * attached and then replaced by another attach instead of |
| 2662 | * committed will not receive a release event, and is not used by |
| 2663 | * the compositor. |
| 2664 | * |
| 2665 | * Destroying the wl_buffer after wl_buffer.release does not change |
| 2666 | * the surface contents. However, if the client destroys the |
| 2667 | * wl_buffer before receiving the wl_buffer.release event, the |
| 2668 | * surface contents become undefined immediately. |
| 2669 | * |
| 2670 | * If wl_surface.attach is sent with a NULL wl_buffer, the |
| 2671 | * following wl_surface.commit will remove the surface content. |
| 2672 | * @param buffer buffer of surface contents |
| 2673 | * @param x surface-local x coordinate |
| 2674 | * @param y surface-local y coordinate |
| 2675 | */ |
| 2676 | void (*attach)(struct wl_client *client, |
| 2677 | struct wl_resource *resource, |
| 2678 | struct wl_resource *buffer, |
| 2679 | int32_t x, |
| 2680 | int32_t y); |
| 2681 | /** |
| 2682 | * mark part of the surface damaged |
| 2683 | * |
| 2684 | * This request is used to describe the regions where the pending |
| 2685 | * buffer is different from the current surface contents, and where |
| 2686 | * the surface therefore needs to be repainted. The compositor |
| 2687 | * ignores the parts of the damage that fall outside of the |
| 2688 | * surface. |
| 2689 | * |
| 2690 | * Damage is double-buffered state, see wl_surface.commit. |
| 2691 | * |
| 2692 | * The damage rectangle is specified in surface-local coordinates, |
| 2693 | * where x and y specify the upper left corner of the damage |
| 2694 | * rectangle. |
| 2695 | * |
| 2696 | * The initial value for pending damage is empty: no damage. |
| 2697 | * wl_surface.damage adds pending damage: the new pending damage is |
| 2698 | * the union of old pending damage and the given rectangle. |
| 2699 | * |
| 2700 | * wl_surface.commit assigns pending damage as the current damage, |
| 2701 | * and clears pending damage. The server will clear the current |
| 2702 | * damage as it repaints the surface. |
| 2703 | * |
| 2704 | * Alternatively, damage can be posted with |
| 2705 | * wl_surface.damage_buffer which uses buffer coordinates instead |
| 2706 | * of surface coordinates, and is probably the preferred and |
| 2707 | * intuitive way of doing this. |
| 2708 | * @param x surface-local x coordinate |
| 2709 | * @param y surface-local y coordinate |
| 2710 | * @param width width of damage rectangle |
| 2711 | * @param height height of damage rectangle |
| 2712 | */ |
| 2713 | void (*damage)(struct wl_client *client, |
| 2714 | struct wl_resource *resource, |
| 2715 | int32_t x, |
| 2716 | int32_t y, |
| 2717 | int32_t width, |
| 2718 | int32_t height); |
| 2719 | /** |
| 2720 | * request a frame throttling hint |
| 2721 | * |
| 2722 | * Request a notification when it is a good time to start drawing |
| 2723 | * a new frame, by creating a frame callback. This is useful for |
| 2724 | * throttling redrawing operations, and driving animations. |
| 2725 | * |
| 2726 | * When a client is animating on a wl_surface, it can use the |
| 2727 | * 'frame' request to get notified when it is a good time to draw |
| 2728 | * and commit the next frame of animation. If the client commits an |
| 2729 | * update earlier than that, it is likely that some updates will |
| 2730 | * not make it to the display, and the client is wasting resources |
| 2731 | * by drawing too often. |
| 2732 | * |
| 2733 | * The frame request will take effect on the next |
| 2734 | * wl_surface.commit. The notification will only be posted for one |
| 2735 | * frame unless requested again. For a wl_surface, the |
| 2736 | * notifications are posted in the order the frame requests were |
| 2737 | * committed. |
| 2738 | * |
| 2739 | * The server must send the notifications so that a client will not |
| 2740 | * send excessive updates, while still allowing the highest |
| 2741 | * possible update rate for clients that wait for the reply before |
| 2742 | * drawing again. The server should give some time for the client |
| 2743 | * to draw and commit after sending the frame callback events to |
| 2744 | * let it hit the next output refresh. |
| 2745 | * |
| 2746 | * A server should avoid signaling the frame callbacks if the |
| 2747 | * surface is not visible in any way, e.g. the surface is |
| 2748 | * off-screen, or completely obscured by other opaque surfaces. |
| 2749 | * |
| 2750 | * The object returned by this request will be destroyed by the |
| 2751 | * compositor after the callback is fired and as such the client |
| 2752 | * must not attempt to use it after that point. |
| 2753 | * |
| 2754 | * The callback_data passed in the callback is the current time, in |
| 2755 | * milliseconds, with an undefined base. |
| 2756 | * @param callback callback object for the frame request |
| 2757 | */ |
| 2758 | void (*frame)(struct wl_client *client, |
| 2759 | struct wl_resource *resource, |
| 2760 | uint32_t callback); |
| 2761 | /** |
| 2762 | * set opaque region |
| 2763 | * |
| 2764 | * This request sets the region of the surface that contains |
| 2765 | * opaque content. |
| 2766 | * |
| 2767 | * The opaque region is an optimization hint for the compositor |
| 2768 | * that lets it optimize the redrawing of content behind opaque |
| 2769 | * regions. Setting an opaque region is not required for correct |
| 2770 | * behaviour, but marking transparent content as opaque will result |
| 2771 | * in repaint artifacts. |
| 2772 | * |
| 2773 | * The opaque region is specified in surface-local coordinates. |
| 2774 | * |
| 2775 | * The compositor ignores the parts of the opaque region that fall |
| 2776 | * outside of the surface. |
| 2777 | * |
| 2778 | * Opaque region is double-buffered state, see wl_surface.commit. |
| 2779 | * |
| 2780 | * wl_surface.set_opaque_region changes the pending opaque region. |
| 2781 | * wl_surface.commit copies the pending region to the current |
| 2782 | * region. Otherwise, the pending and current regions are never |
| 2783 | * changed. |
| 2784 | * |
| 2785 | * The initial value for an opaque region is empty. Setting the |
| 2786 | * pending opaque region has copy semantics, and the wl_region |
| 2787 | * object can be destroyed immediately. A NULL wl_region causes the |
| 2788 | * pending opaque region to be set to empty. |
| 2789 | * @param region opaque region of the surface |
| 2790 | */ |
| 2791 | void (*set_opaque_region)(struct wl_client *client, |
| 2792 | struct wl_resource *resource, |
| 2793 | struct wl_resource *region); |
| 2794 | /** |
| 2795 | * set input region |
| 2796 | * |
| 2797 | * This request sets the region of the surface that can receive |
| 2798 | * pointer and touch events. |
| 2799 | * |
| 2800 | * Input events happening outside of this region will try the next |
| 2801 | * surface in the server surface stack. The compositor ignores the |
| 2802 | * parts of the input region that fall outside of the surface. |
| 2803 | * |
| 2804 | * The input region is specified in surface-local coordinates. |
| 2805 | * |
| 2806 | * Input region is double-buffered state, see wl_surface.commit. |
| 2807 | * |
| 2808 | * wl_surface.set_input_region changes the pending input region. |
| 2809 | * wl_surface.commit copies the pending region to the current |
| 2810 | * region. Otherwise the pending and current regions are never |
| 2811 | * changed, except cursor and icon surfaces are special cases, see |
| 2812 | * wl_pointer.set_cursor and wl_data_device.start_drag. |
| 2813 | * |
| 2814 | * The initial value for an input region is infinite. That means |
| 2815 | * the whole surface will accept input. Setting the pending input |
| 2816 | * region has copy semantics, and the wl_region object can be |
| 2817 | * destroyed immediately. A NULL wl_region causes the input region |
| 2818 | * to be set to infinite. |
| 2819 | * @param region input region of the surface |
| 2820 | */ |
| 2821 | void (*set_input_region)(struct wl_client *client, |
| 2822 | struct wl_resource *resource, |
| 2823 | struct wl_resource *region); |
| 2824 | /** |
| 2825 | * commit pending surface state |
| 2826 | * |
| 2827 | * Surface state (input, opaque, and damage regions, attached |
| 2828 | * buffers, etc.) is double-buffered. Protocol requests modify the |
| 2829 | * pending state, as opposed to the current state in use by the |
| 2830 | * compositor. A commit request atomically applies all pending |
| 2831 | * state, replacing the current state. After commit, the new |
| 2832 | * pending state is as documented for each related request. |
| 2833 | * |
| 2834 | * On commit, a pending wl_buffer is applied first, and all other |
| 2835 | * state second. This means that all coordinates in double-buffered |
| 2836 | * state are relative to the new wl_buffer coming into use, except |
| 2837 | * for wl_surface.attach itself. If there is no pending wl_buffer, |
| 2838 | * the coordinates are relative to the current surface contents. |
| 2839 | * |
| 2840 | * All requests that need a commit to become effective are |
| 2841 | * documented to affect double-buffered state. |
| 2842 | * |
| 2843 | * Other interfaces may add further double-buffered surface state. |
| 2844 | */ |
| 2845 | void (*commit)(struct wl_client *client, |
| 2846 | struct wl_resource *resource); |
| 2847 | /** |
| 2848 | * sets the buffer transformation |
| 2849 | * |
| 2850 | * This request sets an optional transformation on how the |
| 2851 | * compositor interprets the contents of the buffer attached to the |
| 2852 | * surface. The accepted values for the transform parameter are the |
| 2853 | * values for wl_output.transform. |
| 2854 | * |
| 2855 | * Buffer transform is double-buffered state, see |
| 2856 | * wl_surface.commit. |
| 2857 | * |
| 2858 | * A newly created surface has its buffer transformation set to |
| 2859 | * normal. |
| 2860 | * |
| 2861 | * wl_surface.set_buffer_transform changes the pending buffer |
| 2862 | * transformation. wl_surface.commit copies the pending buffer |
| 2863 | * transformation to the current one. Otherwise, the pending and |
| 2864 | * current values are never changed. |
| 2865 | * |
| 2866 | * The purpose of this request is to allow clients to render |
| 2867 | * content according to the output transform, thus permitting the |
| 2868 | * compositor to use certain optimizations even if the display is |
| 2869 | * rotated. Using hardware overlays and scanning out a client |
| 2870 | * buffer for fullscreen surfaces are examples of such |
| 2871 | * optimizations. Those optimizations are highly dependent on the |
| 2872 | * compositor implementation, so the use of this request should be |
| 2873 | * considered on a case-by-case basis. |
| 2874 | * |
| 2875 | * Note that if the transform value includes 90 or 270 degree |
| 2876 | * rotation, the width of the buffer will become the surface height |
| 2877 | * and the height of the buffer will become the surface width. |
| 2878 | * |
| 2879 | * If transform is not one of the values from the |
| 2880 | * wl_output.transform enum the invalid_transform protocol error is |
| 2881 | * raised. |
| 2882 | * @param transform transform for interpreting buffer contents |
| 2883 | * @since 2 |
| 2884 | */ |
| 2885 | void (*set_buffer_transform)(struct wl_client *client, |
| 2886 | struct wl_resource *resource, |
| 2887 | int32_t transform); |
| 2888 | /** |
| 2889 | * sets the buffer scaling factor |
| 2890 | * |
| 2891 | * This request sets an optional scaling factor on how the |
| 2892 | * compositor interprets the contents of the buffer attached to the |
| 2893 | * window. |
| 2894 | * |
| 2895 | * Buffer scale is double-buffered state, see wl_surface.commit. |
| 2896 | * |
| 2897 | * A newly created surface has its buffer scale set to 1. |
| 2898 | * |
| 2899 | * wl_surface.set_buffer_scale changes the pending buffer scale. |
| 2900 | * wl_surface.commit copies the pending buffer scale to the current |
| 2901 | * one. Otherwise, the pending and current values are never |
| 2902 | * changed. |
| 2903 | * |
| 2904 | * The purpose of this request is to allow clients to supply higher |
| 2905 | * resolution buffer data for use on high resolution outputs. It is |
| 2906 | * intended that you pick the same buffer scale as the scale of the |
| 2907 | * output that the surface is displayed on. This means the |
| 2908 | * compositor can avoid scaling when rendering the surface on that |
| 2909 | * output. |
| 2910 | * |
| 2911 | * Note that if the scale is larger than 1, then you have to attach |
| 2912 | * a buffer that is larger (by a factor of scale in each dimension) |
| 2913 | * than the desired surface size. |
| 2914 | * |
| 2915 | * If scale is not positive the invalid_scale protocol error is |
| 2916 | * raised. |
| 2917 | * @param scale positive scale for interpreting buffer contents |
| 2918 | * @since 3 |
| 2919 | */ |
| 2920 | void (*set_buffer_scale)(struct wl_client *client, |
| 2921 | struct wl_resource *resource, |
| 2922 | int32_t scale); |
| 2923 | /** |
| 2924 | * mark part of the surface damaged using buffer coordinates |
| 2925 | * |
| 2926 | * This request is used to describe the regions where the pending |
| 2927 | * buffer is different from the current surface contents, and where |
| 2928 | * the surface therefore needs to be repainted. The compositor |
| 2929 | * ignores the parts of the damage that fall outside of the |
| 2930 | * surface. |
| 2931 | * |
| 2932 | * Damage is double-buffered state, see wl_surface.commit. |
| 2933 | * |
| 2934 | * The damage rectangle is specified in buffer coordinates, where x |
| 2935 | * and y specify the upper left corner of the damage rectangle. |
| 2936 | * |
| 2937 | * The initial value for pending damage is empty: no damage. |
| 2938 | * wl_surface.damage_buffer adds pending damage: the new pending |
| 2939 | * damage is the union of old pending damage and the given |
| 2940 | * rectangle. |
| 2941 | * |
| 2942 | * wl_surface.commit assigns pending damage as the current damage, |
| 2943 | * and clears pending damage. The server will clear the current |
| 2944 | * damage as it repaints the surface. |
| 2945 | * |
| 2946 | * This request differs from wl_surface.damage in only one way - it |
| 2947 | * takes damage in buffer coordinates instead of surface-local |
| 2948 | * coordinates. While this generally is more intuitive than surface |
| 2949 | * coordinates, it is especially desirable when using wp_viewport |
| 2950 | * or when a drawing library (like EGL) is unaware of buffer scale |
| 2951 | * and buffer transform. |
| 2952 | * |
| 2953 | * Note: Because buffer transformation changes and damage requests |
| 2954 | * may be interleaved in the protocol stream, it is impossible to |
| 2955 | * determine the actual mapping between surface and buffer damage |
| 2956 | * until wl_surface.commit time. Therefore, compositors wishing to |
| 2957 | * take both kinds of damage into account will have to accumulate |
| 2958 | * damage from the two requests separately and only transform from |
| 2959 | * one to the other after receiving the wl_surface.commit. |
| 2960 | * @param x buffer-local x coordinate |
| 2961 | * @param y buffer-local y coordinate |
| 2962 | * @param width width of damage rectangle |
| 2963 | * @param height height of damage rectangle |
| 2964 | * @since 4 |
| 2965 | */ |
| 2966 | void (*damage_buffer)(struct wl_client *client, |
| 2967 | struct wl_resource *resource, |
| 2968 | int32_t x, |
| 2969 | int32_t y, |
| 2970 | int32_t width, |
| 2971 | int32_t height); |
| 2972 | }; |
| 2973 | |
| 2974 | #define WL_SURFACE_ENTER 0 |
| 2975 | #define WL_SURFACE_LEAVE 1 |
| 2976 | |
| 2977 | /** |
| 2978 | * @ingroup iface_wl_surface |
| 2979 | */ |
| 2980 | #define WL_SURFACE_ENTER_SINCE_VERSION 1 |
| 2981 | /** |
| 2982 | * @ingroup iface_wl_surface |
| 2983 | */ |
| 2984 | #define WL_SURFACE_LEAVE_SINCE_VERSION 1 |
| 2985 | |
| 2986 | /** |
| 2987 | * @ingroup iface_wl_surface |
| 2988 | */ |
| 2989 | #define WL_SURFACE_DESTROY_SINCE_VERSION 1 |
| 2990 | /** |
| 2991 | * @ingroup iface_wl_surface |
| 2992 | */ |
| 2993 | #define WL_SURFACE_ATTACH_SINCE_VERSION 1 |
| 2994 | /** |
| 2995 | * @ingroup iface_wl_surface |
| 2996 | */ |
| 2997 | #define WL_SURFACE_DAMAGE_SINCE_VERSION 1 |
| 2998 | /** |
| 2999 | * @ingroup iface_wl_surface |
| 3000 | */ |
| 3001 | #define WL_SURFACE_FRAME_SINCE_VERSION 1 |
| 3002 | /** |
| 3003 | * @ingroup iface_wl_surface |
| 3004 | */ |
| 3005 | #define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1 |
| 3006 | /** |
| 3007 | * @ingroup iface_wl_surface |
| 3008 | */ |
| 3009 | #define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1 |
| 3010 | /** |
| 3011 | * @ingroup iface_wl_surface |
| 3012 | */ |
| 3013 | #define WL_SURFACE_COMMIT_SINCE_VERSION 1 |
| 3014 | /** |
| 3015 | * @ingroup iface_wl_surface |
| 3016 | */ |
| 3017 | #define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2 |
| 3018 | /** |
| 3019 | * @ingroup iface_wl_surface |
| 3020 | */ |
| 3021 | #define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3 |
| 3022 | /** |
| 3023 | * @ingroup iface_wl_surface |
| 3024 | */ |
| 3025 | #define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4 |
| 3026 | |
| 3027 | /** |
| 3028 | * @ingroup iface_wl_surface |
| 3029 | * Sends an enter event to the client owning the resource. |
| 3030 | * @param resource_ The client's resource |
| 3031 | * @param output output entered by the surface |
| 3032 | */ |
| 3033 | static inline void |
| 3034 | wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output) |
| 3035 | { |
| 3036 | wl_resource_post_event(resource_, WL_SURFACE_ENTER, output); |
| 3037 | } |
| 3038 | |
| 3039 | /** |
| 3040 | * @ingroup iface_wl_surface |
| 3041 | * Sends an leave event to the client owning the resource. |
| 3042 | * @param resource_ The client's resource |
| 3043 | * @param output output left by the surface |
| 3044 | */ |
| 3045 | static inline void |
| 3046 | wl_surface_send_leave(struct wl_resource *resource_, struct wl_resource *output) |
| 3047 | { |
| 3048 | wl_resource_post_event(resource_, WL_SURFACE_LEAVE, output); |
| 3049 | } |
| 3050 | |
| 3051 | #ifndef WL_SEAT_CAPABILITY_ENUM |
| 3052 | #define WL_SEAT_CAPABILITY_ENUM |
| 3053 | /** |
| 3054 | * @ingroup iface_wl_seat |
| 3055 | * seat capability bitmask |
| 3056 | * |
| 3057 | * This is a bitmask of capabilities this seat has; if a member is |
| 3058 | * set, then it is present on the seat. |
| 3059 | */ |
| 3060 | enum wl_seat_capability { |
| 3061 | /** |
| 3062 | * the seat has pointer devices |
| 3063 | */ |
| 3064 | WL_SEAT_CAPABILITY_POINTER = 1, |
| 3065 | /** |
| 3066 | * the seat has one or more keyboards |
| 3067 | */ |
| 3068 | WL_SEAT_CAPABILITY_KEYBOARD = 2, |
| 3069 | /** |
| 3070 | * the seat has touch devices |
| 3071 | */ |
| 3072 | WL_SEAT_CAPABILITY_TOUCH = 4, |
| 3073 | }; |
| 3074 | #endif /* WL_SEAT_CAPABILITY_ENUM */ |
| 3075 | |
| 3076 | /** |
| 3077 | * @ingroup iface_wl_seat |
| 3078 | * @struct wl_seat_interface |
| 3079 | */ |
| 3080 | struct wl_seat_interface { |
| 3081 | /** |
| 3082 | * return pointer object |
| 3083 | * |
| 3084 | * The ID provided will be initialized to the wl_pointer |
| 3085 | * interface for this seat. |
| 3086 | * |
| 3087 | * This request only takes effect if the seat has the pointer |
| 3088 | * capability, or has had the pointer capability in the past. It is |
| 3089 | * a protocol violation to issue this request on a seat that has |
| 3090 | * never had the pointer capability. |
| 3091 | * @param id seat pointer |
| 3092 | */ |
| 3093 | void (*get_pointer)(struct wl_client *client, |
| 3094 | struct wl_resource *resource, |
| 3095 | uint32_t id); |
| 3096 | /** |
| 3097 | * return keyboard object |
| 3098 | * |
| 3099 | * The ID provided will be initialized to the wl_keyboard |
| 3100 | * interface for this seat. |
| 3101 | * |
| 3102 | * This request only takes effect if the seat has the keyboard |
| 3103 | * capability, or has had the keyboard capability in the past. It |
| 3104 | * is a protocol violation to issue this request on a seat that has |
| 3105 | * never had the keyboard capability. |
| 3106 | * @param id seat keyboard |
| 3107 | */ |
| 3108 | void (*get_keyboard)(struct wl_client *client, |
| 3109 | struct wl_resource *resource, |
| 3110 | uint32_t id); |
| 3111 | /** |
| 3112 | * return touch object |
| 3113 | * |
| 3114 | * The ID provided will be initialized to the wl_touch interface |
| 3115 | * for this seat. |
| 3116 | * |
| 3117 | * This request only takes effect if the seat has the touch |
| 3118 | * capability, or has had the touch capability in the past. It is a |
| 3119 | * protocol violation to issue this request on a seat that has |
| 3120 | * never had the touch capability. |
| 3121 | * @param id seat touch interface |
| 3122 | */ |
| 3123 | void (*get_touch)(struct wl_client *client, |
| 3124 | struct wl_resource *resource, |
| 3125 | uint32_t id); |
| 3126 | /** |
| 3127 | * release the seat object |
| 3128 | * |
| 3129 | * Using this request a client can tell the server that it is not |
| 3130 | * going to use the seat object anymore. |
| 3131 | * @since 5 |
| 3132 | */ |
| 3133 | void (*release)(struct wl_client *client, |
| 3134 | struct wl_resource *resource); |
| 3135 | }; |
| 3136 | |
| 3137 | #define WL_SEAT_CAPABILITIES 0 |
| 3138 | #define WL_SEAT_NAME 1 |
| 3139 | |
| 3140 | /** |
| 3141 | * @ingroup iface_wl_seat |
| 3142 | */ |
| 3143 | #define WL_SEAT_CAPABILITIES_SINCE_VERSION 1 |
| 3144 | /** |
| 3145 | * @ingroup iface_wl_seat |
| 3146 | */ |
| 3147 | #define WL_SEAT_NAME_SINCE_VERSION 2 |
| 3148 | |
| 3149 | /** |
| 3150 | * @ingroup iface_wl_seat |
| 3151 | */ |
| 3152 | #define WL_SEAT_GET_POINTER_SINCE_VERSION 1 |
| 3153 | /** |
| 3154 | * @ingroup iface_wl_seat |
| 3155 | */ |
| 3156 | #define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1 |
| 3157 | /** |
| 3158 | * @ingroup iface_wl_seat |
| 3159 | */ |
| 3160 | #define WL_SEAT_GET_TOUCH_SINCE_VERSION 1 |
| 3161 | /** |
| 3162 | * @ingroup iface_wl_seat |
| 3163 | */ |
| 3164 | #define WL_SEAT_RELEASE_SINCE_VERSION 5 |
| 3165 | |
| 3166 | /** |
| 3167 | * @ingroup iface_wl_seat |
| 3168 | * Sends an capabilities event to the client owning the resource. |
| 3169 | * @param resource_ The client's resource |
| 3170 | * @param capabilities capabilities of the seat |
| 3171 | */ |
| 3172 | static inline void |
| 3173 | wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities) |
| 3174 | { |
| 3175 | wl_resource_post_event(resource_, WL_SEAT_CAPABILITIES, capabilities); |
| 3176 | } |
| 3177 | |
| 3178 | /** |
| 3179 | * @ingroup iface_wl_seat |
| 3180 | * Sends an name event to the client owning the resource. |
| 3181 | * @param resource_ The client's resource |
| 3182 | * @param name seat identifier |
| 3183 | */ |
| 3184 | static inline void |
| 3185 | wl_seat_send_name(struct wl_resource *resource_, const char *name) |
| 3186 | { |
| 3187 | wl_resource_post_event(resource_, WL_SEAT_NAME, name); |
| 3188 | } |
| 3189 | |
| 3190 | #ifndef WL_POINTER_ERROR_ENUM |
| 3191 | #define WL_POINTER_ERROR_ENUM |
| 3192 | enum wl_pointer_error { |
| 3193 | /** |
| 3194 | * given wl_surface has another role |
| 3195 | */ |
| 3196 | WL_POINTER_ERROR_ROLE = 0, |
| 3197 | }; |
| 3198 | #endif /* WL_POINTER_ERROR_ENUM */ |
| 3199 | |
| 3200 | #ifndef WL_POINTER_BUTTON_STATE_ENUM |
| 3201 | #define WL_POINTER_BUTTON_STATE_ENUM |
| 3202 | /** |
| 3203 | * @ingroup iface_wl_pointer |
| 3204 | * physical button state |
| 3205 | * |
| 3206 | * Describes the physical state of a button that produced the button |
| 3207 | * event. |
| 3208 | */ |
| 3209 | enum wl_pointer_button_state { |
| 3210 | /** |
| 3211 | * the button is not pressed |
| 3212 | */ |
| 3213 | WL_POINTER_BUTTON_STATE_RELEASED = 0, |
| 3214 | /** |
| 3215 | * the button is pressed |
| 3216 | */ |
| 3217 | WL_POINTER_BUTTON_STATE_PRESSED = 1, |
| 3218 | }; |
| 3219 | #endif /* WL_POINTER_BUTTON_STATE_ENUM */ |
| 3220 | |
| 3221 | #ifndef WL_POINTER_AXIS_ENUM |
| 3222 | #define WL_POINTER_AXIS_ENUM |
| 3223 | /** |
| 3224 | * @ingroup iface_wl_pointer |
| 3225 | * axis types |
| 3226 | * |
| 3227 | * Describes the axis types of scroll events. |
| 3228 | */ |
| 3229 | enum wl_pointer_axis { |
| 3230 | /** |
| 3231 | * vertical axis |
| 3232 | */ |
| 3233 | WL_POINTER_AXIS_VERTICAL_SCROLL = 0, |
| 3234 | /** |
| 3235 | * horizontal axis |
| 3236 | */ |
| 3237 | WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1, |
| 3238 | }; |
| 3239 | #endif /* WL_POINTER_AXIS_ENUM */ |
| 3240 | |
| 3241 | #ifndef WL_POINTER_AXIS_SOURCE_ENUM |
| 3242 | #define WL_POINTER_AXIS_SOURCE_ENUM |
| 3243 | /** |
| 3244 | * @ingroup iface_wl_pointer |
| 3245 | * axis source types |
| 3246 | * |
| 3247 | * Describes the source types for axis events. This indicates to the |
| 3248 | * client how an axis event was physically generated; a client may |
| 3249 | * adjust the user interface accordingly. For example, scroll events |
| 3250 | * from a "finger" source may be in a smooth coordinate space with |
| 3251 | * kinetic scrolling whereas a "wheel" source may be in discrete steps |
| 3252 | * of a number of lines. |
| 3253 | * |
| 3254 | * The "continuous" axis source is a device generating events in a |
| 3255 | * continuous coordinate space, but using something other than a |
| 3256 | * finger. One example for this source is button-based scrolling where |
| 3257 | * the vertical motion of a device is converted to scroll events while |
| 3258 | * a button is held down. |
| 3259 | * |
| 3260 | * The "wheel tilt" axis source indicates that the actual device is a |
| 3261 | * wheel but the scroll event is not caused by a rotation but a |
| 3262 | * (usually sideways) tilt of the wheel. |
| 3263 | */ |
| 3264 | enum wl_pointer_axis_source { |
| 3265 | /** |
| 3266 | * a physical wheel rotation |
| 3267 | */ |
| 3268 | WL_POINTER_AXIS_SOURCE_WHEEL = 0, |
| 3269 | /** |
| 3270 | * finger on a touch surface |
| 3271 | */ |
| 3272 | WL_POINTER_AXIS_SOURCE_FINGER = 1, |
| 3273 | /** |
| 3274 | * continuous coordinate space |
| 3275 | */ |
| 3276 | WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2, |
| 3277 | /** |
| 3278 | * a physical wheel tilt |
| 3279 | * @since 6 |
| 3280 | */ |
| 3281 | WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3, |
| 3282 | }; |
| 3283 | /** |
| 3284 | * @ingroup iface_wl_pointer |
| 3285 | */ |
| 3286 | #define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6 |
| 3287 | #endif /* WL_POINTER_AXIS_SOURCE_ENUM */ |
| 3288 | |
| 3289 | /** |
| 3290 | * @ingroup iface_wl_pointer |
| 3291 | * @struct wl_pointer_interface |
| 3292 | */ |
| 3293 | struct wl_pointer_interface { |
| 3294 | /** |
| 3295 | * set the pointer surface |
| 3296 | * |
| 3297 | * Set the pointer surface, i.e., the surface that contains the |
| 3298 | * pointer image (cursor). This request gives the surface the role |
| 3299 | * of a cursor. If the surface already has another role, it raises |
| 3300 | * a protocol error. |
| 3301 | * |
| 3302 | * The cursor actually changes only if the pointer focus for this |
| 3303 | * device is one of the requesting client's surfaces or the surface |
| 3304 | * parameter is the current pointer surface. If there was a |
| 3305 | * previous surface set with this request it is replaced. If |
| 3306 | * surface is NULL, the pointer image is hidden. |
| 3307 | * |
| 3308 | * The parameters hotspot_x and hotspot_y define the position of |
| 3309 | * the pointer surface relative to the pointer location. Its |
| 3310 | * top-left corner is always at (x, y) - (hotspot_x, hotspot_y), |
| 3311 | * where (x, y) are the coordinates of the pointer location, in |
| 3312 | * surface-local coordinates. |
| 3313 | * |
| 3314 | * On surface.attach requests to the pointer surface, hotspot_x and |
| 3315 | * hotspot_y are decremented by the x and y parameters passed to |
| 3316 | * the request. Attach must be confirmed by wl_surface.commit as |
| 3317 | * usual. |
| 3318 | * |
| 3319 | * The hotspot can also be updated by passing the currently set |
| 3320 | * pointer surface to this request with new values for hotspot_x |
| 3321 | * and hotspot_y. |
| 3322 | * |
| 3323 | * The current and pending input regions of the wl_surface are |
| 3324 | * cleared, and wl_surface.set_input_region is ignored until the |
| 3325 | * wl_surface is no longer used as the cursor. When the use as a |
| 3326 | * cursor ends, the current and pending input regions become |
| 3327 | * undefined, and the wl_surface is unmapped. |
| 3328 | * @param serial serial number of the enter event |
| 3329 | * @param surface pointer surface |
| 3330 | * @param hotspot_x surface-local x coordinate |
| 3331 | * @param hotspot_y surface-local y coordinate |
| 3332 | */ |
| 3333 | void (*set_cursor)(struct wl_client *client, |
| 3334 | struct wl_resource *resource, |
| 3335 | uint32_t serial, |
| 3336 | struct wl_resource *surface, |
| 3337 | int32_t hotspot_x, |
| 3338 | int32_t hotspot_y); |
| 3339 | /** |
| 3340 | * release the pointer object |
| 3341 | * |
| 3342 | * Using this request a client can tell the server that it is not |
| 3343 | * going to use the pointer object anymore. |
| 3344 | * |
| 3345 | * This request destroys the pointer proxy object, so clients must |
| 3346 | * not call wl_pointer_destroy() after using this request. |
| 3347 | * @since 3 |
| 3348 | */ |
| 3349 | void (*release)(struct wl_client *client, |
| 3350 | struct wl_resource *resource); |
| 3351 | }; |
| 3352 | |
| 3353 | #define WL_POINTER_ENTER 0 |
| 3354 | #define WL_POINTER_LEAVE 1 |
| 3355 | #define WL_POINTER_MOTION 2 |
| 3356 | #define WL_POINTER_BUTTON 3 |
| 3357 | #define WL_POINTER_AXIS 4 |
| 3358 | #define WL_POINTER_FRAME 5 |
| 3359 | #define WL_POINTER_AXIS_SOURCE 6 |
| 3360 | #define WL_POINTER_AXIS_STOP 7 |
| 3361 | #define WL_POINTER_AXIS_DISCRETE 8 |
| 3362 | |
| 3363 | /** |
| 3364 | * @ingroup iface_wl_pointer |
| 3365 | */ |
| 3366 | #define WL_POINTER_ENTER_SINCE_VERSION 1 |
| 3367 | /** |
| 3368 | * @ingroup iface_wl_pointer |
| 3369 | */ |
| 3370 | #define WL_POINTER_LEAVE_SINCE_VERSION 1 |
| 3371 | /** |
| 3372 | * @ingroup iface_wl_pointer |
| 3373 | */ |
| 3374 | #define WL_POINTER_MOTION_SINCE_VERSION 1 |
| 3375 | /** |
| 3376 | * @ingroup iface_wl_pointer |
| 3377 | */ |
| 3378 | #define WL_POINTER_BUTTON_SINCE_VERSION 1 |
| 3379 | /** |
| 3380 | * @ingroup iface_wl_pointer |
| 3381 | */ |
| 3382 | #define WL_POINTER_AXIS_SINCE_VERSION 1 |
| 3383 | /** |
| 3384 | * @ingroup iface_wl_pointer |
| 3385 | */ |
| 3386 | #define WL_POINTER_FRAME_SINCE_VERSION 5 |
| 3387 | /** |
| 3388 | * @ingroup iface_wl_pointer |
| 3389 | */ |
| 3390 | #define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5 |
| 3391 | /** |
| 3392 | * @ingroup iface_wl_pointer |
| 3393 | */ |
| 3394 | #define WL_POINTER_AXIS_STOP_SINCE_VERSION 5 |
| 3395 | /** |
| 3396 | * @ingroup iface_wl_pointer |
| 3397 | */ |
| 3398 | #define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5 |
| 3399 | |
| 3400 | /** |
| 3401 | * @ingroup iface_wl_pointer |
| 3402 | */ |
| 3403 | #define WL_POINTER_SET_CURSOR_SINCE_VERSION 1 |
| 3404 | /** |
| 3405 | * @ingroup iface_wl_pointer |
| 3406 | */ |
| 3407 | #define WL_POINTER_RELEASE_SINCE_VERSION 3 |
| 3408 | |
| 3409 | /** |
| 3410 | * @ingroup iface_wl_pointer |
| 3411 | * Sends an enter event to the client owning the resource. |
| 3412 | * @param resource_ The client's resource |
| 3413 | * @param serial serial number of the enter event |
| 3414 | * @param surface surface entered by the pointer |
| 3415 | * @param surface_x surface-local x coordinate |
| 3416 | * @param surface_y surface-local y coordinate |
| 3417 | */ |
| 3418 | static inline void |
| 3419 | wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y) |
| 3420 | { |
| 3421 | wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, surface_x, surface_y); |
| 3422 | } |
| 3423 | |
| 3424 | /** |
| 3425 | * @ingroup iface_wl_pointer |
| 3426 | * Sends an leave event to the client owning the resource. |
| 3427 | * @param resource_ The client's resource |
| 3428 | * @param serial serial number of the leave event |
| 3429 | * @param surface surface left by the pointer |
| 3430 | */ |
| 3431 | static inline void |
| 3432 | wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface) |
| 3433 | { |
| 3434 | wl_resource_post_event(resource_, WL_POINTER_LEAVE, serial, surface); |
| 3435 | } |
| 3436 | |
| 3437 | /** |
| 3438 | * @ingroup iface_wl_pointer |
| 3439 | * Sends an motion event to the client owning the resource. |
| 3440 | * @param resource_ The client's resource |
| 3441 | * @param time timestamp with millisecond granularity |
| 3442 | * @param surface_x surface-local x coordinate |
| 3443 | * @param surface_y surface-local y coordinate |
| 3444 | */ |
| 3445 | static inline void |
| 3446 | wl_pointer_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) |
| 3447 | { |
| 3448 | wl_resource_post_event(resource_, WL_POINTER_MOTION, time, surface_x, surface_y); |
| 3449 | } |
| 3450 | |
| 3451 | /** |
| 3452 | * @ingroup iface_wl_pointer |
| 3453 | * Sends an button event to the client owning the resource. |
| 3454 | * @param resource_ The client's resource |
| 3455 | * @param serial serial number of the button event |
| 3456 | * @param time timestamp with millisecond granularity |
| 3457 | * @param button button that produced the event |
| 3458 | * @param state physical state of the button |
| 3459 | */ |
| 3460 | static inline void |
| 3461 | wl_pointer_send_button(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t button, uint32_t state) |
| 3462 | { |
| 3463 | wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, button, state); |
| 3464 | } |
| 3465 | |
| 3466 | /** |
| 3467 | * @ingroup iface_wl_pointer |
| 3468 | * Sends an axis event to the client owning the resource. |
| 3469 | * @param resource_ The client's resource |
| 3470 | * @param time timestamp with millisecond granularity |
| 3471 | * @param axis axis type |
| 3472 | * @param value length of vector in surface-local coordinate space |
| 3473 | */ |
| 3474 | static inline void |
| 3475 | wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value) |
| 3476 | { |
| 3477 | wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value); |
| 3478 | } |
| 3479 | |
| 3480 | /** |
| 3481 | * @ingroup iface_wl_pointer |
| 3482 | * Sends an frame event to the client owning the resource. |
| 3483 | * @param resource_ The client's resource |
| 3484 | */ |
| 3485 | static inline void |
| 3486 | wl_pointer_send_frame(struct wl_resource *resource_) |
| 3487 | { |
| 3488 | wl_resource_post_event(resource_, WL_POINTER_FRAME); |
| 3489 | } |
| 3490 | |
| 3491 | /** |
| 3492 | * @ingroup iface_wl_pointer |
| 3493 | * Sends an axis_source event to the client owning the resource. |
| 3494 | * @param resource_ The client's resource |
| 3495 | * @param axis_source source of the axis event |
| 3496 | */ |
| 3497 | static inline void |
| 3498 | wl_pointer_send_axis_source(struct wl_resource *resource_, uint32_t axis_source) |
| 3499 | { |
| 3500 | wl_resource_post_event(resource_, WL_POINTER_AXIS_SOURCE, axis_source); |
| 3501 | } |
| 3502 | |
| 3503 | /** |
| 3504 | * @ingroup iface_wl_pointer |
| 3505 | * Sends an axis_stop event to the client owning the resource. |
| 3506 | * @param resource_ The client's resource |
| 3507 | * @param time timestamp with millisecond granularity |
| 3508 | * @param axis the axis stopped with this event |
| 3509 | */ |
| 3510 | static inline void |
| 3511 | wl_pointer_send_axis_stop(struct wl_resource *resource_, uint32_t time, uint32_t axis) |
| 3512 | { |
| 3513 | wl_resource_post_event(resource_, WL_POINTER_AXIS_STOP, time, axis); |
| 3514 | } |
| 3515 | |
| 3516 | /** |
| 3517 | * @ingroup iface_wl_pointer |
| 3518 | * Sends an axis_discrete event to the client owning the resource. |
| 3519 | * @param resource_ The client's resource |
| 3520 | * @param axis axis type |
| 3521 | * @param discrete number of steps |
| 3522 | */ |
| 3523 | static inline void |
| 3524 | wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis, int32_t discrete) |
| 3525 | { |
| 3526 | wl_resource_post_event(resource_, WL_POINTER_AXIS_DISCRETE, axis, discrete); |
| 3527 | } |
| 3528 | |
| 3529 | #ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM |
| 3530 | #define WL_KEYBOARD_KEYMAP_FORMAT_ENUM |
| 3531 | /** |
| 3532 | * @ingroup iface_wl_keyboard |
| 3533 | * keyboard mapping format |
| 3534 | * |
| 3535 | * This specifies the format of the keymap provided to the |
| 3536 | * client with the wl_keyboard.keymap event. |
| 3537 | */ |
| 3538 | enum wl_keyboard_keymap_format { |
| 3539 | /** |
| 3540 | * no keymap; client must understand how to interpret the raw keycode |
| 3541 | */ |
| 3542 | WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0, |
| 3543 | /** |
| 3544 | * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode |
| 3545 | */ |
| 3546 | WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1, |
| 3547 | }; |
| 3548 | #endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */ |
| 3549 | |
| 3550 | #ifndef WL_KEYBOARD_KEY_STATE_ENUM |
| 3551 | #define WL_KEYBOARD_KEY_STATE_ENUM |
| 3552 | /** |
| 3553 | * @ingroup iface_wl_keyboard |
| 3554 | * physical key state |
| 3555 | * |
| 3556 | * Describes the physical state of a key that produced the key event. |
| 3557 | */ |
| 3558 | enum wl_keyboard_key_state { |
| 3559 | /** |
| 3560 | * key is not pressed |
| 3561 | */ |
| 3562 | WL_KEYBOARD_KEY_STATE_RELEASED = 0, |
| 3563 | /** |
| 3564 | * key is pressed |
| 3565 | */ |
| 3566 | WL_KEYBOARD_KEY_STATE_PRESSED = 1, |
| 3567 | }; |
| 3568 | #endif /* WL_KEYBOARD_KEY_STATE_ENUM */ |
| 3569 | |
| 3570 | /** |
| 3571 | * @ingroup iface_wl_keyboard |
| 3572 | * @struct wl_keyboard_interface |
| 3573 | */ |
| 3574 | struct wl_keyboard_interface { |
| 3575 | /** |
| 3576 | * release the keyboard object |
| 3577 | * |
| 3578 | * |
| 3579 | * @since 3 |
| 3580 | */ |
| 3581 | void (*release)(struct wl_client *client, |
| 3582 | struct wl_resource *resource); |
| 3583 | }; |
| 3584 | |
| 3585 | #define WL_KEYBOARD_KEYMAP 0 |
| 3586 | #define WL_KEYBOARD_ENTER 1 |
| 3587 | #define WL_KEYBOARD_LEAVE 2 |
| 3588 | #define WL_KEYBOARD_KEY 3 |
| 3589 | #define WL_KEYBOARD_MODIFIERS 4 |
| 3590 | #define WL_KEYBOARD_REPEAT_INFO 5 |
| 3591 | |
| 3592 | /** |
| 3593 | * @ingroup iface_wl_keyboard |
| 3594 | */ |
| 3595 | #define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1 |
| 3596 | /** |
| 3597 | * @ingroup iface_wl_keyboard |
| 3598 | */ |
| 3599 | #define WL_KEYBOARD_ENTER_SINCE_VERSION 1 |
| 3600 | /** |
| 3601 | * @ingroup iface_wl_keyboard |
| 3602 | */ |
| 3603 | #define WL_KEYBOARD_LEAVE_SINCE_VERSION 1 |
| 3604 | /** |
| 3605 | * @ingroup iface_wl_keyboard |
| 3606 | */ |
| 3607 | #define WL_KEYBOARD_KEY_SINCE_VERSION 1 |
| 3608 | /** |
| 3609 | * @ingroup iface_wl_keyboard |
| 3610 | */ |
| 3611 | #define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1 |
| 3612 | /** |
| 3613 | * @ingroup iface_wl_keyboard |
| 3614 | */ |
| 3615 | #define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4 |
| 3616 | |
| 3617 | /** |
| 3618 | * @ingroup iface_wl_keyboard |
| 3619 | */ |
| 3620 | #define WL_KEYBOARD_RELEASE_SINCE_VERSION 3 |
| 3621 | |
| 3622 | /** |
| 3623 | * @ingroup iface_wl_keyboard |
| 3624 | * Sends an keymap event to the client owning the resource. |
| 3625 | * @param resource_ The client's resource |
| 3626 | * @param format keymap format |
| 3627 | * @param fd keymap file descriptor |
| 3628 | * @param size keymap size, in bytes |
| 3629 | */ |
| 3630 | static inline void |
| 3631 | wl_keyboard_send_keymap(struct wl_resource *resource_, uint32_t format, int32_t fd, uint32_t size) |
| 3632 | { |
| 3633 | wl_resource_post_event(resource_, WL_KEYBOARD_KEYMAP, format, fd, size); |
| 3634 | } |
| 3635 | |
| 3636 | /** |
| 3637 | * @ingroup iface_wl_keyboard |
| 3638 | * Sends an enter event to the client owning the resource. |
| 3639 | * @param resource_ The client's resource |
| 3640 | * @param serial serial number of the enter event |
| 3641 | * @param surface surface gaining keyboard focus |
| 3642 | * @param keys the currently pressed keys |
| 3643 | */ |
| 3644 | static inline void |
| 3645 | wl_keyboard_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, struct wl_array *keys) |
| 3646 | { |
| 3647 | wl_resource_post_event(resource_, WL_KEYBOARD_ENTER, serial, surface, keys); |
| 3648 | } |
| 3649 | |
| 3650 | /** |
| 3651 | * @ingroup iface_wl_keyboard |
| 3652 | * Sends an leave event to the client owning the resource. |
| 3653 | * @param resource_ The client's resource |
| 3654 | * @param serial serial number of the leave event |
| 3655 | * @param surface surface that lost keyboard focus |
| 3656 | */ |
| 3657 | static inline void |
| 3658 | wl_keyboard_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface) |
| 3659 | { |
| 3660 | wl_resource_post_event(resource_, WL_KEYBOARD_LEAVE, serial, surface); |
| 3661 | } |
| 3662 | |
| 3663 | /** |
| 3664 | * @ingroup iface_wl_keyboard |
| 3665 | * Sends an key event to the client owning the resource. |
| 3666 | * @param resource_ The client's resource |
| 3667 | * @param serial serial number of the key event |
| 3668 | * @param time timestamp with millisecond granularity |
| 3669 | * @param key key that produced the event |
| 3670 | * @param state physical state of the key |
| 3671 | */ |
| 3672 | static inline void |
| 3673 | wl_keyboard_send_key(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t key, uint32_t state) |
| 3674 | { |
| 3675 | wl_resource_post_event(resource_, WL_KEYBOARD_KEY, serial, time, key, state); |
| 3676 | } |
| 3677 | |
| 3678 | /** |
| 3679 | * @ingroup iface_wl_keyboard |
| 3680 | * Sends an modifiers event to the client owning the resource. |
| 3681 | * @param resource_ The client's resource |
| 3682 | * @param serial serial number of the modifiers event |
| 3683 | * @param mods_depressed depressed modifiers |
| 3684 | * @param mods_latched latched modifiers |
| 3685 | * @param mods_locked locked modifiers |
| 3686 | * @param group keyboard layout |
| 3687 | */ |
| 3688 | static inline void |
| 3689 | wl_keyboard_send_modifiers(struct wl_resource *resource_, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group) |
| 3690 | { |
| 3691 | wl_resource_post_event(resource_, WL_KEYBOARD_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group); |
| 3692 | } |
| 3693 | |
| 3694 | /** |
| 3695 | * @ingroup iface_wl_keyboard |
| 3696 | * Sends an repeat_info event to the client owning the resource. |
| 3697 | * @param resource_ The client's resource |
| 3698 | * @param rate the rate of repeating keys in characters per second |
| 3699 | * @param delay delay in milliseconds since key down until repeating starts |
| 3700 | */ |
| 3701 | static inline void |
| 3702 | wl_keyboard_send_repeat_info(struct wl_resource *resource_, int32_t rate, int32_t delay) |
| 3703 | { |
| 3704 | wl_resource_post_event(resource_, WL_KEYBOARD_REPEAT_INFO, rate, delay); |
| 3705 | } |
| 3706 | |
| 3707 | /** |
| 3708 | * @ingroup iface_wl_touch |
| 3709 | * @struct wl_touch_interface |
| 3710 | */ |
| 3711 | struct wl_touch_interface { |
| 3712 | /** |
| 3713 | * release the touch object |
| 3714 | * |
| 3715 | * |
| 3716 | * @since 3 |
| 3717 | */ |
| 3718 | void (*release)(struct wl_client *client, |
| 3719 | struct wl_resource *resource); |
| 3720 | }; |
| 3721 | |
| 3722 | #define WL_TOUCH_DOWN 0 |
| 3723 | #define WL_TOUCH_UP 1 |
| 3724 | #define WL_TOUCH_MOTION 2 |
| 3725 | #define WL_TOUCH_FRAME 3 |
| 3726 | #define WL_TOUCH_CANCEL 4 |
| 3727 | #define WL_TOUCH_SHAPE 5 |
| 3728 | #define WL_TOUCH_ORIENTATION 6 |
| 3729 | |
| 3730 | /** |
| 3731 | * @ingroup iface_wl_touch |
| 3732 | */ |
| 3733 | #define WL_TOUCH_DOWN_SINCE_VERSION 1 |
| 3734 | /** |
| 3735 | * @ingroup iface_wl_touch |
| 3736 | */ |
| 3737 | #define WL_TOUCH_UP_SINCE_VERSION 1 |
| 3738 | /** |
| 3739 | * @ingroup iface_wl_touch |
| 3740 | */ |
| 3741 | #define WL_TOUCH_MOTION_SINCE_VERSION 1 |
| 3742 | /** |
| 3743 | * @ingroup iface_wl_touch |
| 3744 | */ |
| 3745 | #define WL_TOUCH_FRAME_SINCE_VERSION 1 |
| 3746 | /** |
| 3747 | * @ingroup iface_wl_touch |
| 3748 | */ |
| 3749 | #define WL_TOUCH_CANCEL_SINCE_VERSION 1 |
| 3750 | /** |
| 3751 | * @ingroup iface_wl_touch |
| 3752 | */ |
| 3753 | #define WL_TOUCH_SHAPE_SINCE_VERSION 6 |
| 3754 | /** |
| 3755 | * @ingroup iface_wl_touch |
| 3756 | */ |
| 3757 | #define WL_TOUCH_ORIENTATION_SINCE_VERSION 6 |
| 3758 | |
| 3759 | /** |
| 3760 | * @ingroup iface_wl_touch |
| 3761 | */ |
| 3762 | #define WL_TOUCH_RELEASE_SINCE_VERSION 3 |
| 3763 | |
| 3764 | /** |
| 3765 | * @ingroup iface_wl_touch |
| 3766 | * Sends an down event to the client owning the resource. |
| 3767 | * @param resource_ The client's resource |
| 3768 | * @param serial serial number of the touch down event |
| 3769 | * @param time timestamp with millisecond granularity |
| 3770 | * @param surface surface touched |
| 3771 | * @param id the unique ID of this touch point |
| 3772 | * @param x surface-local x coordinate |
| 3773 | * @param y surface-local y coordinate |
| 3774 | */ |
| 3775 | static inline void |
| 3776 | wl_touch_send_down(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, int32_t id, wl_fixed_t x, wl_fixed_t y) |
| 3777 | { |
| 3778 | wl_resource_post_event(resource_, WL_TOUCH_DOWN, serial, time, surface, id, x, y); |
| 3779 | } |
| 3780 | |
| 3781 | /** |
| 3782 | * @ingroup iface_wl_touch |
| 3783 | * Sends an up event to the client owning the resource. |
| 3784 | * @param resource_ The client's resource |
| 3785 | * @param serial serial number of the touch up event |
| 3786 | * @param time timestamp with millisecond granularity |
| 3787 | * @param id the unique ID of this touch point |
| 3788 | */ |
| 3789 | static inline void |
| 3790 | wl_touch_send_up(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t id) |
| 3791 | { |
| 3792 | wl_resource_post_event(resource_, WL_TOUCH_UP, serial, time, id); |
| 3793 | } |
| 3794 | |
| 3795 | /** |
| 3796 | * @ingroup iface_wl_touch |
| 3797 | * Sends an motion event to the client owning the resource. |
| 3798 | * @param resource_ The client's resource |
| 3799 | * @param time timestamp with millisecond granularity |
| 3800 | * @param id the unique ID of this touch point |
| 3801 | * @param x surface-local x coordinate |
| 3802 | * @param y surface-local y coordinate |
| 3803 | */ |
| 3804 | static inline void |
| 3805 | wl_touch_send_motion(struct wl_resource *resource_, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) |
| 3806 | { |
| 3807 | wl_resource_post_event(resource_, WL_TOUCH_MOTION, time, id, x, y); |
| 3808 | } |
| 3809 | |
| 3810 | /** |
| 3811 | * @ingroup iface_wl_touch |
| 3812 | * Sends an frame event to the client owning the resource. |
| 3813 | * @param resource_ The client's resource |
| 3814 | */ |
| 3815 | static inline void |
| 3816 | wl_touch_send_frame(struct wl_resource *resource_) |
| 3817 | { |
| 3818 | wl_resource_post_event(resource_, WL_TOUCH_FRAME); |
| 3819 | } |
| 3820 | |
| 3821 | /** |
| 3822 | * @ingroup iface_wl_touch |
| 3823 | * Sends an cancel event to the client owning the resource. |
| 3824 | * @param resource_ The client's resource |
| 3825 | */ |
| 3826 | static inline void |
| 3827 | wl_touch_send_cancel(struct wl_resource *resource_) |
| 3828 | { |
| 3829 | wl_resource_post_event(resource_, WL_TOUCH_CANCEL); |
| 3830 | } |
| 3831 | |
| 3832 | /** |
| 3833 | * @ingroup iface_wl_touch |
| 3834 | * Sends an shape event to the client owning the resource. |
| 3835 | * @param resource_ The client's resource |
| 3836 | * @param id the unique ID of this touch point |
| 3837 | * @param major length of the major axis in surface-local coordinates |
| 3838 | * @param minor length of the minor axis in surface-local coordinates |
| 3839 | */ |
| 3840 | static inline void |
| 3841 | wl_touch_send_shape(struct wl_resource *resource_, int32_t id, wl_fixed_t major, wl_fixed_t minor) |
| 3842 | { |
| 3843 | wl_resource_post_event(resource_, WL_TOUCH_SHAPE, id, major, minor); |
| 3844 | } |
| 3845 | |
| 3846 | /** |
| 3847 | * @ingroup iface_wl_touch |
| 3848 | * Sends an orientation event to the client owning the resource. |
| 3849 | * @param resource_ The client's resource |
| 3850 | * @param id the unique ID of this touch point |
| 3851 | * @param orientation angle between major axis and positive surface y-axis in degrees |
| 3852 | */ |
| 3853 | static inline void |
| 3854 | wl_touch_send_orientation(struct wl_resource *resource_, int32_t id, wl_fixed_t orientation) |
| 3855 | { |
| 3856 | wl_resource_post_event(resource_, WL_TOUCH_ORIENTATION, id, orientation); |
| 3857 | } |
| 3858 | |
| 3859 | #ifndef WL_OUTPUT_SUBPIXEL_ENUM |
| 3860 | #define WL_OUTPUT_SUBPIXEL_ENUM |
| 3861 | /** |
| 3862 | * @ingroup iface_wl_output |
| 3863 | * subpixel geometry information |
| 3864 | * |
| 3865 | * This enumeration describes how the physical |
| 3866 | * pixels on an output are laid out. |
| 3867 | */ |
| 3868 | enum wl_output_subpixel { |
| 3869 | /** |
| 3870 | * unknown geometry |
| 3871 | */ |
| 3872 | WL_OUTPUT_SUBPIXEL_UNKNOWN = 0, |
| 3873 | /** |
| 3874 | * no geometry |
| 3875 | */ |
| 3876 | WL_OUTPUT_SUBPIXEL_NONE = 1, |
| 3877 | /** |
| 3878 | * horizontal RGB |
| 3879 | */ |
| 3880 | WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2, |
| 3881 | /** |
| 3882 | * horizontal BGR |
| 3883 | */ |
| 3884 | WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3, |
| 3885 | /** |
| 3886 | * vertical RGB |
| 3887 | */ |
| 3888 | WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4, |
| 3889 | /** |
| 3890 | * vertical BGR |
| 3891 | */ |
| 3892 | WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5, |
| 3893 | }; |
| 3894 | #endif /* WL_OUTPUT_SUBPIXEL_ENUM */ |
| 3895 | |
| 3896 | #ifndef WL_OUTPUT_TRANSFORM_ENUM |
| 3897 | #define WL_OUTPUT_TRANSFORM_ENUM |
| 3898 | /** |
| 3899 | * @ingroup iface_wl_output |
| 3900 | * transform from framebuffer to output |
| 3901 | * |
| 3902 | * This describes the transform that a compositor will apply to a |
| 3903 | * surface to compensate for the rotation or mirroring of an |
| 3904 | * output device. |
| 3905 | * |
| 3906 | * The flipped values correspond to an initial flip around a |
| 3907 | * vertical axis followed by rotation. |
| 3908 | * |
| 3909 | * The purpose is mainly to allow clients to render accordingly and |
| 3910 | * tell the compositor, so that for fullscreen surfaces, the |
| 3911 | * compositor will still be able to scan out directly from client |
| 3912 | * surfaces. |
| 3913 | */ |
| 3914 | enum wl_output_transform { |
| 3915 | /** |
| 3916 | * no transform |
| 3917 | */ |
| 3918 | WL_OUTPUT_TRANSFORM_NORMAL = 0, |
| 3919 | /** |
| 3920 | * 90 degrees counter-clockwise |
| 3921 | */ |
| 3922 | WL_OUTPUT_TRANSFORM_90 = 1, |
| 3923 | /** |
| 3924 | * 180 degrees counter-clockwise |
| 3925 | */ |
| 3926 | WL_OUTPUT_TRANSFORM_180 = 2, |
| 3927 | /** |
| 3928 | * 270 degrees counter-clockwise |
| 3929 | */ |
| 3930 | WL_OUTPUT_TRANSFORM_270 = 3, |
| 3931 | /** |
| 3932 | * 180 degree flip around a vertical axis |
| 3933 | */ |
| 3934 | WL_OUTPUT_TRANSFORM_FLIPPED = 4, |
| 3935 | /** |
| 3936 | * flip and rotate 90 degrees counter-clockwise |
| 3937 | */ |
| 3938 | WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5, |
| 3939 | /** |
| 3940 | * flip and rotate 180 degrees counter-clockwise |
| 3941 | */ |
| 3942 | WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6, |
| 3943 | /** |
| 3944 | * flip and rotate 270 degrees counter-clockwise |
| 3945 | */ |
| 3946 | WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7, |
| 3947 | }; |
| 3948 | #endif /* WL_OUTPUT_TRANSFORM_ENUM */ |
| 3949 | |
| 3950 | #ifndef WL_OUTPUT_MODE_ENUM |
| 3951 | #define WL_OUTPUT_MODE_ENUM |
| 3952 | /** |
| 3953 | * @ingroup iface_wl_output |
| 3954 | * mode information |
| 3955 | * |
| 3956 | * These flags describe properties of an output mode. |
| 3957 | * They are used in the flags bitfield of the mode event. |
| 3958 | */ |
| 3959 | enum wl_output_mode { |
| 3960 | /** |
| 3961 | * indicates this is the current mode |
| 3962 | */ |
| 3963 | WL_OUTPUT_MODE_CURRENT = 0x1, |
| 3964 | /** |
| 3965 | * indicates this is the preferred mode |
| 3966 | */ |
| 3967 | WL_OUTPUT_MODE_PREFERRED = 0x2, |
| 3968 | }; |
| 3969 | #endif /* WL_OUTPUT_MODE_ENUM */ |
| 3970 | |
| 3971 | /** |
| 3972 | * @ingroup iface_wl_output |
| 3973 | * @struct wl_output_interface |
| 3974 | */ |
| 3975 | struct wl_output_interface { |
| 3976 | /** |
| 3977 | * release the output object |
| 3978 | * |
| 3979 | * Using this request a client can tell the server that it is not |
| 3980 | * going to use the output object anymore. |
| 3981 | * @since 3 |
| 3982 | */ |
| 3983 | void (*release)(struct wl_client *client, |
| 3984 | struct wl_resource *resource); |
| 3985 | }; |
| 3986 | |
| 3987 | #define WL_OUTPUT_GEOMETRY 0 |
| 3988 | #define WL_OUTPUT_MODE 1 |
| 3989 | #define WL_OUTPUT_DONE 2 |
| 3990 | #define WL_OUTPUT_SCALE 3 |
| 3991 | |
| 3992 | /** |
| 3993 | * @ingroup iface_wl_output |
| 3994 | */ |
| 3995 | #define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1 |
| 3996 | /** |
| 3997 | * @ingroup iface_wl_output |
| 3998 | */ |
| 3999 | #define WL_OUTPUT_MODE_SINCE_VERSION 1 |
| 4000 | /** |
| 4001 | * @ingroup iface_wl_output |
| 4002 | */ |
| 4003 | #define WL_OUTPUT_DONE_SINCE_VERSION 2 |
| 4004 | /** |
| 4005 | * @ingroup iface_wl_output |
| 4006 | */ |
| 4007 | #define WL_OUTPUT_SCALE_SINCE_VERSION 2 |
| 4008 | |
| 4009 | /** |
| 4010 | * @ingroup iface_wl_output |
| 4011 | */ |
| 4012 | #define WL_OUTPUT_RELEASE_SINCE_VERSION 3 |
| 4013 | |
| 4014 | /** |
| 4015 | * @ingroup iface_wl_output |
| 4016 | * Sends an geometry event to the client owning the resource. |
| 4017 | * @param resource_ The client's resource |
| 4018 | * @param x x position within the global compositor space |
| 4019 | * @param y y position within the global compositor space |
| 4020 | * @param physical_width width in millimeters of the output |
| 4021 | * @param physical_height height in millimeters of the output |
| 4022 | * @param subpixel subpixel orientation of the output |
| 4023 | * @param make textual description of the manufacturer |
| 4024 | * @param model textual description of the model |
| 4025 | * @param transform transform that maps framebuffer to output |
| 4026 | */ |
| 4027 | static inline void |
| 4028 | wl_output_send_geometry(struct wl_resource *resource_, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform) |
| 4029 | { |
| 4030 | wl_resource_post_event(resource_, WL_OUTPUT_GEOMETRY, x, y, physical_width, physical_height, subpixel, make, model, transform); |
| 4031 | } |
| 4032 | |
| 4033 | /** |
| 4034 | * @ingroup iface_wl_output |
| 4035 | * Sends an mode event to the client owning the resource. |
| 4036 | * @param resource_ The client's resource |
| 4037 | * @param flags bitfield of mode flags |
| 4038 | * @param width width of the mode in hardware units |
| 4039 | * @param height height of the mode in hardware units |
| 4040 | * @param refresh vertical refresh rate in mHz |
| 4041 | */ |
| 4042 | static inline void |
| 4043 | wl_output_send_mode(struct wl_resource *resource_, uint32_t flags, int32_t width, int32_t height, int32_t refresh) |
| 4044 | { |
| 4045 | wl_resource_post_event(resource_, WL_OUTPUT_MODE, flags, width, height, refresh); |
| 4046 | } |
| 4047 | |
| 4048 | /** |
| 4049 | * @ingroup iface_wl_output |
| 4050 | * Sends an done event to the client owning the resource. |
| 4051 | * @param resource_ The client's resource |
| 4052 | */ |
| 4053 | static inline void |
| 4054 | wl_output_send_done(struct wl_resource *resource_) |
| 4055 | { |
| 4056 | wl_resource_post_event(resource_, WL_OUTPUT_DONE); |
| 4057 | } |
| 4058 | |
| 4059 | /** |
| 4060 | * @ingroup iface_wl_output |
| 4061 | * Sends an scale event to the client owning the resource. |
| 4062 | * @param resource_ The client's resource |
| 4063 | * @param factor scaling factor of output |
| 4064 | */ |
| 4065 | static inline void |
| 4066 | wl_output_send_scale(struct wl_resource *resource_, int32_t factor) |
| 4067 | { |
| 4068 | wl_resource_post_event(resource_, WL_OUTPUT_SCALE, factor); |
| 4069 | } |
| 4070 | |
| 4071 | /** |
| 4072 | * @ingroup iface_wl_region |
| 4073 | * @struct wl_region_interface |
| 4074 | */ |
| 4075 | struct wl_region_interface { |
| 4076 | /** |
| 4077 | * destroy region |
| 4078 | * |
| 4079 | * Destroy the region. This will invalidate the object ID. |
| 4080 | */ |
| 4081 | void (*destroy)(struct wl_client *client, |
| 4082 | struct wl_resource *resource); |
| 4083 | /** |
| 4084 | * add rectangle to region |
| 4085 | * |
| 4086 | * Add the specified rectangle to the region. |
| 4087 | * @param x region-local x coordinate |
| 4088 | * @param y region-local y coordinate |
| 4089 | * @param width rectangle width |
| 4090 | * @param height rectangle height |
| 4091 | */ |
| 4092 | void (*add)(struct wl_client *client, |
| 4093 | struct wl_resource *resource, |
| 4094 | int32_t x, |
| 4095 | int32_t y, |
| 4096 | int32_t width, |
| 4097 | int32_t height); |
| 4098 | /** |
| 4099 | * subtract rectangle from region |
| 4100 | * |
| 4101 | * Subtract the specified rectangle from the region. |
| 4102 | * @param x region-local x coordinate |
| 4103 | * @param y region-local y coordinate |
| 4104 | * @param width rectangle width |
| 4105 | * @param height rectangle height |
| 4106 | */ |
| 4107 | void (*subtract)(struct wl_client *client, |
| 4108 | struct wl_resource *resource, |
| 4109 | int32_t x, |
| 4110 | int32_t y, |
| 4111 | int32_t width, |
| 4112 | int32_t height); |
| 4113 | }; |
| 4114 | |
| 4115 | |
| 4116 | /** |
| 4117 | * @ingroup iface_wl_region |
| 4118 | */ |
| 4119 | #define WL_REGION_DESTROY_SINCE_VERSION 1 |
| 4120 | /** |
| 4121 | * @ingroup iface_wl_region |
| 4122 | */ |
| 4123 | #define WL_REGION_ADD_SINCE_VERSION 1 |
| 4124 | /** |
| 4125 | * @ingroup iface_wl_region |
| 4126 | */ |
| 4127 | #define WL_REGION_SUBTRACT_SINCE_VERSION 1 |
| 4128 | |
| 4129 | #ifndef WL_SUBCOMPOSITOR_ERROR_ENUM |
| 4130 | #define WL_SUBCOMPOSITOR_ERROR_ENUM |
| 4131 | enum wl_subcompositor_error { |
| 4132 | /** |
| 4133 | * the to-be sub-surface is invalid |
| 4134 | */ |
| 4135 | WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0, |
| 4136 | }; |
| 4137 | #endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */ |
| 4138 | |
| 4139 | /** |
| 4140 | * @ingroup iface_wl_subcompositor |
| 4141 | * @struct wl_subcompositor_interface |
| 4142 | */ |
| 4143 | struct wl_subcompositor_interface { |
| 4144 | /** |
| 4145 | * unbind from the subcompositor interface |
| 4146 | * |
| 4147 | * Informs the server that the client will not be using this |
| 4148 | * protocol object anymore. This does not affect any other objects, |
| 4149 | * wl_subsurface objects included. |
| 4150 | */ |
| 4151 | void (*destroy)(struct wl_client *client, |
| 4152 | struct wl_resource *resource); |
| 4153 | /** |
| 4154 | * give a surface the role sub-surface |
| 4155 | * |
| 4156 | * Create a sub-surface interface for the given surface, and |
| 4157 | * associate it with the given parent surface. This turns a plain |
| 4158 | * wl_surface into a sub-surface. |
| 4159 | * |
| 4160 | * The to-be sub-surface must not already have another role, and it |
| 4161 | * must not have an existing wl_subsurface object. Otherwise a |
| 4162 | * protocol error is raised. |
| 4163 | * |
| 4164 | * Adding sub-surfaces to a parent is a double-buffered operation |
| 4165 | * on the parent (see wl_surface.commit). The effect of adding a |
| 4166 | * sub-surface becomes visible on the next time the state of the |
| 4167 | * parent surface is applied. |
| 4168 | * |
| 4169 | * This request modifies the behaviour of wl_surface.commit request |
| 4170 | * on the sub-surface, see the documentation on wl_subsurface |
| 4171 | * interface. |
| 4172 | * @param id the new sub-surface object ID |
| 4173 | * @param surface the surface to be turned into a sub-surface |
| 4174 | * @param parent the parent surface |
| 4175 | */ |
| 4176 | void (*get_subsurface)(struct wl_client *client, |
| 4177 | struct wl_resource *resource, |
| 4178 | uint32_t id, |
| 4179 | struct wl_resource *surface, |
| 4180 | struct wl_resource *parent); |
| 4181 | }; |
| 4182 | |
| 4183 | |
| 4184 | /** |
| 4185 | * @ingroup iface_wl_subcompositor |
| 4186 | */ |
| 4187 | #define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1 |
| 4188 | /** |
| 4189 | * @ingroup iface_wl_subcompositor |
| 4190 | */ |
| 4191 | #define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1 |
| 4192 | |
| 4193 | #ifndef WL_SUBSURFACE_ERROR_ENUM |
| 4194 | #define WL_SUBSURFACE_ERROR_ENUM |
| 4195 | enum wl_subsurface_error { |
| 4196 | /** |
| 4197 | * wl_surface is not a sibling or the parent |
| 4198 | */ |
| 4199 | WL_SUBSURFACE_ERROR_BAD_SURFACE = 0, |
| 4200 | }; |
| 4201 | #endif /* WL_SUBSURFACE_ERROR_ENUM */ |
| 4202 | |
| 4203 | /** |
| 4204 | * @ingroup iface_wl_subsurface |
| 4205 | * @struct wl_subsurface_interface |
| 4206 | */ |
| 4207 | struct wl_subsurface_interface { |
| 4208 | /** |
| 4209 | * remove sub-surface interface |
| 4210 | * |
| 4211 | * The sub-surface interface is removed from the wl_surface |
| 4212 | * object that was turned into a sub-surface with a |
| 4213 | * wl_subcompositor.get_subsurface request. The wl_surface's |
| 4214 | * association to the parent is deleted, and the wl_surface loses |
| 4215 | * its role as a sub-surface. The wl_surface is unmapped |
| 4216 | * immediately. |
| 4217 | */ |
| 4218 | void (*destroy)(struct wl_client *client, |
| 4219 | struct wl_resource *resource); |
| 4220 | /** |
| 4221 | * reposition the sub-surface |
| 4222 | * |
| 4223 | * This schedules a sub-surface position change. The sub-surface |
| 4224 | * will be moved so that its origin (top left corner pixel) will be |
| 4225 | * at the location x, y of the parent surface coordinate system. |
| 4226 | * The coordinates are not restricted to the parent surface area. |
| 4227 | * Negative values are allowed. |
| 4228 | * |
| 4229 | * The scheduled coordinates will take effect whenever the state of |
| 4230 | * the parent surface is applied. When this happens depends on |
| 4231 | * whether the parent surface is in synchronized mode or not. See |
| 4232 | * wl_subsurface.set_sync and wl_subsurface.set_desync for details. |
| 4233 | * |
| 4234 | * If more than one set_position request is invoked by the client |
| 4235 | * before the commit of the parent surface, the position of a new |
| 4236 | * request always replaces the scheduled position from any previous |
| 4237 | * request. |
| 4238 | * |
| 4239 | * The initial position is 0, 0. |
| 4240 | * @param x x coordinate in the parent surface |
| 4241 | * @param y y coordinate in the parent surface |
| 4242 | */ |
| 4243 | void (*set_position)(struct wl_client *client, |
| 4244 | struct wl_resource *resource, |
| 4245 | int32_t x, |
| 4246 | int32_t y); |
| 4247 | /** |
| 4248 | * restack the sub-surface |
| 4249 | * |
| 4250 | * This sub-surface is taken from the stack, and put back just |
| 4251 | * above the reference surface, changing the z-order of the |
| 4252 | * sub-surfaces. The reference surface must be one of the sibling |
| 4253 | * surfaces, or the parent surface. Using any other surface, |
| 4254 | * including this sub-surface, will cause a protocol error. |
| 4255 | * |
| 4256 | * The z-order is double-buffered. Requests are handled in order |
| 4257 | * and applied immediately to a pending state. The final pending |
| 4258 | * state is copied to the active state the next time the state of |
| 4259 | * the parent surface is applied. When this happens depends on |
| 4260 | * whether the parent surface is in synchronized mode or not. See |
| 4261 | * wl_subsurface.set_sync and wl_subsurface.set_desync for details. |
| 4262 | * |
| 4263 | * A new sub-surface is initially added as the top-most in the |
| 4264 | * stack of its siblings and parent. |
| 4265 | * @param sibling the reference surface |
| 4266 | */ |
| 4267 | void (*place_above)(struct wl_client *client, |
| 4268 | struct wl_resource *resource, |
| 4269 | struct wl_resource *sibling); |
| 4270 | /** |
| 4271 | * restack the sub-surface |
| 4272 | * |
| 4273 | * The sub-surface is placed just below the reference surface. |
| 4274 | * See wl_subsurface.place_above. |
| 4275 | * @param sibling the reference surface |
| 4276 | */ |
| 4277 | void (*place_below)(struct wl_client *client, |
| 4278 | struct wl_resource *resource, |
| 4279 | struct wl_resource *sibling); |
| 4280 | /** |
| 4281 | * set sub-surface to synchronized mode |
| 4282 | * |
| 4283 | * Change the commit behaviour of the sub-surface to synchronized |
| 4284 | * mode, also described as the parent dependent mode. |
| 4285 | * |
| 4286 | * In synchronized mode, wl_surface.commit on a sub-surface will |
| 4287 | * accumulate the committed state in a cache, but the state will |
| 4288 | * not be applied and hence will not change the compositor output. |
| 4289 | * The cached state is applied to the sub-surface immediately after |
| 4290 | * the parent surface's state is applied. This ensures atomic |
| 4291 | * updates of the parent and all its synchronized sub-surfaces. |
| 4292 | * Applying the cached state will invalidate the cache, so further |
| 4293 | * parent surface commits do not (re-)apply old state. |
| 4294 | * |
| 4295 | * See wl_subsurface for the recursive effect of this mode. |
| 4296 | */ |
| 4297 | void (*set_sync)(struct wl_client *client, |
| 4298 | struct wl_resource *resource); |
| 4299 | /** |
| 4300 | * set sub-surface to desynchronized mode |
| 4301 | * |
| 4302 | * Change the commit behaviour of the sub-surface to |
| 4303 | * desynchronized mode, also described as independent or freely |
| 4304 | * running mode. |
| 4305 | * |
| 4306 | * In desynchronized mode, wl_surface.commit on a sub-surface will |
| 4307 | * apply the pending state directly, without caching, as happens |
| 4308 | * normally with a wl_surface. Calling wl_surface.commit on the |
| 4309 | * parent surface has no effect on the sub-surface's wl_surface |
| 4310 | * state. This mode allows a sub-surface to be updated on its own. |
| 4311 | * |
| 4312 | * If cached state exists when wl_surface.commit is called in |
| 4313 | * desynchronized mode, the pending state is added to the cached |
| 4314 | * state, and applied as a whole. This invalidates the cache. |
| 4315 | * |
| 4316 | * Note: even if a sub-surface is set to desynchronized, a parent |
| 4317 | * sub-surface may override it to behave as synchronized. For |
| 4318 | * details, see wl_subsurface. |
| 4319 | * |
| 4320 | * If a surface's parent surface behaves as desynchronized, then |
| 4321 | * the cached state is applied on set_desync. |
| 4322 | */ |
| 4323 | void (*set_desync)(struct wl_client *client, |
| 4324 | struct wl_resource *resource); |
| 4325 | }; |
| 4326 | |
| 4327 | |
| 4328 | /** |
| 4329 | * @ingroup iface_wl_subsurface |
| 4330 | */ |
| 4331 | #define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1 |
| 4332 | /** |
| 4333 | * @ingroup iface_wl_subsurface |
| 4334 | */ |
| 4335 | #define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1 |
| 4336 | /** |
| 4337 | * @ingroup iface_wl_subsurface |
| 4338 | */ |
| 4339 | #define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1 |
| 4340 | /** |
| 4341 | * @ingroup iface_wl_subsurface |
| 4342 | */ |
| 4343 | #define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1 |
| 4344 | /** |
| 4345 | * @ingroup iface_wl_subsurface |
| 4346 | */ |
| 4347 | #define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1 |
| 4348 | /** |
| 4349 | * @ingroup iface_wl_subsurface |
| 4350 | */ |
| 4351 | #define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1 |
| 4352 | |
| 4353 | #ifdef __cplusplus |
| 4354 | } |
| 4355 | #endif |
| 4356 | |
| 4357 | #endif |
| 4358 | |