#include "ui/gtk/input_method_context_impl_gtk.h"
#include <cstddef>
#include "base/strings/utf_string_conversions.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/composition_text.h"
#include "ui/base/ime/linux/composition_text_util_pango.h"
#include "ui/base/ime/text_input_client.h"
#include "ui/base/ime/text_input_flags.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gtk/gtk_compat.h"
#include "ui/gtk/gtk_ui.h"
#include "ui/gtk/gtk_ui_platform.h"
#include "ui/gtk/gtk_util.h"
#include "ui/linux/linux_ui.h"
namespace gtk {
namespace {
GdkEventKey* GdkEventToKey(GdkEvent* event) { … }
GdkWindow* GetTargetWindow(const ui::KeyEvent& key_event) { … }
GdkEvent* GdkEventFromImeKeyEvent(const ui::KeyEvent& key_event) { … }
}
InputMethodContextImplGtk::InputMethodContextImplGtk(
ui::LinuxInputMethodContextDelegate* delegate)
: … { … }
InputMethodContextImplGtk::~InputMethodContextImplGtk() { … }
bool InputMethodContextImplGtk::DispatchKeyEvent(
const ui::KeyEvent& key_event) { … }
bool InputMethodContextImplGtk::IsPeekKeyEvent(const ui::KeyEvent& key_event) { … }
void InputMethodContextImplGtk::Reset() { … }
void InputMethodContextImplGtk::UpdateFocus(
bool has_client,
ui::TextInputType old_type,
const TextInputClientAttributes& new_client_attributes,
ui::TextInputClient::FocusReason reason) { … }
void InputMethodContextImplGtk::SetCursorLocation(const gfx::Rect& rect) { … }
void InputMethodContextImplGtk::SetSurroundingText(
const std::u16string& text,
const gfx::Range& text_range,
const gfx::Range& composition_range,
const gfx::Range& selection_range,
const std::optional<ui::GrammarFragment>& fragment,
const std::optional<ui::AutocorrectInfo>& autocorrect) { … }
void InputMethodContextImplGtk::OnCommit(GtkIMContext* context, gchar* text) { … }
void InputMethodContextImplGtk::OnPreeditChanged(GtkIMContext* context) { … }
void InputMethodContextImplGtk::OnPreeditEnd(GtkIMContext* context) { … }
void InputMethodContextImplGtk::OnPreeditStart(GtkIMContext* context) { … }
void InputMethodContextImplGtk::SetContextClientWindow(
GdkWindow* window,
GtkIMContext* gtk_context) { … }
ui::VirtualKeyboardController*
InputMethodContextImplGtk::GetVirtualKeyboardController() { … }
GtkIMContext* InputMethodContextImplGtk::GetIMContext() { … }
}