| 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 QQUICKPINCHAREA_P_H |
| 5 | #define QQUICKPINCHAREA_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <qevent.h> |
| 19 | |
| 20 | #include "qquickitem_p.h" |
| 21 | #include "qquickpincharea_p.h" |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QQuickPinch; |
| 26 | class QQuickPinchAreaPrivate : public QQuickItemPrivate |
| 27 | { |
| 28 | Q_DECLARE_PUBLIC(QQuickPinchArea) |
| 29 | public: |
| 30 | QQuickPinchAreaPrivate() |
| 31 | : enabled(true), inPinch(false), pinchRejected(false), pinchActivated(false), initPinch(false) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | ~QQuickPinchAreaPrivate(); |
| 36 | |
| 37 | void init() |
| 38 | { |
| 39 | Q_Q(QQuickPinchArea); |
| 40 | q->setAcceptTouchEvents(true); |
| 41 | q->setFiltersChildMouseEvents(true); |
| 42 | } |
| 43 | |
| 44 | bool enabled : 1; |
| 45 | bool inPinch : 1; |
| 46 | bool pinchRejected : 1; |
| 47 | bool pinchActivated : 1; |
| 48 | bool initPinch : 1; |
| 49 | int id1 = -1; |
| 50 | QQuickPinch *pinch = nullptr; |
| 51 | QPointF sceneStartPoint1; |
| 52 | QPointF sceneStartPoint2; |
| 53 | QPointF lastPoint1; |
| 54 | QPointF lastPoint2; |
| 55 | qreal pinchStartDist = 0; |
| 56 | qreal pinchStartScale = 1; |
| 57 | qreal pinchLastScale = 1; |
| 58 | qreal pinchStartRotation = 0; |
| 59 | qreal pinchStartAngle = 0; |
| 60 | qreal pinchLastAngle = 0; |
| 61 | qreal pinchRotation = 0; |
| 62 | QPointF sceneStartCenter; |
| 63 | QPointF pinchStartCenter; |
| 64 | QPointF sceneLastCenter; |
| 65 | QPointF pinchStartPos; |
| 66 | QList<QEventPoint> touchPoints; |
| 67 | }; |
| 68 | |
| 69 | QT_END_NAMESPACE |
| 70 | |
| 71 | #endif // QQUICKPINCHAREA_P_H |
| 72 | |
| 73 |
