mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-26 21:49:49 +01:00
4a42344e97
* style: apply clang-format * ci: add new clang-format job to CI
33 lines
714 B
C++
33 lines
714 B
C++
#pragma once
|
|
#include <deque>
|
|
#include <fstream>
|
|
#include <mutex>
|
|
|
|
#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();
|
|
|
|
std::thread m_tThread;
|
|
|
|
private:
|
|
void flushEvents();
|
|
|
|
std::mutex eventQueueMutex;
|
|
std::deque<SHyprIPCEvent> m_dQueuedEvents;
|
|
|
|
std::deque<std::pair<int, wl_event_source*>> m_dAcceptedSocketFDs;
|
|
};
|
|
|
|
inline std::unique_ptr<CEventManager> g_pEventManager;
|