diff options
author | crupest <crupest@outlook.com> | 2022-02-21 18:44:40 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-21 18:44:40 +0800 |
commit | ced1a63686e6c64cb574d74a34d1bbd07d0a668e (patch) | |
tree | 4082e4689e5e7cede8d59a0538d0f1ae37064acb /src/win/gui/InputMethod.cpp | |
parent | 6b00fca7c662301bf657a99cb1e89f21541a46bc (diff) | |
download | cru-ced1a63686e6c64cb574d74a34d1bbd07d0a668e.tar.gz cru-ced1a63686e6c64cb574d74a34d1bbd07d0a668e.tar.bz2 cru-ced1a63686e6c64cb574d74a34d1bbd07d0a668e.zip |
...
Diffstat (limited to 'src/win/gui/InputMethod.cpp')
-rw-r--r-- | src/win/gui/InputMethod.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/win/gui/InputMethod.cpp b/src/win/gui/InputMethod.cpp index fedb72fe..8a54577b 100644 --- a/src/win/gui/InputMethod.cpp +++ b/src/win/gui/InputMethod.cpp @@ -1,6 +1,6 @@ #include "cru/win/gui/InputMethod.h" -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/common/StringUtil.h" #include "cru/platform/Check.h" #include "cru/platform/gui/DebugFlags.h" @@ -35,7 +35,7 @@ AutoHIMC& AutoHIMC::operator=(AutoHIMC&& other) { AutoHIMC::~AutoHIMC() { if (handle_) { if (!::ImmReleaseContext(hwnd_, handle_)) - log::TagWarn(log_tag, u"Failed to release HIMC."); + CRU_LOG_WARN(u"Failed to release HIMC."); } } @@ -157,7 +157,7 @@ WinInputMethodContext::~WinInputMethodContext() {} void WinInputMethodContext::EnableIME() { const auto hwnd = native_window_->GetWindowHandle(); if (::ImmAssociateContextEx(hwnd, nullptr, IACE_DEFAULT) == FALSE) { - log::TagWarn(log_tag, u"Failed to enable ime."); + CRU_LOG_WARN(u"Failed to enable ime."); } } @@ -168,21 +168,21 @@ void WinInputMethodContext::DisableIME() { ::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0); if (::ImmAssociateContextEx(hwnd, nullptr, 0) == FALSE) { - log::TagWarn(log_tag, u"Failed to disable ime."); + CRU_LOG_WARN(u"Failed to disable ime."); } } void WinInputMethodContext::CompleteComposition() { auto himc = GetHIMC(); if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0)) { - log::TagWarn(log_tag, u"Failed to complete composition."); + CRU_LOG_WARN(u"Failed to complete composition."); } } void WinInputMethodContext::CancelComposition() { auto himc = GetHIMC(); if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_CANCEL, 0)) { - log::TagWarn(log_tag, u"Failed to complete composition."); + CRU_LOG_WARN(u"Failed to complete composition."); } } @@ -201,7 +201,7 @@ void WinInputMethodContext::SetCandidateWindowPosition(const Point& point) { form.ptCurrentPos = native_window_->DipToPixel(point); if (!::ImmSetCandidateWindow(himc.Get(), &form)) - log::TagDebug(log_tag, + CRU_LOG_DEBUG( u"Failed to set input method candidate window position."); } @@ -229,7 +229,7 @@ void WinInputMethodContext::OnWindowNativeMessage( // I don't think this will happen because normal key strike without ime // should only trigger ascci character. If it is a charater from // supplementary planes, it should be handled with ime messages. - log::TagWarn(log_tag, + CRU_LOG_WARN( u"A WM_CHAR message for character from supplementary " u"planes is ignored."); } else { @@ -247,7 +247,7 @@ void WinInputMethodContext::OnWindowNativeMessage( composition_event_.Raise(nullptr); auto composition_text = GetCompositionText(); if constexpr (DebugFlags::input_method) { - log::TagDebug(log_tag, u"WM_IME_COMPOSITION composition text:\n{}", + CRU_LOG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}", composition_text); } if (message.l_param & GCS_RESULTSTR) { @@ -258,14 +258,14 @@ void WinInputMethodContext::OnWindowNativeMessage( } case WM_IME_STARTCOMPOSITION: { if constexpr (DebugFlags::input_method) { - log::TagDebug(log_tag, u"WM_IME_STARTCOMPOSITION received."); + CRU_LOG_DEBUG(u"WM_IME_STARTCOMPOSITION received."); } composition_start_event_.Raise(nullptr); break; } case WM_IME_ENDCOMPOSITION: { if constexpr (DebugFlags::input_method) { - log::TagDebug(log_tag, u"WM_IME_ENDCOMPOSITION received."); + CRU_LOG_DEBUG(u"WM_IME_ENDCOMPOSITION received."); } composition_end_event_.Raise(nullptr); break; |