summaryrefslogtreecommitdiff
path: root/src/debug/HyprNotificationOverlay.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2023-02-27 12:32:38 +0000
committerGitHub <noreply@github.com>2023-02-27 12:32:38 +0000
commit8b81f41e52b55835aaaa7e4962af23a00188cbdc (patch)
treebca65923843ea931c0e0222f29d4e2901cfa8637 /src/debug/HyprNotificationOverlay.hpp
parent74a10f26a469de54968e584525f6507928f615f0 (diff)
Plugin System (#1590)
--------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
Diffstat (limited to 'src/debug/HyprNotificationOverlay.hpp')
-rw-r--r--src/debug/HyprNotificationOverlay.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/debug/HyprNotificationOverlay.hpp b/src/debug/HyprNotificationOverlay.hpp
new file mode 100644
index 00000000..12ad8e38
--- /dev/null
+++ b/src/debug/HyprNotificationOverlay.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "../defines.hpp"
+#include "../helpers/Timer.hpp"
+#include "../helpers/Monitor.hpp"
+#include "../render/Texture.hpp"
+
+#include <deque>
+
+#include <cairo/cairo.h>
+
+struct SNotification {
+ std::string text = "";
+ CColor color;
+ CTimer started;
+ float timeMs = 0;
+};
+
+class CHyprNotificationOverlay {
+ public:
+ CHyprNotificationOverlay();
+
+ void draw(CMonitor* pMonitor);
+ void addNotification(const std::string& text, const CColor& color, const float timeMs);
+
+ private:
+ wlr_box drawNotifications(CMonitor* pMonitor);
+ wlr_box m_bLastDamage;
+
+ std::deque<std::unique_ptr<SNotification>> m_dNotifications;
+
+ cairo_surface_t* m_pCairoSurface = nullptr;
+ cairo_t* m_pCairo = nullptr;
+
+ CMonitor* m_pLastMonitor = nullptr;
+
+ CTexture m_tTexture;
+};
+
+inline std::unique_ptr<CHyprNotificationOverlay> g_pHyprNotificationOverlay; \ No newline at end of file