1// Copyright (C) 2017 The Qt Company Ltd.
2// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QTWAYLAND_QWLTOUCH_P_H
6#define QTWAYLAND_QWLTOUCH_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
20#include <QtWaylandCompositor/QWaylandDestroyListener>
21#include <QtWaylandCompositor/QWaylandTouch>
22#include <QtWaylandCompositor/QWaylandSeat>
23#include <QtWaylandCompositor/QWaylandView>
24#include <QtWaylandCompositor/QWaylandCompositor>
25
26#include <QtCore/QPoint>
27#include <QtCore/qvarlengtharray.h>
28#include <QtCore/private/qobject_p.h>
29
30#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
31
32QT_BEGIN_NAMESPACE
33
34class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandTouchPrivate : public QObjectPrivate, public QtWaylandServer::wl_touch
35{
36 Q_DECLARE_PUBLIC(QWaylandTouch)
37public:
38 explicit QWaylandTouchPrivate(QWaylandTouch *touch, QWaylandSeat *seat);
39
40 QWaylandCompositor *compositor() const { return seat->compositor(); }
41
42 uint sendDown(QWaylandSurface *surface, uint32_t time, int touch_id, const QPointF &position);
43 void sendMotion(QWaylandClient *client, uint32_t time, int touch_id, const QPointF &position);
44 uint sendUp(QWaylandClient *client, uint32_t time, int touch_id);
45
46private:
47 void touch_release(Resource *resource) override;
48 int toSequentialWaylandId(int touchId);
49
50 QWaylandSeat *seat = nullptr;
51 QVarLengthArray<int, 10> ids;
52};
53
54QT_END_NAMESPACE
55
56#endif // QTWAYLAND_QWLTOUCH_P_H
57

source code of qtwayland/src/compositor/compositor_api/qwaylandtouch_p.h