summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSCursor.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-31 22:09:10 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-03-31 22:09:10 +0200
commit2334ffcbf8d621c0d4feaa6c1323efc0c130e3dc (patch)
treece326ef483dd82fa85dafdb3d96560bf635de3d3 /Servers/WindowServer/WSCursor.h
parent25f28a54a131c4aa188ba2c4c453c1b1648d02c6 (diff)
downloadserenity-2334ffcbf8d621c0d4feaa6c1323efc0c130e3dc.zip
WindowServer: Add a WSCursor class (a bitmap and a hotspot.)
Also import a bunch of cursors I drew. Only the default ("arrow") cursor is ever used so far.
Diffstat (limited to 'Servers/WindowServer/WSCursor.h')
-rw-r--r--Servers/WindowServer/WSCursor.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Servers/WindowServer/WSCursor.h b/Servers/WindowServer/WSCursor.h
new file mode 100644
index 0000000000..7125ad2a78
--- /dev/null
+++ b/Servers/WindowServer/WSCursor.h
@@ -0,0 +1,22 @@
+#pragma once
+
+#include <SharedGraphics/GraphicsBitmap.h>
+
+class WSCursor : public Retainable<WSCursor> {
+public:
+ static Retained<WSCursor> create(Retained<GraphicsBitmap>&&, const Point& hotspot);
+ static Retained<WSCursor> create(Retained<GraphicsBitmap>&&);
+ ~WSCursor();
+
+ Point hotspot() const { return m_hotspot; }
+ const GraphicsBitmap& bitmap() const { return *m_bitmap; }
+
+ Rect rect() const { return m_bitmap->rect(); }
+ Size size() const { return m_bitmap->size(); }
+
+private:
+ WSCursor(Retained<GraphicsBitmap>&&, const Point&);
+
+ RetainPtr<GraphicsBitmap> m_bitmap;
+ Point m_hotspot;
+};