Hyprland/src/managers/EventManager.hpp
vaxerski ba7e3cd9a1 Major IPC Rework + Added Socket2
IPC is now done with UNIX sockets instead of TCP ones (security!), and added Socket2, see Wiki.
2022-05-24 19:42:43 +02:00

30 lines
No EOL
549 B
C++

#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;