CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

iCursor Struct Reference

This interface is used to access the custom cursor plugin, which handles processing for displaying pixmaps as cursors. More...

#include <custcursor.h>

Inheritance diagram for iCursor:

iBase List of all members.

Public Methods

virtual bool Setup (iGraphics3D *, bool forceEmulation=false)=0
 Must be called before custom cursors will be displayed.

virtual bool ParseConfigFile (const char *iFile)=0
 Load cursor settings from a config file in VFS.

virtual void SetCursor (const char *name, iImage *image, csRGBcolor keycolor, csPoint hotspot=csPoint(0, 0), uint8 alpha=0, csRGBcolor fg=csRGBcolor(255, 255, 255), csRGBcolor bg=csRGBcolor(0, 0, 0))=0
 Adds or replaces a cursor called name.

virtual void SetHotspot (const char *name, csPoint hotspot)=0
 Sets the hotspot (center) of the specified cursor on the pixmap.

virtual void SetAlpha (const char *name, uint8 alpha)=0
 Sets the alpha transparency of the specified cursor.

virtual void SetKeyColor (const char *name, csRGBcolor col)=0
 Set key colour of the specified cursor.

virtual void SetColor (const char *name, csRGBcolor fg, csRGBcolor bg)=0
 Set the foreground and background colors of the cursor.

virtual const csRef< iImageGetCursorImage (const char *name) const=0
 Get cursor image of the specified cursor Returns a reference to NULL if there is no cursor with this name.

virtual csPoint GetHotspot (const char *name) const=0
 Get the hotspot (center) of the specified cursor on the pixmap.

virtual uint8 GetAlpha (const char *name) const=0
 Get the alpha transparency of the specified cursor.

virtual csRGBcolor GetKeyColor (const char *name) const=0
 Get key colour of the specified cursor.

virtual csRGBcolor GetFGColor (const char *name) const=0
 Get the foreground color of the cursor.

virtual csRGBcolor GetBGColor (const char *name) const=0
 Get the background color of the cursor.

virtual bool RemoveCursor (const char *name)=0
 Completely remove a cursor.

virtual void RemoveAllCursors ()=0
 Remove all cursors.

virtual bool SwitchCursor (const char *name)=0
 Switches the current cursor displayed to the specified cursor.


Detailed Description

This interface is used to access the custom cursor plugin, which handles processing for displaying pixmaps as cursors.

Any number of cursors can be set, indexed by key strings, along with hotspots, and alpha transparency. Supports both static csSimplePixmap cursors and csAnimatedPixmap cursors.

Definition at line 38 of file custcursor.h.


Member Function Documentation

virtual uint8 iCursor::GetAlpha const char *    name const [pure virtual]
 

Get the alpha transparency of the specified cursor.

Returns default 0 if there is no cursor with this name

virtual csRGBcolor iCursor::GetBGColor const char *    name const [pure virtual]
 

Get the background color of the cursor.

These will only be used when in OS mode on systems which only support monochrome cursors Returns default 0,0,0 if there is no cursor with this name

virtual const csRef<iImage> iCursor::GetCursorImage const char *    name const [pure virtual]
 

Get cursor image of the specified cursor Returns a reference to NULL if there is no cursor with this name.

This getter safely can be used to check if a cursor is defined or not without switching

virtual csRGBcolor iCursor::GetFGColor const char *    name const [pure virtual]
 

Get the foreground color of the cursor.

These will only be used when in OS mode on systems which only support monochrome cursors Returns default 255,255,255 if there is no cursor with this name

virtual csPoint iCursor::GetHotspot const char *    name const [pure virtual]
 

Get the hotspot (center) of the specified cursor on the pixmap.

Returns default 0,0 if there is no cursor with this name

virtual csRGBcolor iCursor::GetKeyColor const char *    name const [pure virtual]
 

Get key colour of the specified cursor.

Returns default 0,0,0 if there is no cursor with this name

virtual bool iCursor::ParseConfigFile const char *    iFile [pure virtual]
 

Load cursor settings from a config file in VFS.

virtual void iCursor::RemoveAllCursors   [pure virtual]
 

Remove all cursors.

virtual bool iCursor::RemoveCursor const char *    name [pure virtual]
 

Completely remove a cursor.

virtual void iCursor::SetAlpha const char *    name,
uint8    alpha
[pure virtual]
 

Sets the alpha transparency of the specified cursor.

This will only work if the OS supports this, or you are in emulation mode

virtual void iCursor::SetColor const char *    name,
csRGBcolor    fg,
csRGBcolor    bg
[pure virtual]
 

Set the foreground and background colors of the cursor.

These will only be used when in OS mode on systems which only support monochrome cursors

virtual void iCursor::SetCursor const char *    name,
iImage   image,
csRGBcolor    keycolor,
csPoint    hotspot = csPoint(0, 0),
uint8    alpha = 0,
csRGBcolor    fg = csRGBcolor(255, 255, 255),
csRGBcolor    bg = csRGBcolor(0, 0, 0)
[pure virtual]
 

Adds or replaces a cursor called name.

Currently you can only register an iImage - a simple pixmap will then be created for use in emulation mode

virtual void iCursor::SetHotspot const char *    name,
csPoint    hotspot
[pure virtual]
 

Sets the hotspot (center) of the specified cursor on the pixmap.

virtual void iCursor::SetKeyColor const char *    name,
csRGBcolor    col
[pure virtual]
 

Set key colour of the specified cursor.

virtual bool iCursor::Setup iGraphics3D  ,
bool    forceEmulation = false
[pure virtual]
 

Must be called before custom cursors will be displayed.

If you want to use software emulation mode on all platforms, set the forceEmulation argument to true.

virtual bool iCursor::SwitchCursor const char *    name [pure virtual]
 

Switches the current cursor displayed to the specified cursor.

Disables automatic switching of cursors on mouse events;

The system defaults to CSCURSOR_Default. In this mode, it will also automatically switch to CSCURSOR_MouseDown when the mouse is pressed


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.18