This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-13 21:27:42 -04:00
1 parent 5fd47421f9
commit aecd2ebe1d
852 files changed
+4844 -46144

No files matched your search

@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright 2026 The412Banner
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef BANNER_AHB_V1_SERVER_PROTOCOL_H
#define BANNER_AHB_V1_SERVER_PROTOCOL_H
@@ -14,12 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_banner_ahb_v1 The banner_ahb_v1 protocol
* @section page_ifaces_banner_ahb_v1 Interfaces
* - @subpage page_iface_banner_ahb_v1 - Android gralloc buffers behind dma-buf wl_buffers
/*
* @section page_copyright_banner_ahb_v1 Copyright
* <pre>
*
* Copyright 2026 The412Banner
*
@@ -41,132 +36,23 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct banner_ahb_v1;
struct wl_buffer;
#ifndef BANNER_AHB_V1_INTERFACE
#define BANNER_AHB_V1_INTERFACE
/**
* @page page_iface_banner_ahb_v1 banner_ahb_v1
* @section page_iface_banner_ahb_v1_desc Description
*
* Zero-copy window layers on Android. A Vulkan swapchain image that the
* client allocated as an Android AHardwareBuffer (gralloc) is still shared
* as a dma-buf through zwp_linux_dmabuf_v1, so the compositor can import
* and draw it the usual way. This interface additionally hands the
* compositor the AHardwareBuffer itself, once per wl_buffer, so the
* compositor can put the buffer straight on an Android SurfaceControl
* layer (SurfaceFlinger / the display hardware composite it) without
* copying it.
*
* The AHardwareBuffer travels over a Unix socket: the client creates a
* socketpair, writes the buffer's handle into one end with
* AHardwareBuffer_sendHandleToUnixSocket, then sends the other end in the
* attach request. The compositor reads it with
* AHardwareBuffer_recvHandleFromUnixSocket and closes the socket. Its
* reference to the AHardwareBuffer lives as long as the wl_buffer (plus
* whatever the display still holds).
*
* The compositor advertises this global whenever it can put buffers on a
* display layer at all; whether it WANTS gralloc buffers right now is the
* mode event (version 2), sent on bind and every time the user switches
* zero-copy on or off during the session. A client decides per swapchain,
* when it creates the swapchain, from the last mode it received, and a
* client whose live swapchain was built for the other mode retires it
* (VK_ERROR_OUT_OF_DATE_KHR on its next acquire or present) so the program
* rebuilds it for the new mode. Buffers of the old swapchain stay fully
* presentable until then: an attached AHardwareBuffer keeps its association
* for the wl_buffer's lifetime whatever the mode is now. A version 1
* client (no mode event) keeps deciding from its own environment. A
* client that does not see the global (or does not want it) allocates
* swapchain images the standard way; nothing else changes.
*
* Synchronisation stays implicit: the dma-buf carries the client's render
* fence (DMA_BUF_IOCTL_IMPORT_SYNC_FILE by the client's driver), the
* compositor exports it as the layer's acquire fence, and the compositor
* imports the display's release fence into the dma-buf before it sends
* wl_buffer.release, so the client's next acquire waits on it.
* @section page_iface_banner_ahb_v1_api API
* See @ref iface_banner_ahb_v1.
*/
/**
* @defgroup iface_banner_ahb_v1 The banner_ahb_v1 interface
*
* Zero-copy window layers on Android. A Vulkan swapchain image that the
* client allocated as an Android AHardwareBuffer (gralloc) is still shared
* as a dma-buf through zwp_linux_dmabuf_v1, so the compositor can import
* and draw it the usual way. This interface additionally hands the
* compositor the AHardwareBuffer itself, once per wl_buffer, so the
* compositor can put the buffer straight on an Android SurfaceControl
* layer (SurfaceFlinger / the display hardware composite it) without
* copying it.
*
* The AHardwareBuffer travels over a Unix socket: the client creates a
* socketpair, writes the buffer's handle into one end with
* AHardwareBuffer_sendHandleToUnixSocket, then sends the other end in the
* attach request. The compositor reads it with
* AHardwareBuffer_recvHandleFromUnixSocket and closes the socket. Its
* reference to the AHardwareBuffer lives as long as the wl_buffer (plus
* whatever the display still holds).
*
* The compositor advertises this global whenever it can put buffers on a
* display layer at all; whether it WANTS gralloc buffers right now is the
* mode event (version 2), sent on bind and every time the user switches
* zero-copy on or off during the session. A client decides per swapchain,
* when it creates the swapchain, from the last mode it received, and a
* client whose live swapchain was built for the other mode retires it
* (VK_ERROR_OUT_OF_DATE_KHR on its next acquire or present) so the program
* rebuilds it for the new mode. Buffers of the old swapchain stay fully
* presentable until then: an attached AHardwareBuffer keeps its association
* for the wl_buffer's lifetime whatever the mode is now. A version 1
* client (no mode event) keeps deciding from its own environment. A
* client that does not see the global (or does not want it) allocates
* swapchain images the standard way; nothing else changes.
*
* Synchronisation stays implicit: the dma-buf carries the client's render
* fence (DMA_BUF_IOCTL_IMPORT_SYNC_FILE by the client's driver), the
* compositor exports it as the layer's acquire fence, and the compositor
* imports the display's release fence into the dma-buf before it sends
* wl_buffer.release, so the client's next acquire waits on it.
*/
extern const struct wl_interface banner_ahb_v1_interface;
#endif
/**
* @ingroup iface_banner_ahb_v1
* @struct banner_ahb_v1_interface
*/
struct banner_ahb_v1_interface {
/**
* destroy the object
*
* Buffers already attached keep their AHardwareBuffer
* association.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* hand the compositor a buffer's AHardwareBuffer
*
* Associates the AHardwareBuffer readable from socket with the
* (already created) dma-buf wl_buffer. width, height and stride
* (pixels) describe the gralloc allocation; modifier_hi/lo is the
* DRM format modifier the dma-buf was shared with (the same value
* passed to zwp_linux_buffer_params_v1.add); image_count is the
* number of images in the swapchain this buffer belongs to (for
* the compositor's log). Sent once per wl_buffer, before the
* buffer is first attached to a surface.
* @param buffer the dma-buf wl_buffer
* @param socket socket the AHardwareBuffer handle was written to
* @param width buffer width in pixels
* @param height buffer height in pixels
* @param stride gralloc row stride in pixels
* @param modifier_hi high 32 bits of the DRM format modifier
* @param modifier_lo low 32 bits of the DRM format modifier
* @param image_count images in the client's swapchain
*/
void (*attach)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *buffer,
@@ -181,26 +67,11 @@ struct banner_ahb_v1_interface {
#define BANNER_AHB_V1_MODE 0
/**
* @ingroup iface_banner_ahb_v1
*/
#define BANNER_AHB_V1_MODE_SINCE_VERSION 2
/**
* @ingroup iface_banner_ahb_v1
*/
#define BANNER_AHB_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_banner_ahb_v1
*/
#define BANNER_AHB_V1_ATTACH_SINCE_VERSION 1
/**
* @ingroup iface_banner_ahb_v1
* Sends an mode event to the client owning the resource.
* @param resource_ The client's resource
* @param enabled 1 = gralloc swapchain images wanted, 0 = not
*/
static inline void
banner_ahb_v1_send_mode(struct wl_resource *resource_, uint32_t enabled)
{
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright 2026 The412Banner
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef BANNER_DESKTOP_V1_SERVER_PROTOCOL_H
#define BANNER_DESKTOP_V1_SERVER_PROTOCOL_H
@@ -14,12 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_banner_desktop_v1 The banner_desktop_v1 protocol
* @section page_ifaces_banner_desktop_v1 Interfaces
* - @subpage page_iface_banner_desktop_v1 - Windows virtual desktop layout
/*
* @section page_copyright_banner_desktop_v1 Copyright
* <pre>
*
* Copyright 2026 The412Banner
*
@@ -41,98 +36,41 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct banner_desktop_v1;
struct wl_surface;
#ifndef BANNER_DESKTOP_V1_INTERFACE
#define BANNER_DESKTOP_V1_INTERFACE
/**
* @page page_iface_banner_desktop_v1 banner_desktop_v1
* @section page_iface_banner_desktop_v1_desc Description
*
* Each Wine process is a separate Wayland client, so a Windows virtual
* desktop can't be built from subsurfaces. Instead the process that owns
* the desktop window marks one surface as the desktop, and every process
* reports where its top-level windows sit on that desktop and the global
* window stacking order. The compositor draws the desktop at the bottom,
* the windows at the reported positions, and sends pointer and keyboard
* input to the desktop surface; Wine routes it to the right window.
* @section page_iface_banner_desktop_v1_api API
* See @ref iface_banner_desktop_v1.
*/
/**
* @defgroup iface_banner_desktop_v1 The banner_desktop_v1 interface
*
* Each Wine process is a separate Wayland client, so a Windows virtual
* desktop can't be built from subsurfaces. Instead the process that owns
* the desktop window marks one surface as the desktop, and every process
* reports where its top-level windows sit on that desktop and the global
* window stacking order. The compositor draws the desktop at the bottom,
* the windows at the reported positions, and sends pointer and keyboard
* input to the desktop surface; Wine routes it to the right window.
*/
extern const struct wl_interface banner_desktop_v1_interface;
#endif
/**
* @ingroup iface_banner_desktop_v1
* @struct banner_desktop_v1_interface
*/
struct banner_desktop_v1_interface {
/**
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* mark a surface as the virtual desktop
*
* The surface is drawn at the origin, below every window, and
* sets the size of the desktop.
*/
void (*set_desktop)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface);
/**
* place a top-level window on the desktop
*
* Position of the top-left corner of the surface in desktop
* coordinates, and the window handle used by set_zorder.
*/
void (*set_window)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface,
uint32_t hwnd,
int32_t x,
int32_t y);
/**
* report the desktop's window stacking order
*
* Visible top-level window handles as 32-bit values, topmost
* first.
*/
void (*set_zorder)(struct wl_client *client,
struct wl_resource *resource,
struct wl_array *hwnds);
};
/**
* @ingroup iface_banner_desktop_v1
*/
#define BANNER_DESKTOP_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_banner_desktop_v1
*/
#define BANNER_DESKTOP_V1_SET_DESKTOP_SINCE_VERSION 1
/**
* @ingroup iface_banner_desktop_v1
*/
#define BANNER_DESKTOP_V1_SET_WINDOW_SINCE_VERSION 1
/**
* @ingroup iface_banner_desktop_v1
*/
#define BANNER_DESKTOP_V1_SET_ZORDER_SINCE_VERSION 1
#ifdef __cplusplus
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright 2019 Sebastian Wick
* Copyright 2019 Erwin Burema
@@ -34,7 +32,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2014, 2015 Collabora, Ltd.
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef LINUX_DMABUF_V1_SERVER_PROTOCOL_H
#define LINUX_DMABUF_V1_SERVER_PROTOCOL_H
@@ -14,14 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_linux_dmabuf_v1 The linux_dmabuf_v1 protocol
* @section page_ifaces_linux_dmabuf_v1 Interfaces
* - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based wl_buffers
* - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a dmabuf-based wl_buffer
* - @subpage page_iface_zwp_linux_dmabuf_feedback_v1 - dmabuf feedback
/*
* @section page_copyright_linux_dmabuf_v1 Copyright
* <pre>
*
* Copyright © 2014, 2015 Collabora, Ltd.
*
@@ -43,8 +36,14 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_buffer;
struct wl_surface;
struct zwp_linux_buffer_params_v1;
@@ -53,322 +52,26 @@ struct zwp_linux_dmabuf_v1;
#ifndef ZWP_LINUX_DMABUF_V1_INTERFACE
#define ZWP_LINUX_DMABUF_V1_INTERFACE
/**
* @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1
* @section page_iface_zwp_linux_dmabuf_v1_desc Description
*
* This interface offers ways to create generic dmabuf-based wl_buffers.
*
* For more information about dmabuf, see:
* https://www.kernel.org/doc/html/next/userspace-api/dma-buf-alloc-exchange.html
*
* Clients can use the get_surface_feedback request to get dmabuf feedback
* for a particular surface. If the client wants to retrieve feedback not
* tied to a surface, they can use the get_default_feedback request.
*
* The following are required from clients:
*
* - Clients must ensure that either all data in the dma-buf is
* coherent for all subsequent read access or that coherency is
* correctly handled by the underlying kernel-side dma-buf
* implementation.
*
* - Don't make any more attachments after sending the buffer to the
* compositor. Making more attachments later increases the risk of
* the compositor not being able to use (re-import) an existing
* dmabuf-based wl_buffer.
*
* The underlying graphics stack must ensure the following:
*
* - The dmabuf file descriptors relayed to the server will stay valid
* for the whole lifetime of the wl_buffer. This means the server may
* at any time use those fds to import the dmabuf into any kernel
* sub-system that might accept it.
*
* However, when the underlying graphics stack fails to deliver the
* promise, because of e.g. a device hot-unplug which raises internal
* errors, after the wl_buffer has been successfully created the
* compositor must not raise protocol errors to the client when dmabuf
* import later fails.
*
* To create a wl_buffer from one or more dmabufs, a client creates a
* zwp_linux_buffer_params_v1 object with a zwp_linux_dmabuf_v1.create_params
* request. All planes required by the intended format are added with
* the 'add' request. Finally, a 'create' or 'create_immed' request is
* issued, which has the following outcome depending on the import success.
*
* The 'create' request,
* - on success, triggers a 'created' event which provides the final
* wl_buffer to the client.
* - on failure, triggers a 'failed' event to convey that the server
* cannot use the dmabufs received from the client.
*
* For the 'create_immed' request,
* - on success, the server immediately imports the added dmabufs to
* create a wl_buffer. No event is sent from the server in this case.
* - on failure, the server can choose to either:
* - terminate the client by raising a fatal error.
* - mark the wl_buffer as failed, and send a 'failed' event to the
* client. If the client uses a failed wl_buffer as an argument to any
* request, the behaviour is compositor implementation-defined.
*
* For all DRM formats and unless specified in another protocol extension,
* pre-multiplied alpha is used for pixel values.
*
* Unless specified otherwise in another protocol extension, implicit
* synchronization is used. In other words, compositors and clients must
* wait and signal fences implicitly passed via the DMA-BUF's reservation
* mechanism.
* @section page_iface_zwp_linux_dmabuf_v1_api API
* See @ref iface_zwp_linux_dmabuf_v1.
*/
/**
* @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface
*
* This interface offers ways to create generic dmabuf-based wl_buffers.
*
* For more information about dmabuf, see:
* https://www.kernel.org/doc/html/next/userspace-api/dma-buf-alloc-exchange.html
*
* Clients can use the get_surface_feedback request to get dmabuf feedback
* for a particular surface. If the client wants to retrieve feedback not
* tied to a surface, they can use the get_default_feedback request.
*
* The following are required from clients:
*
* - Clients must ensure that either all data in the dma-buf is
* coherent for all subsequent read access or that coherency is
* correctly handled by the underlying kernel-side dma-buf
* implementation.
*
* - Don't make any more attachments after sending the buffer to the
* compositor. Making more attachments later increases the risk of
* the compositor not being able to use (re-import) an existing
* dmabuf-based wl_buffer.
*
* The underlying graphics stack must ensure the following:
*
* - The dmabuf file descriptors relayed to the server will stay valid
* for the whole lifetime of the wl_buffer. This means the server may
* at any time use those fds to import the dmabuf into any kernel
* sub-system that might accept it.
*
* However, when the underlying graphics stack fails to deliver the
* promise, because of e.g. a device hot-unplug which raises internal
* errors, after the wl_buffer has been successfully created the
* compositor must not raise protocol errors to the client when dmabuf
* import later fails.
*
* To create a wl_buffer from one or more dmabufs, a client creates a
* zwp_linux_buffer_params_v1 object with a zwp_linux_dmabuf_v1.create_params
* request. All planes required by the intended format are added with
* the 'add' request. Finally, a 'create' or 'create_immed' request is
* issued, which has the following outcome depending on the import success.
*
* The 'create' request,
* - on success, triggers a 'created' event which provides the final
* wl_buffer to the client.
* - on failure, triggers a 'failed' event to convey that the server
* cannot use the dmabufs received from the client.
*
* For the 'create_immed' request,
* - on success, the server immediately imports the added dmabufs to
* create a wl_buffer. No event is sent from the server in this case.
* - on failure, the server can choose to either:
* - terminate the client by raising a fatal error.
* - mark the wl_buffer as failed, and send a 'failed' event to the
* client. If the client uses a failed wl_buffer as an argument to any
* request, the behaviour is compositor implementation-defined.
*
* For all DRM formats and unless specified in another protocol extension,
* pre-multiplied alpha is used for pixel values.
*
* Unless specified otherwise in another protocol extension, implicit
* synchronization is used. In other words, compositors and clients must
* wait and signal fences implicitly passed via the DMA-BUF's reservation
* mechanism.
*/
extern const struct wl_interface zwp_linux_dmabuf_v1_interface;
#endif
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_INTERFACE
#define ZWP_LINUX_BUFFER_PARAMS_V1_INTERFACE
/**
* @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1
* @section page_iface_zwp_linux_buffer_params_v1_desc Description
*
* This temporary object is a collection of dmabufs and other
* parameters that together form a single logical buffer. The temporary
* object may eventually create one wl_buffer unless cancelled by
* destroying it before requesting 'create'.
*
* Single-planar formats only require one dmabuf, however
* multi-planar formats may require more than one dmabuf. For all
* formats, an 'add' request must be called once per plane (even if the
* underlying dmabuf fd is identical).
*
* You must use consecutive plane indices ('plane_idx' argument for 'add')
* from zero to the number of planes used by the drm_fourcc format code.
* All planes required by the format must be given exactly once, but can
* be given in any order. Each plane index can only be set once; subsequent
* calls with a plane index which has already been set will result in a
* plane_set error being generated.
* @section page_iface_zwp_linux_buffer_params_v1_api API
* See @ref iface_zwp_linux_buffer_params_v1.
*/
/**
* @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 interface
*
* This temporary object is a collection of dmabufs and other
* parameters that together form a single logical buffer. The temporary
* object may eventually create one wl_buffer unless cancelled by
* destroying it before requesting 'create'.
*
* Single-planar formats only require one dmabuf, however
* multi-planar formats may require more than one dmabuf. For all
* formats, an 'add' request must be called once per plane (even if the
* underlying dmabuf fd is identical).
*
* You must use consecutive plane indices ('plane_idx' argument for 'add')
* from zero to the number of planes used by the drm_fourcc format code.
* All planes required by the format must be given exactly once, but can
* be given in any order. Each plane index can only be set once; subsequent
* calls with a plane index which has already been set will result in a
* plane_set error being generated.
*/
extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
#endif
#ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_INTERFACE
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_INTERFACE
/**
* @page page_iface_zwp_linux_dmabuf_feedback_v1 zwp_linux_dmabuf_feedback_v1
* @section page_iface_zwp_linux_dmabuf_feedback_v1_desc Description
*
* This object advertises dmabuf parameters feedback. This includes the
* preferred devices and the supported formats/modifiers.
*
* The parameters are sent once when this object is created and whenever they
* change. The done event is always sent once after all parameters have been
* sent. When a single parameter changes, all parameters are re-sent by the
* compositor.
*
* Compositors can re-send the parameters when the current client buffer
* allocations are sub-optimal. Compositors should not re-send the
* parameters if re-allocating the buffers would not result in a more optimal
* configuration. In particular, compositors should avoid sending the exact
* same parameters multiple times in a row.
*
* The tranche_target_device and tranche_formats events are grouped by
* tranches of preference. For each tranche, a tranche_target_device, one
* tranche_flags and one or more tranche_formats events are sent, followed
* by a tranche_done event finishing the list. The tranches are sent in
* descending order of preference. All formats and modifiers in the same
* tranche have the same preference.
*
* To send parameters, the compositor sends one main_device event (unless
* the client bound version 6 or above), tranches (each consisting of one
* tranche_target_device event, one tranche_flags event, tranche_formats
* events and then a tranche_done event), then one done event.
*
* With version 6 and above, the compositor must always advertise at least
* one tranche with the sampling flag set.
*
* The compositor sends a format_table event at least once for each dmabuf
* parameters feedback object, before any tranche events. Unless the format
* table contents change later, the compositor is free not to send another
* format_table event for the same dmabuf parameters feedback object.
* @section page_iface_zwp_linux_dmabuf_feedback_v1_api API
* See @ref iface_zwp_linux_dmabuf_feedback_v1.
*/
/**
* @defgroup iface_zwp_linux_dmabuf_feedback_v1 The zwp_linux_dmabuf_feedback_v1 interface
*
* This object advertises dmabuf parameters feedback. This includes the
* preferred devices and the supported formats/modifiers.
*
* The parameters are sent once when this object is created and whenever they
* change. The done event is always sent once after all parameters have been
* sent. When a single parameter changes, all parameters are re-sent by the
* compositor.
*
* Compositors can re-send the parameters when the current client buffer
* allocations are sub-optimal. Compositors should not re-send the
* parameters if re-allocating the buffers would not result in a more optimal
* configuration. In particular, compositors should avoid sending the exact
* same parameters multiple times in a row.
*
* The tranche_target_device and tranche_formats events are grouped by
* tranches of preference. For each tranche, a tranche_target_device, one
* tranche_flags and one or more tranche_formats events are sent, followed
* by a tranche_done event finishing the list. The tranches are sent in
* descending order of preference. All formats and modifiers in the same
* tranche have the same preference.
*
* To send parameters, the compositor sends one main_device event (unless
* the client bound version 6 or above), tranches (each consisting of one
* tranche_target_device event, one tranche_flags event, tranche_formats
* events and then a tranche_done event), then one done event.
*
* With version 6 and above, the compositor must always advertise at least
* one tranche with the sampling flag set.
*
* The compositor sends a format_table event at least once for each dmabuf
* parameters feedback object, before any tranche events. Unless the format
* table contents change later, the compositor is free not to send another
* format_table event for the same dmabuf parameters feedback object.
*/
extern const struct wl_interface zwp_linux_dmabuf_feedback_v1_interface;
#endif
/**
* @ingroup iface_zwp_linux_dmabuf_v1
* @struct zwp_linux_dmabuf_v1_interface
*/
struct zwp_linux_dmabuf_v1_interface {
/**
* unbind the factory
*
* Objects created through this interface, especially wl_buffers,
* will remain valid.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* create a temporary object for buffer parameters
*
* This temporary object is used to collect multiple dmabuf
* handles into a single batch to create a wl_buffer. It can only
* be used once and should be destroyed after a 'created' or
* 'failed' event has been received.
* @param params_id id for the newly created zwp_linux_buffer_params_v1
*/
void (*create_params)(struct wl_client *client,
struct wl_resource *resource,
uint32_t params_id);
/**
* get default feedback
*
* This request creates a new zwp_linux_dmabuf_feedback_v1 object
* not bound to a particular surface. This object will deliver
* feedback about dmabuf parameters to use if the client doesn't
* support per-surface feedback (see get_surface_feedback).
* @since 4
*/
void (*get_default_feedback)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id);
/**
* get feedback for a surface
*
* This request creates a new zwp_linux_dmabuf_feedback_v1 object
* for the specified wl_surface. This object will deliver feedback
* about dmabuf parameters to use for buffers attached to this
* surface.
*
* If the surface is destroyed before the
* zwp_linux_dmabuf_feedback_v1 object, the feedback object becomes
* inert.
* @since 4
*/
void (*get_surface_feedback)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -378,52 +81,20 @@ struct zwp_linux_dmabuf_v1_interface {
#define ZWP_LINUX_DMABUF_V1_FORMAT 0
#define ZWP_LINUX_DMABUF_V1_MODIFIER 1
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_GET_DEFAULT_FEEDBACK_SINCE_VERSION 4
/**
* @ingroup iface_zwp_linux_dmabuf_v1
*/
#define ZWP_LINUX_DMABUF_V1_GET_SURFACE_FEEDBACK_SINCE_VERSION 4
/**
* @ingroup iface_zwp_linux_dmabuf_v1
* Sends an format event to the client owning the resource.
* @param resource_ The client's resource
* @param format DRM_FORMAT code
*/
static inline void
zwp_linux_dmabuf_v1_send_format(struct wl_resource *resource_, uint32_t format)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_FORMAT, format);
}
/**
* @ingroup iface_zwp_linux_dmabuf_v1
* Sends an modifier event to the client owning the resource.
* @param resource_ The client's resource
* @param format DRM_FORMAT code
* @param modifier_hi high 32 bits of layout modifier
* @param modifier_lo low 32 bits of layout modifier
*/
static inline void
zwp_linux_dmabuf_v1_send_modifier(struct wl_resource *resource_, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
{
@@ -433,54 +104,20 @@ zwp_linux_dmabuf_v1_send_modifier(struct wl_resource *resource_, uint32_t format
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
#define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
enum zwp_linux_buffer_params_v1_error {
/**
* the zwp_linux_buffer_params_v1 object has already been used to create a wl_buffer
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0,
/**
* plane index out of bounds
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1,
/**
* the plane index was already set
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2,
/**
* missing or too many planes to create a buffer
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3,
/**
* format not supported
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4,
/**
* invalid width or height
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5,
/**
* offset + stride * height goes out of dmabuf bounds
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6,
/**
* invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7,
/**
* an array with mismatching size for a dev_t was used
*/
ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DEV_T_SIZE = 8,
};
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */
#endif
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID
#define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Validate a zwp_linux_buffer_params_v1 error value.
*
* @return true on success, false on error.
* @ref zwp_linux_buffer_params_v1_error
*/
static inline bool
zwp_linux_buffer_params_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -506,35 +143,19 @@ zwp_linux_buffer_params_v1_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM_IS_VALID */
#endif
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
#define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
enum zwp_linux_buffer_params_v1_flags {
/**
* contents are y-inverted
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1,
/**
* content is interlaced
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2,
/**
* bottom field first
*/
ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4,
};
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */
#endif
#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID
#define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Validate a zwp_linux_buffer_params_v1 flags value.
*
* @return true on success, false on error.
* @ref zwp_linux_buffer_params_v1_flags
*/
static inline bool
zwp_linux_buffer_params_v1_flags_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
@@ -546,51 +167,11 @@ zwp_linux_buffer_params_v1_flags_is_valid(uint32_t value, uint32_t version) {
valid |= ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST;
return (value & ~valid) == 0;
}
#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* @struct zwp_linux_buffer_params_v1_interface
*/
struct zwp_linux_buffer_params_v1_interface {
/**
* delete this object, used or not
*
* Cleans up the temporary data sent to the server for
* dmabuf-based wl_buffer creation.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* add a dmabuf to the temporary set
*
* This request adds one dmabuf to the set in this
* zwp_linux_buffer_params_v1.
*
* The 64-bit unsigned value combined from modifier_hi and
* modifier_lo is the dmabuf layout modifier. DRM AddFB2 ioctl
* calls this the fb modifier, which is defined in drm_mode.h of
* Linux UAPI. This is an opaque token. Drivers use this token to
* express tiling, compression, etc. driver-specific modifications
* to the base format defined by the DRM fourcc code.
*
* Starting from version 4, the invalid_format protocol error is
* sent if the format + modifier pair was not advertised as
* supported.
*
* Starting from version 5, the invalid_format protocol error is
* sent if all planes don't use the same modifier.
*
* This request raises the PLANE_IDX error if plane_idx is too
* large. The error PLANE_SET is raised if attempting to set a
* plane that was already set.
* @param fd dmabuf fd
* @param plane_idx plane index
* @param offset offset in bytes
* @param stride stride in bytes
* @param modifier_hi high 32 bits of layout modifier
* @param modifier_lo low 32 bits of layout modifier
*/
void (*add)(struct wl_client *client,
struct wl_resource *resource,
int32_t fd,
@@ -599,112 +180,12 @@ struct zwp_linux_buffer_params_v1_interface {
uint32_t stride,
uint32_t modifier_hi,
uint32_t modifier_lo);
/**
* create a wl_buffer from the given dmabufs
*
* This asks for creation of a wl_buffer from the added dmabuf
* buffers. The wl_buffer is not created immediately but returned
* via the 'created' event if the dmabuf sharing succeeds. The
* sharing may fail at runtime for reasons a client cannot predict,
* in which case the 'failed' event is triggered.
*
* The 'format' argument is a DRM_FORMAT code, as defined by the
* libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
* authoritative source on how the format codes should work.
*
* The 'flags' is a bitfield of the flags defined in enum "flags".
* 'y_invert' means that the image needs to be y-flipped.
*
* Flag 'interlaced' means that the frame in the buffer is not
* progressive as usual, but interlaced. An interlaced buffer as
* supported here must always contain both top and bottom fields.
* The top field always begins on the first pixel row. The temporal
* ordering between the two fields is top field first, unless
* 'bottom_first' is specified. It is undefined whether
* 'bottom_first' is ignored if 'interlaced' is not set.
*
* This protocol does not convey any information about field rate,
* duration, or timing, other than the relative ordering between
* the two fields in one buffer. A compositor may have to estimate
* the intended field rate from the incoming buffer rate. It is
* undefined whether the time of receiving wl_surface.commit with a
* new buffer attached, applying the wl_surface state,
* wl_surface.frame callback trigger, presentation, or any other
* point in the compositor cycle is used to measure the frame or
* field times. There is no support for detecting missed or late
* frames/fields/buffers either, and there is no support whatsoever
* for cooperating with interlaced compositor output.
*
* The composited image quality resulting from the use of
* interlaced buffers is explicitly undefined. A compositor may use
* elaborate hardware features or software to deinterlace and
* create progressive output frames from a sequence of interlaced
* input buffers, or it may produce substandard image quality.
* However, compositors that cannot guarantee reasonable image
* quality in all cases are recommended to just reject all
* interlaced buffers.
*
* Any argument errors, including non-positive width or height,
* mismatch between the number of planes and the format, bad
* format, bad offset or stride, may be indicated by fatal protocol
* errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
* OUT_OF_BOUNDS.
*
* Dmabuf import errors in the server that are not obvious client
* bugs are returned via the 'failed' event as non-fatal. This
* allows attempting dmabuf sharing and falling back in the client
* if it fails.
*
* This request can be sent only once in the object's lifetime,
* after which the only legal request is destroy. This object
* should be destroyed after issuing a 'create' request. Attempting
* to use this object after issuing 'create' raises the
* ALREADY_USED protocol error.
*
* It is not mandatory to issue 'create'. If a client wants to
* cancel the buffer creation, it can just destroy this object.
* @param width base plane width in pixels
* @param height base plane height in pixels
* @param format DRM_FORMAT code
* @param flags see enum flags
*/
void (*create)(struct wl_client *client,
struct wl_resource *resource,
int32_t width,
int32_t height,
uint32_t format,
uint32_t flags);
/**
* immediately create a wl_buffer from the given dmabufs
*
* This asks for immediate creation of a wl_buffer by importing
* the added dmabufs.
*
* In case of import success, no event is sent from the server, and
* the wl_buffer is ready to be used by the client.
*
* Upon import failure, either of the following may happen, as seen
* fit by the implementation: - the client is terminated with one
* of the following fatal protocol errors: - INCOMPLETE,
* INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, in case of
* argument errors such as mismatch between the number of planes
* and the format, bad format, non-positive width or height, or bad
* offset or stride. - INVALID_WL_BUFFER, in case the cause for
* failure is unknown or platform specific. - the server creates an
* invalid wl_buffer, marks it as failed and sends a 'failed' event
* to the client. The result of using this invalid wl_buffer as an
* argument in any request by the client is defined by the
* compositor implementation.
*
* This takes the same arguments as a 'create' request, and obeys
* the same restrictions.
* @param buffer_id id for the newly created wl_buffer
* @param width base plane width in pixels
* @param height base plane height in pixels
* @param format DRM_FORMAT code
* @param flags see enum flags
* @since 2
*/
void (*create_immed)(struct wl_client *client,
struct wl_resource *resource,
uint32_t buffer_id,
@@ -712,26 +193,6 @@ struct zwp_linux_buffer_params_v1_interface {
int32_t height,
uint32_t format,
uint32_t flags);
/**
* set the target device of the wl_buffer
*
* Set the device the compositor should import the dmabufs to for
* sampling in the next create or create_immed request.
*
* To avoid race conditions when the compositor removes a device
* from the tranches, it is not a protocol error if the device
* hasn't been advertised by the compositor in a tranche with the
* sampling flag, but the import is likely to fail in that case.
*
* If the client doesn't know a suitable target device, it
* shouldn't set one, and the compositor should attempt import on
* all devices it supports.
*
* If the array is too small to contain a dev_t or larger than
* required, the invalid_dev_t_size error will be emitted.
* @param device device dev_t value
* @since 6
*/
void (*set_sampling_device)(struct wl_client *client,
struct wl_resource *resource,
struct wl_array *device);
@@ -740,53 +201,21 @@ struct zwp_linux_buffer_params_v1_interface {
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0
#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2
/**
* @ingroup iface_zwp_linux_buffer_params_v1
*/
#define ZWP_LINUX_BUFFER_PARAMS_V1_SET_SAMPLING_DEVICE_SINCE_VERSION 6
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Sends an created event to the client owning the resource.
* @param resource_ The client's resource
* @param buffer id for the the newly created wl_buffer
*/
static inline void
zwp_linux_buffer_params_v1_send_created(struct wl_resource *resource_, struct wl_resource *buffer)
{
wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_CREATED, buffer);
}
/**
* @ingroup iface_zwp_linux_buffer_params_v1
* Sends an failed event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_linux_buffer_params_v1_send_failed(struct wl_resource *resource_)
{
@@ -796,48 +225,15 @@ zwp_linux_buffer_params_v1_send_failed(struct wl_resource *resource_)
#ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM
enum zwp_linux_dmabuf_feedback_v1_tranche_flags {
/**
* direct scan-out tranche
*
* The scanout flag is a hint that direct scan-out may be
* attempted by the compositor on the target device if the client
* appropriately allocates a buffer. How to allocate a buffer that
* can be scanned out on the target device is
* implementation-defined.
* @since 4
*/
ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT = 1,
/**
* sampling tranche
*
* The sampling flag describes that the compositor is able to
* efficiently sample from buffers imported to the target device if
* the client appropriately allocates a buffer. How to allocate a
* buffer that can be efficiently sampled on the target device is
* implementation defined.
* @since 6
*/
ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING = 2,
};
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SCANOUT_SINCE_VERSION 4
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING_SINCE_VERSION 6
#endif /* ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM */
#endif
#ifndef ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Validate a zwp_linux_dmabuf_feedback_v1 tranche_flags value.
*
* @return true on success, false on error.
* @ref zwp_linux_dmabuf_feedback_v1_tranche_flags
*/
static inline bool
zwp_linux_dmabuf_feedback_v1_tranche_flags_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
@@ -847,19 +243,9 @@ zwp_linux_dmabuf_feedback_v1_tranche_flags_is_valid(uint32_t value, uint32_t ver
valid |= ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SAMPLING;
return (value & ~valid) == 0;
}
#endif /* ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* @struct zwp_linux_dmabuf_feedback_v1_interface
*/
struct zwp_linux_dmabuf_feedback_v1_interface {
/**
* destroy the feedback object
*
* Using this request a client can tell the server that it is not
* going to use the zwp_linux_dmabuf_feedback_v1 object anymore.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
@@ -872,117 +258,52 @@ struct zwp_linux_dmabuf_feedback_v1_interface {
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS 5
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS 6
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_FORMAT_TABLE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_MAIN_DEVICE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_DONE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_TARGET_DEVICE_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FLAGS_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
*/
#define ZWP_LINUX_DMABUF_FEEDBACK_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an done event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_done(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_DONE);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an format_table event to the client owning the resource.
* @param resource_ The client's resource
* @param fd table file descriptor
* @param size table size, in bytes
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_format_table(struct wl_resource *resource_, int32_t fd, uint32_t size)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_FORMAT_TABLE, fd, size);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an main_device event to the client owning the resource.
* @param resource_ The client's resource
* @param device device dev_t value
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_main_device(struct wl_resource *resource_, struct wl_array *device)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_MAIN_DEVICE, device);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an tranche_done event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_tranche_done(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_DONE);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an tranche_target_device event to the client owning the resource.
* @param resource_ The client's resource
* @param device device dev_t value
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_tranche_target_device(struct wl_resource *resource_, struct wl_array *device)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_TARGET_DEVICE, device);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an tranche_formats event to the client owning the resource.
* @param resource_ The client's resource
* @param indices array of 16-bit indexes
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_tranche_formats(struct wl_resource *resource_, struct wl_array *indices)
{
wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_FEEDBACK_V1_TRANCHE_FORMATS, indices);
}
/**
* @ingroup iface_zwp_linux_dmabuf_feedback_v1
* Sends an tranche_flags event to the client owning the resource.
* @param resource_ The client's resource
* @param flags tranche flags
*/
static inline void
zwp_linux_dmabuf_feedback_v1_send_tranche_flags(struct wl_resource *resource_, uint32_t flags)
{
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2014 Jonas Ådahl
* Copyright © 2015 Red Hat Inc.
@@ -30,7 +28,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
#define POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H
@@ -14,37 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_pointer_constraints_unstable_v1 The pointer_constraints_unstable_v1 protocol
* protocol for constraining pointer motions
*
* @section page_desc_pointer_constraints_unstable_v1 Description
*
* This protocol specifies a set of interfaces used for adding constraints to
* the motion of a pointer. Possible constraints include confining pointer
* motions to a given region, or locking it to its current position.
*
* In order to constrain the pointer, a client must first bind the global
* interface "wp_pointer_constraints" which, if a compositor supports pointer
* constraints, is exposed by the registry. Using the bound global object, the
* client uses the request that corresponds to the type of constraint it wants
* to make. See wp_pointer_constraints for more details.
*
* Warning! The protocol described in this file is experimental and backward
* incompatible changes may be made. Backward compatible changes may be added
* together with the corresponding interface version bump. Backward
* incompatible changes are done by bumping the version number in the protocol
* and interface names and resetting the interface version. Once the protocol
* is to be declared stable, the 'z' prefix and the version number in the
* protocol and interface names are removed and the interface version number is
* reset.
*
* @section page_ifaces_pointer_constraints_unstable_v1 Interfaces
* - @subpage page_iface_zwp_pointer_constraints_v1 - constrain the movement of a pointer
* - @subpage page_iface_zwp_locked_pointer_v1 - receive relative pointer motion events
* - @subpage page_iface_zwp_confined_pointer_v1 - confined pointer object
/*
* @section page_copyright_pointer_constraints_unstable_v1 Copyright
* <pre>
*
* Copyright © 2014 Jonas Ådahl
* Copyright © 2015 Red Hat Inc.
@@ -67,8 +37,37 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_pointer;
struct wl_region;
struct wl_surface;
@@ -78,180 +77,26 @@ struct zwp_pointer_constraints_v1;
#ifndef ZWP_POINTER_CONSTRAINTS_V1_INTERFACE
#define ZWP_POINTER_CONSTRAINTS_V1_INTERFACE
/**
* @page page_iface_zwp_pointer_constraints_v1 zwp_pointer_constraints_v1
* @section page_iface_zwp_pointer_constraints_v1_desc Description
*
* The global interface exposing pointer constraining functionality. It
* exposes two requests: lock_pointer for locking the pointer to its
* position, and confine_pointer for locking the pointer to a region.
*
* The lock_pointer and confine_pointer requests create the objects
* wp_locked_pointer and wp_confined_pointer respectively, and the client can
* use these objects to interact with the lock.
*
* For any surface, only one lock or confinement may be active across all
* wl_pointer objects of the same seat. If a lock or confinement is requested
* when another lock or confinement is active or requested on the same surface
* and with any of the wl_pointer objects of the same seat, an
* 'already_constrained' error will be raised.
* @section page_iface_zwp_pointer_constraints_v1_api API
* See @ref iface_zwp_pointer_constraints_v1.
*/
/**
* @defgroup iface_zwp_pointer_constraints_v1 The zwp_pointer_constraints_v1 interface
*
* The global interface exposing pointer constraining functionality. It
* exposes two requests: lock_pointer for locking the pointer to its
* position, and confine_pointer for locking the pointer to a region.
*
* The lock_pointer and confine_pointer requests create the objects
* wp_locked_pointer and wp_confined_pointer respectively, and the client can
* use these objects to interact with the lock.
*
* For any surface, only one lock or confinement may be active across all
* wl_pointer objects of the same seat. If a lock or confinement is requested
* when another lock or confinement is active or requested on the same surface
* and with any of the wl_pointer objects of the same seat, an
* 'already_constrained' error will be raised.
*/
extern const struct wl_interface zwp_pointer_constraints_v1_interface;
#endif
#ifndef ZWP_LOCKED_POINTER_V1_INTERFACE
#define ZWP_LOCKED_POINTER_V1_INTERFACE
/**
* @page page_iface_zwp_locked_pointer_v1 zwp_locked_pointer_v1
* @section page_iface_zwp_locked_pointer_v1_desc Description
*
* The wp_locked_pointer interface represents a locked pointer state.
*
* While the lock of this object is active, the wl_pointer objects of the
* associated seat will not emit any wl_pointer.motion events.
*
* This object will send the event 'locked' when the lock is activated.
* Whenever the lock is activated, it is guaranteed that the locked surface
* will already have received pointer focus and that the pointer will be
* within the region passed to the request creating this object.
*
* To unlock the pointer, send the destroy request. This will also destroy
* the wp_locked_pointer object.
*
* If the compositor decides to unlock the pointer the unlocked event is
* sent. See wp_locked_pointer.unlock for details.
*
* When unlocking, the compositor may warp the cursor position to the set
* cursor position hint. If it does, it will not result in any relative
* motion events emitted via wp_relative_pointer.
*
* If the surface the lock was requested on is destroyed and the lock is not
* yet activated, the wp_locked_pointer object is now defunct and must be
* destroyed.
* @section page_iface_zwp_locked_pointer_v1_api API
* See @ref iface_zwp_locked_pointer_v1.
*/
/**
* @defgroup iface_zwp_locked_pointer_v1 The zwp_locked_pointer_v1 interface
*
* The wp_locked_pointer interface represents a locked pointer state.
*
* While the lock of this object is active, the wl_pointer objects of the
* associated seat will not emit any wl_pointer.motion events.
*
* This object will send the event 'locked' when the lock is activated.
* Whenever the lock is activated, it is guaranteed that the locked surface
* will already have received pointer focus and that the pointer will be
* within the region passed to the request creating this object.
*
* To unlock the pointer, send the destroy request. This will also destroy
* the wp_locked_pointer object.
*
* If the compositor decides to unlock the pointer the unlocked event is
* sent. See wp_locked_pointer.unlock for details.
*
* When unlocking, the compositor may warp the cursor position to the set
* cursor position hint. If it does, it will not result in any relative
* motion events emitted via wp_relative_pointer.
*
* If the surface the lock was requested on is destroyed and the lock is not
* yet activated, the wp_locked_pointer object is now defunct and must be
* destroyed.
*/
extern const struct wl_interface zwp_locked_pointer_v1_interface;
#endif
#ifndef ZWP_CONFINED_POINTER_V1_INTERFACE
#define ZWP_CONFINED_POINTER_V1_INTERFACE
/**
* @page page_iface_zwp_confined_pointer_v1 zwp_confined_pointer_v1
* @section page_iface_zwp_confined_pointer_v1_desc Description
*
* The wp_confined_pointer interface represents a confined pointer state.
*
* This object will send the event 'confined' when the confinement is
* activated. Whenever the confinement is activated, it is guaranteed that
* the surface the pointer is confined to will already have received pointer
* focus and that the pointer will be within the region passed to the request
* creating this object. It is up to the compositor to decide whether this
* requires some user interaction and if the pointer will warp to within the
* passed region if outside.
*
* To unconfine the pointer, send the destroy request. This will also destroy
* the wp_confined_pointer object.
*
* If the compositor decides to unconfine the pointer the unconfined event is
* sent. The wp_confined_pointer object is at this point defunct and should
* be destroyed.
* @section page_iface_zwp_confined_pointer_v1_api API
* See @ref iface_zwp_confined_pointer_v1.
*/
/**
* @defgroup iface_zwp_confined_pointer_v1 The zwp_confined_pointer_v1 interface
*
* The wp_confined_pointer interface represents a confined pointer state.
*
* This object will send the event 'confined' when the confinement is
* activated. Whenever the confinement is activated, it is guaranteed that
* the surface the pointer is confined to will already have received pointer
* focus and that the pointer will be within the region passed to the request
* creating this object. It is up to the compositor to decide whether this
* requires some user interaction and if the pointer will warp to within the
* passed region if outside.
*
* To unconfine the pointer, send the destroy request. This will also destroy
* the wp_confined_pointer object.
*
* If the compositor decides to unconfine the pointer the unconfined event is
* sent. The wp_confined_pointer object is at this point defunct and should
* be destroyed.
*/
extern const struct wl_interface zwp_confined_pointer_v1_interface;
#endif
#ifndef ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
#define ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM
/**
* @ingroup iface_zwp_pointer_constraints_v1
* wp_pointer_constraints error values
*
* These errors can be emitted in response to wp_pointer_constraints
* requests.
*/
enum zwp_pointer_constraints_v1_error {
/**
* pointer constraint already requested on that surface
*/
ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1,
};
#endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM */
#endif
#ifndef ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID
#define ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 error value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_error
*/
static inline bool
zwp_pointer_constraints_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -261,49 +106,18 @@ zwp_pointer_constraints_v1_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM_IS_VALID */
#endif
#ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
#define ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM
/**
* @ingroup iface_zwp_pointer_constraints_v1
* constraint lifetime
*
* These values represent different lifetime semantics. They are passed
* as arguments to the factory requests to specify how the constraint
* lifetimes should be managed.
*/
enum zwp_pointer_constraints_v1_lifetime {
/**
* the pointer constraint is defunct once deactivated
*
* A oneshot pointer constraint will never reactivate once it has
* been deactivated. See the corresponding deactivation event
* (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined)
* for details.
*/
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT = 1,
/**
* the pointer constraint may reactivate
*
* A persistent pointer constraint may again reactivate once it
* has been deactivated. See the corresponding deactivation event
* (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined)
* for details.
*/
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2,
};
#endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM */
#endif
#ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID
#define ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID
/**
* @ingroup iface_zwp_pointer_constraints_v1
* Validate a zwp_pointer_constraints_v1 lifetime value.
*
* @return true on success, false on error.
* @ref zwp_pointer_constraints_v1_lifetime
*/
static inline bool
zwp_pointer_constraints_v1_lifetime_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -315,67 +129,11 @@ zwp_pointer_constraints_v1_lifetime_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_zwp_pointer_constraints_v1
* @struct zwp_pointer_constraints_v1_interface
*/
struct zwp_pointer_constraints_v1_interface {
/**
* destroy the pointer constraints manager object
*
* Used by the client to notify the server that it will no longer
* use this pointer constraints object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* lock pointer to a position
*
* The lock_pointer request lets the client request to disable
* movements of the virtual pointer (i.e. the cursor), effectively
* locking the pointer to a position. This request may not take
* effect immediately; in the future, when the compositor deems
* implementation-specific constraints are satisfied, the pointer
* lock will be activated and the compositor sends a locked event.
*
* The protocol provides no guarantee that the constraints are ever
* satisfied, and does not require the compositor to send an error
* if the constraints cannot ever be satisfied. It is thus possible
* to request a lock that will never activate.
*
* There may not be another pointer constraint of any kind
* requested or active on the surface for any of the wl_pointer
* objects of the seat of the passed pointer when requesting a
* lock. If there is, an error will be raised. See general pointer
* lock documentation for more details.
*
* The intersection of the region passed with this request and the
* input region of the surface is used to determine where the
* pointer must be in order for the lock to activate. It is up to
* the compositor whether to warp the pointer or require some kind
* of user interaction for the lock to activate. If the region is
* null the surface input region is used.
*
* A surface may receive pointer focus without the lock being
* activated.
*
* The request creates a new object wp_locked_pointer which is used
* to interact with the lock as well as receive updates about its
* state. See the the description of wp_locked_pointer for further
* information.
*
* Note that while a pointer is locked, the wl_pointer objects of
* the corresponding seat will not emit any wl_pointer.motion
* events, but relative motion events will still be emitted via
* wp_relative_pointer objects of the same seat. wl_pointer.axis
* and wl_pointer.button events are unaffected.
* @param surface surface to lock pointer to
* @param pointer the pointer that should be locked
* @param region region of surface
* @param lifetime lock lifetime
*/
void (*lock_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -383,32 +141,6 @@ struct zwp_pointer_constraints_v1_interface {
struct wl_resource *pointer,
struct wl_resource *region,
uint32_t lifetime);
/**
* confine pointer to a region
*
* The confine_pointer request lets the client request to confine
* the pointer cursor to a given region. This request may not take
* effect immediately; in the future, when the compositor deems
* implementation- specific constraints are satisfied, the pointer
* confinement will be activated and the compositor sends a
* confined event.
*
* The intersection of the region passed with this request and the
* input region of the surface is used to determine where the
* pointer must be in order for the confinement to activate. It is
* up to the compositor whether to warp the pointer or require some
* kind of user interaction for the confinement to activate. If the
* region is null the surface input region is used.
*
* The request will create a new object wp_confined_pointer which
* is used to interact with the confinement as well as receive
* updates about its state. See the the description of
* wp_confined_pointer for further information.
* @param surface surface to lock pointer to
* @param pointer the pointer that should be confined
* @param region region of surface
* @param lifetime confinement lifetime
*/
void (*confine_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -419,65 +151,17 @@ struct zwp_pointer_constraints_v1_interface {
};
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_LOCK_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_pointer_constraints_v1
*/
#define ZWP_POINTER_CONSTRAINTS_V1_CONFINE_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
* @struct zwp_locked_pointer_v1_interface
*/
struct zwp_locked_pointer_v1_interface {
/**
* destroy the locked pointer object
*
* Destroy the locked pointer object. If applicable, the
* compositor will unlock the pointer.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set the pointer cursor position hint
*
* Set the cursor position hint relative to the top left corner
* of the surface.
*
* If the client is drawing its own cursor, it should update the
* position hint to the position of its own cursor. A compositor
* may use this information to warp the pointer upon unlock in
* order to avoid pointer jumps.
*
* The cursor position hint is double buffered. The new hint will
* only take effect when the associated surface gets it pending
* state applied. See wl_surface.commit for details.
* @param surface_x surface-local x coordinate
* @param surface_y surface-local y coordinate
*/
void (*set_cursor_position_hint)(struct wl_client *client,
struct wl_resource *resource,
wl_fixed_t surface_x,
wl_fixed_t surface_y);
/**
* set a new lock region
*
* Set a new region used to lock the pointer.
*
* The new lock region is double-buffered. The new lock region will
* only take effect when the associated surface gets its pending
* state applied. See wl_surface.commit for details.
*
* For details about the lock region, see wp_locked_pointer.
* @param region region of surface
*/
void (*set_region)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *region);
@@ -486,84 +170,28 @@ struct zwp_locked_pointer_v1_interface {
#define ZWP_LOCKED_POINTER_V1_LOCKED 0
#define ZWP_LOCKED_POINTER_V1_UNLOCKED 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_LOCKED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_UNLOCKED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_SET_CURSOR_POSITION_HINT_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
*/
#define ZWP_LOCKED_POINTER_V1_SET_REGION_SINCE_VERSION 1
/**
* @ingroup iface_zwp_locked_pointer_v1
* Sends an locked event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_locked_pointer_v1_send_locked(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LOCKED_POINTER_V1_LOCKED);
}
/**
* @ingroup iface_zwp_locked_pointer_v1
* Sends an unlocked event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_locked_pointer_v1_send_unlocked(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_LOCKED_POINTER_V1_UNLOCKED);
}
/**
* @ingroup iface_zwp_confined_pointer_v1
* @struct zwp_confined_pointer_v1_interface
*/
struct zwp_confined_pointer_v1_interface {
/**
* destroy the confined pointer object
*
* Destroy the confined pointer object. If applicable, the
* compositor will unconfine the pointer.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set a new confine region
*
* Set a new region used to confine the pointer.
*
* The new confine region is double-buffered. The new confine
* region will only take effect when the associated surface gets
* its pending state applied. See wl_surface.commit for details.
*
* If the confinement is active when the new confinement region is
* applied and the pointer ends up outside of newly applied region,
* the pointer may warped to a position within the new confinement
* region. If warped, a wl_pointer.motion event will be emitted,
* but no wp_relative_pointer.relative_motion event.
*
* The compositor may also, instead of using the new region,
* unconfine the pointer.
*
* For details about the confine region, see wp_confined_pointer.
* @param region region of surface
*/
void (*set_region)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *region);
@@ -572,40 +200,18 @@ struct zwp_confined_pointer_v1_interface {
#define ZWP_CONFINED_POINTER_V1_CONFINED 0
#define ZWP_CONFINED_POINTER_V1_UNCONFINED 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_CONFINED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_UNCONFINED_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
*/
#define ZWP_CONFINED_POINTER_V1_SET_REGION_SINCE_VERSION 1
/**
* @ingroup iface_zwp_confined_pointer_v1
* Sends an confined event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_confined_pointer_v1_send_confined(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWP_CONFINED_POINTER_V1_CONFINED);
}
/**
* @ingroup iface_zwp_confined_pointer_v1
* Sends an unconfined event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwp_confined_pointer_v1_send_unconfined(struct wl_resource *resource_)
{
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2013-2014 Collabora, Ltd.
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef PRESENTATION_TIME_SERVER_PROTOCOL_H
#define PRESENTATION_TIME_SERVER_PROTOCOL_H
@@ -14,13 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_presentation_time The presentation_time protocol
* @section page_ifaces_presentation_time Interfaces
* - @subpage page_iface_wp_presentation - timed presentation related wl_surface requests
* - @subpage page_iface_wp_presentation_feedback - presentation time feedback event
/*
* @section page_copyright_presentation_time Copyright
* <pre>
*
* Copyright © 2013-2014 Collabora, Ltd.
*
@@ -42,8 +36,13 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_output;
struct wl_surface;
struct wp_presentation;
@@ -51,131 +50,23 @@ struct wp_presentation_feedback;
#ifndef WP_PRESENTATION_INTERFACE
#define WP_PRESENTATION_INTERFACE
/**
* @page page_iface_wp_presentation wp_presentation
* @section page_iface_wp_presentation_desc Description
*
*
*
*
* The main feature of this interface is accurate presentation
* timing feedback to ensure smooth video playback while maintaining
* audio/video synchronization. Some features use the concept of a
* presentation clock, which is defined in the
* presentation.clock_id event.
*
* A content update for a wl_surface is submitted by a
* wl_surface.commit request. Request 'feedback' associates with
* the wl_surface.commit and provides feedback on the content
* update, particularly the final realized presentation time.
*
*
*
* When the final realized presentation time is available, e.g.
* after a framebuffer flip completes, the requested
* presentation_feedback.presented events are sent. The final
* presentation time can differ from the compositor's predicted
* display update time and the update's target time, especially
* when the compositor misses its target vertical blanking period.
* @section page_iface_wp_presentation_api API
* See @ref iface_wp_presentation.
*/
/**
* @defgroup iface_wp_presentation The wp_presentation interface
*
*
*
*
* The main feature of this interface is accurate presentation
* timing feedback to ensure smooth video playback while maintaining
* audio/video synchronization. Some features use the concept of a
* presentation clock, which is defined in the
* presentation.clock_id event.
*
* A content update for a wl_surface is submitted by a
* wl_surface.commit request. Request 'feedback' associates with
* the wl_surface.commit and provides feedback on the content
* update, particularly the final realized presentation time.
*
*
*
* When the final realized presentation time is available, e.g.
* after a framebuffer flip completes, the requested
* presentation_feedback.presented events are sent. The final
* presentation time can differ from the compositor's predicted
* display update time and the update's target time, especially
* when the compositor misses its target vertical blanking period.
*/
extern const struct wl_interface wp_presentation_interface;
#endif
#ifndef WP_PRESENTATION_FEEDBACK_INTERFACE
#define WP_PRESENTATION_FEEDBACK_INTERFACE
/**
* @page page_iface_wp_presentation_feedback wp_presentation_feedback
* @section page_iface_wp_presentation_feedback_desc Description
*
* A presentation_feedback object returns an indication that a
* wl_surface content update has become visible to the user.
* One object corresponds to one content update submission
* (wl_surface.commit). There are two possible outcomes: the
* content update is presented to the user, and a presentation
* timestamp delivered; or, the user did not see the content
* update because it was superseded or its surface destroyed,
* and the content update is discarded.
*
* Once a presentation_feedback object has delivered a 'presented'
* or 'discarded' event it is automatically destroyed.
* @section page_iface_wp_presentation_feedback_api API
* See @ref iface_wp_presentation_feedback.
*/
/**
* @defgroup iface_wp_presentation_feedback The wp_presentation_feedback interface
*
* A presentation_feedback object returns an indication that a
* wl_surface content update has become visible to the user.
* One object corresponds to one content update submission
* (wl_surface.commit). There are two possible outcomes: the
* content update is presented to the user, and a presentation
* timestamp delivered; or, the user did not see the content
* update because it was superseded or its surface destroyed,
* and the content update is discarded.
*
* Once a presentation_feedback object has delivered a 'presented'
* or 'discarded' event it is automatically destroyed.
*/
extern const struct wl_interface wp_presentation_feedback_interface;
#endif
#ifndef WP_PRESENTATION_ERROR_ENUM
#define WP_PRESENTATION_ERROR_ENUM
/**
* @ingroup iface_wp_presentation
* fatal presentation errors
*
* These fatal protocol errors may be emitted in response to
* illegal presentation requests.
*/
enum wp_presentation_error {
/**
* invalid value in tv_nsec
*/
WP_PRESENTATION_ERROR_INVALID_TIMESTAMP = 0,
/**
* invalid flag
*/
WP_PRESENTATION_ERROR_INVALID_FLAG = 1,
};
#endif /* WP_PRESENTATION_ERROR_ENUM */
#endif
#ifndef WP_PRESENTATION_ERROR_ENUM_IS_VALID
#define WP_PRESENTATION_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_wp_presentation
* Validate a wp_presentation error value.
*
* @return true on success, false on error.
* @ref wp_presentation_error
*/
static inline bool
wp_presentation_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -187,37 +78,11 @@ wp_presentation_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* WP_PRESENTATION_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_wp_presentation
* @struct wp_presentation_interface
*/
struct wp_presentation_interface {
/**
* unbind from the presentation interface
*
* Informs the server that the client will no longer be using
* this protocol object. Existing objects created by this object
* are not affected.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* request presentation feedback information
*
* Request presentation feedback for the current content
* submission on the given surface. This creates a new
* presentation_feedback object, which will deliver the feedback
* information once. If multiple presentation_feedback objects are
* created for the same submission, they will all deliver the same
* information.
*
* For details on what information is returned, see the
* presentation_feedback interface.
* @param surface target surface
* @param callback new feedback object
*/
void (*feedback)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *surface,
@@ -226,26 +91,11 @@ struct wp_presentation_interface {
#define WP_PRESENTATION_CLOCK_ID 0
/**
* @ingroup iface_wp_presentation
*/
#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation
*/
#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation
*/
#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation
* Sends an clock_id event to the client owning the resource.
* @param resource_ The client's resource
* @param clk_id platform clock identifier
*/
static inline void
wp_presentation_send_clock_id(struct wl_resource *resource_, uint32_t clk_id)
{
@@ -254,66 +104,16 @@ wp_presentation_send_clock_id(struct wl_resource *resource_, uint32_t clk_id)
#ifndef WP_PRESENTATION_FEEDBACK_KIND_ENUM
#define WP_PRESENTATION_FEEDBACK_KIND_ENUM
/**
* @ingroup iface_wp_presentation_feedback
* bitmask of flags in presented event
*
* These flags provide information about how the presentation of
* the related content update was done. The intent is to help
* clients assess the reliability of the feedback and the visual
* quality with respect to possible tearing and timings.
*/
enum wp_presentation_feedback_kind {
/**
* presentation was vsync'd
*
* The presentation was synchronized to the "vertical retrace" by
* the display hardware such that tearing does not happen. Relying
* on software scheduling is not acceptable for this flag. If
* presentation is done by a copy to the active frontbuffer, then
* it must guarantee that tearing cannot happen.
*/
WP_PRESENTATION_FEEDBACK_KIND_VSYNC = 0x1,
/**
* hardware provided the presentation timestamp
*
* The display hardware provided measurements that the hardware
* driver converted into a presentation timestamp. Sampling a clock
* in software is not acceptable for this flag.
*/
WP_PRESENTATION_FEEDBACK_KIND_HW_CLOCK = 0x2,
/**
* hardware signalled the start of the presentation
*
* The display hardware signalled that it started using the new
* image content. The opposite of this is e.g. a timer being used
* to guess when the display hardware has switched to the new image
* content.
*/
WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION = 0x4,
/**
* presentation was done zero-copy
*
* The presentation of this update was done zero-copy. This means
* the buffer from the client was given to display hardware as is,
* without copying it. Compositing with OpenGL counts as copying,
* even if textured directly from the client buffer. Possible
* zero-copy cases include direct scanout of a fullscreen surface
* and a surface on a hardware overlay.
*/
WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY = 0x8,
};
#endif /* WP_PRESENTATION_FEEDBACK_KIND_ENUM */
#endif
#ifndef WP_PRESENTATION_FEEDBACK_KIND_ENUM_IS_VALID
#define WP_PRESENTATION_FEEDBACK_KIND_ENUM_IS_VALID
/**
* @ingroup iface_wp_presentation_feedback
* Validate a wp_presentation_feedback kind value.
*
* @return true on success, false on error.
* @ref wp_presentation_feedback_kind
*/
static inline bool
wp_presentation_feedback_kind_is_valid(uint32_t value, uint32_t version) {
uint32_t valid = 0;
@@ -327,61 +127,29 @@ wp_presentation_feedback_kind_is_valid(uint32_t value, uint32_t version) {
valid |= WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
return (value & ~valid) == 0;
}
#endif /* WP_PRESENTATION_FEEDBACK_KIND_ENUM_IS_VALID */
#endif
#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT 0
#define WP_PRESENTATION_FEEDBACK_PRESENTED 1
#define WP_PRESENTATION_FEEDBACK_DISCARDED 2
/**
* @ingroup iface_wp_presentation_feedback
*/
#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation_feedback
*/
#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation_feedback
*/
#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1
/**
* @ingroup iface_wp_presentation_feedback
* Sends an sync_output event to the client owning the resource.
* @param resource_ The client's resource
* @param output presentation output
*/
static inline void
wp_presentation_feedback_send_sync_output(struct wl_resource *resource_, struct wl_resource *output)
{
wl_resource_post_event(resource_, WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT, output);
}
/**
* @ingroup iface_wp_presentation_feedback
* Sends an presented event to the client owning the resource.
* @param resource_ The client's resource
* @param tv_sec_hi high 32 bits of the seconds part of the presentation timestamp
* @param tv_sec_lo low 32 bits of the seconds part of the presentation timestamp
* @param tv_nsec nanoseconds part of the presentation timestamp
* @param refresh nanoseconds till next refresh
* @param seq_hi high 32 bits of refresh counter
* @param seq_lo low 32 bits of refresh counter
* @param flags combination of 'kind' values
*/
static inline void
wp_presentation_feedback_send_presented(struct wl_resource *resource_, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh, uint32_t seq_hi, uint32_t seq_lo, uint32_t flags)
{
wl_resource_post_event(resource_, WP_PRESENTATION_FEEDBACK_PRESENTED, tv_sec_hi, tv_sec_lo, tv_nsec, refresh, seq_hi, seq_lo, flags);
}
/**
* @ingroup iface_wp_presentation_feedback
* Sends an discarded event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
wp_presentation_feedback_send_discarded(struct wl_resource *resource_)
{
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2014 Jonas Ådahl
* Copyright © 2015 Red Hat Inc.
@@ -30,7 +28,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef RELATIVE_POINTER_UNSTABLE_V1_SERVER_PROTOCOL_H
#define RELATIVE_POINTER_UNSTABLE_V1_SERVER_PROTOCOL_H
@@ -14,40 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_relative_pointer_unstable_v1 The relative_pointer_unstable_v1 protocol
* protocol for relative pointer motion events
*
* @section page_desc_relative_pointer_unstable_v1 Description
*
* This protocol specifies a set of interfaces used for making clients able to
* receive relative pointer events not obstructed by barriers (such as the
* monitor edge or other pointer barriers).
*
* To start receiving relative pointer events, a client must first bind the
* global interface "wp_relative_pointer_manager" which, if a compositor
* supports relative pointer motion events, is exposed by the registry. After
* having created the relative pointer manager proxy object, the client uses
* it to create the actual relative pointer object using the
* "get_relative_pointer" request given a wl_pointer. The relative pointer
* motion events will then, when applicable, be transmitted via the proxy of
* the newly created relative pointer object. See the documentation of the
* relative pointer interface for more details.
*
* Warning! The protocol described in this file is experimental and backward
* incompatible changes may be made. Backward compatible changes may be added
* together with the corresponding interface version bump. Backward
* incompatible changes are done by bumping the version number in the protocol
* and interface names and resetting the interface version. Once the protocol
* is to be declared stable, the 'z' prefix and the version number in the
* protocol and interface names are removed and the interface version number is
* reset.
*
* @section page_ifaces_relative_pointer_unstable_v1 Interfaces
* - @subpage page_iface_zwp_relative_pointer_manager_v1 - get relative pointer objects
* - @subpage page_iface_zwp_relative_pointer_v1 - relative pointer object
/*
* @section page_copyright_relative_pointer_unstable_v1 Copyright
* <pre>
*
* Copyright © 2014 Jonas Ådahl
* Copyright © 2015 Red Hat Inc.
@@ -70,74 +37,56 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_pointer;
struct zwp_relative_pointer_manager_v1;
struct zwp_relative_pointer_v1;
#ifndef ZWP_RELATIVE_POINTER_MANAGER_V1_INTERFACE
#define ZWP_RELATIVE_POINTER_MANAGER_V1_INTERFACE
/**
* @page page_iface_zwp_relative_pointer_manager_v1 zwp_relative_pointer_manager_v1
* @section page_iface_zwp_relative_pointer_manager_v1_desc Description
*
* A global interface used for getting the relative pointer object for a
* given pointer.
* @section page_iface_zwp_relative_pointer_manager_v1_api API
* See @ref iface_zwp_relative_pointer_manager_v1.
*/
/**
* @defgroup iface_zwp_relative_pointer_manager_v1 The zwp_relative_pointer_manager_v1 interface
*
* A global interface used for getting the relative pointer object for a
* given pointer.
*/
extern const struct wl_interface zwp_relative_pointer_manager_v1_interface;
#endif
#ifndef ZWP_RELATIVE_POINTER_V1_INTERFACE
#define ZWP_RELATIVE_POINTER_V1_INTERFACE
/**
* @page page_iface_zwp_relative_pointer_v1 zwp_relative_pointer_v1
* @section page_iface_zwp_relative_pointer_v1_desc Description
*
* A wp_relative_pointer object is an extension to the wl_pointer interface
* used for emitting relative pointer events. It shares the same focus as
* wl_pointer objects of the same seat and will only emit events when it has
* focus.
* @section page_iface_zwp_relative_pointer_v1_api API
* See @ref iface_zwp_relative_pointer_v1.
*/
/**
* @defgroup iface_zwp_relative_pointer_v1 The zwp_relative_pointer_v1 interface
*
* A wp_relative_pointer object is an extension to the wl_pointer interface
* used for emitting relative pointer events. It shares the same focus as
* wl_pointer objects of the same seat and will only emit events when it has
* focus.
*/
extern const struct wl_interface zwp_relative_pointer_v1_interface;
#endif
/**
* @ingroup iface_zwp_relative_pointer_manager_v1
* @struct zwp_relative_pointer_manager_v1_interface
*/
struct zwp_relative_pointer_manager_v1_interface {
/**
* destroy the relative pointer manager object
*
* Used by the client to notify the server that it will no longer
* use this relative pointer manager object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* get a relative pointer object
*
* Create a relative pointer interface given a wl_pointer object.
* See the wp_relative_pointer interface for more details.
*/
void (*get_relative_pointer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -145,52 +94,20 @@ struct zwp_relative_pointer_manager_v1_interface {
};
/**
* @ingroup iface_zwp_relative_pointer_manager_v1
*/
#define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_relative_pointer_manager_v1
*/
#define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER_SINCE_VERSION 1
/**
* @ingroup iface_zwp_relative_pointer_v1
* @struct zwp_relative_pointer_v1_interface
*/
struct zwp_relative_pointer_v1_interface {
/**
* release the relative pointer object
*
*
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define ZWP_RELATIVE_POINTER_V1_RELATIVE_MOTION 0
/**
* @ingroup iface_zwp_relative_pointer_v1
*/
#define ZWP_RELATIVE_POINTER_V1_RELATIVE_MOTION_SINCE_VERSION 1
/**
* @ingroup iface_zwp_relative_pointer_v1
*/
#define ZWP_RELATIVE_POINTER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwp_relative_pointer_v1
* Sends an relative_motion event to the client owning the resource.
* @param resource_ The client's resource
* @param utime_hi high 32 bits of a 64 bit timestamp with microsecond granularity
* @param utime_lo low 32 bits of a 64 bit timestamp with microsecond granularity
* @param dx the x component of the motion vector
* @param dy the y component of the motion vector
* @param dx_unaccel the x component of the unaccelerated motion vector
* @param dy_unaccel the y component of the unaccelerated motion vector
*/
static inline void
zwp_relative_pointer_v1_send_relative_motion(struct wl_resource *resource_, uint32_t utime_hi, uint32_t utime_lo, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t dx_unaccel, wl_fixed_t dy_unaccel)
{
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.26.0 */
/*
* Copyright © 2022 Simon Ser
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.26.0 */
#ifndef SINGLE_PIXEL_BUFFER_V1_SERVER_PROTOCOL_H
#define SINGLE_PIXEL_BUFFER_V1_SERVER_PROTOCOL_H
@@ -14,27 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_single_pixel_buffer_v1 The single_pixel_buffer_v1 protocol
* single pixel buffer factory
*
* @section page_desc_single_pixel_buffer_v1 Description
*
* This protocol extension allows clients to create single-pixel buffers.
*
* Compositors supporting this protocol extension should also support the
* viewporter protocol extension. Clients may use viewporter to scale a
* single-pixel buffer to a desired size.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_single_pixel_buffer_v1 Interfaces
* - @subpage page_iface_wp_single_pixel_buffer_manager_v1 - global factory for single-pixel buffers
/*
* @section page_copyright_single_pixel_buffer_v1 Copyright
* <pre>
*
* Copyright © 2022 Simon Ser
*
@@ -56,66 +36,38 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_buffer;
struct wp_single_pixel_buffer_manager_v1;
#ifndef WP_SINGLE_PIXEL_BUFFER_MANAGER_V1_INTERFACE
#define WP_SINGLE_PIXEL_BUFFER_MANAGER_V1_INTERFACE
/**
* @page page_iface_wp_single_pixel_buffer_manager_v1 wp_single_pixel_buffer_manager_v1
* @section page_iface_wp_single_pixel_buffer_manager_v1_desc Description
*
* The wp_single_pixel_buffer_manager_v1 interface is a factory for
* single-pixel buffers.
* @section page_iface_wp_single_pixel_buffer_manager_v1_api API
* See @ref iface_wp_single_pixel_buffer_manager_v1.
*/
/**
* @defgroup iface_wp_single_pixel_buffer_manager_v1 The wp_single_pixel_buffer_manager_v1 interface
*
* The wp_single_pixel_buffer_manager_v1 interface is a factory for
* single-pixel buffers.
*/
extern const struct wl_interface wp_single_pixel_buffer_manager_v1_interface;
#endif
/**
* @ingroup iface_wp_single_pixel_buffer_manager_v1
* @struct wp_single_pixel_buffer_manager_v1_interface
*/
struct wp_single_pixel_buffer_manager_v1_interface {
/**
* destroy the manager
*
* Destroy the wp_single_pixel_buffer_manager_v1 object.
*
* The child objects created via this interface are unaffected.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* create a 1×1 buffer from 32-bit RGBA values
*
* Create a single-pixel buffer from four 32-bit RGBA values.
*
* Unless specified in another protocol extension, the RGBA values
* use pre-multiplied alpha.
*
* The width and height of the buffer are 1.
*
* The r, g, b and a arguments valid range is from UINT32_MIN (0)
* to UINT32_MAX (0xffffffff).
*
* These arguments should be interpreted as a percentage, i.e. -
* UINT32_MIN = 0% of the given color component - UINT32_MAX = 100%
* of the given color component
* @param r value of the buffer's red channel
* @param g value of the buffer's green channel
* @param b value of the buffer's blue channel
* @param a value of the buffer's alpha channel
*/
void (*create_u32_rgba_buffer)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -126,13 +78,7 @@ struct wp_single_pixel_buffer_manager_v1_interface {
};
/**
* @ingroup iface_wp_single_pixel_buffer_manager_v1
*/
#define WP_SINGLE_PIXEL_BUFFER_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_single_pixel_buffer_manager_v1
*/
#define WP_SINGLE_PIXEL_BUFFER_MANAGER_V1_CREATE_U32_RGBA_BUFFER_SINCE_VERSION 1
#ifdef __cplusplus
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2012, 2013 Intel Corporation
* Copyright © 2015, 2016 Jan Arne Petersen
@@ -34,7 +32,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2013-2016 Collabora, Ltd.
*
@@ -29,7 +27,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef VIEWPORTER_SERVER_PROTOCOL_H
#define VIEWPORTER_SERVER_PROTOCOL_H
@@ -14,13 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_viewporter The viewporter protocol
* @section page_ifaces_viewporter Interfaces
* - @subpage page_iface_wp_viewporter - surface cropping and scaling
* - @subpage page_iface_wp_viewport - crop and scale interface to a wl_surface
/*
* @section page_copyright_viewporter Copyright
* <pre>
*
* Copyright © 2013-2016 Collabora, Ltd.
*
@@ -42,184 +36,35 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_surface;
struct wp_viewport;
struct wp_viewporter;
#ifndef WP_VIEWPORTER_INTERFACE
#define WP_VIEWPORTER_INTERFACE
/**
* @page page_iface_wp_viewporter wp_viewporter
* @section page_iface_wp_viewporter_desc Description
*
* The global interface exposing surface cropping and scaling
* capabilities is used to instantiate an interface extension for a
* wl_surface object. This extended interface will then allow
* cropping and scaling the surface contents, effectively
* disconnecting the direct relationship between the buffer and the
* surface size.
* @section page_iface_wp_viewporter_api API
* See @ref iface_wp_viewporter.
*/
/**
* @defgroup iface_wp_viewporter The wp_viewporter interface
*
* The global interface exposing surface cropping and scaling
* capabilities is used to instantiate an interface extension for a
* wl_surface object. This extended interface will then allow
* cropping and scaling the surface contents, effectively
* disconnecting the direct relationship between the buffer and the
* surface size.
*/
extern const struct wl_interface wp_viewporter_interface;
#endif
#ifndef WP_VIEWPORT_INTERFACE
#define WP_VIEWPORT_INTERFACE
/**
* @page page_iface_wp_viewport wp_viewport
* @section page_iface_wp_viewport_desc Description
*
* An additional interface to a wl_surface object, which allows the
* client to specify the cropping and scaling of the surface
* contents.
*
* This interface works with two concepts: the source rectangle (src_x,
* src_y, src_width, src_height), and the destination size (dst_width,
* dst_height). The contents of the source rectangle are scaled to the
* destination size, and content outside the source rectangle is ignored.
* This state is double-buffered, and is applied on the next
* wl_surface.commit.
*
* The two parts of crop and scale state are independent: the source
* rectangle, and the destination size. Initially both are unset, that
* is, no scaling is applied. The whole of the current wl_buffer is
* used as the source, and the surface size is as defined in
* wl_surface.attach.
*
* If the destination size is set, it causes the surface size to become
* dst_width, dst_height. The source (rectangle) is scaled to exactly
* this size. This overrides whatever the attached wl_buffer size is,
* unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
* has no content and therefore no size. Otherwise, the size is always
* at least 1x1 in surface local coordinates.
*
* If the source rectangle is set, it defines what area of the wl_buffer is
* taken as the source. If the source rectangle is set and the destination
* size is not set, then src_width and src_height must be integers, and the
* surface size becomes the source rectangle size. This results in cropping
* without scaling. If src_width or src_height are not integers and
* destination size is not set, the bad_size protocol error is raised when
* the surface state is applied.
*
* The coordinate transformations from buffer pixel coordinates up to
* the surface-local coordinates happen in the following order:
* 1. buffer_transform (wl_surface.set_buffer_transform)
* 2. buffer_scale (wl_surface.set_buffer_scale)
* 3. crop and scale (wp_viewport.set*)
* This means, that the source rectangle coordinates of crop and scale
* are given in the coordinates after the buffer transform and scale,
* i.e. in the coordinates that would be the surface-local coordinates
* if the crop and scale was not applied.
*
* If src_x or src_y are negative, the bad_value protocol error is raised.
* Otherwise, if the source rectangle is partially or completely outside of
* the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
* when the surface state is applied. A NULL wl_buffer does not raise the
* out_of_buffer error.
*
* If the wl_surface associated with the wp_viewport is destroyed,
* all wp_viewport requests except 'destroy' raise the protocol error
* no_surface.
*
* If the wp_viewport object is destroyed, the crop and scale
* state is removed from the wl_surface. The change will be applied
* on the next wl_surface.commit.
* @section page_iface_wp_viewport_api API
* See @ref iface_wp_viewport.
*/
/**
* @defgroup iface_wp_viewport The wp_viewport interface
*
* An additional interface to a wl_surface object, which allows the
* client to specify the cropping and scaling of the surface
* contents.
*
* This interface works with two concepts: the source rectangle (src_x,
* src_y, src_width, src_height), and the destination size (dst_width,
* dst_height). The contents of the source rectangle are scaled to the
* destination size, and content outside the source rectangle is ignored.
* This state is double-buffered, and is applied on the next
* wl_surface.commit.
*
* The two parts of crop and scale state are independent: the source
* rectangle, and the destination size. Initially both are unset, that
* is, no scaling is applied. The whole of the current wl_buffer is
* used as the source, and the surface size is as defined in
* wl_surface.attach.
*
* If the destination size is set, it causes the surface size to become
* dst_width, dst_height. The source (rectangle) is scaled to exactly
* this size. This overrides whatever the attached wl_buffer size is,
* unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
* has no content and therefore no size. Otherwise, the size is always
* at least 1x1 in surface local coordinates.
*
* If the source rectangle is set, it defines what area of the wl_buffer is
* taken as the source. If the source rectangle is set and the destination
* size is not set, then src_width and src_height must be integers, and the
* surface size becomes the source rectangle size. This results in cropping
* without scaling. If src_width or src_height are not integers and
* destination size is not set, the bad_size protocol error is raised when
* the surface state is applied.
*
* The coordinate transformations from buffer pixel coordinates up to
* the surface-local coordinates happen in the following order:
* 1. buffer_transform (wl_surface.set_buffer_transform)
* 2. buffer_scale (wl_surface.set_buffer_scale)
* 3. crop and scale (wp_viewport.set*)
* This means, that the source rectangle coordinates of crop and scale
* are given in the coordinates after the buffer transform and scale,
* i.e. in the coordinates that would be the surface-local coordinates
* if the crop and scale was not applied.
*
* If src_x or src_y are negative, the bad_value protocol error is raised.
* Otherwise, if the source rectangle is partially or completely outside of
* the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
* when the surface state is applied. A NULL wl_buffer does not raise the
* out_of_buffer error.
*
* If the wl_surface associated with the wp_viewport is destroyed,
* all wp_viewport requests except 'destroy' raise the protocol error
* no_surface.
*
* If the wp_viewport object is destroyed, the crop and scale
* state is removed from the wl_surface. The change will be applied
* on the next wl_surface.commit.
*/
extern const struct wl_interface wp_viewport_interface;
#endif
#ifndef WP_VIEWPORTER_ERROR_ENUM
#define WP_VIEWPORTER_ERROR_ENUM
enum wp_viewporter_error {
/**
* the surface already has a viewport object associated
*/
WP_VIEWPORTER_ERROR_VIEWPORT_EXISTS = 0,
};
#endif /* WP_VIEWPORTER_ERROR_ENUM */
#endif
#ifndef WP_VIEWPORTER_ERROR_ENUM_IS_VALID
#define WP_VIEWPORTER_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_wp_viewporter
* Validate a wp_viewporter error value.
*
* @return true on success, false on error.
* @ref wp_viewporter_error
*/
static inline bool
wp_viewporter_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -229,32 +74,11 @@ wp_viewporter_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* WP_VIEWPORTER_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_wp_viewporter
* @struct wp_viewporter_interface
*/
struct wp_viewporter_interface {
/**
* unbind from the cropping and scaling interface
*
* Informs the server that the client will not be using this
* protocol object anymore. This does not affect any other objects,
* wp_viewport objects included.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* extend surface interface for crop and scale
*
* Instantiate an interface extension for the given wl_surface to
* crop and scale its content. If the given wl_surface already has
* a wp_viewport object associated, the viewport_exists protocol
* error is raised.
* @param id the new viewport interface id
* @param surface the surface
*/
void (*get_viewport)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
@@ -262,46 +86,21 @@ struct wp_viewporter_interface {
};
/**
* @ingroup iface_wp_viewporter
*/
#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewporter
*/
#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1
#ifndef WP_VIEWPORT_ERROR_ENUM
#define WP_VIEWPORT_ERROR_ENUM
enum wp_viewport_error {
/**
* negative or zero values in width or height
*/
WP_VIEWPORT_ERROR_BAD_VALUE = 0,
/**
* destination size is not integer
*/
WP_VIEWPORT_ERROR_BAD_SIZE = 1,
/**
* source rectangle extends outside of the content area
*/
WP_VIEWPORT_ERROR_OUT_OF_BUFFER = 2,
/**
* the wl_surface was destroyed
*/
WP_VIEWPORT_ERROR_NO_SURFACE = 3,
};
#endif /* WP_VIEWPORT_ERROR_ENUM */
#endif
#ifndef WP_VIEWPORT_ERROR_ENUM_IS_VALID
#define WP_VIEWPORT_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_wp_viewport
* Validate a wp_viewport error value.
*
* @return true on success, false on error.
* @ref wp_viewport_error
*/
static inline bool
wp_viewport_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -317,63 +116,17 @@ wp_viewport_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* WP_VIEWPORT_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_wp_viewport
* @struct wp_viewport_interface
*/
struct wp_viewport_interface {
/**
* remove scaling and cropping from the surface
*
* The associated wl_surface's crop and scale state is removed.
* The change is applied on the next wl_surface.commit.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set the source rectangle for cropping
*
* Set the source rectangle of the associated wl_surface. See
* wp_viewport for the description, and relation to the wl_buffer
* size.
*
* If all of x, y, width and height are -1.0, the source rectangle
* is unset instead. Any other set of values where width or height
* are zero or negative, or x or y are negative, raise the
* bad_value protocol error.
*
* The crop and scale state is double-buffered state, and will be
* applied on the next wl_surface.commit.
* @param x source rectangle x
* @param y source rectangle y
* @param width source rectangle width
* @param height source rectangle height
*/
void (*set_source)(struct wl_client *client,
struct wl_resource *resource,
wl_fixed_t x,
wl_fixed_t y,
wl_fixed_t width,
wl_fixed_t height);
/**
* set the surface size for scaling
*
* Set the destination size of the associated wl_surface. See
* wp_viewport for the description, and relation to the wl_buffer
* size.
*
* If width is -1 and height is -1, the destination size is unset
* instead. Any other pair of values for width and height that
* contains zero or negative values raises the bad_value protocol
* error.
*
* The crop and scale state is double-buffered state, and will be
* applied on the next wl_surface.commit.
* @param width surface width
* @param height surface height
*/
void (*set_destination)(struct wl_client *client,
struct wl_resource *resource,
int32_t width,
@@ -381,17 +134,8 @@ struct wp_viewport_interface {
};
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1
/**
* @ingroup iface_wp_viewport
*/
#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1
#ifdef __cplusplus
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2018 Simon Ser
* Copyright © 2019 Ivan Molodetskikh
@@ -32,7 +30,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef WLR_DATA_CONTROL_UNSTABLE_V1_SERVER_PROTOCOL_H
#define WLR_DATA_CONTROL_UNSTABLE_V1_SERVER_PROTOCOL_H
@@ -14,35 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_wlr_data_control_unstable_v1 The wlr_data_control_unstable_v1 protocol
* control data devices
*
* @section page_desc_wlr_data_control_unstable_v1 Description
*
* This protocol allows a privileged client to control data devices. In
* particular, the client will be able to manage the current selection and take
* the role of a clipboard manager.
*
* Warning! The protocol described in this file is experimental and
* backward incompatible changes may be made. Backward compatible changes
* may be added together with the corresponding interface version bump.
* Backward incompatible changes are done by bumping the version number in
* the protocol and interface names and resetting the interface version.
* Once the protocol is to be declared stable, the 'z' prefix and the
* version number in the protocol and interface names are removed and the
* interface version number is reset.
*
* Note! This protocol is deprecated and not intended for production use.
* For clipboard management, use the ext-data-control-v1 protocol.
*
* @section page_ifaces_wlr_data_control_unstable_v1 Interfaces
* - @subpage page_iface_zwlr_data_control_manager_v1 - manager to control data devices
* - @subpage page_iface_zwlr_data_control_device_v1 - manage a data device for a seat
* - @subpage page_iface_zwlr_data_control_source_v1 - offer to transfer data
* - @subpage page_iface_zwlr_data_control_offer_v1 - offer to transfer data
/*
* @section page_copyright_wlr_data_control_unstable_v1 Copyright
* <pre>
*
* Copyright © 2018 Simon Ser
* Copyright © 2019 Ivan Molodetskikh
@@ -67,8 +39,35 @@ struct wl_resource;
* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
* THIS SOFTWARE.
* </pre>
*/
struct wl_seat;
struct zwlr_data_control_device_v1;
struct zwlr_data_control_manager_v1;
@@ -77,158 +76,47 @@ struct zwlr_data_control_source_v1;
#ifndef ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
#define ZWLR_DATA_CONTROL_MANAGER_V1_INTERFACE
/**
* @page page_iface_zwlr_data_control_manager_v1 zwlr_data_control_manager_v1
* @section page_iface_zwlr_data_control_manager_v1_desc Description
*
* This interface is a manager that allows creating per-seat data device
* controls.
* @section page_iface_zwlr_data_control_manager_v1_api API
* See @ref iface_zwlr_data_control_manager_v1.
*/
/**
* @defgroup iface_zwlr_data_control_manager_v1 The zwlr_data_control_manager_v1 interface
*
* This interface is a manager that allows creating per-seat data device
* controls.
*/
extern const struct wl_interface zwlr_data_control_manager_v1_interface;
#endif
#ifndef ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
#define ZWLR_DATA_CONTROL_DEVICE_V1_INTERFACE
/**
* @page page_iface_zwlr_data_control_device_v1 zwlr_data_control_device_v1
* @section page_iface_zwlr_data_control_device_v1_desc Description
*
* This interface allows a client to manage a seat's selection.
*
* When the seat is destroyed, this object becomes inert.
* @section page_iface_zwlr_data_control_device_v1_api API
* See @ref iface_zwlr_data_control_device_v1.
*/
/**
* @defgroup iface_zwlr_data_control_device_v1 The zwlr_data_control_device_v1 interface
*
* This interface allows a client to manage a seat's selection.
*
* When the seat is destroyed, this object becomes inert.
*/
extern const struct wl_interface zwlr_data_control_device_v1_interface;
#endif
#ifndef ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
#define ZWLR_DATA_CONTROL_SOURCE_V1_INTERFACE
/**
* @page page_iface_zwlr_data_control_source_v1 zwlr_data_control_source_v1
* @section page_iface_zwlr_data_control_source_v1_desc Description
*
* The wlr_data_control_source object is the source side of a
* wlr_data_control_offer. It is created by the source client in a data
* transfer and provides a way to describe the offered data and a way to
* respond to requests to transfer the data.
* @section page_iface_zwlr_data_control_source_v1_api API
* See @ref iface_zwlr_data_control_source_v1.
*/
/**
* @defgroup iface_zwlr_data_control_source_v1 The zwlr_data_control_source_v1 interface
*
* The wlr_data_control_source object is the source side of a
* wlr_data_control_offer. It is created by the source client in a data
* transfer and provides a way to describe the offered data and a way to
* respond to requests to transfer the data.
*/
extern const struct wl_interface zwlr_data_control_source_v1_interface;
#endif
#ifndef ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
#define ZWLR_DATA_CONTROL_OFFER_V1_INTERFACE
/**
* @page page_iface_zwlr_data_control_offer_v1 zwlr_data_control_offer_v1
* @section page_iface_zwlr_data_control_offer_v1_desc Description
*
* A wlr_data_control_offer represents a piece of data offered for transfer
* by another client (the source client). The offer describes the different
* MIME types that the data can be converted to and provides the mechanism
* for transferring the data directly from the source client.
* @section page_iface_zwlr_data_control_offer_v1_api API
* See @ref iface_zwlr_data_control_offer_v1.
*/
/**
* @defgroup iface_zwlr_data_control_offer_v1 The zwlr_data_control_offer_v1 interface
*
* A wlr_data_control_offer represents a piece of data offered for transfer
* by another client (the source client). The offer describes the different
* MIME types that the data can be converted to and provides the mechanism
* for transferring the data directly from the source client.
*/
extern const struct wl_interface zwlr_data_control_offer_v1_interface;
#endif
/**
* @ingroup iface_zwlr_data_control_manager_v1
* @struct zwlr_data_control_manager_v1_interface
*/
struct zwlr_data_control_manager_v1_interface {
/**
* create a new data source
*
* Create a new data source.
* @param id data source to create
*/
void (*create_data_source)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id);
/**
* get a data device for a seat
*
* Create a data device that can be used to manage a seat's
* selection.
*/
void (*get_data_device)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id,
struct wl_resource *seat);
/**
* destroy the manager
*
* All objects created by the manager will still remain valid,
* until their appropriate destroy request has been called.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
/**
* @ingroup iface_zwlr_data_control_manager_v1
*/
#define ZWLR_DATA_CONTROL_MANAGER_V1_CREATE_DATA_SOURCE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_manager_v1
*/
#define ZWLR_DATA_CONTROL_MANAGER_V1_GET_DATA_DEVICE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_manager_v1
*/
#define ZWLR_DATA_CONTROL_MANAGER_V1_DESTROY_SINCE_VERSION 1
#ifndef ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
#define ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM
enum zwlr_data_control_device_v1_error {
/**
* source given to set_selection or set_primary_selection was already used before
*/
ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_USED_SOURCE = 1,
};
#endif /* ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM */
#endif
#ifndef ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM_IS_VALID
#define ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_data_control_device_v1
* Validate a zwlr_data_control_device_v1 error value.
*
* @return true on success, false on error.
* @ref zwlr_data_control_device_v1_error
*/
static inline bool
zwlr_data_control_device_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -238,51 +126,14 @@ zwlr_data_control_device_v1_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* ZWLR_DATA_CONTROL_DEVICE_V1_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_zwlr_data_control_device_v1
* @struct zwlr_data_control_device_v1_interface
*/
struct zwlr_data_control_device_v1_interface {
/**
* copy data to the selection
*
* This request asks the compositor to set the selection to the
* data from the source on behalf of the client.
*
* The given source may not be used in any further set_selection or
* set_primary_selection requests. Attempting to use a previously
* used source is a protocol error.
*
* To unset the selection, set the source to NULL.
*/
void (*set_selection)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *source);
/**
* destroy this data device
*
* Destroys the data device object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* copy data to the primary selection
*
* This request asks the compositor to set the primary selection
* to the data from the source on behalf of the client.
*
* The given source may not be used in any further set_selection or
* set_primary_selection requests. Attempting to use a previously
* used source is a protocol error.
*
* To unset the primary selection, set the source to NULL.
*
* The compositor will ignore this request if it does not support
* primary selection.
* @since 2
*/
void (*set_primary_selection)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *source);
@@ -293,74 +144,33 @@ struct zwlr_data_control_device_v1_interface {
#define ZWLR_DATA_CONTROL_DEVICE_V1_FINISHED 2
#define ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION 3
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_DATA_OFFER_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_SELECTION_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_FINISHED_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_PRIMARY_SELECTION_SINCE_VERSION 2
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_SELECTION_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_device_v1
*/
#define ZWLR_DATA_CONTROL_DEVICE_V1_SET_PRIMARY_SELECTION_SINCE_VERSION 2
/**
* @ingroup iface_zwlr_data_control_device_v1
* Sends an data_offer event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_data_control_device_v1_send_data_offer(struct wl_resource *resource_, struct wl_resource *id)
{
wl_resource_post_event(resource_, ZWLR_DATA_CONTROL_DEVICE_V1_DATA_OFFER, id);
}
/**
* @ingroup iface_zwlr_data_control_device_v1
* Sends an selection event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_data_control_device_v1_send_selection(struct wl_resource *resource_, struct wl_resource *id)
{
wl_resource_post_event(resource_, ZWLR_DATA_CONTROL_DEVICE_V1_SELECTION, id);
}
/**
* @ingroup iface_zwlr_data_control_device_v1
* Sends an finished event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_data_control_device_v1_send_finished(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWLR_DATA_CONTROL_DEVICE_V1_FINISHED);
}
/**
* @ingroup iface_zwlr_data_control_device_v1
* Sends an primary_selection event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_data_control_device_v1_send_primary_selection(struct wl_resource *resource_, struct wl_resource *id)
{
@@ -370,22 +180,12 @@ zwlr_data_control_device_v1_send_primary_selection(struct wl_resource *resource_
#ifndef ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
#define ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM
enum zwlr_data_control_source_v1_error {
/**
* offer sent after wlr_data_control_device.set_selection
*/
ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_INVALID_OFFER = 1,
};
#endif /* ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM */
#endif
#ifndef ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM_IS_VALID
#define ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_zwlr_data_control_source_v1
* Validate a zwlr_data_control_source_v1 error value.
*
* @return true on success, false on error.
* @ref zwlr_data_control_source_v1_error
*/
static inline bool
zwlr_data_control_source_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -395,32 +195,12 @@ zwlr_data_control_source_v1_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* ZWLR_DATA_CONTROL_SOURCE_V1_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_zwlr_data_control_source_v1
* @struct zwlr_data_control_source_v1_interface
*/
struct zwlr_data_control_source_v1_interface {
/**
* add an offered MIME type
*
* This request adds a MIME type to the set of MIME types
* advertised to targets. Can be called several times to offer
* multiple types.
*
* Calling this after wlr_data_control_device.set_selection is a
* protocol error.
* @param mime_type MIME type offered by the data source
*/
void (*offer)(struct wl_client *client,
struct wl_resource *resource,
const char *mime_type);
/**
* destroy this source
*
* Destroys the data source object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
@@ -428,106 +208,40 @@ struct zwlr_data_control_source_v1_interface {
#define ZWLR_DATA_CONTROL_SOURCE_V1_SEND 0
#define ZWLR_DATA_CONTROL_SOURCE_V1_CANCELLED 1
/**
* @ingroup iface_zwlr_data_control_source_v1
*/
#define ZWLR_DATA_CONTROL_SOURCE_V1_SEND_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_source_v1
*/
#define ZWLR_DATA_CONTROL_SOURCE_V1_CANCELLED_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_source_v1
*/
#define ZWLR_DATA_CONTROL_SOURCE_V1_OFFER_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_source_v1
*/
#define ZWLR_DATA_CONTROL_SOURCE_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_source_v1
* Sends an send event to the client owning the resource.
* @param resource_ The client's resource
* @param mime_type MIME type for the data
* @param fd file descriptor for the data
*/
static inline void
zwlr_data_control_source_v1_send_send(struct wl_resource *resource_, const char *mime_type, int32_t fd)
{
wl_resource_post_event(resource_, ZWLR_DATA_CONTROL_SOURCE_V1_SEND, mime_type, fd);
}
/**
* @ingroup iface_zwlr_data_control_source_v1
* Sends an cancelled event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
zwlr_data_control_source_v1_send_cancelled(struct wl_resource *resource_)
{
wl_resource_post_event(resource_, ZWLR_DATA_CONTROL_SOURCE_V1_CANCELLED);
}
/**
* @ingroup iface_zwlr_data_control_offer_v1
* @struct zwlr_data_control_offer_v1_interface
*/
struct zwlr_data_control_offer_v1_interface {
/**
* request that the data is transferred
*
* To transfer the offered data, the client issues this request
* and indicates the MIME type it wants to receive. The transfer
* happens through the passed file descriptor (typically created
* with the pipe system call). The source client writes the data in
* the MIME type representation requested and then closes the file
* descriptor.
*
* The receiving client reads from the read end of the pipe until
* EOF and then closes its end, at which point the transfer is
* complete.
*
* This request may happen multiple times for different MIME types.
* @param mime_type MIME type desired by receiver
* @param fd file descriptor for data transfer
*/
void (*receive)(struct wl_client *client,
struct wl_resource *resource,
const char *mime_type,
int32_t fd);
/**
* destroy this offer
*
* Destroys the data offer object.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
};
#define ZWLR_DATA_CONTROL_OFFER_V1_OFFER 0
/**
* @ingroup iface_zwlr_data_control_offer_v1
*/
#define ZWLR_DATA_CONTROL_OFFER_V1_OFFER_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_offer_v1
*/
#define ZWLR_DATA_CONTROL_OFFER_V1_RECEIVE_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_offer_v1
*/
#define ZWLR_DATA_CONTROL_OFFER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_zwlr_data_control_offer_v1
* Sends an offer event to the client owning the resource.
* @param resource_ The client's resource
* @param mime_type offered MIME type
*/
static inline void
zwlr_data_control_offer_v1_send_offer(struct wl_resource *resource_, const char *mime_type)
{
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2008-2013 Kristian Høgsberg
* Copyright © 2013 Rafael Antognolli
@@ -34,7 +32,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
File diff suppressed because it is too large. Load diff
@@ -1,5 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
/*
* Copyright © 2023-2024 Matthias Klumpp
* Copyright © 2024 David Edmundson
@@ -30,7 +28,7 @@
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
# define __has_attribute(x) 0
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
@@ -1,4 +1,3 @@
/* Generated by wayland-scanner 1.24.0 */
#ifndef XDG_TOPLEVEL_ICON_V1_SERVER_PROTOCOL_H
#define XDG_TOPLEVEL_ICON_V1_SERVER_PROTOCOL_H
@@ -14,33 +13,8 @@ extern "C" {
struct wl_client;
struct wl_resource;
/**
* @page page_xdg_toplevel_icon_v1 The xdg_toplevel_icon_v1 protocol
* protocol to assign icons to toplevels
*
* @section page_desc_xdg_toplevel_icon_v1 Description
*
* This protocol allows clients to set icons for their toplevel surfaces
* either via the XDG icon stock (using an icon name), or from pixel data.
*
* A toplevel icon represents the individual toplevel (unlike the application
* or launcher icon, which represents the application as a whole), and may be
* shown in window switchers, window overviews and taskbars that list
* individual windows.
*
* This document adheres to RFC 2119 when using words like "must",
* "should", "may", etc.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_xdg_toplevel_icon_v1 Interfaces
* - @subpage page_iface_xdg_toplevel_icon_manager_v1 - interface to manage toplevel icons
* - @subpage page_iface_xdg_toplevel_icon_v1 - a toplevel window icon
/*
* @section page_copyright_xdg_toplevel_icon_v1 Copyright
* <pre>
*
* Copyright © 2023-2024 Matthias Klumpp
* Copyright © 2024 David Edmundson
@@ -63,8 +37,33 @@ struct wl_resource;
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_buffer;
struct xdg_toplevel;
struct xdg_toplevel_icon_manager_v1;
@@ -72,104 +71,19 @@ struct xdg_toplevel_icon_v1;
#ifndef XDG_TOPLEVEL_ICON_MANAGER_V1_INTERFACE
#define XDG_TOPLEVEL_ICON_MANAGER_V1_INTERFACE
/**
* @page page_iface_xdg_toplevel_icon_manager_v1 xdg_toplevel_icon_manager_v1
* @section page_iface_xdg_toplevel_icon_manager_v1_desc Description
*
* This interface allows clients to create toplevel window icons and set
* them on toplevel windows to be displayed to the user.
* @section page_iface_xdg_toplevel_icon_manager_v1_api API
* See @ref iface_xdg_toplevel_icon_manager_v1.
*/
/**
* @defgroup iface_xdg_toplevel_icon_manager_v1 The xdg_toplevel_icon_manager_v1 interface
*
* This interface allows clients to create toplevel window icons and set
* them on toplevel windows to be displayed to the user.
*/
extern const struct wl_interface xdg_toplevel_icon_manager_v1_interface;
#endif
#ifndef XDG_TOPLEVEL_ICON_V1_INTERFACE
#define XDG_TOPLEVEL_ICON_V1_INTERFACE
/**
* @page page_iface_xdg_toplevel_icon_v1 xdg_toplevel_icon_v1
* @section page_iface_xdg_toplevel_icon_v1_desc Description
*
* This interface defines a toplevel icon.
* An icon can have a name, and multiple buffers.
* In order to be applied, the icon must have either a name, or at least
* one buffer assigned. Applying an empty icon (with no buffer or name) to
* a toplevel should reset its icon to the default icon.
*
* It is up to compositor policy whether to prefer using a buffer or loading
* an icon via its name. See 'set_name' and 'add_buffer' for details.
* @section page_iface_xdg_toplevel_icon_v1_api API
* See @ref iface_xdg_toplevel_icon_v1.
*/
/**
* @defgroup iface_xdg_toplevel_icon_v1 The xdg_toplevel_icon_v1 interface
*
* This interface defines a toplevel icon.
* An icon can have a name, and multiple buffers.
* In order to be applied, the icon must have either a name, or at least
* one buffer assigned. Applying an empty icon (with no buffer or name) to
* a toplevel should reset its icon to the default icon.
*
* It is up to compositor policy whether to prefer using a buffer or loading
* an icon via its name. See 'set_name' and 'add_buffer' for details.
*/
extern const struct wl_interface xdg_toplevel_icon_v1_interface;
#endif
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
* @struct xdg_toplevel_icon_manager_v1_interface
*/
struct xdg_toplevel_icon_manager_v1_interface {
/**
* destroy the toplevel icon manager
*
* Destroy the toplevel icon manager. This does not destroy
* objects created with the manager.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* create a new icon instance
*
* Creates a new icon object. This icon can then be attached to a
* xdg_toplevel via the 'set_icon' request.
*/
void (*create_icon)(struct wl_client *client,
struct wl_resource *resource,
uint32_t id);
/**
* set an icon on a toplevel window
*
* This request assigns the icon 'icon' to 'toplevel', or clears
* the toplevel icon if 'icon' was null. This state is
* double-buffered and is applied on the next wl_surface.commit of
* the toplevel.
*
* After making this call, the xdg_toplevel_icon_v1 provided as
* 'icon' can be destroyed by the client without 'toplevel' losing
* its icon. The xdg_toplevel_icon_v1 is immutable from this point,
* and any future attempts to change it must raise the
* 'xdg_toplevel_icon_v1.immutable' protocol error.
*
* The compositor must set the toplevel icon from either the pixel
* data the icon provides, or by loading a stock icon using the
* icon name. See the description of 'xdg_toplevel_icon_v1' for
* details.
*
* If 'icon' is set to null, the icon of the respective toplevel is
* reset to its default icon (usually the icon of the application,
* derived from its desktop-entry file, or a placeholder icon). If
* this request is passed an icon with no pixel buffers or icon
* name assigned, the icon must be reset just like if 'icon' was
* null.
* @param toplevel the toplevel to act on
*/
void (*set_icon)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *toplevel,
@@ -179,45 +93,19 @@ struct xdg_toplevel_icon_manager_v1_interface {
#define XDG_TOPLEVEL_ICON_MANAGER_V1_ICON_SIZE 0
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DONE 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_ICON_SIZE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_CREATE_ICON_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
*/
#define XDG_TOPLEVEL_ICON_MANAGER_V1_SET_ICON_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
* Sends an icon_size event to the client owning the resource.
* @param resource_ The client's resource
* @param size the edge size of the square icon in surface-local coordinates, e.g. 64
*/
static inline void
xdg_toplevel_icon_manager_v1_send_icon_size(struct wl_resource *resource_, int32_t size)
{
wl_resource_post_event(resource_, XDG_TOPLEVEL_ICON_MANAGER_V1_ICON_SIZE, size);
}
/**
* @ingroup iface_xdg_toplevel_icon_manager_v1
* Sends an done event to the client owning the resource.
* @param resource_ The client's resource
*/
static inline void
xdg_toplevel_icon_manager_v1_send_done(struct wl_resource *resource_)
{
@@ -227,30 +115,14 @@ xdg_toplevel_icon_manager_v1_send_done(struct wl_resource *resource_)
#ifndef XDG_TOPLEVEL_ICON_V1_ERROR_ENUM
#define XDG_TOPLEVEL_ICON_V1_ERROR_ENUM
enum xdg_toplevel_icon_v1_error {
/**
* the provided buffer does not satisfy requirements
*/
XDG_TOPLEVEL_ICON_V1_ERROR_INVALID_BUFFER = 1,
/**
* the icon has already been assigned to a toplevel and must not be changed
*/
XDG_TOPLEVEL_ICON_V1_ERROR_IMMUTABLE = 2,
/**
* the provided buffer has been destroyed before the toplevel icon
*/
XDG_TOPLEVEL_ICON_V1_ERROR_NO_BUFFER = 3,
};
#endif /* XDG_TOPLEVEL_ICON_V1_ERROR_ENUM */
#endif
#ifndef XDG_TOPLEVEL_ICON_V1_ERROR_ENUM_IS_VALID
#define XDG_TOPLEVEL_ICON_V1_ERROR_ENUM_IS_VALID
/**
* @ingroup iface_xdg_toplevel_icon_v1
* Validate a xdg_toplevel_icon_v1 error value.
*
* @return true on success, false on error.
* @ref xdg_toplevel_icon_v1_error
*/
static inline bool
xdg_toplevel_icon_v1_error_is_valid(uint32_t value, uint32_t version) {
switch (value) {
@@ -264,77 +136,14 @@ xdg_toplevel_icon_v1_error_is_valid(uint32_t value, uint32_t version) {
return false;
}
}
#endif /* XDG_TOPLEVEL_ICON_V1_ERROR_ENUM_IS_VALID */
#endif
/**
* @ingroup iface_xdg_toplevel_icon_v1
* @struct xdg_toplevel_icon_v1_interface
*/
struct xdg_toplevel_icon_v1_interface {
/**
* destroy the icon object
*
* Destroys the 'xdg_toplevel_icon_v1' object. The icon must
* still remain set on every toplevel it was assigned to, until the
* toplevel icon is reset explicitly.
*/
void (*destroy)(struct wl_client *client,
struct wl_resource *resource);
/**
* set an icon name
*
* This request assigns an icon name to this icon. Any previously
* set name is overridden.
*
* The compositor must resolve 'icon_name' according to the lookup
* rules described in the XDG icon theme specification[1] using the
* environment's current icon theme.
*
* If the compositor does not support icon names or cannot resolve
* 'icon_name' according to the XDG icon theme specification it
* must fall back to using pixel buffer data instead.
*
* If this request is made after the icon has been assigned to a
* toplevel via 'set_icon', an 'immutable' error must be raised.
*
* [1]:
* https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
*/
void (*set_name)(struct wl_client *client,
struct wl_resource *resource,
const char *icon_name);
/**
* add icon data from a pixel buffer
*
* This request adds pixel data supplied as wl_buffer to the
* icon.
*
* The client should add pixel data for all icon sizes and scales
* that it can provide, or which are explicitly requested by the
* compositor via 'icon_size' events on
* xdg_toplevel_icon_manager_v1.
*
* The wl_buffer supplying pixel data as 'buffer' must be backed by
* wl_shm and must be a square (width and height being equal). If
* any of these buffer requirements are not fulfilled, a
* 'invalid_buffer' error must be raised.
*
* If this icon instance already has a buffer of the same size and
* scale from a previous 'add_buffer' request, data from the last
* request overrides the preexisting pixel data.
*
* The wl_buffer must be kept alive for as long as the
* xdg_toplevel_icon it is associated with is not destroyed,
* otherwise a 'no_buffer' error is raised. The buffer contents
* must not be modified after it was assigned to the icon. As a
* result, the region of the wl_shm_pool's backing storage used for
* the wl_buffer must not be modified after this request is sent.
* The wl_buffer.release event is unused.
*
* If this request is made after the icon has been assigned to a
* toplevel via 'set_icon', an 'immutable' error must be raised.
* @param scale the scaling factor of the icon, e.g. 1
*/
void (*add_buffer)(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *buffer,
@@ -342,17 +151,8 @@ struct xdg_toplevel_icon_v1_interface {
};
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_SET_NAME_SINCE_VERSION 1
/**
* @ingroup iface_xdg_toplevel_icon_v1
*/
#define XDG_TOPLEVEL_ICON_V1_ADD_BUFFER_SINCE_VERSION 1
#ifdef __cplusplus