1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00
serenity/LibGUI/GEventLoop.h
2019-01-20 04:49:48 +01:00

34 lines
558 B
C++

#pragma once
#include "GEvent.h"
#include <AK/OwnPtr.h>
#include <AK/Vector.h>
class GObject;
class GEventLoop {
public:
GEventLoop();
~GEventLoop();
int exec();
void postEvent(GObject* receiver, OwnPtr<GEvent>&&);
static GEventLoop& main();
static void initialize();
bool running() const { return m_running; }
private:
void waitForEvent();
struct QueuedEvent {
GObject* receiver { nullptr };
OwnPtr<GEvent> event;
};
Vector<QueuedEvent> m_queuedEvents;
bool m_running { false };
};