aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/win/native/CMakeLists.txt2
-rw-r--r--src/win/native/input_method.cpp12
-rw-r--r--src/win/native/ui_application.cpp6
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