Changeset View
Standalone View
input.h
Show All 23 Lines | |||||
24 | #include <kwinglobals.h> | 24 | #include <kwinglobals.h> | ||
25 | #include <QAction> | 25 | #include <QAction> | ||
26 | #include <QObject> | 26 | #include <QObject> | ||
27 | #include <QPoint> | 27 | #include <QPoint> | ||
28 | #include <QPointer> | 28 | #include <QPointer> | ||
29 | #include <config-kwin.h> | 29 | #include <config-kwin.h> | ||
30 | 30 | | |||
31 | #include <KSharedConfig> | 31 | #include <KSharedConfig> | ||
32 | #include <QSet> | ||||
32 | 33 | | |||
33 | #include <functional> | 34 | #include <functional> | ||
34 | 35 | | |||
35 | class KGlobalAccelInterface; | 36 | class KGlobalAccelInterface; | ||
36 | class QKeySequence; | 37 | class QKeySequence; | ||
37 | class QMouseEvent; | 38 | class QMouseEvent; | ||
38 | class QKeyEvent; | 39 | class QKeyEvent; | ||
39 | class QWheelEvent; | 40 | class QWheelEvent; | ||
40 | 41 | | |||
41 | namespace KWin | 42 | namespace KWin | ||
42 | { | 43 | { | ||
43 | class GlobalShortcutsManager; | 44 | class GlobalShortcutsManager; | ||
44 | class Toplevel; | 45 | class Toplevel; | ||
45 | class InputEventFilter; | 46 | class InputEventFilter; | ||
46 | class InputEventSpy; | 47 | class InputEventSpy; | ||
47 | class KeyboardInputRedirection; | 48 | class KeyboardInputRedirection; | ||
48 | class PointerInputRedirection; | 49 | class PointerInputRedirection; | ||
50 | class TabletInputRedirection; | ||||
49 | class TouchInputRedirection; | 51 | class TouchInputRedirection; | ||
50 | class WindowSelectorFilter; | 52 | class WindowSelectorFilter; | ||
51 | class SwitchEvent; | 53 | class SwitchEvent; | ||
52 | 54 | | |||
53 | namespace Decoration | 55 | namespace Decoration | ||
54 | { | 56 | { | ||
55 | class DecoratedClientImpl; | 57 | class DecoratedClientImpl; | ||
56 | } | 58 | } | ||
57 | 59 | | |||
58 | namespace LibInput | 60 | namespace LibInput | ||
59 | { | 61 | { | ||
60 | class Connection; | 62 | class Connection; | ||
63 | class Device; | ||||
61 | } | 64 | } | ||
62 | 65 | | |||
63 | /** | 66 | /** | ||
64 | * @brief This class is responsible for redirecting incoming input to the surface which currently | 67 | * @brief This class is responsible for redirecting incoming input to the surface which currently | ||
65 | * has input or send enter/leave events. | 68 | * has input or send enter/leave events. | ||
66 | * | 69 | * | ||
67 | * In addition input is intercepted before passed to the surfaces to have KWin internal areas | 70 | * In addition input is intercepted before passed to the surfaces to have KWin internal areas | ||
68 | * getting input first (e.g. screen edges) and filter the input event out if we currently have | 71 | * getting input first (e.g. screen edges) and filter the input event out if we currently have | ||
Show All 18 Lines | 86 | enum PointerAxisSource { | |||
87 | PointerAxisSourceContinuous, | 90 | PointerAxisSourceContinuous, | ||
88 | PointerAxisSourceWheelTilt | 91 | PointerAxisSourceWheelTilt | ||
89 | }; | 92 | }; | ||
90 | enum KeyboardKeyState { | 93 | enum KeyboardKeyState { | ||
91 | KeyboardKeyReleased, | 94 | KeyboardKeyReleased, | ||
92 | KeyboardKeyPressed, | 95 | KeyboardKeyPressed, | ||
93 | KeyboardKeyAutoRepeat | 96 | KeyboardKeyAutoRepeat | ||
94 | }; | 97 | }; | ||
98 | enum TabletEventType { | ||||
romangg: clang-format stupid | |||||
99 | Axis, | ||||
100 | Proximity, | ||||
101 | Tip | ||||
102 | }; | ||||
95 | ~InputRedirection() override; | 103 | ~InputRedirection() override; | ||
96 | void init(); | 104 | void init(); | ||
97 | 105 | | |||
98 | /** | 106 | /** | ||
99 | * @return const QPointF& The current global pointer position | 107 | * @return const QPointF& The current global pointer position | ||
100 | */ | 108 | */ | ||
101 | QPointF globalPointer() const; | 109 | QPointF globalPointer() const; | ||
102 | Qt::MouseButtons qtButtonStates() const; | 110 | Qt::MouseButtons qtButtonStates() const; | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | |||||
216 | } | 224 | } | ||
217 | 225 | | |||
218 | KeyboardInputRedirection *keyboard() const { | 226 | KeyboardInputRedirection *keyboard() const { | ||
219 | return m_keyboard; | 227 | return m_keyboard; | ||
220 | } | 228 | } | ||
221 | PointerInputRedirection *pointer() const { | 229 | PointerInputRedirection *pointer() const { | ||
222 | return m_pointer; | 230 | return m_pointer; | ||
223 | } | 231 | } | ||
232 | TabletInputRedirection *tablet() const | ||||
233 | { | ||||
romangg: bracket | |||||
From Frameworks coding style wiki page
So, the opening brace must be on the next line. zzag: From Frameworks coding style wiki page
> Exception: Function implementations, class, struct… | |||||
romangg: Are we doing it somewhere in KWin this way? | |||||
Only in a few places... but I'd like to point out that putting the opening brace and the method prototype on the same line goes against the coding style. zzag: Only in a few places... but I'd like to point out that putting the opening brace and the method… | |||||
I haven't seen these places. I always see in KWin code opening brackets on same line in this case. So I would prefer to be consistent in deviating from coding style here. Note also that getters keyboard(), pointers(),... directly above this new getter have opening brackets on the same line. In the end best would be to always have member function definitions in the cpp file. But for small getters it's really a hassle... romangg: I haven't seen these places. I always see in KWin code opening brackets on same line in this… | |||||
There are places where we use the other style, but not that many. Hopefully, we'll fix these annoying style issues one day with a little help from beloved clang-format. ;-)
++ zzag: There are places where we use the other style, but not that many. Hopefully, we'll fix these… | |||||
234 | return m_tablet; | ||||
235 | } | ||||
224 | TouchInputRedirection *touch() const { | 236 | TouchInputRedirection *touch() const { | ||
225 | return m_touch; | 237 | return m_touch; | ||
226 | } | 238 | } | ||
227 | 239 | | |||
228 | bool hasAlphaNumericKeyboard(); | 240 | bool hasAlphaNumericKeyboard(); | ||
229 | bool hasTabletModeSwitch(); | 241 | bool hasTabletModeSwitch(); | ||
230 | 242 | | |||
231 | void startInteractiveWindowSelection(std::function<void(KWin::Toplevel*)> callback, const QByteArray &cursorName); | 243 | void startInteractiveWindowSelection(std::function<void(KWin::Toplevel*)> callback, const QByteArray &cursorName); | ||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 289 | private: | |||
279 | void setupTouchpadShortcuts(); | 291 | void setupTouchpadShortcuts(); | ||
280 | void setupLibInputWithScreens(); | 292 | void setupLibInputWithScreens(); | ||
281 | void setupWorkspace(); | 293 | void setupWorkspace(); | ||
282 | void reconfigure(); | 294 | void reconfigure(); | ||
283 | void setupInputFilters(); | 295 | void setupInputFilters(); | ||
284 | void installInputEventFilter(InputEventFilter *filter); | 296 | void installInputEventFilter(InputEventFilter *filter); | ||
285 | KeyboardInputRedirection *m_keyboard; | 297 | KeyboardInputRedirection *m_keyboard; | ||
286 | PointerInputRedirection *m_pointer; | 298 | PointerInputRedirection *m_pointer; | ||
299 | TabletInputRedirection *m_tablet; | ||||
287 | TouchInputRedirection *m_touch; | 300 | TouchInputRedirection *m_touch; | ||
288 | 301 | | |||
289 | GlobalShortcutsManager *m_shortcuts; | 302 | GlobalShortcutsManager *m_shortcuts; | ||
290 | 303 | | |||
291 | LibInput::Connection *m_libInput = nullptr; | 304 | LibInput::Connection *m_libInput = nullptr; | ||
292 | 305 | | |||
293 | WindowSelectorFilter *m_windowSelector = nullptr; | 306 | WindowSelectorFilter *m_windowSelector = nullptr; | ||
294 | 307 | | |||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 339 | public: | |||
365 | 378 | | |||
366 | virtual bool swipeGestureBegin(int fingerCount, quint32 time); | 379 | virtual bool swipeGestureBegin(int fingerCount, quint32 time); | ||
367 | virtual bool swipeGestureUpdate(const QSizeF &delta, quint32 time); | 380 | virtual bool swipeGestureUpdate(const QSizeF &delta, quint32 time); | ||
368 | virtual bool swipeGestureEnd(quint32 time); | 381 | virtual bool swipeGestureEnd(quint32 time); | ||
369 | virtual bool swipeGestureCancelled(quint32 time); | 382 | virtual bool swipeGestureCancelled(quint32 time); | ||
370 | 383 | | |||
371 | virtual bool switchEvent(SwitchEvent *event); | 384 | virtual bool switchEvent(SwitchEvent *event); | ||
372 | 385 | | |||
386 | virtual bool tabletToolEvent(QTabletEvent *event); | ||||
387 | virtual bool tabletToolButtonEvent(const QSet<uint> &buttons); | ||||
388 | virtual bool tabletPadButtonEvent(const QSet<uint> &buttons); | ||||
389 | virtual bool tabletPadStripEvent(int number, int position, bool isFinger); | ||||
390 | virtual bool tabletPadRingEvent(int number, int position, bool isFinger); | ||||
391 | | ||||
373 | protected: | 392 | protected: | ||
374 | void passToWaylandServer(QKeyEvent *event); | 393 | void passToWaylandServer(QKeyEvent *event); | ||
375 | }; | 394 | }; | ||
376 | 395 | | |||
377 | class KWIN_EXPORT InputDeviceHandler : public QObject | 396 | class KWIN_EXPORT InputDeviceHandler : public QObject | ||
378 | { | 397 | { | ||
379 | Q_OBJECT | 398 | Q_OBJECT | ||
380 | public: | 399 | public: | ||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |
clang-format stupid