diff options
Diffstat (limited to 'src/platform/gui/win')
-rw-r--r-- | src/platform/gui/win/Clipboard.cpp | 16 | ||||
-rw-r--r-- | src/platform/gui/win/Cursor.cpp | 2 | ||||
-rw-r--r-- | src/platform/gui/win/GodWindow.cpp | 2 | ||||
-rw-r--r-- | src/platform/gui/win/InputMethod.cpp | 24 | ||||
-rw-r--r-- | src/platform/gui/win/Window.cpp | 10 |
5 files changed, 27 insertions, 27 deletions
diff --git a/src/platform/gui/win/Clipboard.cpp b/src/platform/gui/win/Clipboard.cpp index 9e305d1c..5525cb40 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_TAG_WARN(u"Failed to open clipboard."); + CRU_LOG_TAG_WARN("Failed to open clipboard."); return {}; } if (!::IsClipboardFormatAvailable(CF_UNICODETEXT)) { - CRU_LOG_TAG_WARN(u"Clipboard format for text is not available."); + CRU_LOG_TAG_WARN("Clipboard format for text is not available."); return {}; } auto handle = ::GetClipboardData(CF_UNICODETEXT); if (handle == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to get clipboard data."); + CRU_LOG_TAG_WARN("Failed to get clipboard data."); return {}; } auto ptr = ::GlobalLock(handle); if (ptr == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to lock clipboard data."); + CRU_LOG_TAG_WARN("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_TAG_WARN(u"Failed to open clipboard."); + CRU_LOG_TAG_WARN("Failed to open clipboard."); return; } auto handle = GlobalAlloc(GMEM_MOVEABLE, (text.size() + 1) * sizeof(wchar_t)); if (handle == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to allocate clipboard data."); + CRU_LOG_TAG_WARN("Failed to allocate clipboard data."); ::CloseClipboard(); return; } auto ptr = ::GlobalLock(handle); if (ptr == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to lock clipboard data."); + CRU_LOG_TAG_WARN("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_TAG_WARN(u"Failed to set clipboard data."); + CRU_LOG_TAG_WARN("Failed to set clipboard data."); } ::CloseClipboard(); diff --git a/src/platform/gui/win/Cursor.cpp b/src/platform/gui/win/Cursor.cpp index e6cce5b9..24e9c2fc 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_TAG_WARN(u"Failed to destroy a cursor. Last error code: {}", + CRU_LOG_TAG_WARN("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 c969df8f..485eae72 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_TAG_WARN(u"Failed to destroy god window."); + CRU_LOG_TAG_WARN("Failed to destroy god window."); } } 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; diff --git a/src/platform/gui/win/Window.cpp b/src/platform/gui/win/Window.cpp index 690e56de..5bd14323 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_TAG_DEBUG(u"A repaint is requested."); + CRU_LOG_TAG_DEBUG("A repaint is requested."); } if (!::InvalidateRect(hwnd_, nullptr, FALSE)) throw Win32Error(::GetLastError(), u"Failed to invalidate window."); @@ -235,8 +235,8 @@ void WinNativeWindow::SetCursor(std::shared_ptr<ICursor> cursor) { if (!::SetClassLongPtrW(hwnd_, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(cursor_->GetHandle()))) { CRU_LOG_TAG_WARN( - u"Failed to set cursor because failed to set class long. Last " - u"error code: {}.", + "Failed to set cursor because failed to set class long. Last " + "error code: {}.", ::GetLastError()); return; } @@ -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_TAG_DEBUG(u"Dpi of window is {}.", dpi_); + CRU_LOG_TAG_DEBUG("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_TAG_DEBUG(u"A repaint is finished."); + CRU_LOG_TAG_DEBUG("A repaint is finished."); } } |