Merge lp:~gerboland/qtubuntu/upstream-closer into lp:qtubuntu

Proposed by Gerry Boland
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: no longer in the source branch.
Merged at revision: 367
Proposed branch: lp:~gerboland/qtubuntu/upstream-closer
Merge into: lp:qtubuntu
Diff against target: 4706 lines (+1834/-1069)
34 files modified
README (+7/-7)
src/ubuntumirclient/qmirclientappstatecontroller.cpp (+46/-22)
src/ubuntumirclient/qmirclientappstatecontroller.h (+45/-21)
src/ubuntumirclient/qmirclientbackingstore.cpp (+52/-30)
src/ubuntumirclient/qmirclientbackingstore.h (+46/-22)
src/ubuntumirclient/qmirclientclipboard.cpp (+58/-34)
src/ubuntumirclient/qmirclientclipboard.h (+46/-22)
src/ubuntumirclient/qmirclientcursor.cpp (+52/-28)
src/ubuntumirclient/qmirclientcursor.h (+45/-21)
src/ubuntumirclient/qmirclientdebugextension.cpp (+52/-28)
src/ubuntumirclient/qmirclientdebugextension.h (+45/-21)
src/ubuntumirclient/qmirclientdesktopwindow.cpp (+44/-20)
src/ubuntumirclient/qmirclientdesktopwindow.h (+45/-21)
src/ubuntumirclient/qmirclientglcontext.cpp (+57/-33)
src/ubuntumirclient/qmirclientglcontext.h (+46/-22)
src/ubuntumirclient/qmirclientinput.cpp (+77/-52)
src/ubuntumirclient/qmirclientinput.h (+59/-36)
src/ubuntumirclient/qmirclientintegration.cpp (+97/-74)
src/ubuntumirclient/qmirclientintegration.h (+63/-39)
src/ubuntumirclient/qmirclientlogging.h (+49/-25)
src/ubuntumirclient/qmirclientnativeinterface.cpp (+78/-54)
src/ubuntumirclient/qmirclientnativeinterface.h (+48/-24)
src/ubuntumirclient/qmirclientorientationchangeevent_p.h (+44/-20)
src/ubuntumirclient/qmirclientplatformservices.cpp (+52/-28)
src/ubuntumirclient/qmirclientplatformservices.h (+44/-20)
src/ubuntumirclient/qmirclientplugin.cpp (+50/-29)
src/ubuntumirclient/qmirclientplugin.h (+46/-21)
src/ubuntumirclient/qmirclientscreen.cpp (+56/-32)
src/ubuntumirclient/qmirclientscreen.h (+50/-26)
src/ubuntumirclient/qmirclientscreenobserver.cpp (+59/-35)
src/ubuntumirclient/qmirclientscreenobserver.h (+56/-32)
src/ubuntumirclient/qmirclientwindow.cpp (+132/-104)
src/ubuntumirclient/qmirclientwindow.h (+56/-34)
src/ubuntumirclient/ubuntumirclient.pro (+32/-32)
To merge this branch: bzr merge lp:~gerboland/qtubuntu/upstream-closer
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+315486@code.launchpad.net

Commit message

Class renaming and syntax changes to shrink delta with upstream mirclient QPA plugin (which is equivalent to rev 360)

Changes:
 - Rename classes to prefix "QMirClient" instead of "Ubuntu"
 - Update licence headers to match Qt's
 - change logging categories spec to match Qt: qt.qpa.mirclient
 - Enforce American English
 - some minor syntax tweaks

Some differences will still exist between lp:qtubuntu and upstream, some unavoidable:
 - QPA plugin remains "ubuntumirclient" and not "mirclient" as used upstream.
 - some header paths differ between in-Qt code and externally built code
 - I've not included build-type switches for things like accessibility support
 - relaxed switch cases to allow older versions of Mir not break a build
 - panel height hack removed from upstream
 - platform-api env var setting removed from upstream

Description of the change

This is designed to land *after* the following branches still in the queue:

lp:~nick-dedekind/qtubuntu/1648842.window-focus-regression
lp:~gerboland/qtubuntu/quit-gracefully-on-no-mirconnection
lp:~dandrader/qtubuntu/resizeToolTip

The resulting delta between this and Qt upstream can be seen in this diff:
http://pastebin.ubuntu.com/23858329/

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:367
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/174/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3917
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3945
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3790/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3790/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3790/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3790/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3790/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3790
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3790/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtubuntu-ci/174/rebuild

review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Didn't check the code yet. But after building & installing it on my test machine unity8-dash (or any qt app) no longer comes up.

Log says:
This application failed to start because it could not find or load the Qt platform plugin "ubuntumirclient"

You sure you didn't rename the qpa?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

=== renamed and modified file src/ubuntumirclient/plugin.cpp => src/ubuntumirclient/qmirclientplugin.cpp

"""
- if (system.toLower() == QLatin1String("ubuntumirclient")) {
+ if (system.toLower() == QLatin1String("mirclient")) {
"""

Indeed you renamed it

review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

The rest looks fine.

After undoing the rename of the platform, all works well again.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

all good now

review: Approve
363. By Nick Dedekind

merged trunk

365. By Gerry Boland

Undo qpa plugin name change

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2016-09-29 15:12:29 +0000
3+++ README 2017-02-08 16:34:34 +0000
4@@ -44,13 +44,13 @@
5 logged and debug messages are disabled. QtUbuntu provides the following
6 logging categories:
7
8- * ubuntumirclient.cursor - Messages about the cursor.
9- * ubuntumirclient.input - Messages related to input and other Mir events.
10- * ubuntumirclient.graphics - Messages related to graphics, GL and EGL.
11- * ubuntumirclient.swapBuffers - Messages related to surface buffer swapping.
12- * ubuntumirclient - For all other messages form the ubuntumirclient QPA.
13- * ubuntuappmenu.registrar - Messages related to application menu registration.
14- * ubuntuappmenu - For all other messages form the ubuntuappmenu QPA theme.
15+ * qt.qpa.mirclient.cursor - Messages about the cursor.
16+ * qt.qpa.mirclient.input - Messages related to input and other Mir events.
17+ * qt.qpa.mirclient.graphics - Messages related to graphics, GL and EGL.
18+ * qt.qpa.mirclient.swapBuffers - Messages related to surface buffer swapping.
19+ * qt.qpa.mirclient - For all other messages form the ubuntumirclient QPA.
20+ * ubuntuappmenu.registrar - Messages related to application menu registration.
21+ * ubuntuappmenu - For all other messages form the ubuntuappmenu QPA theme.
22
23 The QT_QPA_EGLFS_DEBUG environment variable prints a little more information
24 from Qt's internals.
25
26=== renamed file 'src/ubuntumirclient/appstatecontroller.cpp' => 'src/ubuntumirclient/qmirclientappstatecontroller.cpp'
27--- src/ubuntumirclient/appstatecontroller.cpp 2016-10-12 15:07:35 +0000
28+++ src/ubuntumirclient/qmirclientappstatecontroller.cpp 2017-02-08 16:34:34 +0000
29@@ -1,31 +1,55 @@
30-/*
31- * Copyright (C) 2016 Canonical, Ltd.
32- *
33- * This program is free software: you can redistribute it and/or modify it under
34- * the terms of the GNU Lesser General Public License version 3, as published by
35- * the Free Software Foundation.
36- *
37- * This program is distributed in the hope that it will be useful, but WITHOUT
38- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
39- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
40- * Lesser General Public License for more details.
41- *
42- * You should have received a copy of the GNU Lesser General Public License
43- * along with this program. If not, see <http://www.gnu.org/licenses/>.
44- */
45-
46-#include "appstatecontroller.h"
47+/****************************************************************************
48+**
49+** Copyright (C) 2016 Canonical, Ltd.
50+** Contact: https://www.qt.io/licensing/
51+**
52+** This file is part of the plugins of the Qt Toolkit.
53+**
54+** $QT_BEGIN_LICENSE:LGPL$
55+** Commercial License Usage
56+** Licensees holding valid commercial Qt licenses may use this file in
57+** accordance with the commercial license agreement provided with the
58+** Software or, alternatively, in accordance with the terms contained in
59+** a written agreement between you and The Qt Company. For licensing terms
60+** and conditions see https://www.qt.io/terms-conditions. For further
61+** information use the contact form at https://www.qt.io/contact-us.
62+**
63+** GNU Lesser General Public License Usage
64+** Alternatively, this file may be used under the terms of the GNU Lesser
65+** General Public License version 3 as published by the Free Software
66+** Foundation and appearing in the file LICENSE.LGPL3 included in the
67+** packaging of this file. Please review the following information to
68+** ensure the GNU Lesser General Public License version 3 requirements
69+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
70+**
71+** GNU General Public License Usage
72+** Alternatively, this file may be used under the terms of the GNU
73+** General Public License version 2.0 or (at your option) the GNU General
74+** Public license version 3 or any later version approved by the KDE Free
75+** Qt Foundation. The licenses are as published by the Free Software
76+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
77+** included in the packaging of this file. Please review the following
78+** information to ensure the GNU General Public License requirements will
79+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
80+** https://www.gnu.org/licenses/gpl-3.0.html.
81+**
82+** $QT_END_LICENSE$
83+**
84+****************************************************************************/
85+
86+
87+#include "qmirclientappstatecontroller.h"
88
89 #include <qpa/qwindowsysteminterface.h>
90
91 /*
92- * UbuntuAppStateController - updates Qt's QApplication::applicationState property.
93+ * QMirClientAppStateController - updates Qt's QApplication::applicationState property.
94 *
95 * Tries to avoid active-inactive-active invocations using a timer. The rapid state
96 * change can confuse some applications.
97 */
98
99-UbuntuAppStateController::UbuntuAppStateController()
100+QMirClientAppStateController::QMirClientAppStateController()
101 : m_suspended(false)
102 , m_lastActive(true)
103 {
104@@ -37,7 +61,7 @@
105 });
106 }
107
108-void UbuntuAppStateController::setSuspended()
109+void QMirClientAppStateController::setSuspended()
110 {
111 m_inactiveTimer.stop();
112 if (!m_suspended) {
113@@ -47,7 +71,7 @@
114 }
115 }
116
117-void UbuntuAppStateController::setResumed()
118+void QMirClientAppStateController::setResumed()
119 {
120 m_inactiveTimer.stop();
121 if (m_suspended) {
122@@ -61,7 +85,7 @@
123 }
124 }
125
126-void UbuntuAppStateController::setWindowFocused(bool focused)
127+void QMirClientAppStateController::setWindowFocused(bool focused)
128 {
129 if (m_suspended) {
130 return;
131
132=== renamed file 'src/ubuntumirclient/appstatecontroller.h' => 'src/ubuntumirclient/qmirclientappstatecontroller.h'
133--- src/ubuntumirclient/appstatecontroller.h 2016-10-12 15:05:58 +0000
134+++ src/ubuntumirclient/qmirclientappstatecontroller.h 2017-02-08 16:34:34 +0000
135@@ -1,28 +1,52 @@
136-/*
137- * Copyright (C) 2016 Canonical, Ltd.
138- *
139- * This program is free software: you can redistribute it and/or modify it under
140- * the terms of the GNU Lesser General Public License version 3, as published by
141- * the Free Software Foundation.
142- *
143- * This program is distributed in the hope that it will be useful, but WITHOUT
144- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
145- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
146- * Lesser General Public License for more details.
147- *
148- * You should have received a copy of the GNU Lesser General Public License
149- * along with this program. If not, see <http://www.gnu.org/licenses/>.
150- */
151-
152-#ifndef UBUNTUAPPSTATECONTROLLER_H
153-#define UBUNTUAPPSTATECONTROLLER_H
154+/****************************************************************************
155+**
156+** Copyright (C) 2016 Canonical, Ltd.
157+** Contact: https://www.qt.io/licensing/
158+**
159+** This file is part of the plugins of the Qt Toolkit.
160+**
161+** $QT_BEGIN_LICENSE:LGPL$
162+** Commercial License Usage
163+** Licensees holding valid commercial Qt licenses may use this file in
164+** accordance with the commercial license agreement provided with the
165+** Software or, alternatively, in accordance with the terms contained in
166+** a written agreement between you and The Qt Company. For licensing terms
167+** and conditions see https://www.qt.io/terms-conditions. For further
168+** information use the contact form at https://www.qt.io/contact-us.
169+**
170+** GNU Lesser General Public License Usage
171+** Alternatively, this file may be used under the terms of the GNU Lesser
172+** General Public License version 3 as published by the Free Software
173+** Foundation and appearing in the file LICENSE.LGPL3 included in the
174+** packaging of this file. Please review the following information to
175+** ensure the GNU Lesser General Public License version 3 requirements
176+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
177+**
178+** GNU General Public License Usage
179+** Alternatively, this file may be used under the terms of the GNU
180+** General Public License version 2.0 or (at your option) the GNU General
181+** Public license version 3 or any later version approved by the KDE Free
182+** Qt Foundation. The licenses are as published by the Free Software
183+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
184+** included in the packaging of this file. Please review the following
185+** information to ensure the GNU General Public License requirements will
186+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
187+** https://www.gnu.org/licenses/gpl-3.0.html.
188+**
189+** $QT_END_LICENSE$
190+**
191+****************************************************************************/
192+
193+
194+#ifndef QMIRCLIENTAPPSTATECONTROLLER_H
195+#define QMIRCLIENTAPPSTATECONTROLLER_H
196
197 #include <QTimer>
198
199-class UbuntuAppStateController
200+class QMirClientAppStateController
201 {
202 public:
203- UbuntuAppStateController();
204+ QMirClientAppStateController();
205
206 void setSuspended();
207 void setResumed();
208@@ -35,4 +59,4 @@
209 QTimer m_inactiveTimer;
210 };
211
212-#endif // UBUNTUAPPSTATECONTROLLER_H
213+#endif // QMIRCLIENTAPPSTATECONTROLLER_H
214
215=== renamed file 'src/ubuntumirclient/backingstore.cpp' => 'src/ubuntumirclient/qmirclientbackingstore.cpp'
216--- src/ubuntumirclient/backingstore.cpp 2016-10-12 16:31:54 +0000
217+++ src/ubuntumirclient/qmirclientbackingstore.cpp 2017-02-08 16:34:34 +0000
218@@ -1,28 +1,52 @@
219-/*
220- * Copyright (C) 2014 Canonical, Ltd.
221- *
222- * This program is free software: you can redistribute it and/or modify it under
223- * the terms of the GNU Lesser General Public License version 3, as published by
224- * the Free Software Foundation.
225- *
226- * This program is distributed in the hope that it will be useful, but WITHOUT
227- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
228- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
229- * Lesser General Public License for more details.
230- *
231- * You should have received a copy of the GNU Lesser General Public License
232- * along with this program. If not, see <http://www.gnu.org/licenses/>.
233- */
234-
235-#include "backingstore.h"
236-#include "logging.h"
237+/****************************************************************************
238+**
239+** Copyright (C) 2016 Canonical, Ltd.
240+** Contact: https://www.qt.io/licensing/
241+**
242+** This file is part of the plugins of the Qt Toolkit.
243+**
244+** $QT_BEGIN_LICENSE:LGPL$
245+** Commercial License Usage
246+** Licensees holding valid commercial Qt licenses may use this file in
247+** accordance with the commercial license agreement provided with the
248+** Software or, alternatively, in accordance with the terms contained in
249+** a written agreement between you and The Qt Company. For licensing terms
250+** and conditions see https://www.qt.io/terms-conditions. For further
251+** information use the contact form at https://www.qt.io/contact-us.
252+**
253+** GNU Lesser General Public License Usage
254+** Alternatively, this file may be used under the terms of the GNU Lesser
255+** General Public License version 3 as published by the Free Software
256+** Foundation and appearing in the file LICENSE.LGPL3 included in the
257+** packaging of this file. Please review the following information to
258+** ensure the GNU Lesser General Public License version 3 requirements
259+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
260+**
261+** GNU General Public License Usage
262+** Alternatively, this file may be used under the terms of the GNU
263+** General Public License version 2.0 or (at your option) the GNU General
264+** Public license version 3 or any later version approved by the KDE Free
265+** Qt Foundation. The licenses are as published by the Free Software
266+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
267+** included in the packaging of this file. Please review the following
268+** information to ensure the GNU General Public License requirements will
269+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
270+** https://www.gnu.org/licenses/gpl-3.0.html.
271+**
272+** $QT_END_LICENSE$
273+**
274+****************************************************************************/
275+
276+
277+#include "qmirclientbackingstore.h"
278+#include "qmirclientlogging.h"
279 #include <QtGui/QOpenGLContext>
280 #include <QtGui/QOpenGLTexture>
281 #include <QtGui/QMatrix4x4>
282 #include <QtGui/private/qopengltextureblitter_p.h>
283 #include <QtGui/qopenglfunctions.h>
284
285-UbuntuBackingStore::UbuntuBackingStore(QWindow* window)
286+QMirClientBackingStore::QMirClientBackingStore(QWindow* window)
287 : QPlatformBackingStore(window)
288 , mContext(new QOpenGLContext)
289 , mTexture(new QOpenGLTexture(QOpenGLTexture::Target2D))
290@@ -35,12 +59,12 @@
291 window->setSurfaceType(QSurface::OpenGLSurface);
292 }
293
294-UbuntuBackingStore::~UbuntuBackingStore()
295+QMirClientBackingStore::~QMirClientBackingStore()
296 {
297 mContext->makeCurrent(window()); // needed as QOpenGLTexture destructor assumes current context
298 }
299
300-void UbuntuBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
301+void QMirClientBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset)
302 {
303 Q_UNUSED(region);
304 Q_UNUSED(offset);
305@@ -59,7 +83,7 @@
306 mContext->swapBuffers(window);
307 }
308
309-void UbuntuBackingStore::updateTexture()
310+void QMirClientBackingStore::updateTexture()
311 {
312 if (mDirty.isNull())
313 return;
314@@ -76,9 +100,7 @@
315 QRegion fixed;
316 QRect imageRect = mImage.rect();
317
318- /* Following code taken from QEGLPlatformBackingStore under the terms of the Lesser GPL v2.1 licence
319- * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). */
320- Q_FOREACH (const QRect &rect, mDirty.rects()) {
321+ for (const QRect &rect : mDirty.rects()) {
322 // intersect with image rect to be sure
323 QRect r = imageRect & rect;
324
325@@ -91,7 +113,7 @@
326 fixed |= r;
327 }
328
329- Q_FOREACH (const QRect &rect, fixed.rects()) {
330+ for (const QRect &rect : fixed.rects()) {
331 // if the sub-rect is full-width we can pass the image data directly to
332 // OpenGL instead of copying, since there is no gap between scanlines
333 if (rect.width() == imageRect.width()) {
334@@ -108,12 +130,12 @@
335 }
336
337
338-void UbuntuBackingStore::beginPaint(const QRegion& region)
339+void QMirClientBackingStore::beginPaint(const QRegion& region)
340 {
341 mDirty |= region;
342 }
343
344-void UbuntuBackingStore::resize(const QSize& size, const QRegion& /*staticContents*/)
345+void QMirClientBackingStore::resize(const QSize& size, const QRegion& /*staticContents*/)
346 {
347 mImage = QImage(size, QImage::Format_RGBA8888);
348
349@@ -123,12 +145,12 @@
350 mTexture->destroy();
351 }
352
353-QPaintDevice* UbuntuBackingStore::paintDevice()
354+QPaintDevice* QMirClientBackingStore::paintDevice()
355 {
356 return &mImage;
357 }
358
359-QImage UbuntuBackingStore::toImage() const
360+QImage QMirClientBackingStore::toImage() const
361 {
362 // used by QPlatformBackingStore::composeAndFlush
363 return mImage;
364
365=== renamed file 'src/ubuntumirclient/backingstore.h' => 'src/ubuntumirclient/qmirclientbackingstore.h'
366--- src/ubuntumirclient/backingstore.h 2016-10-04 16:20:07 +0000
367+++ src/ubuntumirclient/qmirclientbackingstore.h 2017-02-08 16:34:34 +0000
368@@ -1,21 +1,45 @@
369-/*
370- * Copyright (C) 2014 Canonical, Ltd.
371- *
372- * This program is free software: you can redistribute it and/or modify it under
373- * the terms of the GNU Lesser General Public License version 3, as published by
374- * the Free Software Foundation.
375- *
376- * This program is distributed in the hope that it will be useful, but WITHOUT
377- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
378- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
379- * Lesser General Public License for more details.
380- *
381- * You should have received a copy of the GNU Lesser General Public License
382- * along with this program. If not, see <http://www.gnu.org/licenses/>.
383- */
384-
385-#ifndef UBUNTU_BACKING_STORE_H
386-#define UBUNTU_BACKING_STORE_H
387+/****************************************************************************
388+**
389+** Copyright (C) 2016 Canonical, Ltd.
390+** Contact: https://www.qt.io/licensing/
391+**
392+** This file is part of the plugins of the Qt Toolkit.
393+**
394+** $QT_BEGIN_LICENSE:LGPL$
395+** Commercial License Usage
396+** Licensees holding valid commercial Qt licenses may use this file in
397+** accordance with the commercial license agreement provided with the
398+** Software or, alternatively, in accordance with the terms contained in
399+** a written agreement between you and The Qt Company. For licensing terms
400+** and conditions see https://www.qt.io/terms-conditions. For further
401+** information use the contact form at https://www.qt.io/contact-us.
402+**
403+** GNU Lesser General Public License Usage
404+** Alternatively, this file may be used under the terms of the GNU Lesser
405+** General Public License version 3 as published by the Free Software
406+** Foundation and appearing in the file LICENSE.LGPL3 included in the
407+** packaging of this file. Please review the following information to
408+** ensure the GNU Lesser General Public License version 3 requirements
409+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
410+**
411+** GNU General Public License Usage
412+** Alternatively, this file may be used under the terms of the GNU
413+** General Public License version 2.0 or (at your option) the GNU General
414+** Public license version 3 or any later version approved by the KDE Free
415+** Qt Foundation. The licenses are as published by the Free Software
416+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
417+** included in the packaging of this file. Please review the following
418+** information to ensure the GNU General Public License requirements will
419+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
420+** https://www.gnu.org/licenses/gpl-3.0.html.
421+**
422+** $QT_END_LICENSE$
423+**
424+****************************************************************************/
425+
426+
427+#ifndef QMIRCLIENTBACKINGSTORE_H
428+#define QMIRCLIENTBACKINGSTORE_H
429
430 #include <qpa/qplatformbackingstore.h>
431
432@@ -23,11 +47,11 @@
433 class QOpenGLTexture;
434 class QOpenGLTextureBlitter;
435
436-class UbuntuBackingStore : public QPlatformBackingStore
437+class QMirClientBackingStore : public QPlatformBackingStore
438 {
439 public:
440- UbuntuBackingStore(QWindow* window);
441- virtual ~UbuntuBackingStore();
442+ QMirClientBackingStore(QWindow* window);
443+ virtual ~QMirClientBackingStore();
444
445 // QPlatformBackingStore methods.
446 void beginPaint(const QRegion&) override;
447@@ -47,4 +71,4 @@
448 QRegion mDirty;
449 };
450
451-#endif // UBUNTU_BACKING_STORE_H
452+#endif // QMIRCLIENTBACKINGSTORE_H
453
454=== renamed file 'src/ubuntumirclient/clipboard.cpp' => 'src/ubuntumirclient/qmirclientclipboard.cpp'
455--- src/ubuntumirclient/clipboard.cpp 2016-08-24 12:40:30 +0000
456+++ src/ubuntumirclient/qmirclientclipboard.cpp 2017-02-08 16:34:34 +0000
457@@ -1,22 +1,46 @@
458-/*
459- * Copyright (C) 2014,2016 Canonical, Ltd.
460- *
461- * This program is free software: you can redistribute it and/or modify it under
462- * the terms of the GNU Lesser General Public License version 3, as published by
463- * the Free Software Foundation.
464- *
465- * This program is distributed in the hope that it will be useful, but WITHOUT
466- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
467- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
468- * Lesser General Public License for more details.
469- *
470- * You should have received a copy of the GNU Lesser General Public License
471- * along with this program. If not, see <http://www.gnu.org/licenses/>.
472- */
473-
474-#include "clipboard.h"
475-#include "logging.h"
476-#include "window.h"
477+/****************************************************************************
478+**
479+** Copyright (C) 2016 Canonical, Ltd.
480+** Contact: https://www.qt.io/licensing/
481+**
482+** This file is part of the plugins of the Qt Toolkit.
483+**
484+** $QT_BEGIN_LICENSE:LGPL$
485+** Commercial License Usage
486+** Licensees holding valid commercial Qt licenses may use this file in
487+** accordance with the commercial license agreement provided with the
488+** Software or, alternatively, in accordance with the terms contained in
489+** a written agreement between you and The Qt Company. For licensing terms
490+** and conditions see https://www.qt.io/terms-conditions. For further
491+** information use the contact form at https://www.qt.io/contact-us.
492+**
493+** GNU Lesser General Public License Usage
494+** Alternatively, this file may be used under the terms of the GNU Lesser
495+** General Public License version 3 as published by the Free Software
496+** Foundation and appearing in the file LICENSE.LGPL3 included in the
497+** packaging of this file. Please review the following information to
498+** ensure the GNU Lesser General Public License version 3 requirements
499+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
500+**
501+** GNU General Public License Usage
502+** Alternatively, this file may be used under the terms of the GNU
503+** General Public License version 2.0 or (at your option) the GNU General
504+** Public license version 3 or any later version approved by the KDE Free
505+** Qt Foundation. The licenses are as published by the Free Software
506+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
507+** included in the packaging of this file. Please review the following
508+** information to ensure the GNU General Public License requirements will
509+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
510+** https://www.gnu.org/licenses/gpl-3.0.html.
511+**
512+** $QT_END_LICENSE$
513+**
514+****************************************************************************/
515+
516+
517+#include "qmirclientclipboard.h"
518+#include "qmirclientlogging.h"
519+#include "qmirclientwindow.h"
520
521 #include <QDBusPendingCallWatcher>
522 #include <QGuiApplication>
523@@ -30,29 +54,29 @@
524 // get this cumbersome nested namespace out of the way
525 using namespace com::ubuntu::content;
526
527-UbuntuClipboard::UbuntuClipboard()
528+QMirClientClipboard::QMirClientClipboard()
529 : mMimeData(new QMimeData)
530 , mContentHub(Hub::Client::instance())
531 {
532 connect(mContentHub, &Hub::pasteboardChanged, this, [this]() {
533- if (mClipboardState == UbuntuClipboard::SyncedClipboard) {
534- mClipboardState = UbuntuClipboard::OutdatedClipboard;
535+ if (mClipboardState == QMirClientClipboard::SyncedClipboard) {
536+ mClipboardState = QMirClientClipboard::OutdatedClipboard;
537 emitChanged(QClipboard::Clipboard);
538 }
539 });
540
541 connect(qGuiApp, &QGuiApplication::applicationStateChanged,
542- this, &UbuntuClipboard::onApplicationStateChanged);
543+ this, &QMirClientClipboard::onApplicationStateChanged);
544
545 requestMimeData();
546 }
547
548-UbuntuClipboard::~UbuntuClipboard()
549+QMirClientClipboard::~QMirClientClipboard()
550 {
551 delete mMimeData;
552 }
553
554-QMimeData* UbuntuClipboard::mimeData(QClipboard::Mode mode)
555+QMimeData* QMirClientClipboard::mimeData(QClipboard::Mode mode)
556 {
557 if (mode != QClipboard::Clipboard)
558 return nullptr;
559@@ -70,11 +94,11 @@
560 return mMimeData;
561 }
562
563-void UbuntuClipboard::setMimeData(QMimeData* mimeData, QClipboard::Mode mode)
564+void QMirClientClipboard::setMimeData(QMimeData* mimeData, QClipboard::Mode mode)
565 {
566 QWindow *focusWindow = QGuiApplication::focusWindow();
567 if (focusWindow && mode == QClipboard::Clipboard && mimeData != nullptr) {
568- QString surfaceId = static_cast<UbuntuWindow*>(focusWindow->handle())->persistentSurfaceId();
569+ QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
570
571 QDBusPendingCall reply = mContentHub->createPaste(surfaceId, *mimeData);
572
573@@ -89,18 +113,18 @@
574 }
575 }
576
577-bool UbuntuClipboard::supportsMode(QClipboard::Mode mode) const
578+bool QMirClientClipboard::supportsMode(QClipboard::Mode mode) const
579 {
580 return mode == QClipboard::Clipboard;
581 }
582
583-bool UbuntuClipboard::ownsMode(QClipboard::Mode mode) const
584+bool QMirClientClipboard::ownsMode(QClipboard::Mode mode) const
585 {
586 Q_UNUSED(mode);
587 return false;
588 }
589
590-void UbuntuClipboard::onApplicationStateChanged(Qt::ApplicationState state)
591+void QMirClientClipboard::onApplicationStateChanged(Qt::ApplicationState state)
592 {
593 if (state == Qt::ApplicationActive) {
594 // Only focused or active applications might be allowed to paste, so we probably
595@@ -110,7 +134,7 @@
596 }
597 }
598
599-void UbuntuClipboard::updateMimeData()
600+void QMirClientClipboard::updateMimeData()
601 {
602 if (qGuiApp->applicationState() != Qt::ApplicationActive) {
603 // Don't even bother asking as content-hub would probably ignore our request (and should).
604@@ -121,14 +145,14 @@
605
606 QWindow *focusWindow = QGuiApplication::focusWindow();
607 if (focusWindow) {
608- QString surfaceId = static_cast<UbuntuWindow*>(focusWindow->handle())->persistentSurfaceId();
609+ QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
610 mMimeData = mContentHub->latestPaste(surfaceId);
611 mClipboardState = SyncedClipboard;
612 emitChanged(QClipboard::Clipboard);
613 }
614 }
615
616-void UbuntuClipboard::requestMimeData()
617+void QMirClientClipboard::requestMimeData()
618 {
619 if (qGuiApp->applicationState() != Qt::ApplicationActive) {
620 // Don't even bother asking as content-hub would probably ignore our request (and should).
621@@ -140,7 +164,7 @@
622 return;
623 }
624
625- QString surfaceId = static_cast<UbuntuWindow*>(focusWindow->handle())->persistentSurfaceId();
626+ QString surfaceId = static_cast<QMirClientWindow*>(focusWindow->handle())->persistentSurfaceId();
627 QDBusPendingCall reply = mContentHub->requestLatestPaste(surfaceId);
628 mClipboardState = SyncingClipboard;
629
630
631=== renamed file 'src/ubuntumirclient/clipboard.h' => 'src/ubuntumirclient/qmirclientclipboard.h'
632--- src/ubuntumirclient/clipboard.h 2016-08-24 12:40:30 +0000
633+++ src/ubuntumirclient/qmirclientclipboard.h 2017-02-08 16:34:34 +0000
634@@ -1,21 +1,45 @@
635-/*
636- * Copyright (C) 2014,2016 Canonical, Ltd.
637- *
638- * This program is free software: you can redistribute it and/or modify it under
639- * the terms of the GNU Lesser General Public License version 3, as published by
640- * the Free Software Foundation.
641- *
642- * This program is distributed in the hope that it will be useful, but WITHOUT
643- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
644- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
645- * Lesser General Public License for more details.
646- *
647- * You should have received a copy of the GNU Lesser General Public License
648- * along with this program. If not, see <http://www.gnu.org/licenses/>.
649- */
650-
651-#ifndef UBUNTU_CLIPBOARD_H
652-#define UBUNTU_CLIPBOARD_H
653+/****************************************************************************
654+**
655+** Copyright (C) 2016 Canonical, Ltd.
656+** Contact: https://www.qt.io/licensing/
657+**
658+** This file is part of the plugins of the Qt Toolkit.
659+**
660+** $QT_BEGIN_LICENSE:LGPL$
661+** Commercial License Usage
662+** Licensees holding valid commercial Qt licenses may use this file in
663+** accordance with the commercial license agreement provided with the
664+** Software or, alternatively, in accordance with the terms contained in
665+** a written agreement between you and The Qt Company. For licensing terms
666+** and conditions see https://www.qt.io/terms-conditions. For further
667+** information use the contact form at https://www.qt.io/contact-us.
668+**
669+** GNU Lesser General Public License Usage
670+** Alternatively, this file may be used under the terms of the GNU Lesser
671+** General Public License version 3 as published by the Free Software
672+** Foundation and appearing in the file LICENSE.LGPL3 included in the
673+** packaging of this file. Please review the following information to
674+** ensure the GNU Lesser General Public License version 3 requirements
675+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
676+**
677+** GNU General Public License Usage
678+** Alternatively, this file may be used under the terms of the GNU
679+** General Public License version 2.0 or (at your option) the GNU General
680+** Public license version 3 or any later version approved by the KDE Free
681+** Qt Foundation. The licenses are as published by the Free Software
682+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
683+** included in the packaging of this file. Please review the following
684+** information to ensure the GNU General Public License requirements will
685+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
686+** https://www.gnu.org/licenses/gpl-3.0.html.
687+**
688+** $QT_END_LICENSE$
689+**
690+****************************************************************************/
691+
692+
693+#ifndef QMIRCLIENTCLIPBOARD_H
694+#define QMIRCLIENTCLIPBOARD_H
695
696 #include <qpa/qplatformclipboard.h>
697
698@@ -32,12 +56,12 @@
699
700 class QDBusPendingCallWatcher;
701
702-class UbuntuClipboard : public QObject, public QPlatformClipboard
703+class QMirClientClipboard : public QObject, public QPlatformClipboard
704 {
705 Q_OBJECT
706 public:
707- UbuntuClipboard();
708- virtual ~UbuntuClipboard();
709+ QMirClientClipboard();
710+ virtual ~QMirClientClipboard();
711
712 // QPlatformClipboard methods.
713 QMimeData* mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override;
714@@ -65,4 +89,4 @@
715 QDBusPendingCallWatcher *mPasteReply{nullptr};
716 };
717
718-#endif // UBUNTU_CLIPBOARD_H
719+#endif // QMIRCLIENTCLIPBOARD_H
720
721=== renamed file 'src/ubuntumirclient/cursor.cpp' => 'src/ubuntumirclient/qmirclientcursor.cpp'
722--- src/ubuntumirclient/cursor.cpp 2016-12-09 17:02:57 +0000
723+++ src/ubuntumirclient/qmirclientcursor.cpp 2017-02-08 16:34:34 +0000
724@@ -1,29 +1,53 @@
725-/*
726- * Copyright (C) 2015 Canonical, Ltd.
727- *
728- * This program is free software: you can redistribute it and/or modify it under
729- * the terms of the GNU Lesser General Public License version 3, as published by
730- * the Free Software Foundation.
731- *
732- * This program is distributed in the hope that it will be useful, but WITHOUT
733- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
734- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
735- * Lesser General Public License for more details.
736- *
737- * You should have received a copy of the GNU Lesser General Public License
738- * along with this program. If not, see <http://www.gnu.org/licenses/>.
739- */
740-
741-#include "cursor.h"
742-
743-#include "logging.h"
744-#include "window.h"
745+/****************************************************************************
746+**
747+** Copyright (C) 2015-2016 Canonical, Ltd.
748+** Contact: https://www.qt.io/licensing/
749+**
750+** This file is part of the plugins of the Qt Toolkit.
751+**
752+** $QT_BEGIN_LICENSE:LGPL$
753+** Commercial License Usage
754+** Licensees holding valid commercial Qt licenses may use this file in
755+** accordance with the commercial license agreement provided with the
756+** Software or, alternatively, in accordance with the terms contained in
757+** a written agreement between you and The Qt Company. For licensing terms
758+** and conditions see https://www.qt.io/terms-conditions. For further
759+** information use the contact form at https://www.qt.io/contact-us.
760+**
761+** GNU Lesser General Public License Usage
762+** Alternatively, this file may be used under the terms of the GNU Lesser
763+** General Public License version 3 as published by the Free Software
764+** Foundation and appearing in the file LICENSE.LGPL3 included in the
765+** packaging of this file. Please review the following information to
766+** ensure the GNU Lesser General Public License version 3 requirements
767+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
768+**
769+** GNU General Public License Usage
770+** Alternatively, this file may be used under the terms of the GNU
771+** General Public License version 2.0 or (at your option) the GNU General
772+** Public license version 3 or any later version approved by the KDE Free
773+** Qt Foundation. The licenses are as published by the Free Software
774+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
775+** included in the packaging of this file. Please review the following
776+** information to ensure the GNU General Public License requirements will
777+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
778+** https://www.gnu.org/licenses/gpl-3.0.html.
779+**
780+** $QT_END_LICENSE$
781+**
782+****************************************************************************/
783+
784+
785+#include "qmirclientcursor.h"
786+
787+#include "qmirclientlogging.h"
788+#include "qmirclientwindow.h"
789
790 #include <mir_toolkit/mir_client_library.h>
791
792-Q_LOGGING_CATEGORY(ubuntumirclientCursor, "ubuntumirclient.cursor", QtWarningMsg)
793+Q_LOGGING_CATEGORY(mirclientCursor, "qt.qpa.mirclient.cursor", QtWarningMsg)
794
795-UbuntuCursor::UbuntuCursor(MirConnection *connection)
796+QMirClientCursor::QMirClientCursor(MirConnection *connection)
797 : mConnection(connection)
798 {
799 /*
800@@ -58,7 +82,7 @@
801 namespace {
802 const char *qtCursorShapeToStr(Qt::CursorShape shape)
803 {
804- switch(shape) {
805+ switch (shape) {
806 case Qt::ArrowCursor:
807 return "Arrow";
808 case Qt::UpArrowCursor:
809@@ -111,13 +135,13 @@
810 }
811 } // anonymous namespace
812
813-void UbuntuCursor::changeCursor(QCursor *windowCursor, QWindow *window)
814+void QMirClientCursor::changeCursor(QCursor *windowCursor, QWindow *window)
815 {
816 if (!window) {
817 return;
818 }
819
820- MirSurface *surface = static_cast<UbuntuWindow*>(window->handle())->mirSurface();
821+ MirSurface *surface = static_cast<QMirClientWindow*>(window->handle())->mirSurface();
822
823 if (!surface) {
824 return;
825@@ -125,7 +149,7 @@
826
827
828 if (windowCursor) {
829- qCDebug(ubuntumirclientCursor, "changeCursor shape=%s, window=%p", qtCursorShapeToStr(windowCursor->shape()), window);
830+ qCDebug(mirclientCursor, "changeCursor shape=%s, window=%p", qtCursorShapeToStr(windowCursor->shape()), window);
831 if (!windowCursor->pixmap().isNull()) {
832 configureMirCursorWithPixmapQCursor(surface, *windowCursor);
833 } else if (windowCursor->shape() == Qt::BitmapCursor) {
834@@ -143,7 +167,7 @@
835
836 }
837
838-void UbuntuCursor::configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor)
839+void QMirClientCursor::configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor)
840 {
841 QImage image = cursor.pixmap().toImage();
842
843@@ -177,7 +201,7 @@
844 mir_buffer_stream_release_sync(bufferStream);
845 }
846
847-void UbuntuCursor::applyDefaultCursorConfiguration(MirSurface *surface)
848+void QMirClientCursor::applyDefaultCursorConfiguration(MirSurface *surface)
849 {
850 auto cursorConfiguration = mir_cursor_configuration_from_name("left_ptr");
851 mir_surface_configure_cursor(surface, cursorConfiguration);
852
853=== renamed file 'src/ubuntumirclient/cursor.h' => 'src/ubuntumirclient/qmirclientcursor.h'
854--- src/ubuntumirclient/cursor.h 2015-11-11 18:58:44 +0000
855+++ src/ubuntumirclient/qmirclientcursor.h 2017-02-08 16:34:34 +0000
856@@ -1,21 +1,45 @@
857-/*
858- * Copyright (C) 2015 Canonical, Ltd.
859- *
860- * This program is free software: you can redistribute it and/or modify it under
861- * the terms of the GNU Lesser General Public License version 3, as published by
862- * the Free Software Foundation.
863- *
864- * This program is distributed in the hope that it will be useful, but WITHOUT
865- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
866- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
867- * Lesser General Public License for more details.
868- *
869- * You should have received a copy of the GNU Lesser General Public License
870- * along with this program. If not, see <http://www.gnu.org/licenses/>.
871- */
872-
873-#ifndef UBUNTU_CURSOR_H
874-#define UBUNTU_CURSOR_H
875+/****************************************************************************
876+**
877+** Copyright (C) 2015-2016 Canonical, Ltd.
878+** Contact: https://www.qt.io/licensing/
879+**
880+** This file is part of the plugins of the Qt Toolkit.
881+**
882+** $QT_BEGIN_LICENSE:LGPL$
883+** Commercial License Usage
884+** Licensees holding valid commercial Qt licenses may use this file in
885+** accordance with the commercial license agreement provided with the
886+** Software or, alternatively, in accordance with the terms contained in
887+** a written agreement between you and The Qt Company. For licensing terms
888+** and conditions see https://www.qt.io/terms-conditions. For further
889+** information use the contact form at https://www.qt.io/contact-us.
890+**
891+** GNU Lesser General Public License Usage
892+** Alternatively, this file may be used under the terms of the GNU Lesser
893+** General Public License version 3 as published by the Free Software
894+** Foundation and appearing in the file LICENSE.LGPL3 included in the
895+** packaging of this file. Please review the following information to
896+** ensure the GNU Lesser General Public License version 3 requirements
897+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
898+**
899+** GNU General Public License Usage
900+** Alternatively, this file may be used under the terms of the GNU
901+** General Public License version 2.0 or (at your option) the GNU General
902+** Public license version 3 or any later version approved by the KDE Free
903+** Qt Foundation. The licenses are as published by the Free Software
904+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
905+** included in the packaging of this file. Please review the following
906+** information to ensure the GNU General Public License requirements will
907+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
908+** https://www.gnu.org/licenses/gpl-3.0.html.
909+**
910+** $QT_END_LICENSE$
911+**
912+****************************************************************************/
913+
914+
915+#ifndef QMIRCLIENTCURSOR_H
916+#define QMIRCLIENTCURSOR_H
917
918 #include <qpa/qplatformcursor.h>
919
920@@ -25,10 +49,10 @@
921 struct MirConnection;
922 struct MirSurface;
923
924-class UbuntuCursor : public QPlatformCursor
925+class QMirClientCursor : public QPlatformCursor
926 {
927 public:
928- UbuntuCursor(MirConnection *connection);
929+ QMirClientCursor(MirConnection *connection);
930 void changeCursor(QCursor *windowCursor, QWindow *window) override;
931 private:
932 void configureMirCursorWithPixmapQCursor(MirSurface *surface, QCursor &cursor);
933@@ -37,4 +61,4 @@
934 MirConnection *mConnection;
935 };
936
937-#endif // UBUNTU_CURSOR_H
938+#endif // QMIRCLIENTCURSOR_H
939
940=== renamed file 'src/ubuntumirclient/debugextension.cpp' => 'src/ubuntumirclient/qmirclientdebugextension.cpp'
941--- src/ubuntumirclient/debugextension.cpp 2016-12-01 22:28:20 +0000
942+++ src/ubuntumirclient/qmirclientdebugextension.cpp 2017-02-08 16:34:34 +0000
943@@ -1,50 +1,74 @@
944-/*
945- * Copyright (C) 2016 Canonical, Ltd.
946- *
947- * This program is free software: you can redistribute it and/or modify it under
948- * the terms of the GNU Lesser General Public License version 3, as published by
949- * the Free Software Foundation.
950- *
951- * This program is distributed in the hope that it will be useful, but WITHOUT
952- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
953- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
954- * Lesser General Public License for more details.
955- *
956- * You should have received a copy of the GNU Lesser General Public License
957- * along with this program. If not, see <http://www.gnu.org/licenses/>.
958- */
959-
960-#include "debugextension.h"
961-
962-#include "logging.h"
963+/****************************************************************************
964+**
965+** Copyright (C) 2016 Canonical, Ltd.
966+** Contact: https://www.qt.io/licensing/
967+**
968+** This file is part of the plugins of the Qt Toolkit.
969+**
970+** $QT_BEGIN_LICENSE:LGPL$
971+** Commercial License Usage
972+** Licensees holding valid commercial Qt licenses may use this file in
973+** accordance with the commercial license agreement provided with the
974+** Software or, alternatively, in accordance with the terms contained in
975+** a written agreement between you and The Qt Company. For licensing terms
976+** and conditions see https://www.qt.io/terms-conditions. For further
977+** information use the contact form at https://www.qt.io/contact-us.
978+**
979+** GNU Lesser General Public License Usage
980+** Alternatively, this file may be used under the terms of the GNU Lesser
981+** General Public License version 3 as published by the Free Software
982+** Foundation and appearing in the file LICENSE.LGPL3 included in the
983+** packaging of this file. Please review the following information to
984+** ensure the GNU Lesser General Public License version 3 requirements
985+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
986+**
987+** GNU General Public License Usage
988+** Alternatively, this file may be used under the terms of the GNU
989+** General Public License version 2.0 or (at your option) the GNU General
990+** Public license version 3 or any later version approved by the KDE Free
991+** Qt Foundation. The licenses are as published by the Free Software
992+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
993+** included in the packaging of this file. Please review the following
994+** information to ensure the GNU General Public License requirements will
995+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
996+** https://www.gnu.org/licenses/gpl-3.0.html.
997+**
998+** $QT_END_LICENSE$
999+**
1000+****************************************************************************/
1001+
1002+
1003+#include "qmirclientdebugextension.h"
1004+
1005+#include "qmirclientlogging.h"
1006
1007 // mir client debug
1008 #include <mir_toolkit/debug/surface.h>
1009
1010-Q_LOGGING_CATEGORY(ubuntumirclientDebug, "ubuntumirclient.debug")
1011+Q_LOGGING_CATEGORY(mirclientDebug, "qt.qpa.mirclient.debug")
1012
1013-UbuntuDebugExtension::UbuntuDebugExtension()
1014+QMirClientDebugExtension::QMirClientDebugExtension()
1015 : m_mirclientDebug(QStringLiteral("mirclient-debug-extension"), 1)
1016 , m_mapper(nullptr)
1017 {
1018- qCDebug(ubuntumirclientDebug) << "NOTICE: Loading mirclient-debug-extension";
1019+ qCDebug(mirclientDebug) << "NOTICE: Loading mirclient-debug-extension";
1020 m_mapper = (MapperPrototype) m_mirclientDebug.resolve("mir_debug_surface_coords_to_screen");
1021
1022 if (!m_mirclientDebug.isLoaded()) {
1023- qCWarning(ubuntumirclientDebug) << "ERROR: mirclient-debug-extension failed to load:"
1024- << m_mirclientDebug.errorString();
1025+ qCWarning(mirclientDebug) << "ERROR: mirclient-debug-extension failed to load:"
1026+ << m_mirclientDebug.errorString();
1027 } else if (!m_mapper) {
1028- qCWarning(ubuntumirclientDebug) << "ERROR: unable to find required symbols in mirclient-debug-extension:"
1029- << m_mirclientDebug.errorString();
1030+ qCWarning(mirclientDebug) << "ERROR: unable to find required symbols in mirclient-debug-extension:"
1031+ << m_mirclientDebug.errorString();
1032 }
1033 }
1034
1035-bool UbuntuDebugExtension::isEnabled() const
1036+bool QMirClientDebugExtension::isEnabled() const
1037 {
1038 return m_mirclientDebug.isLoaded() && m_mapper;
1039 }
1040
1041-QPoint UbuntuDebugExtension::mapSurfacePointToScreen(MirSurface *surface, const QPoint &point)
1042+QPoint QMirClientDebugExtension::mapSurfacePointToScreen(MirSurface *surface, const QPoint &point)
1043 {
1044 if (!m_mapper) {
1045 return point;
1046
1047=== renamed file 'src/ubuntumirclient/debugextension.h' => 'src/ubuntumirclient/qmirclientdebugextension.h'
1048--- src/ubuntumirclient/debugextension.h 2016-12-01 22:28:20 +0000
1049+++ src/ubuntumirclient/qmirclientdebugextension.h 2017-02-08 16:34:34 +0000
1050@@ -1,21 +1,45 @@
1051-/*
1052- * Copyright (C) 2016 Canonical, Ltd.
1053- *
1054- * This program is free software: you can redistribute it and/or modify it under
1055- * the terms of the GNU Lesser General Public License version 3, as published by
1056- * the Free Software Foundation.
1057- *
1058- * This program is distributed in the hope that it will be useful, but WITHOUT
1059- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1060- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1061- * Lesser General Public License for more details.
1062- *
1063- * You should have received a copy of the GNU Lesser General Public License
1064- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1065- */
1066-
1067-#ifndef UBUNTU_DEBUG_EXTENSION_H
1068-#define UBUNTU_DEBUG_EXTENSION_H
1069+/****************************************************************************
1070+**
1071+** Copyright (C) 2016 Canonical, Ltd.
1072+** Contact: https://www.qt.io/licensing/
1073+**
1074+** This file is part of the plugins of the Qt Toolkit.
1075+**
1076+** $QT_BEGIN_LICENSE:LGPL$
1077+** Commercial License Usage
1078+** Licensees holding valid commercial Qt licenses may use this file in
1079+** accordance with the commercial license agreement provided with the
1080+** Software or, alternatively, in accordance with the terms contained in
1081+** a written agreement between you and The Qt Company. For licensing terms
1082+** and conditions see https://www.qt.io/terms-conditions. For further
1083+** information use the contact form at https://www.qt.io/contact-us.
1084+**
1085+** GNU Lesser General Public License Usage
1086+** Alternatively, this file may be used under the terms of the GNU Lesser
1087+** General Public License version 3 as published by the Free Software
1088+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1089+** packaging of this file. Please review the following information to
1090+** ensure the GNU Lesser General Public License version 3 requirements
1091+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1092+**
1093+** GNU General Public License Usage
1094+** Alternatively, this file may be used under the terms of the GNU
1095+** General Public License version 2.0 or (at your option) the GNU General
1096+** Public license version 3 or any later version approved by the KDE Free
1097+** Qt Foundation. The licenses are as published by the Free Software
1098+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1099+** included in the packaging of this file. Please review the following
1100+** information to ensure the GNU General Public License requirements will
1101+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1102+** https://www.gnu.org/licenses/gpl-3.0.html.
1103+**
1104+** $QT_END_LICENSE$
1105+**
1106+****************************************************************************/
1107+
1108+
1109+#ifndef QMIRCLIENTDEBUGEXTENSION_H
1110+#define QMIRCLIENTDEBUGEXTENSION_H
1111
1112 #include <QPoint>
1113 #include <QLibrary>
1114@@ -24,10 +48,10 @@
1115 typedef bool (*MapperPrototype)(MirSurface* surface, int x, int y, int* screenX, int* screenY);
1116
1117
1118-class UbuntuDebugExtension
1119+class QMirClientDebugExtension
1120 {
1121 public:
1122- UbuntuDebugExtension();
1123+ QMirClientDebugExtension();
1124
1125 bool isEnabled() const;
1126
1127@@ -38,4 +62,4 @@
1128 MapperPrototype m_mapper;
1129 };
1130
1131-#endif // UBUNTU_DEBUG_EXTENSION_H
1132+#endif // QMIRCLIENTDEBUGEXTENSION_H
1133
1134=== renamed file 'src/ubuntumirclient/desktopwindow.cpp' => 'src/ubuntumirclient/qmirclientdesktopwindow.cpp'
1135--- src/ubuntumirclient/desktopwindow.cpp 2016-10-04 16:20:07 +0000
1136+++ src/ubuntumirclient/qmirclientdesktopwindow.cpp 2017-02-08 16:34:34 +0000
1137@@ -1,26 +1,50 @@
1138-/*
1139- * Copyright (C) 2016 Canonical, Ltd.
1140- *
1141- * This program is free software: you can redistribute it and/or modify it under
1142- * the terms of the GNU Lesser General Public License version 3, as published by
1143- * the Free Software Foundation.
1144- *
1145- * This program is distributed in the hope that it will be useful, but WITHOUT
1146- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1147- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1148- * Lesser General Public License for more details.
1149- *
1150- * You should have received a copy of the GNU Lesser General Public License
1151- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1152- */
1153-
1154-#include "desktopwindow.h"
1155+/****************************************************************************
1156+**
1157+** Copyright (C) 2016 Canonical, Ltd.
1158+** Contact: https://www.qt.io/licensing/
1159+**
1160+** This file is part of the plugins of the Qt Toolkit.
1161+**
1162+** $QT_BEGIN_LICENSE:LGPL$
1163+** Commercial License Usage
1164+** Licensees holding valid commercial Qt licenses may use this file in
1165+** accordance with the commercial license agreement provided with the
1166+** Software or, alternatively, in accordance with the terms contained in
1167+** a written agreement between you and The Qt Company. For licensing terms
1168+** and conditions see https://www.qt.io/terms-conditions. For further
1169+** information use the contact form at https://www.qt.io/contact-us.
1170+**
1171+** GNU Lesser General Public License Usage
1172+** Alternatively, this file may be used under the terms of the GNU Lesser
1173+** General Public License version 3 as published by the Free Software
1174+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1175+** packaging of this file. Please review the following information to
1176+** ensure the GNU Lesser General Public License version 3 requirements
1177+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1178+**
1179+** GNU General Public License Usage
1180+** Alternatively, this file may be used under the terms of the GNU
1181+** General Public License version 2.0 or (at your option) the GNU General
1182+** Public license version 3 or any later version approved by the KDE Free
1183+** Qt Foundation. The licenses are as published by the Free Software
1184+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1185+** included in the packaging of this file. Please review the following
1186+** information to ensure the GNU General Public License requirements will
1187+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1188+** https://www.gnu.org/licenses/gpl-3.0.html.
1189+**
1190+** $QT_END_LICENSE$
1191+**
1192+****************************************************************************/
1193+
1194+
1195+#include "qmirclientdesktopwindow.h"
1196
1197 // local
1198-#include "logging.h"
1199+#include "qmirclientlogging.h"
1200
1201-UbuntuDesktopWindow::UbuntuDesktopWindow(QWindow *window)
1202+QMirClientDesktopWindow::QMirClientDesktopWindow(QWindow *window)
1203 : QPlatformWindow(window)
1204 {
1205- qCDebug(ubuntumirclient, "UbuntuDesktopWindow(window=%p)", window);
1206+ qCDebug(mirclient, "QMirClientDesktopWindow(window=%p)", window);
1207 }
1208
1209=== renamed file 'src/ubuntumirclient/desktopwindow.h' => 'src/ubuntumirclient/qmirclientdesktopwindow.h'
1210--- src/ubuntumirclient/desktopwindow.h 2016-10-04 16:20:07 +0000
1211+++ src/ubuntumirclient/qmirclientdesktopwindow.h 2017-02-08 16:34:34 +0000
1212@@ -1,29 +1,53 @@
1213-/*
1214- * Copyright (C) 2016 Canonical, Ltd.
1215- *
1216- * This program is free software: you can redistribute it and/or modify it under
1217- * the terms of the GNU Lesser General Public License version 3, as published by
1218- * the Free Software Foundation.
1219- *
1220- * This program is distributed in the hope that it will be useful, but WITHOUT
1221- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1222- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1223- * Lesser General Public License for more details.
1224- *
1225- * You should have received a copy of the GNU Lesser General Public License
1226- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1227- */
1228-
1229-#ifndef UBUNTU_DESKTOP_WINDOW_H
1230-#define UBUNTU_DESKTOP_WINDOW_H
1231+/****************************************************************************
1232+**
1233+** Copyright (C) 2016 Canonical, Ltd.
1234+** Contact: https://www.qt.io/licensing/
1235+**
1236+** This file is part of the plugins of the Qt Toolkit.
1237+**
1238+** $QT_BEGIN_LICENSE:LGPL$
1239+** Commercial License Usage
1240+** Licensees holding valid commercial Qt licenses may use this file in
1241+** accordance with the commercial license agreement provided with the
1242+** Software or, alternatively, in accordance with the terms contained in
1243+** a written agreement between you and The Qt Company. For licensing terms
1244+** and conditions see https://www.qt.io/terms-conditions. For further
1245+** information use the contact form at https://www.qt.io/contact-us.
1246+**
1247+** GNU Lesser General Public License Usage
1248+** Alternatively, this file may be used under the terms of the GNU Lesser
1249+** General Public License version 3 as published by the Free Software
1250+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1251+** packaging of this file. Please review the following information to
1252+** ensure the GNU Lesser General Public License version 3 requirements
1253+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1254+**
1255+** GNU General Public License Usage
1256+** Alternatively, this file may be used under the terms of the GNU
1257+** General Public License version 2.0 or (at your option) the GNU General
1258+** Public license version 3 or any later version approved by the KDE Free
1259+** Qt Foundation. The licenses are as published by the Free Software
1260+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1261+** included in the packaging of this file. Please review the following
1262+** information to ensure the GNU General Public License requirements will
1263+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1264+** https://www.gnu.org/licenses/gpl-3.0.html.
1265+**
1266+** $QT_END_LICENSE$
1267+**
1268+****************************************************************************/
1269+
1270+
1271+#ifndef QMIRCLIENTDESKTOPWINDOW_H
1272+#define QMIRCLIENTDESKTOPWINDOW_H
1273
1274 #include <qpa/qplatformwindow.h>
1275
1276 // TODO Implement it. For now it's just an empty, dummy class.
1277-class UbuntuDesktopWindow : public QPlatformWindow
1278+class QMirClientDesktopWindow : public QPlatformWindow
1279 {
1280 public:
1281- UbuntuDesktopWindow(QWindow*);
1282+ QMirClientDesktopWindow(QWindow*);
1283 };
1284
1285-#endif // UBUNTU_DESKTOP_WINDOW_H
1286+#endif // QMIRCLIENTDESKTOPWINDOW_H
1287
1288=== renamed file 'src/ubuntumirclient/glcontext.cpp' => 'src/ubuntumirclient/qmirclientglcontext.cpp'
1289--- src/ubuntumirclient/glcontext.cpp 2016-12-09 17:02:57 +0000
1290+++ src/ubuntumirclient/qmirclientglcontext.cpp 2017-02-08 16:34:34 +0000
1291@@ -1,29 +1,53 @@
1292-/*
1293- * Copyright (C) 2014-2016 Canonical, Ltd.
1294- *
1295- * This program is free software: you can redistribute it and/or modify it under
1296- * the terms of the GNU Lesser General Public License version 3, as published by
1297- * the Free Software Foundation.
1298- *
1299- * This program is distributed in the hope that it will be useful, but WITHOUT
1300- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1301- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1302- * Lesser General Public License for more details.
1303- *
1304- * You should have received a copy of the GNU Lesser General Public License
1305- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1306- */
1307-
1308-#include "glcontext.h"
1309-#include "logging.h"
1310-#include "window.h"
1311+/****************************************************************************
1312+**
1313+** Copyright (C) 2016 Canonical, Ltd.
1314+** Contact: https://www.qt.io/licensing/
1315+**
1316+** This file is part of the plugins of the Qt Toolkit.
1317+**
1318+** $QT_BEGIN_LICENSE:LGPL$
1319+** Commercial License Usage
1320+** Licensees holding valid commercial Qt licenses may use this file in
1321+** accordance with the commercial license agreement provided with the
1322+** Software or, alternatively, in accordance with the terms contained in
1323+** a written agreement between you and The Qt Company. For licensing terms
1324+** and conditions see https://www.qt.io/terms-conditions. For further
1325+** information use the contact form at https://www.qt.io/contact-us.
1326+**
1327+** GNU Lesser General Public License Usage
1328+** Alternatively, this file may be used under the terms of the GNU Lesser
1329+** General Public License version 3 as published by the Free Software
1330+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1331+** packaging of this file. Please review the following information to
1332+** ensure the GNU Lesser General Public License version 3 requirements
1333+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1334+**
1335+** GNU General Public License Usage
1336+** Alternatively, this file may be used under the terms of the GNU
1337+** General Public License version 2.0 or (at your option) the GNU General
1338+** Public license version 3 or any later version approved by the KDE Free
1339+** Qt Foundation. The licenses are as published by the Free Software
1340+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1341+** included in the packaging of this file. Please review the following
1342+** information to ensure the GNU General Public License requirements will
1343+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1344+** https://www.gnu.org/licenses/gpl-3.0.html.
1345+**
1346+** $QT_END_LICENSE$
1347+**
1348+****************************************************************************/
1349+
1350+
1351+#include "qmirclientglcontext.h"
1352+#include "qmirclientlogging.h"
1353+#include "qmirclientwindow.h"
1354
1355 #include <QOpenGLFramebufferObject>
1356 #include <QtPlatformSupport/private/qeglconvenience_p.h>
1357 #include <QtPlatformSupport/private/qeglpbuffer_p.h>
1358 #include <QtGui/private/qopenglcontext_p.h>
1359
1360-Q_LOGGING_CATEGORY(ubuntumirclientGraphics, "ubuntumirclient.graphics", QtWarningMsg)
1361+Q_LOGGING_CATEGORY(mirclientGraphics, "qt.qpa.mirclient.graphics", QtWarningMsg)
1362
1363 namespace {
1364
1365@@ -33,25 +57,25 @@
1366 Q_ASSERT(config != nullptr);
1367
1368 const char *string = eglQueryString(display, EGL_VENDOR);
1369- qCDebug(ubuntumirclientGraphics, "EGL vendor: %s", string);
1370+ qCDebug(mirclientGraphics, "EGL vendor: %s", string);
1371
1372 string = eglQueryString(display, EGL_VERSION);
1373- qCDebug(ubuntumirclientGraphics, "EGL version: %s", string);
1374+ qCDebug(mirclientGraphics, "EGL version: %s", string);
1375
1376 string = eglQueryString(display, EGL_EXTENSIONS);
1377- qCDebug(ubuntumirclientGraphics, "EGL extensions: %s", string);
1378+ qCDebug(mirclientGraphics, "EGL extensions: %s", string);
1379
1380- qCDebug(ubuntumirclientGraphics, "EGL configuration attributes:");
1381+ qCDebug(mirclientGraphics, "EGL configuration attributes:");
1382 q_printEglConfig(display, config);
1383 }
1384
1385 } // anonymous namespace
1386
1387-UbuntuOpenGLContext::UbuntuOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
1388+QMirClientOpenGLContext::QMirClientOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
1389 EGLDisplay display)
1390 : QEGLPlatformContext(format, share, display, 0)
1391 {
1392- if (ubuntumirclientGraphics().isDebugEnabled()) {
1393+ if (mirclientGraphics().isDebugEnabled()) {
1394 printEglConfig(display, eglConfig());
1395 }
1396 }
1397@@ -72,7 +96,7 @@
1398 return needsWorkaround;
1399 }
1400
1401-bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface)
1402+bool QMirClientOpenGLContext::makeCurrent(QPlatformSurface* surface)
1403 {
1404 const bool ret = QEGLPlatformContext::makeCurrent(surface);
1405
1406@@ -86,23 +110,23 @@
1407 }
1408
1409 // Following method used internally in the base class QEGLPlatformContext to access
1410-// the egl surface of a QPlatformSurface/UbuntuWindow
1411-EGLSurface UbuntuOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
1412+// the egl surface of a QPlatformSurface/QMirClientWindow
1413+EGLSurface QMirClientOpenGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
1414 {
1415 if (surface->surface()->surfaceClass() == QSurface::Window) {
1416- return static_cast<UbuntuWindow *>(surface)->eglSurface();
1417+ return static_cast<QMirClientWindow *>(surface)->eglSurface();
1418 } else {
1419 return static_cast<QEGLPbuffer *>(surface)->pbuffer();
1420 }
1421 }
1422
1423-void UbuntuOpenGLContext::swapBuffers(QPlatformSurface *surface)
1424+void QMirClientOpenGLContext::swapBuffers(QPlatformSurface *surface)
1425 {
1426 QEGLPlatformContext::swapBuffers(surface);
1427
1428 if (surface->surface()->surfaceClass() == QSurface::Window) {
1429 // notify window on swap completion
1430- auto ubuntuWindow = static_cast<UbuntuWindow *>(surface);
1431- ubuntuWindow->onSwapBuffersDone();
1432+ auto platformWindow = static_cast<QMirClientWindow *>(surface);
1433+ platformWindow->onSwapBuffersDone();
1434 }
1435 }
1436
1437=== renamed file 'src/ubuntumirclient/glcontext.h' => 'src/ubuntumirclient/qmirclientglcontext.h'
1438--- src/ubuntumirclient/glcontext.h 2016-07-21 11:55:40 +0000
1439+++ src/ubuntumirclient/qmirclientglcontext.h 2017-02-08 16:34:34 +0000
1440@@ -1,31 +1,55 @@
1441-/*
1442- * Copyright (C) 2014,2016 Canonical, Ltd.
1443- *
1444- * This program is free software: you can redistribute it and/or modify it under
1445- * the terms of the GNU Lesser General Public License version 3, as published by
1446- * the Free Software Foundation.
1447- *
1448- * This program is distributed in the hope that it will be useful, but WITHOUT
1449- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1450- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1451- * Lesser General Public License for more details.
1452- *
1453- * You should have received a copy of the GNU Lesser General Public License
1454- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1455- */
1456-
1457-#ifndef UBUNTU_OPENGL_CONTEXT_H
1458-#define UBUNTU_OPENGL_CONTEXT_H
1459+/****************************************************************************
1460+**
1461+** Copyright (C) 2016 Canonical, Ltd.
1462+** Contact: https://www.qt.io/licensing/
1463+**
1464+** This file is part of the plugins of the Qt Toolkit.
1465+**
1466+** $QT_BEGIN_LICENSE:LGPL$
1467+** Commercial License Usage
1468+** Licensees holding valid commercial Qt licenses may use this file in
1469+** accordance with the commercial license agreement provided with the
1470+** Software or, alternatively, in accordance with the terms contained in
1471+** a written agreement between you and The Qt Company. For licensing terms
1472+** and conditions see https://www.qt.io/terms-conditions. For further
1473+** information use the contact form at https://www.qt.io/contact-us.
1474+**
1475+** GNU Lesser General Public License Usage
1476+** Alternatively, this file may be used under the terms of the GNU Lesser
1477+** General Public License version 3 as published by the Free Software
1478+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1479+** packaging of this file. Please review the following information to
1480+** ensure the GNU Lesser General Public License version 3 requirements
1481+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1482+**
1483+** GNU General Public License Usage
1484+** Alternatively, this file may be used under the terms of the GNU
1485+** General Public License version 2.0 or (at your option) the GNU General
1486+** Public license version 3 or any later version approved by the KDE Free
1487+** Qt Foundation. The licenses are as published by the Free Software
1488+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1489+** included in the packaging of this file. Please review the following
1490+** information to ensure the GNU General Public License requirements will
1491+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1492+** https://www.gnu.org/licenses/gpl-3.0.html.
1493+**
1494+** $QT_END_LICENSE$
1495+**
1496+****************************************************************************/
1497+
1498+
1499+#ifndef QMIRCLIENTGLCONTEXT_H
1500+#define QMIRCLIENTGLCONTEXT_H
1501
1502 #include <qpa/qplatformopenglcontext.h>
1503-#include <private/qeglplatformcontext_p.h>
1504+#include <QtPlatformSupport/private/qeglplatformcontext_p.h>
1505
1506 #include <EGL/egl.h>
1507
1508-class UbuntuOpenGLContext : public QEGLPlatformContext
1509+class QMirClientOpenGLContext : public QEGLPlatformContext
1510 {
1511 public:
1512- UbuntuOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
1513+ QMirClientOpenGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share,
1514 EGLDisplay display);
1515
1516 // QEGLPlatformContext methods.
1517@@ -36,4 +60,4 @@
1518 EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) final;
1519 };
1520
1521-#endif // UBUNTU_OPENGL_CONTEXT_H
1522+#endif // QMIRCLIENTGLCONTEXT_H
1523
1524=== renamed file 'src/ubuntumirclient/input.cpp' => 'src/ubuntumirclient/qmirclientinput.cpp'
1525--- src/ubuntumirclient/input.cpp 2017-01-10 06:41:48 +0000
1526+++ src/ubuntumirclient/qmirclientinput.cpp 2017-02-08 16:34:34 +0000
1527@@ -1,33 +1,57 @@
1528-/*
1529- * Copyright (C) 2014-2016 Canonical, Ltd.
1530- *
1531- * This program is free software: you can redistribute it and/or modify it under
1532- * the terms of the GNU Lesser General Public License version 3, as published by
1533- * the Free Software Foundation.
1534- *
1535- * This program is distributed in the hope that it will be useful, but WITHOUT
1536- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1537- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1538- * Lesser General Public License for more details.
1539- *
1540- * You should have received a copy of the GNU Lesser General Public License
1541- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1542- */
1543+/****************************************************************************
1544+**
1545+** Copyright (C) 2014-2016 Canonical, Ltd.
1546+** Contact: https://www.qt.io/licensing/
1547+**
1548+** This file is part of the plugins of the Qt Toolkit.
1549+**
1550+** $QT_BEGIN_LICENSE:LGPL$
1551+** Commercial License Usage
1552+** Licensees holding valid commercial Qt licenses may use this file in
1553+** accordance with the commercial license agreement provided with the
1554+** Software or, alternatively, in accordance with the terms contained in
1555+** a written agreement between you and The Qt Company. For licensing terms
1556+** and conditions see https://www.qt.io/terms-conditions. For further
1557+** information use the contact form at https://www.qt.io/contact-us.
1558+**
1559+** GNU Lesser General Public License Usage
1560+** Alternatively, this file may be used under the terms of the GNU Lesser
1561+** General Public License version 3 as published by the Free Software
1562+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1563+** packaging of this file. Please review the following information to
1564+** ensure the GNU Lesser General Public License version 3 requirements
1565+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1566+**
1567+** GNU General Public License Usage
1568+** Alternatively, this file may be used under the terms of the GNU
1569+** General Public License version 2.0 or (at your option) the GNU General
1570+** Public license version 3 or any later version approved by the KDE Free
1571+** Qt Foundation. The licenses are as published by the Free Software
1572+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1573+** included in the packaging of this file. Please review the following
1574+** information to ensure the GNU General Public License requirements will
1575+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1576+** https://www.gnu.org/licenses/gpl-3.0.html.
1577+**
1578+** $QT_END_LICENSE$
1579+**
1580+****************************************************************************/
1581+
1582
1583 // Local
1584-#include "input.h"
1585-#include "integration.h"
1586-#include "nativeinterface.h"
1587-#include "screen.h"
1588-#include "window.h"
1589-#include "logging.h"
1590-#include "orientationchangeevent_p.h"
1591+#include "qmirclientinput.h"
1592+#include "qmirclientintegration.h"
1593+#include "qmirclientnativeinterface.h"
1594+#include "qmirclientscreen.h"
1595+#include "qmirclientwindow.h"
1596+#include "qmirclientlogging.h"
1597+#include "qmirclientorientationchangeevent_p.h"
1598
1599 // Qt
1600 #include <QtCore/QThread>
1601 #include <QtCore/qglobal.h>
1602 #include <QtCore/QCoreApplication>
1603-#include <private/qguiapplication_p.h>
1604+#include <QtGui/private/qguiapplication_p.h>
1605 #include <qpa/qplatforminputcontext.h>
1606 #include <qpa/qwindowsysteminterface.h>
1607 #include <QTextCodec>
1608@@ -37,7 +61,7 @@
1609
1610 #include <mir_toolkit/mir_client_library.h>
1611
1612-Q_LOGGING_CATEGORY(ubuntumirclientInput, "ubuntumirclient.input", QtWarningMsg)
1613+Q_LOGGING_CATEGORY(mirclientInput, "qt.qpa.mirclient.input", QtWarningMsg)
1614
1615 namespace
1616 {
1617@@ -169,7 +193,7 @@
1618 class UbuntuEvent : public QEvent
1619 {
1620 public:
1621- UbuntuEvent(UbuntuWindow* window, const MirEvent *event, QEvent::Type type)
1622+ UbuntuEvent(QMirClientWindow* window, const MirEvent *event, QEvent::Type type)
1623 : QEvent(type), window(window) {
1624 nativeEvent = mir_event_ref(event);
1625 }
1626@@ -178,14 +202,14 @@
1627 mir_event_unref(nativeEvent);
1628 }
1629
1630- QPointer<UbuntuWindow> window;
1631+ QPointer<QMirClientWindow> window;
1632 const MirEvent *nativeEvent;
1633 };
1634
1635-UbuntuInput::UbuntuInput(UbuntuClientIntegration* integration)
1636+QMirClientInput::QMirClientInput(QMirClientClientIntegration* integration)
1637 : QObject(nullptr)
1638 , mIntegration(integration)
1639- , mEventFilterType(static_cast<UbuntuNativeInterface*>(
1640+ , mEventFilterType(static_cast<QMirClientNativeInterface*>(
1641 integration->nativeInterface())->genericEventFilterType())
1642 , mEventType(static_cast<QEvent::Type>(QEvent::registerEventType()))
1643 , mLastInputWindow(nullptr)
1644@@ -199,7 +223,7 @@
1645 QWindowSystemInterface::registerTouchDevice(mTouchDevice);
1646 }
1647
1648-UbuntuInput::~UbuntuInput()
1649+QMirClientInput::~QMirClientInput()
1650 {
1651 // Qt will take care of deleting mTouchDevice.
1652 }
1653@@ -238,14 +262,14 @@
1654 Q_UNREACHABLE();
1655 }
1656
1657-void UbuntuInput::customEvent(QEvent* event)
1658+void QMirClientInput::customEvent(QEvent* event)
1659 {
1660 Q_ASSERT(QThread::currentThread() == thread());
1661 UbuntuEvent* ubuntuEvent = static_cast<UbuntuEvent*>(event);
1662 const MirEvent *nativeEvent = ubuntuEvent->nativeEvent;
1663
1664 if ((ubuntuEvent->window == nullptr) || (ubuntuEvent->window->window() == nullptr)) {
1665- qCWarning(ubuntumirclient) << "Attempted to deliver an event to a non-existent window, ignoring.";
1666+ qCWarning(mirclient) << "Attempted to deliver an event to a non-existent window, ignoring.";
1667 return;
1668 }
1669
1670@@ -254,11 +278,11 @@
1671 if (QWindowSystemInterface::handleNativeEvent(
1672 ubuntuEvent->window->window(), mEventFilterType,
1673 const_cast<void *>(static_cast<const void *>(nativeEvent)), &result) == true) {
1674- qCDebug(ubuntumirclient, "event filtered out by native interface");
1675+ qCDebug(mirclient, "event filtered out by native interface");
1676 return;
1677 }
1678
1679- qCDebug(ubuntumirclientInput, "customEvent(type=%s)", nativeEventTypeToStr(mir_event_get_type(nativeEvent)));
1680+ qCDebug(mirclientInput, "customEvent(type=%s)", nativeEventTypeToStr(mir_event_get_type(nativeEvent)));
1681
1682 // Event dispatching.
1683 switch (mir_event_get_type(nativeEvent))
1684@@ -273,7 +297,7 @@
1685 // Enable workaround for Screen rotation
1686 auto const targetWindow = ubuntuEvent->window;
1687 if (targetWindow) {
1688- auto const screen = static_cast<UbuntuScreen*>(targetWindow->screen());
1689+ auto const screen = static_cast<QMirClientScreen*>(targetWindow->screen());
1690 if (screen) {
1691 screen->handleWindowSurfaceResize(
1692 mir_resize_event_get_width(resizeEvent),
1693@@ -299,11 +323,11 @@
1694 QWindowSystemInterface::handleCloseEvent(ubuntuEvent->window->window());
1695 break;
1696 default:
1697- qCDebug(ubuntumirclient, "unhandled event type: %d", static_cast<int>(mir_event_get_type(nativeEvent)));
1698+ qCDebug(mirclient, "unhandled event type: %d", static_cast<int>(mir_event_get_type(nativeEvent)));
1699 }
1700 }
1701
1702-void UbuntuInput::postEvent(UbuntuWindow *platformWindow, const MirEvent *event)
1703+void QMirClientInput::postEvent(QMirClientWindow *platformWindow, const MirEvent *event)
1704 {
1705 QWindow *window = platformWindow->window();
1706
1707@@ -312,12 +336,12 @@
1708
1709 if ((window->flags().testFlag(Qt::WindowTransparentForInput)) && window->parent()) {
1710 QCoreApplication::postEvent(this, new UbuntuEvent(
1711- static_cast<UbuntuWindow*>(platformWindow->QPlatformWindow::parent()),
1712+ static_cast<QMirClientWindow*>(platformWindow->QPlatformWindow::parent()),
1713 event, mEventType));
1714 }
1715 }
1716
1717-void UbuntuInput::dispatchInputEvent(UbuntuWindow *window, const MirInputEvent *ev)
1718+void QMirClientInput::dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *ev)
1719 {
1720 switch (mir_input_event_get_type(ev))
1721 {
1722@@ -335,7 +359,7 @@
1723 }
1724 }
1725
1726-void UbuntuInput::dispatchTouchEvent(UbuntuWindow *window, const MirInputEvent *ev)
1727+void QMirClientInput::dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *ev)
1728 {
1729 const MirTouchEvent *tev = mir_input_event_get_touch_event(ev);
1730
1731@@ -433,7 +457,7 @@
1732 }
1733 }
1734
1735-void UbuntuInput::dispatchKeyEvent(UbuntuWindow *window, const MirInputEvent *event)
1736+void QMirClientInput::dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event)
1737 {
1738 const MirKeyboardEvent *key_event = mir_input_event_get_keyboard_event(event);
1739
1740@@ -470,7 +494,7 @@
1741 QKeyEvent qKeyEvent(keyType, sym, modifiers, scan_code, xk_sym, native_modifiers, text, is_auto_rep);
1742 qKeyEvent.setTimestamp(timestamp);
1743 if (context->filterEvent(&qKeyEvent)) {
1744- qCDebug(ubuntumirclient, "key event filtered out by input context");
1745+ qCDebug(mirclient, "key event filtered out by input context");
1746 return;
1747 }
1748 }
1749@@ -498,7 +522,7 @@
1750 }
1751 }
1752
1753-void UbuntuInput::dispatchPointerEvent(UbuntuWindow *platformWindow, const MirInputEvent *ev)
1754+void QMirClientInput::dispatchPointerEvent(QMirClientWindow *platformWindow, const MirInputEvent *ev)
1755 {
1756 const auto window = platformWindow->window();
1757 const auto timestamp = mir_input_event_get_event_time(ev) / 1000000;
1758@@ -557,13 +581,13 @@
1759 Q_UNREACHABLE();
1760 }
1761
1762-void UbuntuInput::dispatchOrientationEvent(QWindow *window, const MirOrientationEvent *event)
1763+void QMirClientInput::dispatchOrientationEvent(QWindow *window, const MirOrientationEvent *event)
1764 {
1765 MirOrientation mir_orientation = mir_orientation_event_get_direction(event);
1766- qCDebug(ubuntumirclientInput, "orientation direction: %s", nativeOrientationDirectionToStr(mir_orientation));
1767+ qCDebug(mirclientInput, "orientation direction: %s", nativeOrientationDirectionToStr(mir_orientation));
1768
1769 if (!window->screen()) {
1770- qCDebug(ubuntumirclient, "Window has no associated screen, dropping orientation event");
1771+ qCDebug(mirclient, "Window has no associated screen, dropping orientation event");
1772 return;
1773 }
1774
1775@@ -582,7 +606,7 @@
1776 orientation = OrientationChangeEvent::RightUp;
1777 break;
1778 default:
1779- qCDebug(ubuntumirclient, "No such orientation %d", mir_orientation);
1780+ qCDebug(mirclient, "No such orientation %d", mir_orientation);
1781 return;
1782 }
1783
1784@@ -590,11 +614,11 @@
1785 // notifying Qt of the actual orientation change - done to prevent multiple Windows each creating
1786 // an identical orientation change event and passing it directly to Qt.
1787 // [Platform]Screen can also factor in the native orientation.
1788- QCoreApplication::postEvent(static_cast<UbuntuScreen*>(window->screen()->handle()),
1789+ QCoreApplication::postEvent(static_cast<QMirClientScreen*>(window->screen()->handle()),
1790 new OrientationChangeEvent(OrientationChangeEvent::mType, orientation));
1791 }
1792
1793-void UbuntuInput::handleSurfaceEvent(const QPointer<UbuntuWindow> &window, const MirSurfaceEvent *event)
1794+void QMirClientInput::handleSurfaceEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceEvent *event)
1795 {
1796 auto surfaceEventAttribute = mir_surface_event_get_attribute(event);
1797
1798@@ -604,10 +628,11 @@
1799 mir_surface_event_get_attribute_value(event) == mir_surface_focused);
1800 break;
1801 }
1802- case mir_surface_attrib_visibility:
1803+ case mir_surface_attrib_visibility: {
1804 window->handleSurfaceExposeChange(
1805 mir_surface_event_get_attribute_value(event) == mir_surface_visibility_exposed);
1806 break;
1807+ }
1808 // Remaining attributes are ones client sets for server, and server should not override them
1809 case mir_surface_attrib_state: {
1810 MirSurfaceState state = static_cast<MirSurfaceState>(mir_surface_event_get_attribute_value(event));
1811@@ -630,7 +655,7 @@
1812 }
1813 }
1814
1815-void UbuntuInput::handleSurfaceOutputEvent(const QPointer<UbuntuWindow> &window, const MirSurfaceOutputEvent *event)
1816+void QMirClientInput::handleSurfaceOutputEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceOutputEvent *event)
1817 {
1818 const uint32_t outputId = mir_surface_output_event_get_output_id(event);
1819 const int dpi = mir_surface_output_event_get_dpi(event);
1820@@ -638,9 +663,9 @@
1821 const float scale = mir_surface_output_event_get_scale(event);
1822
1823 const auto screenObserver = mIntegration->screenObserver();
1824- UbuntuScreen *screen = screenObserver->findScreenWithId(outputId);
1825+ QMirClientScreen *screen = screenObserver->findScreenWithId(outputId);
1826 if (!screen) {
1827- qCWarning(ubuntumirclient) << "Mir notified window" << window->window() << "on an unknown screen with id" << outputId;
1828+ qCWarning(mirclient) << "Mir notified window" << window->window() << "on an unknown screen with id" << outputId;
1829 return;
1830 }
1831
1832
1833=== renamed file 'src/ubuntumirclient/input.h' => 'src/ubuntumirclient/qmirclientinput.h'
1834--- src/ubuntumirclient/input.h 2016-09-21 10:25:33 +0000
1835+++ src/ubuntumirclient/qmirclientinput.h 2017-02-08 16:34:34 +0000
1836@@ -1,63 +1,86 @@
1837-/*
1838- * Copyright (C) 2014-2016 Canonical, Ltd.
1839- *
1840- * This program is free software: you can redistribute it and/or modify it under
1841- * the terms of the GNU Lesser General Public License version 3, as published by
1842- * the Free Software Foundation.
1843- *
1844- * This program is distributed in the hope that it will be useful, but WITHOUT
1845- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1846- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1847- * Lesser General Public License for more details.
1848- *
1849- * You should have received a copy of the GNU Lesser General Public License
1850- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1851- */
1852-
1853-#ifndef UBUNTU_INPUT_H
1854-#define UBUNTU_INPUT_H
1855+/****************************************************************************
1856+**
1857+** Copyright (C) 2014-2016 Canonical, Ltd.
1858+** Contact: https://www.qt.io/licensing/
1859+**
1860+** This file is part of the plugins of the Qt Toolkit.
1861+**
1862+** $QT_BEGIN_LICENSE:LGPL$
1863+** Commercial License Usage
1864+** Licensees holding valid commercial Qt licenses may use this file in
1865+** accordance with the commercial license agreement provided with the
1866+** Software or, alternatively, in accordance with the terms contained in
1867+** a written agreement between you and The Qt Company. For licensing terms
1868+** and conditions see https://www.qt.io/terms-conditions. For further
1869+** information use the contact form at https://www.qt.io/contact-us.
1870+**
1871+** GNU Lesser General Public License Usage
1872+** Alternatively, this file may be used under the terms of the GNU Lesser
1873+** General Public License version 3 as published by the Free Software
1874+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1875+** packaging of this file. Please review the following information to
1876+** ensure the GNU Lesser General Public License version 3 requirements
1877+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
1878+**
1879+** GNU General Public License Usage
1880+** Alternatively, this file may be used under the terms of the GNU
1881+** General Public License version 2.0 or (at your option) the GNU General
1882+** Public license version 3 or any later version approved by the KDE Free
1883+** Qt Foundation. The licenses are as published by the Free Software
1884+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
1885+** included in the packaging of this file. Please review the following
1886+** information to ensure the GNU General Public License requirements will
1887+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
1888+** https://www.gnu.org/licenses/gpl-3.0.html.
1889+**
1890+** $QT_END_LICENSE$
1891+**
1892+****************************************************************************/
1893+
1894+
1895+#ifndef QMIRCLIENTINPUT_H
1896+#define QMIRCLIENTINPUT_H
1897
1898 // Qt
1899 #include <qpa/qwindowsysteminterface.h>
1900-#include <QLoggingCategory>
1901
1902 #include <mir_toolkit/mir_client_library.h>
1903
1904-class UbuntuClientIntegration;
1905-class UbuntuWindow;
1906+class QMirClientClientIntegration;
1907+class QMirClientWindow;
1908
1909-class UbuntuInput : public QObject
1910+class QMirClientInput : public QObject
1911 {
1912 Q_OBJECT
1913
1914 public:
1915- UbuntuInput(UbuntuClientIntegration* integration);
1916- virtual ~UbuntuInput();
1917+ QMirClientInput(QMirClientClientIntegration* integration);
1918+ virtual ~QMirClientInput();
1919
1920 // QObject methods.
1921 void customEvent(QEvent* event) override;
1922
1923- void postEvent(UbuntuWindow* window, const MirEvent *event);
1924- UbuntuClientIntegration* integration() const { return mIntegration; }
1925- UbuntuWindow *lastInputWindow() const {return mLastInputWindow; }
1926+ void postEvent(QMirClientWindow* window, const MirEvent *event);
1927+ QMirClientClientIntegration* integration() const { return mIntegration; }
1928+ QMirClientWindow *lastInputWindow() const {return mLastInputWindow; }
1929
1930 protected:
1931- void dispatchKeyEvent(UbuntuWindow *window, const MirInputEvent *event);
1932- void dispatchPointerEvent(UbuntuWindow *window, const MirInputEvent *event);
1933- void dispatchTouchEvent(UbuntuWindow *window, const MirInputEvent *event);
1934- void dispatchInputEvent(UbuntuWindow *window, const MirInputEvent *event);
1935+ void dispatchKeyEvent(QMirClientWindow *window, const MirInputEvent *event);
1936+ void dispatchPointerEvent(QMirClientWindow *window, const MirInputEvent *event);
1937+ void dispatchTouchEvent(QMirClientWindow *window, const MirInputEvent *event);
1938+ void dispatchInputEvent(QMirClientWindow *window, const MirInputEvent *event);
1939
1940 void dispatchOrientationEvent(QWindow* window, const MirOrientationEvent *event);
1941- void handleSurfaceEvent(const QPointer<UbuntuWindow> &window, const MirSurfaceEvent *event);
1942- void handleSurfaceOutputEvent(const QPointer<UbuntuWindow> &window, const MirSurfaceOutputEvent *event);
1943+ void handleSurfaceEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceEvent *event);
1944+ void handleSurfaceOutputEvent(const QPointer<QMirClientWindow> &window, const MirSurfaceOutputEvent *event);
1945
1946 private:
1947- UbuntuClientIntegration* mIntegration;
1948+ QMirClientClientIntegration* mIntegration;
1949 QTouchDevice* mTouchDevice;
1950 const QByteArray mEventFilterType;
1951 const QEvent::Type mEventType;
1952
1953- UbuntuWindow *mLastInputWindow;
1954+ QMirClientWindow *mLastInputWindow;
1955 };
1956
1957-#endif // UBUNTU_INPUT_H
1958+#endif // QMIRCLIENTINPUT_H
1959
1960=== renamed file 'src/ubuntumirclient/integration.cpp' => 'src/ubuntumirclient/qmirclientintegration.cpp'
1961--- src/ubuntumirclient/integration.cpp 2017-01-19 22:54:37 +0000
1962+++ src/ubuntumirclient/qmirclientintegration.cpp 2017-02-08 16:34:34 +0000
1963@@ -1,36 +1,59 @@
1964-/*
1965- * Copyright (C) 2014-2016 Canonical, Ltd.
1966- *
1967- * This program is free software: you can redistribute it and/or modify it under
1968- * the terms of the GNU Lesser General Public License version 3, as published by
1969- * the Free Software Foundation.
1970- *
1971- * This program is distributed in the hope that it will be useful, but WITHOUT
1972- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
1973- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1974- * Lesser General Public License for more details.
1975- *
1976- * You should have received a copy of the GNU Lesser General Public License
1977- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1978- */
1979+/****************************************************************************
1980+**
1981+** Copyright (C) 2014-2016 Canonical, Ltd.
1982+** Contact: https://www.qt.io/licensing/
1983+**
1984+** This file is part of the plugins of the Qt Toolkit.
1985+**
1986+** $QT_BEGIN_LICENSE:LGPL$
1987+** Commercial License Usage
1988+** Licensees holding valid commercial Qt licenses may use this file in
1989+** accordance with the commercial license agreement provided with the
1990+** Software or, alternatively, in accordance with the terms contained in
1991+** a written agreement between you and The Qt Company. For licensing terms
1992+** and conditions see https://www.qt.io/terms-conditions. For further
1993+** information use the contact form at https://www.qt.io/contact-us.
1994+**
1995+** GNU Lesser General Public License Usage
1996+** Alternatively, this file may be used under the terms of the GNU Lesser
1997+** General Public License version 3 as published by the Free Software
1998+** Foundation and appearing in the file LICENSE.LGPL3 included in the
1999+** packaging of this file. Please review the following information to
2000+** ensure the GNU Lesser General Public License version 3 requirements
2001+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2002+**
2003+** GNU General Public License Usage
2004+** Alternatively, this file may be used under the terms of the GNU
2005+** General Public License version 2.0 or (at your option) the GNU General
2006+** Public license version 3 or any later version approved by the KDE Free
2007+** Qt Foundation. The licenses are as published by the Free Software
2008+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2009+** included in the packaging of this file. Please review the following
2010+** information to ensure the GNU General Public License requirements will
2011+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2012+** https://www.gnu.org/licenses/gpl-3.0.html.
2013+**
2014+** $QT_END_LICENSE$
2015+**
2016+****************************************************************************/
2017+
2018
2019 // Local
2020-#include "integration.h"
2021-#include "backingstore.h"
2022-#include "clipboard.h"
2023-#include "desktopwindow.h"
2024-#include "debugextension.h"
2025-#include "glcontext.h"
2026-#include "input.h"
2027-#include "logging.h"
2028-#include "nativeinterface.h"
2029-#include "screen.h"
2030-#include "window.h"
2031+#include "qmirclientintegration.h"
2032+#include "qmirclientbackingstore.h"
2033+#include "qmirclientclipboard.h"
2034+#include "qmirclientdebugextension.h"
2035+#include "qmirclientdesktopwindow.h"
2036+#include "qmirclientglcontext.h"
2037+#include "qmirclientinput.h"
2038+#include "qmirclientlogging.h"
2039+#include "qmirclientnativeinterface.h"
2040+#include "qmirclientscreen.h"
2041+#include "qmirclientwindow.h"
2042
2043 // Qt
2044 #include <QFileInfo>
2045 #include <QGuiApplication>
2046-#include <private/qeglpbuffer_p.h>
2047 #include <qpa/qplatformnativeinterface.h>
2048 #include <qpa/qplatforminputcontextfactory_p.h>
2049 #include <qpa/qplatforminputcontext.h>
2050@@ -71,29 +94,29 @@
2051
2052 static void resumedCallback(const UApplicationOptions */*options*/, void *context)
2053 {
2054- auto integration = static_cast<UbuntuClientIntegration*>(context);
2055+ auto integration = static_cast<QMirClientClientIntegration*>(context);
2056 integration->appStateController()->setResumed();
2057 }
2058
2059 static void aboutToStopCallback(UApplicationArchive */*archive*/, void *context)
2060 {
2061- auto integration = static_cast<UbuntuClientIntegration*>(context);
2062+ auto integration = static_cast<QMirClientClientIntegration*>(context);
2063 auto inputContext = integration->inputContext();
2064 if (inputContext) {
2065 inputContext->hideInputPanel();
2066 } else {
2067- qCWarning(ubuntumirclient) << "aboutToStopCallback(): no input context";
2068+ qCWarning(mirclient) << "aboutToStopCallback(): no input context";
2069 }
2070 integration->appStateController()->setSuspended();
2071 }
2072
2073
2074-UbuntuClientIntegration::UbuntuClientIntegration(int argc, char **argv)
2075+QMirClientClientIntegration::QMirClientClientIntegration(int argc, char **argv)
2076 : QPlatformIntegration()
2077- , mNativeInterface(new UbuntuNativeInterface(this))
2078+ , mNativeInterface(new QMirClientNativeInterface(this))
2079 , mFontDb(new QGenericUnixFontDatabase)
2080- , mServices(new UbuntuPlatformServices)
2081- , mAppStateController(new UbuntuAppStateController)
2082+ , mServices(new QMirClientPlatformServices)
2083+ , mAppStateController(new QMirClientAppStateController)
2084 , mScaleFactor(1.0)
2085 {
2086 QByteArray sessionName;
2087@@ -108,7 +131,7 @@
2088 mInstance = u_application_instance_new_from_description_with_options(mDesc, mOptions);
2089
2090 if (mInstance == nullptr) {
2091- qCritical("[QPA] UbuntuClientIntegration: connection to Mir server failed.\n");
2092+ qCritical("[QPA] QMirClientClientIntegration: connection to Mir server failed.\n");
2093
2094 // TODO: add API to platform-api to fetch Mir's error message (bug:1655970).
2095 // Workaround by retrying the connection here in order to get the message.
2096@@ -140,28 +163,28 @@
2097 }
2098 }
2099 if (testability) {
2100- mDebugExtension.reset(new UbuntuDebugExtension);
2101+ mDebugExtension.reset(new QMirClientDebugExtension);
2102 if (!mDebugExtension->isEnabled()) {
2103 mDebugExtension.reset();
2104 }
2105 }
2106 }
2107
2108-void UbuntuClientIntegration::initialize()
2109+void QMirClientClientIntegration::initialize()
2110 {
2111 // Init the ScreenObserver
2112- mScreenObserver.reset(new UbuntuScreenObserver(mMirConnection));
2113- connect(mScreenObserver.data(), &UbuntuScreenObserver::screenAdded,
2114- [this](UbuntuScreen *screen) { this->screenAdded(screen); });
2115- connect(mScreenObserver.data(), &UbuntuScreenObserver::screenRemoved,
2116- this, &UbuntuClientIntegration::destroyScreen);
2117+ mScreenObserver.reset(new QMirClientScreenObserver(mMirConnection));
2118+ connect(mScreenObserver.data(), &QMirClientScreenObserver::screenAdded,
2119+ [this](QMirClientScreen *screen) { this->screenAdded(screen); });
2120+ connect(mScreenObserver.data(), &QMirClientScreenObserver::screenRemoved,
2121+ this, &QMirClientClientIntegration::destroyScreen);
2122
2123- Q_FOREACH(auto screen, mScreenObserver->screens()) {
2124+ Q_FOREACH (auto screen, mScreenObserver->screens()) {
2125 screenAdded(screen);
2126 }
2127
2128 // Initialize input.
2129- mInput = new UbuntuInput(this);
2130+ mInput = new QMirClientInput(this);
2131 mInputContext = QPlatformInputContextFactory::create();
2132
2133 // compute the scale factor
2134@@ -178,7 +201,7 @@
2135 mScaleFactor = static_cast<qreal>(gridUnit) / defaultGridUnit;
2136 }
2137
2138-UbuntuClientIntegration::~UbuntuClientIntegration()
2139+QMirClientClientIntegration::~QMirClientClientIntegration()
2140 {
2141 eglTerminate(mEglDisplay);
2142 delete mInput;
2143@@ -186,12 +209,12 @@
2144 delete mServices;
2145 }
2146
2147-QPlatformServices *UbuntuClientIntegration::services() const
2148+QPlatformServices *QMirClientClientIntegration::services() const
2149 {
2150 return mServices;
2151 }
2152
2153-void UbuntuClientIntegration::setupOptions(QStringList &args)
2154+void QMirClientClientIntegration::setupOptions(QStringList &args)
2155 {
2156 int argc = args.size() + 1;
2157 char **argv = new char*[argc];
2158@@ -206,7 +229,7 @@
2159 delete [] argv;
2160 }
2161
2162-void UbuntuClientIntegration::setupDescription(QByteArray &sessionName)
2163+void QMirClientClientIntegration::setupDescription(QByteArray &sessionName)
2164 {
2165 mDesc = u_application_description_new();
2166
2167@@ -220,7 +243,7 @@
2168 u_application_description_set_application_lifecycle_delegate(mDesc, delegate);
2169 }
2170
2171-QByteArray UbuntuClientIntegration::generateSessionName(QStringList &args)
2172+QByteArray QMirClientClientIntegration::generateSessionName(QStringList &args)
2173 {
2174 // Try to come up with some meaningful session name to uniquely identify this session,
2175 // helping with shell debugging
2176@@ -236,7 +259,7 @@
2177 }
2178 }
2179
2180-QByteArray UbuntuClientIntegration::generateSessionNameFromQmlFile(QStringList &args)
2181+QByteArray QMirClientClientIntegration::generateSessionNameFromQmlFile(QStringList &args)
2182 {
2183 Q_FOREACH (QString arg, args) {
2184 if (arg.endsWith(".qml")) {
2185@@ -249,25 +272,25 @@
2186 return "qmlscene";
2187 }
2188
2189-QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const
2190+QPlatformWindow* QMirClientClientIntegration::createPlatformWindow(QWindow* window) const
2191 {
2192 if (window->type() == Qt::Desktop) {
2193 // Desktop windows should not be backed up by a mir surface as they don't draw anything (nor should).
2194- return new UbuntuDesktopWindow(window);
2195+ return new QMirClientDesktopWindow(window);
2196 } else {
2197- return new UbuntuWindow(window, mInput, mNativeInterface, mAppStateController.data(),
2198- mEglDisplay, mMirConnection, mDebugExtension.data());
2199+ return new QMirClientWindow(window, mInput, mNativeInterface, mAppStateController.data(),
2200+ mEglDisplay, mMirConnection, mDebugExtension.data());
2201 }
2202 }
2203
2204-bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
2205+bool QMirClientClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const
2206 {
2207 switch (cap) {
2208 case ThreadedOpenGL:
2209 if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) {
2210 return true;
2211 } else {
2212- qCDebug(ubuntumirclient, "disabled threaded OpenGL");
2213+ qCDebug(mirclient, "disabled threaded OpenGL");
2214 return false;
2215 }
2216
2217@@ -286,52 +309,52 @@
2218 }
2219 }
2220
2221-QAbstractEventDispatcher *UbuntuClientIntegration::createEventDispatcher() const
2222+QAbstractEventDispatcher *QMirClientClientIntegration::createEventDispatcher() const
2223 {
2224 return createUnixEventDispatcher();
2225 }
2226
2227-QPlatformBackingStore* UbuntuClientIntegration::createPlatformBackingStore(QWindow* window) const
2228+QPlatformBackingStore* QMirClientClientIntegration::createPlatformBackingStore(QWindow* window) const
2229 {
2230- return new UbuntuBackingStore(window);
2231+ return new QMirClientBackingStore(window);
2232 }
2233
2234-QPlatformOpenGLContext* UbuntuClientIntegration::createPlatformOpenGLContext(
2235+QPlatformOpenGLContext* QMirClientClientIntegration::createPlatformOpenGLContext(
2236 QOpenGLContext* context) const
2237 {
2238 QSurfaceFormat format(context->format());
2239
2240- auto platformContext = new UbuntuOpenGLContext(format, context->shareHandle(), mEglDisplay);
2241+ auto platformContext = new QMirClientOpenGLContext(format, context->shareHandle(), mEglDisplay);
2242 if (!platformContext->isValid()) {
2243 // Older Intel Atom-based devices only support OpenGL 1.4 compatibility profile but by default
2244 // QML asks for at least OpenGL 2.0. The XCB GLX backend ignores this request and returns a
2245- // 1.4 context, but the XCB EGL backend tries to honour it, and fails. The 1.4 context appears to
2246+ // 1.4 context, but the XCB EGL backend tries to honor it, and fails. The 1.4 context appears to
2247 // have sufficient capabilities on MESA (i915) to render correctly however. So reduce the default
2248 // requested OpenGL version to 1.0 to ensure EGL will give us a working context (lp:1549455).
2249 static const bool isMesa = QString(eglQueryString(mEglDisplay, EGL_VENDOR)).contains(QStringLiteral("Mesa"));
2250 if (isMesa) {
2251- qCDebug(ubuntumirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
2252+ qCDebug(mirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
2253 format.setMajorVersion(1);
2254 format.setMinorVersion(4);
2255 delete platformContext;
2256- platformContext = new UbuntuOpenGLContext(format, context->shareHandle(), mEglDisplay);
2257+ platformContext = new QMirClientOpenGLContext(format, context->shareHandle(), mEglDisplay);
2258 }
2259 }
2260 return platformContext;
2261 }
2262
2263-QStringList UbuntuClientIntegration::themeNames() const
2264+QStringList QMirClientClientIntegration::themeNames() const
2265 {
2266 return QStringList(QStringLiteral("ubuntuappmenu"));
2267 }
2268
2269-QPlatformTheme* UbuntuClientIntegration::createPlatformTheme(const QString& name) const
2270+QPlatformTheme* QMirClientClientIntegration::createPlatformTheme(const QString& name) const
2271 {
2272 Q_UNUSED(name);
2273 return new UbuntuIconTheme;
2274 }
2275
2276-QVariant UbuntuClientIntegration::styleHint(StyleHint hint) const
2277+QVariant QMirClientClientIntegration::styleHint(StyleHint hint) const
2278 {
2279 switch (hint) {
2280 case QPlatformIntegration::StartDragDistance: {
2281@@ -348,27 +371,27 @@
2282 return QPlatformIntegration::styleHint(hint);
2283 }
2284
2285-QPlatformClipboard* UbuntuClientIntegration::clipboard() const
2286+QPlatformClipboard* QMirClientClientIntegration::clipboard() const
2287 {
2288 static QPlatformClipboard *clipboard = nullptr;
2289 if (!clipboard) {
2290- clipboard = new UbuntuClipboard;
2291+ clipboard = new QMirClientClipboard;
2292 }
2293 return clipboard;
2294 }
2295
2296-QPlatformNativeInterface* UbuntuClientIntegration::nativeInterface() const
2297+QPlatformNativeInterface* QMirClientClientIntegration::nativeInterface() const
2298 {
2299 return mNativeInterface;
2300 }
2301
2302-QPlatformOffscreenSurface *UbuntuClientIntegration::createPlatformOffscreenSurface(
2303+QPlatformOffscreenSurface *QMirClientClientIntegration::createPlatformOffscreenSurface(
2304 QOffscreenSurface *surface) const
2305 {
2306 return new QEGLPbuffer(mEglDisplay, surface->requestedFormat(), surface);
2307 }
2308
2309-void UbuntuClientIntegration::destroyScreen(UbuntuScreen *screen)
2310+void QMirClientClientIntegration::destroyScreen(QMirClientScreen *screen)
2311 {
2312 // FIXME: on deleting a screen while a Window is on it, Qt will automatically
2313 // move the window to the primaryScreen(). This will trigger a screenChanged
2314@@ -391,7 +414,7 @@
2315 }
2316 }
2317
2318- qCDebug(ubuntumirclient) << "Removing Screen with id" << screen->mirOutputId() << "and geometry" << screen->geometry();
2319+ qCDebug(mirclient) << "Removing Screen with id" << screen->mirOutputId() << "and geometry" << screen->geometry();
2320 #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
2321 delete screen;
2322 #else
2323@@ -399,7 +422,7 @@
2324 #endif
2325 }
2326
2327-QPlatformAccessibility *UbuntuClientIntegration::accessibility() const
2328+QPlatformAccessibility *QMirClientClientIntegration::accessibility() const
2329 {
2330 if (!mAccessibility) {
2331 mAccessibility.reset(new QSpiAccessibleBridge());
2332
2333=== renamed file 'src/ubuntumirclient/integration.h' => 'src/ubuntumirclient/qmirclientintegration.h'
2334--- src/ubuntumirclient/integration.h 2016-12-09 17:02:57 +0000
2335+++ src/ubuntumirclient/qmirclientintegration.h 2017-02-08 16:34:34 +0000
2336@@ -1,28 +1,52 @@
2337-/*
2338- * Copyright (C) 2014,2016 Canonical, Ltd.
2339- *
2340- * This program is free software: you can redistribute it and/or modify it under
2341- * the terms of the GNU Lesser General Public License version 3, as published by
2342- * the Free Software Foundation.
2343- *
2344- * This program is distributed in the hope that it will be useful, but WITHOUT
2345- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
2346- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2347- * Lesser General Public License for more details.
2348- *
2349- * You should have received a copy of the GNU Lesser General Public License
2350- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2351- */
2352-
2353-#ifndef UBUNTU_CLIENT_INTEGRATION_H
2354-#define UBUNTU_CLIENT_INTEGRATION_H
2355+/****************************************************************************
2356+**
2357+** Copyright (C) 2016 Canonical, Ltd.
2358+** Contact: https://www.qt.io/licensing/
2359+**
2360+** This file is part of the plugins of the Qt Toolkit.
2361+**
2362+** $QT_BEGIN_LICENSE:LGPL$
2363+** Commercial License Usage
2364+** Licensees holding valid commercial Qt licenses may use this file in
2365+** accordance with the commercial license agreement provided with the
2366+** Software or, alternatively, in accordance with the terms contained in
2367+** a written agreement between you and The Qt Company. For licensing terms
2368+** and conditions see https://www.qt.io/terms-conditions. For further
2369+** information use the contact form at https://www.qt.io/contact-us.
2370+**
2371+** GNU Lesser General Public License Usage
2372+** Alternatively, this file may be used under the terms of the GNU Lesser
2373+** General Public License version 3 as published by the Free Software
2374+** Foundation and appearing in the file LICENSE.LGPL3 included in the
2375+** packaging of this file. Please review the following information to
2376+** ensure the GNU Lesser General Public License version 3 requirements
2377+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2378+**
2379+** GNU General Public License Usage
2380+** Alternatively, this file may be used under the terms of the GNU
2381+** General Public License version 2.0 or (at your option) the GNU General
2382+** Public license version 3 or any later version approved by the KDE Free
2383+** Qt Foundation. The licenses are as published by the Free Software
2384+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2385+** included in the packaging of this file. Please review the following
2386+** information to ensure the GNU General Public License requirements will
2387+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2388+** https://www.gnu.org/licenses/gpl-3.0.html.
2389+**
2390+** $QT_END_LICENSE$
2391+**
2392+****************************************************************************/
2393+
2394+
2395+#ifndef QMIRCLIENTINTEGRATION_H
2396+#define QMIRCLIENTINTEGRATION_H
2397
2398 #include <qpa/qplatformintegration.h>
2399 #include <QSharedPointer>
2400
2401-#include "appstatecontroller.h"
2402-#include "platformservices.h"
2403-#include "screenobserver.h"
2404+#include "qmirclientappstatecontroller.h"
2405+#include "qmirclientplatformservices.h"
2406+#include "qmirclientscreenobserver.h"
2407
2408 // platform-api
2409 #include <ubuntu/application/description.h>
2410@@ -30,19 +54,19 @@
2411
2412 #include <EGL/egl.h>
2413
2414-class UbuntuDebugExtension;
2415-class UbuntuInput;
2416-class UbuntuNativeInterface;
2417-class UbuntuScreen;
2418+class QMirClientDebugExtension;
2419+class QMirClientInput;
2420+class QMirClientNativeInterface;
2421+class QMirClientScreen;
2422 class MirConnection;
2423
2424-class UbuntuClientIntegration : public QObject, public QPlatformIntegration
2425+class QMirClientClientIntegration : public QObject, public QPlatformIntegration
2426 {
2427 Q_OBJECT
2428
2429 public:
2430- UbuntuClientIntegration(int argc, char **argv);
2431- virtual ~UbuntuClientIntegration();
2432+ QMirClientClientIntegration(int argc, char **argv);
2433+ virtual ~QMirClientClientIntegration();
2434
2435 // QPlatformIntegration methods.
2436 bool hasCapability(QPlatformIntegration::Capability cap) const override;
2437@@ -66,12 +90,12 @@
2438 MirConnection *mirConnection() const { return mMirConnection; }
2439 EGLDisplay eglDisplay() const { return mEglDisplay; }
2440 EGLNativeDisplayType eglNativeDisplay() const { return mEglNativeDisplay; }
2441- UbuntuAppStateController *appStateController() const { return mAppStateController.data(); }
2442- UbuntuScreenObserver *screenObserver() const { return mScreenObserver.data(); }
2443- UbuntuDebugExtension *debugExtension() const { return mDebugExtension.data(); }
2444+ QMirClientAppStateController *appStateController() const { return mAppStateController.data(); }
2445+ QMirClientScreenObserver *screenObserver() const { return mScreenObserver.data(); }
2446+ QMirClientDebugExtension *debugExtension() const { return mDebugExtension.data(); }
2447
2448 private Q_SLOTS:
2449- void destroyScreen(UbuntuScreen *screen);
2450+ void destroyScreen(QMirClientScreen *screen);
2451
2452 private:
2453 void setupOptions(QStringList &args);
2454@@ -79,17 +103,17 @@
2455 static QByteArray generateSessionName(QStringList &args);
2456 static QByteArray generateSessionNameFromQmlFile(QStringList &args);
2457
2458- UbuntuNativeInterface* mNativeInterface;
2459+ QMirClientNativeInterface* mNativeInterface;
2460 QPlatformFontDatabase* mFontDb;
2461
2462- UbuntuPlatformServices* mServices;
2463+ QMirClientPlatformServices* mServices;
2464
2465- UbuntuInput* mInput;
2466+ QMirClientInput* mInput;
2467 QPlatformInputContext* mInputContext;
2468 mutable QScopedPointer<QPlatformAccessibility> mAccessibility;
2469- QScopedPointer<UbuntuDebugExtension> mDebugExtension;
2470- QScopedPointer<UbuntuScreenObserver> mScreenObserver;
2471- QScopedPointer<UbuntuAppStateController> mAppStateController;
2472+ QScopedPointer<QMirClientDebugExtension> mDebugExtension;
2473+ QScopedPointer<QMirClientScreenObserver> mScreenObserver;
2474+ QScopedPointer<QMirClientAppStateController> mAppStateController;
2475 qreal mScaleFactor;
2476
2477 MirConnection *mMirConnection;
2478@@ -104,4 +128,4 @@
2479 EGLNativeDisplayType mEglNativeDisplay;
2480 };
2481
2482-#endif // UBUNTU_CLIENT_INTEGRATION_H
2483+#endif // QMIRCLIENTINTEGRATION_H
2484
2485=== renamed file 'src/ubuntumirclient/logging.h' => 'src/ubuntumirclient/qmirclientlogging.h'
2486--- src/ubuntumirclient/logging.h 2016-12-09 17:02:57 +0000
2487+++ src/ubuntumirclient/qmirclientlogging.h 2017-02-08 16:34:34 +0000
2488@@ -1,31 +1,55 @@
2489-/*
2490- * Copyright (C) 2014-2015 Canonical, Ltd.
2491- *
2492- * This program is free software: you can redistribute it and/or modify it under
2493- * the terms of the GNU Lesser General Public License version 3, as published by
2494- * the Free Software Foundation.
2495- *
2496- * This program is distributed in the hope that it will be useful, but WITHOUT
2497- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
2498- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2499- * Lesser General Public License for more details.
2500- *
2501- * You should have received a copy of the GNU Lesser General Public License
2502- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2503- */
2504-
2505-#ifndef QUBUNTULOGGING_H
2506-#define QUBUNTULOGGING_H
2507+/****************************************************************************
2508+**
2509+** Copyright (C) 2016 Canonical, Ltd.
2510+** Contact: https://www.qt.io/licensing/
2511+**
2512+** This file is part of the plugins of the Qt Toolkit.
2513+**
2514+** $QT_BEGIN_LICENSE:LGPL$
2515+** Commercial License Usage
2516+** Licensees holding valid commercial Qt licenses may use this file in
2517+** accordance with the commercial license agreement provided with the
2518+** Software or, alternatively, in accordance with the terms contained in
2519+** a written agreement between you and The Qt Company. For licensing terms
2520+** and conditions see https://www.qt.io/terms-conditions. For further
2521+** information use the contact form at https://www.qt.io/contact-us.
2522+**
2523+** GNU Lesser General Public License Usage
2524+** Alternatively, this file may be used under the terms of the GNU Lesser
2525+** General Public License version 3 as published by the Free Software
2526+** Foundation and appearing in the file LICENSE.LGPL3 included in the
2527+** packaging of this file. Please review the following information to
2528+** ensure the GNU Lesser General Public License version 3 requirements
2529+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2530+**
2531+** GNU General Public License Usage
2532+** Alternatively, this file may be used under the terms of the GNU
2533+** General Public License version 2.0 or (at your option) the GNU General
2534+** Public license version 3 or any later version approved by the KDE Free
2535+** Qt Foundation. The licenses are as published by the Free Software
2536+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2537+** included in the packaging of this file. Please review the following
2538+** information to ensure the GNU General Public License requirements will
2539+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2540+** https://www.gnu.org/licenses/gpl-3.0.html.
2541+**
2542+** $QT_END_LICENSE$
2543+**
2544+****************************************************************************/
2545+
2546+
2547+#ifndef QMIRCLIENTLOGGING_H
2548+#define QMIRCLIENTLOGGING_H
2549
2550 #include <QLoggingCategory>
2551
2552 #define ASSERT(cond) ((!(cond)) ? qt_assert(#cond,__FILE__,__LINE__) : qt_noop())
2553
2554-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclient)
2555-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientBufferSwap)
2556-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientInput)
2557-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientGraphics)
2558-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientCursor)
2559-Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientDebug)
2560+Q_DECLARE_LOGGING_CATEGORY(mirclient)
2561+Q_DECLARE_LOGGING_CATEGORY(mirclientBufferSwap)
2562+Q_DECLARE_LOGGING_CATEGORY(mirclientInput)
2563+Q_DECLARE_LOGGING_CATEGORY(mirclientGraphics)
2564+Q_DECLARE_LOGGING_CATEGORY(mirclientCursor)
2565+Q_DECLARE_LOGGING_CATEGORY(mirclientDebug)
2566
2567-#endif // QUBUNTULOGGING_H
2568+#endif // QMIRCLIENTLOGGING_H
2569
2570=== renamed file 'src/ubuntumirclient/nativeinterface.cpp' => 'src/ubuntumirclient/qmirclientnativeinterface.cpp'
2571--- src/ubuntumirclient/nativeinterface.cpp 2016-08-23 17:03:35 +0000
2572+++ src/ubuntumirclient/qmirclientnativeinterface.cpp 2017-02-08 16:34:34 +0000
2573@@ -1,63 +1,87 @@
2574-/*
2575- * Copyright (C) 2014,2016 Canonical, Ltd.
2576- *
2577- * This program is free software: you can redistribute it and/or modify it under
2578- * the terms of the GNU Lesser General Public License version 3, as published by
2579- * the Free Software Foundation.
2580- *
2581- * This program is distributed in the hope that it will be useful, but WITHOUT
2582- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
2583- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2584- * Lesser General Public License for more details.
2585- *
2586- * You should have received a copy of the GNU Lesser General Public License
2587- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2588- */
2589+/****************************************************************************
2590+**
2591+** Copyright (C) 2016 Canonical, Ltd.
2592+** Contact: https://www.qt.io/licensing/
2593+**
2594+** This file is part of the plugins of the Qt Toolkit.
2595+**
2596+** $QT_BEGIN_LICENSE:LGPL$
2597+** Commercial License Usage
2598+** Licensees holding valid commercial Qt licenses may use this file in
2599+** accordance with the commercial license agreement provided with the
2600+** Software or, alternatively, in accordance with the terms contained in
2601+** a written agreement between you and The Qt Company. For licensing terms
2602+** and conditions see https://www.qt.io/terms-conditions. For further
2603+** information use the contact form at https://www.qt.io/contact-us.
2604+**
2605+** GNU Lesser General Public License Usage
2606+** Alternatively, this file may be used under the terms of the GNU Lesser
2607+** General Public License version 3 as published by the Free Software
2608+** Foundation and appearing in the file LICENSE.LGPL3 included in the
2609+** packaging of this file. Please review the following information to
2610+** ensure the GNU Lesser General Public License version 3 requirements
2611+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2612+**
2613+** GNU General Public License Usage
2614+** Alternatively, this file may be used under the terms of the GNU
2615+** General Public License version 2.0 or (at your option) the GNU General
2616+** Public license version 3 or any later version approved by the KDE Free
2617+** Qt Foundation. The licenses are as published by the Free Software
2618+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2619+** included in the packaging of this file. Please review the following
2620+** information to ensure the GNU General Public License requirements will
2621+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2622+** https://www.gnu.org/licenses/gpl-3.0.html.
2623+**
2624+** $QT_END_LICENSE$
2625+**
2626+****************************************************************************/
2627+
2628
2629 // Local
2630-#include "nativeinterface.h"
2631-#include "screen.h"
2632-#include "glcontext.h"
2633-#include "window.h"
2634+#include "qmirclientnativeinterface.h"
2635+#include "qmirclientscreen.h"
2636+#include "qmirclientglcontext.h"
2637+#include "qmirclientwindow.h"
2638
2639 // Qt
2640-#include <private/qguiapplication_p.h>
2641+#include <QtGui/private/qguiapplication_p.h>
2642 #include <QtGui/qopenglcontext.h>
2643 #include <QtGui/qscreen.h>
2644 #include <QtCore/QMap>
2645
2646-class UbuntuResourceMap : public QMap<QByteArray, UbuntuNativeInterface::ResourceType>
2647+class UbuntuResourceMap : public QMap<QByteArray, QMirClientNativeInterface::ResourceType>
2648 {
2649 public:
2650 UbuntuResourceMap()
2651- : QMap<QByteArray, UbuntuNativeInterface::ResourceType>() {
2652- insert("egldisplay", UbuntuNativeInterface::EglDisplay);
2653- insert("eglcontext", UbuntuNativeInterface::EglContext);
2654- insert("nativeorientation", UbuntuNativeInterface::NativeOrientation);
2655- insert("display", UbuntuNativeInterface::Display);
2656- insert("mirconnection", UbuntuNativeInterface::MirConnection);
2657- insert("mirsurface", UbuntuNativeInterface::MirSurface);
2658- insert("scale", UbuntuNativeInterface::Scale);
2659- insert("formfactor", UbuntuNativeInterface::FormFactor);
2660+ : QMap<QByteArray, QMirClientNativeInterface::ResourceType>() {
2661+ insert("egldisplay", QMirClientNativeInterface::EglDisplay);
2662+ insert("eglcontext", QMirClientNativeInterface::EglContext);
2663+ insert("nativeorientation", QMirClientNativeInterface::NativeOrientation);
2664+ insert("display", QMirClientNativeInterface::Display);
2665+ insert("mirconnection", QMirClientNativeInterface::MirConnection);
2666+ insert("mirsurface", QMirClientNativeInterface::MirSurface);
2667+ insert("scale", QMirClientNativeInterface::Scale);
2668+ insert("formfactor", QMirClientNativeInterface::FormFactor);
2669 }
2670 };
2671
2672 Q_GLOBAL_STATIC(UbuntuResourceMap, ubuntuResourceMap)
2673
2674-UbuntuNativeInterface::UbuntuNativeInterface(const UbuntuClientIntegration *integration)
2675+QMirClientNativeInterface::QMirClientNativeInterface(const QMirClientClientIntegration *integration)
2676 : mIntegration(integration)
2677 , mGenericEventFilterType(QByteArrayLiteral("Event"))
2678 , mNativeOrientation(nullptr)
2679 {
2680 }
2681
2682-UbuntuNativeInterface::~UbuntuNativeInterface()
2683+QMirClientNativeInterface::~QMirClientNativeInterface()
2684 {
2685 delete mNativeOrientation;
2686 mNativeOrientation = nullptr;
2687 }
2688
2689-void* UbuntuNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
2690+void* QMirClientNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString)
2691 {
2692 const QByteArray lowerCaseResource = resourceString.toLower();
2693
2694@@ -67,14 +91,14 @@
2695
2696 const ResourceType resourceType = ubuntuResourceMap()->value(lowerCaseResource);
2697
2698- if (resourceType == UbuntuNativeInterface::MirConnection) {
2699+ if (resourceType == QMirClientNativeInterface::MirConnection) {
2700 return mIntegration->mirConnection();
2701 } else {
2702 return nullptr;
2703 }
2704 }
2705
2706-void* UbuntuNativeInterface::nativeResourceForContext(
2707+void* QMirClientNativeInterface::nativeResourceForContext(
2708 const QByteArray& resourceString, QOpenGLContext* context)
2709 {
2710 if (!context)
2711@@ -87,13 +111,13 @@
2712
2713 const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
2714
2715- if (kResourceType == UbuntuNativeInterface::EglContext)
2716- return static_cast<UbuntuOpenGLContext*>(context->handle())->eglContext();
2717+ if (kResourceType == QMirClientNativeInterface::EglContext)
2718+ return static_cast<QMirClientOpenGLContext*>(context->handle())->eglContext();
2719 else
2720 return nullptr;
2721 }
2722
2723-void* UbuntuNativeInterface::nativeResourceForWindow(const QByteArray& resourceString, QWindow* window)
2724+void* QMirClientNativeInterface::nativeResourceForWindow(const QByteArray& resourceString, QWindow* window)
2725 {
2726 const QByteArray kLowerCaseResource = resourceString.toLower();
2727 if (!ubuntuResourceMap()->contains(kLowerCaseResource))
2728@@ -106,7 +130,7 @@
2729 case NativeOrientation:
2730 // Return the device's native screen orientation.
2731 if (window) {
2732- UbuntuScreen *ubuntuScreen = static_cast<UbuntuScreen*>(window->screen()->handle());
2733+ QMirClientScreen *ubuntuScreen = static_cast<QMirClientScreen*>(window->screen()->handle());
2734 mNativeOrientation = new Qt::ScreenOrientation(ubuntuScreen->nativeOrientation());
2735 } else {
2736 QPlatformScreen *platformScreen = QGuiApplication::primaryScreen()->handle();
2737@@ -115,7 +139,7 @@
2738 return mNativeOrientation;
2739 case MirSurface:
2740 if (window) {
2741- auto ubuntuWindow = static_cast<UbuntuWindow*>(window->handle());
2742+ auto ubuntuWindow = static_cast<QMirClientWindow*>(window->handle());
2743 if (ubuntuWindow) {
2744 return ubuntuWindow->mirSurface();
2745 } else {
2746@@ -129,7 +153,7 @@
2747 }
2748 }
2749
2750-void* UbuntuNativeInterface::nativeResourceForScreen(const QByteArray& resourceString, QScreen* screen)
2751+void* QMirClientNativeInterface::nativeResourceForScreen(const QByteArray& resourceString, QScreen* screen)
2752 {
2753 const QByteArray kLowerCaseResource = resourceString.toLower();
2754 if (!ubuntuResourceMap()->contains(kLowerCaseResource))
2755@@ -137,28 +161,28 @@
2756 const ResourceType kResourceType = ubuntuResourceMap()->value(kLowerCaseResource);
2757 if (!screen)
2758 screen = QGuiApplication::primaryScreen();
2759- auto ubuntuScreen = static_cast<UbuntuScreen*>(screen->handle());
2760- if (kResourceType == UbuntuNativeInterface::Display) {
2761+ auto ubuntuScreen = static_cast<QMirClientScreen*>(screen->handle());
2762+ if (kResourceType == QMirClientNativeInterface::Display) {
2763 return mIntegration->eglNativeDisplay();
2764- // Changes to the following properties are emitted via the UbuntuNativeInterface::screenPropertyChanged
2765- // signal fired by UbuntuScreen. Connect to this signal for these properties updates.
2766+ // Changes to the following properties are emitted via the QMirClientNativeInterface::screenPropertyChanged
2767+ // signal fired by QMirClientScreen. Connect to this signal for these properties updates.
2768 // WARNING: code highly thread unsafe!
2769- } else if (kResourceType == UbuntuNativeInterface::Scale) {
2770+ } else if (kResourceType == QMirClientNativeInterface::Scale) {
2771 // In application code, read with:
2772 // float scale = *reinterpret_cast<float*>(nativeResourceForScreen("scale", screen()));
2773 return &ubuntuScreen->mScale;
2774- } else if (kResourceType == UbuntuNativeInterface::FormFactor) {
2775+ } else if (kResourceType == QMirClientNativeInterface::FormFactor) {
2776 return &ubuntuScreen->mFormFactor;
2777 } else
2778 return NULL;
2779 }
2780
2781-// Changes to these properties are emitted via the UbuntuNativeInterface::windowPropertyChanged
2782-// signal fired by UbuntuWindow. Connect to this signal for these properties updates.
2783-QVariantMap UbuntuNativeInterface::windowProperties(QPlatformWindow *window) const
2784+// Changes to these properties are emitted via the QMirClientNativeInterface::windowPropertyChanged
2785+// signal fired by QMirClientWindow. Connect to this signal for these properties updates.
2786+QVariantMap QMirClientNativeInterface::windowProperties(QPlatformWindow *window) const
2787 {
2788 QVariantMap propertyMap;
2789- auto w = static_cast<UbuntuWindow*>(window);
2790+ auto w = static_cast<QMirClientWindow*>(window);
2791 if (w) {
2792 propertyMap.insert("scale", w->scale());
2793 propertyMap.insert("formFactor", w->formFactor());
2794@@ -167,9 +191,9 @@
2795 return propertyMap;
2796 }
2797
2798-QVariant UbuntuNativeInterface::windowProperty(QPlatformWindow *window, const QString &name) const
2799+QVariant QMirClientNativeInterface::windowProperty(QPlatformWindow *window, const QString &name) const
2800 {
2801- auto w = static_cast<UbuntuWindow*>(window);
2802+ auto w = static_cast<QMirClientWindow*>(window);
2803 if (!w) {
2804 return QVariant();
2805 }
2806@@ -185,7 +209,7 @@
2807 }
2808 }
2809
2810-QVariant UbuntuNativeInterface::windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const
2811+QVariant QMirClientNativeInterface::windowProperty(QPlatformWindow *window, const QString &name, const QVariant &defaultValue) const
2812 {
2813 QVariant returnVal = windowProperty(window, name);
2814 if (!returnVal.isValid()) {
2815
2816=== renamed file 'src/ubuntumirclient/nativeinterface.h' => 'src/ubuntumirclient/qmirclientnativeinterface.h'
2817--- src/ubuntumirclient/nativeinterface.h 2016-06-21 12:17:55 +0000
2818+++ src/ubuntumirclient/qmirclientnativeinterface.h 2017-02-08 16:34:34 +0000
2819@@ -1,35 +1,59 @@
2820-/*
2821- * Copyright (C) 2014,2016 Canonical, Ltd.
2822- *
2823- * This program is free software: you can redistribute it and/or modify it under
2824- * the terms of the GNU Lesser General Public License version 3, as published by
2825- * the Free Software Foundation.
2826- *
2827- * This program is distributed in the hope that it will be useful, but WITHOUT
2828- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
2829- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2830- * Lesser General Public License for more details.
2831- *
2832- * You should have received a copy of the GNU Lesser General Public License
2833- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2834- */
2835-
2836-#ifndef UBUNTU_NATIVE_INTERFACE_H
2837-#define UBUNTU_NATIVE_INTERFACE_H
2838+/****************************************************************************
2839+**
2840+** Copyright (C) 2016 Canonical, Ltd.
2841+** Contact: https://www.qt.io/licensing/
2842+**
2843+** This file is part of the plugins of the Qt Toolkit.
2844+**
2845+** $QT_BEGIN_LICENSE:LGPL$
2846+** Commercial License Usage
2847+** Licensees holding valid commercial Qt licenses may use this file in
2848+** accordance with the commercial license agreement provided with the
2849+** Software or, alternatively, in accordance with the terms contained in
2850+** a written agreement between you and The Qt Company. For licensing terms
2851+** and conditions see https://www.qt.io/terms-conditions. For further
2852+** information use the contact form at https://www.qt.io/contact-us.
2853+**
2854+** GNU Lesser General Public License Usage
2855+** Alternatively, this file may be used under the terms of the GNU Lesser
2856+** General Public License version 3 as published by the Free Software
2857+** Foundation and appearing in the file LICENSE.LGPL3 included in the
2858+** packaging of this file. Please review the following information to
2859+** ensure the GNU Lesser General Public License version 3 requirements
2860+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2861+**
2862+** GNU General Public License Usage
2863+** Alternatively, this file may be used under the terms of the GNU
2864+** General Public License version 2.0 or (at your option) the GNU General
2865+** Public license version 3 or any later version approved by the KDE Free
2866+** Qt Foundation. The licenses are as published by the Free Software
2867+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2868+** included in the packaging of this file. Please review the following
2869+** information to ensure the GNU General Public License requirements will
2870+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2871+** https://www.gnu.org/licenses/gpl-3.0.html.
2872+**
2873+** $QT_END_LICENSE$
2874+**
2875+****************************************************************************/
2876+
2877+
2878+#ifndef QMIRCLIENTNATIVEINTERFACE_H
2879+#define QMIRCLIENTNATIVEINTERFACE_H
2880
2881 #include <qpa/qplatformnativeinterface.h>
2882
2883-#include "integration.h"
2884+#include "qmirclientintegration.h"
2885
2886 class QPlatformScreen;
2887
2888-class UbuntuNativeInterface : public QPlatformNativeInterface {
2889+class QMirClientNativeInterface : public QPlatformNativeInterface {
2890 Q_OBJECT
2891 public:
2892 enum ResourceType { EglDisplay, EglContext, NativeOrientation, Display, MirConnection, MirSurface, Scale, FormFactor };
2893
2894- UbuntuNativeInterface(const UbuntuClientIntegration *integration);
2895- ~UbuntuNativeInterface();
2896+ QMirClientNativeInterface(const QMirClientClientIntegration *integration);
2897+ ~QMirClientNativeInterface();
2898
2899 // QPlatformNativeInterface methods.
2900 void* nativeResourceForIntegration(const QByteArray &resource) override;
2901@@ -51,9 +75,9 @@
2902 void screenPropertyChanged(QPlatformScreen *screen, const QString &propertyName);
2903
2904 private:
2905- const UbuntuClientIntegration *mIntegration;
2906+ const QMirClientClientIntegration *mIntegration;
2907 const QByteArray mGenericEventFilterType;
2908 Qt::ScreenOrientation* mNativeOrientation;
2909 };
2910
2911-#endif // UBUNTU_NATIVE_INTERFACE_H
2912+#endif // QMIRCLIENTNATIVEINTERFACE_H
2913
2914=== renamed file 'src/ubuntumirclient/orientationchangeevent_p.h' => 'src/ubuntumirclient/qmirclientorientationchangeevent_p.h'
2915--- src/ubuntumirclient/orientationchangeevent_p.h 2015-08-06 14:14:39 +0000
2916+++ src/ubuntumirclient/qmirclientorientationchangeevent_p.h 2017-02-08 16:34:34 +0000
2917@@ -1,24 +1,48 @@
2918-/*
2919- * Copyright (C) 2014 Canonical, Ltd.
2920- *
2921- * This program is free software: you can redistribute it and/or modify it under
2922- * the terms of the GNU Lesser General Public License version 3, as published by
2923- * the Free Software Foundation.
2924- *
2925- * This program is distributed in the hope that it will be useful, but WITHOUT
2926- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
2927- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2928- * Lesser General Public License for more details.
2929- *
2930- * You should have received a copy of the GNU Lesser General Public License
2931- * along with this program. If not, see <http://www.gnu.org/licenses/>.
2932- */
2933-
2934-#ifndef ORIENTATIONCHANGEEVENT_P_H
2935-#define ORIENTATIONCHANGEEVENT_P_H
2936+/****************************************************************************
2937+**
2938+** Copyright (C) 2016 Canonical, Ltd.
2939+** Contact: https://www.qt.io/licensing/
2940+**
2941+** This file is part of the plugins of the Qt Toolkit.
2942+**
2943+** $QT_BEGIN_LICENSE:LGPL$
2944+** Commercial License Usage
2945+** Licensees holding valid commercial Qt licenses may use this file in
2946+** accordance with the commercial license agreement provided with the
2947+** Software or, alternatively, in accordance with the terms contained in
2948+** a written agreement between you and The Qt Company. For licensing terms
2949+** and conditions see https://www.qt.io/terms-conditions. For further
2950+** information use the contact form at https://www.qt.io/contact-us.
2951+**
2952+** GNU Lesser General Public License Usage
2953+** Alternatively, this file may be used under the terms of the GNU Lesser
2954+** General Public License version 3 as published by the Free Software
2955+** Foundation and appearing in the file LICENSE.LGPL3 included in the
2956+** packaging of this file. Please review the following information to
2957+** ensure the GNU Lesser General Public License version 3 requirements
2958+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
2959+**
2960+** GNU General Public License Usage
2961+** Alternatively, this file may be used under the terms of the GNU
2962+** General Public License version 2.0 or (at your option) the GNU General
2963+** Public license version 3 or any later version approved by the KDE Free
2964+** Qt Foundation. The licenses are as published by the Free Software
2965+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
2966+** included in the packaging of this file. Please review the following
2967+** information to ensure the GNU General Public License requirements will
2968+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
2969+** https://www.gnu.org/licenses/gpl-3.0.html.
2970+**
2971+** $QT_END_LICENSE$
2972+**
2973+****************************************************************************/
2974+
2975+
2976+#ifndef QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
2977+#define QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
2978
2979 #include <QEvent>
2980-#include "logging.h"
2981+#include "qmirclientlogging.h"
2982
2983 class OrientationChangeEvent : public QEvent {
2984 public:
2985@@ -34,4 +58,4 @@
2986 Orientation mOrientation;
2987 };
2988
2989-#endif // ORIENTATIONCHANGEEVENT_P_H
2990+#endif // QMIRCLIENTORIENTATIONCHANGEEVENT_P_H
2991
2992=== renamed file 'src/ubuntumirclient/platformservices.cpp' => 'src/ubuntumirclient/qmirclientplatformservices.cpp'
2993--- src/ubuntumirclient/platformservices.cpp 2014-06-18 23:10:00 +0000
2994+++ src/ubuntumirclient/qmirclientplatformservices.cpp 2017-02-08 16:34:34 +0000
2995@@ -1,37 +1,61 @@
2996-/*
2997- * Copyright (C) 2014 Canonical, Ltd.
2998- *
2999- * This program is free software: you can redistribute it and/or modify it under
3000- * the terms of the GNU Lesser General Public License version 3, as published by
3001- * the Free Software Foundation.
3002- *
3003- * This program is distributed in the hope that it will be useful, but WITHOUT
3004- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3005- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3006- * Lesser General Public License for more details.
3007- *
3008- * You should have received a copy of the GNU Lesser General Public License
3009- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3010- */
3011-
3012-#include "platformservices.h"
3013+/****************************************************************************
3014+**
3015+** Copyright (C) 2016 Canonical, Ltd.
3016+** Contact: https://www.qt.io/licensing/
3017+**
3018+** This file is part of the plugins of the Qt Toolkit.
3019+**
3020+** $QT_BEGIN_LICENSE:LGPL$
3021+** Commercial License Usage
3022+** Licensees holding valid commercial Qt licenses may use this file in
3023+** accordance with the commercial license agreement provided with the
3024+** Software or, alternatively, in accordance with the terms contained in
3025+** a written agreement between you and The Qt Company. For licensing terms
3026+** and conditions see https://www.qt.io/terms-conditions. For further
3027+** information use the contact form at https://www.qt.io/contact-us.
3028+**
3029+** GNU Lesser General Public License Usage
3030+** Alternatively, this file may be used under the terms of the GNU Lesser
3031+** General Public License version 3 as published by the Free Software
3032+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3033+** packaging of this file. Please review the following information to
3034+** ensure the GNU Lesser General Public License version 3 requirements
3035+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3036+**
3037+** GNU General Public License Usage
3038+** Alternatively, this file may be used under the terms of the GNU
3039+** General Public License version 2.0 or (at your option) the GNU General
3040+** Public license version 3 or any later version approved by the KDE Free
3041+** Qt Foundation. The licenses are as published by the Free Software
3042+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3043+** included in the packaging of this file. Please review the following
3044+** information to ensure the GNU General Public License requirements will
3045+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3046+** https://www.gnu.org/licenses/gpl-3.0.html.
3047+**
3048+** $QT_END_LICENSE$
3049+**
3050+****************************************************************************/
3051+
3052+
3053+#include "qmirclientplatformservices.h"
3054
3055 #include <QUrl>
3056
3057 #include <ubuntu/application/url_dispatcher/service.h>
3058 #include <ubuntu/application/url_dispatcher/session.h>
3059
3060-bool UbuntuPlatformServices::openUrl(const QUrl &url)
3061-{
3062- return callDispatcher(url);
3063-}
3064-
3065-bool UbuntuPlatformServices::openDocument(const QUrl &url)
3066-{
3067- return callDispatcher(url);
3068-}
3069-
3070-bool UbuntuPlatformServices::callDispatcher(const QUrl &url)
3071+bool QMirClientPlatformServices::openUrl(const QUrl &url)
3072+{
3073+ return callDispatcher(url);
3074+}
3075+
3076+bool QMirClientPlatformServices::openDocument(const QUrl &url)
3077+{
3078+ return callDispatcher(url);
3079+}
3080+
3081+bool QMirClientPlatformServices::callDispatcher(const QUrl &url)
3082 {
3083 UAUrlDispatcherSession* session = ua_url_dispatcher_session();
3084 if (!session)
3085
3086=== renamed file 'src/ubuntumirclient/platformservices.h' => 'src/ubuntumirclient/qmirclientplatformservices.h'
3087--- src/ubuntumirclient/platformservices.h 2014-06-18 23:10:00 +0000
3088+++ src/ubuntumirclient/qmirclientplatformservices.h 2017-02-08 16:34:34 +0000
3089@@ -1,27 +1,51 @@
3090-/*
3091- * Copyright (C) 2014 Canonical, Ltd.
3092- *
3093- * This program is free software: you can redistribute it and/or modify it under
3094- * the terms of the GNU Lesser General Public License version 3, as published by
3095- * the Free Software Foundation.
3096- *
3097- * This program is distributed in the hope that it will be useful, but WITHOUT
3098- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3099- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3100- * Lesser General Public License for more details.
3101- *
3102- * You should have received a copy of the GNU Lesser General Public License
3103- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3104- */
3105-
3106-#ifndef UBUNTU_PLATFORM_SERVICES_H
3107-#define UBUNTU_PLATFORM_SERVICES_H
3108+/****************************************************************************
3109+**
3110+** Copyright (C) 2016 Canonical, Ltd.
3111+** Contact: https://www.qt.io/licensing/
3112+**
3113+** This file is part of the plugins of the Qt Toolkit.
3114+**
3115+** $QT_BEGIN_LICENSE:LGPL$
3116+** Commercial License Usage
3117+** Licensees holding valid commercial Qt licenses may use this file in
3118+** accordance with the commercial license agreement provided with the
3119+** Software or, alternatively, in accordance with the terms contained in
3120+** a written agreement between you and The Qt Company. For licensing terms
3121+** and conditions see https://www.qt.io/terms-conditions. For further
3122+** information use the contact form at https://www.qt.io/contact-us.
3123+**
3124+** GNU Lesser General Public License Usage
3125+** Alternatively, this file may be used under the terms of the GNU Lesser
3126+** General Public License version 3 as published by the Free Software
3127+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3128+** packaging of this file. Please review the following information to
3129+** ensure the GNU Lesser General Public License version 3 requirements
3130+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3131+**
3132+** GNU General Public License Usage
3133+** Alternatively, this file may be used under the terms of the GNU
3134+** General Public License version 2.0 or (at your option) the GNU General
3135+** Public license version 3 or any later version approved by the KDE Free
3136+** Qt Foundation. The licenses are as published by the Free Software
3137+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3138+** included in the packaging of this file. Please review the following
3139+** information to ensure the GNU General Public License requirements will
3140+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3141+** https://www.gnu.org/licenses/gpl-3.0.html.
3142+**
3143+** $QT_END_LICENSE$
3144+**
3145+****************************************************************************/
3146+
3147+
3148+#ifndef QMIRCLIENTPLATFORMSERVICES_H
3149+#define QMIRCLIENTPLATFORMSERVICES_H
3150
3151 #include <qpa/qplatformservices.h>
3152 #include <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
3153 #include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
3154
3155-class UbuntuPlatformServices : public QPlatformServices {
3156+class QMirClientPlatformServices : public QPlatformServices {
3157 public:
3158 bool openUrl(const QUrl &url) override;
3159 bool openDocument(const QUrl &url) override;
3160@@ -30,4 +54,4 @@
3161 bool callDispatcher(const QUrl &url);
3162 };
3163
3164-#endif // UBUNTU_PLATFORM_SERVICES_H
3165+#endif // QMIRCLIENTPLATFORMSERVICES_H
3166
3167=== renamed file 'src/ubuntumirclient/plugin.cpp' => 'src/ubuntumirclient/qmirclientplugin.cpp'
3168--- src/ubuntumirclient/plugin.cpp 2016-12-09 17:02:57 +0000
3169+++ src/ubuntumirclient/qmirclientplugin.cpp 2017-02-08 16:34:34 +0000
3170@@ -1,39 +1,60 @@
3171-/*
3172- * Copyright (C) 2014-2016 Canonical, Ltd.
3173- *
3174- * This program is free software: you can redistribute it and/or modify it under
3175- * the terms of the GNU Lesser General Public License version 3, as published by
3176- * the Free Software Foundation.
3177- *
3178- * This program is distributed in the hope that it will be useful, but WITHOUT
3179- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3180- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3181- * Lesser General Public License for more details.
3182- *
3183- * You should have received a copy of the GNU Lesser General Public License
3184- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3185- */
3186-
3187-#include "plugin.h"
3188-#include "integration.h"
3189-#include "logging.h"
3190-#include "qpa/qplatformwindow.h"
3191-
3192-Q_LOGGING_CATEGORY(ubuntumirclient, "ubuntumirclient", QtWarningMsg)
3193-
3194-QPlatformIntegration *UbuntuMirClientIntegrationPlugin::create(const QString &system,
3195- const QStringList &/*paramList*/,
3196- int &argc, char **argv)
3197+/****************************************************************************
3198+**
3199+** Copyright (C) 2016 Canonical, Ltd.
3200+** Contact: https://www.qt.io/licensing/
3201+**
3202+** This file is part of the plugins of the Qt Toolkit.
3203+**
3204+** $QT_BEGIN_LICENSE:LGPL$
3205+** Commercial License Usage
3206+** Licensees holding valid commercial Qt licenses may use this file in
3207+** accordance with the commercial license agreement provided with the
3208+** Software or, alternatively, in accordance with the terms contained in
3209+** a written agreement between you and The Qt Company. For licensing terms
3210+** and conditions see https://www.qt.io/terms-conditions. For further
3211+** information use the contact form at https://www.qt.io/contact-us.
3212+**
3213+** GNU Lesser General Public License Usage
3214+** Alternatively, this file may be used under the terms of the GNU Lesser
3215+** General Public License version 3 as published by the Free Software
3216+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3217+** packaging of this file. Please review the following information to
3218+** ensure the GNU Lesser General Public License version 3 requirements
3219+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3220+**
3221+** GNU General Public License Usage
3222+** Alternatively, this file may be used under the terms of the GNU
3223+** General Public License version 2.0 or (at your option) the GNU General
3224+** Public license version 3 or any later version approved by the KDE Free
3225+** Qt Foundation. The licenses are as published by the Free Software
3226+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3227+** included in the packaging of this file. Please review the following
3228+** information to ensure the GNU General Public License requirements will
3229+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3230+** https://www.gnu.org/licenses/gpl-3.0.html.
3231+**
3232+** $QT_END_LICENSE$
3233+**
3234+****************************************************************************/
3235+
3236+
3237+#include "qmirclientplugin.h"
3238+#include "qmirclientintegration.h"
3239+#include "qmirclientlogging.h"
3240+
3241+Q_LOGGING_CATEGORY(mirclient, "qt.qpa.mirclient", QtWarningMsg)
3242+
3243+QPlatformIntegration *QMirClientIntegrationPlugin::create(const QString &system,
3244+ const QStringList &/*paramList*/,
3245+ int &argc, char **argv)
3246 {
3247- qRegisterMetaType<QPlatformWindow*>("QPlatformWindow*");
3248-
3249 if (system.toLower() == QLatin1String("ubuntumirclient")) {
3250 #ifdef PLATFORM_API_TOUCH
3251 setenv("UBUNTU_PLATFORM_API_BACKEND", "touch_mirclient", 1);
3252 #else
3253 setenv("UBUNTU_PLATFORM_API_BACKEND", "desktop_mirclient", 1);
3254 #endif
3255- return new UbuntuClientIntegration(argc, argv);
3256+ return new QMirClientClientIntegration(argc, argv);
3257 } else {
3258 return 0;
3259 }
3260
3261=== renamed file 'src/ubuntumirclient/plugin.h' => 'src/ubuntumirclient/qmirclientplugin.h'
3262--- src/ubuntumirclient/plugin.h 2016-06-24 12:36:24 +0000
3263+++ src/ubuntumirclient/qmirclientplugin.h 2017-02-08 16:34:34 +0000
3264@@ -1,31 +1,56 @@
3265-/*
3266- * Copyright (C) 2014-2016 Canonical, Ltd.
3267- *
3268- * This program is free software: you can redistribute it and/or modify it under
3269- * the terms of the GNU Lesser General Public License version 3, as published by
3270- * the Free Software Foundation.
3271- *
3272- * This program is distributed in the hope that it will be useful, but WITHOUT
3273- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3274- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3275- * Lesser General Public License for more details.
3276- *
3277- * You should have received a copy of the GNU Lesser General Public License
3278- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3279- */
3280-
3281-#ifndef UBUNTU_CLIENT_PLUGIN_H
3282-#define UBUNTU_CLIENT_PLUGIN_H
3283+/****************************************************************************
3284+**
3285+** Copyright (C) 2016 Canonical, Ltd.
3286+** Contact: https://www.qt.io/licensing/
3287+**
3288+** This file is part of the plugins of the Qt Toolkit.
3289+**
3290+** $QT_BEGIN_LICENSE:LGPL$
3291+** Commercial License Usage
3292+** Licensees holding valid commercial Qt licenses may use this file in
3293+** accordance with the commercial license agreement provided with the
3294+** Software or, alternatively, in accordance with the terms contained in
3295+** a written agreement between you and The Qt Company. For licensing terms
3296+** and conditions see https://www.qt.io/terms-conditions. For further
3297+** information use the contact form at https://www.qt.io/contact-us.
3298+**
3299+** GNU Lesser General Public License Usage
3300+** Alternatively, this file may be used under the terms of the GNU Lesser
3301+** General Public License version 3 as published by the Free Software
3302+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3303+** packaging of this file. Please review the following information to
3304+** ensure the GNU Lesser General Public License version 3 requirements
3305+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3306+**
3307+** GNU General Public License Usage
3308+** Alternatively, this file may be used under the terms of the GNU
3309+** General Public License version 2.0 or (at your option) the GNU General
3310+** Public license version 3 or any later version approved by the KDE Free
3311+** Qt Foundation. The licenses are as published by the Free Software
3312+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3313+** included in the packaging of this file. Please review the following
3314+** information to ensure the GNU General Public License requirements will
3315+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3316+** https://www.gnu.org/licenses/gpl-3.0.html.
3317+**
3318+** $QT_END_LICENSE$
3319+**
3320+****************************************************************************/
3321+
3322+
3323+#ifndef QMIRCLIENTPLUGIN_H
3324+#define QMIRCLIENTPLUGIN_H
3325
3326 #include <qpa/qplatformintegrationplugin.h>
3327
3328-class UbuntuMirClientIntegrationPlugin : public QPlatformIntegrationPlugin
3329+class QMirClientIntegrationPlugin : public QPlatformIntegrationPlugin
3330 {
3331 Q_OBJECT
3332 Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "ubuntumirclient.json")
3333
3334 public:
3335- QPlatformIntegration *create(const QString &system, const QStringList &paramList, int &argc, char **argv) override;
3336+ QPlatformIntegration *create(const QString &system, const QStringList &paramList,
3337+ int &argc, char **argv) override;
3338 };
3339
3340-#endif // UBUNTU_CLIENT_PLUGIN_H
3341+#endif // QMIRCLIENTPLUGIN_H
3342
3343=== renamed file 'src/ubuntumirclient/screen.cpp' => 'src/ubuntumirclient/qmirclientscreen.cpp'
3344--- src/ubuntumirclient/screen.cpp 2016-09-14 14:43:12 +0000
3345+++ src/ubuntumirclient/qmirclientscreen.cpp 2017-02-08 16:34:34 +0000
3346@@ -1,24 +1,48 @@
3347-/*
3348- * Copyright (C) 2014-2016 Canonical, Ltd.
3349- *
3350- * This program is free software: you can redistribute it and/or modify it under
3351- * the terms of the GNU Lesser General Public License version 3, as published by
3352- * the Free Software Foundation.
3353- *
3354- * This program is distributed in the hope that it will be useful, but WITHOUT
3355- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3356- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3357- * Lesser General Public License for more details.
3358- *
3359- * You should have received a copy of the GNU Lesser General Public License
3360- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3361- */
3362+/****************************************************************************
3363+**
3364+** Copyright (C) 2014-2016 Canonical, Ltd.
3365+** Contact: https://www.qt.io/licensing/
3366+**
3367+** This file is part of the plugins of the Qt Toolkit.
3368+**
3369+** $QT_BEGIN_LICENSE:LGPL$
3370+** Commercial License Usage
3371+** Licensees holding valid commercial Qt licenses may use this file in
3372+** accordance with the commercial license agreement provided with the
3373+** Software or, alternatively, in accordance with the terms contained in
3374+** a written agreement between you and The Qt Company. For licensing terms
3375+** and conditions see https://www.qt.io/terms-conditions. For further
3376+** information use the contact form at https://www.qt.io/contact-us.
3377+**
3378+** GNU Lesser General Public License Usage
3379+** Alternatively, this file may be used under the terms of the GNU Lesser
3380+** General Public License version 3 as published by the Free Software
3381+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3382+** packaging of this file. Please review the following information to
3383+** ensure the GNU Lesser General Public License version 3 requirements
3384+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3385+**
3386+** GNU General Public License Usage
3387+** Alternatively, this file may be used under the terms of the GNU
3388+** General Public License version 2.0 or (at your option) the GNU General
3389+** Public license version 3 or any later version approved by the KDE Free
3390+** Qt Foundation. The licenses are as published by the Free Software
3391+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3392+** included in the packaging of this file. Please review the following
3393+** information to ensure the GNU General Public License requirements will
3394+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3395+** https://www.gnu.org/licenses/gpl-3.0.html.
3396+**
3397+** $QT_END_LICENSE$
3398+**
3399+****************************************************************************/
3400+
3401
3402 // local
3403-#include "screen.h"
3404-#include "logging.h"
3405-#include "orientationchangeevent_p.h"
3406-#include "nativeinterface.h"
3407+#include "qmirclientscreen.h"
3408+#include "qmirclientlogging.h"
3409+#include "qmirclientorientationchangeevent_p.h"
3410+#include "qmirclientnativeinterface.h"
3411
3412 #include <mir_toolkit/mir_client_library.h>
3413
3414@@ -54,7 +78,7 @@
3415 static_cast<QEvent::Type>(QEvent::registerEventType());
3416
3417
3418-UbuntuScreen::UbuntuScreen(const MirOutput *output, MirConnection *connection)
3419+QMirClientScreen::QMirClientScreen(const MirOutput *output, MirConnection *connection)
3420 : mDevicePixelRatio(1.0)
3421 , mFormat(QImage::Format_RGB32)
3422 , mDepth(32)
3423@@ -67,11 +91,11 @@
3424 setMirOutput(output);
3425 }
3426
3427-UbuntuScreen::~UbuntuScreen()
3428+QMirClientScreen::~QMirClientScreen()
3429 {
3430 }
3431
3432-void UbuntuScreen::customEvent(QEvent* event) {
3433+void QMirClientScreen::customEvent(QEvent* event) {
3434 Q_ASSERT(QThread::currentThread() == thread());
3435
3436 OrientationChangeEvent* oReadingEvent = static_cast<OrientationChangeEvent*>(event);
3437@@ -99,11 +123,11 @@
3438 }
3439
3440 // Raise the event signal so that client apps know the orientation changed
3441- qCDebug(ubuntumirclient, "UbuntuScreen::customEvent - handling orientation change to %s", orientationToStr(mCurrentOrientation));
3442+ qCDebug(mirclient, "QMirClientScreen::customEvent - handling orientation change to %s", orientationToStr(mCurrentOrientation));
3443 QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
3444 }
3445
3446-void UbuntuScreen::handleWindowSurfaceResize(int windowWidth, int windowHeight)
3447+void QMirClientScreen::handleWindowSurfaceResize(int windowWidth, int windowHeight)
3448 {
3449 if ((windowWidth > windowHeight && mGeometry.width() < mGeometry.height())
3450 || (windowWidth < windowHeight && mGeometry.width() > mGeometry.height())) {
3451@@ -120,7 +144,7 @@
3452 mGeometry.setWidth(currGeometry.height());
3453 mGeometry.setHeight(currGeometry.width());
3454
3455- qCDebug(ubuntumirclient, "UbuntuScreen::handleWindowSurfaceResize - new screen geometry (w=%d, h=%d)",
3456+ qCDebug(mirclient, "QMirClientScreen::handleWindowSurfaceResize - new screen geometry (w=%d, h=%d)",
3457 mGeometry.width(), mGeometry.height());
3458 QWindowSystemInterface::handleScreenGeometryChange(screen(),
3459 mGeometry /* newGeometry */,
3460@@ -131,12 +155,12 @@
3461 } else {
3462 mCurrentOrientation = Qt::LandscapeOrientation;
3463 }
3464- qCDebug(ubuntumirclient, "UbuntuScreen::handleWindowSurfaceResize - new orientation %s",orientationToStr(mCurrentOrientation));
3465+ qCDebug(mirclient, "QMirClientScreen::handleWindowSurfaceResize - new orientation %s",orientationToStr(mCurrentOrientation));
3466 QWindowSystemInterface::handleScreenOrientationChange(screen(), mCurrentOrientation);
3467 }
3468 }
3469
3470-void UbuntuScreen::setMirOutput(const MirOutput *output)
3471+void QMirClientScreen::setMirOutput(const MirOutput *output)
3472 {
3473 // Physical screen size (in mm)
3474 mPhysicalSize.setWidth(mir_output_get_physical_width_mm(output));
3475@@ -181,7 +205,7 @@
3476 mCurrentOrientation = (mNativeOrientation == Qt::LandscapeOrientation) ? Qt::LandscapeOrientation : Qt::PortraitOrientation;
3477 }
3478
3479-void UbuntuScreen::updateMirOutput(const MirOutput *output)
3480+void QMirClientScreen::updateMirOutput(const MirOutput *output)
3481 {
3482 auto oldRefreshRate = mRefreshRate;
3483 auto oldScale = mScale;
3484@@ -201,7 +225,7 @@
3485 QWindowSystemInterface::handleScreenRefreshRateChange(screen(), mRefreshRate);
3486 }
3487
3488- auto nativeInterface = static_cast<UbuntuNativeInterface *>(qGuiApp->platformNativeInterface());
3489+ auto nativeInterface = static_cast<QMirClientNativeInterface *>(qGuiApp->platformNativeInterface());
3490 if (!qFuzzyCompare(mScale, oldScale)) {
3491 nativeInterface->screenPropertyChanged(this, QStringLiteral("scale"));
3492 }
3493@@ -210,14 +234,14 @@
3494 }
3495 }
3496
3497-void UbuntuScreen::setAdditionalMirDisplayProperties(float scale, MirFormFactor formFactor, int dpi)
3498+void QMirClientScreen::setAdditionalMirDisplayProperties(float scale, MirFormFactor formFactor, int dpi)
3499 {
3500 if (mDpi != dpi) {
3501 mDpi = dpi;
3502 QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(screen(), dpi, dpi);
3503 }
3504
3505- auto nativeInterface = static_cast<UbuntuNativeInterface *>(qGuiApp->platformNativeInterface());
3506+ auto nativeInterface = static_cast<QMirClientNativeInterface *>(qGuiApp->platformNativeInterface());
3507 if (!qFuzzyCompare(mScale, scale)) {
3508 mScale = scale;
3509 nativeInterface->screenPropertyChanged(this, QStringLiteral("scale"));
3510@@ -228,7 +252,7 @@
3511 }
3512 }
3513
3514-QDpi UbuntuScreen::logicalDpi() const
3515+QDpi QMirClientScreen::logicalDpi() const
3516 {
3517 if (mDpi > 0) {
3518 return QDpi(mDpi, mDpi);
3519
3520=== renamed file 'src/ubuntumirclient/screen.h' => 'src/ubuntumirclient/qmirclientscreen.h'
3521--- src/ubuntumirclient/screen.h 2016-12-19 10:16:55 +0000
3522+++ src/ubuntumirclient/qmirclientscreen.h 2017-02-08 16:34:34 +0000
3523@@ -1,38 +1,62 @@
3524-/*
3525- * Copyright (C) 2014-2016 Canonical, Ltd.
3526- *
3527- * This program is free software: you can redistribute it and/or modify it under
3528- * the terms of the GNU Lesser General Public License version 3, as published by
3529- * the Free Software Foundation.
3530- *
3531- * This program is distributed in the hope that it will be useful, but WITHOUT
3532- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3533- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3534- * Lesser General Public License for more details.
3535- *
3536- * You should have received a copy of the GNU Lesser General Public License
3537- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3538- */
3539-
3540-#ifndef UBUNTU_SCREEN_H
3541-#define UBUNTU_SCREEN_H
3542+/****************************************************************************
3543+**
3544+** Copyright (C) 2014-2016 Canonical, Ltd.
3545+** Contact: https://www.qt.io/licensing/
3546+**
3547+** This file is part of the plugins of the Qt Toolkit.
3548+**
3549+** $QT_BEGIN_LICENSE:LGPL$
3550+** Commercial License Usage
3551+** Licensees holding valid commercial Qt licenses may use this file in
3552+** accordance with the commercial license agreement provided with the
3553+** Software or, alternatively, in accordance with the terms contained in
3554+** a written agreement between you and The Qt Company. For licensing terms
3555+** and conditions see https://www.qt.io/terms-conditions. For further
3556+** information use the contact form at https://www.qt.io/contact-us.
3557+**
3558+** GNU Lesser General Public License Usage
3559+** Alternatively, this file may be used under the terms of the GNU Lesser
3560+** General Public License version 3 as published by the Free Software
3561+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3562+** packaging of this file. Please review the following information to
3563+** ensure the GNU Lesser General Public License version 3 requirements
3564+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3565+**
3566+** GNU General Public License Usage
3567+** Alternatively, this file may be used under the terms of the GNU
3568+** General Public License version 2.0 or (at your option) the GNU General
3569+** Public license version 3 or any later version approved by the KDE Free
3570+** Qt Foundation. The licenses are as published by the Free Software
3571+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3572+** included in the packaging of this file. Please review the following
3573+** information to ensure the GNU General Public License requirements will
3574+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3575+** https://www.gnu.org/licenses/gpl-3.0.html.
3576+**
3577+** $QT_END_LICENSE$
3578+**
3579+****************************************************************************/
3580+
3581+
3582+#ifndef QMIRCLIENTSCREEN_H
3583+#define QMIRCLIENTSCREEN_H
3584
3585 #include <qpa/qplatformscreen.h>
3586 #include <QSurfaceFormat>
3587
3588 #include <mir_toolkit/common.h> // just for MirFormFactor enum
3589
3590-#include "cursor.h"
3591+#include "qmirclientcursor.h"
3592
3593 struct MirConnection;
3594 struct MirOutput;
3595
3596-class UbuntuScreen : public QObject, public QPlatformScreen
3597+class QMirClientScreen : public QObject, public QPlatformScreen
3598 {
3599 Q_OBJECT
3600 public:
3601- UbuntuScreen(const MirOutput *output, MirConnection *connection);
3602- virtual ~UbuntuScreen();
3603+ QMirClientScreen(const MirOutput *output, MirConnection *connection);
3604+ virtual ~QMirClientScreen();
3605
3606 // QPlatformScreen methods.
3607 QImage::Format format() const override { return mFormat; }
3608@@ -44,7 +68,7 @@
3609 QDpi logicalDpi() const override;
3610 Qt::ScreenOrientation nativeOrientation() const override { return mNativeOrientation; }
3611 Qt::ScreenOrientation orientation() const override { return mNativeOrientation; }
3612- QPlatformCursor *cursor() const override { return const_cast<UbuntuCursor*>(&mCursor); }
3613+ QPlatformCursor *cursor() const override { return const_cast<QMirClientCursor*>(&mCursor); }
3614
3615 // Additional Screen properties from Mir
3616 int mirOutputId() const { return mOutputId; }
3617@@ -74,9 +98,9 @@
3618 MirFormFactor mFormFactor;
3619 float mScale;
3620 int mOutputId;
3621- UbuntuCursor mCursor;
3622+ QMirClientCursor mCursor;
3623
3624- friend class UbuntuNativeInterface;
3625+ friend class QMirClientNativeInterface;
3626 };
3627
3628-#endif // UBUNTU_SCREEN_H
3629+#endif // QMIRCLIENTSCREEN_H
3630
3631=== renamed file 'src/ubuntumirclient/screenobserver.cpp' => 'src/ubuntumirclient/qmirclientscreenobserver.cpp'
3632--- src/ubuntumirclient/screenobserver.cpp 2016-09-14 14:43:12 +0000
3633+++ src/ubuntumirclient/qmirclientscreenobserver.cpp 2017-02-08 16:34:34 +0000
3634@@ -1,23 +1,47 @@
3635-/*
3636- * Copyright (C) 2016 Canonical, Ltd.
3637- *
3638- * This program is free software: you can redistribute it and/or modify it under
3639- * the terms of the GNU Lesser General Public License version 3, as published by
3640- * the Free Software Foundation.
3641- *
3642- * This program is distributed in the hope that it will be useful, but WITHOUT
3643- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3644- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3645- * Lesser General Public License for more details.
3646- *
3647- * You should have received a copy of the GNU Lesser General Public License
3648- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3649- */
3650-
3651-#include "screenobserver.h"
3652-#include "screen.h"
3653-#include "window.h"
3654-#include "logging.h"
3655+/****************************************************************************
3656+**
3657+** Copyright (C) 2016 Canonical, Ltd.
3658+** Contact: https://www.qt.io/licensing/
3659+**
3660+** This file is part of the plugins of the Qt Toolkit.
3661+**
3662+** $QT_BEGIN_LICENSE:LGPL$
3663+** Commercial License Usage
3664+** Licensees holding valid commercial Qt licenses may use this file in
3665+** accordance with the commercial license agreement provided with the
3666+** Software or, alternatively, in accordance with the terms contained in
3667+** a written agreement between you and The Qt Company. For licensing terms
3668+** and conditions see https://www.qt.io/terms-conditions. For further
3669+** information use the contact form at https://www.qt.io/contact-us.
3670+**
3671+** GNU Lesser General Public License Usage
3672+** Alternatively, this file may be used under the terms of the GNU Lesser
3673+** General Public License version 3 as published by the Free Software
3674+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3675+** packaging of this file. Please review the following information to
3676+** ensure the GNU Lesser General Public License version 3 requirements
3677+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3678+**
3679+** GNU General Public License Usage
3680+** Alternatively, this file may be used under the terms of the GNU
3681+** General Public License version 2.0 or (at your option) the GNU General
3682+** Public license version 3 or any later version approved by the KDE Free
3683+** Qt Foundation. The licenses are as published by the Free Software
3684+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3685+** included in the packaging of this file. Please review the following
3686+** information to ensure the GNU General Public License requirements will
3687+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3688+** https://www.gnu.org/licenses/gpl-3.0.html.
3689+**
3690+** $QT_END_LICENSE$
3691+**
3692+****************************************************************************/
3693+
3694+
3695+#include "qmirclientscreenobserver.h"
3696+#include "qmirclientscreen.h"
3697+#include "qmirclientwindow.h"
3698+#include "qmirclientlogging.h"
3699
3700 // Qt
3701 #include <QMetaObject>
3702@@ -33,7 +57,7 @@
3703 static void displayConfigurationChangedCallback(MirConnection */*connection*/, void* context)
3704 {
3705 ASSERT(context != NULL);
3706- UbuntuScreenObserver *observer = static_cast<UbuntuScreenObserver *>(context);
3707+ QMirClientScreenObserver *observer = static_cast<QMirClientScreenObserver *>(context);
3708 QMetaObject::invokeMethod(observer, "update");
3709 }
3710
3711@@ -51,14 +75,14 @@
3712 }
3713 } // anonymous namespace
3714
3715-UbuntuScreenObserver::UbuntuScreenObserver(MirConnection *mirConnection)
3716+QMirClientScreenObserver::QMirClientScreenObserver(MirConnection *mirConnection)
3717 : mMirConnection(mirConnection)
3718 {
3719 mir_connection_set_display_config_change_callback(mirConnection, ::displayConfigurationChangedCallback, this);
3720 update();
3721 }
3722
3723-void UbuntuScreenObserver::update()
3724+void QMirClientScreenObserver::update()
3725 {
3726 // Wrap MirDisplayConfiguration to always delete when out of scope
3727 auto configDeleter = [](MirDisplayConfig *config) { mir_display_config_release(config); };
3728@@ -66,22 +90,22 @@
3729 configUp displayConfig(mir_connection_create_display_configuration(mMirConnection), configDeleter);
3730
3731 // Mir only tells us something changed, it is up to us to figure out what.
3732- QList<UbuntuScreen*> newScreenList;
3733- QList<UbuntuScreen*> oldScreenList = mScreenList;
3734+ QList<QMirClientScreen*> newScreenList;
3735+ QList<QMirClientScreen*> oldScreenList = mScreenList;
3736 mScreenList.clear();
3737
3738 for (int i = 0; i < mir_display_config_get_num_outputs(displayConfig.get()); i++) {
3739 const MirOutput *output = mir_display_config_get_output(displayConfig.get(), i);
3740 if (mir_output_is_enabled(output)) {
3741- UbuntuScreen *screen = findScreenWithId(oldScreenList, mir_output_get_id(output));
3742+ QMirClientScreen *screen = findScreenWithId(oldScreenList, mir_output_get_id(output));
3743 if (screen) { // we've already set up this display before
3744 screen->updateMirOutput(output);
3745 oldScreenList.removeAll(screen);
3746 } else {
3747- // new display, so create UbuntuScreen for it
3748- screen = new UbuntuScreen(output, mMirConnection);
3749+ // new display, so create QMirClientScreen for it
3750+ screen = new QMirClientScreen(output, mMirConnection);
3751 newScreenList.append(screen);
3752- qCDebug(ubuntumirclient) << "Added Screen with id" << mir_output_get_id(output)
3753+ qCDebug(mirclient) << "Added Screen with id" << mir_output_get_id(output)
3754 << "and geometry" << screen->geometry();
3755 }
3756 mScreenList.append(screen);
3757@@ -104,22 +128,22 @@
3758 Q_EMIT screenAdded(screen);
3759 }
3760
3761- qCDebug(ubuntumirclient) << "=======================================";
3762+ qCDebug(mirclient) << "=======================================";
3763 for (auto screen: mScreenList) {
3764- qCDebug(ubuntumirclient) << screen << "- id:" << screen->mirOutputId()
3765+ qCDebug(mirclient) << screen << "- id:" << screen->mirOutputId()
3766 << "geometry:" << screen->geometry()
3767 << "form factor:" << mirFormFactorToStr(screen->formFactor())
3768 << "scale:" << screen->scale();
3769 }
3770- qCDebug(ubuntumirclient) << "=======================================";
3771+ qCDebug(mirclient) << "=======================================";
3772 }
3773
3774-UbuntuScreen *UbuntuScreenObserver::findScreenWithId(int id)
3775+QMirClientScreen *QMirClientScreenObserver::findScreenWithId(int id)
3776 {
3777 return findScreenWithId(mScreenList, id);
3778 }
3779
3780-UbuntuScreen *UbuntuScreenObserver::findScreenWithId(const QList<UbuntuScreen *> &list, int id)
3781+QMirClientScreen *QMirClientScreenObserver::findScreenWithId(const QList<QMirClientScreen *> &list, int id)
3782 {
3783 Q_FOREACH (const auto screen, list) {
3784 if (screen->mirOutputId() == id) {
3785@@ -129,7 +153,7 @@
3786 return nullptr;
3787 }
3788
3789-void UbuntuScreenObserver::handleScreenPropertiesChange(UbuntuScreen *screen, int dpi,
3790+void QMirClientScreenObserver::handleScreenPropertiesChange(QMirClientScreen *screen, int dpi,
3791 MirFormFactor formFactor, float scale)
3792 {
3793 screen->setAdditionalMirDisplayProperties(scale, formFactor, dpi);
3794
3795=== renamed file 'src/ubuntumirclient/screenobserver.h' => 'src/ubuntumirclient/qmirclientscreenobserver.h'
3796--- src/ubuntumirclient/screenobserver.h 2016-04-25 09:39:59 +0000
3797+++ src/ubuntumirclient/qmirclientscreenobserver.h 2017-02-08 16:34:34 +0000
3798@@ -1,54 +1,78 @@
3799-/*
3800- * Copyright (C) 2016 Canonical, Ltd.
3801- *
3802- * This program is free software: you can redistribute it and/or modify it under
3803- * the terms of the GNU Lesser General Public License version 3, as published by
3804- * the Free Software Foundation.
3805- *
3806- * This program is distributed in the hope that it will be useful, but WITHOUT
3807- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3808- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3809- * Lesser General Public License for more details.
3810- *
3811- * You should have received a copy of the GNU Lesser General Public License
3812- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3813- */
3814-
3815-#ifndef UBUNTU_SCREEN_OBSERVER_H
3816-#define UBUNTU_SCREEN_OBSERVER_H
3817+/****************************************************************************
3818+**
3819+** Copyright (C) 2016 Canonical, Ltd.
3820+** Contact: https://www.qt.io/licensing/
3821+**
3822+** This file is part of the plugins of the Qt Toolkit.
3823+**
3824+** $QT_BEGIN_LICENSE:LGPL$
3825+** Commercial License Usage
3826+** Licensees holding valid commercial Qt licenses may use this file in
3827+** accordance with the commercial license agreement provided with the
3828+** Software or, alternatively, in accordance with the terms contained in
3829+** a written agreement between you and The Qt Company. For licensing terms
3830+** and conditions see https://www.qt.io/terms-conditions. For further
3831+** information use the contact form at https://www.qt.io/contact-us.
3832+**
3833+** GNU Lesser General Public License Usage
3834+** Alternatively, this file may be used under the terms of the GNU Lesser
3835+** General Public License version 3 as published by the Free Software
3836+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3837+** packaging of this file. Please review the following information to
3838+** ensure the GNU Lesser General Public License version 3 requirements
3839+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3840+**
3841+** GNU General Public License Usage
3842+** Alternatively, this file may be used under the terms of the GNU
3843+** General Public License version 2.0 or (at your option) the GNU General
3844+** Public license version 3 or any later version approved by the KDE Free
3845+** Qt Foundation. The licenses are as published by the Free Software
3846+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3847+** included in the packaging of this file. Please review the following
3848+** information to ensure the GNU General Public License requirements will
3849+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3850+** https://www.gnu.org/licenses/gpl-3.0.html.
3851+**
3852+** $QT_END_LICENSE$
3853+**
3854+****************************************************************************/
3855+
3856+
3857+#ifndef QMIRCLIENTSCREENOBSERVER_H
3858+#define QMIRCLIENTSCREENOBSERVER_H
3859
3860 #include <QObject>
3861
3862 #include <mir_toolkit/mir_connection.h>
3863
3864-class UbuntuScreen;
3865+class QMirClientScreen;
3866
3867-class UbuntuScreenObserver : public QObject
3868+class QMirClientScreenObserver : public QObject
3869 {
3870 Q_OBJECT
3871
3872 public:
3873- UbuntuScreenObserver(MirConnection *connection);
3874-
3875- QList<UbuntuScreen*> screens() const { return mScreenList; }
3876- UbuntuScreen *findScreenWithId(int id);
3877-
3878- void handleScreenPropertiesChange(UbuntuScreen *screen, int dpi,
3879+ QMirClientScreenObserver(MirConnection *connection);
3880+
3881+ QList<QMirClientScreen*> screens() const { return mScreenList; }
3882+ QMirClientScreen *findScreenWithId(int id);
3883+
3884+ void handleScreenPropertiesChange(QMirClientScreen *screen, int dpi,
3885 MirFormFactor formFactor, float scale);
3886
3887 Q_SIGNALS:
3888- void screenAdded(UbuntuScreen *screen);
3889- void screenRemoved(UbuntuScreen *screen);
3890+ void screenAdded(QMirClientScreen *screen);
3891+ void screenRemoved(QMirClientScreen *screen);
3892
3893 private Q_SLOTS:
3894 void update();
3895
3896 private:
3897- UbuntuScreen *findScreenWithId(const QList<UbuntuScreen *> &list, int id);
3898- void removeScreen(UbuntuScreen *screen);
3899+ QMirClientScreen *findScreenWithId(const QList<QMirClientScreen *> &list, int id);
3900+ void removeScreen(QMirClientScreen *screen);
3901
3902 MirConnection *mMirConnection;
3903- QList<UbuntuScreen*> mScreenList;
3904+ QList<QMirClientScreen*> mScreenList;
3905 };
3906
3907-#endif // UBUNTU_SCREEN_OBSERVER_H
3908+#endif // QMIRCLIENTSCREENOBSERVER_H
3909
3910=== renamed file 'src/ubuntumirclient/window.cpp' => 'src/ubuntumirclient/qmirclientwindow.cpp'
3911--- src/ubuntumirclient/window.cpp 2017-01-19 18:27:29 +0000
3912+++ src/ubuntumirclient/qmirclientwindow.cpp 2017-02-08 16:34:34 +0000
3913@@ -1,27 +1,51 @@
3914-/*
3915- * Copyright (C) 2014-2017 Canonical, Ltd.
3916- *
3917- * This program is free software: you can redistribute it and/or modify it under
3918- * the terms of the GNU Lesser General Public License version 3, as published by
3919- * the Free Software Foundation.
3920- *
3921- * This program is distributed in the hope that it will be useful, but WITHOUT
3922- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
3923- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3924- * Lesser General Public License for more details.
3925- *
3926- * You should have received a copy of the GNU Lesser General Public License
3927- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3928- */
3929+/****************************************************************************
3930+**
3931+** Copyright (C) 2014-2016 Canonical, Ltd.
3932+** Contact: https://www.qt.io/licensing/
3933+**
3934+** This file is part of the plugins of the Qt Toolkit.
3935+**
3936+** $QT_BEGIN_LICENSE:LGPL$
3937+** Commercial License Usage
3938+** Licensees holding valid commercial Qt licenses may use this file in
3939+** accordance with the commercial license agreement provided with the
3940+** Software or, alternatively, in accordance with the terms contained in
3941+** a written agreement between you and The Qt Company. For licensing terms
3942+** and conditions see https://www.qt.io/terms-conditions. For further
3943+** information use the contact form at https://www.qt.io/contact-us.
3944+**
3945+** GNU Lesser General Public License Usage
3946+** Alternatively, this file may be used under the terms of the GNU Lesser
3947+** General Public License version 3 as published by the Free Software
3948+** Foundation and appearing in the file LICENSE.LGPL3 included in the
3949+** packaging of this file. Please review the following information to
3950+** ensure the GNU Lesser General Public License version 3 requirements
3951+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
3952+**
3953+** GNU General Public License Usage
3954+** Alternatively, this file may be used under the terms of the GNU
3955+** General Public License version 2.0 or (at your option) the GNU General
3956+** Public license version 3 or any later version approved by the KDE Free
3957+** Qt Foundation. The licenses are as published by the Free Software
3958+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
3959+** included in the packaging of this file. Please review the following
3960+** information to ensure the GNU General Public License requirements will
3961+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
3962+** https://www.gnu.org/licenses/gpl-3.0.html.
3963+**
3964+** $QT_END_LICENSE$
3965+**
3966+****************************************************************************/
3967+
3968
3969 // Local
3970-#include "window.h"
3971-#include "debugextension.h"
3972-#include "nativeinterface.h"
3973-#include "input.h"
3974-#include "integration.h"
3975-#include "screen.h"
3976-#include "logging.h"
3977+#include "qmirclientwindow.h"
3978+#include "qmirclientdebugextension.h"
3979+#include "qmirclientnativeinterface.h"
3980+#include "qmirclientinput.h"
3981+#include "qmirclientintegration.h"
3982+#include "qmirclientscreen.h"
3983+#include "qmirclientlogging.h"
3984
3985 #include <mir_toolkit/mir_client_library.h>
3986 #include <mir_toolkit/version.h>
3987@@ -31,21 +55,20 @@
3988 #include <QMutexLocker>
3989 #include <QSize>
3990 #include <QtMath>
3991-#include <private/qeglconvenience_p.h>
3992-#include <private/qguiapplication_p.h>
3993+#include <QtGui/private/qguiapplication_p.h>
3994+#include <QtPlatformSupport/private/qeglconvenience_p.h>
3995
3996 // Platform API
3997 #include <ubuntu/application/instance.h>
3998
3999 #include <EGL/egl.h>
4000
4001-Q_LOGGING_CATEGORY(ubuntumirclientBufferSwap, "ubuntumirclient.bufferSwap", QtWarningMsg)
4002+Q_LOGGING_CATEGORY(mirclientBufferSwap, "qt.qpa.mirclient.bufferSwap", QtWarningMsg)
4003
4004+namespace
4005+{
4006 const Qt::WindowType LowChromeWindowHint = (Qt::WindowType)0x00800000;
4007
4008-namespace
4009-{
4010-
4011 // FIXME: this used to be defined by platform-api, but it's been removed in v3. Change ubuntu-keyboard to use
4012 // a different enum for window roles.
4013 enum UAUiWindowRole {
4014@@ -196,10 +219,10 @@
4015 return static_cast<UAUiWindowRole>(role);
4016 }
4017
4018-UbuntuWindow *transientParentFor(QWindow *window)
4019+QMirClientWindow *transientParentFor(QWindow *window)
4020 {
4021 QWindow *parent = window->transientParent();
4022- return parent ? static_cast<UbuntuWindow *>(parent->handle()) : nullptr;
4023+ return parent ? static_cast<QMirClientWindow *>(parent->handle()) : nullptr;
4024 }
4025
4026 bool requiresParent(const MirSurfaceType type)
4027@@ -222,7 +245,7 @@
4028 return requiresParent(qtWindowTypeToMirSurfaceType(type));
4029 }
4030
4031-Spec makeSurfaceSpec(QWindow *window, MirPixelFormat pixelFormat, UbuntuWindow *parentWindowHandle,
4032+Spec makeSurfaceSpec(QWindow *window, MirPixelFormat pixelFormat, QMirClientWindow *parentWindowHandle,
4033 MirConnection *connection)
4034 {
4035 const auto geometry = window->geometry();
4036@@ -273,7 +296,7 @@
4037 break;
4038 }
4039
4040- qCDebug(ubuntumirclient, "makeSurfaceSpec(window=%p): %s spec (type=0x%x, position=(%d, %d)px, size=(%dx%d)px)",
4041+ qCDebug(mirclient, "makeSurfaceSpec(window=%p): %s spec (type=0x%x, position=(%d, %d)px, size=(%dx%d)px)",
4042 window, mirSurfaceTypeToStr(type), window->type(), location.left, location.top, width, height);
4043
4044 return std::move(spec);
4045@@ -297,7 +320,7 @@
4046 }
4047 }
4048
4049-MirSurface *createMirSurface(QWindow *window, int mirOutputId, UbuntuWindow *parentWindowHandle,
4050+MirSurface *createMirSurface(QWindow *window, int mirOutputId, QMirClientWindow *parentWindowHandle,
4051 MirPixelFormat pixelFormat, MirConnection *connection,
4052 mir_surface_event_callback inputCallback, void *inputContext)
4053 {
4054@@ -328,9 +351,9 @@
4055 return surface;
4056 }
4057
4058-UbuntuWindow *getParentIfNecessary(QWindow *window, UbuntuInput *input)
4059+QMirClientWindow *getParentIfNecessary(QWindow *window, QMirClientInput *input)
4060 {
4061- UbuntuWindow *parentWindowHandle = nullptr;
4062+ QMirClientWindow *parentWindowHandle = nullptr;
4063 if (requiresParent(window->type())) {
4064 parentWindowHandle = transientParentFor(window);
4065 if (parentWindowHandle == nullptr) {
4066@@ -344,7 +367,7 @@
4067
4068 MirPixelFormat disableAlphaBufferIfPossible(MirPixelFormat pixelFormat)
4069 {
4070- switch(pixelFormat) {
4071+ switch (pixelFormat) {
4072 case mir_pixel_format_abgr_8888:
4073 return mir_pixel_format_xbgr_8888;
4074 case mir_pixel_format_argb_8888:
4075@@ -378,7 +401,7 @@
4076 class UbuntuSurface
4077 {
4078 public:
4079- UbuntuSurface(UbuntuWindow *platformWindow, EGLDisplay display, UbuntuInput *input, MirConnection *connection);
4080+ UbuntuSurface(QMirClientWindow *platformWindow, EGLDisplay display, QMirClientInput *input, MirConnection *connection);
4081 ~UbuntuSurface();
4082
4083 UbuntuSurface(const UbuntuSurface &) = delete;
4084@@ -416,10 +439,10 @@
4085 void postEvent(const MirEvent *event);
4086
4087 QWindow * const mWindow;
4088- UbuntuWindow * const mPlatformWindow;
4089- UbuntuInput * const mInput;
4090+ QMirClientWindow * const mPlatformWindow;
4091+ QMirClientInput * const mInput;
4092 MirConnection * const mConnection;
4093- UbuntuWindow * mParentWindowHandle{nullptr};
4094+ QMirClientWindow * mParentWindowHandle{nullptr};
4095
4096 MirSurface* mMirSurface;
4097 const EGLDisplay mEglDisplay;
4098@@ -437,7 +460,7 @@
4099 QString mPersistentIdStr;
4100 };
4101
4102-UbuntuSurface::UbuntuSurface(UbuntuWindow *platformWindow, EGLDisplay display, UbuntuInput *input, MirConnection *connection)
4103+UbuntuSurface::UbuntuSurface(QMirClientWindow *platformWindow, EGLDisplay display, QMirClientInput *input, MirConnection *connection)
4104 : mWindow(platformWindow->window())
4105 , mPlatformWindow(platformWindow)
4106 , mInput(input)
4107@@ -453,12 +476,12 @@
4108 if (config == 0) {
4109 // Older Intel Atom-based devices only support OpenGL 1.4 compatibility profile but by default
4110 // QML asks for at least OpenGL 2.0. The XCB GLX backend ignores this request and returns a
4111- // 1.4 context, but the XCB EGL backend tries to honour it, and fails. The 1.4 context appears to
4112+ // 1.4 context, but the XCB EGL backend tries to honor it, and fails. The 1.4 context appears to
4113 // have sufficient capabilities on MESA (i915) to render correctly however. So reduce the default
4114 // requested OpenGL version to 1.0 to ensure EGL will give us a working context (lp:1549455).
4115 static const bool isMesa = QString(eglQueryString(display, EGL_VENDOR)).contains(QStringLiteral("Mesa"));
4116 if (isMesa) {
4117- qCDebug(ubuntumirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
4118+ qCDebug(mirclientGraphics, "Attempting to choose OpenGL 1.4 context which may suit Mesa");
4119 mFormat.setMajorVersion(1);
4120 mFormat.setMinorVersion(4);
4121 config = q_configFromGLFormat(display, mFormat, true);
4122@@ -475,12 +498,12 @@
4123 mPixelFormat = mir_connection_get_egl_pixel_format(connection, display, config);
4124 // But the chosen EGLConfig might have an alpha buffer enabled, even if not requested by the client.
4125 // If that's the case, try to edit the chosen pixel format in order to disable the alpha buffer.
4126- // This is an optimisation for the compositor, as it can avoid blending this surface.
4127+ // This is an optimization for the compositor, as it can avoid blending this surface.
4128 if (mWindow->requestedFormat().alphaBufferSize() < 0) {
4129 mPixelFormat = disableAlphaBufferIfPossible(mPixelFormat);
4130 }
4131
4132- const auto outputId = static_cast<UbuntuScreen *>(mWindow->screen()->handle())->mirOutputId();
4133+ const auto outputId = static_cast<QMirClientScreen *>(mWindow->screen()->handle())->mirOutputId();
4134
4135 mParentWindowHandle = getParentIfNecessary(mWindow, input);
4136
4137@@ -503,12 +526,12 @@
4138 platformWindow->QPlatformWindow::setGeometry(geom);
4139 QWindowSystemInterface::handleGeometryChange(mWindow, geom);
4140
4141- qCDebug(ubuntumirclient) << "Created surface with geometry:" << geom << "title:" << mWindow->title()
4142- << "role:" << roleFor(mWindow);
4143- qCDebug(ubuntumirclientGraphics)
4144- << "Requested format:" << mWindow->requestedFormat()
4145- << "\nActual format:" << mFormat
4146- << "with associated Mir pixel format:" << mirPixelFormatToStr(mPixelFormat);
4147+ qCDebug(mirclient) << "Created surface with geometry:" << geom << "title:" << mWindow->title()
4148+ << "role:" << roleFor(mWindow);
4149+ qCDebug(mirclientGraphics)
4150+ << "Requested format:" << mWindow->requestedFormat()
4151+ << "\nActual format:" << mFormat
4152+ << "with associated Mir pixel format:" << mirPixelFormatToStr(mPixelFormat);
4153 }
4154
4155 UbuntuSurface::~UbuntuSurface()
4156@@ -531,14 +554,14 @@
4157 MirRectangle mirRect {0,0,0,0};
4158
4159 if (mParentWindowHandle) {
4160- qCDebug(ubuntumirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, child)", mWindow,
4161+ qCDebug(mirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, child)", mWindow,
4162 newGeometry.x(), newGeometry.y(), newGeometry.width(), newGeometry.height());
4163
4164 mirRect.left = newGeometry.x() - mParentWindowHandle->window()->x();
4165 mirRect.top = newGeometry.y() - mParentWindowHandle->window()->y();
4166
4167 } else {
4168- qCDebug(ubuntumirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, top-level)", mWindow,
4169+ qCDebug(mirclient,"updateGeometry(window=%p, x=%d, y=%d, width=%d, height=%d, top-level)", mWindow,
4170 newGeometry.x(), newGeometry.y(), newGeometry.width(), newGeometry.height());
4171
4172 mirRect.left = newGeometry.x();
4173@@ -627,7 +650,7 @@
4174
4175 if (validSize && (mBufferSize.width() != eglSurfaceWidth || mBufferSize.height() != eglSurfaceHeight)) {
4176
4177- qCDebug(ubuntumirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - size changed (%d, %d) => (%d, %d)",
4178+ qCDebug(mirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - size changed (%d, %d) => (%d, %d)",
4179 mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height(), eglSurfaceWidth, eglSurfaceHeight);
4180
4181 mBufferSize.rwidth() = eglSurfaceWidth;
4182@@ -639,7 +662,7 @@
4183 mPlatformWindow->QPlatformWindow::setGeometry(newGeometry);
4184 QWindowSystemInterface::handleGeometryChange(mWindow, newGeometry);
4185 } else {
4186- qCDebug(ubuntumirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - buffer size (%d,%d)",
4187+ qCDebug(mirclientBufferSwap, "onSwapBuffersDone(window=%p) [%d] - buffer size (%d,%d)",
4188 mWindow, sFrameNumber, mBufferSize.width(), mBufferSize.height());
4189 }
4190 }
4191@@ -664,7 +687,7 @@
4192 const auto resizeEvent = mir_event_get_resize_event(event);
4193 const auto width = mir_resize_event_get_width(resizeEvent);
4194 const auto height = mir_resize_event_get_height(resizeEvent);
4195- qCDebug(ubuntumirclient, "resizeEvent(window=%p, width=%d, height=%d)", mWindow, width, height);
4196+ qCDebug(mirclient, "resizeEvent(window=%p, width=%d, height=%d)", mWindow, width, height);
4197
4198 QMutexLocker lock(&mTargetSizeMutex);
4199 mTargetSize.rwidth() = width;
4200@@ -676,7 +699,7 @@
4201
4202 void UbuntuSurface::setSurfaceParent(MirSurface* parent)
4203 {
4204- qCDebug(ubuntumirclient, "setSurfaceParent(window=%p)", mWindow);
4205+ qCDebug(mirclient, "setSurfaceParent(window=%p)", mWindow);
4206
4207 mParented = true;
4208 Spec spec{mir_connection_create_spec_for_changes(mConnection)};
4209@@ -694,25 +717,25 @@
4210 return mPersistentIdStr;
4211 }
4212
4213-UbuntuWindow::UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface *native,
4214- UbuntuAppStateController *appState, EGLDisplay eglDisplay,
4215- MirConnection *mirConnection, UbuntuDebugExtension *debugExt)
4216+QMirClientWindow::QMirClientWindow(QWindow *w, QMirClientInput *input, QMirClientNativeInterface *native,
4217+ QMirClientAppStateController *appState, EGLDisplay eglDisplay,
4218+ MirConnection *mirConnection, QMirClientDebugExtension *debugExt)
4219 : QObject(nullptr)
4220 , QPlatformWindow(w)
4221 , mId(makeId())
4222 , mWindowState(w->windowState())
4223 , mWindowFlags(w->flags())
4224 , mWindowVisible(false)
4225+ , mAppStateController(appState)
4226 , mDebugExtention(debugExt)
4227 , mNativeInterface(native)
4228- , mAppStateController(appState)
4229 , mSurface(new UbuntuSurface{this, eglDisplay, input, mirConnection})
4230 , mScale(1.0)
4231 , mFormFactor(mir_form_factor_unknown)
4232 {
4233 mWindowExposed = mSurface->mNeedsExposeCatchup == false;
4234
4235- qCDebug(ubuntumirclient, "UbuntuWindow(window=%p, screen=%p, input=%p, surf=%p) with title '%s', role: '%d'",
4236+ qCDebug(mirclient, "QMirClientWindow(window=%p, screen=%p, input=%p, surf=%p) with title '%s', role: '%d'",
4237 w, w->screen()->handle(), input, mSurface.get(), qPrintable(window()->title()), roleFor(window()));
4238
4239 updatePanelHeightHack(mSurface->state() != mir_surface_state_fullscreen);
4240@@ -723,15 +746,15 @@
4241 Q_ARG(QString, "persistentSurfaceId"));
4242 }
4243
4244-UbuntuWindow::~UbuntuWindow()
4245+QMirClientWindow::~QMirClientWindow()
4246 {
4247- qCDebug(ubuntumirclient, "~UbuntuWindow(window=%p)", this);
4248+ qCDebug(mirclient, "~QMirClientWindow(window=%p)", this);
4249 }
4250
4251-void UbuntuWindow::handleSurfaceResized(int width, int height)
4252+void QMirClientWindow::handleSurfaceResized(int width, int height)
4253 {
4254 QMutexLocker lock(&mMutex);
4255- qCDebug(ubuntumirclient, "handleSurfaceResize(window=%p, size=(%dx%d)px", window(), width, height);
4256+ qCDebug(mirclient, "handleSurfaceResize(window=%p, size=(%dx%d)px", window(), width, height);
4257
4258 mSurface->handleSurfaceResized(width, height);
4259
4260@@ -742,17 +765,17 @@
4261 // A mir API to drop the currently held buffer would help here, so that we wouldn't have to redraw twice
4262 auto const numRepaints = mSurface->needsRepaint();
4263 lock.unlock();
4264- qCDebug(ubuntumirclient, "handleSurfaceResize(window=%p) redraw %d times", window(), numRepaints);
4265+ qCDebug(mirclient, "handleSurfaceResize(window=%p) redraw %d times", window(), numRepaints);
4266 for (int i = 0; i < numRepaints; i++) {
4267- qCDebug(ubuntumirclient, "handleSurfaceResize(window=%p) repainting size=(%dx%d)dp", window(), geometry().size().width(), geometry().size().height());
4268+ qCDebug(mirclient, "handleSurfaceResize(window=%p) repainting size=(%dx%d)dp", window(), geometry().size().width(), geometry().size().height());
4269 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
4270 }
4271 }
4272
4273-void UbuntuWindow::handleSurfaceExposeChange(bool exposed)
4274+void QMirClientWindow::handleSurfaceExposeChange(bool exposed)
4275 {
4276 QMutexLocker lock(&mMutex);
4277- qCDebug(ubuntumirclient, "handleSurfaceExposeChange(window=%p, exposed=%s)", window(), exposed ? "true" : "false");
4278+ qCDebug(mirclient, "handleSurfaceExposeChange(window=%p, exposed=%s)", window(), exposed ? "true" : "false");
4279
4280 mSurface->mNeedsExposeCatchup = false;
4281 if (mWindowExposed == exposed) return;
4282@@ -762,22 +785,27 @@
4283 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
4284 }
4285
4286-void UbuntuWindow::handleSurfaceFocusChanged(bool focused)
4287+void QMirClientWindow::handleSurfaceFocusChanged(bool focused)
4288 {
4289- qCDebug(ubuntumirclient, "handleSurfaceFocusChanged(window=%p, focused=%d)", window(), focused);
4290+ qCDebug(mirclient, "handleSurfaceFocusChanged(window=%p, focused=%d)", window(), focused);
4291
4292 if (focused) {
4293 mAppStateController->setWindowFocused(true);
4294 QWindowSystemInterface::handleWindowActivated(window(), Qt::ActiveWindowFocusReason);
4295 } else {
4296- QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
4297- mAppStateController->setWindowFocused(false);
4298+ // Flush events so that we update QGuiApplicationPrivate::focus_window first
4299+ QWindowSystemInterface::flushWindowSystemEvents(QEventLoop::ExcludeUserInputEvents);
4300+
4301+ if (window() == QGuiApplicationPrivate::focus_window) { // don't handle unfocus if this window wasn't currently focused.
4302+ QWindowSystemInterface::handleWindowActivated(nullptr, Qt::ActiveWindowFocusReason);
4303+ mAppStateController->setWindowFocused(false);
4304+ }
4305 }
4306 }
4307
4308-void UbuntuWindow::handleSurfaceVisibilityChanged(bool visible)
4309+void QMirClientWindow::handleSurfaceVisibilityChanged(bool visible)
4310 {
4311- qCDebug(ubuntumirclient, "handleSurfaceVisibilityChanged(window=%p, visible=%d)", window(), visible);
4312+ qCDebug(mirclient, "handleSurfaceVisibilityChanged(window=%p, visible=%d)", window(), visible);
4313
4314 if (mWindowVisible == visible) return;
4315 mWindowVisible = visible;
4316@@ -785,9 +813,9 @@
4317 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
4318 }
4319
4320-void UbuntuWindow::handleSurfaceStateChanged(Qt::WindowState state)
4321+void QMirClientWindow::handleSurfaceStateChanged(Qt::WindowState state)
4322 {
4323- qCDebug(ubuntumirclient, "handleSurfaceStateChanged(window=%p, %s)", window(), qtWindowStateToStr(state));
4324+ qCDebug(mirclient, "handleSurfaceStateChanged(window=%p, %s)", window(), qtWindowStateToStr(state));
4325
4326 if (mWindowState == state) return;
4327 mWindowState = state;
4328@@ -795,10 +823,10 @@
4329 QWindowSystemInterface::handleWindowStateChanged(window(), state);
4330 }
4331
4332-void UbuntuWindow::setWindowState(Qt::WindowState state)
4333+void QMirClientWindow::setWindowState(Qt::WindowState state)
4334 {
4335 QMutexLocker lock(&mMutex);
4336- qCDebug(ubuntumirclient, "setWindowState(window=%p, %s)", this, qtWindowStateToStr(state));
4337+ qCDebug(mirclient, "setWindowState(window=%p, %s)", this, qtWindowStateToStr(state));
4338
4339 if (mWindowState == state) return;
4340 mWindowState = state;
4341@@ -807,10 +835,10 @@
4342 updateSurfaceState();
4343 }
4344
4345-void UbuntuWindow::setWindowFlags(Qt::WindowFlags flags)
4346+void QMirClientWindow::setWindowFlags(Qt::WindowFlags flags)
4347 {
4348 QMutexLocker lock(&mMutex);
4349- qCDebug(ubuntumirclient, "setWindowFlags(window=%p, 0x%x)", this, (int)flags);
4350+ qCDebug(mirclient, "setWindowFlags(window=%p, 0x%x)", this, (int)flags);
4351
4352 if (mWindowFlags == flags) return;
4353 mWindowFlags = flags;
4354@@ -824,7 +852,7 @@
4355 window is always on the top-left corner, right below the indicators panel if not
4356 in fullscreen.
4357 */
4358-void UbuntuWindow::updatePanelHeightHack(bool enable)
4359+void QMirClientWindow::updatePanelHeightHack(bool enable)
4360 {
4361 if ((window()->type() & Qt::WindowType_Mask) != Qt::Window) { // only plain windows get the hack
4362 return;
4363@@ -846,7 +874,7 @@
4364 }
4365 }
4366
4367-QRect UbuntuWindow::geometry() const
4368+QRect QMirClientWindow::geometry() const
4369 {
4370 if (mDebugExtention) {
4371 auto geom = QPlatformWindow::geometry();
4372@@ -857,16 +885,16 @@
4373 }
4374 }
4375
4376-void UbuntuWindow::setGeometry(const QRect &rect)
4377+void QMirClientWindow::setGeometry(const QRect &rect)
4378 {
4379 QMutexLocker lock(&mMutex);
4380
4381 if (window()->windowState() == Qt::WindowFullScreen || window()->windowState() == Qt::WindowMaximized) {
4382- qCDebug(ubuntumirclient, "setGeometry(window=%p) - not resizing, window is maximized or fullscreen", window());
4383+ qCDebug(mirclient, "setGeometry(window=%p) - not resizing, window is maximized or fullscreen", window());
4384 return;
4385 }
4386
4387- qCDebug(ubuntumirclient, "setGeometry (window=%p, position=(%d, %d)dp, size=(%dx%d)dp)",
4388+ qCDebug(mirclient, "setGeometry (window=%p, position=(%d, %d)dp, size=(%dx%d)dp)",
4389 window(), rect.x(), rect.y(), rect.width(), rect.height());
4390 // Immediately update internal geometry so Qt believes position updated
4391 QRect newPosition(geometry());
4392@@ -877,10 +905,10 @@
4393 // Note: don't call handleGeometryChange here, wait to see what Mir replies with.
4394 }
4395
4396-void UbuntuWindow::setVisible(bool visible)
4397+void QMirClientWindow::setVisible(bool visible)
4398 {
4399 QMutexLocker lock(&mMutex);
4400- qCDebug(ubuntumirclient, "setVisible (window=%p, visible=%s)", window(), visible ? "true" : "false");
4401+ qCDebug(mirclient, "setVisible (window=%p, visible=%s)", window(), visible ? "true" : "false");
4402
4403 if (mWindowVisible == visible) return;
4404 mWindowVisible = visible;
4405@@ -901,36 +929,36 @@
4406 QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
4407 }
4408
4409-void UbuntuWindow::setWindowTitle(const QString& title)
4410+void QMirClientWindow::setWindowTitle(const QString& title)
4411 {
4412 QMutexLocker lock(&mMutex);
4413- qCDebug(ubuntumirclient, "setWindowTitle(window=%p) title=%s)", window(), title.toUtf8().constData());
4414+ qCDebug(mirclient, "setWindowTitle(window=%p) title=%s)", window(), title.toUtf8().constData());
4415 mSurface->updateTitle(title);
4416 }
4417
4418-void UbuntuWindow::propagateSizeHints()
4419+void QMirClientWindow::propagateSizeHints()
4420 {
4421 QMutexLocker lock(&mMutex);
4422 const auto win = window();
4423- qCDebug(ubuntumirclient, "propagateSizeHints(window=%p) min(%d,%d), max(%d,%d) increment(%d, %d)",
4424+ qCDebug(mirclient, "propagateSizeHints(window=%p) min(%d,%d), max(%d,%d) increment(%d, %d)",
4425 win, win->minimumSize().width(), win->minimumSize().height(),
4426 win->maximumSize().width(), win->maximumSize().height(),
4427 win->sizeIncrement().width(), win->sizeIncrement().height());
4428 mSurface->setSizingConstraints(win->minimumSize(), win->maximumSize(), win->sizeIncrement());
4429 }
4430
4431-bool UbuntuWindow::isExposed() const
4432+bool QMirClientWindow::isExposed() const
4433 {
4434 // mNeedsExposeCatchup because we need to render a frame to get the expose surface event from mir.
4435 return mWindowVisible && (mWindowExposed || (mSurface && mSurface->mNeedsExposeCatchup));
4436 }
4437
4438-QSurfaceFormat UbuntuWindow::format() const
4439+QSurfaceFormat QMirClientWindow::format() const
4440 {
4441 return mSurface->format();
4442 }
4443
4444-QPoint UbuntuWindow::mapToGlobal(const QPoint &pos) const
4445+QPoint QMirClientWindow::mapToGlobal(const QPoint &pos) const
4446 {
4447 if (mDebugExtention) {
4448 return mDebugExtention->mapSurfacePointToScreen(mSurface->mirSurface(), pos);
4449@@ -939,22 +967,22 @@
4450 }
4451 }
4452
4453-void* UbuntuWindow::eglSurface() const
4454+void* QMirClientWindow::eglSurface() const
4455 {
4456 return mSurface->eglSurface();
4457 }
4458
4459-MirSurface *UbuntuWindow::mirSurface() const
4460+MirSurface *QMirClientWindow::mirSurface() const
4461 {
4462 return mSurface->mirSurface();
4463 }
4464
4465-WId UbuntuWindow::winId() const
4466+WId QMirClientWindow::winId() const
4467 {
4468 return mId;
4469 }
4470
4471-void UbuntuWindow::onSwapBuffersDone()
4472+void QMirClientWindow::onSwapBuffersDone()
4473 {
4474 QMutexLocker lock(&mMutex);
4475 mSurface->onSwapBuffersDone();
4476@@ -968,7 +996,7 @@
4477 }
4478 }
4479
4480-void UbuntuWindow::handleScreenPropertiesChange(MirFormFactor formFactor, float scale)
4481+void QMirClientWindow::handleScreenPropertiesChange(MirFormFactor formFactor, float scale)
4482 {
4483 // Update the scale & form factor native-interface properties for the windows affected
4484 // as there is no convenient way to emit signals for those custom properties on a QScreen
4485@@ -986,12 +1014,12 @@
4486 }
4487 }
4488
4489-void UbuntuWindow::updateSurfaceState()
4490+void QMirClientWindow::updateSurfaceState()
4491 {
4492 QMutexLocker lock(&mMutex);
4493 MirSurfaceState newState = mWindowVisible ? qtWindowStateToMirSurfaceState(mWindowState) :
4494 mir_surface_state_hidden;
4495- qCDebug(ubuntumirclient, "updateSurfaceState (window=%p, surfaceState=%s)", window(), mirSurfaceStateToStr(newState));
4496+ qCDebug(mirclient, "updateSurfaceState (window=%p, surfaceState=%s)", window(), mirSurfaceStateToStr(newState));
4497 if (newState != mSurface->state()) {
4498 mSurface->setState(newState);
4499
4500@@ -1000,7 +1028,7 @@
4501 }
4502 }
4503
4504-QString UbuntuWindow::persistentSurfaceId()
4505+QString QMirClientWindow::persistentSurfaceId()
4506 {
4507 return mSurface->persistentSurfaceId();
4508 }
4509
4510=== renamed file 'src/ubuntumirclient/window.h' => 'src/ubuntumirclient/qmirclientwindow.h'
4511--- src/ubuntumirclient/window.h 2016-12-09 17:02:57 +0000
4512+++ src/ubuntumirclient/qmirclientwindow.h 2017-02-08 16:34:34 +0000
4513@@ -1,21 +1,45 @@
4514-/*
4515- * Copyright (C) 2014-2016 Canonical, Ltd.
4516- *
4517- * This program is free software: you can redistribute it and/or modify it under
4518- * the terms of the GNU Lesser General Public License version 3, as published by
4519- * the Free Software Foundation.
4520- *
4521- * This program is distributed in the hope that it will be useful, but WITHOUT
4522- * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
4523- * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4524- * Lesser General Public License for more details.
4525- *
4526- * You should have received a copy of the GNU Lesser General Public License
4527- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4528- */
4529-
4530-#ifndef UBUNTU_WINDOW_H
4531-#define UBUNTU_WINDOW_H
4532+/****************************************************************************
4533+**
4534+** Copyright (C) 2014-2016 Canonical, Ltd.
4535+** Contact: https://www.qt.io/licensing/
4536+**
4537+** This file is part of the plugins of the Qt Toolkit.
4538+**
4539+** $QT_BEGIN_LICENSE:LGPL$
4540+** Commercial License Usage
4541+** Licensees holding valid commercial Qt licenses may use this file in
4542+** accordance with the commercial license agreement provided with the
4543+** Software or, alternatively, in accordance with the terms contained in
4544+** a written agreement between you and The Qt Company. For licensing terms
4545+** and conditions see https://www.qt.io/terms-conditions. For further
4546+** information use the contact form at https://www.qt.io/contact-us.
4547+**
4548+** GNU Lesser General Public License Usage
4549+** Alternatively, this file may be used under the terms of the GNU Lesser
4550+** General Public License version 3 as published by the Free Software
4551+** Foundation and appearing in the file LICENSE.LGPL3 included in the
4552+** packaging of this file. Please review the following information to
4553+** ensure the GNU Lesser General Public License version 3 requirements
4554+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
4555+**
4556+** GNU General Public License Usage
4557+** Alternatively, this file may be used under the terms of the GNU
4558+** General Public License version 2.0 or (at your option) the GNU General
4559+** Public license version 3 or any later version approved by the KDE Free
4560+** Qt Foundation. The licenses are as published by the Free Software
4561+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
4562+** included in the packaging of this file. Please review the following
4563+** information to ensure the GNU General Public License requirements will
4564+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
4565+** https://www.gnu.org/licenses/gpl-3.0.html.
4566+**
4567+** $QT_END_LICENSE$
4568+**
4569+****************************************************************************/
4570+
4571+
4572+#ifndef QMIRCLIENTWINDOW_H
4573+#define QMIRCLIENTWINDOW_H
4574
4575 #include <qpa/qplatformwindow.h>
4576 #include <QSharedPointer>
4577@@ -27,23 +51,23 @@
4578
4579 #include <EGL/egl.h>
4580
4581-class UbuntuAppStateController;
4582-class UbuntuDebugExtension;
4583-class UbuntuNativeInterface;
4584-class UbuntuInput;
4585-class UbuntuScreen;
4586+class QMirClientAppStateController;
4587+class QMirClientDebugExtension;
4588+class QMirClientNativeInterface;
4589+class QMirClientInput;
4590+class QMirClientScreen;
4591 class UbuntuSurface;
4592 struct MirSurface;
4593 class MirConnection;
4594
4595-class UbuntuWindow : public QObject, public QPlatformWindow
4596+class QMirClientWindow : public QObject, public QPlatformWindow
4597 {
4598 Q_OBJECT
4599 public:
4600- UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface *native,
4601- UbuntuAppStateController *appState, EGLDisplay eglDisplay,
4602- MirConnection *mirConnection, UbuntuDebugExtension *debugExt);
4603- virtual ~UbuntuWindow();
4604+ QMirClientWindow(QWindow *w, QMirClientInput *input, QMirClientNativeInterface *native,
4605+ QMirClientAppStateController *appState, EGLDisplay eglDisplay,
4606+ MirConnection *mirConnection, QMirClientDebugExtension *debugExt);
4607+ virtual ~QMirClientWindow();
4608
4609 // QPlatformWindow methods.
4610 WId winId() const override;
4611@@ -84,14 +108,12 @@
4612 Qt::WindowFlags mWindowFlags;
4613 bool mWindowVisible;
4614 bool mWindowExposed;
4615- UbuntuDebugExtension *mDebugExtention;
4616- UbuntuNativeInterface *mNativeInterface;
4617- UbuntuAppStateController *mAppStateController;
4618+ QMirClientAppStateController *mAppStateController;
4619+ QMirClientDebugExtension *mDebugExtention;
4620+ QMirClientNativeInterface *mNativeInterface;
4621 std::unique_ptr<UbuntuSurface> mSurface;
4622 float mScale;
4623 MirFormFactor mFormFactor;
4624 };
4625
4626-Q_DECLARE_METATYPE(QPlatformWindow*);
4627-
4628-#endif // UBUNTU_WINDOW_H
4629+#endif // QMIRCLIENTWINDOW_H
4630
4631=== modified file 'src/ubuntumirclient/ubuntumirclient.pro'
4632--- src/ubuntumirclient/ubuntumirclient.pro 2016-12-09 17:02:57 +0000
4633+++ src/ubuntumirclient/ubuntumirclient.pro 2017-02-08 16:34:34 +0000
4634@@ -15,40 +15,40 @@
4635 PKGCONFIG += egl mirclient ubuntu-platform-api xkbcommon libcontent-hub
4636
4637 SOURCES = \
4638- backingstore.cpp \
4639- clipboard.cpp \
4640- cursor.cpp \
4641- debugextension.cpp \
4642- desktopwindow.cpp \
4643- glcontext.cpp \
4644- input.cpp \
4645- integration.cpp \
4646- nativeinterface.cpp \
4647- platformservices.cpp \
4648- plugin.cpp \
4649- screen.cpp \
4650- screenobserver.cpp \
4651- window.cpp \
4652- appstatecontroller.cpp
4653+ qmirclientbackingstore.cpp \
4654+ qmirclientclipboard.cpp \
4655+ qmirclientcursor.cpp \
4656+ qmirclientdebugextension.cpp \
4657+ qmirclientdesktopwindow.cpp \
4658+ qmirclientglcontext.cpp \
4659+ qmirclientinput.cpp \
4660+ qmirclientintegration.cpp \
4661+ qmirclientnativeinterface.cpp \
4662+ qmirclientplatformservices.cpp \
4663+ qmirclientplugin.cpp \
4664+ qmirclientscreen.cpp \
4665+ qmirclientscreenobserver.cpp \
4666+ qmirclientwindow.cpp \
4667+ qmirclientappstatecontroller.cpp
4668
4669 HEADERS = \
4670- backingstore.h \
4671- clipboard.h \
4672- cursor.h \
4673- debugextension.h \
4674- desktopwindow.h \
4675- glcontext.h \
4676- input.h \
4677- integration.h \
4678- nativeinterface.h \
4679- orientationchangeevent_p.h \
4680- platformservices.h \
4681- plugin.h \
4682- screenobserver.h \
4683- screen.h \
4684- window.h \
4685- logging.h \
4686- appstatecontroller.h
4687+ qmirclientbackingstore.h \
4688+ qmirclientclipboard.h \
4689+ qmirclientcursor.h \
4690+ qmirclientdebugextension.h \
4691+ qmirclientdesktopwindow.h \
4692+ qmirclientglcontext.h \
4693+ qmirclientinput.h \
4694+ qmirclientintegration.h \
4695+ qmirclientnativeinterface.h \
4696+ qmirclientorientationchangeevent_p.h \
4697+ qmirclientplatformservices.h \
4698+ qmirclientplugin.h \
4699+ qmirclientscreenobserver.h \
4700+ qmirclientscreen.h \
4701+ qmirclientwindow.h \
4702+ qmirclientlogging.h \
4703+ qmirclientappstatecontroller.h
4704
4705 OTHER_FILES += \
4706 ubuntumirclient.json

Subscribers

People subscribed via source and target branches