diff options
Diffstat (limited to 'src/win/gui')
-rw-r--r-- | src/win/gui/Clipboard.cpp | 2 | ||||
-rw-r--r-- | src/win/gui/Cursor.cpp | 4 | ||||
-rw-r--r-- | src/win/gui/GodWindow.cpp | 4 | ||||
-rw-r--r-- | src/win/gui/InputMethod.cpp | 22 | ||||
-rw-r--r-- | src/win/gui/UiApplication.cpp | 2 | ||||
-rw-r--r-- | src/win/gui/Window.cpp | 12 |
6 files changed, 23 insertions, 23 deletions
diff --git a/src/win/gui/Clipboard.cpp b/src/win/gui/Clipboard.cpp index 6bb5d1c5..7ecc9dea 100644 --- a/src/win/gui/Clipboard.cpp +++ b/src/win/gui/Clipboard.cpp @@ -1,6 +1,6 @@ #include "cru/win/gui/Clipboard.h" #include <winuser.h> -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/win/gui/GodWindow.h" #include "cru/win/gui/UiApplication.h" diff --git a/src/win/gui/Cursor.cpp b/src/win/gui/Cursor.cpp index 1d421b59..d85ba565 100644 --- a/src/win/gui/Cursor.cpp +++ b/src/win/gui/Cursor.cpp @@ -1,6 +1,6 @@ #include "cru/win/gui/Cursor.h" -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/win/gui/Exception.h" #include <stdexcept> @@ -16,7 +16,7 @@ WinCursor::~WinCursor() { if (!::DestroyCursor(handle_)) { // This is not a fetal error but might still need notice because it may // cause leak. - log::TagWarn(log_tag, u"Failed to destroy a cursor. Last error code: {}", + CRU_LOG_WARN(u"Failed to destroy a cursor. Last error code: {}", ::GetLastError()); } } diff --git a/src/win/gui/GodWindow.cpp b/src/win/gui/GodWindow.cpp index 0c385bea..4416870f 100644 --- a/src/win/gui/GodWindow.cpp +++ b/src/win/gui/GodWindow.cpp @@ -1,6 +1,6 @@ #include "cru/win/gui/GodWindow.h" -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/win/gui/Exception.h" #include "cru/win/gui/UiApplication.h" #include "cru/win/gui/WindowClass.h" @@ -43,7 +43,7 @@ GodWindow::GodWindow(WinUiApplication* application) { GodWindow::~GodWindow() { if (!::DestroyWindow(hwnd_)) { // Although this could be "safely" ignore. - log::TagWarn(log_tag, u"Failed to destroy god window."); + CRU_LOG_WARN(u"Failed to destroy god window."); } } 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; diff --git a/src/win/gui/UiApplication.cpp b/src/win/gui/UiApplication.cpp index 59076a9c..8c2dfae7 100644 --- a/src/win/gui/UiApplication.cpp +++ b/src/win/gui/UiApplication.cpp @@ -2,7 +2,7 @@ #include "TimerManager.h" #include "WindowManager.h" -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/platform/Check.h" #include "cru/win/DebugLogger.h" #include "cru/win/StdOutLogger.h" diff --git a/src/win/gui/Window.cpp b/src/win/gui/Window.cpp index ada3d59f..9c86441e 100644 --- a/src/win/gui/Window.cpp +++ b/src/win/gui/Window.cpp @@ -1,7 +1,7 @@ #include "cru/win/gui/Window.h" #include "WindowManager.h" -#include "cru/common/Logger.h" +#include "cru/common/log/Logger.h" #include "cru/platform/Check.h" #include "cru/platform/graphics/NullPainter.h" #include "cru/platform/gui/Base.h" @@ -207,7 +207,7 @@ bool WinNativeWindow::ReleaseMouse() { void WinNativeWindow::RequestRepaint() { if constexpr (DebugFlags::paint) { - log::TagDebug(log_tag, u"A repaint is requested."); + CRU_LOG_DEBUG(u"A repaint is requested."); } if (!::InvalidateRect(hwnd_, nullptr, FALSE)) throw Win32Error(::GetLastError(), u"Failed to invalidate window."); @@ -234,7 +234,7 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) { if (!::SetClassLongPtrW(hwnd_, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(cursor_->GetHandle()))) { - log::TagWarn(log_tag, + CRU_LOG_WARN( u"Failed to set cursor because failed to set class long. Last " u"error code: {}.", ::GetLastError()); @@ -244,8 +244,8 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) { if (GetVisibility() != WindowVisibilityType::Show) return; auto lg = [](StringView reason) { - log::TagWarn( - log_tag, + CRU_LOG_WARN( + u"Failed to set cursor because {} when window is visible. (We need to " u"update cursor if it is inside the window.) Last error code: {}.", reason, ::GetLastError()); @@ -507,7 +507,7 @@ void WinNativeWindow::OnPaintInternal() { paint_event_.Raise(nullptr); ValidateRect(hwnd_, nullptr); if constexpr (DebugFlags::paint) { - log::TagDebug(log_tag, u"A repaint is finished."); + CRU_LOG_DEBUG(u"A repaint is finished."); } } |