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

#include <QtWaylandClient/private/wayland-wayland-client-protocol.h>
#include <QtWaylandClient/private/qwayland-text-input-unstable-v2.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_v2::zwp_text_input_v2(struct ::wl_registry *registry, uint32_t id, int version)
    {
        init(registry, id, version);
    }

    zwp_text_input_v2::zwp_text_input_v2(struct ::zwp_text_input_v2 *obj)
        : m_zwp_text_input_v2(obj)
    {
        init_listener();
    }

    zwp_text_input_v2::zwp_text_input_v2()
        : m_zwp_text_input_v2(nullptr)
    {
    }

    zwp_text_input_v2::~zwp_text_input_v2()
    {
    }

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

    void zwp_text_input_v2::init(struct ::zwp_text_input_v2 *obj)
    {
        m_zwp_text_input_v2 = obj;
        init_listener();
    }

    zwp_text_input_v2 *zwp_text_input_v2::fromObject(struct ::zwp_text_input_v2 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_zwp_text_input_v2_listener)
            return nullptr;
        return static_cast<zwp_text_input_v2 *>(zwp_text_input_v2_get_user_data(object));
    }

    bool zwp_text_input_v2::isInitialized() const
    {
        return m_zwp_text_input_v2 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_v2::interface()
    {
        return &::zwp_text_input_v2_interface;
    }

    void zwp_text_input_v2::destroy()
    {
        ::zwp_text_input_v2_destroy(
            m_zwp_text_input_v2);
        m_zwp_text_input_v2 = nullptr;
    }

    void zwp_text_input_v2::enable(struct ::wl_surface *surface)
    {
        ::zwp_text_input_v2_enable(
            m_zwp_text_input_v2,
            surface);
    }

    void zwp_text_input_v2::disable(struct ::wl_surface *surface)
    {
        ::zwp_text_input_v2_disable(
            m_zwp_text_input_v2,
            surface);
    }

    void zwp_text_input_v2::show_input_panel()
    {
        ::zwp_text_input_v2_show_input_panel(
            m_zwp_text_input_v2);
    }

    void zwp_text_input_v2::hide_input_panel()
    {
        ::zwp_text_input_v2_hide_input_panel(
            m_zwp_text_input_v2);
    }

    void zwp_text_input_v2::set_surrounding_text(const QString &text, int32_t cursor, int32_t anchor)
    {
        ::zwp_text_input_v2_set_surrounding_text(
            m_zwp_text_input_v2,
            text.toUtf8().constData(),
            cursor,
            anchor);
    }

    void zwp_text_input_v2::set_content_type(uint32_t hint, uint32_t purpose)
    {
        ::zwp_text_input_v2_set_content_type(
            m_zwp_text_input_v2,
            hint,
            purpose);
    }

    void zwp_text_input_v2::set_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height)
    {
        ::zwp_text_input_v2_set_cursor_rectangle(
            m_zwp_text_input_v2,
            x,
            y,
            width,
            height);
    }

    void zwp_text_input_v2::set_preferred_language(const QString &language)
    {
        ::zwp_text_input_v2_set_preferred_language(
            m_zwp_text_input_v2,
            language.toUtf8().constData());
    }

    void zwp_text_input_v2::update_state(uint32_t serial, uint32_t reason)
    {
        ::zwp_text_input_v2_update_state(
            m_zwp_text_input_v2,
            serial,
            reason);
    }

    void zwp_text_input_v2::zwp_text_input_v2_enter(uint32_t , struct ::wl_surface *)
    {
    }

    void zwp_text_input_v2::handle_enter(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t serial,
        struct ::wl_surface *surface)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_enter(
            serial,
            surface);
    }

    void zwp_text_input_v2::zwp_text_input_v2_leave(uint32_t , struct ::wl_surface *)
    {
    }

    void zwp_text_input_v2::handle_leave(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t serial,
        struct ::wl_surface *surface)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_leave(
            serial,
            surface);
    }

    void zwp_text_input_v2::zwp_text_input_v2_input_panel_state(uint32_t , int32_t , int32_t , int32_t , int32_t )
    {
    }

    void zwp_text_input_v2::handle_input_panel_state(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t state,
        int32_t x,
        int32_t y,
        int32_t width,
        int32_t height)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_input_panel_state(
            state,
            x,
            y,
            width,
            height);
    }

    void zwp_text_input_v2::zwp_text_input_v2_preedit_string(const QString &, const QString &)
    {
    }

    void zwp_text_input_v2::handle_preedit_string(
        void *data,
        struct ::zwp_text_input_v2 *object,
        const char *text,
        const char *commit)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_preedit_string(
            QString::fromUtf8(text),
            QString::fromUtf8(commit));
    }

    void zwp_text_input_v2::zwp_text_input_v2_preedit_styling(uint32_t , uint32_t , uint32_t )
    {
    }

    void zwp_text_input_v2::handle_preedit_styling(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t index,
        uint32_t length,
        uint32_t style)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_preedit_styling(
            index,
            length,
            style);
    }

    void zwp_text_input_v2::zwp_text_input_v2_preedit_cursor(int32_t )
    {
    }

    void zwp_text_input_v2::handle_preedit_cursor(
        void *data,
        struct ::zwp_text_input_v2 *object,
        int32_t index)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_preedit_cursor(
            index);
    }

    void zwp_text_input_v2::zwp_text_input_v2_commit_string(const QString &)
    {
    }

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

    void zwp_text_input_v2::zwp_text_input_v2_cursor_position(int32_t , int32_t )
    {
    }

    void zwp_text_input_v2::handle_cursor_position(
        void *data,
        struct ::zwp_text_input_v2 *object,
        int32_t index,
        int32_t anchor)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_cursor_position(
            index,
            anchor);
    }

    void zwp_text_input_v2::zwp_text_input_v2_delete_surrounding_text(uint32_t , uint32_t )
    {
    }

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

    void zwp_text_input_v2::zwp_text_input_v2_modifiers_map(wl_array *)
    {
    }

    void zwp_text_input_v2::handle_modifiers_map(
        void *data,
        struct ::zwp_text_input_v2 *object,
        wl_array *map)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_modifiers_map(
            map);
    }

    void zwp_text_input_v2::zwp_text_input_v2_keysym(uint32_t , uint32_t , uint32_t , uint32_t )
    {
    }

    void zwp_text_input_v2::handle_keysym(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t time,
        uint32_t sym,
        uint32_t state,
        uint32_t modifiers)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_keysym(
            time,
            sym,
            state,
            modifiers);
    }

    void zwp_text_input_v2::zwp_text_input_v2_language(const QString &)
    {
    }

    void zwp_text_input_v2::handle_language(
        void *data,
        struct ::zwp_text_input_v2 *object,
        const char *language)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_language(
            QString::fromUtf8(language));
    }

    void zwp_text_input_v2::zwp_text_input_v2_text_direction(uint32_t )
    {
    }

    void zwp_text_input_v2::handle_text_direction(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t direction)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_text_direction(
            direction);
    }

    void zwp_text_input_v2::zwp_text_input_v2_configure_surrounding_text(int32_t , int32_t )
    {
    }

    void zwp_text_input_v2::handle_configure_surrounding_text(
        void *data,
        struct ::zwp_text_input_v2 *object,
        int32_t before_cursor,
        int32_t after_cursor)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_configure_surrounding_text(
            before_cursor,
            after_cursor);
    }

    void zwp_text_input_v2::zwp_text_input_v2_input_method_changed(uint32_t , uint32_t )
    {
    }

    void zwp_text_input_v2::handle_input_method_changed(
        void *data,
        struct ::zwp_text_input_v2 *object,
        uint32_t serial,
        uint32_t flags)
    {
        Q_UNUSED(object);
        static_cast<zwp_text_input_v2 *>(data)->zwp_text_input_v2_input_method_changed(
            serial,
            flags);
    }

    const struct zwp_text_input_v2_listener zwp_text_input_v2::m_zwp_text_input_v2_listener = {
        zwp_text_input_v2::handle_enter,
        zwp_text_input_v2::handle_leave,
        zwp_text_input_v2::handle_input_panel_state,
        zwp_text_input_v2::handle_preedit_string,
        zwp_text_input_v2::handle_preedit_styling,
        zwp_text_input_v2::handle_preedit_cursor,
        zwp_text_input_v2::handle_commit_string,
        zwp_text_input_v2::handle_cursor_position,
        zwp_text_input_v2::handle_delete_surrounding_text,
        zwp_text_input_v2::handle_modifiers_map,
        zwp_text_input_v2::handle_keysym,
        zwp_text_input_v2::handle_language,
        zwp_text_input_v2::handle_text_direction,
        zwp_text_input_v2::handle_configure_surrounding_text,
        zwp_text_input_v2::handle_input_method_changed,
    };

    void zwp_text_input_v2::init_listener()
    {
        zwp_text_input_v2_add_listener(m_zwp_text_input_v2, &m_zwp_text_input_v2_listener, this);
    }

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

    zwp_text_input_manager_v2::zwp_text_input_manager_v2(struct ::zwp_text_input_manager_v2 *obj)
        : m_zwp_text_input_manager_v2(obj)
    {
    }

    zwp_text_input_manager_v2::zwp_text_input_manager_v2()
        : m_zwp_text_input_manager_v2(nullptr)
    {
    }

    zwp_text_input_manager_v2::~zwp_text_input_manager_v2()
    {
    }

    void zwp_text_input_manager_v2::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_zwp_text_input_manager_v2 = static_cast<struct ::zwp_text_input_manager_v2 *>(wlRegistryBind(registry, id, &zwp_text_input_manager_v2_interface, version));
    }

    void zwp_text_input_manager_v2::init(struct ::zwp_text_input_manager_v2 *obj)
    {
        m_zwp_text_input_manager_v2 = obj;
    }

    zwp_text_input_manager_v2 *zwp_text_input_manager_v2::fromObject(struct ::zwp_text_input_manager_v2 *object)
    {
        return static_cast<zwp_text_input_manager_v2 *>(zwp_text_input_manager_v2_get_user_data(object));
    }

    bool zwp_text_input_manager_v2::isInitialized() const
    {
        return m_zwp_text_input_manager_v2 != nullptr;
    }

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

    const struct wl_interface *zwp_text_input_manager_v2::interface()
    {
        return &::zwp_text_input_manager_v2_interface;
    }

    void zwp_text_input_manager_v2::destroy()
    {
        ::zwp_text_input_manager_v2_destroy(
            m_zwp_text_input_manager_v2);
        m_zwp_text_input_manager_v2 = nullptr;
    }

    struct ::zwp_text_input_v2 *zwp_text_input_manager_v2::get_text_input(struct ::wl_seat *seat)
    {
        return ::zwp_text_input_manager_v2_get_text_input(
            m_zwp_text_input_manager_v2,
            seat);
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
