summaryrefslogtreecommitdiff
path: root/Widgets/EventLoop.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-10 05:28:37 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-10 05:28:37 +0100
commitf603c1713644a47b661b0173d5015a329442ff70 (patch)
treed80045b4d28e9a92bd1488ecd9f9e7261e0d1e52 /Widgets/EventLoop.h
parent3e908abfca00e45ec770f89df729cf272f9a9b9c (diff)
downloadserenity-f603c1713644a47b661b0173d5015a329442ff70.zip
Merge EventLoopSDL into EventLoop.
Diffstat (limited to 'Widgets/EventLoop.h')
-rw-r--r--Widgets/EventLoop.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/Widgets/EventLoop.h b/Widgets/EventLoop.h
index ca8b912bc0..9b112ab59b 100644
--- a/Widgets/EventLoop.h
+++ b/Widgets/EventLoop.h
@@ -1,27 +1,33 @@
#pragma once
+#include "Event.h"
#include <AK/OwnPtr.h>
#include <AK/Vector.h>
-class Event;
+#ifdef USE_SDL
+#include <SDL.h>
+#endif
+
class Object;
class EventLoop {
public:
- virtual ~EventLoop();
+ EventLoop();
+ ~EventLoop();
int exec();
- virtual void waitForEvent() = 0;
-
void postEvent(Object* receiver, OwnPtr<Event>&&);
static EventLoop& main();
-protected:
- EventLoop();
-
private:
+ void waitForEvent();
+
+#ifdef USE_SDL
+ void handleKeyEvent(Event::Type, const SDL_KeyboardEvent&);
+#endif
+
struct QueuedEvent {
Object* receiver { nullptr };
OwnPtr<Event> event;