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:
parent
a181a8f6e7
commit
8c84f9749e
18 changed files with 594 additions and 0 deletions
30
Widgets/EventLoop.h
Normal file
30
Widgets/EventLoop.h
Normal 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;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue