mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 21:05:57 +01:00
formatted hpp files
This commit is contained in:
parent
91e1fc978d
commit
9cc29db0de
3 changed files with 71 additions and 79 deletions
|
@ -35,9 +35,7 @@ class IWindowTransformer;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class CWindowOverridableVar {
|
class CWindowOverridableVar {
|
||||||
public:
|
public:
|
||||||
CWindowOverridableVar(T val)
|
CWindowOverridableVar(T val) : value(val) {}
|
||||||
: value(val) {
|
|
||||||
}
|
|
||||||
|
|
||||||
~CWindowOverridableVar() = default;
|
~CWindowOverridableVar() = default;
|
||||||
|
|
||||||
|
@ -123,25 +121,25 @@ struct SWindowSpecialRenderData {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SWindowAdditionalConfigData {
|
struct SWindowAdditionalConfigData {
|
||||||
std::string animationStyle = std::string("");
|
std::string animationStyle = std::string("");
|
||||||
CWindowOverridableVar<CCornerRadiiData> cornerRadii = CCornerRadiiData(-1); // -1 means no
|
CWindowOverridableVar<CCornerRadiiData> cornerRadii = CCornerRadiiData(-1); // -1 means no
|
||||||
CWindowOverridableVar<bool> forceNoBlur = false;
|
CWindowOverridableVar<bool> forceNoBlur = false;
|
||||||
CWindowOverridableVar<bool> forceOpaque = false;
|
CWindowOverridableVar<bool> forceOpaque = false;
|
||||||
CWindowOverridableVar<bool> forceOpaqueOverridden = false; // if true, a rule will not change the forceOpaque state. This is for the force opaque dispatcher.
|
CWindowOverridableVar<bool> forceOpaqueOverridden = false; // if true, a rule will not change the forceOpaque state. This is for the force opaque dispatcher.
|
||||||
CWindowOverridableVar<bool> forceAllowsInput = false;
|
CWindowOverridableVar<bool> forceAllowsInput = false;
|
||||||
CWindowOverridableVar<bool> forceNoAnims = false;
|
CWindowOverridableVar<bool> forceNoAnims = false;
|
||||||
CWindowOverridableVar<bool> forceNoBorder = false;
|
CWindowOverridableVar<bool> forceNoBorder = false;
|
||||||
CWindowOverridableVar<bool> forceNoShadow = false;
|
CWindowOverridableVar<bool> forceNoShadow = false;
|
||||||
CWindowOverridableVar<bool> forceNoDim = false;
|
CWindowOverridableVar<bool> forceNoDim = false;
|
||||||
CWindowOverridableVar<bool> windowDanceCompat = false;
|
CWindowOverridableVar<bool> windowDanceCompat = false;
|
||||||
CWindowOverridableVar<bool> noMaxSize = false;
|
CWindowOverridableVar<bool> noMaxSize = false;
|
||||||
CWindowOverridableVar<bool> dimAround = false;
|
CWindowOverridableVar<bool> dimAround = false;
|
||||||
CWindowOverridableVar<bool> forceRGBX = false;
|
CWindowOverridableVar<bool> forceRGBX = false;
|
||||||
CWindowOverridableVar<bool> keepAspectRatio = false;
|
CWindowOverridableVar<bool> keepAspectRatio = false;
|
||||||
CWindowOverridableVar<int> xray = -1; // -1 means unset, takes precedence over the renderdata one
|
CWindowOverridableVar<int> xray = -1; // -1 means unset, takes precedence over the renderdata one
|
||||||
CWindowOverridableVar<int> borderSize = -1; // -1 means unset, takes precedence over the renderdata one
|
CWindowOverridableVar<int> borderSize = -1; // -1 means unset, takes precedence over the renderdata one
|
||||||
CWindowOverridableVar<bool> forceTearing = false;
|
CWindowOverridableVar<bool> forceTearing = false;
|
||||||
CWindowOverridableVar<bool> nearestNeighbor = false;
|
CWindowOverridableVar<bool> nearestNeighbor = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SWindowRule {
|
struct SWindowRule {
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
enum eConfigValueDataTypes {
|
enum eConfigValueDataTypes {
|
||||||
CVD_TYPE_INVALID = -1,
|
CVD_TYPE_INVALID = -1,
|
||||||
CVD_TYPE_GRADIENT = 0,
|
CVD_TYPE_GRADIENT = 0,
|
||||||
CVD_TYPE_CORNER_RADII = 1
|
CVD_TYPE_CORNER_RADII = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -54,19 +54,13 @@ class CGradientValueData : public ICustomConfigValueData {
|
||||||
// This class is probably going to be refactored once hyprlang is used
|
// This class is probably going to be refactored once hyprlang is used
|
||||||
class CCornerRadiiData : public ICustomConfigValueData {
|
class CCornerRadiiData : public ICustomConfigValueData {
|
||||||
public:
|
public:
|
||||||
CCornerRadiiData()
|
CCornerRadiiData() : CCornerRadiiData(0) {}
|
||||||
: CCornerRadiiData(0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
CCornerRadiiData(int radius)
|
CCornerRadiiData(int radius) : CCornerRadiiData(radius, radius, radius, radius) {}
|
||||||
: CCornerRadiiData(radius, radius, radius, radius) {
|
|
||||||
}
|
|
||||||
|
|
||||||
CCornerRadiiData(int topL, int topR, int bottomR, int bottomL)
|
CCornerRadiiData(int topL, int topR, int bottomR, int bottomL) : topLeft(topL), topRight(topR), bottomRight(bottomR), bottomLeft(bottomL) {}
|
||||||
: topLeft(topL), topRight(topR), bottomRight(bottomR), bottomLeft(bottomL) {
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~CCornerRadiiData(){}
|
virtual ~CCornerRadiiData() {}
|
||||||
|
|
||||||
virtual eConfigValueDataTypes getDataType() {
|
virtual eConfigValueDataTypes getDataType() {
|
||||||
return CVD_TYPE_CORNER_RADII;
|
return CVD_TYPE_CORNER_RADII;
|
||||||
|
|
|
@ -125,68 +125,68 @@ class CHyprOpenGLImpl {
|
||||||
public:
|
public:
|
||||||
CHyprOpenGLImpl();
|
CHyprOpenGLImpl();
|
||||||
|
|
||||||
void begin(CMonitor*, CRegion*, CFramebuffer* fb = nullptr /* if provided, it's not a real frame */);
|
void begin(CMonitor*, CRegion*, CFramebuffer* fb = nullptr /* if provided, it's not a real frame */);
|
||||||
void end();
|
void end();
|
||||||
|
|
||||||
void renderRect(CBox*, const CColor&, CCornerRadiiData radii = 0);
|
void renderRect(CBox*, const CColor&, CCornerRadiiData radii = 0);
|
||||||
void renderRectWithBlur(CBox*, const CColor&, CCornerRadiiData radii = 0, float blurA = 1.f, bool xray = false);
|
void renderRectWithBlur(CBox*, const CColor&, CCornerRadiiData radii = 0, float blurA = 1.f, bool xray = false);
|
||||||
void renderRectWithDamage(CBox*, const CColor&, CRegion* damage, CCornerRadiiData radii = 0);
|
void renderRectWithDamage(CBox*, const CColor&, CRegion* damage, CCornerRadiiData radii = 0);
|
||||||
void renderTexture(wlr_texture*, CBox*, float a, CCornerRadiiData radii = 0, bool allowCustomUV = false);
|
void renderTexture(wlr_texture*, CBox*, float a, CCornerRadiiData radii = 0, bool allowCustomUV = false);
|
||||||
void renderTexture(const CTexture&, CBox*, float a, CCornerRadiiData radii = 0, bool discardActive = false, bool allowCustomUV = false);
|
void renderTexture(const CTexture&, CBox*, float a, CCornerRadiiData radii = 0, bool discardActive = false, bool allowCustomUV = false);
|
||||||
void renderTextureWithBlur(const CTexture&, CBox*, float a, wlr_surface* pSurface, CCornerRadiiData radii = 0, bool blockBlurOptimization = false, float blurA = 1.f);
|
void renderTextureWithBlur(const CTexture&, CBox*, float a, wlr_surface* pSurface, CCornerRadiiData radii = 0, bool blockBlurOptimization = false, float blurA = 1.f);
|
||||||
void renderRoundedShadow(CBox*, CCornerRadiiData radii, int range, const CColor& color, float a = 1.0);
|
void renderRoundedShadow(CBox*, CCornerRadiiData radii, int range, const CColor& color, float a = 1.0);
|
||||||
void renderBorder(CBox*, const CGradientValueData&, CCornerRadiiData radii, int borderSize, float a = 1.0, CCornerRadiiData outerRadii = -1 /* use round */);
|
void renderBorder(CBox*, const CGradientValueData&, CCornerRadiiData radii, int borderSize, float a = 1.0, CCornerRadiiData outerRadii = -1 /* use round */);
|
||||||
void renderTextureMatte(const CTexture& tex, CBox* pBox, CFramebuffer& matte);
|
void renderTextureMatte(const CTexture& tex, CBox* pBox, CFramebuffer& matte);
|
||||||
|
|
||||||
void setMonitorTransformEnabled(bool enabled);
|
void setMonitorTransformEnabled(bool enabled);
|
||||||
|
|
||||||
void saveMatrix();
|
void saveMatrix();
|
||||||
void setMatrixScaleTranslate(const Vector2D& translate, const float& scale);
|
void setMatrixScaleTranslate(const Vector2D& translate, const float& scale);
|
||||||
void restoreMatrix();
|
void restoreMatrix();
|
||||||
|
|
||||||
void blend(bool enabled);
|
void blend(bool enabled);
|
||||||
|
|
||||||
void makeWindowSnapshot(CWindow*);
|
void makeWindowSnapshot(CWindow*);
|
||||||
void makeRawWindowSnapshot(CWindow*, CFramebuffer*);
|
void makeRawWindowSnapshot(CWindow*, CFramebuffer*);
|
||||||
void makeLayerSnapshot(SLayerSurface*);
|
void makeLayerSnapshot(SLayerSurface*);
|
||||||
void renderSnapshot(CWindow**);
|
void renderSnapshot(CWindow**);
|
||||||
void renderSnapshot(SLayerSurface**);
|
void renderSnapshot(SLayerSurface**);
|
||||||
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow);
|
||||||
|
|
||||||
void clear(const CColor&);
|
void clear(const CColor&);
|
||||||
void clearWithTex();
|
void clearWithTex();
|
||||||
void scissor(const CBox*, bool transform = true);
|
void scissor(const CBox*, bool transform = true);
|
||||||
void scissor(const pixman_box32*, bool transform = true);
|
void scissor(const pixman_box32*, bool transform = true);
|
||||||
void scissor(const int x, const int y, const int w, const int h, bool transform = true);
|
void scissor(const int x, const int y, const int w, const int h, bool transform = true);
|
||||||
|
|
||||||
void destroyMonitorResources(CMonitor*);
|
void destroyMonitorResources(CMonitor*);
|
||||||
|
|
||||||
void markBlurDirtyForMonitor(CMonitor*);
|
void markBlurDirtyForMonitor(CMonitor*);
|
||||||
|
|
||||||
void preWindowPass();
|
void preWindowPass();
|
||||||
bool preBlurQueued();
|
bool preBlurQueued();
|
||||||
void preRender(CMonitor*);
|
void preRender(CMonitor*);
|
||||||
|
|
||||||
void saveBufferForMirror();
|
void saveBufferForMirror();
|
||||||
void renderMirrored();
|
void renderMirrored();
|
||||||
|
|
||||||
void applyScreenShader(const std::string& path);
|
void applyScreenShader(const std::string& path);
|
||||||
|
|
||||||
void bindOffMain();
|
void bindOffMain();
|
||||||
void renderOffToMain(CFramebuffer* off);
|
void renderOffToMain(CFramebuffer* off);
|
||||||
void bindBackOnMain();
|
void bindBackOnMain();
|
||||||
|
|
||||||
uint32_t getPreferredReadFormat(CMonitor* pMonitor);
|
uint32_t getPreferredReadFormat(CMonitor* pMonitor);
|
||||||
const SGLPixelFormat* getPixelFormatFromDRM(uint32_t drmFormat);
|
const SGLPixelFormat* getPixelFormatFromDRM(uint32_t drmFormat);
|
||||||
|
|
||||||
SCurrentRenderData m_RenderData;
|
SCurrentRenderData m_RenderData;
|
||||||
|
|
||||||
GLint m_iCurrentOutputFb = 0;
|
GLint m_iCurrentOutputFb = 0;
|
||||||
|
|
||||||
bool m_bReloadScreenShader = true; // at launch it can be set
|
bool m_bReloadScreenShader = true; // at launch it can be set
|
||||||
|
|
||||||
CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window
|
CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window
|
||||||
SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer
|
SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer
|
||||||
|
|
||||||
std::unordered_map<CWindow*, CFramebuffer> m_mWindowFramebuffers;
|
std::unordered_map<CWindow*, CFramebuffer> m_mWindowFramebuffers;
|
||||||
std::unordered_map<SLayerSurface*, CFramebuffer> m_mLayerFramebuffers;
|
std::unordered_map<SLayerSurface*, CFramebuffer> m_mLayerFramebuffers;
|
||||||
|
|
Loading…
Reference in a new issue