Merge lp:~lukas-kde/unity-api/liveCaption into lp:unity-api

Proposed by Lukáš Tinkl
Status: Superseded
Proposed branch: lp:~lukas-kde/unity-api/liveCaption
Merge into: lp:unity-api
Diff against target: 263 lines (+170/-6)
7 files modified
debian/changelog (+8/-0)
include/unity/shell/application/CMakeLists.txt (+1/-1)
include/unity/shell/application/Mir.h (+20/-3)
include/unity/shell/application/MirMousePointerInterface.h (+99/-0)
include/unity/shell/application/MirPlatformCursor.h (+38/-0)
include/unity/shell/application/MirSurfaceInterface.h (+2/-1)
include/unity/shell/application/MirSurfaceItemInterface.h (+2/-1)
To merge this branch: bzr merge lp:~lukas-kde/unity-api/liveCaption
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Unity Team Pending
Review via email: mp+272753@code.launchpad.net

This proposal has been superseded by a proposal from 2015-09-29.

Commit message

Notify about surface name changes

Description of the change

Notify about surface name changes, bump api version

Cf: https://bugs.launchpad.net/ubuntu/+source/unity-api/+bug/1497092

* Are there any related MPs required for this MP to build/function as expected? Please list.

No

* Did you perform an exploratory manual test run of your code change and any related functionality?

Yes

* Did you make sure that your branch does not contain spurious tags?

Yes

* If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

Yes

* If you changed the UI, has there been a design review?

N/A

To post a comment you must log in.
lp:~lukas-kde/unity-api/liveCaption updated
190. By Lukáš Tinkl

rebase on top of lp:~dandrader/unity-api/mousePointer

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Unmerged revisions

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-09-15 09:15:11 +0000
3+++ debian/changelog 2015-09-29 14:28:01 +0000
4@@ -1,3 +1,11 @@
5+unity-api (7.101) UNRELEASED; urgency=medium
6+
7+ * unity/shell/application: Add Mir.cursorName
8+ * unity/shell/application: Added MirMousePointerInterface.h
9+ * unity/shell/application: Added MirPlatformCursor.h
10+
11+ -- Daniel d'Andrada <daniel.dandrada@canonical.com> Tue, 01 Sep 2015 13:38:11 -0300
12+
13 unity-api (7.100+15.10.20150903-0ubuntu1) wily; urgency=medium
14
15 [ Michal Sawicz ]
16
17=== modified file 'include/unity/shell/application/CMakeLists.txt'
18--- include/unity/shell/application/CMakeLists.txt 2015-08-19 13:18:09 +0000
19+++ include/unity/shell/application/CMakeLists.txt 2015-09-29 14:28:01 +0000
20@@ -7,7 +7,7 @@
21
22 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
23
24-set(VERSION 8)
25+set(VERSION 9)
26 set(PKGCONFIG_NAME "unity-shell-application")
27 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
28 set(PKGCONFIG_REQUIRES "Qt5Core")
29
30=== modified file 'include/unity/shell/application/Mir.h'
31--- include/unity/shell/application/Mir.h 2015-08-19 13:18:09 +0000
32+++ include/unity/shell/application/Mir.h 2015-09-29 14:28:01 +0000
33@@ -20,15 +20,22 @@
34 #include <QObject>
35
36 /**
37- @brief Acting as a namespace to hold enums and such for use in QML
38+ @brief Acting mostly as a namespace to hold enums and such for use in QML
39 */
40-class Mir
41+class Mir : public QObject
42 {
43- Q_GADGET
44+ Q_OBJECT
45 Q_ENUMS(Type)
46 Q_ENUMS(State)
47 Q_ENUMS(OrientationAngle)
48
49+ /**
50+ @brief Name of the mouse cursor to be used. Follows the X Cursor naming convention.
51+
52+ Eg.: "left_ptr" is a left-sided pointer arrow
53+ */
54+ Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName NOTIFY cursorNameChanged)
55+
56 public:
57 /**
58 @brief Surface type
59@@ -69,6 +76,16 @@
60 Angle180 = 180,
61 Angle270 = 270
62 };
63+
64+ /// @cond
65+ virtual void setCursorName(const QString &cursorName) = 0;
66+ virtual QString cursorName() const = 0;
67+ /// @endcond
68+
69+Q_SIGNALS:
70+ /// @cond
71+ void cursorNameChanged(const QString &cursorName);
72+ /// @endcond
73 };
74
75 Q_DECLARE_METATYPE(Mir::OrientationAngle)
76
77=== added file 'include/unity/shell/application/MirMousePointerInterface.h'
78--- include/unity/shell/application/MirMousePointerInterface.h 1970-01-01 00:00:00 +0000
79+++ include/unity/shell/application/MirMousePointerInterface.h 2015-09-29 14:28:01 +0000
80@@ -0,0 +1,99 @@
81+/*
82+ * Copyright (C) 2015 Canonical, Ltd.
83+ *
84+ * This program is free software: you can redistribute it and/or modify it under
85+ * the terms of the GNU Lesser General Public License version 3, as published by
86+ * the Free Software Foundation.
87+ *
88+ * This program is distributed in the hope that it will be useful, but WITHOUT
89+ * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
90+ * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
91+ * Lesser General Public License for more details.
92+ *
93+ * You should have received a copy of the GNU Lesser General Public License
94+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
95+ */
96+
97+#ifndef MIR_MOUSE_POINTER_INTERFACE_H
98+#define MIR_MOUSE_POINTER_INTERFACE_H
99+
100+#include <QQuickItem>
101+
102+/**
103+ * @brief The QML mouse pointer
104+ *
105+ * FIXME: Get this out of unity-api
106+ *
107+ * This QML item drives the position of the Mir mouse pointer on the scene
108+ */
109+class MirMousePointerInterface : public QQuickItem {
110+ Q_OBJECT
111+
112+ /**
113+ * @brief Name of the cursor
114+ * Defines the look of the mouse pointer along with themeName
115+ */
116+ Q_PROPERTY(QString cursorName READ cursorName NOTIFY cursorNameChanged)
117+
118+ /**
119+ * @brief Name of the cursor theme
120+ * Defines the look of the mouse pointer along with cursorName
121+ * Its default value is "default".
122+ */
123+ Q_PROPERTY(QString themeName READ themeName NOTIFY themeNameChanged)
124+
125+ /**
126+ * @brief X coordinate of the cursor hotspot
127+ * Is value depends on the current cursor name and theme
128+ */
129+ Q_PROPERTY(qreal hotspotX READ hotspotX NOTIFY hotspotXChanged)
130+
131+ /**
132+ * @brief Y coordinate of the cursor hotspot
133+ * Is value depends on the current cursor name and theme
134+ */
135+ Q_PROPERTY(qreal hotspotY READ hotspotY NOTIFY hotspotYChanged)
136+public:
137+ /**
138+ * @brief The constructor
139+ */
140+ MirMousePointerInterface(QQuickItem *parent = nullptr) : QQuickItem(parent) {}
141+
142+ /// @cond
143+ virtual void setCursorName(const QString &cursorName) = 0;
144+ virtual QString cursorName() const = 0;
145+
146+ virtual void setThemeName(const QString &themeName) = 0;
147+ virtual QString themeName() const = 0;
148+
149+ virtual qreal hotspotX() const = 0;
150+ virtual qreal hotspotY() const = 0;
151+ /// @endcond
152+
153+Q_SIGNALS:
154+ /// @cond
155+ void cursorNameChanged(QString name);
156+ void themeNameChanged(QString name);
157+ void hotspotXChanged(qreal value);
158+ void hotspotYChanged(qreal value);
159+ /// @endcond
160+
161+public Q_SLOTS:
162+ /**
163+ * @brief Handler for Mir mouse events
164+ * The implementation should respond to Mir mouse events by moving itself along its parent
165+ * area.
166+ * This is called by Mir's platform cursor.
167+ *
168+ * Note that we get only relative mouse movement, since the mouse pointer position is defined
169+ * by this very item. Ie., it's up to this class to decide whether or not it (the mouse pointer)
170+ * should move (and how much) due to movement in a mouse device.
171+ *
172+ * @param movement Movement vector
173+ */
174+ virtual void handleMouseEvent(ulong timestamp, QPointF movement, Qt::MouseButton buttons,
175+ Qt::KeyboardModifiers modifiers) = 0;
176+
177+};
178+
179+#endif // MIR_MOUSE_POINTER_INTERFACE_H
180
181=== added file 'include/unity/shell/application/MirPlatformCursor.h'
182--- include/unity/shell/application/MirPlatformCursor.h 1970-01-01 00:00:00 +0000
183+++ include/unity/shell/application/MirPlatformCursor.h 2015-09-29 14:28:01 +0000
184@@ -0,0 +1,38 @@
185+/*
186+ * Copyright (C) 2015 Canonical, Ltd.
187+ *
188+ * This program is free software; you can redistribute it and/or modify
189+ * it under the terms of the GNU General Public License as published by
190+ * the Free Software Foundation; version 3.
191+ *
192+ * This program is distributed in the hope that it will be useful,
193+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
194+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
195+ * GNU General Public License for more details.
196+ *
197+ * You should have received a copy of the GNU General Public License
198+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
199+ */
200+
201+#ifndef MIR_PLATFORM_CURSOR_H
202+#define MIR_PLATFORM_CURSOR_H
203+
204+#include <qpa/qplatformcursor.h>
205+
206+class MirMousePointerInterface;
207+
208+/**
209+ * @brief Cursor interface for Mir platform
210+ *
211+ * FIXME: Get this out of unity-api
212+ */
213+class MirPlatformCursor : public QPlatformCursor
214+{
215+public:
216+ /**
217+ * @brief Set the QML mouse pointer that this platform cursor will talk to
218+ */
219+ virtual void setMousePointer(MirMousePointerInterface *mousePointer) = 0;
220+};
221+
222+#endif // MIR_PLATFORM_CURSOR_H
223
224=== modified file 'include/unity/shell/application/MirSurfaceInterface.h'
225--- include/unity/shell/application/MirSurfaceInterface.h 2015-08-19 13:18:09 +0000
226+++ include/unity/shell/application/MirSurfaceInterface.h 2015-09-29 14:28:01 +0000
227@@ -47,7 +47,7 @@
228 /**
229 * @brief Name of the surface, given by the client application
230 */
231- Q_PROPERTY(QString name READ name CONSTANT)
232+ Q_PROPERTY(QString name READ name NOTIFY nameChanged)
233
234 /**
235 * @brief Size of the current surface buffer, in pixels.
236@@ -102,6 +102,7 @@
237 void stateChanged(Mir::State value);
238 void orientationAngleChanged(Mir::OrientationAngle value);
239 void sizeChanged(const QSize &value);
240+ void nameChanged(const QString &name);
241 /// @endcond
242 };
243
244
245=== modified file 'include/unity/shell/application/MirSurfaceItemInterface.h'
246--- include/unity/shell/application/MirSurfaceItemInterface.h 2015-08-19 13:18:09 +0000
247+++ include/unity/shell/application/MirSurfaceItemInterface.h 2015-09-29 14:28:01 +0000
248@@ -59,7 +59,7 @@
249 /**
250 * @brief Name of the given surface or an empty string if no surface is set
251 */
252- Q_PROPERTY(QString name READ name CONSTANT)
253+ Q_PROPERTY(QString name READ name NOTIFY nameChanged)
254
255 /**
256 * @brief True if the item has a surface and that surface has a mir client bound to it.
257@@ -141,6 +141,7 @@
258 void consumesInputChanged(bool value);
259 void surfaceWidthChanged(int value);
260 void surfaceHeightChanged(int value);
261+ void nameChanged(const QString &name);
262 /// @endcond
263 };
264

Subscribers

People subscribed via source and target branches

to all changes: