Files
ladybird/Servers/WindowServer/WSEventLoop.h
Robin Burchell 3837de0573 WSEventLoop: Remove inheritance from CEventLoop
The only reason for the inheritance was to add FDs to the select set.

Since CNotifier is available (and now also quite useful), we can make use of it
instead, and remove the inheritance.
2019-07-17 20:16:44 +02:00

31 lines
649 B
C++

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