1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QXCBSCROLLINGDEVICE_P_H
5#define QXCBSCROLLINGDEVICE_P_H
6
7#include <QtGui/private/qpointingdevice_p.h>
8
9QT_BEGIN_NAMESPACE
10
11class QXcbScrollingDevicePrivate : public QPointingDevicePrivate
12{
13 Q_DECLARE_PUBLIC(QPointingDevice)
14public:
15 QXcbScrollingDevicePrivate(const QString &name, qint64 id, QPointingDevice::Capabilities caps,
16 int buttonCount = 3, const QString &seatName = QString());
17
18 // scrolling-related data
19 int verticalIndex = 0;
20 int horizontalIndex = 0;
21 double verticalIncrement = 0;
22 double horizontalIncrement = 0;
23 Qt::Orientations orientations;
24 Qt::Orientations legacyOrientations;
25 mutable QPointF lastScrollPosition;
26 // end of scrolling-related data
27};
28
29class QXcbScrollingDevice : public QPointingDevice
30{
31 Q_OBJECT
32public:
33 QXcbScrollingDevice(QXcbScrollingDevicePrivate &d, QObject *parent)
34 : QPointingDevice(d, parent) {}
35
36 QXcbScrollingDevice(const QString &name, qint64 deviceId, Capabilities caps, int buttonCount,
37 const QString &seatName = QString(), QObject *parent = nullptr)
38 : QPointingDevice(*new QXcbScrollingDevicePrivate(name, deviceId, caps, buttonCount, seatName), parent)
39 {
40 }
41
42 inline static QXcbScrollingDevicePrivate *get(QXcbScrollingDevice *q)
43 {
44 return static_cast<QXcbScrollingDevicePrivate *>(QObjectPrivate::get(o: q));
45 }
46
47 inline static const QXcbScrollingDevicePrivate *get(const QXcbScrollingDevice *q)
48 {
49 return static_cast<const QXcbScrollingDevicePrivate *>(QObjectPrivate::get(o: q));
50 }
51
52};
53
54QT_END_NAMESPACE
55
56#endif // QXCBSCROLLINGDEVICE_P_H
57

source code of qtbase/src/plugins/platforms/xcb/qxcbscrollingdevice_p.h