Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qmultitouch_mac_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of other Qt classes. This header file may change from version to
11// version without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef QMULTITOUCH_MAC_P_H
17#define QMULTITOUCH_MAC_P_H
18
19#include <QtCore/qhash.h>
20#include <QtCore/private/qcore_mac_p.h>
21
22#include <QtGui/qpointingdevice.h>
23
24#include <qpa/qwindowsysteminterface.h>
25
28
29QT_BEGIN_NAMESPACE
30
31class QCocoaTouch
32{
33 public:
34 static QList<QWindowSystemInterface::TouchPoint> getCurrentTouchPointList(NSEvent *event, bool acceptSingleTouch);
35 static void setMouseInDraggingState(bool inDraggingState);
36 static QPointingDevice *getTouchDevice(QInputDevice::DeviceType type, quint64 id);
37
38 private:
39 static QHash<quint64, QPointingDevice*> _touchDevices;
40 static QHash<qint64, QCocoaTouch*> _currentTouches;
41 static QPointF _screenReferencePos;
42 static QPointF _trackpadReferencePos;
43 static int _idAssignmentCount;
44 static int _touchCount;
45 static bool _updateInternalStateOnly;
46
47 QWindowSystemInterface::TouchPoint _touchPoint;
48 qint64 _identity;
49
50 QCocoaTouch(NSTouch *nstouch);
51 ~QCocoaTouch();
52
53 void updateTouchData(NSTouch *nstouch, NSTouchPhase phase);
54 static QCocoaTouch *findQCocoaTouch(NSTouch *nstouch);
55 static QEventPoint::State toTouchPointState(NSTouchPhase nsState);
56};
57
58QT_END_NAMESPACE
59
60#endif // QMULTITOUCH_MAC_P_H
Q_FORWARD_DECLARE_OBJC_CLASS(NSTouch)
QT_FORWARD_DECLARE_OBJC_ENUM(NSTouchPhase, unsigned long)