mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 23:57:25 +00:00
Okay things kinda sorta work. Both Bochs and QEMU now boot into GUI mode. There's a ton of stuff that doesn't make sense and so many things to rework. Still it's quite cool to have made it this far. :^)
39 lines
596 B
C++
39 lines
596 B
C++
#pragma once
|
|
|
|
#include "Event.h"
|
|
#include <AK/OwnPtr.h>
|
|
#include <AK/Vector.h>
|
|
|
|
#ifdef USE_SDL
|
|
#include <SDL.h>
|
|
#endif
|
|
|
|
class Object;
|
|
|
|
class EventLoop {
|
|
public:
|
|
EventLoop();
|
|
~EventLoop();
|
|
|
|
int exec();
|
|
|
|
void postEvent(Object* receiver, OwnPtr<Event>&&);
|
|
|
|
static EventLoop& main();
|
|
|
|
static void initialize();
|
|
|
|
private:
|
|
void waitForEvent();
|
|
|
|
#ifdef USE_SDL
|
|
void handleKeyEvent(Event::Type, const SDL_KeyboardEvent&);
|
|
#endif
|
|
|
|
struct QueuedEvent {
|
|
Object* receiver { nullptr };
|
|
OwnPtr<Event> event;
|
|
};
|
|
Vector<QueuedEvent> m_queuedEvents;
|
|
};
|