Merge lp:~nick-dedekind/unity8/mirCompositor-appMocks into lp:~unity-team/unity8/mirCompositor
- mirCompositor-appMocks
- Merge into mirCompositor
Proposed by
Nick Dedekind
Status: | Merged |
---|---|
Merged at revision: | 1067 |
Proposed branch: | lp:~nick-dedekind/unity8/mirCompositor-appMocks |
Merge into: | lp:~unity-team/unity8/mirCompositor |
Diff against target: |
692 lines (+299/-48) 10 files modified
tests/mocks/Unity/Application/ApplicationInfo.cpp (+60/-22) tests/mocks/Unity/Application/ApplicationInfo.h (+21/-8) tests/mocks/Unity/Application/ApplicationManager.cpp (+31/-18) tests/mocks/Unity/Application/ApplicationManager.h (+6/-0) tests/mocks/Unity/Application/CMakeLists.txt (+2/-0) tests/mocks/Unity/Application/MirSurfaceItem.cpp (+40/-0) tests/mocks/Unity/Application/MirSurfaceItem.h (+84/-0) tests/mocks/Unity/Application/SurfaceManager.cpp (+16/-0) tests/mocks/Unity/Application/SurfaceManager.h (+26/-0) tests/mocks/Unity/Application/plugin.cpp (+13/-0) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/mirCompositor-appMocks |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | Approve | ||
Review via email: mp+227317@code.launchpad.net |
Commit message
Fixed up AppManager mock for qtmir surfaces.
Description of the change
Fixed up AppManager mock for qtmir surfaces.
To post a comment you must log in.
- 1060. By Nick Dedekind
-
removed qdebug
- 1061. By Nick Dedekind
-
whitespace
Revision history for this message
Daniel d'Andrada (dandrader) wrote : | # |
Revision history for this message
Daniel d'Andrada (dandrader) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp' | |||
2 | --- tests/mocks/Unity/Application/ApplicationInfo.cpp 2014-03-20 10:02:52 +0000 | |||
3 | +++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2014-07-18 16:28:08 +0000 | |||
4 | @@ -15,6 +15,8 @@ | |||
5 | 15 | */ | 15 | */ |
6 | 16 | 16 | ||
7 | 17 | #include "ApplicationInfo.h" | 17 | #include "ApplicationInfo.h" |
8 | 18 | #include "MirSurfaceItem.h" | ||
9 | 19 | #include "SurfaceManager.h" | ||
10 | 18 | 20 | ||
11 | 19 | #include <QGuiApplication> | 21 | #include <QGuiApplication> |
12 | 20 | #include <QQuickItem> | 22 | #include <QQuickItem> |
13 | @@ -24,29 +26,39 @@ | |||
14 | 24 | 26 | ||
15 | 25 | ApplicationInfo::ApplicationInfo(const QString &appId, QObject *parent) | 27 | ApplicationInfo::ApplicationInfo(const QString &appId, QObject *parent) |
16 | 26 | : ApplicationInfoInterface(appId, parent) | 28 | : ApplicationInfoInterface(appId, parent) |
25 | 27 | ,m_appId(appId) | 29 | , m_appId(appId) |
26 | 28 | ,m_stage(MainStage) | 30 | , m_stage(MainStage) |
27 | 29 | ,m_state(Starting) | 31 | , m_state(Starting) |
28 | 30 | ,m_focused(false) | 32 | , m_focused(false) |
29 | 31 | ,m_fullscreen(false) | 33 | , m_fullscreen(false) |
30 | 32 | ,m_windowItem(0) | 34 | , m_windowItem(0) |
31 | 33 | ,m_windowComponent(0) | 35 | , m_windowComponent(0) |
32 | 34 | ,m_parentItem(0) | 36 | , m_parentItem(0) |
33 | 37 | , m_surface(0) | ||
34 | 35 | { | 38 | { |
36 | 36 | QTimer::singleShot(300, this, SLOT(setRunning())); | 39 | connect(this, &ApplicationInfo::stateChanged, this, &ApplicationInfo::onStateChanged); |
37 | 37 | } | 40 | } |
38 | 38 | 41 | ||
39 | 39 | ApplicationInfo::ApplicationInfo(QObject *parent) | 42 | ApplicationInfo::ApplicationInfo(QObject *parent) |
40 | 40 | : ApplicationInfoInterface(QString(), parent) | 43 | : ApplicationInfoInterface(QString(), parent) |
50 | 41 | ,m_stage(MainStage) | 44 | , m_stage(MainStage) |
51 | 42 | ,m_state(Starting) | 45 | , m_state(Starting) |
52 | 43 | ,m_focused(false) | 46 | , m_focused(false) |
53 | 44 | ,m_fullscreen(false) | 47 | , m_fullscreen(false) |
54 | 45 | ,m_windowItem(0) | 48 | , m_windowItem(0) |
55 | 46 | ,m_windowComponent(0) | 49 | , m_windowComponent(0) |
56 | 47 | ,m_parentItem(0) | 50 | , m_parentItem(0) |
57 | 48 | { | 51 | , m_surface(0) |
58 | 49 | QTimer::singleShot(300, this, SLOT(setRunning())); | 52 | { |
59 | 53 | connect(this, &ApplicationInfo::stateChanged, this, &ApplicationInfo::onStateChanged); | ||
60 | 54 | } | ||
61 | 55 | |||
62 | 56 | ApplicationInfo::~ApplicationInfo() | ||
63 | 57 | { | ||
64 | 58 | if (m_surface) { | ||
65 | 59 | Q_EMIT SurfaceManager::singleton()->surfaceDestroyed(m_surface); | ||
66 | 60 | m_surface->deleteLater(); | ||
67 | 61 | } | ||
68 | 50 | } | 62 | } |
69 | 51 | 63 | ||
70 | 52 | void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status status) | 64 | void ApplicationInfo::onWindowComponentStatusChanged(QQmlComponent::Status status) |
71 | @@ -55,10 +67,36 @@ | |||
72 | 55 | doCreateWindowItem(); | 67 | doCreateWindowItem(); |
73 | 56 | } | 68 | } |
74 | 57 | 69 | ||
79 | 58 | void ApplicationInfo::setRunning() | 70 | void ApplicationInfo::onStateChanged(State state) |
80 | 59 | { | 71 | { |
81 | 60 | m_state = Running; | 72 | if (state == ApplicationInfo::Running) { |
82 | 61 | Q_EMIT stateChanged(); | 73 | QTimer::singleShot(1000, this, SLOT(createSurface())); |
83 | 74 | } else if (state == ApplicationInfo::Stopped) { | ||
84 | 75 | destroySurface(); | ||
85 | 76 | } | ||
86 | 77 | } | ||
87 | 78 | |||
88 | 79 | void ApplicationInfo::createSurface() | ||
89 | 80 | { | ||
90 | 81 | if (m_surface || state() == ApplicationInfo::Stopped) return; | ||
91 | 82 | |||
92 | 83 | m_surface = new MirSurfaceItem(name(), | ||
93 | 84 | MirSurfaceItem::Normal, | ||
94 | 85 | fullscreen() ? MirSurfaceItem::Fullscreen : MirSurfaceItem::Maximized, | ||
95 | 86 | screenshot()); | ||
96 | 87 | Q_EMIT surfaceChanged(m_surface); | ||
97 | 88 | Q_EMIT SurfaceManager::singleton()->surfaceCreated(m_surface); | ||
98 | 89 | } | ||
99 | 90 | |||
100 | 91 | void ApplicationInfo::destroySurface() | ||
101 | 92 | { | ||
102 | 93 | if (!m_surface) return; | ||
103 | 94 | MirSurfaceItem* oldSurface = m_surface; | ||
104 | 95 | m_surface = nullptr; | ||
105 | 96 | |||
106 | 97 | Q_EMIT surfaceChanged(nullptr); | ||
107 | 98 | Q_EMIT SurfaceManager::singleton()->surfaceDestroyed(oldSurface); | ||
108 | 99 | oldSurface->deleteLater(); | ||
109 | 62 | } | 100 | } |
110 | 63 | 101 | ||
111 | 64 | void ApplicationInfo::createWindowComponent() | 102 | void ApplicationInfo::createWindowComponent() |
112 | 65 | 103 | ||
113 | === modified file 'tests/mocks/Unity/Application/ApplicationInfo.h' | |||
114 | --- tests/mocks/Unity/Application/ApplicationInfo.h 2014-03-20 10:02:52 +0000 | |||
115 | +++ tests/mocks/Unity/Application/ApplicationInfo.h 2014-07-18 16:28:08 +0000 | |||
116 | @@ -21,6 +21,7 @@ | |||
117 | 21 | #include <QQmlComponent> | 21 | #include <QQmlComponent> |
118 | 22 | 22 | ||
119 | 23 | class QQuickItem; | 23 | class QQuickItem; |
120 | 24 | class MirSurfaceItem; | ||
121 | 24 | 25 | ||
122 | 25 | // unity-api | 26 | // unity-api |
123 | 26 | #include <unity/shell/application/ApplicationInfoInterface.h> | 27 | #include <unity/shell/application/ApplicationInfoInterface.h> |
124 | @@ -36,6 +37,7 @@ | |||
125 | 36 | 37 | ||
126 | 37 | Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) | 38 | Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged) |
127 | 38 | Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged) | 39 | Q_PROPERTY(Stage stage READ stage WRITE setStage NOTIFY stageChanged) |
128 | 40 | Q_PROPERTY(MirSurfaceItem* surface READ surface NOTIFY surfaceChanged) | ||
129 | 39 | 41 | ||
130 | 40 | // Only exists in this fake implementation | 42 | // Only exists in this fake implementation |
131 | 41 | 43 | ||
132 | @@ -45,9 +47,10 @@ | |||
133 | 45 | // QML component used to represent the application window | 47 | // QML component used to represent the application window |
134 | 46 | Q_PROPERTY(QString windowQml READ windowQml WRITE setWindowQml NOTIFY windowQmlChanged) | 48 | Q_PROPERTY(QString windowQml READ windowQml WRITE setWindowQml NOTIFY windowQmlChanged) |
135 | 47 | 49 | ||
137 | 48 | public: | 50 | public: |
138 | 49 | ApplicationInfo(QObject *parent = NULL); | 51 | ApplicationInfo(QObject *parent = NULL); |
139 | 50 | ApplicationInfo(const QString &appId, QObject *parent = NULL); | 52 | ApplicationInfo(const QString &appId, QObject *parent = NULL); |
140 | 53 | ~ApplicationInfo(); | ||
141 | 51 | 54 | ||
142 | 52 | #define IMPLEMENT_PROPERTY(name, Name, type) \ | 55 | #define IMPLEMENT_PROPERTY(name, Name, type) \ |
143 | 53 | public: \ | 56 | public: \ |
144 | @@ -56,11 +59,11 @@ | |||
145 | 56 | { \ | 59 | { \ |
146 | 57 | if (m_##name != value) { \ | 60 | if (m_##name != value) { \ |
147 | 58 | m_##name = value; \ | 61 | m_##name = value; \ |
149 | 59 | Q_EMIT name##Changed(); \ | 62 | Q_EMIT name##Changed(value); \ |
150 | 60 | } \ | 63 | } \ |
151 | 61 | } \ | 64 | } \ |
152 | 62 | Q_SIGNALS: \ | 65 | Q_SIGNALS: \ |
154 | 63 | void name##Changed(); \ | 66 | void name##Changed(const type&); \ |
155 | 64 | private: \ | 67 | private: \ |
156 | 65 | type m_##name; | 68 | type m_##name; |
157 | 66 | 69 | ||
158 | @@ -78,21 +81,31 @@ | |||
159 | 78 | 81 | ||
160 | 79 | #undef IMPLEMENT_PROPERTY | 82 | #undef IMPLEMENT_PROPERTY |
161 | 80 | 83 | ||
163 | 81 | public: | 84 | public: |
164 | 85 | MirSurfaceItem* surface() const { return m_surface; } | ||
165 | 86 | |||
166 | 87 | Q_SIGNALS: | ||
167 | 88 | void surfaceChanged(MirSurfaceItem*); | ||
168 | 89 | |||
169 | 90 | public: | ||
170 | 82 | void showWindow(QQuickItem *parent); | 91 | void showWindow(QQuickItem *parent); |
171 | 83 | void hideWindow(); | 92 | void hideWindow(); |
172 | 84 | 93 | ||
174 | 85 | private Q_SLOTS: | 94 | private Q_SLOTS: |
175 | 86 | void onWindowComponentStatusChanged(QQmlComponent::Status status); | 95 | void onWindowComponentStatusChanged(QQmlComponent::Status status); |
179 | 87 | void setRunning(); | 96 | void onStateChanged(State state); |
180 | 88 | 97 | ||
181 | 89 | private: | 98 | void createSurface(); |
182 | 99 | void destroySurface(); | ||
183 | 100 | |||
184 | 101 | private: | ||
185 | 90 | void createWindowItem(); | 102 | void createWindowItem(); |
186 | 91 | void doCreateWindowItem(); | 103 | void doCreateWindowItem(); |
187 | 92 | void createWindowComponent(); | 104 | void createWindowComponent(); |
188 | 93 | QQuickItem *m_windowItem; | 105 | QQuickItem *m_windowItem; |
189 | 94 | QQmlComponent *m_windowComponent; | 106 | QQmlComponent *m_windowComponent; |
190 | 95 | QQuickItem *m_parentItem; | 107 | QQuickItem *m_parentItem; |
191 | 108 | MirSurfaceItem* m_surface; | ||
192 | 96 | }; | 109 | }; |
193 | 97 | 110 | ||
194 | 98 | Q_DECLARE_METATYPE(ApplicationInfo*) | 111 | Q_DECLARE_METATYPE(ApplicationInfo*) |
195 | 99 | 112 | ||
196 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' | |||
197 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2014-07-10 09:27:19 +0000 | |||
198 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2014-07-18 16:28:08 +0000 | |||
199 | @@ -16,6 +16,7 @@ | |||
200 | 16 | 16 | ||
201 | 17 | #include "ApplicationManager.h" | 17 | #include "ApplicationManager.h" |
202 | 18 | #include "ApplicationInfo.h" | 18 | #include "ApplicationInfo.h" |
203 | 19 | #include "MirSurfaceItem.h" | ||
204 | 19 | 20 | ||
205 | 20 | #include <paths.h> | 21 | #include <paths.h> |
206 | 21 | 22 | ||
207 | @@ -36,6 +37,9 @@ | |||
208 | 36 | , m_sideStage(0) | 37 | , m_sideStage(0) |
209 | 37 | , m_rightMargin(0) | 38 | , m_rightMargin(0) |
210 | 38 | { | 39 | { |
211 | 40 | m_roleNames.insert(RoleSurface, "surface"); | ||
212 | 41 | m_roleNames.insert(RoleFullscreen, "fullscreen"); | ||
213 | 42 | |||
214 | 39 | buildListOfAvailableApplications(); | 43 | buildListOfAvailableApplications(); |
215 | 40 | } | 44 | } |
216 | 41 | 45 | ||
217 | @@ -69,6 +73,10 @@ | |||
218 | 69 | return app->focused(); | 73 | return app->focused(); |
219 | 70 | case RoleScreenshot: | 74 | case RoleScreenshot: |
220 | 71 | return app->screenshot(); | 75 | return app->screenshot(); |
221 | 76 | case RoleSurface: | ||
222 | 77 | return QVariant::fromValue(app->surface()); | ||
223 | 78 | case RoleFullscreen: | ||
224 | 79 | return app->fullscreen(); | ||
225 | 72 | default: | 80 | default: |
226 | 73 | return QVariant(); | 81 | return QVariant(); |
227 | 74 | } | 82 | } |
228 | @@ -89,6 +97,17 @@ | |||
229 | 89 | return nullptr; | 97 | return nullptr; |
230 | 90 | } | 98 | } |
231 | 91 | 99 | ||
232 | 100 | QModelIndex ApplicationManager::findIndex(ApplicationInfo* application) | ||
233 | 101 | { | ||
234 | 102 | for (int i = 0; i < m_runningApplications.size(); ++i) { | ||
235 | 103 | if (m_runningApplications.at(i) == application) { | ||
236 | 104 | return index(i); | ||
237 | 105 | } | ||
238 | 106 | } | ||
239 | 107 | |||
240 | 108 | return QModelIndex(); | ||
241 | 109 | } | ||
242 | 110 | |||
243 | 92 | void ApplicationManager::add(ApplicationInfo *application) { | 111 | void ApplicationManager::add(ApplicationInfo *application) { |
244 | 93 | if (!application) { | 112 | if (!application) { |
245 | 94 | return; | 113 | return; |
246 | @@ -100,6 +119,12 @@ | |||
247 | 100 | Q_EMIT applicationAdded(application->appId()); | 119 | Q_EMIT applicationAdded(application->appId()); |
248 | 101 | Q_EMIT countChanged(); | 120 | Q_EMIT countChanged(); |
249 | 102 | Q_EMIT focusRequested(application->appId()); | 121 | Q_EMIT focusRequested(application->appId()); |
250 | 122 | |||
251 | 123 | connect(application, &ApplicationInfo::surfaceChanged, this, [application, this]() { | ||
252 | 124 | QModelIndex appIndex = findIndex(application); | ||
253 | 125 | if (!appIndex.isValid()) return; | ||
254 | 126 | Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << ApplicationManager::RoleSurface); | ||
255 | 127 | }); | ||
256 | 103 | } | 128 | } |
257 | 104 | 129 | ||
258 | 105 | void ApplicationManager::remove(ApplicationInfo *application) { | 130 | void ApplicationManager::remove(ApplicationInfo *application) { |
259 | @@ -111,6 +136,7 @@ | |||
260 | 111 | Q_EMIT applicationRemoved(application->appId()); | 136 | Q_EMIT applicationRemoved(application->appId()); |
261 | 112 | Q_EMIT countChanged(); | 137 | Q_EMIT countChanged(); |
262 | 113 | } | 138 | } |
263 | 139 | disconnect(application, &ApplicationInfo::surfaceChanged, this, 0); | ||
264 | 114 | } | 140 | } |
265 | 115 | 141 | ||
266 | 116 | void ApplicationManager::move(int from, int to) { | 142 | void ApplicationManager::move(int from, int to) { |
267 | @@ -180,6 +206,7 @@ | |||
268 | 180 | application->setStage(ApplicationInfo::MainStage); | 206 | application->setStage(ApplicationInfo::MainStage); |
269 | 181 | } | 207 | } |
270 | 182 | add(application); | 208 | add(application); |
271 | 209 | application->setState(ApplicationInfo::Running); | ||
272 | 183 | 210 | ||
273 | 184 | return application; | 211 | return application; |
274 | 185 | } | 212 | } |
275 | @@ -193,6 +220,7 @@ | |||
276 | 193 | if (application->appId() == focusedApplicationId()) { | 220 | if (application->appId() == focusedApplicationId()) { |
277 | 194 | unfocusCurrentApplication(); | 221 | unfocusCurrentApplication(); |
278 | 195 | } | 222 | } |
279 | 223 | application->setState(ApplicationInfo::Stopped); | ||
280 | 196 | remove(application); | 224 | remove(application); |
281 | 197 | return true; | 225 | return true; |
282 | 198 | } | 226 | } |
283 | @@ -213,7 +241,6 @@ | |||
284 | 213 | return false; | 241 | return false; |
285 | 214 | } | 242 | } |
286 | 215 | 243 | ||
287 | 216 | application->setScreenshot(QString("image://application/%1/%2").arg(appId).arg(QDateTime::currentMSecsSinceEpoch())); | ||
288 | 217 | QModelIndex appIndex = index(idx); | 244 | QModelIndex appIndex = index(idx); |
289 | 218 | Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << RoleScreenshot); | 245 | Q_EMIT dataChanged(appIndex, appIndex, QVector<int>() << RoleScreenshot); |
290 | 219 | return true; | 246 | return true; |
291 | @@ -352,6 +379,9 @@ | |||
292 | 352 | "}").arg(qmlDirectory()) | 379 | "}").arg(qmlDirectory()) |
293 | 353 | .arg(application->icon().toString()); | 380 | .arg(application->icon().toString()); |
294 | 354 | application->setImageQml(imageQml); | 381 | application->setImageQml(imageQml); |
295 | 382 | |||
296 | 383 | application->setScreenshot(QString("file://%1/Dash/graphics/phone/screenshots/%2@12.png").arg(qmlDirectory()) | ||
297 | 384 | .arg(application->icon().toString())); | ||
298 | 355 | } | 385 | } |
299 | 356 | 386 | ||
300 | 357 | void ApplicationManager::buildListOfAvailableApplications() | 387 | void ApplicationManager::buildListOfAvailableApplications() |
301 | @@ -363,7 +393,6 @@ | |||
302 | 363 | application->setName("Dialer"); | 393 | application->setName("Dialer"); |
303 | 364 | application->setIcon(QUrl("dialer")); | 394 | application->setIcon(QUrl("dialer")); |
304 | 365 | application->setStage(ApplicationInfo::SideStage); | 395 | application->setStage(ApplicationInfo::SideStage); |
305 | 366 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
306 | 367 | generateQmlStrings(application); | 396 | generateQmlStrings(application); |
307 | 368 | m_availableApplications.append(application); | 397 | m_availableApplications.append(application); |
308 | 369 | 398 | ||
309 | @@ -372,7 +401,6 @@ | |||
310 | 372 | application->setName("Camera"); | 401 | application->setName("Camera"); |
311 | 373 | application->setIcon(QUrl("camera")); | 402 | application->setIcon(QUrl("camera")); |
312 | 374 | application->setFullscreen(true); | 403 | application->setFullscreen(true); |
313 | 375 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
314 | 376 | generateQmlStrings(application); | 404 | generateQmlStrings(application); |
315 | 377 | m_availableApplications.append(application); | 405 | m_availableApplications.append(application); |
316 | 378 | 406 | ||
317 | @@ -380,7 +408,6 @@ | |||
318 | 380 | application->setAppId("gallery-app"); | 408 | application->setAppId("gallery-app"); |
319 | 381 | application->setName("Gallery"); | 409 | application->setName("Gallery"); |
320 | 382 | application->setIcon(QUrl("gallery")); | 410 | application->setIcon(QUrl("gallery")); |
321 | 383 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
322 | 384 | generateQmlStrings(application); | 411 | generateQmlStrings(application); |
323 | 385 | m_availableApplications.append(application); | 412 | m_availableApplications.append(application); |
324 | 386 | 413 | ||
325 | @@ -389,7 +416,6 @@ | |||
326 | 389 | application->setName("Facebook"); | 416 | application->setName("Facebook"); |
327 | 390 | application->setIcon(QUrl("facebook")); | 417 | application->setIcon(QUrl("facebook")); |
328 | 391 | application->setStage(ApplicationInfo::SideStage); | 418 | application->setStage(ApplicationInfo::SideStage); |
329 | 392 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
330 | 393 | generateQmlStrings(application); | 419 | generateQmlStrings(application); |
331 | 394 | m_availableApplications.append(application); | 420 | m_availableApplications.append(application); |
332 | 395 | 421 | ||
333 | @@ -398,7 +424,6 @@ | |||
334 | 398 | application->setFullscreen(true); | 424 | application->setFullscreen(true); |
335 | 399 | application->setName("Browser"); | 425 | application->setName("Browser"); |
336 | 400 | application->setIcon(QUrl("browser")); | 426 | application->setIcon(QUrl("browser")); |
337 | 401 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
338 | 402 | generateQmlStrings(application); | 427 | generateQmlStrings(application); |
339 | 403 | m_availableApplications.append(application); | 428 | m_availableApplications.append(application); |
340 | 404 | 429 | ||
341 | @@ -407,7 +432,6 @@ | |||
342 | 407 | application->setName("Twitter"); | 432 | application->setName("Twitter"); |
343 | 408 | application->setIcon(QUrl("twitter")); | 433 | application->setIcon(QUrl("twitter")); |
344 | 409 | application->setStage(ApplicationInfo::SideStage); | 434 | application->setStage(ApplicationInfo::SideStage); |
345 | 410 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
346 | 411 | generateQmlStrings(application); | 435 | generateQmlStrings(application); |
347 | 412 | m_availableApplications.append(application); | 436 | m_availableApplications.append(application); |
348 | 413 | 437 | ||
349 | @@ -415,7 +439,6 @@ | |||
350 | 415 | application->setAppId("gmail-webapp"); | 439 | application->setAppId("gmail-webapp"); |
351 | 416 | application->setName("GMail"); | 440 | application->setName("GMail"); |
352 | 417 | application->setIcon(QUrl("gmail")); | 441 | application->setIcon(QUrl("gmail")); |
353 | 418 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
354 | 419 | m_availableApplications.append(application); | 442 | m_availableApplications.append(application); |
355 | 420 | 443 | ||
356 | 421 | application = new ApplicationInfo(this); | 444 | application = new ApplicationInfo(this); |
357 | @@ -423,7 +446,6 @@ | |||
358 | 423 | application->setName("Weather"); | 446 | application->setName("Weather"); |
359 | 424 | application->setIcon(QUrl("weather")); | 447 | application->setIcon(QUrl("weather")); |
360 | 425 | application->setStage(ApplicationInfo::SideStage); | 448 | application->setStage(ApplicationInfo::SideStage); |
361 | 426 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
362 | 427 | generateQmlStrings(application); | 449 | generateQmlStrings(application); |
363 | 428 | m_availableApplications.append(application); | 450 | m_availableApplications.append(application); |
364 | 429 | 451 | ||
365 | @@ -432,7 +454,6 @@ | |||
366 | 432 | application->setName("Notepad"); | 454 | application->setName("Notepad"); |
367 | 433 | application->setIcon(QUrl("notepad")); | 455 | application->setIcon(QUrl("notepad")); |
368 | 434 | application->setStage(ApplicationInfo::SideStage); | 456 | application->setStage(ApplicationInfo::SideStage); |
369 | 435 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
370 | 436 | m_availableApplications.append(application); | 457 | m_availableApplications.append(application); |
371 | 437 | 458 | ||
372 | 438 | application = new ApplicationInfo(this); | 459 | application = new ApplicationInfo(this); |
373 | @@ -440,7 +461,6 @@ | |||
374 | 440 | application->setName("Calendar"); | 461 | application->setName("Calendar"); |
375 | 441 | application->setIcon(QUrl("calendar")); | 462 | application->setIcon(QUrl("calendar")); |
376 | 442 | application->setStage(ApplicationInfo::SideStage); | 463 | application->setStage(ApplicationInfo::SideStage); |
377 | 443 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
378 | 444 | m_availableApplications.append(application); | 464 | m_availableApplications.append(application); |
379 | 445 | 465 | ||
380 | 446 | application = new ApplicationInfo(this); | 466 | application = new ApplicationInfo(this); |
381 | @@ -448,21 +468,18 @@ | |||
382 | 448 | application->setName("Media Player"); | 468 | application->setName("Media Player"); |
383 | 449 | application->setIcon(QUrl("mediaplayer-app")); | 469 | application->setIcon(QUrl("mediaplayer-app")); |
384 | 450 | application->setFullscreen(true); | 470 | application->setFullscreen(true); |
385 | 451 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
386 | 452 | m_availableApplications.append(application); | 471 | m_availableApplications.append(application); |
387 | 453 | 472 | ||
388 | 454 | application = new ApplicationInfo(this); | 473 | application = new ApplicationInfo(this); |
389 | 455 | application->setAppId("evernote"); | 474 | application->setAppId("evernote"); |
390 | 456 | application->setName("Evernote"); | 475 | application->setName("Evernote"); |
391 | 457 | application->setIcon(QUrl("evernote")); | 476 | application->setIcon(QUrl("evernote")); |
392 | 458 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
393 | 459 | m_availableApplications.append(application); | 477 | m_availableApplications.append(application); |
394 | 460 | 478 | ||
395 | 461 | application = new ApplicationInfo(this); | 479 | application = new ApplicationInfo(this); |
396 | 462 | application->setAppId("map"); | 480 | application->setAppId("map"); |
397 | 463 | application->setName("Map"); | 481 | application->setName("Map"); |
398 | 464 | application->setIcon(QUrl("map")); | 482 | application->setIcon(QUrl("map")); |
399 | 465 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
400 | 466 | generateQmlStrings(application); | 483 | generateQmlStrings(application); |
401 | 467 | m_availableApplications.append(application); | 484 | m_availableApplications.append(application); |
402 | 468 | 485 | ||
403 | @@ -470,28 +487,24 @@ | |||
404 | 470 | application->setAppId("pinterest"); | 487 | application->setAppId("pinterest"); |
405 | 471 | application->setName("Pinterest"); | 488 | application->setName("Pinterest"); |
406 | 472 | application->setIcon(QUrl("pinterest")); | 489 | application->setIcon(QUrl("pinterest")); |
407 | 473 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
408 | 474 | m_availableApplications.append(application); | 490 | m_availableApplications.append(application); |
409 | 475 | 491 | ||
410 | 476 | application = new ApplicationInfo(this); | 492 | application = new ApplicationInfo(this); |
411 | 477 | application->setAppId("soundcloud"); | 493 | application->setAppId("soundcloud"); |
412 | 478 | application->setName("SoundCloud"); | 494 | application->setName("SoundCloud"); |
413 | 479 | application->setIcon(QUrl("soundcloud")); | 495 | application->setIcon(QUrl("soundcloud")); |
414 | 480 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
415 | 481 | m_availableApplications.append(application); | 496 | m_availableApplications.append(application); |
416 | 482 | 497 | ||
417 | 483 | application = new ApplicationInfo(this); | 498 | application = new ApplicationInfo(this); |
418 | 484 | application->setAppId("wikipedia"); | 499 | application->setAppId("wikipedia"); |
419 | 485 | application->setName("Wikipedia"); | 500 | application->setName("Wikipedia"); |
420 | 486 | application->setIcon(QUrl("wikipedia")); | 501 | application->setIcon(QUrl("wikipedia")); |
421 | 487 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
422 | 488 | m_availableApplications.append(application); | 502 | m_availableApplications.append(application); |
423 | 489 | 503 | ||
424 | 490 | application = new ApplicationInfo(this); | 504 | application = new ApplicationInfo(this); |
425 | 491 | application->setAppId("youtube"); | 505 | application->setAppId("youtube"); |
426 | 492 | application->setName("YouTube"); | 506 | application->setName("YouTube"); |
427 | 493 | application->setIcon(QUrl("youtube")); | 507 | application->setIcon(QUrl("youtube")); |
428 | 494 | application->setScreenshot(QString("image://application/%1/%2").arg(application->appId()).arg(QDateTime::currentMSecsSinceEpoch())); | ||
429 | 495 | m_availableApplications.append(application); | 508 | m_availableApplications.append(application); |
430 | 496 | } | 509 | } |
431 | 497 | 510 | ||
432 | 498 | 511 | ||
433 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.h' | |||
434 | --- tests/mocks/Unity/Application/ApplicationManager.h 2014-03-11 11:14:10 +0000 | |||
435 | +++ tests/mocks/Unity/Application/ApplicationManager.h 2014-07-18 16:28:08 +0000 | |||
436 | @@ -53,6 +53,10 @@ | |||
437 | 53 | ApplicationManager(QObject *parent = NULL); | 53 | ApplicationManager(QObject *parent = NULL); |
438 | 54 | virtual ~ApplicationManager(); | 54 | virtual ~ApplicationManager(); |
439 | 55 | 55 | ||
440 | 56 | enum MoreRoles { | ||
441 | 57 | RoleSurface = RoleScreenshot+1, | ||
442 | 58 | RoleFullscreen, | ||
443 | 59 | }; | ||
444 | 56 | enum Role { | 60 | enum Role { |
445 | 57 | Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard, | 61 | Dash, Default, Indicators, Notifications, Greeter, Launcher, OnScreenKeyboard, |
446 | 58 | ShutdownDialog | 62 | ShutdownDialog |
447 | @@ -108,6 +112,8 @@ | |||
448 | 108 | int rightMargin() const; | 112 | int rightMargin() const; |
449 | 109 | void setRightMargin(int rightMargin); | 113 | void setRightMargin(int rightMargin); |
450 | 110 | 114 | ||
451 | 115 | QModelIndex findIndex(ApplicationInfo* application); | ||
452 | 116 | |||
453 | 111 | Q_SIGNALS: | 117 | Q_SIGNALS: |
454 | 112 | void keyboardHeightChanged(); | 118 | void keyboardHeightChanged(); |
455 | 113 | void keyboardVisibleChanged(); | 119 | void keyboardVisibleChanged(); |
456 | 114 | 120 | ||
457 | === modified file 'tests/mocks/Unity/Application/CMakeLists.txt' | |||
458 | --- tests/mocks/Unity/Application/CMakeLists.txt 2014-06-26 08:26:58 +0000 | |||
459 | +++ tests/mocks/Unity/Application/CMakeLists.txt 2014-07-18 16:28:08 +0000 | |||
460 | @@ -6,6 +6,8 @@ | |||
461 | 6 | ApplicationImage.cpp | 6 | ApplicationImage.cpp |
462 | 7 | ApplicationManager.cpp | 7 | ApplicationManager.cpp |
463 | 8 | ApplicationScreenshotProvider.cpp | 8 | ApplicationScreenshotProvider.cpp |
464 | 9 | MirSurfaceItem.cpp | ||
465 | 10 | SurfaceManager.cpp | ||
466 | 9 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h | 11 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationInfoInterface.h |
467 | 10 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h | 12 | ${APPLICATION_API_INCLUDEDIR}/unity/shell/application/ApplicationManagerInterface.h |
468 | 11 | ) | 13 | ) |
469 | 12 | 14 | ||
470 | === added file 'tests/mocks/Unity/Application/MirSurfaceItem.cpp' | |||
471 | --- tests/mocks/Unity/Application/MirSurfaceItem.cpp 1970-01-01 00:00:00 +0000 | |||
472 | +++ tests/mocks/Unity/Application/MirSurfaceItem.cpp 2014-07-18 16:28:08 +0000 | |||
473 | @@ -0,0 +1,40 @@ | |||
474 | 1 | /* | ||
475 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
476 | 3 | * | ||
477 | 4 | * This program is free software; you can redistribute it and/or modify | ||
478 | 5 | * it under the terms of the GNU General Public License as published by | ||
479 | 6 | * the Free Software Foundation; version 3. | ||
480 | 7 | * | ||
481 | 8 | * This program is distributed in the hope that it will be useful, | ||
482 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
483 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
484 | 11 | * GNU General Public License for more details. | ||
485 | 12 | * | ||
486 | 13 | * You should have received a copy of the GNU General Public License | ||
487 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
488 | 15 | */ | ||
489 | 16 | |||
490 | 17 | #include "MirSurfaceItem.h" | ||
491 | 18 | |||
492 | 19 | #include <QPainter> | ||
493 | 20 | |||
494 | 21 | MirSurfaceItem::MirSurfaceItem(const QString& name, | ||
495 | 22 | MirSurfaceItem::Type type, | ||
496 | 23 | MirSurfaceItem::State state, | ||
497 | 24 | const QUrl& screenshot, | ||
498 | 25 | QQuickItem *parent) | ||
499 | 26 | : QQuickPaintedItem(parent) | ||
500 | 27 | , m_name(name) | ||
501 | 28 | , m_type(type) | ||
502 | 29 | , m_state(state) | ||
503 | 30 | , m_img(screenshot.isLocalFile() ? screenshot.toLocalFile() : screenshot.toString()) | ||
504 | 31 | { | ||
505 | 32 | setFillColor(Qt::white); | ||
506 | 33 | } | ||
507 | 34 | |||
508 | 35 | void MirSurfaceItem::paint(QPainter * painter) | ||
509 | 36 | { | ||
510 | 37 | if (!m_img.isNull()) { | ||
511 | 38 | painter->drawImage(contentsBoundingRect(), m_img, QRect(QPoint(0,0), m_img.size())); | ||
512 | 39 | } | ||
513 | 40 | } | ||
514 | 0 | 41 | ||
515 | === added file 'tests/mocks/Unity/Application/MirSurfaceItem.h' | |||
516 | --- tests/mocks/Unity/Application/MirSurfaceItem.h 1970-01-01 00:00:00 +0000 | |||
517 | +++ tests/mocks/Unity/Application/MirSurfaceItem.h 2014-07-18 16:28:08 +0000 | |||
518 | @@ -0,0 +1,84 @@ | |||
519 | 1 | /* | ||
520 | 2 | * Copyright (C) 2014 Canonical, Ltd. | ||
521 | 3 | * | ||
522 | 4 | * This program is free software; you can redistribute it and/or modify | ||
523 | 5 | * it under the terms of the GNU General Public License as published by | ||
524 | 6 | * the Free Software Foundation; version 3. | ||
525 | 7 | * | ||
526 | 8 | * This program is distributed in the hope that it will be useful, | ||
527 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
528 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
529 | 11 | * GNU General Public License for more details. | ||
530 | 12 | * | ||
531 | 13 | * You should have received a copy of the GNU General Public License | ||
532 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
533 | 15 | */ | ||
534 | 16 | |||
535 | 17 | #ifndef MIRSURFACEITEM_H | ||
536 | 18 | #define MIRSURFACEITEM_H | ||
537 | 19 | |||
538 | 20 | #include <QQuickPaintedItem> | ||
539 | 21 | #include <QImage> | ||
540 | 22 | |||
541 | 23 | class MirSurfaceItem : public QQuickPaintedItem | ||
542 | 24 | { | ||
543 | 25 | Q_OBJECT | ||
544 | 26 | Q_ENUMS(Type) | ||
545 | 27 | Q_ENUMS(State) | ||
546 | 28 | |||
547 | 29 | Q_PROPERTY(Type type READ type NOTIFY typeChanged) | ||
548 | 30 | Q_PROPERTY(State state READ state NOTIFY stateChanged) | ||
549 | 31 | Q_PROPERTY(QString name READ name NOTIFY nameChanged) | ||
550 | 32 | |||
551 | 33 | public: | ||
552 | 34 | enum Type { | ||
553 | 35 | Normal, | ||
554 | 36 | Utility, | ||
555 | 37 | Dialog, | ||
556 | 38 | Overlay, | ||
557 | 39 | Freestyle, | ||
558 | 40 | Popover, | ||
559 | 41 | InputMethod, | ||
560 | 42 | }; | ||
561 | 43 | |||
562 | 44 | enum State { | ||
563 | 45 | Unknown, | ||
564 | 46 | Restored, | ||
565 | 47 | Minimized, | ||
566 | 48 | Maximized, | ||
567 | 49 | VertMaximized, | ||
568 | 50 | /* SemiMaximized, */ | ||
569 | 51 | Fullscreen, | ||
570 | 52 | }; | ||
571 | 53 | |||
572 | 54 | explicit MirSurfaceItem(const QString& name, | ||
573 | 55 | Type type, | ||
574 | 56 | State state, | ||
575 | 57 | const QUrl& screenshot, | ||
576 | 58 | QQuickItem *parent = 0); | ||
577 | 59 | |||
578 | 60 | //getters | ||
579 | 61 | Type type() const { return m_type; } | ||
580 | 62 | State state() const { return m_state; } | ||
581 | 63 | QString name() const { return m_name; } | ||
582 | 64 | |||
583 | 65 | Q_INVOKABLE void release() {} | ||
584 | 66 | |||
585 | 67 | void paint(QPainter * painter) override; | ||
586 | 68 | |||
587 | 69 | Q_SIGNALS: | ||
588 | 70 | void typeChanged(Type); | ||
589 | 71 | void stateChanged(State); | ||
590 | 72 | void nameChanged(QString); | ||
591 | 73 | |||
592 | 74 | private: | ||
593 | 75 | |||
594 | 76 | const QString m_name; | ||
595 | 77 | const Type m_type; | ||
596 | 78 | const State m_state; | ||
597 | 79 | const QImage m_img; | ||
598 | 80 | }; | ||
599 | 81 | |||
600 | 82 | Q_DECLARE_METATYPE(MirSurfaceItem*) | ||
601 | 83 | |||
602 | 84 | #endif // MIRSURFACEITEM_H | ||
603 | 0 | 85 | ||
604 | === added file 'tests/mocks/Unity/Application/SurfaceManager.cpp' | |||
605 | --- tests/mocks/Unity/Application/SurfaceManager.cpp 1970-01-01 00:00:00 +0000 | |||
606 | +++ tests/mocks/Unity/Application/SurfaceManager.cpp 2014-07-18 16:28:08 +0000 | |||
607 | @@ -0,0 +1,16 @@ | |||
608 | 1 | #include "SurfaceManager.h" | ||
609 | 2 | |||
610 | 3 | SurfaceManager *SurfaceManager::the_surface_manager = nullptr; | ||
611 | 4 | |||
612 | 5 | SurfaceManager *SurfaceManager::singleton() | ||
613 | 6 | { | ||
614 | 7 | if (!the_surface_manager) { | ||
615 | 8 | the_surface_manager = new SurfaceManager(); | ||
616 | 9 | } | ||
617 | 10 | return the_surface_manager; | ||
618 | 11 | } | ||
619 | 12 | |||
620 | 13 | SurfaceManager::SurfaceManager(QObject *parent) : | ||
621 | 14 | QObject(parent) | ||
622 | 15 | { | ||
623 | 16 | } | ||
624 | 0 | 17 | ||
625 | === added file 'tests/mocks/Unity/Application/SurfaceManager.h' | |||
626 | --- tests/mocks/Unity/Application/SurfaceManager.h 1970-01-01 00:00:00 +0000 | |||
627 | +++ tests/mocks/Unity/Application/SurfaceManager.h 2014-07-18 16:28:08 +0000 | |||
628 | @@ -0,0 +1,26 @@ | |||
629 | 1 | #ifndef SURFACEMANAGER_H | ||
630 | 2 | #define SURFACEMANAGER_H | ||
631 | 3 | |||
632 | 4 | #include <QObject> | ||
633 | 5 | |||
634 | 6 | class MirSurfaceItem; | ||
635 | 7 | |||
636 | 8 | class SurfaceManager : public QObject | ||
637 | 9 | { | ||
638 | 10 | Q_OBJECT | ||
639 | 11 | public: | ||
640 | 12 | explicit SurfaceManager(QObject *parent = 0); | ||
641 | 13 | |||
642 | 14 | static SurfaceManager *singleton(); | ||
643 | 15 | |||
644 | 16 | Q_SIGNALS: | ||
645 | 17 | void countChanged(); | ||
646 | 18 | void surfaceCreated(MirSurfaceItem *surface); | ||
647 | 19 | void surfaceDestroyed(MirSurfaceItem *surface); | ||
648 | 20 | |||
649 | 21 | private: | ||
650 | 22 | static SurfaceManager *the_surface_manager; | ||
651 | 23 | |||
652 | 24 | }; | ||
653 | 25 | |||
654 | 26 | #endif // SURFACEMANAGER_H | ||
655 | 0 | 27 | ||
656 | === modified file 'tests/mocks/Unity/Application/plugin.cpp' | |||
657 | --- tests/mocks/Unity/Application/plugin.cpp 2014-01-20 11:34:59 +0000 | |||
658 | +++ tests/mocks/Unity/Application/plugin.cpp 2014-07-18 16:28:08 +0000 | |||
659 | @@ -19,6 +19,8 @@ | |||
660 | 19 | #include "ApplicationImage.h" | 19 | #include "ApplicationImage.h" |
661 | 20 | #include "ApplicationManager.h" | 20 | #include "ApplicationManager.h" |
662 | 21 | #include "ApplicationScreenshotProvider.h" | 21 | #include "ApplicationScreenshotProvider.h" |
663 | 22 | #include "MirSurfaceItem.h" | ||
664 | 23 | #include "SurfaceManager.h" | ||
665 | 22 | 24 | ||
666 | 23 | #include <qqml.h> | 25 | #include <qqml.h> |
667 | 24 | #include <QQmlEngine> | 26 | #include <QQmlEngine> |
668 | @@ -34,14 +36,25 @@ | |||
669 | 34 | return s_appManager; | 36 | return s_appManager; |
670 | 35 | } | 37 | } |
671 | 36 | 38 | ||
672 | 39 | static QObject* surfaceManagerSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) { | ||
673 | 40 | Q_UNUSED(engine); | ||
674 | 41 | Q_UNUSED(scriptEngine); | ||
675 | 42 | return SurfaceManager::singleton(); | ||
676 | 43 | } | ||
677 | 44 | |||
678 | 37 | void FakeUnityApplicationQmlPlugin::registerTypes(const char *uri) | 45 | void FakeUnityApplicationQmlPlugin::registerTypes(const char *uri) |
679 | 38 | { | 46 | { |
680 | 47 | qRegisterMetaType<MirSurfaceItem*>("MirSurfaceItem*"); | ||
681 | 48 | |||
682 | 39 | qmlRegisterUncreatableType<unity::shell::application::ApplicationManagerInterface>(uri, 0, 1, "ApplicationManagerInterface", "Abstract interface. Cannot be created in QML"); | 49 | qmlRegisterUncreatableType<unity::shell::application::ApplicationManagerInterface>(uri, 0, 1, "ApplicationManagerInterface", "Abstract interface. Cannot be created in QML"); |
683 | 40 | qmlRegisterSingletonType<ApplicationManager>(uri, 0, 1, "ApplicationManager", applicationManagerSingleton); | 50 | qmlRegisterSingletonType<ApplicationManager>(uri, 0, 1, "ApplicationManager", applicationManagerSingleton); |
684 | 51 | qmlRegisterSingletonType<SurfaceManager>(uri, 0, 1, "SurfaceManager", surfaceManagerSingleton); | ||
685 | 41 | 52 | ||
686 | 42 | qmlRegisterUncreatableType<unity::shell::application::ApplicationInfoInterface>(uri, 0, 1, "ApplicationInfoInterface", "Abstract interface. Cannot be created in QML"); | 53 | qmlRegisterUncreatableType<unity::shell::application::ApplicationInfoInterface>(uri, 0, 1, "ApplicationInfoInterface", "Abstract interface. Cannot be created in QML"); |
687 | 43 | qmlRegisterType<ApplicationInfo>(uri, 0, 1, "ApplicationInfo"); | 54 | qmlRegisterType<ApplicationInfo>(uri, 0, 1, "ApplicationInfo"); |
688 | 44 | 55 | ||
689 | 56 | qmlRegisterUncreatableType<MirSurfaceItem>(uri, 0, 1, "MirSurfaceItem", "MirSurfaceItem can't be instantiated from QML"); | ||
690 | 57 | |||
691 | 45 | qmlRegisterType<ApplicationImage>(uri, 0, 1, "ApplicationImage"); | 58 | qmlRegisterType<ApplicationImage>(uri, 0, 1, "ApplicationImage"); |
692 | 46 | } | 59 | } |
693 | 47 | 60 |
Would be nice to update the copyright year of the files you changed, like tests/mocks/ Unity/Applicati on/ApplicationI nfo.h