| 1 | /* |
| 2 | * Copyright (C) 2015 Canonical Ltd. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; version 3. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | |
| 17 | #ifndef UCSWIPEAREA_P_P_H |
| 18 | #define UCSWIPEAREA_P_P_Hcxx . . $ `src/LomiriGestures/ucswipearea_p_p.h:18:9`! |
| 19 | |
| 20 | #include <QtGlobal> |
| 21 | |
| 22 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 23 | #include <LomiriGestures-Qt6/private/ucswipearea_p.h> |
| 24 | #else |
| 25 | #include <LomiriGestures/private/ucswipearea_p.h>cxx . . $ `<file>/include/LomiriGestures/5.5.0/LomiriGestures/private/ucswipearea_p.h`/ |
| 26 | #endif |
| 27 | |
| 28 | #include <QtQuick/private/qquickitem_p.h> |
| 29 | |
| 30 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 31 | #include <LomiriGestures-Qt6/private/damper_p.h> |
| 32 | #else |
| 33 | #include <LomiriGestures/private/damper_p.h>cxx . . $ `<file>/include/LomiriGestures/5.5.0/LomiriGestures/private/damper_p.h`/ |
| 34 | #endif |
| 35 | |
| 36 | UG_NAMESPACE_BEGINcxx . . $ LomiriGestures/ |
| 37 | |
| 38 | // Information about an active touch point |
| 39 | struct LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! ActiveTouchInfocxx . . $ LomiriGestures/ActiveTouchInfo# { |
| 40 | ActiveTouchInfocxx . . $ LomiriGestures/ActiveTouchInfo#ActiveTouchInfo(49f6e7a06ebc5aa8).() : idcxx . . $ LomiriGestures/ActiveTouchInfo#id.(-1), startTimecxx . . $ LomiriGestures/ActiveTouchInfo#startTime.(-1) {} |
| 41 | bool isValidcxx . . $ LomiriGestures/ActiveTouchInfo#isValid(50ce9a9e25b4a850).() const { return idcxx . . $ LomiriGestures/ActiveTouchInfo#id. != -1; } |
| 42 | void resetcxx . . $ LomiriGestures/ActiveTouchInfo#reset(49f6e7a06ebc5aa8).() { idcxx . . $ LomiriGestures/ActiveTouchInfo#id. = -1; } |
| 43 | int idcxx . . $ LomiriGestures/ActiveTouchInfo#id.; |
| 44 | qint64cxx . . $ qint64# startTimecxx . . $ LomiriGestures/ActiveTouchInfo#startTime.; |
| 45 | }; |
| 46 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:23:11`! ActiveTouchesInfocxx . . $ LomiriGestures/ActiveTouchesInfo# { |
| 47 | public: |
| 48 | ActiveTouchesInfocxx . . $ LomiriGestures/ActiveTouchesInfo#ActiveTouchesInfo(e13a9371cd1b0d44).(const UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/SharedTimeSource#(SharedTimeSource) &timeSource); |
| 49 | void updatecxx . . $ LomiriGestures/ActiveTouchesInfo#update(3088690d2ec9a7bd).(QTouchEventcxx . . $ QTouchEvent# *event); |
| 50 | qint64cxx . . $ qint64# touchStartTimecxx . . $ LomiriGestures/ActiveTouchesInfo#touchStartTime(9ccc33c3ebad048d).(int id); |
| 51 | bool isEmptycxx . . $ LomiriGestures/ActiveTouchesInfo#isEmpty(50ce9a9e25b4a850).() const { return m_touchInfoPoolcxx . . $ LomiriGestures/ActiveTouchesInfo#m_touchInfoPool..isEmptycxx . . $ Pool#isEmpty(50ce9a9e25b4a850).(); } |
| 52 | qint64cxx . . $ qint64# mostRecentStartTimecxx . . $ LomiriGestures/ActiveTouchesInfo#mostRecentStartTime(a5d9f2bf8849668d).(); |
| 53 | UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/(SharedTimeSource) m_timeSourcecxx . . $ LomiriGestures/ActiveTouchesInfo#m_timeSource.; |
| 54 | private: |
| 55 | void addTouchPointcxx . . $ LomiriGestures/ActiveTouchesInfo#addTouchPoint(d4f767463ce0a6b3).(int touchId); |
| 56 | void removeTouchPointcxx . . $ LomiriGestures/ActiveTouchesInfo#removeTouchPoint(d4f767463ce0a6b3).(int touchId); |
| 57 | QStringcxx . . $ QString# toStringcxx . . $ LomiriGestures/ActiveTouchesInfo#toString(4365c3963150523e).(); |
| 58 | |
| 59 | Poolcxx . . $ Pool#<ActiveTouchInfocxx . . $ LomiriGestures/ActiveTouchInfo#> m_touchInfoPoolcxx . . $ LomiriGestures/ActiveTouchesInfo#m_touchInfoPool.; |
| 60 | }; |
| 61 | |
| 62 | class UCSwipeAreaStatusListenercxx . . $ LomiriGestures/UCSwipeAreaStatusListener#; |
| 63 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:23:11`! UCSwipeAreaPrivatecxx . . $ LomiriGestures/UCSwipeAreaPrivate# : public QQuickItemPrivatecxx . . $ QQuickItemPrivate# |
| 64 | { |
| 65 | Q_DECLARE_PUBLICcxx . . $ QObjectData#q_ptr.(UCSwipeArea) |
| 66 | |
| 67 | Q_ENUMScxx . . $ `<external>/1208926524888476972/qobjectdefs.h:111:9`!(Status) |
| 68 | public: |
| 69 | UCSwipeAreaPrivatecxx . . $ LomiriGestures/UCSwipeAreaPrivate#UCSwipeAreaPrivate(49f6e7a06ebc5aa8).(); |
| 70 | void initcxx . . $ LomiriGestures/UCSwipeAreaPrivate#init(49f6e7a06ebc5aa8).(); |
| 71 | static UCSwipeAreaPrivatecxx . . $ LomiriGestures/UCSwipeAreaPrivate# *getcxx . . $ LomiriGestures/UCSwipeAreaPrivate#get(52e6ad1f65615d0e).(UCSwipeAreacxx . . $ LomiriGestures/UCSwipeArea# *area) |
| 72 | { |
| 73 | return area->d_funccxx . . $ LomiriGestures/UCSwipeArea#d_func(2cf2f7f1d9f280cb).(); |
| 74 | } |
| 75 | |
| 76 | void setMaxTimecxx . . $ LomiriGestures/UCSwipeAreaPrivate#setMaxTime(d4f767463ce0a6b3).(int value); |
| 77 | |
| 78 | void setCompositionTimecxx . . $ LomiriGestures/UCSwipeAreaPrivate#setCompositionTime(d4f767463ce0a6b3).(int value); |
| 79 | |
| 80 | // Replaces the existing Timer with the given one. |
| 81 | // |
| 82 | // Useful for providing a fake timer when testing. |
| 83 | void setRecognitionTimercxx . . $ LomiriGestures/UCSwipeAreaPrivate#setRecognitionTimer(51ff982643cafd7).(UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/(AbstractTimer) *timer); |
| 84 | |
| 85 | // Useful for testing, where a fake time source can be supplied |
| 86 | void setTimeSourcecxx . . $ LomiriGestures/UCSwipeAreaPrivate#setTimeSource(e13a9371cd1b0d44).(const UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/SharedTimeSource#(SharedTimeSource) &timeSource); |
| 87 | |
| 88 | // Describes the state of the directional drag gesture. |
| 89 | enum Statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#Status# { |
| 90 | // Waiting for a new touch point to land on this area. No gesture is being processed |
| 91 | // or tracked. |
| 92 | WaitingForTouchcxx . . $ LomiriGestures/UCSwipeAreaPrivate#WaitingForTouch., |
| 93 | |
| 94 | // A touch point has landed on this area but it's not know yet whether it is |
| 95 | // performing a drag in the correct direction. |
| 96 | // If it's decided that the touch point is not performing a directional drag gesture, |
| 97 | // it will be rejected/ignored and status will return to WaitingForTouch. |
| 98 | Undecidedcxx . . $ LomiriGestures/UCSwipeAreaPrivate#Undecided., //Recognizing, |
| 99 | |
| 100 | // There's a touch point in this area and it performed a drag in the correct |
| 101 | // direction. |
| 102 | // |
| 103 | // Once recognized, the gesture state will move back to WaitingForTouch only once |
| 104 | // that touch point ends. The gesture will remain in the Recognized state even if |
| 105 | // the touch point starts moving in other directions or halts. |
| 106 | Recognizedcxx . . $ LomiriGestures/UCSwipeAreaPrivate#Recognized., |
| 107 | }; |
| 108 | |
| 109 | void touchEvent_absentcxx . . $ LomiriGestures/UCSwipeAreaPrivate#touchEvent_absent(3088690d2ec9a7bd).(QTouchEventcxx . . $ QTouchEvent# *event); |
| 110 | void touchEvent_undecidedcxx . . $ LomiriGestures/UCSwipeAreaPrivate#touchEvent_undecided(3088690d2ec9a7bd).(QTouchEventcxx . . $ QTouchEvent# *event); |
| 111 | void touchEvent_recognizedcxx . . $ LomiriGestures/UCSwipeAreaPrivate#touchEvent_recognized(3088690d2ec9a7bd).(QTouchEventcxx . . $ QTouchEvent# *event); |
| 112 | bool movingInRightDirectioncxx . . $ LomiriGestures/UCSwipeAreaPrivate#movingInRightDirection(50ce9a9e25b4a850).() const; |
| 113 | bool movedFarEnoughAlongGestureAxiscxx . . $ LomiriGestures/UCSwipeAreaPrivate#movedFarEnoughAlongGestureAxis(50ce9a9e25b4a850).() const; |
| 114 | bool isPastMaxDistancecxx . . $ LomiriGestures/UCSwipeAreaPrivate#isPastMaxDistance(50ce9a9e25b4a850).() const; |
| 115 | const QTouchEventcxx . . $ QTouchEvent#::TouchPointcxx . . $ QTouchEvent#TouchPoint# *fetchTargetTouchPointcxx . . $ LomiriGestures/UCSwipeAreaPrivate#fetchTargetTouchPoint(a361cd60761dbe49).(QTouchEventcxx . . $ QTouchEvent# *event); |
| 116 | void setStatuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#setStatus(ce250bfcc812ed41).(Statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#Status# newStatus); |
| 117 | void updatePositioncxx . . $ LomiriGestures/UCSwipeAreaPrivate#updatePosition(4258778b894f8bb6).(const QPointFcxx . . $ QPointF# &point); |
| 118 | void setPublicScenePoscxx . . $ LomiriGestures/UCSwipeAreaPrivate#setPublicScenePos(4258778b894f8bb6).(const QPointFcxx . . $ QPointF# &point); |
| 119 | bool isWithinTouchCompositionWindowcxx . . $ LomiriGestures/UCSwipeAreaPrivate#isWithinTouchCompositionWindow(c9857a73d68e59ba).(); |
| 120 | void updateSceneDirectionVectorcxx . . $ LomiriGestures/UCSwipeAreaPrivate#updateSceneDirectionVector(49f6e7a06ebc5aa8).(); |
| 121 | // returns the scalar projection between the given vector (in scene coordinates) |
| 122 | // and m_sceneDirectionVector |
| 123 | qrealcxx . . $ qreal# projectOntoDirectionVectorcxx . . $ LomiriGestures/UCSwipeAreaPrivate#projectOntoDirectionVector(6e37e6397cbd5f24).(const QPointFcxx . . $ QPointF# &sceneVector) const; |
| 124 | void touchOwnershipEventcxx . . $ LomiriGestures/UCSwipeAreaPrivate#touchOwnershipEvent(acbc5205c8b9efbd).(TouchOwnershipEventcxx . . $ LomiriGestures/TouchOwnershipEvent# *event); |
| 125 | void unownedTouchEventcxx . . $ LomiriGestures/UCSwipeAreaPrivate#unownedTouchEvent(81690ce7bd9b603a).(UnownedTouchEventcxx . . $ LomiriGestures/UnownedTouchEvent# *event); |
| 126 | void unownedTouchEvent_undecidedcxx . . $ LomiriGestures/UCSwipeAreaPrivate#unownedTouchEvent_undecided(81690ce7bd9b603a).(UnownedTouchEventcxx . . $ LomiriGestures/UnownedTouchEvent# *unownedTouchEvent); |
| 127 | void watchPressedTouchPointscxx . . $ LomiriGestures/UCSwipeAreaPrivate#watchPressedTouchPoints(94decdeda16691e3).(const QListcxx . . $ QList#<QTouchEventcxx . . $ QTouchEvent#::TouchPointcxx . . $ QTouchEvent#TouchPoint#> &touchPoints); |
| 128 | bool recognitionIsDisabledcxx . . $ LomiriGestures/UCSwipeAreaPrivate#recognitionIsDisabled(50ce9a9e25b4a850).() const; |
| 129 | bool sanityCheckRecognitionPropertiescxx . . $ LomiriGestures/UCSwipeAreaPrivate#sanityCheckRecognitionProperties(c9857a73d68e59ba).(); |
| 130 | void setDistanceThresholdcxx . . $ LomiriGestures/UCSwipeAreaPrivate#setDistanceThreshold(ba8836b59fb42830).(qrealcxx . . $ qreal# value); |
| 131 | void setPixelsPerMmcxx . . $ LomiriGestures/UCSwipeAreaPrivate#setPixelsPerMm(ba8836b59fb42830).(qrealcxx . . $ qreal# pixelsPerMm); |
| 132 | QStringcxx . . $ QString# objectNamecxx . . $ LomiriGestures/UCSwipeAreaPrivate#objectName(6ef7b6c27b00b43d).() const { return q_funccxx . . $ LomiriGestures/UCSwipeAreaPrivate#q_func(17baa1a50e343968).()->objectNamecxx . . $ QObject#objectName(6ef7b6c27b00b43d).(); } |
| 133 | |
| 134 | // manage status change listeners |
| 135 | void addStatusChangeListenercxx . . $ LomiriGestures/UCSwipeAreaPrivate#addStatusChangeListener(51e7e61b326ee463).(UCSwipeAreaStatusListenercxx . . $ LomiriGestures/UCSwipeAreaStatusListener# *listener); |
| 136 | void removeStatusChangeListenercxx . . $ LomiriGestures/UCSwipeAreaPrivate#removeStatusChangeListener(51e7e61b326ee463).(UCSwipeAreaStatusListenercxx . . $ LomiriGestures/UCSwipeAreaStatusListener# *listener); |
| 137 | |
| 138 | QPointFcxx . . $ QPointF# startScenePoscxx . . $ LomiriGestures/UCSwipeAreaPrivate#startScenePos.; |
| 139 | // The touch position exposed in the public API. |
| 140 | // It only starts to move once the gesture gets recognized. |
| 141 | QPointFcxx . . $ QPointF# publicScenePoscxx . . $ LomiriGestures/UCSwipeAreaPrivate#publicScenePos.; |
| 142 | // A movement damper is used in some of the gesture recognition calculations |
| 143 | // to get rid of noise or small oscillations in the touch position. |
| 144 | DampedPointFcxx . . $ DampedPointF# dampedScenePoscxx . . $ LomiriGestures/UCSwipeAreaPrivate#dampedScenePos.; |
| 145 | QPointFcxx . . $ QPointF# previousDampedScenePoscxx . . $ LomiriGestures/UCSwipeAreaPrivate#previousDampedScenePos.; |
| 146 | // Unit vector in scene coordinates describing the direction of the gesture recognition |
| 147 | QPointFcxx . . $ QPointF# sceneDirectionVectorcxx . . $ LomiriGestures/UCSwipeAreaPrivate#sceneDirectionVector.; |
| 148 | UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/SharedTimeSource#(SharedTimeSource) timeSourcecxx . . $ LomiriGestures/UCSwipeAreaPrivate#timeSource.; |
| 149 | ActiveTouchesInfocxx . . $ LomiriGestures/ActiveTouchesInfo# activeTouchescxx . . $ LomiriGestures/UCSwipeAreaPrivate#activeTouches.; |
| 150 | |
| 151 | // status change listeners |
| 152 | QListcxx . . $ QList#<UCSwipeAreaStatusListenercxx . . $ LomiriGestures/UCSwipeAreaStatusListener#*> statusChangeListenerscxx . . $ LomiriGestures/UCSwipeAreaPrivate#statusChangeListeners.; |
| 153 | |
| 154 | UG_PREPEND_NAMESPACEcxx . . $ LomiriGestures/(AbstractTimer) *recognitionTimercxx . . $ LomiriGestures/UCSwipeAreaPrivate#recognitionTimer.; |
| 155 | |
| 156 | // How far a touch point has to move from its initial position along the gesture axis in order |
| 157 | // for it to be recognized as a directional drag. |
| 158 | qrealcxx . . $ qreal# distanceThresholdcxx . . $ LomiriGestures/UCSwipeAreaPrivate#distanceThreshold.; |
| 159 | qrealcxx . . $ qreal# distanceThresholdSquaredcxx . . $ LomiriGestures/UCSwipeAreaPrivate#distanceThresholdSquared.; // it's pow(distanceThreshold, 2) |
| 160 | // Maximum distance the gesture can go without crossing the axis-aligned distance threshold |
| 161 | qrealcxx . . $ qreal# maxDistancecxx . . $ LomiriGestures/UCSwipeAreaPrivate#maxDistance.; |
| 162 | qrealcxx . . $ qreal# sceneDistancecxx . . $ LomiriGestures/UCSwipeAreaPrivate#sceneDistance.; |
| 163 | |
| 164 | int touchIdcxx . . $ LomiriGestures/UCSwipeAreaPrivate#touchId.; |
| 165 | // Maximum time (in milliseconds) the gesture can take to go beyond the distance threshold |
| 166 | int maxTimecxx . . $ LomiriGestures/UCSwipeAreaPrivate#maxTime.; |
| 167 | // Maximum time (in milliseconds) after the start of a given touch point where |
| 168 | // subsequent touch starts are grouped with the first one into an N-touches gesture |
| 169 | // (e.g. a two-fingers tap or drag). |
| 170 | int compositionTimecxx . . $ LomiriGestures/UCSwipeAreaPrivate#compositionTime.; |
| 171 | |
| 172 | // The current status of the directional drag gesture area. |
| 173 | Statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#Status# statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#status.; |
| 174 | UCSwipeAreacxx . . $ LomiriGestures/UCSwipeArea#::Directioncxx . . $ LomiriGestures/UCSwipeArea#Direction# directioncxx . . $ LomiriGestures/UCSwipeAreaPrivate#direction.; |
| 175 | |
| 176 | bool immediateRecognitioncxx . . $ LomiriGestures/UCSwipeAreaPrivate#immediateRecognition.; |
| 177 | bool grabGesturecxx . . $ LomiriGestures/UCSwipeAreaPrivate#grabGesture.; |
| 178 | }; |
| 179 | |
| 180 | class LOMIRIGESTURES_EXPORTcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:25:11`! UCSwipeAreaStatusListenercxx . . $ LomiriGestures/UCSwipeAreaStatusListener# |
| 181 | { |
| 182 | public: |
| 183 | virtual void swipeStatusChangedcxx . . $ LomiriGestures/UCSwipeAreaStatusListener#swipeStatusChanged(ebb21c0c154bdc15).(UCSwipeAreaPrivatecxx . . $ LomiriGestures/UCSwipeAreaPrivate#::Statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#Status# /*old*/, UCSwipeAreaPrivatecxx . . $ LomiriGestures/UCSwipeAreaPrivate#::Statuscxx . . $ LomiriGestures/UCSwipeAreaPrivate#Status# /*new*/) {} |
| 184 | }; |
| 185 | |
| 186 | UG_NAMESPACE_ENDcxx . . $ `src/LomiriGestures/lomirigesturesglobal.h:31:9`! |
| 187 | |
| 188 | #endif // UCSWIPEAREA_P_P_H |