summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-02-15 08:58:03 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-02-15 08:59:55 +0100
commit18210c606da4315afe9ec984395350a25271594f (patch)
treeb9bbae28d2ffcd56fab9f3df32d2c6cb5a7eb1bd
parente9d6fbfb478c43e3d23ba71182925985202c75c4 (diff)
downloadserenity-18210c606da4315afe9ec984395350a25271594f.zip
Kernel: Remove GUIEventDevice.
It's no longer used since all communication now happens across sockets. :^)
-rw-r--r--Kernel/GUIEventDevice.cpp39
-rw-r--r--Kernel/GUIEventDevice.h18
-rw-r--r--Kernel/Makefile1
-rw-r--r--Kernel/Process.h7
-rw-r--r--Kernel/init.cpp4
-rwxr-xr-xKernel/sync.sh1
-rw-r--r--WindowServer/WSMenu.cpp1
-rw-r--r--WindowServer/WSMessageLoop.cpp1
-rw-r--r--WindowServer/WSWindow.cpp1
9 files changed, 3 insertions, 70 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);
-}
diff --git a/Kernel/GUIEventDevice.h b/Kernel/GUIEventDevice.h
deleted file mode 100644
index f9ce778494..0000000000
--- a/Kernel/GUIEventDevice.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include <Kernel/CharacterDevice.h>
-#include <Kernel/DoubleBuffer.h>
-
-class GUIEventDevice final : public CharacterDevice {
-public:
- GUIEventDevice();
- virtual ~GUIEventDevice() override;
-
-private:
- // ^CharacterDevice
- virtual ssize_t read(Process&, byte* buffer, size_t bufferSize) override;
- virtual ssize_t write(Process&, const byte* buffer, size_t bufferSize) override;
- virtual bool can_read(Process&) const override;
- virtual bool can_write(Process&) const override { return true; }
- virtual const char* class_name() const override { return "GUIEventDevice"; }
-};
diff --git a/Kernel/Makefile b/Kernel/Makefile
index 10e8458184..fa2d01cfe1 100644
--- a/Kernel/Makefile
+++ b/Kernel/Makefile
@@ -32,7 +32,6 @@ KERNEL_OBJS = \
BochsVGADevice.o \
PCI.o \
PS2MouseDevice.o \
- GUIEventDevice.o \
Socket.o \
LocalSocket.o
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 3894c78869..f030acdf24 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -5,7 +5,6 @@
#include "i386.h"
#include "TTY.h"
#include "Syscall.h"
-#include "GUITypes.h"
#include <Kernel/VirtualFileSystem.h>
#include <Kernel/UnixTypes.h>
#include <AK/InlineLinkedList.h>
@@ -287,9 +286,6 @@ public:
bool is_root() const { return m_euid == 0; }
- Vector<GUI_ServerMessage>& gui_events() { return m_gui_events; }
- Lock& gui_events_lock() { return m_gui_events_lock; }
-
bool wakeup_requested() { return m_wakeup_requested; }
void request_wakeup() { m_wakeup_requested = true; }
@@ -401,9 +397,6 @@ private:
RetainPtr<Region> m_display_framebuffer_region;
- Vector<GUI_ServerMessage> m_gui_events;
- Lock m_gui_events_lock;
-
dword m_wakeup_requested { false };
bool m_has_used_fpu { false };
};
diff --git a/Kernel/init.cpp b/Kernel/init.cpp
index 9fc605a2c0..632c00b2f4 100644
--- a/Kernel/init.cpp
+++ b/Kernel/init.cpp
@@ -14,7 +14,6 @@
#include <Kernel/RandomDevice.h>
#include <Kernel/Ext2FileSystem.h>
#include <Kernel/VirtualFileSystem.h>
-#include "GUIEventDevice.h"
#include "MemoryManager.h"
#include "ProcFS.h"
#include "RTC.h"
@@ -41,7 +40,6 @@ VirtualConsole* tty2;
VirtualConsole* tty3;
Keyboard* keyboard;
PS2MouseDevice* ps2mouse;
-GUIEventDevice* gui_event_device;
NullDevice* dev_null;
VFS* vfs;
@@ -85,7 +83,6 @@ static void init_stage2()
vfs->register_character_device(*keyboard);
vfs->register_character_device(*ps2mouse);
- vfs->register_character_device(*gui_event_device);
vfs->register_character_device(*tty0);
vfs->register_character_device(*tty1);
vfs->register_character_device(*tty2);
@@ -157,7 +154,6 @@ void init()
keyboard = new Keyboard;
ps2mouse = new PS2MouseDevice;
- gui_event_device = new GUIEventDevice;
dev_null = new NullDevice;
VirtualConsole::initialize();
diff --git a/Kernel/sync.sh b/Kernel/sync.sh
index 087f096c0a..7499a71413 100755
--- a/Kernel/sync.sh
+++ b/Kernel/sync.sh
@@ -27,7 +27,6 @@ mknod mnt/dev/full c 1 7
mknod mnt/dev/keyboard c 85 1
mknod mnt/dev/psaux c 10 1
mknod mnt/dev/ptmx c 5 2
-mknod mnt/dev/gui_events c 66 1
ln -s /proc/self/fd/0 mnt/dev/stdin
ln -s /proc/self/fd/1 mnt/dev/stdout
ln -s /proc/self/fd/2 mnt/dev/stderr
diff --git a/WindowServer/WSMenu.cpp b/WindowServer/WSMenu.cpp
index 4cef867ae0..3cdba5c9d7 100644
--- a/WindowServer/WSMenu.cpp
+++ b/WindowServer/WSMenu.cpp
@@ -4,6 +4,7 @@
#include "WSMessage.h"
#include "WSMessageLoop.h"
#include "WSWindowManager.h"
+#include <Kernel/GUITypes.h>
#include <WindowServer/WSClientConnection.h>
#include <SharedGraphics/Painter.h>
#include <SharedGraphics/Font.h>
diff --git a/WindowServer/WSMessageLoop.cpp b/WindowServer/WSMessageLoop.cpp
index c554220186..1559210e71 100644
--- a/WindowServer/WSMessageLoop.cpp
+++ b/WindowServer/WSMessageLoop.cpp
@@ -6,6 +6,7 @@
#include <WindowServer/WSClientConnection.h>
#include "PS2MouseDevice.h"
#include <Kernel/Keyboard.h>
+#include <Kernel/GUITypes.h>
#include <AK/Bitmap.h>
#include "Process.h"
diff --git a/WindowServer/WSWindow.cpp b/WindowServer/WSWindow.cpp
index 58a13d1ad3..c3f9f9d9fa 100644
--- a/WindowServer/WSWindow.cpp
+++ b/WindowServer/WSWindow.cpp
@@ -2,6 +2,7 @@
#include "WSWindowManager.h"
#include "WSMessage.h"
#include "WSMessageLoop.h"
+#include <Kernel/GUITypes.h>
#include <WindowServer/WSClientConnection.h>
WSWindow::WSWindow(WSMenu& menu)