FifeGUI
0.2.0
A C++ GUI library designed for games.
src
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
7
namespace
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
34
int
MouseInput::getTimeStamp
()
const
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
fcn::MouseInput::setX
void setX(int x)
Sets the x coordinate of the mouse input.
Definition
mouseinput.cpp:44
fcn::MouseInput::mButton
Button mButton
Holds the button of the mouse input.
Definition
mouseinput.hpp:152
fcn::MouseInput::mX
int mX
Holds the x coordinate of the mouse input.
Definition
mouseinput.hpp:163
fcn::MouseInput::setTimeStamp
void setTimeStamp(int timeStamp)
Sets the timestamp for the mouse input.
Definition
mouseinput.cpp:39
fcn::MouseInput::setY
void setY(int y)
Sets the y coordinate of the mouse input.
Definition
mouseinput.cpp:54
fcn::MouseInput::mTimeStamp
int mTimeStamp
Holds the timestamp of the mouse input.
Definition
mouseinput.hpp:158
fcn::MouseInput::mY
int mY
Holds the y coordinate of the mouse input.
Definition
mouseinput.hpp:168
fcn::MouseInput::getType
Type getType() const
Gets the type of the mouse input.
Definition
mouseinput.cpp:19
fcn::MouseInput::setType
void setType(Type type)
Sets the type of the mouse input.
Definition
mouseinput.cpp:14
fcn::MouseInput::getButton
Button getButton() const
Gets the button pressed.
Definition
mouseinput.cpp:29
fcn::MouseInput::getX
int getX() const
Gets the x coordinate of the mouse input.
Definition
mouseinput.cpp:49
fcn::MouseInput::setButton
void setButton(Button button)
Sets the button pressed.
Definition
mouseinput.cpp:24
fcn::MouseInput::mType
Type mType
Holds the type of the mouse input.
Definition
mouseinput.hpp:147
fcn::MouseInput::getY
int getY() const
Gets the y coordinate of the mouse input.
Definition
mouseinput.cpp:59
fcn::MouseInput::getTimeStamp
int getTimeStamp() const
Gets the time stamp of the input.
Definition
mouseinput.cpp:34
Generated by
1.16.1