// This file was generated by qtwaylandscanner
// source file is /usr/share/plasma-wayland-protocols/dpms.xml

#include "qwayland-dpms.h"

QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-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;
#if (WAYLAND_VERSION_MAJOR == 1 && WAYLAND_VERSION_MINOR > 10) || WAYLAND_VERSION_MAJOR > 1
    return (void *) wl_proxy_marshal_constructor_versioned((struct wl_proxy *) registry,
        bindOpCode, interface, version, name, interface->name, version, nullptr);
#else
    return (void *) wl_proxy_marshal_constructor((struct wl_proxy *) registry,
        bindOpCode, interface, name, interface->name, version, nullptr);
#endif
}

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

    org_kde_kwin_dpms_manager::org_kde_kwin_dpms_manager(struct ::org_kde_kwin_dpms_manager *obj)
        : m_org_kde_kwin_dpms_manager(obj)
    {
    }

    org_kde_kwin_dpms_manager::org_kde_kwin_dpms_manager()
        : m_org_kde_kwin_dpms_manager(nullptr)
    {
    }

    org_kde_kwin_dpms_manager::~org_kde_kwin_dpms_manager()
    {
    }

    void org_kde_kwin_dpms_manager::init(struct ::wl_registry *registry, int id, int version)
    {
        m_org_kde_kwin_dpms_manager = static_cast<struct ::org_kde_kwin_dpms_manager *>(wlRegistryBind(registry, id, &org_kde_kwin_dpms_manager_interface, version));
    }

    void org_kde_kwin_dpms_manager::init(struct ::org_kde_kwin_dpms_manager *obj)
    {
        m_org_kde_kwin_dpms_manager = obj;
    }

    org_kde_kwin_dpms_manager *org_kde_kwin_dpms_manager::fromObject(struct ::org_kde_kwin_dpms_manager *object)
    {
        return static_cast<org_kde_kwin_dpms_manager *>(org_kde_kwin_dpms_manager_get_user_data(object));
    }

    bool org_kde_kwin_dpms_manager::isInitialized() const
    {
        return m_org_kde_kwin_dpms_manager != nullptr;
    }

    const struct wl_interface *org_kde_kwin_dpms_manager::interface()
    {
        return &::org_kde_kwin_dpms_manager_interface;
    }

    struct ::org_kde_kwin_dpms *org_kde_kwin_dpms_manager::get(struct ::wl_output *output)
    {
        return org_kde_kwin_dpms_manager_get(
            m_org_kde_kwin_dpms_manager,
            output);
    }

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

    org_kde_kwin_dpms::org_kde_kwin_dpms(struct ::org_kde_kwin_dpms *obj)
        : m_org_kde_kwin_dpms(obj)
    {
        init_listener();
    }

    org_kde_kwin_dpms::org_kde_kwin_dpms()
        : m_org_kde_kwin_dpms(nullptr)
    {
    }

    org_kde_kwin_dpms::~org_kde_kwin_dpms()
    {
    }

    void org_kde_kwin_dpms::init(struct ::wl_registry *registry, int id, int version)
    {
        m_org_kde_kwin_dpms = static_cast<struct ::org_kde_kwin_dpms *>(wlRegistryBind(registry, id, &org_kde_kwin_dpms_interface, version));
        init_listener();
    }

    void org_kde_kwin_dpms::init(struct ::org_kde_kwin_dpms *obj)
    {
        m_org_kde_kwin_dpms = obj;
        init_listener();
    }

    org_kde_kwin_dpms *org_kde_kwin_dpms::fromObject(struct ::org_kde_kwin_dpms *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_org_kde_kwin_dpms_listener)
            return nullptr;
        return static_cast<org_kde_kwin_dpms *>(org_kde_kwin_dpms_get_user_data(object));
    }

    bool org_kde_kwin_dpms::isInitialized() const
    {
        return m_org_kde_kwin_dpms != nullptr;
    }

    const struct wl_interface *org_kde_kwin_dpms::interface()
    {
        return &::org_kde_kwin_dpms_interface;
    }

    void org_kde_kwin_dpms::set(uint32_t mode)
    {
        org_kde_kwin_dpms_set(
            m_org_kde_kwin_dpms,
            mode);
    }

    void org_kde_kwin_dpms::release()
    {
        org_kde_kwin_dpms_release(
            m_org_kde_kwin_dpms);
        m_org_kde_kwin_dpms = nullptr;
    }

    void org_kde_kwin_dpms::org_kde_kwin_dpms_supported(uint32_t )
    {
    }

    void org_kde_kwin_dpms::handle_supported(
        void *data,
        struct ::org_kde_kwin_dpms *object,
        uint32_t supported)
    {
        Q_UNUSED(object);
        static_cast<org_kde_kwin_dpms *>(data)->org_kde_kwin_dpms_supported(
            supported);
    }

    void org_kde_kwin_dpms::org_kde_kwin_dpms_mode(uint32_t )
    {
    }

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

    void org_kde_kwin_dpms::org_kde_kwin_dpms_done()
    {
    }

    void org_kde_kwin_dpms::handle_done(
        void *data,
        struct ::org_kde_kwin_dpms *object)
    {
        Q_UNUSED(object);
        static_cast<org_kde_kwin_dpms *>(data)->org_kde_kwin_dpms_done();
    }

    const struct org_kde_kwin_dpms_listener org_kde_kwin_dpms::m_org_kde_kwin_dpms_listener = {
        org_kde_kwin_dpms::handle_supported,
        org_kde_kwin_dpms::handle_mode,
        org_kde_kwin_dpms::handle_done,
    };

    void org_kde_kwin_dpms::init_listener()
    {
        org_kde_kwin_dpms_add_listener(m_org_kde_kwin_dpms, &m_org_kde_kwin_dpms_listener, this);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
