Merge lp:~zsombi/ubuntu-ui-toolkit/fixTouchAdaptor into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Cris Dywan
Approved revision: 1934
Merged at revision: 1925
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/fixTouchAdaptor
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 1388 lines (+656/-425)
19 files modified
debian/control (+3/-0)
debian/libubuntutoolkit5-dev.install (+2/-0)
src/Ubuntu/Test/plugin/plugin.pri (+3/-5)
src/Ubuntu/Test/plugin/testplugin.cpp (+3/-11)
src/Ubuntu/Test/plugin/uctestextras.cpp (+7/-23)
src/Ubuntu/Test/plugin/uctestextras.h (+0/-1)
src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro (+13/-3)
src/Ubuntu/UbuntuToolkit/mousetouchadaptor.cpp (+71/-131)
src/Ubuntu/UbuntuToolkit/mousetouchadaptor.h (+27/-24)
src/Ubuntu/UbuntuToolkit/mousetouchadaptor_p.h (+77/-0)
src/Ubuntu/UbuntuToolkit/mousetouchadaptor_x11.cpp (+350/-0)
tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.py (+38/-0)
tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.qml (+51/-0)
tests/unit_x11/tst_components/tst_adaptivepagelayout.qml (+1/-0)
ubuntu-sdk.pro (+4/-1)
ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.cpp (+0/-159)
ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.h (+0/-50)
ubuntu-ui-toolkit-launcher/launcher.cpp (+3/-12)
ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher.pro (+3/-5)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/fixTouchAdaptor
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+290858@code.launchpad.net

Commit message

Move MouseTouchAdaptor into UbuntuToolkit library. Fix adaptor code for Xenial.

To post a comment you must log in.
1924. By Zsombor Egri

missing license header added

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
1925. By Zsombor Egri

revert unwanted change

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
1926. By Zsombor Egri

add missing headers

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
1927. By Zsombor Egri

build dependenci to drive UbuntuToolkit lib to be built first

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
1928. By Zsombor Egri

wrapped and sorted

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Is the XCB 1.9.3 struct ABI specific to Qt's use or XCB itself? Is there any way to check that it's correct, either by Debian dependencies, or compile guards? Or some uni test that sanity-checks the value? Or a warning if the struct looks funny? Maybe there's no good way to handle this, just thinking out loud here.

Also it seems redundant to issue "MouseTouchAdaptor not available on this architecture" in setEnabled when it's always issued from registerTouchDevices regardless of the platform guards. A test case for this would seem useful also because despite "indirect" test coverage immediate failures would be much clearer than unexpected funny results.
Maybe even remove the touchDevices() function from the launcher to avoid false-positives because we have duplicate checks of the touch device? Though that last one could also be a separate mini MR.

review: Needs Information
1929. By Zsombor Egri

staging sync

1930. By Zsombor Egri

load page synchronously if that's what we want to test

Revision history for this message
Zsombor Egri (zsombi) wrote :

> Is the XCB 1.9.3 struct ABI specific to Qt's use or XCB itself? Is there any
> way to check that it's correct, either by Debian dependencies, or compile
> guards? Or some uni test that sanity-checks the value? Or a warning if the
> struct looks funny? Maybe there's no good way to handle this, just thinking
> out loud here.

That's a good question, I haven't seen any version check in Unity8 either... would be good though if we could at least guard the package...

>
> Also it seems redundant to issue "MouseTouchAdaptor not available on this
> architecture" in setEnabled when it's always issued from registerTouchDevices
> regardless of the platform guards. A test case for this would seem useful also
> because despite "indirect" test coverage immediate failures would be much
> clearer than unexpected funny results.
> Maybe even remove the touchDevices() function from the launcher to avoid
> false-positives because we have duplicate checks of the touch device? Though
> that last one could also be a separate mini MR.

I was thinking to flag out completely the use of the MouseTouchAdaptor, but then QML code would fail if the API would not be available on certain architectures... However as long as we keep X11 tests separate from the rest, those will not run on ARM....

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
1931. By Zsombor Egri

add autopilot test guarding mouse to touch conversion

1932. By Zsombor Egri

remove touch device detection from launcher; warn if touch simulation is not available on the platform in constructor, and initialize native event listener only for the valid platforms

1933. By Zsombor Egri

staging sync

Revision history for this message
Cris Dywan (kalikiana) wrote :

You need to set mouseEnabled: false on the MultiPointTouchArea for this test to work - otherwise it succeeds even if the touch emulation is not happening, such as can be seen by removing the -touch argument from the test case.

review: Needs Fixing
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
1934. By Zsombor Egri

disable mouse handling on MPTA

Revision history for this message
Cris Dywan (kalikiana) wrote :

Sweet. Thanks for the AP test and cleaning up the conditionals!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-03-24 09:14:57 +0000
+++ debian/control 2016-04-07 16:01:36 +0000
@@ -22,6 +22,9 @@
22 libqt5sql5-sqlite,22 libqt5sql5-sqlite,
23 libqt5svg5-dev,23 libqt5svg5-dev,
24 libudev-dev,24 libudev-dev,
25 libx11-dev[!armhf],
26 libxcb1-dev[!armhf],
27 libxi-dev[!armhf],
25 libxkbcommon-dev,28 libxkbcommon-dev,
26 libxrender-dev,29 libxrender-dev,
27 locales,30 locales,
2831
=== modified file 'debian/libubuntutoolkit5-dev.install'
--- debian/libubuntutoolkit5-dev.install 2016-03-04 11:58:12 +0000
+++ debian/libubuntutoolkit5-dev.install 2016-04-07 16:01:36 +0000
@@ -1,11 +1,13 @@
1usr/include/*/qt5/UbuntuToolkit/AsyncLoader1usr/include/*/qt5/UbuntuToolkit/AsyncLoader
2usr/include/*/qt5/UbuntuToolkit/ColorUtils2usr/include/*/qt5/UbuntuToolkit/ColorUtils
3usr/include/*/qt5/UbuntuToolkit/MouseTouchAdaptor
3usr/include/*/qt5/UbuntuToolkit/Tree4usr/include/*/qt5/UbuntuToolkit/Tree
4usr/include/*/qt5/UbuntuToolkit/UbuntuToolkit5usr/include/*/qt5/UbuntuToolkit/UbuntuToolkit
5usr/include/*/qt5/UbuntuToolkit/UbuntuToolkitDepends6usr/include/*/qt5/UbuntuToolkit/UbuntuToolkitDepends
6usr/include/*/qt5/UbuntuToolkit/UbuntuToolkitVersion7usr/include/*/qt5/UbuntuToolkit/UbuntuToolkitVersion
7usr/include/*/qt5/UbuntuToolkit/asyncloader.h8usr/include/*/qt5/UbuntuToolkit/asyncloader.h
8usr/include/*/qt5/UbuntuToolkit/colorutils.h9usr/include/*/qt5/UbuntuToolkit/colorutils.h
10usr/include/*/qt5/UbuntuToolkit/mousetouchadaptor.h
9usr/include/*/qt5/UbuntuToolkit/tree.h11usr/include/*/qt5/UbuntuToolkit/tree.h
10usr/include/*/qt5/UbuntuToolkit/ubuntutoolkitglobal.h12usr/include/*/qt5/UbuntuToolkit/ubuntutoolkitglobal.h
11usr/include/*/qt5/UbuntuToolkit/ubuntutoolkitversion.h13usr/include/*/qt5/UbuntuToolkit/ubuntutoolkitversion.h
1214
=== modified file 'src/Ubuntu/Test/plugin/plugin.pri'
--- src/Ubuntu/Test/plugin/plugin.pri 2016-02-25 02:29:05 +0000
+++ src/Ubuntu/Test/plugin/plugin.pri 2016-04-07 16:01:36 +0000
@@ -1,4 +1,4 @@
1QT *= core-private qml qml-private quick quick-private gui-private testlib UbuntuGestures1QT *= core-private qml qml-private quick quick-private gui-private testlib UbuntuGestures UbuntuToolkit
22
3equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {3equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 2) {
4 QT *= v8-private4 QT *= v8-private
@@ -15,11 +15,9 @@
15HEADERS += \15HEADERS += \
16 $$PWD/uctestcase.h \16 $$PWD/uctestcase.h \
17 $$PWD/testplugin.h \17 $$PWD/testplugin.h \
18 $$PWD/uctestextras.h \18 $$PWD/uctestextras.h
19 $$PWD/ucmousetouchadaptor.h \
2019
21SOURCES += \20SOURCES += \
22 $$PWD/uctestcase.cpp \21 $$PWD/uctestcase.cpp \
23 $$PWD/testplugin.cpp \22 $$PWD/testplugin.cpp \
24 $$PWD/uctestextras.cpp \23 $$PWD/uctestextras.cpp
25 $$PWD/ucmousetouchadaptor.cpp \
2624
=== modified file 'src/Ubuntu/Test/plugin/testplugin.cpp'
--- src/Ubuntu/Test/plugin/testplugin.cpp 2015-10-21 08:33:21 +0000
+++ src/Ubuntu/Test/plugin/testplugin.cpp 2016-04-07 16:01:36 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -17,7 +17,7 @@
17#include "testplugin.h"17#include "testplugin.h"
18#include <QtQml>18#include <QtQml>
19#include "uctestextras.h"19#include "uctestextras.h"
20#include "ucmousetouchadaptor.h"20#include <MouseTouchAdaptor>
2121
22static QObject *registerExtras(QQmlEngine *engine, QJSEngine *scriptEngine)22static QObject *registerExtras(QQmlEngine *engine, QJSEngine *scriptEngine)
23{23{
@@ -27,16 +27,8 @@
27 return new UCTestExtras;27 return new UCTestExtras;
28}28}
2929
30static QObject *registerAdaptor(QQmlEngine *engine, QJSEngine *scriptEngine)
31{
32 Q_UNUSED(engine)
33 Q_UNUSED(scriptEngine)
34
35 return new UCMouseTouchAdaptor;
36}
37
38void TestPlugin::registerTypes(const char *uri)30void TestPlugin::registerTypes(const char *uri)
39{31{
40 qmlRegisterSingletonType<UCTestExtras>(uri, 1, 0, "TestExtras", registerExtras);32 qmlRegisterSingletonType<UCTestExtras>(uri, 1, 0, "TestExtras", registerExtras);
41 qmlRegisterSingletonType<UCMouseTouchAdaptor>(uri, 1, 0, "MouseTouchAdaptor", registerAdaptor);33 qmlRegisterSingletonType<UbuntuToolkit::MouseTouchAdaptor>(uri, 1, 0, "MouseTouchAdaptor", UbuntuToolkit::MouseTouchAdaptor::registerQmlSingleton);
42}34}
4335
=== modified file 'src/Ubuntu/Test/plugin/uctestextras.cpp'
--- src/Ubuntu/Test/plugin/uctestextras.cpp 2015-12-17 15:23:26 +0000
+++ src/Ubuntu/Test/plugin/uctestextras.cpp 2016-04-07 16:01:36 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -23,6 +23,7 @@
23#include <qpa/qwindowsysteminterface.h>23#include <qpa/qwindowsysteminterface.h>
24#include <private/qobject_p.h>24#include <private/qobject_p.h>
25#include <QSysInfo>25#include <QSysInfo>
26#include <MouseTouchAdaptor>
2627
27const char *DEVICE_MISSING_MSG = "No touch device registered. Register one using registerTouchDevice() before using %1";28const char *DEVICE_MISSING_MSG = "No touch device registered. Register one using registerTouchDevice() before using %1";
2829
@@ -40,7 +41,6 @@
40 return; \41 return; \
41 }42 }
4243
43QTouchDevice *UCTestExtras::m_touchDevice = 0;
44UCTestExtras *UCTestExtras::m_testExtras = 0;44UCTestExtras *UCTestExtras::m_testExtras = 0;
4545
46/*!46/*!
@@ -118,24 +118,8 @@
118 */118 */
119void UCTestExtras::registerTouchDevice()119void UCTestExtras::registerTouchDevice()
120{120{
121 // check if there is any touch device registered in the system121 if (UbuntuToolkit::MouseTouchAdaptor::registerTouchDevice() && m_testExtras) {
122 if (!m_touchDevice) {122 Q_EMIT m_testExtras->touchDevicePresentChanged();
123 QList<const QTouchDevice*> touchDevices = QTouchDevice::devices();
124 Q_FOREACH(const QTouchDevice *device, touchDevices) {
125 if (device->type() == QTouchDevice::TouchScreen) {
126 m_touchDevice = const_cast<QTouchDevice*>(device);
127 break;
128 }
129 }
130 }
131 // if none, register one
132 if (!m_touchDevice) {
133 m_touchDevice = new QTouchDevice;
134 m_touchDevice->setType(QTouchDevice::TouchScreen);
135 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
136 if (m_testExtras) {
137 Q_EMIT m_testExtras->touchDevicePresentChanged();
138 }
139 }123 }
140}124}
141125
@@ -148,7 +132,7 @@
148void UCTestExtras::touchPress(int touchId, QQuickItem *item, const QPoint &point)132void UCTestExtras::touchPress(int touchId, QQuickItem *item, const QPoint &point)
149{133{
150 CHECK_TOUCH_DEVICE(touchId, item);134 CHECK_TOUCH_DEVICE(touchId, item);
151 QTest::touchEvent(item->window(), m_touchDevice).press(touchId, item->mapToScene(point).toPoint(), item->window());135 QTest::touchEvent(item->window(), UbuntuToolkit::MouseTouchAdaptor::touchDevice()).press(touchId, item->mapToScene(point).toPoint(), item->window());
152}136}
153/*!137/*!
154 * \qmlmethod TestExtras::touchRelease(touchId, item, point)138 * \qmlmethod TestExtras::touchRelease(touchId, item, point)
@@ -158,7 +142,7 @@
158void UCTestExtras::touchRelease(int touchId, QQuickItem *item, const QPoint &point)142void UCTestExtras::touchRelease(int touchId, QQuickItem *item, const QPoint &point)
159{143{
160 CHECK_TOUCH_DEVICE(touchId, item);144 CHECK_TOUCH_DEVICE(touchId, item);
161 QTest::touchEvent(item->window(), m_touchDevice).release(touchId, item->mapToScene(point).toPoint(), item->window());145 QTest::touchEvent(item->window(), UbuntuToolkit::MouseTouchAdaptor::touchDevice()).release(touchId, item->mapToScene(point).toPoint(), item->window());
162}146}
163/*!147/*!
164 * \qmlmethod TestExtras::touchClick(touchId, item, point)148 * \qmlmethod TestExtras::touchClick(touchId, item, point)
@@ -207,7 +191,7 @@
207void UCTestExtras::touchMove(int touchId, QQuickItem *item, const QPoint &point)191void UCTestExtras::touchMove(int touchId, QQuickItem *item, const QPoint &point)
208{192{
209 CHECK_TOUCH_DEVICE(touchId, item);193 CHECK_TOUCH_DEVICE(touchId, item);
210 QTest::touchEvent(item->window(), m_touchDevice).move(touchId, item->mapToScene(point).toPoint(), item->window());194 QTest::touchEvent(item->window(), UbuntuToolkit::MouseTouchAdaptor::touchDevice()).move(touchId, item->mapToScene(point).toPoint(), item->window());
211}195}
212/*!196/*!
213 * \qmlmethod TestExtras::touchDrag(touchId, item, from, delta, steps = 5)197 * \qmlmethod TestExtras::touchDrag(touchId, item, from, delta, steps = 5)
214198
=== modified file 'src/Ubuntu/Test/plugin/uctestextras.h'
--- src/Ubuntu/Test/plugin/uctestextras.h 2015-12-17 14:42:40 +0000
+++ src/Ubuntu/Test/plugin/uctestextras.h 2016-04-07 16:01:36 +0000
@@ -53,7 +53,6 @@
53 static void mouseDragWithPoints(QQuickItem *item, QList<QPoint> points, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int delay = -1);53 static void mouseDragWithPoints(QQuickItem *item, QList<QPoint> points, Qt::MouseButton button, Qt::KeyboardModifiers stateKey = 0, int delay = -1);
5454
55private:55private:
56 static QTouchDevice *m_touchDevice;
57 static UCTestExtras *m_testExtras;56 static UCTestExtras *m_testExtras;
5857
59 friend class UCMouseTouchAdaptor;58 friend class UCMouseTouchAdaptor;
6059
=== modified file 'src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro'
--- src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro 2016-02-25 14:35:59 +0000
+++ src/Ubuntu/UbuntuToolkit/UbuntuToolkit.pro 2016-04-07 16:01:36 +0000
@@ -1,7 +1,14 @@
1TEMPLATE=lib1TEMPLATE=lib
2TARGET=UbuntuToolkit2TARGET=UbuntuToolkit
33
4QT *= core-private gui-private qml qml-private quick quick-private4QT *= core-private gui-private qml qml-private quick quick-private testlib
5
6!contains(QT_ARCH, arm) {
7 DEFINES += UBUNTUTOOLKIT_ENABLE_X11_TOUCH_EMULATION
8 LIBS += -lX11 -lxcb -lXi
9
10 SOURCES += mousetouchadaptor_x11.cpp
11}
512
6CONFIG += dll no_keywords c++1113CONFIG += dll no_keywords c++11
714
@@ -17,9 +24,12 @@
17 ubuntutoolkitglobal.h \24 ubuntutoolkitglobal.h \
18 tree.h \25 tree.h \
19 asyncloader.h \26 asyncloader.h \
20 asyncloader_p.h27 asyncloader_p.h \
28 mousetouchadaptor.h \
29 mousetouchadaptor_p.h
2130
22SOURCES += \ 31SOURCES += \
23 colorutils.cpp \32 colorutils.cpp \
24 tree.cpp \33 tree.cpp \
25 asyncloader.cpp34 asyncloader.cpp \
35 mousetouchadaptor.cpp
2636
=== renamed file 'src/Ubuntu/Test/plugin/ucmousetouchadaptor.cpp' => 'src/Ubuntu/UbuntuToolkit/mousetouchadaptor.cpp'
--- src/Ubuntu/Test/plugin/ucmousetouchadaptor.cpp 2015-11-10 14:42:20 +0000
+++ src/Ubuntu/UbuntuToolkit/mousetouchadaptor.cpp 2016-04-07 16:01:36 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013,2015 Canonical, Ltd.2 * Copyright (C) 2013,2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * 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 by5 * it under the terms of the GNU General Public License as published by
@@ -14,36 +14,34 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 * Zsombor Egri <zsomboir.egri@canonical.com>
17 */18 */
1819
19#include "ucmousetouchadaptor.h"20#include "mousetouchadaptor_p.h"
20#include "uctestextras.h"
2121
22#include <qpa/qplatformnativeinterface.h>
22#include <qpa/qwindowsysteminterface.h>23#include <qpa/qwindowsysteminterface.h>
2324
24#include <QCoreApplication>25#include <QCoreApplication>
25#include <QMouseEvent>26#include <QMouseEvent>
26#include <QTest>27#include <QTest>
2728
28using QTest::QTouchEventSequence;29#ifdef UBUNTUTOOLKIT_ENABLE_X11_TOUCH_EMULATION
2930 #define ENABLE_TOUCH_EMULATION
30namespace {31#endif
3132
32Qt::MouseButton translateMouseButton(xcb_button_t detail)33namespace UbuntuToolkit {
34
35QTouchDevice *MouseTouchAdaptor::m_touchDevice = nullptr;
36
37MouseTouchAdaptorPrivate::~MouseTouchAdaptorPrivate()
33{38{
34 switch (detail) {39 QCoreApplication::instance()->removeNativeEventFilter(this);
35 case 1: return Qt::LeftButton;
36 case 2: return Qt::MidButton;
37 case 3: return Qt::RightButton;
38 // Button values 4-7 are Wheel events
39 default: return Qt::NoButton;
40 }
41}40}
42} // end of anonymous namespace
4341
44/*!42/*!
45 * \qmltype MouseTouchAdaptor43 * \qmltype MouseTouchAdaptor
46 * \instantiates UCMouseTouchAdaptor44 * \instantiates MouseTouchAdaptor
47 * \inqmlmodule Ubuntu.Test 1.045 * \inqmlmodule Ubuntu.Test 1.0
48 * \ingroup ubuntu-test46 * \ingroup ubuntu-test
49 * \brief Singleton type turning mouse events into single finger touch events.47 * \brief Singleton type turning mouse events into single finger touch events.
@@ -60,109 +58,49 @@
60 * \endqml58 * \endqml
61 *59 *
62 */60 */
63UCMouseTouchAdaptor::UCMouseTouchAdaptor()61MouseTouchAdaptor::MouseTouchAdaptor(QObject *parent)
64 : QObject(nullptr)62 :
65 , m_leftButtonIsPressed(false)63#ifdef UBUNTUTOOLKIT_ENABLE_X11_TOUCH_EMULATION
66 , m_enabled(true)64 QObject(*(new X11MouseTouchAdaptorPrivate), parent)
67{65#else
68 QCoreApplication::instance()->installNativeEventFilter(this);66 QObject(*(new MouseTouchAdaptorPrivate), parent)
6967#endif
70 UCTestExtras::registerTouchDevice();68{
71 m_touchDevice = UCTestExtras::m_touchDevice;69#ifdef ENABLE_TOUCH_EMULATION
72}70 registerTouchDevice();
7371#else
74bool UCMouseTouchAdaptor::nativeEventFilter(const QByteArray & eventType,72 qWarning() << "MouseTouchAdaptor not available on this architecture.";
75 void * message, long * /*result*/)73#endif
76{74 Q_D(MouseTouchAdaptor);
77 if (!m_enabled) {75 d->init();
78 return false;76}
79 }77
8078// registers a test touch device, returns true if a device was found/registered
81 if (eventType != "xcb_generic_event_t") {79bool MouseTouchAdaptor::registerTouchDevice()
82 // wrong backend.80{
83 qWarning("MouseTouchAdaptor: XCB backend not in use. Adaptor inoperative!");81 // check if there is any touch device registered in the system
84 return false;82 if (!m_touchDevice) {
85 }83 QList<const QTouchDevice*> touchDevices = QTouchDevice::devices();
8684 Q_FOREACH(const QTouchDevice *device, touchDevices) {
87 xcb_generic_event_t *xcbEvent = static_cast<xcb_generic_event_t *>(message);85 if (device->type() == QTouchDevice::TouchScreen) {
8886 m_touchDevice = const_cast<QTouchDevice*>(device);
89 switch (xcbEvent->response_type & ~0x80) {87 return true;
90 case XCB_BUTTON_PRESS:88 }
91 return handleButtonPress(reinterpret_cast<xcb_button_press_event_t *>(xcbEvent));89 }
92 break;90 }
93 case XCB_BUTTON_RELEASE:91 // if none, register one
94 return handleButtonRelease(reinterpret_cast<xcb_button_release_event_t *>(xcbEvent));92#ifdef ENABLE_TOUCH_EMULATION
95 break;93 if (!m_touchDevice) {
96 case XCB_MOTION_NOTIFY:94 m_touchDevice = new QTouchDevice;
97 return handleMotionNotify(reinterpret_cast<xcb_motion_notify_event_t *>(xcbEvent));95 m_touchDevice->setType(QTouchDevice::TouchScreen);
98 break;96 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
99 default:97 return true;
100 return false;98 }
101 break;99#endif
102 };100 return false;
103}101}
104102
105bool UCMouseTouchAdaptor::handleButtonPress(xcb_button_press_event_t *pressEvent)103QWindow *MouseTouchAdaptorPrivate::findQWindowWithXWindowID(WId windowId)
106{
107 Qt::MouseButton button = translateMouseButton(pressEvent->detail);
108
109 // Just eat the event if it wasn't a left mouse press
110 if (button != Qt::LeftButton)
111 return true;
112
113 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(pressEvent->event));
114
115 QPoint windowPos(pressEvent->event_x / targetWindow->devicePixelRatio(), pressEvent->event_y / targetWindow->devicePixelRatio());
116
117 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
118 false /* autoCommit */);
119 touchEvent.press(0 /* touchId */, windowPos);
120 touchEvent.commit(false /* processEvents */);
121
122 m_leftButtonIsPressed = true;
123 return true;
124}
125
126bool UCMouseTouchAdaptor::handleButtonRelease(xcb_button_release_event_t *releaseEvent)
127{
128 Qt::MouseButton button = translateMouseButton(releaseEvent->detail);
129
130 // Just eat the event if it wasn't a left mouse release
131 if (button != Qt::LeftButton)
132 return true;
133
134 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(releaseEvent->event));
135
136 QPoint windowPos(releaseEvent->event_x / targetWindow->devicePixelRatio(), releaseEvent->event_y / targetWindow->devicePixelRatio());
137
138 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
139 false /* autoCommit */);
140 touchEvent.release(0 /* touchId */, windowPos);
141 touchEvent.commit(false /* processEvents */);
142
143 m_leftButtonIsPressed = false;
144 return true;
145}
146
147bool UCMouseTouchAdaptor::handleMotionNotify(xcb_motion_notify_event_t *event)
148{
149 if (!m_leftButtonIsPressed) {
150 return true;
151 }
152
153 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(event->event));
154
155 QPoint windowPos(event->event_x / targetWindow->devicePixelRatio(), event->event_y / targetWindow->devicePixelRatio());
156
157 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice,
158 false /* autoCommit */);
159 touchEvent.move(0 /* touchId */, windowPos);
160 touchEvent.commit(false /* processEvents */);
161
162 return true;
163}
164
165QWindow *UCMouseTouchAdaptor::findQWindowWithXWindowID(WId windowId)
166{104{
167 QWindowList windowList = QGuiApplication::topLevelWindows();105 QWindowList windowList = QGuiApplication::topLevelWindows();
168 QWindow *foundWindow = nullptr;106 QWindow *foundWindow = nullptr;
@@ -185,14 +123,16 @@
185 * \qmlproperty bool MouseTouchAdaptor::enabled123 * \qmlproperty bool MouseTouchAdaptor::enabled
186 * Enables the mouse to touch conversion functionality. Defaults to true.124 * Enables the mouse to touch conversion functionality. Defaults to true.
187 */125 */
188bool UCMouseTouchAdaptor::enabled() const126bool MouseTouchAdaptorPrivate::isEnabled() const
189{127{
190 return m_enabled;128 return enabled;
191}129}
192void UCMouseTouchAdaptor::setEnabled(bool value)130void MouseTouchAdaptorPrivate::setEnabled(bool value)
193{131{
194 if (value != m_enabled) {132 Q_UNUSED(value);
195 m_enabled = value;133 qWarning() << "MouseTouchAdaptor not available on this architecture, thus cannot be enabled.";
196 Q_EMIT enabledChanged(value);134}
197 }135
198}136} // namespace UbuntuToolkit
137
138#include "moc_mousetouchadaptor.cpp"
199139
=== renamed file 'src/Ubuntu/Test/plugin/ucmousetouchadaptor.h' => 'src/Ubuntu/UbuntuToolkit/mousetouchadaptor.h'
--- src/Ubuntu/Test/plugin/ucmousetouchadaptor.h 2015-10-21 08:33:21 +0000
+++ src/Ubuntu/UbuntuToolkit/mousetouchadaptor.h 2016-04-07 16:01:36 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2013,2015 Canonical, Ltd.2 * Copyright (C) 2013,2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * 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 by5 * it under the terms of the GNU General Public License as published by
@@ -14,47 +14,50 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 * Zsombor Egri <zsomboir.egri@canonical.com>
17 */18 */
1819
19#ifndef MOUSE_TOUCH_ADAPTOR_H20#ifndef MOUSE_TOUCH_ADAPTOR_H
20#define MOUSE_TOUCH_ADAPTOR_H21#define MOUSE_TOUCH_ADAPTOR_H
2122
22#include <QtCore/QAbstractNativeEventFilter>23#include "ubuntutoolkitglobal.h"
23#include <QWindow>24
24#include <xcb/xcb.h>25#include <QtCore/QObject>
2526
26class QMouseEvent;27class QMouseEvent;
27class QTouchDevice;28class QTouchDevice;
29class QQmlEngine;
30class QJSEngine;
31
32namespace UbuntuToolkit {
2833
29// Transforms QMouseEvents into single-finger QTouchEvents.34// Transforms QMouseEvents into single-finger QTouchEvents.
30class UCMouseTouchAdaptor : public QObject, public QAbstractNativeEventFilter35class MouseTouchAdaptorPrivate;
36class UBUNTUTOOLKIT_EXPORT MouseTouchAdaptor : public QObject
31{37{
32 Q_OBJECT38 Q_OBJECT
39 Q_PRIVATE_PROPERTY(MouseTouchAdaptor::d_func(), bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged)
33public:40public:
34 UCMouseTouchAdaptor();41 explicit MouseTouchAdaptor(QObject *parent = Q_NULLPTR);
3542
36 // Filters mouse events and posts the equivalent QTouchEvents.43 static bool registerTouchDevice();
37 bool nativeEventFilter(const QByteArray & eventType, void *message, long *result) override;44 inline static QTouchDevice *touchDevice()
3845 {
39 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)46 return m_touchDevice;
4047 }
41 bool enabled() const;48 static QObject *registerQmlSingleton(QQmlEngine*, QJSEngine*)
42 void setEnabled(bool value);49 {
50 return new MouseTouchAdaptor;
51 }
4352
44Q_SIGNALS:53Q_SIGNALS:
45 void enabledChanged(bool value);54 void enabledChanged(bool value);
4655
47private:56private:
4857 Q_DECLARE_PRIVATE(MouseTouchAdaptor)
49 bool handleButtonPress(xcb_button_press_event_t *pressEvent);58 static QTouchDevice *m_touchDevice;
50 bool handleButtonRelease(xcb_button_release_event_t *releaseEvent);
51 bool handleMotionNotify(xcb_motion_notify_event_t *event);
52 QWindow *findQWindowWithXWindowID(WId windowId);
53
54 QTouchDevice *m_touchDevice;
55 bool m_leftButtonIsPressed;
56
57 bool m_enabled;
58};59};
5960
61} // namespace UbuntuToolkit
62
60#endif // MOUSE_TOUCH_ADAPTOR_H63#endif // MOUSE_TOUCH_ADAPTOR_H
6164
=== added file 'src/Ubuntu/UbuntuToolkit/mousetouchadaptor_p.h'
--- src/Ubuntu/UbuntuToolkit/mousetouchadaptor_p.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/UbuntuToolkit/mousetouchadaptor_p.h 2016-04-07 16:01:36 +0000
@@ -0,0 +1,77 @@
1/*
2 * Copyright (C) 2016 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 * Authored by: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19#ifndef MOUSETOUCHADAPTOR_P
20#define MOUSETOUCHADAPTOR_P
21
22#include "mousetouchadaptor.h"
23#include <QtCore/private/qobject_p.h>
24#include <QtCore/QAbstractNativeEventFilter>
25#include <QWindow>
26#include <xcb/xcb.h>
27
28namespace UbuntuToolkit {
29
30class MouseTouchAdaptorPrivate : public QObjectPrivate, public QAbstractNativeEventFilter
31{
32 Q_DECLARE_PUBLIC(MouseTouchAdaptor)
33public:
34 MouseTouchAdaptorPrivate() : QObjectPrivate() {}
35 ~MouseTouchAdaptorPrivate();
36
37 virtual void init() {}
38 virtual bool nativeEventFilter(const QByteArray & eventType, void *message, long *result)
39 { Q_UNUSED(eventType); Q_UNUSED(message); Q_UNUSED(result); return false; }
40 bool isEnabled() const;
41 virtual void setEnabled(bool enabled);
42
43 QWindow *findQWindowWithXWindowID(WId windowId);
44
45 // fields
46 bool enabled{false};
47};
48
49#ifdef UBUNTUTOOLKIT_ENABLE_X11_TOUCH_EMULATION
50class X11MouseTouchAdaptorPrivate : public MouseTouchAdaptorPrivate
51{
52 Q_DECLARE_PUBLIC(MouseTouchAdaptor)
53public:
54 X11MouseTouchAdaptorPrivate();
55
56 void init() Q_DECL_OVERRIDE;
57 bool nativeEventFilter(const QByteArray & eventType, void *message, long *result) Q_DECL_OVERRIDE;
58 void setEnabled(bool value);
59
60 bool xi2HandleEvent(xcb_ge_event_t *event);
61 bool handleButtonPress(WId windowId, uint32_t detail, uint32_t modifiers, int x, int y);
62 bool handleButtonRelease(WId windowId, uint32_t detail, uint32_t modifiers, int x, int y);
63 bool handleMotionNotify(WId windowId, uint32_t modifiers, int x, int y);
64
65 bool m_leftButtonIsPressed;
66 bool m_triPressModifier;
67
68 bool m_xi2Enabled{false};
69 int m_xi2Minor{-1};
70 int m_xiOpCode, m_xiEventBase, m_xiErrorBase;
71};
72#endif
73
74} // namespace UbuntuToolkit
75
76#endif // MOUSETOUCHADAPTOR_P
77
078
=== added file 'src/Ubuntu/UbuntuToolkit/mousetouchadaptor_x11.cpp'
--- src/Ubuntu/UbuntuToolkit/mousetouchadaptor_x11.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/UbuntuToolkit/mousetouchadaptor_x11.cpp 2016-04-07 16:01:36 +0000
@@ -0,0 +1,350 @@
1/*
2 * Copyright (C) 2016 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 * Authored by: Zsombor Egri <zsombor.egri@canonical.com>
17 */
18
19/* Some parts of the code were copied from the XCB platform plugin of the Qt Toolkit,
20 * which is under the following license:
21 */
22
23/****************************************************************************
24**
25** Copyright (C) 2015 The Qt Company Ltd.
26** Contact: http://www.qt.io/licensing/
27**
28** This file is part of the .
29**
30** $QT_BEGIN_LICENSE:LGPL21$
31** Commercial License Usage
32** Licensees holding valid commercial Qt licenses may use this file in
33** accordance with the commercial license agreement provided with the
34** Software or, alternatively, in accordance with the terms contained in
35** a written agreement between you and The Qt Company. For licensing terms
36** and conditions see http://www.qt.io/terms-conditions. For further
37** information use the contact form at http://www.qt.io/contact-us.
38**
39** GNU Lesser General Public License Usage
40** Alternatively, this file may be used under the terms of the GNU Lesser
41** General Public License version 2.1 or version 3 as published by the Free
42** Software Foundation and appearing in the file LICENSE.LGPLv21 and
43** LICENSE.LGPLv3 included in the packaging of this file. Please review the
44** following information to ensure the GNU Lesser General Public License
45** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
46** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
47**
48** As a special exception, The Qt Company gives you certain additional
49** rights. These rights are described in The Qt Company LGPL Exception
50** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
51**
52** $QT_END_LICENSE$
53**
54****************************************************************************/
55
56#include "mousetouchadaptor_p.h"
57
58#include <qpa/qplatformnativeinterface.h>
59
60#include <QCoreApplication>
61#include <QMouseEvent>
62#include <QTest>
63
64#include <X11/extensions/XInput2.h>
65#include <X11/extensions/XI2proto.h>
66
67using QTest::QTouchEventSequence;
68
69namespace {
70
71const Qt::KeyboardModifiers TRI_PRESS_MODIFIER = Qt::ShiftModifier|Qt::ControlModifier|Qt::AltModifier;
72
73Qt::MouseButton translateMouseButton(xcb_button_t detail)
74{
75 switch (detail) {
76 case 1: return Qt::LeftButton;
77 case 2: return Qt::MidButton;
78 case 3: return Qt::RightButton;
79 // Button values 4-7 are Wheel events
80 default: return Qt::NoButton;
81 }
82}
83
84Qt::KeyboardModifiers translateMofidier(uint32_t mod)
85{
86 Qt::KeyboardModifiers qtMod = Qt::NoModifier;
87
88 if (mod & 0x01) qtMod |= Qt::ShiftModifier;
89 if (mod & 0x04) qtMod |= Qt::ControlModifier;
90 if (mod & 0x08) qtMod |= Qt::AltModifier;
91 if (mod & 0x80) qtMod |= Qt::MetaModifier;
92
93 return qtMod;
94}
95
96} // end of anonymous namespace
97
98
99namespace UbuntuToolkit {
100
101X11MouseTouchAdaptorPrivate::X11MouseTouchAdaptorPrivate()
102 : m_leftButtonIsPressed(false)
103 , m_triPressModifier(false)
104{
105 enabled = true;
106}
107
108void X11MouseTouchAdaptorPrivate::init()
109{
110 QPlatformNativeInterface *nativeInterface = qGuiApp->platformNativeInterface();
111 Display *xDisplay = static_cast<Display*>(nativeInterface->nativeResourceForIntegration("Display"));
112 if (xDisplay && XQueryExtension(xDisplay, "XInputExtension", &m_xiOpCode, &m_xiEventBase, &m_xiErrorBase)) {
113 int xiMajor = 2;
114 m_xi2Minor = 2; // try 2.2 first, needed for TouchBegin/Update/End
115 if (XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) == BadRequest) {
116 m_xi2Minor = 1; // for smooth scrolling 2.1 is enough
117 if (XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) == BadRequest) {
118 m_xi2Minor = 0; // for tablet support 2.0 is enough
119 m_xi2Enabled = XIQueryVersion(xDisplay, &xiMajor, &m_xi2Minor) != BadRequest;
120 } else
121 m_xi2Enabled = true;
122 } else {
123 m_xi2Enabled = true;
124 }
125 }
126
127 QCoreApplication::instance()->installNativeEventFilter(this);
128}
129
130void X11MouseTouchAdaptorPrivate::setEnabled(bool value)
131{
132 if (value != enabled) {
133 enabled = value;
134 Q_EMIT q_func()->enabledChanged(value);
135 }
136}
137
138// Starting from the xcb version 1.9.3 struct xcb_ge_event_t has changed:
139// - "pad0" became "extension"
140// - "pad1" and "pad" became "pad0"
141// New and old version of this struct share the following fields:
142// NOTE: API might change again in the next release of xcb in which case this comment will
143// need to be updated to reflect the reality.
144typedef struct qt_xcb_ge_event_t {
145 uint8_t response_type;
146 uint8_t extension;
147 uint16_t sequence;
148 uint32_t length;
149 uint16_t event_type;
150} qt_xcb_ge_event_t;
151
152bool xi2PrepareXIGenericDeviceEvent(xcb_ge_event_t *ev, int opCode)
153{
154 qt_xcb_ge_event_t *event = (qt_xcb_ge_event_t *)ev;
155 // xGenericEvent has "extension" on the second byte, the same is true for xcb_ge_event_t starting from
156 // the xcb version 1.9.3, prior to that it was called "pad0".
157 if (event->extension == opCode) {
158 // xcb event structs contain stuff that wasn't on the wire, the full_sequence field
159 // adds an extra 4 bytes and generic events cookie data is on the wire right after the standard 32 bytes.
160 // Move this data back to have the same layout in memory as it was on the wire
161 // and allow casting, overwriting the full_sequence field.
162 memmove((char*) event + 32, (char*) event + 36, event->length * 4);
163 return true;
164 }
165 return false;
166}
167
168static inline qreal fixed1616ToReal(FP1616 val)
169{
170 return qreal(val) / 0x10000;
171}
172
173bool X11MouseTouchAdaptorPrivate::xi2HandleEvent(xcb_ge_event_t *event)
174{
175 if (!xi2PrepareXIGenericDeviceEvent(event, m_xiOpCode)) {
176 return false;
177 }
178
179 xXIGenericDeviceEvent *xiEvent = reinterpret_cast<xXIGenericDeviceEvent *>(event);
180 xXIDeviceEvent *xiDeviceEvent = 0;
181
182 switch (xiEvent->evtype) {
183 case XI_ButtonPress:
184 case XI_ButtonRelease:
185 case XI_Motion:
186 xiDeviceEvent = reinterpret_cast<xXIDeviceEvent *>(event);
187 break;
188 default:
189 break;
190 }
191
192 if (!xiDeviceEvent) {
193 return false;
194 }
195
196 switch (xiDeviceEvent->evtype) {
197 case XI_ButtonPress:
198 return handleButtonPress(
199 static_cast<WId>(xiDeviceEvent->event),
200 xiDeviceEvent->detail,
201 xiDeviceEvent->mods.base_mods,
202 fixed1616ToReal(xiDeviceEvent->event_x),
203 fixed1616ToReal(xiDeviceEvent->event_y));
204 case XI_ButtonRelease:
205 return handleButtonRelease(
206 static_cast<WId>(xiDeviceEvent->event),
207 xiDeviceEvent->detail,
208 xiDeviceEvent->mods.base_mods,
209 fixed1616ToReal(xiDeviceEvent->event_x),
210 fixed1616ToReal(xiDeviceEvent->event_y));
211 case XI_Motion:
212 return handleMotionNotify(
213 static_cast<WId>(xiDeviceEvent->event),
214 xiDeviceEvent->mods.base_mods,
215 fixed1616ToReal(xiDeviceEvent->event_x),
216 fixed1616ToReal(xiDeviceEvent->event_y));
217 return true;
218 default:
219 return false;
220 }
221}
222
223bool X11MouseTouchAdaptorPrivate::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
224{
225 Q_UNUSED(result);
226 static int eventCount = 0;
227 eventCount++;
228 if (!enabled) {
229 return false;
230 }
231
232 if (eventType != "xcb_generic_event_t") {
233 // wrong backend.
234 qWarning("MouseTouchAdaptor: XCB backend not in use. Adaptor inoperative!");
235 return false;
236 }
237
238 xcb_generic_event_t *xcbEvent = static_cast<xcb_generic_event_t *>(message);
239
240 switch (xcbEvent->response_type & ~0x80) {
241 case XCB_BUTTON_PRESS: {
242 auto pressEvent = reinterpret_cast<xcb_button_press_event_t *>(xcbEvent);
243 return handleButtonPress(static_cast<WId>(pressEvent->event), pressEvent->detail, 0,
244 pressEvent->event_x, pressEvent->event_y);
245 }
246 case XCB_BUTTON_RELEASE: {
247 auto releaseEvent = reinterpret_cast<xcb_button_release_event_t *>(xcbEvent);
248 return handleButtonRelease(static_cast<WId>(releaseEvent->event), releaseEvent->detail, 0,
249 releaseEvent->event_x, releaseEvent->event_y);
250 }
251 case XCB_MOTION_NOTIFY: {
252 auto motionEvent = reinterpret_cast<xcb_motion_notify_event_t *>(xcbEvent);
253 return handleMotionNotify(static_cast<WId>(motionEvent->event), 0,
254 motionEvent->event_x, motionEvent->event_y);
255 }
256 case XCB_GE_GENERIC:
257 if (m_xi2Enabled) {
258 return xi2HandleEvent(reinterpret_cast<xcb_ge_event_t *>(xcbEvent));
259 } else {
260 return false;
261 }
262 default:
263 return false;
264 };
265}
266
267bool X11MouseTouchAdaptorPrivate::handleButtonPress(WId windowId, uint32_t detail, uint32_t modifiers, int x, int y)
268{
269 Qt::MouseButton button = translateMouseButton(detail);
270 Qt::KeyboardModifiers qtMod = translateMofidier(modifiers);
271
272 // Just eat the event if it wasn't a left mouse press
273 if (button != Qt::LeftButton)
274 return true;
275
276 QWindow *targetWindow = findQWindowWithXWindowID(windowId);
277
278 QPoint windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
279
280 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, MouseTouchAdaptor::touchDevice(),
281 false /* autoCommit */);
282 touchEvent.press(0 /* touchId */, windowPos);
283 if (qtMod == TRI_PRESS_MODIFIER) {
284 touchEvent.press(1, windowPos);
285 touchEvent.press(2, windowPos);
286 m_triPressModifier = true;
287 }
288 touchEvent.commit(false /* processEvents */);
289
290 m_leftButtonIsPressed = true;
291 return true;
292}
293
294bool X11MouseTouchAdaptorPrivate::handleButtonRelease(WId windowId, uint32_t detail, uint32_t, int x, int y)
295{
296 Qt::MouseButton button = translateMouseButton(detail);
297
298 // Don't eat the event if it wasn't a left mouse press
299 if (button != Qt::LeftButton)
300 return false;
301
302 QWindow *targetWindow = findQWindowWithXWindowID(windowId);
303
304 QPoint windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
305
306 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, MouseTouchAdaptor::touchDevice(),
307 false /* autoCommit */);
308 touchEvent.release(0 /* touchId */, windowPos);
309 if (m_triPressModifier) {
310 touchEvent.release(1, windowPos);
311 touchEvent.release(2, windowPos);
312 }
313 touchEvent.commit(false /* processEvents */);
314
315 m_leftButtonIsPressed = false;
316 m_triPressModifier = false;
317 return true;
318}
319
320bool X11MouseTouchAdaptorPrivate::handleMotionNotify(WId windowId, uint32_t modifiers, int x, int y)
321{
322 if (!m_leftButtonIsPressed) {
323 return true;
324 }
325 Qt::KeyboardModifiers qtMod = translateMofidier(modifiers);
326
327 QWindow *targetWindow = findQWindowWithXWindowID(windowId);
328
329 QPoint windowPos(x / targetWindow->devicePixelRatio(), y / targetWindow->devicePixelRatio());
330
331 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, MouseTouchAdaptor::touchDevice(),
332 false /* autoCommit */);
333 touchEvent.move(0 /* touchId */, windowPos);
334 if (m_triPressModifier) {
335 if (qtMod == TRI_PRESS_MODIFIER) {
336 touchEvent.move(1, windowPos);
337 touchEvent.move(2, windowPos);
338 } else {
339 // released modifiers
340 touchEvent.release(1, windowPos);
341 touchEvent.release(2, windowPos);
342 m_triPressModifier = false;
343 }
344 }
345 touchEvent.commit(false /* processEvents */);
346
347 return true;
348}
349
350} // namespace UbuntuToolkit
0351
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.py'
--- tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.py 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.py 2016-04-07 16:01:36 +0000
@@ -0,0 +1,38 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#
3# Copyright (C) 2016 Canonical Ltd.
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU Lesser General Public License as published by
7# the Free Software Foundation; version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU Lesser General Public License for more details.
13#
14# You should have received a copy of the GNU Lesser General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
17import os
18from testtools.matchers import Equals
19from autopilot.matchers import Eventually
20from ubuntuuitoolkit import tests
21
22
23class TouchAdaptorTestCase(tests.QMLFileAppTestCase):
24 path = os.path.abspath(__file__)
25 dir_path = os.path.dirname(path)
26 test_qml_file_path = os.path.join(
27 dir_path, 'test_touchadaptor.qml')
28
29 def get_command_line(self, command_line):
30 command_line.append('-touch')
31 return command_line
32
33 def test_apparent_touch_screen(self):
34 touchArea = self.main_view.select_single(objectName="touchArea")
35 label = self.main_view.select_single(objectName="label")
36 # Trigger handlers as a courtesy to a watching person
37 self.pointing_device.click_object(touchArea)
38 self.assertThat(label.text, Eventually(Equals("Touched")))
039
=== added file 'tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.qml'
--- tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.qml 1970-01-01 00:00:00 +0000
+++ tests/autopilot/ubuntuuitoolkit/tests/test_touchadaptor.qml 2016-04-07 16:01:36 +0000
@@ -0,0 +1,51 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20MainView {
21 width: units.gu(48)
22 height: units.gu(60)
23 objectName: "mainView"
24
25 Page {
26 title: "TouchAdaptor"
27
28 MultiPointTouchArea {
29 id: mpa
30 property bool touched: false
31 anchors.fill: parent
32 mouseEnabled: false
33 objectName: "touchArea"
34 touchPoints: TouchPoint {
35 id: point1
36 onPressedChanged: {
37 if (pressed) {
38 label.text = "Touched";
39 }
40 }
41 }
42
43 Label {
44 id: label
45 objectName: "label"
46 anchors.centerIn: parent
47 text: "Not touched"
48 }
49 }
50 }
51}
052
=== modified file 'tests/unit_x11/tst_components/tst_adaptivepagelayout.qml'
--- tests/unit_x11/tst_components/tst_adaptivepagelayout.qml 2016-03-07 06:19:27 +0000
+++ tests/unit_x11/tst_components/tst_adaptivepagelayout.qml 2016-04-07 16:01:36 +0000
@@ -314,6 +314,7 @@
314 ];314 ];
315 }315 }
316 function test_forced_synchronous_loading_bug1540449(data) {316 function test_forced_synchronous_loading_bug1540449(data) {
317 layout.asynchronous = false;
317 layout[data.func](layout.primaryPage, data.page);318 layout[data.func](layout.primaryPage, data.page);
318 waitForRendering(layout, 400);319 waitForRendering(layout, 400);
319320
320321
=== modified file 'ubuntu-sdk.pro'
--- ubuntu-sdk.pro 2015-12-11 13:35:10 +0000
+++ ubuntu-sdk.pro 2016-04-07 16:01:36 +0000
@@ -8,7 +8,10 @@
8requires(qtHaveModule(quick))8requires(qtHaveModule(quick))
9load(qt_parts)9load(qt_parts)
1010
11SUBDIRS += po documentation app-launch-profiler ubuntu-ui-toolkit-launcher apicheck11src_uitk_launcher.subdir = ubuntu-ui-toolkit-launcher
12src_uitk_launcher.depends = sub-src
13
14SUBDIRS += po documentation app-launch-profiler src_uitk_launcher apicheck
1215
13sub_tests.CONFIG -= no_default_target16sub_tests.CONFIG -= no_default_target
14sub_tests.CONFIG -= no_default_install17sub_tests.CONFIG -= no_default_install
1518
=== removed file 'ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.cpp'
--- ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.cpp 2014-06-16 09:50:56 +0000
+++ ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.cpp 1970-01-01 00:00:00 +0000
@@ -1,159 +0,0 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 *
18 */
19
20#include "MouseTouchAdaptor.h"
21
22#include <qpa/qwindowsysteminterface.h>
23
24#include <QtGui/QMouseEvent>
25#include <QtTest/QTest>
26
27using QTest::QTouchEventSequence;
28
29namespace {
30Qt::MouseButton translateMouseButton(xcb_button_t detail)
31{
32 switch (detail) {
33 case 1: return Qt::LeftButton;
34 case 2: return Qt::MidButton;
35 case 3: return Qt::RightButton;
36 // Button values 4-7 are Wheel events
37 default: return Qt::NoButton;
38 }
39}
40} // end of anonymous namespace
41
42MouseTouchAdaptor::MouseTouchAdaptor()
43 : m_leftButtonIsPressed(false)
44{
45 m_touchDevice = new QTouchDevice;
46 m_touchDevice->setType(QTouchDevice::TouchScreen);
47 QWindowSystemInterface::registerTouchDevice(m_touchDevice);
48}
49
50bool MouseTouchAdaptor::nativeEventFilter(const QByteArray & eventType,
51 void * message, long * /*result*/)
52{
53 if (eventType != "xcb_generic_event_t") {
54 // wrong backend.
55 qWarning("MouseTouchAdaptor: XCB backend not in use. Adaptor inoperative!");
56 return false;
57 }
58
59 xcb_generic_event_t *xcbEvent = static_cast<xcb_generic_event_t *>(message);
60
61 switch (xcbEvent->response_type & ~0x80) {
62 case XCB_BUTTON_PRESS:
63 return handleButtonPress(reinterpret_cast<xcb_button_press_event_t *>(xcbEvent));
64 break;
65 case XCB_BUTTON_RELEASE:
66 return handleButtonRelease(reinterpret_cast<xcb_button_release_event_t *>(xcbEvent));
67 break;
68 case XCB_MOTION_NOTIFY:
69 return handleMotionNotify(reinterpret_cast<xcb_motion_notify_event_t *>(xcbEvent));
70 break;
71 default:
72 return false;
73 break;
74 };
75}
76
77bool MouseTouchAdaptor::handleButtonPress(xcb_button_press_event_t *pressEvent)
78{
79 Qt::MouseButton button = translateMouseButton(pressEvent->detail);
80
81 // Skip the event if it wasn't a left mouse press
82 if (button != Qt::LeftButton) {
83 return false;
84 }
85
86 QPoint windowPos(pressEvent->event_x, pressEvent->event_y);
87
88 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(pressEvent->event));
89
90 // no autoCommit
91 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false);
92 touchEvent.press(0, windowPos);
93 // do not process events when committed, let the events be processed with next event loop
94 touchEvent.commit(false);
95
96 m_leftButtonIsPressed = true;
97 return true;
98}
99
100bool MouseTouchAdaptor::handleButtonRelease(xcb_button_release_event_t *releaseEvent)
101{
102 Qt::MouseButton button = translateMouseButton(releaseEvent->detail);
103
104 // Skip the event if it wasn't a left mouse release
105 if (button != Qt::LeftButton) {
106 return false;
107 }
108
109 QPoint windowPos(releaseEvent->event_x, releaseEvent->event_y);
110
111 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(releaseEvent->event));
112
113 // no autoCommit
114 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false);
115 touchEvent.release(0, windowPos);
116 // do not process events when committed, let the events be processed with next event loop
117 touchEvent.commit(false);
118
119 m_leftButtonIsPressed = false;
120 return true;
121}
122
123bool MouseTouchAdaptor::handleMotionNotify(xcb_motion_notify_event_t *event)
124{
125 if (!m_leftButtonIsPressed) {
126 return false;
127 }
128
129 QPoint windowPos(event->event_x, event->event_y);
130
131 QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(event->event));
132
133 // no autoCommit
134 QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false);
135 touchEvent.move(0, windowPos);
136 // do not process events when committed, let the events be processed with next event loop
137 touchEvent.commit(false);
138
139 return true;
140}
141
142QWindow *MouseTouchAdaptor::findQWindowWithXWindowID(WId windowId)
143{
144 QWindowList windowList = QGuiApplication::topLevelWindows();
145 QWindow *foundWindow = 0;
146
147 int i = 0;
148 while (!foundWindow && i < windowList.count()) {
149 QWindow *window = windowList[i];
150 if (window->winId() == windowId) {
151 foundWindow = window;
152 } else {
153 ++i;
154 }
155 }
156
157 Q_ASSERT(foundWindow);
158 return foundWindow;
159}
1600
=== removed file 'ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.h'
--- ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.h 2014-06-16 09:50:56 +0000
+++ ubuntu-ui-toolkit-launcher/MouseTouchAdaptor.h 1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
17 *
18 */
19
20#ifndef MOUSE_TOUCH_ADAPTOR_H
21#define MOUSE_TOUCH_ADAPTOR_H
22
23#include <QtCore/QAbstractNativeEventFilter>
24#include <QWindow>
25#include <xcb/xcb.h>
26
27class QMouseEvent;
28class QTouchDevice;
29
30// Transforms QMouseEvents into single-finger QTouchEvents.
31class MouseTouchAdaptor : public QAbstractNativeEventFilter {
32
33public:
34 MouseTouchAdaptor();
35
36 // Filters mouse events and posts the equivalent QTouchEvents.
37 virtual bool nativeEventFilter(const QByteArray & eventType, void *message, long *result);
38
39private:
40
41 bool handleButtonPress(xcb_button_press_event_t *pressEvent);
42 bool handleButtonRelease(xcb_button_release_event_t *releaseEvent);
43 bool handleMotionNotify(xcb_motion_notify_event_t *event);
44 QWindow *findQWindowWithXWindowID(WId windowId);
45
46 QTouchDevice *m_touchDevice;
47 bool m_leftButtonIsPressed;
48};
49
50#endif // MOUSE_TOUCH_ADAPTOR_H
510
=== modified file 'ubuntu-ui-toolkit-launcher/launcher.cpp'
--- ubuntu-ui-toolkit-launcher/launcher.cpp 2015-11-13 09:29:40 +0000
+++ ubuntu-ui-toolkit-launcher/launcher.cpp 2016-04-07 16:01:36 +0000
@@ -32,19 +32,10 @@
32#include <QtQuick/private/qsgcontext_p.h>32#include <QtQuick/private/qsgcontext_p.h>
33#include <QtCore/QCommandLineParser>33#include <QtCore/QCommandLineParser>
34#include <QtCore/QCommandLineOption>34#include <QtCore/QCommandLineOption>
35#include "MouseTouchAdaptor.h"35#include <MouseTouchAdaptor>
36#include <QtGui/QTouchDevice>36#include <QtGui/QTouchDevice>
37#include <QtQml/qqml.h>37#include <QtQml/qqml.h>
3838
39bool touchDevicePresent()
40{
41 Q_FOREACH(const QTouchDevice *device, QTouchDevice::devices()) {
42 if (device->type() == QTouchDevice::TouchScreen)
43 return true;
44 }
45 return false;
46}
47
48static QObject *s_testRootObject = 0;39static QObject *s_testRootObject = 0;
49static QObject *testRootObject(QQmlEngine *engine, QJSEngine *jsEngine)40static QObject *testRootObject(QQmlEngine *engine, QJSEngine *jsEngine)
50{41{
@@ -151,9 +142,9 @@
151 view->setFlags(Qt::FramelessWindowHint);142 view->setFlags(Qt::FramelessWindowHint);
152 }143 }
153144
154 if (args.isSet(_enableTouch) && !touchDevicePresent()) {145 if (args.isSet(_enableTouch)) {
155 // has no effect if we have touch screen146 // has no effect if we have touch screen
156 application.installNativeEventFilter(new MouseTouchAdaptor);147 new UbuntuToolkit::MouseTouchAdaptor(&application);
157 }148 }
158149
159 QUrl source(QUrl::fromLocalFile(filename));150 QUrl source(QUrl::fromLocalFile(filename));
160151
=== modified file 'ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher.pro'
--- ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher.pro 2015-11-19 08:45:15 +0000
+++ ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher.pro 2016-04-07 16:01:36 +0000
@@ -1,11 +1,9 @@
1TEMPLATE = app1TEMPLATE = app
2QT += qml quick2QT += qml quick
3# For setSharedOpenGLContext3# For setSharedOpenGLContext
4QT += core-private gui-private testlib quick-private4QT += core-private gui-private testlib quick-private UbuntuToolkit
5CONFIG += no_keywords5CONFIG += no_keywords c++11
6HEADERS += MouseTouchAdaptor.h6SOURCES += launcher.cpp
7SOURCES += launcher.cpp \
8 MouseTouchAdaptor.cpp
9installPath = $$[QT_INSTALL_PREFIX]/bin7installPath = $$[QT_INSTALL_PREFIX]/bin
10launcher.path = $$installPath8launcher.path = $$installPath
11launcher.files = ubuntu-ui-toolkit-launcher9launcher.files = ubuntu-ui-toolkit-launcher

Subscribers

People subscribed via source and target branches