// This file was generated by qtwaylandscanner
// source file is text-input-unstable-v3.xml

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

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

    zwp_text_input_v3::zwp_text_input_v3(struct ::zwp_text_input_v3 *obj)
        : m_zwp_text_input_v3(obj)
    {
        init_listener();
    }

    zwp_text_input_v3::zwp_text_input_v3()
        : m_zwp_text_input_v3(nullptr)
    {
    }

    zwp_text_input_v3::~zwp_text_input_v3()
    {
    }

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

    void zwp_text_input_v3::init(struct ::zwp_text_input_v3 *obj)
    {
        m_zwp_text_input_v3 = obj;
        init_listener();
    }

    zwp_text_input_v3 *zwp_text_input_v3::fromObject(struct ::zwp_text_input_v3 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_zwp_text_input_v3_listener)
            return nullptr;
        return static_cast<zwp_text_input_v3 *>(zwp_text_input_v3_get_user_data(object));
    }

    bool zwp_text_input_v3::isInitialized() const
    {
        return m_zwp_text_input_v3 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_v3::interface()
    {
        return &::zwp_text_input_v3_interface;
    }

    void zwp_text_input_v3::destroy()
    {
        ::zwp_text_input_v3_destroy(
            m_zwp_text_input_v3);
        m_zwp_text_input_v3 = nullptr;
    }

    void zwp_text_input_v3::enable()
    {
        ::zwp_text_input_v3_enable(
            m_zwp_text_input_v3);
    }

    void zwp_text_input_v3::disable()
    {
        ::zwp_text_input_v3_disable(
            m_zwp_text_input_v3);
    }

    void zwp_text_input_v3::set_surrounding_text(const QString &text, int32_t cursor, int32_t anchor)
    {
        ::zwp_text_input_v3_set_surrounding_text(
            m_zwp_text_input_v3,
            text.toUtf8().constData(),
            cursor,
            anchor);
    }

    void zwp_text_input_v3::set_text_change_cause(uint32_t cause)
    {
        ::zwp_text_input_v3_set_text_change_cause(
            m_zwp_text_input_v3,
            cause);
    }

    void zwp_text_input_v3::set_content_type(uint32_t hint, uint32_t purpose)
    {
        ::zwp_text_input_v3_set_content_type(
            m_zwp_text_input_v3,
            hint,
            purpose);
    }

    void zwp_text_input_v3::set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height)
    {
        ::zwp_text_input_v3_set_cursor_rectangle(
            m_zwp_text_input_v3,
            x,
            y,
            width,
            height);
    }

    void zwp_text_input_v3::commit()
    {
        ::zwp_text_input_v3_commit(
            m_zwp_text_input_v3);
    }

    void zwp_text_input_v3::zwp_text_input_v3_enter(struct ::wl_surface *)
    {
    }

    void zwp_text_input_v3::handle_enter(
        void *data,
        struct ::zwp_text_input_v3 *object,
        struct ::wl_surface *surface)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_enter(
            surface);
    }

    void zwp_text_input_v3::zwp_text_input_v3_leave(struct ::wl_surface *)
    {
    }

    void zwp_text_input_v3::handle_leave(
        void *data,
        struct ::zwp_text_input_v3 *object,
        struct ::wl_surface *surface)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_leave(
            surface);
    }

    void zwp_text_input_v3::zwp_text_input_v3_preedit_string(const QString &, int32_t , int32_t )
    {
    }

    void zwp_text_input_v3::handle_preedit_string(
        void *data,
        struct ::zwp_text_input_v3 *object,
        const char *text,
        int32_t cursor_begin,
        int32_t cursor_end)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_preedit_string(
            QString::fromUtf8(text),
            cursor_begin,
            cursor_end);
    }

    void zwp_text_input_v3::zwp_text_input_v3_commit_string(const QString &)
    {
    }

    void zwp_text_input_v3::handle_commit_string(
        void *data,
        struct ::zwp_text_input_v3 *object,
        const char *text)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_commit_string(
            QString::fromUtf8(text));
    }

    void zwp_text_input_v3::zwp_text_input_v3_delete_surrounding_text(uint32_t , uint32_t )
    {
    }

    void zwp_text_input_v3::handle_delete_surrounding_text(
        void *data,
        struct ::zwp_text_input_v3 *object,
        uint32_t before_length,
        uint32_t after_length)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_delete_surrounding_text(
            before_length,
            after_length);
    }

    void zwp_text_input_v3::zwp_text_input_v3_done(uint32_t )
    {
    }

    void zwp_text_input_v3::handle_done(
        void *data,
        struct ::zwp_text_input_v3 *object,
        uint32_t serial)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v3 *>(data)->zwp_text_input_v3_done(
            serial);
    }

    const struct zwp_text_input_v3_listener zwp_text_input_v3::m_zwp_text_input_v3_listener = {
        zwp_text_input_v3::handle_enter,
        zwp_text_input_v3::handle_leave,
        zwp_text_input_v3::handle_preedit_string,
        zwp_text_input_v3::handle_commit_string,
        zwp_text_input_v3::handle_delete_surrounding_text,
        zwp_text_input_v3::handle_done,
    };

    void zwp_text_input_v3::init_listener()
    {
        zwp_text_input_v3_add_listener(m_zwp_text_input_v3, &m_zwp_text_input_v3_listener, this);
    }

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

    zwp_text_input_manager_v3::zwp_text_input_manager_v3(struct ::zwp_text_input_manager_v3 *obj)
        : m_zwp_text_input_manager_v3(obj)
    {
    }

    zwp_text_input_manager_v3::zwp_text_input_manager_v3()
        : m_zwp_text_input_manager_v3(nullptr)
    {
    }

    zwp_text_input_manager_v3::~zwp_text_input_manager_v3()
    {
    }

    void zwp_text_input_manager_v3::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_zwp_text_input_manager_v3 = static_cast<struct ::zwp_text_input_manager_v3 *>(wlRegistryBind(registry, id, &zwp_text_input_manager_v3_interface, version));
    }

    void zwp_text_input_manager_v3::init(struct ::zwp_text_input_manager_v3 *obj)
    {
        m_zwp_text_input_manager_v3 = obj;
    }

    zwp_text_input_manager_v3 *zwp_text_input_manager_v3::fromObject(struct ::zwp_text_input_manager_v3 *object)
    {
        return static_cast<zwp_text_input_manager_v3 *>(zwp_text_input_manager_v3_get_user_data(object));
    }

    bool zwp_text_input_manager_v3::isInitialized() const
    {
        return m_zwp_text_input_manager_v3 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_manager_v3::interface()
    {
        return &::zwp_text_input_manager_v3_interface;
    }

    void zwp_text_input_manager_v3::destroy()
    {
        ::zwp_text_input_manager_v3_destroy(
            m_zwp_text_input_manager_v3);
        m_zwp_text_input_manager_v3 = nullptr;
    }

    struct ::zwp_text_input_v3 *zwp_text_input_manager_v3::get_text_input(struct ::wl_seat *seat)
    {
        struct ::zwp_text_input_v3 * id = ::zwp_text_input_manager_v3_get_text_input(
            m_zwp_text_input_manager_v3,
            seat);
        return id;
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
