From 261c3307f70d14e5bbc7d4113b4ee6dac9e4b627 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 7 Aug 2023 13:35:19 +0200 Subject: internal: cleanup headers in helpers/ --- src/helpers/AnimatedVariable.hpp | 18 ++++++++++-------- src/helpers/BezierCurve.cpp | 3 +++ src/helpers/BezierCurve.hpp | 4 +++- src/helpers/Color.cpp | 6 +++++- src/helpers/MiscFunctions.hpp | 5 ++++- src/helpers/Splashes.hpp | 4 +++- src/helpers/SubsurfaceTree.hpp | 6 ++++-- src/helpers/Timer.hpp | 2 +- src/helpers/Vector2D.hpp | 2 +- src/helpers/WLListener.hpp | 9 +++++---- src/helpers/WLSurface.hpp | 15 +++++++-------- src/helpers/Workspace.hpp | 7 ++++--- 12 files changed, 50 insertions(+), 31 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index d234dce2..e8bb2774 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -1,18 +1,20 @@ #pragma once -#include "../defines.hpp" +#include #include +#include +#include "Vector2D.hpp" +#include "Color.hpp" +#include "../macros.hpp" -enum ANIMATEDVARTYPE -{ +enum ANIMATEDVARTYPE { AVARTYPE_INVALID = -1, AVARTYPE_FLOAT, AVARTYPE_VECTOR, AVARTYPE_COLOR }; -enum AVARDAMAGEPOLICY -{ +enum AVARDAMAGEPOLICY { AVARDAMAGE_NONE = -1, AVARDAMAGE_ENTIRE = 0, AVARDAMAGE_BORDER, @@ -32,10 +34,10 @@ class CAnimatedVariable { void create(ANIMATEDVARTYPE, SAnimationPropertyConfig*, void* pWindow, AVARDAMAGEPOLICY); void create(ANIMATEDVARTYPE, std::any val, SAnimationPropertyConfig*, void* pWindow, AVARDAMAGEPOLICY); - CAnimatedVariable(const CAnimatedVariable&) = delete; - CAnimatedVariable(CAnimatedVariable&&) = delete; + CAnimatedVariable(const CAnimatedVariable&) = delete; + CAnimatedVariable(CAnimatedVariable&&) = delete; CAnimatedVariable& operator=(const CAnimatedVariable&) = delete; - CAnimatedVariable& operator=(CAnimatedVariable&&) = delete; + CAnimatedVariable& operator=(CAnimatedVariable&&) = delete; ~CAnimatedVariable(); diff --git a/src/helpers/BezierCurve.cpp b/src/helpers/BezierCurve.cpp index e018811c..08190117 100644 --- a/src/helpers/BezierCurve.cpp +++ b/src/helpers/BezierCurve.cpp @@ -1,5 +1,8 @@ #include "BezierCurve.hpp" +#include "../debug/Log.hpp" +#include "../macros.hpp" +#include #include void CBezierCurve::setup(std::vector* pVec) { diff --git a/src/helpers/BezierCurve.hpp b/src/helpers/BezierCurve.hpp index 540d33a7..461e6142 100644 --- a/src/helpers/BezierCurve.hpp +++ b/src/helpers/BezierCurve.hpp @@ -1,7 +1,9 @@ #pragma once -#include "../defines.hpp" #include +#include +#include +#include "Vector2D.hpp" constexpr int BAKEDPOINTS = 255; constexpr float INVBAKEDPOINTS = 1.f / BAKEDPOINTS; diff --git a/src/helpers/Color.cpp b/src/helpers/Color.cpp index ecd5a33c..77e0d530 100644 --- a/src/helpers/Color.cpp +++ b/src/helpers/Color.cpp @@ -1,5 +1,9 @@ #include "Color.hpp" -#include "../defines.hpp" + +#define ALPHA(c) ((double)(((c) >> 24) & 0xff) / 255.0) +#define RED(c) ((double)(((c) >> 16) & 0xff) / 255.0) +#define GREEN(c) ((double)(((c) >> 8) & 0xff) / 255.0) +#define BLUE(c) ((double)(((c)) & 0xff) / 255.0) CColor::CColor() {} diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index a5f21313..90ac6d78 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -1,6 +1,9 @@ #pragma once -#include "../includes.hpp" +#include +#include +#include +#include "Vector2D.hpp" std::string absolutePath(const std::string&, const std::string&); void addWLSignal(wl_signal*, wl_listener*, void* pOwner, const std::string& ownerString); diff --git a/src/helpers/Splashes.hpp b/src/helpers/Splashes.hpp index 32bef813..f5990506 100644 --- a/src/helpers/Splashes.hpp +++ b/src/helpers/Splashes.hpp @@ -1,9 +1,10 @@ #pragma once -#include +#include #include inline const std::vector SPLASHES = { + // clang-format off "Woo, animations!", "It's like Hypr, but better.", "Release 1.0 when?", @@ -60,4 +61,5 @@ inline const std::vector SPLASHES = { "Thanks ThatOneCalculator!", "The AUR packages always work, except for the times they don't.", "Funny animation compositor woo" + // clang-format on }; \ No newline at end of file diff --git a/src/helpers/SubsurfaceTree.hpp b/src/helpers/SubsurfaceTree.hpp index 7a0968fd..d6f04a58 100644 --- a/src/helpers/SubsurfaceTree.hpp +++ b/src/helpers/SubsurfaceTree.hpp @@ -26,7 +26,8 @@ struct SSurfaceTreeNode { void* globalOffsetData; CWindow* pWindowOwner = nullptr; - bool operator==(const SSurfaceTreeNode& rhs) const { + // + bool operator==(const SSurfaceTreeNode& rhs) const { return pSurface == rhs.pSurface; } }; @@ -43,7 +44,8 @@ struct SSubsurface { CWindow* pWindowOwner = nullptr; - bool operator==(const SSubsurface& rhs) const { + // + bool operator==(const SSubsurface& rhs) const { return pSubsurface == rhs.pSubsurface; } }; diff --git a/src/helpers/Timer.hpp b/src/helpers/Timer.hpp index 4ab0d294..e55f4ebf 100644 --- a/src/helpers/Timer.hpp +++ b/src/helpers/Timer.hpp @@ -1,6 +1,6 @@ #pragma once -#include "../defines.hpp" +#include class CTimer { public: diff --git a/src/helpers/Vector2D.hpp b/src/helpers/Vector2D.hpp index 3ba06de7..d23b3fbe 100644 --- a/src/helpers/Vector2D.hpp +++ b/src/helpers/Vector2D.hpp @@ -1,6 +1,6 @@ #pragma once -#include +#include class Vector2D { public: diff --git a/src/helpers/WLListener.hpp b/src/helpers/WLListener.hpp index 8327e945..d5d925b0 100644 --- a/src/helpers/WLListener.hpp +++ b/src/helpers/WLListener.hpp @@ -1,7 +1,8 @@ #pragma once -#include "../includes.hpp" +#include #include +#include class CHyprWLListener { public: @@ -9,10 +10,10 @@ class CHyprWLListener { CHyprWLListener(); ~CHyprWLListener(); - CHyprWLListener(const CHyprWLListener&) = delete; - CHyprWLListener(CHyprWLListener&&) = delete; + CHyprWLListener(const CHyprWLListener&) = delete; + CHyprWLListener(CHyprWLListener&&) = delete; CHyprWLListener& operator=(const CHyprWLListener&) = delete; - CHyprWLListener& operator=(CHyprWLListener&&) = delete; + CHyprWLListener& operator=(CHyprWLListener&&) = delete; void initCallback(wl_signal*, std::function, void* owner, std::string author = ""); diff --git a/src/helpers/WLSurface.hpp b/src/helpers/WLSurface.hpp index e3325f99..c5cdd37f 100644 --- a/src/helpers/WLSurface.hpp +++ b/src/helpers/WLSurface.hpp @@ -1,7 +1,6 @@ #pragma once #include "../defines.hpp" - class CWLSurface { public: CWLSurface() = default; @@ -11,20 +10,20 @@ class CWLSurface { void assign(wlr_surface* pSurface); void unassign(); - CWLSurface(const CWLSurface&) = delete; - CWLSurface(CWLSurface&&) = delete; + CWLSurface(const CWLSurface&) = delete; + CWLSurface(CWLSurface&&) = delete; CWLSurface& operator=(const CWLSurface&) = delete; - CWLSurface& operator=(CWLSurface&&) = delete; + CWLSurface& operator=(CWLSurface&&) = delete; wlr_surface* wlr() const; bool exists() const; CWLSurface& operator=(wlr_surface* pSurface) { - destroy(); - m_pWLRSurface = pSurface; - init(); + destroy(); + m_pWLRSurface = pSurface; + init(); - return *this; + return *this; } bool operator==(const CWLSurface& other) const { diff --git a/src/helpers/Workspace.hpp b/src/helpers/Workspace.hpp index b9de76d5..a7ee0e7a 100644 --- a/src/helpers/Workspace.hpp +++ b/src/helpers/Workspace.hpp @@ -1,10 +1,11 @@ #pragma once -#include "../defines.hpp" #include "AnimatedVariable.hpp" +#include +#include "../defines.hpp" +#include "../wlrunstable/wlr_ext_workspace_v1.hpp" -enum eFullscreenMode : uint8_t -{ +enum eFullscreenMode : uint8_t { FULLSCREEN_FULL = 0, FULLSCREEN_MAXIMIZED }; -- cgit v1.2.3