#include "ui/ozone/platform/wayland/host/zwp_text_input_wrapper_v3.h"
#include <string>
#include <utility>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/notimplemented.h"
#include "base/numerics/safe_conversions.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 {
uint32_t InputTypeToContentPurpose(TextInputType input_type) { … }
uint32_t InputFlagsToContentHint(int input_flags) { … }
}
ZWPTextInputWrapperV3::ZWPTextInputWrapperV3(
WaylandConnection* connection,
ZWPTextInputWrapperClient* client,
zwp_text_input_manager_v3* text_input_manager)
: … { … }
ZWPTextInputWrapperV3::~ZWPTextInputWrapperV3() = default;
void ZWPTextInputWrapperV3::Reset() { … }
void ZWPTextInputWrapperV3::Activate(WaylandWindow* window,
TextInputClient::FocusReason reason) { … }
void ZWPTextInputWrapperV3::Deactivate() { … }
void ZWPTextInputWrapperV3::ShowInputPanel() { … }
void ZWPTextInputWrapperV3::HideInputPanel() { … }
void ZWPTextInputWrapperV3::SetCursorRect(const gfx::Rect& rect) { … }
void ZWPTextInputWrapperV3::SendCursorRect(const gfx::Rect& rect) { … }
void ZWPTextInputWrapperV3::SetSurroundingText(
const std::string& text_with_preedit,
const gfx::Range& preedit_range,
const gfx::Range& selection_range) { … }
void ZWPTextInputWrapperV3::SendSurroundingText(
const SetSurroundingTextData& data) { … }
void ZWPTextInputWrapperV3::SetContentType(ui::TextInputType type,
ui::TextInputMode mode,
uint32_t flags,
bool should_do_learning,
bool can_compose_inline) { … }
void ZWPTextInputWrapperV3::SendContentType(const ContentType& content_type) { … }
void ZWPTextInputWrapperV3::ApplyPendingSetRequests() { … }
void ZWPTextInputWrapperV3::ResetPendingSetRequests() { … }
void ZWPTextInputWrapperV3::ResetLastSentValues() { … }
void ZWPTextInputWrapperV3::ResetPendingInputEvents() { … }
void ZWPTextInputWrapperV3::Commit() { … }
void ZWPTextInputWrapperV3::OnEnter(void* data,
struct zwp_text_input_v3* text_input,
struct wl_surface* surface) { … }
void ZWPTextInputWrapperV3::OnLeave(void* data,
struct zwp_text_input_v3* text_input,
struct wl_surface* surface) { … }
void ZWPTextInputWrapperV3::OnPreeditString(
void* data,
struct zwp_text_input_v3* text_input,
const char* text,
int32_t cursor_begin,
int32_t cursor_end) { … }
void ZWPTextInputWrapperV3::OnCommitString(void* data,
struct zwp_text_input_v3* text_input,
const char* text) { … }
void ZWPTextInputWrapperV3::OnDeleteSurroundingText(
void* data,
struct zwp_text_input_v3* text_input,
uint32_t before_length,
uint32_t after_length) { … }
void ZWPTextInputWrapperV3::OnDone(void* data,
struct zwp_text_input_v3* text_input,
uint32_t serial) { … }
bool ZWPTextInputWrapperV3::HasAdvancedSurroundingTextSupport() const { … }
void ZWPTextInputWrapperV3::SetSurroundingTextOffsetUtf16(
uint32_t offset_utf16) { … }
void ZWPTextInputWrapperV3::SetGrammarFragmentAtCursor(
const ui::GrammarFragment& fragment) { … }
void ZWPTextInputWrapperV3::SetAutocorrectInfo(
const gfx::Range& autocorrect_range,
const gfx::Rect& autocorrect_bounds) { … }
}