diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:28:37 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-10 05:28:37 +0100 |
commit | f603c1713644a47b661b0173d5015a329442ff70 (patch) | |
tree | d80045b4d28e9a92bd1488ecd9f9e7261e0d1e52 /Widgets/EventLoop.h | |
parent | 3e908abfca00e45ec770f89df729cf272f9a9b9c (diff) | |
download | serenity-f603c1713644a47b661b0173d5015a329442ff70.zip |
Merge EventLoopSDL into EventLoop.
Diffstat (limited to 'Widgets/EventLoop.h')
-rw-r--r-- | Widgets/EventLoop.h | 20 |
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; |