diff --git a/src/Window.hpp b/src/Window.hpp index e37ffd59..c87caa3c 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -35,9 +35,7 @@ class IWindowTransformer; template class CWindowOverridableVar { public: - CWindowOverridableVar(T val) - : value(val) { - } + CWindowOverridableVar(T val) : value(val) {} ~CWindowOverridableVar() = default; @@ -123,25 +121,25 @@ struct SWindowSpecialRenderData { }; struct SWindowAdditionalConfigData { - std::string animationStyle = std::string(""); - CWindowOverridableVar cornerRadii = CCornerRadiiData(-1); // -1 means no - CWindowOverridableVar forceNoBlur = false; - CWindowOverridableVar forceOpaque = false; - CWindowOverridableVar forceOpaqueOverridden = false; // if true, a rule will not change the forceOpaque state. This is for the force opaque dispatcher. - CWindowOverridableVar forceAllowsInput = false; - CWindowOverridableVar forceNoAnims = false; - CWindowOverridableVar forceNoBorder = false; - CWindowOverridableVar forceNoShadow = false; - CWindowOverridableVar forceNoDim = false; - CWindowOverridableVar windowDanceCompat = false; - CWindowOverridableVar noMaxSize = false; - CWindowOverridableVar dimAround = false; - CWindowOverridableVar forceRGBX = false; - CWindowOverridableVar keepAspectRatio = false; - CWindowOverridableVar xray = -1; // -1 means unset, takes precedence over the renderdata one - CWindowOverridableVar borderSize = -1; // -1 means unset, takes precedence over the renderdata one - CWindowOverridableVar forceTearing = false; - CWindowOverridableVar nearestNeighbor = false; + std::string animationStyle = std::string(""); + CWindowOverridableVar cornerRadii = CCornerRadiiData(-1); // -1 means no + CWindowOverridableVar forceNoBlur = false; + CWindowOverridableVar forceOpaque = false; + CWindowOverridableVar forceOpaqueOverridden = false; // if true, a rule will not change the forceOpaque state. This is for the force opaque dispatcher. + CWindowOverridableVar forceAllowsInput = false; + CWindowOverridableVar forceNoAnims = false; + CWindowOverridableVar forceNoBorder = false; + CWindowOverridableVar forceNoShadow = false; + CWindowOverridableVar forceNoDim = false; + CWindowOverridableVar windowDanceCompat = false; + CWindowOverridableVar noMaxSize = false; + CWindowOverridableVar dimAround = false; + CWindowOverridableVar forceRGBX = false; + CWindowOverridableVar keepAspectRatio = false; + CWindowOverridableVar xray = -1; // -1 means unset, takes precedence over the renderdata one + CWindowOverridableVar borderSize = -1; // -1 means unset, takes precedence over the renderdata one + CWindowOverridableVar forceTearing = false; + CWindowOverridableVar nearestNeighbor = false; }; struct SWindowRule { diff --git a/src/config/ConfigDataValues.hpp b/src/config/ConfigDataValues.hpp index d5e548ab..914df58f 100644 --- a/src/config/ConfigDataValues.hpp +++ b/src/config/ConfigDataValues.hpp @@ -3,8 +3,8 @@ #include enum eConfigValueDataTypes { - CVD_TYPE_INVALID = -1, - CVD_TYPE_GRADIENT = 0, + CVD_TYPE_INVALID = -1, + CVD_TYPE_GRADIENT = 0, 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 class CCornerRadiiData : public ICustomConfigValueData { public: - CCornerRadiiData() - : CCornerRadiiData(0) { - } + CCornerRadiiData() : CCornerRadiiData(0) {} - CCornerRadiiData(int radius) - : CCornerRadiiData(radius, radius, radius, radius) { - } + CCornerRadiiData(int radius) : CCornerRadiiData(radius, radius, radius, radius) {} - CCornerRadiiData(int topL, int topR, int bottomR, int bottomL) - : topLeft(topL), topRight(topR), bottomRight(bottomR), bottomLeft(bottomL) { - } + CCornerRadiiData(int topL, int topR, int bottomR, int bottomL) : topLeft(topL), topRight(topR), bottomRight(bottomR), bottomLeft(bottomL) {} - virtual ~CCornerRadiiData(){} + virtual ~CCornerRadiiData() {} virtual eConfigValueDataTypes getDataType() { return CVD_TYPE_CORNER_RADII; diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index a0c60b05..039015d2 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -125,68 +125,68 @@ class CHyprOpenGLImpl { public: CHyprOpenGLImpl(); - void begin(CMonitor*, CRegion*, CFramebuffer* fb = nullptr /* if provided, it's not a real frame */); - void end(); + void begin(CMonitor*, CRegion*, CFramebuffer* fb = nullptr /* if provided, it's not a real frame */); + void end(); - void renderRect(CBox*, const CColor&, CCornerRadiiData radii = 0); - 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 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 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 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 renderRect(CBox*, const CColor&, CCornerRadiiData radii = 0); + 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 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 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 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 setMonitorTransformEnabled(bool enabled); + void setMonitorTransformEnabled(bool enabled); - void saveMatrix(); - void setMatrixScaleTranslate(const Vector2D& translate, const float& scale); - void restoreMatrix(); + void saveMatrix(); + void setMatrixScaleTranslate(const Vector2D& translate, const float& scale); + void restoreMatrix(); - void blend(bool enabled); + void blend(bool enabled); - void makeWindowSnapshot(CWindow*); - void makeRawWindowSnapshot(CWindow*, CFramebuffer*); - void makeLayerSnapshot(SLayerSurface*); - void renderSnapshot(CWindow**); - void renderSnapshot(SLayerSurface**); - bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow); + void makeWindowSnapshot(CWindow*); + void makeRawWindowSnapshot(CWindow*, CFramebuffer*); + void makeLayerSnapshot(SLayerSurface*); + void renderSnapshot(CWindow**); + void renderSnapshot(SLayerSurface**); + bool shouldUseNewBlurOptimizations(SLayerSurface* pLayer, CWindow* pWindow); - void clear(const CColor&); - void clearWithTex(); - void scissor(const CBox*, 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 clear(const CColor&); + void clearWithTex(); + void scissor(const CBox*, 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 destroyMonitorResources(CMonitor*); + void destroyMonitorResources(CMonitor*); - void markBlurDirtyForMonitor(CMonitor*); + void markBlurDirtyForMonitor(CMonitor*); - void preWindowPass(); - bool preBlurQueued(); - void preRender(CMonitor*); + void preWindowPass(); + bool preBlurQueued(); + void preRender(CMonitor*); - void saveBufferForMirror(); - void renderMirrored(); + void saveBufferForMirror(); + void renderMirrored(); - void applyScreenShader(const std::string& path); + void applyScreenShader(const std::string& path); - void bindOffMain(); - void renderOffToMain(CFramebuffer* off); - void bindBackOnMain(); + void bindOffMain(); + void renderOffToMain(CFramebuffer* off); + void bindBackOnMain(); - uint32_t getPreferredReadFormat(CMonitor* pMonitor); - const SGLPixelFormat* getPixelFormatFromDRM(uint32_t drmFormat); + uint32_t getPreferredReadFormat(CMonitor* pMonitor); + 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 - SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer + CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window + SLayerSurface* m_pCurrentLayer = nullptr; // hack to get the current rendered layer std::unordered_map m_mWindowFramebuffers; std::unordered_map m_mLayerFramebuffers;