Merge lp:~unity-team/unity-api/fwdport-mirsurfaceitem into lp:unity-api

Proposed by kevin gunn
Status: Rejected
Rejected by: Michał Sawicz
Proposed branch: lp:~unity-team/unity-api/fwdport-mirsurfaceitem
Merge into: lp:unity-api
Diff against target: 416 lines (+366/-3)
5 files modified
debian/changelog (+24/-2)
include/unity/shell/application/CMakeLists.txt (+1/-1)
include/unity/shell/application/Mir.h (+76/-0)
include/unity/shell/application/MirSurfaceInterface.h (+114/-0)
include/unity/shell/application/MirSurfaceItemInterface.h (+151/-0)
To merge this branch: bzr merge lp:~unity-team/unity-api/fwdport-mirsurfaceitem
Reviewer Review Type Date Requested Status
Michał Sawicz Disapprove
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+269881@code.launchpad.net

Commit message

This is a forward port from lp:unity-api/trunk-15.04 to lp:unity-api of the MirSurface and MirSurfaceItem used by qtmir

Description of the change

This is a forward port from lp:unity-api/trunk-15.04 to lp:unity-api of the MirSurface and MirSurfaceItem used by qtmir

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Let's not do this in an MP to keep the history sane. We'll just release the next silo into wily. Whether it'll have changes or not.

review: Disapprove

Unmerged revisions

184. By kevin gunn

backport MirSurface and MirSurfaceItem

183. By CI Train Bot Account

Releasing 7.99+15.10.20150826-0ubuntu1

182. By Paweł Stołowski

Change activate/preview methods to take categoryId. Fixes: #1428063
Approved by: PS Jenkins bot

181. By CI Train Bot Account

Releasing 7.99+15.10.20150804-0ubuntu1

180. By Daniel d'Andrada <dandrader@panzer>

Add a NO_TESTS options to cmake

Run cmake with -DNO_TESTS=true to skip building tests. Makes for a way faster build.
Approved by: PS Jenkins bot, Albert Astals Cid

179. By Daniel d'Andrada

Let users of the API suspend & resume individual apps at will

API Changes:
- Removed ApplicationManagerInterface.forceDashActive
- Removed ApplicationManagerInterface.suspended
- Added ApplicationInfoInterface.requestedState
Approved by: PS Jenkins bot, Gerry Boland

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-26 08:59:22 +0000
3+++ debian/changelog 2015-09-02 10:40:26 +0000
4@@ -1,3 +1,13 @@
5+unity-api (7.100+15.04.20150827-0ubuntu1) vivid; urgency=medium
6+
7+ [ Daniel d'Andrada ]
8+ * Added MirSurface and MirSurfaceItem interfaces
9+
10+ [ CI Train Bot ]
11+ * No-change rebuild.
12+
13+ -- CI Train Bot <ci-train-bot@canonical.com> Thu, 27 Aug 2015 08:50:45 +0000
14+
15 unity-api (7.99+15.10.20150826-0ubuntu1) wily; urgency=medium
16
17 [ Pawel Stolowski ]
18@@ -8,7 +18,13 @@
19
20 -- CI Train Bot <ci-train-bot@canonical.com> Wed, 26 Aug 2015 08:59:21 +0000
21
22-unity-api (7.99+15.10.20150804-0ubuntu1) wily; urgency=medium
23+unity-api (7.99+15.04.20150811-0ubuntu1) vivid; urgency=medium
24+
25+ * New rebuild forced.
26+
27+ -- CI Train Bot <ci-train-bot@canonical.com> Tue, 11 Aug 2015 14:05:55 +0000
28+
29+unity-api (7.99+15.04.20150804-0ubuntu1) vivid; urgency=medium
30
31 [ Daniel d'Andrada ]
32 * Remove ApplicationManagerInterface.forceDashActive
33@@ -18,7 +34,13 @@
34
35 -- CI Train Bot <ci-train-bot@canonical.com> Tue, 04 Aug 2015 15:26:16 +0000
36
37-unity-api (7.98+15.10.20150724-0ubuntu1) wily; urgency=medium
38+unity-api (7.99-0ubuntu1) UNRELEASED; urgency=medium
39+
40+ * Changes to activate and preview methods of ScopeInterface.
41+
42+ -- Pawel Stolowski <pawel.stolowski@canonical.com> Mon, 03 Aug 2015 14:03:47 +0000
43+
44+unity-api (7.98+15.04.20150724-0ubuntu1) vivid; urgency=medium
45
46 [ Mirco Müller (MacSlow) ]
47 * added alerting/setAlerting API to LauncherModel and LauncherItem interfaces
48
49=== modified file 'include/unity/shell/application/CMakeLists.txt'
50--- include/unity/shell/application/CMakeLists.txt 2015-06-19 12:02:05 +0000
51+++ include/unity/shell/application/CMakeLists.txt 2015-09-02 10:40:26 +0000
52@@ -7,7 +7,7 @@
53
54 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
55
56-set(VERSION 7)
57+set(VERSION 8)
58 set(PKGCONFIG_NAME "unity-shell-application")
59 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
60 set(PKGCONFIG_REQUIRES "Qt5Core")
61
62=== added file 'include/unity/shell/application/Mir.h'
63--- include/unity/shell/application/Mir.h 1970-01-01 00:00:00 +0000
64+++ include/unity/shell/application/Mir.h 2015-09-02 10:40:26 +0000
65@@ -0,0 +1,76 @@
66+/*
67+ * Copyright (C) 2015 Canonical, Ltd.
68+ *
69+ * This program is free software; you can redistribute it and/or modify
70+ * it under the terms of the GNU General Public License as published by
71+ * the Free Software Foundation; version 3.
72+ *
73+ * This program is distributed in the hope that it will be useful,
74+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
75+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
76+ * GNU General Public License for more details.
77+ *
78+ * You should have received a copy of the GNU General Public License
79+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
80+ */
81+
82+#ifndef UNITY_SHELL_APPLICATION_MIR_H
83+#define UNITY_SHELL_APPLICATION_MIR_H
84+
85+#include <QObject>
86+
87+/**
88+ @brief Acting as a namespace to hold enums and such for use in QML
89+ */
90+class Mir
91+{
92+ Q_GADGET
93+ Q_ENUMS(Type)
94+ Q_ENUMS(State)
95+ Q_ENUMS(OrientationAngle)
96+
97+public:
98+ /**
99+ @brief Surface type
100+ */
101+ enum Type {
102+ UnknownType,
103+ NormalType,
104+ UtilityType,
105+ DialogType,
106+ GlossType,
107+ FreeStyleType,
108+ MenuType,
109+ InputMethodType,
110+ SatelliteType,
111+ TipType,
112+ };
113+
114+ /**
115+ @brief Surface state
116+ */
117+ enum State {
118+ UnknownState,
119+ RestoredState,
120+ MinimizedState,
121+ MaximizedState,
122+ VertMaximizedState,
123+ FullscreenState,
124+ HorizMaximizedState,
125+ HiddenState,
126+ };
127+
128+ /**
129+ @brief Surface orientation angle
130+ */
131+ enum OrientationAngle {
132+ Angle0 = 0,
133+ Angle90 = 90,
134+ Angle180 = 180,
135+ Angle270 = 270
136+ };
137+};
138+
139+Q_DECLARE_METATYPE(Mir::OrientationAngle)
140+
141+#endif // UNITY_SHELL_APPLICATION_MIR_H
142
143=== added file 'include/unity/shell/application/MirSurfaceInterface.h'
144--- include/unity/shell/application/MirSurfaceInterface.h 1970-01-01 00:00:00 +0000
145+++ include/unity/shell/application/MirSurfaceInterface.h 2015-09-02 10:40:26 +0000
146@@ -0,0 +1,114 @@
147+/*
148+ * Copyright (C) 2015 Canonical, Ltd.
149+ *
150+ * This program is free software; you can redistribute it and/or modify
151+ * it under the terms of the GNU General Public License as published by
152+ * the Free Software Foundation; version 3.
153+ *
154+ * This program is distributed in the hope that it will be useful,
155+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
156+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
157+ * GNU General Public License for more details.
158+ *
159+ * You should have received a copy of the GNU General Public License
160+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
161+ */
162+
163+#ifndef UNITY_SHELL_APPLICATION_MIRSURFACE_H
164+#define UNITY_SHELL_APPLICATION_MIRSURFACE_H
165+
166+#include <QObject>
167+#include <QSize>
168+
169+#include "Mir.h"
170+
171+namespace unity
172+{
173+namespace shell
174+{
175+namespace application
176+{
177+
178+/**
179+ @brief Holds a Mir surface. Pretty much an opaque class.
180+
181+ All surface manipulation is done by giving it to a MirSurfaceItem and then
182+ using MirSurfaceItem's properties.
183+ */
184+class MirSurfaceInterface : public QObject
185+{
186+ Q_OBJECT
187+
188+ /**
189+ * @brief The surface type
190+ */
191+ Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
192+
193+ /**
194+ * @brief Name of the surface, given by the client application
195+ */
196+ Q_PROPERTY(QString name READ name CONSTANT)
197+
198+ /**
199+ * @brief Size of the current surface buffer, in pixels.
200+ */
201+ Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
202+
203+ /**
204+ * @brief State of the surface
205+ */
206+ Q_PROPERTY(Mir::State state READ state WRITE setState NOTIFY stateChanged)
207+
208+ /**
209+ * @brief True if it has a mir client bound to it.
210+ * A "zombie" (live == false) surface never becomes alive again.
211+ */
212+ Q_PROPERTY(bool live READ live NOTIFY liveChanged)
213+
214+ /**
215+ * @brief Orientation angle of the surface
216+ *
217+ * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
218+ */
219+ Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
220+ NOTIFY orientationAngleChanged DESIGNABLE false)
221+
222+public:
223+ /// @cond
224+ MirSurfaceInterface(QObject *parent = nullptr) : QObject(parent) {}
225+ virtual ~MirSurfaceInterface() {}
226+
227+ virtual Mir::Type type() const = 0;
228+
229+ virtual QString name() const = 0;
230+
231+ virtual QSize size() const = 0;
232+ virtual void resize(int width, int height) = 0;
233+ virtual void resize(const QSize &size) = 0;
234+
235+ virtual Mir::State state() const = 0;
236+ virtual void setState(Mir::State qmlState) = 0;
237+
238+ virtual bool live() const = 0;
239+
240+ virtual Mir::OrientationAngle orientationAngle() const = 0;
241+ virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
242+ /// @endcond
243+
244+Q_SIGNALS:
245+ /// @cond
246+ void typeChanged(Mir::Type value);
247+ void liveChanged(bool value);
248+ void stateChanged(Mir::State value);
249+ void orientationAngleChanged(Mir::OrientationAngle value);
250+ void sizeChanged(const QSize &value);
251+ /// @endcond
252+};
253+
254+} // namespace application
255+} // namespace shell
256+} // namespace unity
257+
258+Q_DECLARE_METATYPE(unity::shell::application::MirSurfaceInterface*)
259+
260+#endif // UNITY_SHELL_APPLICATION_MIRSURFACE_H
261
262=== added file 'include/unity/shell/application/MirSurfaceItemInterface.h'
263--- include/unity/shell/application/MirSurfaceItemInterface.h 1970-01-01 00:00:00 +0000
264+++ include/unity/shell/application/MirSurfaceItemInterface.h 2015-09-02 10:40:26 +0000
265@@ -0,0 +1,151 @@
266+/*
267+ * Copyright (C) 2015 Canonical, Ltd.
268+ *
269+ * This program is free software; you can redistribute it and/or modify
270+ * it under the terms of the GNU General Public License as published by
271+ * the Free Software Foundation; version 3.
272+ *
273+ * This program is distributed in the hope that it will be useful,
274+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
275+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
276+ * GNU General Public License for more details.
277+ *
278+ * You should have received a copy of the GNU General Public License
279+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
280+ */
281+
282+#ifndef UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
283+#define UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H
284+
285+#include "Mir.h"
286+
287+#include <QQuickItem>
288+
289+namespace unity
290+{
291+namespace shell
292+{
293+namespace application
294+{
295+
296+class MirSurfaceInterface;
297+
298+/**
299+ @brief Renders a MirSurface in a QML scene and forwards the input events it receives to it.
300+
301+ You can have multiple MirSurfaceItems displaying the same MirSurface. But care must
302+ be taken that only one of them feeds the MirSurface with input events and also only
303+ one resizes it.
304+ */
305+class MirSurfaceItemInterface : public QQuickItem
306+{
307+ Q_OBJECT
308+
309+ /**
310+ * @brief The surface to be displayed
311+ */
312+ Q_PROPERTY(unity::shell::application::MirSurfaceInterface* surface READ surface WRITE setSurface NOTIFY surfaceChanged)
313+
314+ /**
315+ * @brief Type of the given surface or Mir.UnknownType if no surface is set
316+ */
317+ Q_PROPERTY(Mir::Type type READ type NOTIFY typeChanged)
318+
319+ /**
320+ * @brief State of the given surface or Mir.UnknownState if no surface is set
321+ */
322+ Q_PROPERTY(Mir::State surfaceState READ surfaceState WRITE setSurfaceState NOTIFY surfaceStateChanged)
323+
324+ /**
325+ * @brief Name of the given surface or an empty string if no surface is set
326+ */
327+ Q_PROPERTY(QString name READ name CONSTANT)
328+
329+ /**
330+ * @brief True if the item has a surface and that surface has a mir client bound to it.
331+ * A "zombie" (live == false) surface never becomes alive again.
332+ */
333+ Q_PROPERTY(bool live READ live NOTIFY liveChanged)
334+
335+ /**
336+ * @brief Orientation angle of the given surface
337+ *
338+ * How many degrees, clockwise, the UI in the surface has to rotate to match shell's UI orientation
339+ */
340+ Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
341+ NOTIFY orientationAngleChanged DESIGNABLE false)
342+
343+
344+ /**
345+ * @brief Whether the item will forward activeFocus, touch events, mouse events and key events to its surface.
346+ * It's false by default.
347+ * Only one item should have this property enabled for a given surface.
348+ */
349+ Q_PROPERTY(bool consumesInput READ consumesInput
350+ WRITE setConsumesInput
351+ NOTIFY consumesInputChanged)
352+
353+ /**
354+ * @brief The desired width for the contained MirSurface.
355+ * It's ignored if set to zero or a negative number
356+ * The default value is zero
357+ */
358+ Q_PROPERTY(int surfaceWidth READ surfaceWidth
359+ WRITE setSurfaceWidth
360+ NOTIFY surfaceWidthChanged)
361+
362+ /**
363+ * @brief The desired height for the contained MirSurface.
364+ * It's ignored if set to zero or a negative number
365+ * The default value is zero
366+ */
367+ Q_PROPERTY(int surfaceHeight READ surfaceHeight
368+ WRITE setSurfaceHeight
369+ NOTIFY surfaceHeightChanged)
370+
371+public:
372+ /// @cond
373+ MirSurfaceItemInterface(QQuickItem *parent = 0) : QQuickItem(parent) {}
374+ virtual ~MirSurfaceItemInterface() {}
375+
376+ virtual Mir::Type type() const = 0;
377+ virtual QString name() const = 0;
378+ virtual bool live() const = 0;
379+
380+ virtual Mir::State surfaceState() const = 0;
381+ virtual void setSurfaceState(Mir::State) = 0;
382+
383+ virtual Mir::OrientationAngle orientationAngle() const = 0;
384+ virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
385+
386+ virtual MirSurfaceInterface* surface() const = 0;
387+ virtual void setSurface(MirSurfaceInterface*) = 0;
388+
389+ virtual bool consumesInput() const = 0;
390+ virtual void setConsumesInput(bool value) = 0;
391+
392+ virtual int surfaceWidth() const = 0;
393+ virtual void setSurfaceWidth(int value) = 0;
394+
395+ virtual int surfaceHeight() const = 0;
396+ virtual void setSurfaceHeight(int value) = 0;
397+ /// @endcond
398+
399+Q_SIGNALS:
400+ /// @cond
401+ void typeChanged(Mir::Type);
402+ void surfaceStateChanged(Mir::State);
403+ void liveChanged(bool live);
404+ void orientationAngleChanged(Mir::OrientationAngle angle);
405+ void surfaceChanged(MirSurfaceInterface*);
406+ void consumesInputChanged(bool value);
407+ void surfaceWidthChanged(int value);
408+ void surfaceHeightChanged(int value);
409+ /// @endcond
410+};
411+
412+} // namespace application
413+} // namespace shell
414+} // namespace unity
415+
416+#endif // UNITY_SHELL_APPLICATION_MIRSURFACEITEM_H

Subscribers

People subscribed via source and target branches

to all changes: