// This file was generated by qtwaylandscanner
// source file is /build/qt5-wayland/src/qtwayland/src/3rdparty/protocol/xdg-shell-unstable-v6.xml

#include <QtWaylandCompositor/private/qwayland-server-xdg-shell-unstable-v6.h>

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

namespace QtWaylandServer {
    zxdg_shell_v6::zxdg_shell_v6(struct ::wl_client *client, int id, int version)
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
        init(client, id, version);
    }

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

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

    zxdg_shell_v6::zxdg_shell_v6()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
    }

    zxdg_shell_v6::~zxdg_shell_v6()
    {
        for (auto resource : qAsConst(m_resource_map))
            resource->zxdg_shell_v6_object = nullptr;

        if (m_resource)
            m_resource->zxdg_shell_v6_object = nullptr;

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

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

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

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

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

    void zxdg_shell_v6::init(struct ::wl_display *display, int version)
    {
        m_global = wl_global_create(display, &::zxdg_shell_v6_interface, version, this, bind_func);
        m_globalVersion = version;
        m_displayDestroyedListener.notify = zxdg_shell_v6::display_destroy_func;
        m_displayDestroyedListener.parent = this;
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *zxdg_shell_v6::interface()
    {
        return &::zxdg_shell_v6_interface;
    }

    zxdg_shell_v6::Resource *zxdg_shell_v6::zxdg_shell_v6_allocate()
    {
        return new Resource;
    }

    void zxdg_shell_v6::zxdg_shell_v6_bind_resource(Resource *)
    {
    }

    void zxdg_shell_v6::zxdg_shell_v6_destroy_resource(Resource *)
    {
    }

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

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

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

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

    zxdg_shell_v6::Resource *zxdg_shell_v6::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, &::zxdg_shell_v6_interface, version, id);
        return bind(handle);
    }

    zxdg_shell_v6::Resource *zxdg_shell_v6::bind(struct ::wl_resource *handle)
    {
        Resource *resource = zxdg_shell_v6_allocate();
        resource->zxdg_shell_v6_object = this;

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

    const struct ::zxdg_shell_v6_interface zxdg_shell_v6::m_zxdg_shell_v6_interface = {
        zxdg_shell_v6::handle_destroy,
        zxdg_shell_v6::handle_create_positioner,
        zxdg_shell_v6::handle_get_xdg_surface,
        zxdg_shell_v6::handle_pong
    };

    void zxdg_shell_v6::zxdg_shell_v6_destroy(Resource *)
    {
    }

    void zxdg_shell_v6::zxdg_shell_v6_create_positioner(Resource *, uint32_t)
    {
    }

    void zxdg_shell_v6::zxdg_shell_v6_get_xdg_surface(Resource *, uint32_t, struct ::wl_resource *)
    {
    }

    void zxdg_shell_v6::zxdg_shell_v6_pong(Resource *, uint32_t )
    {
    }


    void zxdg_shell_v6::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_shell_v6_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<zxdg_shell_v6 *>(r->zxdg_shell_v6_object)->zxdg_shell_v6_destroy(
            r);
    }

    void zxdg_shell_v6::handle_create_positioner(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_shell_v6_object)) {
            return;
        }
        static_cast<zxdg_shell_v6 *>(r->zxdg_shell_v6_object)->zxdg_shell_v6_create_positioner(
            r,
            id);
    }

    void zxdg_shell_v6::handle_get_xdg_surface(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        struct ::wl_resource *surface)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_shell_v6_object)) {
            return;
        }
        static_cast<zxdg_shell_v6 *>(r->zxdg_shell_v6_object)->zxdg_shell_v6_get_xdg_surface(
            r,
            id,
            surface);
    }

    void zxdg_shell_v6::handle_pong(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_shell_v6_object)) {
            return;
        }
        static_cast<zxdg_shell_v6 *>(r->zxdg_shell_v6_object)->zxdg_shell_v6_pong(
            r,
            serial);
    }

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

    void zxdg_shell_v6::send_ping(struct ::wl_resource *resource, uint32_t serial)
    {
        zxdg_shell_v6_send_ping(
            resource,
            serial);
    }


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

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

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

    zxdg_positioner_v6::zxdg_positioner_v6()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
    }

    zxdg_positioner_v6::~zxdg_positioner_v6()
    {
        for (auto resource : qAsConst(m_resource_map))
            resource->zxdg_positioner_v6_object = nullptr;

        if (m_resource)
            m_resource->zxdg_positioner_v6_object = nullptr;

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

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

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

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

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

    void zxdg_positioner_v6::init(struct ::wl_display *display, int version)
    {
        m_global = wl_global_create(display, &::zxdg_positioner_v6_interface, version, this, bind_func);
        m_globalVersion = version;
        m_displayDestroyedListener.notify = zxdg_positioner_v6::display_destroy_func;
        m_displayDestroyedListener.parent = this;
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *zxdg_positioner_v6::interface()
    {
        return &::zxdg_positioner_v6_interface;
    }

    zxdg_positioner_v6::Resource *zxdg_positioner_v6::zxdg_positioner_v6_allocate()
    {
        return new Resource;
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_bind_resource(Resource *)
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_destroy_resource(Resource *)
    {
    }

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

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

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

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

    zxdg_positioner_v6::Resource *zxdg_positioner_v6::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, &::zxdg_positioner_v6_interface, version, id);
        return bind(handle);
    }

    zxdg_positioner_v6::Resource *zxdg_positioner_v6::bind(struct ::wl_resource *handle)
    {
        Resource *resource = zxdg_positioner_v6_allocate();
        resource->zxdg_positioner_v6_object = this;

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

    const struct ::zxdg_positioner_v6_interface zxdg_positioner_v6::m_zxdg_positioner_v6_interface = {
        zxdg_positioner_v6::handle_destroy,
        zxdg_positioner_v6::handle_set_size,
        zxdg_positioner_v6::handle_set_anchor_rect,
        zxdg_positioner_v6::handle_set_anchor,
        zxdg_positioner_v6::handle_set_gravity,
        zxdg_positioner_v6::handle_set_constraint_adjustment,
        zxdg_positioner_v6::handle_set_offset
    };

    void zxdg_positioner_v6::zxdg_positioner_v6_destroy(Resource *)
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_size(Resource *, int32_t , int32_t )
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_anchor_rect(Resource *, int32_t , int32_t , int32_t , int32_t )
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_anchor(Resource *, uint32_t )
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_gravity(Resource *, uint32_t )
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_constraint_adjustment(Resource *, uint32_t )
    {
    }

    void zxdg_positioner_v6::zxdg_positioner_v6_set_offset(Resource *, int32_t , int32_t )
    {
    }


    void zxdg_positioner_v6::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_destroy(
            r);
    }

    void zxdg_positioner_v6::handle_set_size(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_size(
            r,
            width,
            height);
    }

    void zxdg_positioner_v6::handle_set_anchor_rect(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t x,
        int32_t y,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_anchor_rect(
            r,
            x,
            y,
            width,
            height);
    }

    void zxdg_positioner_v6::handle_set_anchor(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t anchor)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_anchor(
            r,
            anchor);
    }

    void zxdg_positioner_v6::handle_set_gravity(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t gravity)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_gravity(
            r,
            gravity);
    }

    void zxdg_positioner_v6::handle_set_constraint_adjustment(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t constraint_adjustment)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_constraint_adjustment(
            r,
            constraint_adjustment);
    }

    void zxdg_positioner_v6::handle_set_offset(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t x,
        int32_t y)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_positioner_v6_object)) {
            return;
        }
        static_cast<zxdg_positioner_v6 *>(r->zxdg_positioner_v6_object)->zxdg_positioner_v6_set_offset(
            r,
            x,
            y);
    }

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

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

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

    zxdg_surface_v6::zxdg_surface_v6()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
    }

    zxdg_surface_v6::~zxdg_surface_v6()
    {
        for (auto resource : qAsConst(m_resource_map))
            resource->zxdg_surface_v6_object = nullptr;

        if (m_resource)
            m_resource->zxdg_surface_v6_object = nullptr;

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

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

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

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

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

    void zxdg_surface_v6::init(struct ::wl_display *display, int version)
    {
        m_global = wl_global_create(display, &::zxdg_surface_v6_interface, version, this, bind_func);
        m_globalVersion = version;
        m_displayDestroyedListener.notify = zxdg_surface_v6::display_destroy_func;
        m_displayDestroyedListener.parent = this;
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *zxdg_surface_v6::interface()
    {
        return &::zxdg_surface_v6_interface;
    }

    zxdg_surface_v6::Resource *zxdg_surface_v6::zxdg_surface_v6_allocate()
    {
        return new Resource;
    }

    void zxdg_surface_v6::zxdg_surface_v6_bind_resource(Resource *)
    {
    }

    void zxdg_surface_v6::zxdg_surface_v6_destroy_resource(Resource *)
    {
    }

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

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

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

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

    zxdg_surface_v6::Resource *zxdg_surface_v6::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, &::zxdg_surface_v6_interface, version, id);
        return bind(handle);
    }

    zxdg_surface_v6::Resource *zxdg_surface_v6::bind(struct ::wl_resource *handle)
    {
        Resource *resource = zxdg_surface_v6_allocate();
        resource->zxdg_surface_v6_object = this;

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

    const struct ::zxdg_surface_v6_interface zxdg_surface_v6::m_zxdg_surface_v6_interface = {
        zxdg_surface_v6::handle_destroy,
        zxdg_surface_v6::handle_get_toplevel,
        zxdg_surface_v6::handle_get_popup,
        zxdg_surface_v6::handle_set_window_geometry,
        zxdg_surface_v6::handle_ack_configure
    };

    void zxdg_surface_v6::zxdg_surface_v6_destroy(Resource *)
    {
    }

    void zxdg_surface_v6::zxdg_surface_v6_get_toplevel(Resource *, uint32_t)
    {
    }

    void zxdg_surface_v6::zxdg_surface_v6_get_popup(Resource *, uint32_t, struct ::wl_resource *, struct ::wl_resource *)
    {
    }

    void zxdg_surface_v6::zxdg_surface_v6_set_window_geometry(Resource *, int32_t , int32_t , int32_t , int32_t )
    {
    }

    void zxdg_surface_v6::zxdg_surface_v6_ack_configure(Resource *, uint32_t )
    {
    }


    void zxdg_surface_v6::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_surface_v6_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<zxdg_surface_v6 *>(r->zxdg_surface_v6_object)->zxdg_surface_v6_destroy(
            r);
    }

    void zxdg_surface_v6::handle_get_toplevel(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_surface_v6_object)) {
            return;
        }
        static_cast<zxdg_surface_v6 *>(r->zxdg_surface_v6_object)->zxdg_surface_v6_get_toplevel(
            r,
            id);
    }

    void zxdg_surface_v6::handle_get_popup(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        struct ::wl_resource *parent,
        struct ::wl_resource *positioner)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_surface_v6_object)) {
            return;
        }
        static_cast<zxdg_surface_v6 *>(r->zxdg_surface_v6_object)->zxdg_surface_v6_get_popup(
            r,
            id,
            parent,
            positioner);
    }

    void zxdg_surface_v6::handle_set_window_geometry(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t x,
        int32_t y,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_surface_v6_object)) {
            return;
        }
        static_cast<zxdg_surface_v6 *>(r->zxdg_surface_v6_object)->zxdg_surface_v6_set_window_geometry(
            r,
            x,
            y,
            width,
            height);
    }

    void zxdg_surface_v6::handle_ack_configure(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_surface_v6_object)) {
            return;
        }
        static_cast<zxdg_surface_v6 *>(r->zxdg_surface_v6_object)->zxdg_surface_v6_ack_configure(
            r,
            serial);
    }

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

    void zxdg_surface_v6::send_configure(struct ::wl_resource *resource, uint32_t serial)
    {
        zxdg_surface_v6_send_configure(
            resource,
            serial);
    }


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

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

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

    zxdg_toplevel_v6::zxdg_toplevel_v6()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
    }

    zxdg_toplevel_v6::~zxdg_toplevel_v6()
    {
        for (auto resource : qAsConst(m_resource_map))
            resource->zxdg_toplevel_v6_object = nullptr;

        if (m_resource)
            m_resource->zxdg_toplevel_v6_object = nullptr;

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

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

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

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

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

    void zxdg_toplevel_v6::init(struct ::wl_display *display, int version)
    {
        m_global = wl_global_create(display, &::zxdg_toplevel_v6_interface, version, this, bind_func);
        m_globalVersion = version;
        m_displayDestroyedListener.notify = zxdg_toplevel_v6::display_destroy_func;
        m_displayDestroyedListener.parent = this;
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *zxdg_toplevel_v6::interface()
    {
        return &::zxdg_toplevel_v6_interface;
    }

    zxdg_toplevel_v6::Resource *zxdg_toplevel_v6::zxdg_toplevel_v6_allocate()
    {
        return new Resource;
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_bind_resource(Resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_destroy_resource(Resource *)
    {
    }

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

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

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

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

    zxdg_toplevel_v6::Resource *zxdg_toplevel_v6::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, &::zxdg_toplevel_v6_interface, version, id);
        return bind(handle);
    }

    zxdg_toplevel_v6::Resource *zxdg_toplevel_v6::bind(struct ::wl_resource *handle)
    {
        Resource *resource = zxdg_toplevel_v6_allocate();
        resource->zxdg_toplevel_v6_object = this;

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

    const struct ::zxdg_toplevel_v6_interface zxdg_toplevel_v6::m_zxdg_toplevel_v6_interface = {
        zxdg_toplevel_v6::handle_destroy,
        zxdg_toplevel_v6::handle_set_parent,
        zxdg_toplevel_v6::handle_set_title,
        zxdg_toplevel_v6::handle_set_app_id,
        zxdg_toplevel_v6::handle_show_window_menu,
        zxdg_toplevel_v6::handle_move,
        zxdg_toplevel_v6::handle_resize,
        zxdg_toplevel_v6::handle_set_max_size,
        zxdg_toplevel_v6::handle_set_min_size,
        zxdg_toplevel_v6::handle_set_maximized,
        zxdg_toplevel_v6::handle_unset_maximized,
        zxdg_toplevel_v6::handle_set_fullscreen,
        zxdg_toplevel_v6::handle_unset_fullscreen,
        zxdg_toplevel_v6::handle_set_minimized
    };

    void zxdg_toplevel_v6::zxdg_toplevel_v6_destroy(Resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_parent(Resource *, struct ::wl_resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_title(Resource *, const QString &)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_app_id(Resource *, const QString &)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_show_window_menu(Resource *, struct ::wl_resource *, uint32_t , int32_t , int32_t )
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_move(Resource *, struct ::wl_resource *, uint32_t )
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_resize(Resource *, struct ::wl_resource *, uint32_t , uint32_t )
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_max_size(Resource *, int32_t , int32_t )
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_min_size(Resource *, int32_t , int32_t )
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_maximized(Resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_unset_maximized(Resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_fullscreen(Resource *, struct ::wl_resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_unset_fullscreen(Resource *)
    {
    }

    void zxdg_toplevel_v6::zxdg_toplevel_v6_set_minimized(Resource *)
    {
    }


    void zxdg_toplevel_v6::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_destroy(
            r);
    }

    void zxdg_toplevel_v6::handle_set_parent(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *parent)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_parent(
            r,
            parent);
    }

    void zxdg_toplevel_v6::handle_set_title(
        ::wl_client *client,
        struct wl_resource *resource,
        const char *title)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_title(
            r,
            QString::fromUtf8(title));
    }

    void zxdg_toplevel_v6::handle_set_app_id(
        ::wl_client *client,
        struct wl_resource *resource,
        const char *app_id)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_app_id(
            r,
            QString::fromUtf8(app_id));
    }

    void zxdg_toplevel_v6::handle_show_window_menu(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *seat,
        uint32_t serial,
        int32_t x,
        int32_t y)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_show_window_menu(
            r,
            seat,
            serial,
            x,
            y);
    }

    void zxdg_toplevel_v6::handle_move(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *seat,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_move(
            r,
            seat,
            serial);
    }

    void zxdg_toplevel_v6::handle_resize(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *seat,
        uint32_t serial,
        uint32_t edges)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_resize(
            r,
            seat,
            serial,
            edges);
    }

    void zxdg_toplevel_v6::handle_set_max_size(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_max_size(
            r,
            width,
            height);
    }

    void zxdg_toplevel_v6::handle_set_min_size(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_min_size(
            r,
            width,
            height);
    }

    void zxdg_toplevel_v6::handle_set_maximized(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_maximized(
            r);
    }

    void zxdg_toplevel_v6::handle_unset_maximized(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_unset_maximized(
            r);
    }

    void zxdg_toplevel_v6::handle_set_fullscreen(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *output)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_fullscreen(
            r,
            output);
    }

    void zxdg_toplevel_v6::handle_unset_fullscreen(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_unset_fullscreen(
            r);
    }

    void zxdg_toplevel_v6::handle_set_minimized(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_toplevel_v6_object)) {
            return;
        }
        static_cast<zxdg_toplevel_v6 *>(r->zxdg_toplevel_v6_object)->zxdg_toplevel_v6_set_minimized(
            r);
    }

    void zxdg_toplevel_v6::send_configure(int32_t width, int32_t height, const QByteArray &states)
    {
        Q_ASSERT_X(m_resource, "zxdg_toplevel_v6::configure", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call zxdg_toplevel_v6::configure as it's not initialised");
            return;
        }
        send_configure(
            m_resource->handle,
            width,
            height,
            states);
    }

    void zxdg_toplevel_v6::send_configure(struct ::wl_resource *resource, int32_t width, int32_t height, const QByteArray &states)
    {
        struct wl_array states_data;
        states_data.size = states.size();
        states_data.data = static_cast<void *>(const_cast<char *>(states.constData()));
        states_data.alloc = 0;

        zxdg_toplevel_v6_send_configure(
            resource,
            width,
            height,
            &states_data);
    }


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

    void zxdg_toplevel_v6::send_close(struct ::wl_resource *resource)
    {
        zxdg_toplevel_v6_send_close(
            resource);
    }


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

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

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

    zxdg_popup_v6::zxdg_popup_v6()
        : m_resource_map()
        , m_resource(nullptr)
        , m_global(nullptr)
    {
    }

    zxdg_popup_v6::~zxdg_popup_v6()
    {
        for (auto resource : qAsConst(m_resource_map))
            resource->zxdg_popup_v6_object = nullptr;

        if (m_resource)
            m_resource->zxdg_popup_v6_object = nullptr;

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

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

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

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

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

    void zxdg_popup_v6::init(struct ::wl_display *display, int version)
    {
        m_global = wl_global_create(display, &::zxdg_popup_v6_interface, version, this, bind_func);
        m_globalVersion = version;
        m_displayDestroyedListener.notify = zxdg_popup_v6::display_destroy_func;
        m_displayDestroyedListener.parent = this;
        wl_display_add_destroy_listener(display, &m_displayDestroyedListener);
    }

    const struct wl_interface *zxdg_popup_v6::interface()
    {
        return &::zxdg_popup_v6_interface;
    }

    zxdg_popup_v6::Resource *zxdg_popup_v6::zxdg_popup_v6_allocate()
    {
        return new Resource;
    }

    void zxdg_popup_v6::zxdg_popup_v6_bind_resource(Resource *)
    {
    }

    void zxdg_popup_v6::zxdg_popup_v6_destroy_resource(Resource *)
    {
    }

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

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

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

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

    zxdg_popup_v6::Resource *zxdg_popup_v6::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, &::zxdg_popup_v6_interface, version, id);
        return bind(handle);
    }

    zxdg_popup_v6::Resource *zxdg_popup_v6::bind(struct ::wl_resource *handle)
    {
        Resource *resource = zxdg_popup_v6_allocate();
        resource->zxdg_popup_v6_object = this;

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

    const struct ::zxdg_popup_v6_interface zxdg_popup_v6::m_zxdg_popup_v6_interface = {
        zxdg_popup_v6::handle_destroy,
        zxdg_popup_v6::handle_grab
    };

    void zxdg_popup_v6::zxdg_popup_v6_destroy(Resource *)
    {
    }

    void zxdg_popup_v6::zxdg_popup_v6_grab(Resource *, struct ::wl_resource *, uint32_t )
    {
    }


    void zxdg_popup_v6::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_popup_v6_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<zxdg_popup_v6 *>(r->zxdg_popup_v6_object)->zxdg_popup_v6_destroy(
            r);
    }

    void zxdg_popup_v6::handle_grab(
        ::wl_client *client,
        struct wl_resource *resource,
        struct ::wl_resource *seat,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *r = Resource::fromResource(resource);
        if (Q_UNLIKELY(!r->zxdg_popup_v6_object)) {
            return;
        }
        static_cast<zxdg_popup_v6 *>(r->zxdg_popup_v6_object)->zxdg_popup_v6_grab(
            r,
            seat,
            serial);
    }

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

    void zxdg_popup_v6::send_configure(struct ::wl_resource *resource, int32_t x, int32_t y, int32_t width, int32_t height)
    {
        zxdg_popup_v6_send_configure(
            resource,
            x,
            y,
            width,
            height);
    }


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

    void zxdg_popup_v6::send_popup_done(struct ::wl_resource *resource)
    {
        zxdg_popup_v6_send_popup_done(
            resource);
    }

}

QT_WARNING_POP
QT_END_NAMESPACE
