Class to handle an operating system cursor. More...
Public Types | |
enum | eCursor { CURSOR_NONE , CURSOR_ARROW , CURSOR_IBEAM , CURSOR_WAIT , CURSOR_CROSS , CURSOR_COUNT , CURSOR_CUSTOM } |
Public Member Functions | |
~OSCursor () | |
Release all cursor resources. | |
Static Public Member Functions | |
static uint_t | IsVisible (void) noexcept |
Return the current state of the visible flag. | |
static uint_t | IsActive (void) noexcept |
Return TRUE if a cursor is visible while the mouse is in the client area. | |
static uint_t | GetImageIDNumber (void) noexcept |
Return the current cursor shape number. | |
static uint_t | IsThisADesktop (void) noexcept |
Is there a desktop cursor? | |
static void | SetImageFromIDNumber (eCursor eCursorNumber) noexcept |
Load an OS resource and set the cursor to it. | |
static void | SetImage (const OSCursorImage *pImage) noexcept |
Set the cursor to a generated cursor. | |
static uint_t | Show (void) noexcept |
Make an OS cursor visible. | |
static uint_t | Show (uint_t bVisible) noexcept |
Make an OS cursor visible if non-zero. | |
static uint_t | Hide (void) noexcept |
Make an OS cursor disappear. | |
static void | Init (void) noexcept |
Reset an OS cursor to an arrow and make it visible. | |
static void | Shutdown (void) noexcept |
Release all resources allocated by the cursor. | |
static void | Refresh (void) noexcept |
If a custom cursor is defined, refresh the operating system. | |
Private Member Functions | |
OSCursor (const OSCursor &)=delete | |
OSCursor & | operator= (const OSCursor &)=delete |
OSCursor (OSCursor &&)=delete | |
OSCursor & | operator= (OSCursor &&)=delete |
OSCursor () noexcept | |
Initialize the defaults. | |
Private Attributes | |
CCrsr ** | m_pCursorImage |
MacOS only, handle to the cursor image. | |
HICON__ * | m_pCursorImage |
Windows only, handle to the cursor image. | |
uint_t | m_bVisibleFlag |
TRUE if the cursor is visible | |
uint_t | m_bActiveFlag |
TRUE if a game cursor is loaded | |
eCursor | m_eIDNumber |
ID Number of the currently set cursor. | |
Static Private Attributes | |
static OSCursor | g_Global |
Singleton instance of the Burger::OSCursor class. | |
Class to handle an operating system cursor.
For desktop operating systems like MacOS, Windows and Linux, a mouse cursor is drawn and updated by the operating system. This class standardizes the behavior of the cursor and allows the application to show, hide or if possible, change the shape of the cursor in a system neutral way.
Enumerator | |
---|---|
CURSOR_NONE | No cursor at all. |
CURSOR_ARROW | Standard arrow cursor. |
CURSOR_IBEAM | Text edit i-beam cursor. |
CURSOR_WAIT | Beachball cursor. |
CURSOR_CROSS | Crosshairs cursor. |
CURSOR_COUNT | Total number of system cursors. |
CURSOR_CUSTOM | Cursor set by a call with SetImage() |
|
privatedelete |
|
privatedelete |
|
privatenoexcept |
Initialize the defaults.
Set up the variables to a default state, however, no actual calls to the operating system are performed. Call Burger::OSCursor::Init() to initialize.
Burger::OSCursor::~OSCursor | ( | ) |
Release all cursor resources.
On shutdown, release any held custom cursor resources
|
inlinestaticnoexcept |
Return the current cursor shape number.
|
staticnoexcept |
|
staticnoexcept |
Reset an OS cursor to an arrow and make it visible.
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
staticnoexcept |
If a custom cursor is defined, refresh the operating system.
|
staticnoexcept |
Set the cursor to a generated cursor.
Given a custom cursor, set the cursor to it.
pImage | NULL to hide the cursor, or a pointer to a generated cursor |
|
staticnoexcept |
Load an OS resource and set the cursor to it.
Given a resource number specific to the operating system, set the cursor to it.
\note This function will pull the cursor from the Windows Resource data or
the MacOS Resource fork using this value as the index. Great care must be taken if this call is issued in platform neutral code.
|
staticnoexcept |
|
staticnoexcept |
|
staticnoexcept |
Release all resources allocated by the cursor.
|
staticprivate |
Singleton instance of the Burger::OSCursor class.
Since this is a shim to a global system resource, this class exists as a singleton.
|
private |
ID Number of the currently set cursor.
|
private |
MacOS only, handle to the cursor image.
|
private |
Windows only, handle to the cursor image.