1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-14 08:07:36 +00:00
serenity/Servers/WindowServer/WSCursor.h
Andreas Kling 1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.

This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00

33 lines
859 B
C++

#pragma once
#include <LibDraw/GraphicsBitmap.h>
enum class WSStandardCursor {
None = 0,
Arrow,
IBeam,
ResizeHorizontal,
ResizeVertical,
ResizeDiagonalTLBR,
ResizeDiagonalBLTR,
};
class WSCursor : public RefCounted<WSCursor> {
public:
static NonnullRefPtr<WSCursor> create(NonnullRefPtr<GraphicsBitmap>&&, const Point& hotspot);
static NonnullRefPtr<WSCursor> create(NonnullRefPtr<GraphicsBitmap>&&);
static RefPtr<WSCursor> create(WSStandardCursor);
~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(NonnullRefPtr<GraphicsBitmap>&&, const Point&);
RefPtr<GraphicsBitmap> m_bitmap;
Point m_hotspot;
};