2022-05-28 20:46:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "IHyprWindowDecoration.hpp"
|
|
|
|
#include <deque>
|
2023-05-22 21:40:32 +02:00
|
|
|
#include "../Texture.hpp"
|
|
|
|
#include <string>
|
2023-07-11 20:57:33 +02:00
|
|
|
#include <memory>
|
2023-05-22 21:40:32 +02:00
|
|
|
|
|
|
|
class CTitleTex {
|
|
|
|
public:
|
|
|
|
CTitleTex(CWindow* pWindow, const Vector2D& bufferSize);
|
|
|
|
~CTitleTex();
|
|
|
|
|
|
|
|
CTexture tex;
|
|
|
|
std::string szContent;
|
|
|
|
CWindow* pWindowOwner = nullptr;
|
|
|
|
};
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-26 18:59:49 +01:00
|
|
|
void refreshGroupBarGradients();
|
|
|
|
|
2022-05-28 20:46:20 +02:00
|
|
|
class CHyprGroupBarDecoration : public IHyprWindowDecoration {
|
2022-12-16 18:17:31 +01:00
|
|
|
public:
|
2022-05-28 20:46:20 +02:00
|
|
|
CHyprGroupBarDecoration(CWindow*);
|
|
|
|
virtual ~CHyprGroupBarDecoration();
|
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual SDecorationPositioningInfo getPositioningInfo();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void onPositioningReply(const SDecorationPositioningReply& reply);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void draw(CMonitor*, float a, const Vector2D& offset);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual eDecorationType getDecorationType();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void updateWindow(CWindow*);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void damageEntire();
|
2023-05-22 20:52:41 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void onBeginWindowDragOnDeco(const Vector2D&);
|
2023-10-29 21:14:47 +01:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual bool onEndWindowDragOnDeco(CWindow* pDraggedWindow, const Vector2D&);
|
2023-10-29 21:14:47 +01:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual void onMouseButtonOnDeco(const Vector2D&, wlr_pointer_button_event*);
|
2023-10-29 21:14:47 +01:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual eDecorationLayer getDecorationLayer();
|
2023-11-04 14:10:52 +01:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
virtual uint64_t getDecorationFlags();
|
2023-11-04 14:10:52 +01:00
|
|
|
|
2023-12-28 16:38:16 +01:00
|
|
|
virtual std::string getDisplayName();
|
|
|
|
|
2022-12-16 18:17:31 +01:00
|
|
|
private:
|
2023-05-22 22:06:40 +02:00
|
|
|
SWindowDecorationExtents m_seExtents;
|
2023-05-22 21:40:32 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
CBox m_bAssignedBox = {0};
|
2023-05-22 21:40:32 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
CWindow* m_pWindow = nullptr;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-05-22 22:06:40 +02:00
|
|
|
std::deque<CWindow*> m_dwGroupMembers;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-10-29 21:14:47 +01:00
|
|
|
float m_fBarWidth;
|
|
|
|
|
2023-05-22 22:06:40 +02:00
|
|
|
CTitleTex* textureFromTitle(const std::string&);
|
|
|
|
void invalidateTextures();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 15:37:17 +01:00
|
|
|
CBox assignedBoxGlobal();
|
|
|
|
|
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;
|
2023-08-30 17:39:22 +02:00
|
|
|
};
|