diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-14 14:21:51 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-14 14:42:49 +0100 |
commit | b0e3f733759a006622b14f75c5379641ef82776f (patch) | |
tree | 010bff69271f7174c1f4728a371785d010a602db /Widgets/GUIEventDevice.h | |
parent | b4da4e8fbdccd34792579f82338e09a727177b33 (diff) | |
download | serenity-b0e3f733759a006622b14f75c5379641ef82776f.zip |
Start refactoring the windowing system to use an event loop.
Userspace programs can now open /dev/gui_events and read a stream of GUI_Event
structs one at a time.
I was stuck on a stupid problem where we'd reenter Scheduler::yield() due to
having one of the has_data_available_for_reading() implementations using locks.
Diffstat (limited to 'Widgets/GUIEventDevice.h')
-rw-r--r-- | Widgets/GUIEventDevice.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Widgets/GUIEventDevice.h b/Widgets/GUIEventDevice.h new file mode 100644 index 0000000000..061fc96e71 --- /dev/null +++ b/Widgets/GUIEventDevice.h @@ -0,0 +1,14 @@ +#pragma once + +#include <VirtualFileSystem/CharacterDevice.h> + +class GUIEventDevice final : public CharacterDevice { +public: + GUIEventDevice(); + virtual ~GUIEventDevice() override; + +private: + virtual bool has_data_available_for_reading(Process&) const override; + virtual ssize_t read(byte* buffer, size_t bufferSize) override; + virtual ssize_t write(const byte* buffer, size_t bufferSize) override; +}; |