// This file was generated by qtwaylandscanner
// source file is server-buffer-extension.xml

#include "qwayland-server-buffer-extension.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);
}

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

    qt_server_buffer::qt_server_buffer(struct ::qt_server_buffer *obj)
        : m_qt_server_buffer(obj)
    {
    }

    qt_server_buffer::qt_server_buffer()
        : m_qt_server_buffer(nullptr)
    {
    }

    qt_server_buffer::~qt_server_buffer()
    {
    }

    void qt_server_buffer::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_qt_server_buffer = static_cast<struct ::qt_server_buffer *>(wlRegistryBind(registry, id, &qt_server_buffer_interface, version));
    }

    void qt_server_buffer::init(struct ::qt_server_buffer *obj)
    {
        m_qt_server_buffer = obj;
    }

    qt_server_buffer *qt_server_buffer::fromObject(struct ::qt_server_buffer *object)
    {
        return static_cast<qt_server_buffer *>(qt_server_buffer_get_user_data(object));
    }

    bool qt_server_buffer::isInitialized() const
    {
        return m_qt_server_buffer != nullptr;
    }

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

    const struct wl_interface *qt_server_buffer::interface()
    {
        return &::qt_server_buffer_interface;
    }

    void qt_server_buffer::release()
    {
        ::qt_server_buffer_release(
            m_qt_server_buffer);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
