diff --git a/ci/licenses_golden/licenses_flutter b/ci/licenses_golden/licenses_flutter index a2cc16781ef02..03d9753e74c47 100644 --- a/ci/licenses_golden/licenses_flutter +++ b/ci/licenses_golden/licenses_flutter @@ -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 diff --git a/shell/platform/windows/BUILD.gn b/shell/platform/windows/BUILD.gn index ad4d4ee8e3135..86c4190972f05 100644 --- a/shell/platform/windows/BUILD.gn +++ b/shell/platform/windows/BUILD.gn @@ -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", @@ -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", diff --git a/shell/platform/windows/text_input_manager.cc b/shell/platform/windows/text_input_manager_win32.cc similarity index 81% rename from shell/platform/windows/text_input_manager.cc rename to shell/platform/windows/text_input_manager_win32.cc index 9e9cfb7ae0639..d18fe20ed76ca 100644 --- a/shell/platform/windows/text_input_manager.cc +++ b/shell/platform/windows/text_input_manager_win32.cc @@ -6,7 +6,7 @@ // 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 @@ -14,11 +14,11 @@ 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; } @@ -35,7 +35,7 @@ void TextInputManager::CreateImeWindow() { UpdateImeWindow(); } -void TextInputManager::DestroyImeWindow() { +void TextInputManagerWin32::DestroyImeWindow() { if (window_handle_ == nullptr) { return; } @@ -47,7 +47,7 @@ void TextInputManager::DestroyImeWindow() { ime_active_ = false; } -void TextInputManager::UpdateImeWindow() { +void TextInputManagerWin32::UpdateImeWindow() { if (window_handle_ == nullptr) { return; } @@ -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) { @@ -74,7 +74,7 @@ void TextInputManager::UpdateCaretRect(const Rect& rect) { } } -long TextInputManager::GetComposingCursorPosition() const { +long TextInputManagerWin32::GetComposingCursorPosition() const { if (window_handle_ == nullptr) { return false; } @@ -90,15 +90,16 @@ long TextInputManager::GetComposingCursorPosition() const { return -1; } -std::optional TextInputManager::GetComposingString() const { +std::optional TextInputManagerWin32::GetComposingString() + const { return GetString(GCS_COMPSTR); } -std::optional TextInputManager::GetResultString() const { +std::optional TextInputManagerWin32::GetResultString() const { return GetString(GCS_RESULTSTR); } -std::optional TextInputManager::GetString(int type) const { +std::optional TextInputManagerWin32::GetString(int type) const { if (window_handle_ == nullptr || !ime_active_) { return std::nullopt; } @@ -121,7 +122,7 @@ std::optional 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; } diff --git a/shell/platform/windows/text_input_manager.h b/shell/platform/windows/text_input_manager_win32.h similarity index 93% rename from shell/platform/windows/text_input_manager.h rename to shell/platform/windows/text_input_manager_win32.h index cf21809f4e8c2..33c3b6d3c78c3 100644 --- a/shell/platform/windows/text_input_manager.h +++ b/shell/platform/windows/text_input_manager_win32.h @@ -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); diff --git a/shell/platform/windows/win32_window.h b/shell/platform/windows/win32_window.h index b1366877cb80d..bd51d386fcec7 100644 --- a/shell/platform/windows/win32_window.h +++ b/shell/platform/windows/win32_window.h @@ -11,7 +11,7 @@ #include #include -#include "flutter/shell/platform/windows/text_input_manager.h" +#include "flutter/shell/platform/windows/text_input_manager_win32.h" namespace flutter { @@ -183,7 +183,7 @@ class Win32Window { int keycode_for_char_message_ = 0; protected: - TextInputManager text_input_manager_; + TextInputManagerWin32 text_input_manager_; }; } // namespace flutter