summaryrefslogtreecommitdiff
path: root/src/managers/EventManager.hpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-24 19:42:43 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-05-24 19:42:43 +0200
commitba7e3cd9a18d6c74bc1f3819ec7485e25daf3472 (patch)
treefdc6cf727d47b4adc953f1c9edfc0f1686ad8a63 /src/managers/EventManager.hpp
parentd8d8a29fc2a6e134c15dac64a919991b535acca4 (diff)
Major IPC Rework + Added Socket2
IPC is now done with UNIX sockets instead of TCP ones (security!), and added Socket2, see Wiki.
Diffstat (limited to 'src/managers/EventManager.hpp')
-rw-r--r--src/managers/EventManager.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/managers/EventManager.hpp b/src/managers/EventManager.hpp
new file mode 100644
index 00000000..b5c4d3a6
--- /dev/null
+++ b/src/managers/EventManager.hpp
@@ -0,0 +1,30 @@
+#pragma once
+#include <deque>
+#include <fstream>
+
+#include "../defines.hpp"
+#include "../helpers/MiscFunctions.hpp"
+
+struct SHyprIPCEvent {
+ std::string event;
+ std::string data;
+};
+
+class CEventManager {
+public:
+ CEventManager();
+
+ void postEvent(const SHyprIPCEvent event);
+
+ void startThread();
+
+private:
+
+ bool m_bCanReadEventQueue = true;
+ bool m_bCanWriteEventQueue = true;
+ std::deque<SHyprIPCEvent> m_dQueuedEvents;
+
+ std::deque<int> m_dAcceptedSocketFDs;
+};
+
+inline std::unique_ptr<CEventManager> g_pEventManager; \ No newline at end of file