aboutsummaryrefslogtreecommitdiff
path: root/src/platform/gui/win/InputMethod.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-07 11:46:11 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-07 11:46:11 +0800
commita0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c (patch)
treeb97687f99055b04775b63b7bafd2c909a7074cdb /src/platform/gui/win/InputMethod.cpp
parent20123151d12a0b01453ab6a36c84e4d3e5ea9504 (diff)
downloadcru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.gz
cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.bz2
cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.zip
Use std::string in logger.
Diffstat (limited to 'src/platform/gui/win/InputMethod.cpp')
-rw-r--r--src/platform/gui/win/InputMethod.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/platform/gui/win/InputMethod.cpp b/src/platform/gui/win/InputMethod.cpp
index 306dc3fa..94795c8c 100644
--- a/src/platform/gui/win/InputMethod.cpp
+++ b/src/platform/gui/win/InputMethod.cpp
@@ -35,7 +35,7 @@ AutoHIMC& AutoHIMC::operator=(AutoHIMC&& other) {
AutoHIMC::~AutoHIMC() {
if (handle_) {
if (!::ImmReleaseContext(hwnd_, handle_))
- CRU_LOG_TAG_WARN(u"Failed to release HIMC.");
+ CRU_LOG_TAG_WARN("Failed to release HIMC.");
}
}
@@ -156,7 +156,7 @@ WinInputMethodContext::~WinInputMethodContext() {}
void WinInputMethodContext::EnableIME() {
const auto hwnd = native_window_->GetWindowHandle();
if (::ImmAssociateContextEx(hwnd, nullptr, IACE_DEFAULT) == FALSE) {
- CRU_LOG_TAG_WARN(u"Failed to enable ime.");
+ CRU_LOG_TAG_WARN("Failed to enable ime.");
}
}
@@ -167,21 +167,21 @@ void WinInputMethodContext::DisableIME() {
::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
if (::ImmAssociateContextEx(hwnd, nullptr, 0) == FALSE) {
- CRU_LOG_TAG_WARN(u"Failed to disable ime.");
+ CRU_LOG_TAG_WARN("Failed to disable ime.");
}
}
void WinInputMethodContext::CompleteComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0)) {
- CRU_LOG_TAG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN("Failed to complete composition.");
}
}
void WinInputMethodContext::CancelComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_CANCEL, 0)) {
- CRU_LOG_TAG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN("Failed to complete composition.");
}
}
@@ -200,7 +200,7 @@ void WinInputMethodContext::SetCandidateWindowPosition(const Point& point) {
form.ptCurrentPos = native_window_->DipToPixel(point);
if (!::ImmSetCandidateWindow(himc.Get(), &form))
- CRU_LOG_TAG_DEBUG(u"Failed to set input method candidate window position.");
+ CRU_LOG_TAG_DEBUG("Failed to set input method candidate window position.");
}
IEvent<std::nullptr_t>* WinInputMethodContext::CompositionStartEvent() {
@@ -228,8 +228,8 @@ void WinInputMethodContext::OnWindowNativeMessage(
// should only trigger ascci character. If it is a charater from
// supplementary planes, it should be handled with ime messages.
CRU_LOG_TAG_WARN(
- u"A WM_CHAR message for character from supplementary "
- u"planes is ignored.");
+ "A WM_CHAR message for character from supplementary "
+ "planes is ignored.");
} else {
if (c != '\b') { // ignore backspace
if (c == '\r') c = '\n'; // Change \r to \n
@@ -245,8 +245,8 @@ void WinInputMethodContext::OnWindowNativeMessage(
composition_event_.Raise(nullptr);
auto composition_text = GetCompositionText();
if constexpr (DebugFlags::input_method) {
- CRU_LOG_TAG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}",
- composition_text);
+ CRU_LOG_TAG_DEBUG("WM_IME_COMPOSITION composition text:\n{}",
+ composition_text);
}
if (message.l_param & GCS_RESULTSTR) {
auto result_string = GetResultString();
@@ -256,14 +256,14 @@ void WinInputMethodContext::OnWindowNativeMessage(
}
case WM_IME_STARTCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_TAG_DEBUG(u"WM_IME_STARTCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG("WM_IME_STARTCOMPOSITION received.");
}
composition_start_event_.Raise(nullptr);
break;
}
case WM_IME_ENDCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_TAG_DEBUG(u"WM_IME_ENDCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG("WM_IME_ENDCOMPOSITION received.");
}
composition_end_event_.Raise(nullptr);
break;