From a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 7 Sep 2025 11:46:11 +0800 Subject: Use std::string in logger. --- src/platform/gui/win/InputMethod.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/platform/gui/win/InputMethod.cpp') 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* 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; -- cgit v1.2.3