## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# iCursor Struct Reference

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

`#include <ivideo/custcursor.h>`

Inheritance diagram for iCursor:

[legend]
List of all members.

## Public Member Functions

virtual csRGBcolor | GetBGColor (const char *name) const =0
| Get the background color of the cursor.
virtual csRef< iImage > | GetCursorImage (const char *name) const =0
| Get cursor image of the specified cursor.
virtual csRGBcolor | GetFGColor (const char *name) const =0
| Get the foreground color of the cursor.
virtual csVector2 | GetHotSpot (const char *name) const =0
| Get the hotspot (center) of the specified cursor on the pixmap.
virtual const csRGBcolor * | GetKeyColor (const char *name) const =0
| Get key colour of the specified cursor.
virtual uint8 | GetTransparency (const char *name) const =0
| Get the transparency of the specified cursor.
virtual bool | ParseConfigFile (iConfigFile *)=0
| Load cursor settings from a configuration file.
virtual void | RemoveAllCursors ()=0
| Remove all cursors.
virtual bool | RemoveCursor (const char *name)=0
| Completely remove a cursor.
virtual void | SetColor (const char *name, csRGBcolor fg, csRGBcolor bg)=0
| Set the foreground and background colors of the cursor.
virtual void | SetCursor (const char *name, iImage *image, csRGBcolor *keycolor=0, csVector2 hotspot=csVector2(0, 0), uint8 transparency=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, csVector2 hotspot)=0
| Sets the hotspot (center) of the specified cursor on the pixmap.
virtual void | SetKeyColor (const char *name, csRGBcolor)=0
| Set key colour of the specified cursor.
virtual void | SetTransparency (const char *name, uint8 transparancy)=0
| Sets the transparency of the specified cursor.
virtual bool | Setup (iGraphics3D *, bool ForceEmulation=false)=0
| Must be called before custom cursors will be displayed.
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 transparency. Supports any static iImage.

A default implementation of the iCursor interface is provided by the 'crystalspace.graphic.cursor' plugin.

Definition at line 52 of file custcursor.h.

## Member Function Documentation

virtual csRGBcolor iCursor::GetBGColor | ( | const char * | name | ) | const`[pure virtual]`

| Get the background color of the cursor. These will only be used for graphics drivers which support only monochrome cursors. Returns default 0,0,0 if there is no cursor with this name.

virtual csRef<iImage> iCursor::GetCursorImage | ( | const char * | name | ) | const`[pure virtual]`

| Get cursor image of the specified cursor. The returned reference is invalid -- check with csRef<>::IsValid() -- if the cursor is not registered. This getter safely can be used to check if a cursor is defined or not without switching cursors.

virtual csRGBcolor iCursor::GetFGColor | ( | const char * | name | ) | const`[pure virtual]`

| Get the foreground color of the cursor. These will only be used for graphics drivers which support only monochrome cursors. Returns default 255,255,255 if there is no cursor with this name.

virtual csVector2 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 const csRGBcolor* iCursor::GetKeyColor | ( | const char * | name | ) | const`[pure virtual]`

| Get key colour of the specified cursor. Returns default 0 if the cursor has no keycolor set or there is no cursor with this name

virtual uint8 iCursor::GetTransparency | ( | const char * | name | ) | const`[pure virtual]`

| Get the transparency of the specified cursor. Transparency can range from 0 (completely opaque) to 255 (completely transparent). Returns default 0 if there is no cursor with this name.

virtual bool iCursor::ParseConfigFile | ( | iConfigFile * |  | ) | `[pure virtual]`

| Load cursor settings from a configuration file.

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::SetColor | ( | const char * | name,
|  | csRGBcolor | fg,
|  | csRGBcolor | bg
| ) | `[pure virtual]`

| Set the foreground and background colors of the cursor. These will only be used for graphics drivers which support only monochrome cursors.

virtual void iCursor::SetCursor | ( | const char * | name,
|  | iImage * | image,
|  | csRGBcolor * | keycolor = `0`,
|  | csVector2 | hotspot = `csVector2(0, 0)`,
|  | uint8 | transparency = `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. The 'transparency' can range from 0 (completely opaque) to 255 (completely transparent).

virtual void iCursor::SetHotSpot | ( | const char * | name,
|  | csVector2 | hotspot
| ) | `[pure virtual]`

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

virtual void iCursor::SetKeyColor | ( | const char * | name,
|  | csRGBcolor |
| ) | `[pure virtual]`

| Set key colour of the specified cursor.

virtual void iCursor::SetTransparency | ( | const char * | name,
|  | uint8 | transparancy
| ) | `[pure virtual]`

| Sets the transparency of the specified cursor. The 'transparency' can range from 0 (completely opaque) to 255 (completely transparent) This will only work if the video driver supports transparency for cursors, or the cursor is being emulated.

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:

- ivideo/custcursor.h