diff options
author | crupest <crupest@outlook.com> | 2020-04-05 23:35:15 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-04-05 23:35:15 +0800 |
commit | 41e17e281ba31e9eff612017f5a2dafd847278b0 (patch) | |
tree | f0736679652abbfa1beeef3aa3d7dabfae8da0b9 /src | |
parent | e9590859b1aaa1c2bf4714893daf34fbfd4166fd (diff) | |
download | cru-41e17e281ba31e9eff612017f5a2dafd847278b0.tar.gz cru-41e17e281ba31e9eff612017f5a2dafd847278b0.tar.bz2 cru-41e17e281ba31e9eff612017f5a2dafd847278b0.zip |
...
Diffstat (limited to 'src')
-rw-r--r-- | src/win/native/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/win/native/input_method.cpp | 12 | ||||
-rw-r--r-- | src/win/native/ui_application.cpp | 6 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/win/native/CMakeLists.txt b/src/win/native/CMakeLists.txt index 521b32cf..ba4b3387 100644 --- a/src/win/native/CMakeLists.txt +++ b/src/win/native/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(cru_win_native STATIC target_sources(cru_win_native PUBLIC ${CRU_WIN_NATIVE_INCLUDE_DIR}/cursor.hpp ${CRU_WIN_NATIVE_INCLUDE_DIR}/exception.hpp + ${CRU_WIN_NATIVE_INCLUDE_DIR}/base.hpp ${CRU_WIN_NATIVE_INCLUDE_DIR}/god_window.hpp ${CRU_WIN_NATIVE_INCLUDE_DIR}/input_method.hpp ${CRU_WIN_NATIVE_INCLUDE_DIR}/keyboard.hpp @@ -32,4 +33,5 @@ target_sources(cru_win_native PUBLIC ${CRU_WIN_NATIVE_INCLUDE_DIR}/window_native_message_event_args.hpp ${CRU_WIN_NATIVE_INCLUDE_DIR}/window_render_target.hpp ) +target_link_libraries(cru_win_native PUBLIC imm32) target_link_libraries(cru_win_native PUBLIC cru_win_graph_direct cru_platform_native) diff --git a/src/win/native/input_method.cpp b/src/win/native/input_method.cpp index adadf8e2..4a125e8d 100644 --- a/src/win/native/input_method.cpp +++ b/src/win/native/input_method.cpp @@ -1,6 +1,7 @@ #include "cru/win/native/input_method.hpp" #include "cru/common/logger.hpp" +#include "cru/platform/check.hpp" #include "cru/win/exception.hpp" #include "cru/win/native/window.hpp" #include "cru/win/string.hpp" @@ -100,4 +101,15 @@ void WinInputMethodContextRef::OnWindowNativeMessage( } } } + +WinInputMethodManager::WinInputMethodManager(WinUiApplication*) {} + +WinInputMethodManager::~WinInputMethodManager() {} + +std::unique_ptr<IInputMethodContextRef> WinInputMethodManager::GetContext( + INativeWindow* window) { + Expects(window); + const auto w = CheckPlatform<WinNativeWindow>(window, GetPlatformId()); + return std::make_unique<WinInputMethodContextRef>(w); +} } // namespace cru::platform::native::win diff --git a/src/win/native/ui_application.cpp b/src/win/native/ui_application.cpp index 80460b29..7fba6805 100644 --- a/src/win/native/ui_application.cpp +++ b/src/win/native/ui_application.cpp @@ -7,6 +7,7 @@ #include "cru/win/native/cursor.hpp" #include "cru/win/native/exception.hpp" #include "cru/win/native/god_window.hpp" +#include "cru/win/native/input_method.hpp" #include "cru/win/native/window.hpp" #include "god_window_message.hpp" #include "timer.hpp" @@ -32,6 +33,7 @@ WinUiApplication::WinUiApplication() { timer_manager_ = std::make_unique<TimerManager>(god_window_.get()); window_manager_ = std::make_unique<WindowManager>(this); cursor_manager_ = std::make_unique<WinCursorManager>(); + input_method_manager_ = std::make_unique<WinInputMethodManager>(this); } WinUiApplication::~WinUiApplication() { instance = nullptr; } @@ -108,4 +110,8 @@ cru::platform::graph::IGraphFactory* WinUiApplication::GetGraphFactory() { ICursorManager* WinUiApplication::GetCursorManager() { return cursor_manager_.get(); } + +IInputMethodManager* WinUiApplication::GetInputMethodManager() { + return input_method_manager_.get(); +} } // namespace cru::platform::native::win |