ladybird/Servers/WindowServer/WSCursor.h
Andreas Kling ea9a39a9f2 LibGUI+WindowServer: Add a GResizeCorner widget.
This widget is automatically included in GStatusBar, but can be added in
any other place, too. When clicked (with the left button), it initiates a
window resize (using a WM request.)

In this patch I also fixed up some issues with override cursors being
cleared after the WindowServer finishes a drag or resize.
2019-05-03 01:38:24 +02:00

33 lines
847 B
C++

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