aboutsummaryrefslogtreecommitdiff
path: root/src/platform/gui/win
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/gui/win')
-rw-r--r--src/platform/gui/win/Clipboard.cpp16
-rw-r--r--src/platform/gui/win/Cursor.cpp2
-rw-r--r--src/platform/gui/win/GodWindow.cpp2
-rw-r--r--src/platform/gui/win/InputMethod.cpp20
-rw-r--r--src/platform/gui/win/Window.cpp10
5 files changed, 25 insertions, 25 deletions
diff --git a/src/platform/gui/win/Clipboard.cpp b/src/platform/gui/win/Clipboard.cpp
index a0914a0b..9e305d1c 100644
--- a/src/platform/gui/win/Clipboard.cpp
+++ b/src/platform/gui/win/Clipboard.cpp
@@ -13,25 +13,25 @@ String WinClipboard::GetText() {
auto god_window = application_->GetGodWindow();
if (!::OpenClipboard(god_window->GetHandle())) {
- CRU_LOG_WARN(u"Failed to open clipboard.");
+ CRU_LOG_TAG_WARN(u"Failed to open clipboard.");
return {};
}
if (!::IsClipboardFormatAvailable(CF_UNICODETEXT)) {
- CRU_LOG_WARN(u"Clipboard format for text is not available.");
+ CRU_LOG_TAG_WARN(u"Clipboard format for text is not available.");
return {};
}
auto handle = ::GetClipboardData(CF_UNICODETEXT);
if (handle == nullptr) {
- CRU_LOG_WARN(u"Failed to get clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to get clipboard data.");
return {};
}
auto ptr = ::GlobalLock(handle);
if (ptr == nullptr) {
- CRU_LOG_WARN(u"Failed to lock clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to lock clipboard data.");
::CloseClipboard();
return {};
}
@@ -48,21 +48,21 @@ void WinClipboard::SetText(String text) {
auto god_window = application_->GetGodWindow();
if (!::OpenClipboard(god_window->GetHandle())) {
- CRU_LOG_WARN(u"Failed to open clipboard.");
+ CRU_LOG_TAG_WARN(u"Failed to open clipboard.");
return;
}
auto handle = GlobalAlloc(GMEM_MOVEABLE, (text.size() + 1) * sizeof(wchar_t));
if (handle == nullptr) {
- CRU_LOG_WARN(u"Failed to allocate clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to allocate clipboard data.");
::CloseClipboard();
return;
}
auto ptr = ::GlobalLock(handle);
if (ptr == nullptr) {
- CRU_LOG_WARN(u"Failed to lock clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to lock clipboard data.");
::GlobalFree(handle);
::CloseClipboard();
return;
@@ -73,7 +73,7 @@ void WinClipboard::SetText(String text) {
::GlobalUnlock(handle);
if (::SetClipboardData(CF_UNICODETEXT, handle) == nullptr) {
- CRU_LOG_WARN(u"Failed to set clipboard data.");
+ CRU_LOG_TAG_WARN(u"Failed to set clipboard data.");
}
::CloseClipboard();
diff --git a/src/platform/gui/win/Cursor.cpp b/src/platform/gui/win/Cursor.cpp
index d7692c2d..e6cce5b9 100644
--- a/src/platform/gui/win/Cursor.cpp
+++ b/src/platform/gui/win/Cursor.cpp
@@ -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.
- CRU_LOG_WARN(u"Failed to destroy a cursor. Last error code: {}",
+ CRU_LOG_TAG_WARN(u"Failed to destroy a cursor. Last error code: {}",
::GetLastError());
}
}
diff --git a/src/platform/gui/win/GodWindow.cpp b/src/platform/gui/win/GodWindow.cpp
index 364688e5..c969df8f 100644
--- a/src/platform/gui/win/GodWindow.cpp
+++ b/src/platform/gui/win/GodWindow.cpp
@@ -43,7 +43,7 @@ GodWindow::GodWindow(WinUiApplication* application) {
GodWindow::~GodWindow() {
if (!::DestroyWindow(hwnd_)) {
// Although this could be "safely" ignore.
- CRU_LOG_WARN(u"Failed to destroy god window.");
+ CRU_LOG_TAG_WARN(u"Failed to destroy god window.");
}
}
diff --git a/src/platform/gui/win/InputMethod.cpp b/src/platform/gui/win/InputMethod.cpp
index 44b5681d..306dc3fa 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_WARN(u"Failed to release HIMC.");
+ CRU_LOG_TAG_WARN(u"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_WARN(u"Failed to enable ime.");
+ CRU_LOG_TAG_WARN(u"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_WARN(u"Failed to disable ime.");
+ CRU_LOG_TAG_WARN(u"Failed to disable ime.");
}
}
void WinInputMethodContext::CompleteComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_COMPLETE, 0)) {
- CRU_LOG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN(u"Failed to complete composition.");
}
}
void WinInputMethodContext::CancelComposition() {
auto himc = GetHIMC();
if (!::ImmNotifyIME(himc.Get(), NI_COMPOSITIONSTR, CPS_CANCEL, 0)) {
- CRU_LOG_WARN(u"Failed to complete composition.");
+ CRU_LOG_TAG_WARN(u"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_DEBUG(u"Failed to set input method candidate window position.");
+ CRU_LOG_TAG_DEBUG(u"Failed to set input method candidate window position.");
}
IEvent<std::nullptr_t>* WinInputMethodContext::CompositionStartEvent() {
@@ -227,7 +227,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.
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"A WM_CHAR message for character from supplementary "
u"planes is ignored.");
} else {
@@ -245,7 +245,7 @@ void WinInputMethodContext::OnWindowNativeMessage(
composition_event_.Raise(nullptr);
auto composition_text = GetCompositionText();
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}",
+ CRU_LOG_TAG_DEBUG(u"WM_IME_COMPOSITION composition text:\n{}",
composition_text);
}
if (message.l_param & GCS_RESULTSTR) {
@@ -256,14 +256,14 @@ void WinInputMethodContext::OnWindowNativeMessage(
}
case WM_IME_STARTCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_STARTCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG(u"WM_IME_STARTCOMPOSITION received.");
}
composition_start_event_.Raise(nullptr);
break;
}
case WM_IME_ENDCOMPOSITION: {
if constexpr (DebugFlags::input_method) {
- CRU_LOG_DEBUG(u"WM_IME_ENDCOMPOSITION received.");
+ CRU_LOG_TAG_DEBUG(u"WM_IME_ENDCOMPOSITION received.");
}
composition_end_event_.Raise(nullptr);
break;
diff --git a/src/platform/gui/win/Window.cpp b/src/platform/gui/win/Window.cpp
index 47ca93f8..690e56de 100644
--- a/src/platform/gui/win/Window.cpp
+++ b/src/platform/gui/win/Window.cpp
@@ -207,7 +207,7 @@ bool WinNativeWindow::ReleaseMouse() {
void WinNativeWindow::RequestRepaint() {
if constexpr (DebugFlags::paint) {
- CRU_LOG_DEBUG(u"A repaint is requested.");
+ CRU_LOG_TAG_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()))) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_WARN(
u"Failed to set cursor because failed to set class long. Last "
u"error code: {}.",
::GetLastError());
@@ -244,7 +244,7 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) {
if (GetVisibility() != WindowVisibilityType::Show) return;
auto lg = [](StringView reason) {
- CRU_LOG_WARN(
+ CRU_LOG_TAG_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: {}.",
@@ -477,7 +477,7 @@ void WinNativeWindow::RecreateWindow() {
if (dpi == 0)
throw Win32Error(::GetLastError(), u"Failed to get dpi of window.");
dpi_ = static_cast<float>(dpi);
- CRU_LOG_DEBUG(u"Dpi of window is {}.", dpi_);
+ CRU_LOG_TAG_DEBUG(u"Dpi of window is {}.", dpi_);
window_manager->RegisterWindow(hwnd_, this);
@@ -507,7 +507,7 @@ void WinNativeWindow::OnPaintInternal() {
paint_event_.Raise(nullptr);
ValidateRect(hwnd_, nullptr);
if constexpr (DebugFlags::paint) {
- CRU_LOG_DEBUG(u"A repaint is finished.");
+ CRU_LOG_TAG_DEBUG(u"A repaint is finished.");
}
}