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

#include "qwayland-keystate.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_keystate::org_kde_kwin_keystate(struct ::wl_registry *registry, int id, int version)
    {
        init(registry, id, version);
    }

    org_kde_kwin_keystate::org_kde_kwin_keystate(struct ::org_kde_kwin_keystate *obj)
        : m_org_kde_kwin_keystate(obj)
    {
        init_listener();
    }

    org_kde_kwin_keystate::org_kde_kwin_keystate()
        : m_org_kde_kwin_keystate(nullptr)
    {
    }

    org_kde_kwin_keystate::~org_kde_kwin_keystate()
    {
    }

    void org_kde_kwin_keystate::init(struct ::wl_registry *registry, int id, int version)
    {
        m_org_kde_kwin_keystate = static_cast<struct ::org_kde_kwin_keystate *>(wlRegistryBind(registry, id, &org_kde_kwin_keystate_interface, version));
        init_listener();
    }

    void org_kde_kwin_keystate::init(struct ::org_kde_kwin_keystate *obj)
    {
        m_org_kde_kwin_keystate = obj;
        init_listener();
    }

    org_kde_kwin_keystate *org_kde_kwin_keystate::fromObject(struct ::org_kde_kwin_keystate *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_org_kde_kwin_keystate_listener)
            return nullptr;
        return static_cast<org_kde_kwin_keystate *>(org_kde_kwin_keystate_get_user_data(object));
    }

    bool org_kde_kwin_keystate::isInitialized() const
    {
        return m_org_kde_kwin_keystate != nullptr;
    }

    const struct wl_interface *org_kde_kwin_keystate::interface()
    {
        return &::org_kde_kwin_keystate_interface;
    }

    void org_kde_kwin_keystate::fetchStates()
    {
        org_kde_kwin_keystate_fetchStates(
            m_org_kde_kwin_keystate);
    }

    void org_kde_kwin_keystate::org_kde_kwin_keystate_stateChanged(uint32_t , uint32_t )
    {
    }

    void org_kde_kwin_keystate::handle_stateChanged(
        void *data,
        struct ::org_kde_kwin_keystate *object,
        uint32_t key,
        uint32_t state)
    {
        Q_UNUSED(object);
        static_cast<org_kde_kwin_keystate *>(data)->org_kde_kwin_keystate_stateChanged(
            key,
            state);
    }

    const struct org_kde_kwin_keystate_listener org_kde_kwin_keystate::m_org_kde_kwin_keystate_listener = {
        org_kde_kwin_keystate::handle_stateChanged,
    };

    void org_kde_kwin_keystate::init_listener()
    {
        org_kde_kwin_keystate_add_listener(m_org_kde_kwin_keystate, &m_org_kde_kwin_keystate_listener, this);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
