Path: blob/master/thirdparty/linuxbsd_headers/wayland/wayland-client-protocol.h
9898 views
/* Generated by wayland-scanner 1.21.0 */12#ifndef WAYLAND_CLIENT_PROTOCOL_H3#define WAYLAND_CLIENT_PROTOCOL_H45#include <stdint.h>6#include <stddef.h>7#include "wayland-client.h"89#ifdef __cplusplus10extern "C" {11#endif1213/**14* @page page_wayland The wayland protocol15* @section page_ifaces_wayland Interfaces16* - @subpage page_iface_wl_display - core global object17* - @subpage page_iface_wl_registry - global registry object18* - @subpage page_iface_wl_callback - callback object19* - @subpage page_iface_wl_compositor - the compositor singleton20* - @subpage page_iface_wl_shm_pool - a shared memory pool21* - @subpage page_iface_wl_shm - shared memory support22* - @subpage page_iface_wl_buffer - content for a wl_surface23* - @subpage page_iface_wl_data_offer - offer to transfer data24* - @subpage page_iface_wl_data_source - offer to transfer data25* - @subpage page_iface_wl_data_device - data transfer device26* - @subpage page_iface_wl_data_device_manager - data transfer interface27* - @subpage page_iface_wl_shell - create desktop-style surfaces28* - @subpage page_iface_wl_shell_surface - desktop-style metadata interface29* - @subpage page_iface_wl_surface - an onscreen surface30* - @subpage page_iface_wl_seat - group of input devices31* - @subpage page_iface_wl_pointer - pointer input device32* - @subpage page_iface_wl_keyboard - keyboard input device33* - @subpage page_iface_wl_touch - touchscreen input device34* - @subpage page_iface_wl_output - compositor output region35* - @subpage page_iface_wl_region - region interface36* - @subpage page_iface_wl_subcompositor - sub-surface compositing37* - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface38* @section page_copyright_wayland Copyright39* <pre>40*41* Copyright © 2008-2011 Kristian Høgsberg42* Copyright © 2010-2011 Intel Corporation43* Copyright © 2012-2013 Collabora, Ltd.44*45* Permission is hereby granted, free of charge, to any person46* obtaining a copy of this software and associated documentation files47* (the "Software"), to deal in the Software without restriction,48* including without limitation the rights to use, copy, modify, merge,49* publish, distribute, sublicense, and/or sell copies of the Software,50* and to permit persons to whom the Software is furnished to do so,51* subject to the following conditions:52*53* The above copyright notice and this permission notice (including the54* next paragraph) shall be included in all copies or substantial55* portions of the Software.56*57* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,58* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF59* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND60* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS61* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN62* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN63* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE64* SOFTWARE.65* </pre>66*/67struct wl_buffer;68struct wl_callback;69struct wl_compositor;70struct wl_data_device;71struct wl_data_device_manager;72struct wl_data_offer;73struct wl_data_source;74struct wl_display;75struct wl_keyboard;76struct wl_output;77struct wl_pointer;78struct wl_region;79struct wl_registry;80struct wl_seat;81struct wl_shell;82struct wl_shell_surface;83struct wl_shm;84struct wl_shm_pool;85struct wl_subcompositor;86struct wl_subsurface;87struct wl_surface;88struct wl_touch;8990#ifndef WL_DISPLAY_INTERFACE91#define WL_DISPLAY_INTERFACE92/**93* @page page_iface_wl_display wl_display94* @section page_iface_wl_display_desc Description95*96* The core global object. This is a special singleton object. It97* is used for internal Wayland protocol features.98* @section page_iface_wl_display_api API99* See @ref iface_wl_display.100*/101/**102* @defgroup iface_wl_display The wl_display interface103*104* The core global object. This is a special singleton object. It105* is used for internal Wayland protocol features.106*/107extern const struct wl_interface wl_display_interface;108#endif109#ifndef WL_REGISTRY_INTERFACE110#define WL_REGISTRY_INTERFACE111/**112* @page page_iface_wl_registry wl_registry113* @section page_iface_wl_registry_desc Description114*115* The singleton global registry object. The server has a number of116* global objects that are available to all clients. These objects117* typically represent an actual object in the server (for example,118* an input device) or they are singleton objects that provide119* extension functionality.120*121* When a client creates a registry object, the registry object122* will emit a global event for each global currently in the123* registry. Globals come and go as a result of device or124* monitor hotplugs, reconfiguration or other events, and the125* registry will send out global and global_remove events to126* keep the client up to date with the changes. To mark the end127* of the initial burst of events, the client can use the128* wl_display.sync request immediately after calling129* wl_display.get_registry.130*131* A client can bind to a global object by using the bind132* request. This creates a client-side handle that lets the object133* emit events to the client and lets the client invoke requests on134* the object.135* @section page_iface_wl_registry_api API136* See @ref iface_wl_registry.137*/138/**139* @defgroup iface_wl_registry The wl_registry interface140*141* The singleton global registry object. The server has a number of142* global objects that are available to all clients. These objects143* typically represent an actual object in the server (for example,144* an input device) or they are singleton objects that provide145* extension functionality.146*147* When a client creates a registry object, the registry object148* will emit a global event for each global currently in the149* registry. Globals come and go as a result of device or150* monitor hotplugs, reconfiguration or other events, and the151* registry will send out global and global_remove events to152* keep the client up to date with the changes. To mark the end153* of the initial burst of events, the client can use the154* wl_display.sync request immediately after calling155* wl_display.get_registry.156*157* A client can bind to a global object by using the bind158* request. This creates a client-side handle that lets the object159* emit events to the client and lets the client invoke requests on160* the object.161*/162extern const struct wl_interface wl_registry_interface;163#endif164#ifndef WL_CALLBACK_INTERFACE165#define WL_CALLBACK_INTERFACE166/**167* @page page_iface_wl_callback wl_callback168* @section page_iface_wl_callback_desc Description169*170* Clients can handle the 'done' event to get notified when171* the related request is done.172* @section page_iface_wl_callback_api API173* See @ref iface_wl_callback.174*/175/**176* @defgroup iface_wl_callback The wl_callback interface177*178* Clients can handle the 'done' event to get notified when179* the related request is done.180*/181extern const struct wl_interface wl_callback_interface;182#endif183#ifndef WL_COMPOSITOR_INTERFACE184#define WL_COMPOSITOR_INTERFACE185/**186* @page page_iface_wl_compositor wl_compositor187* @section page_iface_wl_compositor_desc Description188*189* A compositor. This object is a singleton global. The190* compositor is in charge of combining the contents of multiple191* surfaces into one displayable output.192* @section page_iface_wl_compositor_api API193* See @ref iface_wl_compositor.194*/195/**196* @defgroup iface_wl_compositor The wl_compositor interface197*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*/202extern const struct wl_interface wl_compositor_interface;203#endif204#ifndef WL_SHM_POOL_INTERFACE205#define WL_SHM_POOL_INTERFACE206/**207* @page page_iface_wl_shm_pool wl_shm_pool208* @section page_iface_wl_shm_pool_desc Description209*210* The wl_shm_pool object encapsulates a piece of memory shared211* between the compositor and client. Through the wl_shm_pool212* object, the client can allocate shared memory wl_buffer objects.213* All objects created through the same pool share the same214* underlying mapped memory. Reusing the mapped memory avoids the215* setup/teardown overhead and is useful when interactively resizing216* a surface or for many small buffers.217* @section page_iface_wl_shm_pool_api API218* See @ref iface_wl_shm_pool.219*/220/**221* @defgroup iface_wl_shm_pool The wl_shm_pool interface222*223* The wl_shm_pool object encapsulates a piece of memory shared224* between the compositor and client. Through the wl_shm_pool225* object, the client can allocate shared memory wl_buffer objects.226* All objects created through the same pool share the same227* underlying mapped memory. Reusing the mapped memory avoids the228* setup/teardown overhead and is useful when interactively resizing229* a surface or for many small buffers.230*/231extern const struct wl_interface wl_shm_pool_interface;232#endif233#ifndef WL_SHM_INTERFACE234#define WL_SHM_INTERFACE235/**236* @page page_iface_wl_shm wl_shm237* @section page_iface_wl_shm_desc Description238*239* A singleton global object that provides support for shared240* memory.241*242* Clients can create wl_shm_pool objects using the create_pool243* request.244*245* On binding the wl_shm object one or more format events246* are emitted to inform clients about the valid pixel formats247* that can be used for buffers.248* @section page_iface_wl_shm_api API249* See @ref iface_wl_shm.250*/251/**252* @defgroup iface_wl_shm The wl_shm interface253*254* A singleton global object that provides support for shared255* memory.256*257* Clients can create wl_shm_pool objects using the create_pool258* request.259*260* On binding the wl_shm object one or more format events261* are emitted to inform clients about the valid pixel formats262* that can be used for buffers.263*/264extern const struct wl_interface wl_shm_interface;265#endif266#ifndef WL_BUFFER_INTERFACE267#define WL_BUFFER_INTERFACE268/**269* @page page_iface_wl_buffer wl_buffer270* @section page_iface_wl_buffer_desc Description271*272* A buffer provides the content for a wl_surface. Buffers are273* created through factory interfaces such as wl_shm, wp_linux_buffer_params274* (from the linux-dmabuf protocol extension) or similar. It has a width and275* a height and can be attached to a wl_surface, but the mechanism by which a276* client provides and updates the contents is defined by the buffer factory277* interface.278*279* If the buffer uses a format that has an alpha channel, the alpha channel280* is assumed to be premultiplied in the color channels unless otherwise281* specified.282* @section page_iface_wl_buffer_api API283* See @ref iface_wl_buffer.284*/285/**286* @defgroup iface_wl_buffer The wl_buffer interface287*288* A buffer provides the content for a wl_surface. Buffers are289* created through factory interfaces such as wl_shm, wp_linux_buffer_params290* (from the linux-dmabuf protocol extension) or similar. It has a width and291* a height and can be attached to a wl_surface, but the mechanism by which a292* client provides and updates the contents is defined by the buffer factory293* interface.294*295* If the buffer uses a format that has an alpha channel, the alpha channel296* is assumed to be premultiplied in the color channels unless otherwise297* specified.298*/299extern const struct wl_interface wl_buffer_interface;300#endif301#ifndef WL_DATA_OFFER_INTERFACE302#define WL_DATA_OFFER_INTERFACE303/**304* @page page_iface_wl_data_offer wl_data_offer305* @section page_iface_wl_data_offer_desc Description306*307* A wl_data_offer represents a piece of data offered for transfer308* by another client (the source client). It is used by the309* copy-and-paste and drag-and-drop mechanisms. The offer310* describes the different mime types that the data can be311* converted to and provides the mechanism for transferring the312* data directly from the source client.313* @section page_iface_wl_data_offer_api API314* See @ref iface_wl_data_offer.315*/316/**317* @defgroup iface_wl_data_offer The wl_data_offer interface318*319* A wl_data_offer represents a piece of data offered for transfer320* by another client (the source client). It is used by the321* copy-and-paste and drag-and-drop mechanisms. The offer322* describes the different mime types that the data can be323* converted to and provides the mechanism for transferring the324* data directly from the source client.325*/326extern const struct wl_interface wl_data_offer_interface;327#endif328#ifndef WL_DATA_SOURCE_INTERFACE329#define WL_DATA_SOURCE_INTERFACE330/**331* @page page_iface_wl_data_source wl_data_source332* @section page_iface_wl_data_source_desc Description333*334* The wl_data_source object is the source side of a wl_data_offer.335* It is created by the source client in a data transfer and336* provides a way to describe the offered data and a way to respond337* to requests to transfer the data.338* @section page_iface_wl_data_source_api API339* See @ref iface_wl_data_source.340*/341/**342* @defgroup iface_wl_data_source The wl_data_source interface343*344* The wl_data_source object is the source side of a wl_data_offer.345* It is created by the source client in a data transfer and346* provides a way to describe the offered data and a way to respond347* to requests to transfer the data.348*/349extern const struct wl_interface wl_data_source_interface;350#endif351#ifndef WL_DATA_DEVICE_INTERFACE352#define WL_DATA_DEVICE_INTERFACE353/**354* @page page_iface_wl_data_device wl_data_device355* @section page_iface_wl_data_device_desc Description356*357* There is one wl_data_device per seat which can be obtained358* from the global wl_data_device_manager singleton.359*360* A wl_data_device provides access to inter-client data transfer361* mechanisms such as copy-and-paste and drag-and-drop.362* @section page_iface_wl_data_device_api API363* See @ref iface_wl_data_device.364*/365/**366* @defgroup iface_wl_data_device The wl_data_device interface367*368* There is one wl_data_device per seat which can be obtained369* from the global wl_data_device_manager singleton.370*371* A wl_data_device provides access to inter-client data transfer372* mechanisms such as copy-and-paste and drag-and-drop.373*/374extern const struct wl_interface wl_data_device_interface;375#endif376#ifndef WL_DATA_DEVICE_MANAGER_INTERFACE377#define WL_DATA_DEVICE_MANAGER_INTERFACE378/**379* @page page_iface_wl_data_device_manager wl_data_device_manager380* @section page_iface_wl_data_device_manager_desc Description381*382* The wl_data_device_manager is a singleton global object that383* provides access to inter-client data transfer mechanisms such as384* copy-and-paste and drag-and-drop. These mechanisms are tied to385* a wl_seat and this interface lets a client get a wl_data_device386* corresponding to a wl_seat.387*388* Depending on the version bound, the objects created from the bound389* wl_data_device_manager object will have different requirements for390* functioning properly. See wl_data_source.set_actions,391* wl_data_offer.accept and wl_data_offer.finish for details.392* @section page_iface_wl_data_device_manager_api API393* See @ref iface_wl_data_device_manager.394*/395/**396* @defgroup iface_wl_data_device_manager The wl_data_device_manager interface397*398* The wl_data_device_manager is a singleton global object that399* provides access to inter-client data transfer mechanisms such as400* copy-and-paste and drag-and-drop. These mechanisms are tied to401* a wl_seat and this interface lets a client get a wl_data_device402* corresponding to a wl_seat.403*404* Depending on the version bound, the objects created from the bound405* wl_data_device_manager object will have different requirements for406* functioning properly. See wl_data_source.set_actions,407* wl_data_offer.accept and wl_data_offer.finish for details.408*/409extern const struct wl_interface wl_data_device_manager_interface;410#endif411#ifndef WL_SHELL_INTERFACE412#define WL_SHELL_INTERFACE413/**414* @page page_iface_wl_shell wl_shell415* @section page_iface_wl_shell_desc Description416*417* This interface is implemented by servers that provide418* desktop-style user interfaces.419*420* It allows clients to associate a wl_shell_surface with421* a basic surface.422*423* Note! This protocol is deprecated and not intended for production use.424* For desktop-style user interfaces, use xdg_shell. Compositors and clients425* should not implement this interface.426* @section page_iface_wl_shell_api API427* See @ref iface_wl_shell.428*/429/**430* @defgroup iface_wl_shell The wl_shell interface431*432* This interface is implemented by servers that provide433* desktop-style user interfaces.434*435* It allows clients to associate a wl_shell_surface with436* a basic surface.437*438* Note! This protocol is deprecated and not intended for production use.439* For desktop-style user interfaces, use xdg_shell. Compositors and clients440* should not implement this interface.441*/442extern const struct wl_interface wl_shell_interface;443#endif444#ifndef WL_SHELL_SURFACE_INTERFACE445#define WL_SHELL_SURFACE_INTERFACE446/**447* @page page_iface_wl_shell_surface wl_shell_surface448* @section page_iface_wl_shell_surface_desc Description449*450* An interface that may be implemented by a wl_surface, for451* implementations that provide a desktop-style user interface.452*453* It provides requests to treat surfaces like toplevel, fullscreen454* or popup windows, move, resize or maximize them, associate455* metadata like title and class, etc.456*457* On the server side the object is automatically destroyed when458* the related wl_surface is destroyed. On the client side,459* wl_shell_surface_destroy() must be called before destroying460* the wl_surface object.461* @section page_iface_wl_shell_surface_api API462* See @ref iface_wl_shell_surface.463*/464/**465* @defgroup iface_wl_shell_surface The wl_shell_surface interface466*467* An interface that may be implemented by a wl_surface, for468* implementations that provide a desktop-style user interface.469*470* It provides requests to treat surfaces like toplevel, fullscreen471* or popup windows, move, resize or maximize them, associate472* metadata like title and class, etc.473*474* On the server side the object is automatically destroyed when475* the related wl_surface is destroyed. On the client side,476* wl_shell_surface_destroy() must be called before destroying477* the wl_surface object.478*/479extern const struct wl_interface wl_shell_surface_interface;480#endif481#ifndef WL_SURFACE_INTERFACE482#define WL_SURFACE_INTERFACE483/**484* @page page_iface_wl_surface wl_surface485* @section page_iface_wl_surface_desc Description486*487* A surface is a rectangular area that may be displayed on zero488* or more outputs, and shown any number of times at the compositor's489* discretion. They can present wl_buffers, receive user input, and490* define a local coordinate system.491*492* The size of a surface (and relative positions on it) is described493* in surface-local coordinates, which may differ from the buffer494* coordinates of the pixel content, in case a buffer_transform495* or a buffer_scale is used.496*497* A surface without a "role" is fairly useless: a compositor does498* not know where, when or how to present it. The role is the499* purpose of a wl_surface. Examples of roles are a cursor for a500* pointer (as set by wl_pointer.set_cursor), a drag icon501* (wl_data_device.start_drag), a sub-surface502* (wl_subcompositor.get_subsurface), and a window as defined by a503* shell protocol (e.g. wl_shell.get_shell_surface).504*505* A surface can have only one role at a time. Initially a506* wl_surface does not have a role. Once a wl_surface is given a507* role, it is set permanently for the whole lifetime of the508* wl_surface object. Giving the current role again is allowed,509* unless explicitly forbidden by the relevant interface510* specification.511*512* Surface roles are given by requests in other interfaces such as513* wl_pointer.set_cursor. The request should explicitly mention514* that this request gives a role to a wl_surface. Often, this515* request also creates a new protocol object that represents the516* role and adds additional functionality to wl_surface. When a517* client wants to destroy a wl_surface, they must destroy this 'role518* object' before the wl_surface.519*520* Destroying the role object does not remove the role from the521* wl_surface, but it may stop the wl_surface from "playing the role".522* For instance, if a wl_subsurface object is destroyed, the wl_surface523* it was created for will be unmapped and forget its position and524* z-order. It is allowed to create a wl_subsurface for the same525* wl_surface again, but it is not allowed to use the wl_surface as526* a cursor (cursor is a different role than sub-surface, and role527* switching is not allowed).528* @section page_iface_wl_surface_api API529* See @ref iface_wl_surface.530*/531/**532* @defgroup iface_wl_surface The wl_surface interface533*534* A surface is a rectangular area that may be displayed on zero535* or more outputs, and shown any number of times at the compositor's536* discretion. They can present wl_buffers, receive user input, and537* define a local coordinate system.538*539* The size of a surface (and relative positions on it) is described540* in surface-local coordinates, which may differ from the buffer541* coordinates of the pixel content, in case a buffer_transform542* or a buffer_scale is used.543*544* A surface without a "role" is fairly useless: a compositor does545* not know where, when or how to present it. The role is the546* purpose of a wl_surface. Examples of roles are a cursor for a547* pointer (as set by wl_pointer.set_cursor), a drag icon548* (wl_data_device.start_drag), a sub-surface549* (wl_subcompositor.get_subsurface), and a window as defined by a550* shell protocol (e.g. wl_shell.get_shell_surface).551*552* A surface can have only one role at a time. Initially a553* wl_surface does not have a role. Once a wl_surface is given a554* role, it is set permanently for the whole lifetime of the555* wl_surface object. Giving the current role again is allowed,556* unless explicitly forbidden by the relevant interface557* specification.558*559* Surface roles are given by requests in other interfaces such as560* wl_pointer.set_cursor. The request should explicitly mention561* that this request gives a role to a wl_surface. Often, this562* request also creates a new protocol object that represents the563* role and adds additional functionality to wl_surface. When a564* client wants to destroy a wl_surface, they must destroy this 'role565* object' before the wl_surface.566*567* Destroying the role object does not remove the role from the568* wl_surface, but it may stop the wl_surface from "playing the role".569* For instance, if a wl_subsurface object is destroyed, the wl_surface570* it was created for will be unmapped and forget its position and571* z-order. It is allowed to create a wl_subsurface for the same572* wl_surface again, but it is not allowed to use the wl_surface as573* a cursor (cursor is a different role than sub-surface, and role574* switching is not allowed).575*/576extern const struct wl_interface wl_surface_interface;577#endif578#ifndef WL_SEAT_INTERFACE579#define WL_SEAT_INTERFACE580/**581* @page page_iface_wl_seat wl_seat582* @section page_iface_wl_seat_desc Description583*584* A seat is a group of keyboards, pointer and touch devices. This585* object is published as a global during start up, or when such a586* device is hot plugged. A seat typically has a pointer and587* maintains a keyboard focus and a pointer focus.588* @section page_iface_wl_seat_api API589* See @ref iface_wl_seat.590*/591/**592* @defgroup iface_wl_seat The wl_seat interface593*594* A seat is a group of keyboards, pointer and touch devices. This595* object is published as a global during start up, or when such a596* device is hot plugged. A seat typically has a pointer and597* maintains a keyboard focus and a pointer focus.598*/599extern const struct wl_interface wl_seat_interface;600#endif601#ifndef WL_POINTER_INTERFACE602#define WL_POINTER_INTERFACE603/**604* @page page_iface_wl_pointer wl_pointer605* @section page_iface_wl_pointer_desc Description606*607* The wl_pointer interface represents one or more input devices,608* such as mice, which control the pointer location and pointer_focus609* of a seat.610*611* The wl_pointer interface generates motion, enter and leave612* events for the surfaces that the pointer is located over,613* and button and axis events for button presses, button releases614* and scrolling.615* @section page_iface_wl_pointer_api API616* See @ref iface_wl_pointer.617*/618/**619* @defgroup iface_wl_pointer The wl_pointer interface620*621* The wl_pointer interface represents one or more input devices,622* such as mice, which control the pointer location and pointer_focus623* of a seat.624*625* The wl_pointer interface generates motion, enter and leave626* events for the surfaces that the pointer is located over,627* and button and axis events for button presses, button releases628* and scrolling.629*/630extern const struct wl_interface wl_pointer_interface;631#endif632#ifndef WL_KEYBOARD_INTERFACE633#define WL_KEYBOARD_INTERFACE634/**635* @page page_iface_wl_keyboard wl_keyboard636* @section page_iface_wl_keyboard_desc Description637*638* The wl_keyboard interface represents one or more keyboards639* associated with a seat.640* @section page_iface_wl_keyboard_api API641* See @ref iface_wl_keyboard.642*/643/**644* @defgroup iface_wl_keyboard The wl_keyboard interface645*646* The wl_keyboard interface represents one or more keyboards647* associated with a seat.648*/649extern const struct wl_interface wl_keyboard_interface;650#endif651#ifndef WL_TOUCH_INTERFACE652#define WL_TOUCH_INTERFACE653/**654* @page page_iface_wl_touch wl_touch655* @section page_iface_wl_touch_desc Description656*657* The wl_touch interface represents a touchscreen658* associated with a seat.659*660* Touch interactions can consist of one or more contacts.661* For each contact, a series of events is generated, starting662* with a down event, followed by zero or more motion events,663* and ending with an up event. Events relating to the same664* contact point can be identified by the ID of the sequence.665* @section page_iface_wl_touch_api API666* See @ref iface_wl_touch.667*/668/**669* @defgroup iface_wl_touch The wl_touch interface670*671* The wl_touch interface represents a touchscreen672* associated with a seat.673*674* Touch interactions can consist of one or more contacts.675* For each contact, a series of events is generated, starting676* with a down event, followed by zero or more motion events,677* and ending with an up event. Events relating to the same678* contact point can be identified by the ID of the sequence.679*/680extern const struct wl_interface wl_touch_interface;681#endif682#ifndef WL_OUTPUT_INTERFACE683#define WL_OUTPUT_INTERFACE684/**685* @page page_iface_wl_output wl_output686* @section page_iface_wl_output_desc Description687*688* An output describes part of the compositor geometry. The689* compositor works in the 'compositor coordinate system' and an690* output corresponds to a rectangular area in that space that is691* actually visible. This typically corresponds to a monitor that692* displays part of the compositor space. This object is published693* as global during start up, or when a monitor is hotplugged.694* @section page_iface_wl_output_api API695* See @ref iface_wl_output.696*/697/**698* @defgroup iface_wl_output The wl_output interface699*700* An output describes part of the compositor geometry. The701* compositor works in the 'compositor coordinate system' and an702* output corresponds to a rectangular area in that space that is703* actually visible. This typically corresponds to a monitor that704* displays part of the compositor space. This object is published705* as global during start up, or when a monitor is hotplugged.706*/707extern const struct wl_interface wl_output_interface;708#endif709#ifndef WL_REGION_INTERFACE710#define WL_REGION_INTERFACE711/**712* @page page_iface_wl_region wl_region713* @section page_iface_wl_region_desc Description714*715* A region object describes an area.716*717* Region objects are used to describe the opaque and input718* regions of a surface.719* @section page_iface_wl_region_api API720* See @ref iface_wl_region.721*/722/**723* @defgroup iface_wl_region The wl_region interface724*725* A region object describes an area.726*727* Region objects are used to describe the opaque and input728* regions of a surface.729*/730extern const struct wl_interface wl_region_interface;731#endif732#ifndef WL_SUBCOMPOSITOR_INTERFACE733#define WL_SUBCOMPOSITOR_INTERFACE734/**735* @page page_iface_wl_subcompositor wl_subcompositor736* @section page_iface_wl_subcompositor_desc Description737*738* The global interface exposing sub-surface compositing capabilities.739* A wl_surface, that has sub-surfaces associated, is called the740* parent surface. Sub-surfaces can be arbitrarily nested and create741* a tree of sub-surfaces.742*743* The root surface in a tree of sub-surfaces is the main744* surface. The main surface cannot be a sub-surface, because745* sub-surfaces must always have a parent.746*747* A main surface with its sub-surfaces forms a (compound) window.748* For window management purposes, this set of wl_surface objects is749* to be considered as a single window, and it should also behave as750* such.751*752* The aim of sub-surfaces is to offload some of the compositing work753* within a window from clients to the compositor. A prime example is754* a video player with decorations and video in separate wl_surface755* objects. This should allow the compositor to pass YUV video buffer756* processing to dedicated overlay hardware when possible.757* @section page_iface_wl_subcompositor_api API758* See @ref iface_wl_subcompositor.759*/760/**761* @defgroup iface_wl_subcompositor The wl_subcompositor interface762*763* The global interface exposing sub-surface compositing capabilities.764* A wl_surface, that has sub-surfaces associated, is called the765* parent surface. Sub-surfaces can be arbitrarily nested and create766* a tree of sub-surfaces.767*768* The root surface in a tree of sub-surfaces is the main769* surface. The main surface cannot be a sub-surface, because770* sub-surfaces must always have a parent.771*772* A main surface with its sub-surfaces forms a (compound) window.773* For window management purposes, this set of wl_surface objects is774* to be considered as a single window, and it should also behave as775* such.776*777* The aim of sub-surfaces is to offload some of the compositing work778* within a window from clients to the compositor. A prime example is779* a video player with decorations and video in separate wl_surface780* objects. This should allow the compositor to pass YUV video buffer781* processing to dedicated overlay hardware when possible.782*/783extern const struct wl_interface wl_subcompositor_interface;784#endif785#ifndef WL_SUBSURFACE_INTERFACE786#define WL_SUBSURFACE_INTERFACE787/**788* @page page_iface_wl_subsurface wl_subsurface789* @section page_iface_wl_subsurface_desc Description790*791* An additional interface to a wl_surface object, which has been792* made a sub-surface. A sub-surface has one parent surface. A793* sub-surface's size and position are not limited to that of the parent.794* Particularly, a sub-surface is not automatically clipped to its795* parent's area.796*797* A sub-surface becomes mapped, when a non-NULL wl_buffer is applied798* and the parent surface is mapped. The order of which one happens799* first is irrelevant. A sub-surface is hidden if the parent becomes800* hidden, or if a NULL wl_buffer is applied. These rules apply801* recursively through the tree of surfaces.802*803* The behaviour of a wl_surface.commit request on a sub-surface804* depends on the sub-surface's mode. The possible modes are805* synchronized and desynchronized, see methods806* wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized807* mode caches the wl_surface state to be applied when the parent's808* state gets applied, and desynchronized mode applies the pending809* wl_surface state directly. A sub-surface is initially in the810* synchronized mode.811*812* Sub-surfaces also have another kind of state, which is managed by813* wl_subsurface requests, as opposed to wl_surface requests. This814* state includes the sub-surface position relative to the parent815* surface (wl_subsurface.set_position), and the stacking order of816* the parent and its sub-surfaces (wl_subsurface.place_above and817* .place_below). This state is applied when the parent surface's818* wl_surface state is applied, regardless of the sub-surface's mode.819* As the exception, set_sync and set_desync are effective immediately.820*821* The main surface can be thought to be always in desynchronized mode,822* since it does not have a parent in the sub-surfaces sense.823*824* Even if a sub-surface is in desynchronized mode, it will behave as825* in synchronized mode, if its parent surface behaves as in826* synchronized mode. This rule is applied recursively throughout the827* tree of surfaces. This means, that one can set a sub-surface into828* synchronized mode, and then assume that all its child and grand-child829* sub-surfaces are synchronized, too, without explicitly setting them.830*831* If the wl_surface associated with the wl_subsurface is destroyed, the832* wl_subsurface object becomes inert. Note, that destroying either object833* takes effect immediately. If you need to synchronize the removal834* of a sub-surface to the parent surface update, unmap the sub-surface835* first by attaching a NULL wl_buffer, update parent, and then destroy836* the sub-surface.837*838* If the parent wl_surface object is destroyed, the sub-surface is839* unmapped.840* @section page_iface_wl_subsurface_api API841* See @ref iface_wl_subsurface.842*/843/**844* @defgroup iface_wl_subsurface The wl_subsurface interface845*846* An additional interface to a wl_surface object, which has been847* made a sub-surface. A sub-surface has one parent surface. A848* sub-surface's size and position are not limited to that of the parent.849* Particularly, a sub-surface is not automatically clipped to its850* parent's area.851*852* A sub-surface becomes mapped, when a non-NULL wl_buffer is applied853* and the parent surface is mapped. The order of which one happens854* first is irrelevant. A sub-surface is hidden if the parent becomes855* hidden, or if a NULL wl_buffer is applied. These rules apply856* recursively through the tree of surfaces.857*858* The behaviour of a wl_surface.commit request on a sub-surface859* depends on the sub-surface's mode. The possible modes are860* synchronized and desynchronized, see methods861* wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized862* mode caches the wl_surface state to be applied when the parent's863* state gets applied, and desynchronized mode applies the pending864* wl_surface state directly. A sub-surface is initially in the865* synchronized mode.866*867* Sub-surfaces also have another kind of state, which is managed by868* wl_subsurface requests, as opposed to wl_surface requests. This869* state includes the sub-surface position relative to the parent870* surface (wl_subsurface.set_position), and the stacking order of871* the parent and its sub-surfaces (wl_subsurface.place_above and872* .place_below). This state is applied when the parent surface's873* wl_surface state is applied, regardless of the sub-surface's mode.874* As the exception, set_sync and set_desync are effective immediately.875*876* The main surface can be thought to be always in desynchronized mode,877* since it does not have a parent in the sub-surfaces sense.878*879* Even if a sub-surface is in desynchronized mode, it will behave as880* in synchronized mode, if its parent surface behaves as in881* synchronized mode. This rule is applied recursively throughout the882* tree of surfaces. This means, that one can set a sub-surface into883* synchronized mode, and then assume that all its child and grand-child884* sub-surfaces are synchronized, too, without explicitly setting them.885*886* If the wl_surface associated with the wl_subsurface is destroyed, the887* wl_subsurface object becomes inert. Note, that destroying either object888* takes effect immediately. If you need to synchronize the removal889* of a sub-surface to the parent surface update, unmap the sub-surface890* first by attaching a NULL wl_buffer, update parent, and then destroy891* the sub-surface.892*893* If the parent wl_surface object is destroyed, the sub-surface is894* unmapped.895*/896extern const struct wl_interface wl_subsurface_interface;897#endif898899#ifndef WL_DISPLAY_ERROR_ENUM900#define WL_DISPLAY_ERROR_ENUM901/**902* @ingroup iface_wl_display903* global error values904*905* These errors are global and can be emitted in response to any906* server request.907*/908enum wl_display_error {909/**910* server couldn't find object911*/912WL_DISPLAY_ERROR_INVALID_OBJECT = 0,913/**914* method doesn't exist on the specified interface or malformed request915*/916WL_DISPLAY_ERROR_INVALID_METHOD = 1,917/**918* server is out of memory919*/920WL_DISPLAY_ERROR_NO_MEMORY = 2,921/**922* implementation error in compositor923*/924WL_DISPLAY_ERROR_IMPLEMENTATION = 3,925};926#endif /* WL_DISPLAY_ERROR_ENUM */927928/**929* @ingroup iface_wl_display930* @struct wl_display_listener931*/932struct wl_display_listener {933/**934* fatal error event935*936* The error event is sent out when a fatal (non-recoverable)937* error has occurred. The object_id argument is the object where938* the error occurred, most often in response to a request to that939* object. The code identifies the error and is defined by the940* object interface. As such, each interface defines its own set of941* error codes. The message is a brief description of the error,942* for (debugging) convenience.943* @param object_id object where the error occurred944* @param code error code945* @param message error description946*/947void (*error)(void *data,948struct wl_display *wl_display,949void *object_id,950uint32_t code,951const char *message);952/**953* acknowledge object ID deletion954*955* This event is used internally by the object ID management956* logic. When a client deletes an object that it had created, the957* server will send this event to acknowledge that it has seen the958* delete request. When the client receives this event, it will959* know that it can safely reuse the object ID.960* @param id deleted object ID961*/962void (*delete_id)(void *data,963struct wl_display *wl_display,964uint32_t id);965};966967/**968* @ingroup iface_wl_display969*/970static inline int971wl_display_add_listener(struct wl_display *wl_display,972const struct wl_display_listener *listener, void *data)973{974return wl_proxy_add_listener((struct wl_proxy *) wl_display,975(void (**)(void)) listener, data);976}977978#define WL_DISPLAY_SYNC 0979#define WL_DISPLAY_GET_REGISTRY 1980981/**982* @ingroup iface_wl_display983*/984#define WL_DISPLAY_ERROR_SINCE_VERSION 1985/**986* @ingroup iface_wl_display987*/988#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1989990/**991* @ingroup iface_wl_display992*/993#define WL_DISPLAY_SYNC_SINCE_VERSION 1994/**995* @ingroup iface_wl_display996*/997#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1998999/** @ingroup iface_wl_display */1000static inline void1001wl_display_set_user_data(struct wl_display *wl_display, void *user_data)1002{1003wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);1004}10051006/** @ingroup iface_wl_display */1007static inline void *1008wl_display_get_user_data(struct wl_display *wl_display)1009{1010return wl_proxy_get_user_data((struct wl_proxy *) wl_display);1011}10121013static inline uint32_t1014wl_display_get_version(struct wl_display *wl_display)1015{1016return wl_proxy_get_version((struct wl_proxy *) wl_display);1017}10181019/**1020* @ingroup iface_wl_display1021*1022* The sync request asks the server to emit the 'done' event1023* on the returned wl_callback object. Since requests are1024* handled in-order and events are delivered in-order, this can1025* be used as a barrier to ensure all previous requests and the1026* resulting events have been handled.1027*1028* The object returned by this request will be destroyed by the1029* compositor after the callback is fired and as such the client must not1030* attempt to use it after that point.1031*1032* The callback_data passed in the callback is the event serial.1033*/1034static inline struct wl_callback *1035wl_display_sync(struct wl_display *wl_display)1036{1037struct wl_proxy *callback;10381039callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,1040WL_DISPLAY_SYNC, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);10411042return (struct wl_callback *) callback;1043}10441045/**1046* @ingroup iface_wl_display1047*1048* This request creates a registry object that allows the client1049* to list and bind the global objects available from the1050* compositor.1051*1052* It should be noted that the server side resources consumed in1053* response to a get_registry request can only be released when the1054* client disconnects, not when the client side proxy is destroyed.1055* Therefore, clients should invoke get_registry as infrequently as1056* possible to avoid wasting memory.1057*/1058static inline struct wl_registry *1059wl_display_get_registry(struct wl_display *wl_display)1060{1061struct wl_proxy *registry;10621063registry = wl_proxy_marshal_flags((struct wl_proxy *) wl_display,1064WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, wl_proxy_get_version((struct wl_proxy *) wl_display), 0, NULL);10651066return (struct wl_registry *) registry;1067}10681069/**1070* @ingroup iface_wl_registry1071* @struct wl_registry_listener1072*/1073struct wl_registry_listener {1074/**1075* announce global object1076*1077* Notify the client of global objects.1078*1079* The event notifies the client that a global object with the1080* given name is now available, and it implements the given version1081* of the given interface.1082* @param name numeric name of the global object1083* @param interface interface implemented by the object1084* @param version interface version1085*/1086void (*global)(void *data,1087struct wl_registry *wl_registry,1088uint32_t name,1089const char *interface,1090uint32_t version);1091/**1092* announce removal of global object1093*1094* Notify the client of removed global objects.1095*1096* This event notifies the client that the global identified by1097* name is no longer available. If the client bound to the global1098* using the bind request, the client should now destroy that1099* object.1100*1101* The object remains valid and requests to the object will be1102* ignored until the client destroys it, to avoid races between the1103* global going away and a client sending a request to it.1104* @param name numeric name of the global object1105*/1106void (*global_remove)(void *data,1107struct wl_registry *wl_registry,1108uint32_t name);1109};11101111/**1112* @ingroup iface_wl_registry1113*/1114static inline int1115wl_registry_add_listener(struct wl_registry *wl_registry,1116const struct wl_registry_listener *listener, void *data)1117{1118return wl_proxy_add_listener((struct wl_proxy *) wl_registry,1119(void (**)(void)) listener, data);1120}11211122#define WL_REGISTRY_BIND 011231124/**1125* @ingroup iface_wl_registry1126*/1127#define WL_REGISTRY_GLOBAL_SINCE_VERSION 11128/**1129* @ingroup iface_wl_registry1130*/1131#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 111321133/**1134* @ingroup iface_wl_registry1135*/1136#define WL_REGISTRY_BIND_SINCE_VERSION 111371138/** @ingroup iface_wl_registry */1139static inline void1140wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)1141{1142wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);1143}11441145/** @ingroup iface_wl_registry */1146static inline void *1147wl_registry_get_user_data(struct wl_registry *wl_registry)1148{1149return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);1150}11511152static inline uint32_t1153wl_registry_get_version(struct wl_registry *wl_registry)1154{1155return wl_proxy_get_version((struct wl_proxy *) wl_registry);1156}11571158/** @ingroup iface_wl_registry */1159static inline void1160wl_registry_destroy(struct wl_registry *wl_registry)1161{1162wl_proxy_destroy((struct wl_proxy *) wl_registry);1163}11641165/**1166* @ingroup iface_wl_registry1167*1168* Binds a new, client-created object to the server using the1169* specified name as the identifier.1170*/1171static inline void *1172wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)1173{1174struct wl_proxy *id;11751176id = wl_proxy_marshal_flags((struct wl_proxy *) wl_registry,1177WL_REGISTRY_BIND, interface, version, 0, name, interface->name, version, NULL);11781179return (void *) id;1180}11811182/**1183* @ingroup iface_wl_callback1184* @struct wl_callback_listener1185*/1186struct wl_callback_listener {1187/**1188* done event1189*1190* Notify the client when the related request is done.1191* @param callback_data request-specific data for the callback1192*/1193void (*done)(void *data,1194struct wl_callback *wl_callback,1195uint32_t callback_data);1196};11971198/**1199* @ingroup iface_wl_callback1200*/1201static inline int1202wl_callback_add_listener(struct wl_callback *wl_callback,1203const struct wl_callback_listener *listener, void *data)1204{1205return wl_proxy_add_listener((struct wl_proxy *) wl_callback,1206(void (**)(void)) listener, data);1207}12081209/**1210* @ingroup iface_wl_callback1211*/1212#define WL_CALLBACK_DONE_SINCE_VERSION 1121312141215/** @ingroup iface_wl_callback */1216static inline void1217wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)1218{1219wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);1220}12211222/** @ingroup iface_wl_callback */1223static inline void *1224wl_callback_get_user_data(struct wl_callback *wl_callback)1225{1226return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);1227}12281229static inline uint32_t1230wl_callback_get_version(struct wl_callback *wl_callback)1231{1232return wl_proxy_get_version((struct wl_proxy *) wl_callback);1233}12341235/** @ingroup iface_wl_callback */1236static inline void1237wl_callback_destroy(struct wl_callback *wl_callback)1238{1239wl_proxy_destroy((struct wl_proxy *) wl_callback);1240}12411242#define WL_COMPOSITOR_CREATE_SURFACE 01243#define WL_COMPOSITOR_CREATE_REGION 1124412451246/**1247* @ingroup iface_wl_compositor1248*/1249#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 11250/**1251* @ingroup iface_wl_compositor1252*/1253#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 112541255/** @ingroup iface_wl_compositor */1256static inline void1257wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data)1258{1259wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);1260}12611262/** @ingroup iface_wl_compositor */1263static inline void *1264wl_compositor_get_user_data(struct wl_compositor *wl_compositor)1265{1266return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);1267}12681269static inline uint32_t1270wl_compositor_get_version(struct wl_compositor *wl_compositor)1271{1272return wl_proxy_get_version((struct wl_proxy *) wl_compositor);1273}12741275/** @ingroup iface_wl_compositor */1276static inline void1277wl_compositor_destroy(struct wl_compositor *wl_compositor)1278{1279wl_proxy_destroy((struct wl_proxy *) wl_compositor);1280}12811282/**1283* @ingroup iface_wl_compositor1284*1285* Ask the compositor to create a new surface.1286*/1287static inline struct wl_surface *1288wl_compositor_create_surface(struct wl_compositor *wl_compositor)1289{1290struct wl_proxy *id;12911292id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,1293WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);12941295return (struct wl_surface *) id;1296}12971298/**1299* @ingroup iface_wl_compositor1300*1301* Ask the compositor to create a new region.1302*/1303static inline struct wl_region *1304wl_compositor_create_region(struct wl_compositor *wl_compositor)1305{1306struct wl_proxy *id;13071308id = wl_proxy_marshal_flags((struct wl_proxy *) wl_compositor,1309WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, wl_proxy_get_version((struct wl_proxy *) wl_compositor), 0, NULL);13101311return (struct wl_region *) id;1312}13131314#define WL_SHM_POOL_CREATE_BUFFER 01315#define WL_SHM_POOL_DESTROY 11316#define WL_SHM_POOL_RESIZE 2131713181319/**1320* @ingroup iface_wl_shm_pool1321*/1322#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 11323/**1324* @ingroup iface_wl_shm_pool1325*/1326#define WL_SHM_POOL_DESTROY_SINCE_VERSION 11327/**1328* @ingroup iface_wl_shm_pool1329*/1330#define WL_SHM_POOL_RESIZE_SINCE_VERSION 113311332/** @ingroup iface_wl_shm_pool */1333static inline void1334wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)1335{1336wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);1337}13381339/** @ingroup iface_wl_shm_pool */1340static inline void *1341wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)1342{1343return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);1344}13451346static inline uint32_t1347wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)1348{1349return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);1350}13511352/**1353* @ingroup iface_wl_shm_pool1354*1355* Create a wl_buffer object from the pool.1356*1357* The buffer is created offset bytes into the pool and has1358* width and height as specified. The stride argument specifies1359* the number of bytes from the beginning of one row to the beginning1360* of the next. The format is the pixel format of the buffer and1361* must be one of those advertised through the wl_shm.format event.1362*1363* A buffer will keep a reference to the pool it was created from1364* so it is valid to destroy the pool immediately after creating1365* a buffer from it.1366*/1367static inline struct wl_buffer *1368wl_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)1369{1370struct wl_proxy *id;13711372id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1373WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, NULL, offset, width, height, stride, format);13741375return (struct wl_buffer *) id;1376}13771378/**1379* @ingroup iface_wl_shm_pool1380*1381* Destroy the shared memory pool.1382*1383* The mmapped memory will be released when all1384* buffers that have been created from this pool1385* are gone.1386*/1387static inline void1388wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool)1389{1390wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1391WL_SHM_POOL_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), WL_MARSHAL_FLAG_DESTROY);1392}13931394/**1395* @ingroup iface_wl_shm_pool1396*1397* This request will cause the server to remap the backing memory1398* for the pool from the file descriptor passed when the pool was1399* created, but using the new size. This request can only be1400* used to make the pool bigger.1401*1402* This request only changes the amount of bytes that are mmapped1403* by the server and does not touch the file corresponding to the1404* file descriptor passed at creation time. It is the client's1405* responsibility to ensure that the file is at least as big as1406* the new pool size.1407*/1408static inline void1409wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)1410{1411wl_proxy_marshal_flags((struct wl_proxy *) wl_shm_pool,1412WL_SHM_POOL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shm_pool), 0, size);1413}14141415#ifndef WL_SHM_ERROR_ENUM1416#define WL_SHM_ERROR_ENUM1417/**1418* @ingroup iface_wl_shm1419* wl_shm error values1420*1421* These errors can be emitted in response to wl_shm requests.1422*/1423enum wl_shm_error {1424/**1425* buffer format is not known1426*/1427WL_SHM_ERROR_INVALID_FORMAT = 0,1428/**1429* invalid size or stride during pool or buffer creation1430*/1431WL_SHM_ERROR_INVALID_STRIDE = 1,1432/**1433* mmapping the file descriptor failed1434*/1435WL_SHM_ERROR_INVALID_FD = 2,1436};1437#endif /* WL_SHM_ERROR_ENUM */14381439#ifndef WL_SHM_FORMAT_ENUM1440#define WL_SHM_FORMAT_ENUM1441/**1442* @ingroup iface_wl_shm1443* pixel formats1444*1445* This describes the memory layout of an individual pixel.1446*1447* All renderers should support argb8888 and xrgb8888 but any other1448* formats are optional and may not be supported by the particular1449* renderer in use.1450*1451* The drm format codes match the macros defined in drm_fourcc.h, except1452* argb8888 and xrgb8888. The formats actually supported by the compositor1453* will be reported by the format event.1454*1455* For all wl_shm formats and unless specified in another protocol1456* extension, pre-multiplied alpha is used for pixel values.1457*/1458enum wl_shm_format {1459/**1460* 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian1461*/1462WL_SHM_FORMAT_ARGB8888 = 0,1463/**1464* 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian1465*/1466WL_SHM_FORMAT_XRGB8888 = 1,1467/**1468* 8-bit color index format, [7:0] C1469*/1470WL_SHM_FORMAT_C8 = 0x20203843,1471/**1472* 8-bit RGB format, [7:0] R:G:B 3:3:21473*/1474WL_SHM_FORMAT_RGB332 = 0x38424752,1475/**1476* 8-bit BGR format, [7:0] B:G:R 2:3:31477*/1478WL_SHM_FORMAT_BGR233 = 0x38524742,1479/**1480* 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian1481*/1482WL_SHM_FORMAT_XRGB4444 = 0x32315258,1483/**1484* 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian1485*/1486WL_SHM_FORMAT_XBGR4444 = 0x32314258,1487/**1488* 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian1489*/1490WL_SHM_FORMAT_RGBX4444 = 0x32315852,1491/**1492* 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian1493*/1494WL_SHM_FORMAT_BGRX4444 = 0x32315842,1495/**1496* 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian1497*/1498WL_SHM_FORMAT_ARGB4444 = 0x32315241,1499/**1500* 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian1501*/1502WL_SHM_FORMAT_ABGR4444 = 0x32314241,1503/**1504* 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian1505*/1506WL_SHM_FORMAT_RGBA4444 = 0x32314152,1507/**1508* 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian1509*/1510WL_SHM_FORMAT_BGRA4444 = 0x32314142,1511/**1512* 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian1513*/1514WL_SHM_FORMAT_XRGB1555 = 0x35315258,1515/**1516* 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian1517*/1518WL_SHM_FORMAT_XBGR1555 = 0x35314258,1519/**1520* 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian1521*/1522WL_SHM_FORMAT_RGBX5551 = 0x35315852,1523/**1524* 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian1525*/1526WL_SHM_FORMAT_BGRX5551 = 0x35315842,1527/**1528* 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian1529*/1530WL_SHM_FORMAT_ARGB1555 = 0x35315241,1531/**1532* 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian1533*/1534WL_SHM_FORMAT_ABGR1555 = 0x35314241,1535/**1536* 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian1537*/1538WL_SHM_FORMAT_RGBA5551 = 0x35314152,1539/**1540* 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian1541*/1542WL_SHM_FORMAT_BGRA5551 = 0x35314142,1543/**1544* 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian1545*/1546WL_SHM_FORMAT_RGB565 = 0x36314752,1547/**1548* 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian1549*/1550WL_SHM_FORMAT_BGR565 = 0x36314742,1551/**1552* 24-bit RGB format, [23:0] R:G:B little endian1553*/1554WL_SHM_FORMAT_RGB888 = 0x34324752,1555/**1556* 24-bit BGR format, [23:0] B:G:R little endian1557*/1558WL_SHM_FORMAT_BGR888 = 0x34324742,1559/**1560* 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian1561*/1562WL_SHM_FORMAT_XBGR8888 = 0x34324258,1563/**1564* 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian1565*/1566WL_SHM_FORMAT_RGBX8888 = 0x34325852,1567/**1568* 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian1569*/1570WL_SHM_FORMAT_BGRX8888 = 0x34325842,1571/**1572* 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian1573*/1574WL_SHM_FORMAT_ABGR8888 = 0x34324241,1575/**1576* 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian1577*/1578WL_SHM_FORMAT_RGBA8888 = 0x34324152,1579/**1580* 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian1581*/1582WL_SHM_FORMAT_BGRA8888 = 0x34324142,1583/**1584* 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian1585*/1586WL_SHM_FORMAT_XRGB2101010 = 0x30335258,1587/**1588* 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian1589*/1590WL_SHM_FORMAT_XBGR2101010 = 0x30334258,1591/**1592* 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian1593*/1594WL_SHM_FORMAT_RGBX1010102 = 0x30335852,1595/**1596* 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian1597*/1598WL_SHM_FORMAT_BGRX1010102 = 0x30335842,1599/**1600* 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian1601*/1602WL_SHM_FORMAT_ARGB2101010 = 0x30335241,1603/**1604* 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian1605*/1606WL_SHM_FORMAT_ABGR2101010 = 0x30334241,1607/**1608* 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian1609*/1610WL_SHM_FORMAT_RGBA1010102 = 0x30334152,1611/**1612* 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian1613*/1614WL_SHM_FORMAT_BGRA1010102 = 0x30334142,1615/**1616* packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian1617*/1618WL_SHM_FORMAT_YUYV = 0x56595559,1619/**1620* packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian1621*/1622WL_SHM_FORMAT_YVYU = 0x55595659,1623/**1624* packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian1625*/1626WL_SHM_FORMAT_UYVY = 0x59565955,1627/**1628* packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian1629*/1630WL_SHM_FORMAT_VYUY = 0x59555956,1631/**1632* packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian1633*/1634WL_SHM_FORMAT_AYUV = 0x56555941,1635/**1636* 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane1637*/1638WL_SHM_FORMAT_NV12 = 0x3231564e,1639/**1640* 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane1641*/1642WL_SHM_FORMAT_NV21 = 0x3132564e,1643/**1644* 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane1645*/1646WL_SHM_FORMAT_NV16 = 0x3631564e,1647/**1648* 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane1649*/1650WL_SHM_FORMAT_NV61 = 0x3136564e,1651/**1652* 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes1653*/1654WL_SHM_FORMAT_YUV410 = 0x39565559,1655/**1656* 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes1657*/1658WL_SHM_FORMAT_YVU410 = 0x39555659,1659/**1660* 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes1661*/1662WL_SHM_FORMAT_YUV411 = 0x31315559,1663/**1664* 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes1665*/1666WL_SHM_FORMAT_YVU411 = 0x31315659,1667/**1668* 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes1669*/1670WL_SHM_FORMAT_YUV420 = 0x32315559,1671/**1672* 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes1673*/1674WL_SHM_FORMAT_YVU420 = 0x32315659,1675/**1676* 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes1677*/1678WL_SHM_FORMAT_YUV422 = 0x36315559,1679/**1680* 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes1681*/1682WL_SHM_FORMAT_YVU422 = 0x36315659,1683/**1684* 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes1685*/1686WL_SHM_FORMAT_YUV444 = 0x34325559,1687/**1688* 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes1689*/1690WL_SHM_FORMAT_YVU444 = 0x34325659,1691/**1692* [7:0] R1693*/1694WL_SHM_FORMAT_R8 = 0x20203852,1695/**1696* [15:0] R little endian1697*/1698WL_SHM_FORMAT_R16 = 0x20363152,1699/**1700* [15:0] R:G 8:8 little endian1701*/1702WL_SHM_FORMAT_RG88 = 0x38384752,1703/**1704* [15:0] G:R 8:8 little endian1705*/1706WL_SHM_FORMAT_GR88 = 0x38385247,1707/**1708* [31:0] R:G 16:16 little endian1709*/1710WL_SHM_FORMAT_RG1616 = 0x32334752,1711/**1712* [31:0] G:R 16:16 little endian1713*/1714WL_SHM_FORMAT_GR1616 = 0x32335247,1715/**1716* [63:0] x:R:G:B 16:16:16:16 little endian1717*/1718WL_SHM_FORMAT_XRGB16161616F = 0x48345258,1719/**1720* [63:0] x:B:G:R 16:16:16:16 little endian1721*/1722WL_SHM_FORMAT_XBGR16161616F = 0x48344258,1723/**1724* [63:0] A:R:G:B 16:16:16:16 little endian1725*/1726WL_SHM_FORMAT_ARGB16161616F = 0x48345241,1727/**1728* [63:0] A:B:G:R 16:16:16:16 little endian1729*/1730WL_SHM_FORMAT_ABGR16161616F = 0x48344241,1731/**1732* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian1733*/1734WL_SHM_FORMAT_XYUV8888 = 0x56555958,1735/**1736* [23:0] Cr:Cb:Y 8:8:8 little endian1737*/1738WL_SHM_FORMAT_VUY888 = 0x34325556,1739/**1740* Y followed by U then V, 10:10:10. Non-linear modifier only1741*/1742WL_SHM_FORMAT_VUY101010 = 0x30335556,1743/**1744* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 10:6:10:6:10:6:10:6 little endian per 2 Y pixels1745*/1746WL_SHM_FORMAT_Y210 = 0x30313259,1747/**1748* [63:0] Cr0:0:Y1:0:Cb0:0:Y0:0 12:4:12:4:12:4:12:4 little endian per 2 Y pixels1749*/1750WL_SHM_FORMAT_Y212 = 0x32313259,1751/**1752* [63:0] Cr0:Y1:Cb0:Y0 16:16:16:16 little endian per 2 Y pixels1753*/1754WL_SHM_FORMAT_Y216 = 0x36313259,1755/**1756* [31:0] A:Cr:Y:Cb 2:10:10:10 little endian1757*/1758WL_SHM_FORMAT_Y410 = 0x30313459,1759/**1760* [63:0] A:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian1761*/1762WL_SHM_FORMAT_Y412 = 0x32313459,1763/**1764* [63:0] A:Cr:Y:Cb 16:16:16:16 little endian1765*/1766WL_SHM_FORMAT_Y416 = 0x36313459,1767/**1768* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian1769*/1770WL_SHM_FORMAT_XVYU2101010 = 0x30335658,1771/**1772* [63:0] X:0:Cr:0:Y:0:Cb:0 12:4:12:4:12:4:12:4 little endian1773*/1774WL_SHM_FORMAT_XVYU12_16161616 = 0x36335658,1775/**1776* [63:0] X:Cr:Y:Cb 16:16:16:16 little endian1777*/1778WL_SHM_FORMAT_XVYU16161616 = 0x38345658,1779/**1780* [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 endian1781*/1782WL_SHM_FORMAT_Y0L0 = 0x304c3059,1783/**1784* [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 endian1785*/1786WL_SHM_FORMAT_X0L0 = 0x304c3058,1787/**1788* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian1789*/1790WL_SHM_FORMAT_Y0L2 = 0x324c3059,1791/**1792* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian1793*/1794WL_SHM_FORMAT_X0L2 = 0x324c3058,1795WL_SHM_FORMAT_YUV420_8BIT = 0x38305559,1796WL_SHM_FORMAT_YUV420_10BIT = 0x30315559,1797WL_SHM_FORMAT_XRGB8888_A8 = 0x38415258,1798WL_SHM_FORMAT_XBGR8888_A8 = 0x38414258,1799WL_SHM_FORMAT_RGBX8888_A8 = 0x38415852,1800WL_SHM_FORMAT_BGRX8888_A8 = 0x38415842,1801WL_SHM_FORMAT_RGB888_A8 = 0x38413852,1802WL_SHM_FORMAT_BGR888_A8 = 0x38413842,1803WL_SHM_FORMAT_RGB565_A8 = 0x38413552,1804WL_SHM_FORMAT_BGR565_A8 = 0x38413542,1805/**1806* non-subsampled Cr:Cb plane1807*/1808WL_SHM_FORMAT_NV24 = 0x3432564e,1809/**1810* non-subsampled Cb:Cr plane1811*/1812WL_SHM_FORMAT_NV42 = 0x3234564e,1813/**1814* 2x1 subsampled Cr:Cb plane, 10 bit per channel1815*/1816WL_SHM_FORMAT_P210 = 0x30313250,1817/**1818* 2x2 subsampled Cr:Cb plane 10 bits per channel1819*/1820WL_SHM_FORMAT_P010 = 0x30313050,1821/**1822* 2x2 subsampled Cr:Cb plane 12 bits per channel1823*/1824WL_SHM_FORMAT_P012 = 0x32313050,1825/**1826* 2x2 subsampled Cr:Cb plane 16 bits per channel1827*/1828WL_SHM_FORMAT_P016 = 0x36313050,1829/**1830* [63:0] A:x:B:x:G:x:R:x 10:6:10:6:10:6:10:6 little endian1831*/1832WL_SHM_FORMAT_AXBXGXRX106106106106 = 0x30314241,1833/**1834* 2x2 subsampled Cr:Cb plane1835*/1836WL_SHM_FORMAT_NV15 = 0x3531564e,1837WL_SHM_FORMAT_Q410 = 0x30313451,1838WL_SHM_FORMAT_Q401 = 0x31303451,1839/**1840* [63:0] x:R:G:B 16:16:16:16 little endian1841*/1842WL_SHM_FORMAT_XRGB16161616 = 0x38345258,1843/**1844* [63:0] x:B:G:R 16:16:16:16 little endian1845*/1846WL_SHM_FORMAT_XBGR16161616 = 0x38344258,1847/**1848* [63:0] A:R:G:B 16:16:16:16 little endian1849*/1850WL_SHM_FORMAT_ARGB16161616 = 0x38345241,1851/**1852* [63:0] A:B:G:R 16:16:16:16 little endian1853*/1854WL_SHM_FORMAT_ABGR16161616 = 0x38344241,1855};1856#endif /* WL_SHM_FORMAT_ENUM */18571858/**1859* @ingroup iface_wl_shm1860* @struct wl_shm_listener1861*/1862struct wl_shm_listener {1863/**1864* pixel format description1865*1866* Informs the client about a valid pixel format that can be used1867* for buffers. Known formats include argb8888 and xrgb8888.1868* @param format buffer pixel format1869*/1870void (*format)(void *data,1871struct wl_shm *wl_shm,1872uint32_t format);1873};18741875/**1876* @ingroup iface_wl_shm1877*/1878static inline int1879wl_shm_add_listener(struct wl_shm *wl_shm,1880const struct wl_shm_listener *listener, void *data)1881{1882return wl_proxy_add_listener((struct wl_proxy *) wl_shm,1883(void (**)(void)) listener, data);1884}18851886#define WL_SHM_CREATE_POOL 018871888/**1889* @ingroup iface_wl_shm1890*/1891#define WL_SHM_FORMAT_SINCE_VERSION 118921893/**1894* @ingroup iface_wl_shm1895*/1896#define WL_SHM_CREATE_POOL_SINCE_VERSION 118971898/** @ingroup iface_wl_shm */1899static inline void1900wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)1901{1902wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);1903}19041905/** @ingroup iface_wl_shm */1906static inline void *1907wl_shm_get_user_data(struct wl_shm *wl_shm)1908{1909return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);1910}19111912static inline uint32_t1913wl_shm_get_version(struct wl_shm *wl_shm)1914{1915return wl_proxy_get_version((struct wl_proxy *) wl_shm);1916}19171918/** @ingroup iface_wl_shm */1919static inline void1920wl_shm_destroy(struct wl_shm *wl_shm)1921{1922wl_proxy_destroy((struct wl_proxy *) wl_shm);1923}19241925/**1926* @ingroup iface_wl_shm1927*1928* Create a new wl_shm_pool object.1929*1930* The pool can be used to create shared memory based buffer1931* objects. The server will mmap size bytes of the passed file1932* descriptor, to use as backing memory for the pool.1933*/1934static inline struct wl_shm_pool *1935wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)1936{1937struct wl_proxy *id;19381939id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shm,1940WL_SHM_CREATE_POOL, &wl_shm_pool_interface, wl_proxy_get_version((struct wl_proxy *) wl_shm), 0, NULL, fd, size);19411942return (struct wl_shm_pool *) id;1943}19441945/**1946* @ingroup iface_wl_buffer1947* @struct wl_buffer_listener1948*/1949struct wl_buffer_listener {1950/**1951* compositor releases buffer1952*1953* Sent when this wl_buffer is no longer used by the compositor.1954* The client is now free to reuse or destroy this buffer and its1955* backing storage.1956*1957* If a client receives a release event before the frame callback1958* requested in the same wl_surface.commit that attaches this1959* wl_buffer to a surface, then the client is immediately free to1960* reuse the buffer and its backing storage, and does not need a1961* second buffer for the next surface content update. Typically1962* this is possible, when the compositor maintains a copy of the1963* wl_surface contents, e.g. as a GL texture. This is an important1964* optimization for GL(ES) compositors with wl_shm clients.1965*/1966void (*release)(void *data,1967struct wl_buffer *wl_buffer);1968};19691970/**1971* @ingroup iface_wl_buffer1972*/1973static inline int1974wl_buffer_add_listener(struct wl_buffer *wl_buffer,1975const struct wl_buffer_listener *listener, void *data)1976{1977return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,1978(void (**)(void)) listener, data);1979}19801981#define WL_BUFFER_DESTROY 019821983/**1984* @ingroup iface_wl_buffer1985*/1986#define WL_BUFFER_RELEASE_SINCE_VERSION 119871988/**1989* @ingroup iface_wl_buffer1990*/1991#define WL_BUFFER_DESTROY_SINCE_VERSION 119921993/** @ingroup iface_wl_buffer */1994static inline void1995wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)1996{1997wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);1998}19992000/** @ingroup iface_wl_buffer */2001static inline void *2002wl_buffer_get_user_data(struct wl_buffer *wl_buffer)2003{2004return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);2005}20062007static inline uint32_t2008wl_buffer_get_version(struct wl_buffer *wl_buffer)2009{2010return wl_proxy_get_version((struct wl_proxy *) wl_buffer);2011}20122013/**2014* @ingroup iface_wl_buffer2015*2016* Destroy a buffer. If and how you need to release the backing2017* storage is defined by the buffer factory interface.2018*2019* For possible side-effects to a surface, see wl_surface.attach.2020*/2021static inline void2022wl_buffer_destroy(struct wl_buffer *wl_buffer)2023{2024wl_proxy_marshal_flags((struct wl_proxy *) wl_buffer,2025WL_BUFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_buffer), WL_MARSHAL_FLAG_DESTROY);2026}20272028#ifndef WL_DATA_OFFER_ERROR_ENUM2029#define WL_DATA_OFFER_ERROR_ENUM2030enum wl_data_offer_error {2031/**2032* finish request was called untimely2033*/2034WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,2035/**2036* action mask contains invalid values2037*/2038WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,2039/**2040* action argument has an invalid value2041*/2042WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,2043/**2044* offer doesn't accept this request2045*/2046WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,2047};2048#endif /* WL_DATA_OFFER_ERROR_ENUM */20492050/**2051* @ingroup iface_wl_data_offer2052* @struct wl_data_offer_listener2053*/2054struct wl_data_offer_listener {2055/**2056* advertise offered mime type2057*2058* Sent immediately after creating the wl_data_offer object. One2059* event per offered mime type.2060* @param mime_type offered mime type2061*/2062void (*offer)(void *data,2063struct wl_data_offer *wl_data_offer,2064const char *mime_type);2065/**2066* notify the source-side available actions2067*2068* This event indicates the actions offered by the data source.2069* It will be sent right after wl_data_device.enter, or anytime the2070* source side changes its offered actions through2071* wl_data_source.set_actions.2072* @param source_actions actions offered by the data source2073* @since 32074*/2075void (*source_actions)(void *data,2076struct wl_data_offer *wl_data_offer,2077uint32_t source_actions);2078/**2079* notify the selected action2080*2081* This event indicates the action selected by the compositor2082* after matching the source/destination side actions. Only one2083* action (or none) will be offered here.2084*2085* This event can be emitted multiple times during the2086* drag-and-drop operation in response to destination side action2087* changes through wl_data_offer.set_actions.2088*2089* This event will no longer be emitted after wl_data_device.drop2090* happened on the drag-and-drop destination, the client must honor2091* the last action received, or the last preferred one set through2092* wl_data_offer.set_actions when handling an "ask" action.2093*2094* Compositors may also change the selected action on the fly,2095* mainly in response to keyboard modifier changes during the2096* drag-and-drop operation.2097*2098* The most recent action received is always the valid one. Prior2099* to receiving wl_data_device.drop, the chosen action may change2100* (e.g. due to keyboard modifiers being pressed). At the time of2101* receiving wl_data_device.drop the drag-and-drop destination must2102* honor the last action received.2103*2104* Action changes may still happen after wl_data_device.drop,2105* especially on "ask" actions, where the drag-and-drop destination2106* may choose another action afterwards. Action changes happening2107* at this stage are always the result of inter-client negotiation,2108* the compositor shall no longer be able to induce a different2109* action.2110*2111* Upon "ask" actions, it is expected that the drag-and-drop2112* destination may potentially choose a different action and/or2113* mime type, based on wl_data_offer.source_actions and finally2114* chosen by the user (e.g. popping up a menu with the available2115* options). The final wl_data_offer.set_actions and2116* wl_data_offer.accept requests must happen before the call to2117* wl_data_offer.finish.2118* @param dnd_action action selected by the compositor2119* @since 32120*/2121void (*action)(void *data,2122struct wl_data_offer *wl_data_offer,2123uint32_t dnd_action);2124};21252126/**2127* @ingroup iface_wl_data_offer2128*/2129static inline int2130wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,2131const struct wl_data_offer_listener *listener, void *data)2132{2133return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,2134(void (**)(void)) listener, data);2135}21362137#define WL_DATA_OFFER_ACCEPT 02138#define WL_DATA_OFFER_RECEIVE 12139#define WL_DATA_OFFER_DESTROY 22140#define WL_DATA_OFFER_FINISH 32141#define WL_DATA_OFFER_SET_ACTIONS 421422143/**2144* @ingroup iface_wl_data_offer2145*/2146#define WL_DATA_OFFER_OFFER_SINCE_VERSION 12147/**2148* @ingroup iface_wl_data_offer2149*/2150#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 32151/**2152* @ingroup iface_wl_data_offer2153*/2154#define WL_DATA_OFFER_ACTION_SINCE_VERSION 321552156/**2157* @ingroup iface_wl_data_offer2158*/2159#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 12160/**2161* @ingroup iface_wl_data_offer2162*/2163#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 12164/**2165* @ingroup iface_wl_data_offer2166*/2167#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 12168/**2169* @ingroup iface_wl_data_offer2170*/2171#define WL_DATA_OFFER_FINISH_SINCE_VERSION 32172/**2173* @ingroup iface_wl_data_offer2174*/2175#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 321762177/** @ingroup iface_wl_data_offer */2178static inline void2179wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data)2180{2181wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);2182}21832184/** @ingroup iface_wl_data_offer */2185static inline void *2186wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)2187{2188return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);2189}21902191static inline uint32_t2192wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)2193{2194return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);2195}21962197/**2198* @ingroup iface_wl_data_offer2199*2200* Indicate that the client can accept the given mime type, or2201* NULL for not accepted.2202*2203* For objects of version 2 or older, this request is used by the2204* client to give feedback whether the client can receive the given2205* mime type, or NULL if none is accepted; the feedback does not2206* determine whether the drag-and-drop operation succeeds or not.2207*2208* For objects of version 3 or newer, this request determines the2209* final result of the drag-and-drop operation. If the end result2210* is that no mime types were accepted, the drag-and-drop operation2211* will be cancelled and the corresponding drag source will receive2212* wl_data_source.cancelled. Clients may still use this event in2213* conjunction with wl_data_source.action for feedback.2214*/2215static inline void2216wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)2217{2218wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2219WL_DATA_OFFER_ACCEPT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, serial, mime_type);2220}22212222/**2223* @ingroup iface_wl_data_offer2224*2225* To transfer the offered data, the client issues this request2226* and indicates the mime type it wants to receive. The transfer2227* happens through the passed file descriptor (typically created2228* with the pipe system call). The source client writes the data2229* in the mime type representation requested and then closes the2230* file descriptor.2231*2232* The receiving client reads from the read end of the pipe until2233* EOF and then closes its end, at which point the transfer is2234* complete.2235*2236* This request may happen multiple times for different mime types,2237* both before and after wl_data_device.drop. Drag-and-drop destination2238* clients may preemptively fetch data or examine it more closely to2239* determine acceptance.2240*/2241static inline void2242wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd)2243{2244wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2245WL_DATA_OFFER_RECEIVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, mime_type, fd);2246}22472248/**2249* @ingroup iface_wl_data_offer2250*2251* Destroy the data offer.2252*/2253static inline void2254wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)2255{2256wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2257WL_DATA_OFFER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), WL_MARSHAL_FLAG_DESTROY);2258}22592260/**2261* @ingroup iface_wl_data_offer2262*2263* Notifies the compositor that the drag destination successfully2264* finished the drag-and-drop operation.2265*2266* Upon receiving this request, the compositor will emit2267* wl_data_source.dnd_finished on the drag source client.2268*2269* It is a client error to perform other requests than2270* wl_data_offer.destroy after this one. It is also an error to perform2271* this request after a NULL mime type has been set in2272* wl_data_offer.accept or no action was received through2273* wl_data_offer.action.2274*2275* If wl_data_offer.finish request is received for a non drag and drop2276* operation, the invalid_finish protocol error is raised.2277*/2278static inline void2279wl_data_offer_finish(struct wl_data_offer *wl_data_offer)2280{2281wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2282WL_DATA_OFFER_FINISH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0);2283}22842285/**2286* @ingroup iface_wl_data_offer2287*2288* Sets the actions that the destination side client supports for2289* this operation. This request may trigger the emission of2290* wl_data_source.action and wl_data_offer.action events if the compositor2291* needs to change the selected action.2292*2293* This request can be called multiple times throughout the2294* drag-and-drop operation, typically in response to wl_data_device.enter2295* or wl_data_device.motion events.2296*2297* This request determines the final result of the drag-and-drop2298* operation. If the end result is that no action is accepted,2299* the drag source will receive wl_data_source.cancelled.2300*2301* The dnd_actions argument must contain only values expressed in the2302* wl_data_device_manager.dnd_actions enum, and the preferred_action2303* argument must only contain one of those values set, otherwise it2304* will result in a protocol error.2305*2306* While managing an "ask" action, the destination drag-and-drop client2307* may perform further wl_data_offer.receive requests, and is expected2308* to perform one last wl_data_offer.set_actions request with a preferred2309* action other than "ask" (and optionally wl_data_offer.accept) before2310* requesting wl_data_offer.finish, in order to convey the action selected2311* by the user. If the preferred action is not in the2312* wl_data_offer.source_actions mask, an error will be raised.2313*2314* If the "ask" action is dismissed (e.g. user cancellation), the client2315* is expected to perform wl_data_offer.destroy right away.2316*2317* This request can only be made on drag-and-drop offers, a protocol error2318* will be raised otherwise.2319*/2320static inline void2321wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action)2322{2323wl_proxy_marshal_flags((struct wl_proxy *) wl_data_offer,2324WL_DATA_OFFER_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_offer), 0, dnd_actions, preferred_action);2325}23262327#ifndef WL_DATA_SOURCE_ERROR_ENUM2328#define WL_DATA_SOURCE_ERROR_ENUM2329enum wl_data_source_error {2330/**2331* action mask contains invalid values2332*/2333WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,2334/**2335* source doesn't accept this request2336*/2337WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,2338};2339#endif /* WL_DATA_SOURCE_ERROR_ENUM */23402341/**2342* @ingroup iface_wl_data_source2343* @struct wl_data_source_listener2344*/2345struct wl_data_source_listener {2346/**2347* a target accepts an offered mime type2348*2349* Sent when a target accepts pointer_focus or motion events. If2350* a target does not accept any of the offered types, type is NULL.2351*2352* Used for feedback during drag-and-drop.2353* @param mime_type mime type accepted by the target2354*/2355void (*target)(void *data,2356struct wl_data_source *wl_data_source,2357const char *mime_type);2358/**2359* send the data2360*2361* Request for data from the client. Send the data as the2362* specified mime type over the passed file descriptor, then close2363* it.2364* @param mime_type mime type for the data2365* @param fd file descriptor for the data2366*/2367void (*send)(void *data,2368struct wl_data_source *wl_data_source,2369const char *mime_type,2370int32_t fd);2371/**2372* selection was cancelled2373*2374* This data source is no longer valid. There are several reasons2375* why this could happen:2376*2377* - The data source has been replaced by another data source. -2378* The drag-and-drop operation was performed, but the drop2379* destination did not accept any of the mime types offered through2380* wl_data_source.target. - The drag-and-drop operation was2381* performed, but the drop destination did not select any of the2382* actions present in the mask offered through2383* wl_data_source.action. - The drag-and-drop operation was2384* performed but didn't happen over a surface. - The compositor2385* cancelled the drag-and-drop operation (e.g. compositor dependent2386* timeouts to avoid stale drag-and-drop transfers).2387*2388* The client should clean up and destroy this data source.2389*2390* For objects of version 2 or older, wl_data_source.cancelled will2391* only be emitted if the data source was replaced by another data2392* source.2393*/2394void (*cancelled)(void *data,2395struct wl_data_source *wl_data_source);2396/**2397* the drag-and-drop operation physically finished2398*2399* The user performed the drop action. This event does not2400* indicate acceptance, wl_data_source.cancelled may still be2401* emitted afterwards if the drop destination does not accept any2402* mime type.2403*2404* However, this event might however not be received if the2405* compositor cancelled the drag-and-drop operation before this2406* event could happen.2407*2408* Note that the data_source may still be used in the future and2409* should not be destroyed here.2410* @since 32411*/2412void (*dnd_drop_performed)(void *data,2413struct wl_data_source *wl_data_source);2414/**2415* the drag-and-drop operation concluded2416*2417* The drop destination finished interoperating with this data2418* source, so the client is now free to destroy this data source2419* and free all associated data.2420*2421* If the action used to perform the operation was "move", the2422* source can now delete the transferred data.2423* @since 32424*/2425void (*dnd_finished)(void *data,2426struct wl_data_source *wl_data_source);2427/**2428* notify the selected action2429*2430* This event indicates the action selected by the compositor2431* after matching the source/destination side actions. Only one2432* action (or none) will be offered here.2433*2434* This event can be emitted multiple times during the2435* drag-and-drop operation, mainly in response to destination side2436* changes through wl_data_offer.set_actions, and as the data2437* device enters/leaves surfaces.2438*2439* It is only possible to receive this event after2440* wl_data_source.dnd_drop_performed if the drag-and-drop operation2441* ended in an "ask" action, in which case the final2442* wl_data_source.action event will happen immediately before2443* wl_data_source.dnd_finished.2444*2445* Compositors may also change the selected action on the fly,2446* mainly in response to keyboard modifier changes during the2447* drag-and-drop operation.2448*2449* The most recent action received is always the valid one. The2450* chosen action may change alongside negotiation (e.g. an "ask"2451* action can turn into a "move" operation), so the effects of the2452* final action must always be applied in2453* wl_data_offer.dnd_finished.2454*2455* Clients can trigger cursor surface changes from this point, so2456* they reflect the current action.2457* @param dnd_action action selected by the compositor2458* @since 32459*/2460void (*action)(void *data,2461struct wl_data_source *wl_data_source,2462uint32_t dnd_action);2463};24642465/**2466* @ingroup iface_wl_data_source2467*/2468static inline int2469wl_data_source_add_listener(struct wl_data_source *wl_data_source,2470const struct wl_data_source_listener *listener, void *data)2471{2472return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,2473(void (**)(void)) listener, data);2474}24752476#define WL_DATA_SOURCE_OFFER 02477#define WL_DATA_SOURCE_DESTROY 12478#define WL_DATA_SOURCE_SET_ACTIONS 224792480/**2481* @ingroup iface_wl_data_source2482*/2483#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 12484/**2485* @ingroup iface_wl_data_source2486*/2487#define WL_DATA_SOURCE_SEND_SINCE_VERSION 12488/**2489* @ingroup iface_wl_data_source2490*/2491#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 12492/**2493* @ingroup iface_wl_data_source2494*/2495#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 32496/**2497* @ingroup iface_wl_data_source2498*/2499#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 32500/**2501* @ingroup iface_wl_data_source2502*/2503#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 325042505/**2506* @ingroup iface_wl_data_source2507*/2508#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 12509/**2510* @ingroup iface_wl_data_source2511*/2512#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 12513/**2514* @ingroup iface_wl_data_source2515*/2516#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 325172518/** @ingroup iface_wl_data_source */2519static inline void2520wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data)2521{2522wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);2523}25242525/** @ingroup iface_wl_data_source */2526static inline void *2527wl_data_source_get_user_data(struct wl_data_source *wl_data_source)2528{2529return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);2530}25312532static inline uint32_t2533wl_data_source_get_version(struct wl_data_source *wl_data_source)2534{2535return wl_proxy_get_version((struct wl_proxy *) wl_data_source);2536}25372538/**2539* @ingroup iface_wl_data_source2540*2541* This request adds a mime type to the set of mime types2542* advertised to targets. Can be called several times to offer2543* multiple types.2544*/2545static inline void2546wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type)2547{2548wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2549WL_DATA_SOURCE_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, mime_type);2550}25512552/**2553* @ingroup iface_wl_data_source2554*2555* Destroy the data source.2556*/2557static inline void2558wl_data_source_destroy(struct wl_data_source *wl_data_source)2559{2560wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2561WL_DATA_SOURCE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), WL_MARSHAL_FLAG_DESTROY);2562}25632564/**2565* @ingroup iface_wl_data_source2566*2567* Sets the actions that the source side client supports for this2568* operation. This request may trigger wl_data_source.action and2569* wl_data_offer.action events if the compositor needs to change the2570* selected action.2571*2572* The dnd_actions argument must contain only values expressed in the2573* wl_data_device_manager.dnd_actions enum, otherwise it will result2574* in a protocol error.2575*2576* This request must be made once only, and can only be made on sources2577* used in drag-and-drop, so it must be performed before2578* wl_data_device.start_drag. Attempting to use the source other than2579* for drag-and-drop will raise a protocol error.2580*/2581static inline void2582wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_actions)2583{2584wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,2585WL_DATA_SOURCE_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, dnd_actions);2586}25872588#ifndef WL_DATA_DEVICE_ERROR_ENUM2589#define WL_DATA_DEVICE_ERROR_ENUM2590enum wl_data_device_error {2591/**2592* given wl_surface has another role2593*/2594WL_DATA_DEVICE_ERROR_ROLE = 0,2595};2596#endif /* WL_DATA_DEVICE_ERROR_ENUM */25972598/**2599* @ingroup iface_wl_data_device2600* @struct wl_data_device_listener2601*/2602struct wl_data_device_listener {2603/**2604* introduce a new wl_data_offer2605*2606* The data_offer event introduces a new wl_data_offer object,2607* which will subsequently be used in either the data_device.enter2608* event (for drag-and-drop) or the data_device.selection event2609* (for selections). Immediately following the2610* data_device.data_offer event, the new data_offer object will2611* send out data_offer.offer events to describe the mime types it2612* offers.2613* @param id the new data_offer object2614*/2615void (*data_offer)(void *data,2616struct wl_data_device *wl_data_device,2617struct wl_data_offer *id);2618/**2619* initiate drag-and-drop session2620*2621* This event is sent when an active drag-and-drop pointer enters2622* a surface owned by the client. The position of the pointer at2623* enter time is provided by the x and y arguments, in2624* surface-local coordinates.2625* @param serial serial number of the enter event2626* @param surface client surface entered2627* @param x surface-local x coordinate2628* @param y surface-local y coordinate2629* @param id source data_offer object2630*/2631void (*enter)(void *data,2632struct wl_data_device *wl_data_device,2633uint32_t serial,2634struct wl_surface *surface,2635wl_fixed_t x,2636wl_fixed_t y,2637struct wl_data_offer *id);2638/**2639* end drag-and-drop session2640*2641* This event is sent when the drag-and-drop pointer leaves the2642* surface and the session ends. The client must destroy the2643* wl_data_offer introduced at enter time at this point.2644*/2645void (*leave)(void *data,2646struct wl_data_device *wl_data_device);2647/**2648* drag-and-drop session motion2649*2650* This event is sent when the drag-and-drop pointer moves within2651* the currently focused surface. The new position of the pointer2652* is provided by the x and y arguments, in surface-local2653* coordinates.2654* @param time timestamp with millisecond granularity2655* @param x surface-local x coordinate2656* @param y surface-local y coordinate2657*/2658void (*motion)(void *data,2659struct wl_data_device *wl_data_device,2660uint32_t time,2661wl_fixed_t x,2662wl_fixed_t y);2663/**2664* end drag-and-drop session successfully2665*2666* The event is sent when a drag-and-drop operation is ended2667* because the implicit grab is removed.2668*2669* The drag-and-drop destination is expected to honor the last2670* action received through wl_data_offer.action, if the resulting2671* action is "copy" or "move", the destination can still perform2672* wl_data_offer.receive requests, and is expected to end all2673* transfers with a wl_data_offer.finish request.2674*2675* If the resulting action is "ask", the action will not be2676* considered final. The drag-and-drop destination is expected to2677* perform one last wl_data_offer.set_actions request, or2678* wl_data_offer.destroy in order to cancel the operation.2679*/2680void (*drop)(void *data,2681struct wl_data_device *wl_data_device);2682/**2683* advertise new selection2684*2685* The selection event is sent out to notify the client of a new2686* wl_data_offer for the selection for this device. The2687* data_device.data_offer and the data_offer.offer events are sent2688* out immediately before this event to introduce the data offer2689* object. The selection event is sent to a client immediately2690* before receiving keyboard focus and when a new selection is set2691* while the client has keyboard focus. The data_offer is valid2692* until a new data_offer or NULL is received or until the client2693* loses keyboard focus. Switching surface with keyboard focus2694* within the same client doesn't mean a new selection will be2695* sent. The client must destroy the previous selection data_offer,2696* if any, upon receiving this event.2697* @param id selection data_offer object2698*/2699void (*selection)(void *data,2700struct wl_data_device *wl_data_device,2701struct wl_data_offer *id);2702};27032704/**2705* @ingroup iface_wl_data_device2706*/2707static inline int2708wl_data_device_add_listener(struct wl_data_device *wl_data_device,2709const struct wl_data_device_listener *listener, void *data)2710{2711return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,2712(void (**)(void)) listener, data);2713}27142715#define WL_DATA_DEVICE_START_DRAG 02716#define WL_DATA_DEVICE_SET_SELECTION 12717#define WL_DATA_DEVICE_RELEASE 227182719/**2720* @ingroup iface_wl_data_device2721*/2722#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 12723/**2724* @ingroup iface_wl_data_device2725*/2726#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 12727/**2728* @ingroup iface_wl_data_device2729*/2730#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 12731/**2732* @ingroup iface_wl_data_device2733*/2734#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 12735/**2736* @ingroup iface_wl_data_device2737*/2738#define WL_DATA_DEVICE_DROP_SINCE_VERSION 12739/**2740* @ingroup iface_wl_data_device2741*/2742#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 127432744/**2745* @ingroup iface_wl_data_device2746*/2747#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 12748/**2749* @ingroup iface_wl_data_device2750*/2751#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 12752/**2753* @ingroup iface_wl_data_device2754*/2755#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 227562757/** @ingroup iface_wl_data_device */2758static inline void2759wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data)2760{2761wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);2762}27632764/** @ingroup iface_wl_data_device */2765static inline void *2766wl_data_device_get_user_data(struct wl_data_device *wl_data_device)2767{2768return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);2769}27702771static inline uint32_t2772wl_data_device_get_version(struct wl_data_device *wl_data_device)2773{2774return wl_proxy_get_version((struct wl_proxy *) wl_data_device);2775}27762777/** @ingroup iface_wl_data_device */2778static inline void2779wl_data_device_destroy(struct wl_data_device *wl_data_device)2780{2781wl_proxy_destroy((struct wl_proxy *) wl_data_device);2782}27832784/**2785* @ingroup iface_wl_data_device2786*2787* This request asks the compositor to start a drag-and-drop2788* operation on behalf of the client.2789*2790* The source argument is the data source that provides the data2791* for the eventual data transfer. If source is NULL, enter, leave2792* and motion events are sent only to the client that initiated the2793* drag and the client is expected to handle the data passing2794* internally. If source is destroyed, the drag-and-drop session will be2795* cancelled.2796*2797* The origin surface is the surface where the drag originates and2798* the client must have an active implicit grab that matches the2799* serial.2800*2801* The icon surface is an optional (can be NULL) surface that2802* provides an icon to be moved around with the cursor. Initially,2803* the top-left corner of the icon surface is placed at the cursor2804* hotspot, but subsequent wl_surface.attach request can move the2805* relative position. Attach requests must be confirmed with2806* wl_surface.commit as usual. The icon surface is given the role of2807* a drag-and-drop icon. If the icon surface already has another role,2808* it raises a protocol error.2809*2810* The current and pending input regions of the icon wl_surface are2811* cleared, and wl_surface.set_input_region is ignored until the2812* wl_surface is no longer used as the icon surface. When the use2813* as an icon ends, the current and pending input regions become2814* undefined, and the wl_surface is unmapped.2815*/2816static inline void2817wl_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)2818{2819wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,2820WL_DATA_DEVICE_START_DRAG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, origin, icon, serial);2821}28222823/**2824* @ingroup iface_wl_data_device2825*2826* This request asks the compositor to set the selection2827* to the data from the source on behalf of the client.2828*2829* To unset the selection, set the source to NULL.2830*/2831static inline void2832wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial)2833{2834wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,2835WL_DATA_DEVICE_SET_SELECTION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), 0, source, serial);2836}28372838/**2839* @ingroup iface_wl_data_device2840*2841* This request destroys the data device.2842*/2843static inline void2844wl_data_device_release(struct wl_data_device *wl_data_device)2845{2846wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device,2847WL_DATA_DEVICE_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_device), WL_MARSHAL_FLAG_DESTROY);2848}28492850#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM2851#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM2852/**2853* @ingroup iface_wl_data_device_manager2854* drag and drop actions2855*2856* This is a bitmask of the available/preferred actions in a2857* drag-and-drop operation.2858*2859* In the compositor, the selected action is a result of matching the2860* actions offered by the source and destination sides. "action" events2861* with a "none" action will be sent to both source and destination if2862* there is no match. All further checks will effectively happen on2863* (source actions ∩ destination actions).2864*2865* In addition, compositors may also pick different actions in2866* reaction to key modifiers being pressed. One common design that2867* is used in major toolkits (and the behavior recommended for2868* compositors) is:2869*2870* - If no modifiers are pressed, the first match (in bit order)2871* will be used.2872* - Pressing Shift selects "move", if enabled in the mask.2873* - Pressing Control selects "copy", if enabled in the mask.2874*2875* Behavior beyond that is considered implementation-dependent.2876* Compositors may for example bind other modifiers (like Alt/Meta)2877* or drags initiated with other buttons than BTN_LEFT to specific2878* actions (e.g. "ask").2879*/2880enum wl_data_device_manager_dnd_action {2881/**2882* no action2883*/2884WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,2885/**2886* copy action2887*/2888WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,2889/**2890* move action2891*/2892WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,2893/**2894* ask action2895*/2896WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,2897};2898#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */28992900#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 02901#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1290229032904/**2905* @ingroup iface_wl_data_device_manager2906*/2907#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 12908/**2909* @ingroup iface_wl_data_device_manager2910*/2911#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 129122913/** @ingroup iface_wl_data_device_manager */2914static inline void2915wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data)2916{2917wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);2918}29192920/** @ingroup iface_wl_data_device_manager */2921static inline void *2922wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager)2923{2924return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);2925}29262927static inline uint32_t2928wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager)2929{2930return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);2931}29322933/** @ingroup iface_wl_data_device_manager */2934static inline void2935wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager)2936{2937wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);2938}29392940/**2941* @ingroup iface_wl_data_device_manager2942*2943* Create a new data source.2944*/2945static inline struct wl_data_source *2946wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager)2947{2948struct wl_proxy *id;29492950id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,2951WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL);29522953return (struct wl_data_source *) id;2954}29552956/**2957* @ingroup iface_wl_data_device_manager2958*2959* Create a new data device for a given seat.2960*/2961static inline struct wl_data_device *2962wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)2963{2964struct wl_proxy *id;29652966id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,2967WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL, seat);29682969return (struct wl_data_device *) id;2970}29712972#ifndef WL_SHELL_ERROR_ENUM2973#define WL_SHELL_ERROR_ENUM2974enum wl_shell_error {2975/**2976* given wl_surface has another role2977*/2978WL_SHELL_ERROR_ROLE = 0,2979};2980#endif /* WL_SHELL_ERROR_ENUM */29812982#define WL_SHELL_GET_SHELL_SURFACE 0298329842985/**2986* @ingroup iface_wl_shell2987*/2988#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 129892990/** @ingroup iface_wl_shell */2991static inline void2992wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)2993{2994wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);2995}29962997/** @ingroup iface_wl_shell */2998static inline void *2999wl_shell_get_user_data(struct wl_shell *wl_shell)3000{3001return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);3002}30033004static inline uint32_t3005wl_shell_get_version(struct wl_shell *wl_shell)3006{3007return wl_proxy_get_version((struct wl_proxy *) wl_shell);3008}30093010/** @ingroup iface_wl_shell */3011static inline void3012wl_shell_destroy(struct wl_shell *wl_shell)3013{3014wl_proxy_destroy((struct wl_proxy *) wl_shell);3015}30163017/**3018* @ingroup iface_wl_shell3019*3020* Create a shell surface for an existing surface. This gives3021* the wl_surface the role of a shell surface. If the wl_surface3022* already has another role, it raises a protocol error.3023*3024* Only one shell surface can be associated with a given surface.3025*/3026static inline struct wl_shell_surface *3027wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)3028{3029struct wl_proxy *id;30303031id = wl_proxy_marshal_flags((struct wl_proxy *) wl_shell,3032WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, wl_proxy_get_version((struct wl_proxy *) wl_shell), 0, NULL, surface);30333034return (struct wl_shell_surface *) id;3035}30363037#ifndef WL_SHELL_SURFACE_RESIZE_ENUM3038#define WL_SHELL_SURFACE_RESIZE_ENUM3039/**3040* @ingroup iface_wl_shell_surface3041* edge values for resizing3042*3043* These values are used to indicate which edge of a surface3044* is being dragged in a resize operation. The server may3045* use this information to adapt its behavior, e.g. choose3046* an appropriate cursor image.3047*/3048enum wl_shell_surface_resize {3049/**3050* no edge3051*/3052WL_SHELL_SURFACE_RESIZE_NONE = 0,3053/**3054* top edge3055*/3056WL_SHELL_SURFACE_RESIZE_TOP = 1,3057/**3058* bottom edge3059*/3060WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,3061/**3062* left edge3063*/3064WL_SHELL_SURFACE_RESIZE_LEFT = 4,3065/**3066* top and left edges3067*/3068WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,3069/**3070* bottom and left edges3071*/3072WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,3073/**3074* right edge3075*/3076WL_SHELL_SURFACE_RESIZE_RIGHT = 8,3077/**3078* top and right edges3079*/3080WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,3081/**3082* bottom and right edges3083*/3084WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,3085};3086#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */30873088#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM3089#define WL_SHELL_SURFACE_TRANSIENT_ENUM3090/**3091* @ingroup iface_wl_shell_surface3092* details of transient behaviour3093*3094* These flags specify details of the expected behaviour3095* of transient surfaces. Used in the set_transient request.3096*/3097enum wl_shell_surface_transient {3098/**3099* do not set keyboard focus3100*/3101WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,3102};3103#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */31043105#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM3106#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM3107/**3108* @ingroup iface_wl_shell_surface3109* different method to set the surface fullscreen3110*3111* Hints to indicate to the compositor how to deal with a conflict3112* between the dimensions of the surface and the dimensions of the3113* output. The compositor is free to ignore this parameter.3114*/3115enum wl_shell_surface_fullscreen_method {3116/**3117* no preference, apply default policy3118*/3119WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,3120/**3121* scale, preserve the surface's aspect ratio and center on output3122*/3123WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,3124/**3125* switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch3126*/3127WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,3128/**3129* no upscaling, center on output and add black borders to compensate size mismatch3130*/3131WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,3132};3133#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */31343135/**3136* @ingroup iface_wl_shell_surface3137* @struct wl_shell_surface_listener3138*/3139struct wl_shell_surface_listener {3140/**3141* ping client3142*3143* Ping a client to check if it is receiving events and sending3144* requests. A client is expected to reply with a pong request.3145* @param serial serial number of the ping3146*/3147void (*ping)(void *data,3148struct wl_shell_surface *wl_shell_surface,3149uint32_t serial);3150/**3151* suggest resize3152*3153* The configure event asks the client to resize its surface.3154*3155* The size is a hint, in the sense that the client is free to3156* ignore it if it doesn't resize, pick a smaller size (to satisfy3157* aspect ratio or resize in steps of NxM pixels).3158*3159* The edges parameter provides a hint about how the surface was3160* resized. The client may use this information to decide how to3161* adjust its content to the new size (e.g. a scrolling area might3162* adjust its content position to leave the viewable content3163* unmoved).3164*3165* The client is free to dismiss all but the last configure event3166* it received.3167*3168* The width and height arguments specify the size of the window in3169* surface-local coordinates.3170* @param edges how the surface was resized3171* @param width new width of the surface3172* @param height new height of the surface3173*/3174void (*configure)(void *data,3175struct wl_shell_surface *wl_shell_surface,3176uint32_t edges,3177int32_t width,3178int32_t height);3179/**3180* popup interaction is done3181*3182* The popup_done event is sent out when a popup grab is broken,3183* that is, when the user clicks a surface that doesn't belong to3184* the client owning the popup surface.3185*/3186void (*popup_done)(void *data,3187struct wl_shell_surface *wl_shell_surface);3188};31893190/**3191* @ingroup iface_wl_shell_surface3192*/3193static inline int3194wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface,3195const struct wl_shell_surface_listener *listener, void *data)3196{3197return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,3198(void (**)(void)) listener, data);3199}32003201#define WL_SHELL_SURFACE_PONG 03202#define WL_SHELL_SURFACE_MOVE 13203#define WL_SHELL_SURFACE_RESIZE 23204#define WL_SHELL_SURFACE_SET_TOPLEVEL 33205#define WL_SHELL_SURFACE_SET_TRANSIENT 43206#define WL_SHELL_SURFACE_SET_FULLSCREEN 53207#define WL_SHELL_SURFACE_SET_POPUP 63208#define WL_SHELL_SURFACE_SET_MAXIMIZED 73209#define WL_SHELL_SURFACE_SET_TITLE 83210#define WL_SHELL_SURFACE_SET_CLASS 932113212/**3213* @ingroup iface_wl_shell_surface3214*/3215#define WL_SHELL_SURFACE_PING_SINCE_VERSION 13216/**3217* @ingroup iface_wl_shell_surface3218*/3219#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 13220/**3221* @ingroup iface_wl_shell_surface3222*/3223#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 132243225/**3226* @ingroup iface_wl_shell_surface3227*/3228#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 13229/**3230* @ingroup iface_wl_shell_surface3231*/3232#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 13233/**3234* @ingroup iface_wl_shell_surface3235*/3236#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 13237/**3238* @ingroup iface_wl_shell_surface3239*/3240#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 13241/**3242* @ingroup iface_wl_shell_surface3243*/3244#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 13245/**3246* @ingroup iface_wl_shell_surface3247*/3248#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 13249/**3250* @ingroup iface_wl_shell_surface3251*/3252#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 13253/**3254* @ingroup iface_wl_shell_surface3255*/3256#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 13257/**3258* @ingroup iface_wl_shell_surface3259*/3260#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 13261/**3262* @ingroup iface_wl_shell_surface3263*/3264#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 132653266/** @ingroup iface_wl_shell_surface */3267static inline void3268wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)3269{3270wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);3271}32723273/** @ingroup iface_wl_shell_surface */3274static inline void *3275wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)3276{3277return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);3278}32793280static inline uint32_t3281wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)3282{3283return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);3284}32853286/** @ingroup iface_wl_shell_surface */3287static inline void3288wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)3289{3290wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);3291}32923293/**3294* @ingroup iface_wl_shell_surface3295*3296* A client must respond to a ping event with a pong request or3297* the client may be deemed unresponsive.3298*/3299static inline void3300wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)3301{3302wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3303WL_SHELL_SURFACE_PONG, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, serial);3304}33053306/**3307* @ingroup iface_wl_shell_surface3308*3309* Start a pointer-driven move of the surface.3310*3311* This request must be used in response to a button press event.3312* The server may ignore move requests depending on the state of3313* the surface (e.g. fullscreen or maximized).3314*/3315static inline void3316wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)3317{3318wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3319WL_SHELL_SURFACE_MOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial);3320}33213322/**3323* @ingroup iface_wl_shell_surface3324*3325* Start a pointer-driven resizing of the surface.3326*3327* This request must be used in response to a button press event.3328* The server may ignore resize requests depending on the state of3329* the surface (e.g. fullscreen or maximized).3330*/3331static inline void3332wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)3333{3334wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3335WL_SHELL_SURFACE_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, edges);3336}33373338/**3339* @ingroup iface_wl_shell_surface3340*3341* Map the surface as a toplevel surface.3342*3343* A toplevel surface is not fullscreen, maximized or transient.3344*/3345static inline void3346wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)3347{3348wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3349WL_SHELL_SURFACE_SET_TOPLEVEL, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0);3350}33513352/**3353* @ingroup iface_wl_shell_surface3354*3355* Map the surface relative to an existing surface.3356*3357* The x and y arguments specify the location of the upper left3358* corner of the surface relative to the upper left corner of the3359* parent surface, in surface-local coordinates.3360*3361* The flags argument controls details of the transient behaviour.3362*/3363static inline void3364wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)3365{3366wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3367WL_SHELL_SURFACE_SET_TRANSIENT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, parent, x, y, flags);3368}33693370/**3371* @ingroup iface_wl_shell_surface3372*3373* Map the surface as a fullscreen surface.3374*3375* If an output parameter is given then the surface will be made3376* fullscreen on that output. If the client does not specify the3377* output then the compositor will apply its policy - usually3378* choosing the output on which the surface has the biggest surface3379* area.3380*3381* The client may specify a method to resolve a size conflict3382* between the output size and the surface size - this is provided3383* through the method parameter.3384*3385* The framerate parameter is used only when the method is set3386* to "driver", to indicate the preferred framerate. A value of 03387* indicates that the client does not care about framerate. The3388* framerate is specified in mHz, that is framerate of 60000 is 60Hz.3389*3390* A method of "scale" or "driver" implies a scaling operation of3391* the surface, either via a direct scaling operation or a change of3392* the output mode. This will override any kind of output scaling, so3393* that mapping a surface with a buffer size equal to the mode can3394* fill the screen independent of buffer_scale.3395*3396* A method of "fill" means we don't scale up the buffer, however3397* any output scale is applied. This means that you may run into3398* an edge case where the application maps a buffer with the same3399* size of the output mode but buffer_scale 1 (thus making a3400* surface larger than the output). In this case it is allowed to3401* downscale the results to fit the screen.3402*3403* The compositor must reply to this request with a configure event3404* with the dimensions for the output on which the surface will3405* be made fullscreen.3406*/3407static inline void3408wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)3409{3410wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3411WL_SHELL_SURFACE_SET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, method, framerate, output);3412}34133414/**3415* @ingroup iface_wl_shell_surface3416*3417* Map the surface as a popup.3418*3419* A popup surface is a transient surface with an added pointer3420* grab.3421*3422* An existing implicit grab will be changed to owner-events mode,3423* and the popup grab will continue after the implicit grab ends3424* (i.e. releasing the mouse button does not cause the popup to3425* be unmapped).3426*3427* The popup grab continues until the window is destroyed or a3428* mouse button is pressed in any other client's window. A click3429* in any of the client's surfaces is reported as normal, however,3430* clicks in other clients' surfaces will be discarded and trigger3431* the callback.3432*3433* The x and y arguments specify the location of the upper left3434* corner of the surface relative to the upper left corner of the3435* parent surface, in surface-local coordinates.3436*/3437static inline void3438wl_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)3439{3440wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3441WL_SHELL_SURFACE_SET_POPUP, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, seat, serial, parent, x, y, flags);3442}34433444/**3445* @ingroup iface_wl_shell_surface3446*3447* Map the surface as a maximized surface.3448*3449* If an output parameter is given then the surface will be3450* maximized on that output. If the client does not specify the3451* output then the compositor will apply its policy - usually3452* choosing the output on which the surface has the biggest surface3453* area.3454*3455* The compositor will reply with a configure event telling3456* the expected new surface size. The operation is completed3457* on the next buffer attach to this surface.3458*3459* A maximized surface typically fills the entire output it is3460* bound to, except for desktop elements such as panels. This is3461* the main difference between a maximized shell surface and a3462* fullscreen shell surface.3463*3464* The details depend on the compositor implementation.3465*/3466static inline void3467wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)3468{3469wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3470WL_SHELL_SURFACE_SET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, output);3471}34723473/**3474* @ingroup iface_wl_shell_surface3475*3476* Set a short title for the surface.3477*3478* This string may be used to identify the surface in a task bar,3479* window list, or other user interface elements provided by the3480* compositor.3481*3482* The string must be encoded in UTF-8.3483*/3484static inline void3485wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)3486{3487wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3488WL_SHELL_SURFACE_SET_TITLE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, title);3489}34903491/**3492* @ingroup iface_wl_shell_surface3493*3494* Set a class for the surface.3495*3496* The surface class identifies the general class of applications3497* to which the surface belongs. A common convention is to use the3498* file name (or the full path if it is a non-standard location) of3499* the application's .desktop file as the class.3500*/3501static inline void3502wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)3503{3504wl_proxy_marshal_flags((struct wl_proxy *) wl_shell_surface,3505WL_SHELL_SURFACE_SET_CLASS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_shell_surface), 0, class_);3506}35073508#ifndef WL_SURFACE_ERROR_ENUM3509#define WL_SURFACE_ERROR_ENUM3510/**3511* @ingroup iface_wl_surface3512* wl_surface error values3513*3514* These errors can be emitted in response to wl_surface requests.3515*/3516enum wl_surface_error {3517/**3518* buffer scale value is invalid3519*/3520WL_SURFACE_ERROR_INVALID_SCALE = 0,3521/**3522* buffer transform value is invalid3523*/3524WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,3525/**3526* buffer size is invalid3527*/3528WL_SURFACE_ERROR_INVALID_SIZE = 2,3529/**3530* buffer offset is invalid3531*/3532WL_SURFACE_ERROR_INVALID_OFFSET = 3,3533};3534#endif /* WL_SURFACE_ERROR_ENUM */35353536/**3537* @ingroup iface_wl_surface3538* @struct wl_surface_listener3539*/3540struct wl_surface_listener {3541/**3542* surface enters an output3543*3544* This is emitted whenever a surface's creation, movement, or3545* resizing results in some part of it being within the scanout3546* region of an output.3547*3548* Note that a surface may be overlapping with zero or more3549* outputs.3550* @param output output entered by the surface3551*/3552void (*enter)(void *data,3553struct wl_surface *wl_surface,3554struct wl_output *output);3555/**3556* surface leaves an output3557*3558* This is emitted whenever a surface's creation, movement, or3559* resizing results in it no longer having any part of it within3560* the scanout region of an output.3561*3562* Clients should not use the number of outputs the surface is on3563* for frame throttling purposes. The surface might be hidden even3564* if no leave event has been sent, and the compositor might expect3565* new surface content updates even if no enter event has been3566* sent. The frame event should be used instead.3567* @param output output left by the surface3568*/3569void (*leave)(void *data,3570struct wl_surface *wl_surface,3571struct wl_output *output);3572};35733574/**3575* @ingroup iface_wl_surface3576*/3577static inline int3578wl_surface_add_listener(struct wl_surface *wl_surface,3579const struct wl_surface_listener *listener, void *data)3580{3581return wl_proxy_add_listener((struct wl_proxy *) wl_surface,3582(void (**)(void)) listener, data);3583}35843585#define WL_SURFACE_DESTROY 03586#define WL_SURFACE_ATTACH 13587#define WL_SURFACE_DAMAGE 23588#define WL_SURFACE_FRAME 33589#define WL_SURFACE_SET_OPAQUE_REGION 43590#define WL_SURFACE_SET_INPUT_REGION 53591#define WL_SURFACE_COMMIT 63592#define WL_SURFACE_SET_BUFFER_TRANSFORM 73593#define WL_SURFACE_SET_BUFFER_SCALE 83594#define WL_SURFACE_DAMAGE_BUFFER 93595#define WL_SURFACE_OFFSET 1035963597/**3598* @ingroup iface_wl_surface3599*/3600#define WL_SURFACE_ENTER_SINCE_VERSION 13601/**3602* @ingroup iface_wl_surface3603*/3604#define WL_SURFACE_LEAVE_SINCE_VERSION 136053606/**3607* @ingroup iface_wl_surface3608*/3609#define WL_SURFACE_DESTROY_SINCE_VERSION 13610/**3611* @ingroup iface_wl_surface3612*/3613#define WL_SURFACE_ATTACH_SINCE_VERSION 13614/**3615* @ingroup iface_wl_surface3616*/3617#define WL_SURFACE_DAMAGE_SINCE_VERSION 13618/**3619* @ingroup iface_wl_surface3620*/3621#define WL_SURFACE_FRAME_SINCE_VERSION 13622/**3623* @ingroup iface_wl_surface3624*/3625#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 13626/**3627* @ingroup iface_wl_surface3628*/3629#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 13630/**3631* @ingroup iface_wl_surface3632*/3633#define WL_SURFACE_COMMIT_SINCE_VERSION 13634/**3635* @ingroup iface_wl_surface3636*/3637#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 23638/**3639* @ingroup iface_wl_surface3640*/3641#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 33642/**3643* @ingroup iface_wl_surface3644*/3645#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 43646/**3647* @ingroup iface_wl_surface3648*/3649#define WL_SURFACE_OFFSET_SINCE_VERSION 536503651/** @ingroup iface_wl_surface */3652static inline void3653wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)3654{3655wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);3656}36573658/** @ingroup iface_wl_surface */3659static inline void *3660wl_surface_get_user_data(struct wl_surface *wl_surface)3661{3662return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);3663}36643665static inline uint32_t3666wl_surface_get_version(struct wl_surface *wl_surface)3667{3668return wl_proxy_get_version((struct wl_proxy *) wl_surface);3669}36703671/**3672* @ingroup iface_wl_surface3673*3674* Deletes the surface and invalidates its object ID.3675*/3676static inline void3677wl_surface_destroy(struct wl_surface *wl_surface)3678{3679wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3680WL_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), WL_MARSHAL_FLAG_DESTROY);3681}36823683/**3684* @ingroup iface_wl_surface3685*3686* Set a buffer as the content of this surface.3687*3688* The new size of the surface is calculated based on the buffer3689* size transformed by the inverse buffer_transform and the3690* inverse buffer_scale. This means that at commit time the supplied3691* buffer size must be an integer multiple of the buffer_scale. If3692* that's not the case, an invalid_size error is sent.3693*3694* The x and y arguments specify the location of the new pending3695* buffer's upper left corner, relative to the current buffer's upper3696* left corner, in surface-local coordinates. In other words, the3697* x and y, combined with the new surface size define in which3698* directions the surface's size changes. Setting anything other than 03699* as x and y arguments is discouraged, and should instead be replaced3700* with using the separate wl_surface.offset request.3701*3702* When the bound wl_surface version is 5 or higher, passing any3703* non-zero x or y is a protocol violation, and will result in an3704* 'invalid_offset' error being raised. To achieve equivalent semantics,3705* use wl_surface.offset.3706*3707* Surface contents are double-buffered state, see wl_surface.commit.3708*3709* The initial surface contents are void; there is no content.3710* wl_surface.attach assigns the given wl_buffer as the pending3711* wl_buffer. wl_surface.commit makes the pending wl_buffer the new3712* surface contents, and the size of the surface becomes the size3713* calculated from the wl_buffer, as described above. After commit,3714* there is no pending buffer until the next attach.3715*3716* Committing a pending wl_buffer allows the compositor to read the3717* pixels in the wl_buffer. The compositor may access the pixels at3718* any time after the wl_surface.commit request. When the compositor3719* will not access the pixels anymore, it will send the3720* wl_buffer.release event. Only after receiving wl_buffer.release,3721* the client may reuse the wl_buffer. A wl_buffer that has been3722* attached and then replaced by another attach instead of committed3723* will not receive a release event, and is not used by the3724* compositor.3725*3726* If a pending wl_buffer has been committed to more than one wl_surface,3727* the delivery of wl_buffer.release events becomes undefined. A well3728* behaved client should not rely on wl_buffer.release events in this3729* case. Alternatively, a client could create multiple wl_buffer objects3730* from the same backing storage or use wp_linux_buffer_release.3731*3732* Destroying the wl_buffer after wl_buffer.release does not change3733* the surface contents. Destroying the wl_buffer before wl_buffer.release3734* is allowed as long as the underlying buffer storage isn't re-used (this3735* can happen e.g. on client process termination). However, if the client3736* destroys the wl_buffer before receiving the wl_buffer.release event and3737* mutates the underlying buffer storage, the surface contents become3738* undefined immediately.3739*3740* If wl_surface.attach is sent with a NULL wl_buffer, the3741* following wl_surface.commit will remove the surface content.3742*/3743static inline void3744wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)3745{3746wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3747WL_SURFACE_ATTACH, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, buffer, x, y);3748}37493750/**3751* @ingroup iface_wl_surface3752*3753* This request is used to describe the regions where the pending3754* buffer is different from the current surface contents, and where3755* the surface therefore needs to be repainted. The compositor3756* ignores the parts of the damage that fall outside of the surface.3757*3758* Damage is double-buffered state, see wl_surface.commit.3759*3760* The damage rectangle is specified in surface-local coordinates,3761* where x and y specify the upper left corner of the damage rectangle.3762*3763* The initial value for pending damage is empty: no damage.3764* wl_surface.damage adds pending damage: the new pending damage3765* is the union of old pending damage and the given rectangle.3766*3767* wl_surface.commit assigns pending damage as the current damage,3768* and clears pending damage. The server will clear the current3769* damage as it repaints the surface.3770*3771* Note! New clients should not use this request. Instead damage can be3772* posted with wl_surface.damage_buffer which uses buffer coordinates3773* instead of surface coordinates.3774*/3775static inline void3776wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)3777{3778wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3779WL_SURFACE_DAMAGE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);3780}37813782/**3783* @ingroup iface_wl_surface3784*3785* Request a notification when it is a good time to start drawing a new3786* frame, by creating a frame callback. This is useful for throttling3787* redrawing operations, and driving animations.3788*3789* When a client is animating on a wl_surface, it can use the 'frame'3790* request to get notified when it is a good time to draw and commit the3791* next frame of animation. If the client commits an update earlier than3792* that, it is likely that some updates will not make it to the display,3793* and the client is wasting resources by drawing too often.3794*3795* The frame request will take effect on the next wl_surface.commit.3796* The notification will only be posted for one frame unless3797* requested again. For a wl_surface, the notifications are posted in3798* the order the frame requests were committed.3799*3800* The server must send the notifications so that a client3801* will not send excessive updates, while still allowing3802* the highest possible update rate for clients that wait for the reply3803* before drawing again. The server should give some time for the client3804* to draw and commit after sending the frame callback events to let it3805* hit the next output refresh.3806*3807* A server should avoid signaling the frame callbacks if the3808* surface is not visible in any way, e.g. the surface is off-screen,3809* or completely obscured by other opaque surfaces.3810*3811* The object returned by this request will be destroyed by the3812* compositor after the callback is fired and as such the client must not3813* attempt to use it after that point.3814*3815* The callback_data passed in the callback is the current time, in3816* milliseconds, with an undefined base.3817*/3818static inline struct wl_callback *3819wl_surface_frame(struct wl_surface *wl_surface)3820{3821struct wl_proxy *callback;38223823callback = wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3824WL_SURFACE_FRAME, &wl_callback_interface, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, NULL);38253826return (struct wl_callback *) callback;3827}38283829/**3830* @ingroup iface_wl_surface3831*3832* This request sets the region of the surface that contains3833* opaque content.3834*3835* The opaque region is an optimization hint for the compositor3836* that lets it optimize the redrawing of content behind opaque3837* regions. Setting an opaque region is not required for correct3838* behaviour, but marking transparent content as opaque will result3839* in repaint artifacts.3840*3841* The opaque region is specified in surface-local coordinates.3842*3843* The compositor ignores the parts of the opaque region that fall3844* outside of the surface.3845*3846* Opaque region is double-buffered state, see wl_surface.commit.3847*3848* wl_surface.set_opaque_region changes the pending opaque region.3849* wl_surface.commit copies the pending region to the current region.3850* Otherwise, the pending and current regions are never changed.3851*3852* The initial value for an opaque region is empty. Setting the pending3853* opaque region has copy semantics, and the wl_region object can be3854* destroyed immediately. A NULL wl_region causes the pending opaque3855* region to be set to empty.3856*/3857static inline void3858wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)3859{3860wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3861WL_SURFACE_SET_OPAQUE_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);3862}38633864/**3865* @ingroup iface_wl_surface3866*3867* This request sets the region of the surface that can receive3868* pointer and touch events.3869*3870* Input events happening outside of this region will try the next3871* surface in the server surface stack. The compositor ignores the3872* parts of the input region that fall outside of the surface.3873*3874* The input region is specified in surface-local coordinates.3875*3876* Input region is double-buffered state, see wl_surface.commit.3877*3878* wl_surface.set_input_region changes the pending input region.3879* wl_surface.commit copies the pending region to the current region.3880* Otherwise the pending and current regions are never changed,3881* except cursor and icon surfaces are special cases, see3882* wl_pointer.set_cursor and wl_data_device.start_drag.3883*3884* The initial value for an input region is infinite. That means the3885* whole surface will accept input. Setting the pending input region3886* has copy semantics, and the wl_region object can be destroyed3887* immediately. A NULL wl_region causes the input region to be set3888* to infinite.3889*/3890static inline void3891wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region)3892{3893wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3894WL_SURFACE_SET_INPUT_REGION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, region);3895}38963897/**3898* @ingroup iface_wl_surface3899*3900* Surface state (input, opaque, and damage regions, attached buffers,3901* etc.) is double-buffered. Protocol requests modify the pending state,3902* as opposed to the current state in use by the compositor. A commit3903* request atomically applies all pending state, replacing the current3904* state. After commit, the new pending state is as documented for each3905* related request.3906*3907* On commit, a pending wl_buffer is applied first, and all other state3908* second. This means that all coordinates in double-buffered state are3909* relative to the new wl_buffer coming into use, except for3910* wl_surface.attach itself. If there is no pending wl_buffer, the3911* coordinates are relative to the current surface contents.3912*3913* All requests that need a commit to become effective are documented3914* to affect double-buffered state.3915*3916* Other interfaces may add further double-buffered surface state.3917*/3918static inline void3919wl_surface_commit(struct wl_surface *wl_surface)3920{3921wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3922WL_SURFACE_COMMIT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0);3923}39243925/**3926* @ingroup iface_wl_surface3927*3928* This request sets an optional transformation on how the compositor3929* interprets the contents of the buffer attached to the surface. The3930* accepted values for the transform parameter are the values for3931* wl_output.transform.3932*3933* Buffer transform is double-buffered state, see wl_surface.commit.3934*3935* A newly created surface has its buffer transformation set to normal.3936*3937* wl_surface.set_buffer_transform changes the pending buffer3938* transformation. wl_surface.commit copies the pending buffer3939* transformation to the current one. Otherwise, the pending and current3940* values are never changed.3941*3942* The purpose of this request is to allow clients to render content3943* according to the output transform, thus permitting the compositor to3944* use certain optimizations even if the display is rotated. Using3945* hardware overlays and scanning out a client buffer for fullscreen3946* surfaces are examples of such optimizations. Those optimizations are3947* highly dependent on the compositor implementation, so the use of this3948* request should be considered on a case-by-case basis.3949*3950* Note that if the transform value includes 90 or 270 degree rotation,3951* the width of the buffer will become the surface height and the height3952* of the buffer will become the surface width.3953*3954* If transform is not one of the values from the3955* wl_output.transform enum the invalid_transform protocol error3956* is raised.3957*/3958static inline void3959wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform)3960{3961wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3962WL_SURFACE_SET_BUFFER_TRANSFORM, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, transform);3963}39643965/**3966* @ingroup iface_wl_surface3967*3968* This request sets an optional scaling factor on how the compositor3969* interprets the contents of the buffer attached to the window.3970*3971* Buffer scale is double-buffered state, see wl_surface.commit.3972*3973* A newly created surface has its buffer scale set to 1.3974*3975* wl_surface.set_buffer_scale changes the pending buffer scale.3976* wl_surface.commit copies the pending buffer scale to the current one.3977* Otherwise, the pending and current values are never changed.3978*3979* The purpose of this request is to allow clients to supply higher3980* resolution buffer data for use on high resolution outputs. It is3981* intended that you pick the same buffer scale as the scale of the3982* output that the surface is displayed on. This means the compositor3983* can avoid scaling when rendering the surface on that output.3984*3985* Note that if the scale is larger than 1, then you have to attach3986* a buffer that is larger (by a factor of scale in each dimension)3987* than the desired surface size.3988*3989* If scale is not positive the invalid_scale protocol error is3990* raised.3991*/3992static inline void3993wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)3994{3995wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,3996WL_SURFACE_SET_BUFFER_SCALE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, scale);3997}39983999/**4000* @ingroup iface_wl_surface4001*4002* This request is used to describe the regions where the pending4003* buffer is different from the current surface contents, and where4004* the surface therefore needs to be repainted. The compositor4005* ignores the parts of the damage that fall outside of the surface.4006*4007* Damage is double-buffered state, see wl_surface.commit.4008*4009* The damage rectangle is specified in buffer coordinates,4010* where x and y specify the upper left corner of the damage rectangle.4011*4012* The initial value for pending damage is empty: no damage.4013* wl_surface.damage_buffer adds pending damage: the new pending4014* damage is the union of old pending damage and the given rectangle.4015*4016* wl_surface.commit assigns pending damage as the current damage,4017* and clears pending damage. The server will clear the current4018* damage as it repaints the surface.4019*4020* This request differs from wl_surface.damage in only one way - it4021* takes damage in buffer coordinates instead of surface-local4022* coordinates. While this generally is more intuitive than surface4023* coordinates, it is especially desirable when using wp_viewport4024* or when a drawing library (like EGL) is unaware of buffer scale4025* and buffer transform.4026*4027* Note: Because buffer transformation changes and damage requests may4028* be interleaved in the protocol stream, it is impossible to determine4029* the actual mapping between surface and buffer damage until4030* wl_surface.commit time. Therefore, compositors wishing to take both4031* kinds of damage into account will have to accumulate damage from the4032* two requests separately and only transform from one to the other4033* after receiving the wl_surface.commit.4034*/4035static inline void4036wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)4037{4038wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4039WL_SURFACE_DAMAGE_BUFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y, width, height);4040}40414042/**4043* @ingroup iface_wl_surface4044*4045* The x and y arguments specify the location of the new pending4046* buffer's upper left corner, relative to the current buffer's upper4047* left corner, in surface-local coordinates. In other words, the4048* x and y, combined with the new surface size define in which4049* directions the surface's size changes.4050*4051* Surface location offset is double-buffered state, see4052* wl_surface.commit.4053*4054* This request is semantically equivalent to and the replaces the x and y4055* arguments in the wl_surface.attach request in wl_surface versions prior4056* to 5. See wl_surface.attach for details.4057*/4058static inline void4059wl_surface_offset(struct wl_surface *wl_surface, int32_t x, int32_t y)4060{4061wl_proxy_marshal_flags((struct wl_proxy *) wl_surface,4062WL_SURFACE_OFFSET, NULL, wl_proxy_get_version((struct wl_proxy *) wl_surface), 0, x, y);4063}40644065#ifndef WL_SEAT_CAPABILITY_ENUM4066#define WL_SEAT_CAPABILITY_ENUM4067/**4068* @ingroup iface_wl_seat4069* seat capability bitmask4070*4071* This is a bitmask of capabilities this seat has; if a member is4072* set, then it is present on the seat.4073*/4074enum wl_seat_capability {4075/**4076* the seat has pointer devices4077*/4078WL_SEAT_CAPABILITY_POINTER = 1,4079/**4080* the seat has one or more keyboards4081*/4082WL_SEAT_CAPABILITY_KEYBOARD = 2,4083/**4084* the seat has touch devices4085*/4086WL_SEAT_CAPABILITY_TOUCH = 4,4087};4088#endif /* WL_SEAT_CAPABILITY_ENUM */40894090#ifndef WL_SEAT_ERROR_ENUM4091#define WL_SEAT_ERROR_ENUM4092/**4093* @ingroup iface_wl_seat4094* wl_seat error values4095*4096* These errors can be emitted in response to wl_seat requests.4097*/4098enum wl_seat_error {4099/**4100* get_pointer, get_keyboard or get_touch called on seat without the matching capability4101*/4102WL_SEAT_ERROR_MISSING_CAPABILITY = 0,4103};4104#endif /* WL_SEAT_ERROR_ENUM */41054106/**4107* @ingroup iface_wl_seat4108* @struct wl_seat_listener4109*/4110struct wl_seat_listener {4111/**4112* seat capabilities changed4113*4114* This is emitted whenever a seat gains or loses the pointer,4115* keyboard or touch capabilities. The argument is a capability4116* enum containing the complete set of capabilities this seat has.4117*4118* When the pointer capability is added, a client may create a4119* wl_pointer object using the wl_seat.get_pointer request. This4120* object will receive pointer events until the capability is4121* removed in the future.4122*4123* When the pointer capability is removed, a client should destroy4124* the wl_pointer objects associated with the seat where the4125* capability was removed, using the wl_pointer.release request. No4126* further pointer events will be received on these objects.4127*4128* In some compositors, if a seat regains the pointer capability4129* and a client has a previously obtained wl_pointer object of4130* version 4 or less, that object may start sending pointer events4131* again. This behavior is considered a misinterpretation of the4132* intended behavior and must not be relied upon by the client.4133* wl_pointer objects of version 5 or later must not send events if4134* created before the most recent event notifying the client of an4135* added pointer capability.4136*4137* The above behavior also applies to wl_keyboard and wl_touch with4138* the keyboard and touch capabilities, respectively.4139* @param capabilities capabilities of the seat4140*/4141void (*capabilities)(void *data,4142struct wl_seat *wl_seat,4143uint32_t capabilities);4144/**4145* unique identifier for this seat4146*4147* In a multi-seat configuration the seat name can be used by4148* clients to help identify which physical devices the seat4149* represents.4150*4151* The seat name is a UTF-8 string with no convention defined for4152* its contents. Each name is unique among all wl_seat globals. The4153* name is only guaranteed to be unique for the current compositor4154* instance.4155*4156* The same seat names are used for all clients. Thus, the name can4157* be shared across processes to refer to a specific wl_seat4158* global.4159*4160* The name event is sent after binding to the seat global. This4161* event is only sent once per seat object, and the name does not4162* change over the lifetime of the wl_seat global.4163*4164* Compositors may re-use the same seat name if the wl_seat global4165* is destroyed and re-created later.4166* @param name seat identifier4167* @since 24168*/4169void (*name)(void *data,4170struct wl_seat *wl_seat,4171const char *name);4172};41734174/**4175* @ingroup iface_wl_seat4176*/4177static inline int4178wl_seat_add_listener(struct wl_seat *wl_seat,4179const struct wl_seat_listener *listener, void *data)4180{4181return wl_proxy_add_listener((struct wl_proxy *) wl_seat,4182(void (**)(void)) listener, data);4183}41844185#define WL_SEAT_GET_POINTER 04186#define WL_SEAT_GET_KEYBOARD 14187#define WL_SEAT_GET_TOUCH 24188#define WL_SEAT_RELEASE 341894190/**4191* @ingroup iface_wl_seat4192*/4193#define WL_SEAT_CAPABILITIES_SINCE_VERSION 14194/**4195* @ingroup iface_wl_seat4196*/4197#define WL_SEAT_NAME_SINCE_VERSION 241984199/**4200* @ingroup iface_wl_seat4201*/4202#define WL_SEAT_GET_POINTER_SINCE_VERSION 14203/**4204* @ingroup iface_wl_seat4205*/4206#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 14207/**4208* @ingroup iface_wl_seat4209*/4210#define WL_SEAT_GET_TOUCH_SINCE_VERSION 14211/**4212* @ingroup iface_wl_seat4213*/4214#define WL_SEAT_RELEASE_SINCE_VERSION 542154216/** @ingroup iface_wl_seat */4217static inline void4218wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)4219{4220wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);4221}42224223/** @ingroup iface_wl_seat */4224static inline void *4225wl_seat_get_user_data(struct wl_seat *wl_seat)4226{4227return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);4228}42294230static inline uint32_t4231wl_seat_get_version(struct wl_seat *wl_seat)4232{4233return wl_proxy_get_version((struct wl_proxy *) wl_seat);4234}42354236/** @ingroup iface_wl_seat */4237static inline void4238wl_seat_destroy(struct wl_seat *wl_seat)4239{4240wl_proxy_destroy((struct wl_proxy *) wl_seat);4241}42424243/**4244* @ingroup iface_wl_seat4245*4246* The ID provided will be initialized to the wl_pointer interface4247* for this seat.4248*4249* This request only takes effect if the seat has the pointer4250* capability, or has had the pointer capability in the past.4251* It is a protocol violation to issue this request on a seat that has4252* never had the pointer capability. The missing_capability error will4253* be sent in this case.4254*/4255static inline struct wl_pointer *4256wl_seat_get_pointer(struct wl_seat *wl_seat)4257{4258struct wl_proxy *id;42594260id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4261WL_SEAT_GET_POINTER, &wl_pointer_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);42624263return (struct wl_pointer *) id;4264}42654266/**4267* @ingroup iface_wl_seat4268*4269* The ID provided will be initialized to the wl_keyboard interface4270* for this seat.4271*4272* This request only takes effect if the seat has the keyboard4273* capability, or has had the keyboard capability in the past.4274* It is a protocol violation to issue this request on a seat that has4275* never had the keyboard capability. The missing_capability error will4276* be sent in this case.4277*/4278static inline struct wl_keyboard *4279wl_seat_get_keyboard(struct wl_seat *wl_seat)4280{4281struct wl_proxy *id;42824283id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4284WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);42854286return (struct wl_keyboard *) id;4287}42884289/**4290* @ingroup iface_wl_seat4291*4292* The ID provided will be initialized to the wl_touch interface4293* for this seat.4294*4295* This request only takes effect if the seat has the touch4296* capability, or has had the touch capability in the past.4297* It is a protocol violation to issue this request on a seat that has4298* never had the touch capability. The missing_capability error will4299* be sent in this case.4300*/4301static inline struct wl_touch *4302wl_seat_get_touch(struct wl_seat *wl_seat)4303{4304struct wl_proxy *id;43054306id = wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4307WL_SEAT_GET_TOUCH, &wl_touch_interface, wl_proxy_get_version((struct wl_proxy *) wl_seat), 0, NULL);43084309return (struct wl_touch *) id;4310}43114312/**4313* @ingroup iface_wl_seat4314*4315* Using this request a client can tell the server that it is not going to4316* use the seat object anymore.4317*/4318static inline void4319wl_seat_release(struct wl_seat *wl_seat)4320{4321wl_proxy_marshal_flags((struct wl_proxy *) wl_seat,4322WL_SEAT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_seat), WL_MARSHAL_FLAG_DESTROY);4323}43244325#ifndef WL_POINTER_ERROR_ENUM4326#define WL_POINTER_ERROR_ENUM4327enum wl_pointer_error {4328/**4329* given wl_surface has another role4330*/4331WL_POINTER_ERROR_ROLE = 0,4332};4333#endif /* WL_POINTER_ERROR_ENUM */43344335#ifndef WL_POINTER_BUTTON_STATE_ENUM4336#define WL_POINTER_BUTTON_STATE_ENUM4337/**4338* @ingroup iface_wl_pointer4339* physical button state4340*4341* Describes the physical state of a button that produced the button4342* event.4343*/4344enum wl_pointer_button_state {4345/**4346* the button is not pressed4347*/4348WL_POINTER_BUTTON_STATE_RELEASED = 0,4349/**4350* the button is pressed4351*/4352WL_POINTER_BUTTON_STATE_PRESSED = 1,4353};4354#endif /* WL_POINTER_BUTTON_STATE_ENUM */43554356#ifndef WL_POINTER_AXIS_ENUM4357#define WL_POINTER_AXIS_ENUM4358/**4359* @ingroup iface_wl_pointer4360* axis types4361*4362* Describes the axis types of scroll events.4363*/4364enum wl_pointer_axis {4365/**4366* vertical axis4367*/4368WL_POINTER_AXIS_VERTICAL_SCROLL = 0,4369/**4370* horizontal axis4371*/4372WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,4373};4374#endif /* WL_POINTER_AXIS_ENUM */43754376#ifndef WL_POINTER_AXIS_SOURCE_ENUM4377#define WL_POINTER_AXIS_SOURCE_ENUM4378/**4379* @ingroup iface_wl_pointer4380* axis source types4381*4382* Describes the source types for axis events. This indicates to the4383* client how an axis event was physically generated; a client may4384* adjust the user interface accordingly. For example, scroll events4385* from a "finger" source may be in a smooth coordinate space with4386* kinetic scrolling whereas a "wheel" source may be in discrete steps4387* of a number of lines.4388*4389* The "continuous" axis source is a device generating events in a4390* continuous coordinate space, but using something other than a4391* finger. One example for this source is button-based scrolling where4392* the vertical motion of a device is converted to scroll events while4393* a button is held down.4394*4395* The "wheel tilt" axis source indicates that the actual device is a4396* wheel but the scroll event is not caused by a rotation but a4397* (usually sideways) tilt of the wheel.4398*/4399enum wl_pointer_axis_source {4400/**4401* a physical wheel rotation4402*/4403WL_POINTER_AXIS_SOURCE_WHEEL = 0,4404/**4405* finger on a touch surface4406*/4407WL_POINTER_AXIS_SOURCE_FINGER = 1,4408/**4409* continuous coordinate space4410*/4411WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,4412/**4413* a physical wheel tilt4414* @since 64415*/4416WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,4417};4418/**4419* @ingroup iface_wl_pointer4420*/4421#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 64422#endif /* WL_POINTER_AXIS_SOURCE_ENUM */44234424/**4425* @ingroup iface_wl_pointer4426* @struct wl_pointer_listener4427*/4428struct wl_pointer_listener {4429/**4430* enter event4431*4432* Notification that this seat's pointer is focused on a certain4433* surface.4434*4435* When a seat's focus enters a surface, the pointer image is4436* undefined and a client should respond to this event by setting4437* an appropriate pointer image with the set_cursor request.4438* @param serial serial number of the enter event4439* @param surface surface entered by the pointer4440* @param surface_x surface-local x coordinate4441* @param surface_y surface-local y coordinate4442*/4443void (*enter)(void *data,4444struct wl_pointer *wl_pointer,4445uint32_t serial,4446struct wl_surface *surface,4447wl_fixed_t surface_x,4448wl_fixed_t surface_y);4449/**4450* leave event4451*4452* Notification that this seat's pointer is no longer focused on4453* a certain surface.4454*4455* The leave notification is sent before the enter notification for4456* the new focus.4457* @param serial serial number of the leave event4458* @param surface surface left by the pointer4459*/4460void (*leave)(void *data,4461struct wl_pointer *wl_pointer,4462uint32_t serial,4463struct wl_surface *surface);4464/**4465* pointer motion event4466*4467* Notification of pointer location change. The arguments4468* surface_x and surface_y are the location relative to the focused4469* surface.4470* @param time timestamp with millisecond granularity4471* @param surface_x surface-local x coordinate4472* @param surface_y surface-local y coordinate4473*/4474void (*motion)(void *data,4475struct wl_pointer *wl_pointer,4476uint32_t time,4477wl_fixed_t surface_x,4478wl_fixed_t surface_y);4479/**4480* pointer button event4481*4482* Mouse button click and release notifications.4483*4484* The location of the click is given by the last motion or enter4485* event. The time argument is a timestamp with millisecond4486* granularity, with an undefined base.4487*4488* The button is a button code as defined in the Linux kernel's4489* linux/input-event-codes.h header file, e.g. BTN_LEFT.4490*4491* Any 16-bit button code value is reserved for future additions to4492* the kernel's event code list. All other button codes above4493* 0xFFFF are currently undefined but may be used in future4494* versions of this protocol.4495* @param serial serial number of the button event4496* @param time timestamp with millisecond granularity4497* @param button button that produced the event4498* @param state physical state of the button4499*/4500void (*button)(void *data,4501struct wl_pointer *wl_pointer,4502uint32_t serial,4503uint32_t time,4504uint32_t button,4505uint32_t state);4506/**4507* axis event4508*4509* Scroll and other axis notifications.4510*4511* For scroll events (vertical and horizontal scroll axes), the4512* value parameter is the length of a vector along the specified4513* axis in a coordinate space identical to those of motion events,4514* representing a relative movement along the specified axis.4515*4516* For devices that support movements non-parallel to axes multiple4517* axis events will be emitted.4518*4519* When applicable, for example for touch pads, the server can4520* choose to emit scroll events where the motion vector is4521* equivalent to a motion event vector.4522*4523* When applicable, a client can transform its content relative to4524* the scroll distance.4525* @param time timestamp with millisecond granularity4526* @param axis axis type4527* @param value length of vector in surface-local coordinate space4528*/4529void (*axis)(void *data,4530struct wl_pointer *wl_pointer,4531uint32_t time,4532uint32_t axis,4533wl_fixed_t value);4534/**4535* end of a pointer event sequence4536*4537* Indicates the end of a set of events that logically belong4538* together. A client is expected to accumulate the data in all4539* events within the frame before proceeding.4540*4541* All wl_pointer events before a wl_pointer.frame event belong4542* logically together. For example, in a diagonal scroll motion the4543* compositor will send an optional wl_pointer.axis_source event,4544* two wl_pointer.axis events (horizontal and vertical) and finally4545* a wl_pointer.frame event. The client may use this information to4546* calculate a diagonal vector for scrolling.4547*4548* When multiple wl_pointer.axis events occur within the same4549* frame, the motion vector is the combined motion of all events.4550* When a wl_pointer.axis and a wl_pointer.axis_stop event occur4551* within the same frame, this indicates that axis movement in one4552* axis has stopped but continues in the other axis. When multiple4553* wl_pointer.axis_stop events occur within the same frame, this4554* indicates that these axes stopped in the same instance.4555*4556* A wl_pointer.frame event is sent for every logical event group,4557* even if the group only contains a single wl_pointer event.4558* Specifically, a client may get a sequence: motion, frame,4559* button, frame, axis, frame, axis_stop, frame.4560*4561* The wl_pointer.enter and wl_pointer.leave events are logical4562* events generated by the compositor and not the hardware. These4563* events are also grouped by a wl_pointer.frame. When a pointer4564* moves from one surface to another, a compositor should group the4565* wl_pointer.leave event within the same wl_pointer.frame.4566* However, a client must not rely on wl_pointer.leave and4567* wl_pointer.enter being in the same wl_pointer.frame.4568* Compositor-specific policies may require the wl_pointer.leave4569* and wl_pointer.enter event being split across multiple4570* wl_pointer.frame groups.4571* @since 54572*/4573void (*frame)(void *data,4574struct wl_pointer *wl_pointer);4575/**4576* axis source event4577*4578* Source information for scroll and other axes.4579*4580* This event does not occur on its own. It is sent before a4581* wl_pointer.frame event and carries the source information for4582* all events within that frame.4583*4584* The source specifies how this event was generated. If the source4585* is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event4586* will be sent when the user lifts the finger off the device.4587*4588* If the source is wl_pointer.axis_source.wheel,4589* wl_pointer.axis_source.wheel_tilt or4590* wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event4591* may or may not be sent. Whether a compositor sends an axis_stop4592* event for these sources is hardware-specific and4593* implementation-dependent; clients must not rely on receiving an4594* axis_stop event for these scroll sources and should treat scroll4595* sequences from these scroll sources as unterminated by default.4596*4597* This event is optional. If the source is unknown for a4598* particular axis event sequence, no event is sent. Only one4599* wl_pointer.axis_source event is permitted per frame.4600*4601* The order of wl_pointer.axis_discrete and wl_pointer.axis_source4602* is not guaranteed.4603* @param axis_source source of the axis event4604* @since 54605*/4606void (*axis_source)(void *data,4607struct wl_pointer *wl_pointer,4608uint32_t axis_source);4609/**4610* axis stop event4611*4612* Stop notification for scroll and other axes.4613*4614* For some wl_pointer.axis_source types, a wl_pointer.axis_stop4615* event is sent to notify a client that the axis sequence has4616* terminated. This enables the client to implement kinetic4617* scrolling. See the wl_pointer.axis_source documentation for4618* information on when this event may be generated.4619*4620* Any wl_pointer.axis events with the same axis_source after this4621* event should be considered as the start of a new axis motion.4622*4623* The timestamp is to be interpreted identical to the timestamp in4624* the wl_pointer.axis event. The timestamp value may be the same4625* as a preceding wl_pointer.axis event.4626* @param time timestamp with millisecond granularity4627* @param axis the axis stopped with this event4628* @since 54629*/4630void (*axis_stop)(void *data,4631struct wl_pointer *wl_pointer,4632uint32_t time,4633uint32_t axis);4634/**4635* axis click event4636*4637* Discrete step information for scroll and other axes.4638*4639* This event carries the axis value of the wl_pointer.axis event4640* in discrete steps (e.g. mouse wheel clicks).4641*4642* This event is deprecated with wl_pointer version 8 - this event4643* is not sent to clients supporting version 8 or later.4644*4645* This event does not occur on its own, it is coupled with a4646* wl_pointer.axis event that represents this axis value on a4647* continuous scale. The protocol guarantees that each4648* axis_discrete event is always followed by exactly one axis event4649* with the same axis number within the same wl_pointer.frame. Note4650* that the protocol allows for other events to occur between the4651* axis_discrete and its coupled axis event, including other4652* axis_discrete or axis events. A wl_pointer.frame must not4653* contain more than one axis_discrete event per axis type.4654*4655* This event is optional; continuous scrolling devices like4656* two-finger scrolling on touchpads do not have discrete steps and4657* do not generate this event.4658*4659* The discrete value carries the directional information. e.g. a4660* value of -2 is two steps towards the negative direction of this4661* axis.4662*4663* The axis number is identical to the axis number in the4664* associated axis event.4665*4666* The order of wl_pointer.axis_discrete and wl_pointer.axis_source4667* is not guaranteed.4668* @param axis axis type4669* @param discrete number of steps4670* @since 54671*/4672void (*axis_discrete)(void *data,4673struct wl_pointer *wl_pointer,4674uint32_t axis,4675int32_t discrete);4676/**4677* axis high-resolution scroll event4678*4679* Discrete high-resolution scroll information.4680*4681* This event carries high-resolution wheel scroll information,4682* with each multiple of 120 representing one logical scroll step4683* (a wheel detent). For example, an axis_value120 of 30 is one4684* quarter of a logical scroll step in the positive direction, a4685* value120 of -240 are two logical scroll steps in the negative4686* direction within the same hardware event. Clients that rely on4687* discrete scrolling should accumulate the value120 to multiples4688* of 120 before processing the event.4689*4690* The value120 must not be zero.4691*4692* This event replaces the wl_pointer.axis_discrete event in4693* clients supporting wl_pointer version 8 or later.4694*4695* Where a wl_pointer.axis_source event occurs in the same4696* wl_pointer.frame, the axis source applies to this event.4697*4698* The order of wl_pointer.axis_value120 and wl_pointer.axis_source4699* is not guaranteed.4700* @param axis axis type4701* @param value120 scroll distance as fraction of 1204702* @since 84703*/4704void (*axis_value120)(void *data,4705struct wl_pointer *wl_pointer,4706uint32_t axis,4707int32_t value120);4708};47094710/**4711* @ingroup iface_wl_pointer4712*/4713static inline int4714wl_pointer_add_listener(struct wl_pointer *wl_pointer,4715const struct wl_pointer_listener *listener, void *data)4716{4717return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,4718(void (**)(void)) listener, data);4719}47204721#define WL_POINTER_SET_CURSOR 04722#define WL_POINTER_RELEASE 147234724/**4725* @ingroup iface_wl_pointer4726*/4727#define WL_POINTER_ENTER_SINCE_VERSION 14728/**4729* @ingroup iface_wl_pointer4730*/4731#define WL_POINTER_LEAVE_SINCE_VERSION 14732/**4733* @ingroup iface_wl_pointer4734*/4735#define WL_POINTER_MOTION_SINCE_VERSION 14736/**4737* @ingroup iface_wl_pointer4738*/4739#define WL_POINTER_BUTTON_SINCE_VERSION 14740/**4741* @ingroup iface_wl_pointer4742*/4743#define WL_POINTER_AXIS_SINCE_VERSION 14744/**4745* @ingroup iface_wl_pointer4746*/4747#define WL_POINTER_FRAME_SINCE_VERSION 54748/**4749* @ingroup iface_wl_pointer4750*/4751#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 54752/**4753* @ingroup iface_wl_pointer4754*/4755#define WL_POINTER_AXIS_STOP_SINCE_VERSION 54756/**4757* @ingroup iface_wl_pointer4758*/4759#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 54760/**4761* @ingroup iface_wl_pointer4762*/4763#define WL_POINTER_AXIS_VALUE120_SINCE_VERSION 847644765/**4766* @ingroup iface_wl_pointer4767*/4768#define WL_POINTER_SET_CURSOR_SINCE_VERSION 14769/**4770* @ingroup iface_wl_pointer4771*/4772#define WL_POINTER_RELEASE_SINCE_VERSION 347734774/** @ingroup iface_wl_pointer */4775static inline void4776wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)4777{4778wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);4779}47804781/** @ingroup iface_wl_pointer */4782static inline void *4783wl_pointer_get_user_data(struct wl_pointer *wl_pointer)4784{4785return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);4786}47874788static inline uint32_t4789wl_pointer_get_version(struct wl_pointer *wl_pointer)4790{4791return wl_proxy_get_version((struct wl_proxy *) wl_pointer);4792}47934794/** @ingroup iface_wl_pointer */4795static inline void4796wl_pointer_destroy(struct wl_pointer *wl_pointer)4797{4798wl_proxy_destroy((struct wl_proxy *) wl_pointer);4799}48004801/**4802* @ingroup iface_wl_pointer4803*4804* Set the pointer surface, i.e., the surface that contains the4805* pointer image (cursor). This request gives the surface the role4806* of a cursor. If the surface already has another role, it raises4807* a protocol error.4808*4809* The cursor actually changes only if the pointer4810* focus for this device is one of the requesting client's surfaces4811* or the surface parameter is the current pointer surface. If4812* there was a previous surface set with this request it is4813* replaced. If surface is NULL, the pointer image is hidden.4814*4815* The parameters hotspot_x and hotspot_y define the position of4816* the pointer surface relative to the pointer location. Its4817* top-left corner is always at (x, y) - (hotspot_x, hotspot_y),4818* where (x, y) are the coordinates of the pointer location, in4819* surface-local coordinates.4820*4821* On surface.attach requests to the pointer surface, hotspot_x4822* and hotspot_y are decremented by the x and y parameters4823* passed to the request. Attach must be confirmed by4824* wl_surface.commit as usual.4825*4826* The hotspot can also be updated by passing the currently set4827* pointer surface to this request with new values for hotspot_x4828* and hotspot_y.4829*4830* The current and pending input regions of the wl_surface are4831* cleared, and wl_surface.set_input_region is ignored until the4832* wl_surface is no longer used as the cursor. When the use as a4833* cursor ends, the current and pending input regions become4834* undefined, and the wl_surface is unmapped.4835*4836* The serial parameter must match the latest wl_pointer.enter4837* serial number sent to the client. Otherwise the request will be4838* ignored.4839*/4840static inline void4841wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)4842{4843wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,4844WL_POINTER_SET_CURSOR, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), 0, serial, surface, hotspot_x, hotspot_y);4845}48464847/**4848* @ingroup iface_wl_pointer4849*4850* Using this request a client can tell the server that it is not going to4851* use the pointer object anymore.4852*4853* This request destroys the pointer proxy object, so clients must not call4854* wl_pointer_destroy() after using this request.4855*/4856static inline void4857wl_pointer_release(struct wl_pointer *wl_pointer)4858{4859wl_proxy_marshal_flags((struct wl_proxy *) wl_pointer,4860WL_POINTER_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_pointer), WL_MARSHAL_FLAG_DESTROY);4861}48624863#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM4864#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM4865/**4866* @ingroup iface_wl_keyboard4867* keyboard mapping format4868*4869* This specifies the format of the keymap provided to the4870* client with the wl_keyboard.keymap event.4871*/4872enum wl_keyboard_keymap_format {4873/**4874* no keymap; client must understand how to interpret the raw keycode4875*/4876WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,4877/**4878* libxkbcommon compatible, null-terminated string; to determine the xkb keycode, clients must add 8 to the key event keycode4879*/4880WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,4881};4882#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */48834884#ifndef WL_KEYBOARD_KEY_STATE_ENUM4885#define WL_KEYBOARD_KEY_STATE_ENUM4886/**4887* @ingroup iface_wl_keyboard4888* physical key state4889*4890* Describes the physical state of a key that produced the key event.4891*/4892enum wl_keyboard_key_state {4893/**4894* key is not pressed4895*/4896WL_KEYBOARD_KEY_STATE_RELEASED = 0,4897/**4898* key is pressed4899*/4900WL_KEYBOARD_KEY_STATE_PRESSED = 1,4901};4902#endif /* WL_KEYBOARD_KEY_STATE_ENUM */49034904/**4905* @ingroup iface_wl_keyboard4906* @struct wl_keyboard_listener4907*/4908struct wl_keyboard_listener {4909/**4910* keyboard mapping4911*4912* This event provides a file descriptor to the client which can4913* be memory-mapped in read-only mode to provide a keyboard mapping4914* description.4915*4916* From version 7 onwards, the fd must be mapped with MAP_PRIVATE4917* by the recipient, as MAP_SHARED may fail.4918* @param format keymap format4919* @param fd keymap file descriptor4920* @param size keymap size, in bytes4921*/4922void (*keymap)(void *data,4923struct wl_keyboard *wl_keyboard,4924uint32_t format,4925int32_t fd,4926uint32_t size);4927/**4928* enter event4929*4930* Notification that this seat's keyboard focus is on a certain4931* surface.4932*4933* The compositor must send the wl_keyboard.modifiers event after4934* this event.4935* @param serial serial number of the enter event4936* @param surface surface gaining keyboard focus4937* @param keys the currently pressed keys4938*/4939void (*enter)(void *data,4940struct wl_keyboard *wl_keyboard,4941uint32_t serial,4942struct wl_surface *surface,4943struct wl_array *keys);4944/**4945* leave event4946*4947* Notification that this seat's keyboard focus is no longer on a4948* certain surface.4949*4950* The leave notification is sent before the enter notification for4951* the new focus.4952*4953* After this event client must assume that all keys, including4954* modifiers, are lifted and also it must stop key repeating if4955* there's some going on.4956* @param serial serial number of the leave event4957* @param surface surface that lost keyboard focus4958*/4959void (*leave)(void *data,4960struct wl_keyboard *wl_keyboard,4961uint32_t serial,4962struct wl_surface *surface);4963/**4964* key event4965*4966* A key was pressed or released. The time argument is a4967* timestamp with millisecond granularity, with an undefined base.4968*4969* The key is a platform-specific key code that can be interpreted4970* by feeding it to the keyboard mapping (see the keymap event).4971*4972* If this event produces a change in modifiers, then the resulting4973* wl_keyboard.modifiers event must be sent after this event.4974* @param serial serial number of the key event4975* @param time timestamp with millisecond granularity4976* @param key key that produced the event4977* @param state physical state of the key4978*/4979void (*key)(void *data,4980struct wl_keyboard *wl_keyboard,4981uint32_t serial,4982uint32_t time,4983uint32_t key,4984uint32_t state);4985/**4986* modifier and group state4987*4988* Notifies clients that the modifier and/or group state has4989* changed, and it should update its local state.4990* @param serial serial number of the modifiers event4991* @param mods_depressed depressed modifiers4992* @param mods_latched latched modifiers4993* @param mods_locked locked modifiers4994* @param group keyboard layout4995*/4996void (*modifiers)(void *data,4997struct wl_keyboard *wl_keyboard,4998uint32_t serial,4999uint32_t mods_depressed,5000uint32_t mods_latched,5001uint32_t mods_locked,5002uint32_t group);5003/**5004* repeat rate and delay5005*5006* Informs the client about the keyboard's repeat rate and delay.5007*5008* This event is sent as soon as the wl_keyboard object has been5009* created, and is guaranteed to be received by the client before5010* any key press event.5011*5012* Negative values for either rate or delay are illegal. A rate of5013* zero will disable any repeating (regardless of the value of5014* delay).5015*5016* This event can be sent later on as well with a new value if5017* necessary, so clients should continue listening for the event5018* past the creation of wl_keyboard.5019* @param rate the rate of repeating keys in characters per second5020* @param delay delay in milliseconds since key down until repeating starts5021* @since 45022*/5023void (*repeat_info)(void *data,5024struct wl_keyboard *wl_keyboard,5025int32_t rate,5026int32_t delay);5027};50285029/**5030* @ingroup iface_wl_keyboard5031*/5032static inline int5033wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,5034const struct wl_keyboard_listener *listener, void *data)5035{5036return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,5037(void (**)(void)) listener, data);5038}50395040#define WL_KEYBOARD_RELEASE 050415042/**5043* @ingroup iface_wl_keyboard5044*/5045#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 15046/**5047* @ingroup iface_wl_keyboard5048*/5049#define WL_KEYBOARD_ENTER_SINCE_VERSION 15050/**5051* @ingroup iface_wl_keyboard5052*/5053#define WL_KEYBOARD_LEAVE_SINCE_VERSION 15054/**5055* @ingroup iface_wl_keyboard5056*/5057#define WL_KEYBOARD_KEY_SINCE_VERSION 15058/**5059* @ingroup iface_wl_keyboard5060*/5061#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 15062/**5063* @ingroup iface_wl_keyboard5064*/5065#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 450665067/**5068* @ingroup iface_wl_keyboard5069*/5070#define WL_KEYBOARD_RELEASE_SINCE_VERSION 350715072/** @ingroup iface_wl_keyboard */5073static inline void5074wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)5075{5076wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);5077}50785079/** @ingroup iface_wl_keyboard */5080static inline void *5081wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)5082{5083return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);5084}50855086static inline uint32_t5087wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)5088{5089return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);5090}50915092/** @ingroup iface_wl_keyboard */5093static inline void5094wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)5095{5096wl_proxy_destroy((struct wl_proxy *) wl_keyboard);5097}50985099/**5100* @ingroup iface_wl_keyboard5101*/5102static inline void5103wl_keyboard_release(struct wl_keyboard *wl_keyboard)5104{5105wl_proxy_marshal_flags((struct wl_proxy *) wl_keyboard,5106WL_KEYBOARD_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_keyboard), WL_MARSHAL_FLAG_DESTROY);5107}51085109/**5110* @ingroup iface_wl_touch5111* @struct wl_touch_listener5112*/5113struct wl_touch_listener {5114/**5115* touch down event and beginning of a touch sequence5116*5117* A new touch point has appeared on the surface. This touch5118* point is assigned a unique ID. Future events from this touch5119* point reference this ID. The ID ceases to be valid after a touch5120* up event and may be reused in the future.5121* @param serial serial number of the touch down event5122* @param time timestamp with millisecond granularity5123* @param surface surface touched5124* @param id the unique ID of this touch point5125* @param x surface-local x coordinate5126* @param y surface-local y coordinate5127*/5128void (*down)(void *data,5129struct wl_touch *wl_touch,5130uint32_t serial,5131uint32_t time,5132struct wl_surface *surface,5133int32_t id,5134wl_fixed_t x,5135wl_fixed_t y);5136/**5137* end of a touch event sequence5138*5139* The touch point has disappeared. No further events will be5140* sent for this touch point and the touch point's ID is released5141* and may be reused in a future touch down event.5142* @param serial serial number of the touch up event5143* @param time timestamp with millisecond granularity5144* @param id the unique ID of this touch point5145*/5146void (*up)(void *data,5147struct wl_touch *wl_touch,5148uint32_t serial,5149uint32_t time,5150int32_t id);5151/**5152* update of touch point coordinates5153*5154* A touch point has changed coordinates.5155* @param time timestamp with millisecond granularity5156* @param id the unique ID of this touch point5157* @param x surface-local x coordinate5158* @param y surface-local y coordinate5159*/5160void (*motion)(void *data,5161struct wl_touch *wl_touch,5162uint32_t time,5163int32_t id,5164wl_fixed_t x,5165wl_fixed_t y);5166/**5167* end of touch frame event5168*5169* Indicates the end of a set of events that logically belong5170* together. A client is expected to accumulate the data in all5171* events within the frame before proceeding.5172*5173* A wl_touch.frame terminates at least one event but otherwise no5174* guarantee is provided about the set of events within a frame. A5175* client must assume that any state not updated in a frame is5176* unchanged from the previously known state.5177*/5178void (*frame)(void *data,5179struct wl_touch *wl_touch);5180/**5181* touch session cancelled5182*5183* Sent if the compositor decides the touch stream is a global5184* gesture. No further events are sent to the clients from that5185* particular gesture. Touch cancellation applies to all touch5186* points currently active on this client's surface. The client is5187* responsible for finalizing the touch points, future touch points5188* on this surface may reuse the touch point ID.5189*/5190void (*cancel)(void *data,5191struct wl_touch *wl_touch);5192/**5193* update shape of touch point5194*5195* Sent when a touchpoint has changed its shape.5196*5197* This event does not occur on its own. It is sent before a5198* wl_touch.frame event and carries the new shape information for5199* any previously reported, or new touch points of that frame.5200*5201* Other events describing the touch point such as wl_touch.down,5202* wl_touch.motion or wl_touch.orientation may be sent within the5203* same wl_touch.frame. A client should treat these events as a5204* single logical touch point update. The order of wl_touch.shape,5205* wl_touch.orientation and wl_touch.motion is not guaranteed. A5206* wl_touch.down event is guaranteed to occur before the first5207* wl_touch.shape event for this touch ID but both events may occur5208* within the same wl_touch.frame.5209*5210* A touchpoint shape is approximated by an ellipse through the5211* major and minor axis length. The major axis length describes the5212* longer diameter of the ellipse, while the minor axis length5213* describes the shorter diameter. Major and minor are orthogonal5214* and both are specified in surface-local coordinates. The center5215* of the ellipse is always at the touchpoint location as reported5216* by wl_touch.down or wl_touch.move.5217*5218* This event is only sent by the compositor if the touch device5219* supports shape reports. The client has to make reasonable5220* assumptions about the shape if it did not receive this event.5221* @param id the unique ID of this touch point5222* @param major length of the major axis in surface-local coordinates5223* @param minor length of the minor axis in surface-local coordinates5224* @since 65225*/5226void (*shape)(void *data,5227struct wl_touch *wl_touch,5228int32_t id,5229wl_fixed_t major,5230wl_fixed_t minor);5231/**5232* update orientation of touch point5233*5234* Sent when a touchpoint has changed its orientation.5235*5236* This event does not occur on its own. It is sent before a5237* wl_touch.frame event and carries the new shape information for5238* any previously reported, or new touch points of that frame.5239*5240* Other events describing the touch point such as wl_touch.down,5241* wl_touch.motion or wl_touch.shape may be sent within the same5242* wl_touch.frame. A client should treat these events as a single5243* logical touch point update. The order of wl_touch.shape,5244* wl_touch.orientation and wl_touch.motion is not guaranteed. A5245* wl_touch.down event is guaranteed to occur before the first5246* wl_touch.orientation event for this touch ID but both events may5247* occur within the same wl_touch.frame.5248*5249* The orientation describes the clockwise angle of a touchpoint's5250* major axis to the positive surface y-axis and is normalized to5251* the -180 to +180 degree range. The granularity of orientation5252* depends on the touch device, some devices only support binary5253* rotation values between 0 and 90 degrees.5254*5255* This event is only sent by the compositor if the touch device5256* supports orientation reports.5257* @param id the unique ID of this touch point5258* @param orientation angle between major axis and positive surface y-axis in degrees5259* @since 65260*/5261void (*orientation)(void *data,5262struct wl_touch *wl_touch,5263int32_t id,5264wl_fixed_t orientation);5265};52665267/**5268* @ingroup iface_wl_touch5269*/5270static inline int5271wl_touch_add_listener(struct wl_touch *wl_touch,5272const struct wl_touch_listener *listener, void *data)5273{5274return wl_proxy_add_listener((struct wl_proxy *) wl_touch,5275(void (**)(void)) listener, data);5276}52775278#define WL_TOUCH_RELEASE 052795280/**5281* @ingroup iface_wl_touch5282*/5283#define WL_TOUCH_DOWN_SINCE_VERSION 15284/**5285* @ingroup iface_wl_touch5286*/5287#define WL_TOUCH_UP_SINCE_VERSION 15288/**5289* @ingroup iface_wl_touch5290*/5291#define WL_TOUCH_MOTION_SINCE_VERSION 15292/**5293* @ingroup iface_wl_touch5294*/5295#define WL_TOUCH_FRAME_SINCE_VERSION 15296/**5297* @ingroup iface_wl_touch5298*/5299#define WL_TOUCH_CANCEL_SINCE_VERSION 15300/**5301* @ingroup iface_wl_touch5302*/5303#define WL_TOUCH_SHAPE_SINCE_VERSION 65304/**5305* @ingroup iface_wl_touch5306*/5307#define WL_TOUCH_ORIENTATION_SINCE_VERSION 653085309/**5310* @ingroup iface_wl_touch5311*/5312#define WL_TOUCH_RELEASE_SINCE_VERSION 353135314/** @ingroup iface_wl_touch */5315static inline void5316wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)5317{5318wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);5319}53205321/** @ingroup iface_wl_touch */5322static inline void *5323wl_touch_get_user_data(struct wl_touch *wl_touch)5324{5325return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);5326}53275328static inline uint32_t5329wl_touch_get_version(struct wl_touch *wl_touch)5330{5331return wl_proxy_get_version((struct wl_proxy *) wl_touch);5332}53335334/** @ingroup iface_wl_touch */5335static inline void5336wl_touch_destroy(struct wl_touch *wl_touch)5337{5338wl_proxy_destroy((struct wl_proxy *) wl_touch);5339}53405341/**5342* @ingroup iface_wl_touch5343*/5344static inline void5345wl_touch_release(struct wl_touch *wl_touch)5346{5347wl_proxy_marshal_flags((struct wl_proxy *) wl_touch,5348WL_TOUCH_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_touch), WL_MARSHAL_FLAG_DESTROY);5349}53505351#ifndef WL_OUTPUT_SUBPIXEL_ENUM5352#define WL_OUTPUT_SUBPIXEL_ENUM5353/**5354* @ingroup iface_wl_output5355* subpixel geometry information5356*5357* This enumeration describes how the physical5358* pixels on an output are laid out.5359*/5360enum wl_output_subpixel {5361/**5362* unknown geometry5363*/5364WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,5365/**5366* no geometry5367*/5368WL_OUTPUT_SUBPIXEL_NONE = 1,5369/**5370* horizontal RGB5371*/5372WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,5373/**5374* horizontal BGR5375*/5376WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,5377/**5378* vertical RGB5379*/5380WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,5381/**5382* vertical BGR5383*/5384WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,5385};5386#endif /* WL_OUTPUT_SUBPIXEL_ENUM */53875388#ifndef WL_OUTPUT_TRANSFORM_ENUM5389#define WL_OUTPUT_TRANSFORM_ENUM5390/**5391* @ingroup iface_wl_output5392* transform from framebuffer to output5393*5394* This describes the transform that a compositor will apply to a5395* surface to compensate for the rotation or mirroring of an5396* output device.5397*5398* The flipped values correspond to an initial flip around a5399* vertical axis followed by rotation.5400*5401* The purpose is mainly to allow clients to render accordingly and5402* tell the compositor, so that for fullscreen surfaces, the5403* compositor will still be able to scan out directly from client5404* surfaces.5405*/5406enum wl_output_transform {5407/**5408* no transform5409*/5410WL_OUTPUT_TRANSFORM_NORMAL = 0,5411/**5412* 90 degrees counter-clockwise5413*/5414WL_OUTPUT_TRANSFORM_90 = 1,5415/**5416* 180 degrees counter-clockwise5417*/5418WL_OUTPUT_TRANSFORM_180 = 2,5419/**5420* 270 degrees counter-clockwise5421*/5422WL_OUTPUT_TRANSFORM_270 = 3,5423/**5424* 180 degree flip around a vertical axis5425*/5426WL_OUTPUT_TRANSFORM_FLIPPED = 4,5427/**5428* flip and rotate 90 degrees counter-clockwise5429*/5430WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,5431/**5432* flip and rotate 180 degrees counter-clockwise5433*/5434WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,5435/**5436* flip and rotate 270 degrees counter-clockwise5437*/5438WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,5439};5440#endif /* WL_OUTPUT_TRANSFORM_ENUM */54415442#ifndef WL_OUTPUT_MODE_ENUM5443#define WL_OUTPUT_MODE_ENUM5444/**5445* @ingroup iface_wl_output5446* mode information5447*5448* These flags describe properties of an output mode.5449* They are used in the flags bitfield of the mode event.5450*/5451enum wl_output_mode {5452/**5453* indicates this is the current mode5454*/5455WL_OUTPUT_MODE_CURRENT = 0x1,5456/**5457* indicates this is the preferred mode5458*/5459WL_OUTPUT_MODE_PREFERRED = 0x2,5460};5461#endif /* WL_OUTPUT_MODE_ENUM */54625463/**5464* @ingroup iface_wl_output5465* @struct wl_output_listener5466*/5467struct wl_output_listener {5468/**5469* properties of the output5470*5471* The geometry event describes geometric properties of the5472* output. The event is sent when binding to the output object and5473* whenever any of the properties change.5474*5475* The physical size can be set to zero if it doesn't make sense5476* for this output (e.g. for projectors or virtual outputs).5477*5478* The geometry event will be followed by a done event (starting5479* from version 2).5480*5481* Note: wl_output only advertises partial information about the5482* output position and identification. Some compositors, for5483* instance those not implementing a desktop-style output layout or5484* those exposing virtual outputs, might fake this information.5485* Instead of using x and y, clients should use5486* xdg_output.logical_position. Instead of using make and model,5487* clients should use name and description.5488* @param x x position within the global compositor space5489* @param y y position within the global compositor space5490* @param physical_width width in millimeters of the output5491* @param physical_height height in millimeters of the output5492* @param subpixel subpixel orientation of the output5493* @param make textual description of the manufacturer5494* @param model textual description of the model5495* @param transform transform that maps framebuffer to output5496*/5497void (*geometry)(void *data,5498struct wl_output *wl_output,5499int32_t x,5500int32_t y,5501int32_t physical_width,5502int32_t physical_height,5503int32_t subpixel,5504const char *make,5505const char *model,5506int32_t transform);5507/**5508* advertise available modes for the output5509*5510* The mode event describes an available mode for the output.5511*5512* The event is sent when binding to the output object and there5513* will always be one mode, the current mode. The event is sent5514* again if an output changes mode, for the mode that is now5515* current. In other words, the current mode is always the last5516* mode that was received with the current flag set.5517*5518* Non-current modes are deprecated. A compositor can decide to5519* only advertise the current mode and never send other modes.5520* Clients should not rely on non-current modes.5521*5522* The size of a mode is given in physical hardware units of the5523* output device. This is not necessarily the same as the output5524* size in the global compositor space. For instance, the output5525* may be scaled, as described in wl_output.scale, or transformed,5526* as described in wl_output.transform. Clients willing to retrieve5527* the output size in the global compositor space should use5528* xdg_output.logical_size instead.5529*5530* The vertical refresh rate can be set to zero if it doesn't make5531* sense for this output (e.g. for virtual outputs).5532*5533* The mode event will be followed by a done event (starting from5534* version 2).5535*5536* Clients should not use the refresh rate to schedule frames.5537* Instead, they should use the wl_surface.frame event or the5538* presentation-time protocol.5539*5540* Note: this information is not always meaningful for all outputs.5541* Some compositors, such as those exposing virtual outputs, might5542* fake the refresh rate or the size.5543* @param flags bitfield of mode flags5544* @param width width of the mode in hardware units5545* @param height height of the mode in hardware units5546* @param refresh vertical refresh rate in mHz5547*/5548void (*mode)(void *data,5549struct wl_output *wl_output,5550uint32_t flags,5551int32_t width,5552int32_t height,5553int32_t refresh);5554/**5555* sent all information about output5556*5557* This event is sent after all other properties have been sent5558* after binding to the output object and after any other property5559* changes done after that. This allows changes to the output5560* properties to be seen as atomic, even if they happen via5561* multiple events.5562* @since 25563*/5564void (*done)(void *data,5565struct wl_output *wl_output);5566/**5567* output scaling properties5568*5569* This event contains scaling geometry information that is not5570* in the geometry event. It may be sent after binding the output5571* object or if the output scale changes later. If it is not sent,5572* the client should assume a scale of 1.5573*5574* A scale larger than 1 means that the compositor will5575* automatically scale surface buffers by this amount when5576* rendering. This is used for very high resolution displays where5577* applications rendering at the native resolution would be too5578* small to be legible.5579*5580* It is intended that scaling aware clients track the current5581* output of a surface, and if it is on a scaled output it should5582* use wl_surface.set_buffer_scale with the scale of the output.5583* That way the compositor can avoid scaling the surface, and the5584* client can supply a higher detail image.5585*5586* The scale event will be followed by a done event.5587* @param factor scaling factor of output5588* @since 25589*/5590void (*scale)(void *data,5591struct wl_output *wl_output,5592int32_t factor);5593/**5594* name of this output5595*5596* Many compositors will assign user-friendly names to their5597* outputs, show them to the user, allow the user to refer to an5598* output, etc. The client may wish to know this name as well to5599* offer the user similar behaviors.5600*5601* The name is a UTF-8 string with no convention defined for its5602* contents. Each name is unique among all wl_output globals. The5603* name is only guaranteed to be unique for the compositor5604* instance.5605*5606* The same output name is used for all clients for a given5607* wl_output global. Thus, the name can be shared across processes5608* to refer to a specific wl_output global.5609*5610* The name is not guaranteed to be persistent across sessions,5611* thus cannot be used to reliably identify an output in e.g.5612* configuration files.5613*5614* Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc.5615* However, do not assume that the name is a reflection of an5616* underlying DRM connector, X11 connection, etc.5617*5618* The name event is sent after binding the output object. This5619* event is only sent once per output object, and the name does not5620* change over the lifetime of the wl_output global.5621*5622* Compositors may re-use the same output name if the wl_output5623* global is destroyed and re-created later. Compositors should5624* avoid re-using the same name if possible.5625*5626* The name event will be followed by a done event.5627* @param name output name5628* @since 45629*/5630void (*name)(void *data,5631struct wl_output *wl_output,5632const char *name);5633/**5634* human-readable description of this output5635*5636* Many compositors can produce human-readable descriptions of5637* their outputs. The client may wish to know this description as5638* well, e.g. for output selection purposes.5639*5640* The description is a UTF-8 string with no convention defined for5641* its contents. The description is not guaranteed to be unique5642* among all wl_output globals. Examples might include 'Foocorp 11"5643* Display' or 'Virtual X11 output via :1'.5644*5645* The description event is sent after binding the output object5646* and whenever the description changes. The description is5647* optional, and may not be sent at all.5648*5649* The description event will be followed by a done event.5650* @param description output description5651* @since 45652*/5653void (*description)(void *data,5654struct wl_output *wl_output,5655const char *description);5656};56575658/**5659* @ingroup iface_wl_output5660*/5661static inline int5662wl_output_add_listener(struct wl_output *wl_output,5663const struct wl_output_listener *listener, void *data)5664{5665return wl_proxy_add_listener((struct wl_proxy *) wl_output,5666(void (**)(void)) listener, data);5667}56685669#define WL_OUTPUT_RELEASE 056705671/**5672* @ingroup iface_wl_output5673*/5674#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 15675/**5676* @ingroup iface_wl_output5677*/5678#define WL_OUTPUT_MODE_SINCE_VERSION 15679/**5680* @ingroup iface_wl_output5681*/5682#define WL_OUTPUT_DONE_SINCE_VERSION 25683/**5684* @ingroup iface_wl_output5685*/5686#define WL_OUTPUT_SCALE_SINCE_VERSION 25687/**5688* @ingroup iface_wl_output5689*/5690#define WL_OUTPUT_NAME_SINCE_VERSION 45691/**5692* @ingroup iface_wl_output5693*/5694#define WL_OUTPUT_DESCRIPTION_SINCE_VERSION 456955696/**5697* @ingroup iface_wl_output5698*/5699#define WL_OUTPUT_RELEASE_SINCE_VERSION 357005701/** @ingroup iface_wl_output */5702static inline void5703wl_output_set_user_data(struct wl_output *wl_output, void *user_data)5704{5705wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);5706}57075708/** @ingroup iface_wl_output */5709static inline void *5710wl_output_get_user_data(struct wl_output *wl_output)5711{5712return wl_proxy_get_user_data((struct wl_proxy *) wl_output);5713}57145715static inline uint32_t5716wl_output_get_version(struct wl_output *wl_output)5717{5718return wl_proxy_get_version((struct wl_proxy *) wl_output);5719}57205721/** @ingroup iface_wl_output */5722static inline void5723wl_output_destroy(struct wl_output *wl_output)5724{5725wl_proxy_destroy((struct wl_proxy *) wl_output);5726}57275728/**5729* @ingroup iface_wl_output5730*5731* Using this request a client can tell the server that it is not going to5732* use the output object anymore.5733*/5734static inline void5735wl_output_release(struct wl_output *wl_output)5736{5737wl_proxy_marshal_flags((struct wl_proxy *) wl_output,5738WL_OUTPUT_RELEASE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_output), WL_MARSHAL_FLAG_DESTROY);5739}57405741#define WL_REGION_DESTROY 05742#define WL_REGION_ADD 15743#define WL_REGION_SUBTRACT 2574457455746/**5747* @ingroup iface_wl_region5748*/5749#define WL_REGION_DESTROY_SINCE_VERSION 15750/**5751* @ingroup iface_wl_region5752*/5753#define WL_REGION_ADD_SINCE_VERSION 15754/**5755* @ingroup iface_wl_region5756*/5757#define WL_REGION_SUBTRACT_SINCE_VERSION 157585759/** @ingroup iface_wl_region */5760static inline void5761wl_region_set_user_data(struct wl_region *wl_region, void *user_data)5762{5763wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);5764}57655766/** @ingroup iface_wl_region */5767static inline void *5768wl_region_get_user_data(struct wl_region *wl_region)5769{5770return wl_proxy_get_user_data((struct wl_proxy *) wl_region);5771}57725773static inline uint32_t5774wl_region_get_version(struct wl_region *wl_region)5775{5776return wl_proxy_get_version((struct wl_proxy *) wl_region);5777}57785779/**5780* @ingroup iface_wl_region5781*5782* Destroy the region. This will invalidate the object ID.5783*/5784static inline void5785wl_region_destroy(struct wl_region *wl_region)5786{5787wl_proxy_marshal_flags((struct wl_proxy *) wl_region,5788WL_REGION_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), WL_MARSHAL_FLAG_DESTROY);5789}57905791/**5792* @ingroup iface_wl_region5793*5794* Add the specified rectangle to the region.5795*/5796static inline void5797wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)5798{5799wl_proxy_marshal_flags((struct wl_proxy *) wl_region,5800WL_REGION_ADD, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);5801}58025803/**5804* @ingroup iface_wl_region5805*5806* Subtract the specified rectangle from the region.5807*/5808static inline void5809wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)5810{5811wl_proxy_marshal_flags((struct wl_proxy *) wl_region,5812WL_REGION_SUBTRACT, NULL, wl_proxy_get_version((struct wl_proxy *) wl_region), 0, x, y, width, height);5813}58145815#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM5816#define WL_SUBCOMPOSITOR_ERROR_ENUM5817enum wl_subcompositor_error {5818/**5819* the to-be sub-surface is invalid5820*/5821WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,5822};5823#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */58245825#define WL_SUBCOMPOSITOR_DESTROY 05826#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1582758285829/**5830* @ingroup iface_wl_subcompositor5831*/5832#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 15833/**5834* @ingroup iface_wl_subcompositor5835*/5836#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 158375838/** @ingroup iface_wl_subcompositor */5839static inline void5840wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)5841{5842wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);5843}58445845/** @ingroup iface_wl_subcompositor */5846static inline void *5847wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)5848{5849return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);5850}58515852static inline uint32_t5853wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)5854{5855return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);5856}58575858/**5859* @ingroup iface_wl_subcompositor5860*5861* Informs the server that the client will not be using this5862* protocol object anymore. This does not affect any other5863* objects, wl_subsurface objects included.5864*/5865static inline void5866wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)5867{5868wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,5869WL_SUBCOMPOSITOR_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), WL_MARSHAL_FLAG_DESTROY);5870}58715872/**5873* @ingroup iface_wl_subcompositor5874*5875* Create a sub-surface interface for the given surface, and5876* associate it with the given parent surface. This turns a5877* plain wl_surface into a sub-surface.5878*5879* The to-be sub-surface must not already have another role, and it5880* must not have an existing wl_subsurface object. Otherwise a protocol5881* error is raised.5882*5883* Adding sub-surfaces to a parent is a double-buffered operation on the5884* parent (see wl_surface.commit). The effect of adding a sub-surface5885* becomes visible on the next time the state of the parent surface is5886* applied.5887*5888* This request modifies the behaviour of wl_surface.commit request on5889* the sub-surface, see the documentation on wl_subsurface interface.5890*/5891static inline struct wl_subsurface *5892wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)5893{5894struct wl_proxy *id;58955896id = wl_proxy_marshal_flags((struct wl_proxy *) wl_subcompositor,5897WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, wl_proxy_get_version((struct wl_proxy *) wl_subcompositor), 0, NULL, surface, parent);58985899return (struct wl_subsurface *) id;5900}59015902#ifndef WL_SUBSURFACE_ERROR_ENUM5903#define WL_SUBSURFACE_ERROR_ENUM5904enum wl_subsurface_error {5905/**5906* wl_surface is not a sibling or the parent5907*/5908WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,5909};5910#endif /* WL_SUBSURFACE_ERROR_ENUM */59115912#define WL_SUBSURFACE_DESTROY 05913#define WL_SUBSURFACE_SET_POSITION 15914#define WL_SUBSURFACE_PLACE_ABOVE 25915#define WL_SUBSURFACE_PLACE_BELOW 35916#define WL_SUBSURFACE_SET_SYNC 45917#define WL_SUBSURFACE_SET_DESYNC 5591859195920/**5921* @ingroup iface_wl_subsurface5922*/5923#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 15924/**5925* @ingroup iface_wl_subsurface5926*/5927#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 15928/**5929* @ingroup iface_wl_subsurface5930*/5931#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 15932/**5933* @ingroup iface_wl_subsurface5934*/5935#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 15936/**5937* @ingroup iface_wl_subsurface5938*/5939#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 15940/**5941* @ingroup iface_wl_subsurface5942*/5943#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 159445945/** @ingroup iface_wl_subsurface */5946static inline void5947wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)5948{5949wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);5950}59515952/** @ingroup iface_wl_subsurface */5953static inline void *5954wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)5955{5956return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);5957}59585959static inline uint32_t5960wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)5961{5962return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);5963}59645965/**5966* @ingroup iface_wl_subsurface5967*5968* The sub-surface interface is removed from the wl_surface object5969* that was turned into a sub-surface with a5970* wl_subcompositor.get_subsurface request. The wl_surface's association5971* to the parent is deleted, and the wl_surface loses its role as5972* a sub-surface. The wl_surface is unmapped immediately.5973*/5974static inline void5975wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)5976{5977wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,5978WL_SUBSURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), WL_MARSHAL_FLAG_DESTROY);5979}59805981/**5982* @ingroup iface_wl_subsurface5983*5984* This schedules a sub-surface position change.5985* The sub-surface will be moved so that its origin (top left5986* corner pixel) will be at the location x, y of the parent surface5987* coordinate system. The coordinates are not restricted to the parent5988* surface area. Negative values are allowed.5989*5990* The scheduled coordinates will take effect whenever the state of the5991* parent surface is applied. When this happens depends on whether the5992* parent surface is in synchronized mode or not. See5993* wl_subsurface.set_sync and wl_subsurface.set_desync for details.5994*5995* If more than one set_position request is invoked by the client before5996* the commit of the parent surface, the position of a new request always5997* replaces the scheduled position from any previous request.5998*5999* The initial position is 0, 0.6000*/6001static inline void6002wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)6003{6004wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6005WL_SUBSURFACE_SET_POSITION, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, x, y);6006}60076008/**6009* @ingroup iface_wl_subsurface6010*6011* This sub-surface is taken from the stack, and put back just6012* above the reference surface, changing the z-order of the sub-surfaces.6013* The reference surface must be one of the sibling surfaces, or the6014* parent surface. Using any other surface, including this sub-surface,6015* will cause a protocol error.6016*6017* The z-order is double-buffered. Requests are handled in order and6018* applied immediately to a pending state. The final pending state is6019* copied to the active state the next time the state of the parent6020* surface is applied. When this happens depends on whether the parent6021* surface is in synchronized mode or not. See wl_subsurface.set_sync and6022* wl_subsurface.set_desync for details.6023*6024* A new sub-surface is initially added as the top-most in the stack6025* of its siblings and parent.6026*/6027static inline void6028wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)6029{6030wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6031WL_SUBSURFACE_PLACE_ABOVE, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);6032}60336034/**6035* @ingroup iface_wl_subsurface6036*6037* The sub-surface is placed just below the reference surface.6038* See wl_subsurface.place_above.6039*/6040static inline void6041wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)6042{6043wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6044WL_SUBSURFACE_PLACE_BELOW, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0, sibling);6045}60466047/**6048* @ingroup iface_wl_subsurface6049*6050* Change the commit behaviour of the sub-surface to synchronized6051* mode, also described as the parent dependent mode.6052*6053* In synchronized mode, wl_surface.commit on a sub-surface will6054* accumulate the committed state in a cache, but the state will6055* not be applied and hence will not change the compositor output.6056* The cached state is applied to the sub-surface immediately after6057* the parent surface's state is applied. This ensures atomic6058* updates of the parent and all its synchronized sub-surfaces.6059* Applying the cached state will invalidate the cache, so further6060* parent surface commits do not (re-)apply old state.6061*6062* See wl_subsurface for the recursive effect of this mode.6063*/6064static inline void6065wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)6066{6067wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6068WL_SUBSURFACE_SET_SYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);6069}60706071/**6072* @ingroup iface_wl_subsurface6073*6074* Change the commit behaviour of the sub-surface to desynchronized6075* mode, also described as independent or freely running mode.6076*6077* In desynchronized mode, wl_surface.commit on a sub-surface will6078* apply the pending state directly, without caching, as happens6079* normally with a wl_surface. Calling wl_surface.commit on the6080* parent surface has no effect on the sub-surface's wl_surface6081* state. This mode allows a sub-surface to be updated on its own.6082*6083* If cached state exists when wl_surface.commit is called in6084* desynchronized mode, the pending state is added to the cached6085* state, and applied as a whole. This invalidates the cache.6086*6087* Note: even if a sub-surface is set to desynchronized, a parent6088* sub-surface may override it to behave as synchronized. For details,6089* see wl_subsurface.6090*6091* If a surface's parent surface behaves as desynchronized, then6092* the cached state is applied on set_desync.6093*/6094static inline void6095wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)6096{6097wl_proxy_marshal_flags((struct wl_proxy *) wl_subsurface,6098WL_SUBSURFACE_SET_DESYNC, NULL, wl_proxy_get_version((struct wl_proxy *) wl_subsurface), 0);6099}61006101#ifdef __cplusplus6102}6103#endif61046105#endif610661076108