summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/Event.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-11-01 14:23:22 -0400
committerLinus Groh <mail@linusgroh.de>2022-11-01 21:16:50 +0000
commitf7e747b68e5f5dd44f4fb9462ff8bf16a5630c0c (patch)
tree752ee3699bf355a9e4db33d11057dc7d570c89c6 /Userland/Libraries/LibGUI/Event.h
parent6b41da0b9e98ce604a42648788785b9819c8fca2 (diff)
downloadserenity-f7e747b68e5f5dd44f4fb9462ff8bf16a5630c0c.zip
LibGUI+WindowServer: Create and broadcast an event when a window moves
LibWeb's Window object will need to know the OS-level position and size of the GUI::Window for e.g. screenX, screenY, outerWidth, outerHeight. It will also need to know about changes to that data.
Diffstat (limited to 'Userland/Libraries/LibGUI/Event.h')
-rw-r--r--Userland/Libraries/LibGUI/Event.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Event.h b/Userland/Libraries/LibGUI/Event.h
index a3366122ef..9d9597df12 100644
--- a/Userland/Libraries/LibGUI/Event.h
+++ b/Userland/Libraries/LibGUI/Event.h
@@ -28,6 +28,7 @@ public:
Paint,
MultiPaint,
Resize,
+ Move,
MouseMove,
MouseDown,
MouseDoubleClick,
@@ -310,6 +311,20 @@ private:
Gfx::IntSize m_size;
};
+class MoveEvent final : public Event {
+public:
+ explicit MoveEvent(Gfx::IntPoint const& size)
+ : Event(Event::Move)
+ , m_position(size)
+ {
+ }
+
+ Gfx::IntPoint const& position() const { return m_position; }
+
+private:
+ Gfx::IntPoint m_position;
+};
+
class ContextMenuEvent final : public Event {
public:
explicit ContextMenuEvent(Gfx::IntPoint const& position, Gfx::IntPoint const& screen_position)