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

Proposed by Michał Sawicz
Status: Superseded
Proposed branch: lp:~unity-team/unity-api/surfaceItemSizeHints
Merge into: lp:unity-api
Diff against target: 135 lines (+62/-1)
3 files modified
include/unity/shell/application/ApplicationInfoInterface.h (+10/-1)
include/unity/shell/application/MirSurfaceInterface.h (+49/-0)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h (+3/-0)
To merge this branch: bzr merge lp:~unity-team/unity-api/surfaceItemSizeHints
Reviewer Review Type Date Requested Status
Unity8 CI Bot continuous-integration Approve
PS Jenkins bot (community) continuous-integration Approve
Lukáš Tinkl Pending
Review via email: mp+284829@code.launchpad.net

This proposal supersedes a proposal from 2015-11-26.

This proposal has been superseded by a proposal from 2016-02-03.

Commit message

MirSurfaceInterface: added size hints

Description of the change

MirSurfaceInterface: added size hints

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote : Posted in a previous version of this proposal

LGTM, approving

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:205
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-1-ci/14/
Executed test runs:

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity-api-1-ci/14/rebuild

review: Approve (continuous-integration)
208. By Daniel d'Andrada

MirSurfaceInterface: added size hints

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/unity/shell/application/ApplicationInfoInterface.h'
2--- include/unity/shell/application/ApplicationInfoInterface.h 2015-12-03 19:03:29 +0000
3+++ include/unity/shell/application/ApplicationInfoInterface.h 2016-02-03 11:32:37 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2013,2015 Canonical Ltd.
7+ * Copyright 2013,2015,2016 Canonical Ltd.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published by
11@@ -22,6 +22,7 @@
12 #include <QtCore/QObject>
13 #include <QtCore/QUrl>
14 #include <QColor>
15+#include <QSize>
16
17 namespace unity
18 {
19@@ -211,6 +212,11 @@
20 */
21 Q_PROPERTY(bool exemptFromLifecycle READ exemptFromLifecycle WRITE setExemptFromLifecycle NOTIFY exemptFromLifecycleChanged)
22
23+ /**
24+ * @brief The size to be given for new surfaces created by this application
25+ */
26+ Q_PROPERTY(QSize initialSurfaceSize READ initialSurfaceSize WRITE setInitialSurfaceSize NOTIFY initialSurfaceSizeChanged)
27+
28 protected:
29 /// @cond
30 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
31@@ -284,6 +290,8 @@
32 virtual bool isTouchApp() const = 0;
33 virtual bool exemptFromLifecycle() const = 0;
34 virtual void setExemptFromLifecycle(bool) = 0;
35+ virtual QSize initialSurfaceSize() const = 0;
36+ virtual void setInitialSurfaceSize(const QSize &size) = 0;
37 /// @endcond
38
39 Q_SIGNALS:
40@@ -296,6 +304,7 @@
41 void requestedStateChanged(RequestedState value);
42 void focusedChanged(bool focused);
43 void exemptFromLifecycleChanged(bool exemptFromLifecycle);
44+ void initialSurfaceSizeChanged(const QSize &size);
45 /// @endcond
46 };
47
48
49=== modified file 'include/unity/shell/application/MirSurfaceInterface.h'
50--- include/unity/shell/application/MirSurfaceInterface.h 2015-10-26 18:26:01 +0000
51+++ include/unity/shell/application/MirSurfaceInterface.h 2016-02-03 11:32:37 +0000
52@@ -78,6 +78,42 @@
53 Q_PROPERTY(Mir::OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
54 NOTIFY orientationAngleChanged DESIGNABLE false)
55
56+ /**
57+ * @brief The requested minimum width for the surface
58+ * Zero if not set
59+ */
60+ Q_PROPERTY(int minimumWidth READ minimumWidth NOTIFY minimumWidthChanged)
61+
62+ /**
63+ * @brief The requested minimum height for the surface
64+ * Zero if not set
65+ */
66+ Q_PROPERTY(int minimumHeight READ minimumHeight NOTIFY minimumHeightChanged)
67+
68+ /**
69+ * @brief The requested maximum width for the surface
70+ * Zero if not set
71+ */
72+ Q_PROPERTY(int maximumWidth READ maximumWidth NOTIFY maximumWidthChanged)
73+
74+ /**
75+ * @brief The requested maximum height for the surface
76+ * Zero if not set
77+ */
78+ Q_PROPERTY(int maximumHeight READ maximumHeight NOTIFY maximumHeightChanged)
79+
80+ /**
81+ * @brief The requested width increment for the surface
82+ * Zero if not set
83+ */
84+ Q_PROPERTY(int widthIncrement READ widthIncrement NOTIFY widthIncrementChanged)
85+
86+ /**
87+ * @brief The requested height increment for the surface
88+ * Zero if not set
89+ */
90+ Q_PROPERTY(int heightIncrement READ heightIncrement NOTIFY heightIncrementChanged)
91+
92 public:
93 /// @cond
94 MirSurfaceInterface(QObject *parent = nullptr) : QObject(parent) {}
95@@ -100,6 +136,13 @@
96
97 virtual Mir::OrientationAngle orientationAngle() const = 0;
98 virtual void setOrientationAngle(Mir::OrientationAngle angle) = 0;
99+
100+ virtual int minimumWidth() const = 0;
101+ virtual int minimumHeight() const = 0;
102+ virtual int maximumWidth() const = 0;
103+ virtual int maximumHeight() const = 0;
104+ virtual int widthIncrement() const = 0;
105+ virtual int heightIncrement() const = 0;
106 /// @endcond
107
108 Q_SIGNALS:
109@@ -111,6 +154,12 @@
110 void orientationAngleChanged(Mir::OrientationAngle value);
111 void sizeChanged(const QSize &value);
112 void nameChanged(const QString &name);
113+ void minimumWidthChanged(int value);
114+ void minimumHeightChanged(int value);
115+ void maximumWidthChanged(int value);
116+ void maximumHeightChanged(int value);
117+ void widthIncrementChanged(int value);
118+ void heightIncrementChanged(int value);
119 /// @endcond
120 };
121
122
123=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h'
124--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2015-12-03 17:07:15 +0000
125+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2016-02-03 11:32:37 +0000
126@@ -59,6 +59,9 @@
127 bool exemptFromLifecycle() const override;
128 void setExemptFromLifecycle(bool exemptFromLifecycle) override;
129
130+ QSize initialSurfaceSize() const override { return QSize(); }
131+ void setInitialSurfaceSize(const QSize &) override {}
132+
133 private:
134 QString m_appId;
135 QString m_name;

Subscribers

People subscribed via source and target branches

to all changes: