Debian Codegraph @

src/Gui/Inventor/SoMouseWheelEvent.h

raw
1 /***************************************************************************
2 * Copyright (c) 2020 Victor Titov (DeepSOIC) <[email protected]> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
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. *
10 * *
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. *
15 * *
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 *
20 * *
21 ***************************************************************************/
22
23 #ifndef SOMOUSEWHEELEVENT_H_FC
24 #define SOMOUSEWHEELEVENT_H_FC
25
26
27 #include <Inventor/events/SoEvent.h>
28 #include <Inventor/events/SoSubEvent.h>
29 #include <FCGlobal.h>
30
31 /**
32 * @brief The SoMouseWheelEvent class is a temporary replacement for
33 * SoMouseWheelEvent from Coin, for until freecad stops using Coin version that
34 * doesn't have one (coin v 4.0.0a doesn't have SoMouseWheelEvent).
35 */
36 class GuiExport SoMouseWheelEvent: public SoEvent
37 {
38 SO_EVENT_HEADER();
39
40 public: // methods
41 static void initClass()
42 {
43 SO_EVENT_INIT_CLASS(SoMouseWheelEvent, SoEvent);
44 }
45 SoMouseWheelEvent()
46 : delta(0)
47 {}
48 SoMouseWheelEvent(int delta)
49 : delta(delta)
50 {}
51 /// returns wheel position change. One click is usually 120 units,
52 /// smaller values come from high-resolution devices like touchpads
53 int getDelta() const
54 {
55 return delta;
56 }
57 void setDelta(int delta)
58 {
59 this->delta = delta;
60 }
61 ~SoMouseWheelEvent() override = default;
62
63 private: // data
64 int delta;
65 };
66
67 #endif