// This file was generated by qtwaylandscanner
// source file is viewporter.xml

#include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
#include <QtWaylandClient/private/qwayland-viewporter.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);
}

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

    wp_viewporter::wp_viewporter(struct ::wp_viewporter *obj)
        : m_wp_viewporter(obj)
    {
    }

    wp_viewporter::wp_viewporter()
        : m_wp_viewporter(nullptr)
    {
    }

    wp_viewporter::~wp_viewporter()
    {
    }

    void wp_viewporter::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_wp_viewporter = static_cast<struct ::wp_viewporter *>(wlRegistryBind(registry, id, &wp_viewporter_interface, version));
    }

    void wp_viewporter::init(struct ::wp_viewporter *obj)
    {
        m_wp_viewporter = obj;
    }

    wp_viewporter *wp_viewporter::fromObject(struct ::wp_viewporter *object)
    {
        return static_cast<wp_viewporter *>(wp_viewporter_get_user_data(object));
    }

    bool wp_viewporter::isInitialized() const
    {
        return m_wp_viewporter != nullptr;
    }

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

    const struct wl_interface *wp_viewporter::interface()
    {
        return &::wp_viewporter_interface;
    }

    void wp_viewporter::destroy()
    {
        ::wp_viewporter_destroy(
            m_wp_viewporter);
        m_wp_viewporter = nullptr;
    }

    struct ::wp_viewport *wp_viewporter::get_viewport(struct ::wl_surface *surface)
    {
        struct ::wp_viewport * id = ::wp_viewporter_get_viewport(
            m_wp_viewporter,
            surface);
        return id;
    }

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

    wp_viewport::wp_viewport(struct ::wp_viewport *obj)
        : m_wp_viewport(obj)
    {
    }

    wp_viewport::wp_viewport()
        : m_wp_viewport(nullptr)
    {
    }

    wp_viewport::~wp_viewport()
    {
    }

    void wp_viewport::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_wp_viewport = static_cast<struct ::wp_viewport *>(wlRegistryBind(registry, id, &wp_viewport_interface, version));
    }

    void wp_viewport::init(struct ::wp_viewport *obj)
    {
        m_wp_viewport = obj;
    }

    wp_viewport *wp_viewport::fromObject(struct ::wp_viewport *object)
    {
        return static_cast<wp_viewport *>(wp_viewport_get_user_data(object));
    }

    bool wp_viewport::isInitialized() const
    {
        return m_wp_viewport != nullptr;
    }

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

    const struct wl_interface *wp_viewport::interface()
    {
        return &::wp_viewport_interface;
    }

    void wp_viewport::destroy()
    {
        ::wp_viewport_destroy(
            m_wp_viewport);
        m_wp_viewport = nullptr;
    }

    void wp_viewport::set_source(wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
    {
        ::wp_viewport_set_source(
            m_wp_viewport,
            x,
            y,
            width,
            height);
    }

    void wp_viewport::set_destination(int32_t width, int32_t height)
    {
        ::wp_viewport_set_destination(
            m_wp_viewport,
            width,
            height);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
