Interface to Alias cursors. Note that some of this class’s methods are not available on Windows.
#include <AlCursor.h> class AlCursor enum { kArrowSquare=0, kEmpty, kHourGlass, kEyeDropper, kFullEyeDropper, kMove, kSelect, kInsert, kDelete, kCross, kTarget } Predefined; static statusCode push( int id ); static statusCode pop( void ); static int define( const char*,int,int,int,int ); static int define( const char*,int,int,int,int,const char*,int,int ); static statusCode remove( int id );
This class allows you to display and define cursors inside of OpenAlias. Predefined cursors can be used or custom cursors can be created. Cursors are maintained using a stack of ID numbers. When a cursor image is set, its ID is pushed onto the stack. When a cursor is popped, its image is restored to the previous image.
Sets the current cursor to the given ID number and pushes
the ID onto the stack. ’ID’ can be either a custom ID returned by AlCursor::define() or one of the default types (Predefined::kArrowSquare, Predefined::kEmpty, Predefined::kHourGlass, Predefined::kEyeDropper, Predefined::kFullEyeDropper, Predefined::kMove, Predefined::kSelect, Predefined::kInsert, Predefined::kDelete, Predefined::kCross, or Predefined::kTarget).
id - the id to set the cursor image to
sSuccess - the cursor image changed
sInvalidArgument - the cursor ID value was not valid
Restores the cursor image to its previous state.
sSuccess - worked
Creates a new cursor using a mask. These parameters are used in conjunction with XCreatePixmapFromBitmapData(). The mask can be used to create a blank region around the image.
NOTE: this method always fails on the Windows.
image - pointer to the bitmap data
imageWidth, imageHeight - image bitmap size
imageHotSpotX, imageHotSpotY - where the cursor’s hot spot is located
mask - pointer to the mask data
maskWidth, maskHeight - mask bitmap size
The new ID of the cursor is returned as a positive number. -1 indicates a failure;
Creates a new cursor (the cursor image is also used as the mask).
NOTE: this method always fails on the Windows.
image - pointer to the bitmap data
imageWidth, imageHeight - image bitmap size
imageHotSpotX, imageHotSpotY - where the cursor’s hot spot is located
The new ID of the cursor is returned as a positive number. -1 indicates a failure;
Deletes the given cursor id.
id - the cursor to remove
sSuccess - the cursor image was deleted
sInvalidArgument - the cursor ID value was a default cursor
sFailure - the cursor ID value could not be found