1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 17:57:34 +00:00

Tear out or duplicate what's unique for WindowServer from Widgets.

This turned into a huge refactoring that somehow also includes
making locks recursive/reentrant.
This commit is contained in:
Andreas Kling 2019-01-16 16:03:50 +01:00
parent e655aebd70
commit f7ca6d254d
30 changed files with 757 additions and 308 deletions

View file

@ -1,43 +0,0 @@
#pragma once
#include "Object.h"
#include "Rect.h"
#include "Size.h"
#include "Keyboard.h"
#include "PS2MouseDevice.h"
class AbstractScreen : public Object, public KeyboardClient {
public:
virtual ~AbstractScreen();
int width() const { return m_width; }
int height() const { return m_height; }
static AbstractScreen& the();
Size size() const { return { width(), height() }; }
Rect rect() const { return { 0, 0, width(), height() }; }
static void initialize();
Point cursor_location() const { return m_cursor_location; }
bool left_mouse_button_pressed() const { return m_left_mouse_button_pressed; }
bool right_mouse_button_pressed() const { return m_right_mouse_button_pressed; }
void on_receive_mouse_data(int dx, int dy, bool left_button, bool right_button);
protected:
AbstractScreen(unsigned width, unsigned height);
private:
// ^KeyboardClient
virtual void on_key_pressed(Keyboard::Key) final;
int m_width { 0 };
int m_height { 0 };
Point m_cursor_location;
bool m_left_mouse_button_pressed { false };
bool m_right_mouse_button_pressed { false };
};