Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
WWMouseClass Class Reference

#include <wwmouse.h>

Inherits Mouse.

Public Member Functions

 WWMouseClass (Surface *surfaceptr, HWND window)
 
virtual ~WWMouseClass (void)
 
void Process_Mouse (void)
 
virtual void Set_Cursor (int xhotspot, int yhotspot, ShapeSet const *cursor, int shape)
 
virtual void Hide_Mouse (void)
 
virtual void Show_Mouse (void)
 
virtual void Release_Mouse (void)
 
virtual void Capture_Mouse (void)
 
virtual bool Is_Captured (void) const
 
virtual void Conditional_Hide_Mouse (Rect region)
 
virtual void Conditional_Show_Mouse (void)
 
virtual int Get_Mouse_State (void) const
 
virtual int Get_Mouse_X (void) const
 
virtual int Get_Mouse_Y (void) const
 
virtual void Set_Mouse_XY (int xpos, int ypos)
 
virtual void Draw_Mouse (Surface *scr, bool issidebarsurface=false)
 
virtual void Erase_Mouse (Surface *scr, bool issidebarsurface=false)
 
virtual void Convert_Coordinate (int &x, int &y) const
 
void Calc_Confining_Rect (void)
 
- Public Member Functions inherited from Mouse
 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 MouseIOgetMouseStatus (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)
 
- 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)
 

Additional Inherited Members

- Public Types inherited from Mouse
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 Attributes inherited from Mouse
CursorInfo m_cursorInfo [NUM_MOUSE_CURSORS]
 
AsciiString m_tooltipFontName
 tooltip font
 
Int m_tooltipFontSize
 tooltip font
 
Bool m_tooltipFontIsBold
 tooltip font
 
Bool m_tooltipAnimateBackground
 animate the background with the text
 
Int m_tooltipFillTime
 milliseconds to animate tooltip
 
Int m_tooltipDelayTime
 milliseconds to wait before showing tooltip
 
Real m_tooltipWidth
 default tooltip width in screen width %
 
Real m_lastTooltipWidth
 
RGBAColorInt m_tooltipColorText
 
RGBAColorInt m_tooltipColorHighlight
 
RGBAColorInt m_tooltipColorShadow
 
RGBAColorInt m_tooltipColorBackground
 
RGBAColorInt m_tooltipColorBorder
 
RedrawMode m_currentRedrawMode
 mouse cursor drawing method
 
Bool m_useTooltipAltTextColor
 draw tooltip text with house colors?
 
Bool m_useTooltipAltBackColor
 draw tooltip backgrounds with house colors?
 
Bool m_adjustTooltipAltColor
 adjust house colors (darker/brighter) for tooltips?
 
Bool m_orthoCamera
 use an ortho camera for 3D cursors?
 
Real m_orthoZoom
 uniform zoom to apply to 3D cursors when using ortho cameras
 
UnsignedInt m_dragTolerance
 
UnsignedInt m_dragTolerance3D
 
UnsignedInt m_dragToleranceMS
 
- Static Public Attributes inherited from Mouse
static const char * RedrawModeName [RM_MAX]
 
- Protected Types inherited from Mouse
enum  { NUM_MOUSE_EVENTS = 256 }
 
- Protected Member Functions inherited from Mouse
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
 
- Protected Attributes inherited from Mouse
UnsignedByte m_numButtons
 number of buttons on this mouse
 
UnsignedByte m_numAxes
 number of axes this mouse has
 
Bool m_forceFeedback
 set to TRUE if mouse supprots force feedback
 
UnicodeString m_tooltipString
 tooltip text
 
DisplayStringm_tooltipDisplayString
 tooltipDisplayString
 
Bool m_displayTooltip
 
Bool m_isTooltipEmpty
 
MouseIO m_mouseEvents [NUM_MOUSE_EVENTS]
 for event list
 
MouseIO m_currMouse
 for current mouse data
 
MouseIO m_prevMouse
 for previous mouse data
 
Int m_minX
 mouse is locked to this region
 
Int m_maxX
 mouse is locked to this region
 
Int m_minY
 mouse is locked to this region
 
Int m_maxY
 mouse is locked to this region
 
UnsignedInt m_inputFrame
 frame input was gathered on
 
UnsignedInt m_deadInputFrame
 Frame which last input occured.
 
Bool m_inputMovesAbsolute
 
Bool m_visible
 
MouseCursor m_currentCursor
 current mouse cursor
 
DisplayStringm_cursorTextDisplayString
 text to display on the cursor (if specified)
 
RGBAColorInt m_cursorTextColor
 color of the cursor text
 
RGBAColorInt m_cursorTextDropColor
 color of the cursor text drop shadow
 
Int m_tooltipDelay
 millisecond delay for tooltips
 
Int m_highlightPos
 
UnsignedInt m_highlightUpdateStart
 
UnsignedInt m_stillTime
 
RGBAColorInt m_tooltipTextColor
 
RGBAColorInt m_tooltipBackColor
 
Int m_eventsThisFrame
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

Definition at line 49 of file wwmouse.h.

Constructor & Destructor Documentation

◆ WWMouseClass()

WWMouseClass::WWMouseClass ( Surface * surfaceptr,
HWND window )

Definition at line 124 of file wwmouse.cpp.

◆ ~WWMouseClass()

WWMouseClass::~WWMouseClass ( void )
virtual

Definition at line 166 of file wwmouse.cpp.

Member Function Documentation

◆ Calc_Confining_Rect()

void WWMouseClass::Calc_Confining_Rect ( void )

Definition at line 183 of file wwmouse.cpp.

◆ Capture_Mouse()

void WWMouseClass::Capture_Mouse ( void )
virtual

Implements Mouse.

Definition at line 761 of file wwmouse.cpp.

◆ Conditional_Hide_Mouse()

void WWMouseClass::Conditional_Hide_Mouse ( Rect region)
virtual

Implements Mouse.

Definition at line 827 of file wwmouse.cpp.

◆ Conditional_Show_Mouse()

void WWMouseClass::Conditional_Show_Mouse ( void )
virtual

Implements Mouse.

Definition at line 848 of file wwmouse.cpp.

◆ Convert_Coordinate()

void WWMouseClass::Convert_Coordinate ( int & x,
int & y ) const
virtual

Implements Mouse.

Definition at line 870 of file wwmouse.cpp.

◆ Draw_Mouse()

void WWMouseClass::Draw_Mouse ( Surface * scr,
bool issidebarsurface = false )
virtual

Implements Mouse.

Definition at line 498 of file wwmouse.cpp.

◆ Erase_Mouse()

void WWMouseClass::Erase_Mouse ( Surface * scr,
bool issidebarsurface = false )
virtual

Implements Mouse.

Definition at line 563 of file wwmouse.cpp.

◆ Get_Mouse_State()

int WWMouseClass::Get_Mouse_State ( void ) const
virtual

Implements Mouse.

Definition at line 219 of file wwmouse.cpp.

◆ Get_Mouse_X()

virtual int WWMouseClass::Get_Mouse_X ( void ) const
inlinevirtual

Implements Mouse.

Definition at line 94 of file wwmouse.h.

◆ Get_Mouse_Y()

virtual int WWMouseClass::Get_Mouse_Y ( void ) const
inlinevirtual

Implements Mouse.

Definition at line 95 of file wwmouse.h.

◆ Hide_Mouse()

void WWMouseClass::Hide_Mouse ( void )
virtual

Implements Mouse.

Definition at line 730 of file wwmouse.cpp.

◆ Is_Captured()

virtual bool WWMouseClass::Is_Captured ( void ) const
inlinevirtual

Implements Mouse.

Definition at line 82 of file wwmouse.h.

◆ Process_Mouse()

void WWMouseClass::Process_Mouse ( void )

Definition at line 959 of file wwmouse.cpp.

◆ Release_Mouse()

void WWMouseClass::Release_Mouse ( void )
virtual

Implements Mouse.

Definition at line 797 of file wwmouse.cpp.

◆ Set_Cursor()

void WWMouseClass::Set_Cursor ( int xhotspot,
int yhotspot,
ShapeSet const * cursor,
int shape )
virtual

Implements Mouse.

Definition at line 252 of file wwmouse.cpp.

◆ Set_Mouse_XY()

void WWMouseClass::Set_Mouse_XY ( int xpos,
int ypos )
virtual

Implements Mouse.

Definition at line 991 of file wwmouse.cpp.

◆ Show_Mouse()

void WWMouseClass::Show_Mouse ( void )
virtual

Implements Mouse.

Definition at line 698 of file wwmouse.cpp.


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