ladybird/Servers/WindowServer/WSEventLoop.h
Andreas Kling 272d65e3e2 WindowServer: Port to the new IPC system
This patch introduces code generation for the WindowServer IPC with
its clients. The client/server endpoints are defined by the two .ipc
files in Servers/WindowServer/: WindowServer.ipc and WindowClient.ipc

It now becomes significantly easier to add features and capabilities
to WindowServer since you don't have to know nearly as much about all
the intricate paths that IPC messages take between LibGUI and WSWindow.

The new system also uses significantly less IPC bandwidth since we're
now doing packed serialization instead of passing fixed-sized structs
of ~600 bytes for each message.

Some repaint coalescing optimizations are lost in this conversion and
we'll need to look at how to implement those in the new world.

The old CoreIPC::Client::Connection and CoreIPC::Server::Connection
classes are removed by this patch and replaced by use of ConnectionNG,
which will be renamed eventually.

Goodbye, old WindowServer IPC. You served us well :^)
2019-12-02 11:11:05 +01:00

27 lines
558 B
C++

#pragma once
#include <AK/ByteBuffer.h>
#include <LibCore/CEventLoop.h>
#include <LibCore/CLocalServer.h>
#include <LibCore/CNotifier.h>
class WSClientConnection;
class WSEventLoop {
public:
WSEventLoop();
virtual ~WSEventLoop();
int exec() { return m_event_loop.exec(); }
private:
void drain_mouse();
void drain_keyboard();
CEventLoop m_event_loop;
int m_keyboard_fd { -1 };
RefPtr<CNotifier> m_keyboard_notifier;
int m_mouse_fd { -1 };
RefPtr<CNotifier> m_mouse_notifier;
RefPtr<CLocalServer> m_server;
};