KWayland

touch.h
1 /*
2  SPDX-FileCopyrightText: 2015 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_TOUCH_H
7 #define WAYLAND_TOUCH_H
8 
9 #include <QObject>
10 #include <QPoint>
11 
12 #include <KWayland/Client/kwaylandclient_export.h>
13 
14 struct wl_touch;
15 
16 namespace KWayland
17 {
18 namespace Client
19 {
20 
21 class Surface;
22 class Touch;
23 
27 class KWAYLANDCLIENT_EXPORT TouchPoint
28 {
29 public:
30  virtual ~TouchPoint();
31 
37  qint32 id() const;
41  quint32 downSerial() const;
45  quint32 upSerial() const;
49  quint32 time() const;
54  QVector<quint32> timestamps() const;
58  QPointF position() const;
62  QVector<QPointF> positions() const;
66  QPointer<Surface> surface() const;
70  bool isDown() const;
71 
72 private:
73  friend class Touch;
74  explicit TouchPoint();
75  class Private;
77 };
78 
88 class KWAYLANDCLIENT_EXPORT Touch : public QObject
89 {
90  Q_OBJECT
91 public:
92  explicit Touch(QObject *parent = nullptr);
93  virtual ~Touch();
94 
98  bool isValid() const;
104  void setup(wl_touch *touch);
113  void release();
128  void destroy();
129 
134  QVector<TouchPoint*> sequence() const;
135 
136  operator wl_touch*();
137  operator wl_touch*() const;
138 
139 Q_SIGNALS:
144  void sequenceStarted(KWayland::Client::TouchPoint *startPoint);
149  void sequenceCanceled();
153  void sequenceEnded();
157  void frameEnded();
161  void pointAdded(KWayland::Client::TouchPoint *point);
166  void pointRemoved(KWayland::Client::TouchPoint *point);
170  void pointMoved(KWayland::Client::TouchPoint *point);
171 
172 private:
173  class Private;
175 };
176 
177 }
178 }
179 
180 Q_DECLARE_METATYPE(KWayland::Client::TouchPoint*)
181 
182 #endif
Wrapper for the wl_touch interface.
Definition: touch.h:88
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Nov 30 2020 22:50:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.