2022-05-28 20:46:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
2023-12-29 10:24:56 +01:00
|
|
|
#include <any>
|
2022-05-28 20:46:20 +02:00
|
|
|
#include "../../defines.hpp"
|
2024-06-19 16:20:06 +02:00
|
|
|
#include "../../helpers/math/Math.hpp"
|
2023-11-11 14:37:17 +00:00
|
|
|
#include "DecorationPositioner.hpp"
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-12-07 18:51:18 +01:00
|
|
|
enum eDecorationType : int8_t {
|
2022-05-28 20:46:20 +02:00
|
|
|
DECORATION_NONE = -1,
|
2022-06-25 20:28:40 +02:00
|
|
|
DECORATION_GROUPBAR,
|
2023-02-27 12:32:38 +00:00
|
|
|
DECORATION_SHADOW,
|
2023-12-10 16:28:12 +00:00
|
|
|
DECORATION_BORDER,
|
2023-02-27 12:32:38 +00:00
|
|
|
DECORATION_CUSTOM
|
2022-05-28 20:46:20 +02:00
|
|
|
};
|
|
|
|
|
|
2024-12-07 18:51:18 +01:00
|
|
|
enum eDecorationLayer : uint8_t {
|
2023-11-04 13:10:52 +00:00
|
|
|
DECORATION_LAYER_BOTTOM = 0, /* lowest. */
|
|
|
|
|
DECORATION_LAYER_UNDER, /* under the window, but above BOTTOM */
|
|
|
|
|
DECORATION_LAYER_OVER, /* above the window, but below its popups */
|
|
|
|
|
DECORATION_LAYER_OVERLAY /* above everything of the window, including popups */
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-07 18:51:18 +01:00
|
|
|
enum eDecorationFlags : uint8_t {
|
2023-11-04 13:10:52 +00:00
|
|
|
DECORATION_ALLOWS_MOUSE_INPUT = 1 << 0, /* this decoration accepts mouse input */
|
|
|
|
|
DECORATION_PART_OF_MAIN_WINDOW = 1 << 1, /* this decoration is a *seamless* part of the main window, so stuff like shadows will include it */
|
2023-11-12 13:01:23 +00:00
|
|
|
DECORATION_NON_SOLID = 1 << 2, /* this decoration is not solid. Other decorations should draw on top of it. Example: shadow */
|
2023-11-04 13:10:52 +00:00
|
|
|
};
|
|
|
|
|
|
2022-05-28 20:46:20 +02:00
|
|
|
class CWindow;
|
2022-07-27 12:36:56 +02:00
|
|
|
class CMonitor;
|
2023-11-11 14:37:17 +00:00
|
|
|
class CDecorationPositioner;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-08-07 13:35:19 +02:00
|
|
|
class IHyprWindowDecoration {
|
2022-12-16 17:17:31 +00:00
|
|
|
public:
|
2024-04-27 12:43:12 +01:00
|
|
|
IHyprWindowDecoration(PHLWINDOW);
|
2022-05-28 20:46:20 +02:00
|
|
|
virtual ~IHyprWindowDecoration() = 0;
|
|
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual SDecorationPositioningInfo getPositioningInfo() = 0;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void onPositioningReply(const SDecorationPositioningReply& reply) = 0;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-10-31 00:20:32 +01:00
|
|
|
virtual void draw(PHLMONITOR, float const& a) = 0;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual eDecorationType getDecorationType() = 0;
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2024-04-27 12:43:12 +01:00
|
|
|
virtual void updateWindow(PHLWINDOW) = 0;
|
2023-02-28 19:36:36 +00:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void damageEntire() = 0; // should be ignored by non-absolute decos
|
2023-02-28 22:32:42 +00: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-10-29 20:14:47 +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();
|
|
|
|
|
|
2023-08-30 15:39:22 +00:00
|
|
|
private:
|
2024-04-27 12:43:12 +01:00
|
|
|
PHLWINDOWREF m_pWindow;
|
2023-11-11 14:37:17 +00:00
|
|
|
|
|
|
|
|
friend class CDecorationPositioner;
|
2023-08-30 15:39:22 +00:00
|
|
|
};
|