internal: cleanup headers in helpers/

This commit is contained in:
vaxerski 2023-08-07 13:35:19 +02:00
parent 6e53c47e68
commit 261c3307f7
19 changed files with 135 additions and 121 deletions

View file

@ -1,18 +1,20 @@
#pragma once
#include "../defines.hpp"
#include <functional>
#include <any>
#include <chrono>
#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();

View file

@ -1,5 +1,8 @@
#include "BezierCurve.hpp"
#include "../debug/Log.hpp"
#include "../macros.hpp"
#include <chrono>
#include <algorithm>
void CBezierCurve::setup(std::vector<Vector2D>* pVec) {

View file

@ -1,7 +1,9 @@
#pragma once
#include "../defines.hpp"
#include <deque>
#include <array>
#include <vector>
#include "Vector2D.hpp"
constexpr int BAKEDPOINTS = 255;
constexpr float INVBAKEDPOINTS = 1.f / BAKEDPOINTS;

View file

@ -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() {}

View file

@ -1,6 +1,9 @@
#pragma once
#include "../includes.hpp"
#include <string>
#include <wayland-server.h>
#include <wlr/util/box.h>
#include "Vector2D.hpp"
std::string absolutePath(const std::string&, const std::string&);
void addWLSignal(wl_signal*, wl_listener*, void* pOwner, const std::string& ownerString);

View file

@ -1,9 +1,10 @@
#pragma once
#include <array>
#include <vector>
#include <string>
inline const std::vector<std::string> SPLASHES = {
// clang-format off
"Woo, animations!",
"It's like Hypr, but better.",
"Release 1.0 when?",
@ -60,4 +61,5 @@ inline const std::vector<std::string> SPLASHES = {
"Thanks ThatOneCalculator!",
"The AUR packages always work, except for the times they don't.",
"Funny animation compositor woo"
// clang-format on
};

View file

@ -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;
}
};

View file

@ -1,6 +1,6 @@
#pragma once
#include "../defines.hpp"
#include <chrono>
class CTimer {
public:

View file

@ -1,6 +1,6 @@
#pragma once
#include <math.h>
#include <cmath>
class Vector2D {
public:

View file

@ -1,7 +1,8 @@
#pragma once
#include "../includes.hpp"
#include <string>
#include <functional>
#include <wayland-server.h>
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(void*, void*)>, void* owner, std::string author = "");

View file

@ -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 {

View file

@ -1,10 +1,11 @@
#pragma once
#include "../defines.hpp"
#include "AnimatedVariable.hpp"
#include <string>
#include "../defines.hpp"
#include "../wlrunstable/wlr_ext_workspace_v1.hpp"
enum eFullscreenMode : uint8_t
{
enum eFullscreenMode : uint8_t {
FULLSCREEN_FULL = 0,
FULLSCREEN_MAXIMIZED
};