Sparkle 0.0.1
Loading...
Searching...
No Matches
spk_cursor.hpp
1#pragma once
2
3#include <Windows.h>
4#include <string>
5#include <unordered_map>
6
7namespace spk
8{
9 namespace Win32
10 {
20 class Cursor
21 {
22 public:
27 using Handle = HCURSOR;
28
33 static const Cursor *activeCursor();
34
35 private:
36 static inline const Cursor *_activeCursor;
37 Handle _handle;
38
39 public:
44 Cursor(Handle p_handle);
49 const Handle &handle() const;
53 void use() const;
54
59 static const Cursor &arrowCursor();
64 static const Cursor &textEditCursor();
69 static const Cursor &waitCursor();
74 static const Cursor &crossCursor();
79 static const Cursor &altCrossCursor();
84 static const Cursor &resizeNWSECursor();
89 static const Cursor &resizeNESWCursor();
94 static const Cursor &resizeWECursor();
99 static const Cursor &resizeNSCursor();
104 static const Cursor &moveCursor();
109 static const Cursor &noCursor();
114 static const Cursor &handCursor();
119 static const Cursor &workingCursor();
124 static const Cursor &helpCursor();
125 };
126 }
127}
void use() const
Activates this cursor for the current thread.
Definition spk_cursor.cpp:22
static const Cursor & moveCursor()
Returns the move cursor.
Definition spk_cursor.cpp:72
static const Cursor & altCrossCursor()
Returns the alternate crosshair cursor.
Definition spk_cursor.cpp:47
static const Cursor & textEditCursor()
Returns the I-beam text edit cursor.
Definition spk_cursor.cpp:32
static const Cursor & crossCursor()
Returns the crosshair cursor.
Definition spk_cursor.cpp:42
static const Cursor & resizeNSCursor()
Returns the north/south resize cursor.
Definition spk_cursor.cpp:67
static const Cursor & resizeNWSECursor()
Returns the north-west/south-east resize cursor.
Definition spk_cursor.cpp:52
Cursor(Handle p_handle)
Wraps an existing Win32 cursor handle.
Definition spk_cursor.cpp:12
static const Cursor & arrowCursor()
Returns the standard arrow cursor.
Definition spk_cursor.cpp:27
static const Cursor & handCursor()
Returns the hand cursor for clickable elements.
Definition spk_cursor.cpp:82
static const Cursor & workingCursor()
Returns the working cursor.
Definition spk_cursor.cpp:87
const Handle & handle() const
Returns the underlying Win32 handle.
Definition spk_cursor.cpp:17
static const Cursor & resizeWECursor()
Returns the west/east resize cursor.
Definition spk_cursor.cpp:62
static const Cursor & resizeNESWCursor()
Returns the north-east/south-west resize cursor.
Definition spk_cursor.cpp:57
static const Cursor & helpCursor()
Returns the help cursor.
Definition spk_cursor.cpp:92
static const Cursor * activeCursor()
Returns the cursor currently marked as active.
Definition spk_cursor.cpp:7
static const Cursor & waitCursor()
Returns the wait/busy cursor.
Definition spk_cursor.cpp:37
static const Cursor & noCursor()
Returns the hidden cursor.
Definition spk_cursor.cpp:77
HCURSOR Handle
Win32 cursor handle type.
Definition spk_cursor.hpp:27