// This file was generated by qtwaylandscanner
// source file is qt-text-input-method-unstable-v1.xml

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

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

    qt_text_input_method_v1::qt_text_input_method_v1(struct ::qt_text_input_method_v1 *obj)
        : m_qt_text_input_method_v1(obj)
    {
        init_listener();
    }

    qt_text_input_method_v1::qt_text_input_method_v1()
        : m_qt_text_input_method_v1(nullptr)
    {
    }

    qt_text_input_method_v1::~qt_text_input_method_v1()
    {
    }

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

    void qt_text_input_method_v1::init(struct ::qt_text_input_method_v1 *obj)
    {
        m_qt_text_input_method_v1 = obj;
        init_listener();
    }

    qt_text_input_method_v1 *qt_text_input_method_v1::fromObject(struct ::qt_text_input_method_v1 *object)
    {
        if (wl_proxy_get_listener((struct ::wl_proxy *)object) != (void *)&m_qt_text_input_method_v1_listener)
            return nullptr;
        return static_cast<qt_text_input_method_v1 *>(qt_text_input_method_v1_get_user_data(object));
    }

    bool qt_text_input_method_v1::isInitialized() const
    {
        return m_qt_text_input_method_v1 != nullptr;
    }

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

    const struct wl_interface *qt_text_input_method_v1::interface()
    {
        return &::qt_text_input_method_v1_interface;
    }

    void qt_text_input_method_v1::destroy()
    {
        ::qt_text_input_method_v1_destroy(
            m_qt_text_input_method_v1);
        m_qt_text_input_method_v1 = nullptr;
    }

    void qt_text_input_method_v1::enable(struct ::wl_surface *surface)
    {
        ::qt_text_input_method_v1_enable(
            m_qt_text_input_method_v1,
            surface);
    }

    void qt_text_input_method_v1::disable(struct ::wl_surface *surface)
    {
        ::qt_text_input_method_v1_disable(
            m_qt_text_input_method_v1,
            surface);
    }

    void qt_text_input_method_v1::reset()
    {
        ::qt_text_input_method_v1_reset(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::commit()
    {
        ::qt_text_input_method_v1_commit(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::invoke_action(int32_t type, int32_t cursor_position)
    {
        ::qt_text_input_method_v1_invoke_action(
            m_qt_text_input_method_v1,
            type,
            cursor_position);
    }

    void qt_text_input_method_v1::update_hints(int32_t hints)
    {
        ::qt_text_input_method_v1_update_hints(
            m_qt_text_input_method_v1,
            hints);
    }

    void qt_text_input_method_v1::update_cursor_rectangle(int32_t x, int32_t y, int32_t width, int32_t height)
    {
        ::qt_text_input_method_v1_update_cursor_rectangle(
            m_qt_text_input_method_v1,
            x,
            y,
            width,
            height);
    }

    void qt_text_input_method_v1::update_cursor_position(int32_t cursor_position)
    {
        ::qt_text_input_method_v1_update_cursor_position(
            m_qt_text_input_method_v1,
            cursor_position);
    }

    void qt_text_input_method_v1::update_surrounding_text(const QString &surrounding_text, int32_t text_offset)
    {
        ::qt_text_input_method_v1_update_surrounding_text(
            m_qt_text_input_method_v1,
            surrounding_text.toUtf8().constData(),
            text_offset);
    }

    void qt_text_input_method_v1::update_anchor_position(int32_t anchor_position)
    {
        ::qt_text_input_method_v1_update_anchor_position(
            m_qt_text_input_method_v1,
            anchor_position);
    }

    void qt_text_input_method_v1::update_absolute_position(int32_t absolute_position)
    {
        ::qt_text_input_method_v1_update_absolute_position(
            m_qt_text_input_method_v1,
            absolute_position);
    }

    void qt_text_input_method_v1::update_preferred_language(const QString &preferred_language)
    {
        ::qt_text_input_method_v1_update_preferred_language(
            m_qt_text_input_method_v1,
            preferred_language.toUtf8().constData());
    }

    void qt_text_input_method_v1::start_update(int32_t queries)
    {
        ::qt_text_input_method_v1_start_update(
            m_qt_text_input_method_v1,
            queries);
    }

    void qt_text_input_method_v1::end_update()
    {
        ::qt_text_input_method_v1_end_update(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::show_input_panel()
    {
        ::qt_text_input_method_v1_show_input_panel(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::hide_input_panel()
    {
        ::qt_text_input_method_v1_hide_input_panel(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::acknowledge_input_method()
    {
        ::qt_text_input_method_v1_acknowledge_input_method(
            m_qt_text_input_method_v1);
    }

    void qt_text_input_method_v1::text_input_method_v1_enter(struct ::wl_surface *)
    {
    }

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

    void qt_text_input_method_v1::text_input_method_v1_leave(struct ::wl_surface *)
    {
    }

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

    void qt_text_input_method_v1::text_input_method_v1_key(int32_t , int32_t , int32_t , int32_t , int32_t , int32_t , int32_t , int32_t , const QString &)
    {
    }

    void qt_text_input_method_v1::handle_key(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        int32_t type,
        int32_t key,
        int32_t modifiers,
        int32_t auto_repeat,
        int32_t count,
        int32_t native_scan_code,
        int32_t native_virtual_key,
        int32_t native_modifiers,
        const char *text)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_key(
            type,
            key,
            modifiers,
            auto_repeat,
            count,
            native_scan_code,
            native_virtual_key,
            native_modifiers,
            QString::fromUtf8(text));
    }

    void qt_text_input_method_v1::text_input_method_v1_start_input_method_event(uint32_t , int32_t )
    {
    }

    void qt_text_input_method_v1::handle_start_input_method_event(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        uint32_t serial,
        int32_t surrounding_text_offset)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_start_input_method_event(
            serial,
            surrounding_text_offset);
    }

    void qt_text_input_method_v1::text_input_method_v1_input_method_event_attribute(uint32_t , int32_t , int32_t , int32_t , const QString &)
    {
    }

    void qt_text_input_method_v1::handle_input_method_event_attribute(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        uint32_t serial,
        int32_t type,
        int32_t start,
        int32_t length,
        const char *value)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_input_method_event_attribute(
            serial,
            type,
            start,
            length,
            QString::fromUtf8(value));
    }

    void qt_text_input_method_v1::text_input_method_v1_end_input_method_event(uint32_t , const QString &, const QString &, int32_t , int32_t )
    {
    }

    void qt_text_input_method_v1::handle_end_input_method_event(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        uint32_t serial,
        const char *commit_string,
        const char *preedit_string,
        int32_t replacement_start,
        int32_t replacement_length)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_end_input_method_event(
            serial,
            QString::fromUtf8(commit_string),
            QString::fromUtf8(preedit_string),
            replacement_start,
            replacement_length);
    }

    void qt_text_input_method_v1::text_input_method_v1_visible_changed(int32_t )
    {
    }

    void qt_text_input_method_v1::handle_visible_changed(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        int32_t visible)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_visible_changed(
            visible);
    }

    void qt_text_input_method_v1::text_input_method_v1_keyboard_rectangle_changed(wl_fixed_t , wl_fixed_t , wl_fixed_t , wl_fixed_t )
    {
    }

    void qt_text_input_method_v1::handle_keyboard_rectangle_changed(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        wl_fixed_t x,
        wl_fixed_t y,
        wl_fixed_t width,
        wl_fixed_t height)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_keyboard_rectangle_changed(
            x,
            y,
            width,
            height);
    }

    void qt_text_input_method_v1::text_input_method_v1_locale_changed(const QString &)
    {
    }

    void qt_text_input_method_v1::handle_locale_changed(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        const char *locale_name)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_locale_changed(
            QString::fromUtf8(locale_name));
    }

    void qt_text_input_method_v1::text_input_method_v1_input_direction_changed(int32_t )
    {
    }

    void qt_text_input_method_v1::handle_input_direction_changed(
        void *data,
        struct ::qt_text_input_method_v1 *object,
        int32_t input_direction)
    {
        Q_UNUSED(object);
        static_cast<qt_text_input_method_v1 *>(data)->text_input_method_v1_input_direction_changed(
            input_direction);
    }

    const struct qt_text_input_method_v1_listener qt_text_input_method_v1::m_qt_text_input_method_v1_listener = {
        qt_text_input_method_v1::handle_enter,
        qt_text_input_method_v1::handle_leave,
        qt_text_input_method_v1::handle_key,
        qt_text_input_method_v1::handle_start_input_method_event,
        qt_text_input_method_v1::handle_input_method_event_attribute,
        qt_text_input_method_v1::handle_end_input_method_event,
        qt_text_input_method_v1::handle_visible_changed,
        qt_text_input_method_v1::handle_keyboard_rectangle_changed,
        qt_text_input_method_v1::handle_locale_changed,
        qt_text_input_method_v1::handle_input_direction_changed,
    };

    void qt_text_input_method_v1::init_listener()
    {
        qt_text_input_method_v1_add_listener(m_qt_text_input_method_v1, &m_qt_text_input_method_v1_listener, this);
    }

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

    qt_text_input_method_manager_v1::qt_text_input_method_manager_v1(struct ::qt_text_input_method_manager_v1 *obj)
        : m_qt_text_input_method_manager_v1(obj)
    {
    }

    qt_text_input_method_manager_v1::qt_text_input_method_manager_v1()
        : m_qt_text_input_method_manager_v1(nullptr)
    {
    }

    qt_text_input_method_manager_v1::~qt_text_input_method_manager_v1()
    {
    }

    void qt_text_input_method_manager_v1::init(struct ::wl_registry *registry, uint32_t id, int version)
    {
        m_qt_text_input_method_manager_v1 = static_cast<struct ::qt_text_input_method_manager_v1 *>(wlRegistryBind(registry, id, &qt_text_input_method_manager_v1_interface, version));
    }

    void qt_text_input_method_manager_v1::init(struct ::qt_text_input_method_manager_v1 *obj)
    {
        m_qt_text_input_method_manager_v1 = obj;
    }

    qt_text_input_method_manager_v1 *qt_text_input_method_manager_v1::fromObject(struct ::qt_text_input_method_manager_v1 *object)
    {
        return static_cast<qt_text_input_method_manager_v1 *>(qt_text_input_method_manager_v1_get_user_data(object));
    }

    bool qt_text_input_method_manager_v1::isInitialized() const
    {
        return m_qt_text_input_method_manager_v1 != nullptr;
    }

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

    const struct wl_interface *qt_text_input_method_manager_v1::interface()
    {
        return &::qt_text_input_method_manager_v1_interface;
    }

    void qt_text_input_method_manager_v1::destroy()
    {
        ::qt_text_input_method_manager_v1_destroy(
            m_qt_text_input_method_manager_v1);
        m_qt_text_input_method_manager_v1 = nullptr;
    }

    struct ::qt_text_input_method_v1 *qt_text_input_method_manager_v1::get_text_input_method(struct ::wl_seat *seat)
    {
        struct ::qt_text_input_method_v1 * id = ::qt_text_input_method_manager_v1_get_text_input_method(
            m_qt_text_input_method_manager_v1,
            seat);
        return id;
    }
}

QT_WARNING_POP
QT_END_NAMESPACE
