| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef QWAYLANDTOUCH_H |
| 6 |
#define QWAYLANDTOUCH_H |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#include <qpa/qwindowsysteminterface.h> |
| 20 |
|
| 21 |
#include <QtWaylandClient/private/qwayland-touch-extension.h> |
| 22 |
#include <QtWaylandClient/qtwaylandclientglobal.h> |
| 23 |
|
| 24 |
QT_BEGIN_NAMESPACE |
| 25 |
|
| 26 |
namespace QtWaylandClient { |
| 27 |
|
| 28 |
class QWaylandDisplay; |
| 29 |
class QWaylandInputDevice; |
| 30 |
|
| 31 |
class Q_WAYLAND_CLIENT_EXPORT QWaylandTouchExtension : public QtWayland::qt_touch_extension |
| 32 |
{ |
| 33 |
public: |
| 34 |
QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id); |
| 35 |
|
| 36 |
void touchCanceled(); |
| 37 |
|
| 38 |
private: |
| 39 |
void registerDevice(int caps); |
| 40 |
|
| 41 |
QWaylandDisplay *mDisplay = nullptr; |
| 42 |
|
| 43 |
void touch_extension_touch(uint32_t time, |
| 44 |
uint32_t id, |
| 45 |
uint32_t state, |
| 46 |
int32_t x, |
| 47 |
int32_t y, |
| 48 |
int32_t normalized_x, |
| 49 |
int32_t normalized_y, |
| 50 |
int32_t width, |
| 51 |
int32_t height, |
| 52 |
uint32_t pressure, |
| 53 |
int32_t velocity_x, |
| 54 |
int32_t velocity_y, |
| 55 |
uint32_t flags, |
| 56 |
struct wl_array *rawdata) override; |
| 57 |
void touch_extension_configure(uint32_t flags) override; |
| 58 |
|
| 59 |
void sendTouchEvent(); |
| 60 |
|
| 61 |
QList<QWindowSystemInterface::TouchPoint> mTouchPoints; |
| 62 |
QList<QWindowSystemInterface::TouchPoint> mPrevTouchPoints; |
| 63 |
QTouchDevice *mTouchDevice = nullptr; |
| 64 |
uint32_t mTimestamp; |
| 65 |
int mPointsLeft; |
| 66 |
uint32_t mFlags; |
| 67 |
int mMouseSourceId; |
| 68 |
QPointF mLastMouseLocal; |
| 69 |
QPointF mLastMouseGlobal; |
| 70 |
QWindow *mTargetWindow = nullptr; |
| 71 |
QWaylandInputDevice *mInputDevice = nullptr; |
| 72 |
}; |
| 73 |
|
| 74 |
} |
| 75 |
|
| 76 |
QT_END_NAMESPACE |
| 77 |
|
| 78 |
#endif |