Kernel: Remove GUIEventDevice.

It's no longer used since all communication now happens across sockets. :^)
This commit is contained in:
Andreas Kling 2019-02-15 08:58:03 +01:00
parent e9d6fbfb47
commit 18210c606d
Notes: sideshowbarker 2024-07-19 15:42:46 +09:00
9 changed files with 3 additions and 70 deletions

View File

@ -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);
}

View File

@ -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"; }
};

View File

@ -32,7 +32,6 @@ KERNEL_OBJS = \
BochsVGADevice.o \ BochsVGADevice.o \
PCI.o \ PCI.o \
PS2MouseDevice.o \ PS2MouseDevice.o \
GUIEventDevice.o \
Socket.o \ Socket.o \
LocalSocket.o LocalSocket.o

View File

@ -5,7 +5,6 @@
#include "i386.h" #include "i386.h"
#include "TTY.h" #include "TTY.h"
#include "Syscall.h" #include "Syscall.h"
#include "GUITypes.h"
#include <Kernel/VirtualFileSystem.h> #include <Kernel/VirtualFileSystem.h>
#include <Kernel/UnixTypes.h> #include <Kernel/UnixTypes.h>
#include <AK/InlineLinkedList.h> #include <AK/InlineLinkedList.h>
@ -287,9 +286,6 @@ public:
bool is_root() const { return m_euid == 0; } 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; } bool wakeup_requested() { return m_wakeup_requested; }
void request_wakeup() { m_wakeup_requested = true; } void request_wakeup() { m_wakeup_requested = true; }
@ -401,9 +397,6 @@ private:
RetainPtr<Region> m_display_framebuffer_region; RetainPtr<Region> m_display_framebuffer_region;
Vector<GUI_ServerMessage> m_gui_events;
Lock m_gui_events_lock;
dword m_wakeup_requested { false }; dword m_wakeup_requested { false };
bool m_has_used_fpu { false }; bool m_has_used_fpu { false };
}; };

View File

@ -14,7 +14,6 @@
#include <Kernel/RandomDevice.h> #include <Kernel/RandomDevice.h>
#include <Kernel/Ext2FileSystem.h> #include <Kernel/Ext2FileSystem.h>
#include <Kernel/VirtualFileSystem.h> #include <Kernel/VirtualFileSystem.h>
#include "GUIEventDevice.h"
#include "MemoryManager.h" #include "MemoryManager.h"
#include "ProcFS.h" #include "ProcFS.h"
#include "RTC.h" #include "RTC.h"
@ -41,7 +40,6 @@ VirtualConsole* tty2;
VirtualConsole* tty3; VirtualConsole* tty3;
Keyboard* keyboard; Keyboard* keyboard;
PS2MouseDevice* ps2mouse; PS2MouseDevice* ps2mouse;
GUIEventDevice* gui_event_device;
NullDevice* dev_null; NullDevice* dev_null;
VFS* vfs; VFS* vfs;
@ -85,7 +83,6 @@ static void init_stage2()
vfs->register_character_device(*keyboard); vfs->register_character_device(*keyboard);
vfs->register_character_device(*ps2mouse); vfs->register_character_device(*ps2mouse);
vfs->register_character_device(*gui_event_device);
vfs->register_character_device(*tty0); vfs->register_character_device(*tty0);
vfs->register_character_device(*tty1); vfs->register_character_device(*tty1);
vfs->register_character_device(*tty2); vfs->register_character_device(*tty2);
@ -157,7 +154,6 @@ void init()
keyboard = new Keyboard; keyboard = new Keyboard;
ps2mouse = new PS2MouseDevice; ps2mouse = new PS2MouseDevice;
gui_event_device = new GUIEventDevice;
dev_null = new NullDevice; dev_null = new NullDevice;
VirtualConsole::initialize(); VirtualConsole::initialize();

View File

@ -27,7 +27,6 @@ mknod mnt/dev/full c 1 7
mknod mnt/dev/keyboard c 85 1 mknod mnt/dev/keyboard c 85 1
mknod mnt/dev/psaux c 10 1 mknod mnt/dev/psaux c 10 1
mknod mnt/dev/ptmx c 5 2 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/0 mnt/dev/stdin
ln -s /proc/self/fd/1 mnt/dev/stdout ln -s /proc/self/fd/1 mnt/dev/stdout
ln -s /proc/self/fd/2 mnt/dev/stderr ln -s /proc/self/fd/2 mnt/dev/stderr

View File

@ -4,6 +4,7 @@
#include "WSMessage.h" #include "WSMessage.h"
#include "WSMessageLoop.h" #include "WSMessageLoop.h"
#include "WSWindowManager.h" #include "WSWindowManager.h"
#include <Kernel/GUITypes.h>
#include <WindowServer/WSClientConnection.h> #include <WindowServer/WSClientConnection.h>
#include <SharedGraphics/Painter.h> #include <SharedGraphics/Painter.h>
#include <SharedGraphics/Font.h> #include <SharedGraphics/Font.h>

View File

@ -6,6 +6,7 @@
#include <WindowServer/WSClientConnection.h> #include <WindowServer/WSClientConnection.h>
#include "PS2MouseDevice.h" #include "PS2MouseDevice.h"
#include <Kernel/Keyboard.h> #include <Kernel/Keyboard.h>
#include <Kernel/GUITypes.h>
#include <AK/Bitmap.h> #include <AK/Bitmap.h>
#include "Process.h" #include "Process.h"

View File

@ -2,6 +2,7 @@
#include "WSWindowManager.h" #include "WSWindowManager.h"
#include "WSMessage.h" #include "WSMessage.h"
#include "WSMessageLoop.h" #include "WSMessageLoop.h"
#include <Kernel/GUITypes.h>
#include <WindowServer/WSClientConnection.h> #include <WindowServer/WSClientConnection.h>
WSWindow::WSWindow(WSMenu& menu) WSWindow::WSWindow(WSMenu& menu)