diff options
Diffstat (limited to 'Kernel/GUIEventDevice.cpp')
-rw-r--r-- | Kernel/GUIEventDevice.cpp | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Kernel/GUIEventDevice.cpp b/Kernel/GUIEventDevice.cpp deleted file mode 100644 index 36c91e3716..0000000000 --- a/Kernel/GUIEventDevice.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "GUIEventDevice.h" -#include <Kernel/Process.h> -#include <AK/Lock.h> -#include <LibC/errno_numbers.h> -#include <WindowServer/WSMessageLoop.h> - -//#define GUIEVENTDEVICE_DEBUG - -GUIEventDevice::GUIEventDevice() - : CharacterDevice(66, 1) -{ -} - -GUIEventDevice::~GUIEventDevice() -{ -} - -bool GUIEventDevice::can_read(Process& process) const -{ - return !process.gui_events().is_empty(); -} - -ssize_t GUIEventDevice::read(Process& process, byte* buffer, size_t size) -{ -#ifdef GUIEVENTDEVICE_DEBUG - dbgprintf("GUIEventDevice::read(): %s<%u>, size=%u, sizeof(GUI_ServerMessage)=%u\n", process.name().characters(), process.pid(), size, sizeof(GUI_ServerMessage)); -#endif - if (process.gui_events().is_empty()) - return 0; - LOCKER(process.gui_events_lock()); - ASSERT(size == sizeof(GUI_ServerMessage)); - *reinterpret_cast<GUI_ServerMessage*>(buffer) = process.gui_events().take_first(); - return size; -} - -ssize_t GUIEventDevice::write(Process& process, const byte* data, size_t size) -{ - return WSMessageLoop::the().on_receive_from_client(process.gui_client_id(), data, size); -} |