mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
To get truly atomic updates, add a mechanism for passing arbitrary amounts of extra data along with WindowServer messages. This allows us to pass all the rects in a single message.
30 lines
813 B
C++
30 lines
813 B
C++
#pragma once
|
|
|
|
#include <LibCore/CEventLoop.h>
|
|
#include <AK/ByteBuffer.h>
|
|
|
|
class WSClientConnection;
|
|
struct WSAPI_ClientMessage;
|
|
|
|
class WSEventLoop : public CEventLoop {
|
|
public:
|
|
WSEventLoop();
|
|
virtual ~WSEventLoop() override;
|
|
|
|
static WSEventLoop& the() { return static_cast<WSEventLoop&>(CEventLoop::current()); }
|
|
|
|
private:
|
|
virtual void add_file_descriptors_for_select(fd_set&, int& max_fd_added) override;
|
|
virtual void process_file_descriptors_after_select(const fd_set&) override;
|
|
|
|
void drain_server();
|
|
void drain_mouse();
|
|
void drain_keyboard();
|
|
void drain_client(WSClientConnection&);
|
|
bool on_receive_from_client(int client_id, const WSAPI_ClientMessage&, ByteBuffer&& extra_data);
|
|
|
|
int m_keyboard_fd { -1 };
|
|
int m_mouse_fd { -1 };
|
|
int m_server_fd { -1 };
|
|
};
|