From 579e2df81e5e61426acec8085cfa2f09ac1e558c Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Fri, 1 Jun 2012 16:13:01 +0300 Subject: [PATCH] Cosmetics --- Library/ConfigParser.cpp | 8 ++++---- Library/Litestep.cpp | 8 ++++---- Library/MeasureTime.h | 2 +- Library/MeterWindow.cpp | 12 ++++++------ Library/Rainmeter.cpp | 12 ++++++------ Library/System.cpp | 14 +++++++------- Library/System.h | 10 +++++----- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index d501980e..6fae90a6 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -260,8 +260,8 @@ void CConfigParser::SetMultiMonitorVariables(bool reset) if (CSystem::GetMonitorCount() > 0) { - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; for (size_t i = 0, isize = monitors.size(); i < isize; ++i) { @@ -318,8 +318,8 @@ void CConfigParser::SetAutoSelectedMonitorVariables(CMeterWindow* meterWindow) int w1, w2, s1, s2; int screenIndex; - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; // Set X / WIDTH screenIndex = multimonInfo.primary; diff --git a/Library/Litestep.cpp b/Library/Litestep.cpp index f95561b8..8232163d 100644 --- a/Library/Litestep.cpp +++ b/Library/Litestep.cpp @@ -232,13 +232,13 @@ void LogInternal(int nLevel, ULONGLONG elapsed, LPCTSTR pszMessage) void Log(int nLevel, const WCHAR* message) { - struct DELAYED_LogInfo + struct DelayedLogInfo { int level; ULONGLONG elapsed; std::wstring message; }; - static std::list c_LogDelay; + static std::list c_LogDelay; static ULONGLONG startTime = CSystem::GetTickCount64(); ULONGLONG elapsed = CSystem::GetTickCount64() - startTime; @@ -250,7 +250,7 @@ void Log(int nLevel, const WCHAR* message) while (!c_LogDelay.empty()) { - DELAYED_LogInfo& logInfo = c_LogDelay.front(); + DelayedLogInfo& logInfo = c_LogDelay.front(); LogInternal(logInfo.level, logInfo.elapsed, logInfo.message.c_str()); c_LogDelay.erase(c_LogDelay.begin()); @@ -268,7 +268,7 @@ void Log(int nLevel, const WCHAR* message) // Queue the message EnterCriticalSection(&g_CsLogDelay); - DELAYED_LogInfo logInfo = {nLevel, elapsed, message}; + DelayedLogInfo logInfo = {nLevel, elapsed, message}; c_LogDelay.push_back(logInfo); LeaveCriticalSection(&g_CsLogDelay); diff --git a/Library/MeasureTime.h b/Library/MeasureTime.h index 67717a03..e5c3b3bd 100644 --- a/Library/MeasureTime.h +++ b/Library/MeasureTime.h @@ -36,7 +36,7 @@ protected: virtual void UpdateValue(); private: - void TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format, const struct tm* time); + void TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format, const tm* time); std::wstring m_Format; LARGE_INTEGER m_DeltaTime; diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index fd7e451d..fffdce2f 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1450,8 +1450,8 @@ void CMeterWindow::WindowToScreen() float num; int screenx, screeny, screenh, screenw; - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; // Clear position flags m_WindowXScreen = m_WindowYScreen = multimonInfo.primary; // Default to primary screen @@ -1648,8 +1648,8 @@ void CMeterWindow::ScreenToWindow() float num; int screenx, screeny, screenh, screenw; - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; if (monitors.empty()) { @@ -3419,8 +3419,8 @@ LRESULT CMeterWindow::OnCommand(UINT uMsg, WPARAM wParam, LPARAM lParam) } else if (wParam == IDM_SKIN_MONITOR_PRIMARY || wParam >= ID_MONITOR_FIRST && wParam <= ID_MONITOR_LAST) { - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; int screenIndex; bool screenDefined; diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 09cd17a6..e1e3c088 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -2515,8 +2515,8 @@ void CRainmeter::UpdateDesktopWorkArea(bool reset) } else { - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; if (m_OldDesktopWorkAreas.empty()) { @@ -2589,7 +2589,7 @@ void CRainmeter::UpdateDesktopWorkArea(bool reset) if (changed && CSystem::GetWindow()) { - // Update CSystem::MULTIMONITOR_INFO for for work area variables + // Update CSystem::MultiMonitorInfo for for work area variables SendMessageTimeout(CSystem::GetWindow(), WM_SETTINGCHANGE, SPI_SETWORKAREA, 0, SMTO_ABORTIFHUNG, 1000, NULL); } } @@ -2654,7 +2654,7 @@ void CRainmeter::WriteStats(bool bForce) void CRainmeter::ResetStats() { // Set the stats-date string - struct tm* newtime; + tm* newtime; time_t long_time; time(&long_time); newtime = localtime(&long_time); @@ -3051,8 +3051,8 @@ void CRainmeter::CreateMonitorMenu(HMENU monitorMenu, CMeterWindow* meterWindow) // for the "Specified monitor" (@n) if (CSystem::GetMonitorCount() > 0) { - const MULTIMONITOR_INFO& multimonInfo = CSystem::GetMultiMonitorInfo(); - const std::vector& monitors = multimonInfo.monitors; + const MultiMonitorInfo& multimonInfo = CSystem::GetMultiMonitorInfo(); + const std::vector& monitors = multimonInfo.monitors; for (int i = 0, isize = (int)monitors.size(); i < isize; ++i) { diff --git a/Library/System.cpp b/Library/System.cpp index 3f087a94..60b7ae4a 100644 --- a/Library/System.cpp +++ b/Library/System.cpp @@ -42,7 +42,7 @@ enum INTERVAL INTERVAL_RESUME = 1000 }; -MULTIMONITOR_INFO CSystem::c_Monitors = { 0 }; +MultiMonitorInfo CSystem::c_Monitors = { 0 }; HWND CSystem::c_Window = NULL; HWND CSystem::c_HelperWindow = NULL; @@ -158,7 +158,7 @@ void CSystem::Finalize() */ BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM dwData) { - MULTIMONITOR_INFO* m = (MULTIMONITOR_INFO*)dwData; + MultiMonitorInfo* m = (MultiMonitorInfo*)dwData; MONITORINFOEX info; info.cbSize = sizeof(MONITORINFOEX); @@ -193,7 +193,7 @@ BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonit } else // use only EnumDisplayMonitors { - MONITOR_INFO monitor; + MonitorInfo monitor; monitor.active = true; monitor.handle = hMonitor; @@ -245,7 +245,7 @@ size_t CSystem::GetMonitorCount() */ void CSystem::SetMultiMonitorInfo() { - std::vector& monitors = c_Monitors.monitors; + std::vector& monitors = c_Monitors.monitors; bool logging = Rainmeter->GetDebug(); c_Monitors.vsT = GetSystemMetrics(SM_YVIRTUALSCREEN); @@ -323,7 +323,7 @@ void CSystem::SetMultiMonitorInfo() if ((dd.StateFlags & DISPLAY_DEVICE_MIRRORING_DRIVER) == 0) { - MONITOR_INFO monitor = {0}; + MonitorInfo monitor = {0}; monitor.handle = NULL; monitor.deviceName = deviceName; // E.g. "\\.\DISPLAY1" @@ -440,7 +440,7 @@ void CSystem::SetMultiMonitorInfo() Log(LOG_WARNING, L"Failed to enumerate monitors. Using dummy monitor info."); c_Monitors.useEnumDisplayMonitors = false; - MONITOR_INFO monitor; + MonitorInfo monitor; monitor.active = true; POINT pos = {0, 0}; @@ -515,7 +515,7 @@ void CSystem::SetMultiMonitorInfo() */ void CSystem::UpdateWorkareaInfo() { - std::vector& monitors = c_Monitors.monitors; + std::vector& monitors = c_Monitors.monitors; if (monitors.empty()) { diff --git a/Library/System.h b/Library/System.h index 1c78a174..8898ec85 100644 --- a/Library/System.h +++ b/Library/System.h @@ -30,7 +30,7 @@ enum OSPLATFORM OSPLATFORM_7 }; -struct MONITOR_INFO +struct MonitorInfo { bool active; HMONITOR handle; @@ -40,14 +40,14 @@ struct MONITOR_INFO std::wstring monitorName; // Monitor name (E.g. "Generic Non-PnP Monitor") }; -struct MULTIMONITOR_INFO +struct MultiMonitorInfo { bool useEnumDisplayDevices; // If true, use EnumDisplayDevices function to obtain the multi-monitor information bool useEnumDisplayMonitors; // If true, use EnumDisplayMonitors function to obtain the multi-monitor information int vsT, vsL, vsH, vsW; // Coordinates of the top-left corner (vsT,vsL) and size (vsH,vsW) of the virtual screen int primary; // Index of the primary monitor - std::vector monitors; + std::vector monitors; }; class CSystem @@ -56,7 +56,7 @@ public: static void Initialize(HINSTANCE instance); static void Finalize(); - static const MULTIMONITOR_INFO& GetMultiMonitorInfo() { return c_Monitors; } + static const MultiMonitorInfo& GetMultiMonitorInfo() { return c_Monitors; } static size_t GetMonitorCount(); static bool GetShowDesktop() { return c_ShowDesktop; } @@ -111,7 +111,7 @@ private: static HWINEVENTHOOK c_WinEventHook; - static MULTIMONITOR_INFO c_Monitors; + static MultiMonitorInfo c_Monitors; static bool c_ShowDesktop;