// This file was generated by qtwaylandscanner
// source file is wlr-output-power-management-unstable-v1.xml

#include "qwayland-wlr-output-power-management-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);
}

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

    zwlr_output_power_manager_v1::zwlr_output_power_manager_v1(struct ::zwlr_output_power_manager_v1 *obj)
        : m_zwlr_output_power_manager_v1(obj)
    {
    }

    zwlr_output_power_manager_v1::zwlr_output_power_manager_v1()
        : m_zwlr_output_power_manager_v1(nullptr)
    {
    }

    zwlr_output_power_manager_v1::~zwlr_output_power_manager_v1()
    {
    }

    void zwlr_output_power_manager_v1::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_zwlr_output_power_manager_v1 = static_cast<struct ::zwlr_output_power_manager_v1 *>(wlRegistryBind(registry, id, &zwlr_output_power_manager_v1_interface, version));
    }

    void zwlr_output_power_manager_v1::init(struct ::zwlr_output_power_manager_v1 *obj)
    {
        m_zwlr_output_power_manager_v1 = obj;
    }

    zwlr_output_power_manager_v1 *zwlr_output_power_manager_v1::fromObject(struct ::zwlr_output_power_manager_v1 *object)
    {
        return static_cast<zwlr_output_power_manager_v1 *>(zwlr_output_power_manager_v1_get_user_data(object));
    }

    bool zwlr_output_power_manager_v1::isInitialized() const
    {
        return m_zwlr_output_power_manager_v1 != nullptr;
    }

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

    const struct wl_interface *zwlr_output_power_manager_v1::interface()
    {
        return &::zwlr_output_power_manager_v1_interface;
    }

    struct ::zwlr_output_power_v1 *zwlr_output_power_manager_v1::get_output_power(struct ::wl_output *output)
    {
        struct ::zwlr_output_power_v1 * id = ::zwlr_output_power_manager_v1_get_output_power(
            m_zwlr_output_power_manager_v1,
            output);
        return id;
    }

    void zwlr_output_power_manager_v1::destroy()
    {
        ::zwlr_output_power_manager_v1_destroy(
            m_zwlr_output_power_manager_v1);
        m_zwlr_output_power_manager_v1 = nullptr;
    }

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

    zwlr_output_power_v1::zwlr_output_power_v1(struct ::zwlr_output_power_v1 *obj)
        : m_zwlr_output_power_v1(obj)
    {
        init_listener();
    }

    zwlr_output_power_v1::zwlr_output_power_v1()
        : m_zwlr_output_power_v1(nullptr)
    {
    }

    zwlr_output_power_v1::~zwlr_output_power_v1()
    {
    }

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

    void zwlr_output_power_v1::init(struct ::zwlr_output_power_v1 *obj)
    {
        m_zwlr_output_power_v1 = obj;
        init_listener();
    }

    zwlr_output_power_v1 *zwlr_output_power_v1::fromObject(struct ::zwlr_output_power_v1 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_zwlr_output_power_v1_listener)
            return nullptr;
        return static_cast<zwlr_output_power_v1 *>(zwlr_output_power_v1_get_user_data(object));
    }

    bool zwlr_output_power_v1::isInitialized() const
    {
        return m_zwlr_output_power_v1 != nullptr;
    }

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

    const struct wl_interface *zwlr_output_power_v1::interface()
    {
        return &::zwlr_output_power_v1_interface;
    }

    void zwlr_output_power_v1::set_mode(uint32_t mode)
    {
        ::zwlr_output_power_v1_set_mode(
            m_zwlr_output_power_v1,
            mode);
    }

    void zwlr_output_power_v1::destroy()
    {
        ::zwlr_output_power_v1_destroy(
            m_zwlr_output_power_v1);
        m_zwlr_output_power_v1 = nullptr;
    }

    void zwlr_output_power_v1::zwlr_output_power_v1_mode(uint32_t )
    {
    }

    void zwlr_output_power_v1::handle_mode(
        void *data,
        struct ::zwlr_output_power_v1 *object,
        uint32_t mode)
    {
        Q_UNUSED(object);
        static_cast<zwlr_output_power_v1 *>(data)->zwlr_output_power_v1_mode(
            mode);
    }

    void zwlr_output_power_v1::zwlr_output_power_v1_failed()
    {
    }

    void zwlr_output_power_v1::handle_failed(
        void *data,
        struct ::zwlr_output_power_v1 *object)
    {
        Q_UNUSED(object);
        static_cast<zwlr_output_power_v1 *>(data)->zwlr_output_power_v1_failed();
    }

    const struct zwlr_output_power_v1_listener zwlr_output_power_v1::m_zwlr_output_power_v1_listener = {
        zwlr_output_power_v1::handle_mode,
        zwlr_output_power_v1::handle_failed,
    };

    void zwlr_output_power_v1::init_listener()
    {
        zwlr_output_power_v1_add_listener(m_zwlr_output_power_v1, &m_zwlr_output_power_v1_listener, this);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
