2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-01-16 13:03:50 -02:00
|
|
|
#pragma once
|
|
|
|
|
|
2019-04-21 20:15:47 -03:00
|
|
|
#include <AK/ByteBuffer.h>
|
2020-02-06 11:04:03 -03:00
|
|
|
#include <LibCore/EventLoop.h>
|
|
|
|
|
#include <LibCore/LocalServer.h>
|
|
|
|
|
#include <LibCore/Notifier.h>
|
2019-01-16 13:03:50 -02:00
|
|
|
|
2020-02-06 16:03:37 -03:00
|
|
|
namespace WindowServer {
|
2019-01-16 13:03:50 -02:00
|
|
|
|
2020-02-06 16:03:37 -03:00
|
|
|
class ClientConnection;
|
|
|
|
|
|
|
|
|
|
class EventLoop {
|
2019-01-16 13:03:50 -02:00
|
|
|
public:
|
2020-02-06 16:03:37 -03:00
|
|
|
EventLoop();
|
|
|
|
|
virtual ~EventLoop();
|
2019-01-16 13:03:50 -02:00
|
|
|
|
2019-07-17 06:09:09 -03:00
|
|
|
int exec() { return m_event_loop.exec(); }
|
2019-02-13 14:54:30 -02:00
|
|
|
|
2019-01-16 13:03:50 -02:00
|
|
|
private:
|
2019-01-16 14:20:58 -02:00
|
|
|
void drain_mouse();
|
|
|
|
|
void drain_keyboard();
|
2019-01-16 13:03:50 -02:00
|
|
|
|
2020-02-02 08:34:39 -03:00
|
|
|
Core::EventLoop m_event_loop;
|
2019-01-16 14:20:58 -02:00
|
|
|
int m_keyboard_fd { -1 };
|
2020-02-02 08:34:39 -03:00
|
|
|
RefPtr<Core::Notifier> m_keyboard_notifier;
|
2019-01-16 14:20:58 -02:00
|
|
|
int m_mouse_fd { -1 };
|
2020-02-02 08:34:39 -03:00
|
|
|
RefPtr<Core::Notifier> m_mouse_notifier;
|
2021-04-14 18:38:53 -03:00
|
|
|
RefPtr<Core::LocalServer> m_window_server;
|
|
|
|
|
RefPtr<Core::LocalServer> m_wm_server;
|
2019-01-16 13:03:50 -02:00
|
|
|
};
|
2020-02-06 16:03:37 -03:00
|
|
|
|
|
|
|
|
}
|