AtlatestRepositorysigil-ui
1
/* Generated by wayland-scanner 1.24.0 */3
#ifndef WAYLAND_CLIENT_PROTOCOL_H4
#define WAYLAND_CLIENT_PROTOCOL_H6
#include <stdint.h>7
#include <stddef.h>8
#include "wayland-client.h"10
#ifdef __cplusplus11
extern "C" {12
#endif14
/**15
* @page page_wayland The wayland protocol16
* @section page_ifaces_wayland Interfaces17
* - @subpage page_iface_wl_display - core global object18
* - @subpage page_iface_wl_registry - global registry object19
* - @subpage page_iface_wl_callback - callback object20
* - @subpage page_iface_wl_compositor - the compositor singleton21
* - @subpage page_iface_wl_shm_pool - a shared memory pool22
* - @subpage page_iface_wl_shm - shared memory support23
* - @subpage page_iface_wl_buffer - content for a wl_surface24
* - @subpage page_iface_wl_data_offer - offer to transfer data25
* - @subpage page_iface_wl_data_source - offer to transfer data26
* - @subpage page_iface_wl_data_device - data transfer device27
* - @subpage page_iface_wl_data_device_manager - data transfer interface28
* - @subpage page_iface_wl_shell - create desktop-style surfaces29
* - @subpage page_iface_wl_shell_surface - desktop-style metadata interface30
* - @subpage page_iface_wl_surface - an onscreen surface31
* - @subpage page_iface_wl_seat - group of input devices32
* - @subpage page_iface_wl_pointer - pointer input device33
* - @subpage page_iface_wl_keyboard - keyboard input device34
* - @subpage page_iface_wl_touch - touchscreen input device35
* - @subpage page_iface_wl_output - compositor output region36
* - @subpage page_iface_wl_region - region interface37
* - @subpage page_iface_wl_subcompositor - sub-surface compositing38
* - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface39
* - @subpage page_iface_wl_fixes - wayland protocol fixes40
* @section page_copyright_wayland Copyright41
* <pre>42
*43
* Copyright © 2008-2011 Kristian Høgsberg44
* Copyright © 2010-2011 Intel Corporation45
* Copyright © 2012-2013 Collabora, Ltd.46
*47
* Permission is hereby granted, free of charge, to any person48
* obtaining a copy of this software and associated documentation files49
* (the "Software"), to deal in the Software without restriction,50
* including without limitation the rights to use, copy, modify, merge,51
* publish, distribute, sublicense, and/or sell copies of the Software,52
* and to permit persons to whom the Software is furnished to do so,53
* subject to the following conditions:54
*55
* The above copyright notice and this permission notice (including the56
* next paragraph) shall be included in all copies or substantial57
* portions of the Software.58
*59
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,60
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF61
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND62
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS63
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN64
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN65
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE66
* SOFTWARE.67
* </pre>68
*/69
struct wl_buffer;70
struct wl_callback;71
struct wl_compositor;72
struct wl_data_device;73
struct wl_data_device_manager;74
struct wl_data_offer;75
struct wl_data_source;76
struct wl_display;77
struct wl_fixes;78
struct wl_keyboard;79
struct wl_output;80
struct wl_pointer;81
struct wl_region;82
struct wl_registry;83
struct wl_seat;84
struct wl_shell;85
struct wl_shell_surface;86
struct wl_shm;87
struct wl_shm_pool;88
struct wl_subcompositor;89
struct wl_subsurface;90
struct wl_surface;91
struct wl_touch;93
#ifndef WL_DISPLAY_INTERFACE94
#define WL_DISPLAY_INTERFACE95
/**96
* @page page_iface_wl_display wl_display97
* @section page_iface_wl_display_desc Description98
*99
* The core global object. This is a special singleton object. It100
* is used for internal Wayland protocol features.101
* @section page_iface_wl_display_api API102
* See @ref iface_wl_display.103
*/104
/**105
* @defgroup iface_wl_display The wl_display interface106
*107
* The core global object. This is a special singleton object. It108
* is used for internal Wayland protocol features.109
*/110
extern const struct wl_interface wl_display_interface;111
#endif112
#ifndef WL_REGISTRY_INTERFACE113
#define WL_REGISTRY_INTERFACE114
/**115
* @page page_iface_wl_registry wl_registry116
* @section page_iface_wl_registry_desc Description117
*118
* The singleton global registry object. The server has a number of119
* global objects that are available to all clients. These objects120
* typically represent an actual object in the server (for example,121
* an input device) or they are singleton objects that provide122
* extension functionality.123
*124
* When a client creates a registry object, the registry object125
* will emit a global event for each global currently in the126
* registry. Globals come and go as a result of device or127
* monitor hotplugs, reconfiguration or other events, and the128
* registry will send out global and global_remove events to129
* keep the client up to date with the changes. To mark the end130
* of the initial burst of events, the client can use the131
* wl_display.sync request immediately after calling132
* wl_display.get_registry.133
*134
* A client can bind to a global object by using the bind135
* request. This creates a client-side handle that lets the object136
* emit events to the client and lets the client invoke requests on137
* the object.138
* @section page_iface_wl_registry_api API139
* See @ref iface_wl_registry.140
*/141
/**142
* @defgroup iface_wl_registry The wl_registry interface143
*144
* The singleton global registry object. The server has a number of145
* global objects that are available to all clients. These objects146
* typically represent an actual object in the server (for example,147
* an input device) or they are singleton objects that provide148
* extension functionality.149
*150
* When a client creates a registry object, the registry object151
* will emit a global event for each global currently in the152
* registry. Globals come and go as a result of device or153
* monitor hotplugs, reconfiguration or other events, and the154
* registry will send out global and global_remove events to155
* keep the client up to date with the changes. To mark the end156
* of the initial burst of events, the client can use the157
* wl_display.sync request immediately after calling158
* wl_display.get_registry.159
*160
* A client can bind to a global object by using the bind161
* request. This creates a client-side handle that lets the object162
* emit events to the client and lets the client invoke requests on163
* the object.164
*/165
extern const struct wl_interface wl_registry_interface;166
#endif167
#ifndef WL_CALLBACK_INTERFACE168
#define WL_CALLBACK_INTERFACE169
/**170
* @page page_iface_wl_callback wl_callback171
* @section page_iface_wl_callback_desc Description172
*173
* Clients can handle the 'done' event to get notified when174
* the related request is done.175
*176
* Note, because wl_callback objects are created from multiple independent177
* factory interfaces, the wl_callback interface is frozen at version 1.178
* @section page_iface_wl_callback_api API179
* See @ref iface_wl_callback.180
*/181
/**182
* @defgroup iface_wl_callback The wl_callback interface183
*184
* Clients can handle the 'done' event to get notified when185
* the related request is done.186
*187
* Note, because wl_callback objects are created from multiple independent188
* factory interfaces, the wl_callback interface is frozen at version 1.189
*/190
extern const struct wl_interface wl_callback_interface;191
#endif192
#ifndef WL_COMPOSITOR_INTERFACE193
#define WL_COMPOSITOR_INTERFACE194
/**195
* @page page_iface_wl_compositor wl_compositor196
* @section page_iface_wl_compositor_desc Description197
*198
* A compositor. This object is a singleton global. The199
* compositor is in charge of combining the contents of multiple200
* surfaces into one displayable output.201
* @section page_iface_wl_compositor_api API202
* See @ref iface_wl_compositor.203
*/204
/**205
* @defgroup iface_wl_compositor The wl_compositor interface206
*207
* A compositor. This object is a singleton global. The208
* compositor is in charge of combining the contents of multiple209
* surfaces into one displayable output.210
*/211
extern const struct wl_interface wl_compositor_interface;212
#endif213
#ifndef WL_SHM_POOL_INTERFACE214
#define WL_SHM_POOL_INTERFACE215
/**216
* @page page_iface_wl_shm_pool wl_shm_pool217
* @section page_iface_wl_shm_pool_desc Description218
*219
* The wl_shm_pool object encapsulates a piece of memory shared220
* between the compositor and client. Through the wl_shm_pool221
* object, the client can allocate shared memory wl_buffer objects.222
* All objects created through the same pool share the same223
* underlying mapped memory. Reusing the mapped memory avoids the224
* setup/teardown overhead and is useful when interactively resizing225
* a surface or for many small buffers.226
* @section page_iface_wl_shm_pool_api API227
* See @ref iface_wl_shm_pool.228
*/229
/**230
* @defgroup iface_wl_shm_pool The wl_shm_pool interface231
*232
* The wl_shm_pool object encapsulates a piece of memory shared233
* between the compositor and client. Through the wl_shm_pool234
* object, the client can allocate shared memory wl_buffer objects.235
* All objects created through the same pool share the same236
* underlying mapped memory. Reusing the mapped memory avoids the237
* setup/teardown overhead and is useful when interactively resizing238
* a surface or for many small buffers.239
*/240
extern const struct wl_interface wl_shm_pool_interface;241
#endif242
#ifndef WL_SHM_INTERFACE243
#define WL_SHM_INTERFACE244
/**245
* @page page_iface_wl_shm wl_shm246
* @section page_iface_wl_shm_desc Description247
*248
* A singleton global object that provides support for shared249
* memory.250
*251
* Clients can create wl_shm_pool objects using the create_pool252
* request.253
*254
* On binding the wl_shm object one or more format events255
* are emitted to inform clients about the valid pixel formats256
* that can be used for buffers.257
* @section page_iface_wl_shm_api API258
* See @ref iface_wl_shm.259
*/260
/**261
* @defgroup iface_wl_shm The wl_shm interface262
*263
* A singleton global object that provides support for shared264
* memory.265
*266
* Clients can create wl_shm_pool objects using the create_pool267
* request.268
*269
* On binding the wl_shm object one or more format events270
* are emitted to inform clients about the valid pixel formats271
* that can be used for buffers.272
*/273
extern const struct wl_interface wl_shm_interface;274
#endif275
#ifndef WL_BUFFER_INTERFACE276
#define WL_BUFFER_INTERFACE277
/**278
* @page page_iface_wl_buffer wl_buffer279
* @section page_iface_wl_buffer_desc Description280
*281
* A buffer provides the content for a wl_surface. Buffers are282
* created through factory interfaces such as wl_shm, wp_linux_buffer_params283
* (from the linux-dmabuf protocol extension) or similar. It has a width and284
* a height and can be attached to a wl_surface, but the mechanism by which a285
* client provides and updates the contents is defined by the buffer factory286
* interface.287
*288
* Color channels are assumed to be electrical rather than optical (in other289
* words, encoded with a transfer function) unless otherwise specified. If290
* the buffer uses a format that has an alpha channel, the alpha channel is291
* assumed to be premultiplied into the electrical color channel values292
* (after transfer function encoding) unless otherwise specified.293
*294
* Note, because wl_buffer objects are created from multiple independent295
* factory interfaces, the wl_buffer interface is frozen at version 1.296
* @section page_iface_wl_buffer_api API297
* See @ref iface_wl_buffer.298
*/299
/**300
* @defgroup iface_wl_buffer The wl_buffer interface301
*302
* A buffer provides the content for a wl_surface. Buffers are303
* created through factory interfaces such as wl_shm, wp_linux_buffer_params304
* (from the linux-dmabuf protocol extension) or similar. It has a width and305
* a height and can be attached to a wl_surface, but the mechanism by which a306
* client provides and updates the contents is defined by the buffer factory307
* interface.308
*309
* Color channels are assumed to be electrical rather than optical (in other310
* words, encoded with a transfer function) unless otherwise specified. If311
* the buffer uses a format that has an alpha channel, the alpha channel is312
* assumed to be premultiplied into the electrical color channel values313
* (after transfer function encoding) unless otherwise specified.314
*315
* Note, because wl_buffer objects are created from multiple independent316
* factory interfaces, the wl_buffer interface is frozen at version 1.317
*/318
extern const struct wl_interface wl_buffer_interface;319
#endif320
#ifndef WL_DATA_OFFER_INTERFACE321
#define WL_DATA_OFFER_INTERFACE322
/**323
* @page page_iface_wl_data_offer wl_data_offer324
* @section page_iface_wl_data_offer_desc Description325
*326
* A wl_data_offer represents a piece of data offered for transfer327
* by another client (the source client). It is used by the328
* copy-and-paste and drag-and-drop mechanisms. The offer329
* describes the different mime types that the data can be330
* converted to and provides the mechanism for transferring the331
* data directly from the source client.332
* @section page_iface_wl_data_offer_api API333
* See @ref iface_wl_data_offer.334
*/335
/**336
* @defgroup iface_wl_data_offer The wl_data_offer interface337
*338
* A wl_data_offer represents a piece of data offered for transfer339
* by another client (the source client). It is used by the340
* copy-and-paste and drag-and-drop mechanisms. The offer341
* describes the different mime types that the data can be342
* converted to and provides the mechanism for transferring the343
* data directly from the source client.344
*/345
extern const struct wl_interface wl_data_offer_interface;346
#endif347
#ifndef WL_DATA_SOURCE_INTERFACE348
#define WL_DATA_SOURCE_INTERFACE349
/**350
* @page page_iface_wl_data_source wl_data_source351
* @section page_iface_wl_data_source_desc Description352
*353
* The wl_data_source object is the source side of a wl_data_offer.354
* It is created by the source client in a data transfer and355
* provides a way to describe the offered data and a way to respond356
* to requests to transfer the data.357
* @section page_iface_wl_data_source_api API358
* See @ref iface_wl_data_source.359
*/360
/**361
* @defgroup iface_wl_data_source The wl_data_source interface362
*363
* The wl_data_source object is the source side of a wl_data_offer.364
* It is created by the source client in a data transfer and365
* provides a way to describe the offered data and a way to respond366
* to requests to transfer the data.367
*/368
extern const struct wl_interface wl_data_source_interface;369
#endif370
#ifndef WL_DATA_DEVICE_INTERFACE371
#define WL_DATA_DEVICE_INTERFACE372
/**373
* @page page_iface_wl_data_device wl_data_device374
* @section page_iface_wl_data_device_desc Description375
*376
* There is one wl_data_device per seat which can be obtained377
* from the global wl_data_device_manager singleton.378
*379
* A wl_data_device provides access to inter-client data transfer380
* mechanisms such as copy-and-paste and drag-and-drop.381
* @section page_iface_wl_data_device_api API382
* See @ref iface_wl_data_device.383
*/384
/**385
* @defgroup iface_wl_data_device The wl_data_device interface386
*387
* There is one wl_data_device per seat which can be obtained388
* from the global wl_data_device_manager singleton.389
*390
* A wl_data_device provides access to inter-client data transfer391
* mechanisms such as copy-and-paste and drag-and-drop.392
*/393
extern const struct wl_interface wl_data_device_interface;394
#endif395
#ifndef WL_DATA_DEVICE_MANAGER_INTERFACE396
#define WL_DATA_DEVICE_MANAGER_INTERFACE397
/**398
* @page page_iface_wl_data_device_manager wl_data_device_manager399
* @section page_iface_wl_data_device_manager_desc Description400
*401
* The wl_data_device_manager is a singleton global object that402
* provides access to inter-client data transfer mechanisms such as403
* copy-and-paste and drag-and-drop. These mechanisms are tied to404
* a wl_seat and this interface lets a client get a wl_data_device405
* corresponding to a wl_seat.406
*407
* Depending on the version bound, the objects created from the bound408
* wl_data_device_manager object will have different requirements for409
* functioning properly. See wl_data_source.set_actions,410
* wl_data_offer.accept and wl_data_offer.finish for details.411
* @section page_iface_wl_data_device_manager_api API412
* See @ref iface_wl_data_device_manager.413
*/414
/**415
* @defgroup iface_wl_data_device_manager The wl_data_device_manager interface416
*417
* The wl_data_device_manager is a singleton global object that418
* provides access to inter-client data transfer mechanisms such as419
* copy-and-paste and drag-and-drop. These mechanisms are tied to420
* a wl_seat and this interface lets a client get a wl_data_device421
* corresponding to a wl_seat.422
*423
* Depending on the version bound, the objects created from the bound424
* wl_data_device_manager object will have different requirements for425
* functioning properly. See wl_data_source.set_actions,426
* wl_data_offer.accept and wl_data_offer.finish for details.427
*/428
extern const struct wl_interface wl_data_device_manager_interface;429
#endif430
#ifndef WL_SHELL_INTERFACE431
#define WL_SHELL_INTERFACE432
/**433
* @page page_iface_wl_shell wl_shell434
* @section page_iface_wl_shell_desc Description435
*436
* This interface is implemented by servers that provide437
* desktop-style user interfaces.438
*439
* It allows clients to associate a wl_shell_surface with440
* a basic surface.441
*442
* Note! This protocol is deprecated and not intended for production use.443
* For desktop-style user interfaces, use xdg_shell. Compositors and clients444
* should not implement this interface.445
* @section page_iface_wl_shell_api API446
* See @ref iface_wl_shell.447
*/448
/**449
* @defgroup iface_wl_shell The wl_shell interface450
*451
* This interface is implemented by servers that provide452
* desktop-style user interfaces.453
*454
* It allows clients to associate a wl_shell_surface with455
* a basic surface.456
*457
* Note! This protocol is deprecated and not intended for production use.458
* For desktop-style user interfaces, use xdg_shell. Compositors and clients459
* should not implement this interface.460
*/461
extern const struct wl_interface wl_shell_interface;462
#endif463
#ifndef WL_SHELL_SURFACE_INTERFACE464
#define WL_SHELL_SURFACE_INTERFACE465
/**466
* @page page_iface_wl_shell_surface wl_shell_surface467
* @section page_iface_wl_shell_surface_desc Description468
*469
* An interface that may be implemented by a wl_surface, for470
* implementations that provide a desktop-style user interface.471
*472
* It provides requests to treat surfaces like toplevel, fullscreen473
* or popup windows, move, resize or maximize them, associate474
* metadata like title and class, etc.475
*476
* On the server side the object is automatically destroyed when477
* the related wl_surface is destroyed. On the client side,478
* wl_shell_surface_destroy() must be called before destroying479
* the wl_surface object.480
* @section page_iface_wl_shell_surface_api API481
* See @ref iface_wl_shell_surface.482
*/483
/**484
* @defgroup iface_wl_shell_surface The wl_shell_surface interface485
*486
* An interface that may be implemented by a wl_surface, for487
* implementations that provide a desktop-style user interface.488
*489
* It provides requests to treat surfaces like toplevel, fullscreen490
* or popup windows, move, resize or maximize them, associate491
* metadata like title and class, etc.492
*493
* On the server side the object is automatically destroyed when494
* the related wl_surface is destroyed. On the client side,495
* wl_shell_surface_destroy() must be called before destroying496
* the wl_surface object.497
*/498
extern const struct wl_interface wl_shell_surface_interface;499
#endif500
#ifndef WL_SURFACE_INTERFACE501
#define WL_SURFACE_INTERFACE502
/**503
* @page page_iface_wl_surface wl_surface504
* @section page_iface_wl_surface_desc Description505
*506
* A surface is a rectangular area that may be displayed on zero507
* or more outputs, and shown any number of times at the compositor's508
* discretion. They can present wl_buffers, receive user input, and509
* define a local coordinate system.510
*511
* The size of a surface (and relative positions on it) is described512
* in surface-local coordinates, which may differ from the buffer513
* coordinates of the pixel content, in case a buffer_transform514
* or a buffer_scale is used.515
*516
* A surface without a "role" is fairly useless: a compositor does517
* not know where, when or how to present it. The role is the518
* purpose of a wl_surface. Examples of roles are a cursor for a519
* pointer (as set by wl_pointer.set_cursor), a drag icon520
* (wl_data_device.start_drag), a sub-surface521
* (wl_subcompositor.get_subsurface), and a window as defined by a522
* shell protocol (e.g. wl_shell.get_shell_surface).523
*524
* A surface can have only one role at a time. Initially a525
* wl_surface does not have a role. Once a wl_surface is given a526
* role, it is set permanently for the whole lifetime of the527
* wl_surface object. Giving the current role again is allowed,528
* unless explicitly forbidden by the relevant interface529
* specification.530
*531
* Surface roles are given by requests in other interfaces such as532
* wl_pointer.set_cursor. The request should explicitly mention533
* that this request gives a role to a wl_surface. Often, this534
* request also creates a new protocol object that represents the535
* role and adds additional functionality to wl_surface. When a536
* client wants to destroy a wl_surface, they must destroy this role537
* object before the wl_surface, otherwise a defunct_role_object error is538
* sent.539
*540
* Destroying the role object does not remove the role from the541
* wl_surface, but it may stop the wl_surface from "playing the role".542
* For instance, if a wl_subsurface object is destroyed, the wl_surface543
* it was created for will be unmapped and forget its position and544
* z-order. It is allowed to create a wl_subsurface for the same545
* wl_surface again, but it is not allowed to use the wl_surface as546
* a cursor (cursor is a different role than sub-surface, and role547
* switching is not allowed).548
* @section page_iface_wl_surface_api API549
* See @ref iface_wl_surface.550
*/551
/**552
* @defgroup iface_wl_surface The wl_surface interface553
*554
* A surface is a rectangular area that may be displayed on zero555
* or more outputs, and shown any number of times at the compositor's556
* discretion. They can present wl_buffers, receive user input, and557
* define a local coordinate system.558
*559
* The size of a surface (and relative positions on it) is described560
* in surface-local coordinates, which may differ from the buffer561
* coordinates of the pixel content, in case a buffer_transform562
* or a buffer_scale is used.563
*564
* A surface without a "role" is fairly useless: a compositor does565
* not know where, when or how to present it. The role is the566
* purpose of a wl_surface. Examples of roles are a cursor for a567
* pointer (as set by wl_pointer.set_cursor), a drag icon568
* (wl_data_device.start_drag), a sub-surface569
* (wl_subcompositor.get_subsurface), and a window as defined by a570
* shell protocol (e.g. wl_shell.get_shell_surface).571
*572
* A surface can have only one role at a time. Initially a573
* wl_surface does not have a role. Once a wl_surface is given a574
* role, it is set permanently for the whole lifetime of the575
* wl_surface object. Giving the current role again is allowed,576
* unless explicitly forbidden by the relevant interface577
* specification.578
*579
* Surface roles are given by requests in other interfaces such as580
* wl_pointer.set_cursor. The request should explicitly mention581
* that this request gives a role to a wl_surface. Often, this582
* request also creates a new protocol object that represents the583
* role and adds additional functionality to wl_surface. When a584
* client wants to destroy a wl_surface, they must destroy this role585
* object before the wl_surface, otherwise a defunct_role_object error is586
* sent.587
*588
* Destroying the role object does not remove the role from the589
* wl_surface, but it may stop the wl_surface from "playing the role".590
* For instance, if a wl_subsurface object is destroyed, the wl_surface591
* it was created for will be unmapped and forget its position and592
* z-order. It is allowed to create a wl_subsurface for the same593
* wl_surface again, but it is not allowed to use the wl_surface as594
* a cursor (cursor is a different role than sub-surface, and role595
* switching is not allowed).596
*/597
extern const struct wl_interface wl_surface_interface;598
#endif599
#ifndef WL_SEAT_INTERFACE600
#define WL_SEAT_INTERFACE601
/**602
* @page page_iface_wl_seat wl_seat603
* @section page_iface_wl_seat_desc Description604
*605
* A seat is a group of keyboards, pointer and touch devices. This606
* object is published as a global during start up, or when such a607
* device is hot plugged. A seat typically has a pointer and608
* maintains a keyboard focus and a pointer focus.609
* @section page_iface_wl_seat_api API610
* See @ref iface_wl_seat.611
*/612
/**613
* @defgroup iface_wl_seat The wl_seat interface614
*615
* A seat is a group of keyboards, pointer and touch devices. This616
* object is published as a global during start up, or when such a617
* device is hot plugged. A seat typically has a pointer and618
* maintains a keyboard focus and a pointer focus.619
*/620
extern const struct wl_interface wl_seat_interface;621
#endif622
#ifndef WL_POINTER_INTERFACE623
#define WL_POINTER_INTERFACE624
/**625
* @page page_iface_wl_pointer wl_pointer626
* @section page_iface_wl_pointer_desc Description627
*628
* The wl_pointer interface represents one or more input devices,629
* such as mice, which control the pointer location and pointer_focus630
* of a seat.631
*632
* The wl_pointer interface generates motion, enter and leave633
* events for the surfaces that the pointer is located over,634
* and button and axis events for button presses, button releases635
* and scrolling.636
* @section page_iface_wl_pointer_api API637
* See @ref iface_wl_pointer.638
*/639
/**640
* @defgroup iface_wl_pointer The wl_pointer interface641
*642
* The wl_pointer interface represents one or more input devices,643
* such as mice, which control the pointer location and pointer_focus644
* of a seat.645
*646
* The wl_pointer interface generates motion, enter and leave647
* events for the surfaces that the pointer is located over,648
* and button and axis events for button presses, button releases649
* and scrolling.650
*/651
extern const struct wl_interface wl_pointer_interface;652
#endif653
#ifndef WL_KEYBOARD_INTERFACE654
#define WL_KEYBOARD_INTERFACE655
/**656
* @page page_iface_wl_keyboard wl_keyboard657
* @section page_iface_wl_keyboard_desc Description658
*659
* The wl_keyboard interface represents one or more keyboards660
* associated with a seat.661
*662
* Each wl_keyboard has the following logical state:663
*664
* - an active surface (possibly null),665
* - the keys currently logically down,666
* - the active modifiers,667
* - the active group.668
*669
* By default, the active surface is null, the keys currently logically down670
* are empty, the active modifiers and the active group are 0.671
* @section page_iface_wl_keyboard_api API672
* See @ref iface_wl_keyboard.673
*/674
/**675
* @defgroup iface_wl_keyboard The wl_keyboard interface676
*677
* The wl_keyboard interface represents one or more keyboards678
* associated with a seat.679
*680
* Each wl_keyboard has the following logical state:681
*682
* - an active surface (possibly null),683
* - the keys currently logically down,684
* - the active modifiers,685
* - the active group.686
*687
* By default, the active surface is null, the keys currently logically down688
* are empty, the active modifiers and the active group are 0.689
*/690
extern const struct wl_interface wl_keyboard_interface;691
#endif692
#ifndef WL_TOUCH_INTERFACE693
#define WL_TOUCH_INTERFACE694
/**695
* @page page_iface_wl_touch wl_touch696
* @section page_iface_wl_touch_desc Description697
*698
* The wl_touch interface represents a touchscreen699
* associated with a seat.700
*701
* Touch interactions can consist of one or more contacts.702
* For each contact, a series of events is generated, starting703
* with a down event, followed by zero or more motion events,704
* and ending with an up event. Events relating to the same705
* contact point can be identified by the ID of the sequence.706
* @section page_iface_wl_touch_api API707
* See @ref iface_wl_touch.708
*/709
/**710
* @defgroup iface_wl_touch The wl_touch interface711
*712
* The wl_touch interface represents a touchscreen713
* associated with a seat.714
*715
* Touch interactions can consist of one or more contacts.716
* For each contact, a series of events is generated, starting717
* with a down event, followed by zero or more motion events,718
* and ending with an up event. Events relating to the same719
* contact point can be identified by the ID of the sequence.720
*/721
extern const struct wl_interface wl_touch_interface;722
#endif723
#ifndef WL_OUTPUT_INTERFACE724
#define WL_OUTPUT_INTERFACE725
/**726
* @page page_iface_wl_output wl_output727
* @section page_iface_wl_output_desc Description728
*729
* An output describes part of the compositor geometry. The730
* compositor works in the 'compositor coordinate system' and an731
* output corresponds to a rectangular area in that space that is732
* actually visible. This typically corresponds to a monitor that733
* displays part of the compositor space. This object is published734
* as global during start up, or when a monitor is hotplugged.735
* @section page_iface_wl_output_api API736
* See @ref iface_wl_output.737
*/738
/**739
* @defgroup iface_wl_output The wl_output interface740
*741
* An output describes part of the compositor geometry. The742
* compositor works in the 'compositor coordinate system' and an743
* output corresponds to a rectangular area in that space that is744
* actually visible. This typically corresponds to a monitor that745
* displays part of the compositor space. This object is published746
* as global during start up, or when a monitor is hotplugged.747
*/748
extern const struct wl_interface wl_output_interface;749
#endif750
#ifndef WL_REGION_INTERFACE751
#define WL_REGION_INTERFACE752
/**753
* @page page_iface_wl_region wl_region754
* @section page_iface_wl_region_desc Description755
*756
* A region object describes an area.757
*758
* Region objects are used to describe the opaque and input759
* regions of a surface.760
* @section page_iface_wl_region_api API761
* See @ref iface_wl_region.762
*/763
/**764
* @defgroup iface_wl_region The wl_region interface765
*766
* A region object describes an area.767
*768
* Region objects are used to describe the opaque and input769
* regions of a surface.770
*/771
extern const struct wl_interface wl_region_interface;772
#endif773
#ifndef WL_SUBCOMPOSITOR_INTERFACE774
#define WL_SUBCOMPOSITOR_INTERFACE775
/**776
* @page page_iface_wl_subcompositor wl_subcompositor777
* @section page_iface_wl_subcompositor_desc Description778
*779
* The global interface exposing sub-surface compositing capabilities.780
* A wl_surface, that has sub-surfaces associated, is called the781
* parent surface. Sub-surfaces can be arbitrarily nested and create782
* a tree of sub-surfaces.783
*784
* The root surface in a tree of sub-surfaces is the main785
* surface. The main surface cannot be a sub-surface, because786
* sub-surfaces must always have a parent.787
*788
* A main surface with its sub-surfaces forms a (compound) window.789
* For window management purposes, this set of wl_surface objects is790
* to be considered as a single window, and it should also behave as791
* such.792
*793
* The aim of sub-surfaces is to offload some of the compositing work794
* within a window from clients to the compositor. A prime example is795
* a video player with decorations and video in separate wl_surface796
* objects. This should allow the compositor to pass YUV video buffer797
* processing to dedicated overlay hardware when possible.798
* @section page_iface_wl_subcompositor_api API799
* See @ref iface_wl_subcompositor.800
*/801
/**802
* @defgroup iface_wl_subcompositor The wl_subcompositor interface803
*804
* The global interface exposing sub-surface compositing capabilities.805
* A wl_surface, that has sub-surfaces associated, is called the806
* parent surface. Sub-surfaces can be arbitrarily nested and create807
* a tree of sub-surfaces.808
*809
* The root surface in a tree of sub-surfaces is the main810
* surface. The main surface cannot be a sub-surface, because811
* sub-surfaces must always have a parent.812
*813
* A main surface with its sub-surfaces forms a (compound) window.814
* For window management purposes, this set of wl_surface objects is815
* to be considered as a single window, and it should also behave as816
* such.817
*818
* The aim of sub-surfaces is to offload some of the compositing work819
* within a window from clients to the compositor. A prime example is820
* a video player with decorations and video in separate wl_surface821
* objects. This should allow the compositor to pass YUV video buffer822
* processing to dedicated overlay hardware when possible.823
*/824
extern const struct wl_interface wl_subcompositor_interface;825
#endif826
#ifndef WL_SUBSURFACE_INTERFACE827
#define WL_SUBSURFACE_INTERFACE828
/**829
* @page page_iface_wl_subsurface wl_subsurface830
* @section page_iface_wl_subsurface_desc Description831
*832
* An additional interface to a wl_surface object, which has been833
* made a sub-surface. A sub-surface has one parent surface. A834
* sub-surface's size and position are not limited to that of the parent.835
* Particularly, a sub-surface is not automatically clipped to its836
* parent's area.837
*838
* A sub-surface becomes mapped, when a non-NULL wl_buffer is applied839
* and the parent surface is mapped. The order of which one happens840
* first is irrelevant. A sub-surface is hidden if the parent becomes841
* hidden, or if a NULL wl_buffer is applied. These rules apply842
* recursively through the tree of surfaces.843
*844
* The behaviour of a wl_surface.commit request on a sub-surface845
* depends on the sub-surface's mode. The possible modes are846
* synchronized and desynchronized, see methods847
* wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized848
* mode caches the wl_surface state to be applied when the parent's849
* state gets applied, and desynchronized mode applies the pending850
* wl_surface state directly. A sub-surface is initially in the851
* synchronized mode.852
*853
* Sub-surfaces also have another kind of state, which is managed by854
* wl_subsurface requests, as opposed to wl_surface requests. This855
* state includes the sub-surface position relative to the parent856
* surface (wl_subsurface.set_position), and the stacking order of857
* the parent and its sub-surfaces (wl_subsurface.place_above and858
* .place_below). This state is applied when the parent surface's859
* wl_surface state is applied, regardless of the sub-surface's mode.860
* As the exception, set_sync and set_desync are effective immediately.861
*862
* The main surface can be thought to be always in desynchronized mode,863
* since it does not have a parent in the sub-surfaces sense.864
*865
* Even if a sub-surface is in desynchronized mode, it will behave as866
* in synchronized mode, if its parent surface behaves as in867
* synchronized mode. This rule is applied recursively throughout the868
* tree of surfaces. This means, that one can set a sub-surface into869
* synchronized mode, and then assume that all its child and grand-child870
* sub-surfaces are synchronized, too, without explicitly setting them.871
*872
* Destroying a sub-surface takes effect immediately. If you need to873
* synchronize the removal of a sub-surface to the parent surface update,874
* unmap the sub-surface first by attaching a NULL wl_buffer, update parent,875
* and then destroy the sub-surface.876
*877
* If the parent wl_surface object is destroyed, the sub-surface is878
* unmapped.879
*880
* A sub-surface never has the keyboard focus of any seat.881
*882
* The wl_surface.offset request is ignored: clients must use set_position883
* instead to move the sub-surface.884
* @section page_iface_wl_subsurface_api API885
* See @ref iface_wl_subsurface.886
*/887
/**888
* @defgroup iface_wl_subsurface The wl_subsurface interface889
*890
* An additional interface to a wl_surface object, which has been891
* made a sub-surface. A sub-surface has one parent surface. A892
* sub-surface's size and position are not limited to that of the parent.893
* Particularly, a sub-surface is not automatically clipped to its894
* parent's area.895
*896
* A sub-surface becomes mapped, when a non-NULL wl_buffer is applied897
* and the parent surface is mapped. The order of which one happens898
* first is irrelevant. A sub-surface is hidden if the parent becomes899
* hidden, or if a NULL wl_buffer is applied. These rules apply900
* recursively through the tree of surfaces.901
*902
* The behaviour of a wl_surface.commit request on a sub-surface903
* depends on the sub-surface's mode. The possible modes are904
* synchronized and desynchronized, see methods905
* wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized906
* mode caches the wl_surface state to be applied when the parent's907
* state gets applied, and desynchronized mode applies the pending908
* wl_surface state directly. A sub-surface is initially in the909
* synchronized mode.910
*911
* Sub-surfaces also have another kind of state, which is managed by912
* wl_subsurface requests, as opposed to wl_surface requests. This913
* state includes the sub-surface position relative to the parent914
* surface (wl_subsurface.set_position), and the stacking order of915
* the parent and its sub-surfaces (wl_subsurface.place_above and916
* .place_below). This state is applied when the parent surface's917
* wl_surface state is applied, regardless of the sub-surface's mode.918
* As the exception, set_sync and set_desync are effective immediately.919
*920
* The main surface can be thought to be always in desynchronized mode,921
* since it does not have a parent in the sub-surfaces sense.922
*923
* Even if a sub-surface is in desynchronized mode, it will behave as924
* in synchronized mode, if its parent surface behaves as in925
* synchronized mode. This rule is applied recursively throughout the926
* tree of surfaces. This means, that one can set a sub-surface into927
* synchronized mode, and then assume that all its child and grand-child928
* sub-surfaces are synchronized, too, without explicitly setting them.929
*930
* Destroying a sub-surface takes effect immediately. If you need to931
* synchronize the removal of a sub-surface to the parent surface update,932
* unmap the sub-surface first by attaching a NULL wl_buffer, update parent,933
* and then destroy the sub-surface.934
*935
* If the parent wl_surface object is destroyed, the sub-surface is936
* unmapped.937
*938
* A sub-surface never has the keyboard focus of any seat.939
*940
* The wl_surface.offset request is ignored: clients must use set_position941
* instead to move the sub-surface.942
*/943
extern const struct wl_interface wl_subsurface_interface;944
#endif945
#ifndef WL_FIXES_INTERFACE946
#define WL_FIXES_INTERFACE947
/**948
* @page page_iface_wl_fixes wl_fixes949
* @section page_iface_wl_fixes_desc Description950
*951
* This global fixes problems with other core-protocol interfaces that952
* cannot be fixed in these interfaces themselves.953
* @section page_iface_wl_fixes_api API954
* See @ref iface_wl_fixes.955
*/956
/**957
* @defgroup iface_wl_fixes The wl_fixes interface958
*959
* This global fixes problems with other core-protocol interfaces that960
* cannot be fixed in these interfaces themselves.961
*/962
extern const struct wl_interface wl_fixes_interface;963
#endif965
#ifndef WL_DISPLAY_ERROR_ENUM966
#define WL_DISPLAY_ERROR_ENUM967
/**968
* @ingroup iface_wl_display969
* global error values970
*971
* These errors are global and can be emitted in response to any972
* server request.973
*/974
enum wl_display_error {975
/**976
* server couldn't find object977
*/978
WL_DISPLAY_ERROR_INVALID_OBJECT = 0,979
/**980
* method doesn't exist on the specified interface or malformed request981
*/982
WL_DISPLAY_ERROR_INVALID_METHOD = 1,983
/**984
* server is out of memory985
*/986
WL_DISPLAY_ERROR_NO_MEMORY = 2,987
/**988
* implementation error in compositor989
*/990
WL_DISPLAY_ERROR_IMPLEMENTATION = 3,991
};992
#endif /* WL_DISPLAY_ERROR_ENUM */994
/**995
* @ingroup iface_wl_display996
* @struct wl_display_listener997
*/998
struct wl_display_listener {999
/**1000
* fatal error event1001
*1002
* The error event is sent out when a fatal (non-recoverable)1003
* error has occurred. The object_id argument is the object where1004
* the error occurred, most often in response to a request to that1005
* object. The code identifies the error and is defined by the1006
* object interface. As such, each interface defines its own set of1007
* error codes. The message is a brief description of the error,1008
* for (debugging) convenience.1009
* @param object_id object where the error occurred1010
* @param code error code1011
* @param message error description1012
*/1013
void (*error)(void *data,1014
struct wl_display *wl_display,1015
void *object_id,1016
uint32_t code,1017
const char *message);1018
/**1019
* acknowledge object ID deletion1020
*1021
* This event is used internally by the object ID management1022
* logic. When a client deletes an object that it had created, the1023
* server will send this event to acknowledge that it has seen the1024
* delete request. When the client receives this event, it will1025
* know that it can safely reuse the object ID.1026
* @param id deleted object ID1027
*/1028
void (*delete_id)(void *data,1029
struct wl_display *wl_display,1030
uint32_t id);1031
};1033
/**1034
* @ingroup iface_wl_display1035
*/1036
static inline int1037
wl_display_add_listener(struct wl_display *wl_display,1038
const struct wl_display_listener *listener, void *data)1039
{1040
return wl_proxy_add_listener((struct wl_proxy *) wl_display,1041
(void (**)(void)) listener, data);1042
}1044
#define WL_DISPLAY_SYNC 01045
#define WL_DISPLAY_GET_REGISTRY 11047
/**1048
* @ingroup iface_wl_display1049
*/1050
#define WL_DISPLAY_ERROR_SINCE_VERSION 11051
/**1052
* @ingroup iface_wl_display1053
*/1054
#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 11056
/**1057
* @ingroup iface_wl_display1058
*/1059
#define WL_DISPLAY_SYNC_SINCE_VERSION 11060
/**1061
* @ingroup iface_wl_display1062
*/1063
#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 11065
/** @ingroup iface_wl_display */1066
static inline void1067
wl_display_set_user_data(struct wl_display *wl_display, void *user_data)1068
{1069
wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);1070
}1072
/** @ingroup iface_wl_display */1073
static inline void *1074
wl_display_get_user_data(struct wl_display *wl_display)1075
{1076
return wl_proxy_get_user_data((struct wl_proxy *) wl_display);1077
}1079
static inline uint32_t1080
wl_display_get_version(struct wl_display *wl_display)1081
{1082
return wl_proxy_get_version((struct wl_proxy *) wl_display);1083
}1085
/**1086
* @ingroup iface_wl_display1087
*1088
* The sync request asks the server to emit the 'done' event1089
* on the returned wl_callback object. Since requests are1090
* handled in-order and events are delivered in-order, this can1091
* be used as a barrier to ensure all previous requests and the1092
* resulting events have been handled.1093
*1094
* The object returned by this request will be destroyed by the1095
* compositor after the callback is fired and as such the client must not1096
* attempt to use it after that point.1097
*1098
* The callback_data passed in the callback is undefined and should be ignored.1099
*/1100
static inline struct wl_callback *1101
wl_display_sync(struct wl_display *wl_display)1102
{1103
struct wl_proxy *callback;1105
callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,1106
WL_DISPLAY_SYNC, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);1108
return (struct wl_callback *) callback;1109
}1111
/**1112
* @ingroup iface_wl_display1113
*1114
* This request creates a registry object that allows the client1115
* to list and bind the global objects available from the1116
* compositor.1117
*1118
* It should be noted that the server side resources consumed in1119
* response to a get_registry request can only be released when the1120
* client disconnects, not when the client side proxy is destroyed.1121
* Therefore, clients should invoke get_registry as infrequently as1122
* possible to avoid wasting memory.1123
*/1124
static inline struct wl_registry *1125
wl_display_get_registry(struct wl_display *wl_display)1126
{1127
struct wl_proxy *registry;1129
registry = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,1130
WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);1132
return (struct wl_registry *) registry;1133
}1135
/**1136
* @ingroup iface_wl_registry1137
* @struct wl_registry_listener1138
*/1139
struct wl_registry_listener {1140
/**1141
* announce global object1142
*1143
* Notify the client of global objects.1144
*1145
* The event notifies the client that a global object with the1146
* given name is now available, and it implements the given version1147
* of the given interface.1148
* @param name numeric name of the global object1149
* @param interface interface implemented by the object1150
* @param version interface version1151
*/1152
void (*global)(void *data,1153
struct wl_registry *wl_registry,1154
uint32_t name,1155
const char *interface,1156
uint32_t version);1157
/**1158
* announce removal of global object1159
*1160
* Notify the client of removed global objects.1161
*1162
* This event notifies the client that the global identified by1163
* name is no longer available. If the client bound to the global1164
* using the bind request, the client should now destroy that1165
* object.1166
*1167
* The object remains valid and requests to the object will be1168
* ignored until the client destroys it, to avoid races between the1169
* global going away and a client sending a request to it.1170
* @param name numeric name of the global object1171
*/1172
void (*global_remove)(void *data,1173
struct wl_registry *wl_registry,1174
uint32_t name);1175
};1177
/**1178
* @ingroup iface_wl_registry1179
*/1180
static inline int1181
wl_registry_add_listener(struct wl_registry *wl_registry,1182
const struct wl_registry_listener *listener, void *data)1183
{1184
return wl_proxy_add_listener((struct wl_proxy *) wl_registry,1185
(void (**)(void)) listener, data);1186
}1188
#define WL_REGISTRY_BIND 01190
/**1191
* @ingroup iface_wl_registry1192
*/1193
#define WL_REGISTRY_GLOBAL_SINCE_VERSION 11194
/**1195
* @ingroup iface_wl_registry1196
*/1197
#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 11199
/**1200
* @ingroup iface_wl_registry1201
*/1202
#define WL_REGISTRY_BIND_SINCE_VERSION 11204
/** @ingroup iface_wl_registry */1205
static inline void1206
wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)1207
{1208
wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);1209
}1211
/** @ingroup iface_wl_registry */1212
static inline void *1213
wl_registry_get_user_data(struct wl_registry *wl_registry)1214
{1215
return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);1216
}1218
static inline uint32_t1219
wl_registry_get_version(struct wl_registry *wl_registry)1220
{1221
return wl_proxy_get_version((struct wl_proxy *) wl_registry);1222
}1224
/** @ingroup iface_wl_registry */1225
static inline void1226
wl_registry_destroy(struct wl_registry *wl_registry)1227
{1228
wl_proxy_destroy((struct wl_proxy *) wl_registry);1229
}1231
/**1232
* @ingroup iface_wl_registry1233
*1234
* Binds a new, client-created object to the server using the1235
* specified name as the identifier.1236
*/1237
static inline void *1238
wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)1239
{1240
struct wl_proxy *id;1242
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_registry,1243
WL_REGISTRY_BIND, interface, version, 0, name, interface->name, version, NULL);1245
return (void *) id;1246
}1248
/**1249
* @ingroup iface_wl_callback1250
* @struct wl_callback_listener1251
*/1252
struct wl_callback_listener {1253
/**1254
* done event1255
*1256
* Notify the client when the related request is done.1257
* @param callback_data request-specific data for the callback1258
*/1259
void (*done)(void *data,1260
struct wl_callback *wl_callback,1261
uint32_t callback_data);1262
};1264
/**1265
* @ingroup iface_wl_callback1266
*/1267
static inline int1268
wl_callback_add_listener(struct wl_callback *wl_callback,1269
const struct wl_callback_listener *listener, void *data)1270
{1271
return wl_proxy_add_listener((struct wl_proxy *) wl_callback,1272
(void (**)(void)) listener, data);1273
}1275
/**1276
* @ingroup iface_wl_callback1277
*/1278
#define WL_CALLBACK_DONE_SINCE_VERSION 11281
/** @ingroup iface_wl_callback */1282
static inline void1283
wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)1284
{1285
wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);1286
}1288
/** @ingroup iface_wl_callback */1289
static inline void *1290
wl_callback_get_user_data(struct wl_callback *wl_callback)1291
{1292
return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);1293
}1295
static inline uint32_t1296
wl_callback_get_version(struct wl_callback *wl_callback)1297
{1298
return wl_proxy_get_version((struct wl_proxy *) wl_callback);1299
}1301
/** @ingroup iface_wl_callback */1302
static inline void1303
wl_callback_destroy(struct wl_callback *wl_callback)1304
{1305
wl_proxy_destroy((struct wl_proxy *) wl_callback);1306
}1308
#define WL_COMPOSITOR_CREATE_SURFACE 01309
#define WL_COMPOSITOR_CREATE_REGION 11312
/**1313
* @ingroup iface_wl_compositor1314
*/1315
#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 11316
/**1317
* @ingroup iface_wl_compositor1318
*/1319
#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 11321
/** @ingroup iface_wl_compositor */1322
static inline void1323
wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data)1324
{1325
wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);1326
}1328
/** @ingroup iface_wl_compositor */1329
static inline void *1330
wl_compositor_get_user_data(struct wl_compositor *wl_compositor)1331
{1332
return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);1333
}1335
static inline uint32_t1336
wl_compositor_get_version(struct wl_compositor *wl_compositor)1337
{1338
return wl_proxy_get_version((struct wl_proxy *) wl_compositor);1339
}1341
/** @ingroup iface_wl_compositor */1342
static inline void1343
wl_compositor_destroy(struct wl_compositor *wl_compositor)1344
{1345
wl_proxy_destroy((struct wl_proxy *) wl_compositor);1346
}1348
/**1349
* @ingroup iface_wl_compositor1350
*1351
* Ask the compositor to create a new surface.1352
*/1353
static inline struct wl_surface *1354
wl_compositor_create_surface(struct wl_compositor *wl_compositor)1355
{1356
struct wl_proxy *id;1358
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,1359
WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);1361
return (struct wl_surface *) id;1362
}1364
/**1365
* @ingroup iface_wl_compositor1366
*1367
* Ask the compositor to create a new region.1368
*/1369
static inline struct wl_region *1370
wl_compositor_create_region(struct wl_compositor *wl_compositor)1371
{1372
struct wl_proxy *id;1374
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,1375
WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);1377
return (struct wl_region *) id;1378
}1380
#define WL_SHM_POOL_CREATE_BUFFER 01381
#define WL_SHM_POOL_DESTROY 11382
#define WL_SHM_POOL_RESIZE 21385
/**1386
* @ingroup iface_wl_shm_pool1387
*/1388
#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 11389
/**1390
* @ingroup iface_wl_shm_pool1391
*/1392
#define WL_SHM_POOL_DESTROY_SINCE_VERSION 11393
/**1394
* @ingroup iface_wl_shm_pool1395
*/1396
#define WL_SHM_POOL_RESIZE_SINCE_VERSION 11398
/** @ingroup iface_wl_shm_pool */1399
static inline void1400
wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)1401
{1402
wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);1403
}1405
/** @ingroup iface_wl_shm_pool */1406
static inline void *1407
wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)1408
{1409
return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);1410
}1412
static inline uint32_t1413
wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)1414
{1415
return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);1416
}1418
/**1419
* @ingroup iface_wl_shm_pool1420
*1421
* Create a wl_buffer object from the pool.1422
*1423
* The buffer is created offset bytes into the pool and has1424
* width and height as specified. The stride argument specifies1425
* the number of bytes from the beginning of one row to the beginning1426
* of the next. The format is the pixel format of the buffer and1427
* must be one of those advertised through the wl_shm.format event.1428
*1429
* A buffer will keep a reference to the pool it was created from1430
* so it is valid to destroy the pool immediately after creating1431
* a buffer from it.1432
*/1433
static inline struct wl_buffer *1434
wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format)1435
{1436
struct wl_proxy *id;1438
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1439
WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, NULL, offset, width, height, stride, format);1441
return (struct wl_buffer *) id;1442
}1444
/**1445
* @ingroup iface_wl_shm_pool1446
*1447
* Destroy the shared memory pool.1448
*1449
* The mmapped memory will be released when all1450
* buffers that have been created from this pool1451
* are gone.1452
*/1453
static inline void1454
wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool)1455
{1456
wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1457
WL_SHM_POOL_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), WL_MARSHAL_FLAG_DESTROY);1458
}1460
/**1461
* @ingroup iface_wl_shm_pool1462
*1463
* This request will cause the server to remap the backing memory1464
* for the pool from the file descriptor passed when the pool was1465
* created, but using the new size. This request can only be1466
* used to make the pool bigger.1467
*1468
* This request only changes the amount of bytes that are mmapped1469
* by the server and does not touch the file corresponding to the1470
* file descriptor passed at creation time. It is the client's1471
* responsibility to ensure that the file is at least as big as1472
* the new pool size.1473
*/1474
static inline void1475
wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)1476
{1477
wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1478
WL_SHM_POOL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, size);1479
}1481
#ifndef WL_SHM_ERROR_ENUM1482
#define WL_SHM_ERROR_ENUM1483
/**1484
* @ingroup iface_wl_shm1485
* wl_shm error values1486
*1487
* These errors can be emitted in response to wl_shm requests.1488
*/1489
enum wl_shm_error {1490
/**1491
* buffer format is not known1492
*/1493
WL_SHM_ERROR_INVALID_FORMAT = 0,1494
/**1495
* invalid size or stride during pool or buffer creation1496
*/1497
WL_SHM_ERROR_INVALID_STRIDE = 1,1498
/**1499
* mmapping the file descriptor failed1500
*/1501
WL_SHM_ERROR_INVALID_FD = 2,1502
};1503
#endif /* WL_SHM_ERROR_ENUM */1505
#ifndef WL_SHM_FORMAT_ENUM1506
#define WL_SHM_FORMAT_ENUM1507
/**1508
* @ingroup iface_wl_shm1509
* pixel formats1510
*1511
* This describes the memory layout of an individual pixel.1512
*1513
* All renderers should support argb8888 and xrgb8888 but any other1514
* formats are optional and may not be supported by the particular1515
* renderer in use.1516
*1517
* The drm format codes match the macros defined in drm_fourcc.h, except1518
* argb8888 and xrgb8888. The formats actually supported by the compositor1519
* will be reported by the format event.1520
*1521
* For all wl_shm formats and unless specified in another protocol1522
* extension, pre-multiplied alpha is used for pixel values.1523
*/1524
enum wl_shm_format {1525
/**1526
* 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian1527
*/1528
WL_SHM_FORMAT_ARGB8888 = 0,1529
/**1530
* 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian1531
*/1532
WL_SHM_FORMAT_XRGB8888 = 1,1533
/**1534
* 8-bit color index format, [7:0] C1535
*/1536
WL_SHM_FORMAT_C8 = 0x20203843,1537
/**1538
* 8-bit RGB format, [7:0] R:G:B 3:3:21539
*/1540
WL_SHM_FORMAT_RGB332 = 0x38424752,1541
/**1542
* 8-bit BGR format, [7:0] B:G:R 2:3:31543
*/1544
WL_SHM_FORMAT_BGR233 = 0x38524742,1545
/**1546
* 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian1547
*/1548
WL_SHM_FORMAT_XRGB4444 = 0x32315258,1549
/**1550
* 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian1551
*/1552
WL_SHM_FORMAT_XBGR4444 = 0x32314258,1553
/**1554
* 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian1555
*/1556
WL_SHM_FORMAT_RGBX4444 = 0x32315852,1557
/**1558
* 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian1559
*/1560
WL_SHM_FORMAT_BGRX4444 = 0x32315842,1561
/**1562
* 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian1563
*/1564
WL_SHM_FORMAT_ARGB4444 = 0x32315241,1565
/**1566
* 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian1567
*/1568
WL_SHM_FORMAT_ABGR4444 = 0x32314241,1569
/**1570
* 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian1571
*/1572
WL_SHM_FORMAT_RGBA4444 = 0x32314152,1573
/**1574
* 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian1575
*/1576
WL_SHM_FORMAT_BGRA4444 = 0x32314142,1577
/**1578
* 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian1579
*/1580
WL_SHM_FORMAT_XRGB1555 = 0x35315258,1581
/**1582
* 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian1583
*/1584
WL_SHM_FORMAT_XBGR1555 = 0x35314258,1585
/**1586
* 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian1587
*/1588
WL_SHM_FORMAT_RGBX5551 = 0x35315852,1589
/**1590
* 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian1591
*/1592
WL_SHM_FORMAT_BGRX5551 = 0x35315842,1593
/**1594
* 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian1595
*/1596
WL_SHM_FORMAT_ARGB1555 = 0x35315241,1597
/**1598
* 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian1599
*/1600
WL_SHM_FORMAT_ABGR1555 = 0x35314241,1601
/**1602
* 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian1603
*/1604
WL_SHM_FORMAT_RGBA5551 = 0x35314152,1605
/**1606
* 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian1607
*/1608
WL_SHM_FORMAT_BGRA5551 = 0x35314142,1609
/**1610
* 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian1611
*/1612
WL_SHM_FORMAT_RGB565 = 0x36314752,1613
/**1614
* 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian1615
*/1616
WL_SHM_FORMAT_BGR565 = 0x36314742,1617
/**1618
* 24-bit RGB format, [23:0] R:G:B little endian1619
*/1620
WL_SHM_FORMAT_RGB888 = 0x34324752,1621
/**1622
* 24-bit BGR format, [23:0] B:G:R little endian1623
*/1624
WL_SHM_FORMAT_BGR888 = 0x34324742,1625
/**1626
* 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian1627
*/1628
WL_SHM_FORMAT_XBGR8888 = 0x34324258,1629
/**1630
* 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian1631
*/1632
WL_SHM_FORMAT_RGBX8888 = 0x34325852,1633
/**1634
* 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian1635
*/1636
WL_SHM_FORMAT_BGRX8888 = 0x34325842,1637
/**1638
* 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian1639
*/1640
WL_SHM_FORMAT_ABGR8888 = 0x34324241,1641
/**1642
* 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian1643
*/1644
WL_SHM_FORMAT_RGBA8888 = 0x34324152,1645
/**1646
* 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian1647
*/1648
WL_SHM_FORMAT_BGRA8888 = 0x34324142,1649
/**1650
* 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian1651
*/1652
WL_SHM_FORMAT_XRGB2101010 = 0x30335258,1653
/**1654
* 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian1655
*/1656
WL_SHM_FORMAT_XBGR2101010 = 0x30334258,1657
/**1658
* 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian1659
*/1660
WL_SHM_FORMAT_RGBX1010102 = 0x30335852,1661
/**1662
* 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian1663
*/1664
WL_SHM_FORMAT_BGRX1010102 = 0x30335842,1665
/**1666
* 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian1667
*/1668
WL_SHM_FORMAT_ARGB2101010 = 0x30335241,1669
/**1670
* 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian1671
*/1672
WL_SHM_FORMAT_ABGR2101010 = 0x30334241,1673
/**1674
* 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian1675
*/1676
WL_SHM_FORMAT_RGBA1010102 = 0x30334152,1677
/**1678
* 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian1679
*/1680
WL_SHM_FORMAT_BGRA1010102 = 0x30334142,1681
/**1682
* packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian1683
*/1684
WL_SHM_FORMAT_YUYV = 0x56595559,1685
/**1686
* packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian1687
*/1688
WL_SHM_FORMAT_YVYU = 0x55595659,1689
/**1690
* packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian1691
*/1692
WL_SHM_FORMAT_UYVY = 0x59565955,1693
/**1694
* packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian1695
*/1696
WL_SHM_FORMAT_VYUY = 0x59555956,1697
/**1698
* packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian1699
*/1700
WL_SHM_FORMAT_AYUV = 0x56555941,1701
/**1702
* 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane1703
*/1704
WL_SHM_FORMAT_NV12 = 0x3231564e,1705
/**1706
* 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane1707
*/1708
WL_SHM_FORMAT_NV21 = 0x3132564e,1709
/**1710
* 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane1711
*/1712
WL_SHM_FORMAT_NV16 = 0x3631564e,1713
/**1714
* 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane1715
*/1716
WL_SHM_FORMAT_NV61 = 0x3136564e,1717
/**1718
* 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes1719
*/1720
WL_SHM_FORMAT_YUV410 = 0x39565559,1721
/**1722
* 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes1723
*/1724
WL_SHM_FORMAT_YVU410 = 0x39555659,1725
/**1726
* 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes1727
*/1728
WL_SHM_FORMAT_YUV411 = 0x31315559,1729
/**1730
* 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes1731
*/1732
WL_SHM_FORMAT_YVU411 = 0x31315659,1733
/**1734
* 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes1735
*/1736
WL_SHM_FORMAT_YUV420 = 0x32315559,1737
/**1738
* 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes1739
*/1740
WL_SHM_FORMAT_YVU420 = 0x32315659,1741
/**1742
* 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes1743
*/1744
WL_SHM_FORMAT_YUV422 = 0x36315559,1745
/**1746
* 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes1747
*/1748
WL_SHM_FORMAT_YVU422 = 0x36315659,1749
/**1750
* 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes1751
*/1752
WL_SHM_FORMAT_YUV444 = 0x34325559,1753
/**1754
* 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes1755
*/1756
WL_SHM_FORMAT_YVU444 = 0x34325659,1757
/**1758
* [7:0] R1759
*/1760
WL_SHM_FORMAT_R8 = 0x20203852,1761
/**1762
* [15:0] R little endian1763
*/1764
WL_SHM_FORMAT_R16 = 0x20363152,1765
/**1766
* [15:0] R:G 8:8 little endian1767
*/1768
WL_SHM_FORMAT_RG88 = 0x38384752,1769
/**1770
* [15:0] G:R 8:8 little endian1771
*/1772
WL_SHM_FORMAT_GR88 = 0x38385247,1773
/**1774
* [31:0] R:G 16:16 little endian1775
*/1776
WL_SHM_FORMAT_RG1616 = 0x32334752,1777
/**1778
* [31:0] G:R 16:16 little endian1779
*/1780
WL_SHM_FORMAT_GR1616 = 0x32335247,1781
/**1782
* [63:0] x:R:G:B 16:16:16:16 little endian1783
*/1784
WL_SHM_FORMAT_XRGB16161616F = 0x48345258,1785
/**1786
* [63:0] x:B:G:R 16:16:16:16 little endian1787
*/1788
WL_SHM_FORMAT_XBGR16161616F = 0x48344258,1789
/**1790
* [63:0] A:R:G:B 16:16:16:16 little endian1791
*/1792
WL_SHM_FORMAT_ARGB16161616F = 0x48345241,1793
/**1794
* [63:0] A:B:G:R 16:16:16:16 little endian1795
*/1796
WL_SHM_FORMAT_ABGR16161616F = 0x48344241,1797
/**1798
* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian1799
*/1800
WL_SHM_FORMAT_XYUV8888 = 0x56555958,1801
/**1802
* [23:0] Cr:Cb:Y 8:8:8 little endian1803
*/1804
WL_SHM_FORMAT_VUY888 = 0x34325556,1805
/**1806
* Y followed by U then V, 10:10:10. Non-linear modifier only1807
*/1808
WL_SHM_FORMAT_VUY101010 = 0x30335556,1809
/**1810
* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels1811
*/1812
WL_SHM_FORMAT_Y210 = 0x30313259,1813
/**1814
* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels1815
*/1816
WL_SHM_FORMAT_Y212 = 0x32313259,1817
/**1818
* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels1819
*/1820
WL_SHM_FORMAT_Y216 = 0x36313259,1821
/**1822
* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian1823
*/1824
WL_SHM_FORMAT_Y410 = 0x30313459,1825
/**1826
* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian1827
*/1828
WL_SHM_FORMAT_Y412 = 0x32313459,1829
/**1830
* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian1831
*/1832
WL_SHM_FORMAT_Y416 = 0x36313459,1833
/**1834
* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian1835
*/1836
WL_SHM_FORMAT_XVYU2101010 = 0x30335658,1837
/**1838
* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian1839
*/1840
WL_SHM_FORMAT_XVYU12_16161616 = 0x36335658,1841
/**1842
* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian1843
*/1844
WL_SHM_FORMAT_XVYU16161616 = 0x38345658,1845
/**1846
* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian1847
*/1848
WL_SHM_FORMAT_Y0L0 = 0x304c3059,1849
/**1850
* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian1851
*/1852
WL_SHM_FORMAT_X0L0 = 0x304c3058,1853
/**1854
* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian1855
*/1856
WL_SHM_FORMAT_Y0L2 = 0x324c3059,1857
/**1858
* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian1859
*/1860
WL_SHM_FORMAT_X0L2 = 0x324c3058,1861
WL_SHM_FORMAT_YUV420_8BIT = 0x38305559,1862
WL_SHM_FORMAT_YUV420_10BIT = 0x30315559,1863
WL_SHM_FORMAT_XRGB8888_A8 = 0x38415258,1864
WL_SHM_FORMAT_XBGR8888_A8 = 0x38414258,1865
WL_SHM_FORMAT_RGBX8888_A8 = 0x38415852,1866
WL_SHM_FORMAT_BGRX8888_A8 = 0x38415842,1867
WL_SHM_FORMAT_RGB888_A8 = 0x38413852,1868
WL_SHM_FORMAT_BGR888_A8 = 0x38413842,1869
WL_SHM_FORMAT_RGB565_A8 = 0x38413552,1870
WL_SHM_FORMAT_BGR565_A8 = 0x38413542,1871
/**1872
* non-subsampled Cr:Cb plane1873
*/1874
WL_SHM_FORMAT_NV24 = 0x3432564e,1875
/**1876
* non-subsampled Cb:Cr plane1877
*/1878
WL_SHM_FORMAT_NV42 = 0x3234564e,1879
/**1880
* 2x1 subsampled Cr:Cb plane, 10 bit per channel1881
*/1882
WL_SHM_FORMAT_P210 = 0x30313250,1883
/**1884
* 2x2 subsampled Cr:Cb plane 10 bits per channel1885
*/1886
WL_SHM_FORMAT_P010 = 0x30313050,1887
/**1888
* 2x2 subsampled Cr:Cb plane 12 bits per channel1889
*/1890
WL_SHM_FORMAT_P012 = 0x32313050,1891
/**1892
* 2x2 subsampled Cr:Cb plane 16 bits per channel1893
*/1894
WL_SHM_FORMAT_P016 = 0x36313050,1895
/**1896
* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian1897
*/1898
WL_SHM_FORMAT_AXBXGXRX106106106106 = 0x30314241,1899
/**1900
* 2x2 subsampled Cr:Cb plane1901
*/1902
WL_SHM_FORMAT_NV15 = 0x3531564e,1903
WL_SHM_FORMAT_Q410 = 0x30313451,1904
WL_SHM_FORMAT_Q401 = 0x31303451,1905
/**1906
* [63:0] x:R:G:B 16:16:16:16 little endian1907
*/1908
WL_SHM_FORMAT_XRGB16161616 = 0x38345258,1909
/**1910
* [63:0] x:B:G:R 16:16:16:16 little endian1911
*/1912
WL_SHM_FORMAT_XBGR16161616 = 0x38344258,1913
/**1914
* [63:0] A:R:G:B 16:16:16:16 little endian1915
*/1916
WL_SHM_FORMAT_ARGB16161616 = 0x38345241,1917
/**1918
* [63:0] A:B:G:R 16:16:16:16 little endian1919
*/1920
WL_SHM_FORMAT_ABGR16161616 = 0x38344241,1921
/**1922
* [7:0] C0:C1:C2:C3:C4:C5:C6:C7 1:1:1:1:1:1:1:1 eight pixels/byte1923
*/1924
WL_SHM_FORMAT_C1 = 0x20203143,1925
/**1926
* [7:0] C0:C1:C2:C3 2:2:2:2 four pixels/byte1927
*/1928
WL_SHM_FORMAT_C2 = 0x20203243,1929
/**1930
* [7:0] C0:C1 4:4 two pixels/byte1931
*/1932
WL_SHM_FORMAT_C4 = 0x20203443,1933
/**1934
* [7:0] D0:D1:D2:D3:D4:D5:D6:D7 1:1:1:1:1:1:1:1 eight pixels/byte1935
*/1936
WL_SHM_FORMAT_D1 = 0x20203144,1937
/**1938
* [7:0] D0:D1:D2:D3 2:2:2:2 four pixels/byte1939
*/1940
WL_SHM_FORMAT_D2 = 0x20203244,1941
/**1942
* [7:0] D0:D1 4:4 two pixels/byte1943
*/1944
WL_SHM_FORMAT_D4 = 0x20203444,1945
/**1946
* [7:0] D1947
*/1948
WL_SHM_FORMAT_D8 = 0x20203844,1949
/**1950
* [7:0] R0:R1:R2:R3:R4:R5:R6:R7 1:1:1:1:1:1:1:1 eight pixels/byte1951
*/1952
WL_SHM_FORMAT_R1 = 0x20203152,1953
/**1954
* [7:0] R0:R1:R2:R3 2:2:2:2 four pixels/byte1955
*/1956
WL_SHM_FORMAT_R2 = 0x20203252,1957
/**1958
* [7:0] R0:R1 4:4 two pixels/byte1959
*/1960
WL_SHM_FORMAT_R4 = 0x20203452,1961
/**1962
* [15:0] x:R 6:10 little endian1963
*/1964
WL_SHM_FORMAT_R10 = 0x20303152,1965
/**1966
* [15:0] x:R 4:12 little endian1967
*/1968
WL_SHM_FORMAT_R12 = 0x20323152,1969
/**1970
* [31:0] A:Cr:Cb:Y 8:8:8:8 little endian1971
*/1972
WL_SHM_FORMAT_AVUY8888 = 0x59555641,1973
/**1974
* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian1975
*/1976
WL_SHM_FORMAT_XVUY8888 = 0x59555658,1977
/**1978
* 2x2 subsampled Cr:Cb plane 10 bits per channel packed1979
*/1980
WL_SHM_FORMAT_P030 = 0x30333050,1981
};1982
#endif /* WL_SHM_FORMAT_ENUM */1984
/**1985
* @ingroup iface_wl_shm1986
* @struct wl_shm_listener1987
*/1988
struct wl_shm_listener {1989
/**1990
* pixel format description1991
*1992
* Informs the client about a valid pixel format that can be used1993
* for buffers. Known formats include argb8888 and xrgb8888.1994
* @param format buffer pixel format1995
*/1996
void (*format)(void *data,1997
struct wl_shm *wl_shm,1998
uint32_t format);1999
};2001
/**2002
* @ingroup iface_wl_shm2003
*/2004
static inline int2005
wl_shm_add_listener(struct wl_shm *wl_shm,2006
const struct wl_shm_listener *listener, void *data)2007
{2008
return wl_proxy_add_listener((struct wl_proxy *) wl_shm,2009
(void (**)(void)) listener, data);2010
}2012
#define WL_SHM_CREATE_POOL 02013
#define WL_SHM_RELEASE 12015
/**2016
* @ingroup iface_wl_shm2017
*/2018
#define WL_SHM_FORMAT_SINCE_VERSION 12020
/**2021
* @ingroup iface_wl_shm2022
*/2023
#define WL_SHM_CREATE_POOL_SINCE_VERSION 12024
/**2025
* @ingroup iface_wl_shm2026
*/2027
#define WL_SHM_RELEASE_SINCE_VERSION 22029
/** @ingroup iface_wl_shm */2030
static inline void2031
wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)2032
{2033
wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);2034
}2036
/** @ingroup iface_wl_shm */2037
static inline void *2038
wl_shm_get_user_data(struct wl_shm *wl_shm)2039
{2040
return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);2041
}2043
static inline uint32_t2044
wl_shm_get_version(struct wl_shm *wl_shm)2045
{2046
return wl_proxy_get_version((struct wl_proxy *) wl_shm);2047
}2049
/** @ingroup iface_wl_shm */2050
static inline void2051
wl_shm_destroy(struct wl_shm *wl_shm)2052
{2053
wl_proxy_destroy((struct wl_proxy *) wl_shm);2054
}2056
/**2057
* @ingroup iface_wl_shm2058
*2059
* Create a new wl_shm_pool object.2060
*2061
* The pool can be used to create shared memory based buffer2062
* objects. The server will mmap size bytes of the passed file2063
* descriptor, to use as backing memory for the pool.2064
*/2065
static inline struct wl_shm_pool *2066
wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)2067
{2068
struct wl_proxy *id;2070
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,2071
WL_SHM_CREATE_POOL, &wl_shm_pool_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm), 0, NULL, fd, size);2073
return (struct wl_shm_pool *) id;2074
}2076
/**2077
* @ingroup iface_wl_shm2078
*2079
* Using this request a client can tell the server that it is not going to2080
* use the shm object anymore.2081
*2082
* Objects created via this interface remain unaffected.2083
*/2084
static inline void2085
wl_shm_release(struct wl_shm *wl_shm)2086
{2087
wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,2088
WL_SHM_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm), WL_MARSHAL_FLAG_DESTROY);2089
}2091
/**2092
* @ingroup iface_wl_buffer2093
* @struct wl_buffer_listener2094
*/2095
struct wl_buffer_listener {2096
/**2097
* compositor releases buffer2098
*2099
* Sent when this wl_buffer is no longer used by the compositor.2100
*2101
* For more information on when release events may or may not be2102
* sent, and what consequences it has, please see the description2103
* of wl_surface.attach.2104
*2105
* If a client receives a release event before the frame callback2106
* requested in the same wl_surface.commit that attaches this2107
* wl_buffer to a surface, then the client is immediately free to2108
* reuse the buffer and its backing storage, and does not need a2109
* second buffer for the next surface content update. Typically2110
* this is possible, when the compositor maintains a copy of the2111
* wl_surface contents, e.g. as a GL texture. This is an important2112
* optimization for GL(ES) compositors with wl_shm clients.2113
*/2114
void (*release)(void *data,2115
struct wl_buffer *wl_buffer);2116
};2118
/**2119
* @ingroup iface_wl_buffer2120
*/2121
static inline int2122
wl_buffer_add_listener(struct wl_buffer *wl_buffer,2123
const struct wl_buffer_listener *listener, void *data)2124
{2125
return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,2126
(void (**)(void)) listener, data);2127
}2129
#define WL_BUFFER_DESTROY 02131
/**2132
* @ingroup iface_wl_buffer2133
*/2134
#define WL_BUFFER_RELEASE_SINCE_VERSION 12136
/**2137
* @ingroup iface_wl_buffer2138
*/2139
#define WL_BUFFER_DESTROY_SINCE_VERSION 12141
/** @ingroup iface_wl_buffer */2142
static inline void2143
wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)2144
{2145
wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);2146
}2148
/** @ingroup iface_wl_buffer */2149
static inline void *2150
wl_buffer_get_user_data(struct wl_buffer *wl_buffer)2151
{2152
return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);2153
}2155
static inline uint32_t2156
wl_buffer_get_version(struct wl_buffer *wl_buffer)2157
{2158
return wl_proxy_get_version((struct wl_proxy *) wl_buffer);2159
}2161
/**2162
* @ingroup iface_wl_buffer2163
*2164
* Destroy a buffer. If and how you need to release the backing2165
* storage is defined by the buffer factory interface.2166
*2167
* For possible side-effects to a surface, see wl_surface.attach.2168
*/2169
static inline void2170
wl_buffer_destroy(struct wl_buffer *wl_buffer)2171
{2172
wl_proxy_marshal_flags((struct wl_proxy *) wl_buffer,2173
WL_BUFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_buffer), WL_MARSHAL_FLAG_DESTROY);2174
}2176
#ifndef WL_DATA_OFFER_ERROR_ENUM2177
#define WL_DATA_OFFER_ERROR_ENUM2178
enum wl_data_offer_error {2179
/**2180
* finish request was called untimely2181
*/2182
WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,2183
/**2184
* action mask contains invalid values2185
*/2186
WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,2187
/**2188
* action argument has an invalid value2189
*/2190
WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,2191
/**2192
* offer doesn't accept this request2193
*/2194
WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,2195
};2196
#endif /* WL_DATA_OFFER_ERROR_ENUM */2198
/**2199
* @ingroup iface_wl_data_offer2200
* @struct wl_data_offer_listener2201
*/2202
struct wl_data_offer_listener {2203
/**2204
* advertise offered mime type2205
*2206
* Sent immediately after creating the wl_data_offer object. One2207
* event per offered mime type.2208
* @param mime_type offered mime type2209
*/2210
void (*offer)(void *data,2211
struct wl_data_offer *wl_data_offer,2212
const char *mime_type);2213
/**2214
* notify the source-side available actions2215
*2216
* This event indicates the actions offered by the data source.2217
* It will be sent immediately after creating the wl_data_offer2218
* object, or anytime the source side changes its offered actions2219
* through wl_data_source.set_actions.2220
* @param source_actions actions offered by the data source2221
* @since 32222
*/2223
void (*source_actions)(void *data,2224
struct wl_data_offer *wl_data_offer,2225
uint32_t source_actions);2226
/**2227
* notify the selected action2228
*2229
* This event indicates the action selected by the compositor2230
* after matching the source/destination side actions. Only one2231
* action (or none) will be offered here.2232
*2233
* This event can be emitted multiple times during the2234
* drag-and-drop operation in response to destination side action2235
* changes through wl_data_offer.set_actions.2236
*2237
* This event will no longer be emitted after wl_data_device.drop2238
* happened on the drag-and-drop destination, the client must honor2239
* the last action received, or the last preferred one set through2240
* wl_data_offer.set_actions when handling an "ask" action.2241
*2242
* Compositors may also change the selected action on the fly,2243
* mainly in response to keyboard modifier changes during the2244
* drag-and-drop operation.2245
*2246
* The most recent action received is always the valid one. Prior2247
* to receiving wl_data_device.drop, the chosen action may change2248
* (e.g. due to keyboard modifiers being pressed). At the time of2249
* receiving wl_data_device.drop the drag-and-drop destination must2250
* honor the last action received.2251
*2252
* Action changes may still happen after wl_data_device.drop,2253
* especially on "ask" actions, where the drag-and-drop destination2254
* may choose another action afterwards. Action changes happening2255
* at this stage are always the result of inter-client negotiation,2256
* the compositor shall no longer be able to induce a different2257
* action.2258
*2259
* Upon "ask" actions, it is expected that the drag-and-drop2260
* destination may potentially choose a different action and/or2261
* mime type, based on wl_data_offer.source_actions and finally2262
* chosen by the user (e.g. popping up a menu with the available2263
* options). The final wl_data_offer.set_actions and2264
* wl_data_offer.accept requests must happen before the call to2265
* wl_data_offer.finish.2266
* @param dnd_action action selected by the compositor2267
* @since 32268
*/2269
void (*action)(void *data,2270
struct wl_data_offer *wl_data_offer,2271
uint32_t dnd_action);2272
};2274
/**2275
* @ingroup iface_wl_data_offer2276
*/2277
static inline int2278
wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,2279
const struct wl_data_offer_listener *listener, void *data)2280
{2281
return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,2282
(void (**)(void)) listener, data);2283
}2285
#define WL_DATA_OFFER_ACCEPT 02286
#define WL_DATA_OFFER_RECEIVE 12287
#define WL_DATA_OFFER_DESTROY 22288
#define WL_DATA_OFFER_FINISH 32289
#define WL_DATA_OFFER_SET_ACTIONS 42291
/**2292
* @ingroup iface_wl_data_offer2293
*/2294
#define WL_DATA_OFFER_OFFER_SINCE_VERSION 12295
/**2296
* @ingroup iface_wl_data_offer2297
*/2298
#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 32299
/**2300
* @ingroup iface_wl_data_offer2301
*/2302
#define WL_DATA_OFFER_ACTION_SINCE_VERSION 32304
/**2305
* @ingroup iface_wl_data_offer2306
*/2307
#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 12308
/**2309
* @ingroup iface_wl_data_offer2310
*/2311
#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 12312
/**2313
* @ingroup iface_wl_data_offer2314
*/2315
#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 12316
/**2317
* @ingroup iface_wl_data_offer2318
*/2319
#define WL_DATA_OFFER_FINISH_SINCE_VERSION 32320
/**2321
* @ingroup iface_wl_data_offer2322
*/2323
#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 32325
/** @ingroup iface_wl_data_offer */2326
static inline void2327
wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data)2328
{2329
wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);2330
}2332
/** @ingroup iface_wl_data_offer */2333
static inline void *2334
wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)2335
{2336
return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);2337
}2339
static inline uint32_t2340
wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)2341
{2342
return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);2343
}2345
/**2346
* @ingroup iface_wl_data_offer2347
*2348
* Indicate that the client can accept the given mime type, or2349
* NULL for not accepted.2350
*2351
* For objects of version 2 or older, this request is used by the2352
* client to give feedback whether the client can receive the given2353
* mime type, or NULL if none is accepted; the feedback does not2354
* determine whether the drag-and-drop operation succeeds or not.2355
*2356
* For objects of version 3 or newer, this request determines the2357
* final result of the drag-and-drop operation. If the end result2358
* is that no mime types were accepted, the drag-and-drop operation2359
* will be cancelled and the corresponding drag source will receive2360
* wl_data_source.cancelled. Clients may still use this event in2361
* conjunction with wl_data_source.action for feedback.2362
*/2363
static inline void2364
wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)2365
{2366
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2367
WL_DATA_OFFER_ACCEPT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, serial, mime_type);2368
}2370
/**2371
* @ingroup iface_wl_data_offer2372
*2373
* To transfer the offered data, the client issues this request2374
* and indicates the mime type it wants to receive. The transfer2375
* happens through the passed file descriptor (typically created2376
* with the pipe system call). The source client writes the data2377
* in the mime type representation requested and then closes the2378
* file descriptor.2379
*2380
* The receiving client reads from the read end of the pipe until2381
* EOF and then closes its end, at which point the transfer is2382
* complete.2383
*2384
* This request may happen multiple times for different mime types,2385
* both before and after wl_data_device.drop. Drag-and-drop destination2386
* clients may preemptively fetch data or examine it more closely to2387
* determine acceptance.2388
*/2389
static inline void2390
wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd)2391
{2392
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2393
WL_DATA_OFFER_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, mime_type, fd);2394
}2396
/**2397
* @ingroup iface_wl_data_offer2398
*2399
* Destroy the data offer.2400
*/2401
static inline void2402
wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)2403
{2404
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2405
WL_DATA_OFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), WL_MARSHAL_FLAG_DESTROY);2406
}2408
/**2409
* @ingroup iface_wl_data_offer2410
*2411
* Notifies the compositor that the drag destination successfully2412
* finished the drag-and-drop operation.2413
*2414
* Upon receiving this request, the compositor will emit2415
* wl_data_source.dnd_finished on the drag source client.2416
*2417
* It is a client error to perform other requests than2418
* wl_data_offer.destroy after this one. It is also an error to perform2419
* this request after a NULL mime type has been set in2420
* wl_data_offer.accept or no action was received through2421
* wl_data_offer.action.2422
*2423
* If wl_data_offer.finish request is received for a non drag and drop2424
* operation, the invalid_finish protocol error is raised.2425
*/2426
static inline void2427
wl_data_offer_finish(struct wl_data_offer *wl_data_offer)2428
{2429
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2430
WL_DATA_OFFER_FINISH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0);2431
}2433
/**2434
* @ingroup iface_wl_data_offer2435
*2436
* Sets the actions that the destination side client supports for2437
* this operation. This request may trigger the emission of2438
* wl_data_source.action and wl_data_offer.action events if the compositor2439
* needs to change the selected action.2440
*2441
* This request can be called multiple times throughout the2442
* drag-and-drop operation, typically in response to wl_data_device.enter2443
* or wl_data_device.motion events.2444
*2445
* This request determines the final result of the drag-and-drop2446
* operation. If the end result is that no action is accepted,2447
* the drag source will receive wl_data_source.cancelled.2448
*2449
* The dnd_actions argument must contain only values expressed in the2450
* wl_data_device_manager.dnd_actions enum, and the preferred_action2451
* argument must only contain one of those values set, otherwise it2452
* will result in a protocol error.2453
*2454
* While managing an "ask" action, the destination drag-and-drop client2455
* may perform further wl_data_offer.receive requests, and is expected2456
* to perform one last wl_data_offer.set_actions request with a preferred2457
* action other than "ask" (and optionally wl_data_offer.accept) before2458
* requesting wl_data_offer.finish, in order to convey the action selected2459
* by the user. If the preferred action is not in the2460
* wl_data_offer.source_actions mask, an error will be raised.2461
*2462
* If the "ask" action is dismissed (e.g. user cancellation), the client2463
* is expected to perform wl_data_offer.destroy right away.2464
*2465
* This request can only be made on drag-and-drop offers, a protocol error2466
* will be raised otherwise.2467
*/2468
static inline void2469
wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action)2470
{2471
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2472
WL_DATA_OFFER_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, dnd_actions, preferred_action);2473
}2475
#ifndef WL_DATA_SOURCE_ERROR_ENUM2476
#define WL_DATA_SOURCE_ERROR_ENUM2477
enum wl_data_source_error {2478
/**2479
* action mask contains invalid values2480
*/2481
WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,2482
/**2483
* source doesn't accept this request2484
*/2485
WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,2486
};2487
#endif /* WL_DATA_SOURCE_ERROR_ENUM */2489
/**2490
* @ingroup iface_wl_data_source2491
* @struct wl_data_source_listener2492
*/2493
struct wl_data_source_listener {2494
/**2495
* a target accepts an offered mime type2496
*2497
* Sent when a target accepts pointer_focus or motion events. If2498
* a target does not accept any of the offered types, type is NULL.2499
*2500
* Used for feedback during drag-and-drop.2501
* @param mime_type mime type accepted by the target2502
*/2503
void (*target)(void *data,2504
struct wl_data_source *wl_data_source,2505
const char *mime_type);2506
/**2507
* send the data2508
*2509
* Request for data from the client. Send the data as the2510
* specified mime type over the passed file descriptor, then close2511
* it.2512
* @param mime_type mime type for the data2513
* @param fd file descriptor for the data2514
*/2515
void (*send)(void *data,2516
struct wl_data_source *wl_data_source,2517
const char *mime_type,2518
int32_t fd);2519
/**2520
* selection was cancelled2521
*2522
* This data source is no longer valid. There are several reasons2523
* why this could happen:2524
*2525
* - The data source has been replaced by another data source. -2526
* The drag-and-drop operation was performed, but the drop2527
* destination did not accept any of the mime types offered through2528
* wl_data_source.target. - The drag-and-drop operation was2529
* performed, but the drop destination did not select any of the2530
* actions present in the mask offered through2531
* wl_data_source.action. - The drag-and-drop operation was2532
* performed but didn't happen over a surface. - The compositor2533
* cancelled the drag-and-drop operation (e.g. compositor dependent2534
* timeouts to avoid stale drag-and-drop transfers).2535
*2536
* The client should clean up and destroy this data source.2537
*2538
* For objects of version 2 or older, wl_data_source.cancelled will2539
* only be emitted if the data source was replaced by another data2540
* source.2541
*/2542
void (*cancelled)(void *data,2543
struct wl_data_source *wl_data_source);2544
/**2545
* the drag-and-drop operation physically finished2546
*2547
* The user performed the drop action. This event does not2548
* indicate acceptance, wl_data_source.cancelled may still be2549
* emitted afterwards if the drop destination does not accept any2550
* mime type.2551
*2552
* However, this event might however not be received if the2553
* compositor cancelled the drag-and-drop operation before this2554
* event could happen.2555
*2556
* Note that the data_source may still be used in the future and2557
* should not be destroyed here.2558
* @since 32559
*/2560
void (*dnd_drop_performed)(void *data,2561
struct wl_data_source *wl_data_source);2562
/**2563
* the drag-and-drop operation concluded2564
*2565
* The drop destination finished interoperating with this data2566
* source, so the client is now free to destroy this data source2567
* and free all associated data.2568
*2569
* If the action used to perform the operation was "move", the2570
* source can now delete the transferred data.2571
* @since 32572
*/2573
void (*dnd_finished)(void *data,2574
struct wl_data_source *wl_data_source);2575
/**2576
* notify the selected action2577
*2578
* This event indicates the action selected by the compositor2579
* after matching the source/destination side actions. Only one2580
* action (or none) will be offered here.2581
*2582
* This event can be emitted multiple times during the2583
* drag-and-drop operation, mainly in response to destination side2584
* changes through wl_data_offer.set_actions, and as the data2585
* device enters/leaves surfaces.2586
*2587
* It is only possible to receive this event after2588
* wl_data_source.dnd_drop_performed if the drag-and-drop operation2589
* ended in an "ask" action, in which case the final2590
* wl_data_source.action event will happen immediately before2591
* wl_data_source.dnd_finished.2592
*2593
* Compositors may also change the selected action on the fly,2594
* mainly in response to keyboard modifier changes during the2595
* drag-and-drop operation.2596
*2597
* The most recent action received is always the valid one. The2598
* chosen action may change alongside negotiation (e.g. an "ask"2599
* action can turn into a "move" operation), so the effects of the2600
* final action must always be applied in2601
* wl_data_offer.dnd_finished.2602
*2603
* Clients can trigger cursor surface changes from this point, so2604
* they reflect the current action.2605
* @param dnd_action action selected by the compositor2606
* @since 32607
*/2608
void (*action)(void *data,2609
struct wl_data_source *wl_data_source,2610
uint32_t dnd_action);2611
};2613
/**2614
* @ingroup iface_wl_data_source2615
*/2616
static inline int2617
wl_data_source_add_listener(struct wl_data_source *wl_data_source,2618
const struct wl_data_source_listener *listener, void *data)2619
{2620
return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,2621
(void (**)(void)) listener, data);2622
}2624
#define WL_DATA_SOURCE_OFFER 02625
#define WL_DATA_SOURCE_DESTROY 12626
#define WL_DATA_SOURCE_SET_ACTIONS 22628
/**2629
* @ingroup iface_wl_data_source2630
*/2631
#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 12632
/**2633
* @ingroup iface_wl_data_source2634
*/2635
#define WL_DATA_SOURCE_SEND_SINCE_VERSION 12636
/**2637
* @ingroup iface_wl_data_source2638
*/2639
#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 12640
/**2641
* @ingroup iface_wl_data_source2642
*/2643
#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 32644
/**2645
* @ingroup iface_wl_data_source2646
*/2647
#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 32648
/**2649
* @ingroup iface_wl_data_source2650
*/2651
#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 32653
/**2654
* @ingroup iface_wl_data_source2655
*/2656
#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 12657
/**2658
* @ingroup iface_wl_data_source2659
*/2660
#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 12661
/**2662
* @ingroup iface_wl_data_source2663
*/2664
#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 32666
/** @ingroup iface_wl_data_source */2667
static inline void2668
wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data)2669
{2670
wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);2671
}2673
/** @ingroup iface_wl_data_source */2674
static inline void *2675
wl_data_source_get_user_data(struct wl_data_source *wl_data_source)2676
{2677
return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);2678
}2680
static inline uint32_t2681
wl_data_source_get_version(struct wl_data_source *wl_data_source)2682
{2683
return wl_proxy_get_version((struct wl_proxy *) wl_data_source);2684
}2686
/**2687
* @ingroup iface_wl_data_source2688
*2689
* This request adds a mime type to the set of mime types2690
* advertised to targets. Can be called several times to offer2691
* multiple types.2692
*/2693
static inline void2694
wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type)2695
{2696
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2697
WL_DATA_SOURCE_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, mime_type);2698
}2700
/**2701
* @ingroup iface_wl_data_source2702
*2703
* Destroy the data source.2704
*/2705
static inline void2706
wl_data_source_destroy(struct wl_data_source *wl_data_source)2707
{2708
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2709
WL_DATA_SOURCE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), WL_MARSHAL_FLAG_DESTROY);2710
}2712
/**2713
* @ingroup iface_wl_data_source2714
*2715
* Sets the actions that the source side client supports for this2716
* operation. This request may trigger wl_data_source.action and2717
* wl_data_offer.action events if the compositor needs to change the2718
* selected action.2719
*2720
* The dnd_actions argument must contain only values expressed in the2721
* wl_data_device_manager.dnd_actions enum, otherwise it will result2722
* in a protocol error.2723
*2724
* This request must be made once only, and can only be made on sources2725
* used in drag-and-drop, so it must be performed before2726
* wl_data_device.start_drag. Attempting to use the source other than2727
* for drag-and-drop will raise a protocol error.2728
*/2729
static inline void2730
wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_actions)2731
{2732
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2733
WL_DATA_SOURCE_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, dnd_actions);2734
}2736
#ifndef WL_DATA_DEVICE_ERROR_ENUM2737
#define WL_DATA_DEVICE_ERROR_ENUM2738
enum wl_data_device_error {2739
/**2740
* given wl_surface has another role2741
*/2742
WL_DATA_DEVICE_ERROR_ROLE = 0,2743
/**2744
* source has already been used2745
*/2746
WL_DATA_DEVICE_ERROR_USED_SOURCE = 1,2747
};2748
#endif /* WL_DATA_DEVICE_ERROR_ENUM */2750
/**2751
* @ingroup iface_wl_data_device2752
* @struct wl_data_device_listener2753
*/2754
struct wl_data_device_listener {2755
/**2756
* introduce a new wl_data_offer2757
*2758
* The data_offer event introduces a new wl_data_offer object,2759
* which will subsequently be used in either the data_device.enter2760
* event (for drag-and-drop) or the data_device.selection event2761
* (for selections). Immediately following the2762
* data_device.data_offer event, the new data_offer object will2763
* send out data_offer.offer events to describe the mime types it2764
* offers.2765
* @param id the new data_offer object2766
*/2767
void (*data_offer)(void *data,2768
struct wl_data_device *wl_data_device,2769
struct wl_data_offer *id);2770
/**2771
* initiate drag-and-drop session2772
*2773
* This event is sent when an active drag-and-drop pointer enters2774
* a surface owned by the client. The position of the pointer at2775
* enter time is provided by the x and y arguments, in2776
* surface-local coordinates.2777
* @param serial serial number of the enter event2778
* @param surface client surface entered2779
* @param x surface-local x coordinate2780
* @param y surface-local y coordinate2781
* @param id source data_offer object2782
*/2783
void (*enter)(void *data,2784
struct wl_data_device *wl_data_device,2785
uint32_t serial,2786
struct wl_surface *surface,2787
wl_fixed_t x,2788
wl_fixed_t y,2789
struct wl_data_offer *id);2790
/**2791
* end drag-and-drop session2792
*2793
* This event is sent when the drag-and-drop pointer leaves the2794
* surface and the session ends. The client must destroy the2795
* wl_data_offer introduced at enter time at this point.2796
*/2797
void (*leave)(void *data,2798
struct wl_data_device *wl_data_device);2799
/**2800
* drag-and-drop session motion2801
*2802
* This event is sent when the drag-and-drop pointer moves within2803
* the currently focused surface. The new position of the pointer2804
* is provided by the x and y arguments, in surface-local2805
* coordinates.2806
* @param time timestamp with millisecond granularity2807
* @param x surface-local x coordinate2808
* @param y surface-local y coordinate2809
*/2810
void (*motion)(void *data,2811
struct wl_data_device *wl_data_device,2812
uint32_t time,2813
wl_fixed_t x,2814
wl_fixed_t y);2815
/**2816
* end drag-and-drop session successfully2817
*2818
* The event is sent when a drag-and-drop operation is ended2819
* because the implicit grab is removed.2820
*2821
* The drag-and-drop destination is expected to honor the last2822
* action received through wl_data_offer.action, if the resulting2823
* action is "copy" or "move", the destination can still perform2824
* wl_data_offer.receive requests, and is expected to end all2825
* transfers with a wl_data_offer.finish request.2826
*2827
* If the resulting action is "ask", the action will not be2828
* considered final. The drag-and-drop destination is expected to2829
* perform one last wl_data_offer.set_actions request, or2830
* wl_data_offer.destroy in order to cancel the operation.2831
*/2832
void (*drop)(void *data,2833
struct wl_data_device *wl_data_device);2834
/**2835
* advertise new selection2836
*2837
* The selection event is sent out to notify the client of a new2838
* wl_data_offer for the selection for this device. The2839
* data_device.data_offer and the data_offer.offer events are sent2840
* out immediately before this event to introduce the data offer2841
* object. The selection event is sent to a client immediately2842
* before receiving keyboard focus and when a new selection is set2843
* while the client has keyboard focus. The data_offer is valid2844
* until a new data_offer or NULL is received or until the client2845
* loses keyboard focus. Switching surface with keyboard focus2846
* within the same client doesn't mean a new selection will be2847
* sent. The client must destroy the previous selection data_offer,2848
* if any, upon receiving this event.2849
* @param id selection data_offer object2850
*/2851
void (*selection)(void *data,2852
struct wl_data_device *wl_data_device,2853
struct wl_data_offer *id);2854
};2856
/**2857
* @ingroup iface_wl_data_device2858
*/2859
static inline int2860
wl_data_device_add_listener(struct wl_data_device *wl_data_device,2861
const struct wl_data_device_listener *listener, void *data)2862
{2863
return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,2864
(void (**)(void)) listener, data);2865
}2867
#define WL_DATA_DEVICE_START_DRAG 02868
#define WL_DATA_DEVICE_SET_SELECTION 12869
#define WL_DATA_DEVICE_RELEASE 22871
/**2872
* @ingroup iface_wl_data_device2873
*/2874
#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 12875
/**2876
* @ingroup iface_wl_data_device2877
*/2878
#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 12879
/**2880
* @ingroup iface_wl_data_device2881
*/2882
#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 12883
/**2884
* @ingroup iface_wl_data_device2885
*/2886
#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 12887
/**2888
* @ingroup iface_wl_data_device2889
*/2890
#define WL_DATA_DEVICE_DROP_SINCE_VERSION 12891
/**2892
* @ingroup iface_wl_data_device2893
*/2894
#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 12896
/**2897
* @ingroup iface_wl_data_device2898
*/2899
#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 12900
/**2901
* @ingroup iface_wl_data_device2902
*/2903
#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 12904
/**2905
* @ingroup iface_wl_data_device2906
*/2907
#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 22909
/** @ingroup iface_wl_data_device */2910
static inline void2911
wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data)2912
{2913
wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);2914
}2916
/** @ingroup iface_wl_data_device */2917
static inline void *2918
wl_data_device_get_user_data(struct wl_data_device *wl_data_device)2919
{2920
return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);2921
}2923
static inline uint32_t2924
wl_data_device_get_version(struct wl_data_device *wl_data_device)2925
{2926
return wl_proxy_get_version((struct wl_proxy *) wl_data_device);2927
}2929
/** @ingroup iface_wl_data_device */2930
static inline void2931
wl_data_device_destroy(struct wl_data_device *wl_data_device)2932
{2933
wl_proxy_destroy((struct wl_proxy *) wl_data_device);2934
}2936
/**2937
* @ingroup iface_wl_data_device2938
*2939
* This request asks the compositor to start a drag-and-drop2940
* operation on behalf of the client.2941
*2942
* The source argument is the data source that provides the data2943
* for the eventual data transfer. If source is NULL, enter, leave2944
* and motion events are sent only to the client that initiated the2945
* drag and the client is expected to handle the data passing2946
* internally. If source is destroyed, the drag-and-drop session will be2947
* cancelled.2948
*2949
* The origin surface is the surface where the drag originates and2950
* the client must have an active implicit grab that matches the2951
* serial.2952
*2953
* The icon surface is an optional (can be NULL) surface that2954
* provides an icon to be moved around with the cursor. Initially,2955
* the top-left corner of the icon surface is placed at the cursor2956
* hotspot, but subsequent wl_surface.offset requests can move the2957
* relative position. Attach requests must be confirmed with2958
* wl_surface.commit as usual. The icon surface is given the role of2959
* a drag-and-drop icon. If the icon surface already has another role,2960
* it raises a protocol error.2961
*2962
* The input region is ignored for wl_surfaces with the role of a2963
* drag-and-drop icon.2964
*2965
* The given source may not be used in any further set_selection or2966
* start_drag requests. Attempting to reuse a previously-used source2967
* may send a used_source error.2968
*/2969
static inline void2970
wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial)2971
{2972
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,2973
WL_DATA_DEVICE_START_DRAG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, origin, icon, serial);2974
}2976
/**2977
* @ingroup iface_wl_data_device2978
*2979
* This request asks the compositor to set the selection2980
* to the data from the source on behalf of the client.2981
*2982
* To unset the selection, set the source to NULL.2983
*2984
* The given source may not be used in any further set_selection or2985
* start_drag requests. Attempting to reuse a previously-used source2986
* may send a used_source error.2987
*/2988
static inline void2989
wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial)2990
{2991
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,2992
WL_DATA_DEVICE_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, serial);2993
}2995
/**2996
* @ingroup iface_wl_data_device2997
*2998
* This request destroys the data device.2999
*/3000
static inline void3001
wl_data_device_release(struct wl_data_device *wl_data_device)3002
{3003
wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,3004
WL_DATA_DEVICE_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), WL_MARSHAL_FLAG_DESTROY);3005
}3007
#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM3008
#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM3009
/**3010
* @ingroup iface_wl_data_device_manager3011
* drag and drop actions3012
*3013
* This is a bitmask of the available/preferred actions in a3014
* drag-and-drop operation.3015
*3016
* In the compositor, the selected action is a result of matching the3017
* actions offered by the source and destination sides. "action" events3018
* with a "none" action will be sent to both source and destination if3019
* there is no match. All further checks will effectively happen on3020
* (source actions ∩ destination actions).3021
*3022
* In addition, compositors may also pick different actions in3023
* reaction to key modifiers being pressed. One common design that3024
* is used in major toolkits (and the behavior recommended for3025
* compositors) is:3026
*3027
* - If no modifiers are pressed, the first match (in bit order)3028
* will be used.3029
* - Pressing Shift selects "move", if enabled in the mask.3030
* - Pressing Control selects "copy", if enabled in the mask.3031
*3032
* Behavior beyond that is considered implementation-dependent.3033
* Compositors may for example bind other modifiers (like Alt/Meta)3034
* or drags initiated with other buttons than BTN_LEFT to specific3035
* actions (e.g. "ask").3036
*/3037
enum wl_data_device_manager_dnd_action {3038
/**3039
* no action3040
*/3041
WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,3042
/**3043
* copy action3044
*/3045
WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,3046
/**3047
* move action3048
*/3049
WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,3050
/**3051
* ask action3052
*/3053
WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,3054
};3055
#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */3057
#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 03058
#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 13061
/**3062
* @ingroup iface_wl_data_device_manager3063
*/3064
#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 13065
/**3066
* @ingroup iface_wl_data_device_manager3067
*/3068
#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 13070
/** @ingroup iface_wl_data_device_manager */3071
static inline void3072
wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data)3073
{3074
wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);3075
}3077
/** @ingroup iface_wl_data_device_manager */3078
static inline void *3079
wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager)3080
{3081
return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);3082
}3084
static inline uint32_t3085
wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager)3086
{3087
return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);3088
}3090
/** @ingroup iface_wl_data_device_manager */3091
static inline void3092
wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager)3093
{3094
wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);3095
}3097
/**3098
* @ingroup iface_wl_data_device_manager3099
*3100
* Create a new data source.3101
*/3102
static inline struct wl_data_source *3103
wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager)3104
{3105
struct wl_proxy *id;3107
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,3108
WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL);3110
return (struct wl_data_source *) id;3111
}3113
/**3114
* @ingroup iface_wl_data_device_manager3115
*3116
* Create a new data device for a given seat.3117
*/3118
static inline struct wl_data_device *3119
wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)3120
{3121
struct wl_proxy *id;3123
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,3124
WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL, seat);3126
return (struct wl_data_device *) id;3127
}3129
#ifndef WL_SHELL_ERROR_ENUM3130
#define WL_SHELL_ERROR_ENUM3131
enum wl_shell_error {3132
/**3133
* given wl_surface has another role3134
*/3135
WL_SHELL_ERROR_ROLE = 0,3136
};3137
#endif /* WL_SHELL_ERROR_ENUM */3139
#define WL_SHELL_GET_SHELL_SURFACE 03142
/**3143
* @ingroup iface_wl_shell3144
*/3145
#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 13147
/** @ingroup iface_wl_shell */3148
static inline void3149
wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)3150
{3151
wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);3152
}3154
/** @ingroup iface_wl_shell */3155
static inline void *3156
wl_shell_get_user_data(struct wl_shell *wl_shell)3157
{3158
return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);3159
}3161
static inline uint32_t3162
wl_shell_get_version(struct wl_shell *wl_shell)3163
{3164
return wl_proxy_get_version((struct wl_proxy *) wl_shell);3165
}3167
/** @ingroup iface_wl_shell */3168
static inline void3169
wl_shell_destroy(struct wl_shell *wl_shell)3170
{3171
wl_proxy_destroy((struct wl_proxy *) wl_shell);3172
}3174
/**3175
* @ingroup iface_wl_shell3176
*3177
* Create a shell surface for an existing surface. This gives3178
* the wl_surface the role of a shell surface. If the wl_surface3179
* already has another role, it raises a protocol error.3180
*3181
* Only one shell surface can be associated with a given surface.3182
*/3183
static inline struct wl_shell_surface *3184
wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)3185
{3186
struct wl_proxy *id;3188
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shell,3189
WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_shell), 0, NULL, surface);3191
return (struct wl_shell_surface *) id;3192
}3194
#ifndef WL_SHELL_SURFACE_RESIZE_ENUM3195
#define WL_SHELL_SURFACE_RESIZE_ENUM3196
/**3197
* @ingroup iface_wl_shell_surface3198
* edge values for resizing3199
*3200
* These values are used to indicate which edge of a surface3201
* is being dragged in a resize operation. The server may3202
* use this information to adapt its behavior, e.g. choose3203
* an appropriate cursor image.3204
*/3205
enum wl_shell_surface_resize {3206
/**3207
* no edge3208
*/3209
WL_SHELL_SURFACE_RESIZE_NONE = 0,3210
/**3211
* top edge3212
*/3213
WL_SHELL_SURFACE_RESIZE_TOP = 1,3214
/**3215
* bottom edge3216
*/3217
WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,3218
/**3219
* left edge3220
*/3221
WL_SHELL_SURFACE_RESIZE_LEFT = 4,3222
/**3223
* top and left edges3224
*/3225
WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,3226
/**3227
* bottom and left edges3228
*/3229
WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,3230
/**3231
* right edge3232
*/3233
WL_SHELL_SURFACE_RESIZE_RIGHT = 8,3234
/**3235
* top and right edges3236
*/3237
WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,3238
/**3239
* bottom and right edges3240
*/3241
WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,3242
};3243
#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */3245
#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM3246
#define WL_SHELL_SURFACE_TRANSIENT_ENUM3247
/**3248
* @ingroup iface_wl_shell_surface3249
* details of transient behaviour3250
*3251
* These flags specify details of the expected behaviour3252
* of transient surfaces. Used in the set_transient request.3253
*/3254
enum wl_shell_surface_transient {3255
/**3256
* do not set keyboard focus3257
*/3258
WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,3259
};3260
#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */3262
#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM3263
#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM3264
/**3265
* @ingroup iface_wl_shell_surface3266
* different method to set the surface fullscreen3267
*3268
* Hints to indicate to the compositor how to deal with a conflict3269
* between the dimensions of the surface and the dimensions of the3270
* output. The compositor is free to ignore this parameter.3271
*/3272
enum wl_shell_surface_fullscreen_method {3273
/**3274
* no preference, apply default policy3275
*/3276
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,3277
/**3278
* scale, preserve the surface's aspect ratio and center on output3279
*/3280
WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,3281
/**3282
* switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch3283
*/3284
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,3285
/**3286
* no upscaling, center on output and add black borders to compensate size mismatch3287
*/3288
WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,3289
};3290
#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */3292
/**3293
* @ingroup iface_wl_shell_surface3294
* @struct wl_shell_surface_listener3295
*/3296
struct wl_shell_surface_listener {3297
/**3298
* ping client3299
*3300
* Ping a client to check if it is receiving events and sending3301
* requests. A client is expected to reply with a pong request.3302
* @param serial serial number of the ping3303
*/3304
void (*ping)(void *data,3305
struct wl_shell_surface *wl_shell_surface,3306
uint32_t serial);3307
/**3308
* suggest resize3309
*3310
* The configure event asks the client to resize its surface.3311
*3312
* The size is a hint, in the sense that the client is free to3313
* ignore it if it doesn't resize, pick a smaller size (to satisfy3314
* aspect ratio or resize in steps of NxM pixels).3315
*3316
* The edges parameter provides a hint about how the surface was3317
* resized. The client may use this information to decide how to3318
* adjust its content to the new size (e.g. a scrolling area might3319
* adjust its content position to leave the viewable content3320
* unmoved).3321
*3322
* The client is free to dismiss all but the last configure event3323
* it received.3324
*3325
* The width and height arguments specify the size of the window in3326
* surface-local coordinates.3327
* @param edges how the surface was resized3328
* @param width new width of the surface3329
* @param height new height of the surface3330
*/3331
void (*configure)(void *data,3332
struct wl_shell_surface *wl_shell_surface,3333
uint32_t edges,3334
int32_t width,3335
int32_t height);3336
/**3337
* popup interaction is done3338
*3339
* The popup_done event is sent out when a popup grab is broken,3340
* that is, when the user clicks a surface that doesn't belong to3341
* the client owning the popup surface.3342
*/3343
void (*popup_done)(void *data,3344
struct wl_shell_surface *wl_shell_surface);3345
};3347
/**3348
* @ingroup iface_wl_shell_surface3349
*/3350
static inline int3351
wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface,3352
const struct wl_shell_surface_listener *listener, void *data)3353
{3354
return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,3355
(void (**)(void)) listener, data);3356
}3358
#define WL_SHELL_SURFACE_PONG 03359
#define WL_SHELL_SURFACE_MOVE 13360
#define WL_SHELL_SURFACE_RESIZE 23361
#define WL_SHELL_SURFACE_SET_TOPLEVEL 33362
#define WL_SHELL_SURFACE_SET_TRANSIENT 43363
#define WL_SHELL_SURFACE_SET_FULLSCREEN 53364
#define WL_SHELL_SURFACE_SET_POPUP 63365
#define WL_SHELL_SURFACE_SET_MAXIMIZED 73366
#define WL_SHELL_SURFACE_SET_TITLE 83367
#define WL_SHELL_SURFACE_SET_CLASS 93369
/**3370
* @ingroup iface_wl_shell_surface3371
*/3372
#define WL_SHELL_SURFACE_PING_SINCE_VERSION 13373
/**3374
* @ingroup iface_wl_shell_surface3375
*/3376
#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 13377
/**3378
* @ingroup iface_wl_shell_surface3379
*/3380
#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 13382
/**3383
* @ingroup iface_wl_shell_surface3384
*/3385
#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 13386
/**3387
* @ingroup iface_wl_shell_surface3388
*/3389
#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 13390
/**3391
* @ingroup iface_wl_shell_surface3392
*/3393
#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 13394
/**3395
* @ingroup iface_wl_shell_surface3396
*/3397
#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 13398
/**3399
* @ingroup iface_wl_shell_surface3400
*/3401
#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 13402
/**3403
* @ingroup iface_wl_shell_surface3404
*/3405
#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 13406
/**3407
* @ingroup iface_wl_shell_surface3408
*/3409
#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 13410
/**3411
* @ingroup iface_wl_shell_surface3412
*/3413
#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 13414
/**3415
* @ingroup iface_wl_shell_surface3416
*/3417
#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 13418
/**3419
* @ingroup iface_wl_shell_surface3420
*/3421
#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 13423
/** @ingroup iface_wl_shell_surface */3424
static inline void3425
wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)3426
{3427
wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);3428
}3430
/** @ingroup iface_wl_shell_surface */3431
static inline void *3432
wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)3433
{3434
return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);3435
}3437
static inline uint32_t3438
wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)3439
{3440
return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);3441
}3443
/** @ingroup iface_wl_shell_surface */3444
static inline void3445
wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)3446
{3447
wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);3448
}3450
/**3451
* @ingroup iface_wl_shell_surface3452
*3453
* A client must respond to a ping event with a pong request or3454
* the client may be deemed unresponsive.3455
*/3456
static inline void3457
wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)3458
{3459
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3460
WL_SHELL_SURFACE_PONG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, serial);3461
}3463
/**3464
* @ingroup iface_wl_shell_surface3465
*3466
* Start a pointer-driven move of the surface.3467
*3468
* This request must be used in response to a button press event.3469
* The server may ignore move requests depending on the state of3470
* the surface (e.g. fullscreen or maximized).3471
*/3472
static inline void3473
wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)3474
{3475
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3476
WL_SHELL_SURFACE_MOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial);3477
}3479
/**3480
* @ingroup iface_wl_shell_surface3481
*3482
* Start a pointer-driven resizing of the surface.3483
*3484
* This request must be used in response to a button press event.3485
* The server may ignore resize requests depending on the state of3486
* the surface (e.g. fullscreen or maximized).3487
*/3488
static inline void3489
wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)3490
{3491
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3492
WL_SHELL_SURFACE_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, edges);3493
}3495
/**3496
* @ingroup iface_wl_shell_surface3497
*3498
* Map the surface as a toplevel surface.3499
*3500
* A toplevel surface is not fullscreen, maximized or transient.3501
*/3502
static inline void3503
wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)3504
{3505
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3506
WL_SHELL_SURFACE_SET_TOPLEVEL, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0);3507
}3509
/**3510
* @ingroup iface_wl_shell_surface3511
*3512
* Map the surface relative to an existing surface.3513
*3514
* The x and y arguments specify the location of the upper left3515
* corner of the surface relative to the upper left corner of the3516
* parent surface, in surface-local coordinates.3517
*3518
* The flags argument controls details of the transient behaviour.3519
*/3520
static inline void3521
wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)3522
{3523
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3524
WL_SHELL_SURFACE_SET_TRANSIENT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, parent, x, y, flags);3525
}3527
/**3528
* @ingroup iface_wl_shell_surface3529
*3530
* Map the surface as a fullscreen surface.3531
*3532
* If an output parameter is given then the surface will be made3533
* fullscreen on that output. If the client does not specify the3534
* output then the compositor will apply its policy - usually3535
* choosing the output on which the surface has the biggest surface3536
* area.3537
*3538
* The client may specify a method to resolve a size conflict3539
* between the output size and the surface size - this is provided3540
* through the method parameter.3541
*3542
* The framerate parameter is used only when the method is set3543
* to "driver", to indicate the preferred framerate. A value of 03544
* indicates that the client does not care about framerate. The3545
* framerate is specified in mHz, that is framerate of 60000 is 60Hz.3546
*3547
* A method of "scale" or "driver" implies a scaling operation of3548
* the surface, either via a direct scaling operation or a change of3549
* the output mode. This will override any kind of output scaling, so3550
* that mapping a surface with a buffer size equal to the mode can3551
* fill the screen independent of buffer_scale.3552
*3553
* A method of "fill" means we don't scale up the buffer, however3554
* any output scale is applied. This means that you may run into3555
* an edge case where the application maps a buffer with the same3556
* size of the output mode but buffer_scale 1 (thus making a3557
* surface larger than the output). In this case it is allowed to3558
* downscale the results to fit the screen.3559
*3560
* The compositor must reply to this request with a configure event3561
* with the dimensions for the output on which the surface will3562
* be made fullscreen.3563
*/3564
static inline void3565
wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)3566
{3567
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3568
WL_SHELL_SURFACE_SET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, method, framerate, output);3569
}3571
/**3572
* @ingroup iface_wl_shell_surface3573
*3574
* Map the surface as a popup.3575
*3576
* A popup surface is a transient surface with an added pointer3577
* grab.3578
*3579
* An existing implicit grab will be changed to owner-events mode,3580
* and the popup grab will continue after the implicit grab ends3581
* (i.e. releasing the mouse button does not cause the popup to3582
* be unmapped).3583
*3584
* The popup grab continues until the window is destroyed or a3585
* mouse button is pressed in any other client's window. A click3586
* in any of the client's surfaces is reported as normal, however,3587
* clicks in other clients' surfaces will be discarded and trigger3588
* the callback.3589
*3590
* The x and y arguments specify the location of the upper left3591
* corner of the surface relative to the upper left corner of the3592
* parent surface, in surface-local coordinates.3593
*/3594
static inline void3595
wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)3596
{3597
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3598
WL_SHELL_SURFACE_SET_POPUP, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, parent, x, y, flags);3599
}3601
/**3602
* @ingroup iface_wl_shell_surface3603
*3604
* Map the surface as a maximized surface.3605
*3606
* If an output parameter is given then the surface will be3607
* maximized on that output. If the client does not specify the3608
* output then the compositor will apply its policy - usually3609
* choosing the output on which the surface has the biggest surface3610
* area.3611
*3612
* The compositor will reply with a configure event telling3613
* the expected new surface size. The operation is completed3614
* on the next buffer attach to this surface.3615
*3616
* A maximized surface typically fills the entire output it is3617
* bound to, except for desktop elements such as panels. This is3618
* the main difference between a maximized shell surface and a3619
* fullscreen shell surface.3620
*3621
* The details depend on the compositor implementation.3622
*/3623
static inline void3624
wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)3625
{3626
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3627
WL_SHELL_SURFACE_SET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, output);3628
}3630
/**3631
* @ingroup iface_wl_shell_surface3632
*3633
* Set a short title for the surface.3634
*3635
* This string may be used to identify the surface in a task bar,3636
* window list, or other user interface elements provided by the3637
* compositor.3638
*3639
* The string must be encoded in UTF-8.3640
*/3641
static inline void3642
wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)3643
{3644
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3645
WL_SHELL_SURFACE_SET_TITLE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, title);3646
}3648
/**3649
* @ingroup iface_wl_shell_surface3650
*3651
* Set a class for the surface.3652
*3653
* The surface class identifies the general class of applications3654
* to which the surface belongs. A common convention is to use the3655
* file name (or the full path if it is a non-standard location) of3656
* the application's .desktop file as the class.3657
*/3658
static inline void3659
wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)3660
{3661
wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3662
WL_SHELL_SURFACE_SET_CLASS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, class_);3663
}3665
#ifndef WL_SURFACE_ERROR_ENUM3666
#define WL_SURFACE_ERROR_ENUM3667
/**3668
* @ingroup iface_wl_surface3669
* wl_surface error values3670
*3671
* These errors can be emitted in response to wl_surface requests.3672
*/3673
enum wl_surface_error {3674
/**3675
* buffer scale value is invalid3676
*/3677
WL_SURFACE_ERROR_INVALID_SCALE = 0,3678
/**3679
* buffer transform value is invalid3680
*/3681
WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,3682
/**3683
* buffer size is invalid3684
*/3685
WL_SURFACE_ERROR_INVALID_SIZE = 2,3686
/**3687
* buffer offset is invalid3688
*/3689
WL_SURFACE_ERROR_INVALID_OFFSET = 3,3690
/**3691
* surface was destroyed before its role object3692
*/3693
WL_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT = 4,3694
};3695
#endif /* WL_SURFACE_ERROR_ENUM */3697
/**3698
* @ingroup iface_wl_surface3699
* @struct wl_surface_listener3700
*/3701
struct wl_surface_listener {3702
/**3703
* surface enters an output3704
*3705
* This is emitted whenever a surface's creation, movement, or3706
* resizing results in some part of it being within the scanout3707
* region of an output.3708
*3709
* Note that a surface may be overlapping with zero or more3710
* outputs.3711
* @param output output entered by the surface3712
*/3713
void (*enter)(void *data,3714
struct wl_surface *wl_surface,3715
struct wl_output *output);3716
/**3717
* surface leaves an output3718
*3719
* This is emitted whenever a surface's creation, movement, or3720
* resizing results in it no longer having any part of it within3721
* the scanout region of an output.3722
*3723
* Clients should not use the number of outputs the surface is on3724
* for frame throttling purposes. The surface might be hidden even3725
* if no leave event has been sent, and the compositor might expect3726
* new surface content updates even if no enter event has been3727
* sent. The frame event should be used instead.3728
* @param output output left by the surface3729
*/3730
void (*leave)(void *data,3731
struct wl_surface *wl_surface,3732
struct wl_output *output);3733
/**3734
* preferred buffer scale for the surface3735
*3736
* This event indicates the preferred buffer scale for this3737
* surface. It is sent whenever the compositor's preference3738
* changes.3739
*3740
* Before receiving this event the preferred buffer scale for this3741
* surface is 1.3742
*3743
* It is intended that scaling aware clients use this event to3744
* scale their content and use wl_surface.set_buffer_scale to3745
* indicate the scale they have rendered with. This allows clients3746
* to supply a higher detail buffer.3747
*3748
* The compositor shall emit a scale value greater than 0.3749
* @param factor preferred scaling factor3750
* @since 63751
*/3752
void (*preferred_buffer_scale)(void *data,3753
struct wl_surface *wl_surface,3754
int32_t factor);3755
/**3756
* preferred buffer transform for the surface3757
*3758
* This event indicates the preferred buffer transform for this3759
* surface. It is sent whenever the compositor's preference3760
* changes.3761
*3762
* Before receiving this event the preferred buffer transform for3763
* this surface is normal.3764
*3765
* Applying this transformation to the surface buffer contents and3766
* using wl_surface.set_buffer_transform might allow the compositor3767
* to use the surface buffer more efficiently.3768
* @param transform preferred transform3769
* @since 63770
*/3771
void (*preferred_buffer_transform)(void *data,3772
struct wl_surface *wl_surface,3773
uint32_t transform);3774
};3776
/**3777
* @ingroup iface_wl_surface3778
*/3779
static inline int3780
wl_surface_add_listener(struct wl_surface *wl_surface,3781
const struct wl_surface_listener *listener, void *data)3782
{3783
return wl_proxy_add_listener((struct wl_proxy *) wl_surface,3784
(void (**)(void)) listener, data);3785
}3787
#define WL_SURFACE_DESTROY 03788
#define WL_SURFACE_ATTACH 13789
#define WL_SURFACE_DAMAGE 23790
#define WL_SURFACE_FRAME 33791
#define WL_SURFACE_SET_OPAQUE_REGION 43792
#define WL_SURFACE_SET_INPUT_REGION 53793
#define WL_SURFACE_COMMIT 63794
#define WL_SURFACE_SET_BUFFER_TRANSFORM 73795
#define WL_SURFACE_SET_BUFFER_SCALE 83796
#define WL_SURFACE_DAMAGE_BUFFER 93797
#define WL_SURFACE_OFFSET 103799
/**3800
* @ingroup iface_wl_surface3801
*/3802
#define WL_SURFACE_ENTER_SINCE_VERSION 13803
/**3804
* @ingroup iface_wl_surface3805
*/3806
#define WL_SURFACE_LEAVE_SINCE_VERSION 13807
/**3808
* @ingroup iface_wl_surface3809
*/3810
#define WL_SURFACE_PREFERRED_BUFFER_SCALE_SINCE_VERSION 63811
/**3812
* @ingroup iface_wl_surface3813
*/3814
#define WL_SURFACE_PREFERRED_BUFFER_TRANSFORM_SINCE_VERSION 63816
/**3817
* @ingroup iface_wl_surface3818
*/3819
#define WL_SURFACE_DESTROY_SINCE_VERSION 13820
/**3821
* @ingroup iface_wl_surface3822
*/3823
#define WL_SURFACE_ATTACH_SINCE_VERSION 13824
/**3825
* @ingroup iface_wl_surface3826
*/3827
#define WL_SURFACE_DAMAGE_SINCE_VERSION 13828
/**3829
* @ingroup iface_wl_surface3830
*/3831
#define WL_SURFACE_FRAME_SINCE_VERSION 13832
/**3833
* @ingroup iface_wl_surface3834
*/3835
#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 13836
/**3837
* @ingroup iface_wl_surface3838
*/3839
#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 13840
/**3841
* @ingroup iface_wl_surface3842
*/3843
#define WL_SURFACE_COMMIT_SINCE_VERSION 13844
/**3845
* @ingroup iface_wl_surface3846
*/3847
#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 23848
/**3849
* @ingroup iface_wl_surface3850
*/3851
#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 33852
/**3853
* @ingroup iface_wl_surface3854
*/3855
#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 43856
/**3857
* @ingroup iface_wl_surface3858
*/3859
#define WL_SURFACE_OFFSET_SINCE_VERSION 53861
/** @ingroup iface_wl_surface */3862
static inline void3863
wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)3864
{3865
wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);3866
}3868
/** @ingroup iface_wl_surface */3869
static inline void *3870
wl_surface_get_user_data(struct wl_surface *wl_surface)3871
{3872
return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);3873
}3875
static inline uint32_t3876
wl_surface_get_version(struct wl_surface *wl_surface)3877
{3878
return wl_proxy_get_version((struct wl_proxy *) wl_surface);3879
}3881
/**3882
* @ingroup iface_wl_surface3883
*3884
* Deletes the surface and invalidates its object ID.3885
*/3886
static inline void3887
wl_surface_destroy(struct wl_surface *wl_surface)3888
{3889
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3890
WL_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), WL_MARSHAL_FLAG_DESTROY);3891
}3893
/**3894
* @ingroup iface_wl_surface3895
*3896
* Set a buffer as the content of this surface.3897
*3898
* The new size of the surface is calculated based on the buffer3899
* size transformed by the inverse buffer_transform and the3900
* inverse buffer_scale. This means that at commit time the supplied3901
* buffer size must be an integer multiple of the buffer_scale. If3902
* that's not the case, an invalid_size error is sent.3903
*3904
* The x and y arguments specify the location of the new pending3905
* buffer's upper left corner, relative to the current buffer's upper3906
* left corner, in surface-local coordinates. In other words, the3907
* x and y, combined with the new surface size define in which3908
* directions the surface's size changes. Setting anything other than 03909
* as x and y arguments is discouraged, and should instead be replaced3910
* with using the separate wl_surface.offset request.3911
*3912
* When the bound wl_surface version is 5 or higher, passing any3913
* non-zero x or y is a protocol violation, and will result in an3914
* 'invalid_offset' error being raised. The x and y arguments are ignored3915
* and do not change the pending state. To achieve equivalent semantics,3916
* use wl_surface.offset.3917
*3918
* Surface contents are double-buffered state, see wl_surface.commit.3919
*3920
* The initial surface contents are void; there is no content.3921
* wl_surface.attach assigns the given wl_buffer as the pending3922
* wl_buffer. wl_surface.commit makes the pending wl_buffer the new3923
* surface contents, and the size of the surface becomes the size3924
* calculated from the wl_buffer, as described above. After commit,3925
* there is no pending buffer until the next attach.3926
*3927
* Committing a pending wl_buffer allows the compositor to read the3928
* pixels in the wl_buffer. The compositor may access the pixels at3929
* any time after the wl_surface.commit request. When the compositor3930
* will not access the pixels anymore, it will send the3931
* wl_buffer.release event. Only after receiving wl_buffer.release,3932
* the client may reuse the wl_buffer. A wl_buffer that has been3933
* attached and then replaced by another attach instead of committed3934
* will not receive a release event, and is not used by the3935
* compositor.3936
*3937
* If a pending wl_buffer has been committed to more than one wl_surface,3938
* the delivery of wl_buffer.release events becomes undefined. A well3939
* behaved client should not rely on wl_buffer.release events in this3940
* case. Alternatively, a client could create multiple wl_buffer objects3941
* from the same backing storage or use a protocol extension providing3942
* per-commit release notifications.3943
*3944
* Destroying the wl_buffer after wl_buffer.release does not change3945
* the surface contents. Destroying the wl_buffer before wl_buffer.release3946
* is allowed as long as the underlying buffer storage isn't re-used (this3947
* can happen e.g. on client process termination). However, if the client3948
* destroys the wl_buffer before receiving the wl_buffer.release event and3949
* mutates the underlying buffer storage, the surface contents become3950
* undefined immediately.3951
*3952
* If wl_surface.attach is sent with a NULL wl_buffer, the3953
* following wl_surface.commit will remove the surface content.3954
*3955
* If a pending wl_buffer has been destroyed, the result is not specified.3956
* Many compositors are known to remove the surface content on the following3957
* wl_surface.commit, but this behaviour is not universal. Clients seeking to3958
* maximise compatibility should not destroy pending buffers and should3959
* ensure that they explicitly remove content from surfaces, even after3960
* destroying buffers.3961
*/3962
static inline void3963
wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)3964
{3965
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3966
WL_SURFACE_ATTACH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, buffer, x, y);3967
}3969
/**3970
* @ingroup iface_wl_surface3971
*3972
* This request is used to describe the regions where the pending3973
* buffer is different from the current surface contents, and where3974
* the surface therefore needs to be repainted. The compositor3975
* ignores the parts of the damage that fall outside of the surface.3976
*3977
* Damage is double-buffered state, see wl_surface.commit.3978
*3979
* The damage rectangle is specified in surface-local coordinates,3980
* where x and y specify the upper left corner of the damage rectangle.3981
*3982
* The initial value for pending damage is empty: no damage.3983
* wl_surface.damage adds pending damage: the new pending damage3984
* is the union of old pending damage and the given rectangle.3985
*3986
* wl_surface.commit assigns pending damage as the current damage,3987
* and clears pending damage. The server will clear the current3988
* damage as it repaints the surface.3989
*3990
* Note! New clients should not use this request. Instead damage can be3991
* posted with wl_surface.damage_buffer which uses buffer coordinates3992
* instead of surface coordinates.3993
*/3994
static inline void3995
wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)3996
{3997
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3998
WL_SURFACE_DAMAGE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);3999
}4001
/**4002
* @ingroup iface_wl_surface4003
*4004
* Request a notification when it is a good time to start drawing a new4005
* frame, by creating a frame callback. This is useful for throttling4006
* redrawing operations, and driving animations.4007
*4008
* When a client is animating on a wl_surface, it can use the 'frame'4009
* request to get notified when it is a good time to draw and commit the4010
* next frame of animation. If the client commits an update earlier than4011
* that, it is likely that some updates will not make it to the display,4012
* and the client is wasting resources by drawing too often.4013
*4014
* The frame request will take effect on the next wl_surface.commit.4015
* The notification will only be posted for one frame unless4016
* requested again. For a wl_surface, the notifications are posted in4017
* the order the frame requests were committed.4018
*4019
* The server must send the notifications so that a client4020
* will not send excessive updates, while still allowing4021
* the highest possible update rate for clients that wait for the reply4022
* before drawing again. The server should give some time for the client4023
* to draw and commit after sending the frame callback events to let it4024
* hit the next output refresh.4025
*4026
* A server should avoid signaling the frame callbacks if the4027
* surface is not visible in any way, e.g. the surface is off-screen,4028
* or completely obscured by other opaque surfaces.4029
*4030
* The object returned by this request will be destroyed by the4031
* compositor after the callback is fired and as such the client must not4032
* attempt to use it after that point.4033
*4034
* The callback_data passed in the callback is the current time, in4035
* milliseconds, with an undefined base.4036
*/4037
static inline struct wl_callback *4038
wl_surface_frame(struct wl_surface *wl_surface)4039
{4040
struct wl_proxy *callback;4042
callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4043
WL_SURFACE_FRAME, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, NULL);4045
return (struct wl_callback *) callback;4046
}4048
/**4049
* @ingroup iface_wl_surface4050
*4051
* This request sets the region of the surface that contains4052
* opaque content.4053
*4054
* The opaque region is an optimization hint for the compositor4055
* that lets it optimize the redrawing of content behind opaque4056
* regions. Setting an opaque region is not required for correct4057
* behaviour, but marking transparent content as opaque will result4058
* in repaint artifacts.4059
*4060
* The opaque region is specified in surface-local coordinates.4061
*4062
* The compositor ignores the parts of the opaque region that fall4063
* outside of the surface.4064
*4065
* Opaque region is double-buffered state, see wl_surface.commit.4066
*4067
* wl_surface.set_opaque_region changes the pending opaque region.4068
* wl_surface.commit copies the pending region to the current region.4069
* Otherwise, the pending and current regions are never changed.4070
*4071
* The initial value for an opaque region is empty. Setting the pending4072
* opaque region has copy semantics, and the wl_region object can be4073
* destroyed immediately. A NULL wl_region causes the pending opaque4074
* region to be set to empty.4075
*/4076
static inline void4077
wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)4078
{4079
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4080
WL_SURFACE_SET_OPAQUE_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);4081
}4083
/**4084
* @ingroup iface_wl_surface4085
*4086
* This request sets the region of the surface that can receive4087
* pointer and touch events.4088
*4089
* Input events happening outside of this region will try the next4090
* surface in the server surface stack. The compositor ignores the4091
* parts of the input region that fall outside of the surface.4092
*4093
* The input region is specified in surface-local coordinates.4094
*4095
* Input region is double-buffered state, see wl_surface.commit.4096
*4097
* wl_surface.set_input_region changes the pending input region.4098
* wl_surface.commit copies the pending region to the current region.4099
* Otherwise the pending and current regions are never changed,4100
* except cursor and icon surfaces are special cases, see4101
* wl_pointer.set_cursor and wl_data_device.start_drag.4102
*4103
* The initial value for an input region is infinite. That means the4104
* whole surface will accept input. Setting the pending input region4105
* has copy semantics, and the wl_region object can be destroyed4106
* immediately. A NULL wl_region causes the input region to be set4107
* to infinite.4108
*/4109
static inline void4110
wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region)4111
{4112
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4113
WL_SURFACE_SET_INPUT_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);4114
}4116
/**4117
* @ingroup iface_wl_surface4118
*4119
* Surface state (input, opaque, and damage regions, attached buffers,4120
* etc.) is double-buffered. Protocol requests modify the pending state,4121
* as opposed to the active state in use by the compositor.4122
*4123
* A commit request atomically creates a content update from the pending4124
* state, even if the pending state has not been touched. The content4125
* update is placed in a queue until it becomes active. After commit, the4126
* new pending state is as documented for each related request.4127
*4128
* When the content update is applied, the wl_buffer is applied before all4129
* other state. This means that all coordinates in double-buffered state4130
* are relative to the newly attached wl_buffers, except for4131
* wl_surface.attach itself. If there is no newly attached wl_buffer, the4132
* coordinates are relative to the previous content update.4133
*4134
* All requests that need a commit to become effective are documented4135
* to affect double-buffered state.4136
*4137
* Other interfaces may add further double-buffered surface state.4138
*/4139
static inline void4140
wl_surface_commit(struct wl_surface *wl_surface)4141
{4142
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4143
WL_SURFACE_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0);4144
}4146
/**4147
* @ingroup iface_wl_surface4148
*4149
* This request sets the transformation that the client has already applied4150
* to the content of the buffer. The accepted values for the transform4151
* parameter are the values for wl_output.transform.4152
*4153
* The compositor applies the inverse of this transformation whenever it4154
* uses the buffer contents.4155
*4156
* Buffer transform is double-buffered state, see wl_surface.commit.4157
*4158
* A newly created surface has its buffer transformation set to normal.4159
*4160
* wl_surface.set_buffer_transform changes the pending buffer4161
* transformation. wl_surface.commit copies the pending buffer4162
* transformation to the current one. Otherwise, the pending and current4163
* values are never changed.4164
*4165
* The purpose of this request is to allow clients to render content4166
* according to the output transform, thus permitting the compositor to4167
* use certain optimizations even if the display is rotated. Using4168
* hardware overlays and scanning out a client buffer for fullscreen4169
* surfaces are examples of such optimizations. Those optimizations are4170
* highly dependent on the compositor implementation, so the use of this4171
* request should be considered on a case-by-case basis.4172
*4173
* Note that if the transform value includes 90 or 270 degree rotation,4174
* the width of the buffer will become the surface height and the height4175
* of the buffer will become the surface width.4176
*4177
* If transform is not one of the values from the4178
* wl_output.transform enum the invalid_transform protocol error4179
* is raised.4180
*/4181
static inline void4182
wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform)4183
{4184
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4185
WL_SURFACE_SET_BUFFER_TRANSFORM, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, transform);4186
}4188
/**4189
* @ingroup iface_wl_surface4190
*4191
* This request sets an optional scaling factor on how the compositor4192
* interprets the contents of the buffer attached to the window.4193
*4194
* Buffer scale is double-buffered state, see wl_surface.commit.4195
*4196
* A newly created surface has its buffer scale set to 1.4197
*4198
* wl_surface.set_buffer_scale changes the pending buffer scale.4199
* wl_surface.commit copies the pending buffer scale to the current one.4200
* Otherwise, the pending and current values are never changed.4201
*4202
* The purpose of this request is to allow clients to supply higher4203
* resolution buffer data for use on high resolution outputs. It is4204
* intended that you pick the same buffer scale as the scale of the4205
* output that the surface is displayed on. This means the compositor4206
* can avoid scaling when rendering the surface on that output.4207
*4208
* Note that if the scale is larger than 1, then you have to attach4209
* a buffer that is larger (by a factor of scale in each dimension)4210
* than the desired surface size.4211
*4212
* If scale is not greater than 0 the invalid_scale protocol error is4213
* raised.4214
*/4215
static inline void4216
wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)4217
{4218
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4219
WL_SURFACE_SET_BUFFER_SCALE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, scale);4220
}4222
/**4223
* @ingroup iface_wl_surface4224
*4225
* This request is used to describe the regions where the pending4226
* buffer is different from the current surface contents, and where4227
* the surface therefore needs to be repainted. The compositor4228
* ignores the parts of the damage that fall outside of the surface.4229
*4230
* Damage is double-buffered state, see wl_surface.commit.4231
*4232
* The damage rectangle is specified in buffer coordinates,4233
* where x and y specify the upper left corner of the damage rectangle.4234
*4235
* The initial value for pending damage is empty: no damage.4236
* wl_surface.damage_buffer adds pending damage: the new pending4237
* damage is the union of old pending damage and the given rectangle.4238
*4239
* wl_surface.commit assigns pending damage as the current damage,4240
* and clears pending damage. The server will clear the current4241
* damage as it repaints the surface.4242
*4243
* This request differs from wl_surface.damage in only one way - it4244
* takes damage in buffer coordinates instead of surface-local4245
* coordinates. While this generally is more intuitive than surface4246
* coordinates, it is especially desirable when using wp_viewport4247
* or when a drawing library (like EGL) is unaware of buffer scale4248
* and buffer transform.4249
*4250
* Note: Because buffer transformation changes and damage requests may4251
* be interleaved in the protocol stream, it is impossible to determine4252
* the actual mapping between surface and buffer damage until4253
* wl_surface.commit time. Therefore, compositors wishing to take both4254
* kinds of damage into account will have to accumulate damage from the4255
* two requests separately and only transform from one to the other4256
* after receiving the wl_surface.commit.4257
*/4258
static inline void4259
wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)4260
{4261
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4262
WL_SURFACE_DAMAGE_BUFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);4263
}4265
/**4266
* @ingroup iface_wl_surface4267
*4268
* The x and y arguments specify the location of the new pending4269
* buffer's upper left corner, relative to the current buffer's upper4270
* left corner, in surface-local coordinates. In other words, the4271
* x and y, combined with the new surface size define in which4272
* directions the surface's size changes.4273
*4274
* The exact semantics of wl_surface.offset are role-specific. Refer to4275
* the documentation of specific roles for more information.4276
*4277
* Surface location offset is double-buffered state, see4278
* wl_surface.commit.4279
*4280
* This request is semantically equivalent to and the replaces the x and y4281
* arguments in the wl_surface.attach request in wl_surface versions prior4282
* to 5. See wl_surface.attach for details.4283
*/4284
static inline void4285
wl_surface_offset(struct wl_surface *wl_surface, int32_t x, int32_t y)4286
{4287
wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4288
WL_SURFACE_OFFSET, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y);4289
}4291
#ifndef WL_SEAT_CAPABILITY_ENUM4292
#define WL_SEAT_CAPABILITY_ENUM4293
/**4294
* @ingroup iface_wl_seat4295
* seat capability bitmask4296
*4297
* This is a bitmask of capabilities this seat has; if a member is4298
* set, then it is present on the seat.4299
*/4300
enum wl_seat_capability {4301
/**4302
* the seat has pointer devices4303
*/4304
WL_SEAT_CAPABILITY_POINTER = 1,4305
/**4306
* the seat has one or more keyboards4307
*/4308
WL_SEAT_CAPABILITY_KEYBOARD = 2,4309
/**4310
* the seat has touch devices4311
*/4312
WL_SEAT_CAPABILITY_TOUCH = 4,4313
};4314
#endif /* WL_SEAT_CAPABILITY_ENUM */4316
#ifndef WL_SEAT_ERROR_ENUM4317
#define WL_SEAT_ERROR_ENUM4318
/**4319
* @ingroup iface_wl_seat4320
* wl_seat error values4321
*4322
* These errors can be emitted in response to wl_seat requests.4323
*/4324
enum wl_seat_error {4325
/**4326
* get_pointer, get_keyboard or get_touch called on seat without the matching capability4327
*/4328
WL_SEAT_ERROR_MISSING_CAPABILITY = 0,4329
};4330
#endif /* WL_SEAT_ERROR_ENUM */4332
/**4333
* @ingroup iface_wl_seat4334
* @struct wl_seat_listener4335
*/4336
struct wl_seat_listener {4337
/**4338
* seat capabilities changed4339
*4340
* This is sent on binding to the seat global or whenever a seat4341
* gains or loses the pointer, keyboard or touch capabilities. The4342
* argument is a capability enum containing the complete set of4343
* capabilities this seat has.4344
*4345
* When the pointer capability is added, a client may create a4346
* wl_pointer object using the wl_seat.get_pointer request. This4347
* object will receive pointer events until the capability is4348
* removed in the future.4349
*4350
* When the pointer capability is removed, a client should destroy4351
* the wl_pointer objects associated with the seat where the4352
* capability was removed, using the wl_pointer.release request. No4353
* further pointer events will be received on these objects.4354
*4355
* In some compositors, if a seat regains the pointer capability4356
* and a client has a previously obtained wl_pointer object of4357
* version 4 or less, that object may start sending pointer events4358
* again. This behavior is considered a misinterpretation of the4359
* intended behavior and must not be relied upon by the client.4360
* wl_pointer objects of version 5 or later must not send events if4361
* created before the most recent event notifying the client of an4362
* added pointer capability.4363
*4364
* The above behavior also applies to wl_keyboard and wl_touch with4365
* the keyboard and touch capabilities, respectively.4366
* @param capabilities capabilities of the seat4367
*/4368
void (*capabilities)(void *data,4369
struct wl_seat *wl_seat,4370
uint32_t capabilities);4371
/**4372
* unique identifier for this seat4373
*4374
* In a multi-seat configuration the seat name can be used by4375
* clients to help identify which physical devices the seat4376
* represents.4377
*4378
* The seat name is a UTF-8 string with no convention defined for4379
* its contents. Each name is unique among all wl_seat globals. The4380
* name is only guaranteed to be unique for the current compositor4381
* instance.4382
*4383
* The same seat names are used for all clients. Thus, the name can4384
* be shared across processes to refer to a specific wl_seat4385
* global.4386
*4387
* The name event is sent after binding to the seat global, and4388
* should be sent before announcing capabilities. This event only4389
* sent once per seat object, and the name does not change over the4390
* lifetime of the wl_seat global.4391
*4392
* Compositors may re-use the same seat name if the wl_seat global4393
* is destroyed and re-created later.4394
* @param name seat identifier4395
* @since 24396
*/4397
void (*name)(void *data,4398
struct wl_seat *wl_seat,4399
const char *name);4400
};4402
/**4403
* @ingroup iface_wl_seat4404
*/4405
static inline int4406
wl_seat_add_listener(struct wl_seat *wl_seat,4407
const struct wl_seat_listener *listener, void *data)4408
{4409
return wl_proxy_add_listener((struct wl_proxy *) wl_seat,4410
(void (**)(void)) listener, data);4411
}4413
#define WL_SEAT_GET_POINTER 04414
#define WL_SEAT_GET_KEYBOARD 14415
#define WL_SEAT_GET_TOUCH 24416
#define WL_SEAT_RELEASE 34418
/**4419
* @ingroup iface_wl_seat4420
*/4421
#define WL_SEAT_CAPABILITIES_SINCE_VERSION 14422
/**4423
* @ingroup iface_wl_seat4424
*/4425
#define WL_SEAT_NAME_SINCE_VERSION 24427
/**4428
* @ingroup iface_wl_seat4429
*/4430
#define WL_SEAT_GET_POINTER_SINCE_VERSION 14431
/**4432
* @ingroup iface_wl_seat4433
*/4434
#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 14435
/**4436
* @ingroup iface_wl_seat4437
*/4438
#define WL_SEAT_GET_TOUCH_SINCE_VERSION 14439
/**4440
* @ingroup iface_wl_seat4441
*/4442
#define WL_SEAT_RELEASE_SINCE_VERSION 54444
/** @ingroup iface_wl_seat */4445
static inline void4446
wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)4447
{4448
wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);4449
}4451
/** @ingroup iface_wl_seat */4452
static inline void *4453
wl_seat_get_user_data(struct wl_seat *wl_seat)4454
{4455
return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);4456
}4458
static inline uint32_t4459
wl_seat_get_version(struct wl_seat *wl_seat)4460
{4461
return wl_proxy_get_version((struct wl_proxy *) wl_seat);4462
}4464
/** @ingroup iface_wl_seat */4465
static inline void4466
wl_seat_destroy(struct wl_seat *wl_seat)4467
{4468
wl_proxy_destroy((struct wl_proxy *) wl_seat);4469
}4471
/**4472
* @ingroup iface_wl_seat4473
*4474
* The ID provided will be initialized to the wl_pointer interface4475
* for this seat.4476
*4477
* This request only takes effect if the seat has the pointer4478
* capability, or has had the pointer capability in the past.4479
* It is a protocol violation to issue this request on a seat that has4480
* never had the pointer capability. The missing_capability error will4481
* be sent in this case.4482
*/4483
static inline struct wl_pointer *4484
wl_seat_get_pointer(struct wl_seat *wl_seat)4485
{4486
struct wl_proxy *id;4488
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4489
WL_SEAT_GET_POINTER, &wl_pointer_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);4491
return (struct wl_pointer *) id;4492
}4494
/**4495
* @ingroup iface_wl_seat4496
*4497
* The ID provided will be initialized to the wl_keyboard interface4498
* for this seat.4499
*4500
* This request only takes effect if the seat has the keyboard4501
* capability, or has had the keyboard capability in the past.4502
* It is a protocol violation to issue this request on a seat that has4503
* never had the keyboard capability. The missing_capability error will4504
* be sent in this case.4505
*/4506
static inline struct wl_keyboard *4507
wl_seat_get_keyboard(struct wl_seat *wl_seat)4508
{4509
struct wl_proxy *id;4511
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4512
WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);4514
return (struct wl_keyboard *) id;4515
}4517
/**4518
* @ingroup iface_wl_seat4519
*4520
* The ID provided will be initialized to the wl_touch interface4521
* for this seat.4522
*4523
* This request only takes effect if the seat has the touch4524
* capability, or has had the touch capability in the past.4525
* It is a protocol violation to issue this request on a seat that has4526
* never had the touch capability. The missing_capability error will4527
* be sent in this case.4528
*/4529
static inline struct wl_touch *4530
wl_seat_get_touch(struct wl_seat *wl_seat)4531
{4532
struct wl_proxy *id;4534
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4535
WL_SEAT_GET_TOUCH, &wl_touch_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);4537
return (struct wl_touch *) id;4538
}4540
/**4541
* @ingroup iface_wl_seat4542
*4543
* Using this request a client can tell the server that it is not going to4544
* use the seat object anymore.4545
*/4546
static inline void4547
wl_seat_release(struct wl_seat *wl_seat)4548
{4549
wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4550
WL_SEAT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_seat), WL_MARSHAL_FLAG_DESTROY);4551
}4553
#ifndef WL_POINTER_ERROR_ENUM4554
#define WL_POINTER_ERROR_ENUM4555
enum wl_pointer_error {4556
/**4557
* given wl_surface has another role4558
*/4559
WL_POINTER_ERROR_ROLE = 0,4560
};4561
#endif /* WL_POINTER_ERROR_ENUM */4563
#ifndef WL_POINTER_BUTTON_STATE_ENUM4564
#define WL_POINTER_BUTTON_STATE_ENUM4565
/**4566
* @ingroup iface_wl_pointer4567
* physical button state4568
*4569
* Describes the physical state of a button that produced the button4570
* event.4571
*/4572
enum wl_pointer_button_state {4573
/**4574
* the button is not pressed4575
*/4576
WL_POINTER_BUTTON_STATE_RELEASED = 0,4577
/**4578
* the button is pressed4579
*/4580
WL_POINTER_BUTTON_STATE_PRESSED = 1,4581
};4582
#endif /* WL_POINTER_BUTTON_STATE_ENUM */4584
#ifndef WL_POINTER_AXIS_ENUM4585
#define WL_POINTER_AXIS_ENUM4586
/**4587
* @ingroup iface_wl_pointer4588
* axis types4589
*4590
* Describes the axis types of scroll events.4591
*/4592
enum wl_pointer_axis {4593
/**4594
* vertical axis4595
*/4596
WL_POINTER_AXIS_VERTICAL_SCROLL = 0,4597
/**4598
* horizontal axis4599
*/4600
WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,4601
};4602
#endif /* WL_POINTER_AXIS_ENUM */4604
#ifndef WL_POINTER_AXIS_SOURCE_ENUM4605
#define WL_POINTER_AXIS_SOURCE_ENUM4606
/**4607
* @ingroup iface_wl_pointer4608
* axis source types4609
*4610
* Describes the source types for axis events. This indicates to the4611
* client how an axis event was physically generated; a client may4612
* adjust the user interface accordingly. For example, scroll events4613
* from a "finger" source may be in a smooth coordinate space with4614
* kinetic scrolling whereas a "wheel" source may be in discrete steps4615
* of a number of lines.4616
*4617
* The "continuous" axis source is a device generating events in a4618
* continuous coordinate space, but using something other than a4619
* finger. One example for this source is button-based scrolling where4620
* the vertical motion of a device is converted to scroll events while4621
* a button is held down.4622
*4623
* The "wheel tilt" axis source indicates that the actual device is a4624
* wheel but the scroll event is not caused by a rotation but a4625
* (usually sideways) tilt of the wheel.4626
*/4627
enum wl_pointer_axis_source {4628
/**4629
* a physical wheel rotation4630
*/4631
WL_POINTER_AXIS_SOURCE_WHEEL = 0,4632
/**4633
* finger on a touch surface4634
*/4635
WL_POINTER_AXIS_SOURCE_FINGER = 1,4636
/**4637
* continuous coordinate space4638
*/4639
WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,4640
/**4641
* a physical wheel tilt4642
* @since 64643
*/4644
WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,4645
};4646
/**4647
* @ingroup iface_wl_pointer4648
*/4649
#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 64650
#endif /* WL_POINTER_AXIS_SOURCE_ENUM */4652
#ifndef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM4653
#define WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM4654
/**4655
* @ingroup iface_wl_pointer4656
* axis relative direction4657
*4658
* This specifies the direction of the physical motion that caused a4659
* wl_pointer.axis event, relative to the wl_pointer.axis direction.4660
*/4661
enum wl_pointer_axis_relative_direction {4662
/**4663
* physical motion matches axis direction4664
*/4665
WL_POINTER_AXIS_RELATIVE_DIRECTION_IDENTICAL = 0,4666
/**4667
* physical motion is the inverse of the axis direction4668
*/4669
WL_POINTER_AXIS_RELATIVE_DIRECTION_INVERTED = 1,4670
};4671
#endif /* WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM */4673
/**4674
* @ingroup iface_wl_pointer4675
* @struct wl_pointer_listener4676
*/4677
struct wl_pointer_listener {4678
/**4679
* enter event4680
*4681
* Notification that this seat's pointer is focused on a certain4682
* surface.4683
*4684
* When a seat's focus enters a surface, the pointer image is4685
* undefined and a client should respond to this event by setting4686
* an appropriate pointer image with the set_cursor request.4687
* @param serial serial number of the enter event4688
* @param surface surface entered by the pointer4689
* @param surface_x surface-local x coordinate4690
* @param surface_y surface-local y coordinate4691
*/4692
void (*enter)(void *data,4693
struct wl_pointer *wl_pointer,4694
uint32_t serial,4695
struct wl_surface *surface,4696
wl_fixed_t surface_x,4697
wl_fixed_t surface_y);4698
/**4699
* leave event4700
*4701
* Notification that this seat's pointer is no longer focused on4702
* a certain surface.4703
*4704
* The leave notification is sent before the enter notification for4705
* the new focus.4706
* @param serial serial number of the leave event4707
* @param surface surface left by the pointer4708
*/4709
void (*leave)(void *data,4710
struct wl_pointer *wl_pointer,4711
uint32_t serial,4712
struct wl_surface *surface);4713
/**4714
* pointer motion event4715
*4716
* Notification of pointer location change. The arguments4717
* surface_x and surface_y are the location relative to the focused4718
* surface.4719
* @param time timestamp with millisecond granularity4720
* @param surface_x surface-local x coordinate4721
* @param surface_y surface-local y coordinate4722
*/4723
void (*motion)(void *data,4724
struct wl_pointer *wl_pointer,4725
uint32_t time,4726
wl_fixed_t surface_x,4727
wl_fixed_t surface_y);4728
/**4729
* pointer button event4730
*4731
* Mouse button click and release notifications.4732
*4733
* The location of the click is given by the last motion or enter4734
* event. The time argument is a timestamp with millisecond4735
* granularity, with an undefined base.4736
*4737
* The button is a button code as defined in the Linux kernel's4738
* linux/input-event-codes.h header file, e.g. BTN_LEFT.4739
*4740
* Any 16-bit button code value is reserved for future additions to4741
* the kernel's event code list. All other button codes above4742
* 0xFFFF are currently undefined but may be used in future4743
* versions of this protocol.4744
* @param serial serial number of the button event4745
* @param time timestamp with millisecond granularity4746
* @param button button that produced the event4747
* @param state physical state of the button4748
*/4749
void (*button)(void *data,4750
struct wl_pointer *wl_pointer,4751
uint32_t serial,4752
uint32_t time,4753
uint32_t button,4754
uint32_t state);4755
/**4756
* axis event4757
*4758
* Scroll and other axis notifications.4759
*4760
* For scroll events (vertical and horizontal scroll axes), the4761
* value parameter is the length of a vector along the specified4762
* axis in a coordinate space identical to those of motion events,4763
* representing a relative movement along the specified axis.4764
*4765
* For devices that support movements non-parallel to axes multiple4766
* axis events will be emitted.4767
*4768
* When applicable, for example for touch pads, the server can4769
* choose to emit scroll events where the motion vector is4770
* equivalent to a motion event vector.4771
*4772
* When applicable, a client can transform its content relative to4773
* the scroll distance.4774
* @param time timestamp with millisecond granularity4775
* @param axis axis type4776
* @param value length of vector in surface-local coordinate space4777
*/4778
void (*axis)(void *data,4779
struct wl_pointer *wl_pointer,4780
uint32_t time,4781
uint32_t axis,4782
wl_fixed_t value);4783
/**4784
* end of a pointer event sequence4785
*4786
* Indicates the end of a set of events that logically belong4787
* together. A client is expected to accumulate the data in all4788
* events within the frame before proceeding.4789
*4790
* All wl_pointer events before a wl_pointer.frame event belong4791
* logically together. For example, in a diagonal scroll motion the4792
* compositor will send an optional wl_pointer.axis_source event,4793
* two wl_pointer.axis events (horizontal and vertical) and finally4794
* a wl_pointer.frame event. The client may use this information to4795
* calculate a diagonal vector for scrolling.4796
*4797
* When multiple wl_pointer.axis events occur within the same4798
* frame, the motion vector is the combined motion of all events.4799
* When a wl_pointer.axis and a wl_pointer.axis_stop event occur4800
* within the same frame, this indicates that axis movement in one4801
* axis has stopped but continues in the other axis. When multiple4802
* wl_pointer.axis_stop events occur within the same frame, this4803
* indicates that these axes stopped in the same instance.4804
*4805
* A wl_pointer.frame event is sent for every logical event group,4806
* even if the group only contains a single wl_pointer event.4807
* Specifically, a client may get a sequence: motion, frame,4808
* button, frame, axis, frame, axis_stop, frame.4809
*4810
* The wl_pointer.enter and wl_pointer.leave events are logical4811
* events generated by the compositor and not the hardware. These4812
* events are also grouped by a wl_pointer.frame. When a pointer4813
* moves from one surface to another, a compositor should group the4814
* wl_pointer.leave event within the same wl_pointer.frame.4815
* However, a client must not rely on wl_pointer.leave and4816
* wl_pointer.enter being in the same wl_pointer.frame.4817
* Compositor-specific policies may require the wl_pointer.leave4818
* and wl_pointer.enter event being split across multiple4819
* wl_pointer.frame groups.4820
* @since 54821
*/4822
void (*frame)(void *data,4823
struct wl_pointer *wl_pointer);4824
/**4825
* axis source event4826
*4827
* Source information for scroll and other axes.4828
*4829
* This event does not occur on its own. It is sent before a4830
* wl_pointer.frame event and carries the source information for4831
* all events within that frame.4832
*4833
* The source specifies how this event was generated. If the source4834
* is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event4835
* will be sent when the user lifts the finger off the device.4836
*4837
* If the source is wl_pointer.axis_source.wheel,4838
* wl_pointer.axis_source.wheel_tilt or4839
* wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event4840
* may or may not be sent. Whether a compositor sends an axis_stop4841
* event for these sources is hardware-specific and4842
* implementation-dependent; clients must not rely on receiving an4843
* axis_stop event for these scroll sources and should treat scroll4844
* sequences from these scroll sources as unterminated by default.4845
*4846
* This event is optional. If the source is unknown for a4847
* particular axis event sequence, no event is sent. Only one4848
* wl_pointer.axis_source event is permitted per frame.4849
*4850
* The order of wl_pointer.axis_discrete and wl_pointer.axis_source4851
* is not guaranteed.4852
* @param axis_source source of the axis event4853
* @since 54854
*/4855
void (*axis_source)(void *data,4856
struct wl_pointer *wl_pointer,4857
uint32_t axis_source);4858
/**4859
* axis stop event4860
*4861
* Stop notification for scroll and other axes.4862
*4863
* For some wl_pointer.axis_source types, a wl_pointer.axis_stop4864
* event is sent to notify a client that the axis sequence has4865
* terminated. This enables the client to implement kinetic4866
* scrolling. See the wl_pointer.axis_source documentation for4867
* information on when this event may be generated.4868
*4869
* Any wl_pointer.axis events with the same axis_source after this4870
* event should be considered as the start of a new axis motion.4871
*4872
* The timestamp is to be interpreted identical to the timestamp in4873
* the wl_pointer.axis event. The timestamp value may be the same4874
* as a preceding wl_pointer.axis event.4875
* @param time timestamp with millisecond granularity4876
* @param axis the axis stopped with this event4877
* @since 54878
*/4879
void (*axis_stop)(void *data,4880
struct wl_pointer *wl_pointer,4881
uint32_t time,4882
uint32_t axis);4883
/**4884
* axis click event4885
*4886
* Discrete step information for scroll and other axes.4887
*4888
* This event carries the axis value of the wl_pointer.axis event4889
* in discrete steps (e.g. mouse wheel clicks).4890
*4891
* This event is deprecated with wl_pointer version 8 - this event4892
* is not sent to clients supporting version 8 or later.4893
*4894
* This event does not occur on its own, it is coupled with a4895
* wl_pointer.axis event that represents this axis value on a4896
* continuous scale. The protocol guarantees that each4897
* axis_discrete event is always followed by exactly one axis event4898
* with the same axis number within the same wl_pointer.frame. Note4899
* that the protocol allows for other events to occur between the4900
* axis_discrete and its coupled axis event, including other4901
* axis_discrete or axis events. A wl_pointer.frame must not4902
* contain more than one axis_discrete event per axis type.4903
*4904
* This event is optional; continuous scrolling devices like4905
* two-finger scrolling on touchpads do not have discrete steps and4906
* do not generate this event.4907
*4908
* The discrete value carries the directional information. e.g. a4909
* value of -2 is two steps towards the negative direction of this4910
* axis.4911
*4912
* The axis number is identical to the axis number in the4913
* associated axis event.4914
*4915
* The order of wl_pointer.axis_discrete and wl_pointer.axis_source4916
* is not guaranteed.4917
* @param axis axis type4918
* @param discrete number of steps4919
* @since 54920
* @deprecated Deprecated since version 84921
*/4922
void (*axis_discrete)(void *data,4923
struct wl_pointer *wl_pointer,4924
uint32_t axis,4925
int32_t discrete);4926
/**4927
* axis high-resolution scroll event4928
*4929
* Discrete high-resolution scroll information.4930
*4931
* This event carries high-resolution wheel scroll information,4932
* with each multiple of 120 representing one logical scroll step4933
* (a wheel detent). For example, an axis_value120 of 30 is one4934
* quarter of a logical scroll step in the positive direction, a4935
* value120 of -240 are two logical scroll steps in the negative4936
* direction within the same hardware event. Clients that rely on4937
* discrete scrolling should accumulate the value120 to multiples4938
* of 120 before processing the event.4939
*4940
* The value120 must not be zero.4941
*4942
* This event replaces the wl_pointer.axis_discrete event in4943
* clients supporting wl_pointer version 8 or later.4944
*4945
* Where a wl_pointer.axis_source event occurs in the same4946
* wl_pointer.frame, the axis source applies to this event.4947
*4948
* The order of wl_pointer.axis_value120 and wl_pointer.axis_source4949
* is not guaranteed.4950
* @param axis axis type4951
* @param value120 scroll distance as fraction of 1204952
* @since 84953
*/4954
void (*axis_value120)(void *data,4955
struct wl_pointer *wl_pointer,4956
uint32_t axis,4957
int32_t value120);4958
/**4959
* axis relative physical direction event4960
*4961
* Relative directional information of the entity causing the4962
* axis motion.4963
*4964
* For a wl_pointer.axis event, the4965
* wl_pointer.axis_relative_direction event specifies the movement4966
* direction of the entity causing the wl_pointer.axis event. For4967
* example: - if a user's fingers on a touchpad move down and this4968
* causes a wl_pointer.axis vertical_scroll down event, the4969
* physical direction is 'identical' - if a user's fingers on a4970
* touchpad move down and this causes a wl_pointer.axis4971
* vertical_scroll up scroll up event ('natural scrolling'), the4972
* physical direction is 'inverted'.4973
*4974
* A client may use this information to adjust scroll motion of4975
* components. Specifically, enabling natural scrolling causes the4976
* content to change direction compared to traditional scrolling.4977
* Some widgets like volume control sliders should usually match4978
* the physical direction regardless of whether natural scrolling4979
* is active. This event enables clients to match the scroll4980
* direction of a widget to the physical direction.4981
*4982
* This event does not occur on its own, it is coupled with a4983
* wl_pointer.axis event that represents this axis value. The4984
* protocol guarantees that each axis_relative_direction event is4985
* always followed by exactly one axis event with the same axis4986
* number within the same wl_pointer.frame. Note that the protocol4987
* allows for other events to occur between the4988
* axis_relative_direction and its coupled axis event.4989
*4990
* The axis number is identical to the axis number in the4991
* associated axis event.4992
*4993
* The order of wl_pointer.axis_relative_direction,4994
* wl_pointer.axis_discrete and wl_pointer.axis_source is not4995
* guaranteed.4996
* @param axis axis type4997
* @param direction physical direction relative to axis motion4998
* @since 94999
*/5000
void (*axis_relative_direction)(void *data,5001
struct wl_pointer *wl_pointer,5002
uint32_t axis,5003
uint32_t direction);5004
};5006
/**5007
* @ingroup iface_wl_pointer5008
*/5009
static inline int5010
wl_pointer_add_listener(struct wl_pointer *wl_pointer,5011
const struct wl_pointer_listener *listener, void *data)5012
{5013
return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,5014
(void (**)(void)) listener, data);5015
}5017
#define WL_POINTER_SET_CURSOR 05018
#define WL_POINTER_RELEASE 15020
/**5021
* @ingroup iface_wl_pointer5022
*/5023
#define WL_POINTER_ENTER_SINCE_VERSION 15024
/**5025
* @ingroup iface_wl_pointer5026
*/5027
#define WL_POINTER_LEAVE_SINCE_VERSION 15028
/**5029
* @ingroup iface_wl_pointer5030
*/5031
#define WL_POINTER_MOTION_SINCE_VERSION 15032
/**5033
* @ingroup iface_wl_pointer5034
*/5035
#define WL_POINTER_BUTTON_SINCE_VERSION 15036
/**5037
* @ingroup iface_wl_pointer5038
*/5039
#define WL_POINTER_AXIS_SINCE_VERSION 15040
/**5041
* @ingroup iface_wl_pointer5042
*/5043
#define WL_POINTER_FRAME_SINCE_VERSION 55044
/**5045
* @ingroup iface_wl_pointer5046
*/5047
#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 55048
/**5049
* @ingroup iface_wl_pointer5050
*/5051
#define WL_POINTER_AXIS_STOP_SINCE_VERSION 55052
/**5053
* @ingroup iface_wl_pointer5054
*/5055
#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 55056
/**5057
* @ingroup iface_wl_pointer5058
*/5059
#define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 85060
/**5061
* @ingroup iface_wl_pointer5062
*/5063
#define WL_POINTER_AXIS_RELATIVE_DIRECTION_SINCE_VERSION 95065
/**5066
* @ingroup iface_wl_pointer5067
*/5068
#define WL_POINTER_SET_CURSOR_SINCE_VERSION 15069
/**5070
* @ingroup iface_wl_pointer5071
*/5072
#define WL_POINTER_RELEASE_SINCE_VERSION 35074
/** @ingroup iface_wl_pointer */5075
static inline void5076
wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)5077
{5078
wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);5079
}5081
/** @ingroup iface_wl_pointer */5082
static inline void *5083
wl_pointer_get_user_data(struct wl_pointer *wl_pointer)5084
{5085
return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);5086
}5088
static inline uint32_t5089
wl_pointer_get_version(struct wl_pointer *wl_pointer)5090
{5091
return wl_proxy_get_version((struct wl_proxy *) wl_pointer);5092
}5094
/** @ingroup iface_wl_pointer */5095
static inline void5096
wl_pointer_destroy(struct wl_pointer *wl_pointer)5097
{5098
wl_proxy_destroy((struct wl_proxy *) wl_pointer);5099
}5101
/**5102
* @ingroup iface_wl_pointer5103
*5104
* Set the pointer surface, i.e., the surface that contains the5105
* pointer image (cursor). This request gives the surface the role5106
* of a cursor. If the surface already has another role, it raises5107
* a protocol error.5108
*5109
* The cursor actually changes only if the pointer5110
* focus for this device is one of the requesting client's surfaces5111
* or the surface parameter is the current pointer surface. If5112
* there was a previous surface set with this request it is5113
* replaced. If surface is NULL, the pointer image is hidden.5114
*5115
* The parameters hotspot_x and hotspot_y define the position of5116
* the pointer surface relative to the pointer location. Its5117
* top-left corner is always at (x, y) - (hotspot_x, hotspot_y),5118
* where (x, y) are the coordinates of the pointer location, in5119
* surface-local coordinates.5120
*5121
* On wl_surface.offset requests to the pointer surface, hotspot_x5122
* and hotspot_y are decremented by the x and y parameters5123
* passed to the request. The offset must be applied by5124
* wl_surface.commit as usual.5125
*5126
* The hotspot can also be updated by passing the currently set5127
* pointer surface to this request with new values for hotspot_x5128
* and hotspot_y.5129
*5130
* The input region is ignored for wl_surfaces with the role of5131
* a cursor. When the use as a cursor ends, the wl_surface is5132
* unmapped.5133
*5134
* The serial parameter must match the latest wl_pointer.enter5135
* serial number sent to the client. Otherwise the request will be5136
* ignored.5137
*/5138
static inline void5139
wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)5140
{5141
wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,5142
WL_POINTER_SET_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), 0, serial, surface, hotspot_x, hotspot_y);5143
}5145
/**5146
* @ingroup iface_wl_pointer5147
*5148
* Using this request a client can tell the server that it is not going to5149
* use the pointer object anymore.5150
*5151
* This request destroys the pointer proxy object, so clients must not call5152
* wl_pointer_destroy() after using this request.5153
*/5154
static inline void5155
wl_pointer_release(struct wl_pointer *wl_pointer)5156
{5157
wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,5158
WL_POINTER_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), WL_MARSHAL_FLAG_DESTROY);5159
}5161
#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM5162
#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM5163
/**5164
* @ingroup iface_wl_keyboard5165
* keyboard mapping format5166
*5167
* This specifies the format of the keymap provided to the5168
* client with the wl_keyboard.keymap event.5169
*/5170
enum wl_keyboard_keymap_format {5171
/**5172
* no keymap; client must understand how to interpret the raw keycode5173
*/5174
WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,5175
/**5176
* libxkbcommon compatible, null-terminated string; to determine the xkb keycode, clients must add 8 to the key event keycode5177
*/5178
WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,5179
};5180
#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */5182
#ifndef WL_KEYBOARD_KEY_STATE_ENUM5183
#define WL_KEYBOARD_KEY_STATE_ENUM5184
/**5185
* @ingroup iface_wl_keyboard5186
* physical key state5187
*5188
* Describes the physical state of a key that produced the key event.5189
*5190
* Since version 10, the key can be in a "repeated" pseudo-state which5191
* means the same as "pressed", but is used to signal repetition in the5192
* key event.5193
*5194
* The key may only enter the repeated state after entering the pressed5195
* state and before entering the released state. This event may be5196
* generated multiple times while the key is down.5197
*/5198
enum wl_keyboard_key_state {5199
/**5200
* key is not pressed5201
*/5202
WL_KEYBOARD_KEY_STATE_RELEASED = 0,5203
/**5204
* key is pressed5205
*/5206
WL_KEYBOARD_KEY_STATE_PRESSED = 1,5207
/**5208
* key was repeated5209
* @since 105210
*/5211
WL_KEYBOARD_KEY_STATE_REPEATED = 2,5212
};5213
/**5214
* @ingroup iface_wl_keyboard5215
*/5216
#define WL_KEYBOARD_KEY_STATE_REPEATED_SINCE_VERSION 105217
#endif /* WL_KEYBOARD_KEY_STATE_ENUM */5219
/**5220
* @ingroup iface_wl_keyboard5221
* @struct wl_keyboard_listener5222
*/5223
struct wl_keyboard_listener {5224
/**5225
* keyboard mapping5226
*5227
* This event provides a file descriptor to the client which can5228
* be memory-mapped in read-only mode to provide a keyboard mapping5229
* description.5230
*5231
* From version 7 onwards, the fd must be mapped with MAP_PRIVATE5232
* by the recipient, as MAP_SHARED may fail.5233
* @param format keymap format5234
* @param fd keymap file descriptor5235
* @param size keymap size, in bytes5236
*/5237
void (*keymap)(void *data,5238
struct wl_keyboard *wl_keyboard,5239
uint32_t format,5240
int32_t fd,5241
uint32_t size);5242
/**5243
* enter event5244
*5245
* Notification that this seat's keyboard focus is on a certain5246
* surface.5247
*5248
* The compositor must send the wl_keyboard.modifiers event after5249
* this event.5250
*5251
* In the wl_keyboard logical state, this event sets the active5252
* surface to the surface argument and the keys currently logically5253
* down to the keys in the keys argument. The compositor must not5254
* send this event if the wl_keyboard already had an active surface5255
* immediately before this event.5256
*5257
* Clients should not use the list of pressed keys to emulate5258
* key-press events. The order of keys in the list is unspecified.5259
* @param serial serial number of the enter event5260
* @param surface surface gaining keyboard focus5261
* @param keys the keys currently logically down5262
*/5263
void (*enter)(void *data,5264
struct wl_keyboard *wl_keyboard,5265
uint32_t serial,5266
struct wl_surface *surface,5267
struct wl_array *keys);5268
/**5269
* leave event5270
*5271
* Notification that this seat's keyboard focus is no longer on a5272
* certain surface.5273
*5274
* The leave notification is sent before the enter notification for5275
* the new focus.5276
*5277
* In the wl_keyboard logical state, this event resets all values5278
* to their defaults. The compositor must not send this event if5279
* the active surface of the wl_keyboard was not equal to the5280
* surface argument immediately before this event.5281
* @param serial serial number of the leave event5282
* @param surface surface that lost keyboard focus5283
*/5284
void (*leave)(void *data,5285
struct wl_keyboard *wl_keyboard,5286
uint32_t serial,5287
struct wl_surface *surface);5288
/**5289
* key event5290
*5291
* A key was pressed or released. The time argument is a5292
* timestamp with millisecond granularity, with an undefined base.5293
*5294
* The key is a platform-specific key code that can be interpreted5295
* by feeding it to the keyboard mapping (see the keymap event).5296
*5297
* If this event produces a change in modifiers, then the resulting5298
* wl_keyboard.modifiers event must be sent after this event.5299
*5300
* In the wl_keyboard logical state, this event adds the key to the5301
* keys currently logically down (if the state argument is pressed)5302
* or removes the key from the keys currently logically down (if5303
* the state argument is released). The compositor must not send5304
* this event if the wl_keyboard did not have an active surface5305
* immediately before this event. The compositor must not send this5306
* event if state is pressed (resp. released) and the key was5307
* already logically down (resp. was not logically down)5308
* immediately before this event.5309
*5310
* Since version 10, compositors may send key events with the5311
* "repeated" key state when a wl_keyboard.repeat_info event with a5312
* rate argument of 0 has been received. This allows the compositor5313
* to take over the responsibility of key repetition.5314
* @param serial serial number of the key event5315
* @param time timestamp with millisecond granularity5316
* @param key key that produced the event5317
* @param state physical state of the key5318
*/5319
void (*key)(void *data,5320
struct wl_keyboard *wl_keyboard,5321
uint32_t serial,5322
uint32_t time,5323
uint32_t key,5324
uint32_t state);5325
/**5326
* modifier and group state5327
*5328
* Notifies clients that the modifier and/or group state has5329
* changed, and it should update its local state.5330
*5331
* The compositor may send this event without a surface of the5332
* client having keyboard focus, for example to tie modifier5333
* information to pointer focus instead. If a modifier event with5334
* pressed modifiers is sent without a prior enter event, the5335
* client can assume the modifier state is valid until it receives5336
* the next wl_keyboard.modifiers event. In order to reset the5337
* modifier state again, the compositor can send a5338
* wl_keyboard.modifiers event with no pressed modifiers.5339
*5340
* In the wl_keyboard logical state, this event updates the5341
* modifiers and group.5342
* @param serial serial number of the modifiers event5343
* @param mods_depressed depressed modifiers5344
* @param mods_latched latched modifiers5345
* @param mods_locked locked modifiers5346
* @param group keyboard layout5347
*/5348
void (*modifiers)(void *data,5349
struct wl_keyboard *wl_keyboard,5350
uint32_t serial,5351
uint32_t mods_depressed,5352
uint32_t mods_latched,5353
uint32_t mods_locked,5354
uint32_t group);5355
/**5356
* repeat rate and delay5357
*5358
* Informs the client about the keyboard's repeat rate and delay.5359
*5360
* This event is sent as soon as the wl_keyboard object has been5361
* created, and is guaranteed to be received by the client before5362
* any key press event.5363
*5364
* Negative values for either rate or delay are illegal. A rate of5365
* zero will disable any repeating (regardless of the value of5366
* delay).5367
*5368
* This event can be sent later on as well with a new value if5369
* necessary, so clients should continue listening for the event5370
* past the creation of wl_keyboard.5371
* @param rate the rate of repeating keys in characters per second5372
* @param delay delay in milliseconds since key down until repeating starts5373
* @since 45374
*/5375
void (*repeat_info)(void *data,5376
struct wl_keyboard *wl_keyboard,5377
int32_t rate,5378
int32_t delay);5379
};5381
/**5382
* @ingroup iface_wl_keyboard5383
*/5384
static inline int5385
wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,5386
const struct wl_keyboard_listener *listener, void *data)5387
{5388
return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,5389
(void (**)(void)) listener, data);5390
}5392
#define WL_KEYBOARD_RELEASE 05394
/**5395
* @ingroup iface_wl_keyboard5396
*/5397
#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 15398
/**5399
* @ingroup iface_wl_keyboard5400
*/5401
#define WL_KEYBOARD_ENTER_SINCE_VERSION 15402
/**5403
* @ingroup iface_wl_keyboard5404
*/5405
#define WL_KEYBOARD_LEAVE_SINCE_VERSION 15406
/**5407
* @ingroup iface_wl_keyboard5408
*/5409
#define WL_KEYBOARD_KEY_SINCE_VERSION 15410
/**5411
* @ingroup iface_wl_keyboard5412
*/5413
#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 15414
/**5415
* @ingroup iface_wl_keyboard5416
*/5417
#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 45419
/**5420
* @ingroup iface_wl_keyboard5421
*/5422
#define WL_KEYBOARD_RELEASE_SINCE_VERSION 35424
/** @ingroup iface_wl_keyboard */5425
static inline void5426
wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)5427
{5428
wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);5429
}5431
/** @ingroup iface_wl_keyboard */5432
static inline void *5433
wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)5434
{5435
return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);5436
}5438
static inline uint32_t5439
wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)5440
{5441
return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);5442
}5444
/** @ingroup iface_wl_keyboard */5445
static inline void5446
wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)5447
{5448
wl_proxy_destroy((struct wl_proxy *) wl_keyboard);5449
}5451
/**5452
* @ingroup iface_wl_keyboard5453
*/5454
static inline void5455
wl_keyboard_release(struct wl_keyboard *wl_keyboard)5456
{5457
wl_proxy_marshal_flags((struct wl_proxy *) wl_keyboard,5458
WL_KEYBOARD_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_keyboard), WL_MARSHAL_FLAG_DESTROY);5459
}5461
/**5462
* @ingroup iface_wl_touch5463
* @struct wl_touch_listener5464
*/5465
struct wl_touch_listener {5466
/**5467
* touch down event and beginning of a touch sequence5468
*5469
* A new touch point has appeared on the surface. This touch5470
* point is assigned a unique ID. Future events from this touch5471
* point reference this ID. The ID ceases to be valid after a touch5472
* up event and may be reused in the future.5473
* @param serial serial number of the touch down event5474
* @param time timestamp with millisecond granularity5475
* @param surface surface touched5476
* @param id the unique ID of this touch point5477
* @param x surface-local x coordinate5478
* @param y surface-local y coordinate5479
*/5480
void (*down)(void *data,5481
struct wl_touch *wl_touch,5482
uint32_t serial,5483
uint32_t time,5484
struct wl_surface *surface,5485
int32_t id,5486
wl_fixed_t x,5487
wl_fixed_t y);5488
/**5489
* end of a touch event sequence5490
*5491
* The touch point has disappeared. No further events will be5492
* sent for this touch point and the touch point's ID is released5493
* and may be reused in a future touch down event.5494
* @param serial serial number of the touch up event5495
* @param time timestamp with millisecond granularity5496
* @param id the unique ID of this touch point5497
*/5498
void (*up)(void *data,5499
struct wl_touch *wl_touch,5500
uint32_t serial,5501
uint32_t time,5502
int32_t id);5503
/**5504
* update of touch point coordinates5505
*5506
* A touch point has changed coordinates.5507
* @param time timestamp with millisecond granularity5508
* @param id the unique ID of this touch point5509
* @param x surface-local x coordinate5510
* @param y surface-local y coordinate5511
*/5512
void (*motion)(void *data,5513
struct wl_touch *wl_touch,5514
uint32_t time,5515
int32_t id,5516
wl_fixed_t x,5517
wl_fixed_t y);5518
/**5519
* end of touch frame event5520
*5521
* Indicates the end of a set of events that logically belong5522
* together. A client is expected to accumulate the data in all5523
* events within the frame before proceeding.5524
*5525
* A wl_touch.frame terminates at least one event but otherwise no5526
* guarantee is provided about the set of events within a frame. A5527
* client must assume that any state not updated in a frame is5528
* unchanged from the previously known state.5529
*/5530
void (*frame)(void *data,5531
struct wl_touch *wl_touch);5532
/**5533
* touch session cancelled5534
*5535
* Sent if the compositor decides the touch stream is a global5536
* gesture. No further events are sent to the clients from that5537
* particular gesture. Touch cancellation applies to all touch5538
* points currently active on this client's surface. The client is5539
* responsible for finalizing the touch points, future touch points5540
* on this surface may reuse the touch point ID.5541
*5542
* No frame event is required after the cancel event.5543
*/5544
void (*cancel)(void *data,5545
struct wl_touch *wl_touch);5546
/**5547
* update shape of touch point5548
*5549
* Sent when a touchpoint has changed its shape.5550
*5551
* This event does not occur on its own. It is sent before a5552
* wl_touch.frame event and carries the new shape information for5553
* any previously reported, or new touch points of that frame.5554
*5555
* Other events describing the touch point such as wl_touch.down,5556
* wl_touch.motion or wl_touch.orientation may be sent within the5557
* same wl_touch.frame. A client should treat these events as a5558
* single logical touch point update. The order of wl_touch.shape,5559
* wl_touch.orientation and wl_touch.motion is not guaranteed. A5560
* wl_touch.down event is guaranteed to occur before the first5561
* wl_touch.shape event for this touch ID but both events may occur5562
* within the same wl_touch.frame.5563
*5564
* A touchpoint shape is approximated by an ellipse through the5565
* major and minor axis length. The major axis length describes the5566
* longer diameter of the ellipse, while the minor axis length5567
* describes the shorter diameter. Major and minor are orthogonal5568
* and both are specified in surface-local coordinates. The center5569
* of the ellipse is always at the touchpoint location as reported5570
* by wl_touch.down or wl_touch.move.5571
*5572
* This event is only sent by the compositor if the touch device5573
* supports shape reports. The client has to make reasonable5574
* assumptions about the shape if it did not receive this event.5575
* @param id the unique ID of this touch point5576
* @param major length of the major axis in surface-local coordinates5577
* @param minor length of the minor axis in surface-local coordinates5578
* @since 65579
*/5580
void (*shape)(void *data,5581
struct wl_touch *wl_touch,5582
int32_t id,5583
wl_fixed_t major,5584
wl_fixed_t minor);5585
/**5586
* update orientation of touch point5587
*5588
* Sent when a touchpoint has changed its orientation.5589
*5590
* This event does not occur on its own. It is sent before a5591
* wl_touch.frame event and carries the new shape information for5592
* any previously reported, or new touch points of that frame.5593
*5594
* Other events describing the touch point such as wl_touch.down,5595
* wl_touch.motion or wl_touch.shape may be sent within the same5596
* wl_touch.frame. A client should treat these events as a single5597
* logical touch point update. The order of wl_touch.shape,5598
* wl_touch.orientation and wl_touch.motion is not guaranteed. A5599
* wl_touch.down event is guaranteed to occur before the first5600
* wl_touch.orientation event for this touch ID but both events may5601
* occur within the same wl_touch.frame.5602
*5603
* The orientation describes the clockwise angle of a touchpoint's5604
* major axis to the positive surface y-axis and is normalized to5605
* the -180 to +180 degree range. The granularity of orientation5606
* depends on the touch device, some devices only support binary5607
* rotation values between 0 and 90 degrees.5608
*5609
* This event is only sent by the compositor if the touch device5610
* supports orientation reports.5611
* @param id the unique ID of this touch point5612
* @param orientation angle between major axis and positive surface y-axis in degrees5613
* @since 65614
*/5615
void (*orientation)(void *data,5616
struct wl_touch *wl_touch,5617
int32_t id,5618
wl_fixed_t orientation);5619
};5621
/**5622
* @ingroup iface_wl_touch5623
*/5624
static inline int5625
wl_touch_add_listener(struct wl_touch *wl_touch,5626
const struct wl_touch_listener *listener, void *data)5627
{5628
return wl_proxy_add_listener((struct wl_proxy *) wl_touch,5629
(void (**)(void)) listener, data);5630
}5632
#define WL_TOUCH_RELEASE 05634
/**5635
* @ingroup iface_wl_touch5636
*/5637
#define WL_TOUCH_DOWN_SINCE_VERSION 15638
/**5639
* @ingroup iface_wl_touch5640
*/5641
#define WL_TOUCH_UP_SINCE_VERSION 15642
/**5643
* @ingroup iface_wl_touch5644
*/5645
#define WL_TOUCH_MOTION_SINCE_VERSION 15646
/**5647
* @ingroup iface_wl_touch5648
*/5649
#define WL_TOUCH_FRAME_SINCE_VERSION 15650
/**5651
* @ingroup iface_wl_touch5652
*/5653
#define WL_TOUCH_CANCEL_SINCE_VERSION 15654
/**5655
* @ingroup iface_wl_touch5656
*/5657
#define WL_TOUCH_SHAPE_SINCE_VERSION 65658
/**5659
* @ingroup iface_wl_touch5660
*/5661
#define WL_TOUCH_ORIENTATION_SINCE_VERSION 65663
/**5664
* @ingroup iface_wl_touch5665
*/5666
#define WL_TOUCH_RELEASE_SINCE_VERSION 35668
/** @ingroup iface_wl_touch */5669
static inline void5670
wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)5671
{5672
wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);5673
}5675
/** @ingroup iface_wl_touch */5676
static inline void *5677
wl_touch_get_user_data(struct wl_touch *wl_touch)5678
{5679
return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);5680
}5682
static inline uint32_t5683
wl_touch_get_version(struct wl_touch *wl_touch)5684
{5685
return wl_proxy_get_version((struct wl_proxy *) wl_touch);5686
}5688
/** @ingroup iface_wl_touch */5689
static inline void5690
wl_touch_destroy(struct wl_touch *wl_touch)5691
{5692
wl_proxy_destroy((struct wl_proxy *) wl_touch);5693
}5695
/**5696
* @ingroup iface_wl_touch5697
*/5698
static inline void5699
wl_touch_release(struct wl_touch *wl_touch)5700
{5701
wl_proxy_marshal_flags((struct wl_proxy *) wl_touch,5702
WL_TOUCH_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_touch), WL_MARSHAL_FLAG_DESTROY);5703
}5705
#ifndef WL_OUTPUT_SUBPIXEL_ENUM5706
#define WL_OUTPUT_SUBPIXEL_ENUM5707
/**5708
* @ingroup iface_wl_output5709
* subpixel geometry information5710
*5711
* This enumeration describes how the physical5712
* pixels on an output are laid out.5713
*/5714
enum wl_output_subpixel {5715
/**5716
* unknown geometry5717
*/5718
WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,5719
/**5720
* no geometry5721
*/5722
WL_OUTPUT_SUBPIXEL_NONE = 1,5723
/**5724
* horizontal RGB5725
*/5726
WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,5727
/**5728
* horizontal BGR5729
*/5730
WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,5731
/**5732
* vertical RGB5733
*/5734
WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,5735
/**5736
* vertical BGR5737
*/5738
WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,5739
};5740
#endif /* WL_OUTPUT_SUBPIXEL_ENUM */5742
#ifndef WL_OUTPUT_TRANSFORM_ENUM5743
#define WL_OUTPUT_TRANSFORM_ENUM5744
/**5745
* @ingroup iface_wl_output5746
* transformation applied to buffer contents5747
*5748
* This describes transformations that clients and compositors apply to5749
* buffer contents.5750
*5751
* The flipped values correspond to an initial flip around a5752
* vertical axis followed by rotation.5753
*5754
* The purpose is mainly to allow clients to render accordingly and5755
* tell the compositor, so that for fullscreen surfaces, the5756
* compositor will still be able to scan out directly from client5757
* surfaces.5758
*/5759
enum wl_output_transform {5760
/**5761
* no transform5762
*/5763
WL_OUTPUT_TRANSFORM_NORMAL = 0,5764
/**5765
* 90 degrees counter-clockwise5766
*/5767
WL_OUTPUT_TRANSFORM_90 = 1,5768
/**5769
* 180 degrees counter-clockwise5770
*/5771
WL_OUTPUT_TRANSFORM_180 = 2,5772
/**5773
* 270 degrees counter-clockwise5774
*/5775
WL_OUTPUT_TRANSFORM_270 = 3,5776
/**5777
* 180 degree flip around a vertical axis5778
*/5779
WL_OUTPUT_TRANSFORM_FLIPPED = 4,5780
/**5781
* flip and rotate 90 degrees counter-clockwise5782
*/5783
WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,5784
/**5785
* flip and rotate 180 degrees counter-clockwise5786
*/5787
WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,5788
/**5789
* flip and rotate 270 degrees counter-clockwise5790
*/5791
WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,5792
};5793
#endif /* WL_OUTPUT_TRANSFORM_ENUM */5795
#ifndef WL_OUTPUT_MODE_ENUM5796
#define WL_OUTPUT_MODE_ENUM5797
/**5798
* @ingroup iface_wl_output5799
* mode information5800
*5801
* These flags describe properties of an output mode.5802
* They are used in the flags bitfield of the mode event.5803
*/5804
enum wl_output_mode {5805
/**5806
* indicates this is the current mode5807
*/5808
WL_OUTPUT_MODE_CURRENT = 0x1,5809
/**5810
* indicates this is the preferred mode5811
*/5812
WL_OUTPUT_MODE_PREFERRED = 0x2,5813
};5814
#endif /* WL_OUTPUT_MODE_ENUM */5816
/**5817
* @ingroup iface_wl_output5818
* @struct wl_output_listener5819
*/5820
struct wl_output_listener {5821
/**5822
* properties of the output5823
*5824
* The geometry event describes geometric properties of the5825
* output. The event is sent when binding to the output object and5826
* whenever any of the properties change.5827
*5828
* The physical size can be set to zero if it doesn't make sense5829
* for this output (e.g. for projectors or virtual outputs).5830
*5831
* The geometry event will be followed by a done event (starting5832
* from version 2).5833
*5834
* Clients should use wl_surface.preferred_buffer_transform instead5835
* of the transform advertised by this event to find the preferred5836
* buffer transform to use for a surface.5837
*5838
* Note: wl_output only advertises partial information about the5839
* output position and identification. Some compositors, for5840
* instance those not implementing a desktop-style output layout or5841
* those exposing virtual outputs, might fake this information.5842
* Instead of using x and y, clients should use5843
* xdg_output.logical_position. Instead of using make and model,5844
* clients should use name and description.5845
* @param x x position within the global compositor space5846
* @param y y position within the global compositor space5847
* @param physical_width width in millimeters of the output5848
* @param physical_height height in millimeters of the output5849
* @param subpixel subpixel orientation of the output5850
* @param make textual description of the manufacturer5851
* @param model textual description of the model5852
* @param transform additional transformation applied to buffer contents during presentation5853
*/5854
void (*geometry)(void *data,5855
struct wl_output *wl_output,5856
int32_t x,5857
int32_t y,5858
int32_t physical_width,5859
int32_t physical_height,5860
int32_t subpixel,5861
const char *make,5862
const char *model,5863
int32_t transform);5864
/**5865
* advertise available modes for the output5866
*5867
* The mode event describes an available mode for the output.5868
*5869
* The event is sent when binding to the output object and there5870
* will always be one mode, the current mode. The event is sent5871
* again if an output changes mode, for the mode that is now5872
* current. In other words, the current mode is always the last5873
* mode that was received with the current flag set.5874
*5875
* Non-current modes are deprecated. A compositor can decide to5876
* only advertise the current mode and never send other modes.5877
* Clients should not rely on non-current modes.5878
*5879
* The size of a mode is given in physical hardware units of the5880
* output device. This is not necessarily the same as the output5881
* size in the global compositor space. For instance, the output5882
* may be scaled, as described in wl_output.scale, or transformed,5883
* as described in wl_output.transform. Clients willing to retrieve5884
* the output size in the global compositor space should use5885
* xdg_output.logical_size instead.5886
*5887
* The vertical refresh rate can be set to zero if it doesn't make5888
* sense for this output (e.g. for virtual outputs).5889
*5890
* The mode event will be followed by a done event (starting from5891
* version 2).5892
*5893
* Clients should not use the refresh rate to schedule frames.5894
* Instead, they should use the wl_surface.frame event or the5895
* presentation-time protocol.5896
*5897
* Note: this information is not always meaningful for all outputs.5898
* Some compositors, such as those exposing virtual outputs, might5899
* fake the refresh rate or the size.5900
* @param flags bitfield of mode flags5901
* @param width width of the mode in hardware units5902
* @param height height of the mode in hardware units5903
* @param refresh vertical refresh rate in mHz5904
*/5905
void (*mode)(void *data,5906
struct wl_output *wl_output,5907
uint32_t flags,5908
int32_t width,5909
int32_t height,5910
int32_t refresh);5911
/**5912
* sent all information about output5913
*5914
* This event is sent after all other properties have been sent5915
* after binding to the output object and after any other property5916
* changes done after that. This allows changes to the output5917
* properties to be seen as atomic, even if they happen via5918
* multiple events.5919
* @since 25920
*/5921
void (*done)(void *data,5922
struct wl_output *wl_output);5923
/**5924
* output scaling properties5925
*5926
* This event contains scaling geometry information that is not5927
* in the geometry event. It may be sent after binding the output5928
* object or if the output scale changes later. The compositor will5929
* emit a non-zero, positive value for scale. If it is not sent,5930
* the client should assume a scale of 1.5931
*5932
* A scale larger than 1 means that the compositor will5933
* automatically scale surface buffers by this amount when5934
* rendering. This is used for very high resolution displays where5935
* applications rendering at the native resolution would be too5936
* small to be legible.5937
*5938
* Clients should use wl_surface.preferred_buffer_scale instead of5939
* this event to find the preferred buffer scale to use for a5940
* surface.5941
*5942
* The scale event will be followed by a done event.5943
* @param factor scaling factor of output5944
* @since 25945
*/5946
void (*scale)(void *data,5947
struct wl_output *wl_output,5948
int32_t factor);5949
/**5950
* name of this output5951
*5952
* Many compositors will assign user-friendly names to their5953
* outputs, show them to the user, allow the user to refer to an5954
* output, etc. The client may wish to know this name as well to5955
* offer the user similar behaviors.5956
*5957
* The name is a UTF-8 string with no convention defined for its5958
* contents. Each name is unique among all wl_output globals. The5959
* name is only guaranteed to be unique for the compositor5960
* instance.5961
*5962
* The same output name is used for all clients for a given5963
* wl_output global. Thus, the name can be shared across processes5964
* to refer to a specific wl_output global.5965
*5966
* The name is not guaranteed to be persistent across sessions,5967
* thus cannot be used to reliably identify an output in e.g.5968
* configuration files.5969
*5970
* Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.5971
* However, do not assume that the name is a reflection of an5972
* underlying DRM connector, X11 connection, etc.5973
*5974
* The name event is sent after binding the output object. This5975
* event is only sent once per output object, and the name does not5976
* change over the lifetime of the wl_output global.5977
*5978
* Compositors may re-use the same output name if the wl_output5979
* global is destroyed and re-created later. Compositors should5980
* avoid re-using the same name if possible.5981
*5982
* The name event will be followed by a done event.5983
* @param name output name5984
* @since 45985
*/5986
void (*name)(void *data,5987
struct wl_output *wl_output,5988
const char *name);5989
/**5990
* human-readable description of this output5991
*5992
* Many compositors can produce human-readable descriptions of5993
* their outputs. The client may wish to know this description as5994
* well, e.g. for output selection purposes.5995
*5996
* The description is a UTF-8 string with no convention defined for5997
* its contents. The description is not guaranteed to be unique5998
* among all wl_output globals. Examples might include 'Foocorp 11"5999
* Display' or 'Virtual X11 output via :1'.6000
*6001
* The description event is sent after binding the output object6002
* and whenever the description changes. The description is6003
* optional, and may not be sent at all.6004
*6005
* The description event will be followed by a done event.6006
* @param description output description6007
* @since 46008
*/6009
void (*description)(void *data,6010
struct wl_output *wl_output,6011
const char *description);6012
};6014
/**6015
* @ingroup iface_wl_output6016
*/6017
static inline int6018
wl_output_add_listener(struct wl_output *wl_output,6019
const struct wl_output_listener *listener, void *data)6020
{6021
return wl_proxy_add_listener((struct wl_proxy *) wl_output,6022
(void (**)(void)) listener, data);6023
}6025
#define WL_OUTPUT_RELEASE 06027
/**6028
* @ingroup iface_wl_output6029
*/6030
#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 16031
/**6032
* @ingroup iface_wl_output6033
*/6034
#define WL_OUTPUT_MODE_SINCE_VERSION 16035
/**6036
* @ingroup iface_wl_output6037
*/6038
#define WL_OUTPUT_DONE_SINCE_VERSION 26039
/**6040
* @ingroup iface_wl_output6041
*/6042
#define WL_OUTPUT_SCALE_SINCE_VERSION 26043
/**6044
* @ingroup iface_wl_output6045
*/6046
#define WL_OUTPUT_NAME_SINCE_VERSION 46047
/**6048
* @ingroup iface_wl_output6049
*/6050
#define WL_OUTPUT_DESCRIPTION_SINCE_VERSION 46052
/**6053
* @ingroup iface_wl_output6054
*/6055
#define WL_OUTPUT_RELEASE_SINCE_VERSION 36057
/** @ingroup iface_wl_output */6058
static inline void6059
wl_output_set_user_data(struct wl_output *wl_output, void *user_data)6060
{6061
wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);6062
}6064
/** @ingroup iface_wl_output */6065
static inline void *6066
wl_output_get_user_data(struct wl_output *wl_output)6067
{6068
return wl_proxy_get_user_data((struct wl_proxy *) wl_output);6069
}6071
static inline uint32_t6072
wl_output_get_version(struct wl_output *wl_output)6073
{6074
return wl_proxy_get_version((struct wl_proxy *) wl_output);6075
}6077
/** @ingroup iface_wl_output */6078
static inline void6079
wl_output_destroy(struct wl_output *wl_output)6080
{6081
wl_proxy_destroy((struct wl_proxy *) wl_output);6082
}6084
/**6085
* @ingroup iface_wl_output6086
*6087
* Using this request a client can tell the server that it is not going to6088
* use the output object anymore.6089
*/6090
static inline void6091
wl_output_release(struct wl_output *wl_output)6092
{6093
wl_proxy_marshal_flags((struct wl_proxy *) wl_output,6094
WL_OUTPUT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_output), WL_MARSHAL_FLAG_DESTROY);6095
}6097
#define WL_REGION_DESTROY 06098
#define WL_REGION_ADD 16099
#define WL_REGION_SUBTRACT 26102
/**6103
* @ingroup iface_wl_region6104
*/6105
#define WL_REGION_DESTROY_SINCE_VERSION 16106
/**6107
* @ingroup iface_wl_region6108
*/6109
#define WL_REGION_ADD_SINCE_VERSION 16110
/**6111
* @ingroup iface_wl_region6112
*/6113
#define WL_REGION_SUBTRACT_SINCE_VERSION 16115
/** @ingroup iface_wl_region */6116
static inline void6117
wl_region_set_user_data(struct wl_region *wl_region, void *user_data)6118
{6119
wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);6120
}6122
/** @ingroup iface_wl_region */6123
static inline void *6124
wl_region_get_user_data(struct wl_region *wl_region)6125
{6126
return wl_proxy_get_user_data((struct wl_proxy *) wl_region);6127
}6129
static inline uint32_t6130
wl_region_get_version(struct wl_region *wl_region)6131
{6132
return wl_proxy_get_version((struct wl_proxy *) wl_region);6133
}6135
/**6136
* @ingroup iface_wl_region6137
*6138
* Destroy the region. This will invalidate the object ID.6139
*/6140
static inline void6141
wl_region_destroy(struct wl_region *wl_region)6142
{6143
wl_proxy_marshal_flags((struct wl_proxy *) wl_region,6144
WL_REGION_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), WL_MARSHAL_FLAG_DESTROY);6145
}6147
/**6148
* @ingroup iface_wl_region6149
*6150
* Add the specified rectangle to the region.6151
*/6152
static inline void6153
wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)6154
{6155
wl_proxy_marshal_flags((struct wl_proxy *) wl_region,6156
WL_REGION_ADD, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);6157
}6159
/**6160
* @ingroup iface_wl_region6161
*6162
* Subtract the specified rectangle from the region.6163
*/6164
static inline void6165
wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)6166
{6167
wl_proxy_marshal_flags((struct wl_proxy *) wl_region,6168
WL_REGION_SUBTRACT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);6169
}6171
#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM6172
#define WL_SUBCOMPOSITOR_ERROR_ENUM6173
enum wl_subcompositor_error {6174
/**6175
* the to-be sub-surface is invalid6176
*/6177
WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,6178
/**6179
* the to-be sub-surface parent is invalid6180
*/6181
WL_SUBCOMPOSITOR_ERROR_BAD_PARENT = 1,6182
};6183
#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */6185
#define WL_SUBCOMPOSITOR_DESTROY 06186
#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 16189
/**6190
* @ingroup iface_wl_subcompositor6191
*/6192
#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 16193
/**6194
* @ingroup iface_wl_subcompositor6195
*/6196
#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 16198
/** @ingroup iface_wl_subcompositor */6199
static inline void6200
wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)6201
{6202
wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);6203
}6205
/** @ingroup iface_wl_subcompositor */6206
static inline void *6207
wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)6208
{6209
return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);6210
}6212
static inline uint32_t6213
wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)6214
{6215
return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);6216
}6218
/**6219
* @ingroup iface_wl_subcompositor6220
*6221
* Informs the server that the client will not be using this6222
* protocol object anymore. This does not affect any other6223
* objects, wl_subsurface objects included.6224
*/6225
static inline void6226
wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)6227
{6228
wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,6229
WL_SUBCOMPOSITOR_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), WL_MARSHAL_FLAG_DESTROY);6230
}6232
/**6233
* @ingroup iface_wl_subcompositor6234
*6235
* Create a sub-surface interface for the given surface, and6236
* associate it with the given parent surface. This turns a6237
* plain wl_surface into a sub-surface.6238
*6239
* The to-be sub-surface must not already have another role, and it6240
* must not have an existing wl_subsurface object. Otherwise the6241
* bad_surface protocol error is raised.6242
*6243
* Adding sub-surfaces to a parent is a double-buffered operation on the6244
* parent (see wl_surface.commit). The effect of adding a sub-surface6245
* becomes visible on the next time the state of the parent surface is6246
* applied.6247
*6248
* The parent surface must not be one of the child surface's descendants,6249
* and the parent must be different from the child surface, otherwise the6250
* bad_parent protocol error is raised.6251
*6252
* This request modifies the behaviour of wl_surface.commit request on6253
* the sub-surface, see the documentation on wl_subsurface interface.6254
*/6255
static inline struct wl_subsurface *6256
wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)6257
{6258
struct wl_proxy *id;6260
id = wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,6261
WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), 0, NULL, surface, parent);6263
return (struct wl_subsurface *) id;6264
}6266
#ifndef WL_SUBSURFACE_ERROR_ENUM6267
#define WL_SUBSURFACE_ERROR_ENUM6268
enum wl_subsurface_error {6269
/**6270
* wl_surface is not a sibling or the parent6271
*/6272
WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,6273
};6274
#endif /* WL_SUBSURFACE_ERROR_ENUM */6276
#define WL_SUBSURFACE_DESTROY 06277
#define WL_SUBSURFACE_SET_POSITION 16278
#define WL_SUBSURFACE_PLACE_ABOVE 26279
#define WL_SUBSURFACE_PLACE_BELOW 36280
#define WL_SUBSURFACE_SET_SYNC 46281
#define WL_SUBSURFACE_SET_DESYNC 56284
/**6285
* @ingroup iface_wl_subsurface6286
*/6287
#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 16288
/**6289
* @ingroup iface_wl_subsurface6290
*/6291
#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 16292
/**6293
* @ingroup iface_wl_subsurface6294
*/6295
#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 16296
/**6297
* @ingroup iface_wl_subsurface6298
*/6299
#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 16300
/**6301
* @ingroup iface_wl_subsurface6302
*/6303
#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 16304
/**6305
* @ingroup iface_wl_subsurface6306
*/6307
#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 16309
/** @ingroup iface_wl_subsurface */6310
static inline void6311
wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)6312
{6313
wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);6314
}6316
/** @ingroup iface_wl_subsurface */6317
static inline void *6318
wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)6319
{6320
return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);6321
}6323
static inline uint32_t6324
wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)6325
{6326
return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);6327
}6329
/**6330
* @ingroup iface_wl_subsurface6331
*6332
* The sub-surface interface is removed from the wl_surface object6333
* that was turned into a sub-surface with a6334
* wl_subcompositor.get_subsurface request. The wl_surface's association6335
* to the parent is deleted. The wl_surface is unmapped immediately.6336
*/6337
static inline void6338
wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)6339
{6340
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6341
WL_SUBSURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), WL_MARSHAL_FLAG_DESTROY);6342
}6344
/**6345
* @ingroup iface_wl_subsurface6346
*6347
* This schedules a sub-surface position change.6348
* The sub-surface will be moved so that its origin (top left6349
* corner pixel) will be at the location x, y of the parent surface6350
* coordinate system. The coordinates are not restricted to the parent6351
* surface area. Negative values are allowed.6352
*6353
* The scheduled coordinates will take effect whenever the state of the6354
* parent surface is applied.6355
*6356
* If more than one set_position request is invoked by the client before6357
* the commit of the parent surface, the position of a new request always6358
* replaces the scheduled position from any previous request.6359
*6360
* The initial position is 0, 0.6361
*/6362
static inline void6363
wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)6364
{6365
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6366
WL_SUBSURFACE_SET_POSITION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, x, y);6367
}6369
/**6370
* @ingroup iface_wl_subsurface6371
*6372
* This sub-surface is taken from the stack, and put back just6373
* above the reference surface, changing the z-order of the sub-surfaces.6374
* The reference surface must be one of the sibling surfaces, or the6375
* parent surface. Using any other surface, including this sub-surface,6376
* will cause a protocol error.6377
*6378
* The z-order is double-buffered. Requests are handled in order and6379
* applied immediately to a pending state. The final pending state is6380
* copied to the active state the next time the state of the parent6381
* surface is applied.6382
*6383
* A new sub-surface is initially added as the top-most in the stack6384
* of its siblings and parent.6385
*/6386
static inline void6387
wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)6388
{6389
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6390
WL_SUBSURFACE_PLACE_ABOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);6391
}6393
/**6394
* @ingroup iface_wl_subsurface6395
*6396
* The sub-surface is placed just below the reference surface.6397
* See wl_subsurface.place_above.6398
*/6399
static inline void6400
wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)6401
{6402
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6403
WL_SUBSURFACE_PLACE_BELOW, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);6404
}6406
/**6407
* @ingroup iface_wl_subsurface6408
*6409
* Change the commit behaviour of the sub-surface to synchronized6410
* mode, also described as the parent dependent mode.6411
*6412
* In synchronized mode, wl_surface.commit on a sub-surface will6413
* accumulate the committed state in a cache, but the state will6414
* not be applied and hence will not change the compositor output.6415
* The cached state is applied to the sub-surface immediately after6416
* the parent surface's state is applied. This ensures atomic6417
* updates of the parent and all its synchronized sub-surfaces.6418
* Applying the cached state will invalidate the cache, so further6419
* parent surface commits do not (re-)apply old state.6420
*6421
* See wl_subsurface for the recursive effect of this mode.6422
*/6423
static inline void6424
wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)6425
{6426
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6427
WL_SUBSURFACE_SET_SYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);6428
}6430
/**6431
* @ingroup iface_wl_subsurface6432
*6433
* Change the commit behaviour of the sub-surface to desynchronized6434
* mode, also described as independent or freely running mode.6435
*6436
* In desynchronized mode, wl_surface.commit on a sub-surface will6437
* apply the pending state directly, without caching, as happens6438
* normally with a wl_surface. Calling wl_surface.commit on the6439
* parent surface has no effect on the sub-surface's wl_surface6440
* state. This mode allows a sub-surface to be updated on its own.6441
*6442
* If cached state exists when wl_surface.commit is called in6443
* desynchronized mode, the pending state is added to the cached6444
* state, and applied as a whole. This invalidates the cache.6445
*6446
* Note: even if a sub-surface is set to desynchronized, a parent6447
* sub-surface may override it to behave as synchronized. For details,6448
* see wl_subsurface.6449
*6450
* If a surface's parent surface behaves as desynchronized, then6451
* the cached state is applied on set_desync.6452
*/6453
static inline void6454
wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)6455
{6456
wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6457
WL_SUBSURFACE_SET_DESYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);6458
}6460
#define WL_FIXES_DESTROY 06461
#define WL_FIXES_DESTROY_REGISTRY 16464
/**6465
* @ingroup iface_wl_fixes6466
*/6467
#define WL_FIXES_DESTROY_SINCE_VERSION 16468
/**6469
* @ingroup iface_wl_fixes6470
*/6471
#define WL_FIXES_DESTROY_REGISTRY_SINCE_VERSION 16473
/** @ingroup iface_wl_fixes */6474
static inline void6475
wl_fixes_set_user_data(struct wl_fixes *wl_fixes, void *user_data)6476
{6477
wl_proxy_set_user_data((struct wl_proxy *) wl_fixes, user_data);6478
}6480
/** @ingroup iface_wl_fixes */6481
static inline void *6482
wl_fixes_get_user_data(struct wl_fixes *wl_fixes)6483
{6484
return wl_proxy_get_user_data((struct wl_proxy *) wl_fixes);6485
}6487
static inline uint32_t6488
wl_fixes_get_version(struct wl_fixes *wl_fixes)6489
{6490
return wl_proxy_get_version((struct wl_proxy *) wl_fixes);6491
}6493
/**6494
* @ingroup iface_wl_fixes6495
*/6496
static inline void6497
wl_fixes_destroy(struct wl_fixes *wl_fixes)6498
{6499
wl_proxy_marshal_flags((struct wl_proxy *) wl_fixes,6500
WL_FIXES_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_fixes), WL_MARSHAL_FLAG_DESTROY);6501
}6503
/**6504
* @ingroup iface_wl_fixes6505
*6506
* This request destroys a wl_registry object.6507
*6508
* The client should no longer use the wl_registry after making this6509
* request.6510
*6511
* The compositor will emit a wl_display.delete_id event with the object ID6512
* of the registry and will no longer emit any events on the registry. The6513
* client should re-use the object ID once it receives the6514
* wl_display.delete_id event.6515
*/6516
static inline void6517
wl_fixes_destroy_registry(struct wl_fixes *wl_fixes, struct wl_registry *registry)6518
{6519
wl_proxy_marshal_flags((struct wl_proxy *) wl_fixes,6520
WL_FIXES_DESTROY_REGISTRY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_fixes), 0, registry);6521
}6523
#ifdef __cplusplus6524
}6525
#endif6527
#endif