Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1497,8 +1497,8 @@ FILE: ../../../flutter/shell/platform/windows/task_runner_win32.cc
FILE: ../../../flutter/shell/platform/windows/task_runner_win32.h
FILE: ../../../flutter/shell/platform/windows/task_runner_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/task_runner_winuwp.h
FILE: ../../../flutter/shell/platform/windows/text_input_manager.cc
FILE: ../../../flutter/shell/platform/windows/text_input_manager.h
FILE: ../../../flutter/shell/platform/windows/text_input_manager_win32.cc
FILE: ../../../flutter/shell/platform/windows/text_input_manager_win32.h
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.cc
FILE: ../../../flutter/shell/platform/windows/text_input_plugin.h
FILE: ../../../flutter/shell/platform/windows/text_input_plugin_delegate.h
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ source_set("flutter_windows_source") {
"string_conversion.h",
"system_utils.h",
"task_runner.h",
"text_input_manager.cc",
"text_input_manager.h",
"text_input_plugin.cc",
"text_input_plugin.h",
"window_binding_handler.h",
Expand All @@ -95,6 +93,8 @@ source_set("flutter_windows_source") {
"system_utils_win32.cc",
"task_runner_win32.cc",
"task_runner_win32.h",
"text_input_manager_win32.cc",
"text_input_manager_win32.h",
"win32_dpi_utils.cc",
"win32_dpi_utils.h",
"win32_flutter_window.cc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "flutter/shell/platform/windows/text_input_manager.h"
#include "flutter/shell/platform/windows/text_input_manager_win32.h"

#include <imm.h>

#include <memory>

namespace flutter {

void TextInputManager::SetWindowHandle(HWND window_handle) {
void TextInputManagerWin32::SetWindowHandle(HWND window_handle) {
window_handle_ = window_handle;
}

void TextInputManager::CreateImeWindow() {
void TextInputManagerWin32::CreateImeWindow() {
if (window_handle_ == nullptr) {
return;
}
Expand All @@ -35,7 +35,7 @@ void TextInputManager::CreateImeWindow() {
UpdateImeWindow();
}

void TextInputManager::DestroyImeWindow() {
void TextInputManagerWin32::DestroyImeWindow() {
if (window_handle_ == nullptr) {
return;
}
Expand All @@ -47,7 +47,7 @@ void TextInputManager::DestroyImeWindow() {
ime_active_ = false;
}

void TextInputManager::UpdateImeWindow() {
void TextInputManagerWin32::UpdateImeWindow() {
if (window_handle_ == nullptr) {
return;
}
Expand All @@ -59,7 +59,7 @@ void TextInputManager::UpdateImeWindow() {
}
}

void TextInputManager::UpdateCaretRect(const Rect& rect) {
void TextInputManagerWin32::UpdateCaretRect(const Rect& rect) {
caret_rect_ = rect;

if (window_handle_ == nullptr) {
Expand All @@ -74,7 +74,7 @@ void TextInputManager::UpdateCaretRect(const Rect& rect) {
}
}

long TextInputManager::GetComposingCursorPosition() const {
long TextInputManagerWin32::GetComposingCursorPosition() const {
if (window_handle_ == nullptr) {
return false;
}
Expand All @@ -90,15 +90,16 @@ long TextInputManager::GetComposingCursorPosition() const {
return -1;
}

std::optional<std::u16string> TextInputManager::GetComposingString() const {
std::optional<std::u16string> TextInputManagerWin32::GetComposingString()
const {
return GetString(GCS_COMPSTR);
}

std::optional<std::u16string> TextInputManager::GetResultString() const {
std::optional<std::u16string> TextInputManagerWin32::GetResultString() const {
return GetString(GCS_RESULTSTR);
}

std::optional<std::u16string> TextInputManager::GetString(int type) const {
std::optional<std::u16string> TextInputManagerWin32::GetString(int type) const {
if (window_handle_ == nullptr || !ime_active_) {
return std::nullopt;
}
Expand All @@ -121,7 +122,7 @@ std::optional<std::u16string> TextInputManager::GetString(int type) const {
return std::nullopt;
}

void TextInputManager::MoveImeWindow(HIMC imm_context) {
void TextInputManagerWin32::MoveImeWindow(HIMC imm_context) {
if (GetFocus() != window_handle_ || !ime_active_) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ namespace flutter {
// This implementation wraps the Win32 IMM32 APIs and provides a mechanism for
// creating and positioning the IME window, a system caret, and the candidates
// list as well as for accessing composing and results string contents.
class TextInputManager {
class TextInputManagerWin32 {
public:
TextInputManager() noexcept = default;
~TextInputManager() = default;
TextInputManagerWin32() noexcept = default;
~TextInputManagerWin32() = default;

TextInputManager(const TextInputManager&) = delete;
TextInputManager& operator=(const TextInputManager&) = delete;
TextInputManagerWin32(const TextInputManagerWin32&) = delete;
TextInputManagerWin32& operator=(const TextInputManagerWin32&) = delete;

// Sets the window handle with which the IME is associated.
void SetWindowHandle(HWND window_handle);
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/windows/win32_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <memory>
#include <string>

#include "flutter/shell/platform/windows/text_input_manager.h"
#include "flutter/shell/platform/windows/text_input_manager_win32.h"

namespace flutter {

Expand Down Expand Up @@ -183,7 +183,7 @@ class Win32Window {
int keycode_for_char_message_ = 0;

protected:
TextInputManager text_input_manager_;
TextInputManagerWin32 text_input_manager_;
};

} // namespace flutter
Expand Down