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

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

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

namespace QtWaylandServer {

    int kde_output_management_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_output_management_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_management_v2_destroy_global();
        return 0;
    }

    kde_output_management_v2::kde_output_management_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_management_v2::kde_output_management_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_management_v2::kde_output_management_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

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

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

        if (m_resource)
            m_resource->kde_output_management_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_management_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

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

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

    kde_output_management_v2::Resource *kde_output_management_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_management_v2::Resource *kde_output_management_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_output_management_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_output_management_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_output_management_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_management_v2 *>(wl_global_get_user_data(global));
            object->kde_output_management_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_output_management_v2::interface()
    {
        return &::kde_output_management_v2_interface;
    }

    kde_output_management_v2::Resource *kde_output_management_v2::kde_output_management_v2_allocate()
    {
        return new Resource;
    }

    void kde_output_management_v2::kde_output_management_v2_destroy_global()
    {
    }

    void kde_output_management_v2::kde_output_management_v2_bind_resource(Resource *)
    {
    }

    void kde_output_management_v2::kde_output_management_v2_destroy_resource(Resource *)
    {
    }

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

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

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

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


    void kde_output_management_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_management_v2::Resource *kde_output_management_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_management_v2_interface, version, id);
        return bind(handle);
    }

    kde_output_management_v2::Resource *kde_output_management_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_output_management_v2_allocate();
        resource->kde_output_management_v2_object = this;

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

    const struct ::kde_output_management_v2_interface kde_output_management_v2::m_kde_output_management_v2_interface = {
        kde_output_management_v2::handle_create_configuration,
        kde_output_management_v2::handle_create_mode_list
    };

    void kde_output_management_v2::kde_output_management_v2_create_configuration(Resource *, uint32_t)
    {
    }

    void kde_output_management_v2::kde_output_management_v2_create_mode_list(Resource *, uint32_t)
    {
    }


    void kde_output_management_v2::handle_create_configuration(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_management_v2_object)) {
            return;
        }
        static_cast<kde_output_management_v2 *>(qtResource->kde_output_management_v2_object)->kde_output_management_v2_create_configuration(
            qtResource,
            id);
    }

    void kde_output_management_v2::handle_create_mode_list(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_management_v2_object)) {
            return;
        }
        static_cast<kde_output_management_v2 *>(qtResource->kde_output_management_v2_object)->kde_output_management_v2_create_mode_list(
            qtResource,
            id);
    }


    int kde_output_configuration_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_output_configuration_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_configuration_v2_destroy_global();
        return 0;
    }

    kde_output_configuration_v2::kde_output_configuration_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_configuration_v2::kde_output_configuration_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_configuration_v2::kde_output_configuration_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

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

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

        if (m_resource)
            m_resource->kde_output_configuration_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_configuration_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

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

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

    kde_output_configuration_v2::Resource *kde_output_configuration_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_configuration_v2::Resource *kde_output_configuration_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_output_configuration_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_output_configuration_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_output_configuration_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_configuration_v2 *>(wl_global_get_user_data(global));
            object->kde_output_configuration_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_output_configuration_v2::interface()
    {
        return &::kde_output_configuration_v2_interface;
    }

    kde_output_configuration_v2::Resource *kde_output_configuration_v2::kde_output_configuration_v2_allocate()
    {
        return new Resource;
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_destroy_global()
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_bind_resource(Resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_destroy_resource(Resource *)
    {
    }

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

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

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

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


    void kde_output_configuration_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_configuration_v2::Resource *kde_output_configuration_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_configuration_v2_interface, version, id);
        return bind(handle);
    }

    kde_output_configuration_v2::Resource *kde_output_configuration_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_output_configuration_v2_allocate();
        resource->kde_output_configuration_v2_object = this;

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

    const struct ::kde_output_configuration_v2_interface kde_output_configuration_v2::m_kde_output_configuration_v2_interface = {
        kde_output_configuration_v2::handle_enable,
        kde_output_configuration_v2::handle_mode,
        kde_output_configuration_v2::handle_transform,
        kde_output_configuration_v2::handle_position,
        kde_output_configuration_v2::handle_scale,
        kde_output_configuration_v2::handle_apply,
        kde_output_configuration_v2::handle_destroy,
        kde_output_configuration_v2::handle_overscan,
        kde_output_configuration_v2::handle_set_vrr_policy,
        kde_output_configuration_v2::handle_set_rgb_range,
        kde_output_configuration_v2::handle_set_primary_output,
        kde_output_configuration_v2::handle_set_priority,
        kde_output_configuration_v2::handle_set_high_dynamic_range,
        kde_output_configuration_v2::handle_set_sdr_brightness,
        kde_output_configuration_v2::handle_set_wide_color_gamut,
        kde_output_configuration_v2::handle_set_auto_rotate_policy,
        kde_output_configuration_v2::handle_set_icc_profile_path,
        kde_output_configuration_v2::handle_set_brightness_overrides,
        kde_output_configuration_v2::handle_set_sdr_gamut_wideness,
        kde_output_configuration_v2::handle_set_color_profile_source,
        kde_output_configuration_v2::handle_set_brightness,
        kde_output_configuration_v2::handle_set_color_power_tradeoff,
        kde_output_configuration_v2::handle_set_dimming,
        kde_output_configuration_v2::handle_set_replication_source,
        kde_output_configuration_v2::handle_set_ddc_ci_allowed,
        kde_output_configuration_v2::handle_set_max_bits_per_color,
        kde_output_configuration_v2::handle_set_edr_policy,
        kde_output_configuration_v2::handle_set_sharpness,
        kde_output_configuration_v2::handle_set_custom_modes,
        kde_output_configuration_v2::handle_set_auto_brightness,
        kde_output_configuration_v2::handle_set_hdr_icc_profile_path,
        kde_output_configuration_v2::handle_set_hdr_color_profile_source,
        kde_output_configuration_v2::handle_set_abm_level
    };

    void kde_output_configuration_v2::kde_output_configuration_v2_enable(Resource *, struct ::wl_resource *, int32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_mode(Resource *, struct ::wl_resource *, struct ::wl_resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_transform(Resource *, struct ::wl_resource *, int32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_position(Resource *, struct ::wl_resource *, int32_t , int32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_scale(Resource *, struct ::wl_resource *, wl_fixed_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_apply(Resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_destroy(Resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_overscan(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_vrr_policy(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_rgb_range(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_primary_output(Resource *, struct ::wl_resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_priority(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_high_dynamic_range(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_sdr_brightness(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_wide_color_gamut(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_auto_rotate_policy(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_icc_profile_path(Resource *, struct ::wl_resource *, const QString &)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_brightness_overrides(Resource *, struct ::wl_resource *, int32_t , int32_t , int32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_sdr_gamut_wideness(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_color_profile_source(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_brightness(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_color_power_tradeoff(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_dimming(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_replication_source(Resource *, struct ::wl_resource *, const QString &)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_ddc_ci_allowed(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_max_bits_per_color(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_edr_policy(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_sharpness(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_custom_modes(Resource *, struct ::wl_resource *, struct ::wl_resource *)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_auto_brightness(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_hdr_icc_profile_path(Resource *, struct ::wl_resource *, const QString &)
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_hdr_color_profile_source(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void kde_output_configuration_v2::kde_output_configuration_v2_set_abm_level(Resource *, struct ::wl_resource *, uint32_t )
    {
    }


    void kde_output_configuration_v2::handle_enable(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        int32_t enable)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_enable(
            qtResource,
            outputdevice,
            enable);
    }

    void kde_output_configuration_v2::handle_mode(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        struct ::wl_resource *mode)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_mode(
            qtResource,
            outputdevice,
            mode);
    }

    void kde_output_configuration_v2::handle_transform(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        int32_t transform)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_transform(
            qtResource,
            outputdevice,
            transform);
    }

    void kde_output_configuration_v2::handle_position(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        int32_t x,
        int32_t y)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_position(
            qtResource,
            outputdevice,
            x,
            y);
    }

    void kde_output_configuration_v2::handle_scale(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        wl_fixed_t scale)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_scale(
            qtResource,
            outputdevice,
            scale);
    }

    void kde_output_configuration_v2::handle_apply(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_apply(
            qtResource);
    }

    void kde_output_configuration_v2::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_destroy(
            qtResource);
    }

    void kde_output_configuration_v2::handle_overscan(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t overscan)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_overscan(
            qtResource,
            outputdevice,
            overscan);
    }

    void kde_output_configuration_v2::handle_set_vrr_policy(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t policy)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_vrr_policy(
            qtResource,
            outputdevice,
            policy);
    }

    void kde_output_configuration_v2::handle_set_rgb_range(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t rgb_range)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_rgb_range(
            qtResource,
            outputdevice,
            rgb_range);
    }

    void kde_output_configuration_v2::handle_set_primary_output(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *output)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_primary_output(
            qtResource,
            output);
    }

    void kde_output_configuration_v2::handle_set_priority(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t priority)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_priority(
            qtResource,
            outputdevice,
            priority);
    }

    void kde_output_configuration_v2::handle_set_high_dynamic_range(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t enable_hdr)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_high_dynamic_range(
            qtResource,
            outputdevice,
            enable_hdr);
    }

    void kde_output_configuration_v2::handle_set_sdr_brightness(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t sdr_brightness)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_sdr_brightness(
            qtResource,
            outputdevice,
            sdr_brightness);
    }

    void kde_output_configuration_v2::handle_set_wide_color_gamut(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t enable_wcg)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_wide_color_gamut(
            qtResource,
            outputdevice,
            enable_wcg);
    }

    void kde_output_configuration_v2::handle_set_auto_rotate_policy(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t policy)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_auto_rotate_policy(
            qtResource,
            outputdevice,
            policy);
    }

    void kde_output_configuration_v2::handle_set_icc_profile_path(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        const char *profile_path)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_icc_profile_path(
            qtResource,
            outputdevice,
            QString::fromUtf8(profile_path));
    }

    void kde_output_configuration_v2::handle_set_brightness_overrides(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        int32_t max_peak_brightness,
        int32_t max_frame_average_brightness,
        int32_t min_brightness)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_brightness_overrides(
            qtResource,
            outputdevice,
            max_peak_brightness,
            max_frame_average_brightness,
            min_brightness);
    }

    void kde_output_configuration_v2::handle_set_sdr_gamut_wideness(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t gamut_wideness)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_sdr_gamut_wideness(
            qtResource,
            outputdevice,
            gamut_wideness);
    }

    void kde_output_configuration_v2::handle_set_color_profile_source(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t color_profile_source)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_color_profile_source(
            qtResource,
            outputdevice,
            color_profile_source);
    }

    void kde_output_configuration_v2::handle_set_brightness(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t brightness)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_brightness(
            qtResource,
            outputdevice,
            brightness);
    }

    void kde_output_configuration_v2::handle_set_color_power_tradeoff(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t preference)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_color_power_tradeoff(
            qtResource,
            outputdevice,
            preference);
    }

    void kde_output_configuration_v2::handle_set_dimming(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t multiplier)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_dimming(
            qtResource,
            outputdevice,
            multiplier);
    }

    void kde_output_configuration_v2::handle_set_replication_source(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        const char *source)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_replication_source(
            qtResource,
            outputdevice,
            QString::fromUtf8(source));
    }

    void kde_output_configuration_v2::handle_set_ddc_ci_allowed(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t allowed)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_ddc_ci_allowed(
            qtResource,
            outputdevice,
            allowed);
    }

    void kde_output_configuration_v2::handle_set_max_bits_per_color(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t max_bpc)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_max_bits_per_color(
            qtResource,
            outputdevice,
            max_bpc);
    }

    void kde_output_configuration_v2::handle_set_edr_policy(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t policy)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_edr_policy(
            qtResource,
            outputdevice,
            policy);
    }

    void kde_output_configuration_v2::handle_set_sharpness(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t sharpness)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_sharpness(
            qtResource,
            outputdevice,
            sharpness);
    }

    void kde_output_configuration_v2::handle_set_custom_modes(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        struct ::wl_resource *modes)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_custom_modes(
            qtResource,
            outputdevice,
            modes);
    }

    void kde_output_configuration_v2::handle_set_auto_brightness(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t enabled)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_auto_brightness(
            qtResource,
            outputdevice,
            enabled);
    }

    void kde_output_configuration_v2::handle_set_hdr_icc_profile_path(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        const char *profile_path)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_hdr_icc_profile_path(
            qtResource,
            outputdevice,
            QString::fromUtf8(profile_path));
    }

    void kde_output_configuration_v2::handle_set_hdr_color_profile_source(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t color_profile_source)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_hdr_color_profile_source(
            qtResource,
            outputdevice,
            color_profile_source);
    }

    void kde_output_configuration_v2::handle_set_abm_level(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *outputdevice,
        uint32_t level)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_output_configuration_v2_object)) {
            return;
        }
        static_cast<kde_output_configuration_v2 *>(qtResource->kde_output_configuration_v2_object)->kde_output_configuration_v2_set_abm_level(
            qtResource,
            outputdevice,
            level);
    }

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

    void kde_output_configuration_v2::send_applied(struct ::wl_resource *resource)
    {
        kde_output_configuration_v2_send_applied(
            resource);
    }


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

    void kde_output_configuration_v2::send_failed(struct ::wl_resource *resource)
    {
        kde_output_configuration_v2_send_failed(
            resource);
    }


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

    void kde_output_configuration_v2::send_failure_reason(struct ::wl_resource *resource, const QString &reason)
    {
        kde_output_configuration_v2_send_failure_reason(
            resource,
            reason.toUtf8().constData());
    }



    int kde_mode_list_v2::deferred_destroy_global_func(void *data) {
        auto object = static_cast<kde_mode_list_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_mode_list_v2_destroy_global();
        return 0;
    }

    kde_mode_list_v2::kde_mode_list_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_mode_list_v2::kde_mode_list_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_mode_list_v2::kde_mode_list_v2(struct ::wl_resource *resource)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
        , m_display(nullptr)
        , m_globalRemovedEvent(nullptr)
    {
        init(resource);
    }

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

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

        if (m_resource)
            m_resource->kde_mode_list_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_mode_list_v2::init(struct ::wl_client *client, int id, int version)
    {
        m_resource = bind(client, id, version);
    }

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

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

    kde_mode_list_v2::Resource *kde_mode_list_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_mode_list_v2::Resource *kde_mode_list_v2::add(struct ::wl_resource *resource)
    {
        return *m_resource_map.insert(wl_resource_get_client(resource), bind(resource));
    }

    void kde_mode_list_v2::init(struct ::wl_display *display, int version)
    {
        m_display = display;
        m_global = wl_global_create(display, &::kde_mode_list_v2_interface, version, this, bind_func);
        m_displayDestroyedListener.notify = kde_mode_list_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_mode_list_v2 *>(wl_global_get_user_data(global));
            object->kde_mode_list_v2_destroy_global();
        });
#endif
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *kde_mode_list_v2::interface()
    {
        return &::kde_mode_list_v2_interface;
    }

    kde_mode_list_v2::Resource *kde_mode_list_v2::kde_mode_list_v2_allocate()
    {
        return new Resource;
    }

    void kde_mode_list_v2::kde_mode_list_v2_destroy_global()
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_bind_resource(Resource *)
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_destroy_resource(Resource *)
    {
    }

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

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

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

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


    void kde_mode_list_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_mode_list_v2::Resource *kde_mode_list_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_mode_list_v2_interface, version, id);
        return bind(handle);
    }

    kde_mode_list_v2::Resource *kde_mode_list_v2::bind(struct ::wl_resource *handle)
    {
        Resource *resource = kde_mode_list_v2_allocate();
        resource->kde_mode_list_v2_object = this;

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

    const struct ::kde_mode_list_v2_interface kde_mode_list_v2::m_kde_mode_list_v2_interface = {
        kde_mode_list_v2::handle_destroy,
        kde_mode_list_v2::handle_add_mode,
        kde_mode_list_v2::handle_set_resolution,
        kde_mode_list_v2::handle_set_refresh_rate,
        kde_mode_list_v2::handle_set_reduced_blanking
    };

    void kde_mode_list_v2::kde_mode_list_v2_destroy(Resource *)
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_add_mode(Resource *)
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_set_resolution(Resource *, uint32_t , uint32_t )
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_set_refresh_rate(Resource *, uint32_t )
    {
    }

    void kde_mode_list_v2::kde_mode_list_v2_set_reduced_blanking(Resource *, uint32_t )
    {
    }


    void kde_mode_list_v2::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_mode_list_v2_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<kde_mode_list_v2 *>(qtResource->kde_mode_list_v2_object)->kde_mode_list_v2_destroy(
            qtResource);
    }

    void kde_mode_list_v2::handle_add_mode(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_mode_list_v2_object)) {
            return;
        }
        static_cast<kde_mode_list_v2 *>(qtResource->kde_mode_list_v2_object)->kde_mode_list_v2_add_mode(
            qtResource);
    }

    void kde_mode_list_v2::handle_set_resolution(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t width,
        uint32_t height)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_mode_list_v2_object)) {
            return;
        }
        static_cast<kde_mode_list_v2 *>(qtResource->kde_mode_list_v2_object)->kde_mode_list_v2_set_resolution(
            qtResource,
            width,
            height);
    }

    void kde_mode_list_v2::handle_set_refresh_rate(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t rate)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_mode_list_v2_object)) {
            return;
        }
        static_cast<kde_mode_list_v2 *>(qtResource->kde_mode_list_v2_object)->kde_mode_list_v2_set_refresh_rate(
            qtResource,
            rate);
    }

    void kde_mode_list_v2::handle_set_reduced_blanking(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t reduced)
    {
        Q_UNUSED(client);
        Resource *qtResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qtResource->kde_mode_list_v2_object)) {
            return;
        }
        static_cast<kde_mode_list_v2 *>(qtResource->kde_mode_list_v2_object)->kde_mode_list_v2_set_reduced_blanking(
            qtResource,
            reduced);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
