2022-05-24 19:42:43 +02:00
|
|
|
#pragma once
|
|
|
|
#include <deque>
|
|
|
|
#include <fstream>
|
2022-05-25 17:26:26 +02:00
|
|
|
#include <mutex>
|
2022-05-24 19:42:43 +02:00
|
|
|
|
|
|
|
#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();
|
|
|
|
|
2022-06-21 22:17:30 +02:00
|
|
|
bool m_bIgnoreEvents = false;
|
|
|
|
|
2022-05-24 19:42:43 +02:00
|
|
|
private:
|
|
|
|
|
2022-05-25 17:26:26 +02:00
|
|
|
std::mutex eventQueueMutex;
|
2022-05-24 19:42:43 +02:00
|
|
|
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
|
|
|
|
|
|
|
std::deque<int> m_dAcceptedSocketFDs;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline std::unique_ptr<CEventManager> g_pEventManager;
|