1
/***************************************************************************
2
* Copyright (c) 2010 Thomas Anderson <ta@nextgenengineering> *
4
* This file is part of the FreeCAD CAx development system. *
6
* This library is free software; you can redistribute it and/or *
7
* modify it under the terms of the GNU Library General Public *
8
* License as published by the Free Software Foundation; either *
9
* version 2 of the License, or (at your option) any later version. *
11
* This library is distributed in the hope that it will be useful, *
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
* GNU Library General Public License for more details. *
16
* You should have received a copy of the GNU Library General Public *
17
* License along with this library; see the file COPYING.LIB. If not, *
18
* write to the Free Software Foundation, Inc., 59 Temple Place, *
19
* Suite 330, Boston, MA 02111-1307, USA *
21
***************************************************************************/
23
#include "PreCompiled.h"
25
#include "SpaceballEvent.h"
28
using namespace Spaceball;
30
int MotionEvent::MotionEventType = -1;
31
int ButtonEvent::ButtonEventType = -1;
33
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
34
EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast<QEvent::Type>(event))
36
EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast<QEvent::Type>(event), QPointingDevice::primaryPointingDevice())
42
MotionEvent::MotionEvent() : EventBase(static_cast<QEvent::Type>(MotionEventType))
46
MotionEvent::MotionEvent(const MotionEvent& in) : EventBase(static_cast<QEvent::Type>(MotionEventType))
57
MotionEvent& MotionEvent::operator= (const MotionEvent& in)
72
void MotionEvent::translations(int &xTransOut, int &yTransOut, int &zTransOut)
79
void MotionEvent::setTranslations(const int &xTransIn, const int &yTransIn, const int &zTransIn)
86
void MotionEvent::rotations(int &xRotOut, int &yRotOut, int &zRotOut)
93
void MotionEvent::setRotations(const int &xRotIn, const int &yRotIn, const int &zRotIn)
101
ButtonEvent::ButtonEvent() : EventBase(static_cast<QEvent::Type>(ButtonEventType)),
102
buttonState(BUTTON_NONE), button(0)
106
ButtonEvent::ButtonEvent(const ButtonEvent& in) : EventBase(static_cast<QEvent::Type>(ButtonEventType))
108
buttonState = in.buttonState;
110
handled = in.handled;
113
ButtonEvent& ButtonEvent::operator= (const ButtonEvent& in)
118
buttonState = in.buttonState;
120
handled = in.handled;
124
ButtonStateType ButtonEvent::buttonStatus()
129
void ButtonEvent::setButtonStatus(const ButtonStateType &buttonStatusIn)
131
buttonState = buttonStatusIn;
134
int ButtonEvent::buttonNumber()
139
void ButtonEvent::setButtonNumber(const int &buttonNumberIn)
141
button = buttonNumberIn;