From cd0d3862c710b3ef2de7d043b1eac645949ffdf4 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Sat, 29 Apr 2023 22:59:45 +0200 Subject: [PATCH] Style changes platform-funcs.hpp --- src/legacy/switch-executable.cpp | 2 +- src/legacy/switch-idle.cpp | 2 +- src/legacy/switch-window.cpp | 8 ++++---- src/linux/advanced-scene-switcher-nix.cpp | 8 ++++---- src/macro-core/macro-condition-idle.cpp | 2 +- src/macro-core/macro-condition-process.cpp | 2 +- src/macro-core/macro-condition-window.cpp | 8 ++++---- src/osx/advanced-scene-switcher-osx.mm | 8 ++++---- src/platform-funcs.hpp | 8 ++++---- src/win/advanced-scene-switcher-win.cpp | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/legacy/switch-executable.cpp b/src/legacy/switch-executable.cpp index 55c02f14..a5c057a5 100644 --- a/src/legacy/switch-executable.cpp +++ b/src/legacy/switch-executable.cpp @@ -103,7 +103,7 @@ bool SwitcherData::checkExeSwitch(OBSWeakSource &scene, bool equals = runningProcesses.contains(s.exe); bool matches = (runningProcesses.indexOf( QRegularExpression(s.exe)) != -1); - bool focus = (!s.inFocus || isInFocus(s.exe)); + bool focus = (!s.inFocus || IsInFocus(s.exe)); // True if current window is ignored AND switch equals OR matches last window bool ignore = diff --git a/src/legacy/switch-idle.cpp b/src/legacy/switch-idle.cpp index c61c4570..c3c4e39b 100644 --- a/src/legacy/switch-idle.cpp +++ b/src/legacy/switch-idle.cpp @@ -42,7 +42,7 @@ bool SwitcherData::checkIdleSwitch(OBSWeakSource &scene, } } - if (!ignoreIdle && secondsSinceLastInput() > idleData.time) { + if (!ignoreIdle && SecondsSinceLastInput() > idleData.time) { if (idleData.alreadySwitched) { return false; } diff --git a/src/legacy/switch-window.cpp b/src/legacy/switch-window.cpp index c941f9c2..6f39bc9f 100644 --- a/src/legacy/switch-window.cpp +++ b/src/legacy/switch-window.cpp @@ -181,8 +181,8 @@ void checkWindowTitleSwitchDirect(WindowSwitch &s, OBSWeakSource &transition) { bool focus = (!s.focus || s.window == currentWindowTitle); - bool fullscreen = (!s.fullscreen || isFullscreen(s.window)); - bool max = (!s.maximized || isMaximized(s.window)); + bool fullscreen = (!s.fullscreen || IsFullscreen(s.window)); + bool max = (!s.maximized || IsMaximized(s.window)); if (focus && fullscreen && max) { match = true; @@ -207,8 +207,8 @@ void checkWindowTitleSwitchRegex(WindowSwitch &s, } bool focus = (!s.focus || window == currentWindowTitle); - bool fullscreen = (!s.fullscreen || isFullscreen(window)); - bool max = (!s.maximized || isMaximized(window)); + bool fullscreen = (!s.fullscreen || IsFullscreen(window)); + bool max = (!s.maximized || IsMaximized(window)); if (focus && fullscreen && max) { match = true; diff --git a/src/linux/advanced-scene-switcher-nix.cpp b/src/linux/advanced-scene-switcher-nix.cpp index c68e2bd1..08245660 100644 --- a/src/linux/advanced-scene-switcher-nix.cpp +++ b/src/linux/advanced-scene-switcher-nix.cpp @@ -317,7 +317,7 @@ bool windowStatesAreSet(const std::string &windowTitle, return false; } -bool isMaximized(const std::string &title) +bool IsMaximized(const std::string &title) { std::vector states; states.emplace_back("_NET_WM_STATE_MAXIMIZED_VERT"); @@ -325,7 +325,7 @@ bool isMaximized(const std::string &title) return windowStatesAreSet(title, states); } -bool isFullscreen(const std::string &title) +bool IsFullscreen(const std::string &title) { std::vector states; states.emplace_back("_NET_WM_STATE_FULLSCREEN"); @@ -430,7 +430,7 @@ void GetForegroundProcessName(std::string &proc) proc = getProcNameFromPid(pid); } -bool isInFocus(const QString &executable) +bool IsInFocus(const QString &executable) { std::string current; GetForegroundProcessName(current); @@ -444,7 +444,7 @@ bool isInFocus(const QString &executable) return (equals || matches); } -int secondsSinceLastInput() +int SecondsSinceLastInput() { if (!canGetIdleTime) { return 0; diff --git a/src/macro-core/macro-condition-idle.cpp b/src/macro-core/macro-condition-idle.cpp index e65b195b..a670e96b 100644 --- a/src/macro-core/macro-condition-idle.cpp +++ b/src/macro-core/macro-condition-idle.cpp @@ -13,7 +13,7 @@ bool MacroConditionIdle::_registered = MacroConditionFactory::Register( bool MacroConditionIdle::CheckCondition() { - auto seconds = secondsSinceLastInput(); + auto seconds = SecondsSinceLastInput(); SetVariableValue(std::to_string(seconds)); return seconds >= _duration.Seconds(); } diff --git a/src/macro-core/macro-condition-process.cpp b/src/macro-core/macro-condition-process.cpp index eefc2d05..e917ef05 100644 --- a/src/macro-core/macro-condition-process.cpp +++ b/src/macro-core/macro-condition-process.cpp @@ -22,7 +22,7 @@ bool MacroConditionProcess::CheckCondition() bool equals = runningProcesses.contains(proc); bool matches = runningProcesses.indexOf(QRegularExpression(proc)) != -1; - bool focus = !_focus || isInFocus(proc); + bool focus = !_focus || IsInFocus(proc); if (IsReferencedInVars()) { std::string name; diff --git a/src/macro-core/macro-condition-window.cpp b/src/macro-core/macro-condition-window.cpp index 150b0cb4..5e2cef66 100644 --- a/src/macro-core/macro-condition-window.cpp +++ b/src/macro-core/macro-condition-window.cpp @@ -18,8 +18,8 @@ bool MacroConditionWindow::CheckWindowTitleSwitchDirect( const std::string ¤tWindowTitle) { bool focus = (!_focus || _window == currentWindowTitle); - bool fullscreen = (!_fullscreen || isFullscreen(_window)); - bool max = (!_maximized || isMaximized(_window)); + bool fullscreen = (!_fullscreen || IsFullscreen(_window)); + bool max = (!_maximized || IsMaximized(_window)); return focus && fullscreen && max; } @@ -39,8 +39,8 @@ bool MacroConditionWindow::CheckWindowTitleSwitchRegex( } bool focus = (!_focus || window == currentWindowTitle); - bool fullscreen = (!_fullscreen || isFullscreen(window)); - bool max = (!_maximized || isMaximized(window)); + bool fullscreen = (!_fullscreen || IsFullscreen(window)); + bool max = (!_maximized || IsMaximized(window)); if (focus && fullscreen && max) { match = true; diff --git a/src/osx/advanced-scene-switcher-osx.mm b/src/osx/advanced-scene-switcher-osx.mm index 4728f3c7..10f8a300 100644 --- a/src/osx/advanced-scene-switcher-osx.mm +++ b/src/osx/advanced-scene-switcher-osx.mm @@ -160,7 +160,7 @@ bool nameMachesPattern(std::string windowName, std::string pattern) .contains(QRegularExpression(QString::fromStdString(pattern))); } -bool isMaximized(const std::string &title) +bool IsMaximized(const std::string &title) { @autoreleasepool { NSArray *screens = [NSScreen screens]; @@ -213,7 +213,7 @@ bool isWindowFullscreenOnScreen(NSDictionary *app, NSScreen *screen) return NSEqualSizes(windowBounds.size, screenFrame.size); } -bool isFullscreen(const std::string &title) +bool IsFullscreen(const std::string &title) { @autoreleasepool { NSArray *screens = [NSScreen screens]; @@ -255,7 +255,7 @@ bool isFullscreen(const std::string &title) return false; } -int secondsSinceLastInput() +int SecondsSinceLastInput() { double time = CGEventSourceSecondsSinceLastEventType( kCGEventSourceStateCombinedSessionState, @@ -312,7 +312,7 @@ void GetForegroundProcessName(QString &proc) proc = QString::fromStdString(temp); } -bool isInFocus(const QString &executable) +bool IsInFocus(const QString &executable) { std::string current; GetForegroundProcessName(current); diff --git a/src/platform-funcs.hpp b/src/platform-funcs.hpp index 2825ea77..e06723a1 100644 --- a/src/platform-funcs.hpp +++ b/src/platform-funcs.hpp @@ -16,12 +16,12 @@ extern std::chrono::high_resolution_clock::time_point lastMouseRightClickTime; void GetWindowList(std::vector &windows); void GetWindowList(QStringList &windows); void GetCurrentWindowTitle(std::string &title); -bool isFullscreen(const std::string &title); -bool isMaximized(const std::string &title); -int secondsSinceLastInput(); +bool IsFullscreen(const std::string &title); +bool IsMaximized(const std::string &title); +int SecondsSinceLastInput(); void GetProcessList(QStringList &processes); void GetForegroundProcessName(std::string &name); -bool isInFocus(const QString &executable); +bool IsInFocus(const QString &executable); void PressKeys(const std::vector keys, int duration); void PlatformInit(); void PlatformCleanup(); diff --git a/src/win/advanced-scene-switcher-win.cpp b/src/win/advanced-scene-switcher-win.cpp index 6adc7692..dd456da2 100644 --- a/src/win/advanced-scene-switcher-win.cpp +++ b/src/win/advanced-scene-switcher-win.cpp @@ -148,7 +148,7 @@ static HWND getHWNDfromTitle(std::string title) return hwnd; } -bool isMaximized(const std::string &title) +bool IsMaximized(const std::string &title) { RECT appBounds; MONITORINFO monitorInfo = {0}; @@ -178,7 +178,7 @@ bool isMaximized(const std::string &title) return false; } -bool isFullscreen(const std::string &title) +bool IsFullscreen(const std::string &title) { RECT appBounds; MONITORINFO monitorInfo = {0}; @@ -272,7 +272,7 @@ void GetForegroundProcessName(std::string &proc) proc = temp.toStdString(); } -bool isInFocus(const QString &executable) +bool IsInFocus(const QString &executable) { // only checks if the current foreground window is from the same executable, // may return true for any window from a program @@ -459,7 +459,7 @@ static int getTime() return GetTickCount(); } -int secondsSinceLastInput() +int SecondsSinceLastInput() { return (getTime() - getLastInputTime()) / 1000; }