Hyprland/src/render/decorations/CHyprGroupBarDecoration.hpp

55 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
#include "IHyprWindowDecoration.hpp"
#include <deque>
#include "../Texture.hpp"
#include <string>
2023-07-11 20:57:33 +02:00
#include <memory>
class CTitleTex {
public:
CTitleTex(CWindow* pWindow, const Vector2D& bufferSize);
~CTitleTex();
CTexture tex;
std::string szContent;
CWindow* pWindowOwner = nullptr;
};
class CHyprGroupBarDecoration : public IHyprWindowDecoration {
public:
CHyprGroupBarDecoration(CWindow*);
virtual ~CHyprGroupBarDecoration();
virtual SWindowDecorationExtents getWindowDecorationExtents();
virtual void draw(CMonitor*, float a, const Vector2D& offset);
virtual eDecorationType getDecorationType();
virtual void updateWindow(CWindow*);
virtual void damageEntire();
2023-05-22 20:52:41 +02:00
virtual SWindowDecorationExtents getWindowDecorationReservedArea();
private:
SWindowDecorationExtents m_seExtents;
CWindow* m_pWindow = nullptr;
Vector2D m_vLastWindowPos;
Vector2D m_vLastWindowSize;
std::deque<CWindow*> m_dwGroupMembers;
CTitleTex* textureFromTitle(const std::string&);
void invalidateTextures();
void refreshGradients();
2023-07-11 20:57:33 +02:00
struct STitleTexs {
// STitleTexs* overriden = nullptr; // TODO: make shit shared in-group to decrease VRAM usage.
std::deque<std::unique_ptr<CTitleTex>> titleTexs;
} m_sTitleTexs;
};