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
=== modified file 'debian/changelog'
--- debian/changelog 2015-08-04 15:26:17 +0000
+++ debian/changelog 2015-08-13 10:55:16 +0000
@@ -1,4 +1,15 @@
1unity-api (7.99+15.10.20150804-0ubuntu1) wily; urgency=medium1unity-api (7.99+15.04.20150811-0ubuntu1) vivid; urgency=medium
2
3 [ Daniel d'Andrada ]
4 * New rebuild forced.
5 * Remove ApplicationManagerInterface.forceDashActive
6 * Remove ApplicationManagerInterface.suspended
7 * Add ApplicationInfoInterface.requestedState
8 * Add a NO_TESTS options to cmake
9
10 -- CI Train Bot <ci-train-bot@canonical.com> Tue, 11 Aug 2015 14:05:55 +0000
11
12unity-api (7.99+15.04.20150804-0ubuntu1) vivid; urgency=medium
213
3 [ Daniel d'Andrada ]14 [ Daniel d'Andrada ]
4 * Remove ApplicationManagerInterface.forceDashActive15 * Remove ApplicationManagerInterface.forceDashActive
@@ -8,13 +19,33 @@
819
9 -- CI Train Bot <ci-train-bot@canonical.com> Tue, 04 Aug 2015 15:26:16 +000020 -- CI Train Bot <ci-train-bot@canonical.com> Tue, 04 Aug 2015 15:26:16 +0000
1021
11unity-api (7.98+15.10.20150724-0ubuntu1) wily; urgency=medium22unity-api (7.99-0ubuntu1) UNRELEASED; urgency=medium
23
24 * Changes to activate and preview methods of ScopeInterface.
25
26 -- Pawel Stolowski <pawel.stolowski@canonical.com> Mon, 03 Aug 2015 14:03:47 +0000
27
28unity-api (7.98+15.04.20150805-0ubuntu1) UNRELEASED; urgency=medium
29
30 * Fake entry to keep train happy
31
32 -- CI Train Bot <ci-train-bot@canonical.com> Thu, 6 Aug 2015 09:53:01 +0000
33
34unity-api (7.98+15.04.20150724-0ubuntu1) vivid; urgency=medium
1235
13 [ Mirco Müller (MacSlow) ]36 [ Mirco Müller (MacSlow) ]
14 * added alerting/setAlerting API to LauncherModel and LauncherItem interfaces37 * added alerting/setAlerting API to LauncherModel and LauncherItem interfaces
1538
16 -- CI Train Bot <ci-train-bot@canonical.com> Fri, 24 Jul 2015 09:53:01 +000039 -- CI Train Bot <ci-train-bot@canonical.com> Fri, 24 Jul 2015 09:53:01 +0000
1740
41unity-api (7.98) UNRELEASED; urgency=medium
42
43 * Remove ApplicationManagerInterface.forceDashActive
44 * Remove ApplicationManagerInterface.suspended
45 * Add ApplicationInfoInterface.requestedState
46
47 -- Daniel d'Andrada <daniel.dandrada@canonical.com> Mon, 15 Jun 2015 13:53:07 -0300
48
18unity-api (7.97+15.10.20150721-0ubuntu1) wily; urgency=medium49unity-api (7.97+15.10.20150721-0ubuntu1) wily; urgency=medium
1950
20 [ Michi Henning ]51 [ Michi Henning ]
2152
=== modified file 'include/unity/shell/application/CMakeLists.txt'
--- include/unity/shell/application/CMakeLists.txt 2015-06-19 12:02:05 +0000
+++ include/unity/shell/application/CMakeLists.txt 2015-08-13 10:55:16 +0000
@@ -7,7 +7,7 @@
77
8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
99
10set(VERSION 7)10set(VERSION 8)
11set(PKGCONFIG_NAME "unity-shell-application")11set(PKGCONFIG_NAME "unity-shell-application")
12set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")12set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
13set(PKGCONFIG_REQUIRES "Qt5Core")13set(PKGCONFIG_REQUIRES "Qt5Core")
1414
=== added file 'include/unity/shell/application/Mir.h'
--- include/unity/shell/application/Mir.h 1970-01-01 00:00:00 +0000
+++ include/unity/shell/application/Mir.h 2015-08-13 10:55:16 +0000
@@ -0,0 +1,93 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UNITY_SHELL_APPLICATION_MIR_H
18#define UNITY_SHELL_APPLICATION_MIR_H
19
20#include <QObject>
21
22/**
23 @brief Acting mostly as a namespace to hold enums and such for use in QML
24 */
25class Mir : public QObject
26{
27 Q_OBJECT
28 Q_ENUMS(Type)
29 Q_ENUMS(State)
30 Q_ENUMS(OrientationAngle)
31
32 /**
33 @brief Name of the mouse cursor to be used. Follows the X Cursor naming convention.
34
35 Eg.: "left_ptr" is a left-sided pointer arrow
36 */
37 Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName NOTIFY cursorNameChanged)
38
39public:
40 /**
41 @brief Surface type
42 */
43 enum Type {
44 UnknownType,
45 NormalType,
46 UtilityType,
47 DialogType,
48 GlossType,
49 FreeStyleType,
50 MenuType,
51 InputMethodType,
52 SatelliteType,
53 TipType,
54 };
55
56 /**
57 @brief Surface state
58 */
59 enum State {
60 UnknownState,
61 RestoredState,
62 MinimizedState,
63 MaximizedState,
64 VertMaximizedState,
65 FullscreenState,
66 HorizMaximizedState,
67 HiddenState,
68 };
69
70 /**
71 @brief Surface orientation angle
72 */
73 enum OrientationAngle {
74 Angle0 = 0,
75 Angle90 = 90,
76 Angle180 = 180,
77 Angle270 = 270
78 };
79
80 /// @cond
81 virtual void setCursorName(const QString &cursorName) = 0;
82 virtual QString cursorName() const = 0;
83 /// @endcond
84
85Q_SIGNALS:
86 /// @cond
87 void cursorNameChanged(const QString &cursorName);
88 /// @endcond
89};
90
91Q_DECLARE_METATYPE(Mir::OrientationAngle)
92
93#endif // UNITY_SHELL_APPLICATION_MIR_H
094
=== added file 'include/unity/shell/application/MirSurfaceInterface.h'
--- include/unity/shell/application/MirSurfaceInterface.h 1970-01-01 00:00:00 +0000
+++ include/unity/shell/application/MirSurfaceInterface.h 2015-08-13 10:55:16 +0000
@@ -0,0 +1,113 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UNITY_SHELL_APPLICATION_MIRSURFACE_H
18#define UNITY_SHELL_APPLICATION_MIRSURFACE_H
19
20#include <QObject>
21#include <QSize>
22
23#include "Mir.h"
24
25namespace unity
26{
27namespace shell
28{
29namespace application
30{
31
32/**
33 @brief Holds a Mir surface. Pretty much an opaque class.
34
35 All surface manipulation is done by giving it to a MirSurfaceItem and then
36 using MirSurfaceItem's properties.
37 */
38class MirSurfaceInterface : public QObject
39{
40 Q_OBJECT
41
42 /**
43 * @brief The surface type
44 */
45 Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
46
47 /**
48 * @brief Name of the surface, given by the client application
49 */
50 Q_PROPERTY(QString name READ name CONSTANT)
51
52 /**
53 * @brief Size of the current surface buffer, in pixels.
54 */
55 Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
56
57 /**
58 * @brief State of the surface
59 */
60 Q_PROPERTY(Mir::State state READ state WRITE setState NOTIFY stateChanged)
61
62 /**
63 * @brief True if it has a mir client bound to it.
64 * A "zombie" (live == false) surface never becomes alive again.
65 */
66 Q_PROPERTY(bool live READ live NOTIFY liveChanged)
67
68 /**
69 * @brief Orientation angle of the surface
70 *
71 * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
72 */
73 Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
74 NOTIFY orientationAngleChanged DESIGNABLE false)
75
76public:
77 /// @cond
78 MirSurfaceInterface(QObject *parent = nullptr) : QObject(parent) {}
79 virtual ~MirSurfaceInterface() {}
80
81 virtual Mir::Type type() const = 0;
82
83 virtual QString name() const = 0;
84
85 virtual QSize size() const = 0;
86 virtual void resize(int width, int height) = 0;
87
88 virtual Mir::State state() const = 0;
89 virtual void setState(Mir::State qmlState) = 0;
90
91 virtual bool live() const = 0;
92
93 virtual Mir::OrientationAngle orientationAngle() const = 0;
94 virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
95 /// @endcond
96
97Q_SIGNALS:
98 /// @cond
99 void typeChanged(Mir::Type value);
100 void liveChanged(bool value);
101 void stateChanged(Mir::State value);
102 void orientationAngleChanged(Mir::OrientationAngle value);
103 void sizeChanged(const QSize &value);
104 /// @endcond
105};
106
107} // namespace application
108} // namespace shell
109} // namespace unity
110
111Q_DECLARE_METATYPE(unity::shell::application::MirSurfaceInterface*)
112
113#endif // UNITY_SHELL_APPLICATION_MIRSURFACE_H
0114
=== added file 'include/unity/shell/application/MirSurfaceItemInterface.h'
--- include/unity/shell/application/MirSurfaceItemInterface.h 1970-01-01 00:00:00 +0000
+++ include/unity/shell/application/MirSurfaceItemInterface.h 2015-08-13 10:55:16 +0000
@@ -0,0 +1,151 @@
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
18#define UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
19
20#include "Mir.h"
21
22#include <QQuickItem>
23
24namespace unity
25{
26namespace shell
27{
28namespace application
29{
30
31class MirSurfaceInterface;
32
33/**
34 @brief Renders a MirSurface in a QML scene and forwards the input events it receives to it.
35
36 You can have multiple MirSurfaceItems displaying the same MirSurface. But care must
37 be taken that only one of them feeds the MirSurface with input events and also only
38 one resizes it.
39 */
40class MirSurfaceItemInterface : public QQuickItem
41{
42 Q_OBJECT
43
44 /**
45 * @brief The surface to be displayed
46 */
47 Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface WRITE setSurface NOTIFY surfaceChanged)
48
49 /**
50 * @brief Type of the given surface or Mir.UnknownType if no surface is set
51 */
52 Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
53
54 /**
55 * @brief State of the given surface or Mir.UnknownState if no surface is set
56 */
57 Q_PROPERTY(Mir::State surfaceState READ surfaceState WRITE setSurfaceState NOTIFY surfaceStateChanged)
58
59 /**
60 * @brief Name of the given surface or an empty string if no surface is set
61 */
62 Q_PROPERTY(QString name READ name CONSTANT)
63
64 /**
65 * @brief True if the item has a surface and that surface has a mir client bound to it.
66 * A "zombie" (live == false) surface never becomes alive again.
67 */
68 Q_PROPERTY(bool live READ live NOTIFY liveChanged)
69
70 /**
71 * @brief Orientation angle of the given surface
72 *
73 * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
74 */
75 Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
76 NOTIFY orientationAngleChanged DESIGNABLE false)
77
78
79 /**
80 * @brief Whether the item will forward activeFocus, touch events, mouse events and key events to its surface.
81 * It's false by default.
82 * Only one item should have this property enabled for a given surface.
83 */
84 Q_PROPERTY(bool consumesInput READ consumesInput
85 WRITE setConsumesInput
86 NOTIFY consumesInputChanged)
87
88 /**
89 * @brief The desired width for the contained MirSurface.
90 * It's ignored if set to zero or a negative number
91 * The default value is zero
92 */
93 Q_PROPERTY(int surfaceWidth READ surfaceWidth
94 WRITE setSurfaceWidth
95 NOTIFY surfaceWidthChanged)
96
97 /**
98 * @brief The desired height for the contained MirSurface.
99 * It's ignored if set to zero or a negative number
100 * The default value is zero
101 */
102 Q_PROPERTY(int surfaceHeight READ surfaceHeight
103 WRITE setSurfaceHeight
104 NOTIFY surfaceHeightChanged)
105
106public:
107 /// @cond
108 MirSurfaceItemInterface(QQuickItem *parent = 0) : QQuickItem(parent) {}
109 virtual ~MirSurfaceItemInterface() {}
110
111 virtual Mir::Type type() const = 0;
112 virtual QString name() const = 0;
113 virtual bool live() const = 0;
114
115 virtual Mir::State surfaceState() const = 0;
116 virtual void setSurfaceState(Mir::State) = 0;
117
118 virtual Mir::OrientationAngle orientationAngle() const = 0;
119 virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
120
121 virtual MirSurfaceInterface* surface() const = 0;
122 virtual void setSurface(MirSurfaceInterface*) = 0;
123
124 virtual bool consumesInput() const = 0;
125 virtual void setConsumesInput(bool value) = 0;
126
127 virtual int surfaceWidth() const = 0;
128 virtual void setSurfaceWidth(int value) = 0;
129
130 virtual int surfaceHeight() const = 0;
131 virtual void setSurfaceHeight(int value) = 0;
132 /// @endcond
133
134Q_SIGNALS:
135 /// @cond
136 void typeChanged(Mir::Type);
137 void surfaceStateChanged(Mir::State);
138 void liveChanged(bool live);
139 void orientationAngleChanged(Mir::OrientationAngle angle);
140 void surfaceChanged(MirSurfaceInterface*);
141 void consumesInputChanged(bool value);
142 void surfaceWidthChanged(int value);
143 void surfaceHeightChanged(int value);
144 /// @endcond
145};
146
147} // namespace application
148} // namespace shell
149} // namespace unity
150
151#endif // UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
0152
=== modified file 'include/unity/shell/scopes/CMakeLists.txt'
--- include/unity/shell/scopes/CMakeLists.txt 2015-02-04 17:24:55 +0000
+++ include/unity/shell/scopes/CMakeLists.txt 2015-08-13 10:55:16 +0000
@@ -7,7 +7,7 @@
77
8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)8set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
99
10set(VERSION 6)10set(VERSION 7)
11set(PKGCONFIG_NAME "unity-shell-scopes")11set(PKGCONFIG_NAME "unity-shell-scopes")
12set(PKGCONFIG_DESCRIPTION "Unity shell Scopes APIs")12set(PKGCONFIG_DESCRIPTION "Unity shell Scopes APIs")
13set(PKGCONFIG_REQUIRES "Qt5Core")13set(PKGCONFIG_REQUIRES "Qt5Core")
1414
=== modified file 'include/unity/shell/scopes/ScopeInterface.h'
--- include/unity/shell/scopes/ScopeInterface.h 2014-08-04 15:59:13 +0000
+++ include/unity/shell/scopes/ScopeInterface.h 2015-08-13 10:55:16 +0000
@@ -198,7 +198,7 @@
198 /**198 /**
199 * @brief Method used to activate a result.199 * @brief Method used to activate a result.
200 */200 */
201 Q_INVOKABLE virtual void activate(QVariant const& result) = 0;201 Q_INVOKABLE virtual void activate(QVariant const& result, QString const& categoryId) = 0;
202202
203 /**203 /**
204 * @brief Method used to preview a result.204 * @brief Method used to preview a result.
@@ -206,7 +206,7 @@
206 * Returns a new PreviewStackInterface instance. It's caller's responsibility206 * Returns a new PreviewStackInterface instance. It's caller's responsibility
207 * to free it.207 * to free it.
208 */208 */
209 Q_INVOKABLE virtual unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result) = 0;209 Q_INVOKABLE virtual unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result, QString const& categoryId) = 0;
210210
211 /**211 /**
212 * @brief Cancels the current activation.212 * @brief Cancels the current activation.
213213
=== modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp'
--- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2014-08-04 15:59:13 +0000
+++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.cpp 2015-08-13 10:55:16 +0000
@@ -159,14 +159,16 @@
159 }159 }
160}160}
161161
162void MockScope::activate(QVariant const& result)162void MockScope::activate(QVariant const& result, QString const& categoryId)
163{163{
164 Q_UNUSED(result);164 Q_UNUSED(result);
165 Q_UNUSED(categoryId);
165}166}
166167
167unity::shell::scopes::PreviewStackInterface* MockScope::preview(QVariant const& result)168unity::shell::scopes::PreviewStackInterface* MockScope::preview(QVariant const& result, QString const& categoryId)
168{169{
169 Q_UNUSED(result);170 Q_UNUSED(result);
171 Q_UNUSED(categoryId);
170172
171 // This probably leaks, do we don't care173 // This probably leaks, do we don't care
172 // it's a test after all174 // it's a test after all
173175
=== modified file 'test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h'
--- test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2014-08-04 15:59:13 +0000
+++ test/qmltest/mocks/plugins/Unity/Scopes/Mocks/MockScope.h 2015-08-13 10:55:16 +0000
@@ -57,8 +57,8 @@
57 void setActive(const bool) override;57 void setActive(const bool) override;
58 void setFavorite(const bool) override;58 void setFavorite(const bool) override;
5959
60 Q_INVOKABLE void activate(QVariant const& result) override;60 Q_INVOKABLE void activate(QVariant const& result, QString const& categoryId) override;
61 Q_INVOKABLE unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result) override;61 Q_INVOKABLE unity::shell::scopes::PreviewStackInterface* preview(QVariant const& result, QString const& categoryId) override;
62 Q_INVOKABLE void cancelActivation() override;62 Q_INVOKABLE void cancelActivation() override;
63 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;63 Q_INVOKABLE void closeScope(unity::shell::scopes::ScopeInterface* scope) override;
64 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& departmentId) override;64 Q_INVOKABLE unity::shell::scopes::NavigationInterface* getNavigation(QString const& departmentId) override;
6565
=== modified file 'test/qmltest/unity/shell/scopes/tst_Scopes.qml'
--- test/qmltest/unity/shell/scopes/tst_Scopes.qml 2014-08-04 15:59:13 +0000
+++ test/qmltest/unity/shell/scopes/tst_Scopes.qml 2015-08-13 10:55:16 +0000
@@ -27,7 +27,7 @@
27 id: scopes27 id: scopes
28 }28 }
29 property var scope: scopes.getScope(0)29 property var scope: scopes.getScope(0)
30 property var preview: root.scope.preview("")30 property var preview: root.scope.preview("", "")
31 property var navigation: root.scope.getNavigation("root")31 property var navigation: root.scope.getNavigation("root")
3232
33 Verifier {33 Verifier {

Subscribers

People subscribed via source and target branches

to all changes: