FifeGUI 0.2.0
A C++ GUI library designed for games.
mouseinput.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later OR BSD-3-Clause
2// SPDX-FileCopyrightText: 2004 - 2008 Olof Naessén and Per Larsson
3// SPDX-FileCopyrightText: 2013 - 2026 Fifengine contributors
4
5#include "fifechan/mouseinput.hpp"
6
7namespace fcn
8{
9 MouseInput::MouseInput(Button button, Type type, int x, int y, int timeStamp) :
10 mType(type), mButton(button), mTimeStamp(timeStamp), mX(x), mY(y)
11 {
12 }
13
14 void MouseInput::setType(Type type)
15 {
16 mType = type;
17 }
18
19 MouseInput::Type MouseInput::getType() const
20 {
21 return mType;
22 }
23
24 void MouseInput::setButton(Button button)
25 {
26 mButton = button;
27 }
28
29 MouseInput::Button MouseInput::getButton() const
30 {
31 return mButton;
32 }
33
35 {
36 return mTimeStamp;
37 }
38
39 void MouseInput::setTimeStamp(int timeStamp)
40 {
41 mTimeStamp = timeStamp;
42 }
43
44 void MouseInput::setX(int x)
45 {
46 mX = x;
47 }
48
49 int MouseInput::getX() const
50 {
51 return mX;
52 }
53
54 void MouseInput::setY(int y)
55 {
56 mY = y;
57 }
58
59 int MouseInput::getY() const
60 {
61 return mY;
62 }
63} // namespace fcn
void setX(int x)
Sets the x coordinate of the mouse input.
Button mButton
Holds the button of the mouse input.
int mX
Holds the x coordinate of the mouse input.
void setTimeStamp(int timeStamp)
Sets the timestamp for the mouse input.
void setY(int y)
Sets the y coordinate of the mouse input.
int mTimeStamp
Holds the timestamp of the mouse input.
int mY
Holds the y coordinate of the mouse input.
Type getType() const
Gets the type of the mouse input.
void setType(Type type)
Sets the type of the mouse input.
Button getButton() const
Gets the button pressed.
int getX() const
Gets the x coordinate of the mouse input.
void setButton(Button button)
Sets the button pressed.
Type mType
Holds the type of the mouse input.
int getY() const
Gets the y coordinate of the mouse input.
int getTimeStamp() const
Gets the time stamp of the input.