1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:27:45 +00:00

Start working on a Widgets library.

This commit is contained in:
Andreas Kling 2018-10-10 15:12:38 +02:00
parent a181a8f6e7
commit 8c84f9749e
18 changed files with 594 additions and 0 deletions

30
Widgets/EventLoop.h Normal file
View file

@ -0,0 +1,30 @@
#pragma once
#include <AK/OwnPtr.h>
#include <AK/Vector.h>
class Event;
class Object;
class EventLoop {
public:
virtual ~EventLoop();
int exec();
virtual void waitForEvent() = 0;
void postEvent(Object* receiver, OwnPtr<Event>&&);
static EventLoop& main();
protected:
EventLoop();
private:
struct QueuedEvent {
Object* receiver { nullptr };
OwnPtr<Event> event;
};
Vector<QueuedEvent> m_queuedEvents;
};