GRAPHICS: Add the Windows busy cursor

This commit is contained in:
Matthew Hoops 2013-07-27 20:00:26 -04:00 committed by Eugene Sandulenko
parent 27b938d47f
commit 3c158972b3
2 changed files with 73 additions and 0 deletions

View file

@ -353,4 +353,68 @@ Cursor *makeDefaultWinCursor() {
return new DefaultWinCursor();
}
/**
* The Windows busy cursor
*/
class BusyWinCursor : public Cursor {
public:
BusyWinCursor() {}
~BusyWinCursor() {}
uint16 getWidth() const { return 15; }
uint16 getHeight() const { return 27; }
uint16 getHotspotX() const { return 7; }
uint16 getHotspotY() const { return 13; }
byte getKeyColor() const { return 0; }
const byte *getSurface() const {
static const byte busyCursor[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0,
0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0,
0, 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, 1, 0,
0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 0,
0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 0,
0, 0, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 0, 0,
0, 0, 0, 1, 1, 2, 2, 1, 2, 2, 1, 1, 0, 0, 0,
0, 0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 2, 2, 2, 1, 1, 0, 0, 0, 0,
0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 0, 0,
0, 0, 1, 1, 2, 2, 2, 1, 2, 2, 2, 1, 1, 0, 0,
0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 0,
0, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 1, 0,
0, 1, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 0,
0, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 0,
0, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 0,
0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
return busyCursor;
}
const byte *getPalette() const {
static const byte bwPalette[] = {
0x00, 0x00, 0x00, // Black
0xFF, 0xFF, 0xFF // White
};
return bwPalette;
}
byte getPaletteStartIndex() const { return 1; }
uint16 getPaletteCount() const { return 2; }
};
Cursor *makeBusyWinCursor() {
return new BusyWinCursor();
}
} // End of namespace Graphics

View file

@ -73,7 +73,16 @@ struct WinCursorGroup {
* @note The calling code is responsible for deleting the returned pointer.
*/
Cursor *makeDefaultWinCursor();
/**
* Create a Cursor for the Windows busy cursor.
*
* @note The calling code is responsible for deleting the returned pointer.
*/
Cursor *makeBusyWinCursor();
/** @} */
} // End of namespace Graphics
#endif