Changeset View
Changeset View
Standalone View
Standalone View
input.h
Show All 17 Lines | |||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #ifndef KWIN_INPUT_H | 20 | #ifndef KWIN_INPUT_H | ||
21 | #define KWIN_INPUT_H | 21 | #define KWIN_INPUT_H | ||
22 | #include <kwinglobals.h> | 22 | #include <kwinglobals.h> | ||
23 | #include <QAction> | 23 | #include <QAction> | ||
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QPoint> | 25 | #include <QPoint> | ||
26 | #include <QPointer> | ||||
26 | #include <config-kwin.h> | 27 | #include <config-kwin.h> | ||
27 | 28 | | |||
28 | #include <KSharedConfig> | 29 | #include <KSharedConfig> | ||
29 | 30 | | |||
30 | class KGlobalAccelInterface; | 31 | class KGlobalAccelInterface; | ||
31 | class QKeySequence; | 32 | class QKeySequence; | ||
32 | class QMouseEvent; | 33 | class QMouseEvent; | ||
33 | class QKeyEvent; | 34 | class QKeyEvent; | ||
34 | class QWheelEvent; | 35 | class QWheelEvent; | ||
35 | 36 | | |||
36 | namespace KWin | 37 | namespace KWin | ||
37 | { | 38 | { | ||
38 | class GlobalShortcutsManager; | 39 | class GlobalShortcutsManager; | ||
39 | class Toplevel; | 40 | class Toplevel; | ||
40 | class InputEventFilter; | 41 | class InputEventFilter; | ||
41 | class KeyboardInputRedirection; | 42 | class KeyboardInputRedirection; | ||
42 | class PointerInputRedirection; | 43 | class PointerInputRedirection; | ||
43 | class TouchInputRedirection; | 44 | class TouchInputRedirection; | ||
44 | 45 | | |||
46 | namespace Decoration | ||||
47 | { | ||||
48 | class DecoratedClientImpl; | ||||
49 | } | ||||
50 | | ||||
45 | namespace LibInput | 51 | namespace LibInput | ||
46 | { | 52 | { | ||
47 | class Connection; | 53 | class Connection; | ||
48 | } | 54 | } | ||
49 | 55 | | |||
50 | /** | 56 | /** | ||
51 | * @brief This class is responsible for redirecting incoming input to the surface which currently | 57 | * @brief This class is responsible for redirecting incoming input to the surface which currently | ||
52 | * has input or send enter/leave events. | 58 | * has input or send enter/leave events. | ||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | 253 | public: | |||
275 | * @return @c tru to stop further event processing, @c false to pass to next filter. | 281 | * @return @c tru to stop further event processing, @c false to pass to next filter. | ||
276 | **/ | 282 | **/ | ||
277 | virtual bool keyEvent(QKeyEvent *event); | 283 | virtual bool keyEvent(QKeyEvent *event); | ||
278 | virtual bool touchDown(quint32 id, const QPointF &pos, quint32 time); | 284 | virtual bool touchDown(quint32 id, const QPointF &pos, quint32 time); | ||
279 | virtual bool touchMotion(quint32 id, const QPointF &pos, quint32 time); | 285 | virtual bool touchMotion(quint32 id, const QPointF &pos, quint32 time); | ||
280 | virtual bool touchUp(quint32 id, quint32 time); | 286 | virtual bool touchUp(quint32 id, quint32 time); | ||
281 | }; | 287 | }; | ||
282 | 288 | | |||
289 | class InputDeviceHandler : public QObject | ||||
290 | { | ||||
291 | Q_OBJECT | ||||
292 | public: | ||||
293 | virtual ~InputDeviceHandler(); | ||||
294 | | ||||
295 | QPointer<Toplevel> window() const { | ||||
296 | return m_window; | ||||
297 | } | ||||
298 | QPointer<Decoration::DecoratedClientImpl> decoration() const { | ||||
299 | return m_decoration; | ||||
300 | } | ||||
301 | | ||||
302 | Q_SIGNALS: | ||||
303 | void decorationChanged(); | ||||
304 | | ||||
305 | protected: | ||||
306 | explicit InputDeviceHandler(InputRedirection *parent); | ||||
307 | void updateDecoration(Toplevel *t, const QPointF &pos); | ||||
308 | InputRedirection *m_input; | ||||
309 | /** | ||||
310 | * @brief The Toplevel which currently receives events | ||||
311 | */ | ||||
312 | QPointer<Toplevel> m_window; | ||||
313 | /** | ||||
314 | * @brief The Decoration which currently receives events. | ||||
315 | **/ | ||||
316 | QPointer<Decoration::DecoratedClientImpl> m_decoration; | ||||
317 | }; | ||||
318 | | ||||
283 | inline | 319 | inline | ||
284 | InputRedirection *input() | 320 | InputRedirection *input() | ||
285 | { | 321 | { | ||
286 | return InputRedirection::s_self; | 322 | return InputRedirection::s_self; | ||
287 | } | 323 | } | ||
288 | 324 | | |||
289 | template <typename T> | 325 | template <typename T> | ||
290 | inline | 326 | inline | ||
Show All 12 Lines |