arsa  2.7
Public Member Functions | List of all members
irr::gui::ICursorControl Class Referenceabstract

Interface to manipulate the mouse cursor. More...

#include <ICursorControl.h>

Inheritance diagram for irr::gui::ICursorControl:
irr::IReferenceCounted

Public Member Functions

virtual void setVisible (bool visible)=0
 Changes the visible state of the mouse cursor. More...
 
virtual bool isVisible () const =0
 Returns if the cursor is currently visible. More...
 
virtual void setPosition (const core::position2d< f32 > &pos)=0
 Sets the new position of the cursor. More...
 
virtual void setPosition (f32 x, f32 y)=0
 Sets the new position of the cursor. More...
 
virtual void setPosition (const core::position2d< s32 > &pos)=0
 Sets the new position of the cursor. More...
 
virtual void setPosition (s32 x, s32 y)=0
 Sets the new position of the cursor. More...
 
virtual const core::position2d< s32 > & getPosition (bool updateCursor=true)=0
 Returns the current position of the mouse cursor. More...
 
virtual core::position2d< f32getRelativePosition (bool updateCursor=true)=0
 Returns the current position of the mouse cursor. More...
 
virtual void setReferenceRect (core::rect< s32 > *rect=0)=0
 Sets an absolute reference rect for setting and retrieving the cursor position. More...
 
virtual void setActiveIcon (ECURSOR_ICON iconId)
 Sets the active cursor icon. More...
 
virtual ECURSOR_ICON getActiveIcon () const
 Gets the currently active icon. More...
 
virtual ECURSOR_ICON addIcon (const gui::SCursorSprite &icon)
 Add a custom sprite as cursor icon. More...
 
virtual void changeIcon (ECURSOR_ICON iconId, const gui::SCursorSprite &sprite)
 replace a cursor icon. More...
 
virtual core::dimension2di getSupportedIconSize () const
 Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work. More...
 
virtual void setPlatformBehavior (ECURSOR_PLATFORM_BEHAVIOR behavior)
 Set platform specific behavior flags. More...
 
virtual ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior () const
 Return platform specific behavior. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

Interface to manipulate the mouse cursor.

Definition at line 97 of file ICursorControl.h.

Member Function Documentation

◆ addIcon()

virtual ECURSOR_ICON irr::gui::ICursorControl::addIcon ( const gui::SCursorSprite icon)
inlinevirtual

Add a custom sprite as cursor icon.

Returns
Identification for the icon

Definition at line 173 of file ICursorControl.h.

◆ changeIcon()

virtual void irr::gui::ICursorControl::changeIcon ( ECURSOR_ICON  iconId,
const gui::SCursorSprite sprite 
)
inlinevirtual

replace a cursor icon.

Changing cursor icons is so far only supported on Win32 and Linux Note that this only changes the icons within your application, system cursors outside your application will not be affected.

Definition at line 180 of file ICursorControl.h.

180 {}

◆ getActiveIcon()

virtual ECURSOR_ICON irr::gui::ICursorControl::getActiveIcon ( ) const
inlinevirtual

Gets the currently active icon.

Definition at line 169 of file ICursorControl.h.

◆ getPlatformBehavior()

virtual ECURSOR_PLATFORM_BEHAVIOR irr::gui::ICursorControl::getPlatformBehavior ( ) const
inlinevirtual

Return platform specific behavior.

Returns
Behavior set by setPlatformBehavior or ECPB_NONE for platforms not implementing specific behaviors.

Definition at line 191 of file ICursorControl.h.

191 { return ECPB_NONE; }
default - no platform specific behavior

◆ getPosition()

virtual const core::position2d<s32>& irr::gui::ICursorControl::getPosition ( bool  updateCursor = true)
pure virtual

Returns the current position of the mouse cursor.

Parameters
updateCursorWhen true ask system/OS for current cursor position. When false return the last known (buffered) position ( this is useful to check what has become of a setPosition call with float numbers).
Returns
Returns the current position of the cursor. The returned position is the position of the mouse cursor in pixel units.

◆ getRelativePosition()

virtual core::position2d<f32> irr::gui::ICursorControl::getRelativePosition ( bool  updateCursor = true)
pure virtual

Returns the current position of the mouse cursor.

Parameters
updateCursorWhen true ask system/OS for current cursor position. When false return the last known (buffered) position (this is useful to check what has become of a setPosition call with float numbers and is often different from the values you passed in setPosition).
Returns
Returns the current position of the cursor. The returned position is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is the top left corner and (1.0f, 1.0f) is the bottom right corner of the render window.

◆ getSupportedIconSize()

virtual core::dimension2di irr::gui::ICursorControl::getSupportedIconSize ( ) const
inlinevirtual

Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.

Definition at line 183 of file ICursorControl.h.

183 { return core::dimension2di(0,0); }
dimension2d< s32 > dimension2di
Typedef for an integer dimension.
Definition: dimension2d.h:217

◆ isVisible()

virtual bool irr::gui::ICursorControl::isVisible ( ) const
pure virtual

Returns if the cursor is currently visible.

Returns
True if the cursor is visible, false if not.

◆ setActiveIcon()

virtual void irr::gui::ICursorControl::setActiveIcon ( ECURSOR_ICON  iconId)
inlinevirtual

Sets the active cursor icon.

Setting cursor icons is so far only supported on Win32 and Linux

Definition at line 166 of file ICursorControl.h.

166 {}

◆ setPlatformBehavior()

virtual void irr::gui::ICursorControl::setPlatformBehavior ( ECURSOR_PLATFORM_BEHAVIOR  behavior)
inlinevirtual

Set platform specific behavior flags.

Definition at line 186 of file ICursorControl.h.

186 {}

◆ setPosition() [1/4]

virtual void irr::gui::ICursorControl::setPosition ( const core::position2d< f32 > &  pos)
pure virtual

Sets the new position of the cursor.

The position must be between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is the top left corner and (1.0f, 1.0f) is the bottom right corner of the render window.

Parameters
posNew position of the cursor.

◆ setPosition() [2/4]

virtual void irr::gui::ICursorControl::setPosition ( f32  x,
f32  y 
)
pure virtual

Sets the new position of the cursor.

The position must be between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is the top left corner and (1.0f, 1.0f) is the bottom right corner of the render window.

Parameters
xNew x-coord of the cursor.
yNew x-coord of the cursor.

◆ setPosition() [3/4]

virtual void irr::gui::ICursorControl::setPosition ( const core::position2d< s32 > &  pos)
pure virtual

Sets the new position of the cursor.

Parameters
posNew position of the cursor. The coordinates are pixel units.

◆ setPosition() [4/4]

virtual void irr::gui::ICursorControl::setPosition ( s32  x,
s32  y 
)
pure virtual

Sets the new position of the cursor.

Parameters
xNew x-coord of the cursor. The coordinates are pixel units.
yNew y-coord of the cursor. The coordinates are pixel units.

◆ setReferenceRect()

virtual void irr::gui::ICursorControl::setReferenceRect ( core::rect< s32 > *  rect = 0)
pure virtual

Sets an absolute reference rect for setting and retrieving the cursor position.

If this rect is set, the cursor position is not being calculated relative to the rendering window but to this rect. You can set the rect pointer to 0 to disable this feature again. This feature is useful when rendering into parts of foreign windows for example in an editor.

Parameters
rectA pointer to an reference rectangle or 0 to disable the reference rectangle.

◆ setVisible()

virtual void irr::gui::ICursorControl::setVisible ( bool  visible)
pure virtual

Changes the visible state of the mouse cursor.

Parameters
visibleThe new visible state. If true, the cursor will be visible, if false, it will be invisible.

The documentation for this class was generated from the following file: