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