2022-05-28 20:46:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "IHyprWindowDecoration.hpp"
|
2024-05-09 18:19:32 +00:00
|
|
|
#include "../../devices/IPointer.hpp"
|
2024-12-16 15:58:19 +00:00
|
|
|
#include <vector>
|
2023-05-22 21:40:32 +02:00
|
|
|
#include "../Texture.hpp"
|
|
|
|
|
#include <string>
|
2025-01-23 21:55:41 +01:00
|
|
|
#include "../../helpers/memory/Memory.hpp"
|
2023-05-22 21:40:32 +02:00
|
|
|
|
|
|
|
|
class CTitleTex {
|
|
|
|
|
public:
|
2024-05-09 20:47:59 +00:00
|
|
|
CTitleTex(PHLWINDOW pWindow, const Vector2D& bufferSize, const float monitorScale);
|
2025-01-30 16:07:06 +05:00
|
|
|
~CTitleTex() = default;
|
2023-05-22 21:40:32 +02:00
|
|
|
|
2025-04-24 14:48:08 -04:00
|
|
|
SP<CTexture> texActive;
|
|
|
|
|
SP<CTexture> texInactive;
|
2024-04-27 12:43:12 +01:00
|
|
|
std::string szContent;
|
2024-06-10 06:20:18 -04:00
|
|
|
|
2024-04-27 12:43:12 +01:00
|
|
|
PHLWINDOWREF pWindowOwner;
|
2023-05-22 21:40:32 +02:00
|
|
|
};
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-26 17:59:49 +00:00
|
|
|
void refreshGroupBarGradients();
|
|
|
|
|
|
2022-05-28 20:46:20 +02:00
|
|
|
class CHyprGroupBarDecoration : public IHyprWindowDecoration {
|
2022-12-16 17:17:31 +00:00
|
|
|
public:
|
2024-04-27 12:43:12 +01:00
|
|
|
CHyprGroupBarDecoration(PHLWINDOW);
|
2025-01-30 16:07:06 +05:00
|
|
|
virtual ~CHyprGroupBarDecoration() = default;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual SDecorationPositioningInfo getPositioningInfo();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void onPositioningReply(const SDecorationPositioningReply& reply);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-10-31 00:20:32 +01:00
|
|
|
virtual void draw(PHLMONITOR, float const& a);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual eDecorationType getDecorationType();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-04-27 12:43:12 +01:00
|
|
|
virtual void updateWindow(PHLWINDOW);
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void damageEntire();
|
2023-05-22 20:52:41 +02:00
|
|
|
|
2023-12-28 22:54:41 +00:00
|
|
|
virtual bool onInputOnDeco(const eInputType, const Vector2D&, std::any = {});
|
2023-10-29 20:14:47 +00:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual eDecorationLayer getDecorationLayer();
|
2023-11-04 13:10:52 +00:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual uint64_t getDecorationFlags();
|
2023-11-04 13:10:52 +00:00
|
|
|
|
2023-12-28 15:38:16 +00:00
|
|
|
virtual std::string getDisplayName();
|
|
|
|
|
|
2022-12-16 17:17:31 +00:00
|
|
|
private:
|
2024-12-16 15:58:19 +00:00
|
|
|
SBoxExtents m_seExtents;
|
2023-05-22 21:40:32 +02:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
CBox m_bAssignedBox = {0};
|
2023-05-22 21:40:32 +02:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
PHLWINDOWREF m_pWindow;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
std::vector<PHLWINDOWREF> m_dwGroupMembers;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
float m_fBarWidth;
|
|
|
|
|
float m_fBarHeight;
|
2023-10-29 20:14:47 +00:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
CTitleTex* textureFromTitle(const std::string&);
|
|
|
|
|
void invalidateTextures();
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
CBox assignedBoxGlobal();
|
2023-11-11 14:37:17 +00:00
|
|
|
|
2024-12-16 15:58:19 +00:00
|
|
|
bool onBeginWindowDragOnDeco(const Vector2D&);
|
|
|
|
|
bool onEndWindowDragOnDeco(const Vector2D&, PHLWINDOW);
|
|
|
|
|
bool onMouseButtonOnDeco(const Vector2D&, const IPointer::SButtonEvent&);
|
|
|
|
|
bool onScrollOnDeco(const Vector2D&, const IPointer::SAxisEvent);
|
2023-12-28 22:54:41 +00:00
|
|
|
|
2023-07-11 20:57:33 +02:00
|
|
|
struct STitleTexs {
|
|
|
|
|
// STitleTexs* overriden = nullptr; // TODO: make shit shared in-group to decrease VRAM usage.
|
2025-01-23 21:55:41 +01:00
|
|
|
std::vector<UP<CTitleTex>> titleTexs;
|
2023-07-11 20:57:33 +02:00
|
|
|
} m_sTitleTexs;
|
2023-08-30 15:39:22 +00:00
|
|
|
};
|