chromium/ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v1.h"

#include <sys/mman.h>

#include <string>
#include <string_view>
#include <utility>

#include "base/base64.h"
#include "base/check.h"
#include "base/files/file_util.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/time/time.h"
#include "ui/base/wayland/wayland_client_input_types.h"
#include "ui/gfx/range/range.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_seat.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"

namespace ui {
namespace {

// Converts Chrome's TextInputType into wayland's content_purpose.
// Some of TextInputType values do not have clearly corresponding wayland value,
// and they fallback to closer type.
uint32_t InputTypeToContentPurpose(TextInputType input_type) {}

// Converts Chrome's TextInputType into wayland's content_hint.
uint32_t InputFlagsToContentHint(int input_flags) {}

// Parses the content of |array|, and creates a map of modifiers.
// The content of array is just a concat of modifier names in c-style string
// (i.e., '\0' terminated string), thus this splits the whole byte array by
// '\0' character.
std::vector<std::string> ParseModifiersMap(wl_array* array) {}

// Returns ImeTextSpan style to be assigned. Maybe nullopt if it is not
// supported.
std::optional<ZWPTextInputWrapperClient::SpanStyle::Style> ConvertStyle(
    uint32_t style) {}

}  // namespace

ZWPTextInputWrapperV1::ZWPTextInputWrapperV1(
    WaylandConnection* connection,
    ZWPTextInputWrapperClient* client,
    zwp_text_input_manager_v1* text_input_manager,
    zcr_text_input_extension_v1* text_input_extension)
    :{}

ZWPTextInputWrapperV1::~ZWPTextInputWrapperV1() = default;

void ZWPTextInputWrapperV1::Reset() {}

void ZWPTextInputWrapperV1::Activate(WaylandWindow* window,
                                     TextInputClient::FocusReason reason) {}

void ZWPTextInputWrapperV1::Deactivate() {}

void ZWPTextInputWrapperV1::ShowInputPanel() {}

void ZWPTextInputWrapperV1::HideInputPanel() {}

void ZWPTextInputWrapperV1::SetCursorRect(const gfx::Rect& rect) {}

void ZWPTextInputWrapperV1::SetSurroundingText(
    const std::string& text,
    const gfx::Range& preedit_range,
    const gfx::Range& selection_range) {}

bool ZWPTextInputWrapperV1::HasAdvancedSurroundingTextSupport() const {}

void ZWPTextInputWrapperV1::SetSurroundingTextOffsetUtf16(
    uint32_t offset_utf16) {}

void ZWPTextInputWrapperV1::SetContentType(ui::TextInputType type,
                                           ui::TextInputMode mode,
                                           uint32_t flags,
                                           bool should_do_learning,
                                           bool can_compose_inline) {}

void ZWPTextInputWrapperV1::SetGrammarFragmentAtCursor(
    const ui::GrammarFragment& fragment) {}

void ZWPTextInputWrapperV1::SetAutocorrectInfo(
    const gfx::Range& autocorrect_range,
    const gfx::Rect& autocorrect_bounds) {}

void ZWPTextInputWrapperV1::ResetInputEventState() {}

void ZWPTextInputWrapperV1::TryScheduleFinalizeVirtualKeyboardChanges() {}

void ZWPTextInputWrapperV1::FinalizeVirtualKeyboardChanges() {}

bool ZWPTextInputWrapperV1::SupportsFinalizeVirtualKeyboardChanges() {}

// static
void ZWPTextInputWrapperV1::OnEnter(void* data,
                                    struct zwp_text_input_v1* text_input,
                                    struct wl_surface* surface) {}

// static
void ZWPTextInputWrapperV1::OnLeave(void* data,
                                    struct zwp_text_input_v1* text_input) {}

// static
void ZWPTextInputWrapperV1::OnModifiersMap(void* data,
                                           struct zwp_text_input_v1* text_input,
                                           struct wl_array* map) {}

// static
void ZWPTextInputWrapperV1::OnInputPanelState(
    void* data,
    struct zwp_text_input_v1* text_input,
    uint32_t state) {}

// static
void ZWPTextInputWrapperV1::OnPreeditString(
    void* data,
    struct zwp_text_input_v1* text_input,
    uint32_t serial,
    const char* text,
    const char* commit) {}

// static
void ZWPTextInputWrapperV1::OnPreeditStyling(
    void* data,
    struct zwp_text_input_v1* text_input,
    uint32_t index,
    uint32_t length,
    uint32_t style) {}

// static
void ZWPTextInputWrapperV1::OnPreeditCursor(
    void* data,
    struct zwp_text_input_v1* text_input,
    int32_t index) {}

// static
void ZWPTextInputWrapperV1::OnCommitString(void* data,
                                           struct zwp_text_input_v1* text_input,
                                           uint32_t serial,
                                           const char* text) {}

// static
void ZWPTextInputWrapperV1::OnCursorPosition(
    void* data,
    struct zwp_text_input_v1* text_input,
    int32_t index,
    int32_t anchor) {}

// static
void ZWPTextInputWrapperV1::OnDeleteSurroundingText(
    void* data,
    struct zwp_text_input_v1* text_input,
    int32_t index,
    uint32_t length) {}

// static
void ZWPTextInputWrapperV1::OnKeysym(void* data,
                                     struct zwp_text_input_v1* text_input,
                                     uint32_t serial,
                                     uint32_t time,
                                     uint32_t key,
                                     uint32_t state,
                                     uint32_t modifiers) {}

// static
void ZWPTextInputWrapperV1::OnLanguage(void* data,
                                       struct zwp_text_input_v1* text_input,
                                       uint32_t serial,
                                       const char* language) {}

// static
void ZWPTextInputWrapperV1::OnTextDirection(
    void* data,
    struct zwp_text_input_v1* text_input,
    uint32_t serial,
    uint32_t direction) {}

// static
void ZWPTextInputWrapperV1::OnSetPreeditRegion(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    int32_t index,
    uint32_t length) {}

// static
void ZWPTextInputWrapperV1::OnClearGrammarFragments(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    uint32_t start,
    uint32_t end) {}

// static
void ZWPTextInputWrapperV1::OnAddGrammarFragment(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    uint32_t start,
    uint32_t end,
    const char* suggestion) {}

// static
void ZWPTextInputWrapperV1::OnSetAutocorrectRange(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    uint32_t start,
    uint32_t end) {}

// static
void ZWPTextInputWrapperV1::OnSetVirtualKeyboardOccludedBounds(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    int32_t x,
    int32_t y,
    int32_t width,
    int32_t height) {}

// static
void ZWPTextInputWrapperV1::OnConfirmPreedit(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    uint32_t selection_behavior) {}

// static
void ZWPTextInputWrapperV1::OnInsertImage(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    const char* src) {}

// static
void ZWPTextInputWrapperV1::OnInsertImageWithLargeURL(
    void* data,
    struct zcr_extended_text_input_v1* extended_text_input,
    const char* mime_type,
    const char* charset,
    const int32_t raw_fd,
    const uint32_t size) {}

}  // namespace ui