// This file was generated by qtwaylandscanner
// source file is /build/qt6-wayland/src/qtwayland-everywhere-src-6.3.0/src/client/../3rdparty/protocol/text-input-unstable-v4-wip.xml

#include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
#include <QtWaylandClient/private/qwayland-text-input-unstable-v4-wip.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;
    return (void *) wl_proxy_marshal_constructor_versioned((struct wl_proxy *) registry,
    bindOpCode, interface, version, name, interface->name, version, nullptr);
}

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

    zwp_text_input_v4::zwp_text_input_v4(struct ::zwp_text_input_v4 *obj)
        : m_zwp_text_input_v4(obj)
    {
        init_listener();
    }

    zwp_text_input_v4::zwp_text_input_v4()
        : m_zwp_text_input_v4(nullptr)
    {
    }

    zwp_text_input_v4::~zwp_text_input_v4()
    {
    }

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

    void zwp_text_input_v4::init(struct ::zwp_text_input_v4 *obj)
    {
        m_zwp_text_input_v4 = obj;
        init_listener();
    }

    zwp_text_input_v4 *zwp_text_input_v4::fromObject(struct ::zwp_text_input_v4 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_zwp_text_input_v4_listener)
            return nullptr;
        return static_cast<zwp_text_input_v4 *>(zwp_text_input_v4_get_user_data(object));
    }

    bool zwp_text_input_v4::isInitialized() const
    {
        return m_zwp_text_input_v4 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_v4::interface()
    {
        return &::zwp_text_input_v4_interface;
    }

    void zwp_text_input_v4::destroy()
    {
        ::zwp_text_input_v4_destroy(
            m_zwp_text_input_v4);
        m_zwp_text_input_v4 = nullptr;
    }

    void zwp_text_input_v4::enable()
    {
        ::zwp_text_input_v4_enable(
            m_zwp_text_input_v4);
    }

    void zwp_text_input_v4::disable()
    {
        ::zwp_text_input_v4_disable(
            m_zwp_text_input_v4);
    }

    void zwp_text_input_v4::set_surrounding_text(const QString &text, int32_t cursor, int32_t anchor)
    {
        ::zwp_text_input_v4_set_surrounding_text(
            m_zwp_text_input_v4,
            text.toUtf8().constData(),
            cursor,
            anchor);
    }

    void zwp_text_input_v4::set_text_change_cause(uint32_t cause)
    {
        ::zwp_text_input_v4_set_text_change_cause(
            m_zwp_text_input_v4,
            cause);
    }

    void zwp_text_input_v4::set_content_type(uint32_t hint, uint32_t purpose)
    {
        ::zwp_text_input_v4_set_content_type(
            m_zwp_text_input_v4,
            hint,
            purpose);
    }

    void zwp_text_input_v4::set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height)
    {
        ::zwp_text_input_v4_set_cursor_rectangle(
            m_zwp_text_input_v4,
            x,
            y,
            width,
            height);
    }

    void zwp_text_input_v4::commit()
    {
        ::zwp_text_input_v4_commit(
            m_zwp_text_input_v4);
    }

    void zwp_text_input_v4::zwp_text_input_v4_enter(struct ::wl_surface *)
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_leave(struct ::wl_surface *)
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_preedit_string(const QString &, int32_t , int32_t )
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_commit_string(const QString &)
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_delete_surrounding_text(uint32_t , uint32_t )
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_done(uint32_t )
    {
    }

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

    void zwp_text_input_v4::zwp_text_input_v4_preedit_commit_mode(uint32_t )
    {
    }

    void zwp_text_input_v4::handle_preedit_commit_mode(
        void *data,
        struct ::zwp_text_input_v4 *object,
        uint32_t mode)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v4 *>(data)->zwp_text_input_v4_preedit_commit_mode(
            mode);
    }

    const struct zwp_text_input_v4_listener zwp_text_input_v4::m_zwp_text_input_v4_listener = {
        zwp_text_input_v4::handle_enter,
        zwp_text_input_v4::handle_leave,
        zwp_text_input_v4::handle_preedit_string,
        zwp_text_input_v4::handle_commit_string,
        zwp_text_input_v4::handle_delete_surrounding_text,
        zwp_text_input_v4::handle_done,
        zwp_text_input_v4::handle_preedit_commit_mode,
    };

    void zwp_text_input_v4::init_listener()
    {
        zwp_text_input_v4_add_listener(m_zwp_text_input_v4, &m_zwp_text_input_v4_listener, this);
    }

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

    zwp_text_input_manager_v4::zwp_text_input_manager_v4(struct ::zwp_text_input_manager_v4 *obj)
        : m_zwp_text_input_manager_v4(obj)
    {
    }

    zwp_text_input_manager_v4::zwp_text_input_manager_v4()
        : m_zwp_text_input_manager_v4(nullptr)
    {
    }

    zwp_text_input_manager_v4::~zwp_text_input_manager_v4()
    {
    }

    void zwp_text_input_manager_v4::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_zwp_text_input_manager_v4 = static_cast<struct ::zwp_text_input_manager_v4 *>(wlRegistryBind(registry, id, &zwp_text_input_manager_v4_interface, version));
    }

    void zwp_text_input_manager_v4::init(struct ::zwp_text_input_manager_v4 *obj)
    {
        m_zwp_text_input_manager_v4 = obj;
    }

    zwp_text_input_manager_v4 *zwp_text_input_manager_v4::fromObject(struct ::zwp_text_input_manager_v4 *object)
    {
        return static_cast<zwp_text_input_manager_v4 *>(zwp_text_input_manager_v4_get_user_data(object));
    }

    bool zwp_text_input_manager_v4::isInitialized() const
    {
        return m_zwp_text_input_manager_v4 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_manager_v4::interface()
    {
        return &::zwp_text_input_manager_v4_interface;
    }

    void zwp_text_input_manager_v4::destroy()
    {
        ::zwp_text_input_manager_v4_destroy(
            m_zwp_text_input_manager_v4);
        m_zwp_text_input_manager_v4 = nullptr;
    }

    struct ::zwp_text_input_v4 *zwp_text_input_manager_v4::get_text_input(struct ::wl_seat *seat)
    {
        return ::zwp_text_input_manager_v4_get_text_input(
            m_zwp_text_input_manager_v4,
            seat);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
