on xenial help sign in
fix other build issues
commit4f09de5ad4d497c60cc5e1f45bafaf9acf86650a authorZsombor Egri <zsombor.egri@canonical.com> dateFri 8 Jul 2016, 17:36 (10 years ago) parentbbb6472
13 files changed+47−38
plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp+4−4 plugins/Ubuntu/Gestures/AxisVelocityCalculator.h+3−3 plugins/Ubuntu/Gestures/CMakeLists.txt+1 plugins/Ubuntu/Gestures/TouchGate.cpp+5−5 plugins/Ubuntu/Gestures/TouchGate.h+3−2 plugins/Ubuntu/Gestures/TouchGestureArea.cpp+12−10 plugins/Ubuntu/Gestures/TouchGestureArea.h+7−6 tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1 tests/plugins/Ubuntu/Gestures/GestureTest.cpp+1−1 tests/plugins/Ubuntu/Gestures/GestureTest.h+4−5 tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+2 tests/utils/modules/Unity/Test/CMakeLists.txt+1 tests/utils/modules/Unity/Test/testutil.cpp+3−2
plugins/Ubuntu/Gestures/AxisVelocityCalculator.cpp+4−4
@@ -21,14 +21,14 @@
2121#include "AxisVelocityCalculator.h"
2222#include <QtCore/QElapsedTimer>
2323
24−using namespace UbuntuGestures;
24+UG_USE_NAMESPACE
2525
2626AxisVelocityCalculator::AxisVelocityCalculator(QObject *parent)
27− : AxisVelocityCalculator(SharedTimeSource(new RealTimeSource), parent)
27+ : AxisVelocityCalculator(UG_PREPEND_NAMESPACE(SharedTimeSource)(new UG_PREPEND_NAMESPACE(RealTimeSource)), parent)
2828{
2929}
3030
31−AxisVelocityCalculator::AxisVelocityCalculator(const SharedTimeSource &timeSource,
31+AxisVelocityCalculator::AxisVelocityCalculator(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource,
3232 QObject *parent)
3333 : QObject(parent)
3434 , m_timeSource(timeSource)
@@ -136,7 +136,7 @@ int AxisVelocityCalculator::numSamples() const
136136 }
137137}
138138
139−void AxisVelocityCalculator::setTimeSource(const SharedTimeSource &timeSource)
139+void AxisVelocityCalculator::setTimeSource(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource)
140140{
141141 m_timeSource = timeSource;
142142
plugins/Ubuntu/Gestures/AxisVelocityCalculator.h+3−3
@@ -68,7 +68,7 @@ public:
6868 /*
6969 Constructor that takes a TimeSource
7070 */
71− AxisVelocityCalculator(const UbuntuGestures::SharedTimeSource &timeSource, QObject *parent = 0);
71+ AxisVelocityCalculator(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource, QObject *parent = 0);
7272
7373 virtual ~AxisVelocityCalculator();
7474
@@ -90,7 +90,7 @@ public:
9090 /*
9191 Replaces the TimeSource with the given one. Useful for testing purposes.
9292 */
93− void setTimeSource(const UbuntuGestures::SharedTimeSource &timeSource);
93+ void setTimeSource(const UG_PREPEND_NAMESPACE(SharedTimeSource) &timeSource);
9494
9595 /*
9696 The minimum amount of samples needed for a velocity calculation.
@@ -138,7 +138,7 @@ private:
138138 int m_samplesRead; /* index of the oldest sample available. -1 if buffer is empty */
139139 int m_samplesWrite; /* index where the next sample will be written */
140140
141− UbuntuGestures::SharedTimeSource m_timeSource;
141+ UG_PREPEND_NAMESPACE(SharedTimeSource) m_timeSource;
142142
143143 qreal m_trackedPosition;
144144};
plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -27,6 +27,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
2727include_directories(
2828 SYSTEM
2929 ${UBUNTUGESTURES_INCLUDE_DIRS}
30+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
3031)
3132
3233# There's no cmake var for v8 include path :-/ so create one
plugins/Ubuntu/Gestures/TouchGate.cpp+5−5
@@ -39,8 +39,8 @@ TouchGate::TouchGate(QQuickItem *parent)
3939
4040bool TouchGate::event(QEvent *e)
4141{
42− if (e->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
43− touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(e));
42+ if (e->type() == UG_PREPEND_NAMESPACE(TouchOwnershipEvent)::touchOwnershipEventType()) {
43+ touchOwnershipEvent(static_cast<UG_PREPEND_NAMESPACE(TouchOwnershipEvent*)>(e));
4444 return true;
4545 } else {
4646 return QQuickItem::event(e);
@@ -62,7 +62,7 @@ void TouchGate::touchEvent(QTouchEvent *event)
6262 Q_ASSERT(!m_touchInfoMap.contains(touchPoint.id()));
6363 m_touchInfoMap[touchPoint.id()].ownership = OwnershipRequested;
6464 m_touchInfoMap[touchPoint.id()].ended = false;
65− TouchRegistry::instance()->requestTouchOwnership(touchPoint.id(), this);
65+ UG_PREPEND_NAMESPACE(TouchRegistry)::instance()->requestTouchOwnership(touchPoint.id(), this);
6666 }
6767
6868 if (m_touchInfoMap.contains(touchPoint.id())) {
@@ -107,12 +107,12 @@ void TouchGate::itemChange(ItemChange change, const ItemChangeData &value)
107107{
108108 if (change == QQuickItem::ItemSceneChange) {
109109 if (value.window != nullptr) {
110− value.window->installEventFilter(TouchRegistry::instance());
110+ value.window->installEventFilter(UG_PREPEND_NAMESPACE(TouchRegistry)::instance());
111111 }
112112 }
113113}
114114
115−void TouchGate::touchOwnershipEvent(TouchOwnershipEvent *event)
115+void TouchGate::touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event)
116116{
117117 // TODO: Optimization: batch those actions as TouchOwnershipEvents
118118 // might come one right after the other.
plugins/Ubuntu/Gestures/TouchGate.h+3−2
@@ -19,6 +19,7 @@
1919
2020#include "UbuntuGesturesQmlGlobal.h"
2121#include "TouchDispatcher.h"
22+#include <UbuntuGestures/ubuntugesturesglobal.h>
2223
2324#include <QQuickItem>
2425#include <QList>
@@ -26,7 +27,7 @@
2627
2728#define TOUCHGATE_DEBUG 0
2829
29−class TouchOwnershipEvent;
30+UG_FORWARD_DECLARE_CLASS(TouchOwnershipEvent)
3031
3132/*
3233 Blocks the passage of events until ownership over the related touch points is granted.
@@ -82,7 +83,7 @@ private:
8283 ulong timestamp;
8384 };
8485
85− void touchOwnershipEvent(TouchOwnershipEvent *event);
86+ void touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event);
8687 bool isTouchPointOwned(int touchId) const;
8788 void storeTouchEvent(QTouchDevice *device,
8889 Qt::KeyboardModifiers modifiers,
plugins/Ubuntu/Gestures/TouchGestureArea.cpp+12−10
@@ -16,9 +16,9 @@
1616
1717#include "TouchGestureArea.h"
1818
19−#include <UbuntuGestures/TouchOwnershipEvent>
20−#include <UbuntuGestures/TouchRegistry>
21−#include <UbuntuGestures/UnownedTouchEvent>
19+#include <UbuntuGestures/private/touchownershipevent_p.h>
20+#include <UbuntuGestures/private/touchregistry_p.h>
21+#include <UbuntuGestures/private/unownedtouchevent_p.h>
2222// #include "TouchRegistry.h"
2323// #include "UnownedTouchEvent.h"
2424
@@ -26,6 +26,8 @@
2626#include <QStyleHints>
2727#include <private/qquickwindow_p.h>
2828
29+UG_USE_NAMESPACE
30+
2931#define TOUCHGESTUREAREA_DEBUG 0
3032
3133// TODO - understand more about why we lose touch event releases.
@@ -135,7 +137,7 @@ TouchGestureArea::TouchGestureArea(QQuickItem* parent)
135137 , m_recognitionPeriod(50)
136138 , m_releaseRejectPeriod(100)
137139{
138− setRecognitionTimer(new UbuntuGestures::Timer(this));
140+ setRecognitionTimer(new UG_PREPEND_NAMESPACE(Timer)(this));
139141 m_recognitionTimer->setInterval(m_recognitionPeriod);
140142 m_recognitionTimer->setSingleShot(true);
141143}
@@ -152,18 +154,18 @@ TouchGestureArea::~TouchGestureArea()
152154bool TouchGestureArea::event(QEvent *event)
153155{
154156 // Process unowned touch events (handles update/release for incomplete gestures)
155− if (event->type() == TouchOwnershipEvent::touchOwnershipEventType()) {
156− touchOwnershipEvent(static_cast<TouchOwnershipEvent *>(event));
157+ if (event->type() == UG_PREPEND_NAMESPACE(TouchOwnershipEvent)::touchOwnershipEventType()) {
158+ touchOwnershipEvent(static_cast<UG_PREPEND_NAMESPACE(TouchOwnershipEvent*)>(event));
157159 return true;
158− } else if (event->type() == UnownedTouchEvent::unownedTouchEventType()) {
159− unownedTouchEvent(static_cast<UnownedTouchEvent *>(event)->touchEvent());
160+ } else if (event->type() == UG_PREPEND_NAMESPACE(UnownedTouchEvent)::unownedTouchEventType()) {
161+ unownedTouchEvent(static_cast<UG_PREPEND_NAMESPACE(UnownedTouchEvent*)>(event)->touchEvent());
160162 return true;
161163 }
162164
163165 return QQuickItem::event(event);
164166}
165167
166−void TouchGestureArea::touchOwnershipEvent(TouchOwnershipEvent *event)
168+void TouchGestureArea::touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event)
167169{
168170 int touchId = event->touchId();
169171 tgaDebug("touchOwnershipEvent - id:" << touchId << ", gained:" << event->gained());
@@ -608,7 +610,7 @@ void TouchGestureArea::setInternalStatus(uint newStatus)
608610 }
609611}
610612
611−void TouchGestureArea::setRecognitionTimer(UbuntuGestures::AbstractTimer *timer)
613+void TouchGestureArea::setRecognitionTimer(UG_PREPEND_NAMESPACE(AbstractTimer) *timer)
612614{
613615 int interval = 0;
614616 bool timerWasRunning = false;
plugins/Ubuntu/Gestures/TouchGestureArea.h+7−6
@@ -21,10 +21,11 @@
2121
2222#include <QQuickItem>
2323
24−#include <UbuntuGestures/Timer>
24+#include <UbuntuGestures/ubuntugesturesglobal.h>
25+#include <UbuntuGestures/private/timer_p.h>
2526
26−class TouchOwnershipEvent;
27−class UnownedTouchEvent;
27+UG_FORWARD_DECLARE_CLASS(TouchOwnershipEvent)
28+UG_FORWARD_DECLARE_CLASS(UnownedTouchEvent)
2829
2930class GestureTouchPoint : public QObject
3031{
@@ -141,7 +142,7 @@ public:
141142
142143 bool event(QEvent *e) override;
143144
144− void setRecognitionTimer(UbuntuGestures::AbstractTimer *timer);
145+ void setRecognitionTimer(UG_PREPEND_NAMESPACE(AbstractTimer) *timer);
145146
146147 int status() const;
147148 bool dragging() const;
@@ -194,7 +195,7 @@ private:
194195 void unownedTouchEvent_recognised(QTouchEvent *unownedTouchEvent);
195196 void unownedTouchEvent_rejected(QTouchEvent *unownedTouchEvent);
196197
197− void touchOwnershipEvent(TouchOwnershipEvent *event);
198+ void touchOwnershipEvent(UG_PREPEND_NAMESPACE(TouchOwnershipEvent) *event);
198199 void updateTouchPoints(QTouchEvent *event);
199200
200201 GestureTouchPoint* addTouchPoint(const QTouchEvent::TouchPoint *tp);
@@ -209,7 +210,7 @@ private:
209210 uint m_status;
210211 QSet<int> m_candidateTouches;
211212 QSet<int> m_watchedTouches;
212− UbuntuGestures::AbstractTimer *m_recognitionTimer;
213+ UG_PREPEND_NAMESPACE(AbstractTimer) *m_recognitionTimer;
213214
214215 bool m_dragging;
215216 QHash<int, GestureTouchPoint*> m_liveTouchPoints;
tests/plugins/Ubuntu/Gestures/CMakeLists.txt+1
@@ -7,6 +7,7 @@ include_directories(
77 SYSTEM
88 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
99 ${UBUNTUGESTURES_INCLUDE_DIRS}
10+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
1011 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
1112)
1213
tests/plugins/Ubuntu/Gestures/GestureTest.cpp+1−1
@@ -25,7 +25,7 @@
2525#include <UbuntuGestures/private/timer_p.h>
2626#include <UbuntuGestures/private/touchregistry_p.h>
2727
28−using namespace UbuntuGestures;
28+UG_USE_NAMESPACE
2929
3030GestureTest::GestureTest(const QString &qmlFilename)
3131 : QObject(), m_device(nullptr), m_view(nullptr), m_qmlFilename(qmlFilename)
tests/plugins/Ubuntu/Gestures/GestureTest.h+4−5
@@ -19,14 +19,13 @@
1919
2020#include <QQuickItem>
2121#include <QTouchEvent>
22+#include <UbuntuGestures/ubuntugesturesglobal.h>
2223
2324class QQuickView;
2425class QTouchDevice;
2526
26−namespace UbuntuGestures {
27− class FakeTimerFactory;
28−}
29−class TouchRegistry;
27+UG_FORWARD_DECLARE_CLASS(FakeTimerFactory)
28+UG_FORWARD_DECLARE_CLASS(TouchRegistry)
3029
3130// C++ std lib
3231#include <functional>
@@ -96,7 +95,7 @@ protected:
9695 QTouchDevice *m_device;
9796 QQuickView *m_view;
9897 TouchRegistry *m_touchRegistry;
99− UbuntuGestures::FakeTimerFactory *m_fakeTimerFactory;
98+ UG_PREPEND_NAMESPACE(FakeTimerFactory) *m_fakeTimerFactory;
10099 QString m_qmlFilename;
101100};
102101
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+2
@@ -29,6 +29,8 @@
2929
3030#include "TestItem.h"
3131
32+UG_USE_NAMESPACE
33+
3234class CandidateItem : public QQuickItem
3335{
3436 Q_OBJECT
tests/utils/modules/Unity/Test/CMakeLists.txt+1
@@ -13,6 +13,7 @@ include_directories(
1313 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
1414 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
1515 ${UBUNTUGESTURES_INCLUDE_DIRS}
16+ ${UBUNTUGESTURES_INCLUDEDIR}/UbuntuGestures/${UBUNTUGESTURES_VERSION}
1617)
1718
1819set(UnityTestQML_SOURCES
tests/utils/modules/Unity/Test/testutil.cpp+3−2
@@ -24,10 +24,11 @@
2424#include <private/qquickanimation_p.h>
2525
2626// UbuntuGestures lib
27+#include <UbuntuGestures/ubuntugesturesglobal.h>
2728#include <UbuntuGestures/private/touchregistry_p.h>
2829#include <UbuntuGestures/private/timer_p.h>
2930
30−using namespace UbuntuGestures;
31+UG_USE_NAMESPACE
3132
3233TestUtil::TestUtil(QObject *parent)
3334 : QObject(parent)
@@ -81,7 +82,7 @@ TouchEventSequenceWrapper *TestUtil::touchEvent(QQuickItem *item)
8182 // Tests can be *very* slow to run and we don't want things timing out because
8283 // of that. So give it fake timers to use (they will never time out)
8384 if (!m_putFakeTimerFactoryInTouchRegistry) {
84− TouchRegistry::instance()->setTimerFactory(new FakeTimerFactory);
85+ UG_PREPEND_NAMESPACE(TouchRegistry)::instance()->setTimerFactory(new UG_PREPEND_NAMESPACE(FakeTimerFactory));
8586 m_putFakeTimerFactoryInTouchRegistry = true;
8687 }
8788