ManaPlus
Public Member Functions | Protected Attributes
MouseInput Class Reference

#include <mouseinput.h>

Public Member Functions

 MouseInput ()
 
 MouseInput (const MouseInput &m)
 
MouseInputoperator= (const MouseInput &m)
 
 ~MouseInput ()
 
void setType (MouseEventTypeT type)
 
MouseEventTypeT getType () const
 
void setButton (MouseButtonT button)
 
MouseButtonT getButton () const
 
int getTimeStamp () const
 
void setTimeStamp (int timeStamp)
 
void setX (int x)
 
int getX () const
 
void setY (int y)
 
int getY () const
 
void setReal (const int x, const int y)
 
int getRealX () const
 
int getRealY () const
 
int getTouchX () const
 
int getTouchY () const
 

Protected Attributes

MouseEventTypeT mType
 
MouseButtonT mButton
 
int mTimeStamp
 
int mX
 
int mY
 
int mRealX
 
int mRealY
 

Detailed Description

Definition at line 73 of file mouseinput.h.

Constructor & Destructor Documentation

◆ MouseInput() [1/2]

MouseInput::MouseInput ( )
inline

Definition at line 76 of file mouseinput.h.

76  :
79  mTimeStamp(0),
80  mX(0),
81  mY(0),
82  mRealX(0),
83  mRealY(0)
84  { }
MouseButtonT mButton
Definition: mouseinput.h:197
MouseEventTypeT mType
Definition: mouseinput.h:192
int mTimeStamp
Definition: mouseinput.h:203

◆ MouseInput() [2/2]

MouseInput::MouseInput ( const MouseInput m)
inline

Definition at line 86 of file mouseinput.h.

86  :
87  mType(m.mType),
88  mButton(m.mButton),
90  mX(m.mX),
91  mY(m.mY),
92  mRealX(m.mRealX),
93  mRealY(m.mRealY)
94  {
95  }

◆ ~MouseInput()

MouseInput::~MouseInput ( )
inline

Definition at line 111 of file mouseinput.h.

112  { }

Member Function Documentation

◆ getButton()

MouseButtonT MouseInput::getButton ( ) const
inline

◆ getRealX()

int MouseInput::getRealX ( ) const
inline

Definition at line 167 of file mouseinput.h.

168  { return mRealX; }

References mRealX.

Referenced by Gui::handleMouseInput().

◆ getRealY()

int MouseInput::getRealY ( ) const
inline

Definition at line 170 of file mouseinput.h.

171  { return mRealY; }

References mRealY.

Referenced by Gui::handleMouseInput().

◆ getTimeStamp()

int MouseInput::getTimeStamp ( ) const
inline

Definition at line 134 of file mouseinput.h.

135  {
136  return mTimeStamp;
137  }

References mTimeStamp.

Referenced by Gui::handleMousePressed().

◆ getTouchX()

int MouseInput::getTouchX ( ) const
inline

Definition at line 181 of file mouseinput.h.

182  { return mX; }

References mX.

◆ getTouchY()

int MouseInput::getTouchY ( ) const
inline

Definition at line 184 of file mouseinput.h.

185  { return mY; }

References mY.

◆ getType()

MouseEventTypeT MouseInput::getType ( ) const
inline

Definition at line 119 of file mouseinput.h.

120  {
121  return mType;
122  }

References mType.

Referenced by Gui::handleMouseInput().

◆ getX()

int MouseInput::getX ( ) const
inline

◆ getY()

int MouseInput::getY ( ) const
inline

◆ operator=()

MouseInput& MouseInput::operator= ( const MouseInput m)
inline

Definition at line 99 of file mouseinput.h.

100  {
101  mType = m.mType;
102  mButton = m.mButton;
104  mX = m.mX;
105  mY = m.mY;
106  mRealX = m.mRealX;
107  mRealY = m.mRealY;
108  return *this;
109  }

References mButton, mRealX, mRealY, mTimeStamp, mType, mX, and mY.

◆ setButton()

void MouseInput::setButton ( MouseButtonT  button)
inline

Definition at line 124 of file mouseinput.h.

125  {
126  mButton = button;
127  }

References mButton.

Referenced by SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

◆ setReal()

void MouseInput::setReal ( const int  x,
const int  y 
)
inline

Definition at line 164 of file mouseinput.h.

References mRealX, mRealY, x, and y.

Referenced by SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

◆ setTimeStamp()

void MouseInput::setTimeStamp ( int  timeStamp)
inline

Definition at line 139 of file mouseinput.h.

140  {
141  mTimeStamp = timeStamp;
142  }

References mTimeStamp.

Referenced by SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

◆ setType()

void MouseInput::setType ( MouseEventTypeT  type)
inline

Definition at line 114 of file mouseinput.h.

115  {
116  mType = type;
117  }

References mType.

Referenced by SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

◆ setX()

void MouseInput::setX ( int  x)
inline

Definition at line 144 of file mouseinput.h.

145  {
146  mX = x;
147  }

References mX, and x.

Referenced by TouchManager::processEvent(), SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

◆ setY()

void MouseInput::setY ( int  y)
inline

Definition at line 154 of file mouseinput.h.

155  {
156  mY = y;
157  }

References mY, and y.

Referenced by SDLInput::pushInput(), SDLInput::simulateMouseClick(), and SDLInput::simulateMouseMove().

Field Documentation

◆ mButton

MouseButtonT MouseInput::mButton
protected

Holds the button of the mouse input.

Definition at line 197 of file mouseinput.h.

Referenced by getButton(), operator=(), and setButton().

◆ mRealX

int MouseInput::mRealX
protected

Definition at line 215 of file mouseinput.h.

Referenced by getRealX(), operator=(), and setReal().

◆ mRealY

int MouseInput::mRealY
protected

Definition at line 217 of file mouseinput.h.

Referenced by getRealY(), operator=(), and setReal().

◆ mTimeStamp

int MouseInput::mTimeStamp
protected

Holds the timestamp of the mouse input. Used to check for double clicks.

Definition at line 203 of file mouseinput.h.

Referenced by getTimeStamp(), operator=(), and setTimeStamp().

◆ mType

MouseEventTypeT MouseInput::mType
protected

Holds the type of the mouse input.

Definition at line 192 of file mouseinput.h.

Referenced by getType(), operator=(), and setType().

◆ mX

int MouseInput::mX
protected

Holds the x coordinate of the mouse input.

Definition at line 208 of file mouseinput.h.

Referenced by getTouchX(), getX(), operator=(), and setX().

◆ mY

int MouseInput::mY
protected

Holds the y coordinate of the mouse input.

Definition at line 213 of file mouseinput.h.

Referenced by getTouchY(), getY(), operator=(), and setY().


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