1 /+ 2 + D bindings copyright: 3 + Copyright © 2015 Rémi Thebault 4 +/ 5 /+ 6 + File generated by wayland-scanner-d v1.0.0: 7 + /home/remi/dev/wayland-scanner-d/wayland-scanner-d -m \ 8 + wayland.client.protocol --mode client --protocol -o \ 9 + ./src/wayland/client/protocol.d -x wayland.client.core -x \ 10 + wayland.client.ifaces 11 + 12 + Do not edit! 13 +/ 14 /+ 15 + Protocol copyright: 16 + Copyright © 2008-2011 Kristian Høgsberg 17 + Copyright © 2010-2011 Intel Corporation 18 + Copyright © 2012-2013 Collabora, Ltd. 19 + 20 + Permission is hereby granted, free of charge, to any person 21 + obtaining a copy of this software and associated documentation files 22 + (the "Software"), to deal in the Software without restriction, 23 + including without limitation the rights to use, copy, modify, merge, 24 + publish, distribute, sublicense, and/or sell copies of the Software, 25 + and to permit persons to whom the Software is furnished to do so, 26 + subject to the following conditions: 27 + 28 + The above copyright notice and this permission notice (including the 29 + next paragraph) shall be included in all copies or substantial 30 + portions of the Software. 31 + 32 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 33 + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 34 + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 35 + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 36 + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 37 + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 38 + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 39 + SOFTWARE. 40 +/ 41 module wayland.client.protocol; 42 43 import wayland.client.util; 44 import wayland.client.opaque_types; 45 import wayland.client.core; 46 import wayland.client.ifaces; 47 48 extern (C) { 49 50 struct wl_registry; 51 struct wl_callback; 52 struct wl_compositor; 53 struct wl_shm_pool; 54 struct wl_shm; 55 struct wl_buffer; 56 struct wl_data_offer; 57 struct wl_data_source; 58 struct wl_data_device; 59 struct wl_data_device_manager; 60 struct wl_shell; 61 struct wl_shell_surface; 62 struct wl_surface; 63 struct wl_seat; 64 struct wl_pointer; 65 struct wl_keyboard; 66 struct wl_touch; 67 struct wl_output; 68 struct wl_region; 69 struct wl_subcompositor; 70 struct wl_subsurface; 71 72 /++ 73 + global error values 74 + 75 + These errors are global and can be emitted in response to any 76 + server request. 77 +/ 78 /++ 79 + WL_DISPLAY_ERROR_INVALID_OBJECT: server couldn't find object 80 + WL_DISPLAY_ERROR_INVALID_METHOD: method doesn't exist on the specified interface 81 + WL_DISPLAY_ERROR_NO_MEMORY: server is out of memory 82 + 83 +/ 84 enum uint WL_DISPLAY_ERROR_INVALID_OBJECT = 0; 85 enum uint WL_DISPLAY_ERROR_INVALID_METHOD = 1; /// ditto 86 enum uint WL_DISPLAY_ERROR_NO_MEMORY = 2; /// ditto 87 88 /++ 89 + core global object 90 + 91 + The core global object. This is a special singleton object. It 92 + is used for internal Wayland protocol features. 93 +/ 94 struct wl_display_listener 95 { 96 /++ 97 + fatal error event 98 + 99 + The error event is sent out when a fatal (non-recoverable) 100 + error has occurred. The object_id argument is the object 101 + where the error occurred, most often in response to a request 102 + to that object. The code identifies the error and is defined 103 + by the object interface. As such, each interface defines its 104 + own set of error codes. The message is a brief description 105 + of the error, for (debugging) convenience. 106 +/ 107 void function (void *data, 108 wl_display *wl_display, 109 void *object_id, 110 uint code, 111 const(char) *message) error; 112 /++ 113 + acknowledge object ID deletion 114 + 115 + This event is used internally by the object ID management 116 + logic. When a client deletes an object, the server will send 117 + this event to acknowledge that it has seen the delete request. 118 + When the client receives this event, it will know that it can 119 + safely reuse the object ID. 120 +/ 121 void function (void *data, 122 wl_display *wl_display, 123 uint id) delete_id; 124 } 125 126 extern (D) int 127 wl_display_add_listener(wl_display *wl_display, 128 const(wl_display_listener) *listener, void *data) 129 { 130 alias Callback = extern (C) void function(); 131 132 return wl_proxy_add_listener( 133 cast(wl_proxy*)wl_display, 134 cast(Callback*)listener, data); 135 } 136 137 enum uint WL_DISPLAY_SYNC = 0; 138 enum uint WL_DISPLAY_GET_REGISTRY = 1; 139 140 extern (D) void 141 wl_display_set_user_data(wl_display *wl_display, void *user_data) 142 { 143 wl_proxy_set_user_data(cast(wl_proxy*) wl_display, user_data); 144 } 145 146 extern (D) void * 147 wl_display_get_user_data(wl_display *wl_display) 148 { 149 return wl_proxy_get_user_data(cast(wl_proxy*) wl_display); 150 } 151 152 /++ 153 + asynchronous roundtrip 154 + 155 + The sync request asks the server to emit the 'done' event 156 + on the returned wl_callback object. Since requests are 157 + handled in-order and events are delivered in-order, this can 158 + be used as a barrier to ensure all previous requests and the 159 + resulting events have been handled. 160 + 161 + The object returned by this request will be destroyed by the 162 + compositor after the callback is fired and as such the client must not 163 + attempt to use it after that point. 164 + 165 + The callback_data passed in the callback is the event serial. 166 +/ 167 extern (D) wl_callback * 168 wl_display_sync(wl_display *wl_display_) 169 { 170 wl_proxy *callback; 171 172 callback = wl_proxy_marshal_constructor( 173 cast(wl_proxy*) wl_display_, 174 WL_DISPLAY_SYNC, wl_callback_interface, null); 175 176 return cast(wl_callback *) callback; 177 } 178 179 /++ 180 + get global registry object 181 + 182 + This request creates a registry object that allows the client 183 + to list and bind the global objects available from the 184 + compositor. 185 +/ 186 extern (D) wl_registry * 187 wl_display_get_registry(wl_display *wl_display_) 188 { 189 wl_proxy *registry; 190 191 registry = wl_proxy_marshal_constructor( 192 cast(wl_proxy*) wl_display_, 193 WL_DISPLAY_GET_REGISTRY, wl_registry_interface, null); 194 195 return cast(wl_registry *) registry; 196 } 197 198 /++ 199 + global registry object 200 + 201 + The global registry object. The server has a number of global 202 + objects that are available to all clients. These objects 203 + typically represent an actual object in the server (for example, 204 + an input device) or they are singleton objects that provide 205 + extension functionality. 206 + 207 + When a client creates a registry object, the registry object 208 + will emit a global event for each global currently in the 209 + registry. Globals come and go as a result of device or 210 + monitor hotplugs, reconfiguration or other events, and the 211 + registry will send out global and global_remove events to 212 + keep the client up to date with the changes. To mark the end 213 + of the initial burst of events, the client can use the 214 + wl_display.sync request immediately after calling 215 + wl_display.get_registry. 216 + 217 + A client can bind to a global object by using the bind 218 + request. This creates a client-side handle that lets the object 219 + emit events to the client and lets the client invoke requests on 220 + the object. 221 +/ 222 struct wl_registry_listener 223 { 224 /++ 225 + announce global object 226 + 227 + Notify the client of global objects. 228 + 229 + The event notifies the client that a global object with 230 + the given name is now available, and it implements the 231 + given version of the given interface. 232 +/ 233 void function (void *data, 234 wl_registry *wl_registry, 235 uint name, 236 const(char) *iface, 237 uint ver) global; 238 /++ 239 + announce removal of global object 240 + 241 + Notify the client of removed global objects. 242 + 243 + This event notifies the client that the global identified 244 + by name is no longer available. If the client bound to 245 + the global using the bind request, the client should now 246 + destroy that object. 247 + 248 + The object remains valid and requests to the object will be 249 + ignored until the client destroys it, to avoid races between 250 + the global going away and a client sending a request to it. 251 +/ 252 void function (void *data, 253 wl_registry *wl_registry, 254 uint name) global_remove; 255 } 256 257 extern (D) int 258 wl_registry_add_listener(wl_registry *wl_registry, 259 const(wl_registry_listener) *listener, void *data) 260 { 261 alias Callback = extern (C) void function(); 262 263 return wl_proxy_add_listener( 264 cast(wl_proxy*)wl_registry, 265 cast(Callback*)listener, data); 266 } 267 268 enum uint WL_REGISTRY_BIND = 0; 269 270 extern (D) void 271 wl_registry_set_user_data(wl_registry *wl_registry, void *user_data) 272 { 273 wl_proxy_set_user_data(cast(wl_proxy*) wl_registry, user_data); 274 } 275 276 extern (D) void * 277 wl_registry_get_user_data(wl_registry *wl_registry) 278 { 279 return wl_proxy_get_user_data(cast(wl_proxy*) wl_registry); 280 } 281 282 extern (D) void 283 wl_registry_destroy(wl_registry *wl_registry) 284 { 285 wl_proxy_destroy(cast(wl_proxy*) wl_registry); 286 } 287 288 /++ 289 + bind an object to the display 290 + 291 + Binds a new, client-created object to the server using the 292 + specified name as the identifier. 293 +/ 294 extern (D) void * 295 wl_registry_bind(wl_registry *wl_registry_, uint name, const(wl_interface) *iface, uint ver) 296 { 297 wl_proxy *id; 298 299 id = wl_proxy_marshal_constructor( 300 cast(wl_proxy*) wl_registry_, 301 WL_REGISTRY_BIND, iface, name, iface.name, ver, null); 302 303 return cast(void *) id; 304 } 305 306 /++ 307 + callback object 308 + 309 + Clients can handle the 'done' event to get notified when 310 + the related request is done. 311 +/ 312 struct wl_callback_listener 313 { 314 /++ 315 + done event 316 + 317 + Notify the client when the related request is done. 318 +/ 319 void function (void *data, 320 wl_callback *wl_callback, 321 uint callback_data) done; 322 } 323 324 extern (D) int 325 wl_callback_add_listener(wl_callback *wl_callback, 326 const(wl_callback_listener) *listener, void *data) 327 { 328 alias Callback = extern (C) void function(); 329 330 return wl_proxy_add_listener( 331 cast(wl_proxy*)wl_callback, 332 cast(Callback*)listener, data); 333 } 334 335 336 extern (D) void 337 wl_callback_set_user_data(wl_callback *wl_callback, void *user_data) 338 { 339 wl_proxy_set_user_data(cast(wl_proxy*) wl_callback, user_data); 340 } 341 342 extern (D) void * 343 wl_callback_get_user_data(wl_callback *wl_callback) 344 { 345 return wl_proxy_get_user_data(cast(wl_proxy*) wl_callback); 346 } 347 348 extern (D) void 349 wl_callback_destroy(wl_callback *wl_callback) 350 { 351 wl_proxy_destroy(cast(wl_proxy*) wl_callback); 352 } 353 354 enum uint WL_COMPOSITOR_CREATE_SURFACE = 0; 355 enum uint WL_COMPOSITOR_CREATE_REGION = 1; 356 357 extern (D) void 358 wl_compositor_set_user_data(wl_compositor *wl_compositor, void *user_data) 359 { 360 wl_proxy_set_user_data(cast(wl_proxy*) wl_compositor, user_data); 361 } 362 363 extern (D) void * 364 wl_compositor_get_user_data(wl_compositor *wl_compositor) 365 { 366 return wl_proxy_get_user_data(cast(wl_proxy*) wl_compositor); 367 } 368 369 extern (D) void 370 wl_compositor_destroy(wl_compositor *wl_compositor) 371 { 372 wl_proxy_destroy(cast(wl_proxy*) wl_compositor); 373 } 374 375 /++ 376 + create new surface 377 + 378 + Ask the compositor to create a new surface. 379 +/ 380 extern (D) wl_surface * 381 wl_compositor_create_surface(wl_compositor *wl_compositor_) 382 { 383 wl_proxy *id; 384 385 id = wl_proxy_marshal_constructor( 386 cast(wl_proxy*) wl_compositor_, 387 WL_COMPOSITOR_CREATE_SURFACE, wl_surface_interface, null); 388 389 return cast(wl_surface *) id; 390 } 391 392 /++ 393 + create new region 394 + 395 + Ask the compositor to create a new region. 396 +/ 397 extern (D) wl_region * 398 wl_compositor_create_region(wl_compositor *wl_compositor_) 399 { 400 wl_proxy *id; 401 402 id = wl_proxy_marshal_constructor( 403 cast(wl_proxy*) wl_compositor_, 404 WL_COMPOSITOR_CREATE_REGION, wl_region_interface, null); 405 406 return cast(wl_region *) id; 407 } 408 409 enum uint WL_SHM_POOL_CREATE_BUFFER = 0; 410 enum uint WL_SHM_POOL_DESTROY = 1; 411 enum uint WL_SHM_POOL_RESIZE = 2; 412 413 extern (D) void 414 wl_shm_pool_set_user_data(wl_shm_pool *wl_shm_pool, void *user_data) 415 { 416 wl_proxy_set_user_data(cast(wl_proxy*) wl_shm_pool, user_data); 417 } 418 419 extern (D) void * 420 wl_shm_pool_get_user_data(wl_shm_pool *wl_shm_pool) 421 { 422 return wl_proxy_get_user_data(cast(wl_proxy*) wl_shm_pool); 423 } 424 425 /++ 426 + create a buffer from the pool 427 + 428 + Create a wl_buffer object from the pool. 429 + 430 + The buffer is created offset bytes into the pool and has 431 + width and height as specified. The stride argument specifies 432 + the number of bytes from the beginning of one row to the beginning 433 + of the next. The format is the pixel format of the buffer and 434 + must be one of those advertised through the wl_shm.format event. 435 + 436 + A buffer will keep a reference to the pool it was created from 437 + so it is valid to destroy the pool immediately after creating 438 + a buffer from it. 439 +/ 440 extern (D) wl_buffer * 441 wl_shm_pool_create_buffer(wl_shm_pool *wl_shm_pool_, int offset, int width, int height, int stride, uint format) 442 { 443 wl_proxy *id; 444 445 id = wl_proxy_marshal_constructor( 446 cast(wl_proxy*) wl_shm_pool_, 447 WL_SHM_POOL_CREATE_BUFFER, wl_buffer_interface, null, offset, width, height, stride, format); 448 449 return cast(wl_buffer *) id; 450 } 451 452 /++ 453 + destroy the pool 454 + 455 + Destroy the shared memory pool. 456 + 457 + The mmapped memory will be released when all 458 + buffers that have been created from this pool 459 + are gone. 460 +/ 461 extern (D) void 462 wl_shm_pool_destroy(wl_shm_pool *wl_shm_pool_) 463 { 464 wl_proxy_marshal(cast(wl_proxy*) wl_shm_pool_, 465 WL_SHM_POOL_DESTROY); 466 467 wl_proxy_destroy(cast(wl_proxy*) wl_shm_pool_); 468 } 469 470 /++ 471 + change the size of the pool mapping 472 + 473 + This request will cause the server to remap the backing memory 474 + for the pool from the file descriptor passed when the pool was 475 + created, but using the new size. This request can only be 476 + used to make the pool bigger. 477 +/ 478 extern (D) void 479 wl_shm_pool_resize(wl_shm_pool *wl_shm_pool_, int size) 480 { 481 wl_proxy_marshal(cast(wl_proxy*) wl_shm_pool_, 482 WL_SHM_POOL_RESIZE, size); 483 } 484 485 /++ 486 + wl_shm error values 487 + 488 + These errors can be emitted in response to wl_shm requests. 489 +/ 490 /++ 491 + WL_SHM_ERROR_INVALID_FORMAT: buffer format is not known 492 + WL_SHM_ERROR_INVALID_STRIDE: invalid size or stride during pool or buffer creation 493 + WL_SHM_ERROR_INVALID_FD: mmapping the file descriptor failed 494 + 495 +/ 496 enum uint WL_SHM_ERROR_INVALID_FORMAT = 0; 497 enum uint WL_SHM_ERROR_INVALID_STRIDE = 1; /// ditto 498 enum uint WL_SHM_ERROR_INVALID_FD = 2; /// ditto 499 500 /++ 501 + pixel formats 502 + 503 + This describes the memory layout of an individual pixel. 504 + 505 + All renderers should support argb8888 and xrgb8888 but any other 506 + formats are optional and may not be supported by the particular 507 + renderer in use. 508 + 509 + The drm format codes match the macros defined in drm_fourcc.h. 510 + The formats actually supported by the compositor will be 511 + reported by the format event. 512 +/ 513 /++ 514 + WL_SHM_FORMAT_ARGB8888: 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian 515 + WL_SHM_FORMAT_XRGB8888: 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian 516 + WL_SHM_FORMAT_C8: 8-bit color index format, [7:0] C 517 + WL_SHM_FORMAT_RGB332: 8-bit RGB format, [7:0] R:G:B 3:3:2 518 + WL_SHM_FORMAT_BGR233: 8-bit BGR format, [7:0] B:G:R 2:3:3 519 + WL_SHM_FORMAT_XRGB4444: 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian 520 + WL_SHM_FORMAT_XBGR4444: 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian 521 + WL_SHM_FORMAT_RGBX4444: 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian 522 + WL_SHM_FORMAT_BGRX4444: 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian 523 + WL_SHM_FORMAT_ARGB4444: 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian 524 + WL_SHM_FORMAT_ABGR4444: 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian 525 + WL_SHM_FORMAT_RGBA4444: 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian 526 + WL_SHM_FORMAT_BGRA4444: 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian 527 + WL_SHM_FORMAT_XRGB1555: 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian 528 + WL_SHM_FORMAT_XBGR1555: 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian 529 + WL_SHM_FORMAT_RGBX5551: 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian 530 + WL_SHM_FORMAT_BGRX5551: 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian 531 + WL_SHM_FORMAT_ARGB1555: 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian 532 + WL_SHM_FORMAT_ABGR1555: 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian 533 + WL_SHM_FORMAT_RGBA5551: 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian 534 + WL_SHM_FORMAT_BGRA5551: 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian 535 + WL_SHM_FORMAT_RGB565: 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian 536 + WL_SHM_FORMAT_BGR565: 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian 537 + WL_SHM_FORMAT_RGB888: 24-bit RGB format, [23:0] R:G:B little endian 538 + WL_SHM_FORMAT_BGR888: 24-bit BGR format, [23:0] B:G:R little endian 539 + WL_SHM_FORMAT_XBGR8888: 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian 540 + WL_SHM_FORMAT_RGBX8888: 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian 541 + WL_SHM_FORMAT_BGRX8888: 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian 542 + WL_SHM_FORMAT_ABGR8888: 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian 543 + WL_SHM_FORMAT_RGBA8888: 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian 544 + WL_SHM_FORMAT_BGRA8888: 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian 545 + WL_SHM_FORMAT_XRGB2101010: 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian 546 + WL_SHM_FORMAT_XBGR2101010: 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian 547 + WL_SHM_FORMAT_RGBX1010102: 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian 548 + WL_SHM_FORMAT_BGRX1010102: 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian 549 + WL_SHM_FORMAT_ARGB2101010: 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian 550 + WL_SHM_FORMAT_ABGR2101010: 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian 551 + WL_SHM_FORMAT_RGBA1010102: 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian 552 + WL_SHM_FORMAT_BGRA1010102: 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian 553 + WL_SHM_FORMAT_YUYV: packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian 554 + WL_SHM_FORMAT_YVYU: packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian 555 + WL_SHM_FORMAT_UYVY: packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian 556 + WL_SHM_FORMAT_VYUY: packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian 557 + WL_SHM_FORMAT_AYUV: packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian 558 + WL_SHM_FORMAT_NV12: 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane 559 + WL_SHM_FORMAT_NV21: 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane 560 + WL_SHM_FORMAT_NV16: 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane 561 + WL_SHM_FORMAT_NV61: 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane 562 + WL_SHM_FORMAT_YUV410: 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes 563 + WL_SHM_FORMAT_YVU410: 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes 564 + WL_SHM_FORMAT_YUV411: 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes 565 + WL_SHM_FORMAT_YVU411: 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes 566 + WL_SHM_FORMAT_YUV420: 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes 567 + WL_SHM_FORMAT_YVU420: 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes 568 + WL_SHM_FORMAT_YUV422: 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes 569 + WL_SHM_FORMAT_YVU422: 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes 570 + WL_SHM_FORMAT_YUV444: 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes 571 + WL_SHM_FORMAT_YVU444: 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes 572 + 573 +/ 574 enum uint WL_SHM_FORMAT_ARGB8888 = 0; 575 enum uint WL_SHM_FORMAT_XRGB8888 = 1; /// ditto 576 enum uint WL_SHM_FORMAT_C8 = 0x20203843; /// ditto 577 enum uint WL_SHM_FORMAT_RGB332 = 0x38424752; /// ditto 578 enum uint WL_SHM_FORMAT_BGR233 = 0x38524742; /// ditto 579 enum uint WL_SHM_FORMAT_XRGB4444 = 0x32315258; /// ditto 580 enum uint WL_SHM_FORMAT_XBGR4444 = 0x32314258; /// ditto 581 enum uint WL_SHM_FORMAT_RGBX4444 = 0x32315852; /// ditto 582 enum uint WL_SHM_FORMAT_BGRX4444 = 0x32315842; /// ditto 583 enum uint WL_SHM_FORMAT_ARGB4444 = 0x32315241; /// ditto 584 enum uint WL_SHM_FORMAT_ABGR4444 = 0x32314241; /// ditto 585 enum uint WL_SHM_FORMAT_RGBA4444 = 0x32314152; /// ditto 586 enum uint WL_SHM_FORMAT_BGRA4444 = 0x32314142; /// ditto 587 enum uint WL_SHM_FORMAT_XRGB1555 = 0x35315258; /// ditto 588 enum uint WL_SHM_FORMAT_XBGR1555 = 0x35314258; /// ditto 589 enum uint WL_SHM_FORMAT_RGBX5551 = 0x35315852; /// ditto 590 enum uint WL_SHM_FORMAT_BGRX5551 = 0x35315842; /// ditto 591 enum uint WL_SHM_FORMAT_ARGB1555 = 0x35315241; /// ditto 592 enum uint WL_SHM_FORMAT_ABGR1555 = 0x35314241; /// ditto 593 enum uint WL_SHM_FORMAT_RGBA5551 = 0x35314152; /// ditto 594 enum uint WL_SHM_FORMAT_BGRA5551 = 0x35314142; /// ditto 595 enum uint WL_SHM_FORMAT_RGB565 = 0x36314752; /// ditto 596 enum uint WL_SHM_FORMAT_BGR565 = 0x36314742; /// ditto 597 enum uint WL_SHM_FORMAT_RGB888 = 0x34324752; /// ditto 598 enum uint WL_SHM_FORMAT_BGR888 = 0x34324742; /// ditto 599 enum uint WL_SHM_FORMAT_XBGR8888 = 0x34324258; /// ditto 600 enum uint WL_SHM_FORMAT_RGBX8888 = 0x34325852; /// ditto 601 enum uint WL_SHM_FORMAT_BGRX8888 = 0x34325842; /// ditto 602 enum uint WL_SHM_FORMAT_ABGR8888 = 0x34324241; /// ditto 603 enum uint WL_SHM_FORMAT_RGBA8888 = 0x34324152; /// ditto 604 enum uint WL_SHM_FORMAT_BGRA8888 = 0x34324142; /// ditto 605 enum uint WL_SHM_FORMAT_XRGB2101010 = 0x30335258; /// ditto 606 enum uint WL_SHM_FORMAT_XBGR2101010 = 0x30334258; /// ditto 607 enum uint WL_SHM_FORMAT_RGBX1010102 = 0x30335852; /// ditto 608 enum uint WL_SHM_FORMAT_BGRX1010102 = 0x30335842; /// ditto 609 enum uint WL_SHM_FORMAT_ARGB2101010 = 0x30335241; /// ditto 610 enum uint WL_SHM_FORMAT_ABGR2101010 = 0x30334241; /// ditto 611 enum uint WL_SHM_FORMAT_RGBA1010102 = 0x30334152; /// ditto 612 enum uint WL_SHM_FORMAT_BGRA1010102 = 0x30334142; /// ditto 613 enum uint WL_SHM_FORMAT_YUYV = 0x56595559; /// ditto 614 enum uint WL_SHM_FORMAT_YVYU = 0x55595659; /// ditto 615 enum uint WL_SHM_FORMAT_UYVY = 0x59565955; /// ditto 616 enum uint WL_SHM_FORMAT_VYUY = 0x59555956; /// ditto 617 enum uint WL_SHM_FORMAT_AYUV = 0x56555941; /// ditto 618 enum uint WL_SHM_FORMAT_NV12 = 0x3231564e; /// ditto 619 enum uint WL_SHM_FORMAT_NV21 = 0x3132564e; /// ditto 620 enum uint WL_SHM_FORMAT_NV16 = 0x3631564e; /// ditto 621 enum uint WL_SHM_FORMAT_NV61 = 0x3136564e; /// ditto 622 enum uint WL_SHM_FORMAT_YUV410 = 0x39565559; /// ditto 623 enum uint WL_SHM_FORMAT_YVU410 = 0x39555659; /// ditto 624 enum uint WL_SHM_FORMAT_YUV411 = 0x31315559; /// ditto 625 enum uint WL_SHM_FORMAT_YVU411 = 0x31315659; /// ditto 626 enum uint WL_SHM_FORMAT_YUV420 = 0x32315559; /// ditto 627 enum uint WL_SHM_FORMAT_YVU420 = 0x32315659; /// ditto 628 enum uint WL_SHM_FORMAT_YUV422 = 0x36315559; /// ditto 629 enum uint WL_SHM_FORMAT_YVU422 = 0x36315659; /// ditto 630 enum uint WL_SHM_FORMAT_YUV444 = 0x34325559; /// ditto 631 enum uint WL_SHM_FORMAT_YVU444 = 0x34325659; /// ditto 632 633 /++ 634 + shared memory support 635 + 636 + A global singleton object that provides support for shared 637 + memory. 638 + 639 + Clients can create wl_shm_pool objects using the create_pool 640 + request. 641 + 642 + At connection setup time, the wl_shm object emits one or more 643 + format events to inform clients about the valid pixel formats 644 + that can be used for buffers. 645 +/ 646 struct wl_shm_listener 647 { 648 /++ 649 + pixel format description 650 + 651 + Informs the client about a valid pixel format that 652 + can be used for buffers. Known formats include 653 + argb8888 and xrgb8888. 654 +/ 655 void function (void *data, 656 wl_shm *wl_shm, 657 uint format) format; 658 } 659 660 extern (D) int 661 wl_shm_add_listener(wl_shm *wl_shm, 662 const(wl_shm_listener) *listener, void *data) 663 { 664 alias Callback = extern (C) void function(); 665 666 return wl_proxy_add_listener( 667 cast(wl_proxy*)wl_shm, 668 cast(Callback*)listener, data); 669 } 670 671 enum uint WL_SHM_CREATE_POOL = 0; 672 673 extern (D) void 674 wl_shm_set_user_data(wl_shm *wl_shm, void *user_data) 675 { 676 wl_proxy_set_user_data(cast(wl_proxy*) wl_shm, user_data); 677 } 678 679 extern (D) void * 680 wl_shm_get_user_data(wl_shm *wl_shm) 681 { 682 return wl_proxy_get_user_data(cast(wl_proxy*) wl_shm); 683 } 684 685 extern (D) void 686 wl_shm_destroy(wl_shm *wl_shm) 687 { 688 wl_proxy_destroy(cast(wl_proxy*) wl_shm); 689 } 690 691 /++ 692 + create a shm pool 693 + 694 + Create a new wl_shm_pool object. 695 + 696 + The pool can be used to create shared memory based buffer 697 + objects. The server will mmap size bytes of the passed file 698 + descriptor, to use as backing memory for the pool. 699 +/ 700 extern (D) wl_shm_pool * 701 wl_shm_create_pool(wl_shm *wl_shm_, int fd, int size) 702 { 703 wl_proxy *id; 704 705 id = wl_proxy_marshal_constructor( 706 cast(wl_proxy*) wl_shm_, 707 WL_SHM_CREATE_POOL, wl_shm_pool_interface, null, fd, size); 708 709 return cast(wl_shm_pool *) id; 710 } 711 712 /++ 713 + content for a wl_surface 714 + 715 + A buffer provides the content for a wl_surface. Buffers are 716 + created through factory interfaces such as wl_drm, wl_shm or 717 + similar. It has a width and a height and can be attached to a 718 + wl_surface, but the mechanism by which a client provides and 719 + updates the contents is defined by the buffer factory interface. 720 +/ 721 struct wl_buffer_listener 722 { 723 /++ 724 + compositor releases buffer 725 + 726 + Sent when this wl_buffer is no longer used by the compositor. 727 + The client is now free to reuse or destroy this buffer and its 728 + backing storage. 729 + 730 + If a client receives a release event before the frame callback 731 + requested in the same wl_surface.commit that attaches this 732 + wl_buffer to a surface, then the client is immediately free to 733 + reuse the buffer and its backing storage, and does not need a 734 + second buffer for the next surface content update. Typically 735 + this is possible, when the compositor maintains a copy of the 736 + wl_surface contents, e.g. as a GL texture. This is an important 737 + optimization for GL(ES) compositors with wl_shm clients. 738 +/ 739 void function (void *data, 740 wl_buffer *wl_buffer) release; 741 } 742 743 extern (D) int 744 wl_buffer_add_listener(wl_buffer *wl_buffer, 745 const(wl_buffer_listener) *listener, void *data) 746 { 747 alias Callback = extern (C) void function(); 748 749 return wl_proxy_add_listener( 750 cast(wl_proxy*)wl_buffer, 751 cast(Callback*)listener, data); 752 } 753 754 enum uint WL_BUFFER_DESTROY = 0; 755 756 extern (D) void 757 wl_buffer_set_user_data(wl_buffer *wl_buffer, void *user_data) 758 { 759 wl_proxy_set_user_data(cast(wl_proxy*) wl_buffer, user_data); 760 } 761 762 extern (D) void * 763 wl_buffer_get_user_data(wl_buffer *wl_buffer) 764 { 765 return wl_proxy_get_user_data(cast(wl_proxy*) wl_buffer); 766 } 767 768 /++ 769 + destroy a buffer 770 + 771 + Destroy a buffer. If and how you need to release the backing 772 + storage is defined by the buffer factory interface. 773 + 774 + For possible side-effects to a surface, see wl_surface.attach. 775 +/ 776 extern (D) void 777 wl_buffer_destroy(wl_buffer *wl_buffer_) 778 { 779 wl_proxy_marshal(cast(wl_proxy*) wl_buffer_, 780 WL_BUFFER_DESTROY); 781 782 wl_proxy_destroy(cast(wl_proxy*) wl_buffer_); 783 } 784 785 /++ 786 + WL_DATA_OFFER_ERROR_INVALID_FINISH: finish request was called untimely 787 + WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK: action mask contains invalid values 788 + WL_DATA_OFFER_ERROR_INVALID_ACTION: action argument has an invalid value 789 + WL_DATA_OFFER_ERROR_INVALID_OFFER: offer doesn't accept this request 790 + 791 +/ 792 enum uint WL_DATA_OFFER_ERROR_INVALID_FINISH = 0; 793 enum uint WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1; /// ditto 794 enum uint WL_DATA_OFFER_ERROR_INVALID_ACTION = 2; /// ditto 795 enum uint WL_DATA_OFFER_ERROR_INVALID_OFFER = 3; /// ditto 796 797 /++ 798 + offer to transfer data 799 + 800 + A wl_data_offer represents a piece of data offered for transfer 801 + by another client (the source client). It is used by the 802 + copy-and-paste and drag-and-drop mechanisms. The offer 803 + describes the different mime types that the data can be 804 + converted to and provides the mechanism for transferring the 805 + data directly from the source client. 806 +/ 807 struct wl_data_offer_listener 808 { 809 /++ 810 + advertise offered mime type 811 + 812 + Sent immediately after creating the wl_data_offer object. One 813 + event per offered mime type. 814 +/ 815 void function (void *data, 816 wl_data_offer *wl_data_offer, 817 const(char) *mime_type) offer; 818 /++ 819 + notify the source-side available actions 820 + 821 + This event indicates the actions offered by the data source. It 822 + will be sent right after wl_data_device.enter, or anytime the source 823 + side changes its offered actions through wl_data_source.set_actions. 824 +/ 825 void function (void *data, 826 wl_data_offer *wl_data_offer, 827 uint source_actions) source_actions; 828 /++ 829 + notify the selected action 830 + 831 + This event indicates the action selected by the compositor after 832 + matching the source/destination side actions. Only one action (or 833 + none) will be offered here. 834 + 835 + This event can be emitted multiple times during the drag-and-drop 836 + operation in response to destination side action changes through 837 + wl_data_offer.set_actions. 838 + 839 + This event will no longer be emitted after wl_data_device.drop 840 + happened on the drag-and-drop destination, the client must 841 + honor the last action received, or the last preferred one set 842 + through wl_data_offer.set_actions when handling an "ask" action. 843 + 844 + Compositors may also change the selected action on the fly, mainly 845 + in response to keyboard modifier changes during the drag-and-drop 846 + operation. 847 + 848 + The most recent action received is always the valid one. Prior to 849 + receiving wl_data_device.drop, the chosen action may change (e.g. 850 + due to keyboard modifiers being pressed). At the time of receiving 851 + wl_data_device.drop the drag-and-drop destination must honor the 852 + last action received. 853 + 854 + Action changes may still happen after wl_data_device.drop, 855 + especially on "ask" actions, where the drag-and-drop destination 856 + may choose another action afterwards. Action changes happening 857 + at this stage are always the result of inter-client negotiation, the 858 + compositor shall no longer be able to induce a different action. 859 + 860 + Upon "ask" actions, it is expected that the drag-and-drop destination 861 + may potentially choose a different action and/or mime type, 862 + based on wl_data_offer.source_actions and finally chosen by the 863 + user (e.g. popping up a menu with the available options). The 864 + final wl_data_offer.set_actions and wl_data_offer.accept requests 865 + must happen before the call to wl_data_offer.finish. 866 +/ 867 void function (void *data, 868 wl_data_offer *wl_data_offer, 869 uint dnd_action) action; 870 } 871 872 extern (D) int 873 wl_data_offer_add_listener(wl_data_offer *wl_data_offer, 874 const(wl_data_offer_listener) *listener, void *data) 875 { 876 alias Callback = extern (C) void function(); 877 878 return wl_proxy_add_listener( 879 cast(wl_proxy*)wl_data_offer, 880 cast(Callback*)listener, data); 881 } 882 883 enum uint WL_DATA_OFFER_ACCEPT = 0; 884 enum uint WL_DATA_OFFER_RECEIVE = 1; 885 enum uint WL_DATA_OFFER_DESTROY = 2; 886 enum uint WL_DATA_OFFER_FINISH = 3; 887 enum uint WL_DATA_OFFER_SET_ACTIONS = 4; 888 889 extern (D) void 890 wl_data_offer_set_user_data(wl_data_offer *wl_data_offer, void *user_data) 891 { 892 wl_proxy_set_user_data(cast(wl_proxy*) wl_data_offer, user_data); 893 } 894 895 extern (D) void * 896 wl_data_offer_get_user_data(wl_data_offer *wl_data_offer) 897 { 898 return wl_proxy_get_user_data(cast(wl_proxy*) wl_data_offer); 899 } 900 901 /++ 902 + accept one of the offered mime types 903 + 904 + Indicate that the client can accept the given mime type, or 905 + NULL for not accepted. 906 + 907 + For objects of version 2 or older, this request is used by the 908 + client to give feedback whether the client can receive the given 909 + mime type, or NULL if none is accepted; the feedback does not 910 + determine whether the drag-and-drop operation succeeds or not. 911 + 912 + For objects of version 3 or newer, this request determines the 913 + final result of the drag-and-drop operation. If the end result 914 + is that no mime types were accepted, the drag-and-drop operation 915 + will be cancelled and the corresponding drag source will receive 916 + wl_data_source.cancelled. Clients may still use this event in 917 + conjunction with wl_data_source.action for feedback. 918 +/ 919 extern (D) void 920 wl_data_offer_accept(wl_data_offer *wl_data_offer_, uint serial, const(char) *mime_type) 921 { 922 wl_proxy_marshal(cast(wl_proxy*) wl_data_offer_, 923 WL_DATA_OFFER_ACCEPT, serial, mime_type); 924 } 925 926 /++ 927 + request that the data is transferred 928 + 929 + To transfer the offered data, the client issues this request 930 + and indicates the mime type it wants to receive. The transfer 931 + happens through the passed file descriptor (typically created 932 + with the pipe system call). The source client writes the data 933 + in the mime type representation requested and then closes the 934 + file descriptor. 935 + 936 + The receiving client reads from the read end of the pipe until 937 + EOF and then closes its end, at which point the transfer is 938 + complete. 939 + 940 + This request may happen multiple times for different mime types, 941 + both before and after wl_data_device.drop. Drag-and-drop destination 942 + clients may preemptively fetch data or examine it more closely to 943 + determine acceptance. 944 +/ 945 extern (D) void 946 wl_data_offer_receive(wl_data_offer *wl_data_offer_, const(char) *mime_type, int fd) 947 { 948 wl_proxy_marshal(cast(wl_proxy*) wl_data_offer_, 949 WL_DATA_OFFER_RECEIVE, mime_type, fd); 950 } 951 952 /++ 953 + destroy data offer 954 + 955 + Destroy the data offer. 956 +/ 957 extern (D) void 958 wl_data_offer_destroy(wl_data_offer *wl_data_offer_) 959 { 960 wl_proxy_marshal(cast(wl_proxy*) wl_data_offer_, 961 WL_DATA_OFFER_DESTROY); 962 963 wl_proxy_destroy(cast(wl_proxy*) wl_data_offer_); 964 } 965 966 /++ 967 + the offer will no longer be used 968 + 969 + Notifies the compositor that the drag destination successfully 970 + finished the drag-and-drop operation. 971 + 972 + Upon receiving this request, the compositor will emit 973 + wl_data_source.dnd_finished on the drag source client. 974 + 975 + It is a client error to perform other requests than 976 + wl_data_offer.destroy after this one. It is also an error to perform 977 + this request after a NULL mime type has been set in 978 + wl_data_offer.accept or no action was received through 979 + wl_data_offer.action. 980 +/ 981 extern (D) void 982 wl_data_offer_finish(wl_data_offer *wl_data_offer_) 983 { 984 wl_proxy_marshal(cast(wl_proxy*) wl_data_offer_, 985 WL_DATA_OFFER_FINISH); 986 } 987 988 /++ 989 + set the available/preferred drag-and-drop actions 990 + 991 + Sets the actions that the destination side client supports for 992 + this operation. This request may trigger the emission of 993 + wl_data_source.action and wl_data_offer.action events if the compositor 994 + needs to change the selected action. 995 + 996 + This request can be called multiple times throughout the 997 + drag-and-drop operation, typically in response to wl_data_device.enter 998 + or wl_data_device.motion events. 999 + 1000 + This request determines the final result of the drag-and-drop 1001 + operation. If the end result is that no action is accepted, 1002 + the drag source will receive wl_drag_source.cancelled. 1003 + 1004 + The dnd_actions argument must contain only values expressed in the 1005 + wl_data_device_manager.dnd_actions enum, and the preferred_action 1006 + argument must only contain one of those values set, otherwise it 1007 + will result in a protocol error. 1008 + 1009 + While managing an "ask" action, the destination drag-and-drop client 1010 + may perform further wl_data_offer.receive requests, and is expected 1011 + to perform one last wl_data_offer.set_actions request with a preferred 1012 + action other than "ask" (and optionally wl_data_offer.accept) before 1013 + requesting wl_data_offer.finish, in order to convey the action selected 1014 + by the user. If the preferred action is not in the 1015 + wl_data_offer.source_actions mask, an error will be raised. 1016 + 1017 + If the "ask" action is dismissed (e.g. user cancellation), the client 1018 + is expected to perform wl_data_offer.destroy right away. 1019 + 1020 + This request can only be made on drag-and-drop offers, a protocol error 1021 + will be raised otherwise. 1022 +/ 1023 extern (D) void 1024 wl_data_offer_set_actions(wl_data_offer *wl_data_offer_, uint dnd_actions, uint preferred_action) 1025 { 1026 wl_proxy_marshal(cast(wl_proxy*) wl_data_offer_, 1027 WL_DATA_OFFER_SET_ACTIONS, dnd_actions, preferred_action); 1028 } 1029 1030 /++ 1031 + WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK: action mask contains invalid values 1032 + WL_DATA_SOURCE_ERROR_INVALID_SOURCE: source doesn't accept this request 1033 + 1034 +/ 1035 enum uint WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0; 1036 enum uint WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1; /// ditto 1037 1038 /++ 1039 + offer to transfer data 1040 + 1041 + The wl_data_source object is the source side of a wl_data_offer. 1042 + It is created by the source client in a data transfer and 1043 + provides a way to describe the offered data and a way to respond 1044 + to requests to transfer the data. 1045 +/ 1046 struct wl_data_source_listener 1047 { 1048 /++ 1049 + a target accepts an offered mime type 1050 + 1051 + Sent when a target accepts pointer_focus or motion events. If 1052 + a target does not accept any of the offered types, type is NULL. 1053 + 1054 + Used for feedback during drag-and-drop. 1055 +/ 1056 void function (void *data, 1057 wl_data_source *wl_data_source, 1058 const(char) *mime_type) target; 1059 /++ 1060 + send the data 1061 + 1062 + Request for data from the client. Send the data as the 1063 + specified mime type over the passed file descriptor, then 1064 + close it. 1065 +/ 1066 void function (void *data, 1067 wl_data_source *wl_data_source, 1068 const(char) *mime_type, 1069 int fd) send; 1070 /++ 1071 + selection was cancelled 1072 + 1073 + This data source is no longer valid. There are several reasons why 1074 + this could happen: 1075 + 1076 + - The data source has been replaced by another data source. 1077 + - The drag-and-drop operation was performed, but the drop destination 1078 + did not accept any of the mime types offered through 1079 + wl_data_source.target. 1080 + - The drag-and-drop operation was performed, but the drop destination 1081 + did not select any of the actions present in the mask offered through 1082 + wl_data_source.action. 1083 + - The drag-and-drop operation was performed but didn't happen over a 1084 + surface. 1085 + - The compositor cancelled the drag-and-drop operation (e.g. compositor 1086 + dependent timeouts to avoid stale drag-and-drop transfers). 1087 + 1088 + The client should clean up and destroy this data source. 1089 + 1090 + For objects of version 2 or older, wl_data_source.cancelled will 1091 + only be emitted if the data source was replaced by another data 1092 + source. 1093 +/ 1094 void function (void *data, 1095 wl_data_source *wl_data_source) cancelled; 1096 /++ 1097 + the drag-and-drop operation physically finished 1098 + 1099 + The user performed the drop action. This event does not indicate 1100 + acceptance, wl_data_source.cancelled may still be emitted afterwards 1101 + if the drop destination does not accept any mime type. 1102 + 1103 + However, this event might however not be received if the compositor 1104 + cancelled the drag-and-drop operation before this event could happen. 1105 + 1106 + Note that the data_source may still be used in the future and should 1107 + not be destroyed here. 1108 +/ 1109 void function (void *data, 1110 wl_data_source *wl_data_source) dnd_drop_performed; 1111 /++ 1112 + the drag-and-drop operation concluded 1113 + 1114 + The drop destination finished interoperating with this data 1115 + source, so the client is now free to destroy this data source and 1116 + free all associated data. 1117 + 1118 + If the action used to perform the operation was "move", the 1119 + source can now delete the transferred data. 1120 +/ 1121 void function (void *data, 1122 wl_data_source *wl_data_source) dnd_finished; 1123 /++ 1124 + notify the selected action 1125 + 1126 + This event indicates the action selected by the compositor after 1127 + matching the source/destination side actions. Only one action (or 1128 + none) will be offered here. 1129 + 1130 + This event can be emitted multiple times during the drag-and-drop 1131 + operation, mainly in response to destination side changes through 1132 + wl_data_offer.set_actions, and as the data device enters/leaves 1133 + surfaces. 1134 + 1135 + It is only possible to receive this event after 1136 + wl_data_source.dnd_drop_performed if the drag-and-drop operation 1137 + ended in an "ask" action, in which case the final wl_data_source.action 1138 + event will happen immediately before wl_data_source.dnd_finished. 1139 + 1140 + Compositors may also change the selected action on the fly, mainly 1141 + in response to keyboard modifier changes during the drag-and-drop 1142 + operation. 1143 + 1144 + The most recent action received is always the valid one. The chosen 1145 + action may change alongside negotiation (e.g. an "ask" action can turn 1146 + into a "move" operation), so the effects of the final action must 1147 + always be applied in wl_data_offer.dnd_finished. 1148 + 1149 + Clients can trigger cursor surface changes from this point, so 1150 + they reflect the current action. 1151 +/ 1152 void function (void *data, 1153 wl_data_source *wl_data_source, 1154 uint dnd_action) action; 1155 } 1156 1157 extern (D) int 1158 wl_data_source_add_listener(wl_data_source *wl_data_source, 1159 const(wl_data_source_listener) *listener, void *data) 1160 { 1161 alias Callback = extern (C) void function(); 1162 1163 return wl_proxy_add_listener( 1164 cast(wl_proxy*)wl_data_source, 1165 cast(Callback*)listener, data); 1166 } 1167 1168 enum uint WL_DATA_SOURCE_OFFER = 0; 1169 enum uint WL_DATA_SOURCE_DESTROY = 1; 1170 enum uint WL_DATA_SOURCE_SET_ACTIONS = 2; 1171 1172 extern (D) void 1173 wl_data_source_set_user_data(wl_data_source *wl_data_source, void *user_data) 1174 { 1175 wl_proxy_set_user_data(cast(wl_proxy*) wl_data_source, user_data); 1176 } 1177 1178 extern (D) void * 1179 wl_data_source_get_user_data(wl_data_source *wl_data_source) 1180 { 1181 return wl_proxy_get_user_data(cast(wl_proxy*) wl_data_source); 1182 } 1183 1184 /++ 1185 + add an offered mime type 1186 + 1187 + This request adds a mime type to the set of mime types 1188 + advertised to targets. Can be called several times to offer 1189 + multiple types. 1190 +/ 1191 extern (D) void 1192 wl_data_source_offer(wl_data_source *wl_data_source_, const(char) *mime_type) 1193 { 1194 wl_proxy_marshal(cast(wl_proxy*) wl_data_source_, 1195 WL_DATA_SOURCE_OFFER, mime_type); 1196 } 1197 1198 /++ 1199 + destroy the data source 1200 + 1201 + Destroy the data source. 1202 +/ 1203 extern (D) void 1204 wl_data_source_destroy(wl_data_source *wl_data_source_) 1205 { 1206 wl_proxy_marshal(cast(wl_proxy*) wl_data_source_, 1207 WL_DATA_SOURCE_DESTROY); 1208 1209 wl_proxy_destroy(cast(wl_proxy*) wl_data_source_); 1210 } 1211 1212 /++ 1213 + set the available drag-and-drop actions 1214 + 1215 + Sets the actions that the source side client supports for this 1216 + operation. This request may trigger wl_data_source.action and 1217 + wl_data_offer.action events if the compositor needs to change the 1218 + selected action. 1219 + 1220 + The dnd_actions argument must contain only values expressed in the 1221 + wl_data_device_manager.dnd_actions enum, otherwise it will result 1222 + in a protocol error. 1223 + 1224 + This request must be made once only, and can only be made on sources 1225 + used in drag-and-drop, so it must be performed before 1226 + wl_data_device.start_drag. Attempting to use the source other than 1227 + for drag-and-drop will raise a protocol error. 1228 +/ 1229 extern (D) void 1230 wl_data_source_set_actions(wl_data_source *wl_data_source_, uint dnd_actions) 1231 { 1232 wl_proxy_marshal(cast(wl_proxy*) wl_data_source_, 1233 WL_DATA_SOURCE_SET_ACTIONS, dnd_actions); 1234 } 1235 1236 /++ 1237 + WL_DATA_DEVICE_ERROR_ROLE: given wl_surface has another role 1238 + 1239 +/ 1240 enum uint WL_DATA_DEVICE_ERROR_ROLE = 0; 1241 1242 /++ 1243 + data transfer device 1244 + 1245 + There is one wl_data_device per seat which can be obtained 1246 + from the global wl_data_device_manager singleton. 1247 + 1248 + A wl_data_device provides access to inter-client data transfer 1249 + mechanisms such as copy-and-paste and drag-and-drop. 1250 +/ 1251 struct wl_data_device_listener 1252 { 1253 /++ 1254 + introduce a new wl_data_offer 1255 + 1256 + The data_offer event introduces a new wl_data_offer object, 1257 + which will subsequently be used in either the 1258 + data_device.enter event (for drag-and-drop) or the 1259 + data_device.selection event (for selections). Immediately 1260 + following the data_device_data_offer event, the new data_offer 1261 + object will send out data_offer.offer events to describe the 1262 + mime types it offers. 1263 +/ 1264 void function (void *data, 1265 wl_data_device *wl_data_device, 1266 wl_data_offer *id) data_offer; 1267 /++ 1268 + initiate drag-and-drop session 1269 + 1270 + This event is sent when an active drag-and-drop pointer enters 1271 + a surface owned by the client. The position of the pointer at 1272 + enter time is provided by the x and y arguments, in surface-local 1273 + coordinates. 1274 +/ 1275 void function (void *data, 1276 wl_data_device *wl_data_device, 1277 uint serial, 1278 wl_surface *surface, 1279 wl_fixed_t x, 1280 wl_fixed_t y, 1281 wl_data_offer *id) enter; 1282 /++ 1283 + end drag-and-drop session 1284 + 1285 + This event is sent when the drag-and-drop pointer leaves the 1286 + surface and the session ends. The client must destroy the 1287 + wl_data_offer introduced at enter time at this point. 1288 +/ 1289 void function (void *data, 1290 wl_data_device *wl_data_device) leave; 1291 /++ 1292 + drag-and-drop session motion 1293 + 1294 + This event is sent when the drag-and-drop pointer moves within 1295 + the currently focused surface. The new position of the pointer 1296 + is provided by the x and y arguments, in surface-local 1297 + coordinates. 1298 +/ 1299 void function (void *data, 1300 wl_data_device *wl_data_device, 1301 uint time, 1302 wl_fixed_t x, 1303 wl_fixed_t y) motion; 1304 /++ 1305 + end drag-and-drop session successfully 1306 + 1307 + The event is sent when a drag-and-drop operation is ended 1308 + because the implicit grab is removed. 1309 + 1310 + The drag-and-drop destination is expected to honor the last action 1311 + received through wl_data_offer.action, if the resulting action is 1312 + "copy" or "move", the destination can still perform 1313 + wl_data_offer.receive requests, and is expected to end all 1314 + transfers with a wl_data_offer.finish request. 1315 + 1316 + If the resulting action is "ask", the action will not be considered 1317 + final. The drag-and-drop destination is expected to perform one last 1318 + wl_data_offer.set_actions request, or wl_data_offer.destroy in order 1319 + to cancel the operation. 1320 +/ 1321 void function (void *data, 1322 wl_data_device *wl_data_device) drop; 1323 /++ 1324 + advertise new selection 1325 + 1326 + The selection event is sent out to notify the client of a new 1327 + wl_data_offer for the selection for this device. The 1328 + data_device.data_offer and the data_offer.offer events are 1329 + sent out immediately before this event to introduce the data 1330 + offer object. The selection event is sent to a client 1331 + immediately before receiving keyboard focus and when a new 1332 + selection is set while the client has keyboard focus. The 1333 + data_offer is valid until a new data_offer or NULL is received 1334 + or until the client loses keyboard focus. The client must 1335 + destroy the previous selection data_offer, if any, upon receiving 1336 + this event. 1337 +/ 1338 void function (void *data, 1339 wl_data_device *wl_data_device, 1340 wl_data_offer *id) selection; 1341 } 1342 1343 extern (D) int 1344 wl_data_device_add_listener(wl_data_device *wl_data_device, 1345 const(wl_data_device_listener) *listener, void *data) 1346 { 1347 alias Callback = extern (C) void function(); 1348 1349 return wl_proxy_add_listener( 1350 cast(wl_proxy*)wl_data_device, 1351 cast(Callback*)listener, data); 1352 } 1353 1354 enum uint WL_DATA_DEVICE_START_DRAG = 0; 1355 enum uint WL_DATA_DEVICE_SET_SELECTION = 1; 1356 enum uint WL_DATA_DEVICE_RELEASE = 2; 1357 1358 extern (D) void 1359 wl_data_device_set_user_data(wl_data_device *wl_data_device, void *user_data) 1360 { 1361 wl_proxy_set_user_data(cast(wl_proxy*) wl_data_device, user_data); 1362 } 1363 1364 extern (D) void * 1365 wl_data_device_get_user_data(wl_data_device *wl_data_device) 1366 { 1367 return wl_proxy_get_user_data(cast(wl_proxy*) wl_data_device); 1368 } 1369 1370 extern (D) void 1371 wl_data_device_destroy(wl_data_device *wl_data_device) 1372 { 1373 wl_proxy_destroy(cast(wl_proxy*) wl_data_device); 1374 } 1375 1376 /++ 1377 + start drag-and-drop operation 1378 + 1379 + This request asks the compositor to start a drag-and-drop 1380 + operation on behalf of the client. 1381 + 1382 + The source argument is the data source that provides the data 1383 + for the eventual data transfer. If source is NULL, enter, leave 1384 + and motion events are sent only to the client that initiated the 1385 + drag and the client is expected to handle the data passing 1386 + internally. 1387 + 1388 + The origin surface is the surface where the drag originates and 1389 + the client must have an active implicit grab that matches the 1390 + serial. 1391 + 1392 + The icon surface is an optional (can be NULL) surface that 1393 + provides an icon to be moved around with the cursor. Initially, 1394 + the top-left corner of the icon surface is placed at the cursor 1395 + hotspot, but subsequent wl_surface.attach request can move the 1396 + relative position. Attach requests must be confirmed with 1397 + wl_surface.commit as usual. The icon surface is given the role of 1398 + a drag-and-drop icon. If the icon surface already has another role, 1399 + it raises a protocol error. 1400 + 1401 + The current and pending input regions of the icon wl_surface are 1402 + cleared, and wl_surface.set_input_region is ignored until the 1403 + wl_surface is no longer used as the icon surface. When the use 1404 + as an icon ends, the current and pending input regions become 1405 + undefined, and the wl_surface is unmapped. 1406 +/ 1407 extern (D) void 1408 wl_data_device_start_drag(wl_data_device *wl_data_device_, wl_data_source *source, wl_surface *origin, wl_surface *icon, uint serial) 1409 { 1410 wl_proxy_marshal(cast(wl_proxy*) wl_data_device_, 1411 WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial); 1412 } 1413 1414 /++ 1415 + copy data to the selection 1416 + 1417 + This request asks the compositor to set the selection 1418 + to the data from the source on behalf of the client. 1419 + 1420 + To unset the selection, set the source to NULL. 1421 +/ 1422 extern (D) void 1423 wl_data_device_set_selection(wl_data_device *wl_data_device_, wl_data_source *source, uint serial) 1424 { 1425 wl_proxy_marshal(cast(wl_proxy*) wl_data_device_, 1426 WL_DATA_DEVICE_SET_SELECTION, source, serial); 1427 } 1428 1429 /++ 1430 + destroy data device 1431 + 1432 + This request destroys the data device. 1433 +/ 1434 extern (D) void 1435 wl_data_device_release(wl_data_device *wl_data_device_) 1436 { 1437 wl_proxy_marshal(cast(wl_proxy*) wl_data_device_, 1438 WL_DATA_DEVICE_RELEASE); 1439 1440 wl_proxy_destroy(cast(wl_proxy*) wl_data_device_); 1441 } 1442 1443 /++ 1444 + drag and drop actions 1445 + 1446 + This is a bitmask of the available/preferred actions in a 1447 + drag-and-drop operation. 1448 + 1449 + In the compositor, the selected action is a result of matching the 1450 + actions offered by the source and destination sides. "action" events 1451 + with a "none" action will be sent to both source and destination if 1452 + there is no match. All further checks will effectively happen on 1453 + (source actions ∩ destination actions). 1454 + 1455 + In addition, compositors may also pick different actions in 1456 + reaction to key modifiers being pressed. One common design that 1457 + is used in major toolkits (and the behavior recommended for 1458 + compositors) is: 1459 + 1460 + - If no modifiers are pressed, the first match (in bit order) 1461 + will be used. 1462 + - Pressing Shift selects "move", if enabled in the mask. 1463 + - Pressing Control selects "copy", if enabled in the mask. 1464 + 1465 + Behavior beyond that is considered implementation-dependent. 1466 + Compositors may for example bind other modifiers (like Alt/Meta) 1467 + or drags initiated with other buttons than BTN_LEFT to specific 1468 + actions (e.g. "ask"). 1469 +/ 1470 /++ 1471 + WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE: no action 1472 + WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY: copy action 1473 + WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE: move action 1474 + WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK: ask action 1475 + 1476 +/ 1477 enum uint WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0; 1478 enum uint WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1; /// ditto 1479 enum uint WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2; /// ditto 1480 enum uint WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4; /// ditto 1481 1482 enum uint WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE = 0; 1483 enum uint WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE = 1; 1484 1485 extern (D) void 1486 wl_data_device_manager_set_user_data(wl_data_device_manager *wl_data_device_manager, void *user_data) 1487 { 1488 wl_proxy_set_user_data(cast(wl_proxy*) wl_data_device_manager, user_data); 1489 } 1490 1491 extern (D) void * 1492 wl_data_device_manager_get_user_data(wl_data_device_manager *wl_data_device_manager) 1493 { 1494 return wl_proxy_get_user_data(cast(wl_proxy*) wl_data_device_manager); 1495 } 1496 1497 extern (D) void 1498 wl_data_device_manager_destroy(wl_data_device_manager *wl_data_device_manager) 1499 { 1500 wl_proxy_destroy(cast(wl_proxy*) wl_data_device_manager); 1501 } 1502 1503 /++ 1504 + create a new data source 1505 + 1506 + Create a new data source. 1507 +/ 1508 extern (D) wl_data_source * 1509 wl_data_device_manager_create_data_source(wl_data_device_manager *wl_data_device_manager_) 1510 { 1511 wl_proxy *id; 1512 1513 id = wl_proxy_marshal_constructor( 1514 cast(wl_proxy*) wl_data_device_manager_, 1515 WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, wl_data_source_interface, null); 1516 1517 return cast(wl_data_source *) id; 1518 } 1519 1520 /++ 1521 + create a new data device 1522 + 1523 + Create a new data device for a given seat. 1524 +/ 1525 extern (D) wl_data_device * 1526 wl_data_device_manager_get_data_device(wl_data_device_manager *wl_data_device_manager_, wl_seat *seat) 1527 { 1528 wl_proxy *id; 1529 1530 id = wl_proxy_marshal_constructor( 1531 cast(wl_proxy*) wl_data_device_manager_, 1532 WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, wl_data_device_interface, null, seat); 1533 1534 return cast(wl_data_device *) id; 1535 } 1536 1537 /++ 1538 + WL_SHELL_ERROR_ROLE: given wl_surface has another role 1539 + 1540 +/ 1541 enum uint WL_SHELL_ERROR_ROLE = 0; 1542 1543 enum uint WL_SHELL_GET_SHELL_SURFACE = 0; 1544 1545 extern (D) void 1546 wl_shell_set_user_data(wl_shell *wl_shell, void *user_data) 1547 { 1548 wl_proxy_set_user_data(cast(wl_proxy*) wl_shell, user_data); 1549 } 1550 1551 extern (D) void * 1552 wl_shell_get_user_data(wl_shell *wl_shell) 1553 { 1554 return wl_proxy_get_user_data(cast(wl_proxy*) wl_shell); 1555 } 1556 1557 extern (D) void 1558 wl_shell_destroy(wl_shell *wl_shell) 1559 { 1560 wl_proxy_destroy(cast(wl_proxy*) wl_shell); 1561 } 1562 1563 /++ 1564 + create a shell surface from a surface 1565 + 1566 + Create a shell surface for an existing surface. This gives 1567 + the wl_surface the role of a shell surface. If the wl_surface 1568 + already has another role, it raises a protocol error. 1569 + 1570 + Only one shell surface can be associated with a given surface. 1571 +/ 1572 extern (D) wl_shell_surface * 1573 wl_shell_get_shell_surface(wl_shell *wl_shell_, wl_surface *surface) 1574 { 1575 wl_proxy *id; 1576 1577 id = wl_proxy_marshal_constructor( 1578 cast(wl_proxy*) wl_shell_, 1579 WL_SHELL_GET_SHELL_SURFACE, wl_shell_surface_interface, null, surface); 1580 1581 return cast(wl_shell_surface *) id; 1582 } 1583 1584 /++ 1585 + edge values for resizing 1586 + 1587 + These values are used to indicate which edge of a surface 1588 + is being dragged in a resize operation. The server may 1589 + use this information to adapt its behavior, e.g. choose 1590 + an appropriate cursor image. 1591 +/ 1592 /++ 1593 + WL_SHELL_SURFACE_RESIZE_NONE: no edge 1594 + WL_SHELL_SURFACE_RESIZE_TOP: top edge 1595 + WL_SHELL_SURFACE_RESIZE_BOTTOM: bottom edge 1596 + WL_SHELL_SURFACE_RESIZE_LEFT: left edge 1597 + WL_SHELL_SURFACE_RESIZE_TOP_LEFT: top and left edges 1598 + WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT: bottom and left edges 1599 + WL_SHELL_SURFACE_RESIZE_RIGHT: right edge 1600 + WL_SHELL_SURFACE_RESIZE_TOP_RIGHT: top and right edges 1601 + WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT: bottom and right edges 1602 + 1603 +/ 1604 enum uint WL_SHELL_SURFACE_RESIZE_NONE = 0; 1605 enum uint WL_SHELL_SURFACE_RESIZE_TOP = 1; /// ditto 1606 enum uint WL_SHELL_SURFACE_RESIZE_BOTTOM = 2; /// ditto 1607 enum uint WL_SHELL_SURFACE_RESIZE_LEFT = 4; /// ditto 1608 enum uint WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5; /// ditto 1609 enum uint WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6; /// ditto 1610 enum uint WL_SHELL_SURFACE_RESIZE_RIGHT = 8; /// ditto 1611 enum uint WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9; /// ditto 1612 enum uint WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10; /// ditto 1613 1614 /++ 1615 + details of transient behaviour 1616 + 1617 + These flags specify details of the expected behaviour 1618 + of transient surfaces. Used in the set_transient request. 1619 +/ 1620 /++ 1621 + WL_SHELL_SURFACE_TRANSIENT_INACTIVE: do not set keyboard focus 1622 + 1623 +/ 1624 enum uint WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1; 1625 1626 /++ 1627 + different method to set the surface fullscreen 1628 + 1629 + Hints to indicate to the compositor how to deal with a conflict 1630 + between the dimensions of the surface and the dimensions of the 1631 + output. The compositor is free to ignore this parameter. 1632 +/ 1633 /++ 1634 + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT: no preference, apply default policy 1635 + WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE: scale, preserve the surface's aspect ratio and center on output 1636 + WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER: switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch 1637 + WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL: no upscaling, center on output and add black borders to compensate size mismatch 1638 + 1639 +/ 1640 enum uint WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0; 1641 enum uint WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1; /// ditto 1642 enum uint WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2; /// ditto 1643 enum uint WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3; /// ditto 1644 1645 /++ 1646 + desktop-style metadata interface 1647 + 1648 + An interface that may be implemented by a wl_surface, for 1649 + implementations that provide a desktop-style user interface. 1650 + 1651 + It provides requests to treat surfaces like toplevel, fullscreen 1652 + or popup windows, move, resize or maximize them, associate 1653 + metadata like title and class, etc. 1654 + 1655 + On the server side the object is automatically destroyed when 1656 + the related wl_surface is destroyed. On the client side, 1657 + wl_shell_surface_destroy() must be called before destroying 1658 + the wl_surface object. 1659 +/ 1660 struct wl_shell_surface_listener 1661 { 1662 /++ 1663 + ping client 1664 + 1665 + Ping a client to check if it is receiving events and sending 1666 + requests. A client is expected to reply with a pong request. 1667 +/ 1668 void function (void *data, 1669 wl_shell_surface *wl_shell_surface, 1670 uint serial) ping; 1671 /++ 1672 + suggest resize 1673 + 1674 + The configure event asks the client to resize its surface. 1675 + 1676 + The size is a hint, in the sense that the client is free to 1677 + ignore it if it doesn't resize, pick a smaller size (to 1678 + satisfy aspect ratio or resize in steps of NxM pixels). 1679 + 1680 + The edges parameter provides a hint about how the surface 1681 + was resized. The client may use this information to decide 1682 + how to adjust its content to the new size (e.g. a scrolling 1683 + area might adjust its content position to leave the viewable 1684 + content unmoved). 1685 + 1686 + The client is free to dismiss all but the last configure 1687 + event it received. 1688 + 1689 + The width and height arguments specify the size of the window 1690 + in surface-local coordinates. 1691 +/ 1692 void function (void *data, 1693 wl_shell_surface *wl_shell_surface, 1694 uint edges, 1695 int width, 1696 int height) configure; 1697 /++ 1698 + popup interaction is done 1699 + 1700 + The popup_done event is sent out when a popup grab is broken, 1701 + that is, when the user clicks a surface that doesn't belong 1702 + to the client owning the popup surface. 1703 +/ 1704 void function (void *data, 1705 wl_shell_surface *wl_shell_surface) popup_done; 1706 } 1707 1708 extern (D) int 1709 wl_shell_surface_add_listener(wl_shell_surface *wl_shell_surface, 1710 const(wl_shell_surface_listener) *listener, void *data) 1711 { 1712 alias Callback = extern (C) void function(); 1713 1714 return wl_proxy_add_listener( 1715 cast(wl_proxy*)wl_shell_surface, 1716 cast(Callback*)listener, data); 1717 } 1718 1719 enum uint WL_SHELL_SURFACE_PONG = 0; 1720 enum uint WL_SHELL_SURFACE_MOVE = 1; 1721 enum uint WL_SHELL_SURFACE_RESIZE = 2; 1722 enum uint WL_SHELL_SURFACE_SET_TOPLEVEL = 3; 1723 enum uint WL_SHELL_SURFACE_SET_TRANSIENT = 4; 1724 enum uint WL_SHELL_SURFACE_SET_FULLSCREEN = 5; 1725 enum uint WL_SHELL_SURFACE_SET_POPUP = 6; 1726 enum uint WL_SHELL_SURFACE_SET_MAXIMIZED = 7; 1727 enum uint WL_SHELL_SURFACE_SET_TITLE = 8; 1728 enum uint WL_SHELL_SURFACE_SET_CLASS = 9; 1729 1730 extern (D) void 1731 wl_shell_surface_set_user_data(wl_shell_surface *wl_shell_surface, void *user_data) 1732 { 1733 wl_proxy_set_user_data(cast(wl_proxy*) wl_shell_surface, user_data); 1734 } 1735 1736 extern (D) void * 1737 wl_shell_surface_get_user_data(wl_shell_surface *wl_shell_surface) 1738 { 1739 return wl_proxy_get_user_data(cast(wl_proxy*) wl_shell_surface); 1740 } 1741 1742 extern (D) void 1743 wl_shell_surface_destroy(wl_shell_surface *wl_shell_surface) 1744 { 1745 wl_proxy_destroy(cast(wl_proxy*) wl_shell_surface); 1746 } 1747 1748 /++ 1749 + respond to a ping event 1750 + 1751 + A client must respond to a ping event with a pong request or 1752 + the client may be deemed unresponsive. 1753 +/ 1754 extern (D) void 1755 wl_shell_surface_pong(wl_shell_surface *wl_shell_surface_, uint serial) 1756 { 1757 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1758 WL_SHELL_SURFACE_PONG, serial); 1759 } 1760 1761 /++ 1762 + start an interactive move 1763 + 1764 + Start a pointer-driven move of the surface. 1765 + 1766 + This request must be used in response to a button press event. 1767 + The server may ignore move requests depending on the state of 1768 + the surface (e.g. fullscreen or maximized). 1769 +/ 1770 extern (D) void 1771 wl_shell_surface_move(wl_shell_surface *wl_shell_surface_, wl_seat *seat, uint serial) 1772 { 1773 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1774 WL_SHELL_SURFACE_MOVE, seat, serial); 1775 } 1776 1777 /++ 1778 + start an interactive resize 1779 + 1780 + Start a pointer-driven resizing of the surface. 1781 + 1782 + This request must be used in response to a button press event. 1783 + The server may ignore resize requests depending on the state of 1784 + the surface (e.g. fullscreen or maximized). 1785 +/ 1786 extern (D) void 1787 wl_shell_surface_resize(wl_shell_surface *wl_shell_surface_, wl_seat *seat, uint serial, uint edges) 1788 { 1789 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1790 WL_SHELL_SURFACE_RESIZE, seat, serial, edges); 1791 } 1792 1793 /++ 1794 + make the surface a toplevel surface 1795 + 1796 + Map the surface as a toplevel surface. 1797 + 1798 + A toplevel surface is not fullscreen, maximized or transient. 1799 +/ 1800 extern (D) void 1801 wl_shell_surface_set_toplevel(wl_shell_surface *wl_shell_surface_) 1802 { 1803 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1804 WL_SHELL_SURFACE_SET_TOPLEVEL); 1805 } 1806 1807 /++ 1808 + make the surface a transient surface 1809 + 1810 + Map the surface relative to an existing surface. 1811 + 1812 + The x and y arguments specify the location of the upper left 1813 + corner of the surface relative to the upper left corner of the 1814 + parent surface, in surface-local coordinates. 1815 + 1816 + The flags argument controls details of the transient behaviour. 1817 +/ 1818 extern (D) void 1819 wl_shell_surface_set_transient(wl_shell_surface *wl_shell_surface_, wl_surface *parent, int x, int y, uint flags) 1820 { 1821 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1822 WL_SHELL_SURFACE_SET_TRANSIENT, parent, x, y, flags); 1823 } 1824 1825 /++ 1826 + make the surface a fullscreen surface 1827 + 1828 + Map the surface as a fullscreen surface. 1829 + 1830 + If an output parameter is given then the surface will be made 1831 + fullscreen on that output. If the client does not specify the 1832 + output then the compositor will apply its policy - usually 1833 + choosing the output on which the surface has the biggest surface 1834 + area. 1835 + 1836 + The client may specify a method to resolve a size conflict 1837 + between the output size and the surface size - this is provided 1838 + through the method parameter. 1839 + 1840 + The framerate parameter is used only when the method is set 1841 + to "driver", to indicate the preferred framerate. A value of 0 1842 + indicates that the client does not care about framerate. The 1843 + framerate is specified in mHz, that is framerate of 60000 is 60Hz. 1844 + 1845 + A method of "scale" or "driver" implies a scaling operation of 1846 + the surface, either via a direct scaling operation or a change of 1847 + the output mode. This will override any kind of output scaling, so 1848 + that mapping a surface with a buffer size equal to the mode can 1849 + fill the screen independent of buffer_scale. 1850 + 1851 + A method of "fill" means we don't scale up the buffer, however 1852 + any output scale is applied. This means that you may run into 1853 + an edge case where the application maps a buffer with the same 1854 + size of the output mode but buffer_scale 1 (thus making a 1855 + surface larger than the output). In this case it is allowed to 1856 + downscale the results to fit the screen. 1857 + 1858 + The compositor must reply to this request with a configure event 1859 + with the dimensions for the output on which the surface will 1860 + be made fullscreen. 1861 +/ 1862 extern (D) void 1863 wl_shell_surface_set_fullscreen(wl_shell_surface *wl_shell_surface_, uint method, uint framerate, wl_output *output) 1864 { 1865 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1866 WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output); 1867 } 1868 1869 /++ 1870 + make the surface a popup surface 1871 + 1872 + Map the surface as a popup. 1873 + 1874 + A popup surface is a transient surface with an added pointer 1875 + grab. 1876 + 1877 + An existing implicit grab will be changed to owner-events mode, 1878 + and the popup grab will continue after the implicit grab ends 1879 + (i.e. releasing the mouse button does not cause the popup to 1880 + be unmapped). 1881 + 1882 + The popup grab continues until the window is destroyed or a 1883 + mouse button is pressed in any other client's window. A click 1884 + in any of the client's surfaces is reported as normal, however, 1885 + clicks in other clients' surfaces will be discarded and trigger 1886 + the callback. 1887 + 1888 + The x and y arguments specify the location of the upper left 1889 + corner of the surface relative to the upper left corner of the 1890 + parent surface, in surface-local coordinates. 1891 +/ 1892 extern (D) void 1893 wl_shell_surface_set_popup(wl_shell_surface *wl_shell_surface_, wl_seat *seat, uint serial, wl_surface *parent, int x, int y, uint flags) 1894 { 1895 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1896 WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags); 1897 } 1898 1899 /++ 1900 + make the surface a maximized surface 1901 + 1902 + Map the surface as a maximized surface. 1903 + 1904 + If an output parameter is given then the surface will be 1905 + maximized on that output. If the client does not specify the 1906 + output then the compositor will apply its policy - usually 1907 + choosing the output on which the surface has the biggest surface 1908 + area. 1909 + 1910 + The compositor will reply with a configure event telling 1911 + the expected new surface size. The operation is completed 1912 + on the next buffer attach to this surface. 1913 + 1914 + A maximized surface typically fills the entire output it is 1915 + bound to, except for desktop elements such as panels. This is 1916 + the main difference between a maximized shell surface and a 1917 + fullscreen shell surface. 1918 + 1919 + The details depend on the compositor implementation. 1920 +/ 1921 extern (D) void 1922 wl_shell_surface_set_maximized(wl_shell_surface *wl_shell_surface_, wl_output *output) 1923 { 1924 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1925 WL_SHELL_SURFACE_SET_MAXIMIZED, output); 1926 } 1927 1928 /++ 1929 + set surface title 1930 + 1931 + Set a short title for the surface. 1932 + 1933 + This string may be used to identify the surface in a task bar, 1934 + window list, or other user interface elements provided by the 1935 + compositor. 1936 + 1937 + The string must be encoded in UTF-8. 1938 +/ 1939 extern (D) void 1940 wl_shell_surface_set_title(wl_shell_surface *wl_shell_surface_, const(char) *title) 1941 { 1942 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1943 WL_SHELL_SURFACE_SET_TITLE, title); 1944 } 1945 1946 /++ 1947 + set surface class 1948 + 1949 + Set a class for the surface. 1950 + 1951 + The surface class identifies the general class of applications 1952 + to which the surface belongs. A common convention is to use the 1953 + file name (or the full path if it is a non-standard location) of 1954 + the application's .desktop file as the class. 1955 +/ 1956 extern (D) void 1957 wl_shell_surface_set_class(wl_shell_surface *wl_shell_surface_, const(char) *class_) 1958 { 1959 wl_proxy_marshal(cast(wl_proxy*) wl_shell_surface_, 1960 WL_SHELL_SURFACE_SET_CLASS, class_); 1961 } 1962 1963 /++ 1964 + wl_surface error values 1965 + 1966 + These errors can be emitted in response to wl_surface requests. 1967 +/ 1968 /++ 1969 + WL_SURFACE_ERROR_INVALID_SCALE: buffer scale value is invalid 1970 + WL_SURFACE_ERROR_INVALID_TRANSFORM: buffer transform value is invalid 1971 + 1972 +/ 1973 enum uint WL_SURFACE_ERROR_INVALID_SCALE = 0; 1974 enum uint WL_SURFACE_ERROR_INVALID_TRANSFORM = 1; /// ditto 1975 1976 /++ 1977 + an onscreen surface 1978 + 1979 + A surface is a rectangular area that is displayed on the screen. 1980 + It has a location, size and pixel contents. 1981 + 1982 + The size of a surface (and relative positions on it) is described 1983 + in surface-local coordinates, which may differ from the buffer 1984 + coordinates of the pixel content, in case a buffer_transform 1985 + or a buffer_scale is used. 1986 + 1987 + A surface without a "role" is fairly useless: a compositor does 1988 + not know where, when or how to present it. The role is the 1989 + purpose of a wl_surface. Examples of roles are a cursor for a 1990 + pointer (as set by wl_pointer.set_cursor), a drag icon 1991 + (wl_data_device.start_drag), a sub-surface 1992 + (wl_subcompositor.get_subsurface), and a window as defined by a 1993 + shell protocol (e.g. wl_shell.get_shell_surface). 1994 + 1995 + A surface can have only one role at a time. Initially a 1996 + wl_surface does not have a role. Once a wl_surface is given a 1997 + role, it is set permanently for the whole lifetime of the 1998 + wl_surface object. Giving the current role again is allowed, 1999 + unless explicitly forbidden by the relevant interface 2000 + specification. 2001 + 2002 + Surface roles are given by requests in other interfaces such as 2003 + wl_pointer.set_cursor. The request should explicitly mention 2004 + that this request gives a role to a wl_surface. Often, this 2005 + request also creates a new protocol object that represents the 2006 + role and adds additional functionality to wl_surface. When a 2007 + client wants to destroy a wl_surface, they must destroy this 'role 2008 + object' before the wl_surface. 2009 + 2010 + Destroying the role object does not remove the role from the 2011 + wl_surface, but it may stop the wl_surface from "playing the role". 2012 + For instance, if a wl_subsurface object is destroyed, the wl_surface 2013 + it was created for will be unmapped and forget its position and 2014 + z-order. It is allowed to create a wl_subsurface for the same 2015 + wl_surface again, but it is not allowed to use the wl_surface as 2016 + a cursor (cursor is a different role than sub-surface, and role 2017 + switching is not allowed). 2018 +/ 2019 struct wl_surface_listener 2020 { 2021 /++ 2022 + surface enters an output 2023 + 2024 + This is emitted whenever a surface's creation, movement, or resizing 2025 + results in some part of it being within the scanout region of an 2026 + output. 2027 + 2028 + Note that a surface may be overlapping with zero or more outputs. 2029 +/ 2030 void function (void *data, 2031 wl_surface *wl_surface, 2032 wl_output *output) enter; 2033 /++ 2034 + surface leaves an output 2035 + 2036 + This is emitted whenever a surface's creation, movement, or resizing 2037 + results in it no longer having any part of it within the scanout region 2038 + of an output. 2039 +/ 2040 void function (void *data, 2041 wl_surface *wl_surface, 2042 wl_output *output) leave; 2043 } 2044 2045 extern (D) int 2046 wl_surface_add_listener(wl_surface *wl_surface, 2047 const(wl_surface_listener) *listener, void *data) 2048 { 2049 alias Callback = extern (C) void function(); 2050 2051 return wl_proxy_add_listener( 2052 cast(wl_proxy*)wl_surface, 2053 cast(Callback*)listener, data); 2054 } 2055 2056 enum uint WL_SURFACE_DESTROY = 0; 2057 enum uint WL_SURFACE_ATTACH = 1; 2058 enum uint WL_SURFACE_DAMAGE = 2; 2059 enum uint WL_SURFACE_FRAME = 3; 2060 enum uint WL_SURFACE_SET_OPAQUE_REGION = 4; 2061 enum uint WL_SURFACE_SET_INPUT_REGION = 5; 2062 enum uint WL_SURFACE_COMMIT = 6; 2063 enum uint WL_SURFACE_SET_BUFFER_TRANSFORM = 7; 2064 enum uint WL_SURFACE_SET_BUFFER_SCALE = 8; 2065 enum uint WL_SURFACE_DAMAGE_BUFFER = 9; 2066 2067 extern (D) void 2068 wl_surface_set_user_data(wl_surface *wl_surface, void *user_data) 2069 { 2070 wl_proxy_set_user_data(cast(wl_proxy*) wl_surface, user_data); 2071 } 2072 2073 extern (D) void * 2074 wl_surface_get_user_data(wl_surface *wl_surface) 2075 { 2076 return wl_proxy_get_user_data(cast(wl_proxy*) wl_surface); 2077 } 2078 2079 /++ 2080 + delete surface 2081 + 2082 + Deletes the surface and invalidates its object ID. 2083 +/ 2084 extern (D) void 2085 wl_surface_destroy(wl_surface *wl_surface_) 2086 { 2087 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2088 WL_SURFACE_DESTROY); 2089 2090 wl_proxy_destroy(cast(wl_proxy*) wl_surface_); 2091 } 2092 2093 /++ 2094 + set the surface contents 2095 + 2096 + Set a buffer as the content of this surface. 2097 + 2098 + The new size of the surface is calculated based on the buffer 2099 + size transformed by the inverse buffer_transform and the 2100 + inverse buffer_scale. This means that the supplied buffer 2101 + must be an integer multiple of the buffer_scale. 2102 + 2103 + The x and y arguments specify the location of the new pending 2104 + buffer's upper left corner, relative to the current buffer's upper 2105 + left corner, in surface-local coordinates. In other words, the 2106 + x and y, combined with the new surface size define in which 2107 + directions the surface's size changes. 2108 + 2109 + Surface contents are double-buffered state, see wl_surface.commit. 2110 + 2111 + The initial surface contents are void; there is no content. 2112 + wl_surface.attach assigns the given wl_buffer as the pending 2113 + wl_buffer. wl_surface.commit makes the pending wl_buffer the new 2114 + surface contents, and the size of the surface becomes the size 2115 + calculated from the wl_buffer, as described above. After commit, 2116 + there is no pending buffer until the next attach. 2117 + 2118 + Committing a pending wl_buffer allows the compositor to read the 2119 + pixels in the wl_buffer. The compositor may access the pixels at 2120 + any time after the wl_surface.commit request. When the compositor 2121 + will not access the pixels anymore, it will send the 2122 + wl_buffer.release event. Only after receiving wl_buffer.release, 2123 + the client may reuse the wl_buffer. A wl_buffer that has been 2124 + attached and then replaced by another attach instead of committed 2125 + will not receive a release event, and is not used by the 2126 + compositor. 2127 + 2128 + Destroying the wl_buffer after wl_buffer.release does not change 2129 + the surface contents. However, if the client destroys the 2130 + wl_buffer before receiving the wl_buffer.release event, the surface 2131 + contents become undefined immediately. 2132 + 2133 + If wl_surface.attach is sent with a NULL wl_buffer, the 2134 + following wl_surface.commit will remove the surface content. 2135 +/ 2136 extern (D) void 2137 wl_surface_attach(wl_surface *wl_surface_, wl_buffer *buffer, int x, int y) 2138 { 2139 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2140 WL_SURFACE_ATTACH, buffer, x, y); 2141 } 2142 2143 /++ 2144 + mark part of the surface damaged 2145 + 2146 + This request is used to describe the regions where the pending 2147 + buffer is different from the current surface contents, and where 2148 + the surface therefore needs to be repainted. The compositor 2149 + ignores the parts of the damage that fall outside of the surface. 2150 + 2151 + Damage is double-buffered state, see wl_surface.commit. 2152 + 2153 + The damage rectangle is specified in surface-local coordinates, 2154 + where x and y specify the upper left corner of the damage rectangle. 2155 + 2156 + The initial value for pending damage is empty: no damage. 2157 + wl_surface.damage adds pending damage: the new pending damage 2158 + is the union of old pending damage and the given rectangle. 2159 + 2160 + wl_surface.commit assigns pending damage as the current damage, 2161 + and clears pending damage. The server will clear the current 2162 + damage as it repaints the surface. 2163 + 2164 + Alternatively, damage can be posted with wl_surface.damage_buffer 2165 + which uses buffer coordinates instead of surface coordinates, 2166 + and is probably the preferred and intuitive way of doing this. 2167 +/ 2168 extern (D) void 2169 wl_surface_damage(wl_surface *wl_surface_, int x, int y, int width, int height) 2170 { 2171 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2172 WL_SURFACE_DAMAGE, x, y, width, height); 2173 } 2174 2175 /++ 2176 + request a frame throttling hint 2177 + 2178 + Request a notification when it is a good time to start drawing a new 2179 + frame, by creating a frame callback. This is useful for throttling 2180 + redrawing operations, and driving animations. 2181 + 2182 + When a client is animating on a wl_surface, it can use the 'frame' 2183 + request to get notified when it is a good time to draw and commit the 2184 + next frame of animation. If the client commits an update earlier than 2185 + that, it is likely that some updates will not make it to the display, 2186 + and the client is wasting resources by drawing too often. 2187 + 2188 + The frame request will take effect on the next wl_surface.commit. 2189 + The notification will only be posted for one frame unless 2190 + requested again. For a wl_surface, the notifications are posted in 2191 + the order the frame requests were committed. 2192 + 2193 + The server must send the notifications so that a client 2194 + will not send excessive updates, while still allowing 2195 + the highest possible update rate for clients that wait for the reply 2196 + before drawing again. The server should give some time for the client 2197 + to draw and commit after sending the frame callback events to let it 2198 + hit the next output refresh. 2199 + 2200 + A server should avoid signaling the frame callbacks if the 2201 + surface is not visible in any way, e.g. the surface is off-screen, 2202 + or completely obscured by other opaque surfaces. 2203 + 2204 + The object returned by this request will be destroyed by the 2205 + compositor after the callback is fired and as such the client must not 2206 + attempt to use it after that point. 2207 + 2208 + The callback_data passed in the callback is the current time, in 2209 + milliseconds, with an undefined base. 2210 +/ 2211 extern (D) wl_callback * 2212 wl_surface_frame(wl_surface *wl_surface_) 2213 { 2214 wl_proxy *callback; 2215 2216 callback = wl_proxy_marshal_constructor( 2217 cast(wl_proxy*) wl_surface_, 2218 WL_SURFACE_FRAME, wl_callback_interface, null); 2219 2220 return cast(wl_callback *) callback; 2221 } 2222 2223 /++ 2224 + set opaque region 2225 + 2226 + This request sets the region of the surface that contains 2227 + opaque content. 2228 + 2229 + The opaque region is an optimization hint for the compositor 2230 + that lets it optimize the redrawing of content behind opaque 2231 + regions. Setting an opaque region is not required for correct 2232 + behaviour, but marking transparent content as opaque will result 2233 + in repaint artifacts. 2234 + 2235 + The opaque region is specified in surface-local coordinates. 2236 + 2237 + The compositor ignores the parts of the opaque region that fall 2238 + outside of the surface. 2239 + 2240 + Opaque region is double-buffered state, see wl_surface.commit. 2241 + 2242 + wl_surface.set_opaque_region changes the pending opaque region. 2243 + wl_surface.commit copies the pending region to the current region. 2244 + Otherwise, the pending and current regions are never changed. 2245 + 2246 + The initial value for an opaque region is empty. Setting the pending 2247 + opaque region has copy semantics, and the wl_region object can be 2248 + destroyed immediately. A NULL wl_region causes the pending opaque 2249 + region to be set to empty. 2250 +/ 2251 extern (D) void 2252 wl_surface_set_opaque_region(wl_surface *wl_surface_, wl_region *region) 2253 { 2254 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2255 WL_SURFACE_SET_OPAQUE_REGION, region); 2256 } 2257 2258 /++ 2259 + set input region 2260 + 2261 + This request sets the region of the surface that can receive 2262 + pointer and touch events. 2263 + 2264 + Input events happening outside of this region will try the next 2265 + surface in the server surface stack. The compositor ignores the 2266 + parts of the input region that fall outside of the surface. 2267 + 2268 + The input region is specified in surface-local coordinates. 2269 + 2270 + Input region is double-buffered state, see wl_surface.commit. 2271 + 2272 + wl_surface.set_input_region changes the pending input region. 2273 + wl_surface.commit copies the pending region to the current region. 2274 + Otherwise the pending and current regions are never changed, 2275 + except cursor and icon surfaces are special cases, see 2276 + wl_pointer.set_cursor and wl_data_device.start_drag. 2277 + 2278 + The initial value for an input region is infinite. That means the 2279 + whole surface will accept input. Setting the pending input region 2280 + has copy semantics, and the wl_region object can be destroyed 2281 + immediately. A NULL wl_region causes the input region to be set 2282 + to infinite. 2283 +/ 2284 extern (D) void 2285 wl_surface_set_input_region(wl_surface *wl_surface_, wl_region *region) 2286 { 2287 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2288 WL_SURFACE_SET_INPUT_REGION, region); 2289 } 2290 2291 /++ 2292 + commit pending surface state 2293 + 2294 + Surface state (input, opaque, and damage regions, attached buffers, 2295 + etc.) is double-buffered. Protocol requests modify the pending state, 2296 + as opposed to the current state in use by the compositor. A commit 2297 + request atomically applies all pending state, replacing the current 2298 + state. After commit, the new pending state is as documented for each 2299 + related request. 2300 + 2301 + On commit, a pending wl_buffer is applied first, and all other state 2302 + second. This means that all coordinates in double-buffered state are 2303 + relative to the new wl_buffer coming into use, except for 2304 + wl_surface.attach itself. If there is no pending wl_buffer, the 2305 + coordinates are relative to the current surface contents. 2306 + 2307 + All requests that need a commit to become effective are documented 2308 + to affect double-buffered state. 2309 + 2310 + Other interfaces may add further double-buffered surface state. 2311 +/ 2312 extern (D) void 2313 wl_surface_commit(wl_surface *wl_surface_) 2314 { 2315 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2316 WL_SURFACE_COMMIT); 2317 } 2318 2319 /++ 2320 + sets the buffer transformation 2321 + 2322 + This request sets an optional transformation on how the compositor 2323 + interprets the contents of the buffer attached to the surface. The 2324 + accepted values for the transform parameter are the values for 2325 + wl_output.transform. 2326 + 2327 + Buffer transform is double-buffered state, see wl_surface.commit. 2328 + 2329 + A newly created surface has its buffer transformation set to normal. 2330 + 2331 + wl_surface.set_buffer_transform changes the pending buffer 2332 + transformation. wl_surface.commit copies the pending buffer 2333 + transformation to the current one. Otherwise, the pending and current 2334 + values are never changed. 2335 + 2336 + The purpose of this request is to allow clients to render content 2337 + according to the output transform, thus permitting the compositor to 2338 + use certain optimizations even if the display is rotated. Using 2339 + hardware overlays and scanning out a client buffer for fullscreen 2340 + surfaces are examples of such optimizations. Those optimizations are 2341 + highly dependent on the compositor implementation, so the use of this 2342 + request should be considered on a case-by-case basis. 2343 + 2344 + Note that if the transform value includes 90 or 270 degree rotation, 2345 + the width of the buffer will become the surface height and the height 2346 + of the buffer will become the surface width. 2347 + 2348 + If transform is not one of the values from the 2349 + wl_output.transform enum the invalid_transform protocol error 2350 + is raised. 2351 +/ 2352 extern (D) void 2353 wl_surface_set_buffer_transform(wl_surface *wl_surface_, int transform) 2354 { 2355 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2356 WL_SURFACE_SET_BUFFER_TRANSFORM, transform); 2357 } 2358 2359 /++ 2360 + sets the buffer scaling factor 2361 + 2362 + This request sets an optional scaling factor on how the compositor 2363 + interprets the contents of the buffer attached to the window. 2364 + 2365 + Buffer scale is double-buffered state, see wl_surface.commit. 2366 + 2367 + A newly created surface has its buffer scale set to 1. 2368 + 2369 + wl_surface.set_buffer_scale changes the pending buffer scale. 2370 + wl_surface.commit copies the pending buffer scale to the current one. 2371 + Otherwise, the pending and current values are never changed. 2372 + 2373 + The purpose of this request is to allow clients to supply higher 2374 + resolution buffer data for use on high resolution outputs. It is 2375 + intended that you pick the same buffer scale as the scale of the 2376 + output that the surface is displayed on. This means the compositor 2377 + can avoid scaling when rendering the surface on that output. 2378 + 2379 + Note that if the scale is larger than 1, then you have to attach 2380 + a buffer that is larger (by a factor of scale in each dimension) 2381 + than the desired surface size. 2382 + 2383 + If scale is not positive the invalid_scale protocol error is 2384 + raised. 2385 +/ 2386 extern (D) void 2387 wl_surface_set_buffer_scale(wl_surface *wl_surface_, int scale) 2388 { 2389 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2390 WL_SURFACE_SET_BUFFER_SCALE, scale); 2391 } 2392 2393 /++ 2394 + mark part of the surface damaged using buffer coordinates 2395 + 2396 + This request is used to describe the regions where the pending 2397 + buffer is different from the current surface contents, and where 2398 + the surface therefore needs to be repainted. The compositor 2399 + ignores the parts of the damage that fall outside of the surface. 2400 + 2401 + Damage is double-buffered state, see wl_surface.commit. 2402 + 2403 + The damage rectangle is specified in buffer coordinates, 2404 + where x and y specify the upper left corner of the damage rectangle. 2405 + 2406 + The initial value for pending damage is empty: no damage. 2407 + wl_surface.damage_buffer adds pending damage: the new pending 2408 + damage is the union of old pending damage and the given rectangle. 2409 + 2410 + wl_surface.commit assigns pending damage as the current damage, 2411 + and clears pending damage. The server will clear the current 2412 + damage as it repaints the surface. 2413 + 2414 + This request differs from wl_surface.damage in only one way - it 2415 + takes damage in buffer coordinates instead of surface-local 2416 + coordinates. While this generally is more intuitive than surface 2417 + coordinates, it is especially desirable when using wp_viewport 2418 + or when a drawing library (like EGL) is unaware of buffer scale 2419 + and buffer transform. 2420 + 2421 + Note: Because buffer transformation changes and damage requests may 2422 + be interleaved in the protocol stream, it is impossible to determine 2423 + the actual mapping between surface and buffer damage until 2424 + wl_surface.commit time. Therefore, compositors wishing to take both 2425 + kinds of damage into account will have to accumulate damage from the 2426 + two requests separately and only transform from one to the other 2427 + after receiving the wl_surface.commit. 2428 +/ 2429 extern (D) void 2430 wl_surface_damage_buffer(wl_surface *wl_surface_, int x, int y, int width, int height) 2431 { 2432 wl_proxy_marshal(cast(wl_proxy*) wl_surface_, 2433 WL_SURFACE_DAMAGE_BUFFER, x, y, width, height); 2434 } 2435 2436 /++ 2437 + seat capability bitmask 2438 + 2439 + This is a bitmask of capabilities this seat has; if a member is 2440 + set, then it is present on the seat. 2441 +/ 2442 /++ 2443 + WL_SEAT_CAPABILITY_POINTER: the seat has pointer devices 2444 + WL_SEAT_CAPABILITY_KEYBOARD: the seat has one or more keyboards 2445 + WL_SEAT_CAPABILITY_TOUCH: the seat has touch devices 2446 + 2447 +/ 2448 enum uint WL_SEAT_CAPABILITY_POINTER = 1; 2449 enum uint WL_SEAT_CAPABILITY_KEYBOARD = 2; /// ditto 2450 enum uint WL_SEAT_CAPABILITY_TOUCH = 4; /// ditto 2451 2452 /++ 2453 + group of input devices 2454 + 2455 + A seat is a group of keyboards, pointer and touch devices. This 2456 + object is published as a global during start up, or when such a 2457 + device is hot plugged. A seat typically has a pointer and 2458 + maintains a keyboard focus and a pointer focus. 2459 +/ 2460 struct wl_seat_listener 2461 { 2462 /++ 2463 + seat capabilities changed 2464 + 2465 + This is emitted whenever a seat gains or loses the pointer, 2466 + keyboard or touch capabilities. The argument is a capability 2467 + enum containing the complete set of capabilities this seat has. 2468 + 2469 + When the pointer capability is added, a client may create a 2470 + wl_pointer object using the wl_seat.get_pointer request. This object 2471 + will receive pointer events until the capability is removed in the 2472 + future. 2473 + 2474 + When the pointer capability is removed, a client should destroy the 2475 + wl_pointer objects associated with the seat where the capability was 2476 + removed, using the wl_pointer.release request. No further pointer 2477 + events will be received on these objects. 2478 + 2479 + In some compositors, if a seat regains the pointer capability and a 2480 + client has a previously obtained wl_pointer object of version 4 or 2481 + less, that object may start sending pointer events again. This 2482 + behavior is considered a misinterpretation of the intended behavior 2483 + and must not be relied upon by the client. wl_pointer objects of 2484 + version 5 or later must not send events if created before the most 2485 + recent event notifying the client of an added pointer capability. 2486 + 2487 + The above behavior also applies to wl_keyboard and wl_touch with the 2488 + keyboard and touch capabilities, respectively. 2489 +/ 2490 void function (void *data, 2491 wl_seat *wl_seat, 2492 uint capabilities) capabilities; 2493 /++ 2494 + unique identifier for this seat 2495 + 2496 + In a multiseat configuration this can be used by the client to help 2497 + identify which physical devices the seat represents. Based on 2498 + the seat configuration used by the compositor. 2499 +/ 2500 void function (void *data, 2501 wl_seat *wl_seat, 2502 const(char) *name) name; 2503 } 2504 2505 extern (D) int 2506 wl_seat_add_listener(wl_seat *wl_seat, 2507 const(wl_seat_listener) *listener, void *data) 2508 { 2509 alias Callback = extern (C) void function(); 2510 2511 return wl_proxy_add_listener( 2512 cast(wl_proxy*)wl_seat, 2513 cast(Callback*)listener, data); 2514 } 2515 2516 enum uint WL_SEAT_GET_POINTER = 0; 2517 enum uint WL_SEAT_GET_KEYBOARD = 1; 2518 enum uint WL_SEAT_GET_TOUCH = 2; 2519 enum uint WL_SEAT_RELEASE = 3; 2520 2521 extern (D) void 2522 wl_seat_set_user_data(wl_seat *wl_seat, void *user_data) 2523 { 2524 wl_proxy_set_user_data(cast(wl_proxy*) wl_seat, user_data); 2525 } 2526 2527 extern (D) void * 2528 wl_seat_get_user_data(wl_seat *wl_seat) 2529 { 2530 return wl_proxy_get_user_data(cast(wl_proxy*) wl_seat); 2531 } 2532 2533 extern (D) void 2534 wl_seat_destroy(wl_seat *wl_seat) 2535 { 2536 wl_proxy_destroy(cast(wl_proxy*) wl_seat); 2537 } 2538 2539 /++ 2540 + return pointer object 2541 + 2542 + The ID provided will be initialized to the wl_pointer interface 2543 + for this seat. 2544 + 2545 + This request only takes effect if the seat has the pointer 2546 + capability, or has had the pointer capability in the past. 2547 + It is a protocol violation to issue this request on a seat that has 2548 + never had the pointer capability. 2549 +/ 2550 extern (D) wl_pointer * 2551 wl_seat_get_pointer(wl_seat *wl_seat_) 2552 { 2553 wl_proxy *id; 2554 2555 id = wl_proxy_marshal_constructor( 2556 cast(wl_proxy*) wl_seat_, 2557 WL_SEAT_GET_POINTER, wl_pointer_interface, null); 2558 2559 return cast(wl_pointer *) id; 2560 } 2561 2562 /++ 2563 + return keyboard object 2564 + 2565 + The ID provided will be initialized to the wl_keyboard interface 2566 + for this seat. 2567 + 2568 + This request only takes effect if the seat has the keyboard 2569 + capability, or has had the keyboard capability in the past. 2570 + It is a protocol violation to issue this request on a seat that has 2571 + never had the keyboard capability. 2572 +/ 2573 extern (D) wl_keyboard * 2574 wl_seat_get_keyboard(wl_seat *wl_seat_) 2575 { 2576 wl_proxy *id; 2577 2578 id = wl_proxy_marshal_constructor( 2579 cast(wl_proxy*) wl_seat_, 2580 WL_SEAT_GET_KEYBOARD, wl_keyboard_interface, null); 2581 2582 return cast(wl_keyboard *) id; 2583 } 2584 2585 /++ 2586 + return touch object 2587 + 2588 + The ID provided will be initialized to the wl_touch interface 2589 + for this seat. 2590 + 2591 + This request only takes effect if the seat has the touch 2592 + capability, or has had the touch capability in the past. 2593 + It is a protocol violation to issue this request on a seat that has 2594 + never had the touch capability. 2595 +/ 2596 extern (D) wl_touch * 2597 wl_seat_get_touch(wl_seat *wl_seat_) 2598 { 2599 wl_proxy *id; 2600 2601 id = wl_proxy_marshal_constructor( 2602 cast(wl_proxy*) wl_seat_, 2603 WL_SEAT_GET_TOUCH, wl_touch_interface, null); 2604 2605 return cast(wl_touch *) id; 2606 } 2607 2608 /++ 2609 + release the seat object 2610 + 2611 + Using this request a client can tell the server that it is not going to 2612 + use the seat object anymore. 2613 +/ 2614 extern (D) void 2615 wl_seat_release(wl_seat *wl_seat_) 2616 { 2617 wl_proxy_marshal(cast(wl_proxy*) wl_seat_, 2618 WL_SEAT_RELEASE); 2619 2620 wl_proxy_destroy(cast(wl_proxy*) wl_seat_); 2621 } 2622 2623 /++ 2624 + WL_POINTER_ERROR_ROLE: given wl_surface has another role 2625 + 2626 +/ 2627 enum uint WL_POINTER_ERROR_ROLE = 0; 2628 2629 /++ 2630 + physical button state 2631 + 2632 + Describes the physical state of a button that produced the button 2633 + event. 2634 +/ 2635 /++ 2636 + WL_POINTER_BUTTON_STATE_RELEASED: the button is not pressed 2637 + WL_POINTER_BUTTON_STATE_PRESSED: the button is pressed 2638 + 2639 +/ 2640 enum uint WL_POINTER_BUTTON_STATE_RELEASED = 0; 2641 enum uint WL_POINTER_BUTTON_STATE_PRESSED = 1; /// ditto 2642 2643 /++ 2644 + axis types 2645 + 2646 + Describes the axis types of scroll events. 2647 +/ 2648 /++ 2649 + WL_POINTER_AXIS_VERTICAL_SCROLL: vertical axis 2650 + WL_POINTER_AXIS_HORIZONTAL_SCROLL: horizontal axis 2651 + 2652 +/ 2653 enum uint WL_POINTER_AXIS_VERTICAL_SCROLL = 0; 2654 enum uint WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1; /// ditto 2655 2656 /++ 2657 + axis source types 2658 + 2659 + Describes the source types for axis events. This indicates to the 2660 + client how an axis event was physically generated; a client may 2661 + adjust the user interface accordingly. For example, scroll events 2662 + from a "finger" source may be in a smooth coordinate space with 2663 + kinetic scrolling whereas a "wheel" source may be in discrete steps 2664 + of a number of lines. 2665 + 2666 + The "continuous" axis source is a device generating events in a 2667 + continuous coordinate space, but using something other than a 2668 + finger. One example for this source is button-based scrolling where 2669 + the vertical motion of a device is converted to scroll events while 2670 + a button is held down. 2671 +/ 2672 /++ 2673 + WL_POINTER_AXIS_SOURCE_WHEEL: a physical wheel 2674 + WL_POINTER_AXIS_SOURCE_FINGER: finger on a touch surface 2675 + WL_POINTER_AXIS_SOURCE_CONTINUOUS: continuous coordinate space 2676 + 2677 +/ 2678 enum uint WL_POINTER_AXIS_SOURCE_WHEEL = 0; 2679 enum uint WL_POINTER_AXIS_SOURCE_FINGER = 1; /// ditto 2680 enum uint WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2; /// ditto 2681 2682 /++ 2683 + pointer input device 2684 + 2685 + The wl_pointer interface represents one or more input devices, 2686 + such as mice, which control the pointer location and pointer_focus 2687 + of a seat. 2688 + 2689 + The wl_pointer interface generates motion, enter and leave 2690 + events for the surfaces that the pointer is located over, 2691 + and button and axis events for button presses, button releases 2692 + and scrolling. 2693 +/ 2694 struct wl_pointer_listener 2695 { 2696 /++ 2697 + enter event 2698 + 2699 + Notification that this seat's pointer is focused on a certain 2700 + surface. 2701 + 2702 + When a seat's focus enters a surface, the pointer image 2703 + is undefined and a client should respond to this event by setting 2704 + an appropriate pointer image with the set_cursor request. 2705 +/ 2706 void function (void *data, 2707 wl_pointer *wl_pointer, 2708 uint serial, 2709 wl_surface *surface, 2710 wl_fixed_t surface_x, 2711 wl_fixed_t surface_y) enter; 2712 /++ 2713 + leave event 2714 + 2715 + Notification that this seat's pointer is no longer focused on 2716 + a certain surface. 2717 + 2718 + The leave notification is sent before the enter notification 2719 + for the new focus. 2720 +/ 2721 void function (void *data, 2722 wl_pointer *wl_pointer, 2723 uint serial, 2724 wl_surface *surface) leave; 2725 /++ 2726 + pointer motion event 2727 + 2728 + Notification of pointer location change. The arguments 2729 + surface_x and surface_y are the location relative to the 2730 + focused surface. 2731 +/ 2732 void function (void *data, 2733 wl_pointer *wl_pointer, 2734 uint time, 2735 wl_fixed_t surface_x, 2736 wl_fixed_t surface_y) motion; 2737 /++ 2738 + pointer button event 2739 + 2740 + Mouse button click and release notifications. 2741 + 2742 + The location of the click is given by the last motion or 2743 + enter event. 2744 + The time argument is a timestamp with millisecond 2745 + granularity, with an undefined base. 2746 +/ 2747 void function (void *data, 2748 wl_pointer *wl_pointer, 2749 uint serial, 2750 uint time, 2751 uint button, 2752 uint state) button; 2753 /++ 2754 + axis event 2755 + 2756 + Scroll and other axis notifications. 2757 + 2758 + For scroll events (vertical and horizontal scroll axes), the 2759 + value parameter is the length of a vector along the specified 2760 + axis in a coordinate space identical to those of motion events, 2761 + representing a relative movement along the specified axis. 2762 + 2763 + For devices that support movements non-parallel to axes multiple 2764 + axis events will be emitted. 2765 + 2766 + When applicable, for example for touch pads, the server can 2767 + choose to emit scroll events where the motion vector is 2768 + equivalent to a motion event vector. 2769 + 2770 + When applicable, a client can transform its content relative to the 2771 + scroll distance. 2772 +/ 2773 void function (void *data, 2774 wl_pointer *wl_pointer, 2775 uint time, 2776 uint axis, 2777 wl_fixed_t value) axis; 2778 /++ 2779 + end of a pointer event sequence 2780 + 2781 + Indicates the end of a set of events that logically belong together. 2782 + A client is expected to accumulate the data in all events within the 2783 + frame before proceeding. 2784 + 2785 + All wl_pointer events before a wl_pointer.frame event belong 2786 + logically together. For example, in a diagonal scroll motion the 2787 + compositor will send an optional wl_pointer.axis_source event, two 2788 + wl_pointer.axis events (horizontal and vertical) and finally a 2789 + wl_pointer.frame event. The client may use this information to 2790 + calculate a diagonal vector for scrolling. 2791 + 2792 + When multiple wl_pointer.axis events occur within the same frame, 2793 + the motion vector is the combined motion of all events. 2794 + When a wl_pointer.axis and a wl_pointer.axis_stop event occur within 2795 + the same frame, this indicates that axis movement in one axis has 2796 + stopped but continues in the other axis. 2797 + When multiple wl_pointer.axis_stop events occur within the same 2798 + frame, this indicates that these axes stopped in the same instance. 2799 + 2800 + A wl_pointer.frame event is sent for every logical event group, 2801 + even if the group only contains a single wl_pointer event. 2802 + Specifically, a client may get a sequence: motion, frame, button, 2803 + frame, axis, frame, axis_stop, frame. 2804 + 2805 + The wl_pointer.enter and wl_pointer.leave events are logical events 2806 + generated by the compositor and not the hardware. These events are 2807 + also grouped by a wl_pointer.frame. When a pointer moves from one 2808 + surface to another, a compositor should group the 2809 + wl_pointer.leave event within the same wl_pointer.frame. 2810 + However, a client must not rely on wl_pointer.leave and 2811 + wl_pointer.enter being in the same wl_pointer.frame. 2812 + Compositor-specific policies may require the wl_pointer.leave and 2813 + wl_pointer.enter event being split across multiple wl_pointer.frame 2814 + groups. 2815 +/ 2816 void function (void *data, 2817 wl_pointer *wl_pointer) frame; 2818 /++ 2819 + axis source event 2820 + 2821 + Source information for scroll and other axes. 2822 + 2823 + This event does not occur on its own. It is sent before a 2824 + wl_pointer.frame event and carries the source information for 2825 + all events within that frame. 2826 + 2827 + The source specifies how this event was generated. If the source is 2828 + wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be 2829 + sent when the user lifts the finger off the device. 2830 + 2831 + If the source is wl_pointer axis_source.wheel or 2832 + wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may 2833 + or may not be sent. Whether a compositor sends an axis_stop event 2834 + for these sources is hardware-specific and implementation-dependent; 2835 + clients must not rely on receiving an axis_stop event for these 2836 + scroll sources and should treat scroll sequences from these scroll 2837 + sources as unterminated by default. 2838 + 2839 + This event is optional. If the source is unknown for a particular 2840 + axis event sequence, no event is sent. 2841 + Only one wl_pointer.axis_source event is permitted per frame. 2842 + 2843 + The order of wl_pointer.axis_discrete and wl_pointer.axis_source is 2844 + not guaranteed. 2845 +/ 2846 void function (void *data, 2847 wl_pointer *wl_pointer, 2848 uint axis_source) axis_source; 2849 /++ 2850 + axis stop event 2851 + 2852 + Stop notification for scroll and other axes. 2853 + 2854 + For some wl_pointer.axis_source types, a wl_pointer.axis_stop event 2855 + is sent to notify a client that the axis sequence has terminated. 2856 + This enables the client to implement kinetic scrolling. 2857 + See the wl_pointer.axis_source documentation for information on when 2858 + this event may be generated. 2859 + 2860 + Any wl_pointer.axis events with the same axis_source after this 2861 + event should be considered as the start of a new axis motion. 2862 + 2863 + The timestamp is to be interpreted identical to the timestamp in the 2864 + wl_pointer.axis event. The timestamp value may be the same as a 2865 + preceding wl_pointer.axis event. 2866 +/ 2867 void function (void *data, 2868 wl_pointer *wl_pointer, 2869 uint time, 2870 uint axis) axis_stop; 2871 /++ 2872 + axis click event 2873 + 2874 + Discrete step information for scroll and other axes. 2875 + 2876 + This event carries the axis value of the wl_pointer.axis event in 2877 + discrete steps (e.g. mouse wheel clicks). 2878 + 2879 + This event does not occur on its own, it is coupled with a 2880 + wl_pointer.axis event that represents this axis value on a 2881 + continuous scale. The protocol guarantees that each axis_discrete 2882 + event is always followed by exactly one axis event with the same 2883 + axis number within the same wl_pointer.frame. Note that the protocol 2884 + allows for other events to occur between the axis_discrete and 2885 + its coupled axis event, including other axis_discrete or axis 2886 + events. 2887 + 2888 + This event is optional; continuous scrolling devices 2889 + like two-finger scrolling on touchpads do not have discrete 2890 + steps and do not generate this event. 2891 + 2892 + The discrete value carries the directional information. e.g. a value 2893 + of -2 is two steps towards the negative direction of this axis. 2894 + 2895 + The axis number is identical to the axis number in the associated 2896 + axis event. 2897 + 2898 + The order of wl_pointer.axis_discrete and wl_pointer.axis_source is 2899 + not guaranteed. 2900 +/ 2901 void function (void *data, 2902 wl_pointer *wl_pointer, 2903 uint axis, 2904 int discrete) axis_discrete; 2905 } 2906 2907 extern (D) int 2908 wl_pointer_add_listener(wl_pointer *wl_pointer, 2909 const(wl_pointer_listener) *listener, void *data) 2910 { 2911 alias Callback = extern (C) void function(); 2912 2913 return wl_proxy_add_listener( 2914 cast(wl_proxy*)wl_pointer, 2915 cast(Callback*)listener, data); 2916 } 2917 2918 enum uint WL_POINTER_SET_CURSOR = 0; 2919 enum uint WL_POINTER_RELEASE = 1; 2920 2921 extern (D) void 2922 wl_pointer_set_user_data(wl_pointer *wl_pointer, void *user_data) 2923 { 2924 wl_proxy_set_user_data(cast(wl_proxy*) wl_pointer, user_data); 2925 } 2926 2927 extern (D) void * 2928 wl_pointer_get_user_data(wl_pointer *wl_pointer) 2929 { 2930 return wl_proxy_get_user_data(cast(wl_proxy*) wl_pointer); 2931 } 2932 2933 extern (D) void 2934 wl_pointer_destroy(wl_pointer *wl_pointer) 2935 { 2936 wl_proxy_destroy(cast(wl_proxy*) wl_pointer); 2937 } 2938 2939 /++ 2940 + set the pointer surface 2941 + 2942 + Set the pointer surface, i.e., the surface that contains the 2943 + pointer image (cursor). This request gives the surface the role 2944 + of a cursor. If the surface already has another role, it raises 2945 + a protocol error. 2946 + 2947 + The cursor actually changes only if the pointer 2948 + focus for this device is one of the requesting client's surfaces 2949 + or the surface parameter is the current pointer surface. If 2950 + there was a previous surface set with this request it is 2951 + replaced. If surface is NULL, the pointer image is hidden. 2952 + 2953 + The parameters hotspot_x and hotspot_y define the position of 2954 + the pointer surface relative to the pointer location. Its 2955 + top-left corner is always at (x, y) - (hotspot_x, hotspot_y), 2956 + where (x, y) are the coordinates of the pointer location, in 2957 + surface-local coordinates. 2958 + 2959 + On surface.attach requests to the pointer surface, hotspot_x 2960 + and hotspot_y are decremented by the x and y parameters 2961 + passed to the request. Attach must be confirmed by 2962 + wl_surface.commit as usual. 2963 + 2964 + The hotspot can also be updated by passing the currently set 2965 + pointer surface to this request with new values for hotspot_x 2966 + and hotspot_y. 2967 + 2968 + The current and pending input regions of the wl_surface are 2969 + cleared, and wl_surface.set_input_region is ignored until the 2970 + wl_surface is no longer used as the cursor. When the use as a 2971 + cursor ends, the current and pending input regions become 2972 + undefined, and the wl_surface is unmapped. 2973 +/ 2974 extern (D) void 2975 wl_pointer_set_cursor(wl_pointer *wl_pointer_, uint serial, wl_surface *surface, int hotspot_x, int hotspot_y) 2976 { 2977 wl_proxy_marshal(cast(wl_proxy*) wl_pointer_, 2978 WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y); 2979 } 2980 2981 /++ 2982 + release the pointer object 2983 + 2984 + Using this request a client can tell the server that it is not going to 2985 + use the pointer object anymore. 2986 + 2987 + This request destroys the pointer proxy object, so clients must not call 2988 + wl_pointer_destroy() after using this request. 2989 +/ 2990 extern (D) void 2991 wl_pointer_release(wl_pointer *wl_pointer_) 2992 { 2993 wl_proxy_marshal(cast(wl_proxy*) wl_pointer_, 2994 WL_POINTER_RELEASE); 2995 2996 wl_proxy_destroy(cast(wl_proxy*) wl_pointer_); 2997 } 2998 2999 /++ 3000 + keyboard mapping format 3001 + 3002 + This specifies the format of the keymap provided to the 3003 + client with the wl_keyboard.keymap event. 3004 +/ 3005 /++ 3006 + WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP: no keymap; client must understand how to interpret the raw keycode 3007 + WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1: libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode 3008 + 3009 +/ 3010 enum uint WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0; 3011 enum uint WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1; /// ditto 3012 3013 /++ 3014 + physical key state 3015 + 3016 + Describes the physical state of a key that produced the key event. 3017 +/ 3018 /++ 3019 + WL_KEYBOARD_KEY_STATE_RELEASED: key is not pressed 3020 + WL_KEYBOARD_KEY_STATE_PRESSED: key is pressed 3021 + 3022 +/ 3023 enum uint WL_KEYBOARD_KEY_STATE_RELEASED = 0; 3024 enum uint WL_KEYBOARD_KEY_STATE_PRESSED = 1; /// ditto 3025 3026 /++ 3027 + keyboard input device 3028 + 3029 + The wl_keyboard interface represents one or more keyboards 3030 + associated with a seat. 3031 +/ 3032 struct wl_keyboard_listener 3033 { 3034 /++ 3035 + keyboard mapping 3036 + 3037 + This event provides a file descriptor to the client which can be 3038 + memory-mapped to provide a keyboard mapping description. 3039 +/ 3040 void function (void *data, 3041 wl_keyboard *wl_keyboard, 3042 uint format, 3043 int fd, 3044 uint size) keymap; 3045 /++ 3046 + enter event 3047 + 3048 + Notification that this seat's keyboard focus is on a certain 3049 + surface. 3050 +/ 3051 void function (void *data, 3052 wl_keyboard *wl_keyboard, 3053 uint serial, 3054 wl_surface *surface, 3055 wl_array *keys) enter; 3056 /++ 3057 + leave event 3058 + 3059 + Notification that this seat's keyboard focus is no longer on 3060 + a certain surface. 3061 + 3062 + The leave notification is sent before the enter notification 3063 + for the new focus. 3064 +/ 3065 void function (void *data, 3066 wl_keyboard *wl_keyboard, 3067 uint serial, 3068 wl_surface *surface) leave; 3069 /++ 3070 + key event 3071 + 3072 + A key was pressed or released. 3073 + The time argument is a timestamp with millisecond 3074 + granularity, with an undefined base. 3075 +/ 3076 void function (void *data, 3077 wl_keyboard *wl_keyboard, 3078 uint serial, 3079 uint time, 3080 uint key, 3081 uint state) key; 3082 /++ 3083 + modifier and group state 3084 + 3085 + Notifies clients that the modifier and/or group state has 3086 + changed, and it should update its local state. 3087 +/ 3088 void function (void *data, 3089 wl_keyboard *wl_keyboard, 3090 uint serial, 3091 uint mods_depressed, 3092 uint mods_latched, 3093 uint mods_locked, 3094 uint group) modifiers; 3095 /++ 3096 + repeat rate and delay 3097 + 3098 + Informs the client about the keyboard's repeat rate and delay. 3099 + 3100 + This event is sent as soon as the wl_keyboard object has been created, 3101 + and is guaranteed to be received by the client before any key press 3102 + event. 3103 + 3104 + Negative values for either rate or delay are illegal. A rate of zero 3105 + will disable any repeating (regardless of the value of delay). 3106 + 3107 + This event can be sent later on as well with a new value if necessary, 3108 + so clients should continue listening for the event past the creation 3109 + of wl_keyboard. 3110 +/ 3111 void function (void *data, 3112 wl_keyboard *wl_keyboard, 3113 int rate, 3114 int delay) repeat_info; 3115 } 3116 3117 extern (D) int 3118 wl_keyboard_add_listener(wl_keyboard *wl_keyboard, 3119 const(wl_keyboard_listener) *listener, void *data) 3120 { 3121 alias Callback = extern (C) void function(); 3122 3123 return wl_proxy_add_listener( 3124 cast(wl_proxy*)wl_keyboard, 3125 cast(Callback*)listener, data); 3126 } 3127 3128 enum uint WL_KEYBOARD_RELEASE = 0; 3129 3130 extern (D) void 3131 wl_keyboard_set_user_data(wl_keyboard *wl_keyboard, void *user_data) 3132 { 3133 wl_proxy_set_user_data(cast(wl_proxy*) wl_keyboard, user_data); 3134 } 3135 3136 extern (D) void * 3137 wl_keyboard_get_user_data(wl_keyboard *wl_keyboard) 3138 { 3139 return wl_proxy_get_user_data(cast(wl_proxy*) wl_keyboard); 3140 } 3141 3142 extern (D) void 3143 wl_keyboard_destroy(wl_keyboard *wl_keyboard) 3144 { 3145 wl_proxy_destroy(cast(wl_proxy*) wl_keyboard); 3146 } 3147 3148 /++ 3149 + release the keyboard object 3150 + 3151 + 3152 +/ 3153 extern (D) void 3154 wl_keyboard_release(wl_keyboard *wl_keyboard_) 3155 { 3156 wl_proxy_marshal(cast(wl_proxy*) wl_keyboard_, 3157 WL_KEYBOARD_RELEASE); 3158 3159 wl_proxy_destroy(cast(wl_proxy*) wl_keyboard_); 3160 } 3161 3162 /++ 3163 + touchscreen input device 3164 + 3165 + The wl_touch interface represents a touchscreen 3166 + associated with a seat. 3167 + 3168 + Touch interactions can consist of one or more contacts. 3169 + For each contact, a series of events is generated, starting 3170 + with a down event, followed by zero or more motion events, 3171 + and ending with an up event. Events relating to the same 3172 + contact point can be identified by the ID of the sequence. 3173 +/ 3174 struct wl_touch_listener 3175 { 3176 /++ 3177 + touch down event and beginning of a touch sequence 3178 + 3179 + A new touch point has appeared on the surface. This touch point is 3180 + assigned a unique ID. Future events from this touch point reference 3181 + this ID. The ID ceases to be valid after a touch up event and may be 3182 + reused in the future. 3183 +/ 3184 void function (void *data, 3185 wl_touch *wl_touch, 3186 uint serial, 3187 uint time, 3188 wl_surface *surface, 3189 int id, 3190 wl_fixed_t x, 3191 wl_fixed_t y) down; 3192 /++ 3193 + end of a touch event sequence 3194 + 3195 + The touch point has disappeared. No further events will be sent for 3196 + this touch point and the touch point's ID is released and may be 3197 + reused in a future touch down event. 3198 +/ 3199 void function (void *data, 3200 wl_touch *wl_touch, 3201 uint serial, 3202 uint time, 3203 int id) up; 3204 /++ 3205 + update of touch point coordinates 3206 + 3207 + A touch point has changed coordinates. 3208 +/ 3209 void function (void *data, 3210 wl_touch *wl_touch, 3211 uint time, 3212 int id, 3213 wl_fixed_t x, 3214 wl_fixed_t y) motion; 3215 /++ 3216 + end of touch frame event 3217 + 3218 + Indicates the end of a contact point list. 3219 +/ 3220 void function (void *data, 3221 wl_touch *wl_touch) frame; 3222 /++ 3223 + touch session cancelled 3224 + 3225 + Sent if the compositor decides the touch stream is a global 3226 + gesture. No further events are sent to the clients from that 3227 + particular gesture. Touch cancellation applies to all touch points 3228 + currently active on this client's surface. The client is 3229 + responsible for finalizing the touch points, future touch points on 3230 + this surface may reuse the touch point ID. 3231 +/ 3232 void function (void *data, 3233 wl_touch *wl_touch) cancel; 3234 } 3235 3236 extern (D) int 3237 wl_touch_add_listener(wl_touch *wl_touch, 3238 const(wl_touch_listener) *listener, void *data) 3239 { 3240 alias Callback = extern (C) void function(); 3241 3242 return wl_proxy_add_listener( 3243 cast(wl_proxy*)wl_touch, 3244 cast(Callback*)listener, data); 3245 } 3246 3247 enum uint WL_TOUCH_RELEASE = 0; 3248 3249 extern (D) void 3250 wl_touch_set_user_data(wl_touch *wl_touch, void *user_data) 3251 { 3252 wl_proxy_set_user_data(cast(wl_proxy*) wl_touch, user_data); 3253 } 3254 3255 extern (D) void * 3256 wl_touch_get_user_data(wl_touch *wl_touch) 3257 { 3258 return wl_proxy_get_user_data(cast(wl_proxy*) wl_touch); 3259 } 3260 3261 extern (D) void 3262 wl_touch_destroy(wl_touch *wl_touch) 3263 { 3264 wl_proxy_destroy(cast(wl_proxy*) wl_touch); 3265 } 3266 3267 /++ 3268 + release the touch object 3269 + 3270 + 3271 +/ 3272 extern (D) void 3273 wl_touch_release(wl_touch *wl_touch_) 3274 { 3275 wl_proxy_marshal(cast(wl_proxy*) wl_touch_, 3276 WL_TOUCH_RELEASE); 3277 3278 wl_proxy_destroy(cast(wl_proxy*) wl_touch_); 3279 } 3280 3281 /++ 3282 + subpixel geometry information 3283 + 3284 + This enumeration describes how the physical 3285 + pixels on an output are laid out. 3286 +/ 3287 /++ 3288 + WL_OUTPUT_SUBPIXEL_UNKNOWN: unknown geometry 3289 + WL_OUTPUT_SUBPIXEL_NONE: no geometry 3290 + WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB: horizontal RGB 3291 + WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR: horizontal BGR 3292 + WL_OUTPUT_SUBPIXEL_VERTICAL_RGB: vertical RGB 3293 + WL_OUTPUT_SUBPIXEL_VERTICAL_BGR: vertical BGR 3294 + 3295 +/ 3296 enum uint WL_OUTPUT_SUBPIXEL_UNKNOWN = 0; 3297 enum uint WL_OUTPUT_SUBPIXEL_NONE = 1; /// ditto 3298 enum uint WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2; /// ditto 3299 enum uint WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3; /// ditto 3300 enum uint WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4; /// ditto 3301 enum uint WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5; /// ditto 3302 3303 /++ 3304 + transform from framebuffer to output 3305 + 3306 + This describes the transform that a compositor will apply to a 3307 + surface to compensate for the rotation or mirroring of an 3308 + output device. 3309 + 3310 + The flipped values correspond to an initial flip around a 3311 + vertical axis followed by rotation. 3312 + 3313 + The purpose is mainly to allow clients to render accordingly and 3314 + tell the compositor, so that for fullscreen surfaces, the 3315 + compositor will still be able to scan out directly from client 3316 + surfaces. 3317 +/ 3318 /++ 3319 + WL_OUTPUT_TRANSFORM_NORMAL: no transform 3320 + WL_OUTPUT_TRANSFORM_90: 90 degrees counter-clockwise 3321 + WL_OUTPUT_TRANSFORM_180: 180 degrees counter-clockwise 3322 + WL_OUTPUT_TRANSFORM_270: 270 degrees counter-clockwise 3323 + WL_OUTPUT_TRANSFORM_FLIPPED: 180 degree flip around a vertical axis 3324 + WL_OUTPUT_TRANSFORM_FLIPPED_90: flip and rotate 90 degrees counter-clockwise 3325 + WL_OUTPUT_TRANSFORM_FLIPPED_180: flip and rotate 180 degrees counter-clockwise 3326 + WL_OUTPUT_TRANSFORM_FLIPPED_270: flip and rotate 270 degrees counter-clockwise 3327 + 3328 +/ 3329 enum uint WL_OUTPUT_TRANSFORM_NORMAL = 0; 3330 enum uint WL_OUTPUT_TRANSFORM_90 = 1; /// ditto 3331 enum uint WL_OUTPUT_TRANSFORM_180 = 2; /// ditto 3332 enum uint WL_OUTPUT_TRANSFORM_270 = 3; /// ditto 3333 enum uint WL_OUTPUT_TRANSFORM_FLIPPED = 4; /// ditto 3334 enum uint WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5; /// ditto 3335 enum uint WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6; /// ditto 3336 enum uint WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7; /// ditto 3337 3338 /++ 3339 + mode information 3340 + 3341 + These flags describe properties of an output mode. 3342 + They are used in the flags bitfield of the mode event. 3343 +/ 3344 /++ 3345 + WL_OUTPUT_MODE_CURRENT: indicates this is the current mode 3346 + WL_OUTPUT_MODE_PREFERRED: indicates this is the preferred mode 3347 + 3348 +/ 3349 enum uint WL_OUTPUT_MODE_CURRENT = 0x1; 3350 enum uint WL_OUTPUT_MODE_PREFERRED = 0x2; /// ditto 3351 3352 /++ 3353 + compositor output region 3354 + 3355 + An output describes part of the compositor geometry. The 3356 + compositor works in the 'compositor coordinate system' and an 3357 + output corresponds to a rectangular area in that space that is 3358 + actually visible. This typically corresponds to a monitor that 3359 + displays part of the compositor space. This object is published 3360 + as global during start up, or when a monitor is hotplugged. 3361 +/ 3362 struct wl_output_listener 3363 { 3364 /++ 3365 + properties of the output 3366 + 3367 + The geometry event describes geometric properties of the output. 3368 + The event is sent when binding to the output object and whenever 3369 + any of the properties change. 3370 +/ 3371 void function (void *data, 3372 wl_output *wl_output, 3373 int x, 3374 int y, 3375 int physical_width, 3376 int physical_height, 3377 int subpixel, 3378 const(char) *make, 3379 const(char) *model, 3380 int transform) geometry; 3381 /++ 3382 + advertise available modes for the output 3383 + 3384 + The mode event describes an available mode for the output. 3385 + 3386 + The event is sent when binding to the output object and there 3387 + will always be one mode, the current mode. The event is sent 3388 + again if an output changes mode, for the mode that is now 3389 + current. In other words, the current mode is always the last 3390 + mode that was received with the current flag set. 3391 + 3392 + The size of a mode is given in physical hardware units of 3393 + the output device. This is not necessarily the same as 3394 + the output size in the global compositor space. For instance, 3395 + the output may be scaled, as described in wl_output.scale, 3396 + or transformed, as described in wl_output.transform. 3397 +/ 3398 void function (void *data, 3399 wl_output *wl_output, 3400 uint flags, 3401 int width, 3402 int height, 3403 int refresh) mode; 3404 /++ 3405 + sent all information about output 3406 + 3407 + This event is sent after all other properties have been 3408 + sent after binding to the output object and after any 3409 + other property changes done after that. This allows 3410 + changes to the output properties to be seen as 3411 + atomic, even if they happen via multiple events. 3412 +/ 3413 void function (void *data, 3414 wl_output *wl_output) done; 3415 /++ 3416 + output scaling properties 3417 + 3418 + This event contains scaling geometry information 3419 + that is not in the geometry event. It may be sent after 3420 + binding the output object or if the output scale changes 3421 + later. If it is not sent, the client should assume a 3422 + scale of 1. 3423 + 3424 + A scale larger than 1 means that the compositor will 3425 + automatically scale surface buffers by this amount 3426 + when rendering. This is used for very high resolution 3427 + displays where applications rendering at the native 3428 + resolution would be too small to be legible. 3429 + 3430 + It is intended that scaling aware clients track the 3431 + current output of a surface, and if it is on a scaled 3432 + output it should use wl_surface.set_buffer_scale with 3433 + the scale of the output. That way the compositor can 3434 + avoid scaling the surface, and the client can supply 3435 + a higher detail image. 3436 +/ 3437 void function (void *data, 3438 wl_output *wl_output, 3439 int factor) scale; 3440 } 3441 3442 extern (D) int 3443 wl_output_add_listener(wl_output *wl_output, 3444 const(wl_output_listener) *listener, void *data) 3445 { 3446 alias Callback = extern (C) void function(); 3447 3448 return wl_proxy_add_listener( 3449 cast(wl_proxy*)wl_output, 3450 cast(Callback*)listener, data); 3451 } 3452 3453 enum uint WL_OUTPUT_RELEASE = 0; 3454 3455 extern (D) void 3456 wl_output_set_user_data(wl_output *wl_output, void *user_data) 3457 { 3458 wl_proxy_set_user_data(cast(wl_proxy*) wl_output, user_data); 3459 } 3460 3461 extern (D) void * 3462 wl_output_get_user_data(wl_output *wl_output) 3463 { 3464 return wl_proxy_get_user_data(cast(wl_proxy*) wl_output); 3465 } 3466 3467 extern (D) void 3468 wl_output_destroy(wl_output *wl_output) 3469 { 3470 wl_proxy_destroy(cast(wl_proxy*) wl_output); 3471 } 3472 3473 /++ 3474 + release the output object 3475 + 3476 + Using this request a client can tell the server that it is not going to 3477 + use the output object anymore. 3478 +/ 3479 extern (D) void 3480 wl_output_release(wl_output *wl_output_) 3481 { 3482 wl_proxy_marshal(cast(wl_proxy*) wl_output_, 3483 WL_OUTPUT_RELEASE); 3484 3485 wl_proxy_destroy(cast(wl_proxy*) wl_output_); 3486 } 3487 3488 enum uint WL_REGION_DESTROY = 0; 3489 enum uint WL_REGION_ADD = 1; 3490 enum uint WL_REGION_SUBTRACT = 2; 3491 3492 extern (D) void 3493 wl_region_set_user_data(wl_region *wl_region, void *user_data) 3494 { 3495 wl_proxy_set_user_data(cast(wl_proxy*) wl_region, user_data); 3496 } 3497 3498 extern (D) void * 3499 wl_region_get_user_data(wl_region *wl_region) 3500 { 3501 return wl_proxy_get_user_data(cast(wl_proxy*) wl_region); 3502 } 3503 3504 /++ 3505 + destroy region 3506 + 3507 + Destroy the region. This will invalidate the object ID. 3508 +/ 3509 extern (D) void 3510 wl_region_destroy(wl_region *wl_region_) 3511 { 3512 wl_proxy_marshal(cast(wl_proxy*) wl_region_, 3513 WL_REGION_DESTROY); 3514 3515 wl_proxy_destroy(cast(wl_proxy*) wl_region_); 3516 } 3517 3518 /++ 3519 + add rectangle to region 3520 + 3521 + Add the specified rectangle to the region. 3522 +/ 3523 extern (D) void 3524 wl_region_add(wl_region *wl_region_, int x, int y, int width, int height) 3525 { 3526 wl_proxy_marshal(cast(wl_proxy*) wl_region_, 3527 WL_REGION_ADD, x, y, width, height); 3528 } 3529 3530 /++ 3531 + subtract rectangle from region 3532 + 3533 + Subtract the specified rectangle from the region. 3534 +/ 3535 extern (D) void 3536 wl_region_subtract(wl_region *wl_region_, int x, int y, int width, int height) 3537 { 3538 wl_proxy_marshal(cast(wl_proxy*) wl_region_, 3539 WL_REGION_SUBTRACT, x, y, width, height); 3540 } 3541 3542 /++ 3543 + WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE: the to-be sub-surface is invalid 3544 + 3545 +/ 3546 enum uint WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0; 3547 3548 enum uint WL_SUBCOMPOSITOR_DESTROY = 0; 3549 enum uint WL_SUBCOMPOSITOR_GET_SUBSURFACE = 1; 3550 3551 extern (D) void 3552 wl_subcompositor_set_user_data(wl_subcompositor *wl_subcompositor, void *user_data) 3553 { 3554 wl_proxy_set_user_data(cast(wl_proxy*) wl_subcompositor, user_data); 3555 } 3556 3557 extern (D) void * 3558 wl_subcompositor_get_user_data(wl_subcompositor *wl_subcompositor) 3559 { 3560 return wl_proxy_get_user_data(cast(wl_proxy*) wl_subcompositor); 3561 } 3562 3563 /++ 3564 + unbind from the subcompositor interface 3565 + 3566 + Informs the server that the client will not be using this 3567 + protocol object anymore. This does not affect any other 3568 + objects, wl_subsurface objects included. 3569 +/ 3570 extern (D) void 3571 wl_subcompositor_destroy(wl_subcompositor *wl_subcompositor_) 3572 { 3573 wl_proxy_marshal(cast(wl_proxy*) wl_subcompositor_, 3574 WL_SUBCOMPOSITOR_DESTROY); 3575 3576 wl_proxy_destroy(cast(wl_proxy*) wl_subcompositor_); 3577 } 3578 3579 /++ 3580 + give a surface the role sub-surface 3581 + 3582 + Create a sub-surface interface for the given surface, and 3583 + associate it with the given parent surface. This turns a 3584 + plain wl_surface into a sub-surface. 3585 + 3586 + The to-be sub-surface must not already have another role, and it 3587 + must not have an existing wl_subsurface object. Otherwise a protocol 3588 + error is raised. 3589 +/ 3590 extern (D) wl_subsurface * 3591 wl_subcompositor_get_subsurface(wl_subcompositor *wl_subcompositor_, wl_surface *surface, wl_surface *parent) 3592 { 3593 wl_proxy *id; 3594 3595 id = wl_proxy_marshal_constructor( 3596 cast(wl_proxy*) wl_subcompositor_, 3597 WL_SUBCOMPOSITOR_GET_SUBSURFACE, wl_subsurface_interface, null, surface, parent); 3598 3599 return cast(wl_subsurface *) id; 3600 } 3601 3602 /++ 3603 + WL_SUBSURFACE_ERROR_BAD_SURFACE: wl_surface is not a sibling or the parent 3604 + 3605 +/ 3606 enum uint WL_SUBSURFACE_ERROR_BAD_SURFACE = 0; 3607 3608 enum uint WL_SUBSURFACE_DESTROY = 0; 3609 enum uint WL_SUBSURFACE_SET_POSITION = 1; 3610 enum uint WL_SUBSURFACE_PLACE_ABOVE = 2; 3611 enum uint WL_SUBSURFACE_PLACE_BELOW = 3; 3612 enum uint WL_SUBSURFACE_SET_SYNC = 4; 3613 enum uint WL_SUBSURFACE_SET_DESYNC = 5; 3614 3615 extern (D) void 3616 wl_subsurface_set_user_data(wl_subsurface *wl_subsurface, void *user_data) 3617 { 3618 wl_proxy_set_user_data(cast(wl_proxy*) wl_subsurface, user_data); 3619 } 3620 3621 extern (D) void * 3622 wl_subsurface_get_user_data(wl_subsurface *wl_subsurface) 3623 { 3624 return wl_proxy_get_user_data(cast(wl_proxy*) wl_subsurface); 3625 } 3626 3627 /++ 3628 + remove sub-surface interface 3629 + 3630 + The sub-surface interface is removed from the wl_surface object 3631 + that was turned into a sub-surface with a 3632 + wl_subcompositor.get_subsurface request. The wl_surface's association 3633 + to the parent is deleted, and the wl_surface loses its role as 3634 + a sub-surface. The wl_surface is unmapped. 3635 +/ 3636 extern (D) void 3637 wl_subsurface_destroy(wl_subsurface *wl_subsurface_) 3638 { 3639 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3640 WL_SUBSURFACE_DESTROY); 3641 3642 wl_proxy_destroy(cast(wl_proxy*) wl_subsurface_); 3643 } 3644 3645 /++ 3646 + reposition the sub-surface 3647 + 3648 + This schedules a sub-surface position change. 3649 + The sub-surface will be moved so that its origin (top left 3650 + corner pixel) will be at the location x, y of the parent surface 3651 + coordinate system. The coordinates are not restricted to the parent 3652 + surface area. Negative values are allowed. 3653 + 3654 + The scheduled coordinates will take effect whenever the state of the 3655 + parent surface is applied. When this happens depends on whether the 3656 + parent surface is in synchronized mode or not. See 3657 + wl_subsurface.set_sync and wl_subsurface.set_desync for details. 3658 + 3659 + If more than one set_position request is invoked by the client before 3660 + the commit of the parent surface, the position of a new request always 3661 + replaces the scheduled position from any previous request. 3662 + 3663 + The initial position is 0, 0. 3664 +/ 3665 extern (D) void 3666 wl_subsurface_set_position(wl_subsurface *wl_subsurface_, int x, int y) 3667 { 3668 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3669 WL_SUBSURFACE_SET_POSITION, x, y); 3670 } 3671 3672 /++ 3673 + restack the sub-surface 3674 + 3675 + This sub-surface is taken from the stack, and put back just 3676 + above the reference surface, changing the z-order of the sub-surfaces. 3677 + The reference surface must be one of the sibling surfaces, or the 3678 + parent surface. Using any other surface, including this sub-surface, 3679 + will cause a protocol error. 3680 + 3681 + The z-order is double-buffered. Requests are handled in order and 3682 + applied immediately to a pending state. The final pending state is 3683 + copied to the active state the next time the state of the parent 3684 + surface is applied. When this happens depends on whether the parent 3685 + surface is in synchronized mode or not. See wl_subsurface.set_sync and 3686 + wl_subsurface.set_desync for details. 3687 + 3688 + A new sub-surface is initially added as the top-most in the stack 3689 + of its siblings and parent. 3690 +/ 3691 extern (D) void 3692 wl_subsurface_place_above(wl_subsurface *wl_subsurface_, wl_surface *sibling) 3693 { 3694 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3695 WL_SUBSURFACE_PLACE_ABOVE, sibling); 3696 } 3697 3698 /++ 3699 + restack the sub-surface 3700 + 3701 + The sub-surface is placed just below the reference surface. 3702 + See wl_subsurface.place_above. 3703 +/ 3704 extern (D) void 3705 wl_subsurface_place_below(wl_subsurface *wl_subsurface_, wl_surface *sibling) 3706 { 3707 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3708 WL_SUBSURFACE_PLACE_BELOW, sibling); 3709 } 3710 3711 /++ 3712 + set sub-surface to synchronized mode 3713 + 3714 + Change the commit behaviour of the sub-surface to synchronized 3715 + mode, also described as the parent dependent mode. 3716 + 3717 + In synchronized mode, wl_surface.commit on a sub-surface will 3718 + accumulate the committed state in a cache, but the state will 3719 + not be applied and hence will not change the compositor output. 3720 + The cached state is applied to the sub-surface immediately after 3721 + the parent surface's state is applied. This ensures atomic 3722 + updates of the parent and all its synchronized sub-surfaces. 3723 + Applying the cached state will invalidate the cache, so further 3724 + parent surface commits do not (re-)apply old state. 3725 + 3726 + See wl_subsurface for the recursive effect of this mode. 3727 +/ 3728 extern (D) void 3729 wl_subsurface_set_sync(wl_subsurface *wl_subsurface_) 3730 { 3731 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3732 WL_SUBSURFACE_SET_SYNC); 3733 } 3734 3735 /++ 3736 + set sub-surface to desynchronized mode 3737 + 3738 + Change the commit behaviour of the sub-surface to desynchronized 3739 + mode, also described as independent or freely running mode. 3740 + 3741 + In desynchronized mode, wl_surface.commit on a sub-surface will 3742 + apply the pending state directly, without caching, as happens 3743 + normally with a wl_surface. Calling wl_surface.commit on the 3744 + parent surface has no effect on the sub-surface's wl_surface 3745 + state. This mode allows a sub-surface to be updated on its own. 3746 + 3747 + If cached state exists when wl_surface.commit is called in 3748 + desynchronized mode, the pending state is added to the cached 3749 + state, and applied as a whole. This invalidates the cache. 3750 + 3751 + Note: even if a sub-surface is set to desynchronized, a parent 3752 + sub-surface may override it to behave as synchronized. For details, 3753 + see wl_subsurface. 3754 + 3755 + If a surface's parent surface behaves as desynchronized, then 3756 + the cached state is applied on set_desync. 3757 +/ 3758 extern (D) void 3759 wl_subsurface_set_desync(wl_subsurface *wl_subsurface_) 3760 { 3761 wl_proxy_marshal(cast(wl_proxy*) wl_subsurface_, 3762 WL_SUBSURFACE_SET_DESYNC); 3763 } 3764 3765 3766 } // extern (C) 3767