2022-05-28 20:46:20 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "../../defines.hpp"
|
2023-08-30 15:39:22 +00:00
|
|
|
#include "../../helpers/Region.hpp"
|
2023-11-11 14:37:17 +00:00
|
|
|
#include "DecorationPositioner.hpp"
|
2022-05-28 20:46:20 +02:00
|
|
|
|
2023-12-06 23:54:56 +01:00
|
|
|
enum eDecorationType {
|
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
|
|
|
};
|
|
|
|
|
|
2023-12-06 23:54:56 +01:00
|
|
|
enum eDecorationLayer {
|
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 */
|
|
|
|
|
};
|
|
|
|
|
|
2023-12-06 23:54:56 +01:00
|
|
|
enum eDecorationFlags {
|
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:
|
2023-08-30 15:39:22 +00:00
|
|
|
IHyprWindowDecoration(CWindow*);
|
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
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void draw(CMonitor*, float a, const Vector2D& offset = Vector2D()) = 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
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void updateWindow(CWindow*) = 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-11-11 14:37:17 +00:00
|
|
|
virtual void onBeginWindowDragOnDeco(const Vector2D&); // called when the user calls the "movewindow" mouse dispatcher on the deco
|
2023-08-30 15:39:22 +00:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual bool onEndWindowDragOnDeco(CWindow* pDraggedWindow, const Vector2D&); // returns true if the window should be placed by the layout
|
2023-10-29 20:14:47 +00:00
|
|
|
|
2023-11-11 14:37:17 +00:00
|
|
|
virtual void onMouseButtonOnDeco(const Vector2D&, wlr_pointer_button_event*);
|
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:
|
|
|
|
|
CWindow* m_pWindow = nullptr;
|
2023-11-11 14:37:17 +00:00
|
|
|
|
|
|
|
|
friend class CDecorationPositioner;
|
2023-08-30 15:39:22 +00:00
|
|
|
};
|