// This file was generated by qtwaylandscanner
// source file is /usr/share/treeland-protocols/treeland-input-manager-unstable-v1.xml

#include "qwayland-server-treeland-input-manager-unstable-v1.h"

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

namespace QtWaylandServer {

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

    treeland_input_manager_v1::treeland_input_manager_v1(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);
    }

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

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

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

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

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

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

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

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

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

    const struct wl_interface *treeland_input_manager_v1::interface()
    {
        return &::treeland_input_manager_v1_interface;
    }

    treeland_input_manager_v1::Resource *treeland_input_manager_v1::allocate()
    {
        return new Resource;
    }

    void treeland_input_manager_v1::destroy_global()
    {
    }

    void treeland_input_manager_v1::bind_resource(Resource *)
    {
    }

    void treeland_input_manager_v1::destroy_resource(Resource *)
    {
    }

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

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

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

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


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

        wl_global_remove(m_global);

        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, 5000);
    }

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

    treeland_input_manager_v1::Resource *treeland_input_manager_v1::bind(struct ::wl_resource *handle)
    {
        Resource *resource = allocate();
        resource->treeland_input_manager_v1_object = this;

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

    const struct ::treeland_input_manager_v1_interface treeland_input_manager_v1::m_treeland_input_manager_v1_interface = {
        treeland_input_manager_v1::handle_destroy,
        treeland_input_manager_v1::handle_get_mouse_settings,
        treeland_input_manager_v1::handle_get_touchpad_settings,
        treeland_input_manager_v1::handle_get_keyboard_settings
    };

    void treeland_input_manager_v1::destroy(Resource *resource)
    {
        Q_UNUSED(resource);
    }

    void treeland_input_manager_v1::get_mouse_settings(Resource *resource, uint32_t id, struct ::wl_resource *seat)
    {
        Q_UNUSED(resource);
        Q_UNUSED(id);
        Q_UNUSED(seat);
    }

    void treeland_input_manager_v1::get_touchpad_settings(Resource *resource, uint32_t id, struct ::wl_resource *seat)
    {
        Q_UNUSED(resource);
        Q_UNUSED(id);
        Q_UNUSED(seat);
    }

    void treeland_input_manager_v1::get_keyboard_settings(Resource *resource, uint32_t id, struct ::wl_resource *seat)
    {
        Q_UNUSED(resource);
        Q_UNUSED(id);
        Q_UNUSED(seat);
    }


    void treeland_input_manager_v1::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_input_manager_v1_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<treeland_input_manager_v1 *>(qResource->treeland_input_manager_v1_object)->destroy(
            qResource);
    }

    void treeland_input_manager_v1::handle_get_mouse_settings(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        struct ::wl_resource *seat)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_input_manager_v1_object)) {
            return;
        }
        static_cast<treeland_input_manager_v1 *>(qResource->treeland_input_manager_v1_object)->get_mouse_settings(
            qResource,
            id,
            seat);
    }

    void treeland_input_manager_v1::handle_get_touchpad_settings(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        struct ::wl_resource *seat)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_input_manager_v1_object)) {
            return;
        }
        static_cast<treeland_input_manager_v1 *>(qResource->treeland_input_manager_v1_object)->get_touchpad_settings(
            qResource,
            id,
            seat);
    }

    void treeland_input_manager_v1::handle_get_keyboard_settings(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        struct ::wl_resource *seat)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_input_manager_v1_object)) {
            return;
        }
        static_cast<treeland_input_manager_v1 *>(qResource->treeland_input_manager_v1_object)->get_keyboard_settings(
            qResource,
            id,
            seat);
    }

    void treeland_input_manager_v1::send_capability_available(uint32_t type, struct ::wl_resource *seat)
    {
        Q_ASSERT_X(m_resource, "treeland_input_manager_v1::capability_available", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call treeland_input_manager_v1::capability_available as it's not initialised");
            return;
        }
        send_capability_available(
            m_resource->handle,
            type,
            seat);
    }

    void treeland_input_manager_v1::send_capability_available(struct ::wl_resource *resource, uint32_t type, struct ::wl_resource *seat)
    {
        treeland_input_manager_v1_send_capability_available(
            resource,
            type,
            seat);
    }


    void treeland_input_manager_v1::send_capability_unavailable(uint32_t type, struct ::wl_resource *seat)
    {
        Q_ASSERT_X(m_resource, "treeland_input_manager_v1::capability_unavailable", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call treeland_input_manager_v1::capability_unavailable as it's not initialised");
            return;
        }
        send_capability_unavailable(
            m_resource->handle,
            type,
            seat);
    }

    void treeland_input_manager_v1::send_capability_unavailable(struct ::wl_resource *resource, uint32_t type, struct ::wl_resource *seat)
    {
        treeland_input_manager_v1_send_capability_unavailable(
            resource,
            type,
            seat);
    }



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

    treeland_pointer_device_configuration_v1::treeland_pointer_device_configuration_v1(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);
    }

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

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

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

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

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

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

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

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

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

    const struct wl_interface *treeland_pointer_device_configuration_v1::interface()
    {
        return &::treeland_pointer_device_configuration_v1_interface;
    }

    treeland_pointer_device_configuration_v1::Resource *treeland_pointer_device_configuration_v1::allocate()
    {
        return new Resource;
    }

    void treeland_pointer_device_configuration_v1::destroy_global()
    {
    }

    void treeland_pointer_device_configuration_v1::bind_resource(Resource *)
    {
    }

    void treeland_pointer_device_configuration_v1::destroy_resource(Resource *)
    {
    }

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

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

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

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


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

        wl_global_remove(m_global);

        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, 5000);
    }

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

    treeland_pointer_device_configuration_v1::Resource *treeland_pointer_device_configuration_v1::bind(struct ::wl_resource *handle)
    {
        Resource *resource = allocate();
        resource->treeland_pointer_device_configuration_v1_object = this;

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

    const struct ::treeland_pointer_device_configuration_v1_interface treeland_pointer_device_configuration_v1::m_treeland_pointer_device_configuration_v1_interface = {
        treeland_pointer_device_configuration_v1::handle_destroy,
        treeland_pointer_device_configuration_v1::handle_set_scroll_factor,
        treeland_pointer_device_configuration_v1::handle_set_handed_mode,
        treeland_pointer_device_configuration_v1::handle_set_accel_speed,
        treeland_pointer_device_configuration_v1::handle_set_acceleration_profile,
        treeland_pointer_device_configuration_v1::handle_set_send_events_mode,
        treeland_pointer_device_configuration_v1::handle_set_natural_scroll,
        treeland_pointer_device_configuration_v1::handle_set_disable_while_typing,
        treeland_pointer_device_configuration_v1::handle_set_tap_to_click,
        treeland_pointer_device_configuration_v1::handle_apply
    };

    void treeland_pointer_device_configuration_v1::destroy(Resource *resource)
    {
        Q_UNUSED(resource);
    }

    void treeland_pointer_device_configuration_v1::set_scroll_factor(Resource *resource, wl_fixed_t factor)
    {
        Q_UNUSED(resource);
        Q_UNUSED(factor);
    }

    void treeland_pointer_device_configuration_v1::set_handed_mode(Resource *resource, uint32_t mode)
    {
        Q_UNUSED(resource);
        Q_UNUSED(mode);
    }

    void treeland_pointer_device_configuration_v1::set_accel_speed(Resource *resource, wl_fixed_t accel_speed)
    {
        Q_UNUSED(resource);
        Q_UNUSED(accel_speed);
    }

    void treeland_pointer_device_configuration_v1::set_acceleration_profile(Resource *resource, uint32_t profile)
    {
        Q_UNUSED(resource);
        Q_UNUSED(profile);
    }

    void treeland_pointer_device_configuration_v1::set_send_events_mode(Resource *resource, uint32_t mode)
    {
        Q_UNUSED(resource);
        Q_UNUSED(mode);
    }

    void treeland_pointer_device_configuration_v1::set_natural_scroll(Resource *resource, uint32_t state)
    {
        Q_UNUSED(resource);
        Q_UNUSED(state);
    }

    void treeland_pointer_device_configuration_v1::set_disable_while_typing(Resource *resource, uint32_t state)
    {
        Q_UNUSED(resource);
        Q_UNUSED(state);
    }

    void treeland_pointer_device_configuration_v1::set_tap_to_click(Resource *resource, uint32_t state)
    {
        Q_UNUSED(resource);
        Q_UNUSED(state);
    }

    void treeland_pointer_device_configuration_v1::apply(Resource *resource)
    {
        Q_UNUSED(resource);
    }


    void treeland_pointer_device_configuration_v1::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->destroy(
            qResource);
    }

    void treeland_pointer_device_configuration_v1::handle_set_scroll_factor(
        ::wl_client *client,
        struct wl_resource *resource,
        wl_fixed_t factor)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_scroll_factor(
            qResource,
            factor);
    }

    void treeland_pointer_device_configuration_v1::handle_set_handed_mode(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t mode)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_handed_mode(
            qResource,
            mode);
    }

    void treeland_pointer_device_configuration_v1::handle_set_accel_speed(
        ::wl_client *client,
        struct wl_resource *resource,
        wl_fixed_t accel_speed)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_accel_speed(
            qResource,
            accel_speed);
    }

    void treeland_pointer_device_configuration_v1::handle_set_acceleration_profile(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t profile)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_acceleration_profile(
            qResource,
            profile);
    }

    void treeland_pointer_device_configuration_v1::handle_set_send_events_mode(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t mode)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_send_events_mode(
            qResource,
            mode);
    }

    void treeland_pointer_device_configuration_v1::handle_set_natural_scroll(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t state)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_natural_scroll(
            qResource,
            state);
    }

    void treeland_pointer_device_configuration_v1::handle_set_disable_while_typing(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t state)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_disable_while_typing(
            qResource,
            state);
    }

    void treeland_pointer_device_configuration_v1::handle_set_tap_to_click(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t state)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->set_tap_to_click(
            qResource,
            state);
    }

    void treeland_pointer_device_configuration_v1::handle_apply(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_pointer_device_configuration_v1_object)) {
            return;
        }
        static_cast<treeland_pointer_device_configuration_v1 *>(qResource->treeland_pointer_device_configuration_v1_object)->apply(
            qResource);
    }

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

    void treeland_pointer_device_configuration_v1::send_feature(struct ::wl_resource *resource, uint32_t feature)
    {
        treeland_pointer_device_configuration_v1_send_feature(
            resource,
            feature);
    }


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

    void treeland_pointer_device_configuration_v1::send_scroll_factor(struct ::wl_resource *resource, wl_fixed_t factor)
    {
        treeland_pointer_device_configuration_v1_send_scroll_factor(
            resource,
            factor);
    }


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

    void treeland_pointer_device_configuration_v1::send_handed_mode(struct ::wl_resource *resource, uint32_t mode)
    {
        treeland_pointer_device_configuration_v1_send_handed_mode(
            resource,
            mode);
    }


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

    void treeland_pointer_device_configuration_v1::send_accel_speed(struct ::wl_resource *resource, wl_fixed_t accel_speed)
    {
        treeland_pointer_device_configuration_v1_send_accel_speed(
            resource,
            accel_speed);
    }


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

    void treeland_pointer_device_configuration_v1::send_acceleration_profile(struct ::wl_resource *resource, uint32_t profile)
    {
        treeland_pointer_device_configuration_v1_send_acceleration_profile(
            resource,
            profile);
    }


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

    void treeland_pointer_device_configuration_v1::send_send_events_mode(struct ::wl_resource *resource, uint32_t mode)
    {
        treeland_pointer_device_configuration_v1_send_send_events_mode(
            resource,
            mode);
    }


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

    void treeland_pointer_device_configuration_v1::send_natural_scroll(struct ::wl_resource *resource, uint32_t state)
    {
        treeland_pointer_device_configuration_v1_send_natural_scroll(
            resource,
            state);
    }


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

    void treeland_pointer_device_configuration_v1::send_disable_while_typing(struct ::wl_resource *resource, uint32_t state)
    {
        treeland_pointer_device_configuration_v1_send_disable_while_typing(
            resource,
            state);
    }


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

    void treeland_pointer_device_configuration_v1::send_tap_to_click(struct ::wl_resource *resource, uint32_t state)
    {
        treeland_pointer_device_configuration_v1_send_tap_to_click(
            resource,
            state);
    }


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

    void treeland_pointer_device_configuration_v1::send_failed(struct ::wl_resource *resource)
    {
        treeland_pointer_device_configuration_v1_send_failed(
            resource);
    }


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

    void treeland_pointer_device_configuration_v1::send_done(struct ::wl_resource *resource, uint32_t serial)
    {
        treeland_pointer_device_configuration_v1_send_done(
            resource,
            serial);
    }



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

    treeland_mouse_settings_v1::treeland_mouse_settings_v1(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);
    }

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

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

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

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

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

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

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

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

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

    const struct wl_interface *treeland_mouse_settings_v1::interface()
    {
        return &::treeland_mouse_settings_v1_interface;
    }

    treeland_mouse_settings_v1::Resource *treeland_mouse_settings_v1::allocate()
    {
        return new Resource;
    }

    void treeland_mouse_settings_v1::destroy_global()
    {
    }

    void treeland_mouse_settings_v1::bind_resource(Resource *)
    {
    }

    void treeland_mouse_settings_v1::destroy_resource(Resource *)
    {
    }

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

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

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

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


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

        wl_global_remove(m_global);

        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, 5000);
    }

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

    treeland_mouse_settings_v1::Resource *treeland_mouse_settings_v1::bind(struct ::wl_resource *handle)
    {
        Resource *resource = allocate();
        resource->treeland_mouse_settings_v1_object = this;

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

    const struct ::treeland_mouse_settings_v1_interface treeland_mouse_settings_v1::m_treeland_mouse_settings_v1_interface = {
        treeland_mouse_settings_v1::handle_destroy,
        treeland_mouse_settings_v1::handle_get_pointer_configuration
    };

    void treeland_mouse_settings_v1::destroy(Resource *resource)
    {
        Q_UNUSED(resource);
    }

    void treeland_mouse_settings_v1::get_pointer_configuration(Resource *resource, uint32_t id, uint32_t serial)
    {
        Q_UNUSED(resource);
        Q_UNUSED(id);
        Q_UNUSED(serial);
    }


    void treeland_mouse_settings_v1::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_mouse_settings_v1_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<treeland_mouse_settings_v1 *>(qResource->treeland_mouse_settings_v1_object)->destroy(
            qResource);
    }

    void treeland_mouse_settings_v1::handle_get_pointer_configuration(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_mouse_settings_v1_object)) {
            return;
        }
        static_cast<treeland_mouse_settings_v1 *>(qResource->treeland_mouse_settings_v1_object)->get_pointer_configuration(
            qResource,
            id,
            serial);
    }


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

    treeland_touchpad_settings_v1::treeland_touchpad_settings_v1(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);
    }

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

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

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

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

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

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

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

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

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

    const struct wl_interface *treeland_touchpad_settings_v1::interface()
    {
        return &::treeland_touchpad_settings_v1_interface;
    }

    treeland_touchpad_settings_v1::Resource *treeland_touchpad_settings_v1::allocate()
    {
        return new Resource;
    }

    void treeland_touchpad_settings_v1::destroy_global()
    {
    }

    void treeland_touchpad_settings_v1::bind_resource(Resource *)
    {
    }

    void treeland_touchpad_settings_v1::destroy_resource(Resource *)
    {
    }

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

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

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

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


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

        wl_global_remove(m_global);

        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, 5000);
    }

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

    treeland_touchpad_settings_v1::Resource *treeland_touchpad_settings_v1::bind(struct ::wl_resource *handle)
    {
        Resource *resource = allocate();
        resource->treeland_touchpad_settings_v1_object = this;

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

    const struct ::treeland_touchpad_settings_v1_interface treeland_touchpad_settings_v1::m_treeland_touchpad_settings_v1_interface = {
        treeland_touchpad_settings_v1::handle_destroy,
        treeland_touchpad_settings_v1::handle_get_pointer_configuration
    };

    void treeland_touchpad_settings_v1::destroy(Resource *resource)
    {
        Q_UNUSED(resource);
    }

    void treeland_touchpad_settings_v1::get_pointer_configuration(Resource *resource, uint32_t id, uint32_t serial)
    {
        Q_UNUSED(resource);
        Q_UNUSED(id);
        Q_UNUSED(serial);
    }


    void treeland_touchpad_settings_v1::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_touchpad_settings_v1_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<treeland_touchpad_settings_v1 *>(qResource->treeland_touchpad_settings_v1_object)->destroy(
            qResource);
    }

    void treeland_touchpad_settings_v1::handle_get_pointer_configuration(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t id,
        uint32_t serial)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_touchpad_settings_v1_object)) {
            return;
        }
        static_cast<treeland_touchpad_settings_v1 *>(qResource->treeland_touchpad_settings_v1_object)->get_pointer_configuration(
            qResource,
            id,
            serial);
    }


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

    treeland_keyboard_settings_v1::treeland_keyboard_settings_v1(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);
    }

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

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

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

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

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

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

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

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

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

    const struct wl_interface *treeland_keyboard_settings_v1::interface()
    {
        return &::treeland_keyboard_settings_v1_interface;
    }

    treeland_keyboard_settings_v1::Resource *treeland_keyboard_settings_v1::allocate()
    {
        return new Resource;
    }

    void treeland_keyboard_settings_v1::destroy_global()
    {
    }

    void treeland_keyboard_settings_v1::bind_resource(Resource *)
    {
    }

    void treeland_keyboard_settings_v1::destroy_resource(Resource *)
    {
    }

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

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

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

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


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

        wl_global_remove(m_global);

        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, 5000);
    }

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

    treeland_keyboard_settings_v1::Resource *treeland_keyboard_settings_v1::bind(struct ::wl_resource *handle)
    {
        Resource *resource = allocate();
        resource->treeland_keyboard_settings_v1_object = this;

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

    const struct ::treeland_keyboard_settings_v1_interface treeland_keyboard_settings_v1::m_treeland_keyboard_settings_v1_interface = {
        treeland_keyboard_settings_v1::handle_destroy,
        treeland_keyboard_settings_v1::handle_set_repeat,
        treeland_keyboard_settings_v1::handle_set_num_lock,
        treeland_keyboard_settings_v1::handle_apply
    };

    void treeland_keyboard_settings_v1::destroy(Resource *resource)
    {
        Q_UNUSED(resource);
    }

    void treeland_keyboard_settings_v1::set_repeat(Resource *resource, int32_t rate, int32_t delay)
    {
        Q_UNUSED(resource);
        Q_UNUSED(rate);
        Q_UNUSED(delay);
    }

    void treeland_keyboard_settings_v1::set_num_lock(Resource *resource, uint32_t state)
    {
        Q_UNUSED(resource);
        Q_UNUSED(state);
    }

    void treeland_keyboard_settings_v1::apply(Resource *resource)
    {
        Q_UNUSED(resource);
    }


    void treeland_keyboard_settings_v1::handle_destroy(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_keyboard_settings_v1_object)) {
            wl_resource_destroy(resource);
            return;
        }
        static_cast<treeland_keyboard_settings_v1 *>(qResource->treeland_keyboard_settings_v1_object)->destroy(
            qResource);
    }

    void treeland_keyboard_settings_v1::handle_set_repeat(
        ::wl_client *client,
        struct wl_resource *resource,
        int32_t rate,
        int32_t delay)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_keyboard_settings_v1_object)) {
            return;
        }
        static_cast<treeland_keyboard_settings_v1 *>(qResource->treeland_keyboard_settings_v1_object)->set_repeat(
            qResource,
            rate,
            delay);
    }

    void treeland_keyboard_settings_v1::handle_set_num_lock(
        ::wl_client *client,
        struct wl_resource *resource,
        uint32_t state)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_keyboard_settings_v1_object)) {
            return;
        }
        static_cast<treeland_keyboard_settings_v1 *>(qResource->treeland_keyboard_settings_v1_object)->set_num_lock(
            qResource,
            state);
    }

    void treeland_keyboard_settings_v1::handle_apply(
        ::wl_client *client,
        struct wl_resource *resource)
    {
        Q_UNUSED(client);
        Resource *qResource = Resource::fromResource(resource);
        if (Q_UNLIKELY(!qResource->treeland_keyboard_settings_v1_object)) {
            return;
        }
        static_cast<treeland_keyboard_settings_v1 *>(qResource->treeland_keyboard_settings_v1_object)->apply(
            qResource);
    }

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

    void treeland_keyboard_settings_v1::send_feature(struct ::wl_resource *resource, uint32_t feature)
    {
        treeland_keyboard_settings_v1_send_feature(
            resource,
            feature);
    }


    void treeland_keyboard_settings_v1::send_repeat(int32_t rate, int32_t delay)
    {
        Q_ASSERT_X(m_resource, "treeland_keyboard_settings_v1::repeat", "Uninitialised resource");
        if (Q_UNLIKELY(!m_resource)) {
            qWarning("could not call treeland_keyboard_settings_v1::repeat as it's not initialised");
            return;
        }
        send_repeat(
            m_resource->handle,
            rate,
            delay);
    }

    void treeland_keyboard_settings_v1::send_repeat(struct ::wl_resource *resource, int32_t rate, int32_t delay)
    {
        treeland_keyboard_settings_v1_send_repeat(
            resource,
            rate,
            delay);
    }


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

    void treeland_keyboard_settings_v1::send_num_lock(struct ::wl_resource *resource, uint32_t state)
    {
        treeland_keyboard_settings_v1_send_num_lock(
            resource,
            state);
    }


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

    void treeland_keyboard_settings_v1::send_failed(struct ::wl_resource *resource)
    {
        treeland_keyboard_settings_v1_send_failed(
            resource);
    }


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

    void treeland_keyboard_settings_v1::send_done(struct ::wl_resource *resource)
    {
        treeland_keyboard_settings_v1_send_done(
            resource);
    }

}

QT_WARNING_POP
QT_END_NAMESPACE
