//! Generated by zig-wayland

const std = @import("std");
const assert = std.debug.assert;
const posix = std.posix;
const wayland = @This();

pub const client = struct {
    pub const wl = struct {
        pub const Object = common.Object;
        pub const Message = common.Message;
        pub const Interface = common.Interface;
        pub const list = common.list;
        pub const Array = common.Array;
        pub const Fixed = common.Fixed;
        pub const Argument = common.Argument;

        pub const Proxy = opaque {
            pub inline fn create(factory: *Proxy, interface: *const Interface) error{OutOfMemory}!*Proxy {
                return ffi.client.wl_proxy_create(factory, interface) orelse error.OutOfMemory;
            }

            pub inline fn destroy(proxy: *Proxy) void {
                ffi.client.wl_proxy_destroy(proxy);
            }

            pub inline fn marshal(proxy: *Proxy, opcode: u32, args: ?[*]Argument) void {
                ffi.client.wl_proxy_marshal_array(proxy, opcode, args);
            }

            pub inline fn marshalConstructor(
                proxy: *Proxy,
                opcode: u32,
                args: [*]Argument,
                interface: *const Interface,
            ) error{OutOfMemory}!*Proxy {
                return ffi.client.wl_proxy_marshal_array_constructor(proxy, opcode, args, interface) orelse
                    error.OutOfMemory;
            }

            pub inline fn marshalConstructorVersioned(
                proxy: *Proxy,
                opcode: u32,
                args: [*]Argument,
                interface: *const Interface,
                version: u32,
            ) error{OutOfMemory}!*Proxy {
                return ffi.client.wl_proxy_marshal_array_constructor_versioned(proxy, opcode, args, interface, version) orelse
                    error.OutOfMemory;
            }

            pub const DispatcherFn = fn (
                implementation: ?*const anyopaque,
                proxy: *Proxy,
                opcode: u32,
                message: *const Message,
                args: [*]Argument,
            ) callconv(.c) c_int;
            pub inline fn addDispatcher(
                proxy: *Proxy,
                dispatcher: *const DispatcherFn,
                implementation: ?*const anyopaque,
                data: ?*anyopaque,
            ) void {
                const ret = ffi.client.wl_proxy_add_dispatcher(proxy, dispatcher, implementation, data);
                // Since there is no way to remove listeners, adding a listener to
                // the same proxy twice is always a bug, so assert instead of returning
                // an error.
                assert(ret != -1); // If this fails, a listener was already added
            }

            pub inline fn getUserData(proxy: *Proxy) ?*anyopaque {
                return ffi.client.wl_proxy_get_user_data(proxy);
            }

            pub inline fn getVersion(proxy: *Proxy) u32 {
                return ffi.client.wl_proxy_get_version(proxy);
            }

            pub inline fn getId(proxy: *Proxy) u32 {
                return ffi.client.wl_proxy_get_id(proxy);
            }

            pub inline fn setQueue(proxy: *Proxy, queue: *EventQueue) void {
                ffi.client.wl_proxy_set_queue(proxy, queue);
            }
        };

        pub const EventQueue = opaque {
            pub inline fn destroy(queue: *EventQueue) void {
                ffi.client.wl_event_queue_destroy(queue);
            }
        };

        pub const EglWindow = opaque {
            pub inline fn create(surface: *client.wl.Surface, width: c_int, height: c_int) error{OutOfMemory}!*EglWindow {
                // Why do people use int when they require a positive number?
                assert(width > 0 and height > 0);
                return ffi.egl.wl_egl_window_create(surface, width, height) orelse error.OutOfMemory;
            }

            pub inline fn destroy(egl_window: *EglWindow) void {
                ffi.egl.wl_egl_window_destroy(egl_window);
            }

            pub inline fn resize(egl_window: *EglWindow, width: c_int, height: c_int, dx: c_int, dy: c_int) void {
                ffi.egl.wl_egl_window_resize(egl_window, width, height, dx, dy);
            }

            pub inline fn getAttachedSize(egl_window: *EglWindow, width: *c_int, height: *c_int) void {
                ffi.egl.wl_egl_window_get_attached_size(egl_window, width, height);
            }
        };

        pub const CursorTheme = opaque {
            pub inline fn load(name: ?[*:0]const u8, size: i32, shm: *client.wl.Shm) error{LoadThemeFailed}!*CursorTheme {
                return ffi.cursor.wl_cursor_theme_load(name, @intCast(size), shm) orelse error.LoadThemeFailed;
            }

            pub inline fn destroy(wl_cursor_theme: *CursorTheme) void {
                ffi.cursor.wl_cursor_theme_destroy(wl_cursor_theme);
            }

            pub inline fn getCursor(theme: *CursorTheme, name: [*:0]const u8) ?*Cursor {
                return ffi.cursor.wl_cursor_theme_get_cursor(theme, name);
            }
        };

        pub const Cursor = extern struct {
            image_count: c_uint,
            images: [*]*CursorImage,
            name: [*:0]u8,

            pub inline fn frame(cursor: *Cursor, time: u32) c_int {
                return ffi.cursor.wl_cursor_frame(cursor, time);
            }

            pub inline fn frameAndDuration(cursor: *Cursor, time: u32, duration: *u32) c_int {
                return ffi.cursor.wl_cursor_frame_and_duration(cursor, time, duration);
            }
        };

        pub const CursorImage = extern struct {
            width: u32,
            height: u32,
            hotspot_x: u32,
            hotspot_y: u32,
            delay: u32,

            pub inline fn getBuffer(image: *CursorImage) error{OutOfMemory}!*client.wl.Buffer {
                return ffi.cursor.wl_cursor_image_get_buffer(image) orelse error.OutOfMemory;
            }
        };

        /// The core global object.  This is a special singleton object.  It
        /// is used for internal Wayland protocol features.
        pub const Display = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.display.interface;
            pub const Error = common.wl.display.Error;
            pub inline fn getId(_display: *Display) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_display)).getId();
            }
            pub inline fn getVersion(_display: *Display) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_display)).getVersion();
            }
            pub inline fn getUserData(_display: *Display) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_display)).getUserData();
            }
            pub inline fn setQueue(_display: *Display, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_display);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const error_since_version = 1;
                pub const delete_id_since_version = 1;

                /// The error event is sent out when a fatal (non-recoverable)
                /// error has occurred.  The object_id argument is the object
                /// where the error occurred, most often in response to a request
                /// to that object.  The code identifies the error and is defined
                /// by the object interface.  As such, each interface defines its
                /// own set of error codes.  The message is a brief description
                /// of the error, for (debugging) convenience.
                @"error": struct {
                    object_id: ?*common.Object,
                    code: u32,
                    message: [*:0]const u8,
                },

                /// This event is used internally by the object ID management
                /// logic. When a client deletes an object that it had created,
                /// the server will send this event to acknowledge that it has
                /// seen the delete request. When the client receives this event,
                /// it will know that it can safely reuse the object ID.
                delete_id: struct {
                    id: u32,
                },
            };
            pub inline fn setListener(
                _display: *Display,
                comptime T: type,
                _listener: *const fn (display: *Display, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_display);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Display, T).dispatcher, _listener, _mut_data);
            }
            /// The sync request asks the server to emit the 'done' event
            /// on the returned wl_callback object.  Since requests are
            /// handled in-order and events are delivered in-order, this can
            /// be used as a barrier to ensure all previous requests and the
            /// resulting events have been handled.
            ///
            /// The object returned by this request will be destroyed by the
            /// compositor after the callback is fired and as such the client must not
            /// attempt to use it after that point.
            ///
            /// The callback_data passed in the callback is undefined and should be ignored.
            pub fn sync(_display: *Display) !*client.wl.Callback {
                const _proxy: *client.wl.Proxy = @ptrCast(_display);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Callback.interface));
            }
            pub const sync_since_version = 1;

            /// This request creates a registry object that allows the client
            /// to list and bind the global objects available from the
            /// compositor.
            ///
            /// It should be noted that the server side resources consumed in
            /// response to a get_registry request can only be released when the
            /// client disconnects, not when the client side proxy is destroyed.
            /// Therefore, clients should invoke get_registry as infrequently as
            /// possible to avoid wasting memory.
            pub fn getRegistry(_display: *Display) !*client.wl.Registry {
                const _proxy: *client.wl.Proxy = @ptrCast(_display);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Registry.interface));
            }
            pub const get_registry_since_version = 1;
            pub inline fn connect(name: ?[*:0]const u8) error{ConnectFailed}!*Display {
                return ffi.client.wl_display_connect(name) orelse return error.ConnectFailed;
            }

            pub inline fn connectToFd(fd: c_int) error{ConnectFailed}!*Display {
                return ffi.client.wl_display_connect_to_fd(fd) orelse return error.ConnectFailed;
            }

            pub inline fn disconnect(display: *Display) void {
                ffi.client.wl_display_disconnect(display);
            }

            pub inline fn getFd(display: *Display) c_int {
                return ffi.client.wl_display_get_fd(display);
            }

            pub inline fn dispatch(display: *Display) posix.E {
                return posix.errno(ffi.client.wl_display_dispatch(display));
            }

            pub inline fn dispatchQueue(display: *Display, queue: *client.wl.EventQueue) posix.E {
                return posix.errno(ffi.client.wl_display_dispatch_queue(display, queue));
            }

            pub inline fn dispatchPending(display: *Display) posix.E {
                return posix.errno(ffi.client.wl_display_dispatch_pending(display));
            }

            pub inline fn dispatchQueuePending(display: *Display, queue: *client.wl.EventQueue) posix.E {
                return posix.errno(ffi.client.wl_display_dispatch_queue_pending(display, queue));
            }

            pub inline fn roundtrip(display: *Display) posix.E {
                return posix.errno(ffi.client.wl_display_roundtrip(display));
            }

            pub inline fn roundtripQueue(display: *Display, queue: *client.wl.EventQueue) posix.E {
                return posix.errno(ffi.client.wl_display_roundtrip_queue(display, queue));
            }

            pub inline fn flush(display: *Display) posix.E {
                return posix.errno(ffi.client.wl_display_flush(display));
            }

            pub inline fn createQueue(display: *Display) error{OutOfMemory}!*client.wl.EventQueue {
                return ffi.client.wl_display_create_queue(display) orelse error.OutOfMemory;
            }

            pub inline fn getError(display: *Display) c_int {
                return ffi.client.wl_display_get_error(display);
            }

            /// Succeeds if the queue is empty and returns true.
            /// Fails and returns false if the queue was not empty.
            pub inline fn prepareReadQueue(display: *Display, queue: *client.wl.EventQueue) bool {
                switch (ffi.client.wl_display_prepare_read_queue(display, queue)) {
                    0 => return true,
                    -1 => return false,
                    else => unreachable,
                }
            }

            /// Succeeds if the queue is empty and returns true.
            /// Fails and returns false if the queue was not empty.
            pub inline fn prepareRead(display: *Display) bool {
                switch (ffi.client.wl_display_prepare_read(display)) {
                    0 => return true,
                    -1 => return false,
                    else => unreachable,
                }
            }

            pub inline fn cancelRead(display: *Display) void {
                ffi.client.wl_display_cancel_read(display);
            }

            pub inline fn readEvents(display: *Display) posix.E {
                return posix.errno(ffi.client.wl_display_read_events(display));
            }
        };

        /// The singleton global registry object.  The server has a number of
        /// global objects that are available to all clients.  These objects
        /// typically represent an actual object in the server (for example,
        /// an input device) or they are singleton objects that provide
        /// extension functionality.
        ///
        /// When a client creates a registry object, the registry object
        /// will emit a global event for each global currently in the
        /// registry.  Globals come and go as a result of device or
        /// monitor hotplugs, reconfiguration or other events, and the
        /// registry will send out global and global_remove events to
        /// keep the client up to date with the changes.  To mark the end
        /// of the initial burst of events, the client can use the
        /// wl_display.sync request immediately after calling
        /// wl_display.get_registry.
        ///
        /// A client can bind to a global object by using the bind
        /// request.  This creates a client-side handle that lets the object
        /// emit events to the client and lets the client invoke requests on
        /// the object.
        pub const Registry = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.registry.interface;
            pub inline fn getId(_registry: *Registry) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_registry)).getId();
            }
            pub inline fn getVersion(_registry: *Registry) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_registry)).getVersion();
            }
            pub inline fn getUserData(_registry: *Registry) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_registry)).getUserData();
            }
            pub inline fn setQueue(_registry: *Registry, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_registry);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const global_since_version = 1;
                pub const global_remove_since_version = 1;

                /// Notify the client of global objects.
                ///
                /// The event notifies the client that a global object with
                /// the given name is now available, and it implements the
                /// given version of the given interface.
                global: struct {
                    name: u32,
                    interface: [*:0]const u8,
                    version: u32,
                },

                /// Notify the client of removed global objects.
                ///
                /// This event notifies the client that the global identified
                /// by name is no longer available.  If the client bound to
                /// the global using the bind request, the client should now
                /// destroy that object.
                ///
                /// The object remains valid and requests to the object will be
                /// ignored until the client destroys it, to avoid races between
                /// the global going away and a client sending a request to it.
                global_remove: struct {
                    name: u32,
                },
            };
            pub inline fn setListener(
                _registry: *Registry,
                comptime T: type,
                _listener: *const fn (registry: *Registry, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_registry);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Registry, T).dispatcher, _listener, _mut_data);
            }
            /// Binds a new, client-created object to the server using the
            /// specified name as the identifier.
            pub fn bind(_registry: *Registry, _name: u32, comptime T: type, _version: u32) !*T {
                const version_to_construct = @min(T.generated_version, _version);
                const _proxy: *client.wl.Proxy = @ptrCast(_registry);
                var _args = [_]common.Argument{
                    .{ .u = _name },
                    .{ .s = T.interface.name },
                    .{ .u = version_to_construct },
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructorVersioned(0, &_args, T.interface, version_to_construct));
            }
            pub const bind_since_version = 1;
            pub inline fn destroy(_registry: *Registry) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_registry);
                _proxy.destroy();
            }
        };

        /// Clients can handle the 'done' event to get notified when
        /// the related request is done.
        ///
        /// Note, because wl_callback objects are created from multiple independent
        /// factory interfaces, the wl_callback interface is frozen at version 1.
        pub const Callback = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.callback.interface;
            pub inline fn getId(_callback: *Callback) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_callback)).getId();
            }
            pub inline fn getVersion(_callback: *Callback) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_callback)).getVersion();
            }
            pub inline fn getUserData(_callback: *Callback) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_callback)).getUserData();
            }
            pub inline fn setQueue(_callback: *Callback, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_callback);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const done_since_version = 1;

                /// Notify the client when the related request is done.
                done: struct {
                    callback_data: u32,
                },
            };
            pub inline fn setListener(
                _callback: *Callback,
                comptime T: type,
                _listener: *const fn (callback: *Callback, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_callback);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Callback, T).dispatcher, _listener, _mut_data);
            }
            pub inline fn destroy(_callback: *Callback) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_callback);
                _proxy.destroy();
            }
        };

        /// A buffer provides the content for a wl_surface. Buffers are
        /// created through factory interfaces such as wl_shm, wp_linux_buffer_params
        /// (from the linux-dmabuf protocol extension) or similar. It has a width and
        /// a height and can be attached to a wl_surface, but the mechanism by which a
        /// client provides and updates the contents is defined by the buffer factory
        /// interface.
        ///
        /// Color channels are assumed to be electrical rather than optical (in other
        /// words, encoded with a transfer function) unless otherwise specified. If
        /// the buffer uses a format that has an alpha channel, the alpha channel is
        /// assumed to be premultiplied into the electrical color channel values
        /// (after transfer function encoding) unless otherwise specified.
        ///
        /// Note, because wl_buffer objects are created from multiple independent
        /// factory interfaces, the wl_buffer interface is frozen at version 1.
        pub const Buffer = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.buffer.interface;
            pub inline fn getId(_buffer: *Buffer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_buffer)).getId();
            }
            pub inline fn getVersion(_buffer: *Buffer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_buffer)).getVersion();
            }
            pub inline fn getUserData(_buffer: *Buffer) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_buffer)).getUserData();
            }
            pub inline fn setQueue(_buffer: *Buffer, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_buffer);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const release_since_version = 1;

                /// Sent when this wl_buffer is no longer used by the compositor.
                ///
                /// For more information on when release events may or may not be sent,
                /// and what consequences it has, please see the description of
                /// wl_surface.attach.
                ///
                /// If a client receives a release event before the frame callback
                /// requested in the same wl_surface.commit that attaches this
                /// wl_buffer to a surface, then the client is immediately free to
                /// reuse the buffer and its backing storage, and does not need a
                /// second buffer for the next surface content update. Typically
                /// this is possible, when the compositor maintains a copy of the
                /// wl_surface contents, e.g. as a GL texture. This is an important
                /// optimization for GL(ES) compositors with wl_shm clients.
                release: void,
            };
            pub inline fn setListener(
                _buffer: *Buffer,
                comptime T: type,
                _listener: *const fn (buffer: *Buffer, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_buffer);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Buffer, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy a buffer. If and how you need to release the backing
            /// storage is defined by the buffer factory interface.
            ///
            /// For possible side-effects to a surface, see wl_surface.attach.
            pub fn destroy(_buffer: *Buffer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_buffer);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A compositor.  This object is a singleton global.  The
        /// compositor is in charge of combining the contents of multiple
        /// surfaces into one displayable output.
        pub const Compositor = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.compositor.interface;
            pub inline fn getId(_compositor: *Compositor) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_compositor)).getId();
            }
            pub inline fn getVersion(_compositor: *Compositor) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_compositor)).getVersion();
            }
            pub inline fn getUserData(_compositor: *Compositor) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_compositor)).getUserData();
            }
            pub inline fn setQueue(_compositor: *Compositor, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_compositor);
                _proxy.setQueue(_queue);
            }
            /// Ask the compositor to create a new surface.
            pub fn createSurface(_compositor: *Compositor) !*client.wl.Surface {
                const _proxy: *client.wl.Proxy = @ptrCast(_compositor);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Surface.interface));
            }
            pub const create_surface_since_version = 1;

            /// Ask the compositor to create a new region.
            pub fn createRegion(_compositor: *Compositor) !*client.wl.Region {
                const _proxy: *client.wl.Proxy = @ptrCast(_compositor);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Region.interface));
            }
            pub const create_region_since_version = 1;
            pub inline fn destroy(_compositor: *Compositor) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_compositor);
                _proxy.destroy();
            }
        };

        /// A surface is a rectangular area that may be displayed on zero
        /// or more outputs, and shown any number of times at the compositor's
        /// discretion. They can present wl_buffers, receive user input, and
        /// define a local coordinate system.
        ///
        /// The size of a surface (and relative positions on it) is described
        /// in surface-local coordinates, which may differ from the buffer
        /// coordinates of the pixel content, in case a buffer_transform
        /// or a buffer_scale is used.
        ///
        /// A surface without a "role" is fairly useless: a compositor does
        /// not know where, when or how to present it. The role is the
        /// purpose of a wl_surface. Examples of roles are a cursor for a
        /// pointer (as set by wl_pointer.set_cursor), a drag icon
        /// (wl_data_device.start_drag), a sub-surface
        /// (wl_subcompositor.get_subsurface), and a window as defined by a
        /// shell protocol (e.g. wl_shell.get_shell_surface).
        ///
        /// A surface can have only one role at a time. Initially a
        /// wl_surface does not have a role. Once a wl_surface is given a
        /// role, it is set permanently for the whole lifetime of the
        /// wl_surface object. Giving the current role again is allowed,
        /// unless explicitly forbidden by the relevant interface
        /// specification.
        ///
        /// Surface roles are given by requests in other interfaces such as
        /// wl_pointer.set_cursor. The request should explicitly mention
        /// that this request gives a role to a wl_surface. Often, this
        /// request also creates a new protocol object that represents the
        /// role and adds additional functionality to wl_surface. When a
        /// client wants to destroy a wl_surface, they must destroy this role
        /// object before the wl_surface, otherwise a defunct_role_object error is
        /// sent.
        ///
        /// Destroying the role object does not remove the role from the
        /// wl_surface, but it may stop the wl_surface from "playing the role".
        /// For instance, if a wl_subsurface object is destroyed, the wl_surface
        /// it was created for will be unmapped and forget its position and
        /// z-order. It is allowed to create a wl_subsurface for the same
        /// wl_surface again, but it is not allowed to use the wl_surface as
        /// a cursor (cursor is a different role than sub-surface, and role
        /// switching is not allowed).
        pub const Surface = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.surface.interface;
            pub const Error = common.wl.surface.Error;
            pub inline fn getId(_surface: *Surface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getId();
            }
            pub inline fn getVersion(_surface: *Surface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getVersion();
            }
            pub inline fn getUserData(_surface: *Surface) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getUserData();
            }
            pub inline fn setQueue(_surface: *Surface, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const enter_since_version = 1;
                pub const leave_since_version = 1;

                /// This is emitted whenever a surface's creation, movement, or resizing
                /// results in some part of it being within the scanout region of an
                /// output.
                ///
                /// Note that a surface may be overlapping with zero or more outputs.
                enter: struct {
                    output: ?*client.wl.Output,
                },

                /// This is emitted whenever a surface's creation, movement, or resizing
                /// results in it no longer having any part of it within the scanout region
                /// of an output.
                ///
                /// Clients should not use the number of outputs the surface is on for frame
                /// throttling purposes. The surface might be hidden even if no leave event
                /// has been sent, and the compositor might expect new surface content
                /// updates even if no enter event has been sent. The frame event should be
                /// used instead.
                leave: struct {
                    output: ?*client.wl.Output,
                },
            };
            pub inline fn setListener(
                _surface: *Surface,
                comptime T: type,
                _listener: *const fn (surface: *Surface, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Surface, T).dispatcher, _listener, _mut_data);
            }
            /// Deletes the surface and invalidates its object ID.
            pub fn destroy(_surface: *Surface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set a buffer as the content of this surface.
            ///
            /// The new size of the surface is calculated based on the buffer
            /// size transformed by the inverse buffer_transform and the
            /// inverse buffer_scale. This means that at commit time the supplied
            /// buffer size must be an integer multiple of the buffer_scale. If
            /// that's not the case, an invalid_size error is sent.
            ///
            /// The x and y arguments specify the location of the new pending
            /// buffer's upper left corner, relative to the current buffer's upper
            /// left corner, in surface-local coordinates. In other words, the
            /// x and y, combined with the new surface size define in which
            /// directions the surface's size changes. Setting anything other than 0
            /// as x and y arguments is discouraged, and should instead be replaced
            /// with using the separate wl_surface.offset request.
            ///
            /// When the bound wl_surface version is 5 or higher, passing any
            /// non-zero x or y is a protocol violation, and will result in an
            /// 'invalid_offset' error being raised. The x and y arguments are ignored
            /// and do not change the pending state. To achieve equivalent semantics,
            /// use wl_surface.offset.
            ///
            /// Surface contents are double-buffered state, see wl_surface.commit.
            ///
            /// The initial surface contents are void; there is no content.
            /// wl_surface.attach assigns the given wl_buffer as the pending
            /// wl_buffer. wl_surface.commit makes the pending wl_buffer the new
            /// surface contents, and the size of the surface becomes the size
            /// calculated from the wl_buffer, as described above. After commit,
            /// there is no pending buffer until the next attach.
            ///
            /// Committing a pending wl_buffer allows the compositor to read the
            /// pixels in the wl_buffer. The compositor may access the pixels at
            /// any time after the wl_surface.commit request. When the compositor
            /// will not access the pixels anymore, it will send the
            /// wl_buffer.release event. Only after receiving wl_buffer.release,
            /// the client may reuse the wl_buffer. A wl_buffer that has been
            /// attached and then replaced by another attach instead of committed
            /// will not receive a release event, and is not used by the
            /// compositor.
            ///
            /// If a pending wl_buffer has been committed to more than one wl_surface,
            /// the delivery of wl_buffer.release events becomes undefined. A well
            /// behaved client should not rely on wl_buffer.release events in this
            /// case. Alternatively, a client could create multiple wl_buffer objects
            /// from the same backing storage or use a protocol extension providing
            /// per-commit release notifications.
            ///
            /// Destroying the wl_buffer after wl_buffer.release does not change
            /// the surface contents. Destroying the wl_buffer before wl_buffer.release
            /// is allowed as long as the underlying buffer storage isn't re-used (this
            /// can happen e.g. on client process termination). However, if the client
            /// destroys the wl_buffer before receiving the wl_buffer.release event and
            /// mutates the underlying buffer storage, the surface contents become
            /// undefined immediately.
            ///
            /// If wl_surface.attach is sent with a NULL wl_buffer, the
            /// following wl_surface.commit will remove the surface content.
            ///
            /// If a pending wl_buffer has been destroyed, the result is not specified.
            /// Many compositors are known to remove the surface content on the following
            /// wl_surface.commit, but this behaviour is not universal. Clients seeking to
            /// maximise compatibility should not destroy pending buffers and should
            /// ensure that they explicitly remove content from surfaces, even after
            /// destroying buffers.
            pub fn attach(_surface: *Surface, _buffer: ?*client.wl.Buffer, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_buffer) },
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(1, &_args);
            }
            pub const attach_since_version = 1;

            /// This request is used to describe the regions where the pending
            /// buffer is different from the current surface contents, and where
            /// the surface therefore needs to be repainted. The compositor
            /// ignores the parts of the damage that fall outside of the surface.
            ///
            /// Damage is double-buffered state, see wl_surface.commit.
            ///
            /// The damage rectangle is specified in surface-local coordinates,
            /// where x and y specify the upper left corner of the damage rectangle.
            ///
            /// The initial value for pending damage is empty: no damage.
            /// wl_surface.damage adds pending damage: the new pending damage
            /// is the union of old pending damage and the given rectangle.
            ///
            /// wl_surface.commit assigns pending damage as the current damage,
            /// and clears pending damage. The server will clear the current
            /// damage as it repaints the surface.
            ///
            /// Note! New clients should not use this request. Instead damage can be
            /// posted with wl_surface.damage_buffer which uses buffer coordinates
            /// instead of surface coordinates.
            pub fn damage(_surface: *Surface, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(2, &_args);
            }
            pub const damage_since_version = 1;

            /// Request a notification when it is a good time to start drawing a new
            /// frame, by creating a frame callback. This is useful for throttling
            /// redrawing operations, and driving animations.
            ///
            /// When a client is animating on a wl_surface, it can use the 'frame'
            /// request to get notified when it is a good time to draw and commit the
            /// next frame of animation. If the client commits an update earlier than
            /// that, it is likely that some updates will not make it to the display,
            /// and the client is wasting resources by drawing too often.
            ///
            /// The frame request will take effect on the next wl_surface.commit.
            /// The notification will only be posted for one frame unless
            /// requested again. For a wl_surface, the notifications are posted in
            /// the order the frame requests were committed.
            ///
            /// The server must send the notifications so that a client
            /// will not send excessive updates, while still allowing
            /// the highest possible update rate for clients that wait for the reply
            /// before drawing again. The server should give some time for the client
            /// to draw and commit after sending the frame callback events to let it
            /// hit the next output refresh.
            ///
            /// A server should avoid signaling the frame callbacks if the
            /// surface is not visible in any way, e.g. the surface is off-screen,
            /// or completely obscured by other opaque surfaces.
            ///
            /// The object returned by this request will be destroyed by the
            /// compositor after the callback is fired and as such the client must not
            /// attempt to use it after that point.
            ///
            /// The callback_data passed in the callback is the current time, in
            /// milliseconds, with an undefined base.
            pub fn frame(_surface: *Surface) !*client.wl.Callback {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(3, &_args, client.wl.Callback.interface));
            }
            pub const frame_since_version = 1;

            /// This request sets the region of the surface that contains
            /// opaque content.
            ///
            /// The opaque region is an optimization hint for the compositor
            /// that lets it optimize the redrawing of content behind opaque
            /// regions.  Setting an opaque region is not required for correct
            /// behaviour, but marking transparent content as opaque will result
            /// in repaint artifacts.
            ///
            /// The opaque region is specified in surface-local coordinates.
            ///
            /// The compositor ignores the parts of the opaque region that fall
            /// outside of the surface.
            ///
            /// Opaque region is double-buffered state, see wl_surface.commit.
            ///
            /// wl_surface.set_opaque_region changes the pending opaque region.
            /// wl_surface.commit copies the pending region to the current region.
            /// Otherwise, the pending and current regions are never changed.
            ///
            /// The initial value for an opaque region is empty. Setting the pending
            /// opaque region has copy semantics, and the wl_region object can be
            /// destroyed immediately. A NULL wl_region causes the pending opaque
            /// region to be set to empty.
            pub fn setOpaqueRegion(_surface: *Surface, _region: ?*client.wl.Region) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_region) },
                };
                _proxy.marshal(4, &_args);
            }
            pub const set_opaque_region_since_version = 1;

            /// This request sets the region of the surface that can receive
            /// pointer and touch events.
            ///
            /// Input events happening outside of this region will try the next
            /// surface in the server surface stack. The compositor ignores the
            /// parts of the input region that fall outside of the surface.
            ///
            /// The input region is specified in surface-local coordinates.
            ///
            /// Input region is double-buffered state, see wl_surface.commit.
            ///
            /// wl_surface.set_input_region changes the pending input region.
            /// wl_surface.commit copies the pending region to the current region.
            /// Otherwise the pending and current regions are never changed,
            /// except cursor and icon surfaces are special cases, see
            /// wl_pointer.set_cursor and wl_data_device.start_drag.
            ///
            /// The initial value for an input region is infinite. That means the
            /// whole surface will accept input. Setting the pending input region
            /// has copy semantics, and the wl_region object can be destroyed
            /// immediately. A NULL wl_region causes the input region to be set
            /// to infinite.
            pub fn setInputRegion(_surface: *Surface, _region: ?*client.wl.Region) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_region) },
                };
                _proxy.marshal(5, &_args);
            }
            pub const set_input_region_since_version = 1;

            /// Surface state (input, opaque, and damage regions, attached buffers,
            /// etc.) is double-buffered. Protocol requests modify the pending state,
            /// as opposed to the active state in use by the compositor.
            ///
            /// A commit request atomically creates a content update from the pending
            /// state, even if the pending state has not been touched. The content
            /// update is placed in a queue until it becomes active. After commit, the
            /// new pending state is as documented for each related request.
            ///
            /// When the content update is applied, the wl_buffer is applied before all
            /// other state. This means that all coordinates in double-buffered state
            /// are relative to the newly attached wl_buffers, except for
            /// wl_surface.attach itself. If there is no newly attached wl_buffer, the
            /// coordinates are relative to the previous content update.
            ///
            /// All requests that need a commit to become effective are documented
            /// to affect double-buffered state.
            ///
            /// Other interfaces may add further double-buffered surface state.
            pub fn commit(_surface: *Surface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                _proxy.marshal(6, null);
            }
            pub const commit_since_version = 1;

            /// This request sets the transformation that the client has already applied
            /// to the content of the buffer. The accepted values for the transform
            /// parameter are the values for wl_output.transform.
            ///
            /// The compositor applies the inverse of this transformation whenever it
            /// uses the buffer contents.
            ///
            /// Buffer transform is double-buffered state, see wl_surface.commit.
            ///
            /// A newly created surface has its buffer transformation set to normal.
            ///
            /// wl_surface.set_buffer_transform changes the pending buffer
            /// transformation. wl_surface.commit copies the pending buffer
            /// transformation to the current one. Otherwise, the pending and current
            /// values are never changed.
            ///
            /// The purpose of this request is to allow clients to render content
            /// according to the output transform, thus permitting the compositor to
            /// use certain optimizations even if the display is rotated. Using
            /// hardware overlays and scanning out a client buffer for fullscreen
            /// surfaces are examples of such optimizations. Those optimizations are
            /// highly dependent on the compositor implementation, so the use of this
            /// request should be considered on a case-by-case basis.
            ///
            /// Note that if the transform value includes 90 or 270 degree rotation,
            /// the width of the buffer will become the surface height and the height
            /// of the buffer will become the surface width.
            ///
            /// If transform is not one of the values from the
            /// wl_output.transform enum the invalid_transform protocol error
            /// is raised.
            pub fn setBufferTransform(_surface: *Surface, _transform: common.wl.output.Transform) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .i = switch (@typeInfo(common.wl.output.Transform)) {
                        .@"enum" => @as(i32, @intCast(@intFromEnum(_transform))),
                        .@"struct" => @bitCast(_transform),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(7, &_args);
            }
            pub const set_buffer_transform_since_version = 2;

            /// This request sets an optional scaling factor on how the compositor
            /// interprets the contents of the buffer attached to the window.
            ///
            /// Buffer scale is double-buffered state, see wl_surface.commit.
            ///
            /// A newly created surface has its buffer scale set to 1.
            ///
            /// wl_surface.set_buffer_scale changes the pending buffer scale.
            /// wl_surface.commit copies the pending buffer scale to the current one.
            /// Otherwise, the pending and current values are never changed.
            ///
            /// The purpose of this request is to allow clients to supply higher
            /// resolution buffer data for use on high resolution outputs. It is
            /// intended that you pick the same buffer scale as the scale of the
            /// output that the surface is displayed on. This means the compositor
            /// can avoid scaling when rendering the surface on that output.
            ///
            /// Note that if the scale is larger than 1, then you have to attach
            /// a buffer that is larger (by a factor of scale in each dimension)
            /// than the desired surface size.
            ///
            /// If scale is not greater than 0 the invalid_scale protocol error is
            /// raised.
            pub fn setBufferScale(_surface: *Surface, _scale: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .i = _scale },
                };
                _proxy.marshal(8, &_args);
            }
            pub const set_buffer_scale_since_version = 3;

            /// This request is used to describe the regions where the pending
            /// buffer is different from the current surface contents, and where
            /// the surface therefore needs to be repainted. The compositor
            /// ignores the parts of the damage that fall outside of the surface.
            ///
            /// Damage is double-buffered state, see wl_surface.commit.
            ///
            /// The damage rectangle is specified in buffer coordinates,
            /// where x and y specify the upper left corner of the damage rectangle.
            ///
            /// The initial value for pending damage is empty: no damage.
            /// wl_surface.damage_buffer adds pending damage: the new pending
            /// damage is the union of old pending damage and the given rectangle.
            ///
            /// wl_surface.commit assigns pending damage as the current damage,
            /// and clears pending damage. The server will clear the current
            /// damage as it repaints the surface.
            ///
            /// This request differs from wl_surface.damage in only one way - it
            /// takes damage in buffer coordinates instead of surface-local
            /// coordinates. While this generally is more intuitive than surface
            /// coordinates, it is especially desirable when using wp_viewport
            /// or when a drawing library (like EGL) is unaware of buffer scale
            /// and buffer transform.
            ///
            /// Note: Because buffer transformation changes and damage requests may
            /// be interleaved in the protocol stream, it is impossible to determine
            /// the actual mapping between surface and buffer damage until
            /// wl_surface.commit time. Therefore, compositors wishing to take both
            /// kinds of damage into account will have to accumulate damage from the
            /// two requests separately and only transform from one to the other
            /// after receiving the wl_surface.commit.
            pub fn damageBuffer(_surface: *Surface, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(9, &_args);
            }
            pub const damage_buffer_since_version = 4;
        };

        /// A region object describes an area.
        ///
        /// Region objects are used to describe the opaque and input
        /// regions of a surface.
        pub const Region = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.region.interface;
            pub inline fn getId(_region: *Region) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_region)).getId();
            }
            pub inline fn getVersion(_region: *Region) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_region)).getVersion();
            }
            pub inline fn getUserData(_region: *Region) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_region)).getUserData();
            }
            pub inline fn setQueue(_region: *Region, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_region);
                _proxy.setQueue(_queue);
            }
            /// Destroy the region.  This will invalidate the object ID.
            pub fn destroy(_region: *Region) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_region);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Add the specified rectangle to the region.
            pub fn add(_region: *Region, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_region);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(1, &_args);
            }
            pub const add_since_version = 1;

            /// Subtract the specified rectangle from the region.
            pub fn subtract(_region: *Region, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_region);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(2, &_args);
            }
            pub const subtract_since_version = 1;
        };

        /// The global interface exposing sub-surface compositing capabilities.
        /// A wl_surface, that has sub-surfaces associated, is called the
        /// parent surface. Sub-surfaces can be arbitrarily nested and create
        /// a tree of sub-surfaces.
        ///
        /// The root surface in a tree of sub-surfaces is the main
        /// surface. The main surface cannot be a sub-surface, because
        /// sub-surfaces must always have a parent.
        ///
        /// A main surface with its sub-surfaces forms a (compound) window.
        /// For window management purposes, this set of wl_surface objects is
        /// to be considered as a single window, and it should also behave as
        /// such.
        ///
        /// The aim of sub-surfaces is to offload some of the compositing work
        /// within a window from clients to the compositor. A prime example is
        /// a video player with decorations and video in separate wl_surface
        /// objects. This should allow the compositor to pass YUV video buffer
        /// processing to dedicated overlay hardware when possible.
        pub const Subcompositor = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.subcompositor.interface;
            pub const Error = common.wl.subcompositor.Error;
            pub inline fn getId(_subcompositor: *Subcompositor) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_subcompositor)).getId();
            }
            pub inline fn getVersion(_subcompositor: *Subcompositor) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_subcompositor)).getVersion();
            }
            pub inline fn getUserData(_subcompositor: *Subcompositor) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_subcompositor)).getUserData();
            }
            pub inline fn setQueue(_subcompositor: *Subcompositor, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subcompositor);
                _proxy.setQueue(_queue);
            }
            /// Informs the server that the client will not be using this
            /// protocol object anymore. This does not affect any other
            /// objects, wl_subsurface objects included.
            pub fn destroy(_subcompositor: *Subcompositor) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subcompositor);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Create a sub-surface interface for the given surface, and
            /// associate it with the given parent surface. This turns a
            /// plain wl_surface into a sub-surface.
            ///
            /// The to-be sub-surface must not already have another role, and it
            /// must not have an existing wl_subsurface object. Otherwise the
            /// bad_surface protocol error is raised.
            ///
            /// Adding sub-surfaces to a parent is a double-buffered operation on the
            /// parent (see wl_surface.commit). The effect of adding a sub-surface
            /// becomes visible on the next time the state of the parent surface is
            /// applied.
            ///
            /// The parent surface must not be one of the child surface's descendants,
            /// and the parent must be different from the child surface, otherwise the
            /// bad_parent protocol error is raised.
            ///
            /// This request modifies the behaviour of wl_surface.commit request on
            /// the sub-surface, see the documentation on wl_subsurface interface.
            pub fn getSubsurface(_subcompositor: *Subcompositor, _surface: *client.wl.Surface, _parent: *client.wl.Surface) !*client.wl.Subsurface {
                const _proxy: *client.wl.Proxy = @ptrCast(_subcompositor);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                    .{ .o = @ptrCast(_parent) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Subsurface.interface));
            }
            pub const get_subsurface_since_version = 1;
        };

        /// An additional interface to a wl_surface object, which has been
        /// made a sub-surface. A sub-surface has one parent surface. A
        /// sub-surface's size and position are not limited to that of the parent.
        /// Particularly, a sub-surface is not automatically clipped to its
        /// parent's area.
        ///
        /// A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
        /// and the parent surface is mapped. The order of which one happens
        /// first is irrelevant. A sub-surface is hidden if the parent becomes
        /// hidden, or if a NULL wl_buffer is applied. These rules apply
        /// recursively through the tree of surfaces.
        ///
        /// The behaviour of a wl_surface.commit request on a sub-surface
        /// depends on the sub-surface's mode. The possible modes are
        /// synchronized and desynchronized, see methods
        /// wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
        /// mode caches the wl_surface state to be applied when the parent's
        /// state gets applied, and desynchronized mode applies the pending
        /// wl_surface state directly. A sub-surface is initially in the
        /// synchronized mode.
        ///
        /// Sub-surfaces also have another kind of state, which is managed by
        /// wl_subsurface requests, as opposed to wl_surface requests. This
        /// state includes the sub-surface position relative to the parent
        /// surface (wl_subsurface.set_position), and the stacking order of
        /// the parent and its sub-surfaces (wl_subsurface.place_above and
        /// .place_below). This state is applied when the parent surface's
        /// wl_surface state is applied, regardless of the sub-surface's mode.
        /// As the exception, set_sync and set_desync are effective immediately.
        ///
        /// The main surface can be thought to be always in desynchronized mode,
        /// since it does not have a parent in the sub-surfaces sense.
        ///
        /// Even if a sub-surface is in desynchronized mode, it will behave as
        /// in synchronized mode, if its parent surface behaves as in
        /// synchronized mode. This rule is applied recursively throughout the
        /// tree of surfaces. This means, that one can set a sub-surface into
        /// synchronized mode, and then assume that all its child and grand-child
        /// sub-surfaces are synchronized, too, without explicitly setting them.
        ///
        /// Destroying a sub-surface takes effect immediately. If you need to
        /// synchronize the removal of a sub-surface to the parent surface update,
        /// unmap the sub-surface first by attaching a NULL wl_buffer, update parent,
        /// and then destroy the sub-surface.
        ///
        /// If the parent wl_surface object is destroyed, the sub-surface is
        /// unmapped.
        ///
        /// A sub-surface never has the keyboard focus of any seat.
        ///
        /// The wl_surface.offset request is ignored: clients must use set_position
        /// instead to move the sub-surface.
        pub const Subsurface = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.subsurface.interface;
            pub const Error = common.wl.subsurface.Error;
            pub inline fn getId(_subsurface: *Subsurface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_subsurface)).getId();
            }
            pub inline fn getVersion(_subsurface: *Subsurface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_subsurface)).getVersion();
            }
            pub inline fn getUserData(_subsurface: *Subsurface) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_subsurface)).getUserData();
            }
            pub inline fn setQueue(_subsurface: *Subsurface, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                _proxy.setQueue(_queue);
            }
            /// The sub-surface interface is removed from the wl_surface object
            /// that was turned into a sub-surface with a
            /// wl_subcompositor.get_subsurface request. The wl_surface's association
            /// to the parent is deleted. The wl_surface is unmapped immediately.
            pub fn destroy(_subsurface: *Subsurface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This schedules a sub-surface position change.
            /// The sub-surface will be moved so that its origin (top left
            /// corner pixel) will be at the location x, y of the parent surface
            /// coordinate system. The coordinates are not restricted to the parent
            /// surface area. Negative values are allowed.
            ///
            /// The scheduled coordinates will take effect whenever the state of the
            /// parent surface is applied.
            ///
            /// If more than one set_position request is invoked by the client before
            /// the commit of the parent surface, the position of a new request always
            /// replaces the scheduled position from any previous request.
            ///
            /// The initial position is 0, 0.
            pub fn setPosition(_subsurface: *Subsurface, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_position_since_version = 1;

            /// This sub-surface is taken from the stack, and put back just
            /// above the reference surface, changing the z-order of the sub-surfaces.
            /// The reference surface must be one of the sibling surfaces, or the
            /// parent surface. Using any other surface, including this sub-surface,
            /// will cause a protocol error.
            ///
            /// The z-order is double-buffered. Requests are handled in order and
            /// applied immediately to a pending state. The final pending state is
            /// copied to the active state the next time the state of the parent
            /// surface is applied.
            ///
            /// A new sub-surface is initially added as the top-most in the stack
            /// of its siblings and parent.
            pub fn placeAbove(_subsurface: *Subsurface, _sibling: *client.wl.Surface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_sibling) },
                };
                _proxy.marshal(2, &_args);
            }
            pub const place_above_since_version = 1;

            /// The sub-surface is placed just below the reference surface.
            /// See wl_subsurface.place_above.
            pub fn placeBelow(_subsurface: *Subsurface, _sibling: *client.wl.Surface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_sibling) },
                };
                _proxy.marshal(3, &_args);
            }
            pub const place_below_since_version = 1;

            /// Change the commit behaviour of the sub-surface to synchronized
            /// mode, also described as the parent dependent mode.
            ///
            /// In synchronized mode, wl_surface.commit on a sub-surface will
            /// accumulate the committed state in a cache, but the state will
            /// not be applied and hence will not change the compositor output.
            /// The cached state is applied to the sub-surface immediately after
            /// the parent surface's state is applied. This ensures atomic
            /// updates of the parent and all its synchronized sub-surfaces.
            /// Applying the cached state will invalidate the cache, so further
            /// parent surface commits do not (re-)apply old state.
            ///
            /// See wl_subsurface for the recursive effect of this mode.
            pub fn setSync(_subsurface: *Subsurface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                _proxy.marshal(4, null);
            }
            pub const set_sync_since_version = 1;

            /// Change the commit behaviour of the sub-surface to desynchronized
            /// mode, also described as independent or freely running mode.
            ///
            /// In desynchronized mode, wl_surface.commit on a sub-surface will
            /// apply the pending state directly, without caching, as happens
            /// normally with a wl_surface. Calling wl_surface.commit on the
            /// parent surface has no effect on the sub-surface's wl_surface
            /// state. This mode allows a sub-surface to be updated on its own.
            ///
            /// If cached state exists when wl_surface.commit is called in
            /// desynchronized mode, the pending state is added to the cached
            /// state, and applied as a whole. This invalidates the cache.
            ///
            /// Note: even if a sub-surface is set to desynchronized, a parent
            /// sub-surface may override it to behave as synchronized. For details,
            /// see wl_subsurface.
            ///
            /// If a surface's parent surface behaves as desynchronized, then
            /// the cached state is applied on set_desync.
            pub fn setDesync(_subsurface: *Subsurface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_subsurface);
                _proxy.marshal(5, null);
            }
            pub const set_desync_since_version = 1;
        };

        /// A singleton global object that provides support for shared
        /// memory.
        ///
        /// Clients can create wl_shm_pool objects using the create_pool
        /// request.
        ///
        /// On binding the wl_shm object one or more format events
        /// are emitted to inform clients about the valid pixel formats
        /// that can be used for buffers.
        pub const Shm = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.shm.interface;
            pub const Error = common.wl.shm.Error;
            pub const Format = common.wl.shm.Format;
            pub inline fn getId(_shm: *Shm) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shm)).getId();
            }
            pub inline fn getVersion(_shm: *Shm) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shm)).getVersion();
            }
            pub inline fn getUserData(_shm: *Shm) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_shm)).getUserData();
            }
            pub inline fn setQueue(_shm: *Shm, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const format_since_version = 1;

                /// Informs the client about a valid pixel format that
                /// can be used for buffers. Known formats include
                /// argb8888 and xrgb8888.
                format: struct {
                    format: Format,
                },
            };
            pub inline fn setListener(
                _shm: *Shm,
                comptime T: type,
                _listener: *const fn (shm: *Shm, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Shm, T).dispatcher, _listener, _mut_data);
            }
            /// Create a new wl_shm_pool object.
            ///
            /// The pool can be used to create shared memory based buffer
            /// objects.  The server will mmap size bytes of the passed file
            /// descriptor, to use as backing memory for the pool.
            pub fn createPool(_shm: *Shm, _fd: i32, _size: i32) !*client.wl.ShmPool {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .h = _fd },
                    .{ .i = _size },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.ShmPool.interface));
            }
            pub const create_pool_since_version = 1;
            pub inline fn destroy(_shm: *Shm) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm);
                _proxy.destroy();
            }
        };

        /// The wl_shm_pool object encapsulates a piece of memory shared
        /// between the compositor and client.  Through the wl_shm_pool
        /// object, the client can allocate shared memory wl_buffer objects.
        /// All objects created through the same pool share the same
        /// underlying mapped memory. Reusing the mapped memory avoids the
        /// setup/teardown overhead and is useful when interactively resizing
        /// a surface or for many small buffers.
        pub const ShmPool = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.shm_pool.interface;
            pub inline fn getId(_shm_pool: *ShmPool) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shm_pool)).getId();
            }
            pub inline fn getVersion(_shm_pool: *ShmPool) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shm_pool)).getVersion();
            }
            pub inline fn getUserData(_shm_pool: *ShmPool) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_shm_pool)).getUserData();
            }
            pub inline fn setQueue(_shm_pool: *ShmPool, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm_pool);
                _proxy.setQueue(_queue);
            }
            /// Create a wl_buffer object from the pool.
            ///
            /// The buffer is created offset bytes into the pool and has
            /// width and height as specified.  The stride argument specifies
            /// the number of bytes from the beginning of one row to the beginning
            /// of the next.  The format is the pixel format of the buffer and
            /// must be one of those advertised through the wl_shm.format event.
            ///
            /// A buffer will keep a reference to the pool it was created from
            /// so it is valid to destroy the pool immediately after creating
            /// a buffer from it.
            pub fn createBuffer(_shm_pool: *ShmPool, _offset: i32, _width: i32, _height: i32, _stride: i32, _format: common.wl.shm.Format) !*client.wl.Buffer {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm_pool);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .i = _offset },
                    .{ .i = _width },
                    .{ .i = _height },
                    .{ .i = _stride },
                    .{ .u = switch (@typeInfo(common.wl.shm.Format)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_format))),
                        .@"struct" => @bitCast(_format),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Buffer.interface));
            }
            pub const create_buffer_since_version = 1;

            /// Destroy the shared memory pool.
            ///
            /// The mmapped memory will be released when all
            /// buffers that have been created from this pool
            /// are gone.
            pub fn destroy(_shm_pool: *ShmPool) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm_pool);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request will cause the server to remap the backing memory
            /// for the pool from the file descriptor passed when the pool was
            /// created, but using the new size.  This request can only be
            /// used to make the pool bigger.
            ///
            /// This request only changes the amount of bytes that are mmapped
            /// by the server and does not touch the file corresponding to the
            /// file descriptor passed at creation time. It is the client's
            /// responsibility to ensure that the file is at least as big as
            /// the new pool size.
            pub fn resize(_shm_pool: *ShmPool, _size: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shm_pool);
                var _args = [_]common.Argument{
                    .{ .i = _size },
                };
                _proxy.marshal(2, &_args);
            }
            pub const resize_since_version = 1;
        };

        /// An output describes part of the compositor geometry.  The
        /// compositor works in the 'compositor coordinate system' and an
        /// output corresponds to a rectangular area in that space that is
        /// actually visible.  This typically corresponds to a monitor that
        /// displays part of the compositor space.  This object is published
        /// as global during start up, or when a monitor is hotplugged.
        pub const Output = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.output.interface;
            pub const Subpixel = common.wl.output.Subpixel;
            pub const Transform = common.wl.output.Transform;
            pub const Mode = common.wl.output.Mode;
            pub inline fn getId(_output: *Output) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output)).getId();
            }
            pub inline fn getVersion(_output: *Output) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output)).getVersion();
            }
            pub inline fn getUserData(_output: *Output) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_output)).getUserData();
            }
            pub inline fn setQueue(_output: *Output, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const geometry_since_version = 1;
                pub const mode_since_version = 1;
                pub const done_since_version = 2;
                pub const scale_since_version = 2;
                pub const name_since_version = 4;
                pub const description_since_version = 4;

                /// The geometry event describes geometric properties of the output.
                /// The event is sent when binding to the output object and whenever
                /// any of the properties change.
                ///
                /// The physical size can be set to zero if it doesn't make sense for this
                /// output (e.g. for projectors or virtual outputs).
                ///
                /// The geometry event will be followed by a done event (starting from
                /// version 2).
                ///
                /// Clients should use wl_surface.preferred_buffer_transform instead of the
                /// transform advertised by this event to find the preferred buffer
                /// transform to use for a surface.
                ///
                /// Note: wl_output only advertises partial information about the output
                /// position and identification. Some compositors, for instance those not
                /// implementing a desktop-style output layout or those exposing virtual
                /// outputs, might fake this information. Instead of using x and y, clients
                /// should use xdg_output.logical_position. Instead of using make and model,
                /// clients should use name and description.
                geometry: struct {
                    x: i32,
                    y: i32,
                    physical_width: i32,
                    physical_height: i32,
                    subpixel: Subpixel,
                    make: [*:0]const u8,
                    model: [*:0]const u8,
                    transform: Transform,
                },

                /// The mode event describes an available mode for the output.
                ///
                /// The event is sent when binding to the output object and there
                /// will always be one mode, the current mode.  The event is sent
                /// again if an output changes mode, for the mode that is now
                /// current.  In other words, the current mode is always the last
                /// mode that was received with the current flag set.
                ///
                /// Non-current modes are deprecated. A compositor can decide to only
                /// advertise the current mode and never send other modes. Clients
                /// should not rely on non-current modes.
                ///
                /// The size of a mode is given in physical hardware units of
                /// the output device. This is not necessarily the same as
                /// the output size in the global compositor space. For instance,
                /// the output may be scaled, as described in wl_output.scale,
                /// or transformed, as described in wl_output.transform. Clients
                /// willing to retrieve the output size in the global compositor
                /// space should use xdg_output.logical_size instead.
                ///
                /// The vertical refresh rate can be set to zero if it doesn't make
                /// sense for this output (e.g. for virtual outputs).
                ///
                /// The mode event will be followed by a done event (starting from
                /// version 2).
                ///
                /// Clients should not use the refresh rate to schedule frames. Instead,
                /// they should use the wl_surface.frame event or the presentation-time
                /// protocol.
                ///
                /// Note: this information is not always meaningful for all outputs. Some
                /// compositors, such as those exposing virtual outputs, might fake the
                /// refresh rate or the size.
                mode: struct {
                    flags: Mode,
                    width: i32,
                    height: i32,
                    refresh: i32,
                },

                /// This event is sent after all other properties have been
                /// sent after binding to the output object and after any
                /// other property changes done after that. This allows
                /// changes to the output properties to be seen as
                /// atomic, even if they happen via multiple events.
                done: void,
                /// This event contains scaling geometry information
                /// that is not in the geometry event. It may be sent after
                /// binding the output object or if the output scale changes
                /// later. The compositor will emit a non-zero, positive
                /// value for scale. If it is not sent, the client should
                /// assume a scale of 1.
                ///
                /// A scale larger than 1 means that the compositor will
                /// automatically scale surface buffers by this amount
                /// when rendering. This is used for very high resolution
                /// displays where applications rendering at the native
                /// resolution would be too small to be legible.
                ///
                /// Clients should use wl_surface.preferred_buffer_scale
                /// instead of this event to find the preferred buffer
                /// scale to use for a surface.
                ///
                /// The scale event will be followed by a done event.
                scale: struct {
                    factor: i32,
                },

                /// Many compositors will assign user-friendly names to their outputs, show
                /// them to the user, allow the user to refer to an output, etc. The client
                /// may wish to know this name as well to offer the user similar behaviors.
                ///
                /// The name is a UTF-8 string with no convention defined for its contents.
                /// Each name is unique among all wl_output globals. The name is only
                /// guaranteed to be unique for the compositor instance.
                ///
                /// The same output name is used for all clients for a given wl_output
                /// global. Thus, the name can be shared across processes to refer to a
                /// specific wl_output global.
                ///
                /// The name is not guaranteed to be persistent across sessions, thus cannot
                /// be used to reliably identify an output in e.g. configuration files.
                ///
                /// Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do
                /// not assume that the name is a reflection of an underlying DRM connector,
                /// X11 connection, etc.
                ///
                /// The name event is sent after binding the output object. This event is
                /// only sent once per output object, and the name does not change over the
                /// lifetime of the wl_output global.
                ///
                /// Compositors may re-use the same output name if the wl_output global is
                /// destroyed and re-created later. Compositors should avoid re-using the
                /// same name if possible.
                ///
                /// The name event will be followed by a done event.
                name: struct {
                    name: [*:0]const u8,
                },

                /// Many compositors can produce human-readable descriptions of their
                /// outputs. The client may wish to know this description as well, e.g. for
                /// output selection purposes.
                ///
                /// The description is a UTF-8 string with no convention defined for its
                /// contents. The description is not guaranteed to be unique among all
                /// wl_output globals. Examples might include 'Foocorp 11" Display' or
                /// 'Virtual X11 output via :1'.
                ///
                /// The description event is sent after binding the output object and
                /// whenever the description changes. The description is optional, and may
                /// not be sent at all.
                ///
                /// The description event will be followed by a done event.
                description: struct {
                    description: [*:0]const u8,
                },
            };
            pub inline fn setListener(
                _output: *Output,
                comptime T: type,
                _listener: *const fn (output: *Output, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Output, T).dispatcher, _listener, _mut_data);
            }
            /// Using this request a client can tell the server that it is not going to
            /// use the output object anymore.
            pub fn release(_output: *Output) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const release_since_version = 3;
            pub inline fn destroy(_output: *Output) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output);
                _proxy.destroy();
            }
        };

        /// A seat is a group of keyboards, pointer and touch devices. This
        /// object is published as a global during start up, or when such a
        /// device is hot plugged.  A seat typically has a pointer and
        /// maintains a keyboard focus and a pointer focus.
        pub const Seat = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.seat.interface;
            pub const Capability = common.wl.seat.Capability;
            pub const Error = common.wl.seat.Error;
            pub inline fn getId(_seat: *Seat) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_seat)).getId();
            }
            pub inline fn getVersion(_seat: *Seat) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_seat)).getVersion();
            }
            pub inline fn getUserData(_seat: *Seat) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_seat)).getUserData();
            }
            pub inline fn setQueue(_seat: *Seat, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const capabilities_since_version = 1;
                pub const name_since_version = 2;

                /// This is sent on binding to the seat global or whenever a seat gains
                /// or loses the pointer, keyboard or touch capabilities.
                /// The argument is a capability enum containing the complete set of
                /// capabilities this seat has.
                ///
                /// When the pointer capability is added, a client may create a
                /// wl_pointer object using the wl_seat.get_pointer request. This object
                /// will receive pointer events until the capability is removed in the
                /// future.
                ///
                /// When the pointer capability is removed, a client should destroy the
                /// wl_pointer objects associated with the seat where the capability was
                /// removed, using the wl_pointer.release request. No further pointer
                /// events will be received on these objects.
                ///
                /// In some compositors, if a seat regains the pointer capability and a
                /// client has a previously obtained wl_pointer object of version 4 or
                /// less, that object may start sending pointer events again. This
                /// behavior is considered a misinterpretation of the intended behavior
                /// and must not be relied upon by the client. wl_pointer objects of
                /// version 5 or later must not send events if created before the most
                /// recent event notifying the client of an added pointer capability.
                ///
                /// The above behavior also applies to wl_keyboard and wl_touch with the
                /// keyboard and touch capabilities, respectively.
                capabilities: struct {
                    capabilities: Capability,
                },

                /// In a multi-seat configuration the seat name can be used by clients to
                /// help identify which physical devices the seat represents.
                ///
                /// The seat name is a UTF-8 string with no convention defined for its
                /// contents. Each name is unique among all wl_seat globals. The name is
                /// only guaranteed to be unique for the current compositor instance.
                ///
                /// The same seat names are used for all clients. Thus, the name can be
                /// shared across processes to refer to a specific wl_seat global.
                ///
                /// The name event is sent after binding to the seat global, and should be sent
                /// before announcing capabilities. This event only sent once per seat object,
                /// and the name does not change over the lifetime of the wl_seat global.
                ///
                /// Compositors may re-use the same seat name if the wl_seat global is
                /// destroyed and re-created later.
                name: struct {
                    name: [*:0]const u8,
                },
            };
            pub inline fn setListener(
                _seat: *Seat,
                comptime T: type,
                _listener: *const fn (seat: *Seat, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Seat, T).dispatcher, _listener, _mut_data);
            }
            /// The ID provided will be initialized to the wl_pointer interface
            /// for this seat.
            ///
            /// This request only takes effect if the seat has the pointer
            /// capability, or has had the pointer capability in the past.
            /// It is a protocol violation to issue this request on a seat that has
            /// never had the pointer capability. The missing_capability error will
            /// be sent in this case.
            pub fn getPointer(_seat: *Seat) !*client.wl.Pointer {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.Pointer.interface));
            }
            pub const get_pointer_since_version = 1;

            /// The ID provided will be initialized to the wl_keyboard interface
            /// for this seat.
            ///
            /// This request only takes effect if the seat has the keyboard
            /// capability, or has had the keyboard capability in the past.
            /// It is a protocol violation to issue this request on a seat that has
            /// never had the keyboard capability. The missing_capability error will
            /// be sent in this case.
            pub fn getKeyboard(_seat: *Seat) !*client.wl.Keyboard {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.Keyboard.interface));
            }
            pub const get_keyboard_since_version = 1;

            /// The ID provided will be initialized to the wl_touch interface
            /// for this seat.
            ///
            /// This request only takes effect if the seat has the touch
            /// capability, or has had the touch capability in the past.
            /// It is a protocol violation to issue this request on a seat that has
            /// never had the touch capability. The missing_capability error will
            /// be sent in this case.
            pub fn getTouch(_seat: *Seat) !*client.wl.Touch {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.wl.Touch.interface));
            }
            pub const get_touch_since_version = 1;

            /// Using this request a client can tell the server that it is not going to
            /// use the seat object anymore.
            pub fn release(_seat: *Seat) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                _proxy.marshal(3, null);
                _proxy.destroy();
            }
            pub const release_since_version = 5;
            pub inline fn destroy(_seat: *Seat) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat);
                _proxy.destroy();
            }
        };

        /// The wl_pointer interface represents one or more input devices,
        /// such as mice, which control the pointer location and pointer_focus
        /// of a seat.
        ///
        /// The wl_pointer interface generates motion, enter and leave
        /// events for the surfaces that the pointer is located over,
        /// and button and axis events for button presses, button releases
        /// and scrolling.
        pub const Pointer = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.pointer.interface;
            pub const Error = common.wl.pointer.Error;
            pub const ButtonState = common.wl.pointer.ButtonState;
            pub const Axis = common.wl.pointer.Axis;
            pub const AxisSource = common.wl.pointer.AxisSource;
            pub const AxisRelativeDirection = common.wl.pointer.AxisRelativeDirection;
            pub inline fn getId(_pointer: *Pointer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer)).getId();
            }
            pub inline fn getVersion(_pointer: *Pointer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer)).getVersion();
            }
            pub inline fn getUserData(_pointer: *Pointer) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer)).getUserData();
            }
            pub inline fn setQueue(_pointer: *Pointer, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const enter_since_version = 1;
                pub const leave_since_version = 1;
                pub const motion_since_version = 1;
                pub const button_since_version = 1;
                pub const axis_since_version = 1;
                pub const frame_since_version = 5;
                pub const axis_source_since_version = 5;
                pub const axis_stop_since_version = 5;
                pub const axis_discrete_since_version = 5;

                /// Notification that this seat's pointer is focused on a certain
                /// surface.
                ///
                /// When a seat's focus enters a surface, the pointer image
                /// is undefined and a client should respond to this event by setting
                /// an appropriate pointer image with the set_cursor request.
                enter: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                    surface_x: common.Fixed,
                    surface_y: common.Fixed,
                },

                /// Notification that this seat's pointer is no longer focused on
                /// a certain surface.
                ///
                /// The leave notification is sent before the enter notification
                /// for the new focus.
                leave: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                },

                /// Notification of pointer location change. The arguments
                /// surface_x and surface_y are the location relative to the
                /// focused surface.
                motion: struct {
                    time: u32,
                    surface_x: common.Fixed,
                    surface_y: common.Fixed,
                },

                /// Mouse button click and release notifications.
                ///
                /// The location of the click is given by the last motion or
                /// enter event.
                /// The time argument is a timestamp with millisecond
                /// granularity, with an undefined base.
                ///
                /// The button is a button code as defined in the Linux kernel's
                /// linux/input-event-codes.h header file, e.g. BTN_LEFT.
                ///
                /// Any 16-bit button code value is reserved for future additions to the
                /// kernel's event code list. All other button codes above 0xFFFF are
                /// currently undefined but may be used in future versions of this
                /// protocol.
                button: struct {
                    serial: u32,
                    time: u32,
                    button: u32,
                    state: ButtonState,
                },

                /// Scroll and other axis notifications.
                ///
                /// For scroll events (vertical and horizontal scroll axes), the
                /// value parameter is the length of a vector along the specified
                /// axis in a coordinate space identical to those of motion events,
                /// representing a relative movement along the specified axis.
                ///
                /// For devices that support movements non-parallel to axes multiple
                /// axis events will be emitted.
                ///
                /// When applicable, for example for touch pads, the server can
                /// choose to emit scroll events where the motion vector is
                /// equivalent to a motion event vector.
                ///
                /// When applicable, a client can transform its content relative to the
                /// scroll distance.
                axis: struct {
                    time: u32,
                    axis: Axis,
                    value: common.Fixed,
                },

                /// Indicates the end of a set of events that logically belong together.
                /// A client is expected to accumulate the data in all events within the
                /// frame before proceeding.
                ///
                /// All wl_pointer events before a wl_pointer.frame event belong
                /// logically together. For example, in a diagonal scroll motion the
                /// compositor will send an optional wl_pointer.axis_source event, two
                /// wl_pointer.axis events (horizontal and vertical) and finally a
                /// wl_pointer.frame event. The client may use this information to
                /// calculate a diagonal vector for scrolling.
                ///
                /// When multiple wl_pointer.axis events occur within the same frame,
                /// the motion vector is the combined motion of all events.
                /// When a wl_pointer.axis and a wl_pointer.axis_stop event occur within
                /// the same frame, this indicates that axis movement in one axis has
                /// stopped but continues in the other axis.
                /// When multiple wl_pointer.axis_stop events occur within the same
                /// frame, this indicates that these axes stopped in the same instance.
                ///
                /// A wl_pointer.frame event is sent for every logical event group,
                /// even if the group only contains a single wl_pointer event.
                /// Specifically, a client may get a sequence: motion, frame, button,
                /// frame, axis, frame, axis_stop, frame.
                ///
                /// The wl_pointer.enter and wl_pointer.leave events are logical events
                /// generated by the compositor and not the hardware. These events are
                /// also grouped by a wl_pointer.frame. When a pointer moves from one
                /// surface to another, a compositor should group the
                /// wl_pointer.leave event within the same wl_pointer.frame.
                /// However, a client must not rely on wl_pointer.leave and
                /// wl_pointer.enter being in the same wl_pointer.frame.
                /// Compositor-specific policies may require the wl_pointer.leave and
                /// wl_pointer.enter event being split across multiple wl_pointer.frame
                /// groups.
                frame: void,
                /// Source information for scroll and other axes.
                ///
                /// This event does not occur on its own. It is sent before a
                /// wl_pointer.frame event and carries the source information for
                /// all events within that frame.
                ///
                /// The source specifies how this event was generated. If the source is
                /// wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be
                /// sent when the user lifts the finger off the device.
                ///
                /// If the source is wl_pointer.axis_source.wheel,
                /// wl_pointer.axis_source.wheel_tilt or
                /// wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may
                /// or may not be sent. Whether a compositor sends an axis_stop event
                /// for these sources is hardware-specific and implementation-dependent;
                /// clients must not rely on receiving an axis_stop event for these
                /// scroll sources and should treat scroll sequences from these scroll
                /// sources as unterminated by default.
                ///
                /// This event is optional. If the source is unknown for a particular
                /// axis event sequence, no event is sent.
                /// Only one wl_pointer.axis_source event is permitted per frame.
                ///
                /// The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
                /// not guaranteed.
                axis_source: struct {
                    axis_source: AxisSource,
                },

                /// Stop notification for scroll and other axes.
                ///
                /// For some wl_pointer.axis_source types, a wl_pointer.axis_stop event
                /// is sent to notify a client that the axis sequence has terminated.
                /// This enables the client to implement kinetic scrolling.
                /// See the wl_pointer.axis_source documentation for information on when
                /// this event may be generated.
                ///
                /// Any wl_pointer.axis events with the same axis_source after this
                /// event should be considered as the start of a new axis motion.
                ///
                /// The timestamp is to be interpreted identical to the timestamp in the
                /// wl_pointer.axis event. The timestamp value may be the same as a
                /// preceding wl_pointer.axis event.
                axis_stop: struct {
                    time: u32,
                    axis: Axis,
                },

                /// Discrete step information for scroll and other axes.
                ///
                /// This event carries the axis value of the wl_pointer.axis event in
                /// discrete steps (e.g. mouse wheel clicks).
                ///
                /// This event is deprecated with wl_pointer version 8 - this event is not
                /// sent to clients supporting version 8 or later.
                ///
                /// This event does not occur on its own, it is coupled with a
                /// wl_pointer.axis event that represents this axis value on a
                /// continuous scale. The protocol guarantees that each axis_discrete
                /// event is always followed by exactly one axis event with the same
                /// axis number within the same wl_pointer.frame. Note that the protocol
                /// allows for other events to occur between the axis_discrete and
                /// its coupled axis event, including other axis_discrete or axis
                /// events. A wl_pointer.frame must not contain more than one axis_discrete
                /// event per axis type.
                ///
                /// This event is optional; continuous scrolling devices
                /// like two-finger scrolling on touchpads do not have discrete
                /// steps and do not generate this event.
                ///
                /// The discrete value carries the directional information. e.g. a value
                /// of -2 is two steps towards the negative direction of this axis.
                ///
                /// The axis number is identical to the axis number in the associated
                /// axis event.
                ///
                /// The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
                /// not guaranteed.
                axis_discrete: struct {
                    axis: Axis,
                    discrete: i32,
                },
            };
            pub inline fn setListener(
                _pointer: *Pointer,
                comptime T: type,
                _listener: *const fn (pointer: *Pointer, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Pointer, T).dispatcher, _listener, _mut_data);
            }
            /// Set the pointer surface, i.e., the surface that contains the
            /// pointer image (cursor). This request gives the surface the role
            /// of a cursor. If the surface already has another role, it raises
            /// a protocol error.
            ///
            /// The cursor actually changes only if the pointer
            /// focus for this device is one of the requesting client's surfaces
            /// or the surface parameter is the current pointer surface. If
            /// there was a previous surface set with this request it is
            /// replaced. If surface is NULL, the pointer image is hidden.
            ///
            /// The parameters hotspot_x and hotspot_y define the position of
            /// the pointer surface relative to the pointer location. Its
            /// top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
            /// where (x, y) are the coordinates of the pointer location, in
            /// surface-local coordinates.
            ///
            /// On wl_surface.offset requests to the pointer surface, hotspot_x
            /// and hotspot_y are decremented by the x and y parameters
            /// passed to the request. The offset must be applied by
            /// wl_surface.commit as usual.
            ///
            /// The hotspot can also be updated by passing the currently set
            /// pointer surface to this request with new values for hotspot_x
            /// and hotspot_y.
            ///
            /// The input region is ignored for wl_surfaces with the role of
            /// a cursor. When the use as a cursor ends, the wl_surface is
            /// unmapped.
            ///
            /// The serial parameter must match the latest wl_pointer.enter
            /// serial number sent to the client. Otherwise the request will be
            /// ignored.
            pub fn setCursor(_pointer: *Pointer, _serial: u32, _surface: ?*client.wl.Surface, _hotspot_x: i32, _hotspot_y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                    .{ .i = _hotspot_x },
                    .{ .i = _hotspot_y },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_cursor_since_version = 1;

            /// Using this request a client can tell the server that it is not going to
            /// use the pointer object anymore.
            ///
            /// This request destroys the pointer proxy object, so clients must not call
            /// wl_pointer_destroy() after using this request.
            pub fn release(_pointer: *Pointer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const release_since_version = 3;
            pub inline fn destroy(_pointer: *Pointer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer);
                _proxy.destroy();
            }
        };

        /// The wl_keyboard interface represents one or more keyboards
        /// associated with a seat.
        ///
        /// Each wl_keyboard has the following logical state:
        ///
        /// - an active surface (possibly null),
        /// - the keys currently logically down,
        /// - the active modifiers,
        /// - the active group.
        ///
        /// By default, the active surface is null, the keys currently logically down
        /// are empty, the active modifiers and the active group are 0.
        pub const Keyboard = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.keyboard.interface;
            pub const KeymapFormat = common.wl.keyboard.KeymapFormat;
            pub const KeyState = common.wl.keyboard.KeyState;
            pub inline fn getId(_keyboard: *Keyboard) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_keyboard)).getId();
            }
            pub inline fn getVersion(_keyboard: *Keyboard) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_keyboard)).getVersion();
            }
            pub inline fn getUserData(_keyboard: *Keyboard) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_keyboard)).getUserData();
            }
            pub inline fn setQueue(_keyboard: *Keyboard, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_keyboard);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const keymap_since_version = 1;
                pub const enter_since_version = 1;
                pub const leave_since_version = 1;
                pub const key_since_version = 1;
                pub const modifiers_since_version = 1;
                pub const repeat_info_since_version = 4;

                /// This event provides a file descriptor to the client which can be
                /// memory-mapped in read-only mode to provide a keyboard mapping
                /// description.
                ///
                /// From version 7 onwards, the fd must be mapped with MAP_PRIVATE by
                /// the recipient, as MAP_SHARED may fail.
                keymap: struct {
                    format: KeymapFormat,
                    fd: i32,
                    size: u32,
                },

                /// Notification that this seat's keyboard focus is on a certain
                /// surface.
                ///
                /// The compositor must send the wl_keyboard.modifiers event after this
                /// event.
                ///
                /// In the wl_keyboard logical state, this event sets the active surface to
                /// the surface argument and the keys currently logically down to the keys
                /// in the keys argument. The compositor must not send this event if the
                /// wl_keyboard already had an active surface immediately before this event.
                ///
                /// Clients should not use the list of pressed keys to emulate key-press
                /// events. The order of keys in the list is unspecified.
                enter: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                    keys: *common.Array,
                },

                /// Notification that this seat's keyboard focus is no longer on
                /// a certain surface.
                ///
                /// The leave notification is sent before the enter notification
                /// for the new focus.
                ///
                /// In the wl_keyboard logical state, this event resets all values to their
                /// defaults. The compositor must not send this event if the active surface
                /// of the wl_keyboard was not equal to the surface argument immediately
                /// before this event.
                leave: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                },

                /// A key was pressed or released.
                /// The time argument is a timestamp with millisecond
                /// granularity, with an undefined base.
                ///
                /// The key is a platform-specific key code that can be interpreted
                /// by feeding it to the keyboard mapping (see the keymap event).
                ///
                /// If this event produces a change in modifiers, then the resulting
                /// wl_keyboard.modifiers event must be sent after this event.
                ///
                /// In the wl_keyboard logical state, this event adds the key to the keys
                /// currently logically down (if the state argument is pressed) or removes
                /// the key from the keys currently logically down (if the state argument is
                /// released). The compositor must not send this event if the wl_keyboard
                /// did not have an active surface immediately before this event. The
                /// compositor must not send this event if state is pressed (resp. released)
                /// and the key was already logically down (resp. was not logically down)
                /// immediately before this event.
                ///
                /// Since version 10, compositors may send key events with the "repeated"
                /// key state when a wl_keyboard.repeat_info event with a rate argument of
                /// 0 has been received. This allows the compositor to take over the
                /// responsibility of key repetition.
                key: struct {
                    serial: u32,
                    time: u32,
                    key: u32,
                    state: KeyState,
                },

                /// Notifies clients that the modifier and/or group state has
                /// changed, and it should update its local state.
                ///
                /// The compositor may send this event without a surface of the client
                /// having keyboard focus, for example to tie modifier information to
                /// pointer focus instead. If a modifier event with pressed modifiers is sent
                /// without a prior enter event, the client can assume the modifier state is
                /// valid until it receives the next wl_keyboard.modifiers event. In order to
                /// reset the modifier state again, the compositor can send a
                /// wl_keyboard.modifiers event with no pressed modifiers.
                ///
                /// In the wl_keyboard logical state, this event updates the modifiers and
                /// group.
                modifiers: struct {
                    serial: u32,
                    mods_depressed: u32,
                    mods_latched: u32,
                    mods_locked: u32,
                    group: u32,
                },

                /// Informs the client about the keyboard's repeat rate and delay.
                ///
                /// This event is sent as soon as the wl_keyboard object has been created,
                /// and is guaranteed to be received by the client before any key press
                /// event.
                ///
                /// Negative values for either rate or delay are illegal. A rate of zero
                /// will disable any repeating (regardless of the value of delay).
                ///
                /// This event can be sent later on as well with a new value if necessary,
                /// so clients should continue listening for the event past the creation
                /// of wl_keyboard.
                repeat_info: struct {
                    rate: i32,
                    delay: i32,
                },
            };
            pub inline fn setListener(
                _keyboard: *Keyboard,
                comptime T: type,
                _listener: *const fn (keyboard: *Keyboard, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_keyboard);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Keyboard, T).dispatcher, _listener, _mut_data);
            }
            pub fn release(_keyboard: *Keyboard) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_keyboard);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const release_since_version = 3;
            pub inline fn destroy(_keyboard: *Keyboard) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_keyboard);
                _proxy.destroy();
            }
        };

        /// The wl_touch interface represents a touchscreen
        /// associated with a seat.
        ///
        /// Touch interactions can consist of one or more contacts.
        /// For each contact, a series of events is generated, starting
        /// with a down event, followed by zero or more motion events,
        /// and ending with an up event. Events relating to the same
        /// contact point can be identified by the ID of the sequence.
        pub const Touch = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.touch.interface;
            pub inline fn getId(_touch: *Touch) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_touch)).getId();
            }
            pub inline fn getVersion(_touch: *Touch) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_touch)).getVersion();
            }
            pub inline fn getUserData(_touch: *Touch) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_touch)).getUserData();
            }
            pub inline fn setQueue(_touch: *Touch, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_touch);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const down_since_version = 1;
                pub const up_since_version = 1;
                pub const motion_since_version = 1;
                pub const frame_since_version = 1;
                pub const cancel_since_version = 1;
                pub const shape_since_version = 6;
                pub const orientation_since_version = 6;

                /// A new touch point has appeared on the surface. This touch point is
                /// assigned a unique ID. Future events from this touch point reference
                /// this ID. The ID ceases to be valid after a touch up event and may be
                /// reused in the future.
                down: struct {
                    serial: u32,
                    time: u32,
                    surface: ?*client.wl.Surface,
                    id: i32,
                    x: common.Fixed,
                    y: common.Fixed,
                },

                /// The touch point has disappeared. No further events will be sent for
                /// this touch point and the touch point's ID is released and may be
                /// reused in a future touch down event.
                up: struct {
                    serial: u32,
                    time: u32,
                    id: i32,
                },

                /// A touch point has changed coordinates.
                motion: struct {
                    time: u32,
                    id: i32,
                    x: common.Fixed,
                    y: common.Fixed,
                },

                /// Indicates the end of a set of events that logically belong together.
                /// A client is expected to accumulate the data in all events within the
                /// frame before proceeding.
                ///
                /// A wl_touch.frame terminates at least one event but otherwise no
                /// guarantee is provided about the set of events within a frame. A client
                /// must assume that any state not updated in a frame is unchanged from the
                /// previously known state.
                frame: void,
                /// Sent if the compositor decides the touch stream is a global
                /// gesture. No further events are sent to the clients from that
                /// particular gesture. Touch cancellation applies to all touch points
                /// currently active on this client's surface. The client is
                /// responsible for finalizing the touch points, future touch points on
                /// this surface may reuse the touch point ID.
                ///
                /// No frame event is required after the cancel event.
                cancel: void,
                /// Sent when a touchpoint has changed its shape.
                ///
                /// This event does not occur on its own. It is sent before a
                /// wl_touch.frame event and carries the new shape information for
                /// any previously reported, or new touch points of that frame.
                ///
                /// Other events describing the touch point such as wl_touch.down,
                /// wl_touch.motion or wl_touch.orientation may be sent within the
                /// same wl_touch.frame. A client should treat these events as a single
                /// logical touch point update. The order of wl_touch.shape,
                /// wl_touch.orientation and wl_touch.motion is not guaranteed.
                /// A wl_touch.down event is guaranteed to occur before the first
                /// wl_touch.shape event for this touch ID but both events may occur within
                /// the same wl_touch.frame.
                ///
                /// A touchpoint shape is approximated by an ellipse through the major and
                /// minor axis length. The major axis length describes the longer diameter
                /// of the ellipse, while the minor axis length describes the shorter
                /// diameter. Major and minor are orthogonal and both are specified in
                /// surface-local coordinates. The center of the ellipse is always at the
                /// touchpoint location as reported by wl_touch.down or wl_touch.move.
                ///
                /// This event is only sent by the compositor if the touch device supports
                /// shape reports. The client has to make reasonable assumptions about the
                /// shape if it did not receive this event.
                shape: struct {
                    id: i32,
                    major: common.Fixed,
                    minor: common.Fixed,
                },

                /// Sent when a touchpoint has changed its orientation.
                ///
                /// This event does not occur on its own. It is sent before a
                /// wl_touch.frame event and carries the new shape information for
                /// any previously reported, or new touch points of that frame.
                ///
                /// Other events describing the touch point such as wl_touch.down,
                /// wl_touch.motion or wl_touch.shape may be sent within the
                /// same wl_touch.frame. A client should treat these events as a single
                /// logical touch point update. The order of wl_touch.shape,
                /// wl_touch.orientation and wl_touch.motion is not guaranteed.
                /// A wl_touch.down event is guaranteed to occur before the first
                /// wl_touch.orientation event for this touch ID but both events may occur
                /// within the same wl_touch.frame.
                ///
                /// The orientation describes the clockwise angle of a touchpoint's major
                /// axis to the positive surface y-axis and is normalized to the -180 to
                /// +180 degree range. The granularity of orientation depends on the touch
                /// device, some devices only support binary rotation values between 0 and
                /// 90 degrees.
                ///
                /// This event is only sent by the compositor if the touch device supports
                /// orientation reports.
                orientation: struct {
                    id: i32,
                    orientation: common.Fixed,
                },
            };
            pub inline fn setListener(
                _touch: *Touch,
                comptime T: type,
                _listener: *const fn (touch: *Touch, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_touch);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Touch, T).dispatcher, _listener, _mut_data);
            }
            pub fn release(_touch: *Touch) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_touch);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const release_since_version = 3;
            pub inline fn destroy(_touch: *Touch) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_touch);
                _proxy.destroy();
            }
        };

        /// The wl_data_device_manager is a singleton global object that
        /// provides access to inter-client data transfer mechanisms such as
        /// copy-and-paste and drag-and-drop.  These mechanisms are tied to
        /// a wl_seat and this interface lets a client get a wl_data_device
        /// corresponding to a wl_seat.
        ///
        /// Depending on the version bound, the objects created from the bound
        /// wl_data_device_manager object will have different requirements for
        /// functioning properly. See wl_data_source.set_actions,
        /// wl_data_offer.accept and wl_data_offer.finish for details.
        pub const DataDeviceManager = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_device_manager.interface;
            pub const DndAction = common.wl.data_device_manager.DndAction;
            pub inline fn getId(_data_device_manager: *DataDeviceManager) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_device_manager)).getId();
            }
            pub inline fn getVersion(_data_device_manager: *DataDeviceManager) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_device_manager)).getVersion();
            }
            pub inline fn getUserData(_data_device_manager: *DataDeviceManager) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_data_device_manager)).getUserData();
            }
            pub inline fn setQueue(_data_device_manager: *DataDeviceManager, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device_manager);
                _proxy.setQueue(_queue);
            }
            /// Create a new data source.
            pub fn createDataSource(_data_device_manager: *DataDeviceManager) !*client.wl.DataSource {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device_manager);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.wl.DataSource.interface));
            }
            pub const create_data_source_since_version = 1;

            /// Create a new data device for a given seat.
            pub fn getDataDevice(_data_device_manager: *DataDeviceManager, _seat: *client.wl.Seat) !*client.wl.DataDevice {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device_manager);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_seat) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wl.DataDevice.interface));
            }
            pub const get_data_device_since_version = 1;
            pub inline fn destroy(_data_device_manager: *DataDeviceManager) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device_manager);
                _proxy.destroy();
            }
        };

        /// The wl_data_source object is the source side of a wl_data_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.
        pub const DataSource = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_source.interface;
            pub const Error = common.wl.data_source.Error;
            pub inline fn getId(_data_source: *DataSource) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_source)).getId();
            }
            pub inline fn getVersion(_data_source: *DataSource) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_source)).getVersion();
            }
            pub inline fn getUserData(_data_source: *DataSource) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_data_source)).getUserData();
            }
            pub inline fn setQueue(_data_source: *DataSource, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_source);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const target_since_version = 1;
                pub const send_since_version = 1;
                pub const cancelled_since_version = 1;
                pub const dnd_drop_performed_since_version = 3;
                pub const dnd_finished_since_version = 3;
                pub const action_since_version = 3;

                /// Sent when a target accepts pointer_focus or motion events.  If
                /// a target does not accept any of the offered types, type is NULL.
                ///
                /// Used for feedback during drag-and-drop.
                target: struct {
                    mime_type: ?[*:0]const u8,
                },

                /// Request for data from the client.  Send the data as the
                /// specified mime type over the passed file descriptor, then
                /// close it.
                send: struct {
                    mime_type: [*:0]const u8,
                    fd: i32,
                },

                /// This data source is no longer valid. There are several reasons why
                /// this could happen:
                ///
                /// - The data source has been replaced by another data source.
                /// - The drag-and-drop operation was performed, but the drop destination
                /// did not accept any of the mime types offered through
                /// wl_data_source.target.
                /// - The drag-and-drop operation was performed, but the drop destination
                /// did not select any of the actions present in the mask offered through
                /// wl_data_source.action.
                /// - The drag-and-drop operation was performed but didn't happen over a
                /// surface.
                /// - The compositor cancelled the drag-and-drop operation (e.g. compositor
                /// dependent timeouts to avoid stale drag-and-drop transfers).
                ///
                /// The client should clean up and destroy this data source.
                ///
                /// For objects of version 2 or older, wl_data_source.cancelled will
                /// only be emitted if the data source was replaced by another data
                /// source.
                cancelled: void,
                /// The user performed the drop action. This event does not indicate
                /// acceptance, wl_data_source.cancelled may still be emitted afterwards
                /// if the drop destination does not accept any mime type.
                ///
                /// However, this event might however not be received if the compositor
                /// cancelled the drag-and-drop operation before this event could happen.
                ///
                /// Note that the data_source may still be used in the future and should
                /// not be destroyed here.
                dnd_drop_performed: void,
                /// The drop destination finished interoperating with this data
                /// source, so the client is now free to destroy this data source and
                /// free all associated data.
                ///
                /// If the action used to perform the operation was "move", the
                /// source can now delete the transferred data.
                dnd_finished: void,
                /// This event indicates the action selected by the compositor after
                /// matching the source/destination side actions. Only one action (or
                /// none) will be offered here.
                ///
                /// This event can be emitted multiple times during the drag-and-drop
                /// operation, mainly in response to destination side changes through
                /// wl_data_offer.set_actions, and as the data device enters/leaves
                /// surfaces.
                ///
                /// It is only possible to receive this event after
                /// wl_data_source.dnd_drop_performed if the drag-and-drop operation
                /// ended in an "ask" action, in which case the final wl_data_source.action
                /// event will happen immediately before wl_data_source.dnd_finished.
                ///
                /// Compositors may also change the selected action on the fly, mainly
                /// in response to keyboard modifier changes during the drag-and-drop
                /// operation.
                ///
                /// The most recent action received is always the valid one. The chosen
                /// action may change alongside negotiation (e.g. an "ask" action can turn
                /// into a "move" operation), so the effects of the final action must
                /// always be applied in wl_data_offer.dnd_finished.
                ///
                /// Clients can trigger cursor surface changes from this point, so
                /// they reflect the current action.
                action: struct {
                    dnd_action: common.wl.data_device_manager.DndAction,
                },
            };
            pub inline fn setListener(
                _data_source: *DataSource,
                comptime T: type,
                _listener: *const fn (data_source: *DataSource, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_source);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(DataSource, T).dispatcher, _listener, _mut_data);
            }
            /// This request adds a mime type to the set of mime types
            /// advertised to targets.  Can be called several times to offer
            /// multiple types.
            pub fn offer(_data_source: *DataSource, _mime_type: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_source);
                var _args = [_]common.Argument{
                    .{ .s = _mime_type },
                };
                _proxy.marshal(0, &_args);
            }
            pub const offer_since_version = 1;

            /// Destroy the data source.
            pub fn destroy(_data_source: *DataSource) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_source);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Sets the actions that the source side client supports for this
            /// operation. This request may trigger wl_data_source.action and
            /// wl_data_offer.action events if the compositor needs to change the
            /// selected action.
            ///
            /// The dnd_actions argument must contain only values expressed in the
            /// wl_data_device_manager.dnd_actions enum, otherwise it will result
            /// in a protocol error.
            ///
            /// This request must be made once only, and can only be made on sources
            /// used in drag-and-drop, so it must be performed before
            /// wl_data_device.start_drag. Attempting to use the source other than
            /// for drag-and-drop will raise a protocol error.
            pub fn setActions(_data_source: *DataSource, _dnd_actions: common.wl.data_device_manager.DndAction) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_source);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_dnd_actions))),
                        .@"struct" => @bitCast(_dnd_actions),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_actions_since_version = 3;
        };

        /// There is one wl_data_device per seat which can be obtained
        /// from the global wl_data_device_manager singleton.
        ///
        /// A wl_data_device provides access to inter-client data transfer
        /// mechanisms such as copy-and-paste and drag-and-drop.
        pub const DataDevice = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_device.interface;
            pub const Error = common.wl.data_device.Error;
            pub inline fn getId(_data_device: *DataDevice) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_device)).getId();
            }
            pub inline fn getVersion(_data_device: *DataDevice) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_device)).getVersion();
            }
            pub inline fn getUserData(_data_device: *DataDevice) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_data_device)).getUserData();
            }
            pub inline fn setQueue(_data_device: *DataDevice, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const data_offer_since_version = 1;
                pub const enter_since_version = 1;
                pub const leave_since_version = 1;
                pub const motion_since_version = 1;
                pub const drop_since_version = 1;
                pub const selection_since_version = 1;

                /// The data_offer event introduces a new wl_data_offer object,
                /// which will subsequently be used in either the
                /// data_device.enter event (for drag-and-drop) or the
                /// data_device.selection event (for selections).  Immediately
                /// following the data_device.data_offer event, the new data_offer
                /// object will send out data_offer.offer events to describe the
                /// mime types it offers.
                data_offer: struct {
                    id: *client.wl.DataOffer,
                },

                /// This event is sent when an active drag-and-drop pointer enters
                /// a surface owned by the client.  The position of the pointer at
                /// enter time is provided by the x and y arguments, in surface-local
                /// coordinates.
                enter: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                    x: common.Fixed,
                    y: common.Fixed,
                    id: ?*client.wl.DataOffer,
                },

                /// This event is sent when the drag-and-drop pointer leaves the
                /// surface and the session ends.  The client must destroy the
                /// wl_data_offer introduced at enter time at this point.
                leave: void,
                /// This event is sent when the drag-and-drop pointer moves within
                /// the currently focused surface. The new position of the pointer
                /// is provided by the x and y arguments, in surface-local
                /// coordinates.
                motion: struct {
                    time: u32,
                    x: common.Fixed,
                    y: common.Fixed,
                },

                /// The event is sent when a drag-and-drop operation is ended
                /// because the implicit grab is removed.
                ///
                /// The drag-and-drop destination is expected to honor the last action
                /// received through wl_data_offer.action, if the resulting action is
                /// "copy" or "move", the destination can still perform
                /// wl_data_offer.receive requests, and is expected to end all
                /// transfers with a wl_data_offer.finish request.
                ///
                /// If the resulting action is "ask", the action will not be considered
                /// final. The drag-and-drop destination is expected to perform one last
                /// wl_data_offer.set_actions request, or wl_data_offer.destroy in order
                /// to cancel the operation.
                drop: void,
                /// The selection event is sent out to notify the client of a new
                /// wl_data_offer for the selection for this device.  The
                /// data_device.data_offer and the data_offer.offer events are
                /// sent out immediately before this event to introduce the data
                /// offer object.  The selection event is sent to a client
                /// immediately before receiving keyboard focus and when a new
                /// selection is set while the client has keyboard focus.  The
                /// data_offer is valid until a new data_offer or NULL is received
                /// or until the client loses keyboard focus.  Switching surface with
                /// keyboard focus within the same client doesn't mean a new selection
                /// will be sent.  The client must destroy the previous selection
                /// data_offer, if any, upon receiving this event.
                selection: struct {
                    id: ?*client.wl.DataOffer,
                },
            };
            pub inline fn setListener(
                _data_device: *DataDevice,
                comptime T: type,
                _listener: *const fn (data_device: *DataDevice, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(DataDevice, T).dispatcher, _listener, _mut_data);
            }
            /// This request asks the compositor to start a drag-and-drop
            /// operation on behalf of the client.
            ///
            /// The source argument is the data source that provides the data
            /// for the eventual data transfer. If source is NULL, enter, leave
            /// and motion events are sent only to the client that initiated the
            /// drag and the client is expected to handle the data passing
            /// internally. If source is destroyed, the drag-and-drop session will be
            /// cancelled.
            ///
            /// The origin surface is the surface where the drag originates and
            /// the client must have an active implicit grab that matches the
            /// serial.
            ///
            /// The icon surface is an optional (can be NULL) surface that
            /// provides an icon to be moved around with the cursor.  Initially,
            /// the top-left corner of the icon surface is placed at the cursor
            /// hotspot, but subsequent wl_surface.offset requests can move the
            /// relative position. Attach requests must be confirmed with
            /// wl_surface.commit as usual. The icon surface is given the role of
            /// a drag-and-drop icon. If the icon surface already has another role,
            /// it raises a protocol error.
            ///
            /// The input region is ignored for wl_surfaces with the role of a
            /// drag-and-drop icon.
            ///
            /// The given source may not be used in any further set_selection or
            /// start_drag requests. Attempting to reuse a previously-used source
            /// may send a used_source error.
            pub fn startDrag(_data_device: *DataDevice, _source: ?*client.wl.DataSource, _origin: *client.wl.Surface, _icon: ?*client.wl.Surface, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_source) },
                    .{ .o = @ptrCast(_origin) },
                    .{ .o = @ptrCast(_icon) },
                    .{ .u = _serial },
                };
                _proxy.marshal(0, &_args);
            }
            pub const start_drag_since_version = 1;

            /// This request asks the compositor to set the selection
            /// to the data from the source on behalf of the client.
            ///
            /// To unset the selection, set the source to NULL.
            ///
            /// The given source may not be used in any further set_selection or
            /// start_drag requests. Attempting to reuse a previously-used source
            /// may send a used_source error.
            pub fn setSelection(_data_device: *DataDevice, _source: ?*client.wl.DataSource, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_source) },
                    .{ .u = _serial },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_selection_since_version = 1;

            /// This request destroys the data device.
            pub fn release(_data_device: *DataDevice) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                _proxy.marshal(2, null);
                _proxy.destroy();
            }
            pub const release_since_version = 2;
            pub inline fn destroy(_data_device: *DataDevice) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_device);
                _proxy.destroy();
            }
        };

        /// A wl_data_offer represents a piece of data offered for transfer
        /// by another client (the source client).  It is used by the
        /// copy-and-paste and drag-and-drop mechanisms.  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.
        pub const DataOffer = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_offer.interface;
            pub const Error = common.wl.data_offer.Error;
            pub inline fn getId(_data_offer: *DataOffer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_offer)).getId();
            }
            pub inline fn getVersion(_data_offer: *DataOffer) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_data_offer)).getVersion();
            }
            pub inline fn getUserData(_data_offer: *DataOffer) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_data_offer)).getUserData();
            }
            pub inline fn setQueue(_data_offer: *DataOffer, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const offer_since_version = 1;
                pub const source_actions_since_version = 3;
                pub const action_since_version = 3;

                /// Sent immediately after creating the wl_data_offer object.  One
                /// event per offered mime type.
                offer: struct {
                    mime_type: [*:0]const u8,
                },

                /// This event indicates the actions offered by the data source. It
                /// will be sent immediately after creating the wl_data_offer object,
                /// or anytime the source side changes its offered actions through
                /// wl_data_source.set_actions.
                source_actions: struct {
                    source_actions: common.wl.data_device_manager.DndAction,
                },

                /// This event indicates the action selected by the compositor after
                /// matching the source/destination side actions. Only one action (or
                /// none) will be offered here.
                ///
                /// This event can be emitted multiple times during the drag-and-drop
                /// operation in response to destination side action changes through
                /// wl_data_offer.set_actions.
                ///
                /// This event will no longer be emitted after wl_data_device.drop
                /// happened on the drag-and-drop destination, the client must
                /// honor the last action received, or the last preferred one set
                /// through wl_data_offer.set_actions when handling an "ask" action.
                ///
                /// Compositors may also change the selected action on the fly, mainly
                /// in response to keyboard modifier changes during the drag-and-drop
                /// operation.
                ///
                /// The most recent action received is always the valid one. Prior to
                /// receiving wl_data_device.drop, the chosen action may change (e.g.
                /// due to keyboard modifiers being pressed). At the time of receiving
                /// wl_data_device.drop the drag-and-drop destination must honor the
                /// last action received.
                ///
                /// Action changes may still happen after wl_data_device.drop,
                /// especially on "ask" actions, where the drag-and-drop destination
                /// may choose another action afterwards. Action changes happening
                /// at this stage are always the result of inter-client negotiation, the
                /// compositor shall no longer be able to induce a different action.
                ///
                /// Upon "ask" actions, it is expected that the drag-and-drop destination
                /// may potentially choose a different action and/or mime type,
                /// based on wl_data_offer.source_actions and finally chosen by the
                /// user (e.g. popping up a menu with the available options). The
                /// final wl_data_offer.set_actions and wl_data_offer.accept requests
                /// must happen before the call to wl_data_offer.finish.
                action: struct {
                    dnd_action: common.wl.data_device_manager.DndAction,
                },
            };
            pub inline fn setListener(
                _data_offer: *DataOffer,
                comptime T: type,
                _listener: *const fn (data_offer: *DataOffer, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(DataOffer, T).dispatcher, _listener, _mut_data);
            }
            /// Indicate that the client can accept the given mime type, or
            /// NULL for not accepted.
            ///
            /// For objects of version 2 or older, this request is used by the
            /// client to give feedback whether the client can receive the given
            /// mime type, or NULL if none is accepted; the feedback does not
            /// determine whether the drag-and-drop operation succeeds or not.
            ///
            /// For objects of version 3 or newer, this request determines the
            /// final result of the drag-and-drop operation. If the end result
            /// is that no mime types were accepted, the drag-and-drop operation
            /// will be cancelled and the corresponding drag source will receive
            /// wl_data_source.cancelled. Clients may still use this event in
            /// conjunction with wl_data_source.action for feedback.
            pub fn accept(_data_offer: *DataOffer, _serial: u32, _mime_type: ?[*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .s = _mime_type },
                };
                _proxy.marshal(0, &_args);
            }
            pub const accept_since_version = 1;

            /// 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,
            /// both before and after wl_data_device.drop. Drag-and-drop destination
            /// clients may preemptively fetch data or examine it more closely to
            /// determine acceptance.
            pub fn receive(_data_offer: *DataOffer, _mime_type: [*:0]const u8, _fd: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .s = _mime_type },
                    .{ .h = _fd },
                };
                _proxy.marshal(1, &_args);
            }
            pub const receive_since_version = 1;

            /// Destroy the data offer.
            pub fn destroy(_data_offer: *DataOffer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                _proxy.marshal(2, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Notifies the compositor that the drag destination successfully
            /// finished the drag-and-drop operation.
            ///
            /// Upon receiving this request, the compositor will emit
            /// wl_data_source.dnd_finished on the drag source client.
            ///
            /// It is a client error to perform other requests than
            /// wl_data_offer.destroy after this one. It is also an error to perform
            /// this request after a NULL mime type has been set in
            /// wl_data_offer.accept or no action was received through
            /// wl_data_offer.action.
            ///
            /// If wl_data_offer.finish request is received for a non drag and drop
            /// operation, the invalid_finish protocol error is raised.
            pub fn finish(_data_offer: *DataOffer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                _proxy.marshal(3, null);
            }
            pub const finish_since_version = 3;

            /// Sets the actions that the destination side client supports for
            /// this operation. This request may trigger the emission of
            /// wl_data_source.action and wl_data_offer.action events if the compositor
            /// needs to change the selected action.
            ///
            /// This request can be called multiple times throughout the
            /// drag-and-drop operation, typically in response to wl_data_device.enter
            /// or wl_data_device.motion events.
            ///
            /// This request determines the final result of the drag-and-drop
            /// operation. If the end result is that no action is accepted,
            /// the drag source will receive wl_data_source.cancelled.
            ///
            /// The dnd_actions argument must contain only values expressed in the
            /// wl_data_device_manager.dnd_actions enum, and the preferred_action
            /// argument must only contain one of those values set, otherwise it
            /// will result in a protocol error.
            ///
            /// While managing an "ask" action, the destination drag-and-drop client
            /// may perform further wl_data_offer.receive requests, and is expected
            /// to perform one last wl_data_offer.set_actions request with a preferred
            /// action other than "ask" (and optionally wl_data_offer.accept) before
            /// requesting wl_data_offer.finish, in order to convey the action selected
            /// by the user. If the preferred action is not in the
            /// wl_data_offer.source_actions mask, an error will be raised.
            ///
            /// If the "ask" action is dismissed (e.g. user cancellation), the client
            /// is expected to perform wl_data_offer.destroy right away.
            ///
            /// This request can only be made on drag-and-drop offers, a protocol error
            /// will be raised otherwise.
            pub fn setActions(_data_offer: *DataOffer, _dnd_actions: common.wl.data_device_manager.DndAction, _preferred_action: common.wl.data_device_manager.DndAction) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_dnd_actions))),
                        .@"struct" => @bitCast(_dnd_actions),
                        else => unreachable,
                    } },
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_preferred_action))),
                        .@"struct" => @bitCast(_preferred_action),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(4, &_args);
            }
            pub const set_actions_since_version = 3;
        };
    };
    pub const zwp = struct {
        /// An object that provides access to the graphics tablets available on this
        /// system. All tablets are associated with a seat, to get access to the
        /// actual tablets, use zwp_tablet_manager_v2.get_tablet_seat.
        pub const TabletManagerV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_manager_v2.interface;
            pub inline fn getId(_tablet_manager_v2: *TabletManagerV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_manager_v2)).getId();
            }
            pub inline fn getVersion(_tablet_manager_v2: *TabletManagerV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_manager_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_manager_v2: *TabletManagerV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_manager_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_manager_v2: *TabletManagerV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_manager_v2);
                _proxy.setQueue(_queue);
            }
            /// Get the zwp_tablet_seat_v2 object for the given seat. This object
            /// provides access to all graphics tablets in this seat.
            pub fn getTabletSeat(_tablet_manager_v2: *TabletManagerV2, _seat: *client.wl.Seat) !*client.zwp.TabletSeatV2 {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_manager_v2);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_seat) },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.zwp.TabletSeatV2.interface));
            }
            pub const get_tablet_seat_since_version = 1;

            /// Destroy the zwp_tablet_manager_v2 object. Objects created from this
            /// object are unaffected and should be destroyed separately.
            pub fn destroy(_tablet_manager_v2: *TabletManagerV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_manager_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// An object that provides access to the graphics tablets available on this
        /// seat. After binding to this interface, the compositor sends a set of
        /// zwp_tablet_seat_v2.tablet_added and zwp_tablet_seat_v2.tool_added events.
        pub const TabletSeatV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_seat_v2.interface;
            pub inline fn getId(_tablet_seat_v2: *TabletSeatV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_seat_v2)).getId();
            }
            pub inline fn getVersion(_tablet_seat_v2: *TabletSeatV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_seat_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_seat_v2: *TabletSeatV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_seat_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_seat_v2: *TabletSeatV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_seat_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const tablet_added_since_version = 1;
                pub const tool_added_since_version = 1;
                pub const pad_added_since_version = 1;

                /// This event is sent whenever a new tablet becomes available on this
                /// seat. This event only provides the object id of the tablet, any
                /// static information about the tablet (device name, vid/pid, etc.) is
                /// sent through the zwp_tablet_v2 interface.
                tablet_added: struct {
                    id: *client.zwp.TabletV2,
                },

                /// This event is sent whenever a tool that has not previously been used
                /// with a tablet comes into use. This event only provides the object id
                /// of the tool; any static information about the tool (capabilities,
                /// type, etc.) is sent through the zwp_tablet_tool_v2 interface.
                tool_added: struct {
                    id: *client.zwp.TabletToolV2,
                },

                /// This event is sent whenever a new pad is known to the system. Typically,
                /// pads are physically attached to tablets and a pad_added event is
                /// sent immediately after the zwp_tablet_seat_v2.tablet_added.
                /// However, some standalone pad devices logically attach to tablets at
                /// runtime, and the client must wait for zwp_tablet_pad_v2.enter to know
                /// the tablet a pad is attached to.
                ///
                /// This event only provides the object id of the pad. All further
                /// features (buttons, strips, rings) are sent through the zwp_tablet_pad_v2
                /// interface.
                pad_added: struct {
                    id: *client.zwp.TabletPadV2,
                },
            };
            pub inline fn setListener(
                _tablet_seat_v2: *TabletSeatV2,
                comptime T: type,
                _listener: *const fn (tablet_seat_v2: *TabletSeatV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_seat_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletSeatV2, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the zwp_tablet_seat_v2 object. Objects created from this
            /// object are unaffected and should be destroyed separately.
            pub fn destroy(_tablet_seat_v2: *TabletSeatV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_seat_v2);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// The zwp_tablet_v2 interface represents one graphics tablet device. The
        /// tablet interface itself does not generate events; all events are
        /// generated by zwp_tablet_tool_v2 objects when in proximity above a tablet.
        ///
        /// A tablet has a number of static characteristics, e.g. device name and
        /// pid/vid. These capabilities are sent in an event sequence after the
        /// zwp_tablet_seat_v2.tablet_added event. This initial event sequence is
        /// terminated by a zwp_tablet_v2.done event.
        pub const TabletV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_v2.interface;
            pub inline fn getId(_tablet_v2: *TabletV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_v2)).getId();
            }
            pub inline fn getVersion(_tablet_v2: *TabletV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_v2: *TabletV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_v2: *TabletV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const name_since_version = 1;
                pub const id_since_version = 1;
                pub const path_since_version = 1;
                pub const done_since_version = 1;
                pub const removed_since_version = 1;

                /// A descriptive name for the tablet device.
                ///
                /// If the device has no descriptive name, this event is not sent.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_v2.done event.
                name: struct {
                    name: [*:0]const u8,
                },

                /// The vendor and product IDs for the tablet device.
                ///
                /// The interpretation of the id depends on the zwp_tablet_v2.bustype.
                /// Prior to version v2 of this protocol, the id was implied to be a USB
                /// vendor and product ID. If no zwp_tablet_v2.bustype is sent, the ID
                /// is to be interpreted as USB vendor and product ID.
                ///
                /// If the device has no vendor/product ID, this event is not sent.
                /// This can happen for virtual devices or non-USB devices, for instance.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_v2.done event.
                id: struct {
                    vid: u32,
                    pid: u32,
                },

                /// A system-specific device path that indicates which device is behind
                /// this zwp_tablet_v2. This information may be used to gather additional
                /// information about the device, e.g. through libwacom.
                ///
                /// A device may have more than one device path. If so, multiple
                /// zwp_tablet_v2.path events are sent. A device may be emulated and not
                /// have a device path, and in that case this event will not be sent.
                ///
                /// The format of the path is unspecified, it may be a device node, a
                /// sysfs path, or some other identifier. It is up to the client to
                /// identify the string provided.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_v2.done event.
                path: struct {
                    path: [*:0]const u8,
                },

                /// This event is sent immediately to signal the end of the initial
                /// burst of descriptive events. A client may consider the static
                /// description of the tablet to be complete and finalize initialization
                /// of the tablet.
                done: void,
                /// Sent when the tablet has been removed from the system. When a tablet
                /// is removed, some tools may be removed.
                ///
                /// When this event is received, the client must zwp_tablet_v2.destroy
                /// the object.
                removed: void,
            };
            pub inline fn setListener(
                _tablet_v2: *TabletV2,
                comptime T: type,
                _listener: *const fn (tablet_v2: *TabletV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletV2, T).dispatcher, _listener, _mut_data);
            }
            /// This destroys the client's resource for this tablet object.
            pub fn destroy(_tablet_v2: *TabletV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_v2);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// An object that represents a physical tool that has been, or is
        /// currently in use with a tablet in this seat. Each zwp_tablet_tool_v2
        /// object stays valid until the client destroys it; the compositor
        /// reuses the zwp_tablet_tool_v2 object to indicate that the object's
        /// respective physical tool has come into proximity of a tablet again.
        ///
        /// A zwp_tablet_tool_v2 object's relation to a physical tool depends on the
        /// tablet's ability to report serial numbers. If the tablet supports
        /// this capability, then the object represents a specific physical tool
        /// and can be identified even when used on multiple tablets.
        ///
        /// A tablet tool has a number of static characteristics, e.g. tool type,
        /// hardware_serial and capabilities. These capabilities are sent in an
        /// event sequence after the zwp_tablet_seat_v2.tool_added event before any
        /// actual events from this tool. This initial event sequence is
        /// terminated by a zwp_tablet_tool_v2.done event.
        ///
        /// Tablet tool events are grouped by zwp_tablet_tool_v2.frame events.
        /// Any events received before a zwp_tablet_tool_v2.frame event should be
        /// considered part of the same hardware state change.
        pub const TabletToolV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_tool_v2.interface;
            pub const Type = common.zwp.tablet_tool_v2.Type;
            pub const Capability = common.zwp.tablet_tool_v2.Capability;
            pub const ButtonState = common.zwp.tablet_tool_v2.ButtonState;
            pub const Error = common.zwp.tablet_tool_v2.Error;
            pub inline fn getId(_tablet_tool_v2: *TabletToolV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_tool_v2)).getId();
            }
            pub inline fn getVersion(_tablet_tool_v2: *TabletToolV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_tool_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_tool_v2: *TabletToolV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_tool_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_tool_v2: *TabletToolV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_tool_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const type_since_version = 1;
                pub const hardware_serial_since_version = 1;
                pub const hardware_id_wacom_since_version = 1;
                pub const capability_since_version = 1;
                pub const done_since_version = 1;
                pub const removed_since_version = 1;
                pub const proximity_in_since_version = 1;
                pub const proximity_out_since_version = 1;
                pub const down_since_version = 1;
                pub const up_since_version = 1;
                pub const motion_since_version = 1;
                pub const pressure_since_version = 1;
                pub const distance_since_version = 1;
                pub const tilt_since_version = 1;
                pub const rotation_since_version = 1;
                pub const slider_since_version = 1;
                pub const wheel_since_version = 1;
                pub const button_since_version = 1;
                pub const frame_since_version = 1;

                /// The tool type is the high-level type of the tool and usually decides
                /// the interaction expected from this tool.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_tool_v2.done event.
                type: struct {
                    tool_type: Type,
                },

                /// If the physical tool can be identified by a unique 64-bit serial
                /// number, this event notifies the client of this serial number.
                ///
                /// If multiple tablets are available in the same seat and the tool is
                /// uniquely identifiable by the serial number, that tool may move
                /// between tablets.
                ///
                /// Otherwise, if the tool has no serial number and this event is
                /// missing, the tool is tied to the tablet it first comes into
                /// proximity with. Even if the physical tool is used on multiple
                /// tablets, separate zwp_tablet_tool_v2 objects will be created, one per
                /// tablet.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_tool_v2.done event.
                hardware_serial: struct {
                    hardware_serial_hi: u32,
                    hardware_serial_lo: u32,
                },

                /// This event notifies the client of a hardware id available on this tool.
                ///
                /// The hardware id is a device-specific 64-bit id that provides extra
                /// information about the tool in use, beyond the wl_tool.type
                /// enumeration. The format of the id is specific to tablets made by
                /// Wacom Inc. For example, the hardware id of a Wacom Grip
                /// Pen (a stylus) is 0x802.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_tool_v2.done event.
                hardware_id_wacom: struct {
                    hardware_id_hi: u32,
                    hardware_id_lo: u32,
                },

                /// This event notifies the client of any capabilities of this tool,
                /// beyond the main set of x/y axes and tip up/down detection.
                ///
                /// One event is sent for each extra capability available on this tool.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_tool_v2.done event.
                capability: struct {
                    capability: Capability,
                },

                /// This event signals the end of the initial burst of descriptive
                /// events. A client may consider the static description of the tool to
                /// be complete and finalize initialization of the tool.
                done: void,
                /// This event is sent when the tool is removed from the system and will
                /// send no further events. Should the physical tool come back into
                /// proximity later, a new zwp_tablet_tool_v2 object will be created.
                ///
                /// It is compositor-dependent when a tool is removed. A compositor may
                /// remove a tool on proximity out, tablet removal or any other reason.
                /// A compositor may also keep a tool alive until shutdown.
                ///
                /// If the tool is currently in proximity, a proximity_out event will be
                /// sent before the removed event. See zwp_tablet_tool_v2.proximity_out for
                /// the handling of any buttons logically down.
                ///
                /// When this event is received, the client must zwp_tablet_tool_v2.destroy
                /// the object.
                removed: void,
                /// Notification that this tool is focused on a certain surface.
                ///
                /// This event can be received when the tool has moved from one surface to
                /// another, or when the tool has come back into proximity above the
                /// surface.
                ///
                /// If any button is logically down when the tool comes into proximity,
                /// the respective button event is sent after the proximity_in event but
                /// within the same frame as the proximity_in event.
                proximity_in: struct {
                    serial: u32,
                    tablet: ?*client.zwp.TabletV2,
                    surface: ?*client.wl.Surface,
                },

                /// Notification that this tool has either left proximity, or is no
                /// longer focused on a certain surface.
                ///
                /// When the tablet tool leaves proximity of the tablet, button release
                /// events are sent for each button that was held down at the time of
                /// leaving proximity. These events are sent before the proximity_out
                /// event but within the same zwp_tablet_v2.frame.
                ///
                /// If the tool stays within proximity of the tablet, but the focus
                /// changes from one surface to another, a button release event may not
                /// be sent until the button is actually released or the tool leaves the
                /// proximity of the tablet.
                proximity_out: void,
                /// Sent whenever the tablet tool comes in contact with the surface of the
                /// tablet.
                ///
                /// If the tool is already in contact with the tablet when entering the
                /// input region, the client owning said region will receive a
                /// zwp_tablet_v2.proximity_in event, followed by a zwp_tablet_v2.down
                /// event and a zwp_tablet_v2.frame event.
                ///
                /// Note that this event describes logical contact, not physical
                /// contact. On some devices, a compositor may not consider a tool in
                /// logical contact until a minimum physical pressure threshold is
                /// exceeded.
                down: struct {
                    serial: u32,
                },

                /// Sent whenever the tablet tool stops making contact with the surface of
                /// the tablet, or when the tablet tool moves out of the input region
                /// and the compositor grab (if any) is dismissed.
                ///
                /// If the tablet tool moves out of the input region while in contact
                /// with the surface of the tablet and the compositor does not have an
                /// ongoing grab on the surface, the client owning said region will
                /// receive a zwp_tablet_v2.up event, followed by a zwp_tablet_v2.proximity_out
                /// event and a zwp_tablet_v2.frame event. If the compositor has an ongoing
                /// grab on this device, this event sequence is sent whenever the grab
                /// is dismissed in the future.
                ///
                /// Note that this event describes logical contact, not physical
                /// contact. On some devices, a compositor may not consider a tool out
                /// of logical contact until physical pressure falls below a specific
                /// threshold.
                up: void,
                /// Sent whenever a tablet tool moves.
                motion: struct {
                    x: common.Fixed,
                    y: common.Fixed,
                },

                /// Sent whenever the pressure axis on a tool changes. The value of this
                /// event is normalized to a value between 0 and 65535.
                ///
                /// Note that pressure may be nonzero even when a tool is not in logical
                /// contact. See the down and up events for more details.
                pressure: struct {
                    pressure: u32,
                },

                /// Sent whenever the distance axis on a tool changes. The value of this
                /// event is normalized to a value between 0 and 65535.
                ///
                /// Note that distance may be nonzero even when a tool is not in logical
                /// contact. See the down and up events for more details.
                distance: struct {
                    distance: u32,
                },

                /// Sent whenever one or both of the tilt axes on a tool change. Each tilt
                /// value is in degrees, relative to the z-axis of the tablet.
                /// The angle is positive when the top of a tool tilts along the
                /// positive x or y axis.
                tilt: struct {
                    tilt_x: common.Fixed,
                    tilt_y: common.Fixed,
                },

                /// Sent whenever the z-rotation axis on the tool changes. The
                /// rotation value is in degrees clockwise from the tool's
                /// logical neutral position.
                rotation: struct {
                    degrees: common.Fixed,
                },

                /// Sent whenever the slider position on the tool changes. The
                /// value is normalized between -65535 and 65535, with 0 as the logical
                /// neutral position of the slider.
                ///
                /// The slider is available on e.g. the Wacom Airbrush tool.
                slider: struct {
                    position: i32,
                },

                /// Sent whenever the wheel on the tool emits an event. This event
                /// contains two values for the same axis change. The degrees value is
                /// in the same orientation as the wl_pointer.vertical_scroll axis. The
                /// clicks value is in discrete logical clicks of the mouse wheel. This
                /// value may be zero if the movement of the wheel was less
                /// than one logical click.
                ///
                /// Clients should choose either value and avoid mixing degrees and
                /// clicks. The compositor may accumulate values smaller than a logical
                /// click and emulate click events when a certain threshold is met.
                /// Thus, zwp_tablet_tool_v2.wheel events with non-zero clicks values may
                /// have different degrees values.
                wheel: struct {
                    degrees: common.Fixed,
                    clicks: i32,
                },

                /// Sent whenever a button on the tool is pressed or released.
                ///
                /// If a button is held down when the tool moves in or out of proximity,
                /// button events are generated by the compositor. See
                /// zwp_tablet_tool_v2.proximity_in and zwp_tablet_tool_v2.proximity_out for
                /// details.
                button: struct {
                    serial: u32,
                    button: u32,
                    state: ButtonState,
                },

                /// Marks the end of a series of axis and/or button updates from the
                /// tablet. The Wayland protocol requires axis updates to be sent
                /// sequentially, however all events within a frame should be considered
                /// one hardware event.
                frame: struct {
                    time: u32,
                },
            };
            pub inline fn setListener(
                _tablet_tool_v2: *TabletToolV2,
                comptime T: type,
                _listener: *const fn (tablet_tool_v2: *TabletToolV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_tool_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletToolV2, T).dispatcher, _listener, _mut_data);
            }
            /// Sets the surface of the cursor used for this tool on the given
            /// tablet. This request only takes effect if the tool is in proximity
            /// of one of the requesting client's surfaces or the surface parameter
            /// is the current pointer surface. If there was a previous surface set
            /// with this request it is replaced. If surface is NULL, the cursor
            /// image is hidden.
            ///
            /// The parameters hotspot_x and hotspot_y define the position of the
            /// pointer surface relative to the pointer location. Its top-left corner
            /// is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the
            /// coordinates of the pointer location, in surface-local coordinates.
            ///
            /// On surface.attach requests to the pointer surface, hotspot_x and
            /// hotspot_y are decremented by the x and y parameters passed to the
            /// request. Attach must be confirmed by wl_surface.commit as usual.
            ///
            /// The hotspot can also be updated by passing the currently set pointer
            /// surface to this request with new values for hotspot_x and hotspot_y.
            ///
            /// The current and pending input regions of the wl_surface are cleared,
            /// and wl_surface.set_input_region is ignored until the wl_surface is no
            /// longer used as the cursor. When the use as a cursor ends, the current
            /// and pending input regions become undefined, and the wl_surface is
            /// unmapped.
            ///
            /// This request gives the surface the role of a zwp_tablet_tool_v2 cursor. A
            /// surface may only ever be used as the cursor surface for one
            /// zwp_tablet_tool_v2. If the surface already has another role or has
            /// previously been used as cursor surface for a different tool, a
            /// protocol error is raised.
            pub fn setCursor(_tablet_tool_v2: *TabletToolV2, _serial: u32, _surface: ?*client.wl.Surface, _hotspot_x: i32, _hotspot_y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                    .{ .i = _hotspot_x },
                    .{ .i = _hotspot_y },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_cursor_since_version = 1;

            /// This destroys the client's resource for this tool object.
            pub fn destroy(_tablet_tool_v2: *TabletToolV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_tool_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A pad device is a set of buttons, rings, strips and dials
        /// usually physically present on the tablet device itself. Some
        /// exceptions exist where the pad device is physically detached, e.g. the
        /// Wacom ExpressKey Remote.
        ///
        /// Pad devices have no axes that control the cursor and are generally
        /// auxiliary devices to the tool devices used on the tablet surface.
        ///
        /// A pad device has a number of static characteristics, e.g. the number
        /// of rings. These capabilities are sent in an event sequence after the
        /// zwp_tablet_seat_v2.pad_added event before any actual events from this pad.
        /// This initial event sequence is terminated by a zwp_tablet_pad_v2.done
        /// event.
        ///
        /// All pad features (buttons, rings, strips and dials) are logically divided into
        /// groups and all pads have at least one group. The available groups are
        /// notified through the zwp_tablet_pad_v2.group event; the compositor will
        /// emit one event per group before emitting zwp_tablet_pad_v2.done.
        ///
        /// Groups may have multiple modes. Modes allow clients to map multiple
        /// actions to a single pad feature. Only one mode can be active per group,
        /// although different groups may have different active modes.
        pub const TabletPadV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_v2.interface;
            pub const ButtonState = common.zwp.tablet_pad_v2.ButtonState;
            pub inline fn getId(_tablet_pad_v2: *TabletPadV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_v2: *TabletPadV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_pad_v2: *TabletPadV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_pad_v2: *TabletPadV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const group_since_version = 1;
                pub const path_since_version = 1;
                pub const buttons_since_version = 1;
                pub const done_since_version = 1;
                pub const button_since_version = 1;
                pub const enter_since_version = 1;
                pub const leave_since_version = 1;
                pub const removed_since_version = 1;

                /// Sent on zwp_tablet_pad_v2 initialization to announce available groups.
                /// One event is sent for each pad group available.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_v2.done event. At least one group will be announced.
                group: struct {
                    pad_group: *client.zwp.TabletPadGroupV2,
                },

                /// A system-specific device path that indicates which device is behind
                /// this zwp_tablet_pad_v2. This information may be used to gather additional
                /// information about the device, e.g. through libwacom.
                ///
                /// The format of the path is unspecified, it may be a device node, a
                /// sysfs path, or some other identifier. It is up to the client to
                /// identify the string provided.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_v2.done event.
                path: struct {
                    path: [*:0]const u8,
                },

                /// Sent on zwp_tablet_pad_v2 initialization to announce the available
                /// buttons.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_v2.done event. This event is only sent when at least one
                /// button is available.
                buttons: struct {
                    buttons: u32,
                },

                /// This event signals the end of the initial burst of descriptive
                /// events. A client may consider the static description of the pad to
                /// be complete and finalize initialization of the pad.
                done: void,
                /// Sent whenever the physical state of a button changes.
                button: struct {
                    time: u32,
                    button: u32,
                    state: ButtonState,
                },

                /// Notification that this pad is focused on the specified surface.
                enter: struct {
                    serial: u32,
                    tablet: ?*client.zwp.TabletV2,
                    surface: ?*client.wl.Surface,
                },

                /// Notification that this pad is no longer focused on the specified
                /// surface.
                leave: struct {
                    serial: u32,
                    surface: ?*client.wl.Surface,
                },

                /// Sent when the pad has been removed from the system. When a tablet
                /// is removed its pad(s) will be removed too.
                ///
                /// When this event is received, the client must destroy all rings, strips
                /// and groups that were offered by this pad, and issue zwp_tablet_pad_v2.destroy
                /// the pad itself.
                removed: void,
            };
            pub inline fn setListener(
                _tablet_pad_v2: *TabletPadV2,
                comptime T: type,
                _listener: *const fn (tablet_pad_v2: *TabletPadV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletPadV2, T).dispatcher, _listener, _mut_data);
            }
            /// Requests the compositor to use the provided feedback string
            /// associated with this button. This request should be issued immediately
            /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
            /// group is received, or whenever a button is mapped to a different
            /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
            ///
            /// Clients are encouraged to provide context-aware descriptions for
            /// the actions associated with each button, and compositors may use
            /// this information to offer visual feedback on the button layout
            /// (e.g. on-screen displays).
            ///
            /// Button indices start at 0. Setting the feedback string on a button
            /// that is reserved by the compositor (i.e. not belonging to any
            /// zwp_tablet_pad_group_v2) does not generate an error but the compositor
            /// is free to ignore the request.
            ///
            /// The provided string 'description' is a UTF-8 encoded string to be
            /// associated with this ring, and is considered user-visible; general
            /// internationalization rules apply.
            ///
            /// The serial argument will be that of the last
            /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
            /// button. Requests providing other serials than the most recent one will
            /// be ignored.
            pub fn setFeedback(_tablet_pad_v2: *TabletPadV2, _button: u32, _description: [*:0]const u8, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .u = _button },
                    .{ .s = _description },
                    .{ .u = _serial },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_feedback_since_version = 1;

            /// Destroy the zwp_tablet_pad_v2 object. Objects created from this object
            /// are unaffected and should be destroyed separately.
            pub fn destroy(_tablet_pad_v2: *TabletPadV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A pad group describes a distinct (sub)set of buttons, rings and strips
        /// present in the tablet. The criteria of this grouping is usually positional,
        /// eg. if a tablet has buttons on the left and right side, 2 groups will be
        /// presented. The physical arrangement of groups is undisclosed and may
        /// change on the fly.
        ///
        /// Pad groups will announce their features during pad initialization. Between
        /// the corresponding zwp_tablet_pad_v2.group event and zwp_tablet_pad_group_v2.done, the
        /// pad group will announce the buttons, rings and strips contained in it,
        /// plus the number of supported modes.
        ///
        /// Modes are a mechanism to allow multiple groups of actions for every element
        /// in the pad group. The number of groups and available modes in each is
        /// persistent across device plugs. The current mode is user-switchable, it
        /// will be announced through the zwp_tablet_pad_group_v2.mode_switch event both
        /// whenever it is switched, and after zwp_tablet_pad_v2.enter.
        ///
        /// The current mode logically applies to all elements in the pad group,
        /// although it is at clients' discretion whether to actually perform different
        /// actions, and/or issue the respective .set_feedback requests to notify the
        /// compositor. See the zwp_tablet_pad_group_v2.mode_switch event for more details.
        pub const TabletPadGroupV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_group_v2.interface;
            pub inline fn getId(_tablet_pad_group_v2: *TabletPadGroupV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_group_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_group_v2: *TabletPadGroupV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_group_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_pad_group_v2: *TabletPadGroupV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_group_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_pad_group_v2: *TabletPadGroupV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_group_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const buttons_since_version = 1;
                pub const ring_since_version = 1;
                pub const strip_since_version = 1;
                pub const modes_since_version = 1;
                pub const done_since_version = 1;
                pub const mode_switch_since_version = 1;

                /// Sent on zwp_tablet_pad_group_v2 initialization to announce the available
                /// buttons in the group. Button indices start at 0, a button may only be
                /// in one group at a time.
                ///
                /// This event is first sent in the initial burst of events before the
                /// zwp_tablet_pad_group_v2.done event.
                ///
                /// Some buttons are reserved by the compositor. These buttons may not be
                /// assigned to any zwp_tablet_pad_group_v2. Compositors may broadcast this
                /// event in the case of changes to the mapping of these reserved buttons.
                /// If the compositor happens to reserve all buttons in a group, this event
                /// will be sent with an empty array.
                buttons: struct {
                    buttons: *common.Array,
                },

                /// Sent on zwp_tablet_pad_group_v2 initialization to announce available rings.
                /// One event is sent for each ring available on this pad group.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_group_v2.done event.
                ring: struct {
                    ring: *client.zwp.TabletPadRingV2,
                },

                /// Sent on zwp_tablet_pad_v2 initialization to announce available strips.
                /// One event is sent for each strip available on this pad group.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_group_v2.done event.
                strip: struct {
                    strip: *client.zwp.TabletPadStripV2,
                },

                /// Sent on zwp_tablet_pad_group_v2 initialization to announce that the pad
                /// group may switch between modes. A client may use a mode to store a
                /// specific configuration for buttons, rings and strips and use the
                /// zwp_tablet_pad_group_v2.mode_switch event to toggle between these
                /// configurations. Mode indices start at 0.
                ///
                /// Switching modes is compositor-dependent. See the
                /// zwp_tablet_pad_group_v2.mode_switch event for more details.
                ///
                /// This event is sent in the initial burst of events before the
                /// zwp_tablet_pad_group_v2.done event. This event is only sent when
                /// more than one mode is available.
                modes: struct {
                    modes: u32,
                },

                /// This event is sent immediately to signal the end of the initial
                /// burst of descriptive events. A client may consider the static
                /// description of the tablet to be complete and finalize initialization
                /// of the tablet group.
                done: void,
                /// Notification that the mode was switched.
                ///
                /// A mode applies to all buttons, rings, strips and dials in a group
                /// simultaneously, but a client is not required to assign different actions
                /// for each mode. For example, a client may have mode-specific button
                /// mappings but map the ring to vertical scrolling in all modes. Mode
                /// indices start at 0.
                ///
                /// Switching modes is compositor-dependent. The compositor may provide
                /// visual cues to the user about the mode, e.g. by toggling LEDs on
                /// the tablet device. Mode-switching may be software-controlled or
                /// controlled by one or more physical buttons. For example, on a Wacom
                /// Intuos Pro, the button inside the ring may be assigned to switch
                /// between modes.
                ///
                /// The compositor will also send this event after zwp_tablet_pad_v2.enter on
                /// each group in order to notify of the current mode. Groups that only
                /// feature one mode will use mode=0 when emitting this event.
                ///
                /// If a button action in the new mode differs from the action in the
                /// previous mode, the client should immediately issue a
                /// zwp_tablet_pad_v2.set_feedback request for each changed button.
                ///
                /// If a ring, strip or dial action in the new mode differs from the action
                /// in the previous mode, the client should immediately issue a
                /// zwp_tablet_ring_v2.set_feedback, zwp_tablet_strip_v2.set_feedback or
                /// zwp_tablet_dial_v2.set_feedback request for each changed ring, strip or dial.
                mode_switch: struct {
                    time: u32,
                    serial: u32,
                    mode: u32,
                },
            };
            pub inline fn setListener(
                _tablet_pad_group_v2: *TabletPadGroupV2,
                comptime T: type,
                _listener: *const fn (tablet_pad_group_v2: *TabletPadGroupV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_group_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletPadGroupV2, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the zwp_tablet_pad_group_v2 object. Objects created from this object
            /// are unaffected and should be destroyed separately.
            pub fn destroy(_tablet_pad_group_v2: *TabletPadGroupV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_group_v2);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A circular interaction area, such as the touch ring on the Wacom Intuos
        /// Pro series tablets.
        ///
        /// Events on a ring are logically grouped by the zwp_tablet_pad_ring_v2.frame
        /// event.
        pub const TabletPadRingV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_ring_v2.interface;
            pub const Source = common.zwp.tablet_pad_ring_v2.Source;
            pub inline fn getId(_tablet_pad_ring_v2: *TabletPadRingV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_ring_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_ring_v2: *TabletPadRingV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_ring_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_pad_ring_v2: *TabletPadRingV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_ring_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_pad_ring_v2: *TabletPadRingV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_ring_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const source_since_version = 1;
                pub const angle_since_version = 1;
                pub const stop_since_version = 1;
                pub const frame_since_version = 1;

                /// Source information for ring events.
                ///
                /// This event does not occur on its own. It is sent before a
                /// zwp_tablet_pad_ring_v2.frame event and carries the source information
                /// for all events within that frame.
                ///
                /// The source specifies how this event was generated. If the source is
                /// zwp_tablet_pad_ring_v2.source.finger, a zwp_tablet_pad_ring_v2.stop event
                /// will be sent when the user lifts the finger off the device.
                ///
                /// This event is optional. If the source is unknown for an interaction,
                /// no event is sent.
                source: struct {
                    source: Source,
                },

                /// Sent whenever the angle on a ring changes.
                ///
                /// The angle is provided in degrees clockwise from the logical
                /// north of the ring in the pad's current rotation.
                angle: struct {
                    degrees: common.Fixed,
                },

                /// Stop notification for ring events.
                ///
                /// For some zwp_tablet_pad_ring_v2.source types, a zwp_tablet_pad_ring_v2.stop
                /// event is sent to notify a client that the interaction with the ring
                /// has terminated. This enables the client to implement kinetic scrolling.
                /// See the zwp_tablet_pad_ring_v2.source documentation for information on
                /// when this event may be generated.
                ///
                /// Any zwp_tablet_pad_ring_v2.angle events with the same source after this
                /// event should be considered as the start of a new interaction.
                stop: void,
                /// Indicates the end of a set of ring events that logically belong
                /// together. A client is expected to accumulate the data in all events
                /// within the frame before proceeding.
                ///
                /// All zwp_tablet_pad_ring_v2 events before a zwp_tablet_pad_ring_v2.frame event belong
                /// logically together. For example, on termination of a finger interaction
                /// on a ring the compositor will send a zwp_tablet_pad_ring_v2.source event,
                /// a zwp_tablet_pad_ring_v2.stop event and a zwp_tablet_pad_ring_v2.frame event.
                ///
                /// A zwp_tablet_pad_ring_v2.frame event is sent for every logical event
                /// group, even if the group only contains a single zwp_tablet_pad_ring_v2
                /// event. Specifically, a client may get a sequence: angle, frame,
                /// angle, frame, etc.
                frame: struct {
                    time: u32,
                },
            };
            pub inline fn setListener(
                _tablet_pad_ring_v2: *TabletPadRingV2,
                comptime T: type,
                _listener: *const fn (tablet_pad_ring_v2: *TabletPadRingV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_ring_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletPadRingV2, T).dispatcher, _listener, _mut_data);
            }
            /// Request that the compositor use the provided feedback string
            /// associated with this ring. This request should be issued immediately
            /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
            /// group is received, or whenever the ring is mapped to a different
            /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
            ///
            /// Clients are encouraged to provide context-aware descriptions for
            /// the actions associated with the ring; compositors may use this
            /// information to offer visual feedback about the button layout
            /// (eg. on-screen displays).
            ///
            /// The provided string 'description' is a UTF-8 encoded string to be
            /// associated with this ring, and is considered user-visible; general
            /// internationalization rules apply.
            ///
            /// The serial argument will be that of the last
            /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
            /// ring. Requests providing other serials than the most recent one will be
            /// ignored.
            pub fn setFeedback(_tablet_pad_ring_v2: *TabletPadRingV2, _description: [*:0]const u8, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_ring_v2);
                var _args = [_]common.Argument{
                    .{ .s = _description },
                    .{ .u = _serial },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_feedback_since_version = 1;

            /// This destroys the client's resource for this ring object.
            pub fn destroy(_tablet_pad_ring_v2: *TabletPadRingV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_ring_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A linear interaction area, such as the strips found in Wacom Cintiq
        /// models.
        ///
        /// Events on a strip are logically grouped by the zwp_tablet_pad_strip_v2.frame
        /// event.
        pub const TabletPadStripV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_strip_v2.interface;
            pub const Source = common.zwp.tablet_pad_strip_v2.Source;
            pub inline fn getId(_tablet_pad_strip_v2: *TabletPadStripV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_strip_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_strip_v2: *TabletPadStripV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_strip_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_pad_strip_v2: *TabletPadStripV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_strip_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_pad_strip_v2: *TabletPadStripV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_strip_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const source_since_version = 1;
                pub const position_since_version = 1;
                pub const stop_since_version = 1;
                pub const frame_since_version = 1;

                /// Source information for strip events.
                ///
                /// This event does not occur on its own. It is sent before a
                /// zwp_tablet_pad_strip_v2.frame event and carries the source information
                /// for all events within that frame.
                ///
                /// The source specifies how this event was generated. If the source is
                /// zwp_tablet_pad_strip_v2.source.finger, a zwp_tablet_pad_strip_v2.stop event
                /// will be sent when the user lifts their finger off the device.
                ///
                /// This event is optional. If the source is unknown for an interaction,
                /// no event is sent.
                source: struct {
                    source: Source,
                },

                /// Sent whenever the position on a strip changes.
                ///
                /// The position is normalized to a range of [0, 65535], the 0-value
                /// represents the top-most and/or left-most position of the strip in
                /// the pad's current rotation.
                position: struct {
                    position: u32,
                },

                /// Stop notification for strip events.
                ///
                /// For some zwp_tablet_pad_strip_v2.source types, a zwp_tablet_pad_strip_v2.stop
                /// event is sent to notify a client that the interaction with the strip
                /// has terminated. This enables the client to implement kinetic
                /// scrolling. See the zwp_tablet_pad_strip_v2.source documentation for
                /// information on when this event may be generated.
                ///
                /// Any zwp_tablet_pad_strip_v2.position events with the same source after this
                /// event should be considered as the start of a new interaction.
                stop: void,
                /// Indicates the end of a set of events that represent one logical
                /// hardware strip event. A client is expected to accumulate the data
                /// in all events within the frame before proceeding.
                ///
                /// All zwp_tablet_pad_strip_v2 events before a zwp_tablet_pad_strip_v2.frame event belong
                /// logically together. For example, on termination of a finger interaction
                /// on a strip the compositor will send a zwp_tablet_pad_strip_v2.source event,
                /// a zwp_tablet_pad_strip_v2.stop event and a zwp_tablet_pad_strip_v2.frame
                /// event.
                ///
                /// A zwp_tablet_pad_strip_v2.frame event is sent for every logical event
                /// group, even if the group only contains a single zwp_tablet_pad_strip_v2
                /// event. Specifically, a client may get a sequence: position, frame,
                /// position, frame, etc.
                frame: struct {
                    time: u32,
                },
            };
            pub inline fn setListener(
                _tablet_pad_strip_v2: *TabletPadStripV2,
                comptime T: type,
                _listener: *const fn (tablet_pad_strip_v2: *TabletPadStripV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_strip_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletPadStripV2, T).dispatcher, _listener, _mut_data);
            }
            /// Requests the compositor to use the provided feedback string
            /// associated with this strip. This request should be issued immediately
            /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
            /// group is received, or whenever the strip is mapped to a different
            /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
            ///
            /// Clients are encouraged to provide context-aware descriptions for
            /// the actions associated with the strip, and compositors may use this
            /// information to offer visual feedback about the button layout
            /// (eg. on-screen displays).
            ///
            /// The provided string 'description' is a UTF-8 encoded string to be
            /// associated with this ring, and is considered user-visible; general
            /// internationalization rules apply.
            ///
            /// The serial argument will be that of the last
            /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
            /// strip. Requests providing other serials than the most recent one will be
            /// ignored.
            pub fn setFeedback(_tablet_pad_strip_v2: *TabletPadStripV2, _description: [*:0]const u8, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_strip_v2);
                var _args = [_]common.Argument{
                    .{ .s = _description },
                    .{ .u = _serial },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_feedback_since_version = 1;

            /// This destroys the client's resource for this strip object.
            pub fn destroy(_tablet_pad_strip_v2: *TabletPadStripV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_strip_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A rotary control, e.g. a dial or a wheel.
        ///
        /// Events on a dial are logically grouped by the zwp_tablet_pad_dial_v2.frame
        /// event.
        pub const TabletPadDialV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_dial_v2.interface;
            pub inline fn getId(_tablet_pad_dial_v2: *TabletPadDialV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_dial_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_dial_v2: *TabletPadDialV2) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_dial_v2)).getVersion();
            }
            pub inline fn getUserData(_tablet_pad_dial_v2: *TabletPadDialV2) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tablet_pad_dial_v2)).getUserData();
            }
            pub inline fn setQueue(_tablet_pad_dial_v2: *TabletPadDialV2, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_dial_v2);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const delta_since_version = 1;
                pub const frame_since_version = 1;

                /// Sent whenever the position on a dial changes.
                ///
                /// This event carries the wheel delta as multiples or fractions
                /// of 120 with each multiple of 120 representing one logical wheel detent.
                /// For example, an axis_value120 of 30 is one quarter of
                /// a logical wheel step in the positive direction, a value120 of
                /// -240 are two logical wheel steps in the negative direction within the
                /// same hardware event. See the wl_pointer.axis_value120 for more details.
                ///
                /// The value120 must not be zero.
                delta: struct {
                    value120: i32,
                },

                /// Indicates the end of a set of events that represent one logical
                /// hardware dial event. A client is expected to accumulate the data
                /// in all events within the frame before proceeding.
                ///
                /// All zwp_tablet_pad_dial_v2 events before a zwp_tablet_pad_dial_v2.frame event belong
                /// logically together.
                ///
                /// A zwp_tablet_pad_dial_v2.frame event is sent for every logical event
                /// group, even if the group only contains a single zwp_tablet_pad_dial_v2
                /// event. Specifically, a client may get a sequence: delta, frame,
                /// delta, frame, etc.
                frame: struct {
                    time: u32,
                },
            };
            pub inline fn setListener(
                _tablet_pad_dial_v2: *TabletPadDialV2,
                comptime T: type,
                _listener: *const fn (tablet_pad_dial_v2: *TabletPadDialV2, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_dial_v2);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(TabletPadDialV2, T).dispatcher, _listener, _mut_data);
            }
            /// Requests the compositor to use the provided feedback string
            /// associated with this dial. This request should be issued immediately
            /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
            /// group is received, or whenever the dial is mapped to a different
            /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
            ///
            /// Clients are encouraged to provide context-aware descriptions for
            /// the actions associated with the dial, and compositors may use this
            /// information to offer visual feedback about the button layout
            /// (eg. on-screen displays).
            ///
            /// The provided string 'description' is a UTF-8 encoded string to be
            /// associated with this ring, and is considered user-visible; general
            /// internationalization rules apply.
            ///
            /// The serial argument will be that of the last
            /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
            /// dial. Requests providing other serials than the most recent one will be
            /// ignored.
            pub fn setFeedback(_tablet_pad_dial_v2: *TabletPadDialV2, _description: [*:0]const u8, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_dial_v2);
                var _args = [_]common.Argument{
                    .{ .s = _description },
                    .{ .u = _serial },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_feedback_since_version = 1;

            /// This destroys the client's resource for this dial object.
            pub fn destroy(_tablet_pad_dial_v2: *TabletPadDialV2) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tablet_pad_dial_v2);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// 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.
        pub const PointerConstraintsV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.pointer_constraints_v1.interface;
            pub const Error = common.zwp.pointer_constraints_v1.Error;
            pub const Lifetime = common.zwp.pointer_constraints_v1.Lifetime;
            pub inline fn getId(_pointer_constraints_v1: *PointerConstraintsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_constraints_v1)).getId();
            }
            pub inline fn getVersion(_pointer_constraints_v1: *PointerConstraintsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_constraints_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_constraints_v1: *PointerConstraintsV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_constraints_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_constraints_v1: *PointerConstraintsV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_constraints_v1);
                _proxy.setQueue(_queue);
            }
            /// Used by the client to notify the server that it will no longer use this
            /// pointer constraints object.
            pub fn destroy(_pointer_constraints_v1: *PointerConstraintsV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_constraints_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// 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.
            pub fn lockPointer(_pointer_constraints_v1: *PointerConstraintsV1, _surface: *client.wl.Surface, _pointer: *client.wl.Pointer, _region: ?*client.wl.Region, _lifetime: Lifetime) !*client.zwp.LockedPointerV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_constraints_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                    .{ .o = @ptrCast(_pointer) },
                    .{ .o = @ptrCast(_region) },
                    .{ .u = switch (@typeInfo(Lifetime)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_lifetime))),
                        .@"struct" => @bitCast(_lifetime),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.zwp.LockedPointerV1.interface));
            }
            pub const lock_pointer_since_version = 1;

            /// 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.
            pub fn confinePointer(_pointer_constraints_v1: *PointerConstraintsV1, _surface: *client.wl.Surface, _pointer: *client.wl.Pointer, _region: ?*client.wl.Region, _lifetime: Lifetime) !*client.zwp.ConfinedPointerV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_constraints_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                    .{ .o = @ptrCast(_pointer) },
                    .{ .o = @ptrCast(_region) },
                    .{ .u = switch (@typeInfo(Lifetime)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_lifetime))),
                        .@"struct" => @bitCast(_lifetime),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.zwp.ConfinedPointerV1.interface));
            }
            pub const confine_pointer_since_version = 1;
        };

        /// 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.
        pub const LockedPointerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.locked_pointer_v1.interface;
            pub inline fn getId(_locked_pointer_v1: *LockedPointerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_locked_pointer_v1)).getId();
            }
            pub inline fn getVersion(_locked_pointer_v1: *LockedPointerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_locked_pointer_v1)).getVersion();
            }
            pub inline fn getUserData(_locked_pointer_v1: *LockedPointerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_locked_pointer_v1)).getUserData();
            }
            pub inline fn setQueue(_locked_pointer_v1: *LockedPointerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_locked_pointer_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const locked_since_version = 1;
                pub const unlocked_since_version = 1;

                /// Notification that the pointer lock of the seat's pointer is activated.
                locked: void,
                /// Notification that the pointer lock of the seat's pointer is no longer
                /// active. If this is a oneshot pointer lock (see
                /// wp_pointer_constraints.lifetime) this object is now defunct and should
                /// be destroyed. If this is a persistent pointer lock (see
                /// wp_pointer_constraints.lifetime) this pointer lock may again
                /// reactivate in the future.
                unlocked: void,
            };
            pub inline fn setListener(
                _locked_pointer_v1: *LockedPointerV1,
                comptime T: type,
                _listener: *const fn (locked_pointer_v1: *LockedPointerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_locked_pointer_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LockedPointerV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the locked pointer object. If applicable, the compositor will
            /// unlock the pointer.
            pub fn destroy(_locked_pointer_v1: *LockedPointerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_locked_pointer_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// 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 state, see
            /// wl_surface.commit.
            pub fn setCursorPositionHint(_locked_pointer_v1: *LockedPointerV1, _surface_x: common.Fixed, _surface_y: common.Fixed) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_locked_pointer_v1);
                var _args = [_]common.Argument{
                    .{ .f = _surface_x },
                    .{ .f = _surface_y },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_cursor_position_hint_since_version = 1;

            /// Set a new region used to lock the pointer.
            ///
            /// The new lock region is double-buffered, see wl_surface.commit.
            ///
            /// For details about the lock region, see wp_locked_pointer.
            pub fn setRegion(_locked_pointer_v1: *LockedPointerV1, _region: ?*client.wl.Region) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_locked_pointer_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_region) },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_region_since_version = 1;
        };

        /// 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.
        pub const ConfinedPointerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.confined_pointer_v1.interface;
            pub inline fn getId(_confined_pointer_v1: *ConfinedPointerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_confined_pointer_v1)).getId();
            }
            pub inline fn getVersion(_confined_pointer_v1: *ConfinedPointerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_confined_pointer_v1)).getVersion();
            }
            pub inline fn getUserData(_confined_pointer_v1: *ConfinedPointerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_confined_pointer_v1)).getUserData();
            }
            pub inline fn setQueue(_confined_pointer_v1: *ConfinedPointerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_confined_pointer_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const confined_since_version = 1;
                pub const unconfined_since_version = 1;

                /// Notification that the pointer confinement of the seat's pointer is
                /// activated.
                confined: void,
                /// Notification that the pointer confinement of the seat's pointer is no
                /// longer active. If this is a oneshot pointer confinement (see
                /// wp_pointer_constraints.lifetime) this object is now defunct and should
                /// be destroyed. If this is a persistent pointer confinement (see
                /// wp_pointer_constraints.lifetime) this pointer confinement may again
                /// reactivate in the future.
                unconfined: void,
            };
            pub inline fn setListener(
                _confined_pointer_v1: *ConfinedPointerV1,
                comptime T: type,
                _listener: *const fn (confined_pointer_v1: *ConfinedPointerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_confined_pointer_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ConfinedPointerV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the confined pointer object. If applicable, the compositor will
            /// unconfine the pointer.
            pub fn destroy(_confined_pointer_v1: *ConfinedPointerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_confined_pointer_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set a new region used to confine the pointer.
            ///
            /// The new confine region is double-buffered, see wl_surface.commit.
            ///
            /// 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.
            pub fn setRegion(_confined_pointer_v1: *ConfinedPointerV1, _region: ?*client.wl.Region) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_confined_pointer_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_region) },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_region_since_version = 1;
        };

        /// A global interface to provide semantic touchpad gestures for a given
        /// pointer.
        ///
        /// Three gestures are currently supported: swipe, pinch, and hold.
        /// Pinch and swipe gestures follow a three-stage cycle: begin, update,
        /// end. Hold gestures follow a two-stage cycle: begin and end. All
        /// gestures are identified by a unique id.
        ///
        /// 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.
        pub const PointerGesturesV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gestures_v1.interface;
            pub inline fn getId(_pointer_gestures_v1: *PointerGesturesV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gestures_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gestures_v1: *PointerGesturesV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gestures_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_gestures_v1: *PointerGesturesV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gestures_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_gestures_v1: *PointerGesturesV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                _proxy.setQueue(_queue);
            }
            /// Create a swipe gesture object. See the
            /// wl_pointer_gesture_swipe interface for details.
            pub fn getSwipeGesture(_pointer_gestures_v1: *PointerGesturesV1, _pointer: *client.wl.Pointer) !*client.zwp.PointerGestureSwipeV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_pointer) },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.zwp.PointerGestureSwipeV1.interface));
            }
            pub const get_swipe_gesture_since_version = 1;

            /// Create a pinch gesture object. See the
            /// wl_pointer_gesture_pinch interface for details.
            pub fn getPinchGesture(_pointer_gestures_v1: *PointerGesturesV1, _pointer: *client.wl.Pointer) !*client.zwp.PointerGesturePinchV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_pointer) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.zwp.PointerGesturePinchV1.interface));
            }
            pub const get_pinch_gesture_since_version = 1;

            /// Destroy the pointer gesture object. Swipe, pinch and hold objects
            /// created via this gesture object remain valid.
            pub fn release(_pointer_gestures_v1: *PointerGesturesV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                _proxy.marshal(2, null);
                _proxy.destroy();
            }
            pub const release_since_version = 2;

            /// Create a hold gesture object. See the
            /// wl_pointer_gesture_hold interface for details.
            pub fn getHoldGesture(_pointer_gestures_v1: *PointerGesturesV1, _pointer: *client.wl.Pointer) !*client.zwp.PointerGestureHoldV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_pointer) },
                };
                return @ptrCast(try _proxy.marshalConstructor(3, &_args, client.zwp.PointerGestureHoldV1.interface));
            }
            pub const get_hold_gesture_since_version = 3;
            pub inline fn destroy(_pointer_gestures_v1: *PointerGesturesV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gestures_v1);
                _proxy.destroy();
            }
        };

        /// A swipe gesture object notifies a client about a multi-finger swipe
        /// gesture detected on an indirect input device such as a touchpad.
        /// The gesture is usually initiated by multiple fingers moving in the
        /// same direction but once initiated the direction may change.
        /// The precise conditions of when such a gesture is detected are
        /// implementation-dependent.
        ///
        /// A gesture consists of three stages: begin, update (optional) and end.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGestureSwipeV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_swipe_v1.interface;
            pub inline fn getId(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_swipe_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_swipe_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_swipe_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_swipe_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const begin_since_version = 1;
                pub const update_since_version = 1;
                pub const end_since_version = 1;

                /// This event is sent when a multi-finger swipe gesture is detected
                /// on the device.
                begin: struct {
                    serial: u32,
                    time: u32,
                    surface: ?*client.wl.Surface,
                    fingers: u32,
                },

                /// This event is sent when a multi-finger swipe gesture changes the
                /// position of the logical center.
                ///
                /// The dx and dy coordinates are relative coordinates of the logical
                /// center of the gesture compared to the previous event.
                update: struct {
                    time: u32,
                    dx: common.Fixed,
                    dy: common.Fixed,
                },

                /// This event is sent when a multi-finger swipe gesture ceases to
                /// be valid. This may happen when one or more fingers are lifted or
                /// the gesture is cancelled.
                ///
                /// When a gesture is cancelled, the client should undo state changes
                /// caused by this gesture. What causes a gesture to be cancelled is
                /// implementation-dependent.
                end: struct {
                    serial: u32,
                    time: u32,
                    cancelled: i32,
                },
            };
            pub inline fn setListener(
                _pointer_gesture_swipe_v1: *PointerGestureSwipeV1,
                comptime T: type,
                _listener: *const fn (pointer_gesture_swipe_v1: *PointerGestureSwipeV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_swipe_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(PointerGestureSwipeV1, T).dispatcher, _listener, _mut_data);
            }
            pub fn destroy(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_swipe_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A pinch gesture object notifies a client about a multi-finger pinch
        /// gesture detected on an indirect input device such as a touchpad.
        /// The gesture is usually initiated by multiple fingers moving towards
        /// each other or away from each other, or by two or more fingers rotating
        /// around a logical center of gravity. The precise conditions of when
        /// such a gesture is detected are implementation-dependent.
        ///
        /// A gesture consists of three stages: begin, update (optional) and end.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGesturePinchV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_pinch_v1.interface;
            pub inline fn getId(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_pinch_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_pinch_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_pinch_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_gesture_pinch_v1: *PointerGesturePinchV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_pinch_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const begin_since_version = 1;
                pub const update_since_version = 1;
                pub const end_since_version = 1;

                /// This event is sent when a multi-finger pinch gesture is detected
                /// on the device.
                begin: struct {
                    serial: u32,
                    time: u32,
                    surface: ?*client.wl.Surface,
                    fingers: u32,
                },

                /// This event is sent when a multi-finger pinch gesture changes the
                /// position of the logical center, the rotation or the relative scale.
                ///
                /// The dx and dy coordinates are relative coordinates in the
                /// surface coordinate space of the logical center of the gesture.
                ///
                /// The scale factor is an absolute scale compared to the
                /// pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
                /// are now twice as far apart as on pointer_gesture_pinch.begin.
                ///
                /// The rotation is the relative angle in degrees clockwise compared to the previous
                /// pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
                update: struct {
                    time: u32,
                    dx: common.Fixed,
                    dy: common.Fixed,
                    scale: common.Fixed,
                    rotation: common.Fixed,
                },

                /// This event is sent when a multi-finger pinch gesture ceases to
                /// be valid. This may happen when one or more fingers are lifted or
                /// the gesture is cancelled.
                ///
                /// When a gesture is cancelled, the client should undo state changes
                /// caused by this gesture. What causes a gesture to be cancelled is
                /// implementation-dependent.
                end: struct {
                    serial: u32,
                    time: u32,
                    cancelled: i32,
                },
            };
            pub inline fn setListener(
                _pointer_gesture_pinch_v1: *PointerGesturePinchV1,
                comptime T: type,
                _listener: *const fn (pointer_gesture_pinch_v1: *PointerGesturePinchV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_pinch_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(PointerGesturePinchV1, T).dispatcher, _listener, _mut_data);
            }
            pub fn destroy(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_pinch_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// A hold gesture object notifies a client about a single- or
        /// multi-finger hold gesture detected on an indirect input device such as
        /// a touchpad. The gesture is usually initiated by one or more fingers
        /// being held down without significant movement. The precise conditions
        /// of when such a gesture is detected are implementation-dependent.
        ///
        /// In particular, this gesture may be used to cancel kinetic scrolling.
        ///
        /// A hold gesture consists of two stages: begin and end. Unlike pinch and
        /// swipe there is no update stage.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGestureHoldV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_hold_v1.interface;
            pub inline fn getId(_pointer_gesture_hold_v1: *PointerGestureHoldV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_hold_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_hold_v1: *PointerGestureHoldV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_hold_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_gesture_hold_v1: *PointerGestureHoldV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_gesture_hold_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_gesture_hold_v1: *PointerGestureHoldV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_hold_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const begin_since_version = 3;
                pub const end_since_version = 3;

                /// This event is sent when a hold gesture is detected on the device.
                begin: struct {
                    serial: u32,
                    time: u32,
                    surface: ?*client.wl.Surface,
                    fingers: u32,
                },

                /// This event is sent when a hold gesture ceases to
                /// be valid. This may happen when the holding fingers are lifted or
                /// the gesture is cancelled, for example if the fingers move past an
                /// implementation-defined threshold, the finger count changes or the hold
                /// gesture changes into a different type of gesture.
                ///
                /// When a gesture is cancelled, the client may need to undo state changes
                /// caused by this gesture. What causes a gesture to be cancelled is
                /// implementation-dependent.
                end: struct {
                    serial: u32,
                    time: u32,
                    cancelled: i32,
                },
            };
            pub inline fn setListener(
                _pointer_gesture_hold_v1: *PointerGestureHoldV1,
                comptime T: type,
                _listener: *const fn (pointer_gesture_hold_v1: *PointerGestureHoldV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_hold_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(PointerGestureHoldV1, T).dispatcher, _listener, _mut_data);
            }
            pub fn destroy(_pointer_gesture_hold_v1: *PointerGestureHoldV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_gesture_hold_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 3;
        };

        /// A virtual keyboard manager allows an application to provide keyboard
        /// input events as if they came from a physical keyboard.
        pub const VirtualKeyboardManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.virtual_keyboard_manager_v1.interface;
            pub const Error = common.zwp.virtual_keyboard_manager_v1.Error;
            pub inline fn getId(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_manager_v1)).getId();
            }
            pub inline fn getVersion(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// Creates a new virtual keyboard associated to a seat.
            ///
            /// If the compositor enables a keyboard to perform arbitrary actions, it
            /// should present an error when an untrusted client requests a new
            /// keyboard.
            pub fn createVirtualKeyboard(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1, _seat: *client.wl.Seat) !*client.zwp.VirtualKeyboardV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.zwp.VirtualKeyboardV1.interface));
            }
            pub const create_virtual_keyboard_since_version = 1;
            pub inline fn destroy(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_manager_v1);
                _proxy.destroy();
            }
        };

        /// The virtual keyboard provides an application with requests which emulate
        /// the behaviour of a physical keyboard.
        ///
        /// This interface can be used by clients on its own to provide raw input
        /// events, or it can accompany the input method protocol.
        pub const VirtualKeyboardV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.virtual_keyboard_v1.interface;
            pub const Error = common.zwp.virtual_keyboard_v1.Error;
            pub inline fn getId(_virtual_keyboard_v1: *VirtualKeyboardV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_v1)).getId();
            }
            pub inline fn getVersion(_virtual_keyboard_v1: *VirtualKeyboardV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_v1)).getVersion();
            }
            pub inline fn getUserData(_virtual_keyboard_v1: *VirtualKeyboardV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_virtual_keyboard_v1)).getUserData();
            }
            pub inline fn setQueue(_virtual_keyboard_v1: *VirtualKeyboardV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_v1);
                _proxy.setQueue(_queue);
            }
            /// Provide a file descriptor to the compositor which can be
            /// memory-mapped to provide a keyboard mapping description.
            ///
            /// Format carries a value from the keymap_format enumeration.
            pub fn keymap(_virtual_keyboard_v1: *VirtualKeyboardV1, _format: u32, _fd: i32, _size: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .u = _format },
                    .{ .h = _fd },
                    .{ .u = _size },
                };
                _proxy.marshal(0, &_args);
            }
            pub const keymap_since_version = 1;

            /// A key was pressed or released.
            /// The time argument is a timestamp with millisecond granularity, with an
            /// undefined base. All requests regarding a single object must share the
            /// same clock.
            ///
            /// Keymap must be set before issuing this request.
            ///
            /// State carries a value from the key_state enumeration.
            pub fn key(_virtual_keyboard_v1: *VirtualKeyboardV1, _time: u32, _key: u32, _state: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .u = _key },
                    .{ .u = _state },
                };
                _proxy.marshal(1, &_args);
            }
            pub const key_since_version = 1;

            /// Notifies the compositor that the modifier and/or group state has
            /// changed, and it should update state.
            ///
            /// The client should use wl_keyboard.modifiers event to synchronize its
            /// internal state with seat state.
            ///
            /// Keymap must be set before issuing this request.
            pub fn modifiers(_virtual_keyboard_v1: *VirtualKeyboardV1, _mods_depressed: u32, _mods_latched: u32, _mods_locked: u32, _group: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .u = _mods_depressed },
                    .{ .u = _mods_latched },
                    .{ .u = _mods_locked },
                    .{ .u = _group },
                };
                _proxy.marshal(2, &_args);
            }
            pub const modifiers_since_version = 1;
            pub fn destroy(_virtual_keyboard_v1: *VirtualKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_virtual_keyboard_v1);
                _proxy.marshal(3, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };
    };
    pub const xdg = struct {
        /// The xdg_wm_base interface is exposed as a global object enabling clients
        /// to turn their wl_surfaces into windows in a desktop environment. It
        /// defines the basic functionality needed for clients and the compositor to
        /// create windows that can be dragged, resized, maximized, etc, as well as
        /// creating transient windows such as popup menus.
        pub const WmBase = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.wm_base.interface;
            pub const Error = common.xdg.wm_base.Error;
            pub inline fn getId(_wm_base: *WmBase) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_wm_base)).getId();
            }
            pub inline fn getVersion(_wm_base: *WmBase) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_wm_base)).getVersion();
            }
            pub inline fn getUserData(_wm_base: *WmBase) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_wm_base)).getUserData();
            }
            pub inline fn setQueue(_wm_base: *WmBase, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const ping_since_version = 1;

                /// The ping event asks the client if it's still alive. Pass the
                /// serial specified in the event back to the compositor by sending
                /// a "pong" request back with the specified serial. See xdg_wm_base.pong.
                ///
                /// Compositors can use this to determine if the client is still
                /// alive. It's unspecified what will happen if the client doesn't
                /// respond to the ping request, or in what timeframe. Clients should
                /// try to respond in a reasonable amount of time. The “unresponsive”
                /// error is provided for compositors that wish to disconnect unresponsive
                /// clients.
                ///
                /// A compositor is free to ping in any way it wants, but a client must
                /// always respond to any xdg_wm_base object it created.
                ping: struct {
                    serial: u32,
                },
            };
            pub inline fn setListener(
                _wm_base: *WmBase,
                comptime T: type,
                _listener: *const fn (wm_base: *WmBase, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(WmBase, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy this xdg_wm_base object.
            ///
            /// Destroying a bound xdg_wm_base object while there are surfaces
            /// still alive created by this xdg_wm_base object instance is illegal
            /// and will result in a defunct_surfaces error.
            pub fn destroy(_wm_base: *WmBase) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Create a positioner object. A positioner object is used to position
            /// surfaces relative to some parent surface. See the interface description
            /// and xdg_surface.get_popup for details.
            pub fn createPositioner(_wm_base: *WmBase) !*client.xdg.Positioner {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.xdg.Positioner.interface));
            }
            pub const create_positioner_since_version = 1;

            /// This creates an xdg_surface for the given surface. While xdg_surface
            /// itself is not a role, the corresponding surface may only be assigned
            /// a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is
            /// illegal to create an xdg_surface for a wl_surface which already has an
            /// assigned role and this will result in a role error.
            ///
            /// This creates an xdg_surface for the given surface. An xdg_surface is
            /// used as basis to define a role to a given surface, such as xdg_toplevel
            /// or xdg_popup. It also manages functionality shared between xdg_surface
            /// based surface roles.
            ///
            /// See the documentation of xdg_surface for more details about what an
            /// xdg_surface is and how it is used.
            pub fn getXdgSurface(_wm_base: *WmBase, _surface: *client.wl.Surface) !*client.xdg.Surface {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.xdg.Surface.interface));
            }
            pub const get_xdg_surface_since_version = 1;

            /// A client must respond to a ping event with a pong request or
            /// the client may be deemed unresponsive. See xdg_wm_base.ping
            /// and xdg_wm_base.error.unresponsive.
            pub fn pong(_wm_base: *WmBase, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_wm_base);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _proxy.marshal(3, &_args);
            }
            pub const pong_since_version = 1;
        };

        /// The xdg_positioner provides a collection of rules for the placement of a
        /// child surface relative to a parent surface. Rules can be defined to ensure
        /// the child surface remains within the visible area's borders, and to
        /// specify how the child surface changes its position, such as sliding along
        /// an axis, or flipping around a rectangle. These positioner-created rules are
        /// constrained by the requirement that a child surface must intersect with or
        /// be at least partially adjacent to its parent surface.
        ///
        /// See the various requests for details about possible rules.
        ///
        /// At the time of the request, the compositor makes a copy of the rules
        /// specified by the xdg_positioner. Thus, after the request is complete the
        /// xdg_positioner object can be destroyed or reused; further changes to the
        /// object will have no effect on previous usages.
        ///
        /// For an xdg_positioner object to be considered complete, it must have a
        /// non-zero size set by set_size, and a non-zero anchor rectangle set by
        /// set_anchor_rect. Passing an incomplete xdg_positioner object when
        /// positioning a surface raises an invalid_positioner error.
        pub const Positioner = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.positioner.interface;
            pub const Error = common.xdg.positioner.Error;
            pub const Anchor = common.xdg.positioner.Anchor;
            pub const Gravity = common.xdg.positioner.Gravity;
            pub const ConstraintAdjustment = common.xdg.positioner.ConstraintAdjustment;
            pub inline fn getId(_positioner: *Positioner) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_positioner)).getId();
            }
            pub inline fn getVersion(_positioner: *Positioner) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_positioner)).getVersion();
            }
            pub inline fn getUserData(_positioner: *Positioner) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_positioner)).getUserData();
            }
            pub inline fn setQueue(_positioner: *Positioner, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                _proxy.setQueue(_queue);
            }
            /// Notify the compositor that the xdg_positioner will no longer be used.
            pub fn destroy(_positioner: *Positioner) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the size of the surface that is to be positioned with the positioner
            /// object. The size is in surface-local coordinates and corresponds to the
            /// window geometry. See xdg_surface.set_window_geometry.
            ///
            /// If a zero or negative size is set the invalid_input error is raised.
            pub fn setSize(_positioner: *Positioner, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_size_since_version = 1;

            /// Specify the anchor rectangle within the parent surface that the child
            /// surface will be placed relative to. The rectangle is relative to the
            /// window geometry as defined by xdg_surface.set_window_geometry of the
            /// parent surface.
            ///
            /// When the xdg_positioner object is used to position a child surface, the
            /// anchor rectangle may not extend outside the window geometry of the
            /// positioned child's parent surface.
            ///
            /// If a negative size is set the invalid_input error is raised.
            pub fn setAnchorRect(_positioner: *Positioner, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_anchor_rect_since_version = 1;

            /// Defines the anchor point for the anchor rectangle. The specified anchor
            /// is used derive an anchor point that the child surface will be
            /// positioned relative to. If a corner anchor is set (e.g. 'top_left' or
            /// 'bottom_right'), the anchor point will be at the specified corner;
            /// otherwise, the derived anchor point will be centered on the specified
            /// edge, or in the center of the anchor rectangle if no edge is specified.
            pub fn setAnchor(_positioner: *Positioner, _anchor: Anchor) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Anchor)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_anchor))),
                        .@"struct" => @bitCast(_anchor),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_anchor_since_version = 1;

            /// Defines in what direction a surface should be positioned, relative to
            /// the anchor point of the parent surface. If a corner gravity is
            /// specified (e.g. 'bottom_right' or 'top_left'), then the child surface
            /// will be placed towards the specified gravity; otherwise, the child
            /// surface will be centered over the anchor point on any axis that had no
            /// gravity specified. If the gravity is not in the ‘gravity’ enum, an
            /// invalid_input error is raised.
            pub fn setGravity(_positioner: *Positioner, _gravity: Gravity) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Gravity)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_gravity))),
                        .@"struct" => @bitCast(_gravity),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(4, &_args);
            }
            pub const set_gravity_since_version = 1;

            /// Specify how the window should be positioned if the originally intended
            /// position caused the surface to be constrained, meaning at least
            /// partially outside positioning boundaries set by the compositor. The
            /// adjustment is set by constructing a bitmask describing the adjustment to
            /// be made when the surface is constrained on that axis.
            ///
            /// If no bit for one axis is set, the compositor will assume that the child
            /// surface should not change its position on that axis when constrained.
            ///
            /// If more than one bit for one axis is set, the order of how adjustments
            /// are applied is specified in the corresponding adjustment descriptions.
            ///
            /// The default adjustment is none.
            pub fn setConstraintAdjustment(_positioner: *Positioner, _constraint_adjustment: ConstraintAdjustment) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ConstraintAdjustment)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_constraint_adjustment))),
                        .@"struct" => @bitCast(_constraint_adjustment),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(5, &_args);
            }
            pub const set_constraint_adjustment_since_version = 1;

            /// Specify the surface position offset relative to the position of the
            /// anchor on the anchor rectangle and the anchor on the surface. For
            /// example if the anchor of the anchor rectangle is at (x, y), the surface
            /// has the gravity bottom|right, and the offset is (ox, oy), the calculated
            /// surface position will be (x + ox, y + oy). The offset position of the
            /// surface is the one used for constraint testing. See
            /// set_constraint_adjustment.
            ///
            /// An example use case is placing a popup menu on top of a user interface
            /// element, while aligning the user interface element of the parent surface
            /// with some user interface element placed somewhere in the popup surface.
            pub fn setOffset(_positioner: *Positioner, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_positioner);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(6, &_args);
            }
            pub const set_offset_since_version = 1;
        };

        /// An interface that may be implemented by a wl_surface, for
        /// implementations that provide a desktop-style user interface.
        ///
        /// It provides a base set of functionality required to construct user
        /// interface elements requiring management by the compositor, such as
        /// toplevel windows, menus, etc. The types of functionality are split into
        /// xdg_surface roles.
        ///
        /// Creating an xdg_surface does not set the role for a wl_surface. In order
        /// to map an xdg_surface, the client must create a role-specific object
        /// using, e.g., get_toplevel, get_popup. The wl_surface for any given
        /// xdg_surface can have at most one role, and may not be assigned any role
        /// not based on xdg_surface.
        ///
        /// A role must be assigned before any other requests are made to the
        /// xdg_surface object.
        ///
        /// The client must call wl_surface.commit on the corresponding wl_surface
        /// for the xdg_surface state to take effect.
        ///
        /// Creating an xdg_surface from a wl_surface which has a buffer attached or
        /// committed is a client error, and any attempts by a client to attach or
        /// manipulate a buffer prior to the first xdg_surface.configure call must
        /// also be treated as errors.
        ///
        /// After creating a role-specific object and setting it up (e.g. by sending
        /// the title, app ID, size constraints, parent, etc), the client must
        /// perform an initial commit without any buffer attached. The compositor
        /// will reply with initial wl_surface state such as
        /// wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
        /// event. The client must acknowledge it and is then allowed to attach a
        /// buffer to map the surface.
        ///
        /// Mapping an xdg_surface-based role surface is defined as making it
        /// possible for the surface to be shown by the compositor. Note that
        /// a mapped surface is not guaranteed to be visible once it is mapped.
        ///
        /// For an xdg_surface to be mapped by the compositor, the following
        /// conditions must be met:
        /// (1) the client has assigned an xdg_surface-based role to the surface
        /// (2) the client has set and committed the xdg_surface state and the
        /// role-dependent state to the surface
        /// (3) the client has committed a buffer to the surface
        ///
        /// A newly-unmapped surface is considered to have met condition (1) out
        /// of the 3 required conditions for mapping a surface if its role surface
        /// has not been destroyed, i.e. the client must perform the initial commit
        /// again before attaching a buffer.
        pub const Surface = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.surface.interface;
            pub const Error = common.xdg.surface.Error;
            pub inline fn getId(_surface: *Surface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getId();
            }
            pub inline fn getVersion(_surface: *Surface) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getVersion();
            }
            pub inline fn getUserData(_surface: *Surface) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_surface)).getUserData();
            }
            pub inline fn setQueue(_surface: *Surface, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;

                /// The configure event marks the end of a configure sequence. A configure
                /// sequence is a set of one or more events configuring the state of the
                /// xdg_surface, including the final xdg_surface.configure event.
                ///
                /// Where applicable, xdg_surface surface roles will during a configure
                /// sequence extend this event as a latched state sent as events before the
                /// xdg_surface.configure event. Such events should be considered to make up
                /// a set of atomically applied configuration states, where the
                /// xdg_surface.configure commits the accumulated state.
                ///
                /// Clients should arrange their surface for the new states, and then send
                /// an ack_configure request with the serial sent in this configure event at
                /// some point before committing the new surface.
                ///
                /// If the client receives multiple configure events before it can respond
                /// to one, it is free to discard all but the last event it received.
                configure: struct {
                    serial: u32,
                },
            };
            pub inline fn setListener(
                _surface: *Surface,
                comptime T: type,
                _listener: *const fn (surface: *Surface, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Surface, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the xdg_surface object. An xdg_surface must only be destroyed
            /// after its role object has been destroyed, otherwise
            /// a defunct_role_object error is raised.
            pub fn destroy(_surface: *Surface) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This creates an xdg_toplevel object for the given xdg_surface and gives
            /// the associated wl_surface the xdg_toplevel role.
            ///
            /// See the documentation of xdg_toplevel for more details about what an
            /// xdg_toplevel is and how it is used.
            pub fn getToplevel(_surface: *Surface) !*client.xdg.Toplevel {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.xdg.Toplevel.interface));
            }
            pub const get_toplevel_since_version = 1;

            /// This creates an xdg_popup object for the given xdg_surface and gives
            /// the associated wl_surface the xdg_popup role.
            ///
            /// If null is passed as a parent, a parent surface must be specified using
            /// some other protocol, before committing the initial state.
            ///
            /// See the documentation of xdg_popup for more details about what an
            /// xdg_popup is and how it is used.
            pub fn getPopup(_surface: *Surface, _parent: ?*client.xdg.Surface, _positioner: *client.xdg.Positioner) !*client.xdg.Popup {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_parent) },
                    .{ .o = @ptrCast(_positioner) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.xdg.Popup.interface));
            }
            pub const get_popup_since_version = 1;

            /// The window geometry of a surface is its "visible bounds" from the
            /// user's perspective. Client-side decorations often have invisible
            /// portions like drop-shadows which should be ignored for the
            /// purposes of aligning, placing and constraining windows. Note that
            /// in some situations, compositors may clip rendering to the window
            /// geometry, so the client should avoid putting functional elements
            /// outside of it.
            ///
            /// The window geometry is double-buffered state, see wl_surface.commit.
            ///
            /// When maintaining a position, the compositor should treat the (x, y)
            /// coordinate of the window geometry as the top left corner of the window.
            /// A client changing the (x, y) window geometry coordinate should in
            /// general not alter the position of the window.
            ///
            /// Once the window geometry of the surface is set, it is not possible to
            /// unset it, and it will remain the same until set_window_geometry is
            /// called again, even if a new subsurface or buffer is attached.
            ///
            /// If never set, the value is the full bounds of the surface,
            /// including any subsurfaces. This updates dynamically on every
            /// commit. This unset is meant for extremely simple clients.
            ///
            /// The arguments are given in the surface-local coordinate space of
            /// the wl_surface associated with this xdg_surface, and may extend outside
            /// of the wl_surface itself to mark parts of the subsurface tree as part of
            /// the window geometry.
            ///
            /// When applied, the effective window geometry will be the set window
            /// geometry clamped to the bounding rectangle of the combined
            /// geometry of the surface of the xdg_surface and the associated
            /// subsurfaces.
            ///
            /// The effective geometry will not be recalculated unless a new call to
            /// set_window_geometry is done and the new pending surface state is
            /// subsequently applied.
            ///
            /// The width and height of the effective window geometry must be
            /// greater than zero. Setting an invalid size will raise an
            /// invalid_size error.
            pub fn setWindowGeometry(_surface: *Surface, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_window_geometry_since_version = 1;

            /// When a configure event is received, if a client commits the
            /// surface in response to the configure event, then the client
            /// must make an ack_configure request sometime before the commit
            /// request, passing along the serial of the configure event.
            ///
            /// For instance, for toplevel surfaces the compositor might use this
            /// information to move a surface to the top left only when the client has
            /// drawn itself for the maximized or fullscreen state.
            ///
            /// If the client receives multiple configure events before it
            /// can respond to one, it only has to ack the last configure event.
            /// Acking a configure event that was never sent raises an invalid_serial
            /// error.
            ///
            /// A client is not required to commit immediately after sending
            /// an ack_configure request - it may even ack_configure several times
            /// before its next surface commit.
            ///
            /// A client may send multiple ack_configure requests before committing, but
            /// only the last request sent before a commit indicates which configure
            /// event the client really is responding to.
            ///
            /// Sending an ack_configure request consumes the serial number sent with
            /// the request, as well as serial numbers sent by all configure events
            /// sent on this xdg_surface prior to the configure event referenced by
            /// the committed serial.
            ///
            /// It is an error to issue multiple ack_configure requests referencing a
            /// serial from the same configure event, or to issue an ack_configure
            /// request referencing a serial from a configure event issued before the
            /// event identified by the last ack_configure request for the same
            /// xdg_surface. Doing so will raise an invalid_serial error.
            pub fn ackConfigure(_surface: *Surface, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _proxy.marshal(4, &_args);
            }
            pub const ack_configure_since_version = 1;
        };

        /// This interface defines an xdg_surface role which allows a surface to,
        /// among other things, set window-like properties such as maximize,
        /// fullscreen, and minimize, set application-specific metadata like title and
        /// id, and well as trigger user interactive operations such as interactive
        /// resize and move.
        ///
        /// A xdg_toplevel by default is responsible for providing the full intended
        /// visual representation of the toplevel, which depending on the window
        /// state, may mean things like a title bar, window controls and drop shadow.
        ///
        /// Unmapping an xdg_toplevel means that the surface cannot be shown
        /// by the compositor until it is explicitly mapped again.
        /// All active operations (e.g., move, resize) are canceled and all
        /// attributes (e.g. title, state, stacking, ...) are discarded for
        /// an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to
        /// the state it had right after xdg_surface.get_toplevel. The client
        /// can re-map the toplevel by performing a commit without any buffer
        /// attached, waiting for a configure event and handling it as usual (see
        /// xdg_surface description).
        ///
        /// Attaching a null buffer to a toplevel unmaps the surface.
        pub const Toplevel = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.toplevel.interface;
            pub const Error = common.xdg.toplevel.Error;
            pub const ResizeEdge = common.xdg.toplevel.ResizeEdge;
            pub const State = common.xdg.toplevel.State;
            pub inline fn getId(_toplevel: *Toplevel) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel)).getId();
            }
            pub inline fn getVersion(_toplevel: *Toplevel) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel)).getVersion();
            }
            pub inline fn getUserData(_toplevel: *Toplevel) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel)).getUserData();
            }
            pub inline fn setQueue(_toplevel: *Toplevel, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;
                pub const close_since_version = 1;

                /// This configure event asks the client to resize its toplevel surface or
                /// to change its state. The configured state should not be applied
                /// immediately. See xdg_surface.configure for details.
                ///
                /// The width and height arguments specify a hint to the window
                /// about how its surface should be resized in window geometry
                /// coordinates. See set_window_geometry.
                ///
                /// If the width or height arguments are zero, it means the client
                /// should decide its own window dimension. This may happen when the
                /// compositor needs to configure the state of the surface but doesn't
                /// have any information about any previous or expected dimension.
                ///
                /// The states listed in the event specify how the width/height
                /// arguments should be interpreted, and possibly how it should be
                /// drawn.
                ///
                /// Clients must send an ack_configure in response to this event. See
                /// xdg_surface.configure and xdg_surface.ack_configure for details.
                configure: struct {
                    width: i32,
                    height: i32,
                    states: *common.Array,
                },

                /// The close event is sent by the compositor when the user
                /// wants the surface to be closed. This should be equivalent to
                /// the user clicking the close button in client-side decorations,
                /// if your application has any.
                ///
                /// This is only a request that the user intends to close the
                /// window. The client may choose to ignore this request, or show
                /// a dialog to ask the user to save their data, etc.
                close: void,
            };
            pub inline fn setListener(
                _toplevel: *Toplevel,
                comptime T: type,
                _listener: *const fn (toplevel: *Toplevel, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Toplevel, T).dispatcher, _listener, _mut_data);
            }
            /// This request destroys the role surface and unmaps the surface;
            /// see "Unmapping" behavior in interface section for details.
            pub fn destroy(_toplevel: *Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the "parent" of this surface. This surface should be stacked
            /// above the parent surface and all other ancestor surfaces.
            ///
            /// Parent surfaces should be set on dialogs, toolboxes, or other
            /// "auxiliary" surfaces, so that the parent is raised when the dialog
            /// is raised.
            ///
            /// Setting a null parent for a child surface unsets its parent. Setting
            /// a null parent for a surface which currently has no parent is a no-op.
            ///
            /// Only mapped surfaces can have child surfaces. Setting a parent which
            /// is not mapped is equivalent to setting a null parent. If a surface
            /// becomes unmapped, its children's parent is set to the parent of
            /// the now-unmapped surface. If the now-unmapped surface has no parent,
            /// its children's parent is unset. If the now-unmapped surface becomes
            /// mapped again, its parent-child relationship is not restored.
            ///
            /// The parent toplevel must not be one of the child toplevel's
            /// descendants, and the parent must be different from the child toplevel,
            /// otherwise the invalid_parent protocol error is raised.
            pub fn setParent(_toplevel: *Toplevel, _parent: ?*client.xdg.Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_parent) },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_parent_since_version = 1;

            /// Set a short title for the surface.
            ///
            /// This string may be used to identify the surface in a task bar,
            /// window list, or other user interface elements provided by the
            /// compositor.
            ///
            /// The string must be encoded in UTF-8.
            pub fn setTitle(_toplevel: *Toplevel, _title: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .s = _title },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_title_since_version = 1;

            /// Set an application identifier for the surface.
            ///
            /// The app ID identifies the general class of applications to which
            /// the surface belongs. The compositor can use this to group multiple
            /// surfaces together, or to determine how to launch a new application.
            ///
            /// For D-Bus activatable applications, the app ID is used as the D-Bus
            /// service name.
            ///
            /// The compositor shell will try to group application surfaces together
            /// by their app ID. As a best practice, it is suggested to select app
            /// ID's that match the basename of the application's .desktop file.
            /// For example, "org.freedesktop.FooViewer" where the .desktop file is
            /// "org.freedesktop.FooViewer.desktop".
            ///
            /// Like other properties, a set_app_id request can be sent after the
            /// xdg_toplevel has been mapped to update the property.
            ///
            /// See the desktop-entry specification [0] for more details on
            /// application identifiers and how they relate to well-known D-Bus
            /// names and .desktop files.
            ///
            /// [0] https://standards.freedesktop.org/desktop-entry-spec/
            pub fn setAppId(_toplevel: *Toplevel, _app_id: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .s = _app_id },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_app_id_since_version = 1;

            /// Clients implementing client-side decorations might want to show
            /// a context menu when right-clicking on the decorations, giving the
            /// user a menu that they can use to maximize or minimize the window.
            ///
            /// This request asks the compositor to pop up such a window menu at
            /// the given position, relative to the local surface coordinates of
            /// the parent surface. There are no guarantees as to what menu items
            /// the window menu contains, or even if a window menu will be drawn
            /// at all.
            ///
            /// This request must be used in response to some sort of user action
            /// like a button press, key press, or touch down event.
            pub fn showWindowMenu(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .u = _serial },
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(4, &_args);
            }
            pub const show_window_menu_since_version = 1;

            /// Start an interactive, user-driven move of the surface.
            ///
            /// This request must be used in response to some sort of user action
            /// like a button press, key press, or touch down event. The passed
            /// serial is used to determine the type of interactive move (touch,
            /// pointer, etc).
            ///
            /// The server may ignore move requests depending on the state of
            /// the surface (e.g. fullscreen or maximized), or if the passed serial
            /// is no longer valid.
            ///
            /// If triggered, the surface will lose the focus of the device
            /// (wl_pointer, wl_touch, etc) used for the move. It is up to the
            /// compositor to visually indicate that the move is taking place, such as
            /// updating a pointer cursor, during the move. There is no guarantee
            /// that the device focus will return when the move is completed.
            pub fn move(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .u = _serial },
                };
                _proxy.marshal(5, &_args);
            }
            pub const move_since_version = 1;

            /// Start a user-driven, interactive resize of the surface.
            ///
            /// This request must be used in response to some sort of user action
            /// like a button press, key press, or touch down event. The passed
            /// serial is used to determine the type of interactive resize (touch,
            /// pointer, etc).
            ///
            /// The server may ignore resize requests depending on the state of
            /// the surface (e.g. fullscreen or maximized).
            ///
            /// If triggered, the client will receive configure events with the
            /// "resize" state enum value and the expected sizes. See the "resize"
            /// enum value for more details about what is required. The client
            /// must also acknowledge configure events using "ack_configure". After
            /// the resize is completed, the client will receive another "configure"
            /// event without the resize state.
            ///
            /// If triggered, the surface also will lose the focus of the device
            /// (wl_pointer, wl_touch, etc) used for the resize. It is up to the
            /// compositor to visually indicate that the resize is taking place,
            /// such as updating a pointer cursor, during the resize. There is no
            /// guarantee that the device focus will return when the resize is
            /// completed.
            ///
            /// The edges parameter specifies how the surface should be resized, and
            /// is one of the values of the resize_edge enum. Values not matching
            /// a variant of the enum will cause the invalid_resize_edge protocol error.
            /// The compositor may use this information to update the surface position
            /// for example when dragging the top left corner. The compositor may also
            /// use this information to adapt its behavior, e.g. choose an appropriate
            /// cursor image.
            pub fn resize(_toplevel: *Toplevel, _seat: *client.wl.Seat, _serial: u32, _edges: ResizeEdge) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .u = _serial },
                    .{ .u = switch (@typeInfo(ResizeEdge)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_edges))),
                        .@"struct" => @bitCast(_edges),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(6, &_args);
            }
            pub const resize_since_version = 1;

            /// Set a maximum size for the window.
            ///
            /// The client can specify a maximum size so that the compositor does
            /// not try to configure the window beyond this size.
            ///
            /// The width and height arguments are in window geometry coordinates.
            /// See xdg_surface.set_window_geometry.
            ///
            /// Values set in this way are double-buffered, see wl_surface.commit.
            ///
            /// The compositor can use this information to allow or disallow
            /// different states like maximize or fullscreen and draw accurate
            /// animations.
            ///
            /// Similarly, a tiling window manager may use this information to
            /// place and resize client windows in a more effective way.
            ///
            /// The client should not rely on the compositor to obey the maximum
            /// size. The compositor may decide to ignore the values set by the
            /// client and request a larger size.
            ///
            /// If never set, or a value of zero in the request, means that the
            /// client has no expected maximum size in the given dimension.
            /// As a result, a client wishing to reset the maximum size
            /// to an unspecified state can use zero for width and height in the
            /// request.
            ///
            /// Requesting a maximum size to be smaller than the minimum size of
            /// a surface is illegal and will result in an invalid_size error.
            ///
            /// The width and height must be greater than or equal to zero. Using
            /// strictly negative values for width or height will result in a
            /// invalid_size error.
            pub fn setMaxSize(_toplevel: *Toplevel, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(7, &_args);
            }
            pub const set_max_size_since_version = 1;

            /// Set a minimum size for the window.
            ///
            /// The client can specify a minimum size so that the compositor does
            /// not try to configure the window below this size.
            ///
            /// The width and height arguments are in window geometry coordinates.
            /// See xdg_surface.set_window_geometry.
            ///
            /// Values set in this way are double-buffered, see wl_surface.commit.
            ///
            /// The compositor can use this information to allow or disallow
            /// different states like maximize or fullscreen and draw accurate
            /// animations.
            ///
            /// Similarly, a tiling window manager may use this information to
            /// place and resize client windows in a more effective way.
            ///
            /// The client should not rely on the compositor to obey the minimum
            /// size. The compositor may decide to ignore the values set by the
            /// client and request a smaller size.
            ///
            /// If never set, or a value of zero in the request, means that the
            /// client has no expected minimum size in the given dimension.
            /// As a result, a client wishing to reset the minimum size
            /// to an unspecified state can use zero for width and height in the
            /// request.
            ///
            /// Requesting a minimum size to be larger than the maximum size of
            /// a surface is illegal and will result in an invalid_size error.
            ///
            /// The width and height must be greater than or equal to zero. Using
            /// strictly negative values for width and height will result in a
            /// invalid_size error.
            pub fn setMinSize(_toplevel: *Toplevel, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(8, &_args);
            }
            pub const set_min_size_since_version = 1;

            /// Maximize the surface.
            ///
            /// After requesting that the surface should be maximized, the compositor
            /// will respond by emitting a configure event. Whether this configure
            /// actually sets the window maximized is subject to compositor policies.
            /// The client must then update its content, drawing in the configured
            /// state. The client must also acknowledge the configure when committing
            /// the new content (see ack_configure).
            ///
            /// It is up to the compositor to decide how and where to maximize the
            /// surface, for example which output and what region of the screen should
            /// be used.
            ///
            /// If the surface was already maximized, the compositor will still emit
            /// a configure event with the "maximized" state.
            ///
            /// If the surface is in a fullscreen state, this request has no direct
            /// effect. It may alter the state the surface is returned to when
            /// unmaximized unless overridden by the compositor.
            pub fn setMaximized(_toplevel: *Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.marshal(9, null);
            }
            pub const set_maximized_since_version = 1;

            /// Unmaximize the surface.
            ///
            /// After requesting that the surface should be unmaximized, the compositor
            /// will respond by emitting a configure event. Whether this actually
            /// un-maximizes the window is subject to compositor policies.
            /// If available and applicable, the compositor will include the window
            /// geometry dimensions the window had prior to being maximized in the
            /// configure event. The client must then update its content, drawing it in
            /// the configured state. The client must also acknowledge the configure
            /// when committing the new content (see ack_configure).
            ///
            /// It is up to the compositor to position the surface after it was
            /// unmaximized; usually the position the surface had before maximizing, if
            /// applicable.
            ///
            /// If the surface was already not maximized, the compositor will still
            /// emit a configure event without the "maximized" state.
            ///
            /// If the surface is in a fullscreen state, this request has no direct
            /// effect. It may alter the state the surface is returned to when
            /// unmaximized unless overridden by the compositor.
            pub fn unsetMaximized(_toplevel: *Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.marshal(10, null);
            }
            pub const unset_maximized_since_version = 1;

            /// Make the surface fullscreen.
            ///
            /// After requesting that the surface should be fullscreened, the
            /// compositor will respond by emitting a configure event. Whether the
            /// client is actually put into a fullscreen state is subject to compositor
            /// policies. The client must also acknowledge the configure when
            /// committing the new content (see ack_configure).
            ///
            /// The output passed by the request indicates the client's preference as
            /// to which display it should be set fullscreen on. If this value is NULL,
            /// it's up to the compositor to choose which display will be used to map
            /// this surface.
            ///
            /// If the surface doesn't cover the whole output, the compositor will
            /// position the surface in the center of the output and compensate with
            /// with border fill covering the rest of the output. The content of the
            /// border fill is undefined, but should be assumed to be in some way that
            /// attempts to blend into the surrounding area (e.g. solid black).
            ///
            /// If the fullscreened surface is not opaque, the compositor must make
            /// sure that other screen content not part of the same surface tree (made
            /// up of subsurfaces, popups or similarly coupled surfaces) are not
            /// visible below the fullscreened surface.
            pub fn setFullscreen(_toplevel: *Toplevel, _output: ?*client.wl.Output) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _proxy.marshal(11, &_args);
            }
            pub const set_fullscreen_since_version = 1;

            /// Make the surface no longer fullscreen.
            ///
            /// After requesting that the surface should be unfullscreened, the
            /// compositor will respond by emitting a configure event.
            /// Whether this actually removes the fullscreen state of the client is
            /// subject to compositor policies.
            ///
            /// Making a surface unfullscreen sets states for the surface based on the following:
            /// * the state(s) it may have had before becoming fullscreen
            /// * any state(s) decided by the compositor
            /// * any state(s) requested by the client while the surface was fullscreen
            ///
            /// The compositor may include the previous window geometry dimensions in
            /// the configure event, if applicable.
            ///
            /// The client must also acknowledge the configure when committing the new
            /// content (see ack_configure).
            pub fn unsetFullscreen(_toplevel: *Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.marshal(12, null);
            }
            pub const unset_fullscreen_since_version = 1;

            /// Request that the compositor minimize your surface. There is no
            /// way to know if the surface is currently minimized, nor is there
            /// any way to unset minimization on this surface.
            ///
            /// If you are looking to throttle redrawing when minimized, please
            /// instead use the wl_surface.frame event for this, as this will
            /// also work with live previews on windows in Alt-Tab, Expose or
            /// similar compositor features.
            pub fn setMinimized(_toplevel: *Toplevel) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel);
                _proxy.marshal(13, null);
            }
            pub const set_minimized_since_version = 1;
        };

        /// A popup surface is a short-lived, temporary surface. It can be used to
        /// implement for example menus, popovers, tooltips and other similar user
        /// interface concepts.
        ///
        /// A popup can be made to take an explicit grab. See xdg_popup.grab for
        /// details.
        ///
        /// When the popup is dismissed, a popup_done event will be sent out, and at
        /// the same time the surface will be unmapped. See the xdg_popup.popup_done
        /// event for details.
        ///
        /// Explicitly destroying the xdg_popup object will also dismiss the popup and
        /// unmap the surface. Clients that want to dismiss the popup when another
        /// surface of their own is clicked should dismiss the popup using the destroy
        /// request.
        ///
        /// A newly created xdg_popup will be stacked on top of all previously created
        /// xdg_popup surfaces associated with the same xdg_toplevel.
        ///
        /// The parent of an xdg_popup must be mapped (see the xdg_surface
        /// description) before the xdg_popup itself.
        ///
        /// The client must call wl_surface.commit on the corresponding wl_surface
        /// for the xdg_popup state to take effect.
        pub const Popup = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.popup.interface;
            pub const Error = common.xdg.popup.Error;
            pub inline fn getId(_popup: *Popup) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_popup)).getId();
            }
            pub inline fn getVersion(_popup: *Popup) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_popup)).getVersion();
            }
            pub inline fn getUserData(_popup: *Popup) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_popup)).getUserData();
            }
            pub inline fn setQueue(_popup: *Popup, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_popup);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;
                pub const popup_done_since_version = 1;

                /// This event asks the popup surface to configure itself given the
                /// configuration. The configured state should not be applied immediately.
                /// See xdg_surface.configure for details.
                ///
                /// The x and y arguments represent the position the popup was placed at
                /// given the xdg_positioner rule, relative to the upper left corner of the
                /// window geometry of the parent surface.
                ///
                /// For version 2 or older, the configure event for an xdg_popup is only
                /// ever sent once for the initial configuration. Starting with version 3,
                /// it may be sent again if the popup is setup with an xdg_positioner with
                /// set_reactive requested, or in response to xdg_popup.reposition requests.
                configure: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// The popup_done event is sent out when a popup is dismissed by the
                /// compositor. The client should destroy the xdg_popup object at this
                /// point.
                popup_done: void,
            };
            pub inline fn setListener(
                _popup: *Popup,
                comptime T: type,
                _listener: *const fn (popup: *Popup, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_popup);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(Popup, T).dispatcher, _listener, _mut_data);
            }
            /// This destroys the popup. Explicitly destroying the xdg_popup
            /// object will also dismiss the popup, and unmap the surface.
            ///
            /// If this xdg_popup is not the "topmost" popup, the
            /// xdg_wm_base.not_the_topmost_popup protocol error will be sent.
            pub fn destroy(_popup: *Popup) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_popup);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request makes the created popup take an explicit grab. An explicit
            /// grab will be dismissed when the user dismisses the popup, or when the
            /// client destroys the xdg_popup. This can be done by the user clicking
            /// outside the surface, using the keyboard, or even locking the screen
            /// through closing the lid or a timeout.
            ///
            /// If the compositor denies the grab, the popup will be immediately
            /// dismissed.
            ///
            /// This request must be used in response to some sort of user action like a
            /// button press, key press, or touch down event. The serial number of the
            /// event should be passed as 'serial'.
            ///
            /// The parent of a grabbing popup must either be an xdg_toplevel surface or
            /// another xdg_popup with an explicit grab. If the parent is another
            /// xdg_popup it means that the popups are nested, with this popup now being
            /// the topmost popup.
            ///
            /// Nested popups must be destroyed in the reverse order they were created
            /// in, e.g. the only popup you are allowed to destroy at all times is the
            /// topmost one.
            ///
            /// When compositors choose to dismiss a popup, they may dismiss every
            /// nested grabbing popup as well. When a compositor dismisses popups, it
            /// will follow the same dismissing order as required from the client.
            ///
            /// If the topmost grabbing popup is destroyed, the grab will be returned to
            /// the parent of the popup, if that parent previously had an explicit grab.
            ///
            /// If the parent is a grabbing popup which has already been dismissed, this
            /// popup will be immediately dismissed. If the parent is a popup that did
            /// not take an explicit grab, an error will be raised.
            ///
            /// During a popup grab, the client owning the grab will receive pointer
            /// and touch events for all their surfaces as normal (similar to an
            /// "owner-events" grab in X11 parlance), while the top most grabbing popup
            /// will always have keyboard focus.
            pub fn grab(_popup: *Popup, _seat: *client.wl.Seat, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_popup);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .u = _serial },
                };
                _proxy.marshal(1, &_args);
            }
            pub const grab_since_version = 1;
        };
    };
    pub const wp = struct {
        /// A singleton global interface used for getting color management extensions
        /// for wl_surface and wl_output objects, and for creating client defined
        /// image description objects. The extension interfaces allow
        /// getting the image description of outputs and setting the image
        /// description of surfaces.
        ///
        /// Compositors should never remove this global.
        pub const ColorManagerV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_manager_v1.interface;
            pub const Error = common.wp.color_manager_v1.Error;
            pub const RenderIntent = common.wp.color_manager_v1.RenderIntent;
            pub const Feature = common.wp.color_manager_v1.Feature;
            pub const Primaries = common.wp.color_manager_v1.Primaries;
            pub const TransferFunction = common.wp.color_manager_v1.TransferFunction;
            pub inline fn getId(_color_manager_v1: *ColorManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_manager_v1)).getId();
            }
            pub inline fn getVersion(_color_manager_v1: *ColorManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_color_manager_v1: *ColorManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_color_manager_v1: *ColorManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const supported_intent_since_version = 1;
                pub const supported_feature_since_version = 1;
                pub const supported_tf_named_since_version = 1;
                pub const supported_primaries_named_since_version = 1;
                pub const done_since_version = 1;

                /// When this object is created, it shall immediately send this event once
                /// for each rendering intent the compositor supports.
                ///
                /// A compositor must not advertise intents that are deprecated in the
                /// bound version of the interface.
                supported_intent: struct {
                    render_intent: RenderIntent,
                },

                /// When this object is created, it shall immediately send this event once
                /// for each compositor supported feature listed in the enumeration.
                ///
                /// A compositor must not advertise features that are deprecated in the
                /// bound version of the interface.
                supported_feature: struct {
                    feature: Feature,
                },

                /// When this object is created, it shall immediately send this event once
                /// for each named transfer function the compositor supports with the
                /// parametric image description creator.
                ///
                /// A compositor must not advertise transfer functions that are deprecated
                /// in the bound version of the interface.
                supported_tf_named: struct {
                    tf: TransferFunction,
                },

                /// When this object is created, it shall immediately send this event once
                /// for each named set of primaries the compositor supports with the
                /// parametric image description creator.
                ///
                /// A compositor must not advertise names that are deprecated in the
                /// bound version of the interface.
                supported_primaries_named: struct {
                    primaries: Primaries,
                },

                /// This event is sent when all supported rendering intents, features,
                /// transfer functions and named primaries have been sent.
                done: void,
            };
            pub inline fn setListener(
                _color_manager_v1: *ColorManagerV1,
                comptime T: type,
                _listener: *const fn (color_manager_v1: *ColorManagerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ColorManagerV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the wp_color_manager_v1 object. This does not affect any other
            /// objects in any way.
            pub fn destroy(_color_manager_v1: *ColorManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This creates a new wp_color_management_output_v1 object for the
            /// given wl_output.
            ///
            /// See the wp_color_management_output_v1 interface for more details.
            pub fn getOutput(_color_manager_v1: *ColorManagerV1, _output: *client.wl.Output) !*client.wp.ColorManagementOutputV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_output) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.ColorManagementOutputV1.interface));
            }
            pub const get_output_since_version = 1;

            /// If a wp_color_management_surface_v1 object already exists for the given
            /// wl_surface, the protocol error surface_exists is raised.
            ///
            /// This creates a new color wp_color_management_surface_v1 object for the
            /// given wl_surface.
            ///
            /// See the wp_color_management_surface_v1 interface for more details.
            pub fn getSurface(_color_manager_v1: *ColorManagerV1, _surface: *client.wl.Surface) !*client.wp.ColorManagementSurfaceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.wp.ColorManagementSurfaceV1.interface));
            }
            pub const get_surface_since_version = 1;

            /// This creates a new color wp_color_management_surface_feedback_v1 object
            /// for the given wl_surface.
            ///
            /// See the wp_color_management_surface_feedback_v1 interface for more
            /// details.
            pub fn getSurfaceFeedback(_color_manager_v1: *ColorManagerV1, _surface: *client.wl.Surface) !*client.wp.ColorManagementSurfaceFeedbackV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(3, &_args, client.wp.ColorManagementSurfaceFeedbackV1.interface));
            }
            pub const get_surface_feedback_since_version = 1;

            /// Makes a new ICC-based image description creator object with all
            /// properties initially unset. The client can then use the object's
            /// interface to define all the required properties for an image description
            /// and finally create a wp_image_description_v1 object.
            ///
            /// This request can be used when the compositor advertises
            /// wp_color_manager_v1.feature.icc_v2_v4.
            /// Otherwise this request raises the protocol error unsupported_feature.
            pub fn createIccCreator(_color_manager_v1: *ColorManagerV1) !*client.wp.ImageDescriptionCreatorIccV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(4, &_args, client.wp.ImageDescriptionCreatorIccV1.interface));
            }
            pub const create_icc_creator_since_version = 1;

            /// Makes a new parametric image description creator object with all
            /// properties initially unset. The client can then use the object's
            /// interface to define all the required properties for an image description
            /// and finally create a wp_image_description_v1 object.
            ///
            /// This request can be used when the compositor advertises
            /// wp_color_manager_v1.feature.parametric.
            /// Otherwise this request raises the protocol error unsupported_feature.
            pub fn createParametricCreator(_color_manager_v1: *ColorManagerV1) !*client.wp.ImageDescriptionCreatorParamsV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(5, &_args, client.wp.ImageDescriptionCreatorParamsV1.interface));
            }
            pub const create_parametric_creator_since_version = 1;

            /// This creates a pre-defined image description for the so-called
            /// Windows-scRGB stimulus encoding. This comes from the Windows 10 handling
            /// of its own definition of an scRGB color space for an HDR screen
            /// driven in BT.2100/PQ signalling mode.
            ///
            /// Windows-scRGB uses sRGB (BT.709) color primaries and white point.
            /// The transfer characteristic is extended linear.
            ///
            /// The nominal color channel value range is extended, meaning it includes
            /// negative and greater than 1.0 values. Negative values are used to
            /// escape the sRGB color gamut boundaries. To make use of the extended
            /// range, the client needs to use a pixel format that can represent those
            /// values, e.g. floating-point 16 bits per channel.
            ///
            /// Nominal color value R=G=B=0.0 corresponds to BT.2100/PQ system
            /// 0 cd/m², and R=G=B=1.0 corresponds to BT.2100/PQ system 80 cd/m².
            /// The maximum is R=G=B=125.0 corresponding to 10k cd/m².
            ///
            /// Windows-scRGB is displayed by Windows 10 by converting it to
            /// BT.2100/PQ, maintaining the CIE 1931 chromaticity and mapping the
            /// luminance as above. No adjustment is made to the signal to account
            /// for the viewing conditions.
            ///
            /// The reference white level of Windows-scRGB is unknown. If a
            /// reference white level must be assumed for compositor processing, it
            /// should be R=G=B=2.5375 corresponding to 203 cd/m² of Report ITU-R
            /// BT.2408-7.
            ///
            /// The target color volume of Windows-scRGB is unknown. The color gamut
            /// may be anything between sRGB and BT.2100.
            ///
            /// Note: EGL_EXT_gl_colorspace_scrgb_linear definition differs from
            /// Windows-scRGB by using R=G=B=1.0 as the reference white level, while
            /// Windows-scRGB reference white level is unknown or varies. However,
            /// it seems probable that Windows implements both
            /// EGL_EXT_gl_colorspace_scrgb_linear and Vulkan
            /// VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT as Windows-scRGB.
            ///
            /// This request can be used when the compositor advertises
            /// wp_color_manager_v1.feature.windows_scrgb.
            /// Otherwise this request raises the protocol error unsupported_feature.
            ///
            /// The resulting image description object does not allow get_information
            /// request. The wp_image_description_v1.ready event shall be sent.
            pub fn createWindowsScrgb(_color_manager_v1: *ColorManagerV1) !*client.wp.ImageDescriptionV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(6, &_args, client.wp.ImageDescriptionV1.interface));
            }
            pub const create_windows_scrgb_since_version = 1;

            /// This request retrieves the image description backing a reference.
            ///
            /// The get_information request can be used if and only if the request that
            /// creates the reference allows it.
            pub fn getImageDescription(_color_manager_v1: *ColorManagerV1, _reference: *client.wp.ImageDescriptionReferenceV1) !*client.wp.ImageDescriptionV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_reference) },
                };
                return @ptrCast(try _proxy.marshalConstructor(7, &_args, client.wp.ImageDescriptionV1.interface));
            }
            pub const get_image_description_since_version = 2;
        };

        /// A wp_color_management_output_v1 describes the color properties of an
        /// output.
        ///
        /// The wp_color_management_output_v1 is associated with the wl_output global
        /// underlying the wl_output object. Therefore the client destroying the
        /// wl_output object has no impact, but the compositor removing the output
        /// global makes the wp_color_management_output_v1 object inert.
        pub const ColorManagementOutputV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_output_v1.interface;
            pub inline fn getId(_color_management_output_v1: *ColorManagementOutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_output_v1)).getId();
            }
            pub inline fn getVersion(_color_management_output_v1: *ColorManagementOutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_output_v1)).getVersion();
            }
            pub inline fn getUserData(_color_management_output_v1: *ColorManagementOutputV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_output_v1)).getUserData();
            }
            pub inline fn setQueue(_color_management_output_v1: *ColorManagementOutputV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_output_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const image_description_changed_since_version = 1;

                /// This event is sent whenever the image description of the output changed,
                /// followed by one wl_output.done event common to output events across all
                /// extensions.
                ///
                /// If the client wants to use the updated image description, it needs to do
                /// get_image_description again, because image description objects are
                /// immutable.
                image_description_changed: void,
            };
            pub inline fn setListener(
                _color_management_output_v1: *ColorManagementOutputV1,
                comptime T: type,
                _listener: *const fn (color_management_output_v1: *ColorManagementOutputV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_output_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ColorManagementOutputV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the color wp_color_management_output_v1 object. This does not
            /// affect any remaining protocol objects.
            pub fn destroy(_color_management_output_v1: *ColorManagementOutputV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_output_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This creates a new wp_image_description_v1 object for the current image
            /// description of the output. There always is exactly one image description
            /// active for an output so the client should destroy the image description
            /// created by earlier invocations of this request. This request is usually
            /// sent as a reaction to the image_description_changed event or when
            /// creating a wp_color_management_output_v1 object.
            ///
            /// The image description of an output represents the color encoding the
            /// output expects. There might be performance and power advantages, as well
            /// as improved color reproduction, if a content update matches the image
            /// description of the output it is being shown on. If a content update is
            /// shown on any other output than the one it matches the image description
            /// of, then the color reproduction on those outputs might be considerably
            /// worse.
            ///
            /// The created wp_image_description_v1 object preserves the image
            /// description of the output from the time the object was created.
            ///
            /// The resulting image description object allows get_information request.
            ///
            /// If this protocol object is inert, the resulting image description object
            /// shall immediately deliver the wp_image_description_v1.failed event with
            /// the no_output cause.
            ///
            /// If the interface version is inadequate for the output's image
            /// description, meaning that the client does not support all the events
            /// needed to deliver the crucial information, the resulting image
            /// description object shall immediately deliver the
            /// wp_image_description_v1.failed event with the low_version cause.
            ///
            /// Otherwise the object shall immediately deliver the ready event.
            pub fn getImageDescription(_color_management_output_v1: *ColorManagementOutputV1) !*client.wp.ImageDescriptionV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_output_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.ImageDescriptionV1.interface));
            }
            pub const get_image_description_since_version = 1;
        };

        /// An image description carries information about the pixel color encoding
        /// and its intended display and viewing environment. The image description is
        /// attached to a wl_surface via
        /// wp_color_management_surface_v1.set_image_description. A compositor can use
        /// this information to decode pixel values into colorimetrically meaningful
        /// quantities, which allows the compositor to transform the surface contents
        /// to become suitable for various displays and viewing environments.
        ///
        /// Note, that the wp_image_description_v1 object is not ready to be used
        /// immediately after creation. The object eventually delivers either the
        /// 'ready' or the 'failed' event, specified in all requests creating it. The
        /// object is deemed "ready" after receiving the 'ready' event.
        ///
        /// An object which is not ready is illegal to use, it can only be destroyed.
        /// Any other request in this interface shall result in the 'not_ready'
        /// protocol error. Attempts to use an object which is not ready through other
        /// interfaces shall raise protocol errors defined there.
        ///
        /// Once created and regardless of how it was created, a
        /// wp_image_description_v1 object always refers to one fixed image
        /// description. It cannot change after creation.
        pub const ImageDescriptionV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_v1.interface;
            pub const Error = common.wp.image_description_v1.Error;
            pub const Cause = common.wp.image_description_v1.Cause;
            pub inline fn getId(_image_description_v1: *ImageDescriptionV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_v1)).getId();
            }
            pub inline fn getVersion(_image_description_v1: *ImageDescriptionV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_v1)).getVersion();
            }
            pub inline fn getUserData(_image_description_v1: *ImageDescriptionV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_v1)).getUserData();
            }
            pub inline fn setQueue(_image_description_v1: *ImageDescriptionV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const failed_since_version = 1;
                pub const ready_since_version = 1;
                pub const ready2_since_version = 2;

                /// If creating a wp_image_description_v1 object fails for a reason that is
                /// not defined as a protocol error, this event is sent.
                ///
                /// The requests that create image description objects define whether and
                /// when this can occur. Only such creation requests can trigger this event.
                /// This event cannot be triggered after the image description was
                /// successfully formed.
                ///
                /// Once this event has been sent, the wp_image_description_v1 object will
                /// never become ready and it can only be destroyed.
                failed: struct {
                    cause: Cause,
                    msg: [*:0]const u8,
                },

                /// Starting from interface version 2, the 'ready2' event is sent instead
                /// of this event.
                ///
                /// For the definition of this event, see the 'ready2' event. The
                /// difference to this event is as follows.
                ///
                /// The id number is valid only as long as the protocol object is alive. If
                /// all protocol objects referring to the same image description record are
                /// destroyed, the id number may be recycled for a different image
                /// description record.
                ready: struct {
                    identity: u32,
                },

                /// Once this event has been sent, the wp_image_description_v1 object is
                /// deemed "ready". Ready objects can be used to send requests and can be
                /// used through other interfaces.
                ///
                /// Every ready wp_image_description_v1 protocol object refers to an
                /// underlying image description record in the compositor. Multiple protocol
                /// objects may end up referring to the same record. Clients may identify
                /// these "copies" by comparing their id numbers: if the numbers from two
                /// protocol objects are identical, the protocol objects refer to the same
                /// image description record. Two different image description records
                /// cannot have the same id number simultaneously. The id number does not
                /// change during the lifetime of the image description record.
                ///
                /// Image description id number is not a protocol object id. Zero is
                /// reserved as an invalid id number. It shall not be possible for a client
                /// to refer to an image description by its id number in protocol. The id
                /// numbers might not be portable between Wayland connections. A compositor
                /// shall not send an invalid id number.
                ///
                /// Compositors must not recycle image description id numbers.
                ///
                /// This identity allows clients to de-duplicate image description records
                /// and avoid get_information request if they already have the image
                /// description information.
                ready2: struct {
                    identity_hi: u32,
                    identity_lo: u32,
                },
            };
            pub inline fn setListener(
                _image_description_v1: *ImageDescriptionV1,
                comptime T: type,
                _listener: *const fn (image_description_v1: *ImageDescriptionV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ImageDescriptionV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy this object. It is safe to destroy an object which is not ready.
            ///
            /// Destroying a wp_image_description_v1 object has no side-effects, not
            /// even if a wp_color_management_surface_v1.set_image_description has not
            /// yet been followed by a wl_surface.commit.
            pub fn destroy(_image_description_v1: *ImageDescriptionV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Creates a wp_image_description_info_v1 object which delivers the
            /// information that makes up the image description.
            ///
            /// Not all image description protocol objects allow get_information
            /// request. Whether it is allowed or not is defined by the request that
            /// created the object. If get_information is not allowed, the protocol
            /// error no_information is raised.
            pub fn getInformation(_image_description_v1: *ImageDescriptionV1) !*client.wp.ImageDescriptionInfoV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.ImageDescriptionInfoV1.interface));
            }
            pub const get_information_since_version = 1;
        };

        /// Sends all matching events describing an image description object exactly
        /// once and finally sends the 'done' event.
        ///
        /// This means
        /// - if the image description is parametric, it must send
        /// - primaries
        /// - named_primaries, if applicable
        /// - at least one of tf_power and tf_named, as applicable
        /// - luminances
        /// - target_primaries
        /// - target_luminance
        /// - if the image description is parametric, it may send, if applicable,
        /// - target_max_cll
        /// - target_max_fall
        /// - if the image description contains an ICC profile, it must send the
        /// icc_file event
        ///
        /// Once a wp_image_description_info_v1 object has delivered a 'done' event it
        /// is automatically destroyed.
        ///
        /// Every wp_image_description_info_v1 created from the same
        /// wp_image_description_v1 shall always return the exact same data.
        pub const ImageDescriptionInfoV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_info_v1.interface;
            pub inline fn getId(_image_description_info_v1: *ImageDescriptionInfoV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_info_v1)).getId();
            }
            pub inline fn getVersion(_image_description_info_v1: *ImageDescriptionInfoV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_info_v1)).getVersion();
            }
            pub inline fn getUserData(_image_description_info_v1: *ImageDescriptionInfoV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_info_v1)).getUserData();
            }
            pub inline fn setQueue(_image_description_info_v1: *ImageDescriptionInfoV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_info_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const done_since_version = 1;
                pub const icc_file_since_version = 1;
                pub const primaries_since_version = 1;
                pub const primaries_named_since_version = 1;
                pub const tf_power_since_version = 1;
                pub const tf_named_since_version = 1;
                pub const luminances_since_version = 1;
                pub const target_primaries_since_version = 1;
                pub const target_luminance_since_version = 1;
                pub const target_max_cll_since_version = 1;
                pub const target_max_fall_since_version = 1;

                /// Signals the end of information events and destroys the object.
                done: void,
                /// The icc argument provides a file descriptor to the client which may be
                /// memory-mapped to provide the ICC profile matching the image description.
                /// The fd is read-only, and if mapped then it must be mapped with
                /// MAP_PRIVATE by the client.
                ///
                /// The ICC profile version and other details are determined by the
                /// compositor. There is no provision for a client to ask for a specific
                /// kind of a profile.
                icc_file: struct {
                    icc: i32,
                    icc_size: u32,
                },

                /// Delivers the primary color volume primaries and white point using CIE
                /// 1931 xy chromaticity coordinates.
                ///
                /// Each coordinate value is multiplied by 1 million to get the argument
                /// value to carry precision of 6 decimals.
                primaries: struct {
                    r_x: i32,
                    r_y: i32,
                    g_x: i32,
                    g_y: i32,
                    b_x: i32,
                    b_y: i32,
                    w_x: i32,
                    w_y: i32,
                },

                /// Delivers the primary color volume primaries and white point using an
                /// explicitly enumerated named set.
                primaries_named: struct {
                    primaries: common.wp.color_manager_v1.Primaries,
                },

                /// The color component transfer characteristic of this image description is
                /// a pure power curve. This event provides the exponent of the power
                /// function. This curve represents the conversion from electrical to
                /// optical pixel or color values.
                ///
                /// The curve exponent has been multiplied by 10000 to get the argument eexp
                /// value to carry the precision of 4 decimals.
                tf_power: struct {
                    eexp: u32,
                },

                /// Delivers the transfer characteristic using an explicitly enumerated
                /// named function.
                tf_named: struct {
                    tf: common.wp.color_manager_v1.TransferFunction,
                },

                /// Delivers the primary color volume luminance range and the reference
                /// white luminance level. These values include the minimum display emission
                /// and ambient flare luminances, assumed to be optically additive and have
                /// the chromaticity of the primary color volume white point.
                ///
                /// The minimum luminance is multiplied by 10000 to get the argument
                /// 'min_lum' value and carries precision of 4 decimals. The maximum
                /// luminance and reference white luminance values are unscaled.
                luminances: struct {
                    min_lum: u32,
                    max_lum: u32,
                    reference_lum: u32,
                },

                /// Provides the color primaries and white point of the target color volume
                /// using CIE 1931 xy chromaticity coordinates. This is compatible with the
                /// SMPTE ST 2086 definition of HDR static metadata for mastering displays.
                ///
                /// While primary color volume is about how color is encoded, the target
                /// color volume is the actually displayable color volume.
                ///
                /// Each coordinate value is multiplied by 1 million to get the argument
                /// value to carry precision of 6 decimals.
                target_primaries: struct {
                    r_x: i32,
                    r_y: i32,
                    g_x: i32,
                    g_y: i32,
                    b_x: i32,
                    b_y: i32,
                    w_x: i32,
                    w_y: i32,
                },

                /// Provides the luminance range that the image description is targeting as
                /// the minimum and maximum absolute luminance L. These values include the
                /// minimum display emission and ambient flare luminances, assumed to be
                /// optically additive and have the chromaticity of the primary color
                /// volume white point. This should be compatible with the SMPTE ST 2086
                /// definition of HDR static metadata.
                ///
                /// This luminance range is only theoretical and may not correspond to the
                /// luminance of light emitted on an actual display.
                ///
                /// Min L value is multiplied by 10000 to get the argument min_lum value and
                /// carry precision of 4 decimals. Max L value is unscaled for max_lum.
                target_luminance: struct {
                    min_lum: u32,
                    max_lum: u32,
                },

                /// Provides the targeted max_cll of the image description. max_cll is
                /// defined by CTA-861-H.
                ///
                /// This luminance is only theoretical and may not correspond to the
                /// luminance of light emitted on an actual display.
                target_max_cll: struct {
                    max_cll: u32,
                },

                /// Provides the targeted max_fall of the image description. max_fall is
                /// defined by CTA-861-H.
                ///
                /// This luminance is only theoretical and may not correspond to the
                /// luminance of light emitted on an actual display.
                target_max_fall: struct {
                    max_fall: u32,
                },
            };
            pub inline fn setListener(
                _image_description_info_v1: *ImageDescriptionInfoV1,
                comptime T: type,
                _listener: *const fn (image_description_info_v1: *ImageDescriptionInfoV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_info_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ImageDescriptionInfoV1, T).dispatcher, _listener, _mut_data);
            }
            pub inline fn destroy(_image_description_info_v1: *ImageDescriptionInfoV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_info_v1);
                _proxy.destroy();
            }
        };

        /// A wp_color_management_surface_v1 allows the client to set the color
        /// space and HDR properties of a surface.
        ///
        /// If the wl_surface associated with the wp_color_management_surface_v1 is
        /// destroyed, the wp_color_management_surface_v1 object becomes inert.
        pub const ColorManagementSurfaceV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_surface_v1.interface;
            pub const Error = common.wp.color_management_surface_v1.Error;
            pub inline fn getId(_color_management_surface_v1: *ColorManagementSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_v1)).getId();
            }
            pub inline fn getVersion(_color_management_surface_v1: *ColorManagementSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_v1)).getVersion();
            }
            pub inline fn getUserData(_color_management_surface_v1: *ColorManagementSurfaceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_v1)).getUserData();
            }
            pub inline fn setQueue(_color_management_surface_v1: *ColorManagementSurfaceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy the wp_color_management_surface_v1 object and do the same as
            /// unset_image_description.
            pub fn destroy(_color_management_surface_v1: *ColorManagementSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// Set the image description of the underlying surface. The image
            /// description and rendering intent are double-buffered state, see
            /// wl_surface.commit.
            ///
            /// It is the client's responsibility to understand the image description
            /// it sets on a surface, and to provide content that matches that image
            /// description. Compositors might convert images to match their own or any
            /// other image descriptions.
            ///
            /// Image descriptions which are not ready (see wp_image_description_v1)
            /// are forbidden in this request, and in such case the protocol error
            /// image_description is raised.
            ///
            /// All image descriptions which are ready (see wp_image_description_v1)
            /// are allowed and must always be accepted by the compositor.
            ///
            /// When an image description is set on a surface, it establishes an
            /// explicit link between surface pixel values and surface colorimetry.
            /// This link may be undefined for some pixel values, see the image
            /// description creator interfaces for the conditions. Non-finite
            /// floating-point values (NaN, Inf) always have an undefined colorimetry.
            ///
            /// A rendering intent provides the client's preference on how surface
            /// colorimetry should be mapped to each output. The render_intent value
            /// must be one advertised by the compositor with
            /// wp_color_manager_v1.render_intent event, otherwise the protocol error
            /// render_intent is raised.
            ///
            /// By default, a surface does not have an associated image description
            /// nor a rendering intent. The handling of color on such surfaces is
            /// compositor implementation defined. Compositors should handle such
            /// surfaces as sRGB, but may handle them differently if they have specific
            /// requirements.
            ///
            /// Setting the image description has copy semantics; after this request,
            /// the image description can be immediately destroyed without affecting
            /// the pending state of the surface.
            pub fn setImageDescription(_color_management_surface_v1: *ColorManagementSurfaceV1, _image_description: *client.wp.ImageDescriptionV1, _render_intent: common.wp.color_manager_v1.RenderIntent) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_image_description) },
                    .{ .u = switch (@typeInfo(common.wp.color_manager_v1.RenderIntent)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_render_intent))),
                        .@"struct" => @bitCast(_render_intent),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_image_description_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// This request removes any image description from the surface. See
            /// set_image_description for how a compositor handles a surface without
            /// an image description. This is double-buffered state, see
            /// wl_surface.commit.
            pub fn unsetImageDescription(_color_management_surface_v1: *ColorManagementSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_v1);
                _proxy.marshal(2, null);
            }
            pub const unset_image_description_since_version = 1;
        };

        /// A wp_color_management_surface_feedback_v1 allows the client to get the
        /// preferred image description of a surface.
        ///
        /// If the wl_surface associated with this object is destroyed, the
        /// wp_color_management_surface_feedback_v1 object becomes inert.
        pub const ColorManagementSurfaceFeedbackV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_surface_feedback_v1.interface;
            pub const Error = common.wp.color_management_surface_feedback_v1.Error;
            pub inline fn getId(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_feedback_v1)).getId();
            }
            pub inline fn getVersion(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_feedback_v1)).getVersion();
            }
            pub inline fn getUserData(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_management_surface_feedback_v1)).getUserData();
            }
            pub inline fn setQueue(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_feedback_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const preferred_changed_since_version = 1;
                pub const preferred_changed2_since_version = 2;

                /// Starting from interface version 2, 'preferred_changed2' is sent instead
                /// of this event. See the 'preferred_changed2' event for the definition.
                preferred_changed: struct {
                    identity: u32,
                },

                /// The preferred image description is the one which likely has the most
                /// performance and/or quality benefits for the compositor if used by the
                /// client for its wl_surface contents. This event is sent whenever the
                /// compositor changes the wl_surface's preferred image description.
                ///
                /// This event sends the identity of the new preferred state as the argument,
                /// so clients who are aware of the image description already can reuse it.
                /// Otherwise, if the client client wants to know what the preferred image
                /// description is, it shall use the get_preferred request.
                ///
                /// The preferred image description is not automatically used for anything.
                /// It is only a hint, and clients may set any valid image description with
                /// set_image_description, but there might be performance and color accuracy
                /// improvements by providing the wl_surface contents in the preferred
                /// image description. Therefore clients that can, should render according
                /// to the preferred image description
                preferred_changed2: struct {
                    identity_hi: u32,
                    identity_lo: u32,
                },
            };
            pub inline fn setListener(
                _color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1,
                comptime T: type,
                _listener: *const fn (color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_feedback_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ColorManagementSurfaceFeedbackV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the wp_color_management_surface_feedback_v1 object.
            pub fn destroy(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_feedback_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// The preferred image description represents the compositor's preferred
            /// color encoding for this wl_surface at the current time. There might be
            /// performance and power advantages, as well as improved color
            /// reproduction, if the image description of a content update matches the
            /// preferred image description.
            ///
            /// This creates a new wp_image_description_v1 object for the currently
            /// preferred image description for the wl_surface. The client should
            /// stop using and destroy the image descriptions created by earlier
            /// invocations of this request for the associated wl_surface.
            /// This request is usually sent as a reaction to the preferred_changed
            /// event or when creating a wp_color_management_surface_feedback_v1 object
            /// if the client is capable of adapting to image descriptions.
            ///
            /// The created wp_image_description_v1 object preserves the preferred image
            /// description of the wl_surface from the time the object was created.
            ///
            /// The resulting image description object allows get_information request.
            ///
            /// If the image description is parametric, the client should set it on its
            /// wl_surface only if the image description is an exact match with the
            /// client content. Particularly if everything else matches, but the target
            /// color volume is greater than what the client needs, the client should
            /// create its own parameric image description with its exact parameters.
            ///
            /// If the interface version is inadequate for the preferred image
            /// description, meaning that the client does not support all the
            /// events needed to deliver the crucial information, the resulting image
            /// description object shall immediately deliver the
            /// wp_image_description_v1.failed event with the low_version cause,
            /// otherwise the object shall immediately deliver the ready event.
            pub fn getPreferred(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) !*client.wp.ImageDescriptionV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_feedback_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.ImageDescriptionV1.interface));
            }
            pub const get_preferred_since_version = 1;

            /// The same description as for get_preferred applies, except the returned
            /// image description is guaranteed to be parametric. This is meant for
            /// clients that can only deal with parametric image descriptions.
            ///
            /// If the compositor doesn't support parametric image descriptions, the
            /// unsupported_feature error is emitted.
            pub fn getPreferredParametric(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) !*client.wp.ImageDescriptionV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_management_surface_feedback_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.wp.ImageDescriptionV1.interface));
            }
            pub const get_preferred_parametric_since_version = 1;
        };

        /// This type of object is used for collecting all the information required
        /// to create a wp_image_description_v1 object from an ICC file. A complete
        /// set of required parameters consists of these properties:
        /// - ICC file
        ///
        /// Each required property must be set exactly once if the client is to create
        /// an image description. The set requests verify that a property was not
        /// already set. The create request verifies that all required properties are
        /// set. There may be several alternative requests for setting each property,
        /// and in that case the client must choose one of them.
        ///
        /// Once all properties have been set, the create request must be used to
        /// create the image description object, destroying the creator in the
        /// process.
        ///
        /// The link between a pixel value (a device value in ICC) and its respective
        /// colorimetry is defined by the details of the particular ICC profile.
        /// Those details also determine when colorimetry becomes undefined.
        pub const ImageDescriptionCreatorIccV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_creator_icc_v1.interface;
            pub const Error = common.wp.image_description_creator_icc_v1.Error;
            pub inline fn getId(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_icc_v1)).getId();
            }
            pub inline fn getVersion(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_icc_v1)).getVersion();
            }
            pub inline fn getUserData(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_icc_v1)).getUserData();
            }
            pub inline fn setQueue(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_icc_v1);
                _proxy.setQueue(_queue);
            }
            /// Create an image description object based on the ICC information
            /// previously set on this object. A compositor must parse the ICC data in
            /// some undefined but finite amount of time.
            ///
            /// The completeness of the parameter set is verified. If the set is not
            /// complete, the protocol error incomplete_set is raised. For the
            /// definition of a complete set, see the description of this interface.
            ///
            /// If the particular combination of the information is not supported
            /// by the compositor, the resulting image description object shall
            /// immediately deliver the wp_image_description_v1.failed event with the
            /// 'unsupported' cause. If a valid image description was created from the
            /// information, the wp_image_description_v1.ready event will eventually
            /// be sent instead.
            ///
            /// This request destroys the wp_image_description_creator_icc_v1 object.
            ///
            /// The resulting image description object does not allow get_information
            /// request.
            pub fn create(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_icc_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                _proxy.marshal(0, &_args);
                _proxy.destroy();
            }
            pub const create_since_version = 1;

            /// Sets the ICC profile file to be used as the basis of the image
            /// description.
            ///
            /// The data shall be found through the given fd at the given offset, having
            /// the given length. The fd must be seekable and readable. Violating these
            /// requirements raises the bad_fd protocol error.
            ///
            /// If reading the data fails due to an error independent of the client, the
            /// compositor shall send the wp_image_description_v1.failed event on the
            /// created wp_image_description_v1 with the 'operating_system' cause.
            ///
            /// The maximum size of the ICC profile is 32 MB. If length is greater than
            /// that or zero, the protocol error bad_size is raised. If offset + length
            /// exceeds the file size, the protocol error out_of_file is raised.
            ///
            /// A compositor may read the file at any time starting from this request
            /// and only until whichever happens first:
            /// - If create request was issued, the wp_image_description_v1 object
            /// delivers either failed or ready event; or
            /// - if create request was not issued, this
            /// wp_image_description_creator_icc_v1 object is destroyed.
            ///
            /// A compositor shall not modify the contents of the file, and the fd may
            /// be sealed for writes and size changes. The client must ensure to its
            /// best ability that the data does not change while the compositor is
            /// reading it.
            ///
            /// The data must represent a valid ICC profile. The ICC profile version
            /// must be 2 or 4, it must be a 3 channel profile and the class must be
            /// Display or ColorSpace. Violating these requirements will not result in a
            /// protocol error, but will eventually send the
            /// wp_image_description_v1.failed event on the created
            /// wp_image_description_v1 with the 'unsupported' cause.
            ///
            /// See the International Color Consortium specification ICC.1:2022 for more
            /// details about ICC profiles.
            ///
            /// If ICC file has already been set on this object, the protocol error
            /// already_set is raised.
            pub fn setIccFile(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1, _icc_profile: i32, _offset: u32, _length: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_icc_v1);
                var _args = [_]common.Argument{
                    .{ .h = _icc_profile },
                    .{ .u = _offset },
                    .{ .u = _length },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_icc_file_since_version = 1;
            pub inline fn destroy(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_icc_v1);
                _proxy.destroy();
            }
        };

        /// This type of object is used for collecting all the parameters required
        /// to create a wp_image_description_v1 object. A complete set of required
        /// parameters consists of these properties:
        /// - transfer characteristic function (tf)
        /// - chromaticities of primaries and white point (primary color volume)
        ///
        /// The following properties are optional and have a well-defined default
        /// if not explicitly set:
        /// - primary color volume luminance range
        /// - reference white luminance level
        /// - mastering display primaries and white point (target color volume)
        /// - mastering luminance range
        ///
        /// The following properties are optional and will be ignored
        /// if not explicitly set:
        /// - maximum content light level
        /// - maximum frame-average light level
        ///
        /// Each required property must be set exactly once if the client is to create
        /// an image description. The set requests verify that a property was not
        /// already set. The create request verifies that all required properties are
        /// set. There may be several alternative requests for setting each property,
        /// and in that case the client must choose one of them.
        ///
        /// Once all properties have been set, the create request must be used to
        /// create the image description object, destroying the creator in the
        /// process.
        ///
        /// A viewer, who is viewing the display defined by the resulting image
        /// description (the viewing environment included), is assumed to be fully
        /// adapted to the primary color volume's white point.
        ///
        /// Any of the following conditions will cause the colorimetry of a pixel
        /// to become undefined:
        /// - Values outside of the defined range of the transfer characteristic.
        /// - Tristimulus that exceeds the target color volume.
        /// - If extended_target_volume is not supported: tristimulus that exceeds
        /// the primary color volume.
        ///
        /// The closest correspondence to an image description created through this
        /// interface is the Display class of profiles in ICC.
        pub const ImageDescriptionCreatorParamsV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_creator_params_v1.interface;
            pub const Error = common.wp.image_description_creator_params_v1.Error;
            pub inline fn getId(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_params_v1)).getId();
            }
            pub inline fn getVersion(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_params_v1)).getVersion();
            }
            pub inline fn getUserData(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_image_description_creator_params_v1)).getUserData();
            }
            pub inline fn setQueue(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                _proxy.setQueue(_queue);
            }
            /// Create an image description object based on the parameters previously
            /// set on this object.
            ///
            /// The completeness of the parameter set is verified. If the set is not
            /// complete, the protocol error incomplete_set is raised. For the
            /// definition of a complete set, see the description of this interface.
            ///
            /// When both max_cll and max_fall are set, max_fall must be less or equal
            /// to max_cll otherwise the invalid_luminance protocol error is raised.
            ///
            /// In version 1, these following conditions also result in the
            /// invalid_luminance protocol error. Version 2 and later do not have this
            /// requirement.
            /// - When max_cll is set, it must be greater than min L and less or equal
            /// to max L of the mastering luminance range.
            /// - When max_fall is set, it must be greater than min L and less or equal
            /// to max L of the mastering luminance range.
            ///
            /// If the particular combination of the parameter set is not supported
            /// by the compositor, the resulting image description object shall
            /// immediately deliver the wp_image_description_v1.failed event with the
            /// 'unsupported' cause. If a valid image description was created from the
            /// parameter set, the wp_image_description_v1.ready event will eventually
            /// be sent instead.
            ///
            /// This request destroys the wp_image_description_creator_params_v1
            /// object.
            ///
            /// The resulting image description object does not allow get_information
            /// request.
            pub fn create(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                _proxy.marshal(0, &_args);
                _proxy.destroy();
            }
            pub const create_since_version = 1;

            /// Sets the transfer characteristic using explicitly enumerated named
            /// functions.
            ///
            /// When the resulting image description is attached to an image, the
            /// content should be decoded according to the industry standard
            /// practices for the transfer characteristic.
            ///
            /// Only names advertised with wp_color_manager_v1 event supported_tf_named
            /// are allowed. Other values shall raise the protocol error invalid_tf.
            ///
            /// If transfer characteristic has already been set on this object, the
            /// protocol error already_set is raised.
            pub fn setTfNamed(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _tf: common.wp.color_manager_v1.TransferFunction) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_manager_v1.TransferFunction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_tf))),
                        .@"struct" => @bitCast(_tf),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_tf_named_since_version = 1;

            /// Sets the color component transfer characteristic to a power curve with
            /// the given exponent. Negative values are handled by mirroring the
            /// positive half of the curve through the origin. The valid domain and
            /// range of the curve are all finite real numbers. This curve represents
            /// the conversion from electrical to optical color channel values.
            ///
            /// The curve exponent shall be multiplied by 10000 to get the argument eexp
            /// value to carry the precision of 4 decimals.
            ///
            /// The curve exponent must be at least 1.0 and at most 10.0. Otherwise the
            /// protocol error invalid_tf is raised.
            ///
            /// If transfer characteristic has already been set on this object, the
            /// protocol error already_set is raised.
            ///
            /// This request can be used when the compositor advertises
            /// wp_color_manager_v1.feature.set_tf_power. Otherwise this request raises
            /// the protocol error unsupported_feature.
            pub fn setTfPower(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _eexp: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = _eexp },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_tf_power_since_version = 1;

            /// Sets the color primaries and white point using explicitly named sets.
            /// This describes the primary color volume which is the basis for color
            /// value encoding.
            ///
            /// Only names advertised with wp_color_manager_v1 event
            /// supported_primaries_named are allowed. Other values shall raise the
            /// protocol error invalid_primaries_named.
            ///
            /// If primaries have already been set on this object, the protocol error
            /// already_set is raised.
            pub fn setPrimariesNamed(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _primaries: common.wp.color_manager_v1.Primaries) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_manager_v1.Primaries)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_primaries))),
                        .@"struct" => @bitCast(_primaries),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_primaries_named_since_version = 1;

            /// Sets the color primaries and white point using CIE 1931 xy chromaticity
            /// coordinates. This describes the primary color volume which is the basis
            /// for color value encoding.
            ///
            /// Each coordinate value is multiplied by 1 million to get the argument
            /// value to carry precision of 6 decimals.
            ///
            /// If primaries have already been set on this object, the protocol error
            /// already_set is raised.
            ///
            /// This request can be used if the compositor advertises
            /// wp_color_manager_v1.feature.set_primaries. Otherwise this request raises
            /// the protocol error unsupported_feature.
            pub fn setPrimaries(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _r_x: i32, _r_y: i32, _g_x: i32, _g_y: i32, _b_x: i32, _b_y: i32, _w_x: i32, _w_y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .i = _r_x },
                    .{ .i = _r_y },
                    .{ .i = _g_x },
                    .{ .i = _g_y },
                    .{ .i = _b_x },
                    .{ .i = _b_y },
                    .{ .i = _w_x },
                    .{ .i = _w_y },
                };
                _proxy.marshal(4, &_args);
            }
            pub const set_primaries_since_version = 1;

            /// Sets the primary color volume luminance range and the reference white
            /// luminance level. These values include the minimum display emission, but
            /// not external flare. The minimum display emission is assumed to have
            /// the chromaticity of the primary color volume white point.
            ///
            /// The default luminances from
            /// https://www.color.org/chardata/rgb/srgb.xalter are
            /// - primary color volume minimum: 0.2 cd/m²
            /// - primary color volume maximum: 80 cd/m²
            /// - reference white: 80 cd/m²
            ///
            /// Setting a named transfer characteristic can imply other default
            /// luminances.
            ///
            /// The default luminances get overwritten when this request is used.
            /// With transfer_function.st2084_pq the given 'max_lum' value is ignored,
            /// and 'max_lum' is taken as 'min_lum' + 10000 cd/m².
            ///
            /// 'min_lum' and 'max_lum' specify the minimum and maximum luminances of
            /// the primary color volume as reproduced by the targeted display.
            ///
            /// 'reference_lum' specifies the luminance of the reference white as
            /// reproduced by the targeted display, and reflects the targeted viewing
            /// environment.
            ///
            /// Compositors should make sure that all content is anchored, meaning that
            /// an input signal level of 'reference_lum' on one image description and
            /// another input signal level of 'reference_lum' on another image
            /// description should produce the same output level, even though the
            /// 'reference_lum' on both image representations can be different.
            ///
            /// 'reference_lum' may be higher than 'max_lum'. In that case reaching
            /// the reference white output level in image content requires the
            /// 'extended_target_volume' feature support.
            ///
            /// If 'max_lum' or 'reference_lum' are less than or equal to 'min_lum',
            /// the protocol error invalid_luminance is raised.
            ///
            /// The minimum luminance is multiplied by 10000 to get the argument
            /// 'min_lum' value and carries precision of 4 decimals. The maximum
            /// luminance and reference white luminance values are unscaled.
            ///
            /// If the primary color volume luminance range and the reference white
            /// luminance level have already been set on this object, the protocol error
            /// already_set is raised.
            ///
            /// This request can be used if the compositor advertises
            /// wp_color_manager_v1.feature.set_luminances. Otherwise this request
            /// raises the protocol error unsupported_feature.
            pub fn setLuminances(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _min_lum: u32, _max_lum: u32, _reference_lum: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = _min_lum },
                    .{ .u = _max_lum },
                    .{ .u = _reference_lum },
                };
                _proxy.marshal(5, &_args);
            }
            pub const set_luminances_since_version = 1;

            /// Provides the color primaries and white point of the mastering display
            /// using CIE 1931 xy chromaticity coordinates. This is compatible with the
            /// SMPTE ST 2086 definition of HDR static metadata.
            ///
            /// The mastering display primaries and mastering display luminances define
            /// the target color volume.
            ///
            /// If mastering display primaries are not explicitly set, the target color
            /// volume is assumed to have the same primaries as the primary color volume.
            ///
            /// The target color volume is defined by all tristimulus values between 0.0
            /// and 1.0 (inclusive) of the color space defined by the given mastering
            /// display primaries and white point. The colorimetry is identical between
            /// the container color space and the mastering display color space,
            /// including that no chromatic adaptation is applied even if the white
            /// points differ.
            ///
            /// The target color volume can exceed the primary color volume to allow for
            /// a greater color volume with an existing color space definition (for
            /// example scRGB). It can be smaller than the primary color volume to
            /// minimize gamut and tone mapping distances for big color spaces (HDR
            /// metadata).
            ///
            /// To make use of the entire target color volume a suitable pixel format
            /// has to be chosen (e.g. floating point to exceed the primary color
            /// volume, or abusing limited quantization range as with xvYCC).
            ///
            /// Each coordinate value is multiplied by 1 million to get the argument
            /// value to carry precision of 6 decimals.
            ///
            /// If mastering display primaries have already been set on this object, the
            /// protocol error already_set is raised.
            ///
            /// This request can be used if the compositor advertises
            /// wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
            /// this request raises the protocol error unsupported_feature. The
            /// advertisement implies support only for target color volumes fully
            /// contained within the primary color volume.
            ///
            /// If a compositor additionally supports target color volume exceeding the
            /// primary color volume, it must advertise
            /// wp_color_manager_v1.feature.extended_target_volume. If a client uses
            /// target color volume exceeding the primary color volume and the
            /// compositor does not support it, the result is implementation defined.
            /// Compositors are recommended to detect this case and fail the image
            /// description gracefully, but it may as well result in color artifacts.
            pub fn setMasteringDisplayPrimaries(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _r_x: i32, _r_y: i32, _g_x: i32, _g_y: i32, _b_x: i32, _b_y: i32, _w_x: i32, _w_y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .i = _r_x },
                    .{ .i = _r_y },
                    .{ .i = _g_x },
                    .{ .i = _g_y },
                    .{ .i = _b_x },
                    .{ .i = _b_y },
                    .{ .i = _w_x },
                    .{ .i = _w_y },
                };
                _proxy.marshal(6, &_args);
            }
            pub const set_mastering_display_primaries_since_version = 1;

            /// Sets the luminance range that was used during the content mastering
            /// process as the minimum and maximum absolute luminance L. These values
            /// include the minimum display emission and ambient flare luminances,
            /// assumed to be optically additive and have the chromaticity of the
            /// primary color volume white point. This should be
            /// compatible with the SMPTE ST 2086 definition of HDR static metadata.
            ///
            /// The mastering display primaries and mastering display luminances define
            /// the target color volume.
            ///
            /// If mastering luminances are not explicitly set, the target color volume
            /// is assumed to have the same min and max luminances as the primary color
            /// volume.
            ///
            /// If max L is less than or equal to min L, the protocol error
            /// invalid_luminance is raised.
            ///
            /// Min L value is multiplied by 10000 to get the argument min_lum value
            /// and carry precision of 4 decimals. Max L value is unscaled for max_lum.
            ///
            /// This request can be used if the compositor advertises
            /// wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
            /// this request raises the protocol error unsupported_feature. The
            /// advertisement implies support only for target color volumes fully
            /// contained within the primary color volume.
            ///
            /// If a compositor additionally supports target color volume exceeding the
            /// primary color volume, it must advertise
            /// wp_color_manager_v1.feature.extended_target_volume. If a client uses
            /// target color volume exceeding the primary color volume and the
            /// compositor does not support it, the result is implementation defined.
            /// Compositors are recommended to detect this case and fail the image
            /// description gracefully, but it may as well result in color artifacts.
            pub fn setMasteringLuminance(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _min_lum: u32, _max_lum: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = _min_lum },
                    .{ .u = _max_lum },
                };
                _proxy.marshal(7, &_args);
            }
            pub const set_mastering_luminance_since_version = 1;

            /// Sets the maximum content light level (max_cll) as defined by CTA-861-H.
            ///
            /// max_cll is undefined by default.
            pub fn setMaxCll(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _max_cll: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = _max_cll },
                };
                _proxy.marshal(8, &_args);
            }
            pub const set_max_cll_since_version = 1;

            /// Sets the maximum frame-average light level (max_fall) as defined by
            /// CTA-861-H.
            ///
            /// max_fall is undefined by default.
            pub fn setMaxFall(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _max_fall: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                var _args = [_]common.Argument{
                    .{ .u = _max_fall },
                };
                _proxy.marshal(9, &_args);
            }
            pub const set_max_fall_since_version = 1;
            pub inline fn destroy(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_image_description_creator_params_v1);
                _proxy.destroy();
            }
        };

        /// A singleton global interface used for getting color representation
        /// extensions for wl_surface. The extension interfaces allow setting the
        /// color representation of surfaces.
        ///
        /// Compositors should never remove this global.
        pub const ColorRepresentationManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.color_representation_manager_v1.interface;
            pub const Error = common.wp.color_representation_manager_v1.Error;
            pub inline fn getId(_color_representation_manager_v1: *ColorRepresentationManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_manager_v1)).getId();
            }
            pub inline fn getVersion(_color_representation_manager_v1: *ColorRepresentationManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_color_representation_manager_v1: *ColorRepresentationManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_color_representation_manager_v1: *ColorRepresentationManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_manager_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const supported_alpha_mode_since_version = 1;
                pub const supported_coefficients_and_ranges_since_version = 1;
                pub const done_since_version = 1;

                /// When this object is created, it shall immediately send this event once
                /// for each alpha mode the compositor supports.
                ///
                /// For the definition of the supported values, see the
                /// wp_color_representation_surface_v1::alpha_mode enum.
                supported_alpha_mode: struct {
                    alpha_mode: common.wp.color_representation_surface_v1.AlphaMode,
                },

                /// When this object is created, it shall immediately send this event once
                /// for each matrix coefficient and color range combination the compositor
                /// supports.
                ///
                /// For the definition of the supported values, see the
                /// wp_color_representation_surface_v1::coefficients and
                /// wp_color_representation_surface_v1::range enums.
                supported_coefficients_and_ranges: struct {
                    coefficients: common.wp.color_representation_surface_v1.Coefficients,
                    range: common.wp.color_representation_surface_v1.Range,
                },

                /// This event is sent when all supported features have been sent.
                done: void,
            };
            pub inline fn setListener(
                _color_representation_manager_v1: *ColorRepresentationManagerV1,
                comptime T: type,
                _listener: *const fn (color_representation_manager_v1: *ColorRepresentationManagerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_manager_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ColorRepresentationManagerV1, T).dispatcher, _listener, _mut_data);
            }
            /// Destroy the wp_color_representation_manager_v1 object. This does not
            /// affect any other objects in any way.
            pub fn destroy(_color_representation_manager_v1: *ColorRepresentationManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// If a wp_color_representation_surface_v1 object already exists for the
            /// given wl_surface, the protocol error surface_exists is raised.
            ///
            /// This creates a new color wp_color_representation_surface_v1 object for
            /// the given wl_surface.
            ///
            /// See the wp_color_representation_surface_v1 interface for more details.
            pub fn getSurface(_color_representation_manager_v1: *ColorRepresentationManagerV1, _surface: *client.wl.Surface) !*client.wp.ColorRepresentationSurfaceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.ColorRepresentationSurfaceV1.interface));
            }
            pub const get_surface_since_version = 1;
        };

        /// A wp_color_representation_surface_v1 allows the client to set the color
        /// representation metadata of a surface.
        ///
        /// By default, a surface does not have any color representation metadata set.
        /// The reconstruction of R, G, B signals on such surfaces is compositor
        /// implementation defined. The alpha mode is assumed to be
        /// premultiplied_electrical when the alpha mode is unset.
        ///
        /// If the wl_surface associated with the wp_color_representation_surface_v1
        /// is destroyed, the wp_color_representation_surface_v1 object becomes inert.
        pub const ColorRepresentationSurfaceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.color_representation_surface_v1.interface;
            pub const Error = common.wp.color_representation_surface_v1.Error;
            pub const AlphaMode = common.wp.color_representation_surface_v1.AlphaMode;
            pub const Coefficients = common.wp.color_representation_surface_v1.Coefficients;
            pub const Range = common.wp.color_representation_surface_v1.Range;
            pub const ChromaLocation = common.wp.color_representation_surface_v1.ChromaLocation;
            pub inline fn getId(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_surface_v1)).getId();
            }
            pub inline fn getVersion(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_surface_v1)).getVersion();
            }
            pub inline fn getUserData(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_color_representation_surface_v1)).getUserData();
            }
            pub inline fn setQueue(_color_representation_surface_v1: *ColorRepresentationSurfaceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_surface_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy the wp_color_representation_surface_v1 object.
            ///
            /// Destroying this object unsets all the color representation metadata from
            /// the surface. See the wp_color_representation_surface_v1 interface
            /// description for how a compositor handles a surface without color
            /// representation metadata. Unsetting is double-buffered state, see
            /// wl_surface.commit.
            pub fn destroy(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_surface_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// Assuming an alpha channel exists, it is always linear. The alpha mode
            /// determines whether and how the color channels include pre-multiplied
            /// alpha. Using straight alpha might have performance benefits.
            ///
            /// Only alpha modes advertised by the compositor are allowed to be used as
            /// argument for this request. The "alpha_mode" protocol error is raised
            /// otherwise.
            ///
            /// Alpha mode is double buffered, see wl_surface.commit.
            pub fn setAlphaMode(_color_representation_surface_v1: *ColorRepresentationSurfaceV1, _alpha_mode: AlphaMode) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(AlphaMode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_alpha_mode))),
                        .@"struct" => @bitCast(_alpha_mode),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_alpha_mode_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// Set the matrix coefficients and video range which defines the formula
            /// and the related constants used to derive red, green and blue signals.
            /// Usually coefficients correspond to MatrixCoefficients code points in
            /// H.273.
            ///
            /// Only combinations advertised by the compositor are allowed to be used as
            /// argument for this request. The "coefficients" protocol error is raised
            /// otherwise.
            ///
            /// A call to wl_surface.commit verifies that the pixel format and the
            /// coefficients-range combination in the committed surface contents are
            /// compatible, if contents exist. The "pixel_format" protocol error is
            /// raised otherwise.
            ///
            /// A pixel format is compatible with the coefficients-range combination if
            /// the related equations and conventions as defined in H.273 can produce
            /// the color channels (RGB or YCbCr) of the pixel format.
            ///
            /// For the definition of the supported combination, see the
            /// wp_color_representation_surface_v1::coefficients and
            /// wp_color_representation_surface_v1::range enums.
            ///
            /// The coefficients-range combination is double-buffered, see
            /// wl_surface.commit.
            pub fn setCoefficientsAndRange(_color_representation_surface_v1: *ColorRepresentationSurfaceV1, _coefficients: Coefficients, _range: Range) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Coefficients)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_coefficients))),
                        .@"struct" => @bitCast(_coefficients),
                        else => unreachable,
                    } },
                    .{ .u = switch (@typeInfo(Range)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_range))),
                        .@"struct" => @bitCast(_range),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_coefficients_and_range_since_version = 1;

            /// If this protocol object is inert, the protocol error inert is raised.
            ///
            /// Set the chroma location type which defines the position of downsampled
            /// chroma samples, corresponding to Chroma420SampleLocType code points in
            /// H.273.
            ///
            /// An invalid chroma location enum value raises the "chroma_location"
            /// protocol error.
            ///
            /// A call to wl_surface.commit verifies that the pixel format and chroma
            /// location type in the committed surface contents are compatible, if
            /// contents exist. The "pixel_format" protocol error is raised otherwise.
            ///
            /// For the definition of the supported chroma location types, see the
            /// wp_color_representation_surface_v1::chroma_location enum.
            ///
            /// The chroma location type is double-buffered, see wl_surface.commit.
            pub fn setChromaLocation(_color_representation_surface_v1: *ColorRepresentationSurfaceV1, _chroma_location: ChromaLocation) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_color_representation_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ChromaLocation)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_chroma_location))),
                        .@"struct" => @bitCast(_chroma_location),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_chroma_location_since_version = 1;
        };

        /// This global offers an alternative, optional way to set cursor images. This
        /// new way uses enumerated cursors instead of a wl_surface like
        /// wl_pointer.set_cursor does.
        ///
        /// 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.
        pub const CursorShapeManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.cursor_shape_manager_v1.interface;
            pub inline fn getId(_cursor_shape_manager_v1: *CursorShapeManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_manager_v1)).getId();
            }
            pub inline fn getVersion(_cursor_shape_manager_v1: *CursorShapeManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_cursor_shape_manager_v1: *CursorShapeManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_cursor_shape_manager_v1: *CursorShapeManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy the cursor shape manager.
            pub fn destroy(_cursor_shape_manager_v1: *CursorShapeManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
            ///
            /// When the pointer capability is removed from the wl_seat, the
            /// wp_cursor_shape_device_v1 object becomes inert.
            pub fn getPointer(_cursor_shape_manager_v1: *CursorShapeManagerV1, _pointer: *client.wl.Pointer) !*client.wp.CursorShapeDeviceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_pointer) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.CursorShapeDeviceV1.interface));
            }
            pub const get_pointer_since_version = 1;

            /// Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
            ///
            /// When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1
            /// object becomes inert.
            pub fn getTabletToolV2(_cursor_shape_manager_v1: *CursorShapeManagerV1, _tablet_tool: *client.zwp.TabletToolV2) !*client.wp.CursorShapeDeviceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_tablet_tool) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.wp.CursorShapeDeviceV1.interface));
            }
            pub const get_tablet_tool_v2_since_version = 1;
        };

        /// This interface allows clients to set the cursor shape.
        pub const CursorShapeDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.cursor_shape_device_v1.interface;
            pub const Shape = common.wp.cursor_shape_device_v1.Shape;
            pub const Error = common.wp.cursor_shape_device_v1.Error;
            pub inline fn getId(_cursor_shape_device_v1: *CursorShapeDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_device_v1)).getId();
            }
            pub inline fn getVersion(_cursor_shape_device_v1: *CursorShapeDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_device_v1)).getVersion();
            }
            pub inline fn getUserData(_cursor_shape_device_v1: *CursorShapeDeviceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_cursor_shape_device_v1)).getUserData();
            }
            pub inline fn setQueue(_cursor_shape_device_v1: *CursorShapeDeviceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_device_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy the cursor shape device.
            ///
            /// The device cursor shape remains unchanged.
            pub fn destroy(_cursor_shape_device_v1: *CursorShapeDeviceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_device_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Sets the device cursor to the specified shape. The compositor will
            /// change the cursor image based on the specified shape.
            ///
            /// The cursor actually changes only if the input device focus is one of
            /// the requesting client's surfaces. If any, the previous cursor image
            /// (surface or shape) is replaced.
            ///
            /// The "shape" argument must be a valid enum entry, otherwise the
            /// invalid_shape protocol error is raised.
            ///
            /// This is similar to the wl_pointer.set_cursor and
            /// zwp_tablet_tool_v2.set_cursor requests, but this request accepts a
            /// shape instead of contents in the form of a surface. Clients can mix
            /// set_cursor and set_shape requests.
            ///
            /// The serial parameter must match the latest wl_pointer.enter or
            /// zwp_tablet_tool_v2.proximity_in serial number sent to the client.
            /// Otherwise the request will be ignored.
            pub fn setShape(_cursor_shape_device_v1: *CursorShapeDeviceV1, _serial: u32, _shape: Shape) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_cursor_shape_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = switch (@typeInfo(Shape)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_shape))),
                        .@"struct" => @bitCast(_shape),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_shape_since_version = 1;
        };

        /// For some use cases like games or drawing tablets it can make sense to
        /// reduce latency by accepting tearing with the use of asynchronous page
        /// flips. This global is a factory interface, allowing clients to inform
        /// which type of presentation the content of their surfaces is suitable for.
        ///
        /// Graphics APIs like EGL or Vulkan, that manage the buffer queue and commits
        /// of a wl_surface themselves, are likely to be using this extension
        /// internally. If a client is using such an API for a wl_surface, it should
        /// not directly use this extension on that surface, to avoid raising a
        /// tearing_control_exists protocol error.
        ///
        /// 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.
        pub const TearingControlManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.tearing_control_manager_v1.interface;
            pub const Error = common.wp.tearing_control_manager_v1.Error;
            pub inline fn getId(_tearing_control_manager_v1: *TearingControlManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_manager_v1)).getId();
            }
            pub inline fn getVersion(_tearing_control_manager_v1: *TearingControlManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_tearing_control_manager_v1: *TearingControlManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_tearing_control_manager_v1: *TearingControlManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy this tearing control factory object. Other objects, including
            /// wp_tearing_control_v1 objects created by this factory, are not affected
            /// by this request.
            pub fn destroy(_tearing_control_manager_v1: *TearingControlManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Instantiate an interface extension for the given wl_surface to request
            /// asynchronous page flips for presentation.
            ///
            /// If the given wl_surface already has a wp_tearing_control_v1 object
            /// associated, the tearing_control_exists protocol error is raised.
            pub fn getTearingControl(_tearing_control_manager_v1: *TearingControlManagerV1, _surface: *client.wl.Surface) !*client.wp.TearingControlV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.wp.TearingControlV1.interface));
            }
            pub const get_tearing_control_since_version = 1;
        };

        /// An additional interface to a wl_surface object, which allows the client
        /// to hint to the compositor if the content on the surface is suitable for
        /// presentation with tearing.
        /// The default presentation hint is vsync. See presentation_hint for more
        /// details.
        ///
        /// If the associated wl_surface is destroyed, this object becomes inert and
        /// should be destroyed.
        pub const TearingControlV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.tearing_control_v1.interface;
            pub const PresentationHint = common.wp.tearing_control_v1.PresentationHint;
            pub inline fn getId(_tearing_control_v1: *TearingControlV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_v1)).getId();
            }
            pub inline fn getVersion(_tearing_control_v1: *TearingControlV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_v1)).getVersion();
            }
            pub inline fn getUserData(_tearing_control_v1: *TearingControlV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_tearing_control_v1)).getUserData();
            }
            pub inline fn setQueue(_tearing_control_v1: *TearingControlV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_v1);
                _proxy.setQueue(_queue);
            }
            /// Set the presentation hint for the associated wl_surface. This state is
            /// double-buffered, see wl_surface.commit.
            ///
            /// The compositor is free to dynamically respect or ignore this hint based
            /// on various conditions like hardware capabilities, surface state and
            /// user preferences.
            pub fn setPresentationHint(_tearing_control_v1: *TearingControlV1, _hint: PresentationHint) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(PresentationHint)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_hint))),
                        .@"struct" => @bitCast(_hint),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_presentation_hint_since_version = 1;

            /// Destroy this surface tearing object and revert the presentation hint to
            /// vsync. The change will be applied on the next wl_surface.commit.
            pub fn destroy(_tearing_control_v1: *TearingControlV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_tearing_control_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };
    };
    pub const ext = struct {
        /// This interface is used to request that the session be locked.
        pub const SessionLockManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_manager_v1.interface;
            pub inline fn getId(_session_lock_manager_v1: *SessionLockManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_manager_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_manager_v1: *SessionLockManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_session_lock_manager_v1: *SessionLockManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_session_lock_manager_v1: *SessionLockManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// This informs the compositor that the session lock manager object will
            /// no longer be used. Existing objects created through this interface
            /// remain valid.
            pub fn destroy(_session_lock_manager_v1: *SessionLockManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request creates a session lock and asks the compositor to lock the
            /// session. The compositor will send either the ext_session_lock_v1.locked
            /// or ext_session_lock_v1.finished event on the created object in
            /// response to this request.
            pub fn lock(_session_lock_manager_v1: *SessionLockManagerV1) !*client.ext.SessionLockV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.ext.SessionLockV1.interface));
            }
            pub const lock_since_version = 1;
        };

        /// In response to the creation of this object the compositor must send
        /// either the locked or finished event.
        ///
        /// The locked event indicates that the session is locked. This means
        /// that the compositor must stop rendering and providing input to normal
        /// clients. Instead the compositor must blank all outputs with an opaque
        /// color such that their normal content is fully hidden.
        ///
        /// The only surfaces that should be rendered while the session is locked
        /// are the lock surfaces created through this interface and optionally,
        /// at the compositor's discretion, special privileged surfaces such as
        /// input methods or portions of desktop shell UIs.
        ///
        /// The locked event must not be sent until a new "locked" frame (either
        /// from a session lock surface or the compositor blanking the output) has
        /// been presented on all outputs and no security sensitive normal/unlocked
        /// content is possibly visible.
        ///
        /// The finished event should be sent immediately on creation of this
        /// object if the compositor decides that the locked event will not be sent.
        ///
        /// The compositor may wait for the client to create and render session lock
        /// surfaces before sending the locked event to avoid displaying intermediate
        /// blank frames. However, it must impose a reasonable time limit if
        /// waiting and send the locked event as soon as the hard requirements
        /// described above can be met if the time limit expires. Clients should
        /// immediately create lock surfaces for all outputs on creation of this
        /// object to make this possible.
        ///
        /// This behavior of the locked event is required in order to prevent
        /// possible race conditions with clients that wish to suspend the system
        /// or similar after locking the session. Without these semantics, clients
        /// triggering a suspend after receiving the locked event would race with
        /// the first "locked" frame being presented and normal/unlocked frames
        /// might be briefly visible as the system is resumed if the suspend
        /// operation wins the race.
        ///
        /// If the client dies while the session is locked, the compositor must not
        /// unlock the session in response. It is acceptable for the session to be
        /// permanently locked if this happens. The compositor may choose to continue
        /// to display the lock surfaces the client had mapped before it died or
        /// alternatively fall back to a solid color, this is compositor policy.
        ///
        /// Compositors may also allow a secure way to recover the session, the
        /// details of this are compositor policy. Compositors may allow a new
        /// client to create a ext_session_lock_v1 object and take responsibility
        /// for unlocking the session, they may even start a new lock client
        /// instance automatically.
        pub const SessionLockV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_v1.interface;
            pub const Error = common.ext.session_lock_v1.Error;
            pub inline fn getId(_session_lock_v1: *SessionLockV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_v1: *SessionLockV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_v1)).getVersion();
            }
            pub inline fn getUserData(_session_lock_v1: *SessionLockV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_v1)).getUserData();
            }
            pub inline fn setQueue(_session_lock_v1: *SessionLockV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const locked_since_version = 1;
                pub const finished_since_version = 1;

                /// This client is now responsible for displaying graphics while the
                /// session is locked and deciding when to unlock the session.
                ///
                /// The locked event must not be sent until a new "locked" frame has been
                /// presented on all outputs and no security sensitive normal/unlocked
                /// content is possibly visible.
                ///
                /// If this event is sent, making the destroy request is a protocol error,
                /// the lock object must be destroyed using the unlock_and_destroy request.
                locked: void,
                /// The compositor has decided that the session lock should be destroyed
                /// as it will no longer be used by the compositor. Exactly when this
                /// event is sent is compositor policy, but it must never be sent more
                /// than once for a given session lock object.
                ///
                /// This might be sent because there is already another ext_session_lock_v1
                /// object held by a client, or the compositor has decided to deny the
                /// request to lock the session for some other reason. This might also
                /// be sent because the compositor implements some alternative, secure
                /// way to authenticate and unlock the session.
                ///
                /// The finished event should be sent immediately on creation of this
                /// object if the compositor decides that the locked event will not
                /// be sent.
                ///
                /// If the locked event is sent on creation of this object the finished
                /// event may still be sent at some later time in this object's
                /// lifetime. This is compositor policy.
                ///
                /// Upon receiving this event, the client should make either the destroy
                /// request or the unlock_and_destroy request, depending on whether or
                /// not the locked event was received on this object.
                finished: void,
            };
            pub inline fn setListener(
                _session_lock_v1: *SessionLockV1,
                comptime T: type,
                _listener: *const fn (session_lock_v1: *SessionLockV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(SessionLockV1, T).dispatcher, _listener, _mut_data);
            }
            /// This informs the compositor that the lock object will no longer be
            /// used. Existing objects created through this interface remain valid.
            ///
            /// After this request is made, lock surfaces created through this object
            /// should be destroyed by the client as they will no longer be used by
            /// the compositor.
            ///
            /// It is a protocol error to make this request if the locked event was
            /// sent, the unlock_and_destroy request must be used instead.
            pub fn destroy(_session_lock_v1: *SessionLockV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// The client is expected to create lock surfaces for all outputs
            /// currently present and any new outputs as they are advertised. These
            /// won't be displayed by the compositor unless the lock is successful
            /// and the locked event is sent.
            ///
            /// Providing a wl_surface which already has a role or already has a buffer
            /// attached or committed is a protocol error, as is attaching/committing
            /// a buffer before the first ext_session_lock_surface_v1.configure event.
            ///
            /// Attempting to create more than one lock surface for a given output
            /// is a duplicate_output protocol error.
            pub fn getLockSurface(_session_lock_v1: *SessionLockV1, _surface: *client.wl.Surface, _output: *client.wl.Output) !*client.ext.SessionLockSurfaceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                    .{ .o = @ptrCast(_output) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.ext.SessionLockSurfaceV1.interface));
            }
            pub const get_lock_surface_since_version = 1;

            /// This request indicates that the session should be unlocked, for
            /// example because the user has entered their password and it has been
            /// verified by the client.
            ///
            /// This request also informs the compositor that the lock object will
            /// no longer be used and should be destroyed. Existing objects created
            /// through this interface remain valid.
            ///
            /// After this request is made, lock surfaces created through this object
            /// should be destroyed by the client as they will no longer be used by
            /// the compositor.
            ///
            /// It is a protocol error to make this request if the locked event has
            /// not been sent. In that case, the lock object must be destroyed using
            /// the destroy request.
            ///
            /// Note that a correct client that wishes to exit directly after unlocking
            /// the session must use the wl_display.sync request to ensure the server
            /// receives and processes the unlock_and_destroy request. Otherwise
            /// there is no guarantee that the server has unlocked the session due
            /// to the asynchronous nature of the Wayland protocol. For example,
            /// the server might terminate the client with a protocol error before
            /// it processes the unlock_and_destroy request.
            pub fn unlockAndDestroy(_session_lock_v1: *SessionLockV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_v1);
                _proxy.marshal(2, null);
                _proxy.destroy();
            }
            pub const unlock_and_destroy_since_version = 1;
        };

        /// The client may use lock surfaces to display a screensaver, render a
        /// dialog to enter a password and unlock the session, or however else it
        /// sees fit.
        ///
        /// On binding this interface the compositor will immediately send the
        /// first configure event. After making the ack_configure request in
        /// response to this event the client should attach and commit the first
        /// buffer. Committing the surface before acking the first configure is a
        /// protocol error. Committing the surface with a null buffer at any time
        /// is a protocol error.
        ///
        /// The compositor is free to handle keyboard/pointer focus for lock
        /// surfaces however it chooses. A reasonable way to do this would be to
        /// give the first lock surface created keyboard focus and change keyboard
        /// focus if the user clicks on other surfaces.
        pub const SessionLockSurfaceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_surface_v1.interface;
            pub const Error = common.ext.session_lock_surface_v1.Error;
            pub inline fn getId(_session_lock_surface_v1: *SessionLockSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_surface_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_surface_v1: *SessionLockSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_surface_v1)).getVersion();
            }
            pub inline fn getUserData(_session_lock_surface_v1: *SessionLockSurfaceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_session_lock_surface_v1)).getUserData();
            }
            pub inline fn setQueue(_session_lock_surface_v1: *SessionLockSurfaceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_surface_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;

                /// This event is sent once on binding the interface and may be sent again
                /// at the compositor's discretion, for example if output geometry changes.
                ///
                /// The width and height are in surface-local coordinates and are exact
                /// requirements. Failing to match these surface dimensions in the next
                /// commit after acking a configure is a protocol error.
                configure: struct {
                    serial: u32,
                    width: u32,
                    height: u32,
                },
            };
            pub inline fn setListener(
                _session_lock_surface_v1: *SessionLockSurfaceV1,
                comptime T: type,
                _listener: *const fn (session_lock_surface_v1: *SessionLockSurfaceV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_surface_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(SessionLockSurfaceV1, T).dispatcher, _listener, _mut_data);
            }
            /// This informs the compositor that the lock surface object will no
            /// longer be used.
            ///
            /// It is recommended for a lock client to destroy lock surfaces if
            /// their corresponding wl_output global is removed.
            ///
            /// If a lock surface on an active output is destroyed before the
            /// ext_session_lock_v1.unlock_and_destroy event is sent, the compositor
            /// must fall back to rendering a solid color.
            pub fn destroy(_session_lock_surface_v1: *SessionLockSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_surface_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// When a configure event is received, if a client commits the surface
            /// in response to the configure event, then the client must make an
            /// ack_configure request sometime before the commit request, passing
            /// along the serial of the configure event.
            ///
            /// If the client receives multiple configure events before it can
            /// respond to one, it only has to ack the last configure event.
            ///
            /// A client is not required to commit immediately after sending an
            /// ack_configure request - it may even ack_configure several times
            /// before its next surface commit.
            ///
            /// A client may send multiple ack_configure requests before committing,
            /// but only the last request sent before a commit indicates which
            /// configure event the client really is responding to.
            ///
            /// Sending an ack_configure request consumes the configure event
            /// referenced by the given serial, as well as all older configure events
            /// sent on this object.
            ///
            /// It is a protocol error to issue multiple ack_configure requests
            /// referencing the same configure event or to issue an ack_configure
            /// request referencing a configure event older than the last configure
            /// event acked for a given lock surface.
            pub fn ackConfigure(_session_lock_surface_v1: *SessionLockSurfaceV1, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_session_lock_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _proxy.marshal(1, &_args);
            }
            pub const ack_configure_since_version = 1;
        };
    };
    pub const zxdg = struct {
        /// This interface allows a compositor to announce support for server-side
        /// decorations.
        ///
        /// A window decoration is a set of window controls as deemed appropriate by
        /// the party managing them, such as user interface components used to move,
        /// resize and change a window's state.
        ///
        /// A client can use this protocol to request being decorated by a supporting
        /// compositor.
        ///
        /// If compositor and client do not negotiate the use of a server-side
        /// decoration using this protocol, clients continue to self-decorate as they
        /// see fit.
        ///
        /// 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.
        pub const DecorationManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zxdg.decoration_manager_v1.interface;
            pub inline fn getId(_decoration_manager_v1: *DecorationManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_manager_v1)).getId();
            }
            pub inline fn getVersion(_decoration_manager_v1: *DecorationManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_decoration_manager_v1: *DecorationManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_decoration_manager_v1: *DecorationManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// Destroy the decoration manager. This doesn't destroy objects created
            /// with the manager.
            pub fn destroy(_decoration_manager_v1: *DecorationManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_manager_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Create a new decoration object associated with the given toplevel.
            ///
            /// For objects of version 1, creating an xdg_toplevel_decoration from an
            /// xdg_toplevel which has a buffer attached or committed is a client
            /// error, and any attempts by a client to attach or manipulate a buffer
            /// prior to the first xdg_toplevel_decoration.configure event must also be
            /// treated as errors.
            ///
            /// For objects of version 2 or newer, creating an xdg_toplevel_decoration
            /// from an xdg_toplevel which has a buffer attached or committed is
            /// allowed. The initial decoration mode of the surface if a buffer is
            /// already attached depends on whether a xdg_toplevel_decoration object
            /// has been associated with the surface or not prior to this request.
            ///
            /// If an xdg_toplevel_decoration was associated with the surface, then
            /// destroyed without a surface commit, the previous decoration mode is
            /// retained.
            ///
            /// If no xdg_toplevel_decoration was associated with the surface prior to
            /// this request, or if a surface commit has been performed after a previous
            /// xdg_toplevel_decoration object associated with the surface was
            /// destroyed, the decoration mode is assumed to be client-side.
            pub fn getToplevelDecoration(_decoration_manager_v1: *DecorationManagerV1, _toplevel: *client.xdg.Toplevel) !*client.zxdg.ToplevelDecorationV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_toplevel) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.zxdg.ToplevelDecorationV1.interface));
            }
            pub const get_toplevel_decoration_since_version = 1;
        };

        /// The decoration object allows the compositor to toggle server-side window
        /// decorations for a toplevel surface. The client can request to switch to
        /// another mode.
        ///
        /// The xdg_toplevel_decoration object must be destroyed before its
        /// xdg_toplevel.
        pub const ToplevelDecorationV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zxdg.toplevel_decoration_v1.interface;
            pub const Error = common.zxdg.toplevel_decoration_v1.Error;
            pub const Mode = common.zxdg.toplevel_decoration_v1.Mode;
            pub inline fn getId(_toplevel_decoration_v1: *ToplevelDecorationV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel_decoration_v1)).getId();
            }
            pub inline fn getVersion(_toplevel_decoration_v1: *ToplevelDecorationV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel_decoration_v1)).getVersion();
            }
            pub inline fn getUserData(_toplevel_decoration_v1: *ToplevelDecorationV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_toplevel_decoration_v1)).getUserData();
            }
            pub inline fn setQueue(_toplevel_decoration_v1: *ToplevelDecorationV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel_decoration_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;

                /// The configure event configures the effective decoration mode. The
                /// configured state should not be applied immediately. Clients must send an
                /// ack_configure in response to this event. See xdg_surface.configure and
                /// xdg_surface.ack_configure for details.
                ///
                /// A configure event can be sent at any time. The specified mode must be
                /// obeyed by the client.
                configure: struct {
                    mode: Mode,
                },
            };
            pub inline fn setListener(
                _toplevel_decoration_v1: *ToplevelDecorationV1,
                comptime T: type,
                _listener: *const fn (toplevel_decoration_v1: *ToplevelDecorationV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel_decoration_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(ToplevelDecorationV1, T).dispatcher, _listener, _mut_data);
            }
            /// Switch back to a mode without any server-side decorations at the next
            /// commit, unless a new xdg_toplevel_decoration is created for the surface
            /// first.
            pub fn destroy(_toplevel_decoration_v1: *ToplevelDecorationV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel_decoration_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the toplevel surface decoration mode. This informs the compositor
            /// that the client prefers the provided decoration mode.
            ///
            /// After requesting a decoration mode, the compositor will respond by
            /// emitting an xdg_surface.configure event. The client should then update
            /// its content, drawing it without decorations if the received mode is
            /// server-side decorations. The client must also acknowledge the configure
            /// when committing the new content (see xdg_surface.ack_configure).
            ///
            /// The compositor can decide not to use the client's mode and enforce a
            /// different mode instead.
            ///
            /// Clients whose decoration mode depend on the xdg_toplevel state may send
            /// a set_mode request in response to an xdg_surface.configure event and wait
            /// for the next xdg_surface.configure event to prevent unwanted state.
            /// Such clients are responsible for preventing configure loops and must
            /// make sure not to send multiple successive set_mode requests with the
            /// same decoration mode.
            ///
            /// If an invalid mode is supplied by the client, the invalid_mode protocol
            /// error is raised by the compositor.
            pub fn setMode(_toplevel_decoration_v1: *ToplevelDecorationV1, _mode: Mode) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel_decoration_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Mode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_mode_since_version = 1;

            /// Unset the toplevel surface decoration mode. This informs the compositor
            /// that the client doesn't prefer a particular decoration mode.
            ///
            /// This request has the same semantics as set_mode.
            pub fn unsetMode(_toplevel_decoration_v1: *ToplevelDecorationV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_toplevel_decoration_v1);
                _proxy.marshal(2, null);
            }
            pub const unset_mode_since_version = 1;
        };
    };
    pub const river = struct {
        /// This global interface should only be advertised to the window manager
        /// process. Only one window management client may be active at a time. The
        /// compositor should use the unavailable event if necessary to enforce this.
        ///
        /// There are two disjoint categories of state managed by this protocol:
        ///
        /// Window management state influences the communication between the
        /// compositor and individual windows (e.g. xdg_toplevels). Window management
        /// state includes window dimensions, fullscreen state, keyboard focus,
        /// keyboard bindings, and more.
        ///
        /// Rendering state only affects the rendered output of the compositor and
        /// does not influence communication between the compositor and individual
        /// windows. Rendering state includes the position and rendering order of
        /// windows, shell surfaces, decoration surfaces, borders, and more.
        ///
        /// Window management state may only be modified by the window manager as part
        /// of a manage sequence. A manage sequence is started with the manage_start
        /// event and ended with the manage_finish request. It is a protocol error to
        /// modify window management state outside of a manage sequence.
        ///
        /// A manage sequence is always followed by at least one render sequence. A
        /// render sequence is started with the render_start event and ended with the
        /// render_finish request.
        ///
        /// Rendering state may be modified by the window manager during a manage
        /// sequence or a render sequence. Regardless of when the rendering state is
        /// modified, it is applied with the next render_finish request. It is a
        /// protocol error to modify rendering state outside of a manage or render
        /// sequence.
        ///
        /// The server will start a manage sequence by sending new state and the
        /// manage_start event as soon as possible whenever there is a change in state
        /// that must be communicated with the window manager.
        ///
        /// If the window manager client needs to ensure a manage sequence is started
        /// due to a state change the compositor is not aware of, it may send the
        /// manage_dirty request.
        ///
        /// The server will start a render sequence by sending new state and the
        /// render_start event as soon as possible whenever there is a change in
        /// window dimensions that must be communicated with the window manager.
        /// Multiple render sequences may be made consecutively without a manage
        /// sequence in between, for example if a window independently changes its own
        /// dimensions.
        ///
        /// To summarize, the main loop of this protocol is as follows:
        ///
        /// 1. The server sends events indicating all changes since the last
        /// manage sequence followed by the manage_start event.
        ///
        /// 2. The client sends requests modifying window management state or
        /// rendering state (as defined above) followed by the manage_finish
        /// request.
        ///
        /// 3. The server sends new state to windows and waits for responses.
        ///
        /// 4. The server sends new window dimensions to the client followed by the
        /// render_start event.
        ///
        /// 5. The client sends requests modifying rendering state (as defined above)
        /// followed by the render_finish request.
        ///
        /// 6. If window dimensions change, loop back to step 4.
        /// If state that requires a manage sequence changes or if the client makes
        /// a manage_dirty request, loop back to step 1.
        ///
        /// For the purposes of frame perfection, the server may delay rendering new
        /// state committed by the windows in step 3 until after step 5 is finished.
        ///
        /// It is a protocol error for the client to make a manage_finish or
        /// render_finish request that violates this ordering.
        pub const WindowManagerV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.window_manager_v1.interface;
            pub const Error = common.river.window_manager_v1.Error;
            pub inline fn getId(_window_manager_v1: *WindowManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_window_manager_v1)).getId();
            }
            pub inline fn getVersion(_window_manager_v1: *WindowManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_window_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_window_manager_v1: *WindowManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_window_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_window_manager_v1: *WindowManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const unavailable_since_version = 1;
                pub const finished_since_version = 1;
                pub const manage_start_since_version = 1;
                pub const render_start_since_version = 1;
                pub const session_locked_since_version = 1;
                pub const session_unlocked_since_version = 1;
                pub const window_since_version = 1;
                pub const output_since_version = 1;
                pub const seat_since_version = 1;

                /// This event indicates that window management is not available to the
                /// client, perhaps due to another window management client already running.
                /// The circumstances causing this event to be sent are compositor policy.
                ///
                /// If sent, this event is guaranteed to be the first and only event sent by
                /// the server.
                ///
                /// The server will send no further events on this object. The client should
                /// destroy this object and all objects created through this interface.
                unavailable: void,
                /// This event indicates that the server will send no further events on this
                /// object. The client should destroy the object. See
                /// river_window_manager_v1.destroy for more information.
                finished: void,
                /// This event indicates that the server has sent events indicating all
                /// state changes since the last manage sequence.
                ///
                /// In response to this event, the client should make requests modifying
                /// window management state as it chooses. Then, the client must make the
                /// manage_finish request.
                ///
                /// See the description of the river_window_manager_v1 interface for a
                /// complete overview of the manage/render sequence loop.
                manage_start: void,
                /// This event indicates that the server has sent all
                /// river_window_v1.dimensions events necessary.
                ///
                /// In response to this event, the client should make requests modifying
                /// rendering state as it chooses. Then, the client must make the
                /// render_finish request.
                ///
                /// See the description of the river_window_manager_v1 interface for a
                /// complete overview of the manage/render sequence loop.
                render_start: void,
                /// This event indicates that the session has been locked.
                ///
                /// The window manager may wish to restrict which key bindings are available
                /// while locked or otherwise use this information.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                session_locked: void,
                /// This event indicates that the session has been unlocked.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                session_unlocked: void,
                /// A new window has been created.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                window: struct {
                    id: *client.river.WindowV1,
                },

                /// A new logical output has been created, perhaps due to a new physical
                /// monitor being plugged in or perhaps due to a change in configuration.
                ///
                /// This event will be followed by river_output_v1.position and dimensions
                /// events as well as a manage_start event after all other new state has
                /// been sent by the server.
                output: struct {
                    id: *client.river.OutputV1,
                },

                /// A new seat has been created.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                seat: struct {
                    id: *client.river.SeatV1,
                },
            };
            pub inline fn setListener(
                _window_manager_v1: *WindowManagerV1,
                comptime T: type,
                _listener: *const fn (window_manager_v1: *WindowManagerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(WindowManagerV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client no longer wishes to receive
            /// events on this object.
            ///
            /// The Wayland protocol is asynchronous, which means the server may send
            /// further events until the stop request is processed. The client must wait
            /// for a river_window_manager_v1.finished event before destroying this
            /// object.
            pub fn stop(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(0, null);
            }
            pub const stop_since_version = 1;

            /// This request should be called after the finished event has been received
            /// to complete destruction of the object.
            ///
            /// If a client wishes to destroy this object it should send a
            /// river_window_manager_v1.stop request and wait for a
            /// river_window_manager_v1.finished event. Once the finished event is
            /// received it is safe to destroy this object and any other objects created
            /// through this interface.
            pub fn destroy(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request indicates that the client has made all changes to window
            /// management state it wishes to include in the current manage sequence and
            /// that the server should atomically send these state changes to the
            /// windows and continue with the manage sequence.
            ///
            /// After sending this request, it is a protocol error for the client to
            /// make further changes to window management state until the next
            /// manage_start event is received.
            ///
            /// See the description of the river_window_manager_v1 interface for a
            /// complete overview of the manage/render sequence loop.
            pub fn manageFinish(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(2, null);
            }
            pub const manage_finish_since_version = 1;

            /// This request ensures a manage sequence is started and that a
            /// manage_start event is sent by the server. If this request is made during
            /// an ongoing manage sequence, a new manage sequence will be started as
            /// soon as the current one is completed.
            ///
            /// The client may want to use this request due to an internal state change
            /// that the compositor is not aware of (e.g. a dbus event) which should
            /// affect window management or rendering state.
            pub fn manageDirty(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(3, null);
            }
            pub const manage_dirty_since_version = 1;

            /// This request indicates that the client has made all changes to rendering
            /// state it wishes to include in the current manage sequence and that the
            /// server should atomically apply and display these state changes to the
            /// user.
            ///
            /// After sending this request, it is a protocol error for the client to
            /// make further changes to rendering state until the next manage_start or
            /// render_start event is received, whichever comes first.
            ///
            /// See the description of the river_window_manager_v1 interface for a
            /// complete overview of the manage/render sequence loop.
            pub fn renderFinish(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(4, null);
            }
            pub const render_finish_since_version = 1;

            /// Create a new shell surface for window manager UI and assign the
            /// river_shell_surface_v1 role to the surface.
            ///
            /// Providing a wl_surface which already has a role or already has a buffer
            /// attached or committed is a protocol error.
            pub fn getShellSurface(_window_manager_v1: *WindowManagerV1, _surface: *client.wl.Surface) !*client.river.ShellSurfaceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(5, &_args, client.river.ShellSurfaceV1.interface));
            }
            pub const get_shell_surface_since_version = 1;

            /// End the current Wayland session and exit the compositor.
            /// All Wayland clients running in the current session, including
            /// the window manager, will be disconnected.
            ///
            /// Window managers should only make this request if the user explicitly
            /// asks to exit the Wayland session, not for example on normal window
            /// manager termination.
            pub fn exitSession(_window_manager_v1: *WindowManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_manager_v1);
                _proxy.marshal(6, null);
            }
            pub const exit_session_since_version = 4;
        };

        /// The window manager might use a shell surface to display a status bar,
        /// background image, desktop notifications, launcher, desktop menu, or
        /// whatever else it wants.
        pub const ShellSurfaceV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.shell_surface_v1.interface;
            pub const Error = common.river.shell_surface_v1.Error;
            pub inline fn getId(_shell_surface_v1: *ShellSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shell_surface_v1)).getId();
            }
            pub inline fn getVersion(_shell_surface_v1: *ShellSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_shell_surface_v1)).getVersion();
            }
            pub inline fn getUserData(_shell_surface_v1: *ShellSurfaceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_shell_surface_v1)).getUserData();
            }
            pub inline fn setQueue(_shell_surface_v1: *ShellSurfaceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shell_surface_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the shell
            /// surface object and that it may be safely destroyed.
            pub fn destroy(_shell_surface_v1: *ShellSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shell_surface_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Get the node in the render list corresponding to the shell surface.
            ///
            /// It is a protocol error to make this request more than once for a single
            /// shell surface.
            pub fn getNode(_shell_surface_v1: *ShellSurfaceV1) !*client.river.NodeV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_shell_surface_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.river.NodeV1.interface));
            }
            pub const get_node_since_version = 1;

            /// Synchronize application of the next wl_surface.commit request on the
            /// shell surface with rest of the rendering state atomically applied with
            /// the next river_window_manager_v1.render_finish request.
            ///
            /// The client must make a wl_surface.commit request on the shell surface
            /// after this request and before the render_finish request, failure to do
            /// so is a protocol error.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn syncNextCommit(_shell_surface_v1: *ShellSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_shell_surface_v1);
                _proxy.marshal(2, null);
            }
            pub const sync_next_commit_since_version = 1;
        };

        /// The render list is a list of nodes that determines the rendering order of
        /// the compositor. Nodes may correspond to windows or shell surfaces. The
        /// relative ordering of nodes may be changed with the place_above and
        /// place_below requests, changing the rendering order.
        ///
        /// The initial position of a node in the render list is undefined, the window
        /// manager client must use the place_above or place_below request to
        /// guarantee a specific rendering order.
        pub const NodeV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.node_v1.interface;
            pub inline fn getId(_node_v1: *NodeV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_node_v1)).getId();
            }
            pub inline fn getVersion(_node_v1: *NodeV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_node_v1)).getVersion();
            }
            pub inline fn getUserData(_node_v1: *NodeV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_node_v1)).getUserData();
            }
            pub inline fn setQueue(_node_v1: *NodeV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the node
            /// object and that it may be safely destroyed.
            pub fn destroy(_node_v1: *NodeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the absolute position of the node in the compositor's logical
            /// coordinate space. The x and y coordinates may be positive or negative.
            ///
            /// Note that the position of a river_window_v1 refers to the position of
            /// the window content and is unaffected by the presence of borders or
            /// decoration surfaces.
            ///
            /// If this request is never sent, the position of the node is undefined by
            /// this protocol and left up to the compositor.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setPosition(_node_v1: *NodeV1, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_position_since_version = 1;

            /// This request places the node above all other nodes in the compositor's
            /// render list.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn placeTop(_node_v1: *NodeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                _proxy.marshal(2, null);
            }
            pub const place_top_since_version = 1;

            /// This request places the node below all other nodes in the compositor's
            /// render list.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn placeBottom(_node_v1: *NodeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                _proxy.marshal(3, null);
            }
            pub const place_bottom_since_version = 1;

            /// This request places the node directly above another node in the
            /// compositor's render list.
            ///
            /// Attempting to place a node above itself has no effect.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn placeAbove(_node_v1: *NodeV1, _other: *client.river.NodeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_other) },
                };
                _proxy.marshal(4, &_args);
            }
            pub const place_above_since_version = 1;

            /// This request places the node directly below another node in the
            /// compositor's render list.
            ///
            /// Attempting to place a node below itself has no effect.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn placeBelow(_node_v1: *NodeV1, _other: *client.river.NodeV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_node_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_other) },
                };
                _proxy.marshal(5, &_args);
            }
            pub const place_below_since_version = 1;
        };

        /// This represents a logical window. For example, a window may correspond to
        /// an xdg_toplevel or Xwayland window.
        ///
        /// A newly created window will not be displayed until the window manager
        /// makes a propose_dimensions or fullscreen request as part of a manage
        /// sequence, the server replies with a dimensions event as part of a render
        /// sequence, and that render sequence is finished.
        pub const WindowV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.window_v1.interface;
            pub const Error = common.river.window_v1.Error;
            pub const DecorationHint = common.river.window_v1.DecorationHint;
            pub const Edges = common.river.window_v1.Edges;
            pub const Capabilities = common.river.window_v1.Capabilities;
            pub inline fn getId(_window_v1: *WindowV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_window_v1)).getId();
            }
            pub inline fn getVersion(_window_v1: *WindowV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_window_v1)).getVersion();
            }
            pub inline fn getUserData(_window_v1: *WindowV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_window_v1)).getUserData();
            }
            pub inline fn setQueue(_window_v1: *WindowV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const closed_since_version = 1;
                pub const dimensions_hint_since_version = 1;
                pub const dimensions_since_version = 1;
                pub const app_id_since_version = 1;
                pub const title_since_version = 1;
                pub const parent_since_version = 1;
                pub const decoration_hint_since_version = 1;
                pub const pointer_move_requested_since_version = 1;
                pub const pointer_resize_requested_since_version = 1;
                pub const show_window_menu_requested_since_version = 1;
                pub const maximize_requested_since_version = 1;
                pub const unmaximize_requested_since_version = 1;
                pub const fullscreen_requested_since_version = 1;
                pub const exit_fullscreen_requested_since_version = 1;
                pub const minimize_requested_since_version = 1;
                pub const unreliable_pid_since_version = 2;
                pub const presentation_hint_since_version = 4;
                pub const identifier_since_version = 4;

                /// The window has been closed by the server, perhaps due to an
                /// xdg_toplevel.close request or similar.
                ///
                /// The server will send no further events on this object and ignore any
                /// request other than river_window_v1.destroy made after this event is
                /// sent. The client should destroy this object with the
                /// river_window_v1.destroy request to free up resources.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                closed: void,
                /// This event informs the window manager of the window's preferred min/max
                /// dimensions. These preferences are a hint, and the window manager is free
                /// to propose dimensions outside of these bounds.
                ///
                /// All min/max width/height values must be strictly greater than or equal
                /// to 0. A value of 0 indicates that the window has no preference for that
                /// value.
                ///
                /// The min_width/min_height must be strictly less than or equal to the
                /// max_width/max_height.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                dimensions_hint: struct {
                    min_width: i32,
                    min_height: i32,
                    max_width: i32,
                    max_height: i32,
                },

                /// This event indicates the dimensions of the window in the compositor's
                /// logical coordinate space. The width and height must be strictly greater
                /// than zero.
                ///
                /// Note that the dimensions of a river_window_v1 refer to the dimensions of
                /// the window content and are unaffected by the presence of borders or
                /// decoration surfaces.
                ///
                /// This event is sent as part of a render sequence before the render_start
                /// event.
                ///
                /// It may be sent due to a propose_dimensions or fullscreen request in a
                /// previous manage sequence or because a window independently decides to
                /// change its dimensions.
                ///
                /// The window will not be displayed until the first dimensions event is
                /// received and the render sequence is finished.
                dimensions: struct {
                    width: i32,
                    height: i32,
                },

                /// The window set an application ID.
                ///
                /// The app_id argument will be null if the window has never set an
                /// application ID or if the window cleared its application ID. (Xwayland
                /// windows may do this for example, though xdg-toplevels may not.)
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                app_id: struct {
                    app_id: ?[*:0]const u8,
                },

                /// The window set a title.
                ///
                /// The title argument will be null if the window has never set a title or
                /// if the window cleared its title. (Xwayland windows may do this for
                /// example, though xdg-toplevels may not.)
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                title: struct {
                    title: ?[*:0]const u8,
                },

                /// The window set a parent window. If this event is never received or if
                /// the parent argument is null then the window has no parent.
                ///
                /// A surface with a parent set might be a dialog, file picker, or similar
                /// for the parent window.
                ///
                /// Child windows should generally be rendered directly above their parent.
                ///
                /// The compositor must guarantee that there are no loops in the window
                /// tree: a parent must not be the descendant of one of its children.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                parent: struct {
                    parent: ?*client.river.WindowV1,
                },

                /// Information from the window about the supported and preferred client
                /// side/server side decoration options.
                ///
                /// This event may be sent multiple times over the lifetime of the window if
                /// the window changes its preferences.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                decoration_hint: struct {
                    hint: DecorationHint,
                },

                /// This event informs the window manager that the window has requested to
                /// be interactively moved using the pointer. The seat argument indicates the
                /// seat for the move.
                ///
                /// The xdg-shell protocol for example allows windows to request that an
                /// interactive move be started, perhaps when a client-side rendered
                /// titlebar is dragged.
                ///
                /// The window manager may use the river_seat_v1.op_start_pointer request to
                /// interactively move the window or ignore this event entirely.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                pointer_move_requested: struct {
                    seat: ?*client.river.SeatV1,
                },

                /// This event informs the window manager that the window has requested to
                /// be interactively resized using the pointer. The seat argument indicates
                /// the seat for the resize.
                ///
                /// The edges argument indicates which edges the window has requested to be
                /// resized from. The edges argument will never be none and will never have
                /// both top and bottom or both left and right edges set.
                ///
                /// The xdg-shell protocol for example allows windows to request that an
                /// interactive resize be started, perhaps when the corner of client-side
                /// rendered decorations is dragged.
                ///
                /// The window manager may use the river_seat_v1.op_start_pointer request to
                /// interactively resize the window or ignore this event entirely.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                pointer_resize_requested: struct {
                    seat: ?*client.river.SeatV1,
                    edges: Edges,
                },

                /// The xdg-shell protocol for example allows windows to request that a
                /// window menu be shown, for example when the user right clicks on client
                /// side window decorations.
                ///
                /// A window menu might include options to maximize or minimize the window.
                ///
                /// The window manager is free to ignore this request and decide what the
                /// window menu contains if it does choose to show one.
                ///
                /// The x and y arguments indicate where the window requested that the
                /// window menu be shown.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                show_window_menu_requested: struct {
                    x: i32,
                    y: i32,
                },

                /// The xdg-shell protocol for example allows windows to request to be
                /// maximized.
                ///
                /// The window manager is free to honor this request using
                /// river_window_v1.inform_maximized or ignore it.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                maximize_requested: void,
                /// The xdg-shell protocol for example allows windows to request to be
                /// unmaximized.
                ///
                /// The window manager is free to honor this request using
                /// river_window_v1.inform_unmaximized or ignore it.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                unmaximize_requested: void,
                /// The xdg-shell protocol for example allows windows to request that they
                /// be made fullscreen and allows them to provide an optional output hint.
                ///
                /// If the output argument is null, the window has no preference and the
                /// window manager should choose an output.
                ///
                /// The window manager is free to honor this request using
                /// river_window_v1.fullscreen or ignore it.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                fullscreen_requested: struct {
                    output: ?*client.river.OutputV1,
                },

                /// The xdg-shell protocol for example allows windows to request to exit
                /// fullscreen.
                ///
                /// The window manager is free to honor this request using
                /// river_window_v1.exit_fullscreen or ignore it.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                exit_fullscreen_requested: void,
                /// The xdg-shell protocol for example allows windows to request to be
                /// minimized.
                ///
                /// The window manager is free to ignore this request, hide the window, or
                /// do whatever else it chooses.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                minimize_requested: void,
                /// This event gives an unreliable PID of the process that created the
                /// window. Obtaining this information is inherently racy due to PID reuse.
                /// Therefore, this PID must not be used for anything security sensitive.
                ///
                /// Note also that a single process may create multiple windows, so there is
                /// not necessarily a 1-to-1 mapping from PID to window. Multiple windows
                /// may have the same PID.
                ///
                /// This event is sent once when the river_window_v1 is created and never
                /// sent again.
                unreliable_pid: struct {
                    unreliable_pid: i32,
                },

                /// This event communicates the window's preferred presentation mode.
                ///
                /// This event will be followed by a render_start event after all other new
                /// state has been sent by the server.
                presentation_hint: struct {
                    hint: common.river.output_v1.PresentationMode,
                },

                /// The identifier is a string that contains up to 32 printable ASCII bytes.
                /// The identifier must not be an empty string.
                ///
                /// It is compositor policy how the identifier is generated, but the following
                /// properties must be upheld:
                ///
                /// 1. The identifier must uniquely identify the window. Two windows must not
                /// share the same identifier.
                ///
                /// 2. The identifier must not be reused. This avoids races around window
                /// creation/destruction when identifiers are used in out-of-band IPC.
                ///
                /// If the compositor implements the ext-foreign-toplevel-list-v1 protocol,
                /// the river_window_v1.identifier event must match the corresponding
                /// ext_foreign_toplevel_handle_v1.identifier event.
                ///
                /// This event is sent once when the river_window_v1 is created and never
                /// sent again.
                identifier: struct {
                    identifier: [*:0]const u8,
                },
            };
            pub inline fn setListener(
                _window_v1: *WindowV1,
                comptime T: type,
                _listener: *const fn (window_v1: *WindowV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(WindowV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the window
            /// object and that it may be safely destroyed.
            ///
            /// This request should be made after the river_window_v1.closed event or
            /// river_window_manager_v1.finished is received to complete destruction of
            /// the window.
            pub fn destroy(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Request that the window be closed. The window may ignore this request or
            /// only close after some delay, perhaps opening a dialog asking the user to
            /// save their work or similar.
            ///
            /// The server will send a river_window_v1.closed event if/when the window
            /// has been closed.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn close(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(1, null);
            }
            pub const close_since_version = 1;

            /// Get the node in the render list corresponding to the window.
            ///
            /// It is a protocol error to make this request more than once for a single
            /// window.
            pub fn getNode(_window_v1: *WindowV1) !*client.river.NodeV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.NodeV1.interface));
            }
            pub const get_node_since_version = 1;

            /// This request proposes dimensions for the window in the compositor's
            /// logical coordinate space.
            ///
            /// The width and height must be greater than or equal to zero. If the width
            /// or height is zero the window will be allowed to decide its own
            /// dimensions.
            ///
            /// The window may not take the exact dimensions proposed. The actual
            /// dimensions taken by the window will be sent in a subsequent
            /// river_window_v1.dimensions event. For example, a terminal emulator may
            /// only allow dimensions that are multiple of the cell size.
            ///
            /// When a propose_dimensions request is made, the server must send a
            /// dimensions event in response as soon as possible. It may not be possible
            /// to send a dimensions event in the very next render sequence if, for
            /// example, the window takes too long to respond to the proposed
            /// dimensions. In this case, the server will send the dimensions event in a
            /// future render sequence.
            ///
            /// Note that the dimensions of a river_window_v1 refer to the dimensions of
            /// the window content and are unaffected by the presence of borders or
            /// decoration surfaces.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn proposeDimensions(_window_v1: *WindowV1, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(3, &_args);
            }
            pub const propose_dimensions_since_version = 1;

            /// Request that the window be hidden. Has no effect if the window is
            /// already hidden. Hides any window borders and decorations as well.
            ///
            /// Newly created windows are considered shown unless explicitly hidden with
            /// the hide request.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn hide(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(4, null);
            }
            pub const hide_since_version = 1;

            /// Request that the window be shown. Has no effect if the window is not
            /// hidden. Does not guarantee that the window is visible as it may be
            /// completely obscured by other windows placed above it for example.
            ///
            /// Newly created windows are considered shown unless explicitly hidden with
            /// the hide request.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn show(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(5, null);
            }
            pub const show_since_version = 1;

            /// Tell the client to use client side decoration and draw its own title
            /// bar, borders, etc.
            ///
            /// This is the default if neither this request nor the use_ssd request is
            /// ever made.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn useCsd(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(6, null);
            }
            pub const use_csd_since_version = 1;

            /// Tell the client to use server side decoration and not draw any client
            /// side decorations.
            ///
            /// This request will have no effect if the client only supports client side
            /// decoration, see the decoration_hint event.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn useSsd(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(7, null);
            }
            pub const use_ssd_since_version = 1;

            /// This request decorates the window with borders drawn by the compositor
            /// on the specified edges of the window. Borders are drawn above the window
            /// content.
            ///
            /// Corners are drawn only between borders on adjacent edges. If e.g. the
            /// left edge has a border and the top edge does not, the border drawn on
            /// the left edge will not extend vertically beyond the top edge of the
            /// window.
            ///
            /// Borders are not drawn while the window is fullscreen.
            ///
            /// The color is defined by four 32-bit RGBA values. Unless specified in
            /// another protocol extension, the RGBA values use pre-multiplied alpha.
            ///
            /// Setting the edges to none or the width to 0 disables the borders.
            /// Setting a negative width is a protocol error.
            ///
            /// This request completely overrides all previous set_borders requests.
            /// Only the most recent set_borders request has an effect.
            ///
            /// Note that the position/dimensions of a river_window_v1 refer to the
            /// position/dimensions of the window content and are unaffected by the
            /// presence of borders or decoration surfaces.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setBorders(_window_v1: *WindowV1, _edges: Edges, _width: i32, _r: u32, _g: u32, _b: u32, _a: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Edges)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_edges))),
                        .@"struct" => @bitCast(_edges),
                        else => unreachable,
                    } },
                    .{ .i = _width },
                    .{ .u = _r },
                    .{ .u = _g },
                    .{ .u = _b },
                    .{ .u = _a },
                };
                _proxy.marshal(8, &_args);
            }
            pub const set_borders_since_version = 1;

            /// Inform the window that it is part of a tiled layout and adjacent to
            /// other elements in the tiled layout on the given edges.
            ///
            /// The window should use this information to change the style of its client
            /// side decorations and avoid drawing e.g. drop shadows outside of the
            /// window dimensions on the tiled edges.
            ///
            /// Setting the edges argument to none informs the window that it is not
            /// part of a tiled layout. If this request is never made, the window is
            /// informed that it is not part of a tiled layout.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn setTiled(_window_v1: *WindowV1, _edges: Edges) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Edges)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_edges))),
                        .@"struct" => @bitCast(_edges),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(9, &_args);
            }
            pub const set_tiled_since_version = 1;

            /// Create a decoration surface and assign the river_decoration_v1 role to
            /// the surface. The created decoration is placed above the window in
            /// rendering order, see the description of river_decoration_v1.
            ///
            /// Providing a wl_surface which already has a role or already has a buffer
            /// attached or committed is a protocol error.
            pub fn getDecorationAbove(_window_v1: *WindowV1, _surface: *client.wl.Surface) !*client.river.DecorationV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(10, &_args, client.river.DecorationV1.interface));
            }
            pub const get_decoration_above_since_version = 1;

            /// Create a decoration surface and assign the river_decoration_v1 role to
            /// the surface. The created decoration is placed below the window in
            /// rendering order, see the description of river_decoration_v1.
            ///
            /// Providing a wl_surface which already has a role or already has a buffer
            /// attached or committed is a protocol error.
            pub fn getDecorationBelow(_window_v1: *WindowV1, _surface: *client.wl.Surface) !*client.river.DecorationV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                };
                return @ptrCast(try _proxy.marshalConstructor(11, &_args, client.river.DecorationV1.interface));
            }
            pub const get_decoration_below_since_version = 1;

            /// Inform the window that it is being resized. The window manager should
            /// use this request to inform windows that are the target of an interactive
            /// resize for example.
            ///
            /// The window manager remains responsible for handling the position and
            /// dimensions of the window while it is resizing.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informResizeStart(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(12, null);
            }
            pub const inform_resize_start_since_version = 1;

            /// Inform the window that it is no longer being resized. The window manager
            /// should use this request to inform windows that are the target of an
            /// interactive resize that the interactive resize has ended for example.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informResizeEnd(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(13, null);
            }
            pub const inform_resize_end_since_version = 1;

            /// This request informs the window of the capabilities supported by the
            /// window manager. If the window manager, for example, ignores requests to
            /// be maximized from the window it should not tell the window that it
            /// supports the maximize capability.
            ///
            /// The window might use this information to, for example, only show a
            /// maximize button if the window manager supports the maximize capability.
            ///
            /// The window manager client should use this request to set capabilities
            /// for all new windows. If this request is never made, the compositor will
            /// inform windows that all capabilities are supported.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn setCapabilities(_window_v1: *WindowV1, _caps: Capabilities) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Capabilities)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_caps))),
                        .@"struct" => @bitCast(_caps),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(14, &_args);
            }
            pub const set_capabilities_since_version = 1;

            /// Inform the window that it is maximized. The window might use this
            /// information to adapt the style of its client-side window decorations for
            /// example.
            ///
            /// The window manager remains responsible for handling the position and
            /// dimensions of the window while it is maximized.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informMaximized(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(15, null);
            }
            pub const inform_maximized_since_version = 1;

            /// Inform the window that it is unmaximized. The window might use this
            /// information to adapt the style of its client-side window decorations for
            /// example.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informUnmaximized(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(16, null);
            }
            pub const inform_unmaximized_since_version = 1;

            /// Inform the window that it is fullscreen. The window might use this
            /// information to adapt the style of its client-side window decorations for
            /// example.
            ///
            /// This request does not affect the size/position of the window or cause it
            /// to become the only window rendered, see the river_window_v1.fullscreen
            /// and exit_fullscreen requests for that.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informFullscreen(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(17, null);
            }
            pub const inform_fullscreen_since_version = 1;

            /// Inform the window that it is not fullscreen. The window might use this
            /// information to adapt the style of its client-side window decorations for
            /// example.
            ///
            /// This request does not affect the size/position of the window or cause it
            /// to become the only window rendered, see the river_window_v1.fullscreen
            /// and exit_fullscreen requests for that.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn informNotFullscreen(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(18, null);
            }
            pub const inform_not_fullscreen_since_version = 1;

            /// Make the window fullscreen on the given output. If multiple windows are
            /// fullscreen on the same output at the same time only the "top" window in
            /// rendering order shall be displayed.
            ///
            /// All river_shell_surface_v1 objects above the top fullscreen window in
            /// the rendering order will continue to be rendered.
            ///
            /// The compositor will handle the position and dimensions of the window
            /// while it is fullscreen. The set_position and propose_dimensions requests
            /// shall not affect the current position and dimensions of a fullscreen
            /// window.
            ///
            /// When a fullscreen request is made, the server must send a dimensions
            /// event in response as soon as possible. It may not be possible to send a
            /// dimensions event in the very next render sequence if, for example, the
            /// window takes too long to respond. In this case, the server will send the
            /// dimensions event in a future render sequence.
            ///
            /// The compositor will clip window content, decoration surfaces, and
            /// borders to the given output's dimensions while the window is fullscreen.
            /// The effects of set_clip_box and set_content_clip_box are ignored while
            /// the window is fullscreen.
            ///
            /// If the output on which a window is currently fullscreen is removed, the
            /// windowing state is modified as if there were an exit_fullscreen request
            /// made in the same manage sequence as the river_output_v1.removed event.
            ///
            /// This request does not inform the window that it is fullscreen, see the
            /// river_window_v1.inform_fullscreen and inform_not_fullscreen requests.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn fullscreen(_window_v1: *WindowV1, _output: *client.river.OutputV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _proxy.marshal(19, &_args);
            }
            pub const fullscreen_since_version = 1;

            /// Make the window not fullscreen.
            ///
            /// The position and dimensions are undefined after this request is made
            /// until a manage sequence in which the window manager makes the
            /// propose_dimensions and set_position requests is completed.
            ///
            /// The window manager should make propose_dimensions and set_position
            /// requests in the same manage sequence as the exit_fullscreen request for
            /// frame perfection.
            ///
            /// This request does not inform the window that it is fullscreen, see the
            /// river_window_v1.inform_fullscreen and inform_not_fullscreen requests.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn exitFullscreen(_window_v1: *WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                _proxy.marshal(20, null);
            }
            pub const exit_fullscreen_since_version = 1;

            /// Clip the window, including borders and decoration surfaces, to the box
            /// specified by the x, y, width, and height arguments. The x/y position of
            /// the box is relative to the top left corner of the window.
            ///
            /// The width and height arguments must be greater than or equal to 0.
            ///
            /// Setting a clip box with 0 width or height disables clipping.
            ///
            /// The clip box is ignored while the window is fullscreen.
            ///
            /// Both set_clip_box and set_content_clip_box may be enabled simultaneously.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setClipBox(_window_v1: *WindowV1, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(21, &_args);
            }
            pub const set_clip_box_since_version = 2;

            /// Clip the content of the window, excluding borders and decoration
            /// surfaces, to the box specified by the x, y, width, and height arguments.
            /// The x/y position of the box is relative to the top left corner of the
            /// window.
            ///
            /// Borders drawn by the compositor (see set_borders) are placed around the
            /// intersection of the window content (as defined by the dimensions event)
            /// and the content clip box when content clipping is enabled.
            ///
            /// The width and height arguments must be greater than or equal to 0.
            ///
            /// Setting a box with 0 width or height disables content clipping.
            ///
            /// The content clip box is ignored while the window is fullscreen.
            ///
            /// Both set_clip_box and set_content_clip_box may be enabled simultaneously.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setContentClipBox(_window_v1: *WindowV1, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(22, &_args);
            }
            pub const set_content_clip_box_since_version = 3;

            /// Recommend that the window keep its dimensions within a given
            /// maximum width/height. This recommendation is only a hint and the window
            /// may ignore it.
            ///
            /// Setting the width and height to 0 indicates that there are no bounds
            /// and is equivalent to having never made this request.
            ///
            /// Setting width or height to a negative value is a protocol error.
            ///
            /// The server should communicate this hint to an xdg_toplevel window with
            /// the xdg_toplevel.configure_bounds event for example.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn setDimensionBounds(_window_v1: *WindowV1, _max_width: i32, _max_height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _max_width },
                    .{ .i = _max_height },
                };
                _proxy.marshal(23, &_args);
            }
            pub const set_dimension_bounds_since_version = 4;
        };

        /// The rendering order of windows with decorations is follows:
        ///
        /// 1. Decorations created with get_decoration_below at the bottom
        /// 2. Window content
        /// 3. Borders configured with river_window_v1.set_borders
        /// 4. Decorations created with get_decoration_above at the top
        ///
        /// The relative ordering of decoration surfaces above/below a window is
        /// undefined by this protocol and left up to the compositor.
        pub const DecorationV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.decoration_v1.interface;
            pub const Error = common.river.decoration_v1.Error;
            pub inline fn getId(_decoration_v1: *DecorationV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_v1)).getId();
            }
            pub inline fn getVersion(_decoration_v1: *DecorationV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_v1)).getVersion();
            }
            pub inline fn getUserData(_decoration_v1: *DecorationV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_decoration_v1)).getUserData();
            }
            pub inline fn setQueue(_decoration_v1: *DecorationV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the decoration
            /// object and that it may be safely destroyed.
            pub fn destroy(_decoration_v1: *DecorationV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request sets the offset of the decoration surface from the top left
            /// corner of the window.
            ///
            /// If this request is never sent, the x and y offsets are undefined by this
            /// protocol and left up to the compositor.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setOffset(_decoration_v1: *DecorationV1, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_offset_since_version = 1;

            /// Synchronize application of the next wl_surface.commit request on the
            /// decoration surface with rest of the state atomically applied with the
            /// next river_window_manager_v1.render_finish request.
            ///
            /// The client must make a wl_surface.commit request on the decoration
            /// surface after this request and before the render_finish request, failure
            /// to do so is a protocol error.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn syncNextCommit(_decoration_v1: *DecorationV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_decoration_v1);
                _proxy.marshal(2, null);
            }
            pub const sync_next_commit_since_version = 1;
        };

        /// An area in the compositor's logical coordinate space that should be
        /// treated as a single output for window management purposes. This area may
        /// correspond to a single physical output or multiple physical outputs in the
        /// case of mirroring or tiled monitors depending on the hardware and
        /// compositor configuration.
        pub const OutputV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.output_v1.interface;
            pub const Error = common.river.output_v1.Error;
            pub const PresentationMode = common.river.output_v1.PresentationMode;
            pub inline fn getId(_output_v1: *OutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_v1)).getId();
            }
            pub inline fn getVersion(_output_v1: *OutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_v1)).getVersion();
            }
            pub inline fn getUserData(_output_v1: *OutputV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_output_v1)).getUserData();
            }
            pub inline fn setQueue(_output_v1: *OutputV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const removed_since_version = 1;
                pub const wl_output_since_version = 1;
                pub const position_since_version = 1;
                pub const dimensions_since_version = 1;

                /// This event indicates that the logical output is no longer conceptually
                /// part of window management space.
                ///
                /// The server will send no further events on this object and ignore any
                /// request (other than river_output_v1.destroy) made after this event is
                /// sent. The client should destroy this object with the
                /// river_output_v1.destroy request to free up resources.
                ///
                /// This event may be sent because a corresponding physical output has been
                /// physically unplugged or because some output configuration has changed.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                removed: void,
                /// The wl_output object corresponding to the river_output_v1. The argument
                /// is the global name of the wl_output advertised with wl_registry.global.
                ///
                /// It is guaranteed that the corresponding wl_output is advertised before
                /// this event is sent.
                ///
                /// This event is sent exactly once. The wl_output associated with a
                /// river_output_v1 cannot change. It is guaranteed that there is a 1-to-1
                /// mapping between wl_output and river_output_v1 objects.
                ///
                /// The global_remove event for the corresponding wl_output may be sent
                /// before the river_output_v1.removed event. This is due to the fact that
                /// river_output_v1 state changes are synced to the river window management
                /// manage sequence while changes to globals are not.
                ///
                /// Rationale: The window manager may need information provided by the
                /// wl_output interface such as the name/description. It also may need the
                /// wl_output object to start screencopy for example.
                wl_output: struct {
                    name: u32,
                },

                /// This event indicates the position of the output in the compositor's
                /// logical coordinate space. The x and y coordinates may be positive or
                /// negative.
                ///
                /// This event is sent once when the river_output_v1 is created and again
                /// whenever the position changes.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The server must guarantee that the position and dimensions events do not
                /// cause the areas of multiple logical outputs to overlap when the
                /// corresponding manage_start event is received.
                position: struct {
                    x: i32,
                    y: i32,
                },

                /// This event indicates the dimensions of the output in the compositor's
                /// logical coordinate space. The width and height will always be strictly
                /// greater than zero.
                ///
                /// This event is sent once when the river_output_v1 is created and again
                /// whenever the dimensions change.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The server must guarantee that the position and dimensions events do not
                /// cause the areas of multiple logical outputs to overlap when the
                /// corresponding manage_start event is received.
                dimensions: struct {
                    width: i32,
                    height: i32,
                },
            };
            pub inline fn setListener(
                _output_v1: *OutputV1,
                comptime T: type,
                _listener: *const fn (output_v1: *OutputV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(OutputV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the output
            /// object and that it may be safely destroyed.
            ///
            /// This request should be made after the river_output_v1.removed event is
            /// received to complete destruction of the output.
            pub fn destroy(_output_v1: *OutputV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the preferred presentation mode of the output. The compositor should
            /// always respect the preference of the window manager if possible. If this
            /// request is never made, the preferred presentation mode is vsync.
            ///
            /// This request modifies rendering state and may only be made as part of a
            /// render sequence, see the river_window_manager_v1 description.
            pub fn setPresentationMode(_output_v1: *OutputV1, _mode: PresentationMode) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(PresentationMode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_presentation_mode_since_version = 4;
        };

        /// This object represents a single user's collection of input devices. It
        /// allows the window manager to route keyboard input to windows, get
        /// high-level information about pointer input, define pointer bindings, etc.
        ///
        /// For keyboard bindings, see the river-xkb-bindings-v1 protocol.
        ///
        /// Since version 4: The cursor surface/shape set by the window manager on the
        /// wl_pointer of this seat is used when no client has pointer focus, for
        /// example during a pointer operation. Since the window manager is allowed to
        /// set cursor surface/shape even when it does not have pointer focus, the
        /// compositor must ignore the serial argument of wl_pointer.set_cursor and
        /// wp_cursor_shape_device_v1.set_shape requests made by the window manager.
        ///
        /// The most recent cursor surface/shape set by the window manager is
        /// remembered by the compositor and restored whenever no client has pointer
        /// focus. If the window manager never sets a cursor surface/shape, the
        /// "default" shape is used.
        pub const SeatV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.seat_v1.interface;
            pub const Modifiers = common.river.seat_v1.Modifiers;
            pub inline fn getId(_seat_v1: *SeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_seat_v1)).getId();
            }
            pub inline fn getVersion(_seat_v1: *SeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_seat_v1)).getVersion();
            }
            pub inline fn getUserData(_seat_v1: *SeatV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_seat_v1)).getUserData();
            }
            pub inline fn setQueue(_seat_v1: *SeatV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const removed_since_version = 1;
                pub const wl_seat_since_version = 1;
                pub const pointer_enter_since_version = 1;
                pub const pointer_leave_since_version = 1;
                pub const window_interaction_since_version = 1;
                pub const shell_surface_interaction_since_version = 1;
                pub const op_delta_since_version = 1;
                pub const op_release_since_version = 1;
                pub const pointer_position_since_version = 2;

                /// This event indicates that seat is no longer in use and should be
                /// destroyed.
                ///
                /// The server will send no further events on this object and ignore any
                /// request (other than river_seat_v1.destroy) made after this event is
                /// sent.  The client should destroy this object with the
                /// river_seat_v1.destroy request to free up resources.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                removed: void,
                /// The wl_seat object corresponding to the river_seat_v1. The argument is
                /// the global name of the wl_seat advertised with wl_registry.global.
                ///
                /// It is guaranteed that the corresponding wl_seat is advertised before
                /// this event is sent.
                ///
                /// This event is sent exactly once. The wl_seat associated with a
                /// river_seat_v1 cannot change. It is guaranteed that there is a 1-to-1
                /// mapping between wl_seat and river_seat_v1 objects.
                ///
                /// The global_remove event for the corresponding wl_seat may be sent before
                /// the river_seat_v1.removed event. This is due to the fact that
                /// river_seat_v1 state changes are synced to the river window management
                /// manage sequence while changes to globals are not.
                ///
                /// Rationale: The window manager may want to trigger window management
                /// state changes based on normal input events received by its shell
                /// surfaces for example.
                wl_seat: struct {
                    name: u32,
                },

                /// The seat's pointer entered the given window's area.
                ///
                /// The area of a window is defined to include the area defined by the
                /// window dimensions, borders configured using river_window_v1.set_borders,
                /// and the input regions of decoration surfaces. In particular, it does not
                /// include input regions of surfaces belonging to the window that extend
                /// outside the window dimensions.
                ///
                /// The pointer of a seat may only enter a single window at a time. When the
                /// pointer moves between windows, the pointer_leave event for the old
                /// window must be sent before the pointer_enter event for the new window.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                pointer_enter: struct {
                    window: ?*client.river.WindowV1,
                },

                /// The seat's pointer left the window for which pointer_enter was most
                /// recently sent. See pointer_enter for details.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                pointer_leave: void,
                /// A window has been interacted with beyond the pointer merely passing over
                /// it. This event might be sent due to a pointer button press or due to a
                /// touch/tablet tool interaction with the window.
                ///
                /// There are no guarantees regarding how this event is sent in relation to
                /// the pointer_enter and pointer_leave events as the interaction may use
                /// touch or tablet tool input.
                ///
                /// Rationale: this event gives window managers necessary information to
                /// determine when to send keyboard focus, raise a window that already has
                /// keyboard focus, etc. Rather than expose all pointer, touch, and tablet
                /// events to window managers, a policy over mechanism approach is taken.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                window_interaction: struct {
                    window: ?*client.river.WindowV1,
                },

                /// A shell surface has been interacted with beyond the pointer merely
                /// passing over it. This event might be sent due to a pointer button press
                /// or due to a touch/tablet tool interaction with the shell_surface.
                ///
                /// There are no guarantees regarding how this event is sent in relation to
                /// the pointer_enter and pointer_leave events as the interaction may use
                /// touch or tablet tool input.
                ///
                /// Rationale: While the shell surface does receive all wl_pointer,
                /// wl_touch, etc. input events for the surface directly, these events do
                /// not necessarily trigger a manage sequence and therefore do not allow the
                /// window manager to update focus or perform other actions in response to
                /// the input in a race-free way.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                shell_surface_interaction: struct {
                    shell_surface: ?*client.river.ShellSurfaceV1,
                },

                /// This event indicates the total change in position since the start of the
                /// operation of the pointer/touch point/etc.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                op_delta: struct {
                    dx: i32,
                    dy: i32,
                },

                /// The input driving the current interactive operation has been released.
                /// For a pointer op for example, all pointer buttons have been released.
                ///
                /// Depending on the op type, op_delta events may continue to be sent until
                /// the op is ended with the op_end request.
                ///
                /// This event is sent at most once during an interactive operation.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                op_release: void,
                /// The current position of the pointer in the compositor's logical
                /// coordinate space.
                ///
                /// This state is special in that a change in pointer position alone must
                /// not cause the compositor to start a manage sequence.
                ///
                /// Assuming the seat has a pointer, this event must be sent in every manage
                /// sequence unless there is no change in x/y position since the last time this
                /// event was sent.
                pointer_position: struct {
                    x: i32,
                    y: i32,
                },
            };
            pub inline fn setListener(
                _seat_v1: *SeatV1,
                comptime T: type,
                _listener: *const fn (seat_v1: *SeatV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(SeatV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the seat
            /// object and that it may be safely destroyed.
            ///
            /// This request should be made after the river_seat_v1.removed event is
            /// received to complete destruction of the seat.
            pub fn destroy(_seat_v1: *SeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Request that the compositor send keyboard input to the given window.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn focusWindow(_seat_v1: *SeatV1, _window: *client.river.WindowV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_window) },
                };
                _proxy.marshal(1, &_args);
            }
            pub const focus_window_since_version = 1;

            /// Request that the compositor send keyboard input to the given shell
            /// surface.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn focusShellSurface(_seat_v1: *SeatV1, _shell_surface: *client.river.ShellSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_shell_surface) },
                };
                _proxy.marshal(2, &_args);
            }
            pub const focus_shell_surface_since_version = 1;

            /// Request that the compositor not send keyboard input to any client.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn clearFocus(_seat_v1: *SeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                _proxy.marshal(3, null);
            }
            pub const clear_focus_since_version = 1;

            /// Start an interactive pointer operation. During the operation, op_delta
            /// events will be sent based on pointer input.
            ///
            /// When all pointer buttons are released, the op_release event is sent.
            ///
            /// The pointer operation continues until the op_end request is made during
            /// a manage sequence and that manage sequence is finished.
            ///
            /// The window manager may use this operation to implement interactive
            /// move/resize of windows by setting the position of windows and proposing
            /// dimensions based off of the op_delta events.
            ///
            /// This request is ignored if an operation is already in progress.
            ///
            /// The compositor must ensure that no client has pointer focus from this
            /// seat during the pointer operation. This means that the window manager
            /// has control over the pointer's cursor surface/shape during the pointer
            /// operation. See the river_seat_v1 description.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn opStartPointer(_seat_v1: *SeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                _proxy.marshal(4, null);
            }
            pub const op_start_pointer_since_version = 1;

            /// End an interactive operation.
            ///
            /// This request is ignored if there is no operation in progress.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn opEnd(_seat_v1: *SeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                _proxy.marshal(5, null);
            }
            pub const op_end_since_version = 1;

            /// Define a pointer binding in terms of a pointer button, keyboard
            /// modifiers, and other configurable properties.
            ///
            /// The button argument is a Linux input event code defined in the
            /// linux/input-event-codes.h header file (e.g. BTN_RIGHT).
            ///
            /// The new pointer binding is not enabled until initial configuration is
            /// completed and the enable request is made during a manage sequence.
            pub fn getPointerBinding(_seat_v1: *SeatV1, _button: u32, _modifiers: Modifiers) !*client.river.PointerBindingV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = _button },
                    .{ .u = switch (@typeInfo(Modifiers)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_modifiers))),
                        .@"struct" => @bitCast(_modifiers),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(6, &_args, client.river.PointerBindingV1.interface));
            }
            pub const get_pointer_binding_since_version = 1;

            /// Set the XCursor theme for the seat. This theme is used for cursors
            /// rendered by the compositor, but not necessarily for cursors rendered by
            /// clients.
            ///
            /// Note: The window manager may also wish to set the XCURSOR_THEME and
            /// XCURSOR_SIZE environment variable for programs it starts.
            pub fn setXcursorTheme(_seat_v1: *SeatV1, _name: [*:0]const u8, _size: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                    .{ .u = _size },
                };
                _proxy.marshal(7, &_args);
            }
            pub const set_xcursor_theme_since_version = 2;

            /// Warp the pointer to the given position in the compositor's logical
            /// coordinate space.
            ///
            /// If the given position is outside the bounds of all outputs, the pointer
            /// will be warped to the closest point inside an output instead.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn pointerWarp(_seat_v1: *SeatV1, _x: i32, _y: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _proxy.marshal(8, &_args);
            }
            pub const pointer_warp_since_version = 3;
        };

        /// This object allows the window manager to configure a pointer binding and
        /// receive events when the binding is triggered.
        ///
        /// The new pointer binding is not enabled until the enable request is made
        /// during a manage sequence.
        ///
        /// Normally, all pointer button events are sent to the surface with pointer
        /// focus by the compositor. Pointer button events that trigger a pointer
        /// binding are not sent to the surface with pointer focus.
        ///
        /// If multiple pointer bindings would be triggered by a single physical
        /// pointer event on the compositor side, it is compositor policy which
        /// pointer binding(s) will receive press/release events or if all of the
        /// matched pointer bindings receive press/release events.
        pub const PointerBindingV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.pointer_binding_v1.interface;
            pub inline fn getId(_pointer_binding_v1: *PointerBindingV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_binding_v1)).getId();
            }
            pub inline fn getVersion(_pointer_binding_v1: *PointerBindingV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_binding_v1)).getVersion();
            }
            pub inline fn getUserData(_pointer_binding_v1: *PointerBindingV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_pointer_binding_v1)).getUserData();
            }
            pub inline fn setQueue(_pointer_binding_v1: *PointerBindingV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_binding_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const pressed_since_version = 1;
                pub const released_since_version = 1;

                /// This event indicates that the pointer button triggering the binding has
                /// been pressed.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The compositor should wait for the manage sequence to complete before
                /// processing further input events. This allows the window manager client
                /// to, for example, modify key bindings and keyboard focus without racing
                /// against future input events. The window manager should of course respond
                /// as soon as possible as the capacity of the compositor to buffer incoming
                /// input events is finite.
                pressed: void,
                /// This event indicates that the pointer button triggering the binding has
                /// been released.
                ///
                /// Releasing the modifiers for the binding without releasing the pointer
                /// button does not trigger the release event. This event is sent when the
                /// pointer button is released, even if the modifiers have changed since the
                /// pressed event.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The compositor should wait for the manage sequence to complete before
                /// processing further input events. This allows the window manager client
                /// to, for example, modify key bindings and keyboard focus without racing
                /// against future input events. The window manager should of course respond
                /// as soon as possible as the capacity of the compositor to buffer incoming
                /// input events is finite.
                released: void,
            };
            pub inline fn setListener(
                _pointer_binding_v1: *PointerBindingV1,
                comptime T: type,
                _listener: *const fn (pointer_binding_v1: *PointerBindingV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_binding_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(PointerBindingV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the pointer
            /// binding object and that it may be safely destroyed.
            pub fn destroy(_pointer_binding_v1: *PointerBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_binding_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// This request should be made after all initial configuration has been
            /// completed and the window manager wishes the pointer binding to be able
            /// to be triggered.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn enable(_pointer_binding_v1: *PointerBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_binding_v1);
                _proxy.marshal(1, null);
            }
            pub const enable_since_version = 1;

            /// This request may be used to temporarily disable the pointer binding. It
            /// may be later re-enabled with the enable request.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn disable(_pointer_binding_v1: *PointerBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_pointer_binding_v1);
                _proxy.marshal(2, null);
            }
            pub const disable_since_version = 1;
        };

        /// This global interface should only be advertised to the client if the
        /// river_window_manager_v1 global is also advertised.
        pub const XkbBindingsV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_bindings_v1.interface;
            pub const Error = common.river.xkb_bindings_v1.Error;
            pub inline fn getId(_xkb_bindings_v1: *XkbBindingsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_v1)).getId();
            }
            pub inline fn getVersion(_xkb_bindings_v1: *XkbBindingsV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_bindings_v1: *XkbBindingsV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_bindings_v1: *XkbBindingsV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the
            /// river_xkb_bindings_v1 object.
            pub fn destroy(_xkb_bindings_v1: *XkbBindingsV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Define a key binding for the given seat in terms of an xkbcommon keysym
            /// and other configurable properties.
            ///
            /// The new key binding is not enabled until initial configuration is
            /// completed and the enable request is made during a manage sequence.
            pub fn getXkbBinding(_xkb_bindings_v1: *XkbBindingsV1, _seat: *client.river.SeatV1, _keysym: u32, _modifiers: common.river.seat_v1.Modifiers) !*client.river.XkbBindingV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .o = null },
                    .{ .u = _keysym },
                    .{ .u = switch (@typeInfo(common.river.seat_v1.Modifiers)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_modifiers))),
                        .@"struct" => @bitCast(_modifiers),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.river.XkbBindingV1.interface));
            }
            pub const get_xkb_binding_since_version = 1;

            /// Create an object to manage seat-specific xkb bindings state.
            ///
            /// It is a protocol error to make this request more than once for a given
            /// river_seat_v1 object.
            pub fn getSeat(_xkb_bindings_v1: *XkbBindingsV1, _seat: *client.river.SeatV1) !*client.river.XkbBindingsSeatV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_seat) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.XkbBindingsSeatV1.interface));
            }
            pub const get_seat_since_version = 2;
        };

        /// This object allows the window manager to configure a xkbcommon key binding
        /// and receive events when the key binding is triggered.
        ///
        /// The new key binding is not enabled until the enable request is made during
        /// a manage sequence.
        ///
        /// Normally, all key events are sent to the surface with keyboard focus by
        /// the compositor. Key events that trigger a key binding are not sent to the
        /// surface with keyboard focus.
        ///
        /// If multiple key bindings would be triggered by a single physical key event
        /// on the compositor side, it is compositor policy which key binding(s) will
        /// receive press/release events or if all of the matched key bindings receive
        /// press/release events.
        ///
        /// Key bindings might be matched by the same physical key event due to shared
        /// keysym and modifiers. The layout override feature may also cause the same
        /// physical key event to trigger two key bindings with different keysyms and
        /// different layout overrides configured.
        pub const XkbBindingV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_binding_v1.interface;
            pub inline fn getId(_xkb_binding_v1: *XkbBindingV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_binding_v1)).getId();
            }
            pub inline fn getVersion(_xkb_binding_v1: *XkbBindingV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_binding_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_binding_v1: *XkbBindingV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_binding_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_binding_v1: *XkbBindingV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const pressed_since_version = 1;
                pub const released_since_version = 1;
                pub const stop_repeat_since_version = 2;

                /// This event indicates that the physical key triggering the binding has
                /// been pressed.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The compositor should wait for the manage sequence to complete before
                /// processing further input events. This allows the window manager client
                /// to, for example, modify key bindings and keyboard focus without racing
                /// against future input events. The window manager should of course respond
                /// as soon as possible as the capacity of the compositor to buffer incoming
                /// input events is finite.
                pressed: void,
                /// This event indicates that the physical key triggering the binding has
                /// been released.
                ///
                /// Releasing the modifiers for the binding without releasing the "main"
                /// physical key that produces the bound keysym does not trigger the release
                /// event. This event is sent when the "main" key is released, even if the
                /// modifiers have changed since the pressed event.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ///
                /// The compositor should wait for the manage sequence to complete before
                /// processing further input events. This allows the window manager client
                /// to, for example, modify key bindings and keyboard focus without racing
                /// against future input events. The window manager should of course respond
                /// as soon as possible as the capacity of the compositor to buffer incoming
                /// input events is finite.
                released: void,
                /// This event indicates that repeating should be stopped for the binding if
                /// the window manager has been repeating some action since the pressed
                /// event.
                ///
                /// This event is generally sent when some other (possible unbound) key is
                /// pressed after the pressed event is sent and before the released event
                /// is sent for this binding.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                stop_repeat: void,
            };
            pub inline fn setListener(
                _xkb_binding_v1: *XkbBindingV1,
                comptime T: type,
                _listener: *const fn (xkb_binding_v1: *XkbBindingV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(XkbBindingV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the xkb key
            /// binding object and that it may be safely destroyed.
            pub fn destroy(_xkb_binding_v1: *XkbBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Specify an xkb layout that should be used to translate key events for
            /// the purpose of triggering this key binding irrespective of the currently
            /// active xkb layout.
            ///
            /// The layout argument is a 0-indexed xkbcommon layout number for the
            /// keyboard that generated the key event.
            ///
            /// If this request is never made, the currently active xkb layout of the
            /// keyboard that generated the key event will be used.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn setLayoutOverride(_xkb_binding_v1: *XkbBindingV1, _layout: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                var _args = [_]common.Argument{
                    .{ .u = _layout },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_layout_override_since_version = 1;

            /// This request should be made after all initial configuration has been
            /// completed and the window manager wishes the key binding to be able to be
            /// triggered.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn enable(_xkb_binding_v1: *XkbBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                _proxy.marshal(2, null);
            }
            pub const enable_since_version = 1;

            /// This request may be used to temporarily disable the key binding. It may
            /// be later re-enabled with the enable request.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn disable(_xkb_binding_v1: *XkbBindingV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_binding_v1);
                _proxy.marshal(3, null);
            }
            pub const disable_since_version = 1;
        };

        /// This object manages xkb bindings state associated with a specific seat.
        pub const XkbBindingsSeatV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_bindings_seat_v1.interface;
            pub inline fn getId(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_seat_v1)).getId();
            }
            pub inline fn getVersion(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_seat_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_bindings_seat_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_bindings_seat_v1: *XkbBindingsSeatV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_seat_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const ate_unbound_key_since_version = 2;

                /// An unbound key press event was eaten due to the ensure_next_key_eaten
                /// request.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                ate_unbound_key: void,
            };
            pub inline fn setListener(
                _xkb_bindings_seat_v1: *XkbBindingsSeatV1,
                comptime T: type,
                _listener: *const fn (xkb_bindings_seat_v1: *XkbBindingsSeatV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_seat_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(XkbBindingsSeatV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the object and
            /// that it may be safely destroyed.
            pub fn destroy(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_seat_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 2;

            /// Ensure that the next non-modifier key press and corresponding release
            /// events for this seat are not sent to the currently focused surface.
            ///
            /// If the next non-modifier key press triggers a binding, the
            /// pressed/released events are sent to the river_xkb_binding_v1 object as
            /// usual.
            ///
            /// If the next non-modifier key press does not trigger a binding, the
            /// ate_unbound_key event is sent instead.
            ///
            /// Rationale: the window manager may wish to implement "chorded"
            /// keybindings where triggering a binding activates a "submap" with a
            /// different set of keybindings. Without a way to eat the next key
            /// press event, there is no good way for the window manager to know that it
            /// should error out and exit the submap when a key not bound in the submap
            /// is pressed.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn ensureNextKeyEaten(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_seat_v1);
                _proxy.marshal(1, null);
            }
            pub const ensure_next_key_eaten_since_version = 2;

            /// This requests cancels the effect of the latest ensure_next_key_eaten
            /// request if no key has been eaten due to the request yet. This request
            /// has no effect if a key has already been eaten or no
            /// ensure_next_key_eaten was made.
            ///
            /// Rationale: the window manager may wish cancel an uncompleted "chorded"
            /// keybinding after a timeout of a few seconds. Note that since this
            /// timeout use-case requires the window manager to trigger a manage sequence
            /// with the river_window_manager_v1.manage_dirty request it is possible that
            /// the ate_unbound_key key event may be sent before the window manager has
            /// a chance to make the cancel_ensure_next_key_eaten request.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn cancelEnsureNextKeyEaten(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_bindings_seat_v1);
                _proxy.marshal(2, null);
            }
            pub const cancel_ensure_next_key_eaten_since_version = 2;
        };

        /// This global interface should only be advertised to the client if the
        /// river_window_manager_v1 global is also advertised. Binding this interface
        /// indicates that the window manager supports layer shell.
        ///
        /// If the window manager does not bind this interface, the compositor should
        /// not allow clients to map layer surfaces. This can be achieved by
        /// closing layer surfaces immediately.
        pub const LayerShellV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_v1.interface;
            pub const Error = common.river.layer_shell_v1.Error;
            pub inline fn getId(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getVersion();
            }
            pub inline fn getUserData(_layer_shell_v1: *LayerShellV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getUserData();
            }
            pub inline fn setQueue(_layer_shell_v1: *LayerShellV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the
            /// river_layer_shell_v1 object.
            pub fn destroy(_layer_shell_v1: *LayerShellV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// It is a protocol error to make this request more than once for a given
            /// river_output_v1 object.
            pub fn getOutput(_layer_shell_v1: *LayerShellV1, _output: *client.river.OutputV1) !*client.river.LayerShellOutputV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_output) },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.river.LayerShellOutputV1.interface));
            }
            pub const get_output_since_version = 1;

            /// It is a protocol error to make this request more than once for a given
            /// river_seat_v1 object.
            pub fn getSeat(_layer_shell_v1: *LayerShellV1, _seat: *client.river.SeatV1) !*client.river.LayerShellSeatV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_seat) },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.LayerShellSeatV1.interface));
            }
            pub const get_seat_since_version = 1;
        };

        /// The lifetime of this object is tied to the corresponding river_output_v1.
        /// This object is made inert when the river_output_v1.removed event is sent
        /// and should be destroyed.
        pub const LayerShellOutputV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_output_v1.interface;
            pub inline fn getId(_layer_shell_output_v1: *LayerShellOutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_output_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_output_v1: *LayerShellOutputV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_output_v1)).getVersion();
            }
            pub inline fn getUserData(_layer_shell_output_v1: *LayerShellOutputV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_output_v1)).getUserData();
            }
            pub inline fn setQueue(_layer_shell_output_v1: *LayerShellOutputV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_output_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const non_exclusive_area_since_version = 1;

                /// This event indicates the area of the output remaining after subtracting
                /// the exclusive zones of layer surfaces. Exclusive zones are a hint, the
                /// window manager is free to ignore this area hint if it wishes.
                ///
                /// The x and y values are in the global coordinate space, not relative to
                /// the position of the output.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                non_exclusive_area: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },
            };
            pub inline fn setListener(
                _layer_shell_output_v1: *LayerShellOutputV1,
                comptime T: type,
                _listener: *const fn (layer_shell_output_v1: *LayerShellOutputV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_output_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LayerShellOutputV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the
            /// river_layer_shell_output_v1 object and that it may be safely destroyed.
            ///
            /// This request should be made after the river_output_v1.removed event is
            /// received to complete destruction of the output.
            pub fn destroy(_layer_shell_output_v1: *LayerShellOutputV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_output_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Mark this output as the default for new layer surfaces which do not
            /// request a specific output themselves. This request overrides any
            /// previous set_default request on any river_layer_shell_output_v1 object.
            ///
            /// If no set_default request is made or if the default output is destroyed,
            /// the default output is undefined until the next set_default request.
            ///
            /// This request modifies window management state and may only be made as
            /// part of a manage sequence, see the river_window_manager_v1 description.
            pub fn setDefault(_layer_shell_output_v1: *LayerShellOutputV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_output_v1);
                _proxy.marshal(1, null);
            }
            pub const set_default_since_version = 1;
        };

        /// The lifetime of this object is tied to the corresponding river_seat_v1.
        /// This object is made inert when the river_seat_v1.removed event is sent and
        /// should be destroyed.
        pub const LayerShellSeatV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_seat_v1.interface;
            pub inline fn getId(_layer_shell_seat_v1: *LayerShellSeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_seat_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_seat_v1: *LayerShellSeatV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_seat_v1)).getVersion();
            }
            pub inline fn getUserData(_layer_shell_seat_v1: *LayerShellSeatV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_seat_v1)).getUserData();
            }
            pub inline fn setQueue(_layer_shell_seat_v1: *LayerShellSeatV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_seat_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const focus_exclusive_since_version = 1;
                pub const focus_non_exclusive_since_version = 1;
                pub const focus_none_since_version = 1;

                /// A layer shell surface will be given exclusive keyboard focus at the end
                /// of the manage sequence in which this event is sent. The window manager
                /// may want to update window decorations or similar to indicate that no
                /// window is focused.
                ///
                /// Until the focus_non_exclusive or focus_none event is sent, all window
                /// manager requests to change focus are ignored.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                focus_exclusive: void,
                /// A layer shell surface will be given non-exclusive keyboard focus at the
                /// end of the manage sequence in which this event is sent. The window
                /// manager may want to update window decorations or similar to indicate
                /// that no window is focused.
                ///
                /// The window manager continues to control focus and may choose to focus a
                /// different window/shell surface at any time. If the window manager sets
                /// focus during the same manage sequence in which this event is sent, the
                /// layer surface will not be focused.
                ///
                /// If the layer surface with non-exclusive focus is closed or the window
                /// manager chooses to move focus away from the layer surface, a focus_none
                /// event will be sent in the next manage sequence.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                focus_non_exclusive: void,
                /// No layer shell surface will have keyboard focus at the end of the manage
                /// sequence in which this event is sent. The window manager may want to
                /// return focus to whichever window last had focus, for example.
                ///
                /// This event will be followed by a manage_start event after all other new
                /// state has been sent by the server.
                focus_none: void,
            };
            pub inline fn setListener(
                _layer_shell_seat_v1: *LayerShellSeatV1,
                comptime T: type,
                _listener: *const fn (layer_shell_seat_v1: *LayerShellSeatV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_seat_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LayerShellSeatV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the
            /// river_layer_shell_seat_v1 object and that it may be safely destroyed.
            ///
            /// This request should be made after the river_seat_v1.removed event is
            /// received to complete destruction of the seat.
            pub fn destroy(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_seat_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// Input manager global interface.
        pub const InputManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.input_manager_v1.interface;
            pub const Error = common.river.input_manager_v1.Error;
            pub inline fn getId(_input_manager_v1: *InputManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_input_manager_v1)).getId();
            }
            pub inline fn getVersion(_input_manager_v1: *InputManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_input_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_input_manager_v1: *InputManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_input_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_input_manager_v1: *InputManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const finished_since_version = 1;
                pub const input_device_since_version = 1;

                /// This event indicates that the server will send no further events on this
                /// object. The client should destroy the object. See
                /// river_input_manager_v1.destroy for more information.
                finished: void,
                /// A new input device has been created.
                input_device: struct {
                    id: *client.river.InputDeviceV1,
                },
            };
            pub inline fn setListener(
                _input_manager_v1: *InputManagerV1,
                comptime T: type,
                _listener: *const fn (input_manager_v1: *InputManagerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(InputManagerV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client no longer wishes to receive
            /// events on this object.
            ///
            /// The Wayland protocol is asynchronous, which means the server may send
            /// further events until the stop request is processed. The client must wait
            /// for a river_input_manager_v1.finished event before destroying this
            /// object.
            pub fn stop(_input_manager_v1: *InputManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                _proxy.marshal(0, null);
            }
            pub const stop_since_version = 1;

            /// This request should be called after the finished event has been received
            /// to complete destruction of the object.
            ///
            /// It is a protocol error to make this request before the finished event
            /// has been received.
            ///
            /// If a client wishes to destroy this object it should send a
            /// river_input_manager_v1.stop request and wait for a
            /// river_input_manager_v1.finished event. Once the finished event is
            /// received it is safe to destroy this object and any other objects created
            /// through this interface.
            pub fn destroy(_input_manager_v1: *InputManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Create a new seat with the given name. Has no effect if a seat with the
            /// given name already exists.
            ///
            /// The default seat with name "default" always exists and does not need to
            /// be explicitly created.
            pub fn createSeat(_input_manager_v1: *InputManagerV1, _name: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _proxy.marshal(2, &_args);
            }
            pub const create_seat_since_version = 1;

            /// Destroy the seat with the given name. Has no effect if a seat with the
            /// given name does not exist.
            ///
            /// The default seat with name "default" cannot be destroyed and attempting
            /// to destroy it will have no effect.
            ///
            /// Any input devices assigned to the destroyed seat at the time of
            /// destruction are assigned to the default seat.
            pub fn destroySeat(_input_manager_v1: *InputManagerV1, _name: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_manager_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _proxy.marshal(3, &_args);
            }
            pub const destroy_seat_since_version = 1;
        };

        /// An input device represents a physical keyboard, mouse, touchscreen, or
        /// drawing tablet tool. It is assigned to exactly one seat at a time.
        /// By default, all input devices are assigned to the default seat.
        pub const InputDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.input_device_v1.interface;
            pub const Error = common.river.input_device_v1.Error;
            pub const Type = common.river.input_device_v1.Type;
            pub inline fn getId(_input_device_v1: *InputDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_input_device_v1)).getId();
            }
            pub inline fn getVersion(_input_device_v1: *InputDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_input_device_v1)).getVersion();
            }
            pub inline fn getUserData(_input_device_v1: *InputDeviceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_input_device_v1)).getUserData();
            }
            pub inline fn setQueue(_input_device_v1: *InputDeviceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const removed_since_version = 1;
                pub const type_since_version = 1;
                pub const name_since_version = 1;

                /// This event indicates that the input device has been removed.
                ///
                /// The server will send no further events on this object and ignore any
                /// request (other than river_input_device_v1.destroy) made after this event is
                /// sent. The client should destroy this object with the
                /// river_input_device_v1.destroy request to free up resources.
                removed: void,
                /// The type of the input device. This event is sent once when the
                /// river_input_device_v1 object is created. The device type cannot
                /// change during the lifetime of the object.
                type: struct {
                    type: Type,
                },

                /// The name of the input device. This event is sent once when the
                /// river_input_device_v1 object is created. The device name cannot
                /// change during the lifetime of the object.
                name: struct {
                    name: [*:0]const u8,
                },
            };
            pub inline fn setListener(
                _input_device_v1: *InputDeviceV1,
                comptime T: type,
                _listener: *const fn (input_device_v1: *InputDeviceV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(InputDeviceV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the input
            /// device object and that it may be safely destroyed.
            pub fn destroy(_input_device_v1: *InputDeviceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Assign the input device to a seat. All input devices not explicitly
            /// assigned to a seat are considered assigned to the default seat.
            ///
            /// Has no effect if a seat with the given name does not exist.
            pub fn assignToSeat(_input_device_v1: *InputDeviceV1, _name: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _proxy.marshal(1, &_args);
            }
            pub const assign_to_seat_since_version = 1;

            /// Set repeat rate and delay for a keyboard input device. Has no effect if
            /// the device is not a keyboard.
            ///
            /// Negative values for either rate or delay are illegal. A rate of zero
            /// will disable any repeating (regardless of the value of delay).
            pub fn setRepeatInfo(_input_device_v1: *InputDeviceV1, _rate: i32, _delay: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _rate },
                    .{ .i = _delay },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_repeat_info_since_version = 1;

            /// Set the scroll factor for a pointer input device. Has no effect if the
            /// device is not a pointer.
            ///
            /// For example, a factor of 0.5 will make scrolling twice as slow while a
            /// factor of 3.0 will make scrolling 3 times as fast.
            ///
            /// Setting a scroll factor less than 0 is a protocol error.
            pub fn setScrollFactor(_input_device_v1: *InputDeviceV1, _factor: common.Fixed) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .f = _factor },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_scroll_factor_since_version = 1;

            /// Map the input device to the given output. Has no effect if the device is
            /// not a pointer, touch, or tablet device.
            ///
            /// If mapped to both an output and a rectangle, the rectangle has priority.
            ///
            /// Passing null clears an existing mapping.
            pub fn mapToOutput(_input_device_v1: *InputDeviceV1, _output: ?*client.wl.Output) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _proxy.marshal(4, &_args);
            }
            pub const map_to_output_since_version = 1;

            /// Map the input device to the given rectangle in the global compositor
            /// coordinate space. Has no effect if the device is not a pointer, touch,
            /// or tablet device.
            ///
            /// If mapped to both an output and a rectangle, the rectangle has priority.
            ///
            /// Width and height must be greater than or equal to 0.
            ///
            /// Passing 0 for width or height clears an existing mapping.
            pub fn mapToRectangle(_input_device_v1: *InputDeviceV1, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _proxy.marshal(5, &_args);
            }
            pub const map_to_rectangle_since_version = 1;
        };

        /// Global interface for configuring libinput devices. This global should
        /// only be advertised if river_input_manager_v1 is advertised as well.
        pub const LibinputConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_config_v1.interface;
            pub const Error = common.river.libinput_config_v1.Error;
            pub inline fn getId(_libinput_config_v1: *LibinputConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_config_v1)).getId();
            }
            pub inline fn getVersion(_libinput_config_v1: *LibinputConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_config_v1)).getVersion();
            }
            pub inline fn getUserData(_libinput_config_v1: *LibinputConfigV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_config_v1)).getUserData();
            }
            pub inline fn setQueue(_libinput_config_v1: *LibinputConfigV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_config_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const finished_since_version = 1;
                pub const libinput_device_since_version = 1;

                /// This event indicates that the server will send no further events on this
                /// object. The client should destroy the object. See
                /// river_libinput_config_v1.destroy for more information.
                finished: void,
                /// A new libinput device has been created. Not every river_input_device_v1
                /// is necessarily a libinput device as well.
                libinput_device: struct {
                    id: *client.river.LibinputDeviceV1,
                },
            };
            pub inline fn setListener(
                _libinput_config_v1: *LibinputConfigV1,
                comptime T: type,
                _listener: *const fn (libinput_config_v1: *LibinputConfigV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_config_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LibinputConfigV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client no longer wishes to receive
            /// events on this object.
            ///
            /// The Wayland protocol is asynchronous, which means the server may send
            /// further events until the stop request is processed. The client must wait
            /// for a river_libinput_config_v1.finished event before destroying this
            /// object.
            pub fn stop(_libinput_config_v1: *LibinputConfigV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_config_v1);
                _proxy.marshal(0, null);
            }
            pub const stop_since_version = 1;

            /// This request should be called after the finished event has been received
            /// to complete destruction of the object.
            ///
            /// It is a protocol error to make this request before the finished event
            /// has been received.
            ///
            /// If a client wishes to destroy this object it should send a
            /// river_libinput_config_v1.stop request and wait for a
            /// river_libinput_config_v1.finished event. Once the finished event is
            /// received it is safe to destroy this object and any other objects created
            /// through this interface.
            pub fn destroy(_libinput_config_v1: *LibinputConfigV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_config_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Create a acceleration config which can be applied
            /// with river_libinput_device_v1.apply_accel_config.
            pub fn createAccelConfig(_libinput_config_v1: *LibinputConfigV1, _profile: common.river.libinput_device_v1.AccelProfile) !*client.river.LibinputAccelConfigV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_config_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(common.river.libinput_device_v1.AccelProfile)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_profile))),
                        .@"struct" => @bitCast(_profile),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.LibinputAccelConfigV1.interface));
            }
            pub const create_accel_config_since_version = 1;
        };

        /// The result returned by libinput on setting configuration for a device.
        pub const LibinputAccelConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_accel_config_v1.interface;
            pub const Error = common.river.libinput_accel_config_v1.Error;
            pub const AccelType = common.river.libinput_accel_config_v1.AccelType;
            pub inline fn getId(_libinput_accel_config_v1: *LibinputAccelConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_accel_config_v1)).getId();
            }
            pub inline fn getVersion(_libinput_accel_config_v1: *LibinputAccelConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_accel_config_v1)).getVersion();
            }
            pub inline fn getUserData(_libinput_accel_config_v1: *LibinputAccelConfigV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_accel_config_v1)).getUserData();
            }
            pub inline fn setQueue(_libinput_accel_config_v1: *LibinputAccelConfigV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_accel_config_v1);
                _proxy.setQueue(_queue);
            }
            /// This request indicates that the client will no longer use the accel
            /// config object and that it may be safely destroyed.
            pub fn destroy(_libinput_accel_config_v1: *LibinputAccelConfigV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_accel_config_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Defines the acceleration function for a given movement type
            /// in an acceleration configuration with custom accel profile.
            pub fn setPoints(_libinput_accel_config_v1: *LibinputAccelConfigV1, _type: AccelType, _step: *common.Array, _points: *common.Array) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_accel_config_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(AccelType)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_type))),
                        .@"struct" => @bitCast(_type),
                        else => unreachable,
                    } },
                    .{ .a = _step },
                    .{ .a = _points },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_points_since_version = 1;
        };

        /// The result returned by libinput on setting configuration for a device.
        pub const LibinputResultV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_result_v1.interface;
            pub inline fn getId(_libinput_result_v1: *LibinputResultV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_result_v1)).getId();
            }
            pub inline fn getVersion(_libinput_result_v1: *LibinputResultV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_result_v1)).getVersion();
            }
            pub inline fn getUserData(_libinput_result_v1: *LibinputResultV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_result_v1)).getUserData();
            }
            pub inline fn setQueue(_libinput_result_v1: *LibinputResultV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_result_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const success_since_version = 1;
                pub const unsupported_since_version = 1;
                pub const invalid_since_version = 1;

                /// The configuration was successfully applied to the device.
                success: void,
                /// The configuration is unsupported by the device and was ignored.
                unsupported: void,
                /// The configuration is invalid and was ignored.
                invalid: void,
            };
            pub inline fn setListener(
                _libinput_result_v1: *LibinputResultV1,
                comptime T: type,
                _listener: *const fn (libinput_result_v1: *LibinputResultV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_result_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LibinputResultV1, T).dispatcher, _listener, _mut_data);
            }
            pub inline fn destroy(_libinput_result_v1: *LibinputResultV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_result_v1);
                _proxy.destroy();
            }
        };

        /// In general, *_support events will be sent exactly once directly after the
        /// river_libinput_device_v1 is created. *_default events will be sent after
        /// *_support events if the config option is supported, and *_current events
        /// willl be sent after the *_default events and again whenever the config
        /// option is changed.
        pub const LibinputDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_device_v1.interface;
            pub const Error = common.river.libinput_device_v1.Error;
            pub const SendEventsModes = common.river.libinput_device_v1.SendEventsModes;
            pub const TapState = common.river.libinput_device_v1.TapState;
            pub const TapButtonMap = common.river.libinput_device_v1.TapButtonMap;
            pub const DragState = common.river.libinput_device_v1.DragState;
            pub const DragLockState = common.river.libinput_device_v1.DragLockState;
            pub const ThreeFingerDragState = common.river.libinput_device_v1.ThreeFingerDragState;
            pub const AccelProfile = common.river.libinput_device_v1.AccelProfile;
            pub const AccelProfiles = common.river.libinput_device_v1.AccelProfiles;
            pub const NaturalScrollState = common.river.libinput_device_v1.NaturalScrollState;
            pub const LeftHandedState = common.river.libinput_device_v1.LeftHandedState;
            pub const ClickMethod = common.river.libinput_device_v1.ClickMethod;
            pub const ClickMethods = common.river.libinput_device_v1.ClickMethods;
            pub const ClickfingerButtonMap = common.river.libinput_device_v1.ClickfingerButtonMap;
            pub const MiddleEmulationState = common.river.libinput_device_v1.MiddleEmulationState;
            pub const ScrollMethod = common.river.libinput_device_v1.ScrollMethod;
            pub const ScrollMethods = common.river.libinput_device_v1.ScrollMethods;
            pub const ScrollButtonLockState = common.river.libinput_device_v1.ScrollButtonLockState;
            pub const DwtState = common.river.libinput_device_v1.DwtState;
            pub const DwtpState = common.river.libinput_device_v1.DwtpState;
            pub inline fn getId(_libinput_device_v1: *LibinputDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_device_v1)).getId();
            }
            pub inline fn getVersion(_libinput_device_v1: *LibinputDeviceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_device_v1)).getVersion();
            }
            pub inline fn getUserData(_libinput_device_v1: *LibinputDeviceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_libinput_device_v1)).getUserData();
            }
            pub inline fn setQueue(_libinput_device_v1: *LibinputDeviceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const removed_since_version = 1;
                pub const input_device_since_version = 1;
                pub const send_events_support_since_version = 1;
                pub const send_events_default_since_version = 1;
                pub const send_events_current_since_version = 1;
                pub const tap_support_since_version = 1;
                pub const tap_default_since_version = 1;
                pub const tap_current_since_version = 1;
                pub const tap_button_map_default_since_version = 1;
                pub const tap_button_map_current_since_version = 1;
                pub const drag_default_since_version = 1;
                pub const drag_current_since_version = 1;
                pub const drag_lock_default_since_version = 1;
                pub const drag_lock_current_since_version = 1;
                pub const three_finger_drag_support_since_version = 1;
                pub const three_finger_drag_default_since_version = 1;
                pub const three_finger_drag_current_since_version = 1;
                pub const calibration_matrix_support_since_version = 1;
                pub const calibration_matrix_default_since_version = 1;
                pub const calibration_matrix_current_since_version = 1;
                pub const accel_profiles_support_since_version = 1;
                pub const accel_profile_default_since_version = 1;
                pub const accel_profile_current_since_version = 1;
                pub const accel_speed_default_since_version = 1;
                pub const accel_speed_current_since_version = 1;
                pub const natural_scroll_support_since_version = 1;
                pub const natural_scroll_default_since_version = 1;
                pub const natural_scroll_current_since_version = 1;
                pub const left_handed_support_since_version = 1;
                pub const left_handed_default_since_version = 1;
                pub const left_handed_current_since_version = 1;
                pub const click_method_support_since_version = 1;
                pub const click_method_default_since_version = 1;
                pub const click_method_current_since_version = 1;
                pub const clickfinger_button_map_default_since_version = 1;
                pub const clickfinger_button_map_current_since_version = 1;
                pub const middle_emulation_support_since_version = 1;
                pub const middle_emulation_default_since_version = 1;
                pub const middle_emulation_current_since_version = 1;
                pub const scroll_method_support_since_version = 1;
                pub const scroll_method_default_since_version = 1;
                pub const scroll_method_current_since_version = 1;
                pub const scroll_button_default_since_version = 1;
                pub const scroll_button_current_since_version = 1;
                pub const scroll_button_lock_default_since_version = 1;
                pub const scroll_button_lock_current_since_version = 1;
                pub const dwt_support_since_version = 1;
                pub const dwt_default_since_version = 1;
                pub const dwt_current_since_version = 1;
                pub const dwtp_support_since_version = 1;
                pub const dwtp_default_since_version = 1;
                pub const dwtp_current_since_version = 1;
                pub const rotation_support_since_version = 1;
                pub const rotation_default_since_version = 1;
                pub const rotation_current_since_version = 1;

                /// This event indicates that the libinput device has been removed.
                ///
                /// The server will send no further events on this object and ignore any
                /// request (other than river_libinput_device_v1.destroy) made after this
                /// event is sent. The client should destroy this object with the
                /// river_libinput_device_v1.destroy request to free up resources.
                removed: void,
                /// The river_input_device_v1 corresponding to this libinput device.
                /// This event will always be the first event sent on the
                /// river_libinput_device_v1 object, and it will be sent exactly once.
                input_device: struct {
                    device: ?*client.river.InputDeviceV1,
                },

                /// Supported send events modes.
                send_events_support: struct {
                    modes: SendEventsModes,
                },

                /// Default send events mode.
                send_events_default: struct {
                    mode: SendEventsModes,
                },

                /// Current send events mode.
                send_events_current: struct {
                    mode: SendEventsModes,
                },

                /// The number of fingers supported for tap-to-click/drag.
                /// If finger_count is 0, tap-to-click and drag are unsupported.
                tap_support: struct {
                    finger_count: i32,
                },

                /// Default tap-to-click state.
                tap_default: struct {
                    state: TapState,
                },

                /// Current tap-to-click state.
                tap_current: struct {
                    state: TapState,
                },

                /// Default tap-to-click button map.
                tap_button_map_default: struct {
                    button_map: TapButtonMap,
                },

                /// Current tap-to-click button map.
                tap_button_map_current: struct {
                    button_map: TapButtonMap,
                },

                /// Default tap-and-drag state.
                drag_default: struct {
                    state: DragState,
                },

                /// Current tap-and-drag state.
                drag_current: struct {
                    state: DragState,
                },

                /// Default drag lock state.
                drag_lock_default: struct {
                    state: DragLockState,
                },

                /// Current drag lock state.
                drag_lock_current: struct {
                    state: DragLockState,
                },

                /// The number of fingers supported for three/four finger drag.
                /// If finger_count is less than 3, three finger drag is unsupported.
                three_finger_drag_support: struct {
                    finger_count: i32,
                },

                /// Default three finger drag state.
                three_finger_drag_default: struct {
                    state: ThreeFingerDragState,
                },

                /// Current three finger drag state.
                three_finger_drag_current: struct {
                    state: ThreeFingerDragState,
                },

                /// A calibration matrix is supported if the supported argument is non-zero.
                calibration_matrix_support: struct {
                    supported: i32,
                },

                /// Default calibration matrix.
                calibration_matrix_default: struct {
                    matrix: *common.Array,
                },

                /// Current calibration matrix.
                calibration_matrix_current: struct {
                    matrix: *common.Array,
                },

                /// Supported acceleration profiles.
                accel_profiles_support: struct {
                    profiles: AccelProfiles,
                },

                /// Default acceleration profile.
                accel_profile_default: struct {
                    profile: AccelProfile,
                },

                /// Current acceleration profile.
                accel_profile_current: struct {
                    profile: AccelProfile,
                },

                /// Default acceleration speed.
                accel_speed_default: struct {
                    speed: *common.Array,
                },

                /// Current acceleration speed.
                accel_speed_current: struct {
                    speed: *common.Array,
                },

                /// Natural scroll is supported if the supported argument is non-zero.
                natural_scroll_support: struct {
                    supported: i32,
                },

                /// Default natural scroll.
                natural_scroll_default: struct {
                    state: NaturalScrollState,
                },

                /// Current natural scroll.
                natural_scroll_current: struct {
                    state: NaturalScrollState,
                },

                /// Left-handed mode is supported if the supported argument is non-zero.
                left_handed_support: struct {
                    supported: i32,
                },

                /// Default left-handed mode.
                left_handed_default: struct {
                    state: LeftHandedState,
                },

                /// Current left-handed mode.
                left_handed_current: struct {
                    state: LeftHandedState,
                },

                /// The click methods supported by the device.
                click_method_support: struct {
                    methods: ClickMethods,
                },

                /// Default click method.
                click_method_default: struct {
                    method: ClickMethod,
                },

                /// Current click method.
                click_method_current: struct {
                    method: ClickMethod,
                },

                /// Default clickfinger button map.
                /// Supported if click_methods.clickfinger is supported.
                clickfinger_button_map_default: struct {
                    button_map: ClickfingerButtonMap,
                },

                /// Current clickfinger button map.
                /// Supported if click_methods.clickfinger is supported.
                clickfinger_button_map_current: struct {
                    button_map: ClickfingerButtonMap,
                },

                /// Middle mouse button emulation is supported if the supported argument is
                /// non-zero.
                middle_emulation_support: struct {
                    supported: i32,
                },

                /// Default middle mouse button emulation.
                middle_emulation_default: struct {
                    state: MiddleEmulationState,
                },

                /// Current middle mouse button emulation.
                middle_emulation_current: struct {
                    state: MiddleEmulationState,
                },

                /// The scroll methods supported by the device.
                scroll_method_support: struct {
                    methods: ScrollMethods,
                },

                /// Default scroll method.
                scroll_method_default: struct {
                    method: ScrollMethod,
                },

                /// Current scroll method.
                scroll_method_current: struct {
                    method: ScrollMethod,
                },

                /// Default scroll button.
                /// Supported if scroll_methods.on_button_down is supported.
                scroll_button_default: struct {
                    button: u32,
                },

                /// Current scroll button.
                /// Supported if scroll_methods.on_button_down is supported.
                scroll_button_current: struct {
                    button: u32,
                },

                /// Default scroll button lock state.
                /// Supported if scroll_methods.on_button_down is supported.
                scroll_button_lock_default: struct {
                    state: ScrollButtonLockState,
                },

                /// Current scroll button lock state.
                /// Supported if scroll_methods.on_button_down is supported.
                scroll_button_lock_current: struct {
                    state: ScrollButtonLockState,
                },

                /// Disable-while-typing is supported if the supported argument is
                /// non-zero.
                dwt_support: struct {
                    supported: i32,
                },

                /// Default disable-while-typing state.
                dwt_default: struct {
                    state: DwtState,
                },

                /// Current disable-while-typing state.
                dwt_current: struct {
                    state: DwtState,
                },

                /// Disable-while-trackpointing is supported if the supported argument is
                /// non-zero.
                dwtp_support: struct {
                    supported: i32,
                },

                /// Default disable-while-trackpointing state.
                dwtp_default: struct {
                    state: DwtpState,
                },

                /// Current disable-while-trackpointing state.
                dwtp_current: struct {
                    state: DwtpState,
                },

                /// Rotation is supported if the supported argument is non-zero.
                rotation_support: struct {
                    supported: i32,
                },

                /// Default rotation angle.
                rotation_default: struct {
                    angle: u32,
                },

                /// Current rotation angle.
                rotation_current: struct {
                    angle: u32,
                },
            };
            pub inline fn setListener(
                _libinput_device_v1: *LibinputDeviceV1,
                comptime T: type,
                _listener: *const fn (libinput_device_v1: *LibinputDeviceV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LibinputDeviceV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the input
            /// device object and that it may be safely destroyed.
            pub fn destroy(_libinput_device_v1: *LibinputDeviceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the send events mode for the device.
            pub fn setSendEvents(_libinput_device_v1: *LibinputDeviceV1, _mode: SendEventsModes) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(SendEventsModes)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(1, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_send_events_since_version = 1;

            /// Configure tap-to-click on this device, with a default mapping of
            /// 1, 2, 3 finger tap mapping to left, right, middle click, respectively.
            pub fn setTap(_libinput_device_v1: *LibinputDeviceV1, _state: TapState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(TapState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_tap_since_version = 1;

            /// Set the finger number to button number mapping for tap-to-click. The
            /// default mapping on most devices is to have a 1, 2 and 3 finger tap to
            /// map to the left, right and middle button, respectively.
            pub fn setTapButtonMap(_libinput_device_v1: *LibinputDeviceV1, _button_map: TapButtonMap) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(TapButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(3, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_tap_button_map_since_version = 1;

            /// Configure tap-and-drag functionality on the device.
            pub fn setDrag(_libinput_device_v1: *LibinputDeviceV1, _state: DragState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(DragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(4, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_drag_since_version = 1;

            /// Configure drag-lock during tapping on this device. When enabled, a
            /// finger may be lifted and put back on the touchpad and the drag process
            /// continues. A timeout for lifting the finger is optional. When disabled,
            /// lifting the finger during a tap-and-drag will immediately stop the drag.
            /// See the libinput documentation for more details.
            pub fn setDragLock(_libinput_device_v1: *LibinputDeviceV1, _state: DragLockState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(DragLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(5, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_drag_lock_since_version = 1;

            /// Configure three finger drag functionality for the device.
            pub fn setThreeFingerDrag(_libinput_device_v1: *LibinputDeviceV1, _state: ThreeFingerDragState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(ThreeFingerDragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(6, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_three_finger_drag_since_version = 1;

            /// Set calibration matrix.
            pub fn setCalibrationMatrix(_libinput_device_v1: *LibinputDeviceV1, _matrix: *common.Array) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .a = _matrix },
                };
                return @ptrCast(try _proxy.marshalConstructor(7, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_calibration_matrix_since_version = 1;

            /// Set the acceleration profile.
            pub fn setAccelProfile(_libinput_device_v1: *LibinputDeviceV1, _profile: AccelProfile) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(AccelProfile)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_profile))),
                        .@"struct" => @bitCast(_profile),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(8, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_accel_profile_since_version = 1;

            /// Set the acceleration speed within a range of [-1, 1], where 0 is
            /// the default acceleration for this device, -1 is the slowest acceleration
            /// and 1 is the maximum acceleration available on this device.
            pub fn setAccelSpeed(_libinput_device_v1: *LibinputDeviceV1, _speed: *common.Array) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .a = _speed },
                };
                return @ptrCast(try _proxy.marshalConstructor(9, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_accel_speed_since_version = 1;

            /// Apply a pointer accleration config.
            pub fn applyAccelConfig(_libinput_device_v1: *LibinputDeviceV1, _config: *client.river.LibinputAccelConfigV1) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_config) },
                };
                return @ptrCast(try _proxy.marshalConstructor(10, &_args, client.river.LibinputResultV1.interface));
            }
            pub const apply_accel_config_since_version = 1;

            /// Set natural scroll state.
            pub fn setNaturalScroll(_libinput_device_v1: *LibinputDeviceV1, _state: NaturalScrollState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(NaturalScrollState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(11, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_natural_scroll_since_version = 1;

            /// Set left-handed mode state.
            pub fn setLeftHanded(_libinput_device_v1: *LibinputDeviceV1, _state: LeftHandedState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(LeftHandedState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(12, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_left_handed_since_version = 1;

            /// Set click method.
            pub fn setClickMethod(_libinput_device_v1: *LibinputDeviceV1, _method: ClickMethod) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(ClickMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(13, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_click_method_since_version = 1;

            /// Set clickfinger button map.
            /// Supported if click_methods.clickfinger is supported.
            pub fn setClickfingerButtonMap(_libinput_device_v1: *LibinputDeviceV1, _button_map: ClickfingerButtonMap) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(ClickfingerButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(14, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_clickfinger_button_map_since_version = 1;

            /// Set middle mouse button emulation state.
            pub fn setMiddleEmulation(_libinput_device_v1: *LibinputDeviceV1, _state: MiddleEmulationState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(MiddleEmulationState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(15, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_middle_emulation_since_version = 1;

            /// Set scroll method.
            pub fn setScrollMethod(_libinput_device_v1: *LibinputDeviceV1, _method: ScrollMethod) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(ScrollMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(16, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_scroll_method_since_version = 1;

            /// Set scroll button.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn setScrollButton(_libinput_device_v1: *LibinputDeviceV1, _button: u32) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = _button },
                };
                return @ptrCast(try _proxy.marshalConstructor(17, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_scroll_button_since_version = 1;

            /// Set scroll button lock state.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn setScrollButtonLock(_libinput_device_v1: *LibinputDeviceV1, _state: ScrollButtonLockState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(ScrollButtonLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(18, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_scroll_button_lock_since_version = 1;

            /// Set disable-while-typing state.
            pub fn setDwt(_libinput_device_v1: *LibinputDeviceV1, _state: DwtState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(DwtState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(19, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_dwt_since_version = 1;

            /// Set disable-while-trackpointing state.
            pub fn setDwtp(_libinput_device_v1: *LibinputDeviceV1, _state: DwtpState) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = switch (@typeInfo(DwtpState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(20, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_dwtp_since_version = 1;

            /// Set rotation angle in degrees clockwise off the logical neutral
            /// position. Angle must be in the range [0-360).
            pub fn setRotation(_libinput_device_v1: *LibinputDeviceV1, _angle: u32) !*client.river.LibinputResultV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .u = _angle },
                };
                return @ptrCast(try _proxy.marshalConstructor(21, &_args, client.river.LibinputResultV1.interface));
            }
            pub const set_rotation_since_version = 1;
        };

        /// Global interface for configuring xkb devices.
        ///
        /// This global should only be advertised if river_input_manager_v1 is
        /// advertised as well.
        pub const XkbConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_config_v1.interface;
            pub const Error = common.river.xkb_config_v1.Error;
            pub const KeymapFormat = common.river.xkb_config_v1.KeymapFormat;
            pub inline fn getId(_xkb_config_v1: *XkbConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_config_v1)).getId();
            }
            pub inline fn getVersion(_xkb_config_v1: *XkbConfigV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_config_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_config_v1: *XkbConfigV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_config_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_config_v1: *XkbConfigV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_config_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const finished_since_version = 1;
                pub const xkb_keyboard_since_version = 1;

                /// This event indicates that the server will send no further events on this
                /// object. The client should destroy the object. See
                /// river_xkb_config_v1.destroy for more information.
                finished: void,
                /// A new xkbcommon keyboard has been created. Not every
                /// river_input_device_v1 is necessarily an xkbcommon keyboard as well.
                xkb_keyboard: struct {
                    id: *client.river.XkbKeyboardV1,
                },
            };
            pub inline fn setListener(
                _xkb_config_v1: *XkbConfigV1,
                comptime T: type,
                _listener: *const fn (xkb_config_v1: *XkbConfigV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_config_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(XkbConfigV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client no longer wishes to receive
            /// events on this object.
            ///
            /// The Wayland protocol is asynchronous, which means the server may send
            /// further events until the stop request is processed. The client must wait
            /// for a river_xkb_config_v1.finished event before destroying this object.
            pub fn stop(_xkb_config_v1: *XkbConfigV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_config_v1);
                _proxy.marshal(0, null);
            }
            pub const stop_since_version = 1;

            /// This request should be called after the finished event has been received
            /// to complete destruction of the object.
            ///
            /// It is a protocol error to make this request before the finished event
            /// has been received.
            ///
            /// If a client wishes to destroy this object it should send a
            /// river_xkb_config_v1.stop request and wait for a
            /// river_xkb_config_v1.finished event. Once the finished event is received
            /// it is safe to destroy this object and any other objects created through
            /// this interface.
            pub fn destroy(_xkb_config_v1: *XkbConfigV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_config_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// The server must be able to mmap the fd with MAP_PRIVATE.
            /// The server will fstat the fd to obtain the size of the keymap.
            /// The client must not modify the contents of the fd after making this request.
            /// The client should seal the fd with fcntl.
            pub fn createKeymap(_xkb_config_v1: *XkbConfigV1, _fd: i32, _format: KeymapFormat) !*client.river.XkbKeymapV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_config_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .h = _fd },
                    .{ .u = switch (@typeInfo(KeymapFormat)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_format))),
                        .@"struct" => @bitCast(_format),
                        else => unreachable,
                    } },
                };
                return @ptrCast(try _proxy.marshalConstructor(2, &_args, client.river.XkbKeymapV1.interface));
            }
            pub const create_keymap_since_version = 1;
        };

        /// This object is the result of attempting to create an xkbcommon keymap.
        pub const XkbKeymapV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_keymap_v1.interface;
            pub inline fn getId(_xkb_keymap_v1: *XkbKeymapV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keymap_v1)).getId();
            }
            pub inline fn getVersion(_xkb_keymap_v1: *XkbKeymapV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keymap_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_keymap_v1: *XkbKeymapV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keymap_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_keymap_v1: *XkbKeymapV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keymap_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const success_since_version = 1;
                pub const failure_since_version = 1;

                /// The keymap object was successfully created and may be used with the
                /// river_xkb_keyboard_v1.set_keymap request.
                success: void,
                /// The compositor failed to create a keymap from the given parameters.
                ///
                /// It is a protocol error to use this keymap object with
                /// river_xkb_keyboard_v1.set_keymap.
                failure: struct {
                    error_msg: [*:0]const u8,
                },
            };
            pub inline fn setListener(
                _xkb_keymap_v1: *XkbKeymapV1,
                comptime T: type,
                _listener: *const fn (xkb_keymap_v1: *XkbKeymapV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keymap_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(XkbKeymapV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the keymap
            /// object and that it may be safely destroyed.
            pub fn destroy(_xkb_keymap_v1: *XkbKeymapV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keymap_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// This object represent a physical keyboard which has its configuration and
        /// state managed by xkbcommon.
        pub const XkbKeyboardV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_keyboard_v1.interface;
            pub const Error = common.river.xkb_keyboard_v1.Error;
            pub inline fn getId(_xkb_keyboard_v1: *XkbKeyboardV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keyboard_v1)).getId();
            }
            pub inline fn getVersion(_xkb_keyboard_v1: *XkbKeyboardV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keyboard_v1)).getVersion();
            }
            pub inline fn getUserData(_xkb_keyboard_v1: *XkbKeyboardV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_xkb_keyboard_v1)).getUserData();
            }
            pub inline fn setQueue(_xkb_keyboard_v1: *XkbKeyboardV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const removed_since_version = 1;
                pub const input_device_since_version = 1;
                pub const layout_since_version = 1;
                pub const capslock_enabled_since_version = 1;
                pub const capslock_disabled_since_version = 1;
                pub const numlock_enabled_since_version = 1;
                pub const numlock_disabled_since_version = 1;

                /// This event indicates that the xkb keyboard has been removed.
                ///
                /// The server will send no further events on this object and ignore any
                /// request (other than river_xkb_keyboard_v1.destroy) made after this event
                /// is sent. The client should destroy this object with the
                /// river_xkb_keyboard_v1.destroy request to free up resources.
                removed: void,
                /// The river_input_device_v1 corresponding to this xkb keyboard. This event
                /// will always be the first event sent on the river_xkb_keyboard_v1 object,
                /// and it will be sent exactly once.
                input_device: struct {
                    device: ?*client.river.InputDeviceV1,
                },

                /// The currently active layout index and name. The name arg may be null if
                /// the active layout does not have a name.
                ///
                /// This event is sent once when the river_xkb_keyboard_v1 is created and
                /// again whenever the layout changes.
                layout: struct {
                    index: u32,
                    name: ?[*:0]const u8,
                },

                /// Capslock is currently enabled for the keyboard.
                ///
                /// This event is sent once when the river_xkb_keyboard_v1 is created and
                /// again whenever the capslock state changes.
                capslock_enabled: void,
                /// Capslock is currently disabled for the keyboard.
                ///
                /// This event is sent once when the river_xkb_keyboard_v1 is created and
                /// again whenever the capslock state changes.
                capslock_disabled: void,
                /// Numlock is currently enabled for the keyboard.
                ///
                /// This event is sent once when the river_xkb_keyboard_v1 is created and
                /// again whenever the numlock state changes.
                numlock_enabled: void,
                /// Numlock is currently disabled for the keyboard.
                ///
                /// This event is sent once when the river_xkb_keyboard_v1 is created and
                /// again whenever the numlock state changes.
                numlock_disabled: void,
            };
            pub inline fn setListener(
                _xkb_keyboard_v1: *XkbKeyboardV1,
                comptime T: type,
                _listener: *const fn (xkb_keyboard_v1: *XkbKeyboardV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(XkbKeyboardV1, T).dispatcher, _listener, _mut_data);
            }
            /// This request indicates that the client will no longer use the keyboard
            /// object and that it may be safely destroyed.
            pub fn destroy(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.marshal(0, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Set the keymap for the keyboard.
            ///
            /// Setting a keymap will reset all layout/modifier state.
            ///
            /// It is a protocol error to pass a keymap object for which the
            /// river_xkb_keymap_v1.success event was not received.
            pub fn setKeymap(_xkb_keyboard_v1: *XkbKeyboardV1, _keymap: *client.river.XkbKeymapV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_keymap) },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_keymap_since_version = 1;

            /// Set the active layout for the keyboard's keymap. Has no effect if the
            /// layout index is out of bounds for the current keymap.
            pub fn setLayoutByIndex(_xkb_keyboard_v1: *XkbKeyboardV1, _index: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .i = _index },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_layout_by_index_since_version = 1;

            /// Set the active layout for the keyboard's keymap. Has no effect if there
            /// is no layout with the give name for the keyboard's keymap.
            pub fn setLayoutByName(_xkb_keyboard_v1: *XkbKeyboardV1, _name: [*:0]const u8) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_layout_by_name_since_version = 1;

            /// Enable capslock for the keyboard.
            pub fn capslockEnable(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.marshal(4, null);
            }
            pub const capslock_enable_since_version = 1;

            /// Disable capslock for the keyboard.
            pub fn capslockDisable(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.marshal(5, null);
            }
            pub const capslock_disable_since_version = 1;

            /// Enable numlock for the keyboard.
            pub fn numlockEnable(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.marshal(6, null);
            }
            pub const numlock_enable_since_version = 1;

            /// Disable numlock for the keyboard.
            pub fn numlockDisable(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_xkb_keyboard_v1);
                _proxy.marshal(7, null);
            }
            pub const numlock_disable_since_version = 1;
        };
    };
    pub const zwlr = struct {
        /// Clients can use this interface to assign the surface_layer role to
        /// wl_surfaces. Such surfaces are assigned to a "layer" of the output and
        /// rendered with a defined z-depth respective to each other. They may also be
        /// anchored to the edges and corners of a screen and specify input handling
        /// semantics. This interface should be suitable for the implementation of
        /// many desktop shell components, and a broad number of other applications
        /// that interact with the desktop.
        pub const LayerShellV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.zwlr.layer_shell_v1.interface;
            pub const Error = common.zwlr.layer_shell_v1.Error;
            pub const Layer = common.zwlr.layer_shell_v1.Layer;
            pub inline fn getId(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getVersion();
            }
            pub inline fn getUserData(_layer_shell_v1: *LayerShellV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_layer_shell_v1)).getUserData();
            }
            pub inline fn setQueue(_layer_shell_v1: *LayerShellV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                _proxy.setQueue(_queue);
            }
            /// Create a layer surface for an existing surface. This assigns the role of
            /// layer_surface, or raises a protocol error if another role is already
            /// assigned.
            ///
            /// Creating a layer surface from a wl_surface which has a buffer attached
            /// or committed is a client error, and any attempts by a client to attach
            /// or manipulate a buffer prior to the first layer_surface.configure call
            /// must also be treated as errors.
            ///
            /// After creating a layer_surface object and setting it up, the client
            /// must perform an initial commit without any buffer attached.
            /// The compositor will reply with a layer_surface.configure event.
            /// The client must acknowledge it and is then allowed to attach a buffer
            /// to map the surface.
            ///
            /// You may pass NULL for output to allow the compositor to decide which
            /// output to use. Generally this will be the one that the user most
            /// recently interacted with.
            ///
            /// Clients can specify a namespace that defines the purpose of the layer
            /// surface.
            pub fn getLayerSurface(_layer_shell_v1: *LayerShellV1, _surface: *client.wl.Surface, _output: ?*client.wl.Output, _layer: Layer, _namespace: [*:0]const u8) !*client.zwlr.LayerSurfaceV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_surface) },
                    .{ .o = @ptrCast(_output) },
                    .{ .u = switch (@typeInfo(Layer)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_layer))),
                        .@"struct" => @bitCast(_layer),
                        else => unreachable,
                    } },
                    .{ .s = _namespace },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.zwlr.LayerSurfaceV1.interface));
            }
            pub const get_layer_surface_since_version = 1;

            /// This request indicates that the client will not use the layer_shell
            /// object any more. Objects that have been created through this instance
            /// are not affected.
            pub fn destroy(_layer_shell_v1: *LayerShellV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_shell_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 3;
        };

        /// An interface that may be implemented by a wl_surface, for surfaces that
        /// are designed to be rendered as a layer of a stacked desktop-like
        /// environment.
        ///
        /// Layer surface state (layer, size, anchor, exclusive zone,
        /// margin, interactivity) is double-buffered, and will be applied at the
        /// time wl_surface.commit of the corresponding wl_surface is called.
        ///
        /// Attaching a null buffer to a layer surface unmaps it.
        ///
        /// Unmapping a layer_surface means that the surface cannot be shown by the
        /// compositor until it is explicitly mapped again. The layer_surface
        /// returns to the state it had right after layer_shell.get_layer_surface.
        /// The client can re-map the surface by performing a commit without any
        /// buffer attached, waiting for a configure event and handling it as usual.
        pub const LayerSurfaceV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.zwlr.layer_surface_v1.interface;
            pub const KeyboardInteractivity = common.zwlr.layer_surface_v1.KeyboardInteractivity;
            pub const Error = common.zwlr.layer_surface_v1.Error;
            pub const Anchor = common.zwlr.layer_surface_v1.Anchor;
            pub inline fn getId(_layer_surface_v1: *LayerSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_surface_v1)).getId();
            }
            pub inline fn getVersion(_layer_surface_v1: *LayerSurfaceV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_layer_surface_v1)).getVersion();
            }
            pub inline fn getUserData(_layer_surface_v1: *LayerSurfaceV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_layer_surface_v1)).getUserData();
            }
            pub inline fn setQueue(_layer_surface_v1: *LayerSurfaceV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const configure_since_version = 1;
                pub const closed_since_version = 1;

                /// The configure event asks the client to resize its surface.
                ///
                /// Clients should arrange their surface for the new states, and then send
                /// an ack_configure request with the serial sent in this configure event at
                /// some point before committing the new surface.
                ///
                /// The client is free to dismiss all but the last configure event it
                /// received.
                ///
                /// The width and height arguments specify the size of the window in
                /// surface-local coordinates.
                ///
                /// The size is a hint, in the sense that the client is free to ignore it if
                /// it doesn't resize, pick a smaller size (to satisfy aspect ratio or
                /// resize in steps of NxM pixels). If the client picks a smaller size and
                /// is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
                /// surface will be centered on this axis.
                ///
                /// If the width or height arguments are zero, it means the client should
                /// decide its own window dimension.
                configure: struct {
                    serial: u32,
                    width: u32,
                    height: u32,
                },

                /// The closed event is sent by the compositor when the surface will no
                /// longer be shown. The output may have been destroyed or the user may
                /// have asked for it to be removed. Further changes to the surface will be
                /// ignored. The client should destroy the resource after receiving this
                /// event, and create a new surface if they so choose.
                closed: void,
            };
            pub inline fn setListener(
                _layer_surface_v1: *LayerSurfaceV1,
                comptime T: type,
                _listener: *const fn (layer_surface_v1: *LayerSurfaceV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(LayerSurfaceV1, T).dispatcher, _listener, _mut_data);
            }
            /// Sets the size of the surface in surface-local coordinates. The
            /// compositor will display the surface centered with respect to its
            /// anchors.
            ///
            /// If you pass 0 for either value, the compositor will assign it and
            /// inform you of the assignment in the configure event. You must set your
            /// anchor to opposite edges in the dimensions you omit; not doing so is a
            /// protocol error. Both values are 0 by default.
            ///
            /// Size is double-buffered, see wl_surface.commit.
            pub fn setSize(_layer_surface_v1: *LayerSurfaceV1, _width: u32, _height: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = _width },
                    .{ .u = _height },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_size_since_version = 1;

            /// Requests that the compositor anchor the surface to the specified edges
            /// and corners. If two orthogonal edges are specified (e.g. 'top' and
            /// 'left'), then the anchor point will be the intersection of the edges
            /// (e.g. the top left corner of the output); otherwise the anchor point
            /// will be centered on that edge, or in the center if none is specified.
            ///
            /// Anchor is double-buffered, see wl_surface.commit.
            pub fn setAnchor(_layer_surface_v1: *LayerSurfaceV1, _anchor: Anchor) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Anchor)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_anchor))),
                        .@"struct" => @bitCast(_anchor),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(1, &_args);
            }
            pub const set_anchor_since_version = 1;

            /// Requests that the compositor avoids occluding an area with other
            /// surfaces. The compositor's use of this information is
            /// implementation-dependent - do not assume that this region will not
            /// actually be occluded.
            ///
            /// A positive value is only meaningful if the surface is anchored to one
            /// edge or an edge and both perpendicular edges. If the surface is not
            /// anchored, anchored to only two perpendicular edges (a corner), anchored
            /// to only two parallel edges or anchored to all edges, a positive value
            /// will be treated the same as zero.
            ///
            /// A positive zone is the distance from the edge in surface-local
            /// coordinates to consider exclusive.
            ///
            /// Surfaces that do not wish to have an exclusive zone may instead specify
            /// how they should interact with surfaces that do. If set to zero, the
            /// surface indicates that it would like to be moved to avoid occluding
            /// surfaces with a positive exclusive zone. If set to -1, the surface
            /// indicates that it would not like to be moved to accommodate for other
            /// surfaces, and the compositor should extend it all the way to the edges
            /// it is anchored to.
            ///
            /// For example, a panel might set its exclusive zone to 10, so that
            /// maximized shell surfaces are not shown on top of it. A notification
            /// might set its exclusive zone to 0, so that it is moved to avoid
            /// occluding the panel, but shell surfaces are shown underneath it. A
            /// wallpaper or lock screen might set their exclusive zone to -1, so that
            /// they stretch below or over the panel.
            ///
            /// The default value is 0.
            ///
            /// Exclusive zone is double-buffered, see wl_surface.commit.
            pub fn setExclusiveZone(_layer_surface_v1: *LayerSurfaceV1, _zone: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .i = _zone },
                };
                _proxy.marshal(2, &_args);
            }
            pub const set_exclusive_zone_since_version = 1;

            /// Requests that the surface be placed some distance away from the anchor
            /// point on the output, in surface-local coordinates. Setting this value
            /// for edges you are not anchored to has no effect.
            ///
            /// The exclusive zone includes the margin.
            ///
            /// Margin is double-buffered, see wl_surface.commit.
            pub fn setMargin(_layer_surface_v1: *LayerSurfaceV1, _top: i32, _right: i32, _bottom: i32, _left: i32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .i = _top },
                    .{ .i = _right },
                    .{ .i = _bottom },
                    .{ .i = _left },
                };
                _proxy.marshal(3, &_args);
            }
            pub const set_margin_since_version = 1;

            /// Set how keyboard events are delivered to this surface. By default,
            /// layer shell surfaces do not receive keyboard events; this request can
            /// be used to change this.
            ///
            /// This setting is inherited by child surfaces set by the get_popup
            /// request.
            ///
            /// Layer surfaces receive pointer, touch, and tablet events normally. If
            /// you do not want to receive them, set the input region on your surface
            /// to an empty region.
            ///
            /// Keyboard interactivity is double-buffered, see wl_surface.commit.
            pub fn setKeyboardInteractivity(_layer_surface_v1: *LayerSurfaceV1, _keyboard_interactivity: KeyboardInteractivity) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(KeyboardInteractivity)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_keyboard_interactivity))),
                        .@"struct" => @bitCast(_keyboard_interactivity),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(4, &_args);
            }
            pub const set_keyboard_interactivity_since_version = 1;

            /// This assigns an xdg_popup's parent to this layer_surface.  This popup
            /// should have been created via xdg_surface::get_popup with the parent set
            /// to NULL, and this request must be invoked before committing the popup's
            /// initial state.
            ///
            /// See the documentation of xdg_popup for more details about what an
            /// xdg_popup is and how it is used.
            pub fn getPopup(_layer_surface_v1: *LayerSurfaceV1, _popup: *client.xdg.Popup) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_popup) },
                };
                _proxy.marshal(5, &_args);
            }
            pub const get_popup_since_version = 1;

            /// When a configure event is received, if a client commits the
            /// surface in response to the configure event, then the client
            /// must make an ack_configure request sometime before the commit
            /// request, passing along the serial of the configure event.
            ///
            /// If the client receives multiple configure events before it
            /// can respond to one, it only has to ack the last configure event.
            ///
            /// A client is not required to commit immediately after sending
            /// an ack_configure request - it may even ack_configure several times
            /// before its next surface commit.
            ///
            /// A client may send multiple ack_configure requests before committing, but
            /// only the last request sent before a commit indicates which configure
            /// event the client really is responding to.
            pub fn ackConfigure(_layer_surface_v1: *LayerSurfaceV1, _serial: u32) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _proxy.marshal(6, &_args);
            }
            pub const ack_configure_since_version = 1;

            /// This request destroys the layer surface.
            pub fn destroy(_layer_surface_v1: *LayerSurfaceV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                _proxy.marshal(7, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;

            /// Change the layer that the surface is rendered on.
            ///
            /// Layer is double-buffered, see wl_surface.commit.
            pub fn setLayer(_layer_surface_v1: *LayerSurfaceV1, _layer: common.zwlr.layer_shell_v1.Layer) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.zwlr.layer_shell_v1.Layer)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_layer))),
                        .@"struct" => @bitCast(_layer),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(8, &_args);
            }
            pub const set_layer_since_version = 2;
        };

        /// This interface is a manager that allows creating per-output power
        /// management mode controls.
        pub const OutputPowerManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwlr.output_power_manager_v1.interface;
            pub inline fn getId(_output_power_manager_v1: *OutputPowerManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_manager_v1)).getId();
            }
            pub inline fn getVersion(_output_power_manager_v1: *OutputPowerManagerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_manager_v1)).getVersion();
            }
            pub inline fn getUserData(_output_power_manager_v1: *OutputPowerManagerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_manager_v1)).getUserData();
            }
            pub inline fn setQueue(_output_power_manager_v1: *OutputPowerManagerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_manager_v1);
                _proxy.setQueue(_queue);
            }
            /// Create an output power management mode control that can be used to
            /// adjust the power management mode for a given output.
            pub fn getOutputPower(_output_power_manager_v1: *OutputPowerManagerV1, _output: *client.wl.Output) !*client.zwlr.OutputPowerV1 {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = null },
                    .{ .o = @ptrCast(_output) },
                };
                return @ptrCast(try _proxy.marshalConstructor(0, &_args, client.zwlr.OutputPowerV1.interface));
            }
            pub const get_output_power_since_version = 1;

            /// All objects created by the manager will still remain valid, until their
            /// appropriate destroy request has been called.
            pub fn destroy(_output_power_manager_v1: *OutputPowerManagerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_manager_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };

        /// This object offers requests to set the power management mode of
        /// an output.
        pub const OutputPowerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwlr.output_power_v1.interface;
            pub const Mode = common.zwlr.output_power_v1.Mode;
            pub const Error = common.zwlr.output_power_v1.Error;
            pub inline fn getId(_output_power_v1: *OutputPowerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_v1)).getId();
            }
            pub inline fn getVersion(_output_power_v1: *OutputPowerV1) u32 {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_v1)).getVersion();
            }
            pub inline fn getUserData(_output_power_v1: *OutputPowerV1) ?*anyopaque {
                return @as(*client.wl.Proxy, @ptrCast(_output_power_v1)).getUserData();
            }
            pub inline fn setQueue(_output_power_v1: *OutputPowerV1, _queue: *client.wl.EventQueue) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_v1);
                _proxy.setQueue(_queue);
            }
            pub const Event = union(enum) {
                pub const mode_since_version = 1;
                pub const failed_since_version = 1;

                /// Report the power management mode change of an output.
                ///
                /// The mode event is sent after an output changed its power
                /// management mode. The reason can be a client using set_mode or the
                /// compositor deciding to change an output's mode.
                /// This event is also sent immediately when the object is created
                /// so the client is informed about the current power management mode.
                mode: struct {
                    mode: Mode,
                },

                /// This event indicates that the output power management mode control
                /// is no longer valid. This can happen for a number of reasons,
                /// including:
                /// - The output doesn't support power management
                /// - Another client already has exclusive power management mode control
                /// for this output
                /// - The output disappeared
                ///
                /// Upon receiving this event, the client should destroy this object.
                failed: void,
            };
            pub inline fn setListener(
                _output_power_v1: *OutputPowerV1,
                comptime T: type,
                _listener: *const fn (output_power_v1: *OutputPowerV1, event: Event, data: T) void,
                _data: T,
            ) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_v1);
                const _mut_data: ?*anyopaque = @ptrFromInt(@intFromPtr(_data));
                _proxy.addDispatcher(common.Dispatcher(OutputPowerV1, T).dispatcher, _listener, _mut_data);
            }
            /// Set an output's power save mode to the given mode. The mode change
            /// is effective immediately. If the output does not support the given
            /// mode a failed event is sent.
            pub fn setMode(_output_power_v1: *OutputPowerV1, _mode: Mode) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Mode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _proxy.marshal(0, &_args);
            }
            pub const set_mode_since_version = 1;

            /// Destroys the output power management mode control object.
            pub fn destroy(_output_power_v1: *OutputPowerV1) void {
                const _proxy: *client.wl.Proxy = @ptrCast(_output_power_v1);
                _proxy.marshal(1, null);
                _proxy.destroy();
            }
            pub const destroy_since_version = 1;
        };
    };
};

pub const server = struct {
    pub const wl = struct {
        pub const Object = common.Object;
        pub const Message = common.Message;
        pub const Interface = common.Interface;
        pub const list = common.list;
        pub const Array = common.Array;
        pub const Fixed = common.Fixed;
        pub const Argument = common.Argument;

        /// This is wayland-server's wl_display. It has been renamed as zig-wayland has
        /// decided to hide wl_resources with opaque pointers in the same way that
        /// wayland-client does with wl_proxys. This of course creates a name conflict.
        pub const Server = opaque {
            pub inline fn create() error{ServerCreateFailed}!*Server {
                return ffi.server.wl_display_create() orelse error.ServerCreateFailed;
            }

            pub inline fn destroy(_server: *Server) void {
                ffi.server.wl_display_destroy(_server);
            }

            pub inline fn getEventLoop(_server: *Server) *EventLoop {
                return ffi.server.wl_display_get_event_loop(_server);
            }

            pub inline fn addSocket(_server: *Server, name: [*:0]const u8) error{AddSocketFailed}!void {
                if (ffi.server.wl_display_add_socket(_server, name) == -1)
                    return error.AddSocketFailed;
            }

            // wayland-client will connect to wayland-0 even if WAYLAND_DISPLAY is
            // unset due to an unfortunate piece of code that was not removed before
            // the library was stabilized. Because of this, it is a good idea to never
            // call the socket wayland-0. So, instead of binding to wayland-server's
            // wl_display_add_socket_auto we implement a version which skips wayland-0.
            pub fn addSocketAuto(_server: *Server, buf: *[11]u8) error{AddSocketFailed}![:0]const u8 {
                // Don't use wayland-0
                var i: u32 = 1;
                while (i <= 32) : (i += 1) {
                    const name = std.fmt.bufPrintZ(buf, "wayland-{}", .{i}) catch unreachable;
                    _server.addSocket(name.ptr) catch continue;
                    return name;
                }
                return error.AddSocketFailed;
            }

            pub inline fn addSocketFd(_server: *Server, sock_fd: c_int) error{AddSocketFailed}!void {
                if (ffi.server.wl_display_add_socket_fd(_server, sock_fd) == -1)
                    return error.AddSocketFailed;
            }

            pub inline fn terminate(_server: *Server) void {
                ffi.server.wl_display_terminate(_server);
            }

            pub inline fn run(_server: *Server) void {
                ffi.server.wl_display_run(_server);
            }

            pub inline fn flushClients(_server: *Server) void {
                ffi.server.wl_display_flush_clients(_server);
            }

            pub inline fn destroyClients(_server: *Server) void {
                ffi.server.wl_display_destroy_clients(_server);
            }

            pub inline fn getSerial(_server: *Server) u32 {
                return ffi.server.wl_display_get_serial(_server);
            }

            pub inline fn nextSerial(_server: *Server) u32 {
                return ffi.server.wl_display_next_serial(_server);
            }

            pub inline fn addDestroyListener(_server: *Server, listener: *Listener(*Server)) void {
                ffi.server.wl_display_add_destroy_listener(_server, listener);
            }

            pub inline fn addClientCreatedListener(_server: *Server, listener: *Listener(*Client)) void {
                ffi.server.wl_display_add_client_created_listener(_server, listener);
            }

            // Doesn't really make sense with our Listener API as we would need to
            // pass a pointer to the wrapper function
            //fn wl_display_get_destroy_listener(_server: *Server, notify: @TypeOf(Listener(*Server).notify)) ?*Listener(*Server);

            pub inline fn setGlobalFilter(
                _server: *Server,
                comptime T: type,
                comptime filter: fn (_client: *const Client, global: *const Global, data: T) bool,
                data: T,
            ) void {
                ffi.server.wl_display_set_global_filter(
                    _server,
                    struct {
                        fn _wrapper(_client: *const Client, global: *const Global, _data: ?*anyopaque) callconv(.c) bool {
                            return filter(_client, global, @ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                );
            }

            pub inline fn getClientList(_server: *Server) *list.Head(Client, null) {
                return ffi.server.wl_display_get_client_list(_server);
            }

            pub inline fn initShm(_server: *Server) error{OutOfMemory}!void {
                if (ffi.server.wl_display_init_shm(_server) == -1) return error.OutOfMemory;
            }

            pub inline fn addShmFormat(_server: *Server, format: u32) error{OutOfMemory}!*u32 {
                return ffi.server.wl_display_add_shm_format(_server, format) orelse error.OutOfMemory;
            }

            pub inline fn addProtocolLogger(
                _server: *Server,
                comptime T: type,
                comptime func: fn (data: T, direction: ProtocolLogger.Type, message: *const ProtocolLogger.LogMessage) void,
                data: T,
            ) void {
                ffi.server.wl_display_add_protocol_logger(
                    _server,
                    struct {
                        fn _wrapper(_data: ?*anyopaque, _direction: ProtocolLogger.Type, _message: *const ProtocolLogger.LogMessage) callconv(.c) void {
                            func(@ptrCast(@alignCast(_data)), _direction, _message);
                        }
                    }._wrapper,
                    data,
                );
            }
        };

        pub const Client = opaque {
            pub inline fn create(_server: *Server, fd: c_int) ?*Client {
                return ffi.server.wl_client_create(_server, fd);
            }

            pub inline fn destroy(_client: *Client) void {
                ffi.server.wl_client_destroy(_client);
            }

            pub inline fn flush(_client: *Client) void {
                ffi.server.wl_client_flush(_client);
            }

            pub inline fn getLink(_client: *Client) *list.Link {
                return ffi.server.wl_client_get_link(_client);
            }

            pub inline fn fromLink(link: *list.Link) *Client {
                return ffi.server.wl_client_from_link(link);
            }

            pub const Credentials = struct {
                pid: posix.pid_t,
                gid: posix.gid_t,
                uid: posix.uid_t,
            };
            pub inline fn getCredentials(_client: *Client) Credentials {
                var credentials: Credentials = undefined;
                ffi.server.wl_client_get_credentials(_client, &credentials.pid, &credentials.uid, &credentials.gid);
                return credentials;
            }

            pub inline fn addDestroyListener(_client: *Client, listener: *Listener(*Client)) void {
                ffi.server.wl_client_add_destroy_listener(_client, listener);
            }

            // Doesn't really make sense with our Listener API as we would need to
            // pass a pointer to the wrapper function
            //fn wl_client_get_destroy_listener(_client: *Client, notify: @TypeOf(Listener(*Client).notify)) ?*Listener(*Client);

            pub inline fn getObject(_client: *Client, id: u32) ?*Resource {
                return ffi.server.wl_client_get_object(_client, id);
            }

            pub inline fn postNoMemory(_client: *Client) void {
                ffi.server.wl_client_post_no_memory(_client);
            }

            pub inline fn postImplementationError(_client: *Client, msg: [*:0]const u8) void {
                ffi.server.wl_client_post_implementation_error(_client, "%s", msg);
            }

            pub inline fn addResourceCreatedListener(_client: *Client, listener: *Listener(*Resource)) void {
                ffi.server.wl_client_add_resource_created_listener(_client, listener);
            }

            pub const IteratorResult = enum(c_int) { stop, cont };
            pub inline fn forEachResource(
                _client: *Client,
                comptime T: type,
                comptime iterator: fn (resource: *Resource, data: T) IteratorResult,
                data: T,
            ) void {
                ffi.server.wl_client_for_each_resource(
                    _client,
                    struct {
                        fn _wrapper(_resource: *Resource, _data: ?*anyopaque) callconv(.c) IteratorResult {
                            return iterator(_resource, @ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                );
            }

            pub inline fn getFd(_client: *Client) c_int {
                return ffi.server.wl_client_get_fd(_client);
            }

            pub inline fn getDisplay(_client: *Client) *Server {
                return ffi.server.wl_client_get_display(_client);
            }
        };

        pub const Global = opaque {
            pub inline fn create(
                _server: *Server,
                comptime T: type,
                version: u32,
                comptime DataT: type,
                data: DataT,
                comptime bind: fn (_client: *Client, data: DataT, version: u32, id: u32) void,
            ) error{GlobalCreateFailed}!*Global {
                return ffi.server.wl_global_create(
                    _server,
                    T.interface,
                    @as(c_int, @intCast(version)),
                    data,
                    struct {
                        fn _wrapper(_client: *Client, _data: ?*anyopaque, _version: u32, _id: u32) callconv(.c) void {
                            bind(_client, @ptrCast(@alignCast(_data)), _version, _id);
                        }
                    }._wrapper,
                ) orelse error.GlobalCreateFailed;
            }

            pub inline fn remove(global: *Global) void {
                ffi.server.wl_global_remove(global);
            }

            pub inline fn destroy(global: *Global) void {
                ffi.server.wl_global_destroy(global);
            }

            pub inline fn getInterface(global: *const Global) *const Interface {
                return ffi.server.wl_global_get_interface(global);
            }

            pub inline fn getName(global: *const Global, _client: *const Client) u32 {
                return ffi.server.wl_global_get_name(global, _client);
            }

            pub inline fn getUserData(global: *const Global) ?*anyopaque {
                return ffi.server.wl_global_get_user_data(global);
            }
        };

        pub const Resource = opaque {
            pub inline fn create(_client: *Client, comptime T: type, version: u32, id: u32) error{ResourceCreateFailed}!*Resource {
                // This is only a c_int because of legacy libwayland reasons. Negative versions are invalid.
                // Version is a u32 on the wire and for wl_global, wl_proxy, etc.
                return ffi.server.wl_resource_create(_client, T.interface, @as(c_int, @intCast(version)), id) orelse error.ResourceCreateFailed;
            }

            pub inline fn destroy(resource: *Resource) void {
                ffi.server.wl_resource_destroy(resource);
            }

            pub inline fn postEvent(resource: *Resource, opcode: u32, args: ?[*]Argument) void {
                ffi.server.wl_resource_post_event_array(resource, opcode, args);
            }

            pub inline fn queueEvent(resource: *Resource, opcode: u32, args: ?[*]Argument) void {
                ffi.server.wl_resource_queue_event_array(resource, opcode, args);
            }

            pub inline fn postError(resource: *Resource, code: u32, message: [*:0]const u8) void {
                ffi.server.wl_resource_post_error(resource, code, "%s", message);
            }

            pub inline fn postNoMemory(resource: *Resource) void {
                ffi.server.wl_resource_post_no_memory(resource);
            }

            pub const DispatcherFn = fn (
                implementation: ?*const anyopaque,
                resource: *Resource,
                opcode: u32,
                message: *const Message,
                args: [*]Argument,
            ) callconv(.c) c_int;
            pub const DestroyFn = fn (resource: *Resource) callconv(.c) void;
            pub inline fn setDispatcher(
                resource: *Resource,
                dispatcher: ?*const DispatcherFn,
                implementation: ?*const anyopaque,
                data: ?*anyopaque,
                destroy_fn: ?*const DestroyFn,
            ) void {
                ffi.server.wl_resource_set_dispatcher(resource, dispatcher, implementation, data, destroy_fn);
            }

            pub inline fn getUserData(resource: *Resource) ?*anyopaque {
                return ffi.server.wl_resource_get_user_data(resource);
            }

            pub inline fn getId(resource: *Resource) u32 {
                return ffi.server.wl_resource_get_id(resource);
            }

            pub inline fn getLink(resource: *Resource) *list.Link {
                return ffi.server.wl_resource_get_link(resource);
            }

            pub inline fn fromLink(link: *list.Link) *Resource {
                return ffi.server.wl_resource_from_link(link);
            }

            pub inline fn findForClient(_list: *list.Head(Resource, null), _client: *Client) ?*Resource {
                return ffi.server.wl_resource_find_for_client(_list, _client);
            }

            pub inline fn getClient(resource: *Resource) *Client {
                return ffi.server.wl_resource_get_client(resource);
            }

            pub inline fn getVersion(resource: *Resource) u32 {
                // The fact that wl_resource.version is a int in libwayland is
                // a mistake. Negative versions are impossible and u32 is used
                // everywhere else in libwayland
                return @as(u32, @intCast(ffi.server.wl_resource_get_version(resource)));
            }

            // TOOD: unsure if this should be bound
            //fn wl_resource_set_destructor(resource: *Resource, destroy: DestroyFn) void;

            pub inline fn getClass(resource: *Resource) [*:0]const u8 {
                return ffi.server.wl_resource_get_class(resource);
            }

            pub inline fn addDestroyListener(resource: *Resource, listener: *Listener(*Resource)) void {
                ffi.server.wl_resource_add_destroy_listener(resource, listener);
            }

            // Doesn't really make sense with our Listener API as we would need to
            // pass a pointer to the wrapper function
            //fn wl_resource_get_destroy_listener(resource: *Resource, notify: @TypeOf(Listener(*Resource).notify)) ?*Listener(*Resource);
        };

        pub const ProtocolLogger = opaque {
            pub const Type = enum(c_int) {
                request,
                event,
            };

            pub const LogMessage = extern struct {
                resource: *Resource,
                message_opcode: c_int,
                message: *Message,
                arguments_count: c_int,
                arguments: ?[*]Argument,
            };

            pub inline fn destroy(logger: *ProtocolLogger) void {
                ffi.server.wl_protocol_logger_destroy(logger);
            }
        };

        pub fn Listener(comptime T: type) type {
            return extern struct {
                const Self = @This();

                pub const NotifyFn = if (T == void)
                    fn (listener: *Self) void
                else
                    fn (listener: *Self, data: T) void;

                link: list.Link,
                notify: *const fn (listener: *Self, data: ?*anyopaque) callconv(.c) void,

                pub fn init(comptime notify: NotifyFn) Self {
                    var self: Self = undefined;
                    self.setNotify(notify);
                    return self;
                }

                pub fn setNotify(self: *Self, comptime notify: NotifyFn) void {
                    self.notify = if (T == void)
                        struct {
                            fn wrapper(listener: *Self, _: ?*anyopaque) callconv(.c) void {
                                @call(.always_inline, notify, .{listener});
                            }
                        }.wrapper
                    else
                        struct {
                            fn wrapper(listener: *Self, data: ?*anyopaque) callconv(.c) void {
                                @call(.always_inline, notify, .{ listener, @as(T, @ptrFromInt(@intFromPtr(data))) });
                            }
                        }.wrapper;
                }
            };
        }

        pub fn Signal(comptime T: type) type {
            return extern struct {
                const Self = @This();

                listener_list: list.Head(Listener(T), .link),

                pub fn init(signal: *Self) void {
                    signal.listener_list.init();
                }

                pub fn add(signal: *Self, listener: *Listener(T)) void {
                    signal.listener_list.append(listener);
                }

                pub fn get(signal: *Self, notify: @TypeOf(Listener(T).notify)) ?*Listener(T) {
                    var it = signal.listener_list.iterator(.forward);
                    return while (it.next()) |listener| {
                        if (listener.notify == notify) break listener;
                    } else null;
                }

                pub const emit = if (T == void)
                    struct {
                        pub inline fn emit(signal: *Self) void {
                            emitInner(signal, null);
                        }
                    }.emit
                else
                    struct {
                        pub inline fn emit(signal: *Self, data: T) void {
                            emitInner(signal, data);
                        }
                    }.emit;

                /// This is similar to wlroots' wlr_signal_emit_safe. It handles
                /// removal of any element in the list during iteration and stops at
                /// whatever the last element was when iteration started.
                fn emitInner(signal: *Self, data: ?*anyopaque) void {
                    var cursor: Listener(T) = undefined;
                    signal.listener_list.prepend(&cursor);

                    var end: Listener(T) = undefined;
                    signal.listener_list.append(&end);

                    while (cursor.link.next != &end.link) {
                        const pos = cursor.link.next.?;
                        const listener: *Listener(T) = @fieldParentPtr("link", pos);

                        cursor.link.remove();
                        pos.insert(&cursor.link);

                        listener.notify(listener, data);
                    }

                    cursor.link.remove();
                    end.link.remove();
                }
            };
        }

        pub const EventMask = packed struct(u32) {
            readable: bool = false,
            writable: bool = false,
            hangup: bool = false,
            @"error": bool = false,

            _: u28 = 0,
        };

        pub const EventLoop = opaque {
            pub inline fn create() error{EventLoopCreateFailed}!*EventLoop {
                return ffi.server.wl_event_loop_create() orelse error.EventLoopCreateFailed;
            }

            pub inline fn destroy(loop: *EventLoop) void {
                ffi.server.wl_event_loop_destroy(loop);
            }

            pub inline fn addFd(
                loop: *EventLoop,
                comptime T: type,
                fd: c_int,
                mask: EventMask,
                comptime func: fn (fd: c_int, mask: EventMask, data: T) c_int,
                data: T,
            ) error{AddFdFailed}!*EventSource {
                return ffi.server.wl_event_loop_add_fd(
                    loop,
                    fd,
                    @bitCast(mask),
                    struct {
                        fn _wrapper(_fd: c_int, _mask: u32, _data: ?*anyopaque) callconv(.c) c_int {
                            return func(_fd, @bitCast(_mask), @ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                ) orelse error.AddFdFailed;
            }

            pub inline fn addTimer(
                loop: *EventLoop,
                comptime T: type,
                comptime func: fn (data: T) c_int,
                data: T,
            ) error{AddTimerFailed}!*EventSource {
                return ffi.server.wl_event_loop_add_timer(
                    loop,
                    struct {
                        fn _wrapper(_data: ?*anyopaque) callconv(.c) c_int {
                            return func(@ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                ) orelse error.AddTimerFailed;
            }

            pub inline fn addSignal(
                loop: *EventLoop,
                comptime T: type,
                signal_number: c_int,
                comptime func: fn (signal_number: c_int, data: T) c_int,
                data: T,
            ) error{AddSignalFailed}!*EventSource {
                return ffi.server.wl_event_loop_add_signal(
                    loop,
                    signal_number,
                    struct {
                        fn _wrapper(_signal_number: c_int, _data: ?*anyopaque) callconv(.c) c_int {
                            return func(_signal_number, @ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                ) orelse error.AddSignalFailed;
            }

            pub inline fn addIdle(
                loop: *EventLoop,
                comptime T: type,
                comptime func: fn (data: T) void,
                data: T,
            ) error{OutOfMemory}!*EventSource {
                return ffi.server.wl_event_loop_add_idle(
                    loop,
                    struct {
                        fn _wrapper(_data: ?*anyopaque) callconv(.c) void {
                            return func(@ptrCast(@alignCast(_data)));
                        }
                    }._wrapper,
                    data,
                ) orelse error.OutOfMemory;
            }

            pub inline fn dispatch(loop: *EventLoop, timeout: c_int) posix.UnexpectedError!void {
                const rc = ffi.server.wl_event_loop_dispatch(loop, timeout);
                switch (posix.errno(rc)) {
                    .SUCCESS => return,
                    // TODO
                    else => |err| return posix.unexpectedErrno(err),
                }
            }

            pub inline fn dispatchIdle(loop: *EventLoop) void {
                ffi.server.wl_event_loop_dispatch_idle(loop);
            }

            pub inline fn getFd(loop: *EventLoop) c_int {
                return ffi.server.wl_event_loop_get_fd(loop);
            }

            pub inline fn addDestroyListener(loop: *EventLoop, listener: *Listener(*EventLoop)) void {
                ffi.server.wl_event_loop_add_destroy_listener(loop, listener);
            }

            //fn wl_event_loop_get_destroy_listener(loop: *EventLoop, notify: @TypeOf(Listener(*EventLoop).notify)) ?*Listener;
            //pub const getDestroyListener = wl_event_loop_get_destroy_listener;
        };

        pub const EventSource = opaque {
            pub inline fn remove(source: *EventSource) void {
                if (ffi.server.wl_event_source_remove(source) != 0) unreachable;
            }

            pub inline fn check(source: *EventSource) void {
                ffi.server.wl_event_source_check(source);
            }

            pub inline fn fdUpdate(source: *EventSource, mask: EventMask) posix.UnexpectedError!void {
                const rc = ffi.server.wl_event_source_fd_update(source, @bitCast(mask));
                switch (posix.errno(rc)) {
                    .SUCCESS => return,
                    // TODO
                    else => |err| return posix.unexpectedErrno(err),
                }
            }

            pub inline fn timerUpdate(source: *EventSource, ms_delay: c_int) posix.UnexpectedError!void {
                const rc = ffi.server.wl_event_source_timer_update(source, ms_delay);
                switch (posix.errno(rc)) {
                    .SUCCESS => return,
                    // TODO
                    else => |err| return posix.unexpectedErrno(err),
                }
            }
        };

        pub const shm = struct {
            pub const Buffer = opaque {
                pub inline fn get(resource: *Resource) ?*shm.Buffer {
                    return ffi.server.wl_shm_buffer_get(resource);
                }

                pub inline fn beginAccess(buffer: *shm.Buffer) void {
                    ffi.server.wl_shm_buffer_begin_access(buffer);
                }

                pub inline fn endAccess(buffer: *shm.Buffer) void {
                    ffi.server.wl_shm_buffer_end_access(buffer);
                }

                pub inline fn getData(buffer: *shm.Buffer) ?*anyopaque {
                    return ffi.server.wl_shm_buffer_get_data(buffer);
                }

                pub inline fn getFormat(buffer: *shm.Buffer) u32 {
                    return ffi.server.wl_shm_buffer_get_format(buffer);
                }

                pub inline fn getHeight(buffer: *shm.Buffer) i32 {
                    return ffi.server.wl_shm_buffer_get_height(buffer);
                }

                pub inline fn getWidth(buffer: *shm.Buffer) i32 {
                    return ffi.server.wl_shm_buffer_get_width(buffer);
                }

                pub inline fn getStride(buffer: *shm.Buffer) i32 {
                    return ffi.server.wl_shm_buffer_get_stride(buffer);
                }

                pub inline fn refPool(buffer: *shm.Buffer) *Pool {
                    return ffi.server.wl_shm_buffer_ref_pool(buffer);
                }
            };

            pub const Pool = opaque {
                pub inline fn unref(pool: *Pool) void {
                    ffi.server.wl_shm_pool_unref(pool);
                }
            };
        };

        /// The core global object.  This is a special singleton object.  It
        /// is used for internal Wayland protocol features.
        pub const Display = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.display.interface;
            pub const Error = common.wl.display.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Display {
                return @ptrCast(try server.wl.Resource.create(_client, Display, _version, _id));
            }
            pub inline fn destroy(_display: *Display) void {
                return @as(*server.wl.Resource, @ptrCast(_display)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Display {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_display: *Display) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_display)).getLink();
            }
            pub inline fn getClient(_display: *Display) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_display)).getClient();
            }
            pub inline fn getId(_display: *Display) u32 {
                return @as(*server.wl.Resource, @ptrCast(_display)).getId();
            }
            pub inline fn getVersion(_display: *Display) u32 {
                return @as(*server.wl.Resource, @ptrCast(_display)).getVersion();
            }
            pub inline fn postNoMemory(_display: *Display) void {
                return @as(*server.wl.Resource, @ptrCast(_display)).postNoMemory();
            }
            pub inline fn getUserData(_display: *Display) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_display)).getUserData();
            }
            pub inline fn postError(_display: *Display, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_display)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const sync_since_version = 1;
                pub const get_registry_since_version = 1;

                /// The sync request asks the server to emit the 'done' event
                /// on the returned wl_callback object.  Since requests are
                /// handled in-order and events are delivered in-order, this can
                /// be used as a barrier to ensure all previous requests and the
                /// resulting events have been handled.
                ///
                /// The object returned by this request will be destroyed by the
                /// compositor after the callback is fired and as such the client must not
                /// attempt to use it after that point.
                ///
                /// The callback_data passed in the callback is undefined and should be ignored.
                sync: struct {
                    callback: u32,
                },

                /// This request creates a registry object that allows the client
                /// to list and bind the global objects available from the
                /// compositor.
                ///
                /// It should be noted that the server side resources consumed in
                /// response to a get_registry request can only be released when the
                /// client disconnects, not when the client side proxy is destroyed.
                /// Therefore, clients should invoke get_registry as infrequently as
                /// possible to avoid wasting memory.
                get_registry: struct {
                    registry: u32,
                },
            };
            pub inline fn setHandler(
                _display: *Display,
                comptime T: type,
                handle_request: *const fn (_display: *Display, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_display: *Display, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_display);
                _resource.setDispatcher(
                    common.Dispatcher(Display, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Display, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The error event is sent out when a fatal (non-recoverable)
            /// error has occurred.  The object_id argument is the object
            /// where the error occurred, most often in response to a request
            /// to that object.  The code identifies the error and is defined
            /// by the object interface.  As such, each interface defines its
            /// own set of error codes.  The message is a brief description
            /// of the error, for (debugging) convenience.
            pub fn sendError(_display: *Display, _object_id: *common.Object, _code: u32, _message: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_display);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_object_id) },
                    .{ .u = _code },
                    .{ .s = _message },
                };
                _resource.postEvent(0, &_args);
            }
            pub const error_since_version = 1;

            /// This event is used internally by the object ID management
            /// logic. When a client deletes an object that it had created,
            /// the server will send this event to acknowledge that it has
            /// seen the delete request. When the client receives this event,
            /// it will know that it can safely reuse the object ID.
            pub fn sendDeleteId(_display: *Display, _id: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_display);
                var _args = [_]common.Argument{
                    .{ .u = _id },
                };
                _resource.postEvent(1, &_args);
            }
            pub const delete_id_since_version = 1;
        };

        /// The singleton global registry object.  The server has a number of
        /// global objects that are available to all clients.  These objects
        /// typically represent an actual object in the server (for example,
        /// an input device) or they are singleton objects that provide
        /// extension functionality.
        ///
        /// When a client creates a registry object, the registry object
        /// will emit a global event for each global currently in the
        /// registry.  Globals come and go as a result of device or
        /// monitor hotplugs, reconfiguration or other events, and the
        /// registry will send out global and global_remove events to
        /// keep the client up to date with the changes.  To mark the end
        /// of the initial burst of events, the client can use the
        /// wl_display.sync request immediately after calling
        /// wl_display.get_registry.
        ///
        /// A client can bind to a global object by using the bind
        /// request.  This creates a client-side handle that lets the object
        /// emit events to the client and lets the client invoke requests on
        /// the object.
        pub const Registry = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.registry.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Registry {
                return @ptrCast(try server.wl.Resource.create(_client, Registry, _version, _id));
            }
            pub inline fn destroy(_registry: *Registry) void {
                return @as(*server.wl.Resource, @ptrCast(_registry)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Registry {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_registry: *Registry) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_registry)).getLink();
            }
            pub inline fn getClient(_registry: *Registry) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_registry)).getClient();
            }
            pub inline fn getId(_registry: *Registry) u32 {
                return @as(*server.wl.Resource, @ptrCast(_registry)).getId();
            }
            pub inline fn getVersion(_registry: *Registry) u32 {
                return @as(*server.wl.Resource, @ptrCast(_registry)).getVersion();
            }
            pub inline fn postNoMemory(_registry: *Registry) void {
                return @as(*server.wl.Resource, @ptrCast(_registry)).postNoMemory();
            }
            pub inline fn getUserData(_registry: *Registry) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_registry)).getUserData();
            }
            pub const Request = union(enum) {
                pub const bind_since_version = 1;

                /// Binds a new, client-created object to the server using the
                /// specified name as the identifier.
                bind: struct {
                    name: u32,
                    interface_name: [*:0]const u8,
                    version: u32,
                    id: u32,
                },
            };
            pub inline fn setHandler(
                _registry: *Registry,
                comptime T: type,
                handle_request: *const fn (_registry: *Registry, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_registry: *Registry, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_registry);
                _resource.setDispatcher(
                    common.Dispatcher(Registry, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Registry, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Notify the client of global objects.
            ///
            /// The event notifies the client that a global object with
            /// the given name is now available, and it implements the
            /// given version of the given interface.
            pub fn sendGlobal(_registry: *Registry, _name: u32, _interface: [*:0]const u8, _version: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_registry);
                var _args = [_]common.Argument{
                    .{ .u = _name },
                    .{ .s = _interface },
                    .{ .u = _version },
                };
                _resource.postEvent(0, &_args);
            }
            pub const global_since_version = 1;

            /// Notify the client of removed global objects.
            ///
            /// This event notifies the client that the global identified
            /// by name is no longer available.  If the client bound to
            /// the global using the bind request, the client should now
            /// destroy that object.
            ///
            /// The object remains valid and requests to the object will be
            /// ignored until the client destroys it, to avoid races between
            /// the global going away and a client sending a request to it.
            pub fn sendGlobalRemove(_registry: *Registry, _name: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_registry);
                var _args = [_]common.Argument{
                    .{ .u = _name },
                };
                _resource.postEvent(1, &_args);
            }
            pub const global_remove_since_version = 1;
        };

        /// Clients can handle the 'done' event to get notified when
        /// the related request is done.
        ///
        /// Note, because wl_callback objects are created from multiple independent
        /// factory interfaces, the wl_callback interface is frozen at version 1.
        pub const Callback = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.callback.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Callback {
                return @ptrCast(try server.wl.Resource.create(_client, Callback, _version, _id));
            }
            pub inline fn destroy(_callback: *Callback) void {
                return @as(*server.wl.Resource, @ptrCast(_callback)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Callback {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_callback: *Callback) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_callback)).getLink();
            }
            pub inline fn getClient(_callback: *Callback) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_callback)).getClient();
            }
            pub inline fn getId(_callback: *Callback) u32 {
                return @as(*server.wl.Resource, @ptrCast(_callback)).getId();
            }
            pub inline fn getVersion(_callback: *Callback) u32 {
                return @as(*server.wl.Resource, @ptrCast(_callback)).getVersion();
            }
            pub inline fn postNoMemory(_callback: *Callback) void {
                return @as(*server.wl.Resource, @ptrCast(_callback)).postNoMemory();
            }
            pub inline fn getUserData(_callback: *Callback) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_callback)).getUserData();
            }
            pub inline fn setHandler(
                _callback: *Callback,
                comptime T: type,
                comptime handle_destroy: ?fn (_callback: *Callback, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_callback);
                _resource.setDispatcher(
                    null,
                    null,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Callback, @ptrCast(__resource)),
                                @as(?*anyopaque, @ptrFromInt(@intFromPtr(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Notify the client when the related request is done.
            pub fn destroySendDone(_callback: *Callback, _callback_data: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_callback);
                var _args = [_]common.Argument{
                    .{ .u = _callback_data },
                };
                _resource.postEvent(0, &_args);
                _resource.destroy();
            }
            pub const done_since_version = 1;
        };

        /// A buffer provides the content for a wl_surface. Buffers are
        /// created through factory interfaces such as wl_shm, wp_linux_buffer_params
        /// (from the linux-dmabuf protocol extension) or similar. It has a width and
        /// a height and can be attached to a wl_surface, but the mechanism by which a
        /// client provides and updates the contents is defined by the buffer factory
        /// interface.
        ///
        /// Color channels are assumed to be electrical rather than optical (in other
        /// words, encoded with a transfer function) unless otherwise specified. If
        /// the buffer uses a format that has an alpha channel, the alpha channel is
        /// assumed to be premultiplied into the electrical color channel values
        /// (after transfer function encoding) unless otherwise specified.
        ///
        /// Note, because wl_buffer objects are created from multiple independent
        /// factory interfaces, the wl_buffer interface is frozen at version 1.
        pub const Buffer = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.buffer.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Buffer {
                return @ptrCast(try server.wl.Resource.create(_client, Buffer, _version, _id));
            }
            pub inline fn destroy(_buffer: *Buffer) void {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Buffer {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_buffer: *Buffer) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).getLink();
            }
            pub inline fn getClient(_buffer: *Buffer) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).getClient();
            }
            pub inline fn getId(_buffer: *Buffer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).getId();
            }
            pub inline fn getVersion(_buffer: *Buffer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).getVersion();
            }
            pub inline fn postNoMemory(_buffer: *Buffer) void {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).postNoMemory();
            }
            pub inline fn getUserData(_buffer: *Buffer) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_buffer)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// Destroy a buffer. If and how you need to release the backing
                /// storage is defined by the buffer factory interface.
                ///
                /// For possible side-effects to a surface, see wl_surface.attach.
                destroy: void,
            };
            pub inline fn setHandler(
                _buffer: *Buffer,
                comptime T: type,
                handle_request: *const fn (_buffer: *Buffer, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_buffer: *Buffer, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_buffer);
                _resource.setDispatcher(
                    common.Dispatcher(Buffer, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Buffer, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent when this wl_buffer is no longer used by the compositor.
            ///
            /// For more information on when release events may or may not be sent,
            /// and what consequences it has, please see the description of
            /// wl_surface.attach.
            ///
            /// If a client receives a release event before the frame callback
            /// requested in the same wl_surface.commit that attaches this
            /// wl_buffer to a surface, then the client is immediately free to
            /// reuse the buffer and its backing storage, and does not need a
            /// second buffer for the next surface content update. Typically
            /// this is possible, when the compositor maintains a copy of the
            /// wl_surface contents, e.g. as a GL texture. This is an important
            /// optimization for GL(ES) compositors with wl_shm clients.
            pub fn sendRelease(_buffer: *Buffer) void {
                const _resource: *server.wl.Resource = @ptrCast(_buffer);
                _resource.postEvent(0, null);
            }
            pub const release_since_version = 1;
        };

        /// A compositor.  This object is a singleton global.  The
        /// compositor is in charge of combining the contents of multiple
        /// surfaces into one displayable output.
        pub const Compositor = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.compositor.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Compositor {
                return @ptrCast(try server.wl.Resource.create(_client, Compositor, _version, _id));
            }
            pub inline fn destroy(_compositor: *Compositor) void {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Compositor {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_compositor: *Compositor) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).getLink();
            }
            pub inline fn getClient(_compositor: *Compositor) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).getClient();
            }
            pub inline fn getId(_compositor: *Compositor) u32 {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).getId();
            }
            pub inline fn getVersion(_compositor: *Compositor) u32 {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).getVersion();
            }
            pub inline fn postNoMemory(_compositor: *Compositor) void {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).postNoMemory();
            }
            pub inline fn getUserData(_compositor: *Compositor) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_compositor)).getUserData();
            }
            pub const Request = union(enum) {
                pub const create_surface_since_version = 1;
                pub const create_region_since_version = 1;

                /// Ask the compositor to create a new surface.
                create_surface: struct {
                    id: u32,
                },

                /// Ask the compositor to create a new region.
                create_region: struct {
                    id: u32,
                },
            };
            pub inline fn setHandler(
                _compositor: *Compositor,
                comptime T: type,
                handle_request: *const fn (_compositor: *Compositor, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_compositor: *Compositor, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_compositor);
                _resource.setDispatcher(
                    common.Dispatcher(Compositor, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Compositor, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// A surface is a rectangular area that may be displayed on zero
        /// or more outputs, and shown any number of times at the compositor's
        /// discretion. They can present wl_buffers, receive user input, and
        /// define a local coordinate system.
        ///
        /// The size of a surface (and relative positions on it) is described
        /// in surface-local coordinates, which may differ from the buffer
        /// coordinates of the pixel content, in case a buffer_transform
        /// or a buffer_scale is used.
        ///
        /// A surface without a "role" is fairly useless: a compositor does
        /// not know where, when or how to present it. The role is the
        /// purpose of a wl_surface. Examples of roles are a cursor for a
        /// pointer (as set by wl_pointer.set_cursor), a drag icon
        /// (wl_data_device.start_drag), a sub-surface
        /// (wl_subcompositor.get_subsurface), and a window as defined by a
        /// shell protocol (e.g. wl_shell.get_shell_surface).
        ///
        /// A surface can have only one role at a time. Initially a
        /// wl_surface does not have a role. Once a wl_surface is given a
        /// role, it is set permanently for the whole lifetime of the
        /// wl_surface object. Giving the current role again is allowed,
        /// unless explicitly forbidden by the relevant interface
        /// specification.
        ///
        /// Surface roles are given by requests in other interfaces such as
        /// wl_pointer.set_cursor. The request should explicitly mention
        /// that this request gives a role to a wl_surface. Often, this
        /// request also creates a new protocol object that represents the
        /// role and adds additional functionality to wl_surface. When a
        /// client wants to destroy a wl_surface, they must destroy this role
        /// object before the wl_surface, otherwise a defunct_role_object error is
        /// sent.
        ///
        /// Destroying the role object does not remove the role from the
        /// wl_surface, but it may stop the wl_surface from "playing the role".
        /// For instance, if a wl_subsurface object is destroyed, the wl_surface
        /// it was created for will be unmapped and forget its position and
        /// z-order. It is allowed to create a wl_subsurface for the same
        /// wl_surface again, but it is not allowed to use the wl_surface as
        /// a cursor (cursor is a different role than sub-surface, and role
        /// switching is not allowed).
        pub const Surface = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.surface.interface;
            pub const Error = common.wl.surface.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Surface {
                return @ptrCast(try server.wl.Resource.create(_client, Surface, _version, _id));
            }
            pub inline fn destroy(_surface: *Surface) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Surface {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_surface: *Surface) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getLink();
            }
            pub inline fn getClient(_surface: *Surface) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getClient();
            }
            pub inline fn getId(_surface: *Surface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getId();
            }
            pub inline fn getVersion(_surface: *Surface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getVersion();
            }
            pub inline fn postNoMemory(_surface: *Surface) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).postNoMemory();
            }
            pub inline fn getUserData(_surface: *Surface) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getUserData();
            }
            pub inline fn postError(_surface: *Surface, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const attach_since_version = 1;
                pub const damage_since_version = 1;
                pub const frame_since_version = 1;
                pub const set_opaque_region_since_version = 1;
                pub const set_input_region_since_version = 1;
                pub const commit_since_version = 1;
                pub const set_buffer_transform_since_version = 2;
                pub const set_buffer_scale_since_version = 3;
                pub const damage_buffer_since_version = 4;

                /// Deletes the surface and invalidates its object ID.
                destroy: void,
                /// Set a buffer as the content of this surface.
                ///
                /// The new size of the surface is calculated based on the buffer
                /// size transformed by the inverse buffer_transform and the
                /// inverse buffer_scale. This means that at commit time the supplied
                /// buffer size must be an integer multiple of the buffer_scale. If
                /// that's not the case, an invalid_size error is sent.
                ///
                /// The x and y arguments specify the location of the new pending
                /// buffer's upper left corner, relative to the current buffer's upper
                /// left corner, in surface-local coordinates. In other words, the
                /// x and y, combined with the new surface size define in which
                /// directions the surface's size changes. Setting anything other than 0
                /// as x and y arguments is discouraged, and should instead be replaced
                /// with using the separate wl_surface.offset request.
                ///
                /// When the bound wl_surface version is 5 or higher, passing any
                /// non-zero x or y is a protocol violation, and will result in an
                /// 'invalid_offset' error being raised. The x and y arguments are ignored
                /// and do not change the pending state. To achieve equivalent semantics,
                /// use wl_surface.offset.
                ///
                /// Surface contents are double-buffered state, see wl_surface.commit.
                ///
                /// The initial surface contents are void; there is no content.
                /// wl_surface.attach assigns the given wl_buffer as the pending
                /// wl_buffer. wl_surface.commit makes the pending wl_buffer the new
                /// surface contents, and the size of the surface becomes the size
                /// calculated from the wl_buffer, as described above. After commit,
                /// there is no pending buffer until the next attach.
                ///
                /// Committing a pending wl_buffer allows the compositor to read the
                /// pixels in the wl_buffer. The compositor may access the pixels at
                /// any time after the wl_surface.commit request. When the compositor
                /// will not access the pixels anymore, it will send the
                /// wl_buffer.release event. Only after receiving wl_buffer.release,
                /// the client may reuse the wl_buffer. A wl_buffer that has been
                /// attached and then replaced by another attach instead of committed
                /// will not receive a release event, and is not used by the
                /// compositor.
                ///
                /// If a pending wl_buffer has been committed to more than one wl_surface,
                /// the delivery of wl_buffer.release events becomes undefined. A well
                /// behaved client should not rely on wl_buffer.release events in this
                /// case. Alternatively, a client could create multiple wl_buffer objects
                /// from the same backing storage or use a protocol extension providing
                /// per-commit release notifications.
                ///
                /// Destroying the wl_buffer after wl_buffer.release does not change
                /// the surface contents. Destroying the wl_buffer before wl_buffer.release
                /// is allowed as long as the underlying buffer storage isn't re-used (this
                /// can happen e.g. on client process termination). However, if the client
                /// destroys the wl_buffer before receiving the wl_buffer.release event and
                /// mutates the underlying buffer storage, the surface contents become
                /// undefined immediately.
                ///
                /// If wl_surface.attach is sent with a NULL wl_buffer, the
                /// following wl_surface.commit will remove the surface content.
                ///
                /// If a pending wl_buffer has been destroyed, the result is not specified.
                /// Many compositors are known to remove the surface content on the following
                /// wl_surface.commit, but this behaviour is not universal. Clients seeking to
                /// maximise compatibility should not destroy pending buffers and should
                /// ensure that they explicitly remove content from surfaces, even after
                /// destroying buffers.
                attach: struct {
                    buffer: ?*server.wl.Buffer,
                    x: i32,
                    y: i32,
                },

                /// This request is used to describe the regions where the pending
                /// buffer is different from the current surface contents, and where
                /// the surface therefore needs to be repainted. The compositor
                /// ignores the parts of the damage that fall outside of the surface.
                ///
                /// Damage is double-buffered state, see wl_surface.commit.
                ///
                /// The damage rectangle is specified in surface-local coordinates,
                /// where x and y specify the upper left corner of the damage rectangle.
                ///
                /// The initial value for pending damage is empty: no damage.
                /// wl_surface.damage adds pending damage: the new pending damage
                /// is the union of old pending damage and the given rectangle.
                ///
                /// wl_surface.commit assigns pending damage as the current damage,
                /// and clears pending damage. The server will clear the current
                /// damage as it repaints the surface.
                ///
                /// Note! New clients should not use this request. Instead damage can be
                /// posted with wl_surface.damage_buffer which uses buffer coordinates
                /// instead of surface coordinates.
                damage: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// Request a notification when it is a good time to start drawing a new
                /// frame, by creating a frame callback. This is useful for throttling
                /// redrawing operations, and driving animations.
                ///
                /// When a client is animating on a wl_surface, it can use the 'frame'
                /// request to get notified when it is a good time to draw and commit the
                /// next frame of animation. If the client commits an update earlier than
                /// that, it is likely that some updates will not make it to the display,
                /// and the client is wasting resources by drawing too often.
                ///
                /// The frame request will take effect on the next wl_surface.commit.
                /// The notification will only be posted for one frame unless
                /// requested again. For a wl_surface, the notifications are posted in
                /// the order the frame requests were committed.
                ///
                /// The server must send the notifications so that a client
                /// will not send excessive updates, while still allowing
                /// the highest possible update rate for clients that wait for the reply
                /// before drawing again. The server should give some time for the client
                /// to draw and commit after sending the frame callback events to let it
                /// hit the next output refresh.
                ///
                /// A server should avoid signaling the frame callbacks if the
                /// surface is not visible in any way, e.g. the surface is off-screen,
                /// or completely obscured by other opaque surfaces.
                ///
                /// The object returned by this request will be destroyed by the
                /// compositor after the callback is fired and as such the client must not
                /// attempt to use it after that point.
                ///
                /// The callback_data passed in the callback is the current time, in
                /// milliseconds, with an undefined base.
                frame: struct {
                    callback: u32,
                },

                /// This request sets the region of the surface that contains
                /// opaque content.
                ///
                /// The opaque region is an optimization hint for the compositor
                /// that lets it optimize the redrawing of content behind opaque
                /// regions.  Setting an opaque region is not required for correct
                /// behaviour, but marking transparent content as opaque will result
                /// in repaint artifacts.
                ///
                /// The opaque region is specified in surface-local coordinates.
                ///
                /// The compositor ignores the parts of the opaque region that fall
                /// outside of the surface.
                ///
                /// Opaque region is double-buffered state, see wl_surface.commit.
                ///
                /// wl_surface.set_opaque_region changes the pending opaque region.
                /// wl_surface.commit copies the pending region to the current region.
                /// Otherwise, the pending and current regions are never changed.
                ///
                /// The initial value for an opaque region is empty. Setting the pending
                /// opaque region has copy semantics, and the wl_region object can be
                /// destroyed immediately. A NULL wl_region causes the pending opaque
                /// region to be set to empty.
                set_opaque_region: struct {
                    region: ?*server.wl.Region,
                },

                /// This request sets the region of the surface that can receive
                /// pointer and touch events.
                ///
                /// Input events happening outside of this region will try the next
                /// surface in the server surface stack. The compositor ignores the
                /// parts of the input region that fall outside of the surface.
                ///
                /// The input region is specified in surface-local coordinates.
                ///
                /// Input region is double-buffered state, see wl_surface.commit.
                ///
                /// wl_surface.set_input_region changes the pending input region.
                /// wl_surface.commit copies the pending region to the current region.
                /// Otherwise the pending and current regions are never changed,
                /// except cursor and icon surfaces are special cases, see
                /// wl_pointer.set_cursor and wl_data_device.start_drag.
                ///
                /// The initial value for an input region is infinite. That means the
                /// whole surface will accept input. Setting the pending input region
                /// has copy semantics, and the wl_region object can be destroyed
                /// immediately. A NULL wl_region causes the input region to be set
                /// to infinite.
                set_input_region: struct {
                    region: ?*server.wl.Region,
                },

                /// Surface state (input, opaque, and damage regions, attached buffers,
                /// etc.) is double-buffered. Protocol requests modify the pending state,
                /// as opposed to the active state in use by the compositor.
                ///
                /// A commit request atomically creates a content update from the pending
                /// state, even if the pending state has not been touched. The content
                /// update is placed in a queue until it becomes active. After commit, the
                /// new pending state is as documented for each related request.
                ///
                /// When the content update is applied, the wl_buffer is applied before all
                /// other state. This means that all coordinates in double-buffered state
                /// are relative to the newly attached wl_buffers, except for
                /// wl_surface.attach itself. If there is no newly attached wl_buffer, the
                /// coordinates are relative to the previous content update.
                ///
                /// All requests that need a commit to become effective are documented
                /// to affect double-buffered state.
                ///
                /// Other interfaces may add further double-buffered surface state.
                commit: void,
                /// This request sets the transformation that the client has already applied
                /// to the content of the buffer. The accepted values for the transform
                /// parameter are the values for wl_output.transform.
                ///
                /// The compositor applies the inverse of this transformation whenever it
                /// uses the buffer contents.
                ///
                /// Buffer transform is double-buffered state, see wl_surface.commit.
                ///
                /// A newly created surface has its buffer transformation set to normal.
                ///
                /// wl_surface.set_buffer_transform changes the pending buffer
                /// transformation. wl_surface.commit copies the pending buffer
                /// transformation to the current one. Otherwise, the pending and current
                /// values are never changed.
                ///
                /// The purpose of this request is to allow clients to render content
                /// according to the output transform, thus permitting the compositor to
                /// use certain optimizations even if the display is rotated. Using
                /// hardware overlays and scanning out a client buffer for fullscreen
                /// surfaces are examples of such optimizations. Those optimizations are
                /// highly dependent on the compositor implementation, so the use of this
                /// request should be considered on a case-by-case basis.
                ///
                /// Note that if the transform value includes 90 or 270 degree rotation,
                /// the width of the buffer will become the surface height and the height
                /// of the buffer will become the surface width.
                ///
                /// If transform is not one of the values from the
                /// wl_output.transform enum the invalid_transform protocol error
                /// is raised.
                set_buffer_transform: struct {
                    transform: common.wl.output.Transform,
                },

                /// This request sets an optional scaling factor on how the compositor
                /// interprets the contents of the buffer attached to the window.
                ///
                /// Buffer scale is double-buffered state, see wl_surface.commit.
                ///
                /// A newly created surface has its buffer scale set to 1.
                ///
                /// wl_surface.set_buffer_scale changes the pending buffer scale.
                /// wl_surface.commit copies the pending buffer scale to the current one.
                /// Otherwise, the pending and current values are never changed.
                ///
                /// The purpose of this request is to allow clients to supply higher
                /// resolution buffer data for use on high resolution outputs. It is
                /// intended that you pick the same buffer scale as the scale of the
                /// output that the surface is displayed on. This means the compositor
                /// can avoid scaling when rendering the surface on that output.
                ///
                /// Note that if the scale is larger than 1, then you have to attach
                /// a buffer that is larger (by a factor of scale in each dimension)
                /// than the desired surface size.
                ///
                /// If scale is not greater than 0 the invalid_scale protocol error is
                /// raised.
                set_buffer_scale: struct {
                    scale: i32,
                },

                /// This request is used to describe the regions where the pending
                /// buffer is different from the current surface contents, and where
                /// the surface therefore needs to be repainted. The compositor
                /// ignores the parts of the damage that fall outside of the surface.
                ///
                /// Damage is double-buffered state, see wl_surface.commit.
                ///
                /// The damage rectangle is specified in buffer coordinates,
                /// where x and y specify the upper left corner of the damage rectangle.
                ///
                /// The initial value for pending damage is empty: no damage.
                /// wl_surface.damage_buffer adds pending damage: the new pending
                /// damage is the union of old pending damage and the given rectangle.
                ///
                /// wl_surface.commit assigns pending damage as the current damage,
                /// and clears pending damage. The server will clear the current
                /// damage as it repaints the surface.
                ///
                /// This request differs from wl_surface.damage in only one way - it
                /// takes damage in buffer coordinates instead of surface-local
                /// coordinates. While this generally is more intuitive than surface
                /// coordinates, it is especially desirable when using wp_viewport
                /// or when a drawing library (like EGL) is unaware of buffer scale
                /// and buffer transform.
                ///
                /// Note: Because buffer transformation changes and damage requests may
                /// be interleaved in the protocol stream, it is impossible to determine
                /// the actual mapping between surface and buffer damage until
                /// wl_surface.commit time. Therefore, compositors wishing to take both
                /// kinds of damage into account will have to accumulate damage from the
                /// two requests separately and only transform from one to the other
                /// after receiving the wl_surface.commit.
                damage_buffer: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },
            };
            pub inline fn setHandler(
                _surface: *Surface,
                comptime T: type,
                handle_request: *const fn (_surface: *Surface, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_surface: *Surface, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_surface);
                _resource.setDispatcher(
                    common.Dispatcher(Surface, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Surface, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This is emitted whenever a surface's creation, movement, or resizing
            /// results in some part of it being within the scanout region of an
            /// output.
            ///
            /// Note that a surface may be overlapping with zero or more outputs.
            pub fn sendEnter(_surface: *Surface, _output: *server.wl.Output) void {
                const _resource: *server.wl.Resource = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _resource.postEvent(0, &_args);
            }
            pub const enter_since_version = 1;

            /// This is emitted whenever a surface's creation, movement, or resizing
            /// results in it no longer having any part of it within the scanout region
            /// of an output.
            ///
            /// Clients should not use the number of outputs the surface is on for frame
            /// throttling purposes. The surface might be hidden even if no leave event
            /// has been sent, and the compositor might expect new surface content
            /// updates even if no enter event has been sent. The frame event should be
            /// used instead.
            pub fn sendLeave(_surface: *Surface, _output: *server.wl.Output) void {
                const _resource: *server.wl.Resource = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const leave_since_version = 1;
        };

        /// A region object describes an area.
        ///
        /// Region objects are used to describe the opaque and input
        /// regions of a surface.
        pub const Region = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.region.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Region {
                return @ptrCast(try server.wl.Resource.create(_client, Region, _version, _id));
            }
            pub inline fn destroy(_region: *Region) void {
                return @as(*server.wl.Resource, @ptrCast(_region)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Region {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_region: *Region) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_region)).getLink();
            }
            pub inline fn getClient(_region: *Region) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_region)).getClient();
            }
            pub inline fn getId(_region: *Region) u32 {
                return @as(*server.wl.Resource, @ptrCast(_region)).getId();
            }
            pub inline fn getVersion(_region: *Region) u32 {
                return @as(*server.wl.Resource, @ptrCast(_region)).getVersion();
            }
            pub inline fn postNoMemory(_region: *Region) void {
                return @as(*server.wl.Resource, @ptrCast(_region)).postNoMemory();
            }
            pub inline fn getUserData(_region: *Region) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_region)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const add_since_version = 1;
                pub const subtract_since_version = 1;

                /// Destroy the region.  This will invalidate the object ID.
                destroy: void,
                /// Add the specified rectangle to the region.
                add: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// Subtract the specified rectangle from the region.
                subtract: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },
            };
            pub inline fn setHandler(
                _region: *Region,
                comptime T: type,
                handle_request: *const fn (_region: *Region, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_region: *Region, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_region);
                _resource.setDispatcher(
                    common.Dispatcher(Region, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Region, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The global interface exposing sub-surface compositing capabilities.
        /// A wl_surface, that has sub-surfaces associated, is called the
        /// parent surface. Sub-surfaces can be arbitrarily nested and create
        /// a tree of sub-surfaces.
        ///
        /// The root surface in a tree of sub-surfaces is the main
        /// surface. The main surface cannot be a sub-surface, because
        /// sub-surfaces must always have a parent.
        ///
        /// A main surface with its sub-surfaces forms a (compound) window.
        /// For window management purposes, this set of wl_surface objects is
        /// to be considered as a single window, and it should also behave as
        /// such.
        ///
        /// The aim of sub-surfaces is to offload some of the compositing work
        /// within a window from clients to the compositor. A prime example is
        /// a video player with decorations and video in separate wl_surface
        /// objects. This should allow the compositor to pass YUV video buffer
        /// processing to dedicated overlay hardware when possible.
        pub const Subcompositor = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.subcompositor.interface;
            pub const Error = common.wl.subcompositor.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Subcompositor {
                return @ptrCast(try server.wl.Resource.create(_client, Subcompositor, _version, _id));
            }
            pub inline fn destroy(_subcompositor: *Subcompositor) void {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Subcompositor {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_subcompositor: *Subcompositor) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).getLink();
            }
            pub inline fn getClient(_subcompositor: *Subcompositor) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).getClient();
            }
            pub inline fn getId(_subcompositor: *Subcompositor) u32 {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).getId();
            }
            pub inline fn getVersion(_subcompositor: *Subcompositor) u32 {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).getVersion();
            }
            pub inline fn postNoMemory(_subcompositor: *Subcompositor) void {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).postNoMemory();
            }
            pub inline fn getUserData(_subcompositor: *Subcompositor) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).getUserData();
            }
            pub inline fn postError(_subcompositor: *Subcompositor, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_subcompositor)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_subsurface_since_version = 1;

                /// Informs the server that the client will not be using this
                /// protocol object anymore. This does not affect any other
                /// objects, wl_subsurface objects included.
                destroy: void,
                /// Create a sub-surface interface for the given surface, and
                /// associate it with the given parent surface. This turns a
                /// plain wl_surface into a sub-surface.
                ///
                /// The to-be sub-surface must not already have another role, and it
                /// must not have an existing wl_subsurface object. Otherwise the
                /// bad_surface protocol error is raised.
                ///
                /// Adding sub-surfaces to a parent is a double-buffered operation on the
                /// parent (see wl_surface.commit). The effect of adding a sub-surface
                /// becomes visible on the next time the state of the parent surface is
                /// applied.
                ///
                /// The parent surface must not be one of the child surface's descendants,
                /// and the parent must be different from the child surface, otherwise the
                /// bad_parent protocol error is raised.
                ///
                /// This request modifies the behaviour of wl_surface.commit request on
                /// the sub-surface, see the documentation on wl_subsurface interface.
                get_subsurface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                    parent: *server.wl.Surface,
                },
            };
            pub inline fn setHandler(
                _subcompositor: *Subcompositor,
                comptime T: type,
                handle_request: *const fn (_subcompositor: *Subcompositor, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_subcompositor: *Subcompositor, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_subcompositor);
                _resource.setDispatcher(
                    common.Dispatcher(Subcompositor, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Subcompositor, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An additional interface to a wl_surface object, which has been
        /// made a sub-surface. A sub-surface has one parent surface. A
        /// sub-surface's size and position are not limited to that of the parent.
        /// Particularly, a sub-surface is not automatically clipped to its
        /// parent's area.
        ///
        /// A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
        /// and the parent surface is mapped. The order of which one happens
        /// first is irrelevant. A sub-surface is hidden if the parent becomes
        /// hidden, or if a NULL wl_buffer is applied. These rules apply
        /// recursively through the tree of surfaces.
        ///
        /// The behaviour of a wl_surface.commit request on a sub-surface
        /// depends on the sub-surface's mode. The possible modes are
        /// synchronized and desynchronized, see methods
        /// wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
        /// mode caches the wl_surface state to be applied when the parent's
        /// state gets applied, and desynchronized mode applies the pending
        /// wl_surface state directly. A sub-surface is initially in the
        /// synchronized mode.
        ///
        /// Sub-surfaces also have another kind of state, which is managed by
        /// wl_subsurface requests, as opposed to wl_surface requests. This
        /// state includes the sub-surface position relative to the parent
        /// surface (wl_subsurface.set_position), and the stacking order of
        /// the parent and its sub-surfaces (wl_subsurface.place_above and
        /// .place_below). This state is applied when the parent surface's
        /// wl_surface state is applied, regardless of the sub-surface's mode.
        /// As the exception, set_sync and set_desync are effective immediately.
        ///
        /// The main surface can be thought to be always in desynchronized mode,
        /// since it does not have a parent in the sub-surfaces sense.
        ///
        /// Even if a sub-surface is in desynchronized mode, it will behave as
        /// in synchronized mode, if its parent surface behaves as in
        /// synchronized mode. This rule is applied recursively throughout the
        /// tree of surfaces. This means, that one can set a sub-surface into
        /// synchronized mode, and then assume that all its child and grand-child
        /// sub-surfaces are synchronized, too, without explicitly setting them.
        ///
        /// Destroying a sub-surface takes effect immediately. If you need to
        /// synchronize the removal of a sub-surface to the parent surface update,
        /// unmap the sub-surface first by attaching a NULL wl_buffer, update parent,
        /// and then destroy the sub-surface.
        ///
        /// If the parent wl_surface object is destroyed, the sub-surface is
        /// unmapped.
        ///
        /// A sub-surface never has the keyboard focus of any seat.
        ///
        /// The wl_surface.offset request is ignored: clients must use set_position
        /// instead to move the sub-surface.
        pub const Subsurface = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.subsurface.interface;
            pub const Error = common.wl.subsurface.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Subsurface {
                return @ptrCast(try server.wl.Resource.create(_client, Subsurface, _version, _id));
            }
            pub inline fn destroy(_subsurface: *Subsurface) void {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Subsurface {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_subsurface: *Subsurface) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).getLink();
            }
            pub inline fn getClient(_subsurface: *Subsurface) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).getClient();
            }
            pub inline fn getId(_subsurface: *Subsurface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).getId();
            }
            pub inline fn getVersion(_subsurface: *Subsurface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).getVersion();
            }
            pub inline fn postNoMemory(_subsurface: *Subsurface) void {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).postNoMemory();
            }
            pub inline fn getUserData(_subsurface: *Subsurface) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).getUserData();
            }
            pub inline fn postError(_subsurface: *Subsurface, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_subsurface)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_position_since_version = 1;
                pub const place_above_since_version = 1;
                pub const place_below_since_version = 1;
                pub const set_sync_since_version = 1;
                pub const set_desync_since_version = 1;

                /// The sub-surface interface is removed from the wl_surface object
                /// that was turned into a sub-surface with a
                /// wl_subcompositor.get_subsurface request. The wl_surface's association
                /// to the parent is deleted. The wl_surface is unmapped immediately.
                destroy: void,
                /// This schedules a sub-surface position change.
                /// The sub-surface will be moved so that its origin (top left
                /// corner pixel) will be at the location x, y of the parent surface
                /// coordinate system. The coordinates are not restricted to the parent
                /// surface area. Negative values are allowed.
                ///
                /// The scheduled coordinates will take effect whenever the state of the
                /// parent surface is applied.
                ///
                /// If more than one set_position request is invoked by the client before
                /// the commit of the parent surface, the position of a new request always
                /// replaces the scheduled position from any previous request.
                ///
                /// The initial position is 0, 0.
                set_position: struct {
                    x: i32,
                    y: i32,
                },

                /// This sub-surface is taken from the stack, and put back just
                /// above the reference surface, changing the z-order of the sub-surfaces.
                /// The reference surface must be one of the sibling surfaces, or the
                /// parent surface. Using any other surface, including this sub-surface,
                /// will cause a protocol error.
                ///
                /// The z-order is double-buffered. Requests are handled in order and
                /// applied immediately to a pending state. The final pending state is
                /// copied to the active state the next time the state of the parent
                /// surface is applied.
                ///
                /// A new sub-surface is initially added as the top-most in the stack
                /// of its siblings and parent.
                place_above: struct {
                    sibling: *server.wl.Surface,
                },

                /// The sub-surface is placed just below the reference surface.
                /// See wl_subsurface.place_above.
                place_below: struct {
                    sibling: *server.wl.Surface,
                },

                /// Change the commit behaviour of the sub-surface to synchronized
                /// mode, also described as the parent dependent mode.
                ///
                /// In synchronized mode, wl_surface.commit on a sub-surface will
                /// accumulate the committed state in a cache, but the state will
                /// not be applied and hence will not change the compositor output.
                /// The cached state is applied to the sub-surface immediately after
                /// the parent surface's state is applied. This ensures atomic
                /// updates of the parent and all its synchronized sub-surfaces.
                /// Applying the cached state will invalidate the cache, so further
                /// parent surface commits do not (re-)apply old state.
                ///
                /// See wl_subsurface for the recursive effect of this mode.
                set_sync: void,
                /// Change the commit behaviour of the sub-surface to desynchronized
                /// mode, also described as independent or freely running mode.
                ///
                /// In desynchronized mode, wl_surface.commit on a sub-surface will
                /// apply the pending state directly, without caching, as happens
                /// normally with a wl_surface. Calling wl_surface.commit on the
                /// parent surface has no effect on the sub-surface's wl_surface
                /// state. This mode allows a sub-surface to be updated on its own.
                ///
                /// If cached state exists when wl_surface.commit is called in
                /// desynchronized mode, the pending state is added to the cached
                /// state, and applied as a whole. This invalidates the cache.
                ///
                /// Note: even if a sub-surface is set to desynchronized, a parent
                /// sub-surface may override it to behave as synchronized. For details,
                /// see wl_subsurface.
                ///
                /// If a surface's parent surface behaves as desynchronized, then
                /// the cached state is applied on set_desync.
                set_desync: void,
            };
            pub inline fn setHandler(
                _subsurface: *Subsurface,
                comptime T: type,
                handle_request: *const fn (_subsurface: *Subsurface, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_subsurface: *Subsurface, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_subsurface);
                _resource.setDispatcher(
                    common.Dispatcher(Subsurface, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Subsurface, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// A singleton global object that provides support for shared
        /// memory.
        ///
        /// Clients can create wl_shm_pool objects using the create_pool
        /// request.
        ///
        /// On binding the wl_shm object one or more format events
        /// are emitted to inform clients about the valid pixel formats
        /// that can be used for buffers.
        pub const Shm = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.shm.interface;
            pub const Error = common.wl.shm.Error;
            pub const Format = common.wl.shm.Format;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Shm {
                return @ptrCast(try server.wl.Resource.create(_client, Shm, _version, _id));
            }
            pub inline fn destroy(_shm: *Shm) void {
                return @as(*server.wl.Resource, @ptrCast(_shm)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Shm {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_shm: *Shm) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_shm)).getLink();
            }
            pub inline fn getClient(_shm: *Shm) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_shm)).getClient();
            }
            pub inline fn getId(_shm: *Shm) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shm)).getId();
            }
            pub inline fn getVersion(_shm: *Shm) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shm)).getVersion();
            }
            pub inline fn postNoMemory(_shm: *Shm) void {
                return @as(*server.wl.Resource, @ptrCast(_shm)).postNoMemory();
            }
            pub inline fn getUserData(_shm: *Shm) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_shm)).getUserData();
            }
            pub inline fn postError(_shm: *Shm, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_shm)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const create_pool_since_version = 1;

                /// Create a new wl_shm_pool object.
                ///
                /// The pool can be used to create shared memory based buffer
                /// objects.  The server will mmap size bytes of the passed file
                /// descriptor, to use as backing memory for the pool.
                create_pool: struct {
                    id: u32,
                    fd: i32,
                    size: i32,
                },
            };
            pub inline fn setHandler(
                _shm: *Shm,
                comptime T: type,
                handle_request: *const fn (_shm: *Shm, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_shm: *Shm, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_shm);
                _resource.setDispatcher(
                    common.Dispatcher(Shm, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Shm, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Informs the client about a valid pixel format that
            /// can be used for buffers. Known formats include
            /// argb8888 and xrgb8888.
            pub fn sendFormat(_shm: *Shm, _format: Format) void {
                const _resource: *server.wl.Resource = @ptrCast(_shm);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Format)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_format))),
                        .@"struct" => @bitCast(_format),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const format_since_version = 1;
        };

        /// The wl_shm_pool object encapsulates a piece of memory shared
        /// between the compositor and client.  Through the wl_shm_pool
        /// object, the client can allocate shared memory wl_buffer objects.
        /// All objects created through the same pool share the same
        /// underlying mapped memory. Reusing the mapped memory avoids the
        /// setup/teardown overhead and is useful when interactively resizing
        /// a surface or for many small buffers.
        pub const ShmPool = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wl.shm_pool.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ShmPool {
                return @ptrCast(try server.wl.Resource.create(_client, ShmPool, _version, _id));
            }
            pub inline fn destroy(_shm_pool: *ShmPool) void {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ShmPool {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_shm_pool: *ShmPool) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).getLink();
            }
            pub inline fn getClient(_shm_pool: *ShmPool) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).getClient();
            }
            pub inline fn getId(_shm_pool: *ShmPool) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).getId();
            }
            pub inline fn getVersion(_shm_pool: *ShmPool) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).getVersion();
            }
            pub inline fn postNoMemory(_shm_pool: *ShmPool) void {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).postNoMemory();
            }
            pub inline fn getUserData(_shm_pool: *ShmPool) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_shm_pool)).getUserData();
            }
            pub const Request = union(enum) {
                pub const create_buffer_since_version = 1;
                pub const destroy_since_version = 1;
                pub const resize_since_version = 1;

                /// Create a wl_buffer object from the pool.
                ///
                /// The buffer is created offset bytes into the pool and has
                /// width and height as specified.  The stride argument specifies
                /// the number of bytes from the beginning of one row to the beginning
                /// of the next.  The format is the pixel format of the buffer and
                /// must be one of those advertised through the wl_shm.format event.
                ///
                /// A buffer will keep a reference to the pool it was created from
                /// so it is valid to destroy the pool immediately after creating
                /// a buffer from it.
                create_buffer: struct {
                    id: u32,
                    offset: i32,
                    width: i32,
                    height: i32,
                    stride: i32,
                    format: common.wl.shm.Format,
                },

                /// Destroy the shared memory pool.
                ///
                /// The mmapped memory will be released when all
                /// buffers that have been created from this pool
                /// are gone.
                destroy: void,
                /// This request will cause the server to remap the backing memory
                /// for the pool from the file descriptor passed when the pool was
                /// created, but using the new size.  This request can only be
                /// used to make the pool bigger.
                ///
                /// This request only changes the amount of bytes that are mmapped
                /// by the server and does not touch the file corresponding to the
                /// file descriptor passed at creation time. It is the client's
                /// responsibility to ensure that the file is at least as big as
                /// the new pool size.
                resize: struct {
                    size: i32,
                },
            };
            pub inline fn setHandler(
                _shm_pool: *ShmPool,
                comptime T: type,
                handle_request: *const fn (_shm_pool: *ShmPool, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_shm_pool: *ShmPool, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_shm_pool);
                _resource.setDispatcher(
                    common.Dispatcher(ShmPool, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ShmPool, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An output describes part of the compositor geometry.  The
        /// compositor works in the 'compositor coordinate system' and an
        /// output corresponds to a rectangular area in that space that is
        /// actually visible.  This typically corresponds to a monitor that
        /// displays part of the compositor space.  This object is published
        /// as global during start up, or when a monitor is hotplugged.
        pub const Output = opaque {
            pub const generated_version = 4;
            pub const interface = &common.wl.output.interface;
            pub const Subpixel = common.wl.output.Subpixel;
            pub const Transform = common.wl.output.Transform;
            pub const Mode = common.wl.output.Mode;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Output {
                return @ptrCast(try server.wl.Resource.create(_client, Output, _version, _id));
            }
            pub inline fn destroy(_output: *Output) void {
                return @as(*server.wl.Resource, @ptrCast(_output)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Output {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_output: *Output) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_output)).getLink();
            }
            pub inline fn getClient(_output: *Output) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_output)).getClient();
            }
            pub inline fn getId(_output: *Output) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output)).getId();
            }
            pub inline fn getVersion(_output: *Output) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output)).getVersion();
            }
            pub inline fn postNoMemory(_output: *Output) void {
                return @as(*server.wl.Resource, @ptrCast(_output)).postNoMemory();
            }
            pub inline fn getUserData(_output: *Output) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_output)).getUserData();
            }
            pub const Request = union(enum) {
                pub const release_since_version = 3;

                /// Using this request a client can tell the server that it is not going to
                /// use the output object anymore.
                release: void,
            };
            pub inline fn setHandler(
                _output: *Output,
                comptime T: type,
                handle_request: *const fn (_output: *Output, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_output: *Output, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                _resource.setDispatcher(
                    common.Dispatcher(Output, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Output, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The geometry event describes geometric properties of the output.
            /// The event is sent when binding to the output object and whenever
            /// any of the properties change.
            ///
            /// The physical size can be set to zero if it doesn't make sense for this
            /// output (e.g. for projectors or virtual outputs).
            ///
            /// The geometry event will be followed by a done event (starting from
            /// version 2).
            ///
            /// Clients should use wl_surface.preferred_buffer_transform instead of the
            /// transform advertised by this event to find the preferred buffer
            /// transform to use for a surface.
            ///
            /// Note: wl_output only advertises partial information about the output
            /// position and identification. Some compositors, for instance those not
            /// implementing a desktop-style output layout or those exposing virtual
            /// outputs, might fake this information. Instead of using x and y, clients
            /// should use xdg_output.logical_position. Instead of using make and model,
            /// clients should use name and description.
            pub fn sendGeometry(_output: *Output, _x: i32, _y: i32, _physical_width: i32, _physical_height: i32, _subpixel: Subpixel, _make: [*:0]const u8, _model: [*:0]const u8, _transform: Transform) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _physical_width },
                    .{ .i = _physical_height },
                    .{ .i = switch (@typeInfo(Subpixel)) {
                        .@"enum" => @as(i32, @intCast(@intFromEnum(_subpixel))),
                        .@"struct" => @bitCast(_subpixel),
                        else => unreachable,
                    } },
                    .{ .s = _make },
                    .{ .s = _model },
                    .{ .i = switch (@typeInfo(Transform)) {
                        .@"enum" => @as(i32, @intCast(@intFromEnum(_transform))),
                        .@"struct" => @bitCast(_transform),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const geometry_since_version = 1;

            /// The mode event describes an available mode for the output.
            ///
            /// The event is sent when binding to the output object and there
            /// will always be one mode, the current mode.  The event is sent
            /// again if an output changes mode, for the mode that is now
            /// current.  In other words, the current mode is always the last
            /// mode that was received with the current flag set.
            ///
            /// Non-current modes are deprecated. A compositor can decide to only
            /// advertise the current mode and never send other modes. Clients
            /// should not rely on non-current modes.
            ///
            /// The size of a mode is given in physical hardware units of
            /// the output device. This is not necessarily the same as
            /// the output size in the global compositor space. For instance,
            /// the output may be scaled, as described in wl_output.scale,
            /// or transformed, as described in wl_output.transform. Clients
            /// willing to retrieve the output size in the global compositor
            /// space should use xdg_output.logical_size instead.
            ///
            /// The vertical refresh rate can be set to zero if it doesn't make
            /// sense for this output (e.g. for virtual outputs).
            ///
            /// The mode event will be followed by a done event (starting from
            /// version 2).
            ///
            /// Clients should not use the refresh rate to schedule frames. Instead,
            /// they should use the wl_surface.frame event or the presentation-time
            /// protocol.
            ///
            /// Note: this information is not always meaningful for all outputs. Some
            /// compositors, such as those exposing virtual outputs, might fake the
            /// refresh rate or the size.
            pub fn sendMode(_output: *Output, _flags: Mode, _width: i32, _height: i32, _refresh: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Mode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_flags))),
                        .@"struct" => @bitCast(_flags),
                        else => unreachable,
                    } },
                    .{ .i = _width },
                    .{ .i = _height },
                    .{ .i = _refresh },
                };
                _resource.postEvent(1, &_args);
            }
            pub const mode_since_version = 1;

            /// This event is sent after all other properties have been
            /// sent after binding to the output object and after any
            /// other property changes done after that. This allows
            /// changes to the output properties to be seen as
            /// atomic, even if they happen via multiple events.
            pub fn sendDone(_output: *Output) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                _resource.postEvent(2, null);
            }
            pub const done_since_version = 2;

            /// This event contains scaling geometry information
            /// that is not in the geometry event. It may be sent after
            /// binding the output object or if the output scale changes
            /// later. The compositor will emit a non-zero, positive
            /// value for scale. If it is not sent, the client should
            /// assume a scale of 1.
            ///
            /// A scale larger than 1 means that the compositor will
            /// automatically scale surface buffers by this amount
            /// when rendering. This is used for very high resolution
            /// displays where applications rendering at the native
            /// resolution would be too small to be legible.
            ///
            /// Clients should use wl_surface.preferred_buffer_scale
            /// instead of this event to find the preferred buffer
            /// scale to use for a surface.
            ///
            /// The scale event will be followed by a done event.
            pub fn sendScale(_output: *Output, _factor: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                var _args = [_]common.Argument{
                    .{ .i = _factor },
                };
                _resource.postEvent(3, &_args);
            }
            pub const scale_since_version = 2;

            /// Many compositors will assign user-friendly names to their outputs, show
            /// them to the user, allow the user to refer to an output, etc. The client
            /// may wish to know this name as well to offer the user similar behaviors.
            ///
            /// The name is a UTF-8 string with no convention defined for its contents.
            /// Each name is unique among all wl_output globals. The name is only
            /// guaranteed to be unique for the compositor instance.
            ///
            /// The same output name is used for all clients for a given wl_output
            /// global. Thus, the name can be shared across processes to refer to a
            /// specific wl_output global.
            ///
            /// The name is not guaranteed to be persistent across sessions, thus cannot
            /// be used to reliably identify an output in e.g. configuration files.
            ///
            /// Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do
            /// not assume that the name is a reflection of an underlying DRM connector,
            /// X11 connection, etc.
            ///
            /// The name event is sent after binding the output object. This event is
            /// only sent once per output object, and the name does not change over the
            /// lifetime of the wl_output global.
            ///
            /// Compositors may re-use the same output name if the wl_output global is
            /// destroyed and re-created later. Compositors should avoid re-using the
            /// same name if possible.
            ///
            /// The name event will be followed by a done event.
            pub fn sendName(_output: *Output, _name: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _resource.postEvent(4, &_args);
            }
            pub const name_since_version = 4;

            /// Many compositors can produce human-readable descriptions of their
            /// outputs. The client may wish to know this description as well, e.g. for
            /// output selection purposes.
            ///
            /// The description is a UTF-8 string with no convention defined for its
            /// contents. The description is not guaranteed to be unique among all
            /// wl_output globals. Examples might include 'Foocorp 11" Display' or
            /// 'Virtual X11 output via :1'.
            ///
            /// The description event is sent after binding the output object and
            /// whenever the description changes. The description is optional, and may
            /// not be sent at all.
            ///
            /// The description event will be followed by a done event.
            pub fn sendDescription(_output: *Output, _description: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_output);
                var _args = [_]common.Argument{
                    .{ .s = _description },
                };
                _resource.postEvent(5, &_args);
            }
            pub const description_since_version = 4;
        };

        /// A seat is a group of keyboards, pointer and touch devices. This
        /// object is published as a global during start up, or when such a
        /// device is hot plugged.  A seat typically has a pointer and
        /// maintains a keyboard focus and a pointer focus.
        pub const Seat = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.seat.interface;
            pub const Capability = common.wl.seat.Capability;
            pub const Error = common.wl.seat.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Seat {
                return @ptrCast(try server.wl.Resource.create(_client, Seat, _version, _id));
            }
            pub inline fn destroy(_seat: *Seat) void {
                return @as(*server.wl.Resource, @ptrCast(_seat)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Seat {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_seat: *Seat) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_seat)).getLink();
            }
            pub inline fn getClient(_seat: *Seat) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_seat)).getClient();
            }
            pub inline fn getId(_seat: *Seat) u32 {
                return @as(*server.wl.Resource, @ptrCast(_seat)).getId();
            }
            pub inline fn getVersion(_seat: *Seat) u32 {
                return @as(*server.wl.Resource, @ptrCast(_seat)).getVersion();
            }
            pub inline fn postNoMemory(_seat: *Seat) void {
                return @as(*server.wl.Resource, @ptrCast(_seat)).postNoMemory();
            }
            pub inline fn getUserData(_seat: *Seat) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_seat)).getUserData();
            }
            pub inline fn postError(_seat: *Seat, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_seat)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const get_pointer_since_version = 1;
                pub const get_keyboard_since_version = 1;
                pub const get_touch_since_version = 1;
                pub const release_since_version = 5;

                /// The ID provided will be initialized to the wl_pointer interface
                /// for this seat.
                ///
                /// This request only takes effect if the seat has the pointer
                /// capability, or has had the pointer capability in the past.
                /// It is a protocol violation to issue this request on a seat that has
                /// never had the pointer capability. The missing_capability error will
                /// be sent in this case.
                get_pointer: struct {
                    id: u32,
                },

                /// The ID provided will be initialized to the wl_keyboard interface
                /// for this seat.
                ///
                /// This request only takes effect if the seat has the keyboard
                /// capability, or has had the keyboard capability in the past.
                /// It is a protocol violation to issue this request on a seat that has
                /// never had the keyboard capability. The missing_capability error will
                /// be sent in this case.
                get_keyboard: struct {
                    id: u32,
                },

                /// The ID provided will be initialized to the wl_touch interface
                /// for this seat.
                ///
                /// This request only takes effect if the seat has the touch
                /// capability, or has had the touch capability in the past.
                /// It is a protocol violation to issue this request on a seat that has
                /// never had the touch capability. The missing_capability error will
                /// be sent in this case.
                get_touch: struct {
                    id: u32,
                },

                /// Using this request a client can tell the server that it is not going to
                /// use the seat object anymore.
                release: void,
            };
            pub inline fn setHandler(
                _seat: *Seat,
                comptime T: type,
                handle_request: *const fn (_seat: *Seat, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_seat: *Seat, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat);
                _resource.setDispatcher(
                    common.Dispatcher(Seat, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Seat, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This is sent on binding to the seat global or whenever a seat gains
            /// or loses the pointer, keyboard or touch capabilities.
            /// The argument is a capability enum containing the complete set of
            /// capabilities this seat has.
            ///
            /// When the pointer capability is added, a client may create a
            /// wl_pointer object using the wl_seat.get_pointer request. This object
            /// will receive pointer events until the capability is removed in the
            /// future.
            ///
            /// When the pointer capability is removed, a client should destroy the
            /// wl_pointer objects associated with the seat where the capability was
            /// removed, using the wl_pointer.release request. No further pointer
            /// events will be received on these objects.
            ///
            /// In some compositors, if a seat regains the pointer capability and a
            /// client has a previously obtained wl_pointer object of version 4 or
            /// less, that object may start sending pointer events again. This
            /// behavior is considered a misinterpretation of the intended behavior
            /// and must not be relied upon by the client. wl_pointer objects of
            /// version 5 or later must not send events if created before the most
            /// recent event notifying the client of an added pointer capability.
            ///
            /// The above behavior also applies to wl_keyboard and wl_touch with the
            /// keyboard and touch capabilities, respectively.
            pub fn sendCapabilities(_seat: *Seat, _capabilities: Capability) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Capability)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_capabilities))),
                        .@"struct" => @bitCast(_capabilities),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const capabilities_since_version = 1;

            /// In a multi-seat configuration the seat name can be used by clients to
            /// help identify which physical devices the seat represents.
            ///
            /// The seat name is a UTF-8 string with no convention defined for its
            /// contents. Each name is unique among all wl_seat globals. The name is
            /// only guaranteed to be unique for the current compositor instance.
            ///
            /// The same seat names are used for all clients. Thus, the name can be
            /// shared across processes to refer to a specific wl_seat global.
            ///
            /// The name event is sent after binding to the seat global, and should be sent
            /// before announcing capabilities. This event only sent once per seat object,
            /// and the name does not change over the lifetime of the wl_seat global.
            ///
            /// Compositors may re-use the same seat name if the wl_seat global is
            /// destroyed and re-created later.
            pub fn sendName(_seat: *Seat, _name: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _resource.postEvent(1, &_args);
            }
            pub const name_since_version = 2;
        };

        /// The wl_pointer interface represents one or more input devices,
        /// such as mice, which control the pointer location and pointer_focus
        /// of a seat.
        ///
        /// The wl_pointer interface generates motion, enter and leave
        /// events for the surfaces that the pointer is located over,
        /// and button and axis events for button presses, button releases
        /// and scrolling.
        pub const Pointer = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.pointer.interface;
            pub const Error = common.wl.pointer.Error;
            pub const ButtonState = common.wl.pointer.ButtonState;
            pub const Axis = common.wl.pointer.Axis;
            pub const AxisSource = common.wl.pointer.AxisSource;
            pub const AxisRelativeDirection = common.wl.pointer.AxisRelativeDirection;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Pointer {
                return @ptrCast(try server.wl.Resource.create(_client, Pointer, _version, _id));
            }
            pub inline fn destroy(_pointer: *Pointer) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Pointer {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer: *Pointer) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).getLink();
            }
            pub inline fn getClient(_pointer: *Pointer) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).getClient();
            }
            pub inline fn getId(_pointer: *Pointer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).getId();
            }
            pub inline fn getVersion(_pointer: *Pointer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).getVersion();
            }
            pub inline fn postNoMemory(_pointer: *Pointer) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).postNoMemory();
            }
            pub inline fn getUserData(_pointer: *Pointer) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).getUserData();
            }
            pub inline fn postError(_pointer: *Pointer, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const set_cursor_since_version = 1;
                pub const release_since_version = 3;

                /// Set the pointer surface, i.e., the surface that contains the
                /// pointer image (cursor). This request gives the surface the role
                /// of a cursor. If the surface already has another role, it raises
                /// a protocol error.
                ///
                /// The cursor actually changes only if the pointer
                /// focus for this device is one of the requesting client's surfaces
                /// or the surface parameter is the current pointer surface. If
                /// there was a previous surface set with this request it is
                /// replaced. If surface is NULL, the pointer image is hidden.
                ///
                /// The parameters hotspot_x and hotspot_y define the position of
                /// the pointer surface relative to the pointer location. Its
                /// top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
                /// where (x, y) are the coordinates of the pointer location, in
                /// surface-local coordinates.
                ///
                /// On wl_surface.offset requests to the pointer surface, hotspot_x
                /// and hotspot_y are decremented by the x and y parameters
                /// passed to the request. The offset must be applied by
                /// wl_surface.commit as usual.
                ///
                /// The hotspot can also be updated by passing the currently set
                /// pointer surface to this request with new values for hotspot_x
                /// and hotspot_y.
                ///
                /// The input region is ignored for wl_surfaces with the role of
                /// a cursor. When the use as a cursor ends, the wl_surface is
                /// unmapped.
                ///
                /// The serial parameter must match the latest wl_pointer.enter
                /// serial number sent to the client. Otherwise the request will be
                /// ignored.
                set_cursor: struct {
                    serial: u32,
                    surface: ?*server.wl.Surface,
                    hotspot_x: i32,
                    hotspot_y: i32,
                },

                /// Using this request a client can tell the server that it is not going to
                /// use the pointer object anymore.
                ///
                /// This request destroys the pointer proxy object, so clients must not call
                /// wl_pointer_destroy() after using this request.
                release: void,
            };
            pub inline fn setHandler(
                _pointer: *Pointer,
                comptime T: type,
                handle_request: *const fn (_pointer: *Pointer, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer: *Pointer, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                _resource.setDispatcher(
                    common.Dispatcher(Pointer, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Pointer, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Notification that this seat's pointer is focused on a certain
            /// surface.
            ///
            /// When a seat's focus enters a surface, the pointer image
            /// is undefined and a client should respond to this event by setting
            /// an appropriate pointer image with the set_cursor request.
            pub fn sendEnter(_pointer: *Pointer, _serial: u32, _surface: *server.wl.Surface, _surface_x: common.Fixed, _surface_y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                    .{ .f = _surface_x },
                    .{ .f = _surface_y },
                };
                _resource.postEvent(0, &_args);
            }
            pub const enter_since_version = 1;

            /// Notification that this seat's pointer is no longer focused on
            /// a certain surface.
            ///
            /// The leave notification is sent before the enter notification
            /// for the new focus.
            pub fn sendLeave(_pointer: *Pointer, _serial: u32, _surface: *server.wl.Surface) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const leave_since_version = 1;

            /// Notification of pointer location change. The arguments
            /// surface_x and surface_y are the location relative to the
            /// focused surface.
            pub fn sendMotion(_pointer: *Pointer, _time: u32, _surface_x: common.Fixed, _surface_y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .f = _surface_x },
                    .{ .f = _surface_y },
                };
                _resource.postEvent(2, &_args);
            }
            pub const motion_since_version = 1;

            /// Mouse button click and release notifications.
            ///
            /// The location of the click is given by the last motion or
            /// enter event.
            /// The time argument is a timestamp with millisecond
            /// granularity, with an undefined base.
            ///
            /// The button is a button code as defined in the Linux kernel's
            /// linux/input-event-codes.h header file, e.g. BTN_LEFT.
            ///
            /// Any 16-bit button code value is reserved for future additions to the
            /// kernel's event code list. All other button codes above 0xFFFF are
            /// currently undefined but may be used in future versions of this
            /// protocol.
            pub fn sendButton(_pointer: *Pointer, _serial: u32, _time: u32, _button: u32, _state: ButtonState) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .u = _button },
                    .{ .u = switch (@typeInfo(ButtonState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const button_since_version = 1;

            /// Scroll and other axis notifications.
            ///
            /// For scroll events (vertical and horizontal scroll axes), the
            /// value parameter is the length of a vector along the specified
            /// axis in a coordinate space identical to those of motion events,
            /// representing a relative movement along the specified axis.
            ///
            /// For devices that support movements non-parallel to axes multiple
            /// axis events will be emitted.
            ///
            /// When applicable, for example for touch pads, the server can
            /// choose to emit scroll events where the motion vector is
            /// equivalent to a motion event vector.
            ///
            /// When applicable, a client can transform its content relative to the
            /// scroll distance.
            pub fn sendAxis(_pointer: *Pointer, _time: u32, _axis: Axis, _value: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .u = switch (@typeInfo(Axis)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_axis))),
                        .@"struct" => @bitCast(_axis),
                        else => unreachable,
                    } },
                    .{ .f = _value },
                };
                _resource.postEvent(4, &_args);
            }
            pub const axis_since_version = 1;

            /// Indicates the end of a set of events that logically belong together.
            /// A client is expected to accumulate the data in all events within the
            /// frame before proceeding.
            ///
            /// All wl_pointer events before a wl_pointer.frame event belong
            /// logically together. For example, in a diagonal scroll motion the
            /// compositor will send an optional wl_pointer.axis_source event, two
            /// wl_pointer.axis events (horizontal and vertical) and finally a
            /// wl_pointer.frame event. The client may use this information to
            /// calculate a diagonal vector for scrolling.
            ///
            /// When multiple wl_pointer.axis events occur within the same frame,
            /// the motion vector is the combined motion of all events.
            /// When a wl_pointer.axis and a wl_pointer.axis_stop event occur within
            /// the same frame, this indicates that axis movement in one axis has
            /// stopped but continues in the other axis.
            /// When multiple wl_pointer.axis_stop events occur within the same
            /// frame, this indicates that these axes stopped in the same instance.
            ///
            /// A wl_pointer.frame event is sent for every logical event group,
            /// even if the group only contains a single wl_pointer event.
            /// Specifically, a client may get a sequence: motion, frame, button,
            /// frame, axis, frame, axis_stop, frame.
            ///
            /// The wl_pointer.enter and wl_pointer.leave events are logical events
            /// generated by the compositor and not the hardware. These events are
            /// also grouped by a wl_pointer.frame. When a pointer moves from one
            /// surface to another, a compositor should group the
            /// wl_pointer.leave event within the same wl_pointer.frame.
            /// However, a client must not rely on wl_pointer.leave and
            /// wl_pointer.enter being in the same wl_pointer.frame.
            /// Compositor-specific policies may require the wl_pointer.leave and
            /// wl_pointer.enter event being split across multiple wl_pointer.frame
            /// groups.
            pub fn sendFrame(_pointer: *Pointer) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                _resource.postEvent(5, null);
            }
            pub const frame_since_version = 5;

            /// Source information for scroll and other axes.
            ///
            /// This event does not occur on its own. It is sent before a
            /// wl_pointer.frame event and carries the source information for
            /// all events within that frame.
            ///
            /// The source specifies how this event was generated. If the source is
            /// wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be
            /// sent when the user lifts the finger off the device.
            ///
            /// If the source is wl_pointer.axis_source.wheel,
            /// wl_pointer.axis_source.wheel_tilt or
            /// wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may
            /// or may not be sent. Whether a compositor sends an axis_stop event
            /// for these sources is hardware-specific and implementation-dependent;
            /// clients must not rely on receiving an axis_stop event for these
            /// scroll sources and should treat scroll sequences from these scroll
            /// sources as unterminated by default.
            ///
            /// This event is optional. If the source is unknown for a particular
            /// axis event sequence, no event is sent.
            /// Only one wl_pointer.axis_source event is permitted per frame.
            ///
            /// The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
            /// not guaranteed.
            pub fn sendAxisSource(_pointer: *Pointer, _axis_source: AxisSource) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(AxisSource)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_axis_source))),
                        .@"struct" => @bitCast(_axis_source),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(6, &_args);
            }
            pub const axis_source_since_version = 5;

            /// Stop notification for scroll and other axes.
            ///
            /// For some wl_pointer.axis_source types, a wl_pointer.axis_stop event
            /// is sent to notify a client that the axis sequence has terminated.
            /// This enables the client to implement kinetic scrolling.
            /// See the wl_pointer.axis_source documentation for information on when
            /// this event may be generated.
            ///
            /// Any wl_pointer.axis events with the same axis_source after this
            /// event should be considered as the start of a new axis motion.
            ///
            /// The timestamp is to be interpreted identical to the timestamp in the
            /// wl_pointer.axis event. The timestamp value may be the same as a
            /// preceding wl_pointer.axis event.
            pub fn sendAxisStop(_pointer: *Pointer, _time: u32, _axis: Axis) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .u = switch (@typeInfo(Axis)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_axis))),
                        .@"struct" => @bitCast(_axis),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(7, &_args);
            }
            pub const axis_stop_since_version = 5;

            /// Discrete step information for scroll and other axes.
            ///
            /// This event carries the axis value of the wl_pointer.axis event in
            /// discrete steps (e.g. mouse wheel clicks).
            ///
            /// This event is deprecated with wl_pointer version 8 - this event is not
            /// sent to clients supporting version 8 or later.
            ///
            /// This event does not occur on its own, it is coupled with a
            /// wl_pointer.axis event that represents this axis value on a
            /// continuous scale. The protocol guarantees that each axis_discrete
            /// event is always followed by exactly one axis event with the same
            /// axis number within the same wl_pointer.frame. Note that the protocol
            /// allows for other events to occur between the axis_discrete and
            /// its coupled axis event, including other axis_discrete or axis
            /// events. A wl_pointer.frame must not contain more than one axis_discrete
            /// event per axis type.
            ///
            /// This event is optional; continuous scrolling devices
            /// like two-finger scrolling on touchpads do not have discrete
            /// steps and do not generate this event.
            ///
            /// The discrete value carries the directional information. e.g. a value
            /// of -2 is two steps towards the negative direction of this axis.
            ///
            /// The axis number is identical to the axis number in the associated
            /// axis event.
            ///
            /// The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
            /// not guaranteed.
            pub fn sendAxisDiscrete(_pointer: *Pointer, _axis: Axis, _discrete: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Axis)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_axis))),
                        .@"struct" => @bitCast(_axis),
                        else => unreachable,
                    } },
                    .{ .i = _discrete },
                };
                _resource.postEvent(8, &_args);
            }
            pub const axis_discrete_since_version = 5;
        };

        /// The wl_keyboard interface represents one or more keyboards
        /// associated with a seat.
        ///
        /// Each wl_keyboard has the following logical state:
        ///
        /// - an active surface (possibly null),
        /// - the keys currently logically down,
        /// - the active modifiers,
        /// - the active group.
        ///
        /// By default, the active surface is null, the keys currently logically down
        /// are empty, the active modifiers and the active group are 0.
        pub const Keyboard = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.keyboard.interface;
            pub const KeymapFormat = common.wl.keyboard.KeymapFormat;
            pub const KeyState = common.wl.keyboard.KeyState;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Keyboard {
                return @ptrCast(try server.wl.Resource.create(_client, Keyboard, _version, _id));
            }
            pub inline fn destroy(_keyboard: *Keyboard) void {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Keyboard {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_keyboard: *Keyboard) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).getLink();
            }
            pub inline fn getClient(_keyboard: *Keyboard) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).getClient();
            }
            pub inline fn getId(_keyboard: *Keyboard) u32 {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).getId();
            }
            pub inline fn getVersion(_keyboard: *Keyboard) u32 {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).getVersion();
            }
            pub inline fn postNoMemory(_keyboard: *Keyboard) void {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).postNoMemory();
            }
            pub inline fn getUserData(_keyboard: *Keyboard) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_keyboard)).getUserData();
            }
            pub const Request = union(enum) {
                pub const release_since_version = 3;
                release: void,
            };
            pub inline fn setHandler(
                _keyboard: *Keyboard,
                comptime T: type,
                handle_request: *const fn (_keyboard: *Keyboard, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_keyboard: *Keyboard, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                _resource.setDispatcher(
                    common.Dispatcher(Keyboard, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Keyboard, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event provides a file descriptor to the client which can be
            /// memory-mapped in read-only mode to provide a keyboard mapping
            /// description.
            ///
            /// From version 7 onwards, the fd must be mapped with MAP_PRIVATE by
            /// the recipient, as MAP_SHARED may fail.
            pub fn sendKeymap(_keyboard: *Keyboard, _format: KeymapFormat, _fd: i32, _size: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(KeymapFormat)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_format))),
                        .@"struct" => @bitCast(_format),
                        else => unreachable,
                    } },
                    .{ .h = _fd },
                    .{ .u = _size },
                };
                _resource.postEvent(0, &_args);
            }
            pub const keymap_since_version = 1;

            /// Notification that this seat's keyboard focus is on a certain
            /// surface.
            ///
            /// The compositor must send the wl_keyboard.modifiers event after this
            /// event.
            ///
            /// In the wl_keyboard logical state, this event sets the active surface to
            /// the surface argument and the keys currently logically down to the keys
            /// in the keys argument. The compositor must not send this event if the
            /// wl_keyboard already had an active surface immediately before this event.
            ///
            /// Clients should not use the list of pressed keys to emulate key-press
            /// events. The order of keys in the list is unspecified.
            pub fn sendEnter(_keyboard: *Keyboard, _serial: u32, _surface: *server.wl.Surface, _keys: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                    .{ .a = _keys },
                };
                _resource.postEvent(1, &_args);
            }
            pub const enter_since_version = 1;

            /// Notification that this seat's keyboard focus is no longer on
            /// a certain surface.
            ///
            /// The leave notification is sent before the enter notification
            /// for the new focus.
            ///
            /// In the wl_keyboard logical state, this event resets all values to their
            /// defaults. The compositor must not send this event if the active surface
            /// of the wl_keyboard was not equal to the surface argument immediately
            /// before this event.
            pub fn sendLeave(_keyboard: *Keyboard, _serial: u32, _surface: *server.wl.Surface) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                };
                _resource.postEvent(2, &_args);
            }
            pub const leave_since_version = 1;

            /// A key was pressed or released.
            /// The time argument is a timestamp with millisecond
            /// granularity, with an undefined base.
            ///
            /// The key is a platform-specific key code that can be interpreted
            /// by feeding it to the keyboard mapping (see the keymap event).
            ///
            /// If this event produces a change in modifiers, then the resulting
            /// wl_keyboard.modifiers event must be sent after this event.
            ///
            /// In the wl_keyboard logical state, this event adds the key to the keys
            /// currently logically down (if the state argument is pressed) or removes
            /// the key from the keys currently logically down (if the state argument is
            /// released). The compositor must not send this event if the wl_keyboard
            /// did not have an active surface immediately before this event. The
            /// compositor must not send this event if state is pressed (resp. released)
            /// and the key was already logically down (resp. was not logically down)
            /// immediately before this event.
            ///
            /// Since version 10, compositors may send key events with the "repeated"
            /// key state when a wl_keyboard.repeat_info event with a rate argument of
            /// 0 has been received. This allows the compositor to take over the
            /// responsibility of key repetition.
            pub fn sendKey(_keyboard: *Keyboard, _serial: u32, _time: u32, _key: u32, _state: KeyState) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .u = _key },
                    .{ .u = switch (@typeInfo(KeyState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const key_since_version = 1;

            /// Notifies clients that the modifier and/or group state has
            /// changed, and it should update its local state.
            ///
            /// The compositor may send this event without a surface of the client
            /// having keyboard focus, for example to tie modifier information to
            /// pointer focus instead. If a modifier event with pressed modifiers is sent
            /// without a prior enter event, the client can assume the modifier state is
            /// valid until it receives the next wl_keyboard.modifiers event. In order to
            /// reset the modifier state again, the compositor can send a
            /// wl_keyboard.modifiers event with no pressed modifiers.
            ///
            /// In the wl_keyboard logical state, this event updates the modifiers and
            /// group.
            pub fn sendModifiers(_keyboard: *Keyboard, _serial: u32, _mods_depressed: u32, _mods_latched: u32, _mods_locked: u32, _group: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _mods_depressed },
                    .{ .u = _mods_latched },
                    .{ .u = _mods_locked },
                    .{ .u = _group },
                };
                _resource.postEvent(4, &_args);
            }
            pub const modifiers_since_version = 1;

            /// Informs the client about the keyboard's repeat rate and delay.
            ///
            /// This event is sent as soon as the wl_keyboard object has been created,
            /// and is guaranteed to be received by the client before any key press
            /// event.
            ///
            /// Negative values for either rate or delay are illegal. A rate of zero
            /// will disable any repeating (regardless of the value of delay).
            ///
            /// This event can be sent later on as well with a new value if necessary,
            /// so clients should continue listening for the event past the creation
            /// of wl_keyboard.
            pub fn sendRepeatInfo(_keyboard: *Keyboard, _rate: i32, _delay: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_keyboard);
                var _args = [_]common.Argument{
                    .{ .i = _rate },
                    .{ .i = _delay },
                };
                _resource.postEvent(5, &_args);
            }
            pub const repeat_info_since_version = 4;
        };

        /// The wl_touch interface represents a touchscreen
        /// associated with a seat.
        ///
        /// Touch interactions can consist of one or more contacts.
        /// For each contact, a series of events is generated, starting
        /// with a down event, followed by zero or more motion events,
        /// and ending with an up event. Events relating to the same
        /// contact point can be identified by the ID of the sequence.
        pub const Touch = opaque {
            pub const generated_version = 7;
            pub const interface = &common.wl.touch.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Touch {
                return @ptrCast(try server.wl.Resource.create(_client, Touch, _version, _id));
            }
            pub inline fn destroy(_touch: *Touch) void {
                return @as(*server.wl.Resource, @ptrCast(_touch)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Touch {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_touch: *Touch) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_touch)).getLink();
            }
            pub inline fn getClient(_touch: *Touch) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_touch)).getClient();
            }
            pub inline fn getId(_touch: *Touch) u32 {
                return @as(*server.wl.Resource, @ptrCast(_touch)).getId();
            }
            pub inline fn getVersion(_touch: *Touch) u32 {
                return @as(*server.wl.Resource, @ptrCast(_touch)).getVersion();
            }
            pub inline fn postNoMemory(_touch: *Touch) void {
                return @as(*server.wl.Resource, @ptrCast(_touch)).postNoMemory();
            }
            pub inline fn getUserData(_touch: *Touch) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_touch)).getUserData();
            }
            pub const Request = union(enum) {
                pub const release_since_version = 3;
                release: void,
            };
            pub inline fn setHandler(
                _touch: *Touch,
                comptime T: type,
                handle_request: *const fn (_touch: *Touch, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_touch: *Touch, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                _resource.setDispatcher(
                    common.Dispatcher(Touch, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Touch, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// A new touch point has appeared on the surface. This touch point is
            /// assigned a unique ID. Future events from this touch point reference
            /// this ID. The ID ceases to be valid after a touch up event and may be
            /// reused in the future.
            pub fn sendDown(_touch: *Touch, _serial: u32, _time: u32, _surface: *server.wl.Surface, _id: i32, _x: common.Fixed, _y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .o = @ptrCast(_surface) },
                    .{ .i = _id },
                    .{ .f = _x },
                    .{ .f = _y },
                };
                _resource.postEvent(0, &_args);
            }
            pub const down_since_version = 1;

            /// The touch point has disappeared. No further events will be sent for
            /// this touch point and the touch point's ID is released and may be
            /// reused in a future touch down event.
            pub fn sendUp(_touch: *Touch, _serial: u32, _time: u32, _id: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .i = _id },
                };
                _resource.postEvent(1, &_args);
            }
            pub const up_since_version = 1;

            /// A touch point has changed coordinates.
            pub fn sendMotion(_touch: *Touch, _time: u32, _id: i32, _x: common.Fixed, _y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .i = _id },
                    .{ .f = _x },
                    .{ .f = _y },
                };
                _resource.postEvent(2, &_args);
            }
            pub const motion_since_version = 1;

            /// Indicates the end of a set of events that logically belong together.
            /// A client is expected to accumulate the data in all events within the
            /// frame before proceeding.
            ///
            /// A wl_touch.frame terminates at least one event but otherwise no
            /// guarantee is provided about the set of events within a frame. A client
            /// must assume that any state not updated in a frame is unchanged from the
            /// previously known state.
            pub fn sendFrame(_touch: *Touch) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                _resource.postEvent(3, null);
            }
            pub const frame_since_version = 1;

            /// Sent if the compositor decides the touch stream is a global
            /// gesture. No further events are sent to the clients from that
            /// particular gesture. Touch cancellation applies to all touch points
            /// currently active on this client's surface. The client is
            /// responsible for finalizing the touch points, future touch points on
            /// this surface may reuse the touch point ID.
            ///
            /// No frame event is required after the cancel event.
            pub fn sendCancel(_touch: *Touch) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                _resource.postEvent(4, null);
            }
            pub const cancel_since_version = 1;

            /// Sent when a touchpoint has changed its shape.
            ///
            /// This event does not occur on its own. It is sent before a
            /// wl_touch.frame event and carries the new shape information for
            /// any previously reported, or new touch points of that frame.
            ///
            /// Other events describing the touch point such as wl_touch.down,
            /// wl_touch.motion or wl_touch.orientation may be sent within the
            /// same wl_touch.frame. A client should treat these events as a single
            /// logical touch point update. The order of wl_touch.shape,
            /// wl_touch.orientation and wl_touch.motion is not guaranteed.
            /// A wl_touch.down event is guaranteed to occur before the first
            /// wl_touch.shape event for this touch ID but both events may occur within
            /// the same wl_touch.frame.
            ///
            /// A touchpoint shape is approximated by an ellipse through the major and
            /// minor axis length. The major axis length describes the longer diameter
            /// of the ellipse, while the minor axis length describes the shorter
            /// diameter. Major and minor are orthogonal and both are specified in
            /// surface-local coordinates. The center of the ellipse is always at the
            /// touchpoint location as reported by wl_touch.down or wl_touch.move.
            ///
            /// This event is only sent by the compositor if the touch device supports
            /// shape reports. The client has to make reasonable assumptions about the
            /// shape if it did not receive this event.
            pub fn sendShape(_touch: *Touch, _id: i32, _major: common.Fixed, _minor: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                var _args = [_]common.Argument{
                    .{ .i = _id },
                    .{ .f = _major },
                    .{ .f = _minor },
                };
                _resource.postEvent(5, &_args);
            }
            pub const shape_since_version = 6;

            /// Sent when a touchpoint has changed its orientation.
            ///
            /// This event does not occur on its own. It is sent before a
            /// wl_touch.frame event and carries the new shape information for
            /// any previously reported, or new touch points of that frame.
            ///
            /// Other events describing the touch point such as wl_touch.down,
            /// wl_touch.motion or wl_touch.shape may be sent within the
            /// same wl_touch.frame. A client should treat these events as a single
            /// logical touch point update. The order of wl_touch.shape,
            /// wl_touch.orientation and wl_touch.motion is not guaranteed.
            /// A wl_touch.down event is guaranteed to occur before the first
            /// wl_touch.orientation event for this touch ID but both events may occur
            /// within the same wl_touch.frame.
            ///
            /// The orientation describes the clockwise angle of a touchpoint's major
            /// axis to the positive surface y-axis and is normalized to the -180 to
            /// +180 degree range. The granularity of orientation depends on the touch
            /// device, some devices only support binary rotation values between 0 and
            /// 90 degrees.
            ///
            /// This event is only sent by the compositor if the touch device supports
            /// orientation reports.
            pub fn sendOrientation(_touch: *Touch, _id: i32, _orientation: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_touch);
                var _args = [_]common.Argument{
                    .{ .i = _id },
                    .{ .f = _orientation },
                };
                _resource.postEvent(6, &_args);
            }
            pub const orientation_since_version = 6;
        };

        /// The wl_data_device_manager is a singleton global object that
        /// provides access to inter-client data transfer mechanisms such as
        /// copy-and-paste and drag-and-drop.  These mechanisms are tied to
        /// a wl_seat and this interface lets a client get a wl_data_device
        /// corresponding to a wl_seat.
        ///
        /// Depending on the version bound, the objects created from the bound
        /// wl_data_device_manager object will have different requirements for
        /// functioning properly. See wl_data_source.set_actions,
        /// wl_data_offer.accept and wl_data_offer.finish for details.
        pub const DataDeviceManager = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_device_manager.interface;
            pub const DndAction = common.wl.data_device_manager.DndAction;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DataDeviceManager {
                return @ptrCast(try server.wl.Resource.create(_client, DataDeviceManager, _version, _id));
            }
            pub inline fn destroy(_data_device_manager: *DataDeviceManager) void {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DataDeviceManager {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_data_device_manager: *DataDeviceManager) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).getLink();
            }
            pub inline fn getClient(_data_device_manager: *DataDeviceManager) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).getClient();
            }
            pub inline fn getId(_data_device_manager: *DataDeviceManager) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).getId();
            }
            pub inline fn getVersion(_data_device_manager: *DataDeviceManager) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).getVersion();
            }
            pub inline fn postNoMemory(_data_device_manager: *DataDeviceManager) void {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).postNoMemory();
            }
            pub inline fn getUserData(_data_device_manager: *DataDeviceManager) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_data_device_manager)).getUserData();
            }
            pub const Request = union(enum) {
                pub const create_data_source_since_version = 1;
                pub const get_data_device_since_version = 1;

                /// Create a new data source.
                create_data_source: struct {
                    id: u32,
                },

                /// Create a new data device for a given seat.
                get_data_device: struct {
                    id: u32,
                    seat: *server.wl.Seat,
                },
            };
            pub inline fn setHandler(
                _data_device_manager: *DataDeviceManager,
                comptime T: type,
                handle_request: *const fn (_data_device_manager: *DataDeviceManager, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_data_device_manager: *DataDeviceManager, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device_manager);
                _resource.setDispatcher(
                    common.Dispatcher(DataDeviceManager, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DataDeviceManager, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The wl_data_source object is the source side of a wl_data_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.
        pub const DataSource = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_source.interface;
            pub const Error = common.wl.data_source.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DataSource {
                return @ptrCast(try server.wl.Resource.create(_client, DataSource, _version, _id));
            }
            pub inline fn destroy(_data_source: *DataSource) void {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DataSource {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_data_source: *DataSource) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).getLink();
            }
            pub inline fn getClient(_data_source: *DataSource) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).getClient();
            }
            pub inline fn getId(_data_source: *DataSource) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).getId();
            }
            pub inline fn getVersion(_data_source: *DataSource) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).getVersion();
            }
            pub inline fn postNoMemory(_data_source: *DataSource) void {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).postNoMemory();
            }
            pub inline fn getUserData(_data_source: *DataSource) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).getUserData();
            }
            pub inline fn postError(_data_source: *DataSource, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_data_source)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const offer_since_version = 1;
                pub const destroy_since_version = 1;
                pub const set_actions_since_version = 3;

                /// This request adds a mime type to the set of mime types
                /// advertised to targets.  Can be called several times to offer
                /// multiple types.
                offer: struct {
                    mime_type: [*:0]const u8,
                },

                /// Destroy the data source.
                destroy: void,
                /// Sets the actions that the source side client supports for this
                /// operation. This request may trigger wl_data_source.action and
                /// wl_data_offer.action events if the compositor needs to change the
                /// selected action.
                ///
                /// The dnd_actions argument must contain only values expressed in the
                /// wl_data_device_manager.dnd_actions enum, otherwise it will result
                /// in a protocol error.
                ///
                /// This request must be made once only, and can only be made on sources
                /// used in drag-and-drop, so it must be performed before
                /// wl_data_device.start_drag. Attempting to use the source other than
                /// for drag-and-drop will raise a protocol error.
                set_actions: struct {
                    dnd_actions: common.wl.data_device_manager.DndAction,
                },
            };
            pub inline fn setHandler(
                _data_source: *DataSource,
                comptime T: type,
                handle_request: *const fn (_data_source: *DataSource, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_data_source: *DataSource, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                _resource.setDispatcher(
                    common.Dispatcher(DataSource, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DataSource, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent when a target accepts pointer_focus or motion events.  If
            /// a target does not accept any of the offered types, type is NULL.
            ///
            /// Used for feedback during drag-and-drop.
            pub fn sendTarget(_data_source: *DataSource, _mime_type: ?[*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                var _args = [_]common.Argument{
                    .{ .s = _mime_type },
                };
                _resource.postEvent(0, &_args);
            }
            pub const target_since_version = 1;

            /// Request for data from the client.  Send the data as the
            /// specified mime type over the passed file descriptor, then
            /// close it.
            pub fn sendSend(_data_source: *DataSource, _mime_type: [*:0]const u8, _fd: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                var _args = [_]common.Argument{
                    .{ .s = _mime_type },
                    .{ .h = _fd },
                };
                _resource.postEvent(1, &_args);
            }
            pub const send_since_version = 1;

            /// This data source is no longer valid. There are several reasons why
            /// this could happen:
            ///
            /// - The data source has been replaced by another data source.
            /// - The drag-and-drop operation was performed, but the drop destination
            /// did not accept any of the mime types offered through
            /// wl_data_source.target.
            /// - The drag-and-drop operation was performed, but the drop destination
            /// did not select any of the actions present in the mask offered through
            /// wl_data_source.action.
            /// - The drag-and-drop operation was performed but didn't happen over a
            /// surface.
            /// - The compositor cancelled the drag-and-drop operation (e.g. compositor
            /// dependent timeouts to avoid stale drag-and-drop transfers).
            ///
            /// The client should clean up and destroy this data source.
            ///
            /// For objects of version 2 or older, wl_data_source.cancelled will
            /// only be emitted if the data source was replaced by another data
            /// source.
            pub fn sendCancelled(_data_source: *DataSource) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                _resource.postEvent(2, null);
            }
            pub const cancelled_since_version = 1;

            /// The user performed the drop action. This event does not indicate
            /// acceptance, wl_data_source.cancelled may still be emitted afterwards
            /// if the drop destination does not accept any mime type.
            ///
            /// However, this event might however not be received if the compositor
            /// cancelled the drag-and-drop operation before this event could happen.
            ///
            /// Note that the data_source may still be used in the future and should
            /// not be destroyed here.
            pub fn sendDndDropPerformed(_data_source: *DataSource) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                _resource.postEvent(3, null);
            }
            pub const dnd_drop_performed_since_version = 3;

            /// The drop destination finished interoperating with this data
            /// source, so the client is now free to destroy this data source and
            /// free all associated data.
            ///
            /// If the action used to perform the operation was "move", the
            /// source can now delete the transferred data.
            pub fn sendDndFinished(_data_source: *DataSource) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                _resource.postEvent(4, null);
            }
            pub const dnd_finished_since_version = 3;

            /// This event indicates the action selected by the compositor after
            /// matching the source/destination side actions. Only one action (or
            /// none) will be offered here.
            ///
            /// This event can be emitted multiple times during the drag-and-drop
            /// operation, mainly in response to destination side changes through
            /// wl_data_offer.set_actions, and as the data device enters/leaves
            /// surfaces.
            ///
            /// It is only possible to receive this event after
            /// wl_data_source.dnd_drop_performed if the drag-and-drop operation
            /// ended in an "ask" action, in which case the final wl_data_source.action
            /// event will happen immediately before wl_data_source.dnd_finished.
            ///
            /// Compositors may also change the selected action on the fly, mainly
            /// in response to keyboard modifier changes during the drag-and-drop
            /// operation.
            ///
            /// The most recent action received is always the valid one. The chosen
            /// action may change alongside negotiation (e.g. an "ask" action can turn
            /// into a "move" operation), so the effects of the final action must
            /// always be applied in wl_data_offer.dnd_finished.
            ///
            /// Clients can trigger cursor surface changes from this point, so
            /// they reflect the current action.
            pub fn sendAction(_data_source: *DataSource, _dnd_action: common.wl.data_device_manager.DndAction) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_source);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_dnd_action))),
                        .@"struct" => @bitCast(_dnd_action),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(5, &_args);
            }
            pub const action_since_version = 3;
        };

        /// There is one wl_data_device per seat which can be obtained
        /// from the global wl_data_device_manager singleton.
        ///
        /// A wl_data_device provides access to inter-client data transfer
        /// mechanisms such as copy-and-paste and drag-and-drop.
        pub const DataDevice = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_device.interface;
            pub const Error = common.wl.data_device.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DataDevice {
                return @ptrCast(try server.wl.Resource.create(_client, DataDevice, _version, _id));
            }
            pub inline fn destroy(_data_device: *DataDevice) void {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DataDevice {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_data_device: *DataDevice) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).getLink();
            }
            pub inline fn getClient(_data_device: *DataDevice) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).getClient();
            }
            pub inline fn getId(_data_device: *DataDevice) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).getId();
            }
            pub inline fn getVersion(_data_device: *DataDevice) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).getVersion();
            }
            pub inline fn postNoMemory(_data_device: *DataDevice) void {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).postNoMemory();
            }
            pub inline fn getUserData(_data_device: *DataDevice) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).getUserData();
            }
            pub inline fn postError(_data_device: *DataDevice, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_data_device)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const start_drag_since_version = 1;
                pub const set_selection_since_version = 1;
                pub const release_since_version = 2;

                /// This request asks the compositor to start a drag-and-drop
                /// operation on behalf of the client.
                ///
                /// The source argument is the data source that provides the data
                /// for the eventual data transfer. If source is NULL, enter, leave
                /// and motion events are sent only to the client that initiated the
                /// drag and the client is expected to handle the data passing
                /// internally. If source is destroyed, the drag-and-drop session will be
                /// cancelled.
                ///
                /// The origin surface is the surface where the drag originates and
                /// the client must have an active implicit grab that matches the
                /// serial.
                ///
                /// The icon surface is an optional (can be NULL) surface that
                /// provides an icon to be moved around with the cursor.  Initially,
                /// the top-left corner of the icon surface is placed at the cursor
                /// hotspot, but subsequent wl_surface.offset requests can move the
                /// relative position. Attach requests must be confirmed with
                /// wl_surface.commit as usual. The icon surface is given the role of
                /// a drag-and-drop icon. If the icon surface already has another role,
                /// it raises a protocol error.
                ///
                /// The input region is ignored for wl_surfaces with the role of a
                /// drag-and-drop icon.
                ///
                /// The given source may not be used in any further set_selection or
                /// start_drag requests. Attempting to reuse a previously-used source
                /// may send a used_source error.
                start_drag: struct {
                    source: ?*server.wl.DataSource,
                    origin: *server.wl.Surface,
                    icon: ?*server.wl.Surface,
                    serial: u32,
                },

                /// This request asks the compositor to set the selection
                /// to the data from the source on behalf of the client.
                ///
                /// To unset the selection, set the source to NULL.
                ///
                /// The given source may not be used in any further set_selection or
                /// start_drag requests. Attempting to reuse a previously-used source
                /// may send a used_source error.
                set_selection: struct {
                    source: ?*server.wl.DataSource,
                    serial: u32,
                },

                /// This request destroys the data device.
                release: void,
            };
            pub inline fn setHandler(
                _data_device: *DataDevice,
                comptime T: type,
                handle_request: *const fn (_data_device: *DataDevice, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_data_device: *DataDevice, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                _resource.setDispatcher(
                    common.Dispatcher(DataDevice, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DataDevice, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The data_offer event introduces a new wl_data_offer object,
            /// which will subsequently be used in either the
            /// data_device.enter event (for drag-and-drop) or the
            /// data_device.selection event (for selections).  Immediately
            /// following the data_device.data_offer event, the new data_offer
            /// object will send out data_offer.offer events to describe the
            /// mime types it offers.
            pub fn sendDataOffer(_data_device: *DataDevice, _id: *server.wl.DataOffer) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(0, &_args);
            }
            pub const data_offer_since_version = 1;

            /// This event is sent when an active drag-and-drop pointer enters
            /// a surface owned by the client.  The position of the pointer at
            /// enter time is provided by the x and y arguments, in surface-local
            /// coordinates.
            pub fn sendEnter(_data_device: *DataDevice, _serial: u32, _surface: *server.wl.Surface, _x: common.Fixed, _y: common.Fixed, _id: ?*server.wl.DataOffer) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                    .{ .f = _x },
                    .{ .f = _y },
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const enter_since_version = 1;

            /// This event is sent when the drag-and-drop pointer leaves the
            /// surface and the session ends.  The client must destroy the
            /// wl_data_offer introduced at enter time at this point.
            pub fn sendLeave(_data_device: *DataDevice) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                _resource.postEvent(2, null);
            }
            pub const leave_since_version = 1;

            /// This event is sent when the drag-and-drop pointer moves within
            /// the currently focused surface. The new position of the pointer
            /// is provided by the x and y arguments, in surface-local
            /// coordinates.
            pub fn sendMotion(_data_device: *DataDevice, _time: u32, _x: common.Fixed, _y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .f = _x },
                    .{ .f = _y },
                };
                _resource.postEvent(3, &_args);
            }
            pub const motion_since_version = 1;

            /// The event is sent when a drag-and-drop operation is ended
            /// because the implicit grab is removed.
            ///
            /// The drag-and-drop destination is expected to honor the last action
            /// received through wl_data_offer.action, if the resulting action is
            /// "copy" or "move", the destination can still perform
            /// wl_data_offer.receive requests, and is expected to end all
            /// transfers with a wl_data_offer.finish request.
            ///
            /// If the resulting action is "ask", the action will not be considered
            /// final. The drag-and-drop destination is expected to perform one last
            /// wl_data_offer.set_actions request, or wl_data_offer.destroy in order
            /// to cancel the operation.
            pub fn sendDrop(_data_device: *DataDevice) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                _resource.postEvent(4, null);
            }
            pub const drop_since_version = 1;

            /// The selection event is sent out to notify the client of a new
            /// wl_data_offer for the selection for this device.  The
            /// data_device.data_offer and the data_offer.offer events are
            /// sent out immediately before this event to introduce the data
            /// offer object.  The selection event is sent to a client
            /// immediately before receiving keyboard focus and when a new
            /// selection is set while the client has keyboard focus.  The
            /// data_offer is valid until a new data_offer or NULL is received
            /// or until the client loses keyboard focus.  Switching surface with
            /// keyboard focus within the same client doesn't mean a new selection
            /// will be sent.  The client must destroy the previous selection
            /// data_offer, if any, upon receiving this event.
            pub fn sendSelection(_data_device: *DataDevice, _id: ?*server.wl.DataOffer) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_device);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(5, &_args);
            }
            pub const selection_since_version = 1;
        };

        /// A wl_data_offer represents a piece of data offered for transfer
        /// by another client (the source client).  It is used by the
        /// copy-and-paste and drag-and-drop mechanisms.  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.
        pub const DataOffer = opaque {
            pub const generated_version = 3;
            pub const interface = &common.wl.data_offer.interface;
            pub const Error = common.wl.data_offer.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DataOffer {
                return @ptrCast(try server.wl.Resource.create(_client, DataOffer, _version, _id));
            }
            pub inline fn destroy(_data_offer: *DataOffer) void {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DataOffer {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_data_offer: *DataOffer) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).getLink();
            }
            pub inline fn getClient(_data_offer: *DataOffer) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).getClient();
            }
            pub inline fn getId(_data_offer: *DataOffer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).getId();
            }
            pub inline fn getVersion(_data_offer: *DataOffer) u32 {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).getVersion();
            }
            pub inline fn postNoMemory(_data_offer: *DataOffer) void {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).postNoMemory();
            }
            pub inline fn getUserData(_data_offer: *DataOffer) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).getUserData();
            }
            pub inline fn postError(_data_offer: *DataOffer, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_data_offer)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const accept_since_version = 1;
                pub const receive_since_version = 1;
                pub const destroy_since_version = 1;
                pub const finish_since_version = 3;
                pub const set_actions_since_version = 3;

                /// Indicate that the client can accept the given mime type, or
                /// NULL for not accepted.
                ///
                /// For objects of version 2 or older, this request is used by the
                /// client to give feedback whether the client can receive the given
                /// mime type, or NULL if none is accepted; the feedback does not
                /// determine whether the drag-and-drop operation succeeds or not.
                ///
                /// For objects of version 3 or newer, this request determines the
                /// final result of the drag-and-drop operation. If the end result
                /// is that no mime types were accepted, the drag-and-drop operation
                /// will be cancelled and the corresponding drag source will receive
                /// wl_data_source.cancelled. Clients may still use this event in
                /// conjunction with wl_data_source.action for feedback.
                accept: struct {
                    serial: u32,
                    mime_type: ?[*:0]const u8,
                },

                /// 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,
                /// both before and after wl_data_device.drop. Drag-and-drop destination
                /// clients may preemptively fetch data or examine it more closely to
                /// determine acceptance.
                receive: struct {
                    mime_type: [*:0]const u8,
                    fd: i32,
                },

                /// Destroy the data offer.
                destroy: void,
                /// Notifies the compositor that the drag destination successfully
                /// finished the drag-and-drop operation.
                ///
                /// Upon receiving this request, the compositor will emit
                /// wl_data_source.dnd_finished on the drag source client.
                ///
                /// It is a client error to perform other requests than
                /// wl_data_offer.destroy after this one. It is also an error to perform
                /// this request after a NULL mime type has been set in
                /// wl_data_offer.accept or no action was received through
                /// wl_data_offer.action.
                ///
                /// If wl_data_offer.finish request is received for a non drag and drop
                /// operation, the invalid_finish protocol error is raised.
                finish: void,
                /// Sets the actions that the destination side client supports for
                /// this operation. This request may trigger the emission of
                /// wl_data_source.action and wl_data_offer.action events if the compositor
                /// needs to change the selected action.
                ///
                /// This request can be called multiple times throughout the
                /// drag-and-drop operation, typically in response to wl_data_device.enter
                /// or wl_data_device.motion events.
                ///
                /// This request determines the final result of the drag-and-drop
                /// operation. If the end result is that no action is accepted,
                /// the drag source will receive wl_data_source.cancelled.
                ///
                /// The dnd_actions argument must contain only values expressed in the
                /// wl_data_device_manager.dnd_actions enum, and the preferred_action
                /// argument must only contain one of those values set, otherwise it
                /// will result in a protocol error.
                ///
                /// While managing an "ask" action, the destination drag-and-drop client
                /// may perform further wl_data_offer.receive requests, and is expected
                /// to perform one last wl_data_offer.set_actions request with a preferred
                /// action other than "ask" (and optionally wl_data_offer.accept) before
                /// requesting wl_data_offer.finish, in order to convey the action selected
                /// by the user. If the preferred action is not in the
                /// wl_data_offer.source_actions mask, an error will be raised.
                ///
                /// If the "ask" action is dismissed (e.g. user cancellation), the client
                /// is expected to perform wl_data_offer.destroy right away.
                ///
                /// This request can only be made on drag-and-drop offers, a protocol error
                /// will be raised otherwise.
                set_actions: struct {
                    dnd_actions: common.wl.data_device_manager.DndAction,
                    preferred_action: common.wl.data_device_manager.DndAction,
                },
            };
            pub inline fn setHandler(
                _data_offer: *DataOffer,
                comptime T: type,
                handle_request: *const fn (_data_offer: *DataOffer, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_data_offer: *DataOffer, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_offer);
                _resource.setDispatcher(
                    common.Dispatcher(DataOffer, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DataOffer, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent immediately after creating the wl_data_offer object.  One
            /// event per offered mime type.
            pub fn sendOffer(_data_offer: *DataOffer, _mime_type: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .s = _mime_type },
                };
                _resource.postEvent(0, &_args);
            }
            pub const offer_since_version = 1;

            /// This event indicates the actions offered by the data source. It
            /// will be sent immediately after creating the wl_data_offer object,
            /// or anytime the source side changes its offered actions through
            /// wl_data_source.set_actions.
            pub fn sendSourceActions(_data_offer: *DataOffer, _source_actions: common.wl.data_device_manager.DndAction) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_source_actions))),
                        .@"struct" => @bitCast(_source_actions),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(1, &_args);
            }
            pub const source_actions_since_version = 3;

            /// This event indicates the action selected by the compositor after
            /// matching the source/destination side actions. Only one action (or
            /// none) will be offered here.
            ///
            /// This event can be emitted multiple times during the drag-and-drop
            /// operation in response to destination side action changes through
            /// wl_data_offer.set_actions.
            ///
            /// This event will no longer be emitted after wl_data_device.drop
            /// happened on the drag-and-drop destination, the client must
            /// honor the last action received, or the last preferred one set
            /// through wl_data_offer.set_actions when handling an "ask" action.
            ///
            /// Compositors may also change the selected action on the fly, mainly
            /// in response to keyboard modifier changes during the drag-and-drop
            /// operation.
            ///
            /// The most recent action received is always the valid one. Prior to
            /// receiving wl_data_device.drop, the chosen action may change (e.g.
            /// due to keyboard modifiers being pressed). At the time of receiving
            /// wl_data_device.drop the drag-and-drop destination must honor the
            /// last action received.
            ///
            /// Action changes may still happen after wl_data_device.drop,
            /// especially on "ask" actions, where the drag-and-drop destination
            /// may choose another action afterwards. Action changes happening
            /// at this stage are always the result of inter-client negotiation, the
            /// compositor shall no longer be able to induce a different action.
            ///
            /// Upon "ask" actions, it is expected that the drag-and-drop destination
            /// may potentially choose a different action and/or mime type,
            /// based on wl_data_offer.source_actions and finally chosen by the
            /// user (e.g. popping up a menu with the available options). The
            /// final wl_data_offer.set_actions and wl_data_offer.accept requests
            /// must happen before the call to wl_data_offer.finish.
            pub fn sendAction(_data_offer: *DataOffer, _dnd_action: common.wl.data_device_manager.DndAction) void {
                const _resource: *server.wl.Resource = @ptrCast(_data_offer);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wl.data_device_manager.DndAction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_dnd_action))),
                        .@"struct" => @bitCast(_dnd_action),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(2, &_args);
            }
            pub const action_since_version = 3;
        };
    };
    pub const zwp = struct {
        /// An object that provides access to the graphics tablets available on this
        /// system. All tablets are associated with a seat, to get access to the
        /// actual tablets, use zwp_tablet_manager_v2.get_tablet_seat.
        pub const TabletManagerV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_manager_v2.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletManagerV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletManagerV2, _version, _id));
            }
            pub inline fn destroy(_tablet_manager_v2: *TabletManagerV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletManagerV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_manager_v2: *TabletManagerV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).getLink();
            }
            pub inline fn getClient(_tablet_manager_v2: *TabletManagerV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).getClient();
            }
            pub inline fn getId(_tablet_manager_v2: *TabletManagerV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).getId();
            }
            pub inline fn getVersion(_tablet_manager_v2: *TabletManagerV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_manager_v2: *TabletManagerV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_manager_v2: *TabletManagerV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_manager_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const get_tablet_seat_since_version = 1;
                pub const destroy_since_version = 1;

                /// Get the zwp_tablet_seat_v2 object for the given seat. This object
                /// provides access to all graphics tablets in this seat.
                get_tablet_seat: struct {
                    tablet_seat: u32,
                    seat: *server.wl.Seat,
                },

                /// Destroy the zwp_tablet_manager_v2 object. Objects created from this
                /// object are unaffected and should be destroyed separately.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_manager_v2: *TabletManagerV2,
                comptime T: type,
                handle_request: *const fn (_tablet_manager_v2: *TabletManagerV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_manager_v2: *TabletManagerV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_manager_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletManagerV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletManagerV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An object that provides access to the graphics tablets available on this
        /// seat. After binding to this interface, the compositor sends a set of
        /// zwp_tablet_seat_v2.tablet_added and zwp_tablet_seat_v2.tool_added events.
        pub const TabletSeatV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_seat_v2.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletSeatV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletSeatV2, _version, _id));
            }
            pub inline fn destroy(_tablet_seat_v2: *TabletSeatV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletSeatV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_seat_v2: *TabletSeatV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).getLink();
            }
            pub inline fn getClient(_tablet_seat_v2: *TabletSeatV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).getClient();
            }
            pub inline fn getId(_tablet_seat_v2: *TabletSeatV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).getId();
            }
            pub inline fn getVersion(_tablet_seat_v2: *TabletSeatV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_seat_v2: *TabletSeatV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_seat_v2: *TabletSeatV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_seat_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// Destroy the zwp_tablet_seat_v2 object. Objects created from this
                /// object are unaffected and should be destroyed separately.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_seat_v2: *TabletSeatV2,
                comptime T: type,
                handle_request: *const fn (_tablet_seat_v2: *TabletSeatV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_seat_v2: *TabletSeatV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_seat_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletSeatV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletSeatV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent whenever a new tablet becomes available on this
            /// seat. This event only provides the object id of the tablet, any
            /// static information about the tablet (device name, vid/pid, etc.) is
            /// sent through the zwp_tablet_v2 interface.
            pub fn sendTabletAdded(_tablet_seat_v2: *TabletSeatV2, _id: *server.zwp.TabletV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_seat_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(0, &_args);
            }
            pub const tablet_added_since_version = 1;

            /// This event is sent whenever a tool that has not previously been used
            /// with a tablet comes into use. This event only provides the object id
            /// of the tool; any static information about the tool (capabilities,
            /// type, etc.) is sent through the zwp_tablet_tool_v2 interface.
            pub fn sendToolAdded(_tablet_seat_v2: *TabletSeatV2, _id: *server.zwp.TabletToolV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_seat_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const tool_added_since_version = 1;

            /// This event is sent whenever a new pad is known to the system. Typically,
            /// pads are physically attached to tablets and a pad_added event is
            /// sent immediately after the zwp_tablet_seat_v2.tablet_added.
            /// However, some standalone pad devices logically attach to tablets at
            /// runtime, and the client must wait for zwp_tablet_pad_v2.enter to know
            /// the tablet a pad is attached to.
            ///
            /// This event only provides the object id of the pad. All further
            /// features (buttons, strips, rings) are sent through the zwp_tablet_pad_v2
            /// interface.
            pub fn sendPadAdded(_tablet_seat_v2: *TabletSeatV2, _id: *server.zwp.TabletPadV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_seat_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(2, &_args);
            }
            pub const pad_added_since_version = 1;
        };

        /// The zwp_tablet_v2 interface represents one graphics tablet device. The
        /// tablet interface itself does not generate events; all events are
        /// generated by zwp_tablet_tool_v2 objects when in proximity above a tablet.
        ///
        /// A tablet has a number of static characteristics, e.g. device name and
        /// pid/vid. These capabilities are sent in an event sequence after the
        /// zwp_tablet_seat_v2.tablet_added event. This initial event sequence is
        /// terminated by a zwp_tablet_v2.done event.
        pub const TabletV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_v2.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletV2, _version, _id));
            }
            pub inline fn destroy(_tablet_v2: *TabletV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_v2: *TabletV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).getLink();
            }
            pub inline fn getClient(_tablet_v2: *TabletV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).getClient();
            }
            pub inline fn getId(_tablet_v2: *TabletV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).getId();
            }
            pub inline fn getVersion(_tablet_v2: *TabletV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_v2: *TabletV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_v2: *TabletV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// This destroys the client's resource for this tablet object.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_v2: *TabletV2,
                comptime T: type,
                handle_request: *const fn (_tablet_v2: *TabletV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_v2: *TabletV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// A descriptive name for the tablet device.
            ///
            /// If the device has no descriptive name, this event is not sent.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_v2.done event.
            pub fn sendName(_tablet_v2: *TabletV2, _name: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _resource.postEvent(0, &_args);
            }
            pub const name_since_version = 1;

            /// The vendor and product IDs for the tablet device.
            ///
            /// The interpretation of the id depends on the zwp_tablet_v2.bustype.
            /// Prior to version v2 of this protocol, the id was implied to be a USB
            /// vendor and product ID. If no zwp_tablet_v2.bustype is sent, the ID
            /// is to be interpreted as USB vendor and product ID.
            ///
            /// If the device has no vendor/product ID, this event is not sent.
            /// This can happen for virtual devices or non-USB devices, for instance.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_v2.done event.
            pub fn sendId(_tablet_v2: *TabletV2, _vid: u32, _pid: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                var _args = [_]common.Argument{
                    .{ .u = _vid },
                    .{ .u = _pid },
                };
                _resource.postEvent(1, &_args);
            }
            pub const id_since_version = 1;

            /// A system-specific device path that indicates which device is behind
            /// this zwp_tablet_v2. This information may be used to gather additional
            /// information about the device, e.g. through libwacom.
            ///
            /// A device may have more than one device path. If so, multiple
            /// zwp_tablet_v2.path events are sent. A device may be emulated and not
            /// have a device path, and in that case this event will not be sent.
            ///
            /// The format of the path is unspecified, it may be a device node, a
            /// sysfs path, or some other identifier. It is up to the client to
            /// identify the string provided.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_v2.done event.
            pub fn sendPath(_tablet_v2: *TabletV2, _path: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                var _args = [_]common.Argument{
                    .{ .s = _path },
                };
                _resource.postEvent(2, &_args);
            }
            pub const path_since_version = 1;

            /// This event is sent immediately to signal the end of the initial
            /// burst of descriptive events. A client may consider the static
            /// description of the tablet to be complete and finalize initialization
            /// of the tablet.
            pub fn sendDone(_tablet_v2: *TabletV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                _resource.postEvent(3, null);
            }
            pub const done_since_version = 1;

            /// Sent when the tablet has been removed from the system. When a tablet
            /// is removed, some tools may be removed.
            ///
            /// When this event is received, the client must zwp_tablet_v2.destroy
            /// the object.
            pub fn sendRemoved(_tablet_v2: *TabletV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_v2);
                _resource.postEvent(4, null);
            }
            pub const removed_since_version = 1;
        };

        /// An object that represents a physical tool that has been, or is
        /// currently in use with a tablet in this seat. Each zwp_tablet_tool_v2
        /// object stays valid until the client destroys it; the compositor
        /// reuses the zwp_tablet_tool_v2 object to indicate that the object's
        /// respective physical tool has come into proximity of a tablet again.
        ///
        /// A zwp_tablet_tool_v2 object's relation to a physical tool depends on the
        /// tablet's ability to report serial numbers. If the tablet supports
        /// this capability, then the object represents a specific physical tool
        /// and can be identified even when used on multiple tablets.
        ///
        /// A tablet tool has a number of static characteristics, e.g. tool type,
        /// hardware_serial and capabilities. These capabilities are sent in an
        /// event sequence after the zwp_tablet_seat_v2.tool_added event before any
        /// actual events from this tool. This initial event sequence is
        /// terminated by a zwp_tablet_tool_v2.done event.
        ///
        /// Tablet tool events are grouped by zwp_tablet_tool_v2.frame events.
        /// Any events received before a zwp_tablet_tool_v2.frame event should be
        /// considered part of the same hardware state change.
        pub const TabletToolV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_tool_v2.interface;
            pub const Type = common.zwp.tablet_tool_v2.Type;
            pub const Capability = common.zwp.tablet_tool_v2.Capability;
            pub const ButtonState = common.zwp.tablet_tool_v2.ButtonState;
            pub const Error = common.zwp.tablet_tool_v2.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletToolV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletToolV2, _version, _id));
            }
            pub inline fn destroy(_tablet_tool_v2: *TabletToolV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletToolV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_tool_v2: *TabletToolV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).getLink();
            }
            pub inline fn getClient(_tablet_tool_v2: *TabletToolV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).getClient();
            }
            pub inline fn getId(_tablet_tool_v2: *TabletToolV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).getId();
            }
            pub inline fn getVersion(_tablet_tool_v2: *TabletToolV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_tool_v2: *TabletToolV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_tool_v2: *TabletToolV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).getUserData();
            }
            pub inline fn postError(_tablet_tool_v2: *TabletToolV2, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_tool_v2)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const set_cursor_since_version = 1;
                pub const destroy_since_version = 1;

                /// Sets the surface of the cursor used for this tool on the given
                /// tablet. This request only takes effect if the tool is in proximity
                /// of one of the requesting client's surfaces or the surface parameter
                /// is the current pointer surface. If there was a previous surface set
                /// with this request it is replaced. If surface is NULL, the cursor
                /// image is hidden.
                ///
                /// The parameters hotspot_x and hotspot_y define the position of the
                /// pointer surface relative to the pointer location. Its top-left corner
                /// is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the
                /// coordinates of the pointer location, in surface-local coordinates.
                ///
                /// On surface.attach requests to the pointer surface, hotspot_x and
                /// hotspot_y are decremented by the x and y parameters passed to the
                /// request. Attach must be confirmed by wl_surface.commit as usual.
                ///
                /// The hotspot can also be updated by passing the currently set pointer
                /// surface to this request with new values for hotspot_x and hotspot_y.
                ///
                /// The current and pending input regions of the wl_surface are cleared,
                /// and wl_surface.set_input_region is ignored until the wl_surface is no
                /// longer used as the cursor. When the use as a cursor ends, the current
                /// and pending input regions become undefined, and the wl_surface is
                /// unmapped.
                ///
                /// This request gives the surface the role of a zwp_tablet_tool_v2 cursor. A
                /// surface may only ever be used as the cursor surface for one
                /// zwp_tablet_tool_v2. If the surface already has another role or has
                /// previously been used as cursor surface for a different tool, a
                /// protocol error is raised.
                set_cursor: struct {
                    serial: u32,
                    surface: ?*server.wl.Surface,
                    hotspot_x: i32,
                    hotspot_y: i32,
                },

                /// This destroys the client's resource for this tool object.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_tool_v2: *TabletToolV2,
                comptime T: type,
                handle_request: *const fn (_tablet_tool_v2: *TabletToolV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_tool_v2: *TabletToolV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletToolV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletToolV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The tool type is the high-level type of the tool and usually decides
            /// the interaction expected from this tool.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_tool_v2.done event.
            pub fn sendType(_tablet_tool_v2: *TabletToolV2, _tool_type: Type) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Type)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_tool_type))),
                        .@"struct" => @bitCast(_tool_type),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const type_since_version = 1;

            /// If the physical tool can be identified by a unique 64-bit serial
            /// number, this event notifies the client of this serial number.
            ///
            /// If multiple tablets are available in the same seat and the tool is
            /// uniquely identifiable by the serial number, that tool may move
            /// between tablets.
            ///
            /// Otherwise, if the tool has no serial number and this event is
            /// missing, the tool is tied to the tablet it first comes into
            /// proximity with. Even if the physical tool is used on multiple
            /// tablets, separate zwp_tablet_tool_v2 objects will be created, one per
            /// tablet.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_tool_v2.done event.
            pub fn sendHardwareSerial(_tablet_tool_v2: *TabletToolV2, _hardware_serial_hi: u32, _hardware_serial_lo: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _hardware_serial_hi },
                    .{ .u = _hardware_serial_lo },
                };
                _resource.postEvent(1, &_args);
            }
            pub const hardware_serial_since_version = 1;

            /// This event notifies the client of a hardware id available on this tool.
            ///
            /// The hardware id is a device-specific 64-bit id that provides extra
            /// information about the tool in use, beyond the wl_tool.type
            /// enumeration. The format of the id is specific to tablets made by
            /// Wacom Inc. For example, the hardware id of a Wacom Grip
            /// Pen (a stylus) is 0x802.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_tool_v2.done event.
            pub fn sendHardwareIdWacom(_tablet_tool_v2: *TabletToolV2, _hardware_id_hi: u32, _hardware_id_lo: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _hardware_id_hi },
                    .{ .u = _hardware_id_lo },
                };
                _resource.postEvent(2, &_args);
            }
            pub const hardware_id_wacom_since_version = 1;

            /// This event notifies the client of any capabilities of this tool,
            /// beyond the main set of x/y axes and tip up/down detection.
            ///
            /// One event is sent for each extra capability available on this tool.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_tool_v2.done event.
            pub fn sendCapability(_tablet_tool_v2: *TabletToolV2, _capability: Capability) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Capability)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_capability))),
                        .@"struct" => @bitCast(_capability),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const capability_since_version = 1;

            /// This event signals the end of the initial burst of descriptive
            /// events. A client may consider the static description of the tool to
            /// be complete and finalize initialization of the tool.
            pub fn sendDone(_tablet_tool_v2: *TabletToolV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                _resource.postEvent(4, null);
            }
            pub const done_since_version = 1;

            /// This event is sent when the tool is removed from the system and will
            /// send no further events. Should the physical tool come back into
            /// proximity later, a new zwp_tablet_tool_v2 object will be created.
            ///
            /// It is compositor-dependent when a tool is removed. A compositor may
            /// remove a tool on proximity out, tablet removal or any other reason.
            /// A compositor may also keep a tool alive until shutdown.
            ///
            /// If the tool is currently in proximity, a proximity_out event will be
            /// sent before the removed event. See zwp_tablet_tool_v2.proximity_out for
            /// the handling of any buttons logically down.
            ///
            /// When this event is received, the client must zwp_tablet_tool_v2.destroy
            /// the object.
            pub fn sendRemoved(_tablet_tool_v2: *TabletToolV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                _resource.postEvent(5, null);
            }
            pub const removed_since_version = 1;

            /// Notification that this tool is focused on a certain surface.
            ///
            /// This event can be received when the tool has moved from one surface to
            /// another, or when the tool has come back into proximity above the
            /// surface.
            ///
            /// If any button is logically down when the tool comes into proximity,
            /// the respective button event is sent after the proximity_in event but
            /// within the same frame as the proximity_in event.
            pub fn sendProximityIn(_tablet_tool_v2: *TabletToolV2, _serial: u32, _tablet: *server.zwp.TabletV2, _surface: *server.wl.Surface) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_tablet) },
                    .{ .o = @ptrCast(_surface) },
                };
                _resource.postEvent(6, &_args);
            }
            pub const proximity_in_since_version = 1;

            /// Notification that this tool has either left proximity, or is no
            /// longer focused on a certain surface.
            ///
            /// When the tablet tool leaves proximity of the tablet, button release
            /// events are sent for each button that was held down at the time of
            /// leaving proximity. These events are sent before the proximity_out
            /// event but within the same zwp_tablet_v2.frame.
            ///
            /// If the tool stays within proximity of the tablet, but the focus
            /// changes from one surface to another, a button release event may not
            /// be sent until the button is actually released or the tool leaves the
            /// proximity of the tablet.
            pub fn sendProximityOut(_tablet_tool_v2: *TabletToolV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                _resource.postEvent(7, null);
            }
            pub const proximity_out_since_version = 1;

            /// Sent whenever the tablet tool comes in contact with the surface of the
            /// tablet.
            ///
            /// If the tool is already in contact with the tablet when entering the
            /// input region, the client owning said region will receive a
            /// zwp_tablet_v2.proximity_in event, followed by a zwp_tablet_v2.down
            /// event and a zwp_tablet_v2.frame event.
            ///
            /// Note that this event describes logical contact, not physical
            /// contact. On some devices, a compositor may not consider a tool in
            /// logical contact until a minimum physical pressure threshold is
            /// exceeded.
            pub fn sendDown(_tablet_tool_v2: *TabletToolV2, _serial: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _resource.postEvent(8, &_args);
            }
            pub const down_since_version = 1;

            /// Sent whenever the tablet tool stops making contact with the surface of
            /// the tablet, or when the tablet tool moves out of the input region
            /// and the compositor grab (if any) is dismissed.
            ///
            /// If the tablet tool moves out of the input region while in contact
            /// with the surface of the tablet and the compositor does not have an
            /// ongoing grab on the surface, the client owning said region will
            /// receive a zwp_tablet_v2.up event, followed by a zwp_tablet_v2.proximity_out
            /// event and a zwp_tablet_v2.frame event. If the compositor has an ongoing
            /// grab on this device, this event sequence is sent whenever the grab
            /// is dismissed in the future.
            ///
            /// Note that this event describes logical contact, not physical
            /// contact. On some devices, a compositor may not consider a tool out
            /// of logical contact until physical pressure falls below a specific
            /// threshold.
            pub fn sendUp(_tablet_tool_v2: *TabletToolV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                _resource.postEvent(9, null);
            }
            pub const up_since_version = 1;

            /// Sent whenever a tablet tool moves.
            pub fn sendMotion(_tablet_tool_v2: *TabletToolV2, _x: common.Fixed, _y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .f = _x },
                    .{ .f = _y },
                };
                _resource.postEvent(10, &_args);
            }
            pub const motion_since_version = 1;

            /// Sent whenever the pressure axis on a tool changes. The value of this
            /// event is normalized to a value between 0 and 65535.
            ///
            /// Note that pressure may be nonzero even when a tool is not in logical
            /// contact. See the down and up events for more details.
            pub fn sendPressure(_tablet_tool_v2: *TabletToolV2, _pressure: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _pressure },
                };
                _resource.postEvent(11, &_args);
            }
            pub const pressure_since_version = 1;

            /// Sent whenever the distance axis on a tool changes. The value of this
            /// event is normalized to a value between 0 and 65535.
            ///
            /// Note that distance may be nonzero even when a tool is not in logical
            /// contact. See the down and up events for more details.
            pub fn sendDistance(_tablet_tool_v2: *TabletToolV2, _distance: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _distance },
                };
                _resource.postEvent(12, &_args);
            }
            pub const distance_since_version = 1;

            /// Sent whenever one or both of the tilt axes on a tool change. Each tilt
            /// value is in degrees, relative to the z-axis of the tablet.
            /// The angle is positive when the top of a tool tilts along the
            /// positive x or y axis.
            pub fn sendTilt(_tablet_tool_v2: *TabletToolV2, _tilt_x: common.Fixed, _tilt_y: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .f = _tilt_x },
                    .{ .f = _tilt_y },
                };
                _resource.postEvent(13, &_args);
            }
            pub const tilt_since_version = 1;

            /// Sent whenever the z-rotation axis on the tool changes. The
            /// rotation value is in degrees clockwise from the tool's
            /// logical neutral position.
            pub fn sendRotation(_tablet_tool_v2: *TabletToolV2, _degrees: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .f = _degrees },
                };
                _resource.postEvent(14, &_args);
            }
            pub const rotation_since_version = 1;

            /// Sent whenever the slider position on the tool changes. The
            /// value is normalized between -65535 and 65535, with 0 as the logical
            /// neutral position of the slider.
            ///
            /// The slider is available on e.g. the Wacom Airbrush tool.
            pub fn sendSlider(_tablet_tool_v2: *TabletToolV2, _position: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .i = _position },
                };
                _resource.postEvent(15, &_args);
            }
            pub const slider_since_version = 1;

            /// Sent whenever the wheel on the tool emits an event. This event
            /// contains two values for the same axis change. The degrees value is
            /// in the same orientation as the wl_pointer.vertical_scroll axis. The
            /// clicks value is in discrete logical clicks of the mouse wheel. This
            /// value may be zero if the movement of the wheel was less
            /// than one logical click.
            ///
            /// Clients should choose either value and avoid mixing degrees and
            /// clicks. The compositor may accumulate values smaller than a logical
            /// click and emulate click events when a certain threshold is met.
            /// Thus, zwp_tablet_tool_v2.wheel events with non-zero clicks values may
            /// have different degrees values.
            pub fn sendWheel(_tablet_tool_v2: *TabletToolV2, _degrees: common.Fixed, _clicks: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .f = _degrees },
                    .{ .i = _clicks },
                };
                _resource.postEvent(16, &_args);
            }
            pub const wheel_since_version = 1;

            /// Sent whenever a button on the tool is pressed or released.
            ///
            /// If a button is held down when the tool moves in or out of proximity,
            /// button events are generated by the compositor. See
            /// zwp_tablet_tool_v2.proximity_in and zwp_tablet_tool_v2.proximity_out for
            /// details.
            pub fn sendButton(_tablet_tool_v2: *TabletToolV2, _serial: u32, _button: u32, _state: ButtonState) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _button },
                    .{ .u = switch (@typeInfo(ButtonState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(17, &_args);
            }
            pub const button_since_version = 1;

            /// Marks the end of a series of axis and/or button updates from the
            /// tablet. The Wayland protocol requires axis updates to be sent
            /// sequentially, however all events within a frame should be considered
            /// one hardware event.
            pub fn sendFrame(_tablet_tool_v2: *TabletToolV2, _time: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_tool_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                };
                _resource.postEvent(18, &_args);
            }
            pub const frame_since_version = 1;
        };

        /// A pad device is a set of buttons, rings, strips and dials
        /// usually physically present on the tablet device itself. Some
        /// exceptions exist where the pad device is physically detached, e.g. the
        /// Wacom ExpressKey Remote.
        ///
        /// Pad devices have no axes that control the cursor and are generally
        /// auxiliary devices to the tool devices used on the tablet surface.
        ///
        /// A pad device has a number of static characteristics, e.g. the number
        /// of rings. These capabilities are sent in an event sequence after the
        /// zwp_tablet_seat_v2.pad_added event before any actual events from this pad.
        /// This initial event sequence is terminated by a zwp_tablet_pad_v2.done
        /// event.
        ///
        /// All pad features (buttons, rings, strips and dials) are logically divided into
        /// groups and all pads have at least one group. The available groups are
        /// notified through the zwp_tablet_pad_v2.group event; the compositor will
        /// emit one event per group before emitting zwp_tablet_pad_v2.done.
        ///
        /// Groups may have multiple modes. Modes allow clients to map multiple
        /// actions to a single pad feature. Only one mode can be active per group,
        /// although different groups may have different active modes.
        pub const TabletPadV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_v2.interface;
            pub const ButtonState = common.zwp.tablet_pad_v2.ButtonState;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletPadV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletPadV2, _version, _id));
            }
            pub inline fn destroy(_tablet_pad_v2: *TabletPadV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletPadV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_pad_v2: *TabletPadV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).getLink();
            }
            pub inline fn getClient(_tablet_pad_v2: *TabletPadV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).getClient();
            }
            pub inline fn getId(_tablet_pad_v2: *TabletPadV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_v2: *TabletPadV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_pad_v2: *TabletPadV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_pad_v2: *TabletPadV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const set_feedback_since_version = 1;
                pub const destroy_since_version = 1;

                /// Requests the compositor to use the provided feedback string
                /// associated with this button. This request should be issued immediately
                /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
                /// group is received, or whenever a button is mapped to a different
                /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
                ///
                /// Clients are encouraged to provide context-aware descriptions for
                /// the actions associated with each button, and compositors may use
                /// this information to offer visual feedback on the button layout
                /// (e.g. on-screen displays).
                ///
                /// Button indices start at 0. Setting the feedback string on a button
                /// that is reserved by the compositor (i.e. not belonging to any
                /// zwp_tablet_pad_group_v2) does not generate an error but the compositor
                /// is free to ignore the request.
                ///
                /// The provided string 'description' is a UTF-8 encoded string to be
                /// associated with this ring, and is considered user-visible; general
                /// internationalization rules apply.
                ///
                /// The serial argument will be that of the last
                /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
                /// button. Requests providing other serials than the most recent one will
                /// be ignored.
                set_feedback: struct {
                    button: u32,
                    description: [*:0]const u8,
                    serial: u32,
                },

                /// Destroy the zwp_tablet_pad_v2 object. Objects created from this object
                /// are unaffected and should be destroyed separately.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_pad_v2: *TabletPadV2,
                comptime T: type,
                handle_request: *const fn (_tablet_pad_v2: *TabletPadV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_pad_v2: *TabletPadV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletPadV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletPadV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent on zwp_tablet_pad_v2 initialization to announce available groups.
            /// One event is sent for each pad group available.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_v2.done event. At least one group will be announced.
            pub fn sendGroup(_tablet_pad_v2: *TabletPadV2, _pad_group: *server.zwp.TabletPadGroupV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_pad_group) },
                };
                _resource.postEvent(0, &_args);
            }
            pub const group_since_version = 1;

            /// A system-specific device path that indicates which device is behind
            /// this zwp_tablet_pad_v2. This information may be used to gather additional
            /// information about the device, e.g. through libwacom.
            ///
            /// The format of the path is unspecified, it may be a device node, a
            /// sysfs path, or some other identifier. It is up to the client to
            /// identify the string provided.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_v2.done event.
            pub fn sendPath(_tablet_pad_v2: *TabletPadV2, _path: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .s = _path },
                };
                _resource.postEvent(1, &_args);
            }
            pub const path_since_version = 1;

            /// Sent on zwp_tablet_pad_v2 initialization to announce the available
            /// buttons.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_v2.done event. This event is only sent when at least one
            /// button is available.
            pub fn sendButtons(_tablet_pad_v2: *TabletPadV2, _buttons: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .u = _buttons },
                };
                _resource.postEvent(2, &_args);
            }
            pub const buttons_since_version = 1;

            /// This event signals the end of the initial burst of descriptive
            /// events. A client may consider the static description of the pad to
            /// be complete and finalize initialization of the pad.
            pub fn sendDone(_tablet_pad_v2: *TabletPadV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                _resource.postEvent(3, null);
            }
            pub const done_since_version = 1;

            /// Sent whenever the physical state of a button changes.
            pub fn sendButton(_tablet_pad_v2: *TabletPadV2, _time: u32, _button: u32, _state: ButtonState) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .u = _button },
                    .{ .u = switch (@typeInfo(ButtonState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(4, &_args);
            }
            pub const button_since_version = 1;

            /// Notification that this pad is focused on the specified surface.
            pub fn sendEnter(_tablet_pad_v2: *TabletPadV2, _serial: u32, _tablet: *server.zwp.TabletV2, _surface: *server.wl.Surface) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_tablet) },
                    .{ .o = @ptrCast(_surface) },
                };
                _resource.postEvent(5, &_args);
            }
            pub const enter_since_version = 1;

            /// Notification that this pad is no longer focused on the specified
            /// surface.
            pub fn sendLeave(_tablet_pad_v2: *TabletPadV2, _serial: u32, _surface: *server.wl.Surface) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .o = @ptrCast(_surface) },
                };
                _resource.postEvent(6, &_args);
            }
            pub const leave_since_version = 1;

            /// Sent when the pad has been removed from the system. When a tablet
            /// is removed its pad(s) will be removed too.
            ///
            /// When this event is received, the client must destroy all rings, strips
            /// and groups that were offered by this pad, and issue zwp_tablet_pad_v2.destroy
            /// the pad itself.
            pub fn sendRemoved(_tablet_pad_v2: *TabletPadV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_v2);
                _resource.postEvent(7, null);
            }
            pub const removed_since_version = 1;
        };

        /// A pad group describes a distinct (sub)set of buttons, rings and strips
        /// present in the tablet. The criteria of this grouping is usually positional,
        /// eg. if a tablet has buttons on the left and right side, 2 groups will be
        /// presented. The physical arrangement of groups is undisclosed and may
        /// change on the fly.
        ///
        /// Pad groups will announce their features during pad initialization. Between
        /// the corresponding zwp_tablet_pad_v2.group event and zwp_tablet_pad_group_v2.done, the
        /// pad group will announce the buttons, rings and strips contained in it,
        /// plus the number of supported modes.
        ///
        /// Modes are a mechanism to allow multiple groups of actions for every element
        /// in the pad group. The number of groups and available modes in each is
        /// persistent across device plugs. The current mode is user-switchable, it
        /// will be announced through the zwp_tablet_pad_group_v2.mode_switch event both
        /// whenever it is switched, and after zwp_tablet_pad_v2.enter.
        ///
        /// The current mode logically applies to all elements in the pad group,
        /// although it is at clients' discretion whether to actually perform different
        /// actions, and/or issue the respective .set_feedback requests to notify the
        /// compositor. See the zwp_tablet_pad_group_v2.mode_switch event for more details.
        pub const TabletPadGroupV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_group_v2.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletPadGroupV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletPadGroupV2, _version, _id));
            }
            pub inline fn destroy(_tablet_pad_group_v2: *TabletPadGroupV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletPadGroupV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_pad_group_v2: *TabletPadGroupV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).getLink();
            }
            pub inline fn getClient(_tablet_pad_group_v2: *TabletPadGroupV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).getClient();
            }
            pub inline fn getId(_tablet_pad_group_v2: *TabletPadGroupV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_group_v2: *TabletPadGroupV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_pad_group_v2: *TabletPadGroupV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_pad_group_v2: *TabletPadGroupV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_group_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// Destroy the zwp_tablet_pad_group_v2 object. Objects created from this object
                /// are unaffected and should be destroyed separately.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_pad_group_v2: *TabletPadGroupV2,
                comptime T: type,
                handle_request: *const fn (_tablet_pad_group_v2: *TabletPadGroupV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_pad_group_v2: *TabletPadGroupV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletPadGroupV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletPadGroupV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent on zwp_tablet_pad_group_v2 initialization to announce the available
            /// buttons in the group. Button indices start at 0, a button may only be
            /// in one group at a time.
            ///
            /// This event is first sent in the initial burst of events before the
            /// zwp_tablet_pad_group_v2.done event.
            ///
            /// Some buttons are reserved by the compositor. These buttons may not be
            /// assigned to any zwp_tablet_pad_group_v2. Compositors may broadcast this
            /// event in the case of changes to the mapping of these reserved buttons.
            /// If the compositor happens to reserve all buttons in a group, this event
            /// will be sent with an empty array.
            pub fn sendButtons(_tablet_pad_group_v2: *TabletPadGroupV2, _buttons: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                var _args = [_]common.Argument{
                    .{ .a = _buttons },
                };
                _resource.postEvent(0, &_args);
            }
            pub const buttons_since_version = 1;

            /// Sent on zwp_tablet_pad_group_v2 initialization to announce available rings.
            /// One event is sent for each ring available on this pad group.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_group_v2.done event.
            pub fn sendRing(_tablet_pad_group_v2: *TabletPadGroupV2, _ring: *server.zwp.TabletPadRingV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_ring) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const ring_since_version = 1;

            /// Sent on zwp_tablet_pad_v2 initialization to announce available strips.
            /// One event is sent for each strip available on this pad group.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_group_v2.done event.
            pub fn sendStrip(_tablet_pad_group_v2: *TabletPadGroupV2, _strip: *server.zwp.TabletPadStripV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_strip) },
                };
                _resource.postEvent(2, &_args);
            }
            pub const strip_since_version = 1;

            /// Sent on zwp_tablet_pad_group_v2 initialization to announce that the pad
            /// group may switch between modes. A client may use a mode to store a
            /// specific configuration for buttons, rings and strips and use the
            /// zwp_tablet_pad_group_v2.mode_switch event to toggle between these
            /// configurations. Mode indices start at 0.
            ///
            /// Switching modes is compositor-dependent. See the
            /// zwp_tablet_pad_group_v2.mode_switch event for more details.
            ///
            /// This event is sent in the initial burst of events before the
            /// zwp_tablet_pad_group_v2.done event. This event is only sent when
            /// more than one mode is available.
            pub fn sendModes(_tablet_pad_group_v2: *TabletPadGroupV2, _modes: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                var _args = [_]common.Argument{
                    .{ .u = _modes },
                };
                _resource.postEvent(3, &_args);
            }
            pub const modes_since_version = 1;

            /// This event is sent immediately to signal the end of the initial
            /// burst of descriptive events. A client may consider the static
            /// description of the tablet to be complete and finalize initialization
            /// of the tablet group.
            pub fn sendDone(_tablet_pad_group_v2: *TabletPadGroupV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                _resource.postEvent(4, null);
            }
            pub const done_since_version = 1;

            /// Notification that the mode was switched.
            ///
            /// A mode applies to all buttons, rings, strips and dials in a group
            /// simultaneously, but a client is not required to assign different actions
            /// for each mode. For example, a client may have mode-specific button
            /// mappings but map the ring to vertical scrolling in all modes. Mode
            /// indices start at 0.
            ///
            /// Switching modes is compositor-dependent. The compositor may provide
            /// visual cues to the user about the mode, e.g. by toggling LEDs on
            /// the tablet device. Mode-switching may be software-controlled or
            /// controlled by one or more physical buttons. For example, on a Wacom
            /// Intuos Pro, the button inside the ring may be assigned to switch
            /// between modes.
            ///
            /// The compositor will also send this event after zwp_tablet_pad_v2.enter on
            /// each group in order to notify of the current mode. Groups that only
            /// feature one mode will use mode=0 when emitting this event.
            ///
            /// If a button action in the new mode differs from the action in the
            /// previous mode, the client should immediately issue a
            /// zwp_tablet_pad_v2.set_feedback request for each changed button.
            ///
            /// If a ring, strip or dial action in the new mode differs from the action
            /// in the previous mode, the client should immediately issue a
            /// zwp_tablet_ring_v2.set_feedback, zwp_tablet_strip_v2.set_feedback or
            /// zwp_tablet_dial_v2.set_feedback request for each changed ring, strip or dial.
            pub fn sendModeSwitch(_tablet_pad_group_v2: *TabletPadGroupV2, _time: u32, _serial: u32, _mode: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_group_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .u = _serial },
                    .{ .u = _mode },
                };
                _resource.postEvent(5, &_args);
            }
            pub const mode_switch_since_version = 1;
        };

        /// A circular interaction area, such as the touch ring on the Wacom Intuos
        /// Pro series tablets.
        ///
        /// Events on a ring are logically grouped by the zwp_tablet_pad_ring_v2.frame
        /// event.
        pub const TabletPadRingV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_ring_v2.interface;
            pub const Source = common.zwp.tablet_pad_ring_v2.Source;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletPadRingV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletPadRingV2, _version, _id));
            }
            pub inline fn destroy(_tablet_pad_ring_v2: *TabletPadRingV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletPadRingV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_pad_ring_v2: *TabletPadRingV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).getLink();
            }
            pub inline fn getClient(_tablet_pad_ring_v2: *TabletPadRingV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).getClient();
            }
            pub inline fn getId(_tablet_pad_ring_v2: *TabletPadRingV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_ring_v2: *TabletPadRingV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_pad_ring_v2: *TabletPadRingV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_pad_ring_v2: *TabletPadRingV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_ring_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const set_feedback_since_version = 1;
                pub const destroy_since_version = 1;

                /// Request that the compositor use the provided feedback string
                /// associated with this ring. This request should be issued immediately
                /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
                /// group is received, or whenever the ring is mapped to a different
                /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
                ///
                /// Clients are encouraged to provide context-aware descriptions for
                /// the actions associated with the ring; compositors may use this
                /// information to offer visual feedback about the button layout
                /// (eg. on-screen displays).
                ///
                /// The provided string 'description' is a UTF-8 encoded string to be
                /// associated with this ring, and is considered user-visible; general
                /// internationalization rules apply.
                ///
                /// The serial argument will be that of the last
                /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
                /// ring. Requests providing other serials than the most recent one will be
                /// ignored.
                set_feedback: struct {
                    description: [*:0]const u8,
                    serial: u32,
                },

                /// This destroys the client's resource for this ring object.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_pad_ring_v2: *TabletPadRingV2,
                comptime T: type,
                handle_request: *const fn (_tablet_pad_ring_v2: *TabletPadRingV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_pad_ring_v2: *TabletPadRingV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_ring_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletPadRingV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletPadRingV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Source information for ring events.
            ///
            /// This event does not occur on its own. It is sent before a
            /// zwp_tablet_pad_ring_v2.frame event and carries the source information
            /// for all events within that frame.
            ///
            /// The source specifies how this event was generated. If the source is
            /// zwp_tablet_pad_ring_v2.source.finger, a zwp_tablet_pad_ring_v2.stop event
            /// will be sent when the user lifts the finger off the device.
            ///
            /// This event is optional. If the source is unknown for an interaction,
            /// no event is sent.
            pub fn sendSource(_tablet_pad_ring_v2: *TabletPadRingV2, _source: Source) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_ring_v2);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Source)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_source))),
                        .@"struct" => @bitCast(_source),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const source_since_version = 1;

            /// Sent whenever the angle on a ring changes.
            ///
            /// The angle is provided in degrees clockwise from the logical
            /// north of the ring in the pad's current rotation.
            pub fn sendAngle(_tablet_pad_ring_v2: *TabletPadRingV2, _degrees: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_ring_v2);
                var _args = [_]common.Argument{
                    .{ .f = _degrees },
                };
                _resource.postEvent(1, &_args);
            }
            pub const angle_since_version = 1;

            /// Stop notification for ring events.
            ///
            /// For some zwp_tablet_pad_ring_v2.source types, a zwp_tablet_pad_ring_v2.stop
            /// event is sent to notify a client that the interaction with the ring
            /// has terminated. This enables the client to implement kinetic scrolling.
            /// See the zwp_tablet_pad_ring_v2.source documentation for information on
            /// when this event may be generated.
            ///
            /// Any zwp_tablet_pad_ring_v2.angle events with the same source after this
            /// event should be considered as the start of a new interaction.
            pub fn sendStop(_tablet_pad_ring_v2: *TabletPadRingV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_ring_v2);
                _resource.postEvent(2, null);
            }
            pub const stop_since_version = 1;

            /// Indicates the end of a set of ring events that logically belong
            /// together. A client is expected to accumulate the data in all events
            /// within the frame before proceeding.
            ///
            /// All zwp_tablet_pad_ring_v2 events before a zwp_tablet_pad_ring_v2.frame event belong
            /// logically together. For example, on termination of a finger interaction
            /// on a ring the compositor will send a zwp_tablet_pad_ring_v2.source event,
            /// a zwp_tablet_pad_ring_v2.stop event and a zwp_tablet_pad_ring_v2.frame event.
            ///
            /// A zwp_tablet_pad_ring_v2.frame event is sent for every logical event
            /// group, even if the group only contains a single zwp_tablet_pad_ring_v2
            /// event. Specifically, a client may get a sequence: angle, frame,
            /// angle, frame, etc.
            pub fn sendFrame(_tablet_pad_ring_v2: *TabletPadRingV2, _time: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_ring_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                };
                _resource.postEvent(3, &_args);
            }
            pub const frame_since_version = 1;
        };

        /// A linear interaction area, such as the strips found in Wacom Cintiq
        /// models.
        ///
        /// Events on a strip are logically grouped by the zwp_tablet_pad_strip_v2.frame
        /// event.
        pub const TabletPadStripV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_strip_v2.interface;
            pub const Source = common.zwp.tablet_pad_strip_v2.Source;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletPadStripV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletPadStripV2, _version, _id));
            }
            pub inline fn destroy(_tablet_pad_strip_v2: *TabletPadStripV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletPadStripV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_pad_strip_v2: *TabletPadStripV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).getLink();
            }
            pub inline fn getClient(_tablet_pad_strip_v2: *TabletPadStripV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).getClient();
            }
            pub inline fn getId(_tablet_pad_strip_v2: *TabletPadStripV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_strip_v2: *TabletPadStripV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_pad_strip_v2: *TabletPadStripV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_pad_strip_v2: *TabletPadStripV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_strip_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const set_feedback_since_version = 1;
                pub const destroy_since_version = 1;

                /// Requests the compositor to use the provided feedback string
                /// associated with this strip. This request should be issued immediately
                /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
                /// group is received, or whenever the strip is mapped to a different
                /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
                ///
                /// Clients are encouraged to provide context-aware descriptions for
                /// the actions associated with the strip, and compositors may use this
                /// information to offer visual feedback about the button layout
                /// (eg. on-screen displays).
                ///
                /// The provided string 'description' is a UTF-8 encoded string to be
                /// associated with this ring, and is considered user-visible; general
                /// internationalization rules apply.
                ///
                /// The serial argument will be that of the last
                /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
                /// strip. Requests providing other serials than the most recent one will be
                /// ignored.
                set_feedback: struct {
                    description: [*:0]const u8,
                    serial: u32,
                },

                /// This destroys the client's resource for this strip object.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_pad_strip_v2: *TabletPadStripV2,
                comptime T: type,
                handle_request: *const fn (_tablet_pad_strip_v2: *TabletPadStripV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_pad_strip_v2: *TabletPadStripV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_strip_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletPadStripV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletPadStripV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Source information for strip events.
            ///
            /// This event does not occur on its own. It is sent before a
            /// zwp_tablet_pad_strip_v2.frame event and carries the source information
            /// for all events within that frame.
            ///
            /// The source specifies how this event was generated. If the source is
            /// zwp_tablet_pad_strip_v2.source.finger, a zwp_tablet_pad_strip_v2.stop event
            /// will be sent when the user lifts their finger off the device.
            ///
            /// This event is optional. If the source is unknown for an interaction,
            /// no event is sent.
            pub fn sendSource(_tablet_pad_strip_v2: *TabletPadStripV2, _source: Source) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_strip_v2);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Source)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_source))),
                        .@"struct" => @bitCast(_source),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const source_since_version = 1;

            /// Sent whenever the position on a strip changes.
            ///
            /// The position is normalized to a range of [0, 65535], the 0-value
            /// represents the top-most and/or left-most position of the strip in
            /// the pad's current rotation.
            pub fn sendPosition(_tablet_pad_strip_v2: *TabletPadStripV2, _position: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_strip_v2);
                var _args = [_]common.Argument{
                    .{ .u = _position },
                };
                _resource.postEvent(1, &_args);
            }
            pub const position_since_version = 1;

            /// Stop notification for strip events.
            ///
            /// For some zwp_tablet_pad_strip_v2.source types, a zwp_tablet_pad_strip_v2.stop
            /// event is sent to notify a client that the interaction with the strip
            /// has terminated. This enables the client to implement kinetic
            /// scrolling. See the zwp_tablet_pad_strip_v2.source documentation for
            /// information on when this event may be generated.
            ///
            /// Any zwp_tablet_pad_strip_v2.position events with the same source after this
            /// event should be considered as the start of a new interaction.
            pub fn sendStop(_tablet_pad_strip_v2: *TabletPadStripV2) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_strip_v2);
                _resource.postEvent(2, null);
            }
            pub const stop_since_version = 1;

            /// Indicates the end of a set of events that represent one logical
            /// hardware strip event. A client is expected to accumulate the data
            /// in all events within the frame before proceeding.
            ///
            /// All zwp_tablet_pad_strip_v2 events before a zwp_tablet_pad_strip_v2.frame event belong
            /// logically together. For example, on termination of a finger interaction
            /// on a strip the compositor will send a zwp_tablet_pad_strip_v2.source event,
            /// a zwp_tablet_pad_strip_v2.stop event and a zwp_tablet_pad_strip_v2.frame
            /// event.
            ///
            /// A zwp_tablet_pad_strip_v2.frame event is sent for every logical event
            /// group, even if the group only contains a single zwp_tablet_pad_strip_v2
            /// event. Specifically, a client may get a sequence: position, frame,
            /// position, frame, etc.
            pub fn sendFrame(_tablet_pad_strip_v2: *TabletPadStripV2, _time: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_strip_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                };
                _resource.postEvent(3, &_args);
            }
            pub const frame_since_version = 1;
        };

        /// A rotary control, e.g. a dial or a wheel.
        ///
        /// Events on a dial are logically grouped by the zwp_tablet_pad_dial_v2.frame
        /// event.
        pub const TabletPadDialV2 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.tablet_pad_dial_v2.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TabletPadDialV2 {
                return @ptrCast(try server.wl.Resource.create(_client, TabletPadDialV2, _version, _id));
            }
            pub inline fn destroy(_tablet_pad_dial_v2: *TabletPadDialV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TabletPadDialV2 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tablet_pad_dial_v2: *TabletPadDialV2) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).getLink();
            }
            pub inline fn getClient(_tablet_pad_dial_v2: *TabletPadDialV2) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).getClient();
            }
            pub inline fn getId(_tablet_pad_dial_v2: *TabletPadDialV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).getId();
            }
            pub inline fn getVersion(_tablet_pad_dial_v2: *TabletPadDialV2) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).getVersion();
            }
            pub inline fn postNoMemory(_tablet_pad_dial_v2: *TabletPadDialV2) void {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).postNoMemory();
            }
            pub inline fn getUserData(_tablet_pad_dial_v2: *TabletPadDialV2) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tablet_pad_dial_v2)).getUserData();
            }
            pub const Request = union(enum) {
                pub const set_feedback_since_version = 1;
                pub const destroy_since_version = 1;

                /// Requests the compositor to use the provided feedback string
                /// associated with this dial. This request should be issued immediately
                /// after a zwp_tablet_pad_group_v2.mode_switch event from the corresponding
                /// group is received, or whenever the dial is mapped to a different
                /// action. See zwp_tablet_pad_group_v2.mode_switch for more details.
                ///
                /// Clients are encouraged to provide context-aware descriptions for
                /// the actions associated with the dial, and compositors may use this
                /// information to offer visual feedback about the button layout
                /// (eg. on-screen displays).
                ///
                /// The provided string 'description' is a UTF-8 encoded string to be
                /// associated with this ring, and is considered user-visible; general
                /// internationalization rules apply.
                ///
                /// The serial argument will be that of the last
                /// zwp_tablet_pad_group_v2.mode_switch event received for the group of this
                /// dial. Requests providing other serials than the most recent one will be
                /// ignored.
                set_feedback: struct {
                    description: [*:0]const u8,
                    serial: u32,
                },

                /// This destroys the client's resource for this dial object.
                destroy: void,
            };
            pub inline fn setHandler(
                _tablet_pad_dial_v2: *TabletPadDialV2,
                comptime T: type,
                handle_request: *const fn (_tablet_pad_dial_v2: *TabletPadDialV2, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tablet_pad_dial_v2: *TabletPadDialV2, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_dial_v2);
                _resource.setDispatcher(
                    common.Dispatcher(TabletPadDialV2, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TabletPadDialV2, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Sent whenever the position on a dial changes.
            ///
            /// This event carries the wheel delta as multiples or fractions
            /// of 120 with each multiple of 120 representing one logical wheel detent.
            /// For example, an axis_value120 of 30 is one quarter of
            /// a logical wheel step in the positive direction, a value120 of
            /// -240 are two logical wheel steps in the negative direction within the
            /// same hardware event. See the wl_pointer.axis_value120 for more details.
            ///
            /// The value120 must not be zero.
            pub fn sendDelta(_tablet_pad_dial_v2: *TabletPadDialV2, _value120: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_dial_v2);
                var _args = [_]common.Argument{
                    .{ .i = _value120 },
                };
                _resource.postEvent(0, &_args);
            }
            pub const delta_since_version = 1;

            /// Indicates the end of a set of events that represent one logical
            /// hardware dial event. A client is expected to accumulate the data
            /// in all events within the frame before proceeding.
            ///
            /// All zwp_tablet_pad_dial_v2 events before a zwp_tablet_pad_dial_v2.frame event belong
            /// logically together.
            ///
            /// A zwp_tablet_pad_dial_v2.frame event is sent for every logical event
            /// group, even if the group only contains a single zwp_tablet_pad_dial_v2
            /// event. Specifically, a client may get a sequence: delta, frame,
            /// delta, frame, etc.
            pub fn sendFrame(_tablet_pad_dial_v2: *TabletPadDialV2, _time: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_tablet_pad_dial_v2);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                };
                _resource.postEvent(1, &_args);
            }
            pub const frame_since_version = 1;
        };

        /// 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.
        pub const PointerConstraintsV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.pointer_constraints_v1.interface;
            pub const Error = common.zwp.pointer_constraints_v1.Error;
            pub const Lifetime = common.zwp.pointer_constraints_v1.Lifetime;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerConstraintsV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerConstraintsV1, _version, _id));
            }
            pub inline fn destroy(_pointer_constraints_v1: *PointerConstraintsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerConstraintsV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_constraints_v1: *PointerConstraintsV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).getLink();
            }
            pub inline fn getClient(_pointer_constraints_v1: *PointerConstraintsV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).getClient();
            }
            pub inline fn getId(_pointer_constraints_v1: *PointerConstraintsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).getId();
            }
            pub inline fn getVersion(_pointer_constraints_v1: *PointerConstraintsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_constraints_v1: *PointerConstraintsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_constraints_v1: *PointerConstraintsV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).getUserData();
            }
            pub inline fn postError(_pointer_constraints_v1: *PointerConstraintsV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_constraints_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const lock_pointer_since_version = 1;
                pub const confine_pointer_since_version = 1;

                /// Used by the client to notify the server that it will no longer use this
                /// pointer constraints object.
                destroy: void,
                /// 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.
                lock_pointer: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                    pointer: *server.wl.Pointer,
                    region: ?*server.wl.Region,
                    lifetime: Lifetime,
                },

                /// 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.
                confine_pointer: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                    pointer: *server.wl.Pointer,
                    region: ?*server.wl.Region,
                    lifetime: Lifetime,
                },
            };
            pub inline fn setHandler(
                _pointer_constraints_v1: *PointerConstraintsV1,
                comptime T: type,
                handle_request: *const fn (_pointer_constraints_v1: *PointerConstraintsV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_constraints_v1: *PointerConstraintsV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_constraints_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerConstraintsV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerConstraintsV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// 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.
        pub const LockedPointerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.locked_pointer_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LockedPointerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LockedPointerV1, _version, _id));
            }
            pub inline fn destroy(_locked_pointer_v1: *LockedPointerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LockedPointerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_locked_pointer_v1: *LockedPointerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).getLink();
            }
            pub inline fn getClient(_locked_pointer_v1: *LockedPointerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).getClient();
            }
            pub inline fn getId(_locked_pointer_v1: *LockedPointerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).getId();
            }
            pub inline fn getVersion(_locked_pointer_v1: *LockedPointerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).getVersion();
            }
            pub inline fn postNoMemory(_locked_pointer_v1: *LockedPointerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).postNoMemory();
            }
            pub inline fn getUserData(_locked_pointer_v1: *LockedPointerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_locked_pointer_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_cursor_position_hint_since_version = 1;
                pub const set_region_since_version = 1;

                /// Destroy the locked pointer object. If applicable, the compositor will
                /// unlock the pointer.
                destroy: void,
                /// 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 state, see
                /// wl_surface.commit.
                set_cursor_position_hint: struct {
                    surface_x: common.Fixed,
                    surface_y: common.Fixed,
                },

                /// Set a new region used to lock the pointer.
                ///
                /// The new lock region is double-buffered, see wl_surface.commit.
                ///
                /// For details about the lock region, see wp_locked_pointer.
                set_region: struct {
                    region: ?*server.wl.Region,
                },
            };
            pub inline fn setHandler(
                _locked_pointer_v1: *LockedPointerV1,
                comptime T: type,
                handle_request: *const fn (_locked_pointer_v1: *LockedPointerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_locked_pointer_v1: *LockedPointerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_locked_pointer_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LockedPointerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LockedPointerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Notification that the pointer lock of the seat's pointer is activated.
            pub fn sendLocked(_locked_pointer_v1: *LockedPointerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_locked_pointer_v1);
                _resource.postEvent(0, null);
            }
            pub const locked_since_version = 1;

            /// Notification that the pointer lock of the seat's pointer is no longer
            /// active. If this is a oneshot pointer lock (see
            /// wp_pointer_constraints.lifetime) this object is now defunct and should
            /// be destroyed. If this is a persistent pointer lock (see
            /// wp_pointer_constraints.lifetime) this pointer lock may again
            /// reactivate in the future.
            pub fn sendUnlocked(_locked_pointer_v1: *LockedPointerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_locked_pointer_v1);
                _resource.postEvent(1, null);
            }
            pub const unlocked_since_version = 1;
        };

        /// 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.
        pub const ConfinedPointerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.confined_pointer_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ConfinedPointerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ConfinedPointerV1, _version, _id));
            }
            pub inline fn destroy(_confined_pointer_v1: *ConfinedPointerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ConfinedPointerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_confined_pointer_v1: *ConfinedPointerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).getLink();
            }
            pub inline fn getClient(_confined_pointer_v1: *ConfinedPointerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).getClient();
            }
            pub inline fn getId(_confined_pointer_v1: *ConfinedPointerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).getId();
            }
            pub inline fn getVersion(_confined_pointer_v1: *ConfinedPointerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).getVersion();
            }
            pub inline fn postNoMemory(_confined_pointer_v1: *ConfinedPointerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).postNoMemory();
            }
            pub inline fn getUserData(_confined_pointer_v1: *ConfinedPointerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_confined_pointer_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_region_since_version = 1;

                /// Destroy the confined pointer object. If applicable, the compositor will
                /// unconfine the pointer.
                destroy: void,
                /// Set a new region used to confine the pointer.
                ///
                /// The new confine region is double-buffered, see wl_surface.commit.
                ///
                /// 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.
                set_region: struct {
                    region: ?*server.wl.Region,
                },
            };
            pub inline fn setHandler(
                _confined_pointer_v1: *ConfinedPointerV1,
                comptime T: type,
                handle_request: *const fn (_confined_pointer_v1: *ConfinedPointerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_confined_pointer_v1: *ConfinedPointerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_confined_pointer_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ConfinedPointerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ConfinedPointerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Notification that the pointer confinement of the seat's pointer is
            /// activated.
            pub fn sendConfined(_confined_pointer_v1: *ConfinedPointerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_confined_pointer_v1);
                _resource.postEvent(0, null);
            }
            pub const confined_since_version = 1;

            /// Notification that the pointer confinement of the seat's pointer is no
            /// longer active. If this is a oneshot pointer confinement (see
            /// wp_pointer_constraints.lifetime) this object is now defunct and should
            /// be destroyed. If this is a persistent pointer confinement (see
            /// wp_pointer_constraints.lifetime) this pointer confinement may again
            /// reactivate in the future.
            pub fn sendUnconfined(_confined_pointer_v1: *ConfinedPointerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_confined_pointer_v1);
                _resource.postEvent(1, null);
            }
            pub const unconfined_since_version = 1;
        };

        /// A global interface to provide semantic touchpad gestures for a given
        /// pointer.
        ///
        /// Three gestures are currently supported: swipe, pinch, and hold.
        /// Pinch and swipe gestures follow a three-stage cycle: begin, update,
        /// end. Hold gestures follow a two-stage cycle: begin and end. All
        /// gestures are identified by a unique id.
        ///
        /// 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.
        pub const PointerGesturesV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gestures_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerGesturesV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerGesturesV1, _version, _id));
            }
            pub inline fn destroy(_pointer_gestures_v1: *PointerGesturesV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerGesturesV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_gestures_v1: *PointerGesturesV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).getLink();
            }
            pub inline fn getClient(_pointer_gestures_v1: *PointerGesturesV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).getClient();
            }
            pub inline fn getId(_pointer_gestures_v1: *PointerGesturesV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gestures_v1: *PointerGesturesV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_gestures_v1: *PointerGesturesV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_gestures_v1: *PointerGesturesV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gestures_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const get_swipe_gesture_since_version = 1;
                pub const get_pinch_gesture_since_version = 1;
                pub const release_since_version = 2;
                pub const get_hold_gesture_since_version = 3;

                /// Create a swipe gesture object. See the
                /// wl_pointer_gesture_swipe interface for details.
                get_swipe_gesture: struct {
                    id: u32,
                    pointer: *server.wl.Pointer,
                },

                /// Create a pinch gesture object. See the
                /// wl_pointer_gesture_pinch interface for details.
                get_pinch_gesture: struct {
                    id: u32,
                    pointer: *server.wl.Pointer,
                },

                /// Destroy the pointer gesture object. Swipe, pinch and hold objects
                /// created via this gesture object remain valid.
                release: void,
                /// Create a hold gesture object. See the
                /// wl_pointer_gesture_hold interface for details.
                get_hold_gesture: struct {
                    id: u32,
                    pointer: *server.wl.Pointer,
                },
            };
            pub inline fn setHandler(
                _pointer_gestures_v1: *PointerGesturesV1,
                comptime T: type,
                handle_request: *const fn (_pointer_gestures_v1: *PointerGesturesV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_gestures_v1: *PointerGesturesV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gestures_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerGesturesV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerGesturesV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// A swipe gesture object notifies a client about a multi-finger swipe
        /// gesture detected on an indirect input device such as a touchpad.
        /// The gesture is usually initiated by multiple fingers moving in the
        /// same direction but once initiated the direction may change.
        /// The precise conditions of when such a gesture is detected are
        /// implementation-dependent.
        ///
        /// A gesture consists of three stages: begin, update (optional) and end.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGestureSwipeV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_swipe_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerGestureSwipeV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerGestureSwipeV1, _version, _id));
            }
            pub inline fn destroy(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerGestureSwipeV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).getLink();
            }
            pub inline fn getClient(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).getClient();
            }
            pub inline fn getId(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_swipe_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                destroy: void,
            };
            pub inline fn setHandler(
                _pointer_gesture_swipe_v1: *PointerGestureSwipeV1,
                comptime T: type,
                handle_request: *const fn (_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_swipe_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerGestureSwipeV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerGestureSwipeV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent when a multi-finger swipe gesture is detected
            /// on the device.
            pub fn sendBegin(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, _serial: u32, _time: u32, _surface: *server.wl.Surface, _fingers: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_swipe_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .o = @ptrCast(_surface) },
                    .{ .u = _fingers },
                };
                _resource.postEvent(0, &_args);
            }
            pub const begin_since_version = 1;

            /// This event is sent when a multi-finger swipe gesture changes the
            /// position of the logical center.
            ///
            /// The dx and dy coordinates are relative coordinates of the logical
            /// center of the gesture compared to the previous event.
            pub fn sendUpdate(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, _time: u32, _dx: common.Fixed, _dy: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_swipe_v1);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .f = _dx },
                    .{ .f = _dy },
                };
                _resource.postEvent(1, &_args);
            }
            pub const update_since_version = 1;

            /// This event is sent when a multi-finger swipe gesture ceases to
            /// be valid. This may happen when one or more fingers are lifted or
            /// the gesture is cancelled.
            ///
            /// When a gesture is cancelled, the client should undo state changes
            /// caused by this gesture. What causes a gesture to be cancelled is
            /// implementation-dependent.
            pub fn sendEnd(_pointer_gesture_swipe_v1: *PointerGestureSwipeV1, _serial: u32, _time: u32, _cancelled: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_swipe_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .i = _cancelled },
                };
                _resource.postEvent(2, &_args);
            }
            pub const end_since_version = 1;
        };

        /// A pinch gesture object notifies a client about a multi-finger pinch
        /// gesture detected on an indirect input device such as a touchpad.
        /// The gesture is usually initiated by multiple fingers moving towards
        /// each other or away from each other, or by two or more fingers rotating
        /// around a logical center of gravity. The precise conditions of when
        /// such a gesture is detected are implementation-dependent.
        ///
        /// A gesture consists of three stages: begin, update (optional) and end.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGesturePinchV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_pinch_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerGesturePinchV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerGesturePinchV1, _version, _id));
            }
            pub inline fn destroy(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerGesturePinchV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).getLink();
            }
            pub inline fn getClient(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).getClient();
            }
            pub inline fn getId(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_gesture_pinch_v1: *PointerGesturePinchV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_pinch_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                destroy: void,
            };
            pub inline fn setHandler(
                _pointer_gesture_pinch_v1: *PointerGesturePinchV1,
                comptime T: type,
                handle_request: *const fn (_pointer_gesture_pinch_v1: *PointerGesturePinchV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_gesture_pinch_v1: *PointerGesturePinchV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_pinch_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerGesturePinchV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerGesturePinchV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent when a multi-finger pinch gesture is detected
            /// on the device.
            pub fn sendBegin(_pointer_gesture_pinch_v1: *PointerGesturePinchV1, _serial: u32, _time: u32, _surface: *server.wl.Surface, _fingers: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_pinch_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .o = @ptrCast(_surface) },
                    .{ .u = _fingers },
                };
                _resource.postEvent(0, &_args);
            }
            pub const begin_since_version = 1;

            /// This event is sent when a multi-finger pinch gesture changes the
            /// position of the logical center, the rotation or the relative scale.
            ///
            /// The dx and dy coordinates are relative coordinates in the
            /// surface coordinate space of the logical center of the gesture.
            ///
            /// The scale factor is an absolute scale compared to the
            /// pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
            /// are now twice as far apart as on pointer_gesture_pinch.begin.
            ///
            /// The rotation is the relative angle in degrees clockwise compared to the previous
            /// pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
            pub fn sendUpdate(_pointer_gesture_pinch_v1: *PointerGesturePinchV1, _time: u32, _dx: common.Fixed, _dy: common.Fixed, _scale: common.Fixed, _rotation: common.Fixed) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_pinch_v1);
                var _args = [_]common.Argument{
                    .{ .u = _time },
                    .{ .f = _dx },
                    .{ .f = _dy },
                    .{ .f = _scale },
                    .{ .f = _rotation },
                };
                _resource.postEvent(1, &_args);
            }
            pub const update_since_version = 1;

            /// This event is sent when a multi-finger pinch gesture ceases to
            /// be valid. This may happen when one or more fingers are lifted or
            /// the gesture is cancelled.
            ///
            /// When a gesture is cancelled, the client should undo state changes
            /// caused by this gesture. What causes a gesture to be cancelled is
            /// implementation-dependent.
            pub fn sendEnd(_pointer_gesture_pinch_v1: *PointerGesturePinchV1, _serial: u32, _time: u32, _cancelled: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_pinch_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .i = _cancelled },
                };
                _resource.postEvent(2, &_args);
            }
            pub const end_since_version = 1;
        };

        /// A hold gesture object notifies a client about a single- or
        /// multi-finger hold gesture detected on an indirect input device such as
        /// a touchpad. The gesture is usually initiated by one or more fingers
        /// being held down without significant movement. The precise conditions
        /// of when such a gesture is detected are implementation-dependent.
        ///
        /// In particular, this gesture may be used to cancel kinetic scrolling.
        ///
        /// A hold gesture consists of two stages: begin and end. Unlike pinch and
        /// swipe there is no update stage.
        /// There cannot be multiple simultaneous hold, pinch or swipe gestures on a
        /// same pointer/seat, how compositors prevent these situations is
        /// implementation-dependent.
        ///
        /// A gesture may be cancelled by the compositor or the hardware.
        /// Clients should not consider performing permanent or irreversible
        /// actions until the end of a gesture has been received.
        pub const PointerGestureHoldV1 = opaque {
            pub const generated_version = 3;
            pub const interface = &common.zwp.pointer_gesture_hold_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerGestureHoldV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerGestureHoldV1, _version, _id));
            }
            pub inline fn destroy(_pointer_gesture_hold_v1: *PointerGestureHoldV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerGestureHoldV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_gesture_hold_v1: *PointerGestureHoldV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).getLink();
            }
            pub inline fn getClient(_pointer_gesture_hold_v1: *PointerGestureHoldV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).getClient();
            }
            pub inline fn getId(_pointer_gesture_hold_v1: *PointerGestureHoldV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).getId();
            }
            pub inline fn getVersion(_pointer_gesture_hold_v1: *PointerGestureHoldV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_gesture_hold_v1: *PointerGestureHoldV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_gesture_hold_v1: *PointerGestureHoldV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_gesture_hold_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 3;
                destroy: void,
            };
            pub inline fn setHandler(
                _pointer_gesture_hold_v1: *PointerGestureHoldV1,
                comptime T: type,
                handle_request: *const fn (_pointer_gesture_hold_v1: *PointerGestureHoldV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_gesture_hold_v1: *PointerGestureHoldV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_hold_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerGestureHoldV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerGestureHoldV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent when a hold gesture is detected on the device.
            pub fn sendBegin(_pointer_gesture_hold_v1: *PointerGestureHoldV1, _serial: u32, _time: u32, _surface: *server.wl.Surface, _fingers: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_hold_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .o = @ptrCast(_surface) },
                    .{ .u = _fingers },
                };
                _resource.postEvent(0, &_args);
            }
            pub const begin_since_version = 3;

            /// This event is sent when a hold gesture ceases to
            /// be valid. This may happen when the holding fingers are lifted or
            /// the gesture is cancelled, for example if the fingers move past an
            /// implementation-defined threshold, the finger count changes or the hold
            /// gesture changes into a different type of gesture.
            ///
            /// When a gesture is cancelled, the client may need to undo state changes
            /// caused by this gesture. What causes a gesture to be cancelled is
            /// implementation-dependent.
            pub fn sendEnd(_pointer_gesture_hold_v1: *PointerGestureHoldV1, _serial: u32, _time: u32, _cancelled: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_gesture_hold_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _time },
                    .{ .i = _cancelled },
                };
                _resource.postEvent(1, &_args);
            }
            pub const end_since_version = 3;
        };

        /// A virtual keyboard manager allows an application to provide keyboard
        /// input events as if they came from a physical keyboard.
        pub const VirtualKeyboardManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.virtual_keyboard_manager_v1.interface;
            pub const Error = common.zwp.virtual_keyboard_manager_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*VirtualKeyboardManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, VirtualKeyboardManagerV1, _version, _id));
            }
            pub inline fn destroy(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *VirtualKeyboardManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).getLink();
            }
            pub inline fn getClient(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).getClient();
            }
            pub inline fn getId(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).getId();
            }
            pub inline fn getVersion(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).getUserData();
            }
            pub inline fn postError(_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const create_virtual_keyboard_since_version = 1;

                /// Creates a new virtual keyboard associated to a seat.
                ///
                /// If the compositor enables a keyboard to perform arbitrary actions, it
                /// should present an error when an untrusted client requests a new
                /// keyboard.
                create_virtual_keyboard: struct {
                    seat: *server.wl.Seat,
                    id: u32,
                },
            };
            pub inline fn setHandler(
                _virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1,
                comptime T: type,
                handle_request: *const fn (_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_virtual_keyboard_manager_v1: *VirtualKeyboardManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_virtual_keyboard_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(VirtualKeyboardManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*VirtualKeyboardManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The virtual keyboard provides an application with requests which emulate
        /// the behaviour of a physical keyboard.
        ///
        /// This interface can be used by clients on its own to provide raw input
        /// events, or it can accompany the input method protocol.
        pub const VirtualKeyboardV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwp.virtual_keyboard_v1.interface;
            pub const Error = common.zwp.virtual_keyboard_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*VirtualKeyboardV1 {
                return @ptrCast(try server.wl.Resource.create(_client, VirtualKeyboardV1, _version, _id));
            }
            pub inline fn destroy(_virtual_keyboard_v1: *VirtualKeyboardV1) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *VirtualKeyboardV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_virtual_keyboard_v1: *VirtualKeyboardV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).getLink();
            }
            pub inline fn getClient(_virtual_keyboard_v1: *VirtualKeyboardV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).getClient();
            }
            pub inline fn getId(_virtual_keyboard_v1: *VirtualKeyboardV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).getId();
            }
            pub inline fn getVersion(_virtual_keyboard_v1: *VirtualKeyboardV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).getVersion();
            }
            pub inline fn postNoMemory(_virtual_keyboard_v1: *VirtualKeyboardV1) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).postNoMemory();
            }
            pub inline fn getUserData(_virtual_keyboard_v1: *VirtualKeyboardV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).getUserData();
            }
            pub inline fn postError(_virtual_keyboard_v1: *VirtualKeyboardV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_virtual_keyboard_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const keymap_since_version = 1;
                pub const key_since_version = 1;
                pub const modifiers_since_version = 1;
                pub const destroy_since_version = 1;

                /// Provide a file descriptor to the compositor which can be
                /// memory-mapped to provide a keyboard mapping description.
                ///
                /// Format carries a value from the keymap_format enumeration.
                keymap: struct {
                    format: u32,
                    fd: i32,
                    size: u32,
                },

                /// A key was pressed or released.
                /// The time argument is a timestamp with millisecond granularity, with an
                /// undefined base. All requests regarding a single object must share the
                /// same clock.
                ///
                /// Keymap must be set before issuing this request.
                ///
                /// State carries a value from the key_state enumeration.
                key: struct {
                    time: u32,
                    key: u32,
                    state: u32,
                },

                /// Notifies the compositor that the modifier and/or group state has
                /// changed, and it should update state.
                ///
                /// The client should use wl_keyboard.modifiers event to synchronize its
                /// internal state with seat state.
                ///
                /// Keymap must be set before issuing this request.
                modifiers: struct {
                    mods_depressed: u32,
                    mods_latched: u32,
                    mods_locked: u32,
                    group: u32,
                },
                destroy: void,
            };
            pub inline fn setHandler(
                _virtual_keyboard_v1: *VirtualKeyboardV1,
                comptime T: type,
                handle_request: *const fn (_virtual_keyboard_v1: *VirtualKeyboardV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_virtual_keyboard_v1: *VirtualKeyboardV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_virtual_keyboard_v1);
                _resource.setDispatcher(
                    common.Dispatcher(VirtualKeyboardV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*VirtualKeyboardV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };
    };
    pub const xdg = struct {
        /// The xdg_wm_base interface is exposed as a global object enabling clients
        /// to turn their wl_surfaces into windows in a desktop environment. It
        /// defines the basic functionality needed for clients and the compositor to
        /// create windows that can be dragged, resized, maximized, etc, as well as
        /// creating transient windows such as popup menus.
        pub const WmBase = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.wm_base.interface;
            pub const Error = common.xdg.wm_base.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*WmBase {
                return @ptrCast(try server.wl.Resource.create(_client, WmBase, _version, _id));
            }
            pub inline fn destroy(_wm_base: *WmBase) void {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *WmBase {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_wm_base: *WmBase) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).getLink();
            }
            pub inline fn getClient(_wm_base: *WmBase) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).getClient();
            }
            pub inline fn getId(_wm_base: *WmBase) u32 {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).getId();
            }
            pub inline fn getVersion(_wm_base: *WmBase) u32 {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).getVersion();
            }
            pub inline fn postNoMemory(_wm_base: *WmBase) void {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).postNoMemory();
            }
            pub inline fn getUserData(_wm_base: *WmBase) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).getUserData();
            }
            pub inline fn postError(_wm_base: *WmBase, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_wm_base)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const create_positioner_since_version = 1;
                pub const get_xdg_surface_since_version = 1;
                pub const pong_since_version = 1;

                /// Destroy this xdg_wm_base object.
                ///
                /// Destroying a bound xdg_wm_base object while there are surfaces
                /// still alive created by this xdg_wm_base object instance is illegal
                /// and will result in a defunct_surfaces error.
                destroy: void,
                /// Create a positioner object. A positioner object is used to position
                /// surfaces relative to some parent surface. See the interface description
                /// and xdg_surface.get_popup for details.
                create_positioner: struct {
                    id: u32,
                },

                /// This creates an xdg_surface for the given surface. While xdg_surface
                /// itself is not a role, the corresponding surface may only be assigned
                /// a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is
                /// illegal to create an xdg_surface for a wl_surface which already has an
                /// assigned role and this will result in a role error.
                ///
                /// This creates an xdg_surface for the given surface. An xdg_surface is
                /// used as basis to define a role to a given surface, such as xdg_toplevel
                /// or xdg_popup. It also manages functionality shared between xdg_surface
                /// based surface roles.
                ///
                /// See the documentation of xdg_surface for more details about what an
                /// xdg_surface is and how it is used.
                get_xdg_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// A client must respond to a ping event with a pong request or
                /// the client may be deemed unresponsive. See xdg_wm_base.ping
                /// and xdg_wm_base.error.unresponsive.
                pong: struct {
                    serial: u32,
                },
            };
            pub inline fn setHandler(
                _wm_base: *WmBase,
                comptime T: type,
                handle_request: *const fn (_wm_base: *WmBase, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_wm_base: *WmBase, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_wm_base);
                _resource.setDispatcher(
                    common.Dispatcher(WmBase, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*WmBase, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The ping event asks the client if it's still alive. Pass the
            /// serial specified in the event back to the compositor by sending
            /// a "pong" request back with the specified serial. See xdg_wm_base.pong.
            ///
            /// Compositors can use this to determine if the client is still
            /// alive. It's unspecified what will happen if the client doesn't
            /// respond to the ping request, or in what timeframe. Clients should
            /// try to respond in a reasonable amount of time. The “unresponsive”
            /// error is provided for compositors that wish to disconnect unresponsive
            /// clients.
            ///
            /// A compositor is free to ping in any way it wants, but a client must
            /// always respond to any xdg_wm_base object it created.
            pub fn sendPing(_wm_base: *WmBase, _serial: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_wm_base);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _resource.postEvent(0, &_args);
            }
            pub const ping_since_version = 1;
        };

        /// The xdg_positioner provides a collection of rules for the placement of a
        /// child surface relative to a parent surface. Rules can be defined to ensure
        /// the child surface remains within the visible area's borders, and to
        /// specify how the child surface changes its position, such as sliding along
        /// an axis, or flipping around a rectangle. These positioner-created rules are
        /// constrained by the requirement that a child surface must intersect with or
        /// be at least partially adjacent to its parent surface.
        ///
        /// See the various requests for details about possible rules.
        ///
        /// At the time of the request, the compositor makes a copy of the rules
        /// specified by the xdg_positioner. Thus, after the request is complete the
        /// xdg_positioner object can be destroyed or reused; further changes to the
        /// object will have no effect on previous usages.
        ///
        /// For an xdg_positioner object to be considered complete, it must have a
        /// non-zero size set by set_size, and a non-zero anchor rectangle set by
        /// set_anchor_rect. Passing an incomplete xdg_positioner object when
        /// positioning a surface raises an invalid_positioner error.
        pub const Positioner = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.positioner.interface;
            pub const Error = common.xdg.positioner.Error;
            pub const Anchor = common.xdg.positioner.Anchor;
            pub const Gravity = common.xdg.positioner.Gravity;
            pub const ConstraintAdjustment = common.xdg.positioner.ConstraintAdjustment;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Positioner {
                return @ptrCast(try server.wl.Resource.create(_client, Positioner, _version, _id));
            }
            pub inline fn destroy(_positioner: *Positioner) void {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Positioner {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_positioner: *Positioner) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).getLink();
            }
            pub inline fn getClient(_positioner: *Positioner) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).getClient();
            }
            pub inline fn getId(_positioner: *Positioner) u32 {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).getId();
            }
            pub inline fn getVersion(_positioner: *Positioner) u32 {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).getVersion();
            }
            pub inline fn postNoMemory(_positioner: *Positioner) void {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).postNoMemory();
            }
            pub inline fn getUserData(_positioner: *Positioner) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).getUserData();
            }
            pub inline fn postError(_positioner: *Positioner, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_positioner)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_size_since_version = 1;
                pub const set_anchor_rect_since_version = 1;
                pub const set_anchor_since_version = 1;
                pub const set_gravity_since_version = 1;
                pub const set_constraint_adjustment_since_version = 1;
                pub const set_offset_since_version = 1;

                /// Notify the compositor that the xdg_positioner will no longer be used.
                destroy: void,
                /// Set the size of the surface that is to be positioned with the positioner
                /// object. The size is in surface-local coordinates and corresponds to the
                /// window geometry. See xdg_surface.set_window_geometry.
                ///
                /// If a zero or negative size is set the invalid_input error is raised.
                set_size: struct {
                    width: i32,
                    height: i32,
                },

                /// Specify the anchor rectangle within the parent surface that the child
                /// surface will be placed relative to. The rectangle is relative to the
                /// window geometry as defined by xdg_surface.set_window_geometry of the
                /// parent surface.
                ///
                /// When the xdg_positioner object is used to position a child surface, the
                /// anchor rectangle may not extend outside the window geometry of the
                /// positioned child's parent surface.
                ///
                /// If a negative size is set the invalid_input error is raised.
                set_anchor_rect: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// Defines the anchor point for the anchor rectangle. The specified anchor
                /// is used derive an anchor point that the child surface will be
                /// positioned relative to. If a corner anchor is set (e.g. 'top_left' or
                /// 'bottom_right'), the anchor point will be at the specified corner;
                /// otherwise, the derived anchor point will be centered on the specified
                /// edge, or in the center of the anchor rectangle if no edge is specified.
                set_anchor: struct {
                    anchor: Anchor,
                },

                /// Defines in what direction a surface should be positioned, relative to
                /// the anchor point of the parent surface. If a corner gravity is
                /// specified (e.g. 'bottom_right' or 'top_left'), then the child surface
                /// will be placed towards the specified gravity; otherwise, the child
                /// surface will be centered over the anchor point on any axis that had no
                /// gravity specified. If the gravity is not in the ‘gravity’ enum, an
                /// invalid_input error is raised.
                set_gravity: struct {
                    gravity: Gravity,
                },

                /// Specify how the window should be positioned if the originally intended
                /// position caused the surface to be constrained, meaning at least
                /// partially outside positioning boundaries set by the compositor. The
                /// adjustment is set by constructing a bitmask describing the adjustment to
                /// be made when the surface is constrained on that axis.
                ///
                /// If no bit for one axis is set, the compositor will assume that the child
                /// surface should not change its position on that axis when constrained.
                ///
                /// If more than one bit for one axis is set, the order of how adjustments
                /// are applied is specified in the corresponding adjustment descriptions.
                ///
                /// The default adjustment is none.
                set_constraint_adjustment: struct {
                    constraint_adjustment: ConstraintAdjustment,
                },

                /// Specify the surface position offset relative to the position of the
                /// anchor on the anchor rectangle and the anchor on the surface. For
                /// example if the anchor of the anchor rectangle is at (x, y), the surface
                /// has the gravity bottom|right, and the offset is (ox, oy), the calculated
                /// surface position will be (x + ox, y + oy). The offset position of the
                /// surface is the one used for constraint testing. See
                /// set_constraint_adjustment.
                ///
                /// An example use case is placing a popup menu on top of a user interface
                /// element, while aligning the user interface element of the parent surface
                /// with some user interface element placed somewhere in the popup surface.
                set_offset: struct {
                    x: i32,
                    y: i32,
                },
            };
            pub inline fn setHandler(
                _positioner: *Positioner,
                comptime T: type,
                handle_request: *const fn (_positioner: *Positioner, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_positioner: *Positioner, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_positioner);
                _resource.setDispatcher(
                    common.Dispatcher(Positioner, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Positioner, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An interface that may be implemented by a wl_surface, for
        /// implementations that provide a desktop-style user interface.
        ///
        /// It provides a base set of functionality required to construct user
        /// interface elements requiring management by the compositor, such as
        /// toplevel windows, menus, etc. The types of functionality are split into
        /// xdg_surface roles.
        ///
        /// Creating an xdg_surface does not set the role for a wl_surface. In order
        /// to map an xdg_surface, the client must create a role-specific object
        /// using, e.g., get_toplevel, get_popup. The wl_surface for any given
        /// xdg_surface can have at most one role, and may not be assigned any role
        /// not based on xdg_surface.
        ///
        /// A role must be assigned before any other requests are made to the
        /// xdg_surface object.
        ///
        /// The client must call wl_surface.commit on the corresponding wl_surface
        /// for the xdg_surface state to take effect.
        ///
        /// Creating an xdg_surface from a wl_surface which has a buffer attached or
        /// committed is a client error, and any attempts by a client to attach or
        /// manipulate a buffer prior to the first xdg_surface.configure call must
        /// also be treated as errors.
        ///
        /// After creating a role-specific object and setting it up (e.g. by sending
        /// the title, app ID, size constraints, parent, etc), the client must
        /// perform an initial commit without any buffer attached. The compositor
        /// will reply with initial wl_surface state such as
        /// wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
        /// event. The client must acknowledge it and is then allowed to attach a
        /// buffer to map the surface.
        ///
        /// Mapping an xdg_surface-based role surface is defined as making it
        /// possible for the surface to be shown by the compositor. Note that
        /// a mapped surface is not guaranteed to be visible once it is mapped.
        ///
        /// For an xdg_surface to be mapped by the compositor, the following
        /// conditions must be met:
        /// (1) the client has assigned an xdg_surface-based role to the surface
        /// (2) the client has set and committed the xdg_surface state and the
        /// role-dependent state to the surface
        /// (3) the client has committed a buffer to the surface
        ///
        /// A newly-unmapped surface is considered to have met condition (1) out
        /// of the 3 required conditions for mapping a surface if its role surface
        /// has not been destroyed, i.e. the client must perform the initial commit
        /// again before attaching a buffer.
        pub const Surface = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.surface.interface;
            pub const Error = common.xdg.surface.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Surface {
                return @ptrCast(try server.wl.Resource.create(_client, Surface, _version, _id));
            }
            pub inline fn destroy(_surface: *Surface) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Surface {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_surface: *Surface) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getLink();
            }
            pub inline fn getClient(_surface: *Surface) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getClient();
            }
            pub inline fn getId(_surface: *Surface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getId();
            }
            pub inline fn getVersion(_surface: *Surface) u32 {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getVersion();
            }
            pub inline fn postNoMemory(_surface: *Surface) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).postNoMemory();
            }
            pub inline fn getUserData(_surface: *Surface) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_surface)).getUserData();
            }
            pub inline fn postError(_surface: *Surface, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_surface)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_toplevel_since_version = 1;
                pub const get_popup_since_version = 1;
                pub const set_window_geometry_since_version = 1;
                pub const ack_configure_since_version = 1;

                /// Destroy the xdg_surface object. An xdg_surface must only be destroyed
                /// after its role object has been destroyed, otherwise
                /// a defunct_role_object error is raised.
                destroy: void,
                /// This creates an xdg_toplevel object for the given xdg_surface and gives
                /// the associated wl_surface the xdg_toplevel role.
                ///
                /// See the documentation of xdg_toplevel for more details about what an
                /// xdg_toplevel is and how it is used.
                get_toplevel: struct {
                    id: u32,
                },

                /// This creates an xdg_popup object for the given xdg_surface and gives
                /// the associated wl_surface the xdg_popup role.
                ///
                /// If null is passed as a parent, a parent surface must be specified using
                /// some other protocol, before committing the initial state.
                ///
                /// See the documentation of xdg_popup for more details about what an
                /// xdg_popup is and how it is used.
                get_popup: struct {
                    id: u32,
                    parent: ?*server.xdg.Surface,
                    positioner: *server.xdg.Positioner,
                },

                /// The window geometry of a surface is its "visible bounds" from the
                /// user's perspective. Client-side decorations often have invisible
                /// portions like drop-shadows which should be ignored for the
                /// purposes of aligning, placing and constraining windows. Note that
                /// in some situations, compositors may clip rendering to the window
                /// geometry, so the client should avoid putting functional elements
                /// outside of it.
                ///
                /// The window geometry is double-buffered state, see wl_surface.commit.
                ///
                /// When maintaining a position, the compositor should treat the (x, y)
                /// coordinate of the window geometry as the top left corner of the window.
                /// A client changing the (x, y) window geometry coordinate should in
                /// general not alter the position of the window.
                ///
                /// Once the window geometry of the surface is set, it is not possible to
                /// unset it, and it will remain the same until set_window_geometry is
                /// called again, even if a new subsurface or buffer is attached.
                ///
                /// If never set, the value is the full bounds of the surface,
                /// including any subsurfaces. This updates dynamically on every
                /// commit. This unset is meant for extremely simple clients.
                ///
                /// The arguments are given in the surface-local coordinate space of
                /// the wl_surface associated with this xdg_surface, and may extend outside
                /// of the wl_surface itself to mark parts of the subsurface tree as part of
                /// the window geometry.
                ///
                /// When applied, the effective window geometry will be the set window
                /// geometry clamped to the bounding rectangle of the combined
                /// geometry of the surface of the xdg_surface and the associated
                /// subsurfaces.
                ///
                /// The effective geometry will not be recalculated unless a new call to
                /// set_window_geometry is done and the new pending surface state is
                /// subsequently applied.
                ///
                /// The width and height of the effective window geometry must be
                /// greater than zero. Setting an invalid size will raise an
                /// invalid_size error.
                set_window_geometry: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// When a configure event is received, if a client commits the
                /// surface in response to the configure event, then the client
                /// must make an ack_configure request sometime before the commit
                /// request, passing along the serial of the configure event.
                ///
                /// For instance, for toplevel surfaces the compositor might use this
                /// information to move a surface to the top left only when the client has
                /// drawn itself for the maximized or fullscreen state.
                ///
                /// If the client receives multiple configure events before it
                /// can respond to one, it only has to ack the last configure event.
                /// Acking a configure event that was never sent raises an invalid_serial
                /// error.
                ///
                /// A client is not required to commit immediately after sending
                /// an ack_configure request - it may even ack_configure several times
                /// before its next surface commit.
                ///
                /// A client may send multiple ack_configure requests before committing, but
                /// only the last request sent before a commit indicates which configure
                /// event the client really is responding to.
                ///
                /// Sending an ack_configure request consumes the serial number sent with
                /// the request, as well as serial numbers sent by all configure events
                /// sent on this xdg_surface prior to the configure event referenced by
                /// the committed serial.
                ///
                /// It is an error to issue multiple ack_configure requests referencing a
                /// serial from the same configure event, or to issue an ack_configure
                /// request referencing a serial from a configure event issued before the
                /// event identified by the last ack_configure request for the same
                /// xdg_surface. Doing so will raise an invalid_serial error.
                ack_configure: struct {
                    serial: u32,
                },
            };
            pub inline fn setHandler(
                _surface: *Surface,
                comptime T: type,
                handle_request: *const fn (_surface: *Surface, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_surface: *Surface, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_surface);
                _resource.setDispatcher(
                    common.Dispatcher(Surface, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Surface, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The configure event marks the end of a configure sequence. A configure
            /// sequence is a set of one or more events configuring the state of the
            /// xdg_surface, including the final xdg_surface.configure event.
            ///
            /// Where applicable, xdg_surface surface roles will during a configure
            /// sequence extend this event as a latched state sent as events before the
            /// xdg_surface.configure event. Such events should be considered to make up
            /// a set of atomically applied configuration states, where the
            /// xdg_surface.configure commits the accumulated state.
            ///
            /// Clients should arrange their surface for the new states, and then send
            /// an ack_configure request with the serial sent in this configure event at
            /// some point before committing the new surface.
            ///
            /// If the client receives multiple configure events before it can respond
            /// to one, it is free to discard all but the last event it received.
            pub fn sendConfigure(_surface: *Surface, _serial: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_surface);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;
        };

        /// This interface defines an xdg_surface role which allows a surface to,
        /// among other things, set window-like properties such as maximize,
        /// fullscreen, and minimize, set application-specific metadata like title and
        /// id, and well as trigger user interactive operations such as interactive
        /// resize and move.
        ///
        /// A xdg_toplevel by default is responsible for providing the full intended
        /// visual representation of the toplevel, which depending on the window
        /// state, may mean things like a title bar, window controls and drop shadow.
        ///
        /// Unmapping an xdg_toplevel means that the surface cannot be shown
        /// by the compositor until it is explicitly mapped again.
        /// All active operations (e.g., move, resize) are canceled and all
        /// attributes (e.g. title, state, stacking, ...) are discarded for
        /// an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to
        /// the state it had right after xdg_surface.get_toplevel. The client
        /// can re-map the toplevel by performing a commit without any buffer
        /// attached, waiting for a configure event and handling it as usual (see
        /// xdg_surface description).
        ///
        /// Attaching a null buffer to a toplevel unmaps the surface.
        pub const Toplevel = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.toplevel.interface;
            pub const Error = common.xdg.toplevel.Error;
            pub const ResizeEdge = common.xdg.toplevel.ResizeEdge;
            pub const State = common.xdg.toplevel.State;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Toplevel {
                return @ptrCast(try server.wl.Resource.create(_client, Toplevel, _version, _id));
            }
            pub inline fn destroy(_toplevel: *Toplevel) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Toplevel {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_toplevel: *Toplevel) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).getLink();
            }
            pub inline fn getClient(_toplevel: *Toplevel) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).getClient();
            }
            pub inline fn getId(_toplevel: *Toplevel) u32 {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).getId();
            }
            pub inline fn getVersion(_toplevel: *Toplevel) u32 {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).getVersion();
            }
            pub inline fn postNoMemory(_toplevel: *Toplevel) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).postNoMemory();
            }
            pub inline fn getUserData(_toplevel: *Toplevel) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).getUserData();
            }
            pub inline fn postError(_toplevel: *Toplevel, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_parent_since_version = 1;
                pub const set_title_since_version = 1;
                pub const set_app_id_since_version = 1;
                pub const show_window_menu_since_version = 1;
                pub const move_since_version = 1;
                pub const resize_since_version = 1;
                pub const set_max_size_since_version = 1;
                pub const set_min_size_since_version = 1;
                pub const set_maximized_since_version = 1;
                pub const unset_maximized_since_version = 1;
                pub const set_fullscreen_since_version = 1;
                pub const unset_fullscreen_since_version = 1;
                pub const set_minimized_since_version = 1;

                /// This request destroys the role surface and unmaps the surface;
                /// see "Unmapping" behavior in interface section for details.
                destroy: void,
                /// Set the "parent" of this surface. This surface should be stacked
                /// above the parent surface and all other ancestor surfaces.
                ///
                /// Parent surfaces should be set on dialogs, toolboxes, or other
                /// "auxiliary" surfaces, so that the parent is raised when the dialog
                /// is raised.
                ///
                /// Setting a null parent for a child surface unsets its parent. Setting
                /// a null parent for a surface which currently has no parent is a no-op.
                ///
                /// Only mapped surfaces can have child surfaces. Setting a parent which
                /// is not mapped is equivalent to setting a null parent. If a surface
                /// becomes unmapped, its children's parent is set to the parent of
                /// the now-unmapped surface. If the now-unmapped surface has no parent,
                /// its children's parent is unset. If the now-unmapped surface becomes
                /// mapped again, its parent-child relationship is not restored.
                ///
                /// The parent toplevel must not be one of the child toplevel's
                /// descendants, and the parent must be different from the child toplevel,
                /// otherwise the invalid_parent protocol error is raised.
                set_parent: struct {
                    parent: ?*server.xdg.Toplevel,
                },

                /// Set a short title for the surface.
                ///
                /// This string may be used to identify the surface in a task bar,
                /// window list, or other user interface elements provided by the
                /// compositor.
                ///
                /// The string must be encoded in UTF-8.
                set_title: struct {
                    title: [*:0]const u8,
                },

                /// Set an application identifier for the surface.
                ///
                /// The app ID identifies the general class of applications to which
                /// the surface belongs. The compositor can use this to group multiple
                /// surfaces together, or to determine how to launch a new application.
                ///
                /// For D-Bus activatable applications, the app ID is used as the D-Bus
                /// service name.
                ///
                /// The compositor shell will try to group application surfaces together
                /// by their app ID. As a best practice, it is suggested to select app
                /// ID's that match the basename of the application's .desktop file.
                /// For example, "org.freedesktop.FooViewer" where the .desktop file is
                /// "org.freedesktop.FooViewer.desktop".
                ///
                /// Like other properties, a set_app_id request can be sent after the
                /// xdg_toplevel has been mapped to update the property.
                ///
                /// See the desktop-entry specification [0] for more details on
                /// application identifiers and how they relate to well-known D-Bus
                /// names and .desktop files.
                ///
                /// [0] https://standards.freedesktop.org/desktop-entry-spec/
                set_app_id: struct {
                    app_id: [*:0]const u8,
                },

                /// Clients implementing client-side decorations might want to show
                /// a context menu when right-clicking on the decorations, giving the
                /// user a menu that they can use to maximize or minimize the window.
                ///
                /// This request asks the compositor to pop up such a window menu at
                /// the given position, relative to the local surface coordinates of
                /// the parent surface. There are no guarantees as to what menu items
                /// the window menu contains, or even if a window menu will be drawn
                /// at all.
                ///
                /// This request must be used in response to some sort of user action
                /// like a button press, key press, or touch down event.
                show_window_menu: struct {
                    seat: *server.wl.Seat,
                    serial: u32,
                    x: i32,
                    y: i32,
                },

                /// Start an interactive, user-driven move of the surface.
                ///
                /// This request must be used in response to some sort of user action
                /// like a button press, key press, or touch down event. The passed
                /// serial is used to determine the type of interactive move (touch,
                /// pointer, etc).
                ///
                /// The server may ignore move requests depending on the state of
                /// the surface (e.g. fullscreen or maximized), or if the passed serial
                /// is no longer valid.
                ///
                /// If triggered, the surface will lose the focus of the device
                /// (wl_pointer, wl_touch, etc) used for the move. It is up to the
                /// compositor to visually indicate that the move is taking place, such as
                /// updating a pointer cursor, during the move. There is no guarantee
                /// that the device focus will return when the move is completed.
                move: struct {
                    seat: *server.wl.Seat,
                    serial: u32,
                },

                /// Start a user-driven, interactive resize of the surface.
                ///
                /// This request must be used in response to some sort of user action
                /// like a button press, key press, or touch down event. The passed
                /// serial is used to determine the type of interactive resize (touch,
                /// pointer, etc).
                ///
                /// The server may ignore resize requests depending on the state of
                /// the surface (e.g. fullscreen or maximized).
                ///
                /// If triggered, the client will receive configure events with the
                /// "resize" state enum value and the expected sizes. See the "resize"
                /// enum value for more details about what is required. The client
                /// must also acknowledge configure events using "ack_configure". After
                /// the resize is completed, the client will receive another "configure"
                /// event without the resize state.
                ///
                /// If triggered, the surface also will lose the focus of the device
                /// (wl_pointer, wl_touch, etc) used for the resize. It is up to the
                /// compositor to visually indicate that the resize is taking place,
                /// such as updating a pointer cursor, during the resize. There is no
                /// guarantee that the device focus will return when the resize is
                /// completed.
                ///
                /// The edges parameter specifies how the surface should be resized, and
                /// is one of the values of the resize_edge enum. Values not matching
                /// a variant of the enum will cause the invalid_resize_edge protocol error.
                /// The compositor may use this information to update the surface position
                /// for example when dragging the top left corner. The compositor may also
                /// use this information to adapt its behavior, e.g. choose an appropriate
                /// cursor image.
                resize: struct {
                    seat: *server.wl.Seat,
                    serial: u32,
                    edges: ResizeEdge,
                },

                /// Set a maximum size for the window.
                ///
                /// The client can specify a maximum size so that the compositor does
                /// not try to configure the window beyond this size.
                ///
                /// The width and height arguments are in window geometry coordinates.
                /// See xdg_surface.set_window_geometry.
                ///
                /// Values set in this way are double-buffered, see wl_surface.commit.
                ///
                /// The compositor can use this information to allow or disallow
                /// different states like maximize or fullscreen and draw accurate
                /// animations.
                ///
                /// Similarly, a tiling window manager may use this information to
                /// place and resize client windows in a more effective way.
                ///
                /// The client should not rely on the compositor to obey the maximum
                /// size. The compositor may decide to ignore the values set by the
                /// client and request a larger size.
                ///
                /// If never set, or a value of zero in the request, means that the
                /// client has no expected maximum size in the given dimension.
                /// As a result, a client wishing to reset the maximum size
                /// to an unspecified state can use zero for width and height in the
                /// request.
                ///
                /// Requesting a maximum size to be smaller than the minimum size of
                /// a surface is illegal and will result in an invalid_size error.
                ///
                /// The width and height must be greater than or equal to zero. Using
                /// strictly negative values for width or height will result in a
                /// invalid_size error.
                set_max_size: struct {
                    width: i32,
                    height: i32,
                },

                /// Set a minimum size for the window.
                ///
                /// The client can specify a minimum size so that the compositor does
                /// not try to configure the window below this size.
                ///
                /// The width and height arguments are in window geometry coordinates.
                /// See xdg_surface.set_window_geometry.
                ///
                /// Values set in this way are double-buffered, see wl_surface.commit.
                ///
                /// The compositor can use this information to allow or disallow
                /// different states like maximize or fullscreen and draw accurate
                /// animations.
                ///
                /// Similarly, a tiling window manager may use this information to
                /// place and resize client windows in a more effective way.
                ///
                /// The client should not rely on the compositor to obey the minimum
                /// size. The compositor may decide to ignore the values set by the
                /// client and request a smaller size.
                ///
                /// If never set, or a value of zero in the request, means that the
                /// client has no expected minimum size in the given dimension.
                /// As a result, a client wishing to reset the minimum size
                /// to an unspecified state can use zero for width and height in the
                /// request.
                ///
                /// Requesting a minimum size to be larger than the maximum size of
                /// a surface is illegal and will result in an invalid_size error.
                ///
                /// The width and height must be greater than or equal to zero. Using
                /// strictly negative values for width and height will result in a
                /// invalid_size error.
                set_min_size: struct {
                    width: i32,
                    height: i32,
                },

                /// Maximize the surface.
                ///
                /// After requesting that the surface should be maximized, the compositor
                /// will respond by emitting a configure event. Whether this configure
                /// actually sets the window maximized is subject to compositor policies.
                /// The client must then update its content, drawing in the configured
                /// state. The client must also acknowledge the configure when committing
                /// the new content (see ack_configure).
                ///
                /// It is up to the compositor to decide how and where to maximize the
                /// surface, for example which output and what region of the screen should
                /// be used.
                ///
                /// If the surface was already maximized, the compositor will still emit
                /// a configure event with the "maximized" state.
                ///
                /// If the surface is in a fullscreen state, this request has no direct
                /// effect. It may alter the state the surface is returned to when
                /// unmaximized unless overridden by the compositor.
                set_maximized: void,
                /// Unmaximize the surface.
                ///
                /// After requesting that the surface should be unmaximized, the compositor
                /// will respond by emitting a configure event. Whether this actually
                /// un-maximizes the window is subject to compositor policies.
                /// If available and applicable, the compositor will include the window
                /// geometry dimensions the window had prior to being maximized in the
                /// configure event. The client must then update its content, drawing it in
                /// the configured state. The client must also acknowledge the configure
                /// when committing the new content (see ack_configure).
                ///
                /// It is up to the compositor to position the surface after it was
                /// unmaximized; usually the position the surface had before maximizing, if
                /// applicable.
                ///
                /// If the surface was already not maximized, the compositor will still
                /// emit a configure event without the "maximized" state.
                ///
                /// If the surface is in a fullscreen state, this request has no direct
                /// effect. It may alter the state the surface is returned to when
                /// unmaximized unless overridden by the compositor.
                unset_maximized: void,
                /// Make the surface fullscreen.
                ///
                /// After requesting that the surface should be fullscreened, the
                /// compositor will respond by emitting a configure event. Whether the
                /// client is actually put into a fullscreen state is subject to compositor
                /// policies. The client must also acknowledge the configure when
                /// committing the new content (see ack_configure).
                ///
                /// The output passed by the request indicates the client's preference as
                /// to which display it should be set fullscreen on. If this value is NULL,
                /// it's up to the compositor to choose which display will be used to map
                /// this surface.
                ///
                /// If the surface doesn't cover the whole output, the compositor will
                /// position the surface in the center of the output and compensate with
                /// with border fill covering the rest of the output. The content of the
                /// border fill is undefined, but should be assumed to be in some way that
                /// attempts to blend into the surrounding area (e.g. solid black).
                ///
                /// If the fullscreened surface is not opaque, the compositor must make
                /// sure that other screen content not part of the same surface tree (made
                /// up of subsurfaces, popups or similarly coupled surfaces) are not
                /// visible below the fullscreened surface.
                set_fullscreen: struct {
                    output: ?*server.wl.Output,
                },

                /// Make the surface no longer fullscreen.
                ///
                /// After requesting that the surface should be unfullscreened, the
                /// compositor will respond by emitting a configure event.
                /// Whether this actually removes the fullscreen state of the client is
                /// subject to compositor policies.
                ///
                /// Making a surface unfullscreen sets states for the surface based on the following:
                /// * the state(s) it may have had before becoming fullscreen
                /// * any state(s) decided by the compositor
                /// * any state(s) requested by the client while the surface was fullscreen
                ///
                /// The compositor may include the previous window geometry dimensions in
                /// the configure event, if applicable.
                ///
                /// The client must also acknowledge the configure when committing the new
                /// content (see ack_configure).
                unset_fullscreen: void,
                /// Request that the compositor minimize your surface. There is no
                /// way to know if the surface is currently minimized, nor is there
                /// any way to unset minimization on this surface.
                ///
                /// If you are looking to throttle redrawing when minimized, please
                /// instead use the wl_surface.frame event for this, as this will
                /// also work with live previews on windows in Alt-Tab, Expose or
                /// similar compositor features.
                set_minimized: void,
            };
            pub inline fn setHandler(
                _toplevel: *Toplevel,
                comptime T: type,
                handle_request: *const fn (_toplevel: *Toplevel, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_toplevel: *Toplevel, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_toplevel);
                _resource.setDispatcher(
                    common.Dispatcher(Toplevel, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Toplevel, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This configure event asks the client to resize its toplevel surface or
            /// to change its state. The configured state should not be applied
            /// immediately. See xdg_surface.configure for details.
            ///
            /// The width and height arguments specify a hint to the window
            /// about how its surface should be resized in window geometry
            /// coordinates. See set_window_geometry.
            ///
            /// If the width or height arguments are zero, it means the client
            /// should decide its own window dimension. This may happen when the
            /// compositor needs to configure the state of the surface but doesn't
            /// have any information about any previous or expected dimension.
            ///
            /// The states listed in the event specify how the width/height
            /// arguments should be interpreted, and possibly how it should be
            /// drawn.
            ///
            /// Clients must send an ack_configure in response to this event. See
            /// xdg_surface.configure and xdg_surface.ack_configure for details.
            pub fn sendConfigure(_toplevel: *Toplevel, _width: i32, _height: i32, _states: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_toplevel);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                    .{ .a = _states },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;

            /// The close event is sent by the compositor when the user
            /// wants the surface to be closed. This should be equivalent to
            /// the user clicking the close button in client-side decorations,
            /// if your application has any.
            ///
            /// This is only a request that the user intends to close the
            /// window. The client may choose to ignore this request, or show
            /// a dialog to ask the user to save their data, etc.
            pub fn sendClose(_toplevel: *Toplevel) void {
                const _resource: *server.wl.Resource = @ptrCast(_toplevel);
                _resource.postEvent(1, null);
            }
            pub const close_since_version = 1;
        };

        /// A popup surface is a short-lived, temporary surface. It can be used to
        /// implement for example menus, popovers, tooltips and other similar user
        /// interface concepts.
        ///
        /// A popup can be made to take an explicit grab. See xdg_popup.grab for
        /// details.
        ///
        /// When the popup is dismissed, a popup_done event will be sent out, and at
        /// the same time the surface will be unmapped. See the xdg_popup.popup_done
        /// event for details.
        ///
        /// Explicitly destroying the xdg_popup object will also dismiss the popup and
        /// unmap the surface. Clients that want to dismiss the popup when another
        /// surface of their own is clicked should dismiss the popup using the destroy
        /// request.
        ///
        /// A newly created xdg_popup will be stacked on top of all previously created
        /// xdg_popup surfaces associated with the same xdg_toplevel.
        ///
        /// The parent of an xdg_popup must be mapped (see the xdg_surface
        /// description) before the xdg_popup itself.
        ///
        /// The client must call wl_surface.commit on the corresponding wl_surface
        /// for the xdg_popup state to take effect.
        pub const Popup = opaque {
            pub const generated_version = 2;
            pub const interface = &common.xdg.popup.interface;
            pub const Error = common.xdg.popup.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*Popup {
                return @ptrCast(try server.wl.Resource.create(_client, Popup, _version, _id));
            }
            pub inline fn destroy(_popup: *Popup) void {
                return @as(*server.wl.Resource, @ptrCast(_popup)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *Popup {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_popup: *Popup) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_popup)).getLink();
            }
            pub inline fn getClient(_popup: *Popup) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_popup)).getClient();
            }
            pub inline fn getId(_popup: *Popup) u32 {
                return @as(*server.wl.Resource, @ptrCast(_popup)).getId();
            }
            pub inline fn getVersion(_popup: *Popup) u32 {
                return @as(*server.wl.Resource, @ptrCast(_popup)).getVersion();
            }
            pub inline fn postNoMemory(_popup: *Popup) void {
                return @as(*server.wl.Resource, @ptrCast(_popup)).postNoMemory();
            }
            pub inline fn getUserData(_popup: *Popup) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_popup)).getUserData();
            }
            pub inline fn postError(_popup: *Popup, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_popup)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const grab_since_version = 1;

                /// This destroys the popup. Explicitly destroying the xdg_popup
                /// object will also dismiss the popup, and unmap the surface.
                ///
                /// If this xdg_popup is not the "topmost" popup, the
                /// xdg_wm_base.not_the_topmost_popup protocol error will be sent.
                destroy: void,
                /// This request makes the created popup take an explicit grab. An explicit
                /// grab will be dismissed when the user dismisses the popup, or when the
                /// client destroys the xdg_popup. This can be done by the user clicking
                /// outside the surface, using the keyboard, or even locking the screen
                /// through closing the lid or a timeout.
                ///
                /// If the compositor denies the grab, the popup will be immediately
                /// dismissed.
                ///
                /// This request must be used in response to some sort of user action like a
                /// button press, key press, or touch down event. The serial number of the
                /// event should be passed as 'serial'.
                ///
                /// The parent of a grabbing popup must either be an xdg_toplevel surface or
                /// another xdg_popup with an explicit grab. If the parent is another
                /// xdg_popup it means that the popups are nested, with this popup now being
                /// the topmost popup.
                ///
                /// Nested popups must be destroyed in the reverse order they were created
                /// in, e.g. the only popup you are allowed to destroy at all times is the
                /// topmost one.
                ///
                /// When compositors choose to dismiss a popup, they may dismiss every
                /// nested grabbing popup as well. When a compositor dismisses popups, it
                /// will follow the same dismissing order as required from the client.
                ///
                /// If the topmost grabbing popup is destroyed, the grab will be returned to
                /// the parent of the popup, if that parent previously had an explicit grab.
                ///
                /// If the parent is a grabbing popup which has already been dismissed, this
                /// popup will be immediately dismissed. If the parent is a popup that did
                /// not take an explicit grab, an error will be raised.
                ///
                /// During a popup grab, the client owning the grab will receive pointer
                /// and touch events for all their surfaces as normal (similar to an
                /// "owner-events" grab in X11 parlance), while the top most grabbing popup
                /// will always have keyboard focus.
                grab: struct {
                    seat: *server.wl.Seat,
                    serial: u32,
                },
            };
            pub inline fn setHandler(
                _popup: *Popup,
                comptime T: type,
                handle_request: *const fn (_popup: *Popup, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_popup: *Popup, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_popup);
                _resource.setDispatcher(
                    common.Dispatcher(Popup, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*Popup, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event asks the popup surface to configure itself given the
            /// configuration. The configured state should not be applied immediately.
            /// See xdg_surface.configure for details.
            ///
            /// The x and y arguments represent the position the popup was placed at
            /// given the xdg_positioner rule, relative to the upper left corner of the
            /// window geometry of the parent surface.
            ///
            /// For version 2 or older, the configure event for an xdg_popup is only
            /// ever sent once for the initial configuration. Starting with version 3,
            /// it may be sent again if the popup is setup with an xdg_positioner with
            /// set_reactive requested, or in response to xdg_popup.reposition requests.
            pub fn sendConfigure(_popup: *Popup, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_popup);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;

            /// The popup_done event is sent out when a popup is dismissed by the
            /// compositor. The client should destroy the xdg_popup object at this
            /// point.
            pub fn sendPopupDone(_popup: *Popup) void {
                const _resource: *server.wl.Resource = @ptrCast(_popup);
                _resource.postEvent(1, null);
            }
            pub const popup_done_since_version = 1;
        };
    };
    pub const wp = struct {
        /// A singleton global interface used for getting color management extensions
        /// for wl_surface and wl_output objects, and for creating client defined
        /// image description objects. The extension interfaces allow
        /// getting the image description of outputs and setting the image
        /// description of surfaces.
        ///
        /// Compositors should never remove this global.
        pub const ColorManagerV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_manager_v1.interface;
            pub const Error = common.wp.color_manager_v1.Error;
            pub const RenderIntent = common.wp.color_manager_v1.RenderIntent;
            pub const Feature = common.wp.color_manager_v1.Feature;
            pub const Primaries = common.wp.color_manager_v1.Primaries;
            pub const TransferFunction = common.wp.color_manager_v1.TransferFunction;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorManagerV1, _version, _id));
            }
            pub inline fn destroy(_color_manager_v1: *ColorManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_manager_v1: *ColorManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).getLink();
            }
            pub inline fn getClient(_color_manager_v1: *ColorManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).getClient();
            }
            pub inline fn getId(_color_manager_v1: *ColorManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).getId();
            }
            pub inline fn getVersion(_color_manager_v1: *ColorManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_manager_v1: *ColorManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_manager_v1: *ColorManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).getUserData();
            }
            pub inline fn postError(_color_manager_v1: *ColorManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_color_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_output_since_version = 1;
                pub const get_surface_since_version = 1;
                pub const get_surface_feedback_since_version = 1;
                pub const create_icc_creator_since_version = 1;
                pub const create_parametric_creator_since_version = 1;
                pub const create_windows_scrgb_since_version = 1;
                pub const get_image_description_since_version = 2;

                /// Destroy the wp_color_manager_v1 object. This does not affect any other
                /// objects in any way.
                destroy: void,
                /// This creates a new wp_color_management_output_v1 object for the
                /// given wl_output.
                ///
                /// See the wp_color_management_output_v1 interface for more details.
                get_output: struct {
                    id: u32,
                    output: *server.wl.Output,
                },

                /// If a wp_color_management_surface_v1 object already exists for the given
                /// wl_surface, the protocol error surface_exists is raised.
                ///
                /// This creates a new color wp_color_management_surface_v1 object for the
                /// given wl_surface.
                ///
                /// See the wp_color_management_surface_v1 interface for more details.
                get_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// This creates a new color wp_color_management_surface_feedback_v1 object
                /// for the given wl_surface.
                ///
                /// See the wp_color_management_surface_feedback_v1 interface for more
                /// details.
                get_surface_feedback: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// Makes a new ICC-based image description creator object with all
                /// properties initially unset. The client can then use the object's
                /// interface to define all the required properties for an image description
                /// and finally create a wp_image_description_v1 object.
                ///
                /// This request can be used when the compositor advertises
                /// wp_color_manager_v1.feature.icc_v2_v4.
                /// Otherwise this request raises the protocol error unsupported_feature.
                create_icc_creator: struct {
                    obj: u32,
                },

                /// Makes a new parametric image description creator object with all
                /// properties initially unset. The client can then use the object's
                /// interface to define all the required properties for an image description
                /// and finally create a wp_image_description_v1 object.
                ///
                /// This request can be used when the compositor advertises
                /// wp_color_manager_v1.feature.parametric.
                /// Otherwise this request raises the protocol error unsupported_feature.
                create_parametric_creator: struct {
                    obj: u32,
                },

                /// This creates a pre-defined image description for the so-called
                /// Windows-scRGB stimulus encoding. This comes from the Windows 10 handling
                /// of its own definition of an scRGB color space for an HDR screen
                /// driven in BT.2100/PQ signalling mode.
                ///
                /// Windows-scRGB uses sRGB (BT.709) color primaries and white point.
                /// The transfer characteristic is extended linear.
                ///
                /// The nominal color channel value range is extended, meaning it includes
                /// negative and greater than 1.0 values. Negative values are used to
                /// escape the sRGB color gamut boundaries. To make use of the extended
                /// range, the client needs to use a pixel format that can represent those
                /// values, e.g. floating-point 16 bits per channel.
                ///
                /// Nominal color value R=G=B=0.0 corresponds to BT.2100/PQ system
                /// 0 cd/m², and R=G=B=1.0 corresponds to BT.2100/PQ system 80 cd/m².
                /// The maximum is R=G=B=125.0 corresponding to 10k cd/m².
                ///
                /// Windows-scRGB is displayed by Windows 10 by converting it to
                /// BT.2100/PQ, maintaining the CIE 1931 chromaticity and mapping the
                /// luminance as above. No adjustment is made to the signal to account
                /// for the viewing conditions.
                ///
                /// The reference white level of Windows-scRGB is unknown. If a
                /// reference white level must be assumed for compositor processing, it
                /// should be R=G=B=2.5375 corresponding to 203 cd/m² of Report ITU-R
                /// BT.2408-7.
                ///
                /// The target color volume of Windows-scRGB is unknown. The color gamut
                /// may be anything between sRGB and BT.2100.
                ///
                /// Note: EGL_EXT_gl_colorspace_scrgb_linear definition differs from
                /// Windows-scRGB by using R=G=B=1.0 as the reference white level, while
                /// Windows-scRGB reference white level is unknown or varies. However,
                /// it seems probable that Windows implements both
                /// EGL_EXT_gl_colorspace_scrgb_linear and Vulkan
                /// VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT as Windows-scRGB.
                ///
                /// This request can be used when the compositor advertises
                /// wp_color_manager_v1.feature.windows_scrgb.
                /// Otherwise this request raises the protocol error unsupported_feature.
                ///
                /// The resulting image description object does not allow get_information
                /// request. The wp_image_description_v1.ready event shall be sent.
                create_windows_scrgb: struct {
                    image_description: u32,
                },

                /// This request retrieves the image description backing a reference.
                ///
                /// The get_information request can be used if and only if the request that
                /// creates the reference allows it.
                get_image_description: struct {
                    image_description: u32,
                    reference: *server.wp.ImageDescriptionReferenceV1,
                },
            };
            pub inline fn setHandler(
                _color_manager_v1: *ColorManagerV1,
                comptime T: type,
                handle_request: *const fn (_color_manager_v1: *ColorManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_manager_v1: *ColorManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// When this object is created, it shall immediately send this event once
            /// for each rendering intent the compositor supports.
            ///
            /// A compositor must not advertise intents that are deprecated in the
            /// bound version of the interface.
            pub fn sendSupportedIntent(_color_manager_v1: *ColorManagerV1, _render_intent: RenderIntent) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(RenderIntent)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_render_intent))),
                        .@"struct" => @bitCast(_render_intent),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const supported_intent_since_version = 1;

            /// When this object is created, it shall immediately send this event once
            /// for each compositor supported feature listed in the enumeration.
            ///
            /// A compositor must not advertise features that are deprecated in the
            /// bound version of the interface.
            pub fn sendSupportedFeature(_color_manager_v1: *ColorManagerV1, _feature: Feature) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Feature)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_feature))),
                        .@"struct" => @bitCast(_feature),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(1, &_args);
            }
            pub const supported_feature_since_version = 1;

            /// When this object is created, it shall immediately send this event once
            /// for each named transfer function the compositor supports with the
            /// parametric image description creator.
            ///
            /// A compositor must not advertise transfer functions that are deprecated
            /// in the bound version of the interface.
            pub fn sendSupportedTfNamed(_color_manager_v1: *ColorManagerV1, _tf: TransferFunction) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(TransferFunction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_tf))),
                        .@"struct" => @bitCast(_tf),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(2, &_args);
            }
            pub const supported_tf_named_since_version = 1;

            /// When this object is created, it shall immediately send this event once
            /// for each named set of primaries the compositor supports with the
            /// parametric image description creator.
            ///
            /// A compositor must not advertise names that are deprecated in the
            /// bound version of the interface.
            pub fn sendSupportedPrimariesNamed(_color_manager_v1: *ColorManagerV1, _primaries: Primaries) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Primaries)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_primaries))),
                        .@"struct" => @bitCast(_primaries),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const supported_primaries_named_since_version = 1;

            /// This event is sent when all supported rendering intents, features,
            /// transfer functions and named primaries have been sent.
            pub fn sendDone(_color_manager_v1: *ColorManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_manager_v1);
                _resource.postEvent(4, null);
            }
            pub const done_since_version = 1;
        };

        /// A wp_color_management_output_v1 describes the color properties of an
        /// output.
        ///
        /// The wp_color_management_output_v1 is associated with the wl_output global
        /// underlying the wl_output object. Therefore the client destroying the
        /// wl_output object has no impact, but the compositor removing the output
        /// global makes the wp_color_management_output_v1 object inert.
        pub const ColorManagementOutputV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_output_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorManagementOutputV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorManagementOutputV1, _version, _id));
            }
            pub inline fn destroy(_color_management_output_v1: *ColorManagementOutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorManagementOutputV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_management_output_v1: *ColorManagementOutputV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).getLink();
            }
            pub inline fn getClient(_color_management_output_v1: *ColorManagementOutputV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).getClient();
            }
            pub inline fn getId(_color_management_output_v1: *ColorManagementOutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).getId();
            }
            pub inline fn getVersion(_color_management_output_v1: *ColorManagementOutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_management_output_v1: *ColorManagementOutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_management_output_v1: *ColorManagementOutputV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_management_output_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_image_description_since_version = 1;

                /// Destroy the color wp_color_management_output_v1 object. This does not
                /// affect any remaining protocol objects.
                destroy: void,
                /// This creates a new wp_image_description_v1 object for the current image
                /// description of the output. There always is exactly one image description
                /// active for an output so the client should destroy the image description
                /// created by earlier invocations of this request. This request is usually
                /// sent as a reaction to the image_description_changed event or when
                /// creating a wp_color_management_output_v1 object.
                ///
                /// The image description of an output represents the color encoding the
                /// output expects. There might be performance and power advantages, as well
                /// as improved color reproduction, if a content update matches the image
                /// description of the output it is being shown on. If a content update is
                /// shown on any other output than the one it matches the image description
                /// of, then the color reproduction on those outputs might be considerably
                /// worse.
                ///
                /// The created wp_image_description_v1 object preserves the image
                /// description of the output from the time the object was created.
                ///
                /// The resulting image description object allows get_information request.
                ///
                /// If this protocol object is inert, the resulting image description object
                /// shall immediately deliver the wp_image_description_v1.failed event with
                /// the no_output cause.
                ///
                /// If the interface version is inadequate for the output's image
                /// description, meaning that the client does not support all the events
                /// needed to deliver the crucial information, the resulting image
                /// description object shall immediately deliver the
                /// wp_image_description_v1.failed event with the low_version cause.
                ///
                /// Otherwise the object shall immediately deliver the ready event.
                get_image_description: struct {
                    image_description: u32,
                },
            };
            pub inline fn setHandler(
                _color_management_output_v1: *ColorManagementOutputV1,
                comptime T: type,
                handle_request: *const fn (_color_management_output_v1: *ColorManagementOutputV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_management_output_v1: *ColorManagementOutputV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_output_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorManagementOutputV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorManagementOutputV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent whenever the image description of the output changed,
            /// followed by one wl_output.done event common to output events across all
            /// extensions.
            ///
            /// If the client wants to use the updated image description, it needs to do
            /// get_image_description again, because image description objects are
            /// immutable.
            pub fn sendImageDescriptionChanged(_color_management_output_v1: *ColorManagementOutputV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_output_v1);
                _resource.postEvent(0, null);
            }
            pub const image_description_changed_since_version = 1;
        };

        /// An image description carries information about the pixel color encoding
        /// and its intended display and viewing environment. The image description is
        /// attached to a wl_surface via
        /// wp_color_management_surface_v1.set_image_description. A compositor can use
        /// this information to decode pixel values into colorimetrically meaningful
        /// quantities, which allows the compositor to transform the surface contents
        /// to become suitable for various displays and viewing environments.
        ///
        /// Note, that the wp_image_description_v1 object is not ready to be used
        /// immediately after creation. The object eventually delivers either the
        /// 'ready' or the 'failed' event, specified in all requests creating it. The
        /// object is deemed "ready" after receiving the 'ready' event.
        ///
        /// An object which is not ready is illegal to use, it can only be destroyed.
        /// Any other request in this interface shall result in the 'not_ready'
        /// protocol error. Attempts to use an object which is not ready through other
        /// interfaces shall raise protocol errors defined there.
        ///
        /// Once created and regardless of how it was created, a
        /// wp_image_description_v1 object always refers to one fixed image
        /// description. It cannot change after creation.
        pub const ImageDescriptionV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_v1.interface;
            pub const Error = common.wp.image_description_v1.Error;
            pub const Cause = common.wp.image_description_v1.Cause;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ImageDescriptionV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ImageDescriptionV1, _version, _id));
            }
            pub inline fn destroy(_image_description_v1: *ImageDescriptionV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ImageDescriptionV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_image_description_v1: *ImageDescriptionV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).getLink();
            }
            pub inline fn getClient(_image_description_v1: *ImageDescriptionV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).getClient();
            }
            pub inline fn getId(_image_description_v1: *ImageDescriptionV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).getId();
            }
            pub inline fn getVersion(_image_description_v1: *ImageDescriptionV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).getVersion();
            }
            pub inline fn postNoMemory(_image_description_v1: *ImageDescriptionV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).postNoMemory();
            }
            pub inline fn getUserData(_image_description_v1: *ImageDescriptionV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).getUserData();
            }
            pub inline fn postError(_image_description_v1: *ImageDescriptionV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_information_since_version = 1;

                /// Destroy this object. It is safe to destroy an object which is not ready.
                ///
                /// Destroying a wp_image_description_v1 object has no side-effects, not
                /// even if a wp_color_management_surface_v1.set_image_description has not
                /// yet been followed by a wl_surface.commit.
                destroy: void,
                /// Creates a wp_image_description_info_v1 object which delivers the
                /// information that makes up the image description.
                ///
                /// Not all image description protocol objects allow get_information
                /// request. Whether it is allowed or not is defined by the request that
                /// created the object. If get_information is not allowed, the protocol
                /// error no_information is raised.
                get_information: struct {
                    information: u32,
                },
            };
            pub inline fn setHandler(
                _image_description_v1: *ImageDescriptionV1,
                comptime T: type,
                handle_request: *const fn (_image_description_v1: *ImageDescriptionV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_image_description_v1: *ImageDescriptionV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ImageDescriptionV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ImageDescriptionV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// If creating a wp_image_description_v1 object fails for a reason that is
            /// not defined as a protocol error, this event is sent.
            ///
            /// The requests that create image description objects define whether and
            /// when this can occur. Only such creation requests can trigger this event.
            /// This event cannot be triggered after the image description was
            /// successfully formed.
            ///
            /// Once this event has been sent, the wp_image_description_v1 object will
            /// never become ready and it can only be destroyed.
            pub fn sendFailed(_image_description_v1: *ImageDescriptionV1, _cause: Cause, _msg: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Cause)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_cause))),
                        .@"struct" => @bitCast(_cause),
                        else => unreachable,
                    } },
                    .{ .s = _msg },
                };
                _resource.postEvent(0, &_args);
            }
            pub const failed_since_version = 1;

            /// Starting from interface version 2, the 'ready2' event is sent instead
            /// of this event.
            ///
            /// For the definition of this event, see the 'ready2' event. The
            /// difference to this event is as follows.
            ///
            /// The id number is valid only as long as the protocol object is alive. If
            /// all protocol objects referring to the same image description record are
            /// destroyed, the id number may be recycled for a different image
            /// description record.
            pub fn sendReady(_image_description_v1: *ImageDescriptionV1, _identity: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_v1);
                var _args = [_]common.Argument{
                    .{ .u = _identity },
                };
                _resource.postEvent(1, &_args);
            }
            pub const ready_since_version = 1;

            /// Once this event has been sent, the wp_image_description_v1 object is
            /// deemed "ready". Ready objects can be used to send requests and can be
            /// used through other interfaces.
            ///
            /// Every ready wp_image_description_v1 protocol object refers to an
            /// underlying image description record in the compositor. Multiple protocol
            /// objects may end up referring to the same record. Clients may identify
            /// these "copies" by comparing their id numbers: if the numbers from two
            /// protocol objects are identical, the protocol objects refer to the same
            /// image description record. Two different image description records
            /// cannot have the same id number simultaneously. The id number does not
            /// change during the lifetime of the image description record.
            ///
            /// Image description id number is not a protocol object id. Zero is
            /// reserved as an invalid id number. It shall not be possible for a client
            /// to refer to an image description by its id number in protocol. The id
            /// numbers might not be portable between Wayland connections. A compositor
            /// shall not send an invalid id number.
            ///
            /// Compositors must not recycle image description id numbers.
            ///
            /// This identity allows clients to de-duplicate image description records
            /// and avoid get_information request if they already have the image
            /// description information.
            pub fn sendReady2(_image_description_v1: *ImageDescriptionV1, _identity_hi: u32, _identity_lo: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_v1);
                var _args = [_]common.Argument{
                    .{ .u = _identity_hi },
                    .{ .u = _identity_lo },
                };
                _resource.postEvent(2, &_args);
            }
            pub const ready2_since_version = 2;
        };

        /// Sends all matching events describing an image description object exactly
        /// once and finally sends the 'done' event.
        ///
        /// This means
        /// - if the image description is parametric, it must send
        /// - primaries
        /// - named_primaries, if applicable
        /// - at least one of tf_power and tf_named, as applicable
        /// - luminances
        /// - target_primaries
        /// - target_luminance
        /// - if the image description is parametric, it may send, if applicable,
        /// - target_max_cll
        /// - target_max_fall
        /// - if the image description contains an ICC profile, it must send the
        /// icc_file event
        ///
        /// Once a wp_image_description_info_v1 object has delivered a 'done' event it
        /// is automatically destroyed.
        ///
        /// Every wp_image_description_info_v1 created from the same
        /// wp_image_description_v1 shall always return the exact same data.
        pub const ImageDescriptionInfoV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_info_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ImageDescriptionInfoV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ImageDescriptionInfoV1, _version, _id));
            }
            pub inline fn destroy(_image_description_info_v1: *ImageDescriptionInfoV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ImageDescriptionInfoV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_image_description_info_v1: *ImageDescriptionInfoV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).getLink();
            }
            pub inline fn getClient(_image_description_info_v1: *ImageDescriptionInfoV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).getClient();
            }
            pub inline fn getId(_image_description_info_v1: *ImageDescriptionInfoV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).getId();
            }
            pub inline fn getVersion(_image_description_info_v1: *ImageDescriptionInfoV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).getVersion();
            }
            pub inline fn postNoMemory(_image_description_info_v1: *ImageDescriptionInfoV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).postNoMemory();
            }
            pub inline fn getUserData(_image_description_info_v1: *ImageDescriptionInfoV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_image_description_info_v1)).getUserData();
            }
            pub inline fn setHandler(
                _image_description_info_v1: *ImageDescriptionInfoV1,
                comptime T: type,
                comptime handle_destroy: ?fn (_image_description_info_v1: *ImageDescriptionInfoV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                _resource.setDispatcher(
                    null,
                    null,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ImageDescriptionInfoV1, @ptrCast(__resource)),
                                @as(?*anyopaque, @ptrFromInt(@intFromPtr(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Signals the end of information events and destroys the object.
            pub fn destroySendDone(_image_description_info_v1: *ImageDescriptionInfoV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                _resource.postEvent(0, null);
                _resource.destroy();
            }
            pub const done_since_version = 1;

            /// The icc argument provides a file descriptor to the client which may be
            /// memory-mapped to provide the ICC profile matching the image description.
            /// The fd is read-only, and if mapped then it must be mapped with
            /// MAP_PRIVATE by the client.
            ///
            /// The ICC profile version and other details are determined by the
            /// compositor. There is no provision for a client to ask for a specific
            /// kind of a profile.
            pub fn sendIccFile(_image_description_info_v1: *ImageDescriptionInfoV1, _icc: i32, _icc_size: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .h = _icc },
                    .{ .u = _icc_size },
                };
                _resource.postEvent(1, &_args);
            }
            pub const icc_file_since_version = 1;

            /// Delivers the primary color volume primaries and white point using CIE
            /// 1931 xy chromaticity coordinates.
            ///
            /// Each coordinate value is multiplied by 1 million to get the argument
            /// value to carry precision of 6 decimals.
            pub fn sendPrimaries(_image_description_info_v1: *ImageDescriptionInfoV1, _r_x: i32, _r_y: i32, _g_x: i32, _g_y: i32, _b_x: i32, _b_y: i32, _w_x: i32, _w_y: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .i = _r_x },
                    .{ .i = _r_y },
                    .{ .i = _g_x },
                    .{ .i = _g_y },
                    .{ .i = _b_x },
                    .{ .i = _b_y },
                    .{ .i = _w_x },
                    .{ .i = _w_y },
                };
                _resource.postEvent(2, &_args);
            }
            pub const primaries_since_version = 1;

            /// Delivers the primary color volume primaries and white point using an
            /// explicitly enumerated named set.
            pub fn sendPrimariesNamed(_image_description_info_v1: *ImageDescriptionInfoV1, _primaries: common.wp.color_manager_v1.Primaries) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_manager_v1.Primaries)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_primaries))),
                        .@"struct" => @bitCast(_primaries),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const primaries_named_since_version = 1;

            /// The color component transfer characteristic of this image description is
            /// a pure power curve. This event provides the exponent of the power
            /// function. This curve represents the conversion from electrical to
            /// optical pixel or color values.
            ///
            /// The curve exponent has been multiplied by 10000 to get the argument eexp
            /// value to carry the precision of 4 decimals.
            pub fn sendTfPower(_image_description_info_v1: *ImageDescriptionInfoV1, _eexp: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = _eexp },
                };
                _resource.postEvent(4, &_args);
            }
            pub const tf_power_since_version = 1;

            /// Delivers the transfer characteristic using an explicitly enumerated
            /// named function.
            pub fn sendTfNamed(_image_description_info_v1: *ImageDescriptionInfoV1, _tf: common.wp.color_manager_v1.TransferFunction) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_manager_v1.TransferFunction)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_tf))),
                        .@"struct" => @bitCast(_tf),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(5, &_args);
            }
            pub const tf_named_since_version = 1;

            /// Delivers the primary color volume luminance range and the reference
            /// white luminance level. These values include the minimum display emission
            /// and ambient flare luminances, assumed to be optically additive and have
            /// the chromaticity of the primary color volume white point.
            ///
            /// The minimum luminance is multiplied by 10000 to get the argument
            /// 'min_lum' value and carries precision of 4 decimals. The maximum
            /// luminance and reference white luminance values are unscaled.
            pub fn sendLuminances(_image_description_info_v1: *ImageDescriptionInfoV1, _min_lum: u32, _max_lum: u32, _reference_lum: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = _min_lum },
                    .{ .u = _max_lum },
                    .{ .u = _reference_lum },
                };
                _resource.postEvent(6, &_args);
            }
            pub const luminances_since_version = 1;

            /// Provides the color primaries and white point of the target color volume
            /// using CIE 1931 xy chromaticity coordinates. This is compatible with the
            /// SMPTE ST 2086 definition of HDR static metadata for mastering displays.
            ///
            /// While primary color volume is about how color is encoded, the target
            /// color volume is the actually displayable color volume.
            ///
            /// Each coordinate value is multiplied by 1 million to get the argument
            /// value to carry precision of 6 decimals.
            pub fn sendTargetPrimaries(_image_description_info_v1: *ImageDescriptionInfoV1, _r_x: i32, _r_y: i32, _g_x: i32, _g_y: i32, _b_x: i32, _b_y: i32, _w_x: i32, _w_y: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .i = _r_x },
                    .{ .i = _r_y },
                    .{ .i = _g_x },
                    .{ .i = _g_y },
                    .{ .i = _b_x },
                    .{ .i = _b_y },
                    .{ .i = _w_x },
                    .{ .i = _w_y },
                };
                _resource.postEvent(7, &_args);
            }
            pub const target_primaries_since_version = 1;

            /// Provides the luminance range that the image description is targeting as
            /// the minimum and maximum absolute luminance L. These values include the
            /// minimum display emission and ambient flare luminances, assumed to be
            /// optically additive and have the chromaticity of the primary color
            /// volume white point. This should be compatible with the SMPTE ST 2086
            /// definition of HDR static metadata.
            ///
            /// This luminance range is only theoretical and may not correspond to the
            /// luminance of light emitted on an actual display.
            ///
            /// Min L value is multiplied by 10000 to get the argument min_lum value and
            /// carry precision of 4 decimals. Max L value is unscaled for max_lum.
            pub fn sendTargetLuminance(_image_description_info_v1: *ImageDescriptionInfoV1, _min_lum: u32, _max_lum: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = _min_lum },
                    .{ .u = _max_lum },
                };
                _resource.postEvent(8, &_args);
            }
            pub const target_luminance_since_version = 1;

            /// Provides the targeted max_cll of the image description. max_cll is
            /// defined by CTA-861-H.
            ///
            /// This luminance is only theoretical and may not correspond to the
            /// luminance of light emitted on an actual display.
            pub fn sendTargetMaxCll(_image_description_info_v1: *ImageDescriptionInfoV1, _max_cll: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = _max_cll },
                };
                _resource.postEvent(9, &_args);
            }
            pub const target_max_cll_since_version = 1;

            /// Provides the targeted max_fall of the image description. max_fall is
            /// defined by CTA-861-H.
            ///
            /// This luminance is only theoretical and may not correspond to the
            /// luminance of light emitted on an actual display.
            pub fn sendTargetMaxFall(_image_description_info_v1: *ImageDescriptionInfoV1, _max_fall: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_info_v1);
                var _args = [_]common.Argument{
                    .{ .u = _max_fall },
                };
                _resource.postEvent(10, &_args);
            }
            pub const target_max_fall_since_version = 1;
        };

        /// A wp_color_management_surface_v1 allows the client to set the color
        /// space and HDR properties of a surface.
        ///
        /// If the wl_surface associated with the wp_color_management_surface_v1 is
        /// destroyed, the wp_color_management_surface_v1 object becomes inert.
        pub const ColorManagementSurfaceV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_surface_v1.interface;
            pub const Error = common.wp.color_management_surface_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorManagementSurfaceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorManagementSurfaceV1, _version, _id));
            }
            pub inline fn destroy(_color_management_surface_v1: *ColorManagementSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorManagementSurfaceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_management_surface_v1: *ColorManagementSurfaceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).getLink();
            }
            pub inline fn getClient(_color_management_surface_v1: *ColorManagementSurfaceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).getClient();
            }
            pub inline fn getId(_color_management_surface_v1: *ColorManagementSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).getId();
            }
            pub inline fn getVersion(_color_management_surface_v1: *ColorManagementSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_management_surface_v1: *ColorManagementSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_management_surface_v1: *ColorManagementSurfaceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).getUserData();
            }
            pub inline fn postError(_color_management_surface_v1: *ColorManagementSurfaceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_image_description_since_version = 1;
                pub const unset_image_description_since_version = 1;

                /// Destroy the wp_color_management_surface_v1 object and do the same as
                /// unset_image_description.
                destroy: void,
                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// Set the image description of the underlying surface. The image
                /// description and rendering intent are double-buffered state, see
                /// wl_surface.commit.
                ///
                /// It is the client's responsibility to understand the image description
                /// it sets on a surface, and to provide content that matches that image
                /// description. Compositors might convert images to match their own or any
                /// other image descriptions.
                ///
                /// Image descriptions which are not ready (see wp_image_description_v1)
                /// are forbidden in this request, and in such case the protocol error
                /// image_description is raised.
                ///
                /// All image descriptions which are ready (see wp_image_description_v1)
                /// are allowed and must always be accepted by the compositor.
                ///
                /// When an image description is set on a surface, it establishes an
                /// explicit link between surface pixel values and surface colorimetry.
                /// This link may be undefined for some pixel values, see the image
                /// description creator interfaces for the conditions. Non-finite
                /// floating-point values (NaN, Inf) always have an undefined colorimetry.
                ///
                /// A rendering intent provides the client's preference on how surface
                /// colorimetry should be mapped to each output. The render_intent value
                /// must be one advertised by the compositor with
                /// wp_color_manager_v1.render_intent event, otherwise the protocol error
                /// render_intent is raised.
                ///
                /// By default, a surface does not have an associated image description
                /// nor a rendering intent. The handling of color on such surfaces is
                /// compositor implementation defined. Compositors should handle such
                /// surfaces as sRGB, but may handle them differently if they have specific
                /// requirements.
                ///
                /// Setting the image description has copy semantics; after this request,
                /// the image description can be immediately destroyed without affecting
                /// the pending state of the surface.
                set_image_description: struct {
                    image_description: *server.wp.ImageDescriptionV1,
                    render_intent: common.wp.color_manager_v1.RenderIntent,
                },

                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// This request removes any image description from the surface. See
                /// set_image_description for how a compositor handles a surface without
                /// an image description. This is double-buffered state, see
                /// wl_surface.commit.
                unset_image_description: void,
            };
            pub inline fn setHandler(
                _color_management_surface_v1: *ColorManagementSurfaceV1,
                comptime T: type,
                handle_request: *const fn (_color_management_surface_v1: *ColorManagementSurfaceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_management_surface_v1: *ColorManagementSurfaceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_surface_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorManagementSurfaceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorManagementSurfaceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// A wp_color_management_surface_feedback_v1 allows the client to get the
        /// preferred image description of a surface.
        ///
        /// If the wl_surface associated with this object is destroyed, the
        /// wp_color_management_surface_feedback_v1 object becomes inert.
        pub const ColorManagementSurfaceFeedbackV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.color_management_surface_feedback_v1.interface;
            pub const Error = common.wp.color_management_surface_feedback_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorManagementSurfaceFeedbackV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorManagementSurfaceFeedbackV1, _version, _id));
            }
            pub inline fn destroy(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorManagementSurfaceFeedbackV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).getLink();
            }
            pub inline fn getClient(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).getClient();
            }
            pub inline fn getId(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).getId();
            }
            pub inline fn getVersion(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).getUserData();
            }
            pub inline fn postError(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_color_management_surface_feedback_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_preferred_since_version = 1;
                pub const get_preferred_parametric_since_version = 1;

                /// Destroy the wp_color_management_surface_feedback_v1 object.
                destroy: void,
                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// The preferred image description represents the compositor's preferred
                /// color encoding for this wl_surface at the current time. There might be
                /// performance and power advantages, as well as improved color
                /// reproduction, if the image description of a content update matches the
                /// preferred image description.
                ///
                /// This creates a new wp_image_description_v1 object for the currently
                /// preferred image description for the wl_surface. The client should
                /// stop using and destroy the image descriptions created by earlier
                /// invocations of this request for the associated wl_surface.
                /// This request is usually sent as a reaction to the preferred_changed
                /// event or when creating a wp_color_management_surface_feedback_v1 object
                /// if the client is capable of adapting to image descriptions.
                ///
                /// The created wp_image_description_v1 object preserves the preferred image
                /// description of the wl_surface from the time the object was created.
                ///
                /// The resulting image description object allows get_information request.
                ///
                /// If the image description is parametric, the client should set it on its
                /// wl_surface only if the image description is an exact match with the
                /// client content. Particularly if everything else matches, but the target
                /// color volume is greater than what the client needs, the client should
                /// create its own parameric image description with its exact parameters.
                ///
                /// If the interface version is inadequate for the preferred image
                /// description, meaning that the client does not support all the
                /// events needed to deliver the crucial information, the resulting image
                /// description object shall immediately deliver the
                /// wp_image_description_v1.failed event with the low_version cause,
                /// otherwise the object shall immediately deliver the ready event.
                get_preferred: struct {
                    image_description: u32,
                },

                /// The same description as for get_preferred applies, except the returned
                /// image description is guaranteed to be parametric. This is meant for
                /// clients that can only deal with parametric image descriptions.
                ///
                /// If the compositor doesn't support parametric image descriptions, the
                /// unsupported_feature error is emitted.
                get_preferred_parametric: struct {
                    image_description: u32,
                },
            };
            pub inline fn setHandler(
                _color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1,
                comptime T: type,
                handle_request: *const fn (_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_surface_feedback_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorManagementSurfaceFeedbackV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorManagementSurfaceFeedbackV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Starting from interface version 2, 'preferred_changed2' is sent instead
            /// of this event. See the 'preferred_changed2' event for the definition.
            pub fn sendPreferredChanged(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, _identity: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_surface_feedback_v1);
                var _args = [_]common.Argument{
                    .{ .u = _identity },
                };
                _resource.postEvent(0, &_args);
            }
            pub const preferred_changed_since_version = 1;

            /// The preferred image description is the one which likely has the most
            /// performance and/or quality benefits for the compositor if used by the
            /// client for its wl_surface contents. This event is sent whenever the
            /// compositor changes the wl_surface's preferred image description.
            ///
            /// This event sends the identity of the new preferred state as the argument,
            /// so clients who are aware of the image description already can reuse it.
            /// Otherwise, if the client client wants to know what the preferred image
            /// description is, it shall use the get_preferred request.
            ///
            /// The preferred image description is not automatically used for anything.
            /// It is only a hint, and clients may set any valid image description with
            /// set_image_description, but there might be performance and color accuracy
            /// improvements by providing the wl_surface contents in the preferred
            /// image description. Therefore clients that can, should render according
            /// to the preferred image description
            pub fn sendPreferredChanged2(_color_management_surface_feedback_v1: *ColorManagementSurfaceFeedbackV1, _identity_hi: u32, _identity_lo: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_management_surface_feedback_v1);
                var _args = [_]common.Argument{
                    .{ .u = _identity_hi },
                    .{ .u = _identity_lo },
                };
                _resource.postEvent(1, &_args);
            }
            pub const preferred_changed2_since_version = 2;
        };

        /// This type of object is used for collecting all the information required
        /// to create a wp_image_description_v1 object from an ICC file. A complete
        /// set of required parameters consists of these properties:
        /// - ICC file
        ///
        /// Each required property must be set exactly once if the client is to create
        /// an image description. The set requests verify that a property was not
        /// already set. The create request verifies that all required properties are
        /// set. There may be several alternative requests for setting each property,
        /// and in that case the client must choose one of them.
        ///
        /// Once all properties have been set, the create request must be used to
        /// create the image description object, destroying the creator in the
        /// process.
        ///
        /// The link between a pixel value (a device value in ICC) and its respective
        /// colorimetry is defined by the details of the particular ICC profile.
        /// Those details also determine when colorimetry becomes undefined.
        pub const ImageDescriptionCreatorIccV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_creator_icc_v1.interface;
            pub const Error = common.wp.image_description_creator_icc_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ImageDescriptionCreatorIccV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ImageDescriptionCreatorIccV1, _version, _id));
            }
            pub inline fn destroy(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ImageDescriptionCreatorIccV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).getLink();
            }
            pub inline fn getClient(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).getClient();
            }
            pub inline fn getId(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).getId();
            }
            pub inline fn getVersion(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).getVersion();
            }
            pub inline fn postNoMemory(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).postNoMemory();
            }
            pub inline fn getUserData(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).getUserData();
            }
            pub inline fn postError(_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_icc_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const create_since_version = 1;
                pub const set_icc_file_since_version = 1;

                /// Create an image description object based on the ICC information
                /// previously set on this object. A compositor must parse the ICC data in
                /// some undefined but finite amount of time.
                ///
                /// The completeness of the parameter set is verified. If the set is not
                /// complete, the protocol error incomplete_set is raised. For the
                /// definition of a complete set, see the description of this interface.
                ///
                /// If the particular combination of the information is not supported
                /// by the compositor, the resulting image description object shall
                /// immediately deliver the wp_image_description_v1.failed event with the
                /// 'unsupported' cause. If a valid image description was created from the
                /// information, the wp_image_description_v1.ready event will eventually
                /// be sent instead.
                ///
                /// This request destroys the wp_image_description_creator_icc_v1 object.
                ///
                /// The resulting image description object does not allow get_information
                /// request.
                create: struct {
                    image_description: u32,
                },

                /// Sets the ICC profile file to be used as the basis of the image
                /// description.
                ///
                /// The data shall be found through the given fd at the given offset, having
                /// the given length. The fd must be seekable and readable. Violating these
                /// requirements raises the bad_fd protocol error.
                ///
                /// If reading the data fails due to an error independent of the client, the
                /// compositor shall send the wp_image_description_v1.failed event on the
                /// created wp_image_description_v1 with the 'operating_system' cause.
                ///
                /// The maximum size of the ICC profile is 32 MB. If length is greater than
                /// that or zero, the protocol error bad_size is raised. If offset + length
                /// exceeds the file size, the protocol error out_of_file is raised.
                ///
                /// A compositor may read the file at any time starting from this request
                /// and only until whichever happens first:
                /// - If create request was issued, the wp_image_description_v1 object
                /// delivers either failed or ready event; or
                /// - if create request was not issued, this
                /// wp_image_description_creator_icc_v1 object is destroyed.
                ///
                /// A compositor shall not modify the contents of the file, and the fd may
                /// be sealed for writes and size changes. The client must ensure to its
                /// best ability that the data does not change while the compositor is
                /// reading it.
                ///
                /// The data must represent a valid ICC profile. The ICC profile version
                /// must be 2 or 4, it must be a 3 channel profile and the class must be
                /// Display or ColorSpace. Violating these requirements will not result in a
                /// protocol error, but will eventually send the
                /// wp_image_description_v1.failed event on the created
                /// wp_image_description_v1 with the 'unsupported' cause.
                ///
                /// See the International Color Consortium specification ICC.1:2022 for more
                /// details about ICC profiles.
                ///
                /// If ICC file has already been set on this object, the protocol error
                /// already_set is raised.
                set_icc_file: struct {
                    icc_profile: i32,
                    offset: u32,
                    length: u32,
                },
            };
            pub inline fn setHandler(
                _image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1,
                comptime T: type,
                handle_request: *const fn (_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_image_description_creator_icc_v1: *ImageDescriptionCreatorIccV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_creator_icc_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ImageDescriptionCreatorIccV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ImageDescriptionCreatorIccV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This type of object is used for collecting all the parameters required
        /// to create a wp_image_description_v1 object. A complete set of required
        /// parameters consists of these properties:
        /// - transfer characteristic function (tf)
        /// - chromaticities of primaries and white point (primary color volume)
        ///
        /// The following properties are optional and have a well-defined default
        /// if not explicitly set:
        /// - primary color volume luminance range
        /// - reference white luminance level
        /// - mastering display primaries and white point (target color volume)
        /// - mastering luminance range
        ///
        /// The following properties are optional and will be ignored
        /// if not explicitly set:
        /// - maximum content light level
        /// - maximum frame-average light level
        ///
        /// Each required property must be set exactly once if the client is to create
        /// an image description. The set requests verify that a property was not
        /// already set. The create request verifies that all required properties are
        /// set. There may be several alternative requests for setting each property,
        /// and in that case the client must choose one of them.
        ///
        /// Once all properties have been set, the create request must be used to
        /// create the image description object, destroying the creator in the
        /// process.
        ///
        /// A viewer, who is viewing the display defined by the resulting image
        /// description (the viewing environment included), is assumed to be fully
        /// adapted to the primary color volume's white point.
        ///
        /// Any of the following conditions will cause the colorimetry of a pixel
        /// to become undefined:
        /// - Values outside of the defined range of the transfer characteristic.
        /// - Tristimulus that exceeds the target color volume.
        /// - If extended_target_volume is not supported: tristimulus that exceeds
        /// the primary color volume.
        ///
        /// The closest correspondence to an image description created through this
        /// interface is the Display class of profiles in ICC.
        pub const ImageDescriptionCreatorParamsV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.wp.image_description_creator_params_v1.interface;
            pub const Error = common.wp.image_description_creator_params_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ImageDescriptionCreatorParamsV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ImageDescriptionCreatorParamsV1, _version, _id));
            }
            pub inline fn destroy(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ImageDescriptionCreatorParamsV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).getLink();
            }
            pub inline fn getClient(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).getClient();
            }
            pub inline fn getId(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).getId();
            }
            pub inline fn getVersion(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).getVersion();
            }
            pub inline fn postNoMemory(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).postNoMemory();
            }
            pub inline fn getUserData(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).getUserData();
            }
            pub inline fn postError(_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_image_description_creator_params_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const create_since_version = 1;
                pub const set_tf_named_since_version = 1;
                pub const set_tf_power_since_version = 1;
                pub const set_primaries_named_since_version = 1;
                pub const set_primaries_since_version = 1;
                pub const set_luminances_since_version = 1;
                pub const set_mastering_display_primaries_since_version = 1;
                pub const set_mastering_luminance_since_version = 1;
                pub const set_max_cll_since_version = 1;
                pub const set_max_fall_since_version = 1;

                /// Create an image description object based on the parameters previously
                /// set on this object.
                ///
                /// The completeness of the parameter set is verified. If the set is not
                /// complete, the protocol error incomplete_set is raised. For the
                /// definition of a complete set, see the description of this interface.
                ///
                /// When both max_cll and max_fall are set, max_fall must be less or equal
                /// to max_cll otherwise the invalid_luminance protocol error is raised.
                ///
                /// In version 1, these following conditions also result in the
                /// invalid_luminance protocol error. Version 2 and later do not have this
                /// requirement.
                /// - When max_cll is set, it must be greater than min L and less or equal
                /// to max L of the mastering luminance range.
                /// - When max_fall is set, it must be greater than min L and less or equal
                /// to max L of the mastering luminance range.
                ///
                /// If the particular combination of the parameter set is not supported
                /// by the compositor, the resulting image description object shall
                /// immediately deliver the wp_image_description_v1.failed event with the
                /// 'unsupported' cause. If a valid image description was created from the
                /// parameter set, the wp_image_description_v1.ready event will eventually
                /// be sent instead.
                ///
                /// This request destroys the wp_image_description_creator_params_v1
                /// object.
                ///
                /// The resulting image description object does not allow get_information
                /// request.
                create: struct {
                    image_description: u32,
                },

                /// Sets the transfer characteristic using explicitly enumerated named
                /// functions.
                ///
                /// When the resulting image description is attached to an image, the
                /// content should be decoded according to the industry standard
                /// practices for the transfer characteristic.
                ///
                /// Only names advertised with wp_color_manager_v1 event supported_tf_named
                /// are allowed. Other values shall raise the protocol error invalid_tf.
                ///
                /// If transfer characteristic has already been set on this object, the
                /// protocol error already_set is raised.
                set_tf_named: struct {
                    tf: common.wp.color_manager_v1.TransferFunction,
                },

                /// Sets the color component transfer characteristic to a power curve with
                /// the given exponent. Negative values are handled by mirroring the
                /// positive half of the curve through the origin. The valid domain and
                /// range of the curve are all finite real numbers. This curve represents
                /// the conversion from electrical to optical color channel values.
                ///
                /// The curve exponent shall be multiplied by 10000 to get the argument eexp
                /// value to carry the precision of 4 decimals.
                ///
                /// The curve exponent must be at least 1.0 and at most 10.0. Otherwise the
                /// protocol error invalid_tf is raised.
                ///
                /// If transfer characteristic has already been set on this object, the
                /// protocol error already_set is raised.
                ///
                /// This request can be used when the compositor advertises
                /// wp_color_manager_v1.feature.set_tf_power. Otherwise this request raises
                /// the protocol error unsupported_feature.
                set_tf_power: struct {
                    eexp: u32,
                },

                /// Sets the color primaries and white point using explicitly named sets.
                /// This describes the primary color volume which is the basis for color
                /// value encoding.
                ///
                /// Only names advertised with wp_color_manager_v1 event
                /// supported_primaries_named are allowed. Other values shall raise the
                /// protocol error invalid_primaries_named.
                ///
                /// If primaries have already been set on this object, the protocol error
                /// already_set is raised.
                set_primaries_named: struct {
                    primaries: common.wp.color_manager_v1.Primaries,
                },

                /// Sets the color primaries and white point using CIE 1931 xy chromaticity
                /// coordinates. This describes the primary color volume which is the basis
                /// for color value encoding.
                ///
                /// Each coordinate value is multiplied by 1 million to get the argument
                /// value to carry precision of 6 decimals.
                ///
                /// If primaries have already been set on this object, the protocol error
                /// already_set is raised.
                ///
                /// This request can be used if the compositor advertises
                /// wp_color_manager_v1.feature.set_primaries. Otherwise this request raises
                /// the protocol error unsupported_feature.
                set_primaries: struct {
                    r_x: i32,
                    r_y: i32,
                    g_x: i32,
                    g_y: i32,
                    b_x: i32,
                    b_y: i32,
                    w_x: i32,
                    w_y: i32,
                },

                /// Sets the primary color volume luminance range and the reference white
                /// luminance level. These values include the minimum display emission, but
                /// not external flare. The minimum display emission is assumed to have
                /// the chromaticity of the primary color volume white point.
                ///
                /// The default luminances from
                /// https://www.color.org/chardata/rgb/srgb.xalter are
                /// - primary color volume minimum: 0.2 cd/m²
                /// - primary color volume maximum: 80 cd/m²
                /// - reference white: 80 cd/m²
                ///
                /// Setting a named transfer characteristic can imply other default
                /// luminances.
                ///
                /// The default luminances get overwritten when this request is used.
                /// With transfer_function.st2084_pq the given 'max_lum' value is ignored,
                /// and 'max_lum' is taken as 'min_lum' + 10000 cd/m².
                ///
                /// 'min_lum' and 'max_lum' specify the minimum and maximum luminances of
                /// the primary color volume as reproduced by the targeted display.
                ///
                /// 'reference_lum' specifies the luminance of the reference white as
                /// reproduced by the targeted display, and reflects the targeted viewing
                /// environment.
                ///
                /// Compositors should make sure that all content is anchored, meaning that
                /// an input signal level of 'reference_lum' on one image description and
                /// another input signal level of 'reference_lum' on another image
                /// description should produce the same output level, even though the
                /// 'reference_lum' on both image representations can be different.
                ///
                /// 'reference_lum' may be higher than 'max_lum'. In that case reaching
                /// the reference white output level in image content requires the
                /// 'extended_target_volume' feature support.
                ///
                /// If 'max_lum' or 'reference_lum' are less than or equal to 'min_lum',
                /// the protocol error invalid_luminance is raised.
                ///
                /// The minimum luminance is multiplied by 10000 to get the argument
                /// 'min_lum' value and carries precision of 4 decimals. The maximum
                /// luminance and reference white luminance values are unscaled.
                ///
                /// If the primary color volume luminance range and the reference white
                /// luminance level have already been set on this object, the protocol error
                /// already_set is raised.
                ///
                /// This request can be used if the compositor advertises
                /// wp_color_manager_v1.feature.set_luminances. Otherwise this request
                /// raises the protocol error unsupported_feature.
                set_luminances: struct {
                    min_lum: u32,
                    max_lum: u32,
                    reference_lum: u32,
                },

                /// Provides the color primaries and white point of the mastering display
                /// using CIE 1931 xy chromaticity coordinates. This is compatible with the
                /// SMPTE ST 2086 definition of HDR static metadata.
                ///
                /// The mastering display primaries and mastering display luminances define
                /// the target color volume.
                ///
                /// If mastering display primaries are not explicitly set, the target color
                /// volume is assumed to have the same primaries as the primary color volume.
                ///
                /// The target color volume is defined by all tristimulus values between 0.0
                /// and 1.0 (inclusive) of the color space defined by the given mastering
                /// display primaries and white point. The colorimetry is identical between
                /// the container color space and the mastering display color space,
                /// including that no chromatic adaptation is applied even if the white
                /// points differ.
                ///
                /// The target color volume can exceed the primary color volume to allow for
                /// a greater color volume with an existing color space definition (for
                /// example scRGB). It can be smaller than the primary color volume to
                /// minimize gamut and tone mapping distances for big color spaces (HDR
                /// metadata).
                ///
                /// To make use of the entire target color volume a suitable pixel format
                /// has to be chosen (e.g. floating point to exceed the primary color
                /// volume, or abusing limited quantization range as with xvYCC).
                ///
                /// Each coordinate value is multiplied by 1 million to get the argument
                /// value to carry precision of 6 decimals.
                ///
                /// If mastering display primaries have already been set on this object, the
                /// protocol error already_set is raised.
                ///
                /// This request can be used if the compositor advertises
                /// wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
                /// this request raises the protocol error unsupported_feature. The
                /// advertisement implies support only for target color volumes fully
                /// contained within the primary color volume.
                ///
                /// If a compositor additionally supports target color volume exceeding the
                /// primary color volume, it must advertise
                /// wp_color_manager_v1.feature.extended_target_volume. If a client uses
                /// target color volume exceeding the primary color volume and the
                /// compositor does not support it, the result is implementation defined.
                /// Compositors are recommended to detect this case and fail the image
                /// description gracefully, but it may as well result in color artifacts.
                set_mastering_display_primaries: struct {
                    r_x: i32,
                    r_y: i32,
                    g_x: i32,
                    g_y: i32,
                    b_x: i32,
                    b_y: i32,
                    w_x: i32,
                    w_y: i32,
                },

                /// Sets the luminance range that was used during the content mastering
                /// process as the minimum and maximum absolute luminance L. These values
                /// include the minimum display emission and ambient flare luminances,
                /// assumed to be optically additive and have the chromaticity of the
                /// primary color volume white point. This should be
                /// compatible with the SMPTE ST 2086 definition of HDR static metadata.
                ///
                /// The mastering display primaries and mastering display luminances define
                /// the target color volume.
                ///
                /// If mastering luminances are not explicitly set, the target color volume
                /// is assumed to have the same min and max luminances as the primary color
                /// volume.
                ///
                /// If max L is less than or equal to min L, the protocol error
                /// invalid_luminance is raised.
                ///
                /// Min L value is multiplied by 10000 to get the argument min_lum value
                /// and carry precision of 4 decimals. Max L value is unscaled for max_lum.
                ///
                /// This request can be used if the compositor advertises
                /// wp_color_manager_v1.feature.set_mastering_display_primaries. Otherwise
                /// this request raises the protocol error unsupported_feature. The
                /// advertisement implies support only for target color volumes fully
                /// contained within the primary color volume.
                ///
                /// If a compositor additionally supports target color volume exceeding the
                /// primary color volume, it must advertise
                /// wp_color_manager_v1.feature.extended_target_volume. If a client uses
                /// target color volume exceeding the primary color volume and the
                /// compositor does not support it, the result is implementation defined.
                /// Compositors are recommended to detect this case and fail the image
                /// description gracefully, but it may as well result in color artifacts.
                set_mastering_luminance: struct {
                    min_lum: u32,
                    max_lum: u32,
                },

                /// Sets the maximum content light level (max_cll) as defined by CTA-861-H.
                ///
                /// max_cll is undefined by default.
                set_max_cll: struct {
                    max_cll: u32,
                },

                /// Sets the maximum frame-average light level (max_fall) as defined by
                /// CTA-861-H.
                ///
                /// max_fall is undefined by default.
                set_max_fall: struct {
                    max_fall: u32,
                },
            };
            pub inline fn setHandler(
                _image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1,
                comptime T: type,
                handle_request: *const fn (_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_image_description_creator_params_v1: *ImageDescriptionCreatorParamsV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_image_description_creator_params_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ImageDescriptionCreatorParamsV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ImageDescriptionCreatorParamsV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// A singleton global interface used for getting color representation
        /// extensions for wl_surface. The extension interfaces allow setting the
        /// color representation of surfaces.
        ///
        /// Compositors should never remove this global.
        pub const ColorRepresentationManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.color_representation_manager_v1.interface;
            pub const Error = common.wp.color_representation_manager_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorRepresentationManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorRepresentationManagerV1, _version, _id));
            }
            pub inline fn destroy(_color_representation_manager_v1: *ColorRepresentationManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorRepresentationManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_representation_manager_v1: *ColorRepresentationManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).getLink();
            }
            pub inline fn getClient(_color_representation_manager_v1: *ColorRepresentationManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).getClient();
            }
            pub inline fn getId(_color_representation_manager_v1: *ColorRepresentationManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).getId();
            }
            pub inline fn getVersion(_color_representation_manager_v1: *ColorRepresentationManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_representation_manager_v1: *ColorRepresentationManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_representation_manager_v1: *ColorRepresentationManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).getUserData();
            }
            pub inline fn postError(_color_representation_manager_v1: *ColorRepresentationManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_surface_since_version = 1;

                /// Destroy the wp_color_representation_manager_v1 object. This does not
                /// affect any other objects in any way.
                destroy: void,
                /// If a wp_color_representation_surface_v1 object already exists for the
                /// given wl_surface, the protocol error surface_exists is raised.
                ///
                /// This creates a new color wp_color_representation_surface_v1 object for
                /// the given wl_surface.
                ///
                /// See the wp_color_representation_surface_v1 interface for more details.
                get_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },
            };
            pub inline fn setHandler(
                _color_representation_manager_v1: *ColorRepresentationManagerV1,
                comptime T: type,
                handle_request: *const fn (_color_representation_manager_v1: *ColorRepresentationManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_representation_manager_v1: *ColorRepresentationManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_representation_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorRepresentationManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorRepresentationManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// When this object is created, it shall immediately send this event once
            /// for each alpha mode the compositor supports.
            ///
            /// For the definition of the supported values, see the
            /// wp_color_representation_surface_v1::alpha_mode enum.
            pub fn sendSupportedAlphaMode(_color_representation_manager_v1: *ColorRepresentationManagerV1, _alpha_mode: common.wp.color_representation_surface_v1.AlphaMode) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_representation_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_representation_surface_v1.AlphaMode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_alpha_mode))),
                        .@"struct" => @bitCast(_alpha_mode),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const supported_alpha_mode_since_version = 1;

            /// When this object is created, it shall immediately send this event once
            /// for each matrix coefficient and color range combination the compositor
            /// supports.
            ///
            /// For the definition of the supported values, see the
            /// wp_color_representation_surface_v1::coefficients and
            /// wp_color_representation_surface_v1::range enums.
            pub fn sendSupportedCoefficientsAndRanges(_color_representation_manager_v1: *ColorRepresentationManagerV1, _coefficients: common.wp.color_representation_surface_v1.Coefficients, _range: common.wp.color_representation_surface_v1.Range) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_representation_manager_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.wp.color_representation_surface_v1.Coefficients)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_coefficients))),
                        .@"struct" => @bitCast(_coefficients),
                        else => unreachable,
                    } },
                    .{ .u = switch (@typeInfo(common.wp.color_representation_surface_v1.Range)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_range))),
                        .@"struct" => @bitCast(_range),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(1, &_args);
            }
            pub const supported_coefficients_and_ranges_since_version = 1;

            /// This event is sent when all supported features have been sent.
            pub fn sendDone(_color_representation_manager_v1: *ColorRepresentationManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_representation_manager_v1);
                _resource.postEvent(2, null);
            }
            pub const done_since_version = 1;
        };

        /// A wp_color_representation_surface_v1 allows the client to set the color
        /// representation metadata of a surface.
        ///
        /// By default, a surface does not have any color representation metadata set.
        /// The reconstruction of R, G, B signals on such surfaces is compositor
        /// implementation defined. The alpha mode is assumed to be
        /// premultiplied_electrical when the alpha mode is unset.
        ///
        /// If the wl_surface associated with the wp_color_representation_surface_v1
        /// is destroyed, the wp_color_representation_surface_v1 object becomes inert.
        pub const ColorRepresentationSurfaceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.color_representation_surface_v1.interface;
            pub const Error = common.wp.color_representation_surface_v1.Error;
            pub const AlphaMode = common.wp.color_representation_surface_v1.AlphaMode;
            pub const Coefficients = common.wp.color_representation_surface_v1.Coefficients;
            pub const Range = common.wp.color_representation_surface_v1.Range;
            pub const ChromaLocation = common.wp.color_representation_surface_v1.ChromaLocation;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ColorRepresentationSurfaceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ColorRepresentationSurfaceV1, _version, _id));
            }
            pub inline fn destroy(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ColorRepresentationSurfaceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).getLink();
            }
            pub inline fn getClient(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).getClient();
            }
            pub inline fn getId(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).getId();
            }
            pub inline fn getVersion(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).getVersion();
            }
            pub inline fn postNoMemory(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).postNoMemory();
            }
            pub inline fn getUserData(_color_representation_surface_v1: *ColorRepresentationSurfaceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).getUserData();
            }
            pub inline fn postError(_color_representation_surface_v1: *ColorRepresentationSurfaceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_color_representation_surface_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_alpha_mode_since_version = 1;
                pub const set_coefficients_and_range_since_version = 1;
                pub const set_chroma_location_since_version = 1;

                /// Destroy the wp_color_representation_surface_v1 object.
                ///
                /// Destroying this object unsets all the color representation metadata from
                /// the surface. See the wp_color_representation_surface_v1 interface
                /// description for how a compositor handles a surface without color
                /// representation metadata. Unsetting is double-buffered state, see
                /// wl_surface.commit.
                destroy: void,
                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// Assuming an alpha channel exists, it is always linear. The alpha mode
                /// determines whether and how the color channels include pre-multiplied
                /// alpha. Using straight alpha might have performance benefits.
                ///
                /// Only alpha modes advertised by the compositor are allowed to be used as
                /// argument for this request. The "alpha_mode" protocol error is raised
                /// otherwise.
                ///
                /// Alpha mode is double buffered, see wl_surface.commit.
                set_alpha_mode: struct {
                    alpha_mode: AlphaMode,
                },

                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// Set the matrix coefficients and video range which defines the formula
                /// and the related constants used to derive red, green and blue signals.
                /// Usually coefficients correspond to MatrixCoefficients code points in
                /// H.273.
                ///
                /// Only combinations advertised by the compositor are allowed to be used as
                /// argument for this request. The "coefficients" protocol error is raised
                /// otherwise.
                ///
                /// A call to wl_surface.commit verifies that the pixel format and the
                /// coefficients-range combination in the committed surface contents are
                /// compatible, if contents exist. The "pixel_format" protocol error is
                /// raised otherwise.
                ///
                /// A pixel format is compatible with the coefficients-range combination if
                /// the related equations and conventions as defined in H.273 can produce
                /// the color channels (RGB or YCbCr) of the pixel format.
                ///
                /// For the definition of the supported combination, see the
                /// wp_color_representation_surface_v1::coefficients and
                /// wp_color_representation_surface_v1::range enums.
                ///
                /// The coefficients-range combination is double-buffered, see
                /// wl_surface.commit.
                set_coefficients_and_range: struct {
                    coefficients: Coefficients,
                    range: Range,
                },

                /// If this protocol object is inert, the protocol error inert is raised.
                ///
                /// Set the chroma location type which defines the position of downsampled
                /// chroma samples, corresponding to Chroma420SampleLocType code points in
                /// H.273.
                ///
                /// An invalid chroma location enum value raises the "chroma_location"
                /// protocol error.
                ///
                /// A call to wl_surface.commit verifies that the pixel format and chroma
                /// location type in the committed surface contents are compatible, if
                /// contents exist. The "pixel_format" protocol error is raised otherwise.
                ///
                /// For the definition of the supported chroma location types, see the
                /// wp_color_representation_surface_v1::chroma_location enum.
                ///
                /// The chroma location type is double-buffered, see wl_surface.commit.
                set_chroma_location: struct {
                    chroma_location: ChromaLocation,
                },
            };
            pub inline fn setHandler(
                _color_representation_surface_v1: *ColorRepresentationSurfaceV1,
                comptime T: type,
                handle_request: *const fn (_color_representation_surface_v1: *ColorRepresentationSurfaceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_color_representation_surface_v1: *ColorRepresentationSurfaceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_color_representation_surface_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ColorRepresentationSurfaceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ColorRepresentationSurfaceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This global offers an alternative, optional way to set cursor images. This
        /// new way uses enumerated cursors instead of a wl_surface like
        /// wl_pointer.set_cursor does.
        ///
        /// 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.
        pub const CursorShapeManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.cursor_shape_manager_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*CursorShapeManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, CursorShapeManagerV1, _version, _id));
            }
            pub inline fn destroy(_cursor_shape_manager_v1: *CursorShapeManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *CursorShapeManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_cursor_shape_manager_v1: *CursorShapeManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).getLink();
            }
            pub inline fn getClient(_cursor_shape_manager_v1: *CursorShapeManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).getClient();
            }
            pub inline fn getId(_cursor_shape_manager_v1: *CursorShapeManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).getId();
            }
            pub inline fn getVersion(_cursor_shape_manager_v1: *CursorShapeManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_cursor_shape_manager_v1: *CursorShapeManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_cursor_shape_manager_v1: *CursorShapeManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_manager_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_pointer_since_version = 1;
                pub const get_tablet_tool_v2_since_version = 1;

                /// Destroy the cursor shape manager.
                destroy: void,
                /// Obtain a wp_cursor_shape_device_v1 for a wl_pointer object.
                ///
                /// When the pointer capability is removed from the wl_seat, the
                /// wp_cursor_shape_device_v1 object becomes inert.
                get_pointer: struct {
                    cursor_shape_device: u32,
                    pointer: *server.wl.Pointer,
                },

                /// Obtain a wp_cursor_shape_device_v1 for a zwp_tablet_tool_v2 object.
                ///
                /// When the zwp_tablet_tool_v2 is removed, the wp_cursor_shape_device_v1
                /// object becomes inert.
                get_tablet_tool_v2: struct {
                    cursor_shape_device: u32,
                    tablet_tool: *server.zwp.TabletToolV2,
                },
            };
            pub inline fn setHandler(
                _cursor_shape_manager_v1: *CursorShapeManagerV1,
                comptime T: type,
                handle_request: *const fn (_cursor_shape_manager_v1: *CursorShapeManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_cursor_shape_manager_v1: *CursorShapeManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_cursor_shape_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(CursorShapeManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*CursorShapeManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This interface allows clients to set the cursor shape.
        pub const CursorShapeDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.cursor_shape_device_v1.interface;
            pub const Shape = common.wp.cursor_shape_device_v1.Shape;
            pub const Error = common.wp.cursor_shape_device_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*CursorShapeDeviceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, CursorShapeDeviceV1, _version, _id));
            }
            pub inline fn destroy(_cursor_shape_device_v1: *CursorShapeDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *CursorShapeDeviceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_cursor_shape_device_v1: *CursorShapeDeviceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).getLink();
            }
            pub inline fn getClient(_cursor_shape_device_v1: *CursorShapeDeviceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).getClient();
            }
            pub inline fn getId(_cursor_shape_device_v1: *CursorShapeDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).getId();
            }
            pub inline fn getVersion(_cursor_shape_device_v1: *CursorShapeDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).getVersion();
            }
            pub inline fn postNoMemory(_cursor_shape_device_v1: *CursorShapeDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).postNoMemory();
            }
            pub inline fn getUserData(_cursor_shape_device_v1: *CursorShapeDeviceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).getUserData();
            }
            pub inline fn postError(_cursor_shape_device_v1: *CursorShapeDeviceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_cursor_shape_device_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_shape_since_version = 1;

                /// Destroy the cursor shape device.
                ///
                /// The device cursor shape remains unchanged.
                destroy: void,
                /// Sets the device cursor to the specified shape. The compositor will
                /// change the cursor image based on the specified shape.
                ///
                /// The cursor actually changes only if the input device focus is one of
                /// the requesting client's surfaces. If any, the previous cursor image
                /// (surface or shape) is replaced.
                ///
                /// The "shape" argument must be a valid enum entry, otherwise the
                /// invalid_shape protocol error is raised.
                ///
                /// This is similar to the wl_pointer.set_cursor and
                /// zwp_tablet_tool_v2.set_cursor requests, but this request accepts a
                /// shape instead of contents in the form of a surface. Clients can mix
                /// set_cursor and set_shape requests.
                ///
                /// The serial parameter must match the latest wl_pointer.enter or
                /// zwp_tablet_tool_v2.proximity_in serial number sent to the client.
                /// Otherwise the request will be ignored.
                set_shape: struct {
                    serial: u32,
                    shape: Shape,
                },
            };
            pub inline fn setHandler(
                _cursor_shape_device_v1: *CursorShapeDeviceV1,
                comptime T: type,
                handle_request: *const fn (_cursor_shape_device_v1: *CursorShapeDeviceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_cursor_shape_device_v1: *CursorShapeDeviceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_cursor_shape_device_v1);
                _resource.setDispatcher(
                    common.Dispatcher(CursorShapeDeviceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*CursorShapeDeviceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// For some use cases like games or drawing tablets it can make sense to
        /// reduce latency by accepting tearing with the use of asynchronous page
        /// flips. This global is a factory interface, allowing clients to inform
        /// which type of presentation the content of their surfaces is suitable for.
        ///
        /// Graphics APIs like EGL or Vulkan, that manage the buffer queue and commits
        /// of a wl_surface themselves, are likely to be using this extension
        /// internally. If a client is using such an API for a wl_surface, it should
        /// not directly use this extension on that surface, to avoid raising a
        /// tearing_control_exists protocol error.
        ///
        /// 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.
        pub const TearingControlManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.tearing_control_manager_v1.interface;
            pub const Error = common.wp.tearing_control_manager_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TearingControlManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, TearingControlManagerV1, _version, _id));
            }
            pub inline fn destroy(_tearing_control_manager_v1: *TearingControlManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TearingControlManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tearing_control_manager_v1: *TearingControlManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).getLink();
            }
            pub inline fn getClient(_tearing_control_manager_v1: *TearingControlManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).getClient();
            }
            pub inline fn getId(_tearing_control_manager_v1: *TearingControlManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).getId();
            }
            pub inline fn getVersion(_tearing_control_manager_v1: *TearingControlManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_tearing_control_manager_v1: *TearingControlManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_tearing_control_manager_v1: *TearingControlManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).getUserData();
            }
            pub inline fn postError(_tearing_control_manager_v1: *TearingControlManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_tearing_control_since_version = 1;

                /// Destroy this tearing control factory object. Other objects, including
                /// wp_tearing_control_v1 objects created by this factory, are not affected
                /// by this request.
                destroy: void,
                /// Instantiate an interface extension for the given wl_surface to request
                /// asynchronous page flips for presentation.
                ///
                /// If the given wl_surface already has a wp_tearing_control_v1 object
                /// associated, the tearing_control_exists protocol error is raised.
                get_tearing_control: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },
            };
            pub inline fn setHandler(
                _tearing_control_manager_v1: *TearingControlManagerV1,
                comptime T: type,
                handle_request: *const fn (_tearing_control_manager_v1: *TearingControlManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tearing_control_manager_v1: *TearingControlManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tearing_control_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(TearingControlManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TearingControlManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An additional interface to a wl_surface object, which allows the client
        /// to hint to the compositor if the content on the surface is suitable for
        /// presentation with tearing.
        /// The default presentation hint is vsync. See presentation_hint for more
        /// details.
        ///
        /// If the associated wl_surface is destroyed, this object becomes inert and
        /// should be destroyed.
        pub const TearingControlV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.wp.tearing_control_v1.interface;
            pub const PresentationHint = common.wp.tearing_control_v1.PresentationHint;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*TearingControlV1 {
                return @ptrCast(try server.wl.Resource.create(_client, TearingControlV1, _version, _id));
            }
            pub inline fn destroy(_tearing_control_v1: *TearingControlV1) void {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *TearingControlV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_tearing_control_v1: *TearingControlV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).getLink();
            }
            pub inline fn getClient(_tearing_control_v1: *TearingControlV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).getClient();
            }
            pub inline fn getId(_tearing_control_v1: *TearingControlV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).getId();
            }
            pub inline fn getVersion(_tearing_control_v1: *TearingControlV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).getVersion();
            }
            pub inline fn postNoMemory(_tearing_control_v1: *TearingControlV1) void {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).postNoMemory();
            }
            pub inline fn getUserData(_tearing_control_v1: *TearingControlV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_tearing_control_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const set_presentation_hint_since_version = 1;
                pub const destroy_since_version = 1;

                /// Set the presentation hint for the associated wl_surface. This state is
                /// double-buffered, see wl_surface.commit.
                ///
                /// The compositor is free to dynamically respect or ignore this hint based
                /// on various conditions like hardware capabilities, surface state and
                /// user preferences.
                set_presentation_hint: struct {
                    hint: PresentationHint,
                },

                /// Destroy this surface tearing object and revert the presentation hint to
                /// vsync. The change will be applied on the next wl_surface.commit.
                destroy: void,
            };
            pub inline fn setHandler(
                _tearing_control_v1: *TearingControlV1,
                comptime T: type,
                handle_request: *const fn (_tearing_control_v1: *TearingControlV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_tearing_control_v1: *TearingControlV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_tearing_control_v1);
                _resource.setDispatcher(
                    common.Dispatcher(TearingControlV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*TearingControlV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };
    };
    pub const ext = struct {
        /// This interface is used to request that the session be locked.
        pub const SessionLockManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_manager_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*SessionLockManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, SessionLockManagerV1, _version, _id));
            }
            pub inline fn destroy(_session_lock_manager_v1: *SessionLockManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *SessionLockManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_session_lock_manager_v1: *SessionLockManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).getLink();
            }
            pub inline fn getClient(_session_lock_manager_v1: *SessionLockManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).getClient();
            }
            pub inline fn getId(_session_lock_manager_v1: *SessionLockManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_manager_v1: *SessionLockManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_session_lock_manager_v1: *SessionLockManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_session_lock_manager_v1: *SessionLockManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_manager_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const lock_since_version = 1;

                /// This informs the compositor that the session lock manager object will
                /// no longer be used. Existing objects created through this interface
                /// remain valid.
                destroy: void,
                /// This request creates a session lock and asks the compositor to lock the
                /// session. The compositor will send either the ext_session_lock_v1.locked
                /// or ext_session_lock_v1.finished event on the created object in
                /// response to this request.
                lock: struct {
                    id: u32,
                },
            };
            pub inline fn setHandler(
                _session_lock_manager_v1: *SessionLockManagerV1,
                comptime T: type,
                handle_request: *const fn (_session_lock_manager_v1: *SessionLockManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_session_lock_manager_v1: *SessionLockManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(SessionLockManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*SessionLockManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// In response to the creation of this object the compositor must send
        /// either the locked or finished event.
        ///
        /// The locked event indicates that the session is locked. This means
        /// that the compositor must stop rendering and providing input to normal
        /// clients. Instead the compositor must blank all outputs with an opaque
        /// color such that their normal content is fully hidden.
        ///
        /// The only surfaces that should be rendered while the session is locked
        /// are the lock surfaces created through this interface and optionally,
        /// at the compositor's discretion, special privileged surfaces such as
        /// input methods or portions of desktop shell UIs.
        ///
        /// The locked event must not be sent until a new "locked" frame (either
        /// from a session lock surface or the compositor blanking the output) has
        /// been presented on all outputs and no security sensitive normal/unlocked
        /// content is possibly visible.
        ///
        /// The finished event should be sent immediately on creation of this
        /// object if the compositor decides that the locked event will not be sent.
        ///
        /// The compositor may wait for the client to create and render session lock
        /// surfaces before sending the locked event to avoid displaying intermediate
        /// blank frames. However, it must impose a reasonable time limit if
        /// waiting and send the locked event as soon as the hard requirements
        /// described above can be met if the time limit expires. Clients should
        /// immediately create lock surfaces for all outputs on creation of this
        /// object to make this possible.
        ///
        /// This behavior of the locked event is required in order to prevent
        /// possible race conditions with clients that wish to suspend the system
        /// or similar after locking the session. Without these semantics, clients
        /// triggering a suspend after receiving the locked event would race with
        /// the first "locked" frame being presented and normal/unlocked frames
        /// might be briefly visible as the system is resumed if the suspend
        /// operation wins the race.
        ///
        /// If the client dies while the session is locked, the compositor must not
        /// unlock the session in response. It is acceptable for the session to be
        /// permanently locked if this happens. The compositor may choose to continue
        /// to display the lock surfaces the client had mapped before it died or
        /// alternatively fall back to a solid color, this is compositor policy.
        ///
        /// Compositors may also allow a secure way to recover the session, the
        /// details of this are compositor policy. Compositors may allow a new
        /// client to create a ext_session_lock_v1 object and take responsibility
        /// for unlocking the session, they may even start a new lock client
        /// instance automatically.
        pub const SessionLockV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_v1.interface;
            pub const Error = common.ext.session_lock_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*SessionLockV1 {
                return @ptrCast(try server.wl.Resource.create(_client, SessionLockV1, _version, _id));
            }
            pub inline fn destroy(_session_lock_v1: *SessionLockV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *SessionLockV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_session_lock_v1: *SessionLockV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).getLink();
            }
            pub inline fn getClient(_session_lock_v1: *SessionLockV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).getClient();
            }
            pub inline fn getId(_session_lock_v1: *SessionLockV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_v1: *SessionLockV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).getVersion();
            }
            pub inline fn postNoMemory(_session_lock_v1: *SessionLockV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).postNoMemory();
            }
            pub inline fn getUserData(_session_lock_v1: *SessionLockV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).getUserData();
            }
            pub inline fn postError(_session_lock_v1: *SessionLockV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_lock_surface_since_version = 1;
                pub const unlock_and_destroy_since_version = 1;

                /// This informs the compositor that the lock object will no longer be
                /// used. Existing objects created through this interface remain valid.
                ///
                /// After this request is made, lock surfaces created through this object
                /// should be destroyed by the client as they will no longer be used by
                /// the compositor.
                ///
                /// It is a protocol error to make this request if the locked event was
                /// sent, the unlock_and_destroy request must be used instead.
                destroy: void,
                /// The client is expected to create lock surfaces for all outputs
                /// currently present and any new outputs as they are advertised. These
                /// won't be displayed by the compositor unless the lock is successful
                /// and the locked event is sent.
                ///
                /// Providing a wl_surface which already has a role or already has a buffer
                /// attached or committed is a protocol error, as is attaching/committing
                /// a buffer before the first ext_session_lock_surface_v1.configure event.
                ///
                /// Attempting to create more than one lock surface for a given output
                /// is a duplicate_output protocol error.
                get_lock_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                    output: *server.wl.Output,
                },

                /// This request indicates that the session should be unlocked, for
                /// example because the user has entered their password and it has been
                /// verified by the client.
                ///
                /// This request also informs the compositor that the lock object will
                /// no longer be used and should be destroyed. Existing objects created
                /// through this interface remain valid.
                ///
                /// After this request is made, lock surfaces created through this object
                /// should be destroyed by the client as they will no longer be used by
                /// the compositor.
                ///
                /// It is a protocol error to make this request if the locked event has
                /// not been sent. In that case, the lock object must be destroyed using
                /// the destroy request.
                ///
                /// Note that a correct client that wishes to exit directly after unlocking
                /// the session must use the wl_display.sync request to ensure the server
                /// receives and processes the unlock_and_destroy request. Otherwise
                /// there is no guarantee that the server has unlocked the session due
                /// to the asynchronous nature of the Wayland protocol. For example,
                /// the server might terminate the client with a protocol error before
                /// it processes the unlock_and_destroy request.
                unlock_and_destroy: void,
            };
            pub inline fn setHandler(
                _session_lock_v1: *SessionLockV1,
                comptime T: type,
                handle_request: *const fn (_session_lock_v1: *SessionLockV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_session_lock_v1: *SessionLockV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_v1);
                _resource.setDispatcher(
                    common.Dispatcher(SessionLockV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*SessionLockV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This client is now responsible for displaying graphics while the
            /// session is locked and deciding when to unlock the session.
            ///
            /// The locked event must not be sent until a new "locked" frame has been
            /// presented on all outputs and no security sensitive normal/unlocked
            /// content is possibly visible.
            ///
            /// If this event is sent, making the destroy request is a protocol error,
            /// the lock object must be destroyed using the unlock_and_destroy request.
            pub fn sendLocked(_session_lock_v1: *SessionLockV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_v1);
                _resource.postEvent(0, null);
            }
            pub const locked_since_version = 1;

            /// The compositor has decided that the session lock should be destroyed
            /// as it will no longer be used by the compositor. Exactly when this
            /// event is sent is compositor policy, but it must never be sent more
            /// than once for a given session lock object.
            ///
            /// This might be sent because there is already another ext_session_lock_v1
            /// object held by a client, or the compositor has decided to deny the
            /// request to lock the session for some other reason. This might also
            /// be sent because the compositor implements some alternative, secure
            /// way to authenticate and unlock the session.
            ///
            /// The finished event should be sent immediately on creation of this
            /// object if the compositor decides that the locked event will not
            /// be sent.
            ///
            /// If the locked event is sent on creation of this object the finished
            /// event may still be sent at some later time in this object's
            /// lifetime. This is compositor policy.
            ///
            /// Upon receiving this event, the client should make either the destroy
            /// request or the unlock_and_destroy request, depending on whether or
            /// not the locked event was received on this object.
            pub fn sendFinished(_session_lock_v1: *SessionLockV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_v1);
                _resource.postEvent(1, null);
            }
            pub const finished_since_version = 1;
        };

        /// The client may use lock surfaces to display a screensaver, render a
        /// dialog to enter a password and unlock the session, or however else it
        /// sees fit.
        ///
        /// On binding this interface the compositor will immediately send the
        /// first configure event. After making the ack_configure request in
        /// response to this event the client should attach and commit the first
        /// buffer. Committing the surface before acking the first configure is a
        /// protocol error. Committing the surface with a null buffer at any time
        /// is a protocol error.
        ///
        /// The compositor is free to handle keyboard/pointer focus for lock
        /// surfaces however it chooses. A reasonable way to do this would be to
        /// give the first lock surface created keyboard focus and change keyboard
        /// focus if the user clicks on other surfaces.
        pub const SessionLockSurfaceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.ext.session_lock_surface_v1.interface;
            pub const Error = common.ext.session_lock_surface_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*SessionLockSurfaceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, SessionLockSurfaceV1, _version, _id));
            }
            pub inline fn destroy(_session_lock_surface_v1: *SessionLockSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *SessionLockSurfaceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_session_lock_surface_v1: *SessionLockSurfaceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).getLink();
            }
            pub inline fn getClient(_session_lock_surface_v1: *SessionLockSurfaceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).getClient();
            }
            pub inline fn getId(_session_lock_surface_v1: *SessionLockSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).getId();
            }
            pub inline fn getVersion(_session_lock_surface_v1: *SessionLockSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).getVersion();
            }
            pub inline fn postNoMemory(_session_lock_surface_v1: *SessionLockSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).postNoMemory();
            }
            pub inline fn getUserData(_session_lock_surface_v1: *SessionLockSurfaceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).getUserData();
            }
            pub inline fn postError(_session_lock_surface_v1: *SessionLockSurfaceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_session_lock_surface_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const ack_configure_since_version = 1;

                /// This informs the compositor that the lock surface object will no
                /// longer be used.
                ///
                /// It is recommended for a lock client to destroy lock surfaces if
                /// their corresponding wl_output global is removed.
                ///
                /// If a lock surface on an active output is destroyed before the
                /// ext_session_lock_v1.unlock_and_destroy event is sent, the compositor
                /// must fall back to rendering a solid color.
                destroy: void,
                /// When a configure event is received, if a client commits the surface
                /// in response to the configure event, then the client must make an
                /// ack_configure request sometime before the commit request, passing
                /// along the serial of the configure event.
                ///
                /// If the client receives multiple configure events before it can
                /// respond to one, it only has to ack the last configure event.
                ///
                /// A client is not required to commit immediately after sending an
                /// ack_configure request - it may even ack_configure several times
                /// before its next surface commit.
                ///
                /// A client may send multiple ack_configure requests before committing,
                /// but only the last request sent before a commit indicates which
                /// configure event the client really is responding to.
                ///
                /// Sending an ack_configure request consumes the configure event
                /// referenced by the given serial, as well as all older configure events
                /// sent on this object.
                ///
                /// It is a protocol error to issue multiple ack_configure requests
                /// referencing the same configure event or to issue an ack_configure
                /// request referencing a configure event older than the last configure
                /// event acked for a given lock surface.
                ack_configure: struct {
                    serial: u32,
                },
            };
            pub inline fn setHandler(
                _session_lock_surface_v1: *SessionLockSurfaceV1,
                comptime T: type,
                handle_request: *const fn (_session_lock_surface_v1: *SessionLockSurfaceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_session_lock_surface_v1: *SessionLockSurfaceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_surface_v1);
                _resource.setDispatcher(
                    common.Dispatcher(SessionLockSurfaceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*SessionLockSurfaceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event is sent once on binding the interface and may be sent again
            /// at the compositor's discretion, for example if output geometry changes.
            ///
            /// The width and height are in surface-local coordinates and are exact
            /// requirements. Failing to match these surface dimensions in the next
            /// commit after acking a configure is a protocol error.
            pub fn sendConfigure(_session_lock_surface_v1: *SessionLockSurfaceV1, _serial: u32, _width: u32, _height: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_session_lock_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _width },
                    .{ .u = _height },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;
        };
    };
    pub const zxdg = struct {
        /// This interface allows a compositor to announce support for server-side
        /// decorations.
        ///
        /// A window decoration is a set of window controls as deemed appropriate by
        /// the party managing them, such as user interface components used to move,
        /// resize and change a window's state.
        ///
        /// A client can use this protocol to request being decorated by a supporting
        /// compositor.
        ///
        /// If compositor and client do not negotiate the use of a server-side
        /// decoration using this protocol, clients continue to self-decorate as they
        /// see fit.
        ///
        /// 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.
        pub const DecorationManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zxdg.decoration_manager_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DecorationManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, DecorationManagerV1, _version, _id));
            }
            pub inline fn destroy(_decoration_manager_v1: *DecorationManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DecorationManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_decoration_manager_v1: *DecorationManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).getLink();
            }
            pub inline fn getClient(_decoration_manager_v1: *DecorationManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).getClient();
            }
            pub inline fn getId(_decoration_manager_v1: *DecorationManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).getId();
            }
            pub inline fn getVersion(_decoration_manager_v1: *DecorationManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_decoration_manager_v1: *DecorationManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_decoration_manager_v1: *DecorationManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_decoration_manager_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_toplevel_decoration_since_version = 1;

                /// Destroy the decoration manager. This doesn't destroy objects created
                /// with the manager.
                destroy: void,
                /// Create a new decoration object associated with the given toplevel.
                ///
                /// For objects of version 1, creating an xdg_toplevel_decoration from an
                /// xdg_toplevel which has a buffer attached or committed is a client
                /// error, and any attempts by a client to attach or manipulate a buffer
                /// prior to the first xdg_toplevel_decoration.configure event must also be
                /// treated as errors.
                ///
                /// For objects of version 2 or newer, creating an xdg_toplevel_decoration
                /// from an xdg_toplevel which has a buffer attached or committed is
                /// allowed. The initial decoration mode of the surface if a buffer is
                /// already attached depends on whether a xdg_toplevel_decoration object
                /// has been associated with the surface or not prior to this request.
                ///
                /// If an xdg_toplevel_decoration was associated with the surface, then
                /// destroyed without a surface commit, the previous decoration mode is
                /// retained.
                ///
                /// If no xdg_toplevel_decoration was associated with the surface prior to
                /// this request, or if a surface commit has been performed after a previous
                /// xdg_toplevel_decoration object associated with the surface was
                /// destroyed, the decoration mode is assumed to be client-side.
                get_toplevel_decoration: struct {
                    id: u32,
                    toplevel: *server.xdg.Toplevel,
                },
            };
            pub inline fn setHandler(
                _decoration_manager_v1: *DecorationManagerV1,
                comptime T: type,
                handle_request: *const fn (_decoration_manager_v1: *DecorationManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_decoration_manager_v1: *DecorationManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_decoration_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(DecorationManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DecorationManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The decoration object allows the compositor to toggle server-side window
        /// decorations for a toplevel surface. The client can request to switch to
        /// another mode.
        ///
        /// The xdg_toplevel_decoration object must be destroyed before its
        /// xdg_toplevel.
        pub const ToplevelDecorationV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zxdg.toplevel_decoration_v1.interface;
            pub const Error = common.zxdg.toplevel_decoration_v1.Error;
            pub const Mode = common.zxdg.toplevel_decoration_v1.Mode;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ToplevelDecorationV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ToplevelDecorationV1, _version, _id));
            }
            pub inline fn destroy(_toplevel_decoration_v1: *ToplevelDecorationV1) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ToplevelDecorationV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_toplevel_decoration_v1: *ToplevelDecorationV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).getLink();
            }
            pub inline fn getClient(_toplevel_decoration_v1: *ToplevelDecorationV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).getClient();
            }
            pub inline fn getId(_toplevel_decoration_v1: *ToplevelDecorationV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).getId();
            }
            pub inline fn getVersion(_toplevel_decoration_v1: *ToplevelDecorationV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).getVersion();
            }
            pub inline fn postNoMemory(_toplevel_decoration_v1: *ToplevelDecorationV1) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).postNoMemory();
            }
            pub inline fn getUserData(_toplevel_decoration_v1: *ToplevelDecorationV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).getUserData();
            }
            pub inline fn postError(_toplevel_decoration_v1: *ToplevelDecorationV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_toplevel_decoration_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_mode_since_version = 1;
                pub const unset_mode_since_version = 1;

                /// Switch back to a mode without any server-side decorations at the next
                /// commit, unless a new xdg_toplevel_decoration is created for the surface
                /// first.
                destroy: void,
                /// Set the toplevel surface decoration mode. This informs the compositor
                /// that the client prefers the provided decoration mode.
                ///
                /// After requesting a decoration mode, the compositor will respond by
                /// emitting an xdg_surface.configure event. The client should then update
                /// its content, drawing it without decorations if the received mode is
                /// server-side decorations. The client must also acknowledge the configure
                /// when committing the new content (see xdg_surface.ack_configure).
                ///
                /// The compositor can decide not to use the client's mode and enforce a
                /// different mode instead.
                ///
                /// Clients whose decoration mode depend on the xdg_toplevel state may send
                /// a set_mode request in response to an xdg_surface.configure event and wait
                /// for the next xdg_surface.configure event to prevent unwanted state.
                /// Such clients are responsible for preventing configure loops and must
                /// make sure not to send multiple successive set_mode requests with the
                /// same decoration mode.
                ///
                /// If an invalid mode is supplied by the client, the invalid_mode protocol
                /// error is raised by the compositor.
                set_mode: struct {
                    mode: Mode,
                },

                /// Unset the toplevel surface decoration mode. This informs the compositor
                /// that the client doesn't prefer a particular decoration mode.
                ///
                /// This request has the same semantics as set_mode.
                unset_mode: void,
            };
            pub inline fn setHandler(
                _toplevel_decoration_v1: *ToplevelDecorationV1,
                comptime T: type,
                handle_request: *const fn (_toplevel_decoration_v1: *ToplevelDecorationV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_toplevel_decoration_v1: *ToplevelDecorationV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_toplevel_decoration_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ToplevelDecorationV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ToplevelDecorationV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The configure event configures the effective decoration mode. The
            /// configured state should not be applied immediately. Clients must send an
            /// ack_configure in response to this event. See xdg_surface.configure and
            /// xdg_surface.ack_configure for details.
            ///
            /// A configure event can be sent at any time. The specified mode must be
            /// obeyed by the client.
            pub fn sendConfigure(_toplevel_decoration_v1: *ToplevelDecorationV1, _mode: Mode) void {
                const _resource: *server.wl.Resource = @ptrCast(_toplevel_decoration_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Mode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;
        };
    };
    pub const river = struct {
        /// This global interface should only be advertised to the window manager
        /// process. Only one window management client may be active at a time. The
        /// compositor should use the unavailable event if necessary to enforce this.
        ///
        /// There are two disjoint categories of state managed by this protocol:
        ///
        /// Window management state influences the communication between the
        /// compositor and individual windows (e.g. xdg_toplevels). Window management
        /// state includes window dimensions, fullscreen state, keyboard focus,
        /// keyboard bindings, and more.
        ///
        /// Rendering state only affects the rendered output of the compositor and
        /// does not influence communication between the compositor and individual
        /// windows. Rendering state includes the position and rendering order of
        /// windows, shell surfaces, decoration surfaces, borders, and more.
        ///
        /// Window management state may only be modified by the window manager as part
        /// of a manage sequence. A manage sequence is started with the manage_start
        /// event and ended with the manage_finish request. It is a protocol error to
        /// modify window management state outside of a manage sequence.
        ///
        /// A manage sequence is always followed by at least one render sequence. A
        /// render sequence is started with the render_start event and ended with the
        /// render_finish request.
        ///
        /// Rendering state may be modified by the window manager during a manage
        /// sequence or a render sequence. Regardless of when the rendering state is
        /// modified, it is applied with the next render_finish request. It is a
        /// protocol error to modify rendering state outside of a manage or render
        /// sequence.
        ///
        /// The server will start a manage sequence by sending new state and the
        /// manage_start event as soon as possible whenever there is a change in state
        /// that must be communicated with the window manager.
        ///
        /// If the window manager client needs to ensure a manage sequence is started
        /// due to a state change the compositor is not aware of, it may send the
        /// manage_dirty request.
        ///
        /// The server will start a render sequence by sending new state and the
        /// render_start event as soon as possible whenever there is a change in
        /// window dimensions that must be communicated with the window manager.
        /// Multiple render sequences may be made consecutively without a manage
        /// sequence in between, for example if a window independently changes its own
        /// dimensions.
        ///
        /// To summarize, the main loop of this protocol is as follows:
        ///
        /// 1. The server sends events indicating all changes since the last
        /// manage sequence followed by the manage_start event.
        ///
        /// 2. The client sends requests modifying window management state or
        /// rendering state (as defined above) followed by the manage_finish
        /// request.
        ///
        /// 3. The server sends new state to windows and waits for responses.
        ///
        /// 4. The server sends new window dimensions to the client followed by the
        /// render_start event.
        ///
        /// 5. The client sends requests modifying rendering state (as defined above)
        /// followed by the render_finish request.
        ///
        /// 6. If window dimensions change, loop back to step 4.
        /// If state that requires a manage sequence changes or if the client makes
        /// a manage_dirty request, loop back to step 1.
        ///
        /// For the purposes of frame perfection, the server may delay rendering new
        /// state committed by the windows in step 3 until after step 5 is finished.
        ///
        /// It is a protocol error for the client to make a manage_finish or
        /// render_finish request that violates this ordering.
        pub const WindowManagerV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.window_manager_v1.interface;
            pub const Error = common.river.window_manager_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*WindowManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, WindowManagerV1, _version, _id));
            }
            pub inline fn destroy(_window_manager_v1: *WindowManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *WindowManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_window_manager_v1: *WindowManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).getLink();
            }
            pub inline fn getClient(_window_manager_v1: *WindowManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).getClient();
            }
            pub inline fn getId(_window_manager_v1: *WindowManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).getId();
            }
            pub inline fn getVersion(_window_manager_v1: *WindowManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_window_manager_v1: *WindowManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_window_manager_v1: *WindowManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).getUserData();
            }
            pub inline fn postError(_window_manager_v1: *WindowManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_window_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const stop_since_version = 1;
                pub const destroy_since_version = 1;
                pub const manage_finish_since_version = 1;
                pub const manage_dirty_since_version = 1;
                pub const render_finish_since_version = 1;
                pub const get_shell_surface_since_version = 1;
                pub const exit_session_since_version = 4;

                /// This request indicates that the client no longer wishes to receive
                /// events on this object.
                ///
                /// The Wayland protocol is asynchronous, which means the server may send
                /// further events until the stop request is processed. The client must wait
                /// for a river_window_manager_v1.finished event before destroying this
                /// object.
                stop: void,
                /// This request should be called after the finished event has been received
                /// to complete destruction of the object.
                ///
                /// If a client wishes to destroy this object it should send a
                /// river_window_manager_v1.stop request and wait for a
                /// river_window_manager_v1.finished event. Once the finished event is
                /// received it is safe to destroy this object and any other objects created
                /// through this interface.
                destroy: void,
                /// This request indicates that the client has made all changes to window
                /// management state it wishes to include in the current manage sequence and
                /// that the server should atomically send these state changes to the
                /// windows and continue with the manage sequence.
                ///
                /// After sending this request, it is a protocol error for the client to
                /// make further changes to window management state until the next
                /// manage_start event is received.
                ///
                /// See the description of the river_window_manager_v1 interface for a
                /// complete overview of the manage/render sequence loop.
                manage_finish: void,
                /// This request ensures a manage sequence is started and that a
                /// manage_start event is sent by the server. If this request is made during
                /// an ongoing manage sequence, a new manage sequence will be started as
                /// soon as the current one is completed.
                ///
                /// The client may want to use this request due to an internal state change
                /// that the compositor is not aware of (e.g. a dbus event) which should
                /// affect window management or rendering state.
                manage_dirty: void,
                /// This request indicates that the client has made all changes to rendering
                /// state it wishes to include in the current manage sequence and that the
                /// server should atomically apply and display these state changes to the
                /// user.
                ///
                /// After sending this request, it is a protocol error for the client to
                /// make further changes to rendering state until the next manage_start or
                /// render_start event is received, whichever comes first.
                ///
                /// See the description of the river_window_manager_v1 interface for a
                /// complete overview of the manage/render sequence loop.
                render_finish: void,
                /// Create a new shell surface for window manager UI and assign the
                /// river_shell_surface_v1 role to the surface.
                ///
                /// Providing a wl_surface which already has a role or already has a buffer
                /// attached or committed is a protocol error.
                get_shell_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// End the current Wayland session and exit the compositor.
                /// All Wayland clients running in the current session, including
                /// the window manager, will be disconnected.
                ///
                /// Window managers should only make this request if the user explicitly
                /// asks to exit the Wayland session, not for example on normal window
                /// manager termination.
                exit_session: void,
            };
            pub inline fn setHandler(
                _window_manager_v1: *WindowManagerV1,
                comptime T: type,
                handle_request: *const fn (_window_manager_v1: *WindowManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_window_manager_v1: *WindowManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(WindowManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*WindowManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that window management is not available to the
            /// client, perhaps due to another window management client already running.
            /// The circumstances causing this event to be sent are compositor policy.
            ///
            /// If sent, this event is guaranteed to be the first and only event sent by
            /// the server.
            ///
            /// The server will send no further events on this object. The client should
            /// destroy this object and all objects created through this interface.
            pub fn sendUnavailable(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(0, null);
            }
            pub const unavailable_since_version = 1;

            /// This event indicates that the server will send no further events on this
            /// object. The client should destroy the object. See
            /// river_window_manager_v1.destroy for more information.
            pub fn sendFinished(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(1, null);
            }
            pub const finished_since_version = 1;

            /// This event indicates that the server has sent events indicating all
            /// state changes since the last manage sequence.
            ///
            /// In response to this event, the client should make requests modifying
            /// window management state as it chooses. Then, the client must make the
            /// manage_finish request.
            ///
            /// See the description of the river_window_manager_v1 interface for a
            /// complete overview of the manage/render sequence loop.
            pub fn sendManageStart(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(2, null);
            }
            pub const manage_start_since_version = 1;

            /// This event indicates that the server has sent all
            /// river_window_v1.dimensions events necessary.
            ///
            /// In response to this event, the client should make requests modifying
            /// rendering state as it chooses. Then, the client must make the
            /// render_finish request.
            ///
            /// See the description of the river_window_manager_v1 interface for a
            /// complete overview of the manage/render sequence loop.
            pub fn sendRenderStart(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(3, null);
            }
            pub const render_start_since_version = 1;

            /// This event indicates that the session has been locked.
            ///
            /// The window manager may wish to restrict which key bindings are available
            /// while locked or otherwise use this information.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendSessionLocked(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(4, null);
            }
            pub const session_locked_since_version = 1;

            /// This event indicates that the session has been unlocked.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendSessionUnlocked(_window_manager_v1: *WindowManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                _resource.postEvent(5, null);
            }
            pub const session_unlocked_since_version = 1;

            /// A new window has been created.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendWindow(_window_manager_v1: *WindowManagerV1, _id: *server.river.WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(6, &_args);
            }
            pub const window_since_version = 1;

            /// A new logical output has been created, perhaps due to a new physical
            /// monitor being plugged in or perhaps due to a change in configuration.
            ///
            /// This event will be followed by river_output_v1.position and dimensions
            /// events as well as a manage_start event after all other new state has
            /// been sent by the server.
            pub fn sendOutput(_window_manager_v1: *WindowManagerV1, _id: *server.river.OutputV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(7, &_args);
            }
            pub const output_since_version = 1;

            /// A new seat has been created.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendSeat(_window_manager_v1: *WindowManagerV1, _id: *server.river.SeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(8, &_args);
            }
            pub const seat_since_version = 1;
        };

        /// The window manager might use a shell surface to display a status bar,
        /// background image, desktop notifications, launcher, desktop menu, or
        /// whatever else it wants.
        pub const ShellSurfaceV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.shell_surface_v1.interface;
            pub const Error = common.river.shell_surface_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*ShellSurfaceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, ShellSurfaceV1, _version, _id));
            }
            pub inline fn destroy(_shell_surface_v1: *ShellSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *ShellSurfaceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_shell_surface_v1: *ShellSurfaceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).getLink();
            }
            pub inline fn getClient(_shell_surface_v1: *ShellSurfaceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).getClient();
            }
            pub inline fn getId(_shell_surface_v1: *ShellSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).getId();
            }
            pub inline fn getVersion(_shell_surface_v1: *ShellSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).getVersion();
            }
            pub inline fn postNoMemory(_shell_surface_v1: *ShellSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).postNoMemory();
            }
            pub inline fn getUserData(_shell_surface_v1: *ShellSurfaceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).getUserData();
            }
            pub inline fn postError(_shell_surface_v1: *ShellSurfaceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_shell_surface_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_node_since_version = 1;
                pub const sync_next_commit_since_version = 1;

                /// This request indicates that the client will no longer use the shell
                /// surface object and that it may be safely destroyed.
                destroy: void,
                /// Get the node in the render list corresponding to the shell surface.
                ///
                /// It is a protocol error to make this request more than once for a single
                /// shell surface.
                get_node: struct {
                    id: u32,
                },

                /// Synchronize application of the next wl_surface.commit request on the
                /// shell surface with rest of the rendering state atomically applied with
                /// the next river_window_manager_v1.render_finish request.
                ///
                /// The client must make a wl_surface.commit request on the shell surface
                /// after this request and before the render_finish request, failure to do
                /// so is a protocol error.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                sync_next_commit: void,
            };
            pub inline fn setHandler(
                _shell_surface_v1: *ShellSurfaceV1,
                comptime T: type,
                handle_request: *const fn (_shell_surface_v1: *ShellSurfaceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_shell_surface_v1: *ShellSurfaceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_shell_surface_v1);
                _resource.setDispatcher(
                    common.Dispatcher(ShellSurfaceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*ShellSurfaceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The render list is a list of nodes that determines the rendering order of
        /// the compositor. Nodes may correspond to windows or shell surfaces. The
        /// relative ordering of nodes may be changed with the place_above and
        /// place_below requests, changing the rendering order.
        ///
        /// The initial position of a node in the render list is undefined, the window
        /// manager client must use the place_above or place_below request to
        /// guarantee a specific rendering order.
        pub const NodeV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.node_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*NodeV1 {
                return @ptrCast(try server.wl.Resource.create(_client, NodeV1, _version, _id));
            }
            pub inline fn destroy(_node_v1: *NodeV1) void {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *NodeV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_node_v1: *NodeV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).getLink();
            }
            pub inline fn getClient(_node_v1: *NodeV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).getClient();
            }
            pub inline fn getId(_node_v1: *NodeV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).getId();
            }
            pub inline fn getVersion(_node_v1: *NodeV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).getVersion();
            }
            pub inline fn postNoMemory(_node_v1: *NodeV1) void {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).postNoMemory();
            }
            pub inline fn getUserData(_node_v1: *NodeV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_node_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_position_since_version = 1;
                pub const place_top_since_version = 1;
                pub const place_bottom_since_version = 1;
                pub const place_above_since_version = 1;
                pub const place_below_since_version = 1;

                /// This request indicates that the client will no longer use the node
                /// object and that it may be safely destroyed.
                destroy: void,
                /// Set the absolute position of the node in the compositor's logical
                /// coordinate space. The x and y coordinates may be positive or negative.
                ///
                /// Note that the position of a river_window_v1 refers to the position of
                /// the window content and is unaffected by the presence of borders or
                /// decoration surfaces.
                ///
                /// If this request is never sent, the position of the node is undefined by
                /// this protocol and left up to the compositor.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_position: struct {
                    x: i32,
                    y: i32,
                },

                /// This request places the node above all other nodes in the compositor's
                /// render list.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                place_top: void,
                /// This request places the node below all other nodes in the compositor's
                /// render list.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                place_bottom: void,
                /// This request places the node directly above another node in the
                /// compositor's render list.
                ///
                /// Attempting to place a node above itself has no effect.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                place_above: struct {
                    other: *server.river.NodeV1,
                },

                /// This request places the node directly below another node in the
                /// compositor's render list.
                ///
                /// Attempting to place a node below itself has no effect.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                place_below: struct {
                    other: *server.river.NodeV1,
                },
            };
            pub inline fn setHandler(
                _node_v1: *NodeV1,
                comptime T: type,
                handle_request: *const fn (_node_v1: *NodeV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_node_v1: *NodeV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_node_v1);
                _resource.setDispatcher(
                    common.Dispatcher(NodeV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*NodeV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This represents a logical window. For example, a window may correspond to
        /// an xdg_toplevel or Xwayland window.
        ///
        /// A newly created window will not be displayed until the window manager
        /// makes a propose_dimensions or fullscreen request as part of a manage
        /// sequence, the server replies with a dimensions event as part of a render
        /// sequence, and that render sequence is finished.
        pub const WindowV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.window_v1.interface;
            pub const Error = common.river.window_v1.Error;
            pub const DecorationHint = common.river.window_v1.DecorationHint;
            pub const Edges = common.river.window_v1.Edges;
            pub const Capabilities = common.river.window_v1.Capabilities;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*WindowV1 {
                return @ptrCast(try server.wl.Resource.create(_client, WindowV1, _version, _id));
            }
            pub inline fn destroy(_window_v1: *WindowV1) void {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *WindowV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_window_v1: *WindowV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).getLink();
            }
            pub inline fn getClient(_window_v1: *WindowV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).getClient();
            }
            pub inline fn getId(_window_v1: *WindowV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).getId();
            }
            pub inline fn getVersion(_window_v1: *WindowV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).getVersion();
            }
            pub inline fn postNoMemory(_window_v1: *WindowV1) void {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).postNoMemory();
            }
            pub inline fn getUserData(_window_v1: *WindowV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).getUserData();
            }
            pub inline fn postError(_window_v1: *WindowV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_window_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const close_since_version = 1;
                pub const get_node_since_version = 1;
                pub const propose_dimensions_since_version = 1;
                pub const hide_since_version = 1;
                pub const show_since_version = 1;
                pub const use_csd_since_version = 1;
                pub const use_ssd_since_version = 1;
                pub const set_borders_since_version = 1;
                pub const set_tiled_since_version = 1;
                pub const get_decoration_above_since_version = 1;
                pub const get_decoration_below_since_version = 1;
                pub const inform_resize_start_since_version = 1;
                pub const inform_resize_end_since_version = 1;
                pub const set_capabilities_since_version = 1;
                pub const inform_maximized_since_version = 1;
                pub const inform_unmaximized_since_version = 1;
                pub const inform_fullscreen_since_version = 1;
                pub const inform_not_fullscreen_since_version = 1;
                pub const fullscreen_since_version = 1;
                pub const exit_fullscreen_since_version = 1;
                pub const set_clip_box_since_version = 2;
                pub const set_content_clip_box_since_version = 3;
                pub const set_dimension_bounds_since_version = 4;

                /// This request indicates that the client will no longer use the window
                /// object and that it may be safely destroyed.
                ///
                /// This request should be made after the river_window_v1.closed event or
                /// river_window_manager_v1.finished is received to complete destruction of
                /// the window.
                destroy: void,
                /// Request that the window be closed. The window may ignore this request or
                /// only close after some delay, perhaps opening a dialog asking the user to
                /// save their work or similar.
                ///
                /// The server will send a river_window_v1.closed event if/when the window
                /// has been closed.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                close: void,
                /// Get the node in the render list corresponding to the window.
                ///
                /// It is a protocol error to make this request more than once for a single
                /// window.
                get_node: struct {
                    id: u32,
                },

                /// This request proposes dimensions for the window in the compositor's
                /// logical coordinate space.
                ///
                /// The width and height must be greater than or equal to zero. If the width
                /// or height is zero the window will be allowed to decide its own
                /// dimensions.
                ///
                /// The window may not take the exact dimensions proposed. The actual
                /// dimensions taken by the window will be sent in a subsequent
                /// river_window_v1.dimensions event. For example, a terminal emulator may
                /// only allow dimensions that are multiple of the cell size.
                ///
                /// When a propose_dimensions request is made, the server must send a
                /// dimensions event in response as soon as possible. It may not be possible
                /// to send a dimensions event in the very next render sequence if, for
                /// example, the window takes too long to respond to the proposed
                /// dimensions. In this case, the server will send the dimensions event in a
                /// future render sequence.
                ///
                /// Note that the dimensions of a river_window_v1 refer to the dimensions of
                /// the window content and are unaffected by the presence of borders or
                /// decoration surfaces.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                propose_dimensions: struct {
                    width: i32,
                    height: i32,
                },

                /// Request that the window be hidden. Has no effect if the window is
                /// already hidden. Hides any window borders and decorations as well.
                ///
                /// Newly created windows are considered shown unless explicitly hidden with
                /// the hide request.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                hide: void,
                /// Request that the window be shown. Has no effect if the window is not
                /// hidden. Does not guarantee that the window is visible as it may be
                /// completely obscured by other windows placed above it for example.
                ///
                /// Newly created windows are considered shown unless explicitly hidden with
                /// the hide request.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                show: void,
                /// Tell the client to use client side decoration and draw its own title
                /// bar, borders, etc.
                ///
                /// This is the default if neither this request nor the use_ssd request is
                /// ever made.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                use_csd: void,
                /// Tell the client to use server side decoration and not draw any client
                /// side decorations.
                ///
                /// This request will have no effect if the client only supports client side
                /// decoration, see the decoration_hint event.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                use_ssd: void,
                /// This request decorates the window with borders drawn by the compositor
                /// on the specified edges of the window. Borders are drawn above the window
                /// content.
                ///
                /// Corners are drawn only between borders on adjacent edges. If e.g. the
                /// left edge has a border and the top edge does not, the border drawn on
                /// the left edge will not extend vertically beyond the top edge of the
                /// window.
                ///
                /// Borders are not drawn while the window is fullscreen.
                ///
                /// The color is defined by four 32-bit RGBA values. Unless specified in
                /// another protocol extension, the RGBA values use pre-multiplied alpha.
                ///
                /// Setting the edges to none or the width to 0 disables the borders.
                /// Setting a negative width is a protocol error.
                ///
                /// This request completely overrides all previous set_borders requests.
                /// Only the most recent set_borders request has an effect.
                ///
                /// Note that the position/dimensions of a river_window_v1 refer to the
                /// position/dimensions of the window content and are unaffected by the
                /// presence of borders or decoration surfaces.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_borders: struct {
                    edges: Edges,
                    width: i32,
                    r: u32,
                    g: u32,
                    b: u32,
                    a: u32,
                },

                /// Inform the window that it is part of a tiled layout and adjacent to
                /// other elements in the tiled layout on the given edges.
                ///
                /// The window should use this information to change the style of its client
                /// side decorations and avoid drawing e.g. drop shadows outside of the
                /// window dimensions on the tiled edges.
                ///
                /// Setting the edges argument to none informs the window that it is not
                /// part of a tiled layout. If this request is never made, the window is
                /// informed that it is not part of a tiled layout.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                set_tiled: struct {
                    edges: Edges,
                },

                /// Create a decoration surface and assign the river_decoration_v1 role to
                /// the surface. The created decoration is placed above the window in
                /// rendering order, see the description of river_decoration_v1.
                ///
                /// Providing a wl_surface which already has a role or already has a buffer
                /// attached or committed is a protocol error.
                get_decoration_above: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// Create a decoration surface and assign the river_decoration_v1 role to
                /// the surface. The created decoration is placed below the window in
                /// rendering order, see the description of river_decoration_v1.
                ///
                /// Providing a wl_surface which already has a role or already has a buffer
                /// attached or committed is a protocol error.
                get_decoration_below: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                },

                /// Inform the window that it is being resized. The window manager should
                /// use this request to inform windows that are the target of an interactive
                /// resize for example.
                ///
                /// The window manager remains responsible for handling the position and
                /// dimensions of the window while it is resizing.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_resize_start: void,
                /// Inform the window that it is no longer being resized. The window manager
                /// should use this request to inform windows that are the target of an
                /// interactive resize that the interactive resize has ended for example.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_resize_end: void,
                /// This request informs the window of the capabilities supported by the
                /// window manager. If the window manager, for example, ignores requests to
                /// be maximized from the window it should not tell the window that it
                /// supports the maximize capability.
                ///
                /// The window might use this information to, for example, only show a
                /// maximize button if the window manager supports the maximize capability.
                ///
                /// The window manager client should use this request to set capabilities
                /// for all new windows. If this request is never made, the compositor will
                /// inform windows that all capabilities are supported.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                set_capabilities: struct {
                    caps: Capabilities,
                },

                /// Inform the window that it is maximized. The window might use this
                /// information to adapt the style of its client-side window decorations for
                /// example.
                ///
                /// The window manager remains responsible for handling the position and
                /// dimensions of the window while it is maximized.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_maximized: void,
                /// Inform the window that it is unmaximized. The window might use this
                /// information to adapt the style of its client-side window decorations for
                /// example.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_unmaximized: void,
                /// Inform the window that it is fullscreen. The window might use this
                /// information to adapt the style of its client-side window decorations for
                /// example.
                ///
                /// This request does not affect the size/position of the window or cause it
                /// to become the only window rendered, see the river_window_v1.fullscreen
                /// and exit_fullscreen requests for that.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_fullscreen: void,
                /// Inform the window that it is not fullscreen. The window might use this
                /// information to adapt the style of its client-side window decorations for
                /// example.
                ///
                /// This request does not affect the size/position of the window or cause it
                /// to become the only window rendered, see the river_window_v1.fullscreen
                /// and exit_fullscreen requests for that.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                inform_not_fullscreen: void,
                /// Make the window fullscreen on the given output. If multiple windows are
                /// fullscreen on the same output at the same time only the "top" window in
                /// rendering order shall be displayed.
                ///
                /// All river_shell_surface_v1 objects above the top fullscreen window in
                /// the rendering order will continue to be rendered.
                ///
                /// The compositor will handle the position and dimensions of the window
                /// while it is fullscreen. The set_position and propose_dimensions requests
                /// shall not affect the current position and dimensions of a fullscreen
                /// window.
                ///
                /// When a fullscreen request is made, the server must send a dimensions
                /// event in response as soon as possible. It may not be possible to send a
                /// dimensions event in the very next render sequence if, for example, the
                /// window takes too long to respond. In this case, the server will send the
                /// dimensions event in a future render sequence.
                ///
                /// The compositor will clip window content, decoration surfaces, and
                /// borders to the given output's dimensions while the window is fullscreen.
                /// The effects of set_clip_box and set_content_clip_box are ignored while
                /// the window is fullscreen.
                ///
                /// If the output on which a window is currently fullscreen is removed, the
                /// windowing state is modified as if there were an exit_fullscreen request
                /// made in the same manage sequence as the river_output_v1.removed event.
                ///
                /// This request does not inform the window that it is fullscreen, see the
                /// river_window_v1.inform_fullscreen and inform_not_fullscreen requests.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                fullscreen: struct {
                    output: *server.river.OutputV1,
                },

                /// Make the window not fullscreen.
                ///
                /// The position and dimensions are undefined after this request is made
                /// until a manage sequence in which the window manager makes the
                /// propose_dimensions and set_position requests is completed.
                ///
                /// The window manager should make propose_dimensions and set_position
                /// requests in the same manage sequence as the exit_fullscreen request for
                /// frame perfection.
                ///
                /// This request does not inform the window that it is fullscreen, see the
                /// river_window_v1.inform_fullscreen and inform_not_fullscreen requests.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                exit_fullscreen: void,
                /// Clip the window, including borders and decoration surfaces, to the box
                /// specified by the x, y, width, and height arguments. The x/y position of
                /// the box is relative to the top left corner of the window.
                ///
                /// The width and height arguments must be greater than or equal to 0.
                ///
                /// Setting a clip box with 0 width or height disables clipping.
                ///
                /// The clip box is ignored while the window is fullscreen.
                ///
                /// Both set_clip_box and set_content_clip_box may be enabled simultaneously.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_clip_box: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// Clip the content of the window, excluding borders and decoration
                /// surfaces, to the box specified by the x, y, width, and height arguments.
                /// The x/y position of the box is relative to the top left corner of the
                /// window.
                ///
                /// Borders drawn by the compositor (see set_borders) are placed around the
                /// intersection of the window content (as defined by the dimensions event)
                /// and the content clip box when content clipping is enabled.
                ///
                /// The width and height arguments must be greater than or equal to 0.
                ///
                /// Setting a box with 0 width or height disables content clipping.
                ///
                /// The content clip box is ignored while the window is fullscreen.
                ///
                /// Both set_clip_box and set_content_clip_box may be enabled simultaneously.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_content_clip_box: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },

                /// Recommend that the window keep its dimensions within a given
                /// maximum width/height. This recommendation is only a hint and the window
                /// may ignore it.
                ///
                /// Setting the width and height to 0 indicates that there are no bounds
                /// and is equivalent to having never made this request.
                ///
                /// Setting width or height to a negative value is a protocol error.
                ///
                /// The server should communicate this hint to an xdg_toplevel window with
                /// the xdg_toplevel.configure_bounds event for example.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                set_dimension_bounds: struct {
                    max_width: i32,
                    max_height: i32,
                },
            };
            pub inline fn setHandler(
                _window_v1: *WindowV1,
                comptime T: type,
                handle_request: *const fn (_window_v1: *WindowV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_window_v1: *WindowV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.setDispatcher(
                    common.Dispatcher(WindowV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*WindowV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The window has been closed by the server, perhaps due to an
            /// xdg_toplevel.close request or similar.
            ///
            /// The server will send no further events on this object and ignore any
            /// request other than river_window_v1.destroy made after this event is
            /// sent. The client should destroy this object with the
            /// river_window_v1.destroy request to free up resources.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendClosed(_window_v1: *WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.postEvent(0, null);
            }
            pub const closed_since_version = 1;

            /// This event informs the window manager of the window's preferred min/max
            /// dimensions. These preferences are a hint, and the window manager is free
            /// to propose dimensions outside of these bounds.
            ///
            /// All min/max width/height values must be strictly greater than or equal
            /// to 0. A value of 0 indicates that the window has no preference for that
            /// value.
            ///
            /// The min_width/min_height must be strictly less than or equal to the
            /// max_width/max_height.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendDimensionsHint(_window_v1: *WindowV1, _min_width: i32, _min_height: i32, _max_width: i32, _max_height: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _min_width },
                    .{ .i = _min_height },
                    .{ .i = _max_width },
                    .{ .i = _max_height },
                };
                _resource.postEvent(1, &_args);
            }
            pub const dimensions_hint_since_version = 1;

            /// This event indicates the dimensions of the window in the compositor's
            /// logical coordinate space. The width and height must be strictly greater
            /// than zero.
            ///
            /// Note that the dimensions of a river_window_v1 refer to the dimensions of
            /// the window content and are unaffected by the presence of borders or
            /// decoration surfaces.
            ///
            /// This event is sent as part of a render sequence before the render_start
            /// event.
            ///
            /// It may be sent due to a propose_dimensions or fullscreen request in a
            /// previous manage sequence or because a window independently decides to
            /// change its dimensions.
            ///
            /// The window will not be displayed until the first dimensions event is
            /// received and the render sequence is finished.
            pub fn sendDimensions(_window_v1: *WindowV1, _width: i32, _height: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _resource.postEvent(2, &_args);
            }
            pub const dimensions_since_version = 1;

            /// The window set an application ID.
            ///
            /// The app_id argument will be null if the window has never set an
            /// application ID or if the window cleared its application ID. (Xwayland
            /// windows may do this for example, though xdg-toplevels may not.)
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendAppId(_window_v1: *WindowV1, _app_id: ?[*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .s = _app_id },
                };
                _resource.postEvent(3, &_args);
            }
            pub const app_id_since_version = 1;

            /// The window set a title.
            ///
            /// The title argument will be null if the window has never set a title or
            /// if the window cleared its title. (Xwayland windows may do this for
            /// example, though xdg-toplevels may not.)
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendTitle(_window_v1: *WindowV1, _title: ?[*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .s = _title },
                };
                _resource.postEvent(4, &_args);
            }
            pub const title_since_version = 1;

            /// The window set a parent window. If this event is never received or if
            /// the parent argument is null then the window has no parent.
            ///
            /// A surface with a parent set might be a dialog, file picker, or similar
            /// for the parent window.
            ///
            /// Child windows should generally be rendered directly above their parent.
            ///
            /// The compositor must guarantee that there are no loops in the window
            /// tree: a parent must not be the descendant of one of its children.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendParent(_window_v1: *WindowV1, _parent: ?*server.river.WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_parent) },
                };
                _resource.postEvent(5, &_args);
            }
            pub const parent_since_version = 1;

            /// Information from the window about the supported and preferred client
            /// side/server side decoration options.
            ///
            /// This event may be sent multiple times over the lifetime of the window if
            /// the window changes its preferences.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendDecorationHint(_window_v1: *WindowV1, _hint: DecorationHint) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DecorationHint)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_hint))),
                        .@"struct" => @bitCast(_hint),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(6, &_args);
            }
            pub const decoration_hint_since_version = 1;

            /// This event informs the window manager that the window has requested to
            /// be interactively moved using the pointer. The seat argument indicates the
            /// seat for the move.
            ///
            /// The xdg-shell protocol for example allows windows to request that an
            /// interactive move be started, perhaps when a client-side rendered
            /// titlebar is dragged.
            ///
            /// The window manager may use the river_seat_v1.op_start_pointer request to
            /// interactively move the window or ignore this event entirely.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendPointerMoveRequested(_window_v1: *WindowV1, _seat: *server.river.SeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                };
                _resource.postEvent(7, &_args);
            }
            pub const pointer_move_requested_since_version = 1;

            /// This event informs the window manager that the window has requested to
            /// be interactively resized using the pointer. The seat argument indicates
            /// the seat for the resize.
            ///
            /// The edges argument indicates which edges the window has requested to be
            /// resized from. The edges argument will never be none and will never have
            /// both top and bottom or both left and right edges set.
            ///
            /// The xdg-shell protocol for example allows windows to request that an
            /// interactive resize be started, perhaps when the corner of client-side
            /// rendered decorations is dragged.
            ///
            /// The window manager may use the river_seat_v1.op_start_pointer request to
            /// interactively resize the window or ignore this event entirely.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendPointerResizeRequested(_window_v1: *WindowV1, _seat: *server.river.SeatV1, _edges: Edges) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_seat) },
                    .{ .u = switch (@typeInfo(Edges)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_edges))),
                        .@"struct" => @bitCast(_edges),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(8, &_args);
            }
            pub const pointer_resize_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request that a
            /// window menu be shown, for example when the user right clicks on client
            /// side window decorations.
            ///
            /// A window menu might include options to maximize or minimize the window.
            ///
            /// The window manager is free to ignore this request and decide what the
            /// window menu contains if it does choose to show one.
            ///
            /// The x and y arguments indicate where the window requested that the
            /// window menu be shown.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendShowWindowMenuRequested(_window_v1: *WindowV1, _x: i32, _y: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _resource.postEvent(9, &_args);
            }
            pub const show_window_menu_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request to be
            /// maximized.
            ///
            /// The window manager is free to honor this request using
            /// river_window_v1.inform_maximized or ignore it.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendMaximizeRequested(_window_v1: *WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.postEvent(10, null);
            }
            pub const maximize_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request to be
            /// unmaximized.
            ///
            /// The window manager is free to honor this request using
            /// river_window_v1.inform_unmaximized or ignore it.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendUnmaximizeRequested(_window_v1: *WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.postEvent(11, null);
            }
            pub const unmaximize_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request that they
            /// be made fullscreen and allows them to provide an optional output hint.
            ///
            /// If the output argument is null, the window has no preference and the
            /// window manager should choose an output.
            ///
            /// The window manager is free to honor this request using
            /// river_window_v1.fullscreen or ignore it.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendFullscreenRequested(_window_v1: *WindowV1, _output: ?*server.river.OutputV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_output) },
                };
                _resource.postEvent(12, &_args);
            }
            pub const fullscreen_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request to exit
            /// fullscreen.
            ///
            /// The window manager is free to honor this request using
            /// river_window_v1.exit_fullscreen or ignore it.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendExitFullscreenRequested(_window_v1: *WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.postEvent(13, null);
            }
            pub const exit_fullscreen_requested_since_version = 1;

            /// The xdg-shell protocol for example allows windows to request to be
            /// minimized.
            ///
            /// The window manager is free to ignore this request, hide the window, or
            /// do whatever else it chooses.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendMinimizeRequested(_window_v1: *WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                _resource.postEvent(14, null);
            }
            pub const minimize_requested_since_version = 1;

            /// This event gives an unreliable PID of the process that created the
            /// window. Obtaining this information is inherently racy due to PID reuse.
            /// Therefore, this PID must not be used for anything security sensitive.
            ///
            /// Note also that a single process may create multiple windows, so there is
            /// not necessarily a 1-to-1 mapping from PID to window. Multiple windows
            /// may have the same PID.
            ///
            /// This event is sent once when the river_window_v1 is created and never
            /// sent again.
            pub fn sendUnreliablePid(_window_v1: *WindowV1, _unreliable_pid: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .i = _unreliable_pid },
                };
                _resource.postEvent(15, &_args);
            }
            pub const unreliable_pid_since_version = 2;

            /// This event communicates the window's preferred presentation mode.
            ///
            /// This event will be followed by a render_start event after all other new
            /// state has been sent by the server.
            pub fn sendPresentationHint(_window_v1: *WindowV1, _hint: common.river.output_v1.PresentationMode) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(common.river.output_v1.PresentationMode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_hint))),
                        .@"struct" => @bitCast(_hint),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(16, &_args);
            }
            pub const presentation_hint_since_version = 4;

            /// The identifier is a string that contains up to 32 printable ASCII bytes.
            /// The identifier must not be an empty string.
            ///
            /// It is compositor policy how the identifier is generated, but the following
            /// properties must be upheld:
            ///
            /// 1. The identifier must uniquely identify the window. Two windows must not
            /// share the same identifier.
            ///
            /// 2. The identifier must not be reused. This avoids races around window
            /// creation/destruction when identifiers are used in out-of-band IPC.
            ///
            /// If the compositor implements the ext-foreign-toplevel-list-v1 protocol,
            /// the river_window_v1.identifier event must match the corresponding
            /// ext_foreign_toplevel_handle_v1.identifier event.
            ///
            /// This event is sent once when the river_window_v1 is created and never
            /// sent again.
            pub fn sendIdentifier(_window_v1: *WindowV1, _identifier: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_window_v1);
                var _args = [_]common.Argument{
                    .{ .s = _identifier },
                };
                _resource.postEvent(17, &_args);
            }
            pub const identifier_since_version = 4;
        };

        /// The rendering order of windows with decorations is follows:
        ///
        /// 1. Decorations created with get_decoration_below at the bottom
        /// 2. Window content
        /// 3. Borders configured with river_window_v1.set_borders
        /// 4. Decorations created with get_decoration_above at the top
        ///
        /// The relative ordering of decoration surfaces above/below a window is
        /// undefined by this protocol and left up to the compositor.
        pub const DecorationV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.decoration_v1.interface;
            pub const Error = common.river.decoration_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*DecorationV1 {
                return @ptrCast(try server.wl.Resource.create(_client, DecorationV1, _version, _id));
            }
            pub inline fn destroy(_decoration_v1: *DecorationV1) void {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *DecorationV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_decoration_v1: *DecorationV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).getLink();
            }
            pub inline fn getClient(_decoration_v1: *DecorationV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).getClient();
            }
            pub inline fn getId(_decoration_v1: *DecorationV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).getId();
            }
            pub inline fn getVersion(_decoration_v1: *DecorationV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).getVersion();
            }
            pub inline fn postNoMemory(_decoration_v1: *DecorationV1) void {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).postNoMemory();
            }
            pub inline fn getUserData(_decoration_v1: *DecorationV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).getUserData();
            }
            pub inline fn postError(_decoration_v1: *DecorationV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_decoration_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_offset_since_version = 1;
                pub const sync_next_commit_since_version = 1;

                /// This request indicates that the client will no longer use the decoration
                /// object and that it may be safely destroyed.
                destroy: void,
                /// This request sets the offset of the decoration surface from the top left
                /// corner of the window.
                ///
                /// If this request is never sent, the x and y offsets are undefined by this
                /// protocol and left up to the compositor.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_offset: struct {
                    x: i32,
                    y: i32,
                },

                /// Synchronize application of the next wl_surface.commit request on the
                /// decoration surface with rest of the state atomically applied with the
                /// next river_window_manager_v1.render_finish request.
                ///
                /// The client must make a wl_surface.commit request on the decoration
                /// surface after this request and before the render_finish request, failure
                /// to do so is a protocol error.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                sync_next_commit: void,
            };
            pub inline fn setHandler(
                _decoration_v1: *DecorationV1,
                comptime T: type,
                handle_request: *const fn (_decoration_v1: *DecorationV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_decoration_v1: *DecorationV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_decoration_v1);
                _resource.setDispatcher(
                    common.Dispatcher(DecorationV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*DecorationV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An area in the compositor's logical coordinate space that should be
        /// treated as a single output for window management purposes. This area may
        /// correspond to a single physical output or multiple physical outputs in the
        /// case of mirroring or tiled monitors depending on the hardware and
        /// compositor configuration.
        pub const OutputV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.output_v1.interface;
            pub const Error = common.river.output_v1.Error;
            pub const PresentationMode = common.river.output_v1.PresentationMode;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*OutputV1 {
                return @ptrCast(try server.wl.Resource.create(_client, OutputV1, _version, _id));
            }
            pub inline fn destroy(_output_v1: *OutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *OutputV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_output_v1: *OutputV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).getLink();
            }
            pub inline fn getClient(_output_v1: *OutputV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).getClient();
            }
            pub inline fn getId(_output_v1: *OutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).getId();
            }
            pub inline fn getVersion(_output_v1: *OutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).getVersion();
            }
            pub inline fn postNoMemory(_output_v1: *OutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).postNoMemory();
            }
            pub inline fn getUserData(_output_v1: *OutputV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).getUserData();
            }
            pub inline fn postError(_output_v1: *OutputV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_output_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_presentation_mode_since_version = 4;

                /// This request indicates that the client will no longer use the output
                /// object and that it may be safely destroyed.
                ///
                /// This request should be made after the river_output_v1.removed event is
                /// received to complete destruction of the output.
                destroy: void,
                /// Set the preferred presentation mode of the output. The compositor should
                /// always respect the preference of the window manager if possible. If this
                /// request is never made, the preferred presentation mode is vsync.
                ///
                /// This request modifies rendering state and may only be made as part of a
                /// render sequence, see the river_window_manager_v1 description.
                set_presentation_mode: struct {
                    mode: PresentationMode,
                },
            };
            pub inline fn setHandler(
                _output_v1: *OutputV1,
                comptime T: type,
                handle_request: *const fn (_output_v1: *OutputV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_output_v1: *OutputV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_v1);
                _resource.setDispatcher(
                    common.Dispatcher(OutputV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*OutputV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the logical output is no longer conceptually
            /// part of window management space.
            ///
            /// The server will send no further events on this object and ignore any
            /// request (other than river_output_v1.destroy) made after this event is
            /// sent. The client should destroy this object with the
            /// river_output_v1.destroy request to free up resources.
            ///
            /// This event may be sent because a corresponding physical output has been
            /// physically unplugged or because some output configuration has changed.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendRemoved(_output_v1: *OutputV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_v1);
                _resource.postEvent(0, null);
            }
            pub const removed_since_version = 1;

            /// The wl_output object corresponding to the river_output_v1. The argument
            /// is the global name of the wl_output advertised with wl_registry.global.
            ///
            /// It is guaranteed that the corresponding wl_output is advertised before
            /// this event is sent.
            ///
            /// This event is sent exactly once. The wl_output associated with a
            /// river_output_v1 cannot change. It is guaranteed that there is a 1-to-1
            /// mapping between wl_output and river_output_v1 objects.
            ///
            /// The global_remove event for the corresponding wl_output may be sent
            /// before the river_output_v1.removed event. This is due to the fact that
            /// river_output_v1 state changes are synced to the river window management
            /// manage sequence while changes to globals are not.
            ///
            /// Rationale: The window manager may need information provided by the
            /// wl_output interface such as the name/description. It also may need the
            /// wl_output object to start screencopy for example.
            pub fn sendWlOutput(_output_v1: *OutputV1, _name: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_v1);
                var _args = [_]common.Argument{
                    .{ .u = _name },
                };
                _resource.postEvent(1, &_args);
            }
            pub const wl_output_since_version = 1;

            /// This event indicates the position of the output in the compositor's
            /// logical coordinate space. The x and y coordinates may be positive or
            /// negative.
            ///
            /// This event is sent once when the river_output_v1 is created and again
            /// whenever the position changes.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The server must guarantee that the position and dimensions events do not
            /// cause the areas of multiple logical outputs to overlap when the
            /// corresponding manage_start event is received.
            pub fn sendPosition(_output_v1: *OutputV1, _x: i32, _y: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _resource.postEvent(2, &_args);
            }
            pub const position_since_version = 1;

            /// This event indicates the dimensions of the output in the compositor's
            /// logical coordinate space. The width and height will always be strictly
            /// greater than zero.
            ///
            /// This event is sent once when the river_output_v1 is created and again
            /// whenever the dimensions change.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The server must guarantee that the position and dimensions events do not
            /// cause the areas of multiple logical outputs to overlap when the
            /// corresponding manage_start event is received.
            pub fn sendDimensions(_output_v1: *OutputV1, _width: i32, _height: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_v1);
                var _args = [_]common.Argument{
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _resource.postEvent(3, &_args);
            }
            pub const dimensions_since_version = 1;
        };

        /// This object represents a single user's collection of input devices. It
        /// allows the window manager to route keyboard input to windows, get
        /// high-level information about pointer input, define pointer bindings, etc.
        ///
        /// For keyboard bindings, see the river-xkb-bindings-v1 protocol.
        ///
        /// Since version 4: The cursor surface/shape set by the window manager on the
        /// wl_pointer of this seat is used when no client has pointer focus, for
        /// example during a pointer operation. Since the window manager is allowed to
        /// set cursor surface/shape even when it does not have pointer focus, the
        /// compositor must ignore the serial argument of wl_pointer.set_cursor and
        /// wp_cursor_shape_device_v1.set_shape requests made by the window manager.
        ///
        /// The most recent cursor surface/shape set by the window manager is
        /// remembered by the compositor and restored whenever no client has pointer
        /// focus. If the window manager never sets a cursor surface/shape, the
        /// "default" shape is used.
        pub const SeatV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.seat_v1.interface;
            pub const Modifiers = common.river.seat_v1.Modifiers;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*SeatV1 {
                return @ptrCast(try server.wl.Resource.create(_client, SeatV1, _version, _id));
            }
            pub inline fn destroy(_seat_v1: *SeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *SeatV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_seat_v1: *SeatV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).getLink();
            }
            pub inline fn getClient(_seat_v1: *SeatV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).getClient();
            }
            pub inline fn getId(_seat_v1: *SeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).getId();
            }
            pub inline fn getVersion(_seat_v1: *SeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).getVersion();
            }
            pub inline fn postNoMemory(_seat_v1: *SeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).postNoMemory();
            }
            pub inline fn getUserData(_seat_v1: *SeatV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_seat_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const focus_window_since_version = 1;
                pub const focus_shell_surface_since_version = 1;
                pub const clear_focus_since_version = 1;
                pub const op_start_pointer_since_version = 1;
                pub const op_end_since_version = 1;
                pub const get_pointer_binding_since_version = 1;
                pub const set_xcursor_theme_since_version = 2;
                pub const pointer_warp_since_version = 3;

                /// This request indicates that the client will no longer use the seat
                /// object and that it may be safely destroyed.
                ///
                /// This request should be made after the river_seat_v1.removed event is
                /// received to complete destruction of the seat.
                destroy: void,
                /// Request that the compositor send keyboard input to the given window.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                focus_window: struct {
                    window: *server.river.WindowV1,
                },

                /// Request that the compositor send keyboard input to the given shell
                /// surface.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                focus_shell_surface: struct {
                    shell_surface: *server.river.ShellSurfaceV1,
                },

                /// Request that the compositor not send keyboard input to any client.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                clear_focus: void,
                /// Start an interactive pointer operation. During the operation, op_delta
                /// events will be sent based on pointer input.
                ///
                /// When all pointer buttons are released, the op_release event is sent.
                ///
                /// The pointer operation continues until the op_end request is made during
                /// a manage sequence and that manage sequence is finished.
                ///
                /// The window manager may use this operation to implement interactive
                /// move/resize of windows by setting the position of windows and proposing
                /// dimensions based off of the op_delta events.
                ///
                /// This request is ignored if an operation is already in progress.
                ///
                /// The compositor must ensure that no client has pointer focus from this
                /// seat during the pointer operation. This means that the window manager
                /// has control over the pointer's cursor surface/shape during the pointer
                /// operation. See the river_seat_v1 description.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                op_start_pointer: void,
                /// End an interactive operation.
                ///
                /// This request is ignored if there is no operation in progress.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                op_end: void,
                /// Define a pointer binding in terms of a pointer button, keyboard
                /// modifiers, and other configurable properties.
                ///
                /// The button argument is a Linux input event code defined in the
                /// linux/input-event-codes.h header file (e.g. BTN_RIGHT).
                ///
                /// The new pointer binding is not enabled until initial configuration is
                /// completed and the enable request is made during a manage sequence.
                get_pointer_binding: struct {
                    id: u32,
                    button: u32,
                    modifiers: Modifiers,
                },

                /// Set the XCursor theme for the seat. This theme is used for cursors
                /// rendered by the compositor, but not necessarily for cursors rendered by
                /// clients.
                ///
                /// Note: The window manager may also wish to set the XCURSOR_THEME and
                /// XCURSOR_SIZE environment variable for programs it starts.
                set_xcursor_theme: struct {
                    name: [*:0]const u8,
                    size: u32,
                },

                /// Warp the pointer to the given position in the compositor's logical
                /// coordinate space.
                ///
                /// If the given position is outside the bounds of all outputs, the pointer
                /// will be warped to the closest point inside an output instead.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                pointer_warp: struct {
                    x: i32,
                    y: i32,
                },
            };
            pub inline fn setHandler(
                _seat_v1: *SeatV1,
                comptime T: type,
                handle_request: *const fn (_seat_v1: *SeatV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_seat_v1: *SeatV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                _resource.setDispatcher(
                    common.Dispatcher(SeatV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*SeatV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that seat is no longer in use and should be
            /// destroyed.
            ///
            /// The server will send no further events on this object and ignore any
            /// request (other than river_seat_v1.destroy) made after this event is
            /// sent.  The client should destroy this object with the
            /// river_seat_v1.destroy request to free up resources.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendRemoved(_seat_v1: *SeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                _resource.postEvent(0, null);
            }
            pub const removed_since_version = 1;

            /// The wl_seat object corresponding to the river_seat_v1. The argument is
            /// the global name of the wl_seat advertised with wl_registry.global.
            ///
            /// It is guaranteed that the corresponding wl_seat is advertised before
            /// this event is sent.
            ///
            /// This event is sent exactly once. The wl_seat associated with a
            /// river_seat_v1 cannot change. It is guaranteed that there is a 1-to-1
            /// mapping between wl_seat and river_seat_v1 objects.
            ///
            /// The global_remove event for the corresponding wl_seat may be sent before
            /// the river_seat_v1.removed event. This is due to the fact that
            /// river_seat_v1 state changes are synced to the river window management
            /// manage sequence while changes to globals are not.
            ///
            /// Rationale: The window manager may want to trigger window management
            /// state changes based on normal input events received by its shell
            /// surfaces for example.
            pub fn sendWlSeat(_seat_v1: *SeatV1, _name: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .u = _name },
                };
                _resource.postEvent(1, &_args);
            }
            pub const wl_seat_since_version = 1;

            /// The seat's pointer entered the given window's area.
            ///
            /// The area of a window is defined to include the area defined by the
            /// window dimensions, borders configured using river_window_v1.set_borders,
            /// and the input regions of decoration surfaces. In particular, it does not
            /// include input regions of surfaces belonging to the window that extend
            /// outside the window dimensions.
            ///
            /// The pointer of a seat may only enter a single window at a time. When the
            /// pointer moves between windows, the pointer_leave event for the old
            /// window must be sent before the pointer_enter event for the new window.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendPointerEnter(_seat_v1: *SeatV1, _window: *server.river.WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_window) },
                };
                _resource.postEvent(2, &_args);
            }
            pub const pointer_enter_since_version = 1;

            /// The seat's pointer left the window for which pointer_enter was most
            /// recently sent. See pointer_enter for details.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendPointerLeave(_seat_v1: *SeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                _resource.postEvent(3, null);
            }
            pub const pointer_leave_since_version = 1;

            /// A window has been interacted with beyond the pointer merely passing over
            /// it. This event might be sent due to a pointer button press or due to a
            /// touch/tablet tool interaction with the window.
            ///
            /// There are no guarantees regarding how this event is sent in relation to
            /// the pointer_enter and pointer_leave events as the interaction may use
            /// touch or tablet tool input.
            ///
            /// Rationale: this event gives window managers necessary information to
            /// determine when to send keyboard focus, raise a window that already has
            /// keyboard focus, etc. Rather than expose all pointer, touch, and tablet
            /// events to window managers, a policy over mechanism approach is taken.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendWindowInteraction(_seat_v1: *SeatV1, _window: *server.river.WindowV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_window) },
                };
                _resource.postEvent(4, &_args);
            }
            pub const window_interaction_since_version = 1;

            /// A shell surface has been interacted with beyond the pointer merely
            /// passing over it. This event might be sent due to a pointer button press
            /// or due to a touch/tablet tool interaction with the shell_surface.
            ///
            /// There are no guarantees regarding how this event is sent in relation to
            /// the pointer_enter and pointer_leave events as the interaction may use
            /// touch or tablet tool input.
            ///
            /// Rationale: While the shell surface does receive all wl_pointer,
            /// wl_touch, etc. input events for the surface directly, these events do
            /// not necessarily trigger a manage sequence and therefore do not allow the
            /// window manager to update focus or perform other actions in response to
            /// the input in a race-free way.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendShellSurfaceInteraction(_seat_v1: *SeatV1, _shell_surface: *server.river.ShellSurfaceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_shell_surface) },
                };
                _resource.postEvent(5, &_args);
            }
            pub const shell_surface_interaction_since_version = 1;

            /// This event indicates the total change in position since the start of the
            /// operation of the pointer/touch point/etc.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendOpDelta(_seat_v1: *SeatV1, _dx: i32, _dy: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .i = _dx },
                    .{ .i = _dy },
                };
                _resource.postEvent(6, &_args);
            }
            pub const op_delta_since_version = 1;

            /// The input driving the current interactive operation has been released.
            /// For a pointer op for example, all pointer buttons have been released.
            ///
            /// Depending on the op type, op_delta events may continue to be sent until
            /// the op is ended with the op_end request.
            ///
            /// This event is sent at most once during an interactive operation.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendOpRelease(_seat_v1: *SeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                _resource.postEvent(7, null);
            }
            pub const op_release_since_version = 1;

            /// The current position of the pointer in the compositor's logical
            /// coordinate space.
            ///
            /// This state is special in that a change in pointer position alone must
            /// not cause the compositor to start a manage sequence.
            ///
            /// Assuming the seat has a pointer, this event must be sent in every manage
            /// sequence unless there is no change in x/y position since the last time this
            /// event was sent.
            pub fn sendPointerPosition(_seat_v1: *SeatV1, _x: i32, _y: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_seat_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                };
                _resource.postEvent(8, &_args);
            }
            pub const pointer_position_since_version = 2;
        };

        /// This object allows the window manager to configure a pointer binding and
        /// receive events when the binding is triggered.
        ///
        /// The new pointer binding is not enabled until the enable request is made
        /// during a manage sequence.
        ///
        /// Normally, all pointer button events are sent to the surface with pointer
        /// focus by the compositor. Pointer button events that trigger a pointer
        /// binding are not sent to the surface with pointer focus.
        ///
        /// If multiple pointer bindings would be triggered by a single physical
        /// pointer event on the compositor side, it is compositor policy which
        /// pointer binding(s) will receive press/release events or if all of the
        /// matched pointer bindings receive press/release events.
        pub const PointerBindingV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.river.pointer_binding_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*PointerBindingV1 {
                return @ptrCast(try server.wl.Resource.create(_client, PointerBindingV1, _version, _id));
            }
            pub inline fn destroy(_pointer_binding_v1: *PointerBindingV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *PointerBindingV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_pointer_binding_v1: *PointerBindingV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).getLink();
            }
            pub inline fn getClient(_pointer_binding_v1: *PointerBindingV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).getClient();
            }
            pub inline fn getId(_pointer_binding_v1: *PointerBindingV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).getId();
            }
            pub inline fn getVersion(_pointer_binding_v1: *PointerBindingV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).getVersion();
            }
            pub inline fn postNoMemory(_pointer_binding_v1: *PointerBindingV1) void {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).postNoMemory();
            }
            pub inline fn getUserData(_pointer_binding_v1: *PointerBindingV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_pointer_binding_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const enable_since_version = 1;
                pub const disable_since_version = 1;

                /// This request indicates that the client will no longer use the pointer
                /// binding object and that it may be safely destroyed.
                destroy: void,
                /// This request should be made after all initial configuration has been
                /// completed and the window manager wishes the pointer binding to be able
                /// to be triggered.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                enable: void,
                /// This request may be used to temporarily disable the pointer binding. It
                /// may be later re-enabled with the enable request.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                disable: void,
            };
            pub inline fn setHandler(
                _pointer_binding_v1: *PointerBindingV1,
                comptime T: type,
                handle_request: *const fn (_pointer_binding_v1: *PointerBindingV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_pointer_binding_v1: *PointerBindingV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_binding_v1);
                _resource.setDispatcher(
                    common.Dispatcher(PointerBindingV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*PointerBindingV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the pointer button triggering the binding has
            /// been pressed.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The compositor should wait for the manage sequence to complete before
            /// processing further input events. This allows the window manager client
            /// to, for example, modify key bindings and keyboard focus without racing
            /// against future input events. The window manager should of course respond
            /// as soon as possible as the capacity of the compositor to buffer incoming
            /// input events is finite.
            pub fn sendPressed(_pointer_binding_v1: *PointerBindingV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_binding_v1);
                _resource.postEvent(0, null);
            }
            pub const pressed_since_version = 1;

            /// This event indicates that the pointer button triggering the binding has
            /// been released.
            ///
            /// Releasing the modifiers for the binding without releasing the pointer
            /// button does not trigger the release event. This event is sent when the
            /// pointer button is released, even if the modifiers have changed since the
            /// pressed event.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The compositor should wait for the manage sequence to complete before
            /// processing further input events. This allows the window manager client
            /// to, for example, modify key bindings and keyboard focus without racing
            /// against future input events. The window manager should of course respond
            /// as soon as possible as the capacity of the compositor to buffer incoming
            /// input events is finite.
            pub fn sendReleased(_pointer_binding_v1: *PointerBindingV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_pointer_binding_v1);
                _resource.postEvent(1, null);
            }
            pub const released_since_version = 1;
        };

        /// This global interface should only be advertised to the client if the
        /// river_window_manager_v1 global is also advertised.
        pub const XkbBindingsV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_bindings_v1.interface;
            pub const Error = common.river.xkb_bindings_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbBindingsV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbBindingsV1, _version, _id));
            }
            pub inline fn destroy(_xkb_bindings_v1: *XkbBindingsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbBindingsV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_bindings_v1: *XkbBindingsV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).getLink();
            }
            pub inline fn getClient(_xkb_bindings_v1: *XkbBindingsV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).getClient();
            }
            pub inline fn getId(_xkb_bindings_v1: *XkbBindingsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).getId();
            }
            pub inline fn getVersion(_xkb_bindings_v1: *XkbBindingsV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_bindings_v1: *XkbBindingsV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_bindings_v1: *XkbBindingsV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).getUserData();
            }
            pub inline fn postError(_xkb_bindings_v1: *XkbBindingsV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_xkb_binding_since_version = 1;
                pub const get_seat_since_version = 2;

                /// This request indicates that the client will no longer use the
                /// river_xkb_bindings_v1 object.
                destroy: void,
                /// Define a key binding for the given seat in terms of an xkbcommon keysym
                /// and other configurable properties.
                ///
                /// The new key binding is not enabled until initial configuration is
                /// completed and the enable request is made during a manage sequence.
                get_xkb_binding: struct {
                    seat: *server.river.SeatV1,
                    id: u32,
                    keysym: u32,
                    modifiers: common.river.seat_v1.Modifiers,
                },

                /// Create an object to manage seat-specific xkb bindings state.
                ///
                /// It is a protocol error to make this request more than once for a given
                /// river_seat_v1 object.
                get_seat: struct {
                    id: u32,
                    seat: *server.river.SeatV1,
                },
            };
            pub inline fn setHandler(
                _xkb_bindings_v1: *XkbBindingsV1,
                comptime T: type,
                handle_request: *const fn (_xkb_bindings_v1: *XkbBindingsV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_bindings_v1: *XkbBindingsV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_bindings_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbBindingsV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbBindingsV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This object allows the window manager to configure a xkbcommon key binding
        /// and receive events when the key binding is triggered.
        ///
        /// The new key binding is not enabled until the enable request is made during
        /// a manage sequence.
        ///
        /// Normally, all key events are sent to the surface with keyboard focus by
        /// the compositor. Key events that trigger a key binding are not sent to the
        /// surface with keyboard focus.
        ///
        /// If multiple key bindings would be triggered by a single physical key event
        /// on the compositor side, it is compositor policy which key binding(s) will
        /// receive press/release events or if all of the matched key bindings receive
        /// press/release events.
        ///
        /// Key bindings might be matched by the same physical key event due to shared
        /// keysym and modifiers. The layout override feature may also cause the same
        /// physical key event to trigger two key bindings with different keysyms and
        /// different layout overrides configured.
        pub const XkbBindingV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_binding_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbBindingV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbBindingV1, _version, _id));
            }
            pub inline fn destroy(_xkb_binding_v1: *XkbBindingV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbBindingV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_binding_v1: *XkbBindingV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).getLink();
            }
            pub inline fn getClient(_xkb_binding_v1: *XkbBindingV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).getClient();
            }
            pub inline fn getId(_xkb_binding_v1: *XkbBindingV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).getId();
            }
            pub inline fn getVersion(_xkb_binding_v1: *XkbBindingV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_binding_v1: *XkbBindingV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_binding_v1: *XkbBindingV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_binding_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_layout_override_since_version = 1;
                pub const enable_since_version = 1;
                pub const disable_since_version = 1;

                /// This request indicates that the client will no longer use the xkb key
                /// binding object and that it may be safely destroyed.
                destroy: void,
                /// Specify an xkb layout that should be used to translate key events for
                /// the purpose of triggering this key binding irrespective of the currently
                /// active xkb layout.
                ///
                /// The layout argument is a 0-indexed xkbcommon layout number for the
                /// keyboard that generated the key event.
                ///
                /// If this request is never made, the currently active xkb layout of the
                /// keyboard that generated the key event will be used.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                set_layout_override: struct {
                    layout: u32,
                },

                /// This request should be made after all initial configuration has been
                /// completed and the window manager wishes the key binding to be able to be
                /// triggered.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                enable: void,
                /// This request may be used to temporarily disable the key binding. It may
                /// be later re-enabled with the enable request.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                disable: void,
            };
            pub inline fn setHandler(
                _xkb_binding_v1: *XkbBindingV1,
                comptime T: type,
                handle_request: *const fn (_xkb_binding_v1: *XkbBindingV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_binding_v1: *XkbBindingV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_binding_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbBindingV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbBindingV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the physical key triggering the binding has
            /// been pressed.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The compositor should wait for the manage sequence to complete before
            /// processing further input events. This allows the window manager client
            /// to, for example, modify key bindings and keyboard focus without racing
            /// against future input events. The window manager should of course respond
            /// as soon as possible as the capacity of the compositor to buffer incoming
            /// input events is finite.
            pub fn sendPressed(_xkb_binding_v1: *XkbBindingV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_binding_v1);
                _resource.postEvent(0, null);
            }
            pub const pressed_since_version = 1;

            /// This event indicates that the physical key triggering the binding has
            /// been released.
            ///
            /// Releasing the modifiers for the binding without releasing the "main"
            /// physical key that produces the bound keysym does not trigger the release
            /// event. This event is sent when the "main" key is released, even if the
            /// modifiers have changed since the pressed event.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            ///
            /// The compositor should wait for the manage sequence to complete before
            /// processing further input events. This allows the window manager client
            /// to, for example, modify key bindings and keyboard focus without racing
            /// against future input events. The window manager should of course respond
            /// as soon as possible as the capacity of the compositor to buffer incoming
            /// input events is finite.
            pub fn sendReleased(_xkb_binding_v1: *XkbBindingV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_binding_v1);
                _resource.postEvent(1, null);
            }
            pub const released_since_version = 1;

            /// This event indicates that repeating should be stopped for the binding if
            /// the window manager has been repeating some action since the pressed
            /// event.
            ///
            /// This event is generally sent when some other (possible unbound) key is
            /// pressed after the pressed event is sent and before the released event
            /// is sent for this binding.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendStopRepeat(_xkb_binding_v1: *XkbBindingV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_binding_v1);
                _resource.postEvent(2, null);
            }
            pub const stop_repeat_since_version = 2;
        };

        /// This object manages xkb bindings state associated with a specific seat.
        pub const XkbBindingsSeatV1 = opaque {
            pub const generated_version = 2;
            pub const interface = &common.river.xkb_bindings_seat_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbBindingsSeatV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbBindingsSeatV1, _version, _id));
            }
            pub inline fn destroy(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbBindingsSeatV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).getLink();
            }
            pub inline fn getClient(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).getClient();
            }
            pub inline fn getId(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).getId();
            }
            pub inline fn getVersion(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_bindings_seat_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 2;
                pub const ensure_next_key_eaten_since_version = 2;
                pub const cancel_ensure_next_key_eaten_since_version = 2;

                /// This request indicates that the client will no longer use the object and
                /// that it may be safely destroyed.
                destroy: void,
                /// Ensure that the next non-modifier key press and corresponding release
                /// events for this seat are not sent to the currently focused surface.
                ///
                /// If the next non-modifier key press triggers a binding, the
                /// pressed/released events are sent to the river_xkb_binding_v1 object as
                /// usual.
                ///
                /// If the next non-modifier key press does not trigger a binding, the
                /// ate_unbound_key event is sent instead.
                ///
                /// Rationale: the window manager may wish to implement "chorded"
                /// keybindings where triggering a binding activates a "submap" with a
                /// different set of keybindings. Without a way to eat the next key
                /// press event, there is no good way for the window manager to know that it
                /// should error out and exit the submap when a key not bound in the submap
                /// is pressed.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                ensure_next_key_eaten: void,
                /// This requests cancels the effect of the latest ensure_next_key_eaten
                /// request if no key has been eaten due to the request yet. This request
                /// has no effect if a key has already been eaten or no
                /// ensure_next_key_eaten was made.
                ///
                /// Rationale: the window manager may wish cancel an uncompleted "chorded"
                /// keybinding after a timeout of a few seconds. Note that since this
                /// timeout use-case requires the window manager to trigger a manage sequence
                /// with the river_window_manager_v1.manage_dirty request it is possible that
                /// the ate_unbound_key key event may be sent before the window manager has
                /// a chance to make the cancel_ensure_next_key_eaten request.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                cancel_ensure_next_key_eaten: void,
            };
            pub inline fn setHandler(
                _xkb_bindings_seat_v1: *XkbBindingsSeatV1,
                comptime T: type,
                handle_request: *const fn (_xkb_bindings_seat_v1: *XkbBindingsSeatV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_bindings_seat_v1: *XkbBindingsSeatV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_bindings_seat_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbBindingsSeatV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbBindingsSeatV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// An unbound key press event was eaten due to the ensure_next_key_eaten
            /// request.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendAteUnboundKey(_xkb_bindings_seat_v1: *XkbBindingsSeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_bindings_seat_v1);
                _resource.postEvent(0, null);
            }
            pub const ate_unbound_key_since_version = 2;
        };

        /// This global interface should only be advertised to the client if the
        /// river_window_manager_v1 global is also advertised. Binding this interface
        /// indicates that the window manager supports layer shell.
        ///
        /// If the window manager does not bind this interface, the compositor should
        /// not allow clients to map layer surfaces. This can be achieved by
        /// closing layer surfaces immediately.
        pub const LayerShellV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_v1.interface;
            pub const Error = common.river.layer_shell_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LayerShellV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LayerShellV1, _version, _id));
            }
            pub inline fn destroy(_layer_shell_v1: *LayerShellV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LayerShellV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_layer_shell_v1: *LayerShellV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getLink();
            }
            pub inline fn getClient(_layer_shell_v1: *LayerShellV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getClient();
            }
            pub inline fn getId(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getVersion();
            }
            pub inline fn postNoMemory(_layer_shell_v1: *LayerShellV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).postNoMemory();
            }
            pub inline fn getUserData(_layer_shell_v1: *LayerShellV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getUserData();
            }
            pub inline fn postError(_layer_shell_v1: *LayerShellV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const get_output_since_version = 1;
                pub const get_seat_since_version = 1;

                /// This request indicates that the client will no longer use the
                /// river_layer_shell_v1 object.
                destroy: void,
                /// It is a protocol error to make this request more than once for a given
                /// river_output_v1 object.
                get_output: struct {
                    id: u32,
                    output: *server.river.OutputV1,
                },

                /// It is a protocol error to make this request more than once for a given
                /// river_seat_v1 object.
                get_seat: struct {
                    id: u32,
                    seat: *server.river.SeatV1,
                },
            };
            pub inline fn setHandler(
                _layer_shell_v1: *LayerShellV1,
                comptime T: type,
                handle_request: *const fn (_layer_shell_v1: *LayerShellV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_layer_shell_v1: *LayerShellV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LayerShellV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LayerShellV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The lifetime of this object is tied to the corresponding river_output_v1.
        /// This object is made inert when the river_output_v1.removed event is sent
        /// and should be destroyed.
        pub const LayerShellOutputV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_output_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LayerShellOutputV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LayerShellOutputV1, _version, _id));
            }
            pub inline fn destroy(_layer_shell_output_v1: *LayerShellOutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LayerShellOutputV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_layer_shell_output_v1: *LayerShellOutputV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).getLink();
            }
            pub inline fn getClient(_layer_shell_output_v1: *LayerShellOutputV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).getClient();
            }
            pub inline fn getId(_layer_shell_output_v1: *LayerShellOutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_output_v1: *LayerShellOutputV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).getVersion();
            }
            pub inline fn postNoMemory(_layer_shell_output_v1: *LayerShellOutputV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).postNoMemory();
            }
            pub inline fn getUserData(_layer_shell_output_v1: *LayerShellOutputV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_output_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_default_since_version = 1;

                /// This request indicates that the client will no longer use the
                /// river_layer_shell_output_v1 object and that it may be safely destroyed.
                ///
                /// This request should be made after the river_output_v1.removed event is
                /// received to complete destruction of the output.
                destroy: void,
                /// Mark this output as the default for new layer surfaces which do not
                /// request a specific output themselves. This request overrides any
                /// previous set_default request on any river_layer_shell_output_v1 object.
                ///
                /// If no set_default request is made or if the default output is destroyed,
                /// the default output is undefined until the next set_default request.
                ///
                /// This request modifies window management state and may only be made as
                /// part of a manage sequence, see the river_window_manager_v1 description.
                set_default: void,
            };
            pub inline fn setHandler(
                _layer_shell_output_v1: *LayerShellOutputV1,
                comptime T: type,
                handle_request: *const fn (_layer_shell_output_v1: *LayerShellOutputV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_layer_shell_output_v1: *LayerShellOutputV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_output_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LayerShellOutputV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LayerShellOutputV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates the area of the output remaining after subtracting
            /// the exclusive zones of layer surfaces. Exclusive zones are a hint, the
            /// window manager is free to ignore this area hint if it wishes.
            ///
            /// The x and y values are in the global coordinate space, not relative to
            /// the position of the output.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendNonExclusiveArea(_layer_shell_output_v1: *LayerShellOutputV1, _x: i32, _y: i32, _width: i32, _height: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_output_v1);
                var _args = [_]common.Argument{
                    .{ .i = _x },
                    .{ .i = _y },
                    .{ .i = _width },
                    .{ .i = _height },
                };
                _resource.postEvent(0, &_args);
            }
            pub const non_exclusive_area_since_version = 1;
        };

        /// The lifetime of this object is tied to the corresponding river_seat_v1.
        /// This object is made inert when the river_seat_v1.removed event is sent and
        /// should be destroyed.
        pub const LayerShellSeatV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.layer_shell_seat_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LayerShellSeatV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LayerShellSeatV1, _version, _id));
            }
            pub inline fn destroy(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LayerShellSeatV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_layer_shell_seat_v1: *LayerShellSeatV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).getLink();
            }
            pub inline fn getClient(_layer_shell_seat_v1: *LayerShellSeatV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).getClient();
            }
            pub inline fn getId(_layer_shell_seat_v1: *LayerShellSeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_seat_v1: *LayerShellSeatV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).getVersion();
            }
            pub inline fn postNoMemory(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).postNoMemory();
            }
            pub inline fn getUserData(_layer_shell_seat_v1: *LayerShellSeatV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_seat_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// This request indicates that the client will no longer use the
                /// river_layer_shell_seat_v1 object and that it may be safely destroyed.
                ///
                /// This request should be made after the river_seat_v1.removed event is
                /// received to complete destruction of the seat.
                destroy: void,
            };
            pub inline fn setHandler(
                _layer_shell_seat_v1: *LayerShellSeatV1,
                comptime T: type,
                handle_request: *const fn (_layer_shell_seat_v1: *LayerShellSeatV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_layer_shell_seat_v1: *LayerShellSeatV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_seat_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LayerShellSeatV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LayerShellSeatV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// A layer shell surface will be given exclusive keyboard focus at the end
            /// of the manage sequence in which this event is sent. The window manager
            /// may want to update window decorations or similar to indicate that no
            /// window is focused.
            ///
            /// Until the focus_non_exclusive or focus_none event is sent, all window
            /// manager requests to change focus are ignored.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendFocusExclusive(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_seat_v1);
                _resource.postEvent(0, null);
            }
            pub const focus_exclusive_since_version = 1;

            /// A layer shell surface will be given non-exclusive keyboard focus at the
            /// end of the manage sequence in which this event is sent. The window
            /// manager may want to update window decorations or similar to indicate
            /// that no window is focused.
            ///
            /// The window manager continues to control focus and may choose to focus a
            /// different window/shell surface at any time. If the window manager sets
            /// focus during the same manage sequence in which this event is sent, the
            /// layer surface will not be focused.
            ///
            /// If the layer surface with non-exclusive focus is closed or the window
            /// manager chooses to move focus away from the layer surface, a focus_none
            /// event will be sent in the next manage sequence.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendFocusNonExclusive(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_seat_v1);
                _resource.postEvent(1, null);
            }
            pub const focus_non_exclusive_since_version = 1;

            /// No layer shell surface will have keyboard focus at the end of the manage
            /// sequence in which this event is sent. The window manager may want to
            /// return focus to whichever window last had focus, for example.
            ///
            /// This event will be followed by a manage_start event after all other new
            /// state has been sent by the server.
            pub fn sendFocusNone(_layer_shell_seat_v1: *LayerShellSeatV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_seat_v1);
                _resource.postEvent(2, null);
            }
            pub const focus_none_since_version = 1;
        };

        /// Input manager global interface.
        pub const InputManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.input_manager_v1.interface;
            pub const Error = common.river.input_manager_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*InputManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, InputManagerV1, _version, _id));
            }
            pub inline fn destroy(_input_manager_v1: *InputManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *InputManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_input_manager_v1: *InputManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).getLink();
            }
            pub inline fn getClient(_input_manager_v1: *InputManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).getClient();
            }
            pub inline fn getId(_input_manager_v1: *InputManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).getId();
            }
            pub inline fn getVersion(_input_manager_v1: *InputManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_input_manager_v1: *InputManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_input_manager_v1: *InputManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).getUserData();
            }
            pub inline fn postError(_input_manager_v1: *InputManagerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_input_manager_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const stop_since_version = 1;
                pub const destroy_since_version = 1;
                pub const create_seat_since_version = 1;
                pub const destroy_seat_since_version = 1;

                /// This request indicates that the client no longer wishes to receive
                /// events on this object.
                ///
                /// The Wayland protocol is asynchronous, which means the server may send
                /// further events until the stop request is processed. The client must wait
                /// for a river_input_manager_v1.finished event before destroying this
                /// object.
                stop: void,
                /// This request should be called after the finished event has been received
                /// to complete destruction of the object.
                ///
                /// It is a protocol error to make this request before the finished event
                /// has been received.
                ///
                /// If a client wishes to destroy this object it should send a
                /// river_input_manager_v1.stop request and wait for a
                /// river_input_manager_v1.finished event. Once the finished event is
                /// received it is safe to destroy this object and any other objects created
                /// through this interface.
                destroy: void,
                /// Create a new seat with the given name. Has no effect if a seat with the
                /// given name already exists.
                ///
                /// The default seat with name "default" always exists and does not need to
                /// be explicitly created.
                create_seat: struct {
                    name: [*:0]const u8,
                },

                /// Destroy the seat with the given name. Has no effect if a seat with the
                /// given name does not exist.
                ///
                /// The default seat with name "default" cannot be destroyed and attempting
                /// to destroy it will have no effect.
                ///
                /// Any input devices assigned to the destroyed seat at the time of
                /// destruction are assigned to the default seat.
                destroy_seat: struct {
                    name: [*:0]const u8,
                },
            };
            pub inline fn setHandler(
                _input_manager_v1: *InputManagerV1,
                comptime T: type,
                handle_request: *const fn (_input_manager_v1: *InputManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_input_manager_v1: *InputManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(InputManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*InputManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the server will send no further events on this
            /// object. The client should destroy the object. See
            /// river_input_manager_v1.destroy for more information.
            pub fn sendFinished(_input_manager_v1: *InputManagerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_manager_v1);
                _resource.postEvent(0, null);
            }
            pub const finished_since_version = 1;

            /// A new input device has been created.
            pub fn sendInputDevice(_input_manager_v1: *InputManagerV1, _id: *server.river.InputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_manager_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const input_device_since_version = 1;
        };

        /// An input device represents a physical keyboard, mouse, touchscreen, or
        /// drawing tablet tool. It is assigned to exactly one seat at a time.
        /// By default, all input devices are assigned to the default seat.
        pub const InputDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.input_device_v1.interface;
            pub const Error = common.river.input_device_v1.Error;
            pub const Type = common.river.input_device_v1.Type;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*InputDeviceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, InputDeviceV1, _version, _id));
            }
            pub inline fn destroy(_input_device_v1: *InputDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *InputDeviceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_input_device_v1: *InputDeviceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).getLink();
            }
            pub inline fn getClient(_input_device_v1: *InputDeviceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).getClient();
            }
            pub inline fn getId(_input_device_v1: *InputDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).getId();
            }
            pub inline fn getVersion(_input_device_v1: *InputDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).getVersion();
            }
            pub inline fn postNoMemory(_input_device_v1: *InputDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).postNoMemory();
            }
            pub inline fn getUserData(_input_device_v1: *InputDeviceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).getUserData();
            }
            pub inline fn postError(_input_device_v1: *InputDeviceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_input_device_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const assign_to_seat_since_version = 1;
                pub const set_repeat_info_since_version = 1;
                pub const set_scroll_factor_since_version = 1;
                pub const map_to_output_since_version = 1;
                pub const map_to_rectangle_since_version = 1;

                /// This request indicates that the client will no longer use the input
                /// device object and that it may be safely destroyed.
                destroy: void,
                /// Assign the input device to a seat. All input devices not explicitly
                /// assigned to a seat are considered assigned to the default seat.
                ///
                /// Has no effect if a seat with the given name does not exist.
                assign_to_seat: struct {
                    name: [*:0]const u8,
                },

                /// Set repeat rate and delay for a keyboard input device. Has no effect if
                /// the device is not a keyboard.
                ///
                /// Negative values for either rate or delay are illegal. A rate of zero
                /// will disable any repeating (regardless of the value of delay).
                set_repeat_info: struct {
                    rate: i32,
                    delay: i32,
                },

                /// Set the scroll factor for a pointer input device. Has no effect if the
                /// device is not a pointer.
                ///
                /// For example, a factor of 0.5 will make scrolling twice as slow while a
                /// factor of 3.0 will make scrolling 3 times as fast.
                ///
                /// Setting a scroll factor less than 0 is a protocol error.
                set_scroll_factor: struct {
                    factor: common.Fixed,
                },

                /// Map the input device to the given output. Has no effect if the device is
                /// not a pointer, touch, or tablet device.
                ///
                /// If mapped to both an output and a rectangle, the rectangle has priority.
                ///
                /// Passing null clears an existing mapping.
                map_to_output: struct {
                    output: ?*server.wl.Output,
                },

                /// Map the input device to the given rectangle in the global compositor
                /// coordinate space. Has no effect if the device is not a pointer, touch,
                /// or tablet device.
                ///
                /// If mapped to both an output and a rectangle, the rectangle has priority.
                ///
                /// Width and height must be greater than or equal to 0.
                ///
                /// Passing 0 for width or height clears an existing mapping.
                map_to_rectangle: struct {
                    x: i32,
                    y: i32,
                    width: i32,
                    height: i32,
                },
            };
            pub inline fn setHandler(
                _input_device_v1: *InputDeviceV1,
                comptime T: type,
                handle_request: *const fn (_input_device_v1: *InputDeviceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_input_device_v1: *InputDeviceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_device_v1);
                _resource.setDispatcher(
                    common.Dispatcher(InputDeviceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*InputDeviceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the input device has been removed.
            ///
            /// The server will send no further events on this object and ignore any
            /// request (other than river_input_device_v1.destroy) made after this event is
            /// sent. The client should destroy this object with the
            /// river_input_device_v1.destroy request to free up resources.
            pub fn sendRemoved(_input_device_v1: *InputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_device_v1);
                _resource.postEvent(0, null);
            }
            pub const removed_since_version = 1;

            /// The type of the input device. This event is sent once when the
            /// river_input_device_v1 object is created. The device type cannot
            /// change during the lifetime of the object.
            pub fn sendType(_input_device_v1: *InputDeviceV1, _type: Type) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Type)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_type))),
                        .@"struct" => @bitCast(_type),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(1, &_args);
            }
            pub const type_since_version = 1;

            /// The name of the input device. This event is sent once when the
            /// river_input_device_v1 object is created. The device name cannot
            /// change during the lifetime of the object.
            pub fn sendName(_input_device_v1: *InputDeviceV1, _name: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_input_device_v1);
                var _args = [_]common.Argument{
                    .{ .s = _name },
                };
                _resource.postEvent(2, &_args);
            }
            pub const name_since_version = 1;
        };

        /// Global interface for configuring libinput devices. This global should
        /// only be advertised if river_input_manager_v1 is advertised as well.
        pub const LibinputConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_config_v1.interface;
            pub const Error = common.river.libinput_config_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LibinputConfigV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LibinputConfigV1, _version, _id));
            }
            pub inline fn destroy(_libinput_config_v1: *LibinputConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LibinputConfigV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_libinput_config_v1: *LibinputConfigV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).getLink();
            }
            pub inline fn getClient(_libinput_config_v1: *LibinputConfigV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).getClient();
            }
            pub inline fn getId(_libinput_config_v1: *LibinputConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).getId();
            }
            pub inline fn getVersion(_libinput_config_v1: *LibinputConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).getVersion();
            }
            pub inline fn postNoMemory(_libinput_config_v1: *LibinputConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).postNoMemory();
            }
            pub inline fn getUserData(_libinput_config_v1: *LibinputConfigV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).getUserData();
            }
            pub inline fn postError(_libinput_config_v1: *LibinputConfigV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_config_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const stop_since_version = 1;
                pub const destroy_since_version = 1;
                pub const create_accel_config_since_version = 1;

                /// This request indicates that the client no longer wishes to receive
                /// events on this object.
                ///
                /// The Wayland protocol is asynchronous, which means the server may send
                /// further events until the stop request is processed. The client must wait
                /// for a river_libinput_config_v1.finished event before destroying this
                /// object.
                stop: void,
                /// This request should be called after the finished event has been received
                /// to complete destruction of the object.
                ///
                /// It is a protocol error to make this request before the finished event
                /// has been received.
                ///
                /// If a client wishes to destroy this object it should send a
                /// river_libinput_config_v1.stop request and wait for a
                /// river_libinput_config_v1.finished event. Once the finished event is
                /// received it is safe to destroy this object and any other objects created
                /// through this interface.
                destroy: void,
                /// Create a acceleration config which can be applied
                /// with river_libinput_device_v1.apply_accel_config.
                create_accel_config: struct {
                    id: u32,
                    profile: common.river.libinput_device_v1.AccelProfile,
                },
            };
            pub inline fn setHandler(
                _libinput_config_v1: *LibinputConfigV1,
                comptime T: type,
                handle_request: *const fn (_libinput_config_v1: *LibinputConfigV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_libinput_config_v1: *LibinputConfigV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_config_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LibinputConfigV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LibinputConfigV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the server will send no further events on this
            /// object. The client should destroy the object. See
            /// river_libinput_config_v1.destroy for more information.
            pub fn sendFinished(_libinput_config_v1: *LibinputConfigV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_config_v1);
                _resource.postEvent(0, null);
            }
            pub const finished_since_version = 1;

            /// A new libinput device has been created. Not every river_input_device_v1
            /// is necessarily a libinput device as well.
            pub fn sendLibinputDevice(_libinput_config_v1: *LibinputConfigV1, _id: *server.river.LibinputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_config_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const libinput_device_since_version = 1;
        };

        /// The result returned by libinput on setting configuration for a device.
        pub const LibinputAccelConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_accel_config_v1.interface;
            pub const Error = common.river.libinput_accel_config_v1.Error;
            pub const AccelType = common.river.libinput_accel_config_v1.AccelType;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LibinputAccelConfigV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LibinputAccelConfigV1, _version, _id));
            }
            pub inline fn destroy(_libinput_accel_config_v1: *LibinputAccelConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LibinputAccelConfigV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_libinput_accel_config_v1: *LibinputAccelConfigV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).getLink();
            }
            pub inline fn getClient(_libinput_accel_config_v1: *LibinputAccelConfigV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).getClient();
            }
            pub inline fn getId(_libinput_accel_config_v1: *LibinputAccelConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).getId();
            }
            pub inline fn getVersion(_libinput_accel_config_v1: *LibinputAccelConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).getVersion();
            }
            pub inline fn postNoMemory(_libinput_accel_config_v1: *LibinputAccelConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).postNoMemory();
            }
            pub inline fn getUserData(_libinput_accel_config_v1: *LibinputAccelConfigV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).getUserData();
            }
            pub inline fn postError(_libinput_accel_config_v1: *LibinputAccelConfigV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_accel_config_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_points_since_version = 1;

                /// This request indicates that the client will no longer use the accel
                /// config object and that it may be safely destroyed.
                destroy: void,
                /// Defines the acceleration function for a given movement type
                /// in an acceleration configuration with custom accel profile.
                set_points: struct {
                    result: u32,
                    type: AccelType,
                    step: *common.Array,
                    points: *common.Array,
                },
            };
            pub inline fn setHandler(
                _libinput_accel_config_v1: *LibinputAccelConfigV1,
                comptime T: type,
                handle_request: *const fn (_libinput_accel_config_v1: *LibinputAccelConfigV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_libinput_accel_config_v1: *LibinputAccelConfigV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_accel_config_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LibinputAccelConfigV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LibinputAccelConfigV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// The result returned by libinput on setting configuration for a device.
        pub const LibinputResultV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_result_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LibinputResultV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LibinputResultV1, _version, _id));
            }
            pub inline fn destroy(_libinput_result_v1: *LibinputResultV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LibinputResultV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_libinput_result_v1: *LibinputResultV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).getLink();
            }
            pub inline fn getClient(_libinput_result_v1: *LibinputResultV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).getClient();
            }
            pub inline fn getId(_libinput_result_v1: *LibinputResultV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).getId();
            }
            pub inline fn getVersion(_libinput_result_v1: *LibinputResultV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).getVersion();
            }
            pub inline fn postNoMemory(_libinput_result_v1: *LibinputResultV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).postNoMemory();
            }
            pub inline fn getUserData(_libinput_result_v1: *LibinputResultV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_libinput_result_v1)).getUserData();
            }
            pub inline fn setHandler(
                _libinput_result_v1: *LibinputResultV1,
                comptime T: type,
                comptime handle_destroy: ?fn (_libinput_result_v1: *LibinputResultV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_result_v1);
                _resource.setDispatcher(
                    null,
                    null,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LibinputResultV1, @ptrCast(__resource)),
                                @as(?*anyopaque, @ptrFromInt(@intFromPtr(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The configuration was successfully applied to the device.
            pub fn destroySendSuccess(_libinput_result_v1: *LibinputResultV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_result_v1);
                _resource.postEvent(0, null);
                _resource.destroy();
            }
            pub const success_since_version = 1;

            /// The configuration is unsupported by the device and was ignored.
            pub fn destroySendUnsupported(_libinput_result_v1: *LibinputResultV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_result_v1);
                _resource.postEvent(1, null);
                _resource.destroy();
            }
            pub const unsupported_since_version = 1;

            /// The configuration is invalid and was ignored.
            pub fn destroySendInvalid(_libinput_result_v1: *LibinputResultV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_result_v1);
                _resource.postEvent(2, null);
                _resource.destroy();
            }
            pub const invalid_since_version = 1;
        };

        /// In general, *_support events will be sent exactly once directly after the
        /// river_libinput_device_v1 is created. *_default events will be sent after
        /// *_support events if the config option is supported, and *_current events
        /// willl be sent after the *_default events and again whenever the config
        /// option is changed.
        pub const LibinputDeviceV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.libinput_device_v1.interface;
            pub const Error = common.river.libinput_device_v1.Error;
            pub const SendEventsModes = common.river.libinput_device_v1.SendEventsModes;
            pub const TapState = common.river.libinput_device_v1.TapState;
            pub const TapButtonMap = common.river.libinput_device_v1.TapButtonMap;
            pub const DragState = common.river.libinput_device_v1.DragState;
            pub const DragLockState = common.river.libinput_device_v1.DragLockState;
            pub const ThreeFingerDragState = common.river.libinput_device_v1.ThreeFingerDragState;
            pub const AccelProfile = common.river.libinput_device_v1.AccelProfile;
            pub const AccelProfiles = common.river.libinput_device_v1.AccelProfiles;
            pub const NaturalScrollState = common.river.libinput_device_v1.NaturalScrollState;
            pub const LeftHandedState = common.river.libinput_device_v1.LeftHandedState;
            pub const ClickMethod = common.river.libinput_device_v1.ClickMethod;
            pub const ClickMethods = common.river.libinput_device_v1.ClickMethods;
            pub const ClickfingerButtonMap = common.river.libinput_device_v1.ClickfingerButtonMap;
            pub const MiddleEmulationState = common.river.libinput_device_v1.MiddleEmulationState;
            pub const ScrollMethod = common.river.libinput_device_v1.ScrollMethod;
            pub const ScrollMethods = common.river.libinput_device_v1.ScrollMethods;
            pub const ScrollButtonLockState = common.river.libinput_device_v1.ScrollButtonLockState;
            pub const DwtState = common.river.libinput_device_v1.DwtState;
            pub const DwtpState = common.river.libinput_device_v1.DwtpState;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LibinputDeviceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LibinputDeviceV1, _version, _id));
            }
            pub inline fn destroy(_libinput_device_v1: *LibinputDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LibinputDeviceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_libinput_device_v1: *LibinputDeviceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).getLink();
            }
            pub inline fn getClient(_libinput_device_v1: *LibinputDeviceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).getClient();
            }
            pub inline fn getId(_libinput_device_v1: *LibinputDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).getId();
            }
            pub inline fn getVersion(_libinput_device_v1: *LibinputDeviceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).getVersion();
            }
            pub inline fn postNoMemory(_libinput_device_v1: *LibinputDeviceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).postNoMemory();
            }
            pub inline fn getUserData(_libinput_device_v1: *LibinputDeviceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).getUserData();
            }
            pub inline fn postError(_libinput_device_v1: *LibinputDeviceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_libinput_device_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_send_events_since_version = 1;
                pub const set_tap_since_version = 1;
                pub const set_tap_button_map_since_version = 1;
                pub const set_drag_since_version = 1;
                pub const set_drag_lock_since_version = 1;
                pub const set_three_finger_drag_since_version = 1;
                pub const set_calibration_matrix_since_version = 1;
                pub const set_accel_profile_since_version = 1;
                pub const set_accel_speed_since_version = 1;
                pub const apply_accel_config_since_version = 1;
                pub const set_natural_scroll_since_version = 1;
                pub const set_left_handed_since_version = 1;
                pub const set_click_method_since_version = 1;
                pub const set_clickfinger_button_map_since_version = 1;
                pub const set_middle_emulation_since_version = 1;
                pub const set_scroll_method_since_version = 1;
                pub const set_scroll_button_since_version = 1;
                pub const set_scroll_button_lock_since_version = 1;
                pub const set_dwt_since_version = 1;
                pub const set_dwtp_since_version = 1;
                pub const set_rotation_since_version = 1;

                /// This request indicates that the client will no longer use the input
                /// device object and that it may be safely destroyed.
                destroy: void,
                /// Set the send events mode for the device.
                set_send_events: struct {
                    result: u32,
                    mode: SendEventsModes,
                },

                /// Configure tap-to-click on this device, with a default mapping of
                /// 1, 2, 3 finger tap mapping to left, right, middle click, respectively.
                set_tap: struct {
                    result: u32,
                    state: TapState,
                },

                /// Set the finger number to button number mapping for tap-to-click. The
                /// default mapping on most devices is to have a 1, 2 and 3 finger tap to
                /// map to the left, right and middle button, respectively.
                set_tap_button_map: struct {
                    result: u32,
                    button_map: TapButtonMap,
                },

                /// Configure tap-and-drag functionality on the device.
                set_drag: struct {
                    result: u32,
                    state: DragState,
                },

                /// Configure drag-lock during tapping on this device. When enabled, a
                /// finger may be lifted and put back on the touchpad and the drag process
                /// continues. A timeout for lifting the finger is optional. When disabled,
                /// lifting the finger during a tap-and-drag will immediately stop the drag.
                /// See the libinput documentation for more details.
                set_drag_lock: struct {
                    result: u32,
                    state: DragLockState,
                },

                /// Configure three finger drag functionality for the device.
                set_three_finger_drag: struct {
                    result: u32,
                    state: ThreeFingerDragState,
                },

                /// Set calibration matrix.
                set_calibration_matrix: struct {
                    result: u32,
                    matrix: *common.Array,
                },

                /// Set the acceleration profile.
                set_accel_profile: struct {
                    result: u32,
                    profile: AccelProfile,
                },

                /// Set the acceleration speed within a range of [-1, 1], where 0 is
                /// the default acceleration for this device, -1 is the slowest acceleration
                /// and 1 is the maximum acceleration available on this device.
                set_accel_speed: struct {
                    result: u32,
                    speed: *common.Array,
                },

                /// Apply a pointer accleration config.
                apply_accel_config: struct {
                    result: u32,
                    config: *server.river.LibinputAccelConfigV1,
                },

                /// Set natural scroll state.
                set_natural_scroll: struct {
                    result: u32,
                    state: NaturalScrollState,
                },

                /// Set left-handed mode state.
                set_left_handed: struct {
                    result: u32,
                    state: LeftHandedState,
                },

                /// Set click method.
                set_click_method: struct {
                    result: u32,
                    method: ClickMethod,
                },

                /// Set clickfinger button map.
                /// Supported if click_methods.clickfinger is supported.
                set_clickfinger_button_map: struct {
                    result: u32,
                    button_map: ClickfingerButtonMap,
                },

                /// Set middle mouse button emulation state.
                set_middle_emulation: struct {
                    result: u32,
                    state: MiddleEmulationState,
                },

                /// Set scroll method.
                set_scroll_method: struct {
                    result: u32,
                    method: ScrollMethod,
                },

                /// Set scroll button.
                /// Supported if scroll_methods.on_button_down is supported.
                set_scroll_button: struct {
                    result: u32,
                    button: u32,
                },

                /// Set scroll button lock state.
                /// Supported if scroll_methods.on_button_down is supported.
                set_scroll_button_lock: struct {
                    result: u32,
                    state: ScrollButtonLockState,
                },

                /// Set disable-while-typing state.
                set_dwt: struct {
                    result: u32,
                    state: DwtState,
                },

                /// Set disable-while-trackpointing state.
                set_dwtp: struct {
                    result: u32,
                    state: DwtpState,
                },

                /// Set rotation angle in degrees clockwise off the logical neutral
                /// position. Angle must be in the range [0-360).
                set_rotation: struct {
                    result: u32,
                    angle: u32,
                },
            };
            pub inline fn setHandler(
                _libinput_device_v1: *LibinputDeviceV1,
                comptime T: type,
                handle_request: *const fn (_libinput_device_v1: *LibinputDeviceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_libinput_device_v1: *LibinputDeviceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LibinputDeviceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LibinputDeviceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the libinput device has been removed.
            ///
            /// The server will send no further events on this object and ignore any
            /// request (other than river_libinput_device_v1.destroy) made after this
            /// event is sent. The client should destroy this object with the
            /// river_libinput_device_v1.destroy request to free up resources.
            pub fn sendRemoved(_libinput_device_v1: *LibinputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                _resource.postEvent(0, null);
            }
            pub const removed_since_version = 1;

            /// The river_input_device_v1 corresponding to this libinput device.
            /// This event will always be the first event sent on the
            /// river_libinput_device_v1 object, and it will be sent exactly once.
            pub fn sendInputDevice(_libinput_device_v1: *LibinputDeviceV1, _device: *server.river.InputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_device) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const input_device_since_version = 1;

            /// Supported send events modes.
            pub fn sendSendEventsSupport(_libinput_device_v1: *LibinputDeviceV1, _modes: SendEventsModes) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(SendEventsModes)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_modes))),
                        .@"struct" => @bitCast(_modes),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(2, &_args);
            }
            pub const send_events_support_since_version = 1;

            /// Default send events mode.
            pub fn sendSendEventsDefault(_libinput_device_v1: *LibinputDeviceV1, _mode: SendEventsModes) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(SendEventsModes)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(3, &_args);
            }
            pub const send_events_default_since_version = 1;

            /// Current send events mode.
            pub fn sendSendEventsCurrent(_libinput_device_v1: *LibinputDeviceV1, _mode: SendEventsModes) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(SendEventsModes)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(4, &_args);
            }
            pub const send_events_current_since_version = 1;

            /// The number of fingers supported for tap-to-click/drag.
            /// If finger_count is 0, tap-to-click and drag are unsupported.
            pub fn sendTapSupport(_libinput_device_v1: *LibinputDeviceV1, _finger_count: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _finger_count },
                };
                _resource.postEvent(5, &_args);
            }
            pub const tap_support_since_version = 1;

            /// Default tap-to-click state.
            pub fn sendTapDefault(_libinput_device_v1: *LibinputDeviceV1, _state: TapState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(TapState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(6, &_args);
            }
            pub const tap_default_since_version = 1;

            /// Current tap-to-click state.
            pub fn sendTapCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: TapState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(TapState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(7, &_args);
            }
            pub const tap_current_since_version = 1;

            /// Default tap-to-click button map.
            pub fn sendTapButtonMapDefault(_libinput_device_v1: *LibinputDeviceV1, _button_map: TapButtonMap) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(TapButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(8, &_args);
            }
            pub const tap_button_map_default_since_version = 1;

            /// Current tap-to-click button map.
            pub fn sendTapButtonMapCurrent(_libinput_device_v1: *LibinputDeviceV1, _button_map: TapButtonMap) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(TapButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(9, &_args);
            }
            pub const tap_button_map_current_since_version = 1;

            /// Default tap-and-drag state.
            pub fn sendDragDefault(_libinput_device_v1: *LibinputDeviceV1, _state: DragState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(10, &_args);
            }
            pub const drag_default_since_version = 1;

            /// Current tap-and-drag state.
            pub fn sendDragCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: DragState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(11, &_args);
            }
            pub const drag_current_since_version = 1;

            /// Default drag lock state.
            pub fn sendDragLockDefault(_libinput_device_v1: *LibinputDeviceV1, _state: DragLockState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DragLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(12, &_args);
            }
            pub const drag_lock_default_since_version = 1;

            /// Current drag lock state.
            pub fn sendDragLockCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: DragLockState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DragLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(13, &_args);
            }
            pub const drag_lock_current_since_version = 1;

            /// The number of fingers supported for three/four finger drag.
            /// If finger_count is less than 3, three finger drag is unsupported.
            pub fn sendThreeFingerDragSupport(_libinput_device_v1: *LibinputDeviceV1, _finger_count: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _finger_count },
                };
                _resource.postEvent(14, &_args);
            }
            pub const three_finger_drag_support_since_version = 1;

            /// Default three finger drag state.
            pub fn sendThreeFingerDragDefault(_libinput_device_v1: *LibinputDeviceV1, _state: ThreeFingerDragState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ThreeFingerDragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(15, &_args);
            }
            pub const three_finger_drag_default_since_version = 1;

            /// Current three finger drag state.
            pub fn sendThreeFingerDragCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: ThreeFingerDragState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ThreeFingerDragState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(16, &_args);
            }
            pub const three_finger_drag_current_since_version = 1;

            /// A calibration matrix is supported if the supported argument is non-zero.
            pub fn sendCalibrationMatrixSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(17, &_args);
            }
            pub const calibration_matrix_support_since_version = 1;

            /// Default calibration matrix.
            pub fn sendCalibrationMatrixDefault(_libinput_device_v1: *LibinputDeviceV1, _matrix: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .a = _matrix },
                };
                _resource.postEvent(18, &_args);
            }
            pub const calibration_matrix_default_since_version = 1;

            /// Current calibration matrix.
            pub fn sendCalibrationMatrixCurrent(_libinput_device_v1: *LibinputDeviceV1, _matrix: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .a = _matrix },
                };
                _resource.postEvent(19, &_args);
            }
            pub const calibration_matrix_current_since_version = 1;

            /// Supported acceleration profiles.
            pub fn sendAccelProfilesSupport(_libinput_device_v1: *LibinputDeviceV1, _profiles: AccelProfiles) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(AccelProfiles)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_profiles))),
                        .@"struct" => @bitCast(_profiles),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(20, &_args);
            }
            pub const accel_profiles_support_since_version = 1;

            /// Default acceleration profile.
            pub fn sendAccelProfileDefault(_libinput_device_v1: *LibinputDeviceV1, _profile: AccelProfile) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(AccelProfile)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_profile))),
                        .@"struct" => @bitCast(_profile),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(21, &_args);
            }
            pub const accel_profile_default_since_version = 1;

            /// Current acceleration profile.
            pub fn sendAccelProfileCurrent(_libinput_device_v1: *LibinputDeviceV1, _profile: AccelProfile) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(AccelProfile)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_profile))),
                        .@"struct" => @bitCast(_profile),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(22, &_args);
            }
            pub const accel_profile_current_since_version = 1;

            /// Default acceleration speed.
            pub fn sendAccelSpeedDefault(_libinput_device_v1: *LibinputDeviceV1, _speed: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .a = _speed },
                };
                _resource.postEvent(23, &_args);
            }
            pub const accel_speed_default_since_version = 1;

            /// Current acceleration speed.
            pub fn sendAccelSpeedCurrent(_libinput_device_v1: *LibinputDeviceV1, _speed: *common.Array) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .a = _speed },
                };
                _resource.postEvent(24, &_args);
            }
            pub const accel_speed_current_since_version = 1;

            /// Natural scroll is supported if the supported argument is non-zero.
            pub fn sendNaturalScrollSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(25, &_args);
            }
            pub const natural_scroll_support_since_version = 1;

            /// Default natural scroll.
            pub fn sendNaturalScrollDefault(_libinput_device_v1: *LibinputDeviceV1, _state: NaturalScrollState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(NaturalScrollState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(26, &_args);
            }
            pub const natural_scroll_default_since_version = 1;

            /// Current natural scroll.
            pub fn sendNaturalScrollCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: NaturalScrollState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(NaturalScrollState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(27, &_args);
            }
            pub const natural_scroll_current_since_version = 1;

            /// Left-handed mode is supported if the supported argument is non-zero.
            pub fn sendLeftHandedSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(28, &_args);
            }
            pub const left_handed_support_since_version = 1;

            /// Default left-handed mode.
            pub fn sendLeftHandedDefault(_libinput_device_v1: *LibinputDeviceV1, _state: LeftHandedState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(LeftHandedState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(29, &_args);
            }
            pub const left_handed_default_since_version = 1;

            /// Current left-handed mode.
            pub fn sendLeftHandedCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: LeftHandedState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(LeftHandedState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(30, &_args);
            }
            pub const left_handed_current_since_version = 1;

            /// The click methods supported by the device.
            pub fn sendClickMethodSupport(_libinput_device_v1: *LibinputDeviceV1, _methods: ClickMethods) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ClickMethods)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_methods))),
                        .@"struct" => @bitCast(_methods),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(31, &_args);
            }
            pub const click_method_support_since_version = 1;

            /// Default click method.
            pub fn sendClickMethodDefault(_libinput_device_v1: *LibinputDeviceV1, _method: ClickMethod) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ClickMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(32, &_args);
            }
            pub const click_method_default_since_version = 1;

            /// Current click method.
            pub fn sendClickMethodCurrent(_libinput_device_v1: *LibinputDeviceV1, _method: ClickMethod) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ClickMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(33, &_args);
            }
            pub const click_method_current_since_version = 1;

            /// Default clickfinger button map.
            /// Supported if click_methods.clickfinger is supported.
            pub fn sendClickfingerButtonMapDefault(_libinput_device_v1: *LibinputDeviceV1, _button_map: ClickfingerButtonMap) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ClickfingerButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(34, &_args);
            }
            pub const clickfinger_button_map_default_since_version = 1;

            /// Current clickfinger button map.
            /// Supported if click_methods.clickfinger is supported.
            pub fn sendClickfingerButtonMapCurrent(_libinput_device_v1: *LibinputDeviceV1, _button_map: ClickfingerButtonMap) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ClickfingerButtonMap)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_button_map))),
                        .@"struct" => @bitCast(_button_map),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(35, &_args);
            }
            pub const clickfinger_button_map_current_since_version = 1;

            /// Middle mouse button emulation is supported if the supported argument is
            /// non-zero.
            pub fn sendMiddleEmulationSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(36, &_args);
            }
            pub const middle_emulation_support_since_version = 1;

            /// Default middle mouse button emulation.
            pub fn sendMiddleEmulationDefault(_libinput_device_v1: *LibinputDeviceV1, _state: MiddleEmulationState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(MiddleEmulationState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(37, &_args);
            }
            pub const middle_emulation_default_since_version = 1;

            /// Current middle mouse button emulation.
            pub fn sendMiddleEmulationCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: MiddleEmulationState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(MiddleEmulationState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(38, &_args);
            }
            pub const middle_emulation_current_since_version = 1;

            /// The scroll methods supported by the device.
            pub fn sendScrollMethodSupport(_libinput_device_v1: *LibinputDeviceV1, _methods: ScrollMethods) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ScrollMethods)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_methods))),
                        .@"struct" => @bitCast(_methods),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(39, &_args);
            }
            pub const scroll_method_support_since_version = 1;

            /// Default scroll method.
            pub fn sendScrollMethodDefault(_libinput_device_v1: *LibinputDeviceV1, _method: ScrollMethod) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ScrollMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(40, &_args);
            }
            pub const scroll_method_default_since_version = 1;

            /// Current scroll method.
            pub fn sendScrollMethodCurrent(_libinput_device_v1: *LibinputDeviceV1, _method: ScrollMethod) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ScrollMethod)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_method))),
                        .@"struct" => @bitCast(_method),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(41, &_args);
            }
            pub const scroll_method_current_since_version = 1;

            /// Default scroll button.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn sendScrollButtonDefault(_libinput_device_v1: *LibinputDeviceV1, _button: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = _button },
                };
                _resource.postEvent(42, &_args);
            }
            pub const scroll_button_default_since_version = 1;

            /// Current scroll button.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn sendScrollButtonCurrent(_libinput_device_v1: *LibinputDeviceV1, _button: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = _button },
                };
                _resource.postEvent(43, &_args);
            }
            pub const scroll_button_current_since_version = 1;

            /// Default scroll button lock state.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn sendScrollButtonLockDefault(_libinput_device_v1: *LibinputDeviceV1, _state: ScrollButtonLockState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ScrollButtonLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(44, &_args);
            }
            pub const scroll_button_lock_default_since_version = 1;

            /// Current scroll button lock state.
            /// Supported if scroll_methods.on_button_down is supported.
            pub fn sendScrollButtonLockCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: ScrollButtonLockState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(ScrollButtonLockState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(45, &_args);
            }
            pub const scroll_button_lock_current_since_version = 1;

            /// Disable-while-typing is supported if the supported argument is
            /// non-zero.
            pub fn sendDwtSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(46, &_args);
            }
            pub const dwt_support_since_version = 1;

            /// Default disable-while-typing state.
            pub fn sendDwtDefault(_libinput_device_v1: *LibinputDeviceV1, _state: DwtState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DwtState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(47, &_args);
            }
            pub const dwt_default_since_version = 1;

            /// Current disable-while-typing state.
            pub fn sendDwtCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: DwtState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DwtState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(48, &_args);
            }
            pub const dwt_current_since_version = 1;

            /// Disable-while-trackpointing is supported if the supported argument is
            /// non-zero.
            pub fn sendDwtpSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(49, &_args);
            }
            pub const dwtp_support_since_version = 1;

            /// Default disable-while-trackpointing state.
            pub fn sendDwtpDefault(_libinput_device_v1: *LibinputDeviceV1, _state: DwtpState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DwtpState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(50, &_args);
            }
            pub const dwtp_default_since_version = 1;

            /// Current disable-while-trackpointing state.
            pub fn sendDwtpCurrent(_libinput_device_v1: *LibinputDeviceV1, _state: DwtpState) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(DwtpState)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_state))),
                        .@"struct" => @bitCast(_state),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(51, &_args);
            }
            pub const dwtp_current_since_version = 1;

            /// Rotation is supported if the supported argument is non-zero.
            pub fn sendRotationSupport(_libinput_device_v1: *LibinputDeviceV1, _supported: i32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .i = _supported },
                };
                _resource.postEvent(52, &_args);
            }
            pub const rotation_support_since_version = 1;

            /// Default rotation angle.
            pub fn sendRotationDefault(_libinput_device_v1: *LibinputDeviceV1, _angle: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = _angle },
                };
                _resource.postEvent(53, &_args);
            }
            pub const rotation_default_since_version = 1;

            /// Current rotation angle.
            pub fn sendRotationCurrent(_libinput_device_v1: *LibinputDeviceV1, _angle: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_libinput_device_v1);
                var _args = [_]common.Argument{
                    .{ .u = _angle },
                };
                _resource.postEvent(54, &_args);
            }
            pub const rotation_current_since_version = 1;
        };

        /// Global interface for configuring xkb devices.
        ///
        /// This global should only be advertised if river_input_manager_v1 is
        /// advertised as well.
        pub const XkbConfigV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_config_v1.interface;
            pub const Error = common.river.xkb_config_v1.Error;
            pub const KeymapFormat = common.river.xkb_config_v1.KeymapFormat;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbConfigV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbConfigV1, _version, _id));
            }
            pub inline fn destroy(_xkb_config_v1: *XkbConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbConfigV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_config_v1: *XkbConfigV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).getLink();
            }
            pub inline fn getClient(_xkb_config_v1: *XkbConfigV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).getClient();
            }
            pub inline fn getId(_xkb_config_v1: *XkbConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).getId();
            }
            pub inline fn getVersion(_xkb_config_v1: *XkbConfigV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_config_v1: *XkbConfigV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_config_v1: *XkbConfigV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).getUserData();
            }
            pub inline fn postError(_xkb_config_v1: *XkbConfigV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_config_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const stop_since_version = 1;
                pub const destroy_since_version = 1;
                pub const create_keymap_since_version = 1;

                /// This request indicates that the client no longer wishes to receive
                /// events on this object.
                ///
                /// The Wayland protocol is asynchronous, which means the server may send
                /// further events until the stop request is processed. The client must wait
                /// for a river_xkb_config_v1.finished event before destroying this object.
                stop: void,
                /// This request should be called after the finished event has been received
                /// to complete destruction of the object.
                ///
                /// It is a protocol error to make this request before the finished event
                /// has been received.
                ///
                /// If a client wishes to destroy this object it should send a
                /// river_xkb_config_v1.stop request and wait for a
                /// river_xkb_config_v1.finished event. Once the finished event is received
                /// it is safe to destroy this object and any other objects created through
                /// this interface.
                destroy: void,
                /// The server must be able to mmap the fd with MAP_PRIVATE.
                /// The server will fstat the fd to obtain the size of the keymap.
                /// The client must not modify the contents of the fd after making this request.
                /// The client should seal the fd with fcntl.
                create_keymap: struct {
                    id: u32,
                    fd: i32,
                    format: KeymapFormat,
                },
            };
            pub inline fn setHandler(
                _xkb_config_v1: *XkbConfigV1,
                comptime T: type,
                handle_request: *const fn (_xkb_config_v1: *XkbConfigV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_config_v1: *XkbConfigV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_config_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbConfigV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbConfigV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the server will send no further events on this
            /// object. The client should destroy the object. See
            /// river_xkb_config_v1.destroy for more information.
            pub fn sendFinished(_xkb_config_v1: *XkbConfigV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_config_v1);
                _resource.postEvent(0, null);
            }
            pub const finished_since_version = 1;

            /// A new xkbcommon keyboard has been created. Not every
            /// river_input_device_v1 is necessarily an xkbcommon keyboard as well.
            pub fn sendXkbKeyboard(_xkb_config_v1: *XkbConfigV1, _id: *server.river.XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_config_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_id) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const xkb_keyboard_since_version = 1;
        };

        /// This object is the result of attempting to create an xkbcommon keymap.
        pub const XkbKeymapV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_keymap_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbKeymapV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbKeymapV1, _version, _id));
            }
            pub inline fn destroy(_xkb_keymap_v1: *XkbKeymapV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbKeymapV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_keymap_v1: *XkbKeymapV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).getLink();
            }
            pub inline fn getClient(_xkb_keymap_v1: *XkbKeymapV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).getClient();
            }
            pub inline fn getId(_xkb_keymap_v1: *XkbKeymapV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).getId();
            }
            pub inline fn getVersion(_xkb_keymap_v1: *XkbKeymapV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_keymap_v1: *XkbKeymapV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_keymap_v1: *XkbKeymapV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keymap_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;

                /// This request indicates that the client will no longer use the keymap
                /// object and that it may be safely destroyed.
                destroy: void,
            };
            pub inline fn setHandler(
                _xkb_keymap_v1: *XkbKeymapV1,
                comptime T: type,
                handle_request: *const fn (_xkb_keymap_v1: *XkbKeymapV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_keymap_v1: *XkbKeymapV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keymap_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbKeymapV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbKeymapV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The keymap object was successfully created and may be used with the
            /// river_xkb_keyboard_v1.set_keymap request.
            pub fn sendSuccess(_xkb_keymap_v1: *XkbKeymapV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keymap_v1);
                _resource.postEvent(0, null);
            }
            pub const success_since_version = 1;

            /// The compositor failed to create a keymap from the given parameters.
            ///
            /// It is a protocol error to use this keymap object with
            /// river_xkb_keyboard_v1.set_keymap.
            pub fn sendFailure(_xkb_keymap_v1: *XkbKeymapV1, _error_msg: [*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keymap_v1);
                var _args = [_]common.Argument{
                    .{ .s = _error_msg },
                };
                _resource.postEvent(1, &_args);
            }
            pub const failure_since_version = 1;
        };

        /// This object represent a physical keyboard which has its configuration and
        /// state managed by xkbcommon.
        pub const XkbKeyboardV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.river.xkb_keyboard_v1.interface;
            pub const Error = common.river.xkb_keyboard_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*XkbKeyboardV1 {
                return @ptrCast(try server.wl.Resource.create(_client, XkbKeyboardV1, _version, _id));
            }
            pub inline fn destroy(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *XkbKeyboardV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_xkb_keyboard_v1: *XkbKeyboardV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).getLink();
            }
            pub inline fn getClient(_xkb_keyboard_v1: *XkbKeyboardV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).getClient();
            }
            pub inline fn getId(_xkb_keyboard_v1: *XkbKeyboardV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).getId();
            }
            pub inline fn getVersion(_xkb_keyboard_v1: *XkbKeyboardV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).getVersion();
            }
            pub inline fn postNoMemory(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).postNoMemory();
            }
            pub inline fn getUserData(_xkb_keyboard_v1: *XkbKeyboardV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).getUserData();
            }
            pub inline fn postError(_xkb_keyboard_v1: *XkbKeyboardV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_xkb_keyboard_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const destroy_since_version = 1;
                pub const set_keymap_since_version = 1;
                pub const set_layout_by_index_since_version = 1;
                pub const set_layout_by_name_since_version = 1;
                pub const capslock_enable_since_version = 1;
                pub const capslock_disable_since_version = 1;
                pub const numlock_enable_since_version = 1;
                pub const numlock_disable_since_version = 1;

                /// This request indicates that the client will no longer use the keyboard
                /// object and that it may be safely destroyed.
                destroy: void,
                /// Set the keymap for the keyboard.
                ///
                /// Setting a keymap will reset all layout/modifier state.
                ///
                /// It is a protocol error to pass a keymap object for which the
                /// river_xkb_keymap_v1.success event was not received.
                set_keymap: struct {
                    keymap: *server.river.XkbKeymapV1,
                },

                /// Set the active layout for the keyboard's keymap. Has no effect if the
                /// layout index is out of bounds for the current keymap.
                set_layout_by_index: struct {
                    index: i32,
                },

                /// Set the active layout for the keyboard's keymap. Has no effect if there
                /// is no layout with the give name for the keyboard's keymap.
                set_layout_by_name: struct {
                    name: [*:0]const u8,
                },

                /// Enable capslock for the keyboard.
                capslock_enable: void,
                /// Disable capslock for the keyboard.
                capslock_disable: void,
                /// Enable numlock for the keyboard.
                numlock_enable: void,
                /// Disable numlock for the keyboard.
                numlock_disable: void,
            };
            pub inline fn setHandler(
                _xkb_keyboard_v1: *XkbKeyboardV1,
                comptime T: type,
                handle_request: *const fn (_xkb_keyboard_v1: *XkbKeyboardV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_xkb_keyboard_v1: *XkbKeyboardV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.setDispatcher(
                    common.Dispatcher(XkbKeyboardV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*XkbKeyboardV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// This event indicates that the xkb keyboard has been removed.
            ///
            /// The server will send no further events on this object and ignore any
            /// request (other than river_xkb_keyboard_v1.destroy) made after this event
            /// is sent. The client should destroy this object with the
            /// river_xkb_keyboard_v1.destroy request to free up resources.
            pub fn sendRemoved(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.postEvent(0, null);
            }
            pub const removed_since_version = 1;

            /// The river_input_device_v1 corresponding to this xkb keyboard. This event
            /// will always be the first event sent on the river_xkb_keyboard_v1 object,
            /// and it will be sent exactly once.
            pub fn sendInputDevice(_xkb_keyboard_v1: *XkbKeyboardV1, _device: *server.river.InputDeviceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .o = @ptrCast(_device) },
                };
                _resource.postEvent(1, &_args);
            }
            pub const input_device_since_version = 1;

            /// The currently active layout index and name. The name arg may be null if
            /// the active layout does not have a name.
            ///
            /// This event is sent once when the river_xkb_keyboard_v1 is created and
            /// again whenever the layout changes.
            pub fn sendLayout(_xkb_keyboard_v1: *XkbKeyboardV1, _index: u32, _name: ?[*:0]const u8) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                var _args = [_]common.Argument{
                    .{ .u = _index },
                    .{ .s = _name },
                };
                _resource.postEvent(2, &_args);
            }
            pub const layout_since_version = 1;

            /// Capslock is currently enabled for the keyboard.
            ///
            /// This event is sent once when the river_xkb_keyboard_v1 is created and
            /// again whenever the capslock state changes.
            pub fn sendCapslockEnabled(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.postEvent(3, null);
            }
            pub const capslock_enabled_since_version = 1;

            /// Capslock is currently disabled for the keyboard.
            ///
            /// This event is sent once when the river_xkb_keyboard_v1 is created and
            /// again whenever the capslock state changes.
            pub fn sendCapslockDisabled(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.postEvent(4, null);
            }
            pub const capslock_disabled_since_version = 1;

            /// Numlock is currently enabled for the keyboard.
            ///
            /// This event is sent once when the river_xkb_keyboard_v1 is created and
            /// again whenever the numlock state changes.
            pub fn sendNumlockEnabled(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.postEvent(5, null);
            }
            pub const numlock_enabled_since_version = 1;

            /// Numlock is currently disabled for the keyboard.
            ///
            /// This event is sent once when the river_xkb_keyboard_v1 is created and
            /// again whenever the numlock state changes.
            pub fn sendNumlockDisabled(_xkb_keyboard_v1: *XkbKeyboardV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_xkb_keyboard_v1);
                _resource.postEvent(6, null);
            }
            pub const numlock_disabled_since_version = 1;
        };
    };
    pub const zwlr = struct {
        /// Clients can use this interface to assign the surface_layer role to
        /// wl_surfaces. Such surfaces are assigned to a "layer" of the output and
        /// rendered with a defined z-depth respective to each other. They may also be
        /// anchored to the edges and corners of a screen and specify input handling
        /// semantics. This interface should be suitable for the implementation of
        /// many desktop shell components, and a broad number of other applications
        /// that interact with the desktop.
        pub const LayerShellV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.zwlr.layer_shell_v1.interface;
            pub const Error = common.zwlr.layer_shell_v1.Error;
            pub const Layer = common.zwlr.layer_shell_v1.Layer;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LayerShellV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LayerShellV1, _version, _id));
            }
            pub inline fn destroy(_layer_shell_v1: *LayerShellV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LayerShellV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_layer_shell_v1: *LayerShellV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getLink();
            }
            pub inline fn getClient(_layer_shell_v1: *LayerShellV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getClient();
            }
            pub inline fn getId(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getId();
            }
            pub inline fn getVersion(_layer_shell_v1: *LayerShellV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getVersion();
            }
            pub inline fn postNoMemory(_layer_shell_v1: *LayerShellV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).postNoMemory();
            }
            pub inline fn getUserData(_layer_shell_v1: *LayerShellV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).getUserData();
            }
            pub inline fn postError(_layer_shell_v1: *LayerShellV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_shell_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const get_layer_surface_since_version = 1;
                pub const destroy_since_version = 3;

                /// Create a layer surface for an existing surface. This assigns the role of
                /// layer_surface, or raises a protocol error if another role is already
                /// assigned.
                ///
                /// Creating a layer surface from a wl_surface which has a buffer attached
                /// or committed is a client error, and any attempts by a client to attach
                /// or manipulate a buffer prior to the first layer_surface.configure call
                /// must also be treated as errors.
                ///
                /// After creating a layer_surface object and setting it up, the client
                /// must perform an initial commit without any buffer attached.
                /// The compositor will reply with a layer_surface.configure event.
                /// The client must acknowledge it and is then allowed to attach a buffer
                /// to map the surface.
                ///
                /// You may pass NULL for output to allow the compositor to decide which
                /// output to use. Generally this will be the one that the user most
                /// recently interacted with.
                ///
                /// Clients can specify a namespace that defines the purpose of the layer
                /// surface.
                get_layer_surface: struct {
                    id: u32,
                    surface: *server.wl.Surface,
                    output: ?*server.wl.Output,
                    layer: Layer,
                    namespace: [*:0]const u8,
                },

                /// This request indicates that the client will not use the layer_shell
                /// object any more. Objects that have been created through this instance
                /// are not affected.
                destroy: void,
            };
            pub inline fn setHandler(
                _layer_shell_v1: *LayerShellV1,
                comptime T: type,
                handle_request: *const fn (_layer_shell_v1: *LayerShellV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_layer_shell_v1: *LayerShellV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_shell_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LayerShellV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LayerShellV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// An interface that may be implemented by a wl_surface, for surfaces that
        /// are designed to be rendered as a layer of a stacked desktop-like
        /// environment.
        ///
        /// Layer surface state (layer, size, anchor, exclusive zone,
        /// margin, interactivity) is double-buffered, and will be applied at the
        /// time wl_surface.commit of the corresponding wl_surface is called.
        ///
        /// Attaching a null buffer to a layer surface unmaps it.
        ///
        /// Unmapping a layer_surface means that the surface cannot be shown by the
        /// compositor until it is explicitly mapped again. The layer_surface
        /// returns to the state it had right after layer_shell.get_layer_surface.
        /// The client can re-map the surface by performing a commit without any
        /// buffer attached, waiting for a configure event and handling it as usual.
        pub const LayerSurfaceV1 = opaque {
            pub const generated_version = 4;
            pub const interface = &common.zwlr.layer_surface_v1.interface;
            pub const KeyboardInteractivity = common.zwlr.layer_surface_v1.KeyboardInteractivity;
            pub const Error = common.zwlr.layer_surface_v1.Error;
            pub const Anchor = common.zwlr.layer_surface_v1.Anchor;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*LayerSurfaceV1 {
                return @ptrCast(try server.wl.Resource.create(_client, LayerSurfaceV1, _version, _id));
            }
            pub inline fn destroy(_layer_surface_v1: *LayerSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *LayerSurfaceV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_layer_surface_v1: *LayerSurfaceV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).getLink();
            }
            pub inline fn getClient(_layer_surface_v1: *LayerSurfaceV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).getClient();
            }
            pub inline fn getId(_layer_surface_v1: *LayerSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).getId();
            }
            pub inline fn getVersion(_layer_surface_v1: *LayerSurfaceV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).getVersion();
            }
            pub inline fn postNoMemory(_layer_surface_v1: *LayerSurfaceV1) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).postNoMemory();
            }
            pub inline fn getUserData(_layer_surface_v1: *LayerSurfaceV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).getUserData();
            }
            pub inline fn postError(_layer_surface_v1: *LayerSurfaceV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_layer_surface_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const set_size_since_version = 1;
                pub const set_anchor_since_version = 1;
                pub const set_exclusive_zone_since_version = 1;
                pub const set_margin_since_version = 1;
                pub const set_keyboard_interactivity_since_version = 1;
                pub const get_popup_since_version = 1;
                pub const ack_configure_since_version = 1;
                pub const destroy_since_version = 1;
                pub const set_layer_since_version = 2;

                /// Sets the size of the surface in surface-local coordinates. The
                /// compositor will display the surface centered with respect to its
                /// anchors.
                ///
                /// If you pass 0 for either value, the compositor will assign it and
                /// inform you of the assignment in the configure event. You must set your
                /// anchor to opposite edges in the dimensions you omit; not doing so is a
                /// protocol error. Both values are 0 by default.
                ///
                /// Size is double-buffered, see wl_surface.commit.
                set_size: struct {
                    width: u32,
                    height: u32,
                },

                /// Requests that the compositor anchor the surface to the specified edges
                /// and corners. If two orthogonal edges are specified (e.g. 'top' and
                /// 'left'), then the anchor point will be the intersection of the edges
                /// (e.g. the top left corner of the output); otherwise the anchor point
                /// will be centered on that edge, or in the center if none is specified.
                ///
                /// Anchor is double-buffered, see wl_surface.commit.
                set_anchor: struct {
                    anchor: Anchor,
                },

                /// Requests that the compositor avoids occluding an area with other
                /// surfaces. The compositor's use of this information is
                /// implementation-dependent - do not assume that this region will not
                /// actually be occluded.
                ///
                /// A positive value is only meaningful if the surface is anchored to one
                /// edge or an edge and both perpendicular edges. If the surface is not
                /// anchored, anchored to only two perpendicular edges (a corner), anchored
                /// to only two parallel edges or anchored to all edges, a positive value
                /// will be treated the same as zero.
                ///
                /// A positive zone is the distance from the edge in surface-local
                /// coordinates to consider exclusive.
                ///
                /// Surfaces that do not wish to have an exclusive zone may instead specify
                /// how they should interact with surfaces that do. If set to zero, the
                /// surface indicates that it would like to be moved to avoid occluding
                /// surfaces with a positive exclusive zone. If set to -1, the surface
                /// indicates that it would not like to be moved to accommodate for other
                /// surfaces, and the compositor should extend it all the way to the edges
                /// it is anchored to.
                ///
                /// For example, a panel might set its exclusive zone to 10, so that
                /// maximized shell surfaces are not shown on top of it. A notification
                /// might set its exclusive zone to 0, so that it is moved to avoid
                /// occluding the panel, but shell surfaces are shown underneath it. A
                /// wallpaper or lock screen might set their exclusive zone to -1, so that
                /// they stretch below or over the panel.
                ///
                /// The default value is 0.
                ///
                /// Exclusive zone is double-buffered, see wl_surface.commit.
                set_exclusive_zone: struct {
                    zone: i32,
                },

                /// Requests that the surface be placed some distance away from the anchor
                /// point on the output, in surface-local coordinates. Setting this value
                /// for edges you are not anchored to has no effect.
                ///
                /// The exclusive zone includes the margin.
                ///
                /// Margin is double-buffered, see wl_surface.commit.
                set_margin: struct {
                    top: i32,
                    right: i32,
                    bottom: i32,
                    left: i32,
                },

                /// Set how keyboard events are delivered to this surface. By default,
                /// layer shell surfaces do not receive keyboard events; this request can
                /// be used to change this.
                ///
                /// This setting is inherited by child surfaces set by the get_popup
                /// request.
                ///
                /// Layer surfaces receive pointer, touch, and tablet events normally. If
                /// you do not want to receive them, set the input region on your surface
                /// to an empty region.
                ///
                /// Keyboard interactivity is double-buffered, see wl_surface.commit.
                set_keyboard_interactivity: struct {
                    keyboard_interactivity: KeyboardInteractivity,
                },

                /// This assigns an xdg_popup's parent to this layer_surface.  This popup
                /// should have been created via xdg_surface::get_popup with the parent set
                /// to NULL, and this request must be invoked before committing the popup's
                /// initial state.
                ///
                /// See the documentation of xdg_popup for more details about what an
                /// xdg_popup is and how it is used.
                get_popup: struct {
                    popup: *server.xdg.Popup,
                },

                /// When a configure event is received, if a client commits the
                /// surface in response to the configure event, then the client
                /// must make an ack_configure request sometime before the commit
                /// request, passing along the serial of the configure event.
                ///
                /// If the client receives multiple configure events before it
                /// can respond to one, it only has to ack the last configure event.
                ///
                /// A client is not required to commit immediately after sending
                /// an ack_configure request - it may even ack_configure several times
                /// before its next surface commit.
                ///
                /// A client may send multiple ack_configure requests before committing, but
                /// only the last request sent before a commit indicates which configure
                /// event the client really is responding to.
                ack_configure: struct {
                    serial: u32,
                },

                /// This request destroys the layer surface.
                destroy: void,
                /// Change the layer that the surface is rendered on.
                ///
                /// Layer is double-buffered, see wl_surface.commit.
                set_layer: struct {
                    layer: common.zwlr.layer_shell_v1.Layer,
                },
            };
            pub inline fn setHandler(
                _layer_surface_v1: *LayerSurfaceV1,
                comptime T: type,
                handle_request: *const fn (_layer_surface_v1: *LayerSurfaceV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_layer_surface_v1: *LayerSurfaceV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_surface_v1);
                _resource.setDispatcher(
                    common.Dispatcher(LayerSurfaceV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*LayerSurfaceV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// The configure event asks the client to resize its surface.
            ///
            /// Clients should arrange their surface for the new states, and then send
            /// an ack_configure request with the serial sent in this configure event at
            /// some point before committing the new surface.
            ///
            /// The client is free to dismiss all but the last configure event it
            /// received.
            ///
            /// The width and height arguments specify the size of the window in
            /// surface-local coordinates.
            ///
            /// The size is a hint, in the sense that the client is free to ignore it if
            /// it doesn't resize, pick a smaller size (to satisfy aspect ratio or
            /// resize in steps of NxM pixels). If the client picks a smaller size and
            /// is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
            /// surface will be centered on this axis.
            ///
            /// If the width or height arguments are zero, it means the client should
            /// decide its own window dimension.
            pub fn sendConfigure(_layer_surface_v1: *LayerSurfaceV1, _serial: u32, _width: u32, _height: u32) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_surface_v1);
                var _args = [_]common.Argument{
                    .{ .u = _serial },
                    .{ .u = _width },
                    .{ .u = _height },
                };
                _resource.postEvent(0, &_args);
            }
            pub const configure_since_version = 1;

            /// The closed event is sent by the compositor when the surface will no
            /// longer be shown. The output may have been destroyed or the user may
            /// have asked for it to be removed. Further changes to the surface will be
            /// ignored. The client should destroy the resource after receiving this
            /// event, and create a new surface if they so choose.
            pub fn sendClosed(_layer_surface_v1: *LayerSurfaceV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_layer_surface_v1);
                _resource.postEvent(1, null);
            }
            pub const closed_since_version = 1;
        };

        /// This interface is a manager that allows creating per-output power
        /// management mode controls.
        pub const OutputPowerManagerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwlr.output_power_manager_v1.interface;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*OutputPowerManagerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, OutputPowerManagerV1, _version, _id));
            }
            pub inline fn destroy(_output_power_manager_v1: *OutputPowerManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *OutputPowerManagerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_output_power_manager_v1: *OutputPowerManagerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).getLink();
            }
            pub inline fn getClient(_output_power_manager_v1: *OutputPowerManagerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).getClient();
            }
            pub inline fn getId(_output_power_manager_v1: *OutputPowerManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).getId();
            }
            pub inline fn getVersion(_output_power_manager_v1: *OutputPowerManagerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).getVersion();
            }
            pub inline fn postNoMemory(_output_power_manager_v1: *OutputPowerManagerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).postNoMemory();
            }
            pub inline fn getUserData(_output_power_manager_v1: *OutputPowerManagerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_output_power_manager_v1)).getUserData();
            }
            pub const Request = union(enum) {
                pub const get_output_power_since_version = 1;
                pub const destroy_since_version = 1;

                /// Create an output power management mode control that can be used to
                /// adjust the power management mode for a given output.
                get_output_power: struct {
                    id: u32,
                    output: *server.wl.Output,
                },

                /// All objects created by the manager will still remain valid, until their
                /// appropriate destroy request has been called.
                destroy: void,
            };
            pub inline fn setHandler(
                _output_power_manager_v1: *OutputPowerManagerV1,
                comptime T: type,
                handle_request: *const fn (_output_power_manager_v1: *OutputPowerManagerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_output_power_manager_v1: *OutputPowerManagerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_power_manager_v1);
                _resource.setDispatcher(
                    common.Dispatcher(OutputPowerManagerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*OutputPowerManagerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
        };

        /// This object offers requests to set the power management mode of
        /// an output.
        pub const OutputPowerV1 = opaque {
            pub const generated_version = 1;
            pub const interface = &common.zwlr.output_power_v1.interface;
            pub const Mode = common.zwlr.output_power_v1.Mode;
            pub const Error = common.zwlr.output_power_v1.Error;
            pub inline fn create(_client: *server.wl.Client, _version: u32, _id: u32) error{ResourceCreateFailed}!*OutputPowerV1 {
                return @ptrCast(try server.wl.Resource.create(_client, OutputPowerV1, _version, _id));
            }
            pub inline fn destroy(_output_power_v1: *OutputPowerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).destroy();
            }
            pub inline fn fromLink(_link: *server.wl.list.Link) *OutputPowerV1 {
                return @ptrCast(server.wl.Resource.fromLink(_link));
            }
            pub inline fn getLink(_output_power_v1: *OutputPowerV1) *server.wl.list.Link {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).getLink();
            }
            pub inline fn getClient(_output_power_v1: *OutputPowerV1) *server.wl.Client {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).getClient();
            }
            pub inline fn getId(_output_power_v1: *OutputPowerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).getId();
            }
            pub inline fn getVersion(_output_power_v1: *OutputPowerV1) u32 {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).getVersion();
            }
            pub inline fn postNoMemory(_output_power_v1: *OutputPowerV1) void {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).postNoMemory();
            }
            pub inline fn getUserData(_output_power_v1: *OutputPowerV1) ?*anyopaque {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).getUserData();
            }
            pub inline fn postError(_output_power_v1: *OutputPowerV1, _err: Error, _message: [*:0]const u8) void {
                return @as(*server.wl.Resource, @ptrCast(_output_power_v1)).postError(@intCast(@intFromEnum(_err)), _message);
            }
            pub const Request = union(enum) {
                pub const set_mode_since_version = 1;
                pub const destroy_since_version = 1;

                /// Set an output's power save mode to the given mode. The mode change
                /// is effective immediately. If the output does not support the given
                /// mode a failed event is sent.
                set_mode: struct {
                    mode: Mode,
                },

                /// Destroys the output power management mode control object.
                destroy: void,
            };
            pub inline fn setHandler(
                _output_power_v1: *OutputPowerV1,
                comptime T: type,
                handle_request: *const fn (_output_power_v1: *OutputPowerV1, request: Request, data: T) void,
                comptime handle_destroy: ?fn (_output_power_v1: *OutputPowerV1, data: T) void,
                _data: T,
            ) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_power_v1);
                _resource.setDispatcher(
                    common.Dispatcher(OutputPowerV1, T).dispatcher,
                    handle_request,
                    @ptrFromInt(@intFromPtr(_data)),
                    if (handle_destroy) |_handler| struct {
                        fn _wrapper(__resource: *server.wl.Resource) callconv(.c) void {
                            @call(.always_inline, _handler, .{
                                @as(*OutputPowerV1, @ptrCast(__resource)),
                                @as(T, @ptrCast(@alignCast(__resource.getUserData()))),
                            });
                        }
                    }._wrapper else null,
                );
            }
            /// Report the power management mode change of an output.
            ///
            /// The mode event is sent after an output changed its power
            /// management mode. The reason can be a client using set_mode or the
            /// compositor deciding to change an output's mode.
            /// This event is also sent immediately when the object is created
            /// so the client is informed about the current power management mode.
            pub fn sendMode(_output_power_v1: *OutputPowerV1, _mode: Mode) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_power_v1);
                var _args = [_]common.Argument{
                    .{ .u = switch (@typeInfo(Mode)) {
                        .@"enum" => @as(u32, @intCast(@intFromEnum(_mode))),
                        .@"struct" => @bitCast(_mode),
                        else => unreachable,
                    } },
                };
                _resource.postEvent(0, &_args);
            }
            pub const mode_since_version = 1;

            /// This event indicates that the output power management mode control
            /// is no longer valid. This can happen for a number of reasons,
            /// including:
            /// - The output doesn't support power management
            /// - Another client already has exclusive power management mode control
            /// for this output
            /// - The output disappeared
            ///
            /// Upon receiving this event, the client should destroy this object.
            pub fn sendFailed(_output_power_v1: *OutputPowerV1) void {
                const _resource: *server.wl.Resource = @ptrCast(_output_power_v1);
                _resource.postEvent(1, null);
            }
            pub const failed_since_version = 1;
        };
    };
};

const common = struct {
    const Object = opaque {};

    const Message = extern struct {
        name: [*:0]const u8,
        signature: [*:0]const u8,
        types: ?[*]const ?*const Interface,
    };

    const Interface = extern struct {
        name: [*:0]const u8,
        version: c_int,
        method_count: c_int,
        methods: ?[*]const Message,
        event_count: c_int,
        events: ?[*]const Message,
    };

    const list = struct {
        pub const Link = extern struct {
            prev: ?*Link,
            next: ?*Link,

            pub fn init(link: *Link) void {
                link.* = .{ .prev = link, .next = link };
            }

            pub fn insert(link: *Link, other: *Link) void {
                other.prev = link;
                other.next = link.next;
                link.next = other;
                other.next.?.prev = other;
            }

            pub fn remove(link: *Link) void {
                link.prev.?.next = link.next;
                link.next.?.prev = link.prev;
                link.* = .{ .prev = null, .next = null };
            }

            pub fn replaceWith(link: *Link, other: *Link) void {
                other.next = link.next;
                other.next.?.prev = other;
                other.prev = link.prev;
                other.prev.?.next = other;

                link.* = .{ .prev = null, .next = null };
            }

            pub fn swapWith(link: *Link, other: *Link) void {
                const old_other_prev = other.prev.?;
                other.remove();

                link.replaceWith(other);

                if (old_other_prev == link) {
                    other.insert(link);
                } else {
                    old_other_prev.insert(link);
                }
            }

            /// private helper that doesn't handle empty lists and assumes that
            /// other is the link of a Head.
            fn insertList(link: *Link, other: *Link) void {
                other.next.?.prev = link;
                other.prev.?.next = link.next;
                link.next.?.prev = other.prev;
                link.next = other.next;

                other.init();
            }
        };

        pub const Direction = enum {
            forward,
            reverse,
        };

        /// This has the same ABI as wl.list.Link/wl_list. If link_field is null, then
        /// T.getLink()/T.fromLink() will be used. This allows for compatiability
        /// with wl.Client and wl.Resource
        pub fn Head(comptime T: type, comptime link_field: ?@Type(.enum_literal)) type {
            return extern struct {
                const Self = @This();

                link: Link,

                pub fn init(head: *Self) void {
                    head.link.init();
                }

                pub fn prepend(head: *Self, elem: *T) void {
                    head.link.insert(linkFromElem(elem));
                }

                pub fn append(head: *Self, elem: *T) void {
                    head.link.prev.?.insert(linkFromElem(elem));
                }

                pub fn prependList(head: *Self, other: *Self) void {
                    if (other.empty()) return;
                    head.link.insertList(&other.link);
                }

                pub fn appendList(head: *Self, other: *Self) void {
                    if (other.empty()) return;
                    head.link.prev.?.insertList(&other.link);
                }

                pub fn first(head: *Self) ?*T {
                    if (head.empty()) {
                        return null;
                    } else {
                        return elemFromLink(head.link.next.?);
                    }
                }

                pub fn last(head: *Self) ?*T {
                    if (head.empty()) {
                        return null;
                    } else {
                        return elemFromLink(head.link.prev.?);
                    }
                }

                pub fn length(head: *const Self) usize {
                    var count: usize = 0;
                    var current = head.link.next.?;
                    while (current != &head.link) : (current = current.next.?) {
                        count += 1;
                    }
                    return count;
                }

                pub fn empty(head: *const Self) bool {
                    return head.link.next == &head.link;
                }

                /// Removal of the current element during iteration is permitted.
                /// Removal of other elements is illegal.
                pub fn Iterator(comptime direction: Direction) type {
                    return struct {
                        head: *Link,
                        current: *Link,
                        future: *Link,

                        pub fn next(it: *@This()) ?*T {
                            it.current = it.future;
                            it.future = switch (direction) {
                                .forward => it.future.next.?,
                                .reverse => it.future.prev.?,
                            };
                            if (it.current == it.head) return null;
                            return elemFromLink(it.current);
                        }
                    };
                }

                /// Removal of the current element during iteration is permitted.
                /// Removal of other elements is illegal.
                pub fn iterator(head: *Self, comptime direction: Direction) Iterator(direction) {
                    return .{
                        .head = &head.link,
                        .current = &head.link,
                        .future = switch (direction) {
                            .forward => head.link.next.?,
                            .reverse => head.link.prev.?,
                        },
                    };
                }

                pub const safeIterator = iterator;
                pub const SafeIterator = Iterator;

                fn linkFromElem(elem: *T) *Link {
                    if (link_field) |f| {
                        return &@field(elem, @tagName(f));
                    } else {
                        return elem.getLink();
                    }
                }

                fn elemFromLink(link: *Link) *T {
                    if (link_field) |f| {
                        return @alignCast(@fieldParentPtr(@tagName(f), link));
                    } else {
                        return T.fromLink(link);
                    }
                }
            };
        }
    };

    const Array = extern struct {
        size: usize,
        alloc: usize,
        data: ?*anyopaque,

        /// Does not clone memory
        pub fn fromArrayList(comptime T: type, array_list: std.ArrayList(T)) Array {
            return Array{
                .size = array_list.items.len * @sizeOf(T),
                .alloc = array_list.capacity * @sizeOf(T),
                .data = array_list.items.ptr,
            };
        }

        pub fn slice(array: Array, comptime T: type) []align(4) T {
            const data = array.data orelse return &[0]T{};
            // The wire protocol/libwayland only guarantee 32-bit word alignment.
            const ptr: [*]align(4) T = @ptrCast(@alignCast(data));
            return ptr[0..@divExact(array.size, @sizeOf(T))];
        }
    };

    /// A 24.8 signed fixed-point number.
    const Fixed = enum(i32) {
        _,

        pub fn toInt(f: Fixed) i24 {
            return @truncate(@intFromEnum(f) >> 8);
        }

        pub fn fromInt(i: i24) Fixed {
            return @enumFromInt(@as(i32, i) << 8);
        }

        pub fn toDouble(f: Fixed) f64 {
            return @as(f64, @floatFromInt(@intFromEnum(f))) / 256;
        }

        pub fn fromDouble(d: f64) Fixed {
            return @enumFromInt(@as(i32, @intFromFloat(d * 256)));
        }
    };

    const Argument = extern union {
        i: i32,
        u: u32,
        f: Fixed,
        s: ?[*:0]const u8,
        o: ?*Object,
        n: u32,
        a: ?*Array,
        h: i32,
    };

    fn Dispatcher(comptime Obj: type, comptime Data: type) type {
        const client_side = @hasDecl(Obj, "Event");
        const Payload = if (client_side) Obj.Event else Obj.Request;
        return struct {
            fn dispatcher(
                implementation: ?*const anyopaque,
                object: if (client_side) *client.wl.Proxy else *server.wl.Resource,
                opcode: u32,
                _: *const Message,
                args: [*]Argument,
            ) callconv(.c) c_int {
                inline for (@typeInfo(Payload).@"union".fields, 0..) |payload_field, payload_num| {
                    if (payload_num == opcode) {
                        var payload_data: payload_field.type = undefined;
                        if (payload_field.type != void) {
                            inline for (@typeInfo(payload_field.type).@"struct".fields, 0..) |f, i| {
                                switch (@typeInfo(f.type)) {
                                    // signed/unsigned ints, fds, new_ids, bitfield enums
                                    .int, .@"struct" => @field(payload_data, f.name) = @as(f.type, @bitCast(args[i].u)),
                                    // objects, strings, arrays
                                    .pointer, .optional => @field(payload_data, f.name) = @as(f.type, @ptrFromInt(@intFromPtr(args[i].o))),
                                    // non-bitfield enums
                                    .@"enum" => @field(payload_data, f.name) = @as(f.type, @enumFromInt(args[i].i)),
                                    else => unreachable,
                                }
                            }
                        }

                        const HandlerFn = fn (*Obj, Payload, Data) void;
                        @as(*const HandlerFn, @ptrCast(@alignCast(implementation)))(
                            @as(*Obj, @ptrCast(object)),
                            @unionInit(Payload, payload_field.name, payload_data),
                            @as(Data, @ptrFromInt(@intFromPtr(object.getUserData()))),
                        );

                        return 0;
                    }
                }
                unreachable;
            }
        };
    }
    const wl = struct {
        const display = struct {
            const interface: common.Interface = .{
                .name = "wl_display",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "sync",
                        .signature = "n",
                        .types = &.{
                            &common.wl.callback.interface,
                        },
                    },
                    .{
                        .name = "get_registry",
                        .signature = "n",
                        .types = &.{
                            &common.wl.registry.interface,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "error",
                        .signature = "ous",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "delete_id",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// These errors are global and can be emitted in response to any
            /// server request.
            const Error = enum(c_int) {
                pub const invalid_object_since_version = 1;
                pub const invalid_method_since_version = 1;
                pub const no_memory_since_version = 1;
                pub const implementation_since_version = 1;

                invalid_object = 0,
                invalid_method = 1,
                no_memory = 2,
                implementation = 3,
                _,
            };
        };
        const registry = struct {
            const interface: common.Interface = .{
                .name = "wl_registry",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "bind",
                        .signature = "usun",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "global",
                        .signature = "usu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "global_remove",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const callback = struct {
            const interface: common.Interface = .{
                .name = "wl_callback",
                .version = 1,
                .method_count = 0,
                .methods = null,
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "done",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const buffer = struct {
            const interface: common.Interface = .{
                .name = "wl_buffer",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "release",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const compositor = struct {
            const interface: common.Interface = .{
                .name = "wl_compositor",
                .version = 6,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "create_surface",
                        .signature = "n",
                        .types = &.{
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "create_region",
                        .signature = "n",
                        .types = &.{
                            &common.wl.region.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const surface = struct {
            const interface: common.Interface = .{
                .name = "wl_surface",
                .version = 6,
                .method_count = 11,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "attach",
                        .signature = "?oii",
                        .types = &.{
                            &common.wl.buffer.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "damage",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "frame",
                        .signature = "n",
                        .types = &.{
                            &common.wl.callback.interface,
                        },
                    },
                    .{
                        .name = "set_opaque_region",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.region.interface,
                        },
                    },
                    .{
                        .name = "set_input_region",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.region.interface,
                        },
                    },
                    .{
                        .name = "commit",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_buffer_transform",
                        .signature = "2i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_buffer_scale",
                        .signature = "3i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "damage_buffer",
                        .signature = "4iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "offset",
                        .signature = "5ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
                .event_count = 4,
                .events = &.{
                    .{
                        .name = "enter",
                        .signature = "o",
                        .types = &.{
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "leave",
                        .signature = "o",
                        .types = &.{
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "preferred_buffer_scale",
                        .signature = "6i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "preferred_buffer_transform",
                        .signature = "6u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// These errors can be emitted in response to wl_surface requests.
            const Error = enum(c_int) {
                pub const invalid_scale_since_version = 1;
                pub const invalid_transform_since_version = 1;
                pub const invalid_size_since_version = 1;
                pub const invalid_offset_since_version = 1;
                pub const defunct_role_object_since_version = 1;

                invalid_scale = 0,
                invalid_transform = 1,
                invalid_size = 2,
                invalid_offset = 3,
                defunct_role_object = 4,
                _,
            };
        };
        const region = struct {
            const interface: common.Interface = .{
                .name = "wl_region",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "add",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "subtract",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const shm = struct {
            const interface: common.Interface = .{
                .name = "wl_shm",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "create_pool",
                        .signature = "nhi",
                        .types = &.{
                            &common.wl.shm_pool.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "release",
                        .signature = "2",
                        .types = null,
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "format",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// These errors can be emitted in response to wl_shm requests.
            const Error = enum(c_int) {
                pub const invalid_format_since_version = 1;
                pub const invalid_stride_since_version = 1;
                pub const invalid_fd_since_version = 1;

                invalid_format = 0,
                invalid_stride = 1,
                invalid_fd = 2,
                _,
            };

            /// This describes the memory layout of an individual pixel.
            ///
            /// All renderers should support argb8888 and xrgb8888 but any other
            /// formats are optional and may not be supported by the particular
            /// renderer in use.
            ///
            /// The drm format codes match the macros defined in drm_fourcc.h, except
            /// argb8888 and xrgb8888. The formats actually supported by the compositor
            /// will be reported by the format event.
            ///
            /// For all wl_shm formats and unless specified in another protocol
            /// extension, pre-multiplied alpha is used for pixel values.
            const Format = enum(c_int) {
                pub const argb8888_since_version = 1;
                pub const xrgb8888_since_version = 1;
                pub const c8_since_version = 1;
                pub const rgb332_since_version = 1;
                pub const bgr233_since_version = 1;
                pub const xrgb4444_since_version = 1;
                pub const xbgr4444_since_version = 1;
                pub const rgbx4444_since_version = 1;
                pub const bgrx4444_since_version = 1;
                pub const argb4444_since_version = 1;
                pub const abgr4444_since_version = 1;
                pub const rgba4444_since_version = 1;
                pub const bgra4444_since_version = 1;
                pub const xrgb1555_since_version = 1;
                pub const xbgr1555_since_version = 1;
                pub const rgbx5551_since_version = 1;
                pub const bgrx5551_since_version = 1;
                pub const argb1555_since_version = 1;
                pub const abgr1555_since_version = 1;
                pub const rgba5551_since_version = 1;
                pub const bgra5551_since_version = 1;
                pub const rgb565_since_version = 1;
                pub const bgr565_since_version = 1;
                pub const rgb888_since_version = 1;
                pub const bgr888_since_version = 1;
                pub const xbgr8888_since_version = 1;
                pub const rgbx8888_since_version = 1;
                pub const bgrx8888_since_version = 1;
                pub const abgr8888_since_version = 1;
                pub const rgba8888_since_version = 1;
                pub const bgra8888_since_version = 1;
                pub const xrgb2101010_since_version = 1;
                pub const xbgr2101010_since_version = 1;
                pub const rgbx1010102_since_version = 1;
                pub const bgrx1010102_since_version = 1;
                pub const argb2101010_since_version = 1;
                pub const abgr2101010_since_version = 1;
                pub const rgba1010102_since_version = 1;
                pub const bgra1010102_since_version = 1;
                pub const yuyv_since_version = 1;
                pub const yvyu_since_version = 1;
                pub const uyvy_since_version = 1;
                pub const vyuy_since_version = 1;
                pub const ayuv_since_version = 1;
                pub const nv12_since_version = 1;
                pub const nv21_since_version = 1;
                pub const nv16_since_version = 1;
                pub const nv61_since_version = 1;
                pub const yuv410_since_version = 1;
                pub const yvu410_since_version = 1;
                pub const yuv411_since_version = 1;
                pub const yvu411_since_version = 1;
                pub const yuv420_since_version = 1;
                pub const yvu420_since_version = 1;
                pub const yuv422_since_version = 1;
                pub const yvu422_since_version = 1;
                pub const yuv444_since_version = 1;
                pub const yvu444_since_version = 1;
                pub const r8_since_version = 1;
                pub const r16_since_version = 1;
                pub const rg88_since_version = 1;
                pub const gr88_since_version = 1;
                pub const rg1616_since_version = 1;
                pub const gr1616_since_version = 1;
                pub const xrgb16161616f_since_version = 1;
                pub const xbgr16161616f_since_version = 1;
                pub const argb16161616f_since_version = 1;
                pub const abgr16161616f_since_version = 1;
                pub const xyuv8888_since_version = 1;
                pub const vuy888_since_version = 1;
                pub const vuy101010_since_version = 1;
                pub const y210_since_version = 1;
                pub const y212_since_version = 1;
                pub const y216_since_version = 1;
                pub const y410_since_version = 1;
                pub const y412_since_version = 1;
                pub const y416_since_version = 1;
                pub const xvyu2101010_since_version = 1;
                pub const xvyu12_16161616_since_version = 1;
                pub const xvyu16161616_since_version = 1;
                pub const y0l0_since_version = 1;
                pub const x0l0_since_version = 1;
                pub const y0l2_since_version = 1;
                pub const x0l2_since_version = 1;
                pub const yuv420_8bit_since_version = 1;
                pub const yuv420_10bit_since_version = 1;
                pub const xrgb8888_a8_since_version = 1;
                pub const xbgr8888_a8_since_version = 1;
                pub const rgbx8888_a8_since_version = 1;
                pub const bgrx8888_a8_since_version = 1;
                pub const rgb888_a8_since_version = 1;
                pub const bgr888_a8_since_version = 1;
                pub const rgb565_a8_since_version = 1;
                pub const bgr565_a8_since_version = 1;
                pub const nv24_since_version = 1;
                pub const nv42_since_version = 1;
                pub const p210_since_version = 1;
                pub const p010_since_version = 1;
                pub const p012_since_version = 1;
                pub const p016_since_version = 1;
                pub const axbxgxrx106106106106_since_version = 1;
                pub const nv15_since_version = 1;
                pub const q410_since_version = 1;
                pub const q401_since_version = 1;
                pub const xrgb16161616_since_version = 1;
                pub const xbgr16161616_since_version = 1;
                pub const argb16161616_since_version = 1;
                pub const abgr16161616_since_version = 1;
                pub const c1_since_version = 1;
                pub const c2_since_version = 1;
                pub const c4_since_version = 1;
                pub const d1_since_version = 1;
                pub const d2_since_version = 1;
                pub const d4_since_version = 1;
                pub const d8_since_version = 1;
                pub const r1_since_version = 1;
                pub const r2_since_version = 1;
                pub const r4_since_version = 1;
                pub const r10_since_version = 1;
                pub const r12_since_version = 1;
                pub const avuy8888_since_version = 1;
                pub const xvuy8888_since_version = 1;
                pub const p030_since_version = 1;

                argb8888 = 0,
                xrgb8888 = 1,
                c8 = 0x20203843,
                rgb332 = 0x38424752,
                bgr233 = 0x38524742,
                xrgb4444 = 0x32315258,
                xbgr4444 = 0x32314258,
                rgbx4444 = 0x32315852,
                bgrx4444 = 0x32315842,
                argb4444 = 0x32315241,
                abgr4444 = 0x32314241,
                rgba4444 = 0x32314152,
                bgra4444 = 0x32314142,
                xrgb1555 = 0x35315258,
                xbgr1555 = 0x35314258,
                rgbx5551 = 0x35315852,
                bgrx5551 = 0x35315842,
                argb1555 = 0x35315241,
                abgr1555 = 0x35314241,
                rgba5551 = 0x35314152,
                bgra5551 = 0x35314142,
                rgb565 = 0x36314752,
                bgr565 = 0x36314742,
                rgb888 = 0x34324752,
                bgr888 = 0x34324742,
                xbgr8888 = 0x34324258,
                rgbx8888 = 0x34325852,
                bgrx8888 = 0x34325842,
                abgr8888 = 0x34324241,
                rgba8888 = 0x34324152,
                bgra8888 = 0x34324142,
                xrgb2101010 = 0x30335258,
                xbgr2101010 = 0x30334258,
                rgbx1010102 = 0x30335852,
                bgrx1010102 = 0x30335842,
                argb2101010 = 0x30335241,
                abgr2101010 = 0x30334241,
                rgba1010102 = 0x30334152,
                bgra1010102 = 0x30334142,
                yuyv = 0x56595559,
                yvyu = 0x55595659,
                uyvy = 0x59565955,
                vyuy = 0x59555956,
                ayuv = 0x56555941,
                nv12 = 0x3231564e,
                nv21 = 0x3132564e,
                nv16 = 0x3631564e,
                nv61 = 0x3136564e,
                yuv410 = 0x39565559,
                yvu410 = 0x39555659,
                yuv411 = 0x31315559,
                yvu411 = 0x31315659,
                yuv420 = 0x32315559,
                yvu420 = 0x32315659,
                yuv422 = 0x36315559,
                yvu422 = 0x36315659,
                yuv444 = 0x34325559,
                yvu444 = 0x34325659,
                r8 = 0x20203852,
                r16 = 0x20363152,
                rg88 = 0x38384752,
                gr88 = 0x38385247,
                rg1616 = 0x32334752,
                gr1616 = 0x32335247,
                xrgb16161616f = 0x48345258,
                xbgr16161616f = 0x48344258,
                argb16161616f = 0x48345241,
                abgr16161616f = 0x48344241,
                xyuv8888 = 0x56555958,
                vuy888 = 0x34325556,
                vuy101010 = 0x30335556,
                y210 = 0x30313259,
                y212 = 0x32313259,
                y216 = 0x36313259,
                y410 = 0x30313459,
                y412 = 0x32313459,
                y416 = 0x36313459,
                xvyu2101010 = 0x30335658,
                xvyu12_16161616 = 0x36335658,
                xvyu16161616 = 0x38345658,
                y0l0 = 0x304c3059,
                x0l0 = 0x304c3058,
                y0l2 = 0x324c3059,
                x0l2 = 0x324c3058,
                yuv420_8bit = 0x38305559,
                yuv420_10bit = 0x30315559,
                xrgb8888_a8 = 0x38415258,
                xbgr8888_a8 = 0x38414258,
                rgbx8888_a8 = 0x38415852,
                bgrx8888_a8 = 0x38415842,
                rgb888_a8 = 0x38413852,
                bgr888_a8 = 0x38413842,
                rgb565_a8 = 0x38413552,
                bgr565_a8 = 0x38413542,
                nv24 = 0x3432564e,
                nv42 = 0x3234564e,
                p210 = 0x30313250,
                p010 = 0x30313050,
                p012 = 0x32313050,
                p016 = 0x36313050,
                axbxgxrx106106106106 = 0x30314241,
                nv15 = 0x3531564e,
                q410 = 0x30313451,
                q401 = 0x31303451,
                xrgb16161616 = 0x38345258,
                xbgr16161616 = 0x38344258,
                argb16161616 = 0x38345241,
                abgr16161616 = 0x38344241,
                c1 = 0x20203143,
                c2 = 0x20203243,
                c4 = 0x20203443,
                d1 = 0x20203144,
                d2 = 0x20203244,
                d4 = 0x20203444,
                d8 = 0x20203844,
                r1 = 0x20203152,
                r2 = 0x20203252,
                r4 = 0x20203452,
                r10 = 0x20303152,
                r12 = 0x20323152,
                avuy8888 = 0x59555641,
                xvuy8888 = 0x59555658,
                p030 = 0x30333050,
                _,
            };
        };
        const shm_pool = struct {
            const interface: common.Interface = .{
                .name = "wl_shm_pool",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "create_buffer",
                        .signature = "niiiiu",
                        .types = &.{
                            &common.wl.buffer.interface,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "resize",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const data_device_manager = struct {
            const interface: common.Interface = .{
                .name = "wl_data_device_manager",
                .version = 3,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "create_data_source",
                        .signature = "n",
                        .types = &.{
                            &common.wl.data_source.interface,
                        },
                    },
                    .{
                        .name = "get_data_device",
                        .signature = "no",
                        .types = &.{
                            &common.wl.data_device.interface,
                            &common.wl.seat.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            /// This is a bitmask of the available/preferred actions in a
            /// drag-and-drop operation.
            ///
            /// In the compositor, the selected action is a result of matching the
            /// actions offered by the source and destination sides.  "action" events
            /// with a "none" action will be sent to both source and destination if
            /// there is no match. All further checks will effectively happen on
            /// (source actions ∩ destination actions).
            ///
            /// In addition, compositors may also pick different actions in
            /// reaction to key modifiers being pressed. One common design that
            /// is used in major toolkits (and the behavior recommended for
            /// compositors) is:
            ///
            /// - If no modifiers are pressed, the first match (in bit order)
            /// will be used.
            /// - Pressing Shift selects "move", if enabled in the mask.
            /// - Pressing Control selects "copy", if enabled in the mask.
            ///
            /// Behavior beyond that is considered implementation-dependent.
            /// Compositors may for example bind other modifiers (like Alt/Meta)
            /// or drags initiated with other buttons than BTN_LEFT to specific
            /// actions (e.g. "ask").
            const DndAction = packed struct(u32) {
                pub const none_since_version = 1;
                pub const copy_since_version = 1;
                pub const move_since_version = 1;
                pub const ask_since_version = 1;

                copy: bool = false,
                move: bool = false,
                ask: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const copy_since_version = 1;
                    pub const move_since_version = 1;
                    pub const ask_since_version = 1;

                    none = 0,
                    copy = 1,
                    move = 2,
                    ask = 4,
                    _,
                };
            };
        };
        const data_source = struct {
            const interface: common.Interface = .{
                .name = "wl_data_source",
                .version = 3,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "offer",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_actions",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 6,
                .events = &.{
                    .{
                        .name = "target",
                        .signature = "?s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "send",
                        .signature = "sh",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "cancelled",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "dnd_drop_performed",
                        .signature = "3",
                        .types = null,
                    },
                    .{
                        .name = "dnd_finished",
                        .signature = "3",
                        .types = null,
                    },
                    .{
                        .name = "action",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_action_mask_since_version = 1;
                pub const invalid_source_since_version = 1;

                invalid_action_mask = 0,
                invalid_source = 1,
                _,
            };
        };
        const data_device = struct {
            const interface: common.Interface = .{
                .name = "wl_data_device",
                .version = 3,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "start_drag",
                        .signature = "?oo?ou",
                        .types = &.{
                            &common.wl.data_source.interface,
                            &common.wl.surface.interface,
                            &common.wl.surface.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_selection",
                        .signature = "?ou",
                        .types = &.{
                            &common.wl.data_source.interface,
                            null,
                        },
                    },
                    .{
                        .name = "release",
                        .signature = "2",
                        .types = null,
                    },
                },
                .event_count = 6,
                .events = &.{
                    .{
                        .name = "data_offer",
                        .signature = "n",
                        .types = &.{
                            &common.wl.data_offer.interface,
                        },
                    },
                    .{
                        .name = "enter",
                        .signature = "uoff?o",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                            &common.wl.data_offer.interface,
                        },
                    },
                    .{
                        .name = "leave",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "motion",
                        .signature = "uff",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "drop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "selection",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.data_offer.interface,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const role_since_version = 1;
                pub const used_source_since_version = 1;

                role = 0,
                used_source = 1,
                _,
            };
        };
        const data_offer = struct {
            const interface: common.Interface = .{
                .name = "wl_data_offer",
                .version = 3,
                .method_count = 5,
                .methods = &.{
                    .{
                        .name = "accept",
                        .signature = "u?s",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "receive",
                        .signature = "sh",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "finish",
                        .signature = "3",
                        .types = null,
                    },
                    .{
                        .name = "set_actions",
                        .signature = "3uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "offer",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "source_actions",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "action",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_finish_since_version = 1;
                pub const invalid_action_mask_since_version = 1;
                pub const invalid_action_since_version = 1;
                pub const invalid_offer_since_version = 1;

                invalid_finish = 0,
                invalid_action_mask = 1,
                invalid_action = 2,
                invalid_offer = 3,
                _,
            };
        };
        const shell = struct {
            const interface: common.Interface = .{
                .name = "wl_shell",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "get_shell_surface",
                        .signature = "no",
                        .types = &.{
                            &common.wl.shell_surface.interface,
                            &common.wl.surface.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const shell_surface = struct {
            const interface: common.Interface = .{
                .name = "wl_shell_surface",
                .version = 1,
                .method_count = 10,
                .methods = &.{
                    .{
                        .name = "pong",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "move",
                        .signature = "ou",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                        },
                    },
                    .{
                        .name = "resize",
                        .signature = "ouu",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_toplevel",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_transient",
                        .signature = "oiiu",
                        .types = &.{
                            &common.wl.surface.interface,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_fullscreen",
                        .signature = "uu?o",
                        .types = &.{
                            null,
                            null,
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "set_popup",
                        .signature = "ouoiiu",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_maximized",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "set_title",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_class",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "ping",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "configure",
                        .signature = "uii",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "popup_done",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const seat = struct {
            const interface: common.Interface = .{
                .name = "wl_seat",
                .version = 10,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "get_pointer",
                        .signature = "n",
                        .types = &.{
                            &common.wl.pointer.interface,
                        },
                    },
                    .{
                        .name = "get_keyboard",
                        .signature = "n",
                        .types = &.{
                            &common.wl.keyboard.interface,
                        },
                    },
                    .{
                        .name = "get_touch",
                        .signature = "n",
                        .types = &.{
                            &common.wl.touch.interface,
                        },
                    },
                    .{
                        .name = "release",
                        .signature = "5",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "capabilities",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "name",
                        .signature = "2s",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// This is a bitmask of capabilities this seat has; if a member is
            /// set, then it is present on the seat.
            const Capability = packed struct(u32) {
                pub const pointer_since_version = 1;
                pub const keyboard_since_version = 1;
                pub const touch_since_version = 1;

                pointer: bool = false,
                keyboard: bool = false,
                touch: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const pointer_since_version = 1;
                    pub const keyboard_since_version = 1;
                    pub const touch_since_version = 1;

                    pointer = 1,
                    keyboard = 2,
                    touch = 4,
                    _,
                };
            };

            /// These errors can be emitted in response to wl_seat requests.
            const Error = enum(c_int) {
                pub const missing_capability_since_version = 1;

                missing_capability = 0,
                _,
            };
        };
        const pointer = struct {
            const interface: common.Interface = .{
                .name = "wl_pointer",
                .version = 10,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_cursor",
                        .signature = "u?oii",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "release",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 11,
                .events = &.{
                    .{
                        .name = "enter",
                        .signature = "uoff",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "leave",
                        .signature = "uo",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "motion",
                        .signature = "uff",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "button",
                        .signature = "uuuu",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "axis",
                        .signature = "uuf",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "frame",
                        .signature = "5",
                        .types = null,
                    },
                    .{
                        .name = "axis_source",
                        .signature = "5u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "axis_stop",
                        .signature = "5uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "axis_discrete",
                        .signature = "5ui",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "axis_value120",
                        .signature = "8ui",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "axis_relative_direction",
                        .signature = "9uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const role_since_version = 1;

                role = 0,
                _,
            };

            /// Describes the physical state of a button that produced the button
            /// event.
            const ButtonState = enum(c_int) {
                pub const released_since_version = 1;
                pub const pressed_since_version = 1;

                released = 0,
                pressed = 1,
                _,
            };

            /// Describes the axis types of scroll events.
            const Axis = enum(c_int) {
                pub const vertical_scroll_since_version = 1;
                pub const horizontal_scroll_since_version = 1;

                vertical_scroll = 0,
                horizontal_scroll = 1,
                _,
            };

            /// Describes the source types for axis events. This indicates to the
            /// client how an axis event was physically generated; a client may
            /// adjust the user interface accordingly. For example, scroll events
            /// from a "finger" source may be in a smooth coordinate space with
            /// kinetic scrolling whereas a "wheel" source may be in discrete steps
            /// of a number of lines.
            ///
            /// The "continuous" axis source is a device generating events in a
            /// continuous coordinate space, but using something other than a
            /// finger. One example for this source is button-based scrolling where
            /// the vertical motion of a device is converted to scroll events while
            /// a button is held down.
            ///
            /// The "wheel tilt" axis source indicates that the actual device is a
            /// wheel but the scroll event is not caused by a rotation but a
            /// (usually sideways) tilt of the wheel.
            const AxisSource = enum(c_int) {
                pub const wheel_since_version = 1;
                pub const finger_since_version = 1;
                pub const continuous_since_version = 1;
                pub const wheel_tilt_since_version = 6;

                wheel = 0,
                finger = 1,
                continuous = 2,
                wheel_tilt = 3,
                _,
            };

            /// This specifies the direction of the physical motion that caused a
            /// wl_pointer.axis event, relative to the wl_pointer.axis direction.
            const AxisRelativeDirection = enum(c_int) {
                pub const identical_since_version = 1;
                pub const inverted_since_version = 1;

                identical = 0,
                inverted = 1,
                _,
            };
        };
        const keyboard = struct {
            const interface: common.Interface = .{
                .name = "wl_keyboard",
                .version = 10,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "release",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 6,
                .events = &.{
                    .{
                        .name = "keymap",
                        .signature = "uhu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "enter",
                        .signature = "uoa",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                            null,
                        },
                    },
                    .{
                        .name = "leave",
                        .signature = "uo",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "key",
                        .signature = "uuuu",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "modifiers",
                        .signature = "uuuuu",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "repeat_info",
                        .signature = "4ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            /// This specifies the format of the keymap provided to the
            /// client with the wl_keyboard.keymap event.
            const KeymapFormat = enum(c_int) {
                pub const no_keymap_since_version = 1;
                pub const xkb_v1_since_version = 1;

                no_keymap = 0,
                xkb_v1 = 1,
                _,
            };

            /// Describes the physical state of a key that produced the key event.
            ///
            /// Since version 10, the key can be in a "repeated" pseudo-state which
            /// means the same as "pressed", but is used to signal repetition in the
            /// key event.
            ///
            /// The key may only enter the repeated state after entering the pressed
            /// state and before entering the released state. This event may be
            /// generated multiple times while the key is down.
            const KeyState = enum(c_int) {
                pub const released_since_version = 1;
                pub const pressed_since_version = 1;

                released = 0,
                pressed = 1,
                _,
            };
        };
        const touch = struct {
            const interface: common.Interface = .{
                .name = "wl_touch",
                .version = 10,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "release",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 7,
                .events = &.{
                    .{
                        .name = "down",
                        .signature = "uuoiff",
                        .types = &.{
                            null,
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "up",
                        .signature = "uui",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "motion",
                        .signature = "uiff",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "frame",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "cancel",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "shape",
                        .signature = "6iff",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "orientation",
                        .signature = "6if",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
        };
        const output = struct {
            const interface: common.Interface = .{
                .name = "wl_output",
                .version = 4,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "release",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 6,
                .events = &.{
                    .{
                        .name = "geometry",
                        .signature = "iiiiissi",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "mode",
                        .signature = "uiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "2",
                        .types = null,
                    },
                    .{
                        .name = "scale",
                        .signature = "2i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "name",
                        .signature = "4s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "description",
                        .signature = "4s",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// This enumeration describes how the physical
            /// pixels on an output are laid out.
            const Subpixel = enum(c_int) {
                pub const unknown_since_version = 1;
                pub const none_since_version = 1;
                pub const horizontal_rgb_since_version = 1;
                pub const horizontal_bgr_since_version = 1;
                pub const vertical_rgb_since_version = 1;
                pub const vertical_bgr_since_version = 1;

                unknown = 0,
                none = 1,
                horizontal_rgb = 2,
                horizontal_bgr = 3,
                vertical_rgb = 4,
                vertical_bgr = 5,
                _,
            };

            /// This describes transformations that clients and compositors apply to
            /// buffer contents.
            ///
            /// The flipped values correspond to an initial flip around a
            /// vertical axis followed by rotation.
            ///
            /// The purpose is mainly to allow clients to render accordingly and
            /// tell the compositor, so that for fullscreen surfaces, the
            /// compositor will still be able to scan out directly from client
            /// surfaces.
            const Transform = enum(c_int) {
                pub const normal_since_version = 1;
                pub const @"90_since_version" = 1;
                pub const @"180_since_version" = 1;
                pub const @"270_since_version" = 1;
                pub const flipped_since_version = 1;
                pub const flipped_90_since_version = 1;
                pub const flipped_180_since_version = 1;
                pub const flipped_270_since_version = 1;

                normal = 0,
                @"90" = 1,
                @"180" = 2,
                @"270" = 3,
                flipped = 4,
                flipped_90 = 5,
                flipped_180 = 6,
                flipped_270 = 7,
                _,
            };

            /// These flags describe properties of an output mode.
            /// They are used in the flags bitfield of the mode event.
            const Mode = packed struct(u32) {
                pub const current_since_version = 1;
                pub const preferred_since_version = 1;

                current: bool = false,
                preferred: bool = false,
                _padding2: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const current_since_version = 1;
                    pub const preferred_since_version = 1;

                    current = 0x1,
                    preferred = 0x2,
                    _,
                };
            };
        };
        const subcompositor = struct {
            const interface: common.Interface = .{
                .name = "wl_subcompositor",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_subsurface",
                        .signature = "noo",
                        .types = &.{
                            &common.wl.subsurface.interface,
                            &common.wl.surface.interface,
                            &common.wl.surface.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const bad_surface_since_version = 1;
                pub const bad_parent_since_version = 1;

                bad_surface = 0,
                bad_parent = 1,
                _,
            };
        };
        const subsurface = struct {
            const interface: common.Interface = .{
                .name = "wl_subsurface",
                .version = 1,
                .method_count = 6,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_position",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "place_above",
                        .signature = "o",
                        .types = &.{
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "place_below",
                        .signature = "o",
                        .types = &.{
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "set_sync",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_desync",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const bad_surface_since_version = 1;

                bad_surface = 0,
                _,
            };
        };
        const fixes = struct {
            const interface: common.Interface = .{
                .name = "wl_fixes",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "destroy_registry",
                        .signature = "o",
                        .types = &.{
                            &common.wl.registry.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
    };
    const zwp = struct {
        const tablet_manager_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_manager_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "get_tablet_seat",
                        .signature = "no",
                        .types = &.{
                            &common.zwp.tablet_seat_v2.interface,
                            &common.wl.seat.interface,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const tablet_seat_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_seat_v2",
                .version = 2,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "tablet_added",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_v2.interface,
                        },
                    },
                    .{
                        .name = "tool_added",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_tool_v2.interface,
                        },
                    },
                    .{
                        .name = "pad_added",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_pad_v2.interface,
                        },
                    },
                },
            };
        };
        const tablet_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_v2",
                .version = 2,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 6,
                .events = &.{
                    .{
                        .name = "name",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "id",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "path",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "bustype",
                        .signature = "2u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const tablet_tool_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_tool_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_cursor",
                        .signature = "u?oii",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 19,
                .events = &.{
                    .{
                        .name = "type",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "hardware_serial",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "hardware_id_wacom",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "capability",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "proximity_in",
                        .signature = "uoo",
                        .types = &.{
                            null,
                            &common.zwp.tablet_v2.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "proximity_out",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "down",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "up",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "motion",
                        .signature = "ff",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "pressure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "distance",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tilt",
                        .signature = "ff",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "rotation",
                        .signature = "f",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "slider",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "wheel",
                        .signature = "fi",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "button",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "frame",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// Describes the physical type of a tool. The physical type of a tool
            /// generally defines its base usage.
            ///
            /// The mouse tool represents a mouse-shaped tool that is not a relative
            /// device but bound to the tablet's surface, providing absolute
            /// coordinates.
            ///
            /// The lens tool is a mouse-shaped tool with an attached lens to
            /// provide precision focus.
            const Type = enum(c_int) {
                pub const pen_since_version = 1;
                pub const eraser_since_version = 1;
                pub const brush_since_version = 1;
                pub const pencil_since_version = 1;
                pub const airbrush_since_version = 1;
                pub const finger_since_version = 1;
                pub const mouse_since_version = 1;
                pub const lens_since_version = 1;

                pen = 0x140,
                eraser = 0x141,
                brush = 0x142,
                pencil = 0x143,
                airbrush = 0x144,
                finger = 0x145,
                mouse = 0x146,
                lens = 0x147,
                _,
            };

            /// Describes extra capabilities on a tablet.
            ///
            /// Any tool must provide x and y values, extra axes are
            /// device-specific.
            const Capability = enum(c_int) {
                pub const tilt_since_version = 1;
                pub const pressure_since_version = 1;
                pub const distance_since_version = 1;
                pub const rotation_since_version = 1;
                pub const slider_since_version = 1;
                pub const wheel_since_version = 1;

                tilt = 1,
                pressure = 2,
                distance = 3,
                rotation = 4,
                slider = 5,
                wheel = 6,
                _,
            };

            /// Describes the physical state of a button that produced the button event.
            const ButtonState = enum(c_int) {
                pub const released_since_version = 1;
                pub const pressed_since_version = 1;

                released = 0,
                pressed = 1,
                _,
            };
            const Error = enum(c_int) {
                pub const role_since_version = 1;

                role = 0,
                _,
            };
        };
        const tablet_pad_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_pad_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_feedback",
                        .signature = "usu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 8,
                .events = &.{
                    .{
                        .name = "group",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_pad_group_v2.interface,
                        },
                    },
                    .{
                        .name = "path",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "buttons",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "button",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "enter",
                        .signature = "uoo",
                        .types = &.{
                            null,
                            &common.zwp.tablet_v2.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "leave",
                        .signature = "uo",
                        .types = &.{
                            null,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            /// Describes the physical state of a button that caused the button
            /// event.
            const ButtonState = enum(c_int) {
                pub const released_since_version = 1;
                pub const pressed_since_version = 1;

                released = 0,
                pressed = 1,
                _,
            };
        };
        const tablet_pad_group_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_pad_group_v2",
                .version = 2,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 7,
                .events = &.{
                    .{
                        .name = "buttons",
                        .signature = "a",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "ring",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_pad_ring_v2.interface,
                        },
                    },
                    .{
                        .name = "strip",
                        .signature = "n",
                        .types = &.{
                            &common.zwp.tablet_pad_strip_v2.interface,
                        },
                    },
                    .{
                        .name = "modes",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "mode_switch",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "dial",
                        .signature = "2n",
                        .types = &.{
                            &common.zwp.tablet_pad_dial_v2.interface,
                        },
                    },
                },
            };
        };
        const tablet_pad_ring_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_pad_ring_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_feedback",
                        .signature = "su",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 4,
                .events = &.{
                    .{
                        .name = "source",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "angle",
                        .signature = "f",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "frame",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// Describes the source types for ring events. This indicates to the
            /// client how a ring event was physically generated; a client may
            /// adjust the user interface accordingly. For example, events
            /// from a "finger" source may trigger kinetic scrolling.
            const Source = enum(c_int) {
                pub const finger_since_version = 1;

                finger = 1,
                _,
            };
        };
        const tablet_pad_strip_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_pad_strip_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_feedback",
                        .signature = "su",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 4,
                .events = &.{
                    .{
                        .name = "source",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "position",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "frame",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            /// Describes the source types for strip events. This indicates to the
            /// client how a strip event was physically generated; a client may
            /// adjust the user interface accordingly. For example, events
            /// from a "finger" source may trigger kinetic scrolling.
            const Source = enum(c_int) {
                pub const finger_since_version = 1;

                finger = 1,
                _,
            };
        };
        const tablet_pad_dial_v2 = struct {
            const interface: common.Interface = .{
                .name = "zwp_tablet_pad_dial_v2",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_feedback",
                        .signature = "su",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "delta",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "frame",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const pointer_constraints_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_pointer_constraints_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "lock_pointer",
                        .signature = "noo?ou",
                        .types = &.{
                            &common.zwp.locked_pointer_v1.interface,
                            &common.wl.surface.interface,
                            &common.wl.pointer.interface,
                            &common.wl.region.interface,
                            null,
                        },
                    },
                    .{
                        .name = "confine_pointer",
                        .signature = "noo?ou",
                        .types = &.{
                            &common.zwp.confined_pointer_v1.interface,
                            &common.wl.surface.interface,
                            &common.wl.pointer.interface,
                            &common.wl.region.interface,
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            /// These errors can be emitted in response to wp_pointer_constraints
            /// requests.
            const Error = enum(c_int) {
                pub const already_constrained_since_version = 1;

                already_constrained = 1,
                _,
            };

            /// These values represent different lifetime semantics. They are passed
            /// as arguments to the factory requests to specify how the constraint
            /// lifetimes should be managed.
            const Lifetime = enum(c_int) {
                pub const oneshot_since_version = 1;
                pub const persistent_since_version = 1;

                oneshot = 1,
                persistent = 2,
                _,
            };
        };
        const locked_pointer_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_locked_pointer_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_cursor_position_hint",
                        .signature = "ff",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_region",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.region.interface,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "locked",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unlocked",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const confined_pointer_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_confined_pointer_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_region",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.region.interface,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "confined",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unconfined",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const pointer_gestures_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_pointer_gestures_v1",
                .version = 3,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "get_swipe_gesture",
                        .signature = "no",
                        .types = &.{
                            &common.zwp.pointer_gesture_swipe_v1.interface,
                            &common.wl.pointer.interface,
                        },
                    },
                    .{
                        .name = "get_pinch_gesture",
                        .signature = "no",
                        .types = &.{
                            &common.zwp.pointer_gesture_pinch_v1.interface,
                            &common.wl.pointer.interface,
                        },
                    },
                    .{
                        .name = "release",
                        .signature = "2",
                        .types = null,
                    },
                    .{
                        .name = "get_hold_gesture",
                        .signature = "3no",
                        .types = &.{
                            &common.zwp.pointer_gesture_hold_v1.interface,
                            &common.wl.pointer.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const pointer_gesture_swipe_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_pointer_gesture_swipe_v1",
                .version = 3,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "begin",
                        .signature = "uuou",
                        .types = &.{
                            null,
                            null,
                            &common.wl.surface.interface,
                            null,
                        },
                    },
                    .{
                        .name = "update",
                        .signature = "uff",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "end",
                        .signature = "uui",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                },
            };
        };
        const pointer_gesture_pinch_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_pointer_gesture_pinch_v1",
                .version = 3,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "begin",
                        .signature = "uuou",
                        .types = &.{
                            null,
                            null,
                            &common.wl.surface.interface,
                            null,
                        },
                    },
                    .{
                        .name = "update",
                        .signature = "uffff",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "end",
                        .signature = "uui",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                },
            };
        };
        const pointer_gesture_hold_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_pointer_gesture_hold_v1",
                .version = 3,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "begin",
                        .signature = "3uuou",
                        .types = &.{
                            null,
                            null,
                            &common.wl.surface.interface,
                            null,
                        },
                    },
                    .{
                        .name = "end",
                        .signature = "3uui",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                },
            };
        };
        const virtual_keyboard_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_virtual_keyboard_manager_v1",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "create_virtual_keyboard",
                        .signature = "on",
                        .types = &.{
                            &common.wl.seat.interface,
                            &common.zwp.virtual_keyboard_v1.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const unauthorized_since_version = 1;

                unauthorized = 0,
                _,
            };
        };
        const virtual_keyboard_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwp_virtual_keyboard_v1",
                .version = 1,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "keymap",
                        .signature = "uhu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "key",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "modifiers",
                        .signature = "uuuu",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const no_keymap_since_version = 1;

                no_keymap = 0,
                _,
            };
        };
    };
    const xdg = struct {
        const wm_base = struct {
            const interface: common.Interface = .{
                .name = "xdg_wm_base",
                .version = 7,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "create_positioner",
                        .signature = "n",
                        .types = &.{
                            &common.xdg.positioner.interface,
                        },
                    },
                    .{
                        .name = "get_xdg_surface",
                        .signature = "no",
                        .types = &.{
                            &common.xdg.surface.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "pong",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "ping",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const role_since_version = 1;
                pub const defunct_surfaces_since_version = 1;
                pub const not_the_topmost_popup_since_version = 1;
                pub const invalid_popup_parent_since_version = 1;
                pub const invalid_surface_state_since_version = 1;
                pub const invalid_positioner_since_version = 1;
                pub const unresponsive_since_version = 1;

                role = 0,
                defunct_surfaces = 1,
                not_the_topmost_popup = 2,
                invalid_popup_parent = 3,
                invalid_surface_state = 4,
                invalid_positioner = 5,
                unresponsive = 6,
                _,
            };
        };
        const positioner = struct {
            const interface: common.Interface = .{
                .name = "xdg_positioner",
                .version = 7,
                .method_count = 10,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_size",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_anchor_rect",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_anchor",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_gravity",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_constraint_adjustment",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_offset",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_reactive",
                        .signature = "3",
                        .types = null,
                    },
                    .{
                        .name = "set_parent_size",
                        .signature = "3ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_parent_configure",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const invalid_input_since_version = 1;

                invalid_input = 0,
                _,
            };
            const Anchor = enum(c_int) {
                pub const none_since_version = 1;
                pub const top_since_version = 1;
                pub const bottom_since_version = 1;
                pub const left_since_version = 1;
                pub const right_since_version = 1;
                pub const top_left_since_version = 1;
                pub const bottom_left_since_version = 1;
                pub const top_right_since_version = 1;
                pub const bottom_right_since_version = 1;

                none = 0,
                top = 1,
                bottom = 2,
                left = 3,
                right = 4,
                top_left = 5,
                bottom_left = 6,
                top_right = 7,
                bottom_right = 8,
                _,
            };
            const Gravity = enum(c_int) {
                pub const none_since_version = 1;
                pub const top_since_version = 1;
                pub const bottom_since_version = 1;
                pub const left_since_version = 1;
                pub const right_since_version = 1;
                pub const top_left_since_version = 1;
                pub const bottom_left_since_version = 1;
                pub const top_right_since_version = 1;
                pub const bottom_right_since_version = 1;

                none = 0,
                top = 1,
                bottom = 2,
                left = 3,
                right = 4,
                top_left = 5,
                bottom_left = 6,
                top_right = 7,
                bottom_right = 8,
                _,
            };

            /// The constraint adjustment value define ways the compositor will adjust
            /// the position of the surface, if the unadjusted position would result
            /// in the surface being partly constrained.
            ///
            /// Whether a surface is considered 'constrained' is left to the compositor
            /// to determine. For example, the surface may be partly outside the
            /// compositor's defined 'work area', thus necessitating the child surface's
            /// position be adjusted until it is entirely inside the work area.
            ///
            /// The adjustments can be combined, according to a defined precedence: 1)
            /// Flip, 2) Slide, 3) Resize.
            const ConstraintAdjustment = packed struct(u32) {
                pub const none_since_version = 1;
                pub const slide_x_since_version = 1;
                pub const slide_y_since_version = 1;
                pub const flip_x_since_version = 1;
                pub const flip_y_since_version = 1;
                pub const resize_x_since_version = 1;
                pub const resize_y_since_version = 1;

                slide_x: bool = false,
                slide_y: bool = false,
                flip_x: bool = false,
                flip_y: bool = false,
                resize_x: bool = false,
                resize_y: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const slide_x_since_version = 1;
                    pub const slide_y_since_version = 1;
                    pub const flip_x_since_version = 1;
                    pub const flip_y_since_version = 1;
                    pub const resize_x_since_version = 1;
                    pub const resize_y_since_version = 1;

                    none = 0,
                    slide_x = 1,
                    slide_y = 2,
                    flip_x = 4,
                    flip_y = 8,
                    resize_x = 16,
                    resize_y = 32,
                    _,
                };
            };
        };
        const surface = struct {
            const interface: common.Interface = .{
                .name = "xdg_surface",
                .version = 7,
                .method_count = 5,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_toplevel",
                        .signature = "n",
                        .types = &.{
                            &common.xdg.toplevel.interface,
                        },
                    },
                    .{
                        .name = "get_popup",
                        .signature = "n?oo",
                        .types = &.{
                            &common.xdg.popup.interface,
                            &common.xdg.surface.interface,
                            &common.xdg.positioner.interface,
                        },
                    },
                    .{
                        .name = "set_window_geometry",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "ack_configure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const not_constructed_since_version = 1;
                pub const already_constructed_since_version = 1;
                pub const unconfigured_buffer_since_version = 1;
                pub const invalid_serial_since_version = 1;
                pub const invalid_size_since_version = 1;
                pub const defunct_role_object_since_version = 1;

                not_constructed = 1,
                already_constructed = 2,
                unconfigured_buffer = 3,
                invalid_serial = 4,
                invalid_size = 5,
                defunct_role_object = 6,
                _,
            };
        };
        const toplevel = struct {
            const interface: common.Interface = .{
                .name = "xdg_toplevel",
                .version = 7,
                .method_count = 14,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_parent",
                        .signature = "?o",
                        .types = &.{
                            &common.xdg.toplevel.interface,
                        },
                    },
                    .{
                        .name = "set_title",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_app_id",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "show_window_menu",
                        .signature = "ouii",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "move",
                        .signature = "ou",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                        },
                    },
                    .{
                        .name = "resize",
                        .signature = "ouu",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_max_size",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_min_size",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_maximized",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unset_maximized",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_fullscreen",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "unset_fullscreen",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_minimized",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 4,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "iia",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "close",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "configure_bounds",
                        .signature = "4ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "wm_capabilities",
                        .signature = "5a",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_resize_edge_since_version = 1;
                pub const invalid_parent_since_version = 1;
                pub const invalid_size_since_version = 1;

                invalid_resize_edge = 0,
                invalid_parent = 1,
                invalid_size = 2,
                _,
            };

            /// These values are used to indicate which edge of a surface
            /// is being dragged in a resize operation.
            const ResizeEdge = enum(c_int) {
                pub const none_since_version = 1;
                pub const top_since_version = 1;
                pub const bottom_since_version = 1;
                pub const left_since_version = 1;
                pub const top_left_since_version = 1;
                pub const bottom_left_since_version = 1;
                pub const right_since_version = 1;
                pub const top_right_since_version = 1;
                pub const bottom_right_since_version = 1;

                none = 0,
                top = 1,
                bottom = 2,
                left = 4,
                top_left = 5,
                bottom_left = 6,
                right = 8,
                top_right = 9,
                bottom_right = 10,
                _,
            };

            /// The different state values used on the surface. This is designed for
            /// state values like maximized, fullscreen. It is paired with the
            /// configure event to ensure that both the client and the compositor
            /// setting the state can be synchronized.
            ///
            /// States set in this way are double-buffered, see wl_surface.commit.
            const State = enum(c_int) {
                pub const maximized_since_version = 1;
                pub const fullscreen_since_version = 1;
                pub const resizing_since_version = 1;
                pub const activated_since_version = 1;
                pub const tiled_left_since_version = 2;
                pub const tiled_right_since_version = 2;
                pub const tiled_top_since_version = 2;
                pub const tiled_bottom_since_version = 2;

                maximized = 1,
                fullscreen = 2,
                resizing = 3,
                activated = 4,
                tiled_left = 5,
                tiled_right = 6,
                tiled_top = 7,
                tiled_bottom = 8,
                _,
            };
        };
        const popup = struct {
            const interface: common.Interface = .{
                .name = "xdg_popup",
                .version = 7,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "grab",
                        .signature = "ou",
                        .types = &.{
                            &common.wl.seat.interface,
                            null,
                        },
                    },
                    .{
                        .name = "reposition",
                        .signature = "3ou",
                        .types = &.{
                            &common.xdg.positioner.interface,
                            null,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "popup_done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "repositioned",
                        .signature = "3u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_grab_since_version = 1;

                invalid_grab = 0,
                _,
            };
        };
    };
    const wp = struct {
        const color_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_manager_v1",
                .version = 2,
                .method_count = 8,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_output",
                        .signature = "no",
                        .types = &.{
                            &common.wp.color_management_output_v1.interface,
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "get_surface",
                        .signature = "no",
                        .types = &.{
                            &common.wp.color_management_surface_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "get_surface_feedback",
                        .signature = "no",
                        .types = &.{
                            &common.wp.color_management_surface_feedback_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "create_icc_creator",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_creator_icc_v1.interface,
                        },
                    },
                    .{
                        .name = "create_parametric_creator",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_creator_params_v1.interface,
                        },
                    },
                    .{
                        .name = "create_windows_scrgb",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                    .{
                        .name = "get_image_description",
                        .signature = "2no",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                            &common.wp.image_description_reference_v1.interface,
                        },
                    },
                },
                .event_count = 5,
                .events = &.{
                    .{
                        .name = "supported_intent",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "supported_feature",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "supported_tf_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "supported_primaries_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            const Error = enum(c_int) {
                pub const unsupported_feature_since_version = 1;
                pub const surface_exists_since_version = 1;

                unsupported_feature = 0,
                surface_exists = 1,
                _,
            };

            /// See the ICC.1:2022 specification from the International Color Consortium
            /// for more details about rendering intents.
            ///
            /// The principles of ICC defined rendering intents apply with all types of
            /// image descriptions, not only those with ICC file profiles.
            ///
            /// Compositors must support the perceptual rendering intent. Other
            /// rendering intents are optional.
            const RenderIntent = enum(c_int) {
                pub const perceptual_since_version = 1;
                pub const relative_since_version = 1;
                pub const saturation_since_version = 1;
                pub const absolute_since_version = 1;
                pub const relative_bpc_since_version = 1;
                pub const absolute_no_adaptation_since_version = 2;

                perceptual = 0,
                relative = 1,
                saturation = 2,
                absolute = 3,
                relative_bpc = 4,
                absolute_no_adaptation = 5,
                _,
            };
            const Feature = enum(c_int) {
                pub const icc_v2_v4_since_version = 1;
                pub const parametric_since_version = 1;
                pub const set_primaries_since_version = 1;
                pub const set_tf_power_since_version = 1;
                pub const set_luminances_since_version = 1;
                pub const set_mastering_display_primaries_since_version = 1;
                pub const extended_target_volume_since_version = 1;
                pub const windows_scrgb_since_version = 1;

                icc_v2_v4 = 0,
                parametric = 1,
                set_primaries = 2,
                set_tf_power = 3,
                set_luminances = 4,
                set_mastering_display_primaries = 5,
                extended_target_volume = 6,
                windows_scrgb = 7,
                _,
            };

            /// Named color primaries used to encode well-known sets of primaries.
            ///
            /// A value of 0 is invalid and will never be present in the list of enums.
            const Primaries = enum(c_int) {
                pub const srgb_since_version = 1;
                pub const pal_m_since_version = 1;
                pub const pal_since_version = 1;
                pub const ntsc_since_version = 1;
                pub const generic_film_since_version = 1;
                pub const bt2020_since_version = 1;
                pub const cie1931_xyz_since_version = 1;
                pub const dci_p3_since_version = 1;
                pub const display_p3_since_version = 1;
                pub const adobe_rgb_since_version = 1;

                srgb = 1,
                pal_m = 2,
                pal = 3,
                ntsc = 4,
                generic_film = 5,
                bt2020 = 6,
                cie1931_xyz = 7,
                dci_p3 = 8,
                display_p3 = 9,
                adobe_rgb = 10,
                _,
            };

            /// Named transfer functions used to represent well-known transfer
            /// characteristics of displays.
            ///
            /// A value of 0 is invalid and will never be present in the list of enums.
            ///
            /// See appendix.md for the formulae.
            const TransferFunction = enum(c_int) {
                pub const bt1886_since_version = 1;
                pub const gamma22_since_version = 1;
                pub const gamma28_since_version = 1;
                pub const st240_since_version = 1;
                pub const ext_linear_since_version = 1;
                pub const log_100_since_version = 1;
                pub const log_316_since_version = 1;
                pub const xvycc_since_version = 1;
                pub const srgb_since_version = 1;
                pub const ext_srgb_since_version = 1;
                pub const st2084_pq_since_version = 1;
                pub const st428_since_version = 1;
                pub const hlg_since_version = 1;
                pub const compound_power_2_4_since_version = 2;

                bt1886 = 1,
                gamma22 = 2,
                gamma28 = 3,
                st240 = 4,
                ext_linear = 5,
                log_100 = 6,
                log_316 = 7,
                xvycc = 8,
                srgb = 9,
                ext_srgb = 10,
                st2084_pq = 11,
                st428 = 12,
                hlg = 13,
                compound_power_2_4 = 14,
                _,
            };
        };
        const color_management_output_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_management_output_v1",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_image_description",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "image_description_changed",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const image_description_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_image_description_v1",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_information",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_info_v1.interface,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "failed",
                        .signature = "us",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "ready",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "ready2",
                        .signature = "2uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const not_ready_since_version = 1;
                pub const no_information_since_version = 1;

                not_ready = 0,
                no_information = 1,
                _,
            };
            const Cause = enum(c_int) {
                pub const low_version_since_version = 1;
                pub const unsupported_since_version = 1;
                pub const operating_system_since_version = 1;
                pub const no_output_since_version = 1;

                low_version = 0,
                unsupported = 1,
                operating_system = 2,
                no_output = 3,
                _,
            };
        };
        const image_description_info_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_image_description_info_v1",
                .version = 2,
                .method_count = 0,
                .methods = null,
                .event_count = 11,
                .events = &.{
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "icc_file",
                        .signature = "hu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "primaries",
                        .signature = "iiiiiiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "primaries_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tf_power",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tf_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "luminances",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "target_primaries",
                        .signature = "iiiiiiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "target_luminance",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "target_max_cll",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "target_max_fall",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const color_management_surface_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_management_surface_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_image_description",
                        .signature = "ou",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "unset_image_description",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const render_intent_since_version = 1;
                pub const image_description_since_version = 1;
                pub const inert_since_version = 1;

                render_intent = 0,
                image_description = 1,
                inert = 2,
                _,
            };
        };
        const color_management_surface_feedback_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_management_surface_feedback_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_preferred",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                    .{
                        .name = "get_preferred_parametric",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "preferred_changed",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "preferred_changed2",
                        .signature = "2uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const inert_since_version = 1;
                pub const unsupported_feature_since_version = 1;

                inert = 0,
                unsupported_feature = 1,
                _,
            };
        };
        const image_description_creator_icc_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_image_description_creator_icc_v1",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "create",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                    .{
                        .name = "set_icc_file",
                        .signature = "huu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const incomplete_set_since_version = 1;
                pub const already_set_since_version = 1;
                pub const bad_fd_since_version = 1;
                pub const bad_size_since_version = 1;
                pub const out_of_file_since_version = 1;

                incomplete_set = 0,
                already_set = 1,
                bad_fd = 2,
                bad_size = 3,
                out_of_file = 4,
                _,
            };
        };
        const image_description_creator_params_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_image_description_creator_params_v1",
                .version = 2,
                .method_count = 10,
                .methods = &.{
                    .{
                        .name = "create",
                        .signature = "n",
                        .types = &.{
                            &common.wp.image_description_v1.interface,
                        },
                    },
                    .{
                        .name = "set_tf_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_tf_power",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_primaries_named",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_primaries",
                        .signature = "iiiiiiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_luminances",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_mastering_display_primaries",
                        .signature = "iiiiiiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_mastering_luminance",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_max_cll",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_max_fall",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const incomplete_set_since_version = 1;
                pub const already_set_since_version = 1;
                pub const unsupported_feature_since_version = 1;
                pub const invalid_tf_since_version = 1;
                pub const invalid_primaries_named_since_version = 1;
                pub const invalid_luminance_since_version = 1;

                incomplete_set = 0,
                already_set = 1,
                unsupported_feature = 2,
                invalid_tf = 3,
                invalid_primaries_named = 4,
                invalid_luminance = 5,
                _,
            };
        };
        const image_description_reference_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_image_description_reference_v1",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const color_representation_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_representation_manager_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_surface",
                        .signature = "no",
                        .types = &.{
                            &common.wp.color_representation_surface_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "supported_alpha_mode",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "supported_coefficients_and_ranges",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "done",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            const Error = enum(c_int) {
                pub const surface_exists_since_version = 1;

                surface_exists = 1,
                _,
            };
        };
        const color_representation_surface_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_color_representation_surface_v1",
                .version = 1,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_alpha_mode",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_coefficients_and_range",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_chroma_location",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const alpha_mode_since_version = 1;
                pub const coefficients_since_version = 1;
                pub const pixel_format_since_version = 1;
                pub const inert_since_version = 1;
                pub const chroma_location_since_version = 1;

                alpha_mode = 1,
                coefficients = 2,
                pixel_format = 3,
                inert = 4,
                chroma_location = 5,
                _,
            };

            /// Specifies how the alpha channel affects the color channels.
            const AlphaMode = enum(c_int) {
                pub const premultiplied_electrical_since_version = 1;
                pub const premultiplied_optical_since_version = 1;
                pub const straight_since_version = 1;

                premultiplied_electrical = 0,
                premultiplied_optical = 1,
                straight = 2,
                _,
            };

            /// Named matrix coefficients used to encode well-known sets of
            /// coefficients. H.273 is the authority, when it comes to the exact values
            /// of coefficients and authoritative specifications, where an equivalent
            /// code point exists.
            ///
            /// A value of 0 is invalid and will never be present in the list of enums.
            ///
            /// Descriptions do list the specifications for convenience.
            const Coefficients = enum(c_int) {
                pub const identity_since_version = 1;
                pub const bt709_since_version = 1;
                pub const fcc_since_version = 1;
                pub const bt601_since_version = 1;
                pub const smpte240_since_version = 1;
                pub const bt2020_since_version = 1;
                pub const bt2020_cl_since_version = 1;
                pub const ictcp_since_version = 1;

                identity = 1,
                bt709 = 2,
                fcc = 3,
                bt601 = 4,
                smpte240 = 5,
                bt2020 = 6,
                bt2020_cl = 7,
                ictcp = 8,
                _,
            };

            /// Possible color range values.
            ///
            /// A value of 0 is invalid and will never be present in the list of enums.
            const Range = enum(c_int) {
                pub const full_since_version = 1;
                pub const limited_since_version = 1;

                full = 1,
                limited = 2,
                _,
            };

            /// Chroma sample location as defined by H.273 Chroma420SampleLocType.
            ///
            /// A value of 0 is invalid and will never be present in the list of enums.
            ///
            /// The descriptions list the matching Vulkan VkChromaLocation combinations
            /// for convenience.
            const ChromaLocation = enum(c_int) {
                pub const type_0_since_version = 1;
                pub const type_1_since_version = 1;
                pub const type_2_since_version = 1;
                pub const type_3_since_version = 1;
                pub const type_4_since_version = 1;
                pub const type_5_since_version = 1;

                type_0 = 1,
                type_1 = 2,
                type_2 = 3,
                type_3 = 4,
                type_4 = 5,
                type_5 = 6,
                _,
            };
        };
        const cursor_shape_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_cursor_shape_manager_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_pointer",
                        .signature = "no",
                        .types = &.{
                            &common.wp.cursor_shape_device_v1.interface,
                            &common.wl.pointer.interface,
                        },
                    },
                    .{
                        .name = "get_tablet_tool_v2",
                        .signature = "no",
                        .types = &.{
                            &common.wp.cursor_shape_device_v1.interface,
                            &common.zwp.tablet_tool_v2.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const cursor_shape_device_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_cursor_shape_device_v1",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_shape",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            /// This enum describes cursor shapes.
            ///
            /// The names are taken from the CSS W3C specification:
            /// https://w3c.github.io/csswg-drafts/css-ui/#cursor
            /// with a few additions.
            ///
            /// Note that there are some groups of cursor shapes that are related:
            /// The first group is drag-and-drop cursors which are used to indicate
            /// the selected action during dnd operations. The second group is resize
            /// cursors which are used to indicate resizing and moving possibilities
            /// on window borders. It is recommended that the shapes in these groups
            /// should use visually compatible images and metaphors.
            const Shape = enum(c_int) {
                pub const default_since_version = 1;
                pub const context_menu_since_version = 1;
                pub const help_since_version = 1;
                pub const pointer_since_version = 1;
                pub const progress_since_version = 1;
                pub const wait_since_version = 1;
                pub const cell_since_version = 1;
                pub const crosshair_since_version = 1;
                pub const text_since_version = 1;
                pub const vertical_text_since_version = 1;
                pub const alias_since_version = 1;
                pub const copy_since_version = 1;
                pub const move_since_version = 1;
                pub const no_drop_since_version = 1;
                pub const not_allowed_since_version = 1;
                pub const grab_since_version = 1;
                pub const grabbing_since_version = 1;
                pub const e_resize_since_version = 1;
                pub const n_resize_since_version = 1;
                pub const ne_resize_since_version = 1;
                pub const nw_resize_since_version = 1;
                pub const s_resize_since_version = 1;
                pub const se_resize_since_version = 1;
                pub const sw_resize_since_version = 1;
                pub const w_resize_since_version = 1;
                pub const ew_resize_since_version = 1;
                pub const ns_resize_since_version = 1;
                pub const nesw_resize_since_version = 1;
                pub const nwse_resize_since_version = 1;
                pub const col_resize_since_version = 1;
                pub const row_resize_since_version = 1;
                pub const all_scroll_since_version = 1;
                pub const zoom_in_since_version = 1;
                pub const zoom_out_since_version = 1;

                default = 1,
                context_menu = 2,
                help = 3,
                pointer = 4,
                progress = 5,
                wait = 6,
                cell = 7,
                crosshair = 8,
                text = 9,
                vertical_text = 10,
                alias = 11,
                copy = 12,
                move = 13,
                no_drop = 14,
                not_allowed = 15,
                grab = 16,
                grabbing = 17,
                e_resize = 18,
                n_resize = 19,
                ne_resize = 20,
                nw_resize = 21,
                s_resize = 22,
                se_resize = 23,
                sw_resize = 24,
                w_resize = 25,
                ew_resize = 26,
                ns_resize = 27,
                nesw_resize = 28,
                nwse_resize = 29,
                col_resize = 30,
                row_resize = 31,
                all_scroll = 32,
                zoom_in = 33,
                zoom_out = 34,
                _,
            };
            const Error = enum(c_int) {
                pub const invalid_shape_since_version = 1;

                invalid_shape = 1,
                _,
            };
        };
        const tearing_control_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_tearing_control_manager_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_tearing_control",
                        .signature = "no",
                        .types = &.{
                            &common.wp.tearing_control_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const tearing_control_exists_since_version = 1;

                tearing_control_exists = 0,
                _,
            };
        };
        const tearing_control_v1 = struct {
            const interface: common.Interface = .{
                .name = "wp_tearing_control_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_presentation_hint",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            /// This enum provides information for if submitted frames from the client
            /// may be presented with tearing.
            const PresentationHint = enum(c_int) {
                pub const vsync_since_version = 1;
                pub const async_since_version = 1;

                vsync = 0,
                async = 1,
                _,
            };
        };
    };
    const ext = struct {
        const session_lock_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "ext_session_lock_manager_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "lock",
                        .signature = "n",
                        .types = &.{
                            &common.ext.session_lock_v1.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const session_lock_v1 = struct {
            const interface: common.Interface = .{
                .name = "ext_session_lock_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_lock_surface",
                        .signature = "noo",
                        .types = &.{
                            &common.ext.session_lock_surface_v1.interface,
                            &common.wl.surface.interface,
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "unlock_and_destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "locked",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "finished",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_destroy_since_version = 1;
                pub const invalid_unlock_since_version = 1;
                pub const role_since_version = 1;
                pub const duplicate_output_since_version = 1;
                pub const already_constructed_since_version = 1;

                invalid_destroy = 0,
                invalid_unlock = 1,
                role = 2,
                duplicate_output = 3,
                already_constructed = 4,
                _,
            };
        };
        const session_lock_surface_v1 = struct {
            const interface: common.Interface = .{
                .name = "ext_session_lock_surface_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "ack_configure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const commit_before_first_ack_since_version = 1;
                pub const null_buffer_since_version = 1;
                pub const dimensions_mismatch_since_version = 1;
                pub const invalid_serial_since_version = 1;

                commit_before_first_ack = 0,
                null_buffer = 1,
                dimensions_mismatch = 2,
                invalid_serial = 3,
                _,
            };
        };
    };
    const zxdg = struct {
        const decoration_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "zxdg_decoration_manager_v1",
                .version = 2,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_toplevel_decoration",
                        .signature = "no",
                        .types = &.{
                            &common.zxdg.toplevel_decoration_v1.interface,
                            &common.xdg.toplevel.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const toplevel_decoration_v1 = struct {
            const interface: common.Interface = .{
                .name = "zxdg_toplevel_decoration_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_mode",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "unset_mode",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const unconfigured_buffer_since_version = 1;
                pub const already_constructed_since_version = 1;
                pub const orphaned_since_version = 1;
                pub const invalid_mode_since_version = 1;

                unconfigured_buffer = 0,
                already_constructed = 1,
                orphaned = 2,
                invalid_mode = 3,
                _,
            };

            /// These values describe window decoration modes.
            const Mode = enum(c_int) {
                pub const client_side_since_version = 1;
                pub const server_side_since_version = 1;

                client_side = 1,
                server_side = 2,
                _,
            };
        };
    };
    const river = struct {
        const window_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_window_manager_v1",
                .version = 4,
                .method_count = 7,
                .methods = &.{
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "manage_finish",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "manage_dirty",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "render_finish",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_shell_surface",
                        .signature = "no",
                        .types = &.{
                            &common.river.shell_surface_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "exit_session",
                        .signature = "4",
                        .types = null,
                    },
                },
                .event_count = 9,
                .events = &.{
                    .{
                        .name = "unavailable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "finished",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "manage_start",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "render_start",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "session_locked",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "session_unlocked",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "window",
                        .signature = "n",
                        .types = &.{
                            &common.river.window_v1.interface,
                        },
                    },
                    .{
                        .name = "output",
                        .signature = "n",
                        .types = &.{
                            &common.river.output_v1.interface,
                        },
                    },
                    .{
                        .name = "seat",
                        .signature = "n",
                        .types = &.{
                            &common.river.seat_v1.interface,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const sequence_order_since_version = 1;
                pub const role_since_version = 1;
                pub const unresponsive_since_version = 1;

                sequence_order = 0,
                role = 1,
                unresponsive = 2,
                _,
            };
        };
        const shell_surface_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_shell_surface_v1",
                .version = 4,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_node",
                        .signature = "n",
                        .types = &.{
                            &common.river.node_v1.interface,
                        },
                    },
                    .{
                        .name = "sync_next_commit",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const node_exists_since_version = 1;
                pub const no_commit_since_version = 1;

                node_exists = 0,
                no_commit = 1,
                _,
            };
        };
        const node_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_node_v1",
                .version = 4,
                .method_count = 6,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_position",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "place_top",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "place_bottom",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "place_above",
                        .signature = "o",
                        .types = &.{
                            &common.river.node_v1.interface,
                        },
                    },
                    .{
                        .name = "place_below",
                        .signature = "o",
                        .types = &.{
                            &common.river.node_v1.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const window_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_window_v1",
                .version = 4,
                .method_count = 24,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "close",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_node",
                        .signature = "n",
                        .types = &.{
                            &common.river.node_v1.interface,
                        },
                    },
                    .{
                        .name = "propose_dimensions",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "hide",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "show",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "use_csd",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "use_ssd",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_borders",
                        .signature = "uiuuuu",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_tiled",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "get_decoration_above",
                        .signature = "no",
                        .types = &.{
                            &common.river.decoration_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "get_decoration_below",
                        .signature = "no",
                        .types = &.{
                            &common.river.decoration_v1.interface,
                            &common.wl.surface.interface,
                        },
                    },
                    .{
                        .name = "inform_resize_start",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "inform_resize_end",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_capabilities",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "inform_maximized",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "inform_unmaximized",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "inform_fullscreen",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "inform_not_fullscreen",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "fullscreen",
                        .signature = "o",
                        .types = &.{
                            &common.river.output_v1.interface,
                        },
                    },
                    .{
                        .name = "exit_fullscreen",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_clip_box",
                        .signature = "2iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_content_clip_box",
                        .signature = "3iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_dimension_bounds",
                        .signature = "4ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
                .event_count = 18,
                .events = &.{
                    .{
                        .name = "closed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "dimensions_hint",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "dimensions",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "app_id",
                        .signature = "?s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "title",
                        .signature = "?s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "parent",
                        .signature = "?o",
                        .types = &.{
                            &common.river.window_v1.interface,
                        },
                    },
                    .{
                        .name = "decoration_hint",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "pointer_move_requested",
                        .signature = "o",
                        .types = &.{
                            &common.river.seat_v1.interface,
                        },
                    },
                    .{
                        .name = "pointer_resize_requested",
                        .signature = "ou",
                        .types = &.{
                            &common.river.seat_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "show_window_menu_requested",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "maximize_requested",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unmaximize_requested",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "fullscreen_requested",
                        .signature = "?o",
                        .types = &.{
                            &common.river.output_v1.interface,
                        },
                    },
                    .{
                        .name = "exit_fullscreen_requested",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "minimize_requested",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unreliable_pid",
                        .signature = "2i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "presentation_hint",
                        .signature = "4u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "identifier",
                        .signature = "4s",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const node_exists_since_version = 1;
                pub const invalid_dimensions_since_version = 1;
                pub const invalid_border_since_version = 1;
                pub const invalid_clip_box_since_version = 1;

                node_exists = 0,
                invalid_dimensions = 1,
                invalid_border = 2,
                invalid_clip_box = 3,
                _,
            };
            const DecorationHint = enum(c_int) {
                pub const only_supports_csd_since_version = 1;
                pub const prefers_csd_since_version = 1;
                pub const prefers_ssd_since_version = 1;
                pub const no_preference_since_version = 1;

                only_supports_csd = 0,
                prefers_csd = 1,
                prefers_ssd = 2,
                no_preference = 3,
                _,
            };
            const Edges = packed struct(u32) {
                pub const none_since_version = 1;
                pub const top_since_version = 1;
                pub const bottom_since_version = 1;
                pub const left_since_version = 1;
                pub const right_since_version = 1;

                top: bool = false,
                bottom: bool = false,
                left: bool = false,
                right: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const top_since_version = 1;
                    pub const bottom_since_version = 1;
                    pub const left_since_version = 1;
                    pub const right_since_version = 1;

                    none = 0,
                    top = 1,
                    bottom = 2,
                    left = 4,
                    right = 8,
                    _,
                };
            };
            const Capabilities = packed struct(u32) {
                pub const window_menu_since_version = 1;
                pub const maximize_since_version = 1;
                pub const fullscreen_since_version = 1;
                pub const minimize_since_version = 1;

                window_menu: bool = false,
                maximize: bool = false,
                fullscreen: bool = false,
                minimize: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const window_menu_since_version = 1;
                    pub const maximize_since_version = 1;
                    pub const fullscreen_since_version = 1;
                    pub const minimize_since_version = 1;

                    window_menu = 1,
                    maximize = 2,
                    fullscreen = 4,
                    minimize = 8,
                    _,
                };
            };
        };
        const decoration_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_decoration_v1",
                .version = 4,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_offset",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "sync_next_commit",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const no_commit_since_version = 1;

                no_commit = 0,
                _,
            };
        };
        const output_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_output_v1",
                .version = 4,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_presentation_mode",
                        .signature = "4u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 4,
                .events = &.{
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "wl_output",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "position",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "dimensions",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_presentation_mode_since_version = 4;

                invalid_presentation_mode = 0,
                _,
            };
            const PresentationMode = enum(c_int) {
                pub const vsync_since_version = 1;
                pub const async_since_version = 1;

                vsync = 0,
                async = 1,
                _,
            };
        };
        const seat_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_seat_v1",
                .version = 4,
                .method_count = 9,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "focus_window",
                        .signature = "o",
                        .types = &.{
                            &common.river.window_v1.interface,
                        },
                    },
                    .{
                        .name = "focus_shell_surface",
                        .signature = "o",
                        .types = &.{
                            &common.river.shell_surface_v1.interface,
                        },
                    },
                    .{
                        .name = "clear_focus",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "op_start_pointer",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "op_end",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_pointer_binding",
                        .signature = "nuu",
                        .types = &.{
                            &common.river.pointer_binding_v1.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_xcursor_theme",
                        .signature = "2su",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "pointer_warp",
                        .signature = "3ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
                .event_count = 9,
                .events = &.{
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "wl_seat",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "pointer_enter",
                        .signature = "o",
                        .types = &.{
                            &common.river.window_v1.interface,
                        },
                    },
                    .{
                        .name = "pointer_leave",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "window_interaction",
                        .signature = "o",
                        .types = &.{
                            &common.river.window_v1.interface,
                        },
                    },
                    .{
                        .name = "shell_surface_interaction",
                        .signature = "o",
                        .types = &.{
                            &common.river.shell_surface_v1.interface,
                        },
                    },
                    .{
                        .name = "op_delta",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "op_release",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "pointer_position",
                        .signature = "2ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                },
            };
            /// This enum is used to describe the keyboard modifiers that must be held
            /// down to trigger a key binding or pointer binding.
            ///
            /// Note that river and wlroots use the values 2 and 16 for capslock and
            /// numlock internally. It doesn't make sense to use locked modifiers for
            /// bindings however so these values are not included in this enum.
            const Modifiers = packed struct(u32) {
                pub const none_since_version = 1;
                pub const shift_since_version = 1;
                pub const ctrl_since_version = 1;
                pub const mod1_since_version = 1;
                pub const mod3_since_version = 1;
                pub const mod4_since_version = 1;
                pub const mod5_since_version = 1;

                shift: bool = false,
                _padding1: bool = false,
                ctrl: bool = false,
                mod1: bool = false,
                _padding4: bool = false,
                mod3: bool = false,
                mod4: bool = false,
                mod5: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const shift_since_version = 1;
                    pub const ctrl_since_version = 1;
                    pub const mod1_since_version = 1;
                    pub const mod3_since_version = 1;
                    pub const mod4_since_version = 1;
                    pub const mod5_since_version = 1;

                    none = 0,
                    shift = 1,
                    ctrl = 4,
                    mod1 = 8,
                    mod3 = 32,
                    mod4 = 64,
                    mod5 = 128,
                    _,
                };
            };
        };
        const pointer_binding_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_pointer_binding_v1",
                .version = 4,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "enable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "disable",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "pressed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "released",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const xkb_bindings_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_bindings_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_xkb_binding",
                        .signature = "onuu",
                        .types = &.{
                            &common.river.seat_v1.interface,
                            &common.river.xkb_binding_v1.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "get_seat",
                        .signature = "2no",
                        .types = &.{
                            &common.river.xkb_bindings_seat_v1.interface,
                            &common.river.seat_v1.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const object_already_created_since_version = 2;

                object_already_created = 0,
                _,
            };
        };
        const xkb_binding_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_binding_v1",
                .version = 2,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_layout_override",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "enable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "disable",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "pressed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "released",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "stop_repeat",
                        .signature = "2",
                        .types = null,
                    },
                },
            };
        };
        const xkb_bindings_seat_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_bindings_seat_v1",
                .version = 2,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "2",
                        .types = null,
                    },
                    .{
                        .name = "ensure_next_key_eaten",
                        .signature = "2",
                        .types = null,
                    },
                    .{
                        .name = "cancel_ensure_next_key_eaten",
                        .signature = "2",
                        .types = null,
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "ate_unbound_key",
                        .signature = "2",
                        .types = null,
                    },
                },
            };
        };
        const layer_shell_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_layer_shell_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "get_output",
                        .signature = "no",
                        .types = &.{
                            &common.river.layer_shell_output_v1.interface,
                            &common.river.output_v1.interface,
                        },
                    },
                    .{
                        .name = "get_seat",
                        .signature = "no",
                        .types = &.{
                            &common.river.layer_shell_seat_v1.interface,
                            &common.river.seat_v1.interface,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const object_already_created_since_version = 1;

                object_already_created = 0,
                _,
            };
        };
        const layer_shell_output_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_layer_shell_output_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_default",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 1,
                .events = &.{
                    .{
                        .name = "non_exclusive_area",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                },
            };
        };
        const layer_shell_seat_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_layer_shell_seat_v1",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "focus_exclusive",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "focus_non_exclusive",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "focus_none",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const input_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_input_manager_v1",
                .version = 1,
                .method_count = 4,
                .methods = &.{
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "create_seat",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "destroy_seat",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "finished",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "input_device",
                        .signature = "n",
                        .types = &.{
                            &common.river.input_device_v1.interface,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_destroy_since_version = 1;

                invalid_destroy = 0,
                _,
            };
        };
        const input_device_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_input_device_v1",
                .version = 1,
                .method_count = 6,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "assign_to_seat",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_repeat_info",
                        .signature = "ii",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_scroll_factor",
                        .signature = "f",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "map_to_output",
                        .signature = "?o",
                        .types = &.{
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "map_to_rectangle",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "type",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "name",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_repeat_info_since_version = 1;
                pub const invalid_scroll_factor_since_version = 1;
                pub const invalid_map_to_rectangle_since_version = 1;

                invalid_repeat_info = 0,
                invalid_scroll_factor = 1,
                invalid_map_to_rectangle = 2,
                _,
            };
            const Type = enum(c_int) {
                pub const keyboard_since_version = 1;
                pub const pointer_since_version = 1;
                pub const touch_since_version = 1;
                pub const tablet_since_version = 1;

                keyboard = 0,
                pointer = 1,
                touch = 2,
                tablet = 3,
                _,
            };
        };
        const libinput_config_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_libinput_config_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "create_accel_config",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_accel_config_v1.interface,
                            null,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "finished",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "libinput_device",
                        .signature = "n",
                        .types = &.{
                            &common.river.libinput_device_v1.interface,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_arg_since_version = 1;
                pub const invalid_destroy_since_version = 1;

                invalid_arg = 0,
                invalid_destroy = 1,
                _,
            };
        };
        const libinput_accel_config_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_libinput_accel_config_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_points",
                        .signature = "nuaa",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const invalid_arg_since_version = 1;

                invalid_arg = 0,
                _,
            };
            const AccelType = enum(c_int) {
                pub const fallback_since_version = 1;
                pub const motion_since_version = 1;
                pub const scroll_since_version = 1;

                fallback = 0,
                motion = 1,
                scroll = 2,
                _,
            };
        };
        const libinput_result_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_libinput_result_v1",
                .version = 1,
                .method_count = 0,
                .methods = null,
                .event_count = 3,
                .events = &.{
                    .{
                        .name = "success",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "unsupported",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "invalid",
                        .signature = "",
                        .types = null,
                    },
                },
            };
        };
        const libinput_device_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_libinput_device_v1",
                .version = 1,
                .method_count = 22,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_send_events",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_tap",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_tap_button_map",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_drag",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_drag_lock",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_three_finger_drag",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_calibration_matrix",
                        .signature = "na",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_accel_profile",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_accel_speed",
                        .signature = "na",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "apply_accel_config",
                        .signature = "no",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            &common.river.libinput_accel_config_v1.interface,
                        },
                    },
                    .{
                        .name = "set_natural_scroll",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_left_handed",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_click_method",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_clickfinger_button_map",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_middle_emulation",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_scroll_method",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_scroll_button",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_scroll_button_lock",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_dwt",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_dwtp",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                    .{
                        .name = "set_rotation",
                        .signature = "nu",
                        .types = &.{
                            &common.river.libinput_result_v1.interface,
                            null,
                        },
                    },
                },
                .event_count = 55,
                .events = &.{
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "input_device",
                        .signature = "o",
                        .types = &.{
                            &common.river.input_device_v1.interface,
                        },
                    },
                    .{
                        .name = "send_events_support",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "send_events_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "send_events_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tap_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tap_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tap_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tap_button_map_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "tap_button_map_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "drag_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "drag_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "drag_lock_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "drag_lock_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "three_finger_drag_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "three_finger_drag_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "three_finger_drag_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "calibration_matrix_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "calibration_matrix_default",
                        .signature = "a",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "calibration_matrix_current",
                        .signature = "a",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "accel_profiles_support",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "accel_profile_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "accel_profile_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "accel_speed_default",
                        .signature = "a",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "accel_speed_current",
                        .signature = "a",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "natural_scroll_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "natural_scroll_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "natural_scroll_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "left_handed_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "left_handed_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "left_handed_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "click_method_support",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "click_method_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "click_method_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "clickfinger_button_map_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "clickfinger_button_map_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "middle_emulation_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "middle_emulation_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "middle_emulation_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_method_support",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_method_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_method_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_button_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_button_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_button_lock_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "scroll_button_lock_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwt_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwt_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwt_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwtp_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwtp_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "dwtp_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "rotation_support",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "rotation_default",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "rotation_current",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_arg_since_version = 1;

                invalid_arg = 0,
                _,
            };
            const SendEventsModes = packed struct(u32) {
                pub const enabled_since_version = 1;
                pub const disabled_since_version = 1;
                pub const disabled_on_external_mouse_since_version = 1;

                disabled: bool = false,
                disabled_on_external_mouse: bool = false,
                _padding2: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const enabled_since_version = 1;
                    pub const disabled_since_version = 1;
                    pub const disabled_on_external_mouse_since_version = 1;

                    enabled = 0,
                    disabled = 1,
                    disabled_on_external_mouse = 2,
                    _,
                };
            };
            const TapState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const TapButtonMap = enum(c_int) {
                pub const lrm_since_version = 1;
                pub const lmr_since_version = 1;

                lrm = 0,
                lmr = 1,
                _,
            };
            const DragState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const DragLockState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_timeout_since_version = 1;
                pub const enabled_sticky_since_version = 1;

                disabled = 0,
                enabled_timeout = 1,
                enabled_sticky = 2,
                _,
            };
            const ThreeFingerDragState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_3fg_since_version = 1;
                pub const enabled_4fg_since_version = 1;

                disabled = 0,
                enabled_3fg = 1,
                enabled_4fg = 2,
                _,
            };
            const AccelProfile = enum(c_int) {
                pub const none_since_version = 1;
                pub const flat_since_version = 1;
                pub const adaptive_since_version = 1;
                pub const custom_since_version = 1;

                none = 0,
                flat = 1,
                adaptive = 2,
                custom = 4,
                _,
            };
            const AccelProfiles = packed struct(u32) {
                pub const none_since_version = 1;
                pub const flat_since_version = 1;
                pub const adaptive_since_version = 1;
                pub const custom_since_version = 1;

                flat: bool = false,
                adaptive: bool = false,
                custom: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const flat_since_version = 1;
                    pub const adaptive_since_version = 1;
                    pub const custom_since_version = 1;

                    none = 0,
                    flat = 1,
                    adaptive = 2,
                    custom = 4,
                    _,
                };
            };
            const NaturalScrollState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const LeftHandedState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const ClickMethod = enum(c_int) {
                pub const none_since_version = 1;
                pub const button_areas_since_version = 1;
                pub const clickfinger_since_version = 1;

                none = 0,
                button_areas = 1,
                clickfinger = 2,
                _,
            };
            const ClickMethods = packed struct(u32) {
                pub const none_since_version = 1;
                pub const button_areas_since_version = 1;
                pub const clickfinger_since_version = 1;

                button_areas: bool = false,
                clickfinger: bool = false,
                _padding2: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const none_since_version = 1;
                    pub const button_areas_since_version = 1;
                    pub const clickfinger_since_version = 1;

                    none = 0,
                    button_areas = 1,
                    clickfinger = 2,
                    _,
                };
            };
            const ClickfingerButtonMap = enum(c_int) {
                pub const lrm_since_version = 1;
                pub const lmr_since_version = 1;

                lrm = 0,
                lmr = 1,
                _,
            };
            const MiddleEmulationState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const ScrollMethod = enum(c_int) {
                pub const no_scroll_since_version = 1;
                pub const two_finger_since_version = 1;
                pub const edge_since_version = 1;
                pub const on_button_down_since_version = 1;

                no_scroll = 0,
                two_finger = 1,
                edge = 2,
                on_button_down = 4,
                _,
            };
            const ScrollMethods = packed struct(u32) {
                pub const no_scroll_since_version = 1;
                pub const two_finger_since_version = 1;
                pub const edge_since_version = 1;
                pub const on_button_down_since_version = 1;

                two_finger: bool = false,
                edge: bool = false,
                on_button_down: bool = false,
                _padding3: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const no_scroll_since_version = 1;
                    pub const two_finger_since_version = 1;
                    pub const edge_since_version = 1;
                    pub const on_button_down_since_version = 1;

                    no_scroll = 0,
                    two_finger = 1,
                    edge = 2,
                    on_button_down = 4,
                    _,
                };
            };
            const ScrollButtonLockState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const DwtState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
            const DwtpState = enum(c_int) {
                pub const disabled_since_version = 1;
                pub const enabled_since_version = 1;

                disabled = 0,
                enabled = 1,
                _,
            };
        };
        const xkb_config_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_config_v1",
                .version = 1,
                .method_count = 3,
                .methods = &.{
                    .{
                        .name = "stop",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "create_keymap",
                        .signature = "nhu",
                        .types = &.{
                            &common.river.xkb_keymap_v1.interface,
                            null,
                            null,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "finished",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "xkb_keyboard",
                        .signature = "n",
                        .types = &.{
                            &common.river.xkb_keyboard_v1.interface,
                        },
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_destroy_since_version = 1;
                pub const invalid_format_since_version = 1;

                invalid_destroy = 0,
                invalid_format = 1,
                _,
            };
            const KeymapFormat = enum(c_int) {
                pub const text_v1_since_version = 1;
                pub const text_v2_since_version = 1;

                text_v1 = 1,
                text_v2 = 2,
                _,
            };
        };
        const xkb_keymap_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_keymap_v1",
                .version = 1,
                .method_count = 1,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "success",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "failure",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                },
            };
        };
        const xkb_keyboard_v1 = struct {
            const interface: common.Interface = .{
                .name = "river_xkb_keyboard_v1",
                .version = 1,
                .method_count = 8,
                .methods = &.{
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_keymap",
                        .signature = "o",
                        .types = &.{
                            &common.river.xkb_keymap_v1.interface,
                        },
                    },
                    .{
                        .name = "set_layout_by_index",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_layout_by_name",
                        .signature = "s",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "capslock_enable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "capslock_disable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "numlock_enable",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "numlock_disable",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 7,
                .events = &.{
                    .{
                        .name = "removed",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "input_device",
                        .signature = "o",
                        .types = &.{
                            &common.river.input_device_v1.interface,
                        },
                    },
                    .{
                        .name = "layout",
                        .signature = "u?s",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "capslock_enabled",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "capslock_disabled",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "numlock_enabled",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "numlock_disabled",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            const Error = enum(c_int) {
                pub const invalid_keymap_since_version = 1;

                invalid_keymap = 0,
                _,
            };
        };
    };
    const zwlr = struct {
        const layer_shell_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwlr_layer_shell_v1",
                .version = 5,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "get_layer_surface",
                        .signature = "no?ous",
                        .types = &.{
                            &common.zwlr.layer_surface_v1.interface,
                            &common.wl.surface.interface,
                            &common.wl.output.interface,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "3",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
            const Error = enum(c_int) {
                pub const role_since_version = 1;
                pub const invalid_layer_since_version = 1;
                pub const already_constructed_since_version = 1;

                role = 0,
                invalid_layer = 1,
                already_constructed = 2,
                _,
            };

            /// These values indicate which layers a surface can be rendered in. They
            /// are ordered by z depth, bottom-most first. Traditional shell surfaces
            /// will typically be rendered between the bottom and top layers.
            /// Fullscreen shell surfaces are typically rendered at the top layer.
            /// Multiple surfaces can share a single layer, and ordering within a
            /// single layer is undefined.
            const Layer = enum(c_int) {
                pub const background_since_version = 1;
                pub const bottom_since_version = 1;
                pub const top_since_version = 1;
                pub const overlay_since_version = 1;

                background = 0,
                bottom = 1,
                top = 2,
                overlay = 3,
                _,
            };
        };
        const layer_surface_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwlr_layer_surface_v1",
                .version = 5,
                .method_count = 10,
                .methods = &.{
                    .{
                        .name = "set_size",
                        .signature = "uu",
                        .types = &.{
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_anchor",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_exclusive_zone",
                        .signature = "i",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_margin",
                        .signature = "iiii",
                        .types = &.{
                            null,
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "set_keyboard_interactivity",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "get_popup",
                        .signature = "o",
                        .types = &.{
                            &common.xdg.popup.interface,
                        },
                    },
                    .{
                        .name = "ack_configure",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                    .{
                        .name = "set_layer",
                        .signature = "2u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "set_exclusive_edge",
                        .signature = "5u",
                        .types = &.{
                            null,
                        },
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "configure",
                        .signature = "uuu",
                        .types = &.{
                            null,
                            null,
                            null,
                        },
                    },
                    .{
                        .name = "closed",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            /// Types of keyboard interaction possible for layer shell surfaces. The
            /// rationale for this is twofold: (1) some applications are not interested
            /// in keyboard events and not allowing them to be focused can improve the
            /// desktop experience; (2) some applications will want to take exclusive
            /// keyboard focus.
            const KeyboardInteractivity = enum(c_int) {
                pub const none_since_version = 1;
                pub const exclusive_since_version = 1;
                pub const on_demand_since_version = 4;

                none = 0,
                exclusive = 1,
                on_demand = 2,
                _,
            };
            const Error = enum(c_int) {
                pub const invalid_surface_state_since_version = 1;
                pub const invalid_size_since_version = 1;
                pub const invalid_anchor_since_version = 1;
                pub const invalid_keyboard_interactivity_since_version = 1;
                pub const invalid_exclusive_edge_since_version = 1;

                invalid_surface_state = 0,
                invalid_size = 1,
                invalid_anchor = 2,
                invalid_keyboard_interactivity = 3,
                invalid_exclusive_edge = 4,
                _,
            };
            const Anchor = packed struct(u32) {
                pub const top_since_version = 1;
                pub const bottom_since_version = 1;
                pub const left_since_version = 1;
                pub const right_since_version = 1;

                top: bool = false,
                bottom: bool = false,
                left: bool = false,
                right: bool = false,
                _padding4: bool = false,
                _padding5: bool = false,
                _padding6: bool = false,
                _padding7: bool = false,
                _padding8: bool = false,
                _padding9: bool = false,
                _padding10: bool = false,
                _padding11: bool = false,
                _padding12: bool = false,
                _padding13: bool = false,
                _padding14: bool = false,
                _padding15: bool = false,
                _padding16: bool = false,
                _padding17: bool = false,
                _padding18: bool = false,
                _padding19: bool = false,
                _padding20: bool = false,
                _padding21: bool = false,
                _padding22: bool = false,
                _padding23: bool = false,
                _padding24: bool = false,
                _padding25: bool = false,
                _padding26: bool = false,
                _padding27: bool = false,
                _padding28: bool = false,
                _padding29: bool = false,
                _padding30: bool = false,
                _padding31: bool = false,
                pub const Enum = enum(c_int) {
                    pub const top_since_version = 1;
                    pub const bottom_since_version = 1;
                    pub const left_since_version = 1;
                    pub const right_since_version = 1;

                    top = 1,
                    bottom = 2,
                    left = 4,
                    right = 8,
                    _,
                };
            };
        };
        const output_power_manager_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwlr_output_power_manager_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "get_output_power",
                        .signature = "no",
                        .types = &.{
                            &common.zwlr.output_power_v1.interface,
                            &common.wl.output.interface,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 0,
                .events = null,
            };
        };
        const output_power_v1 = struct {
            const interface: common.Interface = .{
                .name = "zwlr_output_power_v1",
                .version = 1,
                .method_count = 2,
                .methods = &.{
                    .{
                        .name = "set_mode",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "destroy",
                        .signature = "",
                        .types = null,
                    },
                },
                .event_count = 2,
                .events = &.{
                    .{
                        .name = "mode",
                        .signature = "u",
                        .types = &.{
                            null,
                        },
                    },
                    .{
                        .name = "failed",
                        .signature = "",
                        .types = null,
                    },
                },
            };
            const Mode = enum(c_int) {
                pub const off_since_version = 1;
                pub const on_since_version = 1;

                off = 0,
                on = 1,
                _,
            };
            const Error = enum(c_int) {
                pub const invalid_mode_since_version = 1;

                invalid_mode = 1,
                _,
            };
        };
    };
};
const ffi = struct {
    const Argument = common.Argument;
    const Interface = common.Interface;
    const list = common.list;

    pub const client = struct {
        const wl = wayland.client.wl;

        extern fn wl_display_cancel_read(display: *wl.Display) void;
        extern fn wl_display_connect_to_fd(fd: c_int) ?*wl.Display;
        extern fn wl_display_connect(name: ?[*:0]const u8) ?*wl.Display;
        extern fn wl_display_create_queue(display: *wl.Display) ?*wl.EventQueue;
        extern fn wl_display_disconnect(display: *wl.Display) void;
        extern fn wl_display_dispatch_pending(display: *wl.Display) c_int;
        extern fn wl_display_dispatch_queue_pending(display: *wl.Display, queue: *wl.EventQueue) c_int;
        extern fn wl_display_dispatch_queue(display: *wl.Display, queue: *wl.EventQueue) c_int;
        extern fn wl_display_dispatch(display: *wl.Display) c_int;
        extern fn wl_display_flush(display: *wl.Display) c_int;
        extern fn wl_display_get_error(display: *wl.Display) c_int;
        extern fn wl_display_get_fd(display: *wl.Display) c_int;
        extern fn wl_display_prepare_read_queue(display: *wl.Display, queue: *wl.EventQueue) c_int;
        extern fn wl_display_prepare_read(display: *wl.Display) c_int;
        extern fn wl_display_read_events(display: *wl.Display) c_int;
        extern fn wl_display_roundtrip_queue(display: *wl.Display, queue: *wl.EventQueue) c_int;
        extern fn wl_display_roundtrip(display: *wl.Display) c_int;
        extern fn wl_event_queue_destroy(queue: *wl.EventQueue) void;
        extern fn wl_proxy_add_dispatcher(
            proxy: *wl.Proxy,
            dispatcher: *const wl.Proxy.DispatcherFn,
            implementation: ?*const anyopaque,
            data: ?*anyopaque,
        ) c_int;
        extern fn wl_proxy_create(factory: *wl.Proxy, interface: *const Interface) ?*wl.Proxy;
        extern fn wl_proxy_destroy(proxy: *wl.Proxy) void;
        extern fn wl_proxy_get_id(proxy: *wl.Proxy) u32;
        extern fn wl_proxy_get_user_data(proxy: *wl.Proxy) ?*anyopaque;
        extern fn wl_proxy_get_version(proxy: *wl.Proxy) u32;
        extern fn wl_proxy_marshal_array_constructor_versioned(
            proxy: *wl.Proxy,
            opcode: u32,
            args: [*]Argument,
            interface: *const Interface,
            version: u32,
        ) ?*wl.Proxy;
        extern fn wl_proxy_marshal_array_constructor(
            proxy: *wl.Proxy,
            opcode: u32,
            args: [*]Argument,
            interface: *const Interface,
        ) ?*wl.Proxy;
        extern fn wl_proxy_marshal_array(proxy: *wl.Proxy, opcode: u32, args: ?[*]Argument) void;
        extern fn wl_proxy_set_queue(proxy: *wl.Proxy, queue: *wl.EventQueue) void;
    };

    pub const cursor = struct {
        const wl = wayland.client.wl;

        extern fn wl_cursor_frame(cursor: *wl.Cursor, time: u32) c_int;
        extern fn wl_cursor_frame_and_duration(cursor: *wl.Cursor, time: u32, duration: *u32) c_int;
        extern fn wl_cursor_image_get_buffer(image: *wl.CursorImage) ?*wl.Buffer;
        extern fn wl_cursor_theme_load(name: ?[*:0]const u8, size: c_int, shm: *wl.Shm) ?*wl.CursorTheme;
        extern fn wl_cursor_theme_destroy(wl_cursor_theme: *wl.CursorTheme) void;
        extern fn wl_cursor_theme_get_cursor(theme: *wl.CursorTheme, name: [*:0]const u8) ?*wl.Cursor;
    };

    pub const egl = struct {
        const wl = wayland.client.wl;

        extern fn wl_egl_window_create(surface: *wl.Surface, width: c_int, height: c_int) ?*wl.EglWindow;
        extern fn wl_egl_window_destroy(egl_window: *wl.EglWindow) void;
        extern fn wl_egl_window_resize(egl_window: *wl.EglWindow, width: c_int, height: c_int, dx: c_int, dy: c_int) void;
        extern fn wl_egl_window_get_attached_size(egl_window: *wl.EglWindow, width: *c_int, height: *c_int) void;
    };

    pub const server = struct {
        const wl = wayland.server.wl;

        extern fn wl_display_create() ?*wl.Server;
        extern fn wl_display_destroy(_server: *wl.Server) void;
        extern fn wl_display_get_event_loop(_server: *wl.Server) *wl.EventLoop;
        extern fn wl_display_add_socket(_server: *wl.Server, name: [*:0]const u8) c_int;
        extern fn wl_display_add_socket_fd(_server: *wl.Server, sock_fd: c_int) c_int;
        extern fn wl_display_terminate(_server: *wl.Server) void;
        extern fn wl_display_run(_server: *wl.Server) void;
        extern fn wl_display_flush_clients(_server: *wl.Server) void;
        extern fn wl_display_destroy_clients(_server: *wl.Server) void;
        extern fn wl_display_get_serial(_server: *wl.Server) u32;
        extern fn wl_display_next_serial(_server: *wl.Server) u32;
        extern fn wl_display_add_destroy_listener(_server: *wl.Server, listener: *wl.Listener(*wl.Server)) void;
        extern fn wl_display_add_client_created_listener(_server: *wl.Server, listener: *wl.Listener(*wl.Client)) void;
        extern fn wl_display_set_global_filter(
            server: *wl.Server,
            filter: *const fn (_client: *const wl.Client, global: *const wl.Global, data: ?*anyopaque) callconv(.c) bool,
            data: ?*anyopaque,
        ) void;
        extern fn wl_display_get_client_list(_server: *wl.Server) *list.Head(wl.Client, null);
        extern fn wl_display_init_shm(_server: *wl.Server) c_int;
        extern fn wl_display_add_shm_format(_server: *wl.Server, format: u32) ?*u32;
        extern fn wl_display_add_protocol_logger(
            _server: *wl.Server,
            func: *const fn (data: ?*anyopaque, direction: wl.ProtocolLogger.Type, message: *const wl.ProtocolLogger.LogMessage) callconv(.c) void,
            data: ?*anyopaque,
        ) void;
        extern fn wl_client_create(_server: *wl.Server, fd: c_int) ?*wl.Client;
        extern fn wl_client_destroy(_client: *wl.Client) void;
        extern fn wl_client_flush(_client: *wl.Client) void;
        extern fn wl_client_get_link(_client: *wl.Client) *list.Link;
        extern fn wl_client_from_link(link: *list.Link) *wl.Client;
        extern fn wl_client_get_credentials(_client: *wl.Client, pid: *posix.pid_t, uid: *posix.uid_t, gid: *posix.gid_t) void;
        extern fn wl_client_add_destroy_listener(_client: *wl.Client, listener: *wl.Listener(*wl.Client)) void;
        extern fn wl_client_get_object(_client: *wl.Client, id: u32) ?*wl.Resource;
        extern fn wl_client_post_no_memory(_client: *wl.Client) void;
        extern fn wl_client_post_implementation_error(_client: *wl.Client, msg: [*:0]const u8, ...) void;
        extern fn wl_client_add_resource_created_listener(_client: *wl.Client, listener: *wl.Listener(*wl.Resource)) void;
        extern fn wl_client_for_each_resource(
            _client: *wl.Client,
            iterator: *const fn (resource: *wl.Resource, data: ?*anyopaque) callconv(.c) wl.IteratorResult,
            data: ?*anyopaque,
        ) void;
        extern fn wl_client_get_fd(_client: *wl.Client) c_int;
        extern fn wl_client_get_display(_client: *wl.Client) *wl.Server;
        extern fn wl_global_create(
            _server: *wl.Server,
            interface: *const Interface,
            version: c_int,
            data: ?*anyopaque,
            bind: *const fn (_client: *wl.Client, data: ?*anyopaque, version: u32, id: u32) callconv(.c) void,
        ) ?*wl.Global;
        extern fn wl_global_remove(global: *wl.Global) void;
        extern fn wl_global_destroy(global: *wl.Global) void;
        extern fn wl_global_get_interface(global: *const wl.Global) *const Interface;
        extern fn wl_global_get_name(global: *const wl.Global, _client: *const wl.Client) u32;
        extern fn wl_global_get_user_data(global: *const wl.Global) ?*anyopaque;
        extern fn wl_resource_create(_client: *wl.Client, interface: *const Interface, version: c_int, id: u32) ?*wl.Resource;
        extern fn wl_resource_destroy(resource: *wl.Resource) void;
        extern fn wl_resource_post_event_array(resource: *wl.Resource, opcode: u32, args: ?[*]Argument) void;
        extern fn wl_resource_queue_event_array(resource: *wl.Resource, opcode: u32, args: ?[*]Argument) void;
        extern fn wl_resource_post_error(resource: *wl.Resource, code: u32, message: [*:0]const u8, ...) void;
        extern fn wl_resource_post_no_memory(resource: *wl.Resource) void;
        extern fn wl_resource_set_dispatcher(
            resource: *wl.Resource,
            dispatcher: ?*const wl.Resource.DispatcherFn,
            implementation: ?*const anyopaque,
            data: ?*anyopaque,
            destroy_fn: ?*const wl.Resource.DestroyFn,
        ) void;
        extern fn wl_resource_get_user_data(resource: *wl.Resource) ?*anyopaque;
        extern fn wl_resource_get_id(resource: *wl.Resource) u32;
        extern fn wl_resource_get_link(resource: *wl.Resource) *list.Link;
        extern fn wl_resource_from_link(link: *list.Link) *wl.Resource;
        extern fn wl_resource_find_for_client(_list: *list.Head(wl.Resource, null), _client: *wl.Client) ?*wl.Resource;
        extern fn wl_resource_get_client(resource: *wl.Resource) *wl.Client;
        extern fn wl_resource_get_version(resource: *wl.Resource) c_int;
        extern fn wl_resource_get_class(resource: *wl.Resource) [*:0]const u8;
        extern fn wl_resource_add_destroy_listener(resource: *wl.Resource, listener: *wl.Listener(*wl.Resource)) void;
        extern fn wl_protocol_logger_destroy(logger: *wl.ProtocolLogger) void;
        extern fn wl_event_loop_create() ?*wl.EventLoop;
        extern fn wl_event_loop_destroy(loop: *wl.EventLoop) void;
        extern fn wl_event_loop_add_fd(
            loop: *wl.EventLoop,
            fd: c_int,
            mask: u32,
            func: *const fn (fd: c_int, mask: u32, data: ?*anyopaque) callconv(.c) c_int,
            data: ?*anyopaque,
        ) ?*wl.EventSource;
        extern fn wl_event_loop_add_timer(
            loop: *wl.EventLoop,
            func: *const fn (data: ?*anyopaque) callconv(.c) c_int,
            data: ?*anyopaque,
        ) ?*wl.EventSource;
        extern fn wl_event_loop_add_signal(
            loop: *wl.EventLoop,
            signal_number: c_int,
            func: *const fn (c_int, ?*anyopaque) callconv(.c) c_int,
            data: ?*anyopaque,
        ) ?*wl.EventSource;
        extern fn wl_event_loop_add_idle(
            loop: *wl.EventLoop,
            func: *const fn (data: ?*anyopaque) callconv(.c) void,
            data: ?*anyopaque,
        ) ?*wl.EventSource;
        extern fn wl_event_loop_dispatch(loop: *wl.EventLoop, timeout: c_int) c_int;
        extern fn wl_event_loop_dispatch_idle(loop: *wl.EventLoop) void;
        extern fn wl_event_loop_get_fd(loop: *wl.EventLoop) c_int;
        extern fn wl_event_loop_add_destroy_listener(loop: *wl.EventLoop, listener: *wl.Listener(*wl.EventLoop)) void;
        extern fn wl_event_source_remove(source: *wl.EventSource) c_int;
        extern fn wl_event_source_check(source: *wl.EventSource) void;
        extern fn wl_event_source_fd_update(source: *wl.EventSource, mask: u32) c_int;
        extern fn wl_event_source_timer_update(source: *wl.EventSource, ms_delay: c_int) c_int;
        extern fn wl_shm_buffer_get(resource: *wl.Resource) ?*wl.shm.Buffer;
        extern fn wl_shm_buffer_begin_access(buffer: *wl.shm.Buffer) void;
        extern fn wl_shm_buffer_end_access(buffer: *wl.shm.Buffer) void;
        extern fn wl_shm_buffer_get_data(buffer: *wl.shm.Buffer) ?*anyopaque;
        extern fn wl_shm_buffer_get_format(buffer: *wl.shm.Buffer) u32;
        extern fn wl_shm_buffer_get_height(buffer: *wl.shm.Buffer) i32;
        extern fn wl_shm_buffer_get_width(buffer: *wl.shm.Buffer) i32;
        extern fn wl_shm_buffer_get_stride(buffer: *wl.shm.Buffer) i32;
        extern fn wl_shm_buffer_ref_pool(buffer: *wl.shm.Buffer) *wl.Pool;
        extern fn wl_shm_pool_unref(pool: *wl.Pool) void;
    };
};
