Merge lp:~unity-team/unity-api/silo0 into lp:unity-api

Proposed by Gerry Boland
Status: Work in progress
Proposed branch: lp:~unity-team/unity-api/silo0
Merge into: lp:unity-api
Diff against target: 526 lines (+401/-11)
10 files modified
debian/changelog (+33/-2)
include/unity/shell/application/CMakeLists.txt (+1/-1)
include/unity/shell/application/Mir.h (+93/-0)
include/unity/shell/application/MirSurfaceInterface.h (+113/-0)
include/unity/shell/application/MirSurfaceItemInterface.h (+151/-0)
include/unity/shell/scopes/CMakeLists.txt (+1/-1)
include/unity/shell/scopes/ScopeInterface.h (+2/-2)
test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp (+4/-2)
test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h (+2/-2)
test/qmltest/unity/shell/scopes/tst_Scopes.qml (+1/-1)
To merge this branch: bzr merge lp:~unity-team/unity-api/silo0
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+267055@code.launchpad.net

Commit message

Silo0 - pocket desktop - DO NOT LAND THIS

To post a comment you must log in.
lp:~unity-team/unity-api/silo0 updated
180. By Gerry Boland

Fake changelog entry to satisfy train

181. By Gerry Boland

Merge unity-api trunk

182. By Gerry Boland

edit changelog to unrelease, keep train happy

183. By Gerry Boland

Merge unity-api trunk-15.04

Unmerged revisions

183. By Gerry Boland

Merge unity-api trunk-15.04

182. By Gerry Boland

edit changelog to unrelease, keep train happy

181. By Gerry Boland

Merge unity-api trunk

180. By Gerry Boland

Fake changelog entry to satisfy train

179. By Gerry Boland

Merge mousePointer

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-08-04 15:26:17 +0000
3+++ debian/changelog 2015-08-13 10:55:16 +0000
4@@ -1,4 +1,15 @@
5-unity-api (7.99+15.10.20150804-0ubuntu1) wily; urgency=medium
6+unity-api (7.99+15.04.20150811-0ubuntu1) vivid; urgency=medium
7+
8+ [ Daniel d'Andrada ]
9+ * New rebuild forced.
10+ * Remove ApplicationManagerInterface.forceDashActive
11+ * Remove ApplicationManagerInterface.suspended
12+ * Add ApplicationInfoInterface.requestedState
13+ * Add a NO_TESTS options to cmake
14+
15+ -- CI Train Bot <ci-train-bot@canonical.com> Tue, 11 Aug 2015 14:05:55 +0000
16+
17+unity-api (7.99+15.04.20150804-0ubuntu1) vivid; urgency=medium
18
19 [ Daniel d'Andrada ]
20 * Remove ApplicationManagerInterface.forceDashActive
21@@ -8,13 +19,33 @@
22
23 -- CI Train Bot <ci-train-bot@canonical.com> Tue, 04 Aug 2015 15:26:16 +0000
24
25-unity-api (7.98+15.10.20150724-0ubuntu1) wily; urgency=medium
26+unity-api (7.99-0ubuntu1) UNRELEASED; urgency=medium
27+
28+ * Changes to activate and preview methods of ScopeInterface.
29+
30+ -- Pawel Stolowski <pawel.stolowski@canonical.com> Mon, 03 Aug 2015 14:03:47 +0000
31+
32+unity-api (7.98+15.04.20150805-0ubuntu1) UNRELEASED; urgency=medium
33+
34+ * Fake entry to keep train happy
35+
36+ -- CI Train Bot <ci-train-bot@canonical.com> Thu, 6 Aug 2015 09:53:01 +0000
37+
38+unity-api (7.98+15.04.20150724-0ubuntu1) vivid; urgency=medium
39
40 [ Mirco Müller (MacSlow) ]
41 * added alerting/setAlerting API to LauncherModel and LauncherItem interfaces
42
43 -- CI Train Bot <ci-train-bot@canonical.com> Fri, 24 Jul 2015 09:53:01 +0000
44
45+unity-api (7.98) UNRELEASED; urgency=medium
46+
47+ * Remove ApplicationManagerInterface.forceDashActive
48+ * Remove ApplicationManagerInterface.suspended
49+ * Add ApplicationInfoInterface.requestedState
50+
51+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Mon, 15 Jun 2015 13:53:07 -0300
52+
53 unity-api (7.97+15.10.20150721-0ubuntu1) wily; urgency=medium
54
55 [ Michi Henning ]
56
57=== modified file 'include/unity/shell/application/CMakeLists.txt'
58--- include/unity/shell/application/CMakeLists.txt 2015-06-19 12:02:05 +0000
59+++ include/unity/shell/application/CMakeLists.txt 2015-08-13 10:55:16 +0000
60@@ -7,7 +7,7 @@
61
62 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
63
64-set(VERSION 7)
65+set(VERSION 8)
66 set(PKGCONFIG_NAME "unity-shell-application")
67 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
68 set(PKGCONFIG_REQUIRES "Qt5Core")
69
70=== added file 'include/unity/shell/application/Mir.h'
71--- include/unity/shell/application/Mir.h 1970-01-01 00:00:00 +0000
72+++ include/unity/shell/application/Mir.h 2015-08-13 10:55:16 +0000
73@@ -0,0 +1,93 @@
74+/*
75+ * Copyright (C) 2015 Canonical, Ltd.
76+ *
77+ * This program is free software; you can redistribute it and/or modify
78+ * it under the terms of the GNU General Public License as published by
79+ * the Free Software Foundation; version 3.
80+ *
81+ * This program is distributed in the hope that it will be useful,
82+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
83+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84+ * GNU General Public License for more details.
85+ *
86+ * You should have received a copy of the GNU General Public License
87+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
88+ */
89+
90+#ifndef UNITY_SHELL_APPLICATION_MIR_H
91+#define UNITY_SHELL_APPLICATION_MIR_H
92+
93+#include <QObject>
94+
95+/**
96+ @brief Acting mostly as a namespace to hold enums and such for use in QML
97+ */
98+class Mir : public QObject
99+{
100+ Q_OBJECT
101+ Q_ENUMS(Type)
102+ Q_ENUMS(State)
103+ Q_ENUMS(OrientationAngle)
104+
105+ /**
106+ @brief Name of the mouse cursor to be used. Follows the X Cursor naming convention.
107+
108+ Eg.: "left_ptr" is a left-sided pointer arrow
109+ */
110+ Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName NOTIFY cursorNameChanged)
111+
112+public:
113+ /**
114+ @brief Surface type
115+ */
116+ enum Type {
117+ UnknownType,
118+ NormalType,
119+ UtilityType,
120+ DialogType,
121+ GlossType,
122+ FreeStyleType,
123+ MenuType,
124+ InputMethodType,
125+ SatelliteType,
126+ TipType,
127+ };
128+
129+ /**
130+ @brief Surface state
131+ */
132+ enum State {
133+ UnknownState,
134+ RestoredState,
135+ MinimizedState,
136+ MaximizedState,
137+ VertMaximizedState,
138+ FullscreenState,
139+ HorizMaximizedState,
140+ HiddenState,
141+ };
142+
143+ /**
144+ @brief Surface orientation angle
145+ */
146+ enum OrientationAngle {
147+ Angle0 = 0,
148+ Angle90 = 90,
149+ Angle180 = 180,
150+ Angle270 = 270
151+ };
152+
153+ /// @cond
154+ virtual void setCursorName(const QString &cursorName) = 0;
155+ virtual QString cursorName() const = 0;
156+ /// @endcond
157+
158+Q_SIGNALS:
159+ /// @cond
160+ void cursorNameChanged(const QString &cursorName);
161+ /// @endcond
162+};
163+
164+Q_DECLARE_METATYPE(Mir::OrientationAngle)
165+
166+#endif // UNITY_SHELL_APPLICATION_MIR_H
167
168=== added file 'include/unity/shell/application/MirSurfaceInterface.h'
169--- include/unity/shell/application/MirSurfaceInterface.h 1970-01-01 00:00:00 +0000
170+++ include/unity/shell/application/MirSurfaceInterface.h 2015-08-13 10:55:16 +0000
171@@ -0,0 +1,113 @@
172+/*
173+ * Copyright (C) 2015 Canonical, Ltd.
174+ *
175+ * This program is free software; you can redistribute it and/or modify
176+ * it under the terms of the GNU General Public License as published by
177+ * the Free Software Foundation; version 3.
178+ *
179+ * This program is distributed in the hope that it will be useful,
180+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
181+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
182+ * GNU General Public License for more details.
183+ *
184+ * You should have received a copy of the GNU General Public License
185+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
186+ */
187+
188+#ifndef UNITY_SHELL_APPLICATION_MIRSURFACE_H
189+#define UNITY_SHELL_APPLICATION_MIRSURFACE_H
190+
191+#include <QObject>
192+#include <QSize>
193+
194+#include "Mir.h"
195+
196+namespace unity
197+{
198+namespace shell
199+{
200+namespace application
201+{
202+
203+/**
204+ @brief Holds a Mir surface. Pretty much an opaque class.
205+
206+ All surface manipulation is done by giving it to a MirSurfaceItem and then
207+ using MirSurfaceItem's properties.
208+ */
209+class MirSurfaceInterface : public QObject
210+{
211+ Q_OBJECT
212+
213+ /**
214+ * @brief The surface type
215+ */
216+ Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
217+
218+ /**
219+ * @brief Name of the surface, given by the client application
220+ */
221+ Q_PROPERTY(QString name READ name CONSTANT)
222+
223+ /**
224+ * @brief Size of the current surface buffer, in pixels.
225+ */
226+ Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
227+
228+ /**
229+ * @brief State of the surface
230+ */
231+ Q_PROPERTY(Mir::State state READ state WRITE setState NOTIFY stateChanged)
232+
233+ /**
234+ * @brief True if it has a mir client bound to it.
235+ * A "zombie" (live == false) surface never becomes alive again.
236+ */
237+ Q_PROPERTY(bool live READ live NOTIFY liveChanged)
238+
239+ /**
240+ * @brief Orientation angle of the surface
241+ *
242+ * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
243+ */
244+ Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
245+ NOTIFY orientationAngleChanged DESIGNABLE false)
246+
247+public:
248+ /// @cond
249+ MirSurfaceInterface(QObject *parent = nullptr) : QObject(parent) {}
250+ virtual ~MirSurfaceInterface() {}
251+
252+ virtual Mir::Type type() const = 0;
253+
254+ virtual QString name() const = 0;
255+
256+ virtual QSize size() const = 0;
257+ virtual void resize(int width, int height) = 0;
258+
259+ virtual Mir::State state() const = 0;
260+ virtual void setState(Mir::State qmlState) = 0;
261+
262+ virtual bool live() const = 0;
263+
264+ virtual Mir::OrientationAngle orientationAngle() const = 0;
265+ virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
266+ /// @endcond
267+
268+Q_SIGNALS:
269+ /// @cond
270+ void typeChanged(Mir::Type value);
271+ void liveChanged(bool value);
272+ void stateChanged(Mir::State value);
273+ void orientationAngleChanged(Mir::OrientationAngle value);
274+ void sizeChanged(const QSize &value);
275+ /// @endcond
276+};
277+
278+} // namespace application
279+} // namespace shell
280+} // namespace unity
281+
282+Q_DECLARE_METATYPE(unity::shell::application::MirSurfaceInterface*)
283+
284+#endif // UNITY_SHELL_APPLICATION_MIRSURFACE_H
285
286=== added file 'include/unity/shell/application/MirSurfaceItemInterface.h'
287--- include/unity/shell/application/MirSurfaceItemInterface.h 1970-01-01 00:00:00 +0000
288+++ include/unity/shell/application/MirSurfaceItemInterface.h 2015-08-13 10:55:16 +0000
289@@ -0,0 +1,151 @@
290+/*
291+ * Copyright (C) 2015 Canonical, Ltd.
292+ *
293+ * This program is free software; you can redistribute it and/or modify
294+ * it under the terms of the GNU General Public License as published by
295+ * the Free Software Foundation; version 3.
296+ *
297+ * This program is distributed in the hope that it will be useful,
298+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
299+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
300+ * GNU General Public License for more details.
301+ *
302+ * You should have received a copy of the GNU General Public License
303+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
304+ */
305+
306+#ifndef UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
307+#define UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
308+
309+#include "Mir.h"
310+
311+#include <QQuickItem>
312+
313+namespace unity
314+{
315+namespace shell
316+{
317+namespace application
318+{
319+
320+class MirSurfaceInterface;
321+
322+/**
323+ @brief Renders a MirSurface in a QML scene and forwards the input events it receives to it.
324+
325+ You can have multiple MirSurfaceItems displaying the same MirSurface. But care must
326+ be taken that only one of them feeds the MirSurface with input events and also only
327+ one resizes it.
328+ */
329+class MirSurfaceItemInterface : public QQuickItem
330+{
331+ Q_OBJECT
332+
333+ /**
334+ * @brief The surface to be displayed
335+ */
336+ Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface WRITE setSurface NOTIFY surfaceChanged)
337+
338+ /**
339+ * @brief Type of the given surface or Mir.UnknownType if no surface is set
340+ */
341+ Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
342+
343+ /**
344+ * @brief State of the given surface or Mir.UnknownState if no surface is set
345+ */
346+ Q_PROPERTY(Mir::State surfaceState READ surfaceState WRITE setSurfaceState NOTIFY surfaceStateChanged)
347+
348+ /**
349+ * @brief Name of the given surface or an empty string if no surface is set
350+ */
351+ Q_PROPERTY(QString name READ name CONSTANT)
352+
353+ /**
354+ * @brief True if the item has a surface and that surface has a mir client bound to it.
355+ * A "zombie" (live == false) surface never becomes alive again.
356+ */
357+ Q_PROPERTY(bool live READ live NOTIFY liveChanged)
358+
359+ /**
360+ * @brief Orientation angle of the given surface
361+ *
362+ * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
363+ */
364+ Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
365+ NOTIFY orientationAngleChanged DESIGNABLE false)
366+
367+
368+ /**
369+ * @brief Whether the item will forward activeFocus, touch events, mouse events and key events to its surface.
370+ * It's false by default.
371+ * Only one item should have this property enabled for a given surface.
372+ */
373+ Q_PROPERTY(bool consumesInput READ consumesInput
374+ WRITE setConsumesInput
375+ NOTIFY consumesInputChanged)
376+
377+ /**
378+ * @brief The desired width for the contained MirSurface.
379+ * It's ignored if set to zero or a negative number
380+ * The default value is zero
381+ */
382+ Q_PROPERTY(int surfaceWidth READ surfaceWidth
383+ WRITE setSurfaceWidth
384+ NOTIFY surfaceWidthChanged)
385+
386+ /**
387+ * @brief The desired height for the contained MirSurface.
388+ * It's ignored if set to zero or a negative number
389+ * The default value is zero
390+ */
391+ Q_PROPERTY(int surfaceHeight READ surfaceHeight
392+ WRITE setSurfaceHeight
393+ NOTIFY surfaceHeightChanged)
394+
395+public:
396+ /// @cond
397+ MirSurfaceItemInterface(QQuickItem *parent = 0) : QQuickItem(parent) {}
398+ virtual ~MirSurfaceItemInterface() {}
399+
400+ virtual Mir::Type type() const = 0;
401+ virtual QString name() const = 0;
402+ virtual bool live() const = 0;
403+
404+ virtual Mir::State surfaceState() const = 0;
405+ virtual void setSurfaceState(Mir::State) = 0;
406+
407+ virtual Mir::OrientationAngle orientationAngle() const = 0;
408+ virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
409+
410+ virtual MirSurfaceInterface* surface() const = 0;
411+ virtual void setSurface(MirSurfaceInterface*) = 0;
412+
413+ virtual bool consumesInput() const = 0;
414+ virtual void setConsumesInput(bool value) = 0;
415+
416+ virtual int surfaceWidth() const = 0;
417+ virtual void setSurfaceWidth(int value) = 0;
418+
419+ virtual int surfaceHeight() const = 0;
420+ virtual void setSurfaceHeight(int value) = 0;
421+ /// @endcond
422+
423+Q_SIGNALS:
424+ /// @cond
425+ void typeChanged(Mir::Type);
426+ void surfaceStateChanged(Mir::State);
427+ void liveChanged(bool live);
428+ void orientationAngleChanged(Mir::OrientationAngle angle);
429+ void surfaceChanged(MirSurfaceInterface*);
430+ void consumesInputChanged(bool value);
431+ void surfaceWidthChanged(int value);
432+ void surfaceHeightChanged(int value);
433+ /// @endcond
434+};
435+
436+} // namespace application
437+} // namespace shell
438+} // namespace unity
439+
440+#endif // UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
441
442=== modified file 'include/unity/shell/scopes/CMakeLists.txt'
443--- include/unity/shell/scopes/CMakeLists.txt 2015-02-04 17:24:55 +0000
444+++ include/unity/shell/scopes/CMakeLists.txt 2015-08-13 10:55:16 +0000
445@@ -7,7 +7,7 @@
446
447 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
448
449-set(VERSION 6)
450+set(VERSION 7)
451 set(PKGCONFIG_NAME "unity-shell-scopes")
452 set(PKGCONFIG_DESCRIPTION "Unity shell Scopes APIs")
453 set(PKGCONFIG_REQUIRES "Qt5Core")
454
455=== modified file 'include/unity/shell/scopes/ScopeInterface.h'
456--- include/unity/shell/scopes/ScopeInterface.h 2014-08-04 15:59:13 +0000
457+++ include/unity/shell/scopes/ScopeInterface.h 2015-08-13 10:55:16 +0000
458@@ -198,7 +198,7 @@
459 /**
460 * @brief Method used to activate a result.
461 */
462- Q_INVOKABLE virtual void activate(QVariant const& result) = 0;
463+ Q_INVOKABLE virtual void activate(QVariant const& result, QString const& categoryId) = 0;
464
465 /**
466 * @brief Method used to preview a result.
467@@ -206,7 +206,7 @@
468 * Returns a new PreviewStackInterface instance. It's caller's responsibility
469 * to free it.
470 */
471- Q_INVOKABLE virtual unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result) = 0;
472+ Q_INVOKABLE virtual unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result, QString const& categoryId) = 0;
473
474 /**
475 * @brief Cancels the current activation.
476
477=== modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp'
478--- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2014-08-04 15:59:13 +0000
479+++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2015-08-13 10:55:16 +0000
480@@ -159,14 +159,16 @@
481 }
482 }
483
484-void MockScope::activate(QVariant const& result)
485+void MockScope::activate(QVariant const& result, QString const& categoryId)
486 {
487 Q_UNUSED(result);
488+ Q_UNUSED(categoryId);
489 }
490
491-unity::shell::scopes::PreviewStackInterface* MockScope::preview(QVariant const& result)
492+unity::shell::scopes::PreviewStackInterface* MockScope::preview(QVariant const& result, QString const& categoryId)
493 {
494 Q_UNUSED(result);
495+ Q_UNUSED(categoryId);
496
497 // This probably leaks, do we don't care
498 // it's a test after all
499
500=== modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h'
501--- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2014-08-04 15:59:13 +0000
502+++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2015-08-13 10:55:16 +0000
503@@ -57,8 +57,8 @@
504 void setActive(const bool) override;
505 void setFavorite(const bool) override;
506
507- Q_INVOKABLE void activate(QVariant const& result) override;
508- Q_INVOKABLE unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result) override;
509+ Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
510+ Q_INVOKABLE unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result, QString const& categoryId) override;
511 Q_INVOKABLE void cancelActivation() override;
512 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
513 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& departmentId) override;
514
515=== modified file 'test/qmltest/unity/shell/scopes/tst_Scopes.qml'
516--- test/qmltest/unity/shell/scopes/tst_Scopes.qml 2014-08-04 15:59:13 +0000
517+++ test/qmltest/unity/shell/scopes/tst_Scopes.qml 2015-08-13 10:55:16 +0000
518@@ -27,7 +27,7 @@
519 id: scopes
520 }
521 property var scope: scopes.getScope(0)
522- property var preview: root.scope.preview("")
523+ property var preview: root.scope.preview("", "")
524 property var navigation: root.scope.getNavigation("root")
525
526 Verifier {

Subscribers

People subscribed via source and target branches

to all changes: