#include <Mouse.h>
Inherits SubsystemInterface.
Inherited by DirectInputMouse, WWMouseClass, and Win32Mouse.
Public Types | |
| enum | MouseCursor { INVALID_MOUSE_CURSOR = -1 , NONE = 0 , FIRST_CURSOR , NORMAL = FIRST_CURSOR , ARROW , SCROLL , CROSS , MOVETO , ATTACKMOVETO , ATTACK_OBJECT , FORCE_ATTACK_OBJECT , FORCE_ATTACK_GROUND , BUILD_PLACEMENT , INVALID_BUILD_PLACEMENT , GENERIC_INVALID , SELECTING , ENTER_FRIENDLY , ENTER_AGGRESSIVELY , SET_RALLY_POINT , GET_REPAIRED , GET_HEALED , DO_REPAIR , RESUME_CONSTRUCTION , CAPTUREBUILDING , SNIPE_VEHICLE , LASER_GUIDED_MISSILES , TANKHUNTER_TNT_ATTACK , STAB_ATTACK , PLACE_REMOTE_CHARGE , PLACE_TIMED_CHARGE , DEFECTOR , DOCK , FIRE_FLAME , FIRE_BOMB , PLACE_BEACON , DISGUISE_AS_VEHICLE , WAYPOINT , OUTRANGE , STAB_ATTACK_INVALID , PLACE_CHARGE_INVALID , HACK , PARTICLE_UPLINK_CANNON , NUM_MOUSE_CURSORS } |
| enum | RedrawMode { RM_WINDOWS =0 , RM_W3D , RM_POLYGON , RM_DX8 , RM_MAX } |
Public Member Functions | |
| Mouse (void) | |
| virtual | ~Mouse (void) |
| virtual void | parseIni (void) |
| parse ini settings associated with mouse (do this before init()). | |
| virtual void | init (void) |
| init mouse, extend this functionality, do not replace | |
| virtual void | reset (void) |
| Reset the system. | |
| virtual void | update (void) |
| update the state of the mouse position and buttons | |
| virtual void | initCursorResources (void)=0 |
| needed so Win32 cursors can load resources before D3D device created. | |
| virtual void | createStreamMessages (void) |
| virtual void | draw (void) |
| draw the mouse | |
| virtual void | setPosition (Int x, Int y) |
| set the mouse position | |
| virtual void | setCursor (MouseCursor cursor)=0 |
| set mouse cursor | |
| virtual void | capture (void)=0 |
| capture the mouse | |
| virtual void | releaseCapture (void)=0 |
| release mouse capture | |
| const MouseIO * | getMouseStatus (void) |
| get current mouse status | |
| Int | getCursorTooltipDelay () |
| void | setCursorTooltipDelay (Int delay) |
| void | setCursorTooltip (UnicodeString tooltip, Int tooltipDelay=-1, const RGBColor *color=NULL, Real width=1.0f) |
| set tooltip string at cursor | |
| void | setMouseText (UnicodeString text, const RGBAColorInt *color, const RGBAColorInt *dropColor) |
| set the cursor text, NOT the tooltip text | |
| virtual void | setMouseLimits (void) |
| update the limit extents the mouse can move in | |
| MouseCursor | getMouseCursor (void) |
| get the current mouse cursor image type | |
| virtual void | setRedrawMode (RedrawMode mode) |
| set cursor drawing method. | |
| virtual RedrawMode | getRedrawMode (void) |
| virtual void | setVisibility (Bool visible) |
| Bool | getVisibility (void) |
| void | drawTooltip (void) |
| draw the tooltip text | |
| void | drawCursorText (void) |
| draw the mouse cursor text | |
| Int | getCursorIndex (const AsciiString &name) |
| void | resetTooltipDelay (void) |
| void | mouseNotifyResolutionChange (void) |
| Bool | isClick (const ICoord2D *anchor, const ICoord2D *dest, UnsignedInt previousMouseClick, UnsignedInt currentMouseClick) |
| virtual | ~Mouse (void) |
| virtual void | Set_Cursor (int xhotspot, int yhotspot, ShapeSet const *cursor, int shape)=0 |
| virtual void | Hide_Mouse (void)=0 |
| virtual void | Show_Mouse (void)=0 |
| virtual void | Release_Mouse (void)=0 |
| virtual void | Capture_Mouse (void)=0 |
| virtual bool | Is_Captured (void) const =0 |
| virtual void | Conditional_Hide_Mouse (Rect region)=0 |
| virtual void | Conditional_Show_Mouse (void)=0 |
| virtual int | Get_Mouse_State (void) const =0 |
| virtual int | Get_Mouse_X (void) const =0 |
| virtual int | Get_Mouse_Y (void) const =0 |
| virtual void | Set_Mouse_XY (int xpos, int ypos)=0 |
| virtual void | Draw_Mouse (Surface *scr, bool issidebarsurface=false)=0 |
| virtual void | Erase_Mouse (Surface *scr, bool issidebarsurface=false)=0 |
| virtual void | Convert_Coordinate (int &x, int &y) const =0 |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Static Public Attributes | |
| static const char * | RedrawModeName [RM_MAX] |
Protected Types | |
| enum | { NUM_MOUSE_EVENTS = 256 } |
Protected Member Functions | |
| virtual UnsignedByte | getMouseEvent (MouseIO *result, Bool flush)=0 |
| you must implement getting a buffered mouse event from you device here | |
| void | updateMouseData () |
| update the mouse with the current device data | |
| void | processMouseEvent (Int eventToProcess) |
| combine mouse events into final data | |
| void | checkForDrag (void) |
| check for mouse drag | |
| void | moveMouse (Int x, Int y, Int relOrAbs) |
| move mouse by delta or absolute | |
| enum Mouse::MouseCursor |
If you update this enum make sure you update CursorININames[]
| enum Mouse::RedrawMode |
|
pure virtual |
capture the mouse
Implemented in DirectInputMouse, and Win32Mouse.
|
pure virtual |
Implemented in WWMouseClass.
|
protected |
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
|
virtual |
given state of device, create messages and put them on the stream for the raw state.
Given the current state of this input device, turn the raw input data into raw stream messages and place those messages on the stream. NOTE that the click messages replace up messages in the mouse, so we are going to propagate those click messages in addition to up messages
|
virtual |
Implemented in WWMouseClass.
| void Mouse::drawCursorText | ( | void | ) |
| void Mouse::drawTooltip | ( | void | ) |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
| Int Mouse::getCursorIndex | ( | const AsciiString & | name | ) |
|
inline |
|
protectedpure virtual |
you must implement getting a buffered mouse event from you device here
Implemented in DirectInputMouse, and Win32Mouse.
|
inline |
|
inlinevirtual |
|
pure virtual |
Implemented in WWMouseClass.
|
virtual |
init mouse, extend this functionality, do not replace
Initialize the mouse
Implements SubsystemInterface.
Reimplemented in DirectInputMouse, W3DMouse, and Win32Mouse.
|
pure virtual |
needed so Win32 cursors can load resources before D3D device created.
Implemented in Win32Mouse.
|
pure virtual |
Implemented in WWMouseClass.
| Bool Mouse::isClick | ( | const ICoord2D * | anchor, |
| const ICoord2D * | dest, | ||
| UnsignedInt | previousMouseClick, | ||
| UnsignedInt | currentMouseClick ) |
| void Mouse::mouseNotifyResolutionChange | ( | void | ) |
|
virtual |
|
protected |
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
release mouse capture
Implemented in DirectInputMouse, and Win32Mouse.
|
virtual |
Reset the system.
Reset mouse system
@ todo Write Mouse::reset() if there needs to be anything here
Implements SubsystemInterface.
Reimplemented in DirectInputMouse, W3DMouse, and Win32Mouse.
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
Implemented in WWMouseClass.
|
pure virtual |
set mouse cursor
Implemented in DirectInputMouse, W3DMouse, and Win32Mouse.
| void Mouse::setCursorTooltip | ( | UnicodeString | tooltip, |
| Int | delay = -1, | ||
| const RGBColor * | color = NULL, | ||
| Real | width = 1.0f ) |
|
virtual |
update the limit extents the mouse can move in
This default implemtation of SetMouseLimits will just set the limiting
rectangle to be the width and height of the game display with the origin in the upper left at (0,0). However, if the game is running in a windowed mode then these limits should reflect the SCREEN coords that the mouse is allowed to move in. Also, if the game is in a window you may want to adjust for any title bar available in the operating system. For system specific limits and windows etc, just override this function in the device implementation of the mouse
Reimplemented in DirectInputMouse.
| void Mouse::setMouseText | ( | UnicodeString | text, |
| const RGBAColorInt * | color, | ||
| const RGBAColorInt * | dropColor ) |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in Win32Mouse.
|
pure virtual |
Implemented in WWMouseClass.
|
virtual |
update the state of the mouse position and buttons
Update the states of the mouse position and buttons
Implements SubsystemInterface.
Reimplemented in DirectInputMouse, and Win32Mouse.
|
protected |
| Bool Mouse::m_adjustTooltipAltColor |
|
protected |
| RedrawMode Mouse::m_currentRedrawMode |
| CursorInfo Mouse::m_cursorInfo[NUM_MOUSE_CURSORS] |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| UnsignedInt Mouse::m_dragTolerance |
| UnsignedInt Mouse::m_dragTolerance3D |
| UnsignedInt Mouse::m_dragToleranceMS |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| Bool Mouse::m_orthoCamera |
| Real Mouse::m_orthoZoom |
|
protected |
|
protected |
| Bool Mouse::m_tooltipAnimateBackground |
|
protected |
| RGBAColorInt Mouse::m_tooltipColorBackground |
| RGBAColorInt Mouse::m_tooltipColorBorder |
| RGBAColorInt Mouse::m_tooltipColorHighlight |
| RGBAColorInt Mouse::m_tooltipColorShadow |
| RGBAColorInt Mouse::m_tooltipColorText |
|
protected |
| Int Mouse::m_tooltipDelayTime |
|
protected |
| Int Mouse::m_tooltipFillTime |
| AsciiString Mouse::m_tooltipFontName |
|
protected |
|
protected |
| Real Mouse::m_tooltipWidth |
| Bool Mouse::m_useTooltipAltBackColor |
| Bool Mouse::m_useTooltipAltTextColor |
|
static |