// This file was generated by qtwaylandscanner
// source file is treeland-wallpaper-manager-unstable-v1.xml

#include "qwayland-treeland-wallpaper-manager-unstable-v1.h"

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

namespace QtWayland {

static inline void *wlRegistryBind(struct ::wl_registry *registry, uint32_t name, const struct ::wl_interface *interface, uint32_t version)
{
    const uint32_t bindOpCode = 0;
    return (void *) wl_proxy_marshal_constructor_versioned((struct wl_proxy *) registry,
    bindOpCode, interface, version, name, interface->name, version, nullptr);
}

    treeland_wallpaper_manager_v1::treeland_wallpaper_manager_v1(struct ::wl_registry *registry, uint32_t id, int version)
    {
        init(registry, id, version);
    }

    treeland_wallpaper_manager_v1::treeland_wallpaper_manager_v1(struct ::treeland_wallpaper_manager_v1 *obj)
        : m_treeland_wallpaper_manager_v1(obj)
    {
    }

    treeland_wallpaper_manager_v1::treeland_wallpaper_manager_v1()
        : m_treeland_wallpaper_manager_v1(nullptr)
    {
    }

    treeland_wallpaper_manager_v1::~treeland_wallpaper_manager_v1()
    {
    }

    void treeland_wallpaper_manager_v1::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_treeland_wallpaper_manager_v1 = static_cast<struct ::treeland_wallpaper_manager_v1 *>(wlRegistryBind(registry, id, &treeland_wallpaper_manager_v1_interface, version));
    }

    void treeland_wallpaper_manager_v1::init(struct ::treeland_wallpaper_manager_v1 *obj)
    {
        m_treeland_wallpaper_manager_v1 = obj;
    }

    treeland_wallpaper_manager_v1 *treeland_wallpaper_manager_v1::fromObject(struct ::treeland_wallpaper_manager_v1 *object)
    {
        return static_cast<treeland_wallpaper_manager_v1 *>(treeland_wallpaper_manager_v1_get_user_data(object));
    }

    bool treeland_wallpaper_manager_v1::isInitialized() const
    {
        return m_treeland_wallpaper_manager_v1 != nullptr;
    }

    uint32_t treeland_wallpaper_manager_v1::version() const
    {
        return wl_proxy_get_version(reinterpret_cast<wl_proxy*>(m_treeland_wallpaper_manager_v1));
    }

    const struct wl_interface *treeland_wallpaper_manager_v1::interface()
    {
        return &::treeland_wallpaper_manager_v1_interface;
    }

    void treeland_wallpaper_manager_v1::destroy()
    {
        ::treeland_wallpaper_manager_v1_destroy(
            m_treeland_wallpaper_manager_v1);
        m_treeland_wallpaper_manager_v1 = nullptr;
    }

    struct ::treeland_wallpaper_v1 *treeland_wallpaper_manager_v1::get_treeland_wallpaper(struct ::wl_output *output, struct ::wl_surface *surface)
    {
        struct ::treeland_wallpaper_v1 * id = ::treeland_wallpaper_manager_v1_get_treeland_wallpaper(
            m_treeland_wallpaper_manager_v1,
            output,
            surface);
        return id;
    }

    treeland_wallpaper_v1::treeland_wallpaper_v1(struct ::wl_registry *registry, uint32_t id, int version)
    {
        init(registry, id, version);
    }

    treeland_wallpaper_v1::treeland_wallpaper_v1(struct ::treeland_wallpaper_v1 *obj)
        : m_treeland_wallpaper_v1(obj)
    {
        init_listener();
    }

    treeland_wallpaper_v1::treeland_wallpaper_v1()
        : m_treeland_wallpaper_v1(nullptr)
    {
    }

    treeland_wallpaper_v1::~treeland_wallpaper_v1()
    {
    }

    void treeland_wallpaper_v1::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_treeland_wallpaper_v1 = static_cast<struct ::treeland_wallpaper_v1 *>(wlRegistryBind(registry, id, &treeland_wallpaper_v1_interface, version));
        init_listener();
    }

    void treeland_wallpaper_v1::init(struct ::treeland_wallpaper_v1 *obj)
    {
        m_treeland_wallpaper_v1 = obj;
        init_listener();
    }

    treeland_wallpaper_v1 *treeland_wallpaper_v1::fromObject(struct ::treeland_wallpaper_v1 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_treeland_wallpaper_v1_listener)
            return nullptr;
        return static_cast<treeland_wallpaper_v1 *>(treeland_wallpaper_v1_get_user_data(object));
    }

    bool treeland_wallpaper_v1::isInitialized() const
    {
        return m_treeland_wallpaper_v1 != nullptr;
    }

    uint32_t treeland_wallpaper_v1::version() const
    {
        return wl_proxy_get_version(reinterpret_cast<wl_proxy*>(m_treeland_wallpaper_v1));
    }

    const struct wl_interface *treeland_wallpaper_v1::interface()
    {
        return &::treeland_wallpaper_v1_interface;
    }

    void treeland_wallpaper_v1::destroy()
    {
        ::treeland_wallpaper_v1_destroy(
            m_treeland_wallpaper_v1);
        m_treeland_wallpaper_v1 = nullptr;
    }

    void treeland_wallpaper_v1::set_image_source(const QString &file_source, uint32_t role)
    {
        ::treeland_wallpaper_v1_set_image_source(
            m_treeland_wallpaper_v1,
            file_source.toUtf8().constData(),
            role);
    }

    void treeland_wallpaper_v1::set_video_source(const QString &file_source, uint32_t role)
    {
        ::treeland_wallpaper_v1_set_video_source(
            m_treeland_wallpaper_v1,
            file_source.toUtf8().constData(),
            role);
    }

    void treeland_wallpaper_v1::treeland_wallpaper_v1_failed(const QString &, uint32_t )
    {
    }

    void treeland_wallpaper_v1::handle_failed(
        void *data,
        struct ::treeland_wallpaper_v1 *object,
        const char *file_source,
        uint32_t error)
    {
        Q_UNUSED(object);
        static_cast<treeland_wallpaper_v1 *>(data)->treeland_wallpaper_v1_failed(
            QString::fromUtf8(file_source),
            error);
    }

    void treeland_wallpaper_v1::treeland_wallpaper_v1_changed(uint32_t , uint32_t , const QString &)
    {
    }

    void treeland_wallpaper_v1::handle_changed(
        void *data,
        struct ::treeland_wallpaper_v1 *object,
        uint32_t role,
        uint32_t source_type,
        const char *file_source)
    {
        Q_UNUSED(object);
        static_cast<treeland_wallpaper_v1 *>(data)->treeland_wallpaper_v1_changed(
            role,
            source_type,
            QString::fromUtf8(file_source));
    }

    const struct treeland_wallpaper_v1_listener treeland_wallpaper_v1::m_treeland_wallpaper_v1_listener = {
        treeland_wallpaper_v1::handle_failed,
        treeland_wallpaper_v1::handle_changed,
    };

    void treeland_wallpaper_v1::init_listener()
    {
        treeland_wallpaper_v1_add_listener(m_treeland_wallpaper_v1, &m_treeland_wallpaper_v1_listener, this);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
