// This file was generated by qtwaylandscanner
// source file is kde-output-device-v2.xml

#include "qwayland-server-kde-output-device-v2.h"

QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")

namespace QtWaylandServer {

    int kde_output_device_registry_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_output_device_registry_v2 *>(data);
        wl_global_destroy(object->m_global);
        object->m_global = nullptr;
        wl_event_source_remove(object->m_globalRemovedEvent);
        object->m_globalRemovedEvent = nullptr;
        wl_list_remove(&object->m_displayDestroyedListener.link);
        object->kde_output_device_registry_v2_destroy_global();
        return 0;
    }

    kde_output_device_registry_v2::kde_output_device_registry_v2(struct ::wl_client *client, int id, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(client, id, version);
    }

    kde_output_device_registry_v2::kde_output_device_registry_v2(struct ::wl_display *display, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(display, version);
    }

    kde_output_device_registry_v2::kde_output_device_registry_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

    kde_output_device_registry_v2::kde_output_device_registry_v2()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
    }

    kde_output_device_registry_v2::~kde_output_device_registry_v2()
    {
        for (auto resource : std::as_const(m_resource_map))
            resource->kde_output_device_registry_v2_object = nullptr;

        if (m_resource)
            m_resource->kde_output_device_registry_v2_object = nullptr;

        if (m_global) {
            if (m_globalRemovedEvent)
                wl_event_source_remove(m_globalRemovedEvent);
            wl_global_destroy(m_global);
            wl_list_remove(&m_displayDestroyedListener.link);
        }
    }

    void kde_output_device_registry_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

    void kde_output_device_registry_v2::init(struct ::wl_resource *resource)
    {
        m_resource = bind(resource);
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::add(struct ::wl_client *client, int version)
    {
        Resource *resource = bind(client, 0, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::add(struct ::wl_client *client, int id, int version)
    {
        Resource *resource = bind(client, id, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_output_device_registry_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_output_device_registry_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_output_device_registry_v2::display_destroy_func;
        m_displayDestroyedListener.parent = this;
#ifdef HAVE_ACK_GLOBAL_REMOVE
        wl_global_set_withdrawn_listener(m_global, [](wl_global *global) {
            auto object = static_cast<kde_output_device_registry_v2 *>(wl_global_get_user_data(global));
            object->kde_output_device_registry_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_output_device_registry_v2::interface()
    {
        return &::kde_output_device_registry_v2_interface;
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::kde_output_device_registry_v2_allocate()
    {
        return new Resource;
    }

    void kde_output_device_registry_v2::kde_output_device_registry_v2_destroy_global()
    {
    }

    void kde_output_device_registry_v2::kde_output_device_registry_v2_bind_resource(Resource *)
    {
    }

    void kde_output_device_registry_v2::kde_output_device_registry_v2_destroy_resource(Resource *)
    {
    }

    void kde_output_device_registry_v2::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)
    {
        kde_output_device_registry_v2 *that = static_cast<kde_output_device_registry_v2 *>(data);
        that->add(client, id, version);
    }

    void kde_output_device_registry_v2::display_destroy_func(struct ::wl_listener *listener, void *data)
    {
        Q_UNUSED(data);
        kde_output_device_registry_v2 *that = static_cast<kde_output_device_registry_v2::DisplayDestroyedListener *>(listener)->parent;
        that->m_global = nullptr;
        that->m_globalRemovedEvent = nullptr;
    }

    void kde_output_device_registry_v2::destroy_func(struct ::wl_resource *client_resource)
    {
        Resource *resource = Resource::fromResource(client_resource);
        Q_ASSERT(resource);
        kde_output_device_registry_v2 *that = resource->kde_output_device_registry_v2_object;
        if (Q_LIKELY(that)) {
            that->m_resource_map.remove(resource->client(), resource);
            that->kde_output_device_registry_v2_destroy_resource(resource);

            that = resource->kde_output_device_registry_v2_object;
            if (that && that->m_resource == resource)
                that->m_resource = nullptr;
        }
        delete resource;
    }


    void kde_output_device_registry_v2::globalRemove()
    {
        if (!m_global || m_globalRemovedEvent)
            return;

        struct wl_event_loop *event_loop = wl_display_get_event_loop(m_display);
        m_globalRemovedEvent = wl_event_loop_add_timer(event_loop, deferred_destroy_global_func, this);
        wl_event_source_timer_update(m_globalRemovedEvent, 24 * 60 * 60 * 1000);

        wl_global_remove(m_global);
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::bind(struct ::wl_client *client, uint32_t id, int version)
    {
        Q_ASSERT_X(!wl_client_get_object(client, id), "QWaylandObject bind", QStringLiteral("binding to object %1 more than once").arg(id).toLocal8Bit().constData());
        struct ::wl_resource *handle = wl_resource_create(client, &::kde_output_device_registry_v2_interface, version, id);
        return bind(handle);
    }

    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_output_device_registry_v2_allocate();
        resource->kde_output_device_registry_v2_object = this;

        wl_resource_set_implementation(handle, &m_kde_output_device_registry_v2_interface, resource, destroy_func);
        resource->handle = handle;
        kde_output_device_registry_v2_bind_resource(resource);
        return resource;
    }
    kde_output_device_registry_v2::Resource *kde_output_device_registry_v2::Resource::fromResource(struct ::wl_resource *resource)
    {
        if (Q_UNLIKELY(!resource))
            return nullptr;
        if (wl_resource_instance_of(resource, &::kde_output_device_registry_v2_interface, &m_kde_output_device_registry_v2_interface))
            return static_cast<Resource *>(wl_resource_get_user_data(resource));
        return nullptr;
    }

    const struct ::kde_output_device_registry_v2_interface kde_output_device_registry_v2::m_kde_output_device_registry_v2_interface = {
        kde_output_device_registry_v2::handle_stop
    };

    void kde_output_device_registry_v2::kde_output_device_registry_v2_stop(Resource *)
    {
    }


    void kde_output_device_registry_v2::handle_stop(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_device_registry_v2_object)) {
            return;
        }
        static_cast<kde_output_device_registry_v2 *>(qtResource->kde_output_device_registry_v2_object)->kde_output_device_registry_v2_stop(
            qtResource);
    }

    void kde_output_device_registry_v2::send_finished()
    {
        Q_ASSERT_X(m_resource, "kde_output_device_registry_v2::finished", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_registry_v2::finished as it's not initialised");
            return;
        }
        send_finished(
            m_resource->handle);
    }

    void kde_output_device_registry_v2::send_finished(struct ::wl_resource *resource)
    {
        kde_output_device_registry_v2_send_finished(
            resource);
    }


    void kde_output_device_registry_v2::send_output(struct ::wl_resource *output)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_registry_v2::output", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_registry_v2::output as it's not initialised");
            return;
        }
        send_output(
            m_resource->handle,
            output);
    }

    void kde_output_device_registry_v2::send_output(struct ::wl_resource *resource, struct ::wl_resource *output)
    {
        kde_output_device_registry_v2_send_output(
            resource,
            output);
    }



    int kde_output_device_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_output_device_v2 *>(data);
        wl_global_destroy(object->m_global);
        object->m_global = nullptr;
        wl_event_source_remove(object->m_globalRemovedEvent);
        object->m_globalRemovedEvent = nullptr;
        wl_list_remove(&object->m_displayDestroyedListener.link);
        object->kde_output_device_v2_destroy_global();
        return 0;
    }

    kde_output_device_v2::kde_output_device_v2(struct ::wl_client *client, int id, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(client, id, version);
    }

    kde_output_device_v2::kde_output_device_v2(struct ::wl_display *display, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(display, version);
    }

    kde_output_device_v2::kde_output_device_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

    kde_output_device_v2::kde_output_device_v2()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
    }

    kde_output_device_v2::~kde_output_device_v2()
    {
        for (auto resource : std::as_const(m_resource_map))
            resource->kde_output_device_v2_object = nullptr;

        if (m_resource)
            m_resource->kde_output_device_v2_object = nullptr;

        if (m_global) {
            if (m_globalRemovedEvent)
                wl_event_source_remove(m_globalRemovedEvent);
            wl_global_destroy(m_global);
            wl_list_remove(&m_displayDestroyedListener.link);
        }
    }

    void kde_output_device_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

    void kde_output_device_v2::init(struct ::wl_resource *resource)
    {
        m_resource = bind(resource);
    }

    kde_output_device_v2::Resource *kde_output_device_v2::add(struct ::wl_client *client, int version)
    {
        Resource *resource = bind(client, 0, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_v2::Resource *kde_output_device_v2::add(struct ::wl_client *client, int id, int version)
    {
        Resource *resource = bind(client, id, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_v2::Resource *kde_output_device_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_output_device_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_output_device_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_output_device_v2::display_destroy_func;
        m_displayDestroyedListener.parent = this;
#ifdef HAVE_ACK_GLOBAL_REMOVE
        wl_global_set_withdrawn_listener(m_global, [](wl_global *global) {
            auto object = static_cast<kde_output_device_v2 *>(wl_global_get_user_data(global));
            object->kde_output_device_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_output_device_v2::interface()
    {
        return &::kde_output_device_v2_interface;
    }

    kde_output_device_v2::Resource *kde_output_device_v2::kde_output_device_v2_allocate()
    {
        return new Resource;
    }

    void kde_output_device_v2::kde_output_device_v2_destroy_global()
    {
    }

    void kde_output_device_v2::kde_output_device_v2_bind_resource(Resource *)
    {
    }

    void kde_output_device_v2::kde_output_device_v2_destroy_resource(Resource *)
    {
    }

    void kde_output_device_v2::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)
    {
        kde_output_device_v2 *that = static_cast<kde_output_device_v2 *>(data);
        that->add(client, id, version);
    }

    void kde_output_device_v2::display_destroy_func(struct ::wl_listener *listener, void *data)
    {
        Q_UNUSED(data);
        kde_output_device_v2 *that = static_cast<kde_output_device_v2::DisplayDestroyedListener *>(listener)->parent;
        that->m_global = nullptr;
        that->m_globalRemovedEvent = nullptr;
    }

    void kde_output_device_v2::destroy_func(struct ::wl_resource *client_resource)
    {
        Resource *resource = Resource::fromResource(client_resource);
        Q_ASSERT(resource);
        kde_output_device_v2 *that = resource->kde_output_device_v2_object;
        if (Q_LIKELY(that)) {
            that->m_resource_map.remove(resource->client(), resource);
            that->kde_output_device_v2_destroy_resource(resource);

            that = resource->kde_output_device_v2_object;
            if (that && that->m_resource == resource)
                that->m_resource = nullptr;
        }
        delete resource;
    }


    void kde_output_device_v2::globalRemove()
    {
        if (!m_global || m_globalRemovedEvent)
            return;

        struct wl_event_loop *event_loop = wl_display_get_event_loop(m_display);
        m_globalRemovedEvent = wl_event_loop_add_timer(event_loop, deferred_destroy_global_func, this);
        wl_event_source_timer_update(m_globalRemovedEvent, 24 * 60 * 60 * 1000);

        wl_global_remove(m_global);
    }

    kde_output_device_v2::Resource *kde_output_device_v2::bind(struct ::wl_client *client, uint32_t id, int version)
    {
        Q_ASSERT_X(!wl_client_get_object(client, id), "QWaylandObject bind", QStringLiteral("binding to object %1 more than once").arg(id).toLocal8Bit().constData());
        struct ::wl_resource *handle = wl_resource_create(client, &::kde_output_device_v2_interface, version, id);
        return bind(handle);
    }

    kde_output_device_v2::Resource *kde_output_device_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_output_device_v2_allocate();
        resource->kde_output_device_v2_object = this;

        wl_resource_set_implementation(handle, &m_kde_output_device_v2_interface, resource, destroy_func);
        resource->handle = handle;
        kde_output_device_v2_bind_resource(resource);
        return resource;
    }
    kde_output_device_v2::Resource *kde_output_device_v2::Resource::fromResource(struct ::wl_resource *resource)
    {
        if (Q_UNLIKELY(!resource))
            return nullptr;
        if (wl_resource_instance_of(resource, &::kde_output_device_v2_interface, &m_kde_output_device_v2_interface))
            return static_cast<Resource *>(wl_resource_get_user_data(resource));
        return nullptr;
    }

    const struct ::kde_output_device_v2_interface kde_output_device_v2::m_kde_output_device_v2_interface = {
        kde_output_device_v2::handle_release
    };

    void kde_output_device_v2::kde_output_device_v2_release(Resource *)
    {
    }


    void kde_output_device_v2::handle_release(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_device_v2_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<kde_output_device_v2 *>(qtResource->kde_output_device_v2_object)->kde_output_device_v2_release(
            qtResource);
    }

    void kde_output_device_v2::send_geometry(int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const QString &make, const QString &model, int32_t transform)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::geometry", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::geometry as it's not initialised");
            return;
        }
        send_geometry(
            m_resource->handle,
            x,
            y,
            physical_width,
            physical_height,
            subpixel,
            make,
            model,
            transform);
    }

    void kde_output_device_v2::send_geometry(struct ::wl_resource *resource, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const QString &make, const QString &model, int32_t transform)
    {
        kde_output_device_v2_send_geometry(
            resource,
            x,
            y,
            physical_width,
            physical_height,
            subpixel,
            make.toUtf8().constData(),
            model.toUtf8().constData(),
            transform);
    }


    void kde_output_device_v2::send_current_mode(struct ::wl_resource *mode)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::current_mode", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::current_mode as it's not initialised");
            return;
        }
        send_current_mode(
            m_resource->handle,
            mode);
    }

    void kde_output_device_v2::send_current_mode(struct ::wl_resource *resource, struct ::wl_resource *mode)
    {
        kde_output_device_v2_send_current_mode(
            resource,
            mode);
    }


    void kde_output_device_v2::send_mode(struct ::wl_resource *mode)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::mode", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::mode as it's not initialised");
            return;
        }
        send_mode(
            m_resource->handle,
            mode);
    }

    void kde_output_device_v2::send_mode(struct ::wl_resource *resource, struct ::wl_resource *mode)
    {
        kde_output_device_v2_send_mode(
            resource,
            mode);
    }


    void kde_output_device_v2::send_done()
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::done", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::done as it's not initialised");
            return;
        }
        send_done(
            m_resource->handle);
    }

    void kde_output_device_v2::send_done(struct ::wl_resource *resource)
    {
        kde_output_device_v2_send_done(
            resource);
    }


    void kde_output_device_v2::send_scale(wl_fixed_t factor)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::scale", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::scale as it's not initialised");
            return;
        }
        send_scale(
            m_resource->handle,
            factor);
    }

    void kde_output_device_v2::send_scale(struct ::wl_resource *resource, wl_fixed_t factor)
    {
        kde_output_device_v2_send_scale(
            resource,
            factor);
    }


    void kde_output_device_v2::send_edid(const QString &raw)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::edid", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::edid as it's not initialised");
            return;
        }
        send_edid(
            m_resource->handle,
            raw);
    }

    void kde_output_device_v2::send_edid(struct ::wl_resource *resource, const QString &raw)
    {
        kde_output_device_v2_send_edid(
            resource,
            raw.toUtf8().constData());
    }


    void kde_output_device_v2::send_enabled(int32_t enabled)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::enabled", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::enabled as it's not initialised");
            return;
        }
        send_enabled(
            m_resource->handle,
            enabled);
    }

    void kde_output_device_v2::send_enabled(struct ::wl_resource *resource, int32_t enabled)
    {
        kde_output_device_v2_send_enabled(
            resource,
            enabled);
    }


    void kde_output_device_v2::send_uuid(const QString &uuid)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::uuid", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::uuid as it's not initialised");
            return;
        }
        send_uuid(
            m_resource->handle,
            uuid);
    }

    void kde_output_device_v2::send_uuid(struct ::wl_resource *resource, const QString &uuid)
    {
        kde_output_device_v2_send_uuid(
            resource,
            uuid.toUtf8().constData());
    }


    void kde_output_device_v2::send_serial_number(const QString &serialNumber)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::serial_number", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::serial_number as it's not initialised");
            return;
        }
        send_serial_number(
            m_resource->handle,
            serialNumber);
    }

    void kde_output_device_v2::send_serial_number(struct ::wl_resource *resource, const QString &serialNumber)
    {
        kde_output_device_v2_send_serial_number(
            resource,
            serialNumber.toUtf8().constData());
    }


    void kde_output_device_v2::send_eisa_id(const QString &eisaId)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::eisa_id", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::eisa_id as it's not initialised");
            return;
        }
        send_eisa_id(
            m_resource->handle,
            eisaId);
    }

    void kde_output_device_v2::send_eisa_id(struct ::wl_resource *resource, const QString &eisaId)
    {
        kde_output_device_v2_send_eisa_id(
            resource,
            eisaId.toUtf8().constData());
    }


    void kde_output_device_v2::send_capabilities(uint32_t flags)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::capabilities", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::capabilities as it's not initialised");
            return;
        }
        send_capabilities(
            m_resource->handle,
            flags);
    }

    void kde_output_device_v2::send_capabilities(struct ::wl_resource *resource, uint32_t flags)
    {
        kde_output_device_v2_send_capabilities(
            resource,
            flags);
    }


    void kde_output_device_v2::send_overscan(uint32_t overscan)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::overscan", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::overscan as it's not initialised");
            return;
        }
        send_overscan(
            m_resource->handle,
            overscan);
    }

    void kde_output_device_v2::send_overscan(struct ::wl_resource *resource, uint32_t overscan)
    {
        kde_output_device_v2_send_overscan(
            resource,
            overscan);
    }


    void kde_output_device_v2::send_vrr_policy(uint32_t vrr_policy)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::vrr_policy", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::vrr_policy as it's not initialised");
            return;
        }
        send_vrr_policy(
            m_resource->handle,
            vrr_policy);
    }

    void kde_output_device_v2::send_vrr_policy(struct ::wl_resource *resource, uint32_t vrr_policy)
    {
        kde_output_device_v2_send_vrr_policy(
            resource,
            vrr_policy);
    }


    void kde_output_device_v2::send_rgb_range(uint32_t rgb_range)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::rgb_range", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::rgb_range as it's not initialised");
            return;
        }
        send_rgb_range(
            m_resource->handle,
            rgb_range);
    }

    void kde_output_device_v2::send_rgb_range(struct ::wl_resource *resource, uint32_t rgb_range)
    {
        kde_output_device_v2_send_rgb_range(
            resource,
            rgb_range);
    }


    void kde_output_device_v2::send_name(const QString &name)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::name", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::name as it's not initialised");
            return;
        }
        send_name(
            m_resource->handle,
            name);
    }

    void kde_output_device_v2::send_name(struct ::wl_resource *resource, const QString &name)
    {
        kde_output_device_v2_send_name(
            resource,
            name.toUtf8().constData());
    }


    void kde_output_device_v2::send_high_dynamic_range(uint32_t hdr_enabled)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::high_dynamic_range", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::high_dynamic_range as it's not initialised");
            return;
        }
        send_high_dynamic_range(
            m_resource->handle,
            hdr_enabled);
    }

    void kde_output_device_v2::send_high_dynamic_range(struct ::wl_resource *resource, uint32_t hdr_enabled)
    {
        kde_output_device_v2_send_high_dynamic_range(
            resource,
            hdr_enabled);
    }


    void kde_output_device_v2::send_sdr_brightness(uint32_t sdr_brightness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::sdr_brightness", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::sdr_brightness as it's not initialised");
            return;
        }
        send_sdr_brightness(
            m_resource->handle,
            sdr_brightness);
    }

    void kde_output_device_v2::send_sdr_brightness(struct ::wl_resource *resource, uint32_t sdr_brightness)
    {
        kde_output_device_v2_send_sdr_brightness(
            resource,
            sdr_brightness);
    }


    void kde_output_device_v2::send_wide_color_gamut(uint32_t wcg_enabled)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::wide_color_gamut", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::wide_color_gamut as it's not initialised");
            return;
        }
        send_wide_color_gamut(
            m_resource->handle,
            wcg_enabled);
    }

    void kde_output_device_v2::send_wide_color_gamut(struct ::wl_resource *resource, uint32_t wcg_enabled)
    {
        kde_output_device_v2_send_wide_color_gamut(
            resource,
            wcg_enabled);
    }


    void kde_output_device_v2::send_auto_rotate_policy(uint32_t policy)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::auto_rotate_policy", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::auto_rotate_policy as it's not initialised");
            return;
        }
        send_auto_rotate_policy(
            m_resource->handle,
            policy);
    }

    void kde_output_device_v2::send_auto_rotate_policy(struct ::wl_resource *resource, uint32_t policy)
    {
        kde_output_device_v2_send_auto_rotate_policy(
            resource,
            policy);
    }


    void kde_output_device_v2::send_icc_profile_path(const QString &profile_path)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::icc_profile_path", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::icc_profile_path as it's not initialised");
            return;
        }
        send_icc_profile_path(
            m_resource->handle,
            profile_path);
    }

    void kde_output_device_v2::send_icc_profile_path(struct ::wl_resource *resource, const QString &profile_path)
    {
        kde_output_device_v2_send_icc_profile_path(
            resource,
            profile_path.toUtf8().constData());
    }


    void kde_output_device_v2::send_brightness_metadata(uint32_t max_peak_brightness, uint32_t max_frame_average_brightness, uint32_t min_brightness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::brightness_metadata", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::brightness_metadata as it's not initialised");
            return;
        }
        send_brightness_metadata(
            m_resource->handle,
            max_peak_brightness,
            max_frame_average_brightness,
            min_brightness);
    }

    void kde_output_device_v2::send_brightness_metadata(struct ::wl_resource *resource, uint32_t max_peak_brightness, uint32_t max_frame_average_brightness, uint32_t min_brightness)
    {
        kde_output_device_v2_send_brightness_metadata(
            resource,
            max_peak_brightness,
            max_frame_average_brightness,
            min_brightness);
    }


    void kde_output_device_v2::send_brightness_overrides(int32_t max_peak_brightness, int32_t max_average_brightness, int32_t min_brightness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::brightness_overrides", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::brightness_overrides as it's not initialised");
            return;
        }
        send_brightness_overrides(
            m_resource->handle,
            max_peak_brightness,
            max_average_brightness,
            min_brightness);
    }

    void kde_output_device_v2::send_brightness_overrides(struct ::wl_resource *resource, int32_t max_peak_brightness, int32_t max_average_brightness, int32_t min_brightness)
    {
        kde_output_device_v2_send_brightness_overrides(
            resource,
            max_peak_brightness,
            max_average_brightness,
            min_brightness);
    }


    void kde_output_device_v2::send_sdr_gamut_wideness(uint32_t gamut_wideness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::sdr_gamut_wideness", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::sdr_gamut_wideness as it's not initialised");
            return;
        }
        send_sdr_gamut_wideness(
            m_resource->handle,
            gamut_wideness);
    }

    void kde_output_device_v2::send_sdr_gamut_wideness(struct ::wl_resource *resource, uint32_t gamut_wideness)
    {
        kde_output_device_v2_send_sdr_gamut_wideness(
            resource,
            gamut_wideness);
    }


    void kde_output_device_v2::send_color_profile_source(uint32_t source)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::color_profile_source", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::color_profile_source as it's not initialised");
            return;
        }
        send_color_profile_source(
            m_resource->handle,
            source);
    }

    void kde_output_device_v2::send_color_profile_source(struct ::wl_resource *resource, uint32_t source)
    {
        kde_output_device_v2_send_color_profile_source(
            resource,
            source);
    }


    void kde_output_device_v2::send_brightness(uint32_t brightness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::brightness", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::brightness as it's not initialised");
            return;
        }
        send_brightness(
            m_resource->handle,
            brightness);
    }

    void kde_output_device_v2::send_brightness(struct ::wl_resource *resource, uint32_t brightness)
    {
        kde_output_device_v2_send_brightness(
            resource,
            brightness);
    }


    void kde_output_device_v2::send_color_power_tradeoff(uint32_t preference)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::color_power_tradeoff", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::color_power_tradeoff as it's not initialised");
            return;
        }
        send_color_power_tradeoff(
            m_resource->handle,
            preference);
    }

    void kde_output_device_v2::send_color_power_tradeoff(struct ::wl_resource *resource, uint32_t preference)
    {
        kde_output_device_v2_send_color_power_tradeoff(
            resource,
            preference);
    }


    void kde_output_device_v2::send_dimming(uint32_t multiplier)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::dimming", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::dimming as it's not initialised");
            return;
        }
        send_dimming(
            m_resource->handle,
            multiplier);
    }

    void kde_output_device_v2::send_dimming(struct ::wl_resource *resource, uint32_t multiplier)
    {
        kde_output_device_v2_send_dimming(
            resource,
            multiplier);
    }


    void kde_output_device_v2::send_replication_source(const QString &source)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::replication_source", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::replication_source as it's not initialised");
            return;
        }
        send_replication_source(
            m_resource->handle,
            source);
    }

    void kde_output_device_v2::send_replication_source(struct ::wl_resource *resource, const QString &source)
    {
        kde_output_device_v2_send_replication_source(
            resource,
            source.toUtf8().constData());
    }


    void kde_output_device_v2::send_ddc_ci_allowed(uint32_t allowed)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::ddc_ci_allowed", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::ddc_ci_allowed as it's not initialised");
            return;
        }
        send_ddc_ci_allowed(
            m_resource->handle,
            allowed);
    }

    void kde_output_device_v2::send_ddc_ci_allowed(struct ::wl_resource *resource, uint32_t allowed)
    {
        kde_output_device_v2_send_ddc_ci_allowed(
            resource,
            allowed);
    }


    void kde_output_device_v2::send_max_bits_per_color(uint32_t max_bpc)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::max_bits_per_color", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::max_bits_per_color as it's not initialised");
            return;
        }
        send_max_bits_per_color(
            m_resource->handle,
            max_bpc);
    }

    void kde_output_device_v2::send_max_bits_per_color(struct ::wl_resource *resource, uint32_t max_bpc)
    {
        kde_output_device_v2_send_max_bits_per_color(
            resource,
            max_bpc);
    }


    void kde_output_device_v2::send_max_bits_per_color_range(uint32_t min_value, uint32_t max_value)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::max_bits_per_color_range", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::max_bits_per_color_range as it's not initialised");
            return;
        }
        send_max_bits_per_color_range(
            m_resource->handle,
            min_value,
            max_value);
    }

    void kde_output_device_v2::send_max_bits_per_color_range(struct ::wl_resource *resource, uint32_t min_value, uint32_t max_value)
    {
        kde_output_device_v2_send_max_bits_per_color_range(
            resource,
            min_value,
            max_value);
    }


    void kde_output_device_v2::send_automatic_max_bits_per_color_limit(uint32_t max_bpc_limit)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::automatic_max_bits_per_color_limit", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::automatic_max_bits_per_color_limit as it's not initialised");
            return;
        }
        send_automatic_max_bits_per_color_limit(
            m_resource->handle,
            max_bpc_limit);
    }

    void kde_output_device_v2::send_automatic_max_bits_per_color_limit(struct ::wl_resource *resource, uint32_t max_bpc_limit)
    {
        kde_output_device_v2_send_automatic_max_bits_per_color_limit(
            resource,
            max_bpc_limit);
    }


    void kde_output_device_v2::send_edr_policy(uint32_t policy)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::edr_policy", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::edr_policy as it's not initialised");
            return;
        }
        send_edr_policy(
            m_resource->handle,
            policy);
    }

    void kde_output_device_v2::send_edr_policy(struct ::wl_resource *resource, uint32_t policy)
    {
        kde_output_device_v2_send_edr_policy(
            resource,
            policy);
    }


    void kde_output_device_v2::send_sharpness(uint32_t sharpness)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::sharpness", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::sharpness as it's not initialised");
            return;
        }
        send_sharpness(
            m_resource->handle,
            sharpness);
    }

    void kde_output_device_v2::send_sharpness(struct ::wl_resource *resource, uint32_t sharpness)
    {
        kde_output_device_v2_send_sharpness(
            resource,
            sharpness);
    }


    void kde_output_device_v2::send_priority(uint32_t priority)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::priority", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::priority as it's not initialised");
            return;
        }
        send_priority(
            m_resource->handle,
            priority);
    }

    void kde_output_device_v2::send_priority(struct ::wl_resource *resource, uint32_t priority)
    {
        kde_output_device_v2_send_priority(
            resource,
            priority);
    }


    void kde_output_device_v2::send_auto_brightness(uint32_t enabled)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::auto_brightness", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::auto_brightness as it's not initialised");
            return;
        }
        send_auto_brightness(
            m_resource->handle,
            enabled);
    }

    void kde_output_device_v2::send_auto_brightness(struct ::wl_resource *resource, uint32_t enabled)
    {
        kde_output_device_v2_send_auto_brightness(
            resource,
            enabled);
    }


    void kde_output_device_v2::send_removed()
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::removed", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::removed as it's not initialised");
            return;
        }
        send_removed(
            m_resource->handle);
    }

    void kde_output_device_v2::send_removed(struct ::wl_resource *resource)
    {
        kde_output_device_v2_send_removed(
            resource);
    }


    void kde_output_device_v2::send_hdr_icc_profile_path(const QString &profile_path)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::hdr_icc_profile_path", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::hdr_icc_profile_path as it's not initialised");
            return;
        }
        send_hdr_icc_profile_path(
            m_resource->handle,
            profile_path);
    }

    void kde_output_device_v2::send_hdr_icc_profile_path(struct ::wl_resource *resource, const QString &profile_path)
    {
        kde_output_device_v2_send_hdr_icc_profile_path(
            resource,
            profile_path.toUtf8().constData());
    }


    void kde_output_device_v2::send_hdr_color_profile_source(uint32_t source)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::hdr_color_profile_source", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::hdr_color_profile_source as it's not initialised");
            return;
        }
        send_hdr_color_profile_source(
            m_resource->handle,
            source);
    }

    void kde_output_device_v2::send_hdr_color_profile_source(struct ::wl_resource *resource, uint32_t source)
    {
        kde_output_device_v2_send_hdr_color_profile_source(
            resource,
            source);
    }


    void kde_output_device_v2::send_abm_level(uint32_t level)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_v2::abm_level", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_v2::abm_level as it's not initialised");
            return;
        }
        send_abm_level(
            m_resource->handle,
            level);
    }

    void kde_output_device_v2::send_abm_level(struct ::wl_resource *resource, uint32_t level)
    {
        kde_output_device_v2_send_abm_level(
            resource,
            level);
    }



    int kde_output_device_mode_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_output_device_mode_v2 *>(data);
        wl_global_destroy(object->m_global);
        object->m_global = nullptr;
        wl_event_source_remove(object->m_globalRemovedEvent);
        object->m_globalRemovedEvent = nullptr;
        wl_list_remove(&object->m_displayDestroyedListener.link);
        object->kde_output_device_mode_v2_destroy_global();
        return 0;
    }

    kde_output_device_mode_v2::kde_output_device_mode_v2(struct ::wl_client *client, int id, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(client, id, version);
    }

    kde_output_device_mode_v2::kde_output_device_mode_v2(struct ::wl_display *display, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(display, version);
    }

    kde_output_device_mode_v2::kde_output_device_mode_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

    kde_output_device_mode_v2::kde_output_device_mode_v2()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
    }

    kde_output_device_mode_v2::~kde_output_device_mode_v2()
    {
        for (auto resource : std::as_const(m_resource_map))
            resource->kde_output_device_mode_v2_object = nullptr;

        if (m_resource)
            m_resource->kde_output_device_mode_v2_object = nullptr;

        if (m_global) {
            if (m_globalRemovedEvent)
                wl_event_source_remove(m_globalRemovedEvent);
            wl_global_destroy(m_global);
            wl_list_remove(&m_displayDestroyedListener.link);
        }
    }

    void kde_output_device_mode_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

    void kde_output_device_mode_v2::init(struct ::wl_resource *resource)
    {
        m_resource = bind(resource);
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::add(struct ::wl_client *client, int version)
    {
        Resource *resource = bind(client, 0, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::add(struct ::wl_client *client, int id, int version)
    {
        Resource *resource = bind(client, id, version);
        m_resource_map.insert(client, resource);
        return resource;
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_output_device_mode_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_output_device_mode_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_output_device_mode_v2::display_destroy_func;
        m_displayDestroyedListener.parent = this;
#ifdef HAVE_ACK_GLOBAL_REMOVE
        wl_global_set_withdrawn_listener(m_global, [](wl_global *global) {
            auto object = static_cast<kde_output_device_mode_v2 *>(wl_global_get_user_data(global));
            object->kde_output_device_mode_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_output_device_mode_v2::interface()
    {
        return &::kde_output_device_mode_v2_interface;
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::kde_output_device_mode_v2_allocate()
    {
        return new Resource;
    }

    void kde_output_device_mode_v2::kde_output_device_mode_v2_destroy_global()
    {
    }

    void kde_output_device_mode_v2::kde_output_device_mode_v2_bind_resource(Resource *)
    {
    }

    void kde_output_device_mode_v2::kde_output_device_mode_v2_destroy_resource(Resource *)
    {
    }

    void kde_output_device_mode_v2::bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id)
    {
        kde_output_device_mode_v2 *that = static_cast<kde_output_device_mode_v2 *>(data);
        that->add(client, id, version);
    }

    void kde_output_device_mode_v2::display_destroy_func(struct ::wl_listener *listener, void *data)
    {
        Q_UNUSED(data);
        kde_output_device_mode_v2 *that = static_cast<kde_output_device_mode_v2::DisplayDestroyedListener *>(listener)->parent;
        that->m_global = nullptr;
        that->m_globalRemovedEvent = nullptr;
    }

    void kde_output_device_mode_v2::destroy_func(struct ::wl_resource *client_resource)
    {
        Resource *resource = Resource::fromResource(client_resource);
        Q_ASSERT(resource);
        kde_output_device_mode_v2 *that = resource->kde_output_device_mode_v2_object;
        if (Q_LIKELY(that)) {
            that->m_resource_map.remove(resource->client(), resource);
            that->kde_output_device_mode_v2_destroy_resource(resource);

            that = resource->kde_output_device_mode_v2_object;
            if (that && that->m_resource == resource)
                that->m_resource = nullptr;
        }
        delete resource;
    }


    void kde_output_device_mode_v2::globalRemove()
    {
        if (!m_global || m_globalRemovedEvent)
            return;

        struct wl_event_loop *event_loop = wl_display_get_event_loop(m_display);
        m_globalRemovedEvent = wl_event_loop_add_timer(event_loop, deferred_destroy_global_func, this);
        wl_event_source_timer_update(m_globalRemovedEvent, 24 * 60 * 60 * 1000);

        wl_global_remove(m_global);
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::bind(struct ::wl_client *client, uint32_t id, int version)
    {
        Q_ASSERT_X(!wl_client_get_object(client, id), "QWaylandObject bind", QStringLiteral("binding to object %1 more than once").arg(id).toLocal8Bit().constData());
        struct ::wl_resource *handle = wl_resource_create(client, &::kde_output_device_mode_v2_interface, version, id);
        return bind(handle);
    }

    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_output_device_mode_v2_allocate();
        resource->kde_output_device_mode_v2_object = this;

        wl_resource_set_implementation(handle, nullptr, resource, destroy_func);
        resource->handle = handle;
        kde_output_device_mode_v2_bind_resource(resource);
        return resource;
    }
    kde_output_device_mode_v2::Resource *kde_output_device_mode_v2::Resource::fromResource(struct ::wl_resource *resource)
    {
        if (Q_UNLIKELY(!resource))
            return nullptr;
        if (wl_resource_instance_of(resource, &::kde_output_device_mode_v2_interface, nullptr))
            return static_cast<Resource *>(wl_resource_get_user_data(resource));
        return nullptr;
    }

    void kde_output_device_mode_v2::send_size(int32_t width, int32_t height)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_mode_v2::size", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_mode_v2::size as it's not initialised");
            return;
        }
        send_size(
            m_resource->handle,
            width,
            height);
    }

    void kde_output_device_mode_v2::send_size(struct ::wl_resource *resource, int32_t width, int32_t height)
    {
        kde_output_device_mode_v2_send_size(
            resource,
            width,
            height);
    }


    void kde_output_device_mode_v2::send_refresh(int32_t refresh)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_mode_v2::refresh", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_mode_v2::refresh as it's not initialised");
            return;
        }
        send_refresh(
            m_resource->handle,
            refresh);
    }

    void kde_output_device_mode_v2::send_refresh(struct ::wl_resource *resource, int32_t refresh)
    {
        kde_output_device_mode_v2_send_refresh(
            resource,
            refresh);
    }


    void kde_output_device_mode_v2::send_preferred()
    {
        Q_ASSERT_X(m_resource, "kde_output_device_mode_v2::preferred", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_mode_v2::preferred as it's not initialised");
            return;
        }
        send_preferred(
            m_resource->handle);
    }

    void kde_output_device_mode_v2::send_preferred(struct ::wl_resource *resource)
    {
        kde_output_device_mode_v2_send_preferred(
            resource);
    }


    void kde_output_device_mode_v2::send_removed()
    {
        Q_ASSERT_X(m_resource, "kde_output_device_mode_v2::removed", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_mode_v2::removed as it's not initialised");
            return;
        }
        send_removed(
            m_resource->handle);
    }

    void kde_output_device_mode_v2::send_removed(struct ::wl_resource *resource)
    {
        kde_output_device_mode_v2_send_removed(
            resource);
    }


    void kde_output_device_mode_v2::send_flags(uint32_t flags)
    {
        Q_ASSERT_X(m_resource, "kde_output_device_mode_v2::flags", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call kde_output_device_mode_v2::flags as it's not initialised");
            return;
        }
        send_flags(
            m_resource->handle,
            flags);
    }

    void kde_output_device_mode_v2::send_flags(struct ::wl_resource *resource, uint32_t flags)
    {
        kde_output_device_mode_v2_send_flags(
            resource,
            flags);
    }

}

QT_WARNING_POP
QT_END_NAMESPACE
