Merge lp:~ricmm/hud/papi-v2 into lp:hud/14.10

Proposed by Ricardo Mendoza
Status: Merged
Approved by: Pete Woods
Approved revision: 393
Merged at revision: 392
Proposed branch: lp:~ricmm/hud/papi-v2
Merge into: lp:hud/14.10
Diff against target: 343 lines (+3/-270)
6 files modified
debian/control (+0/-1)
tests/unit/window-stack-bridge/CMakeLists.txt (+1/-6)
tests/unit/window-stack-bridge/TestPlatformApiWindowStack.cpp (+0/-54)
window-stack-bridge/CMakeLists.txt (+2/-10)
window-stack-bridge/PlatformApiWindowStack.cpp (+0/-127)
window-stack-bridge/PlatformApiWindowStack.h (+0/-72)
To merge this branch: bzr merge lp:~ricmm/hud/papi-v2
Reviewer Review Type Date Requested Status
Pete Woods (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+221326@code.launchpad.net

Commit message

Drop support for Platform API (SF)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~ricmm/hud/papi-v2 updated
393. By Ricardo Mendoza

Remove tests

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2014-03-05 12:06:48 +0000
+++ debian/control 2014-05-29 09:06:35 +0000
@@ -23,7 +23,6 @@
23 libqt5sql5-sqlite,23 libqt5sql5-sqlite,
24 libqtdbustest1-dev (>= 0.2),24 libqtdbustest1-dev (>= 0.2),
25 libqtdbusmock1-dev (>= 0.2),25 libqtdbusmock1-dev (>= 0.2),
26 libubuntu-platform-api1-dev [armhf],
27 libunityvoice1-dev,26 libunityvoice1-dev,
28 pkg-config,27 pkg-config,
29 python-setuptools,28 python-setuptools,
3029
=== modified file 'tests/unit/window-stack-bridge/CMakeLists.txt'
--- tests/unit/window-stack-bridge/CMakeLists.txt 2013-12-13 18:31:07 +0000
+++ tests/unit/window-stack-bridge/CMakeLists.txt 2014-05-29 09:06:35 +0000
@@ -1,14 +1,9 @@
11if(${ENABLE_BAMF})
2if(${ENABLE_BAMF} OR ${ENABLE_PLATFORM_API})
32
4if(${ENABLE_BAMF})3if(${ENABLE_BAMF})
5 list(APPEND UNIT_TESTS_SRC TestBamfWindowStack.cpp)4 list(APPEND UNIT_TESTS_SRC TestBamfWindowStack.cpp)
6endif()5endif()
76
8if(${ENABLE_PLATFORM_API})
9 list(APPEND UNIT_TESTS_SRC TestPlatformApiWindowStack.cpp)
10endif()
11
12add_executable(7add_executable(
13 test-window-stack-bridge-unit-tests8 test-window-stack-bridge-unit-tests
14 ${UNIT_TESTS_SRC}9 ${UNIT_TESTS_SRC}
1510
=== removed file 'tests/unit/window-stack-bridge/TestPlatformApiWindowStack.cpp'
--- tests/unit/window-stack-bridge/TestPlatformApiWindowStack.cpp 2013-11-27 14:28:43 +0000
+++ tests/unit/window-stack-bridge/TestPlatformApiWindowStack.cpp 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1/*
2 * Copyright (C) 2013 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 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include <common/DBusTypes.h>
20#include <common/WindowStackInterface.h>
21#include <window-stack-bridge/PlatformApiWindowStack.h>
22
23#include <libqtdbustest/DBusTestRunner.h>
24#include <libqtdbusmock/DBusMock.h>
25#include <QSignalSpy>
26#include <gtest/gtest.h>
27#include <gmock/gmock.h>
28
29using namespace std;
30using namespace testing;
31using namespace hud::common;
32using namespace QtDBusTest;
33using namespace QtDBusMock;
34
35namespace {
36
37class TestPlatformApiWindowStack: public Test {
38protected:
39 TestPlatformApiWindowStack() :
40 mock(dbus) {
41 }
42
43 virtual ~TestPlatformApiWindowStack() {
44 }
45
46 DBusTestRunner dbus;
47
48 DBusMock mock;
49};
50
51TEST_F(TestPlatformApiWindowStack, ExportsDBusInterface) {
52}
53
54} // namespace
550
=== modified file 'window-stack-bridge/CMakeLists.txt'
--- window-stack-bridge/CMakeLists.txt 2013-10-31 13:41:01 +0000
+++ window-stack-bridge/CMakeLists.txt 2014-05-29 09:06:35 +0000
@@ -1,12 +1,9 @@
11
2if(${ENABLE_BAMF})2if(${ENABLE_BAMF})
3 add_definitions( -DENABLE_BAMF=1 )3 add_definitions( -DENABLE_BAMF=1 )
4elseif(${ENABLE_PLATFORM_API})
5 add_definitions( -DENABLE_PLATFORM_API=1 )
6 set(PLATFORM_API_LIBRARIES "-lubuntu_application_api")
7endif()4endif()
85
9if(${ENABLE_BAMF} OR ${ENABLE_PLATFORM_API})6if(${ENABLE_BAMF})
107
11set(8set(
12 WINDOW_STACK_BRIDGE_SOURCES9 WINDOW_STACK_BRIDGE_SOURCES
@@ -29,10 +26,6 @@
29 )26 )
30endif()27endif()
3128
32if(${ENABLE_PLATFORM_API})
33 list(APPEND WINDOW_STACK_BRIDGE_SOURCES PlatformApiWindowStack.cpp)
34endif()
35
36qt5_add_dbus_adaptor(29qt5_add_dbus_adaptor(
37 WINDOW_STACK_BRIDGE_SOURCES30 WINDOW_STACK_BRIDGE_SOURCES
38 ${WINDOW_STACK_XML}31 ${WINDOW_STACK_XML}
@@ -62,7 +55,6 @@
62target_link_libraries(55target_link_libraries(
63 window-stack-bridge56 window-stack-bridge
64 hud-common57 hud-common
65 ${PLATFORM_API_LIBRARIES}
66)58)
6759
68add_executable(60add_executable(
@@ -91,4 +83,4 @@
91 RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/hud"83 RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/hud"
92)84)
9385
94endif()
95\ No newline at end of file86\ No newline at end of file
87endif()
9688
=== removed file 'window-stack-bridge/PlatformApiWindowStack.cpp'
--- window-stack-bridge/PlatformApiWindowStack.cpp 2013-10-31 13:41:01 +0000
+++ window-stack-bridge/PlatformApiWindowStack.cpp 1970-01-01 00:00:00 +0000
@@ -1,127 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#include <window-stack-bridge/PlatformApiWindowStack.h>
20#include <common/Localisation.h>
21
22#include <QDebug>
23#include <stdexcept>
24#include <ubuntu/application/ui/stage.h>
25
26using namespace hud::common;
27
28PlatformApiWindowStack::PlatformApiWindowStack(
29 const QDBusConnection &connection, QObject *parent) :
30 AbstractWindowStack(connection, parent) {
31
32 if (qgetenv("QT_QPA_PLATFORM") != "ubuntu") {
33 throw std::logic_error(
34 _("Incorrect QPA environment for Ubuntu platform API"));
35 }
36
37 registerOnBus();
38
39 m_observer_definition.on_session_requested = on_session_requested_cb;
40 m_observer_definition.on_session_born = on_session_born_cb;
41 m_observer_definition.on_session_unfocused = on_session_unfocused_cb;
42 m_observer_definition.on_session_focused = on_session_focused_cb;
43 m_observer_definition.on_session_died = on_session_died_cb;
44 m_observer_definition.on_keyboard_geometry_changed = 0;
45 m_observer_definition.on_session_requested_fullscreen = 0;
46 m_observer_definition.context = reinterpret_cast<void *>(this);
47
48 ubuntu_ui_session_install_session_lifecycle_observer(
49 &m_observer_definition);
50}
51
52PlatformApiWindowStack::~PlatformApiWindowStack() {
53}
54
55QString PlatformApiWindowStack::GetAppIdFromPid(uint pid) {
56 // FIXME Not implemented
57 qDebug() << "GetAppIdFromPid";
58 return QString();
59}
60
61QList<WindowInfo> PlatformApiWindowStack::GetWindowStack() {
62 // FIXME Not implemented
63 qDebug() << "GetWindowStack";
64 return QList<WindowInfo>();
65}
66
67QStringList PlatformApiWindowStack::GetWindowProperties(uint windowId,
68 const QString &appId, const QStringList &names) {
69 // FIXME Not implemented
70 qDebug() << "GetWindowProperties:" << windowId << appId << names;
71 return QStringList();
72}
73
74void PlatformApiWindowStack::onSessionRequested(
75 ubuntu_ui_well_known_application app) {
76 // FIXME Not implemented
77 qDebug() << "onSessionRequested";
78}
79
80void PlatformApiWindowStack::onSessionBorn(ubuntu_ui_session_properties props) {
81 // FIXME Not implemented
82 qDebug() << "onSessionBorn";
83 //session_properties_get_window_id
84}
85
86void PlatformApiWindowStack::onSessionUnfocused(
87 ubuntu_ui_session_properties props) {
88 // FIXME Not implemented
89 qDebug() << "onSessionUnfocused";
90}
91
92void PlatformApiWindowStack::onSessionFocused(
93 ubuntu_ui_session_properties props) {
94 // FIXME Not implemented
95 qDebug() << "onSessionFocused";
96}
97
98void PlatformApiWindowStack::onSessionDied(ubuntu_ui_session_properties props) {
99 // FIXME Not implemented
100 qDebug() << "onSessionDied";
101}
102
103void PlatformApiWindowStack::on_session_requested_cb(
104 ubuntu_ui_well_known_application app, void* context) {
105 reinterpret_cast<PlatformApiWindowStack *>(context)->onSessionRequested(
106 app);
107}
108
109void PlatformApiWindowStack::on_session_born_cb(
110 ubuntu_ui_session_properties props, void* context) {
111 reinterpret_cast<PlatformApiWindowStack *>(context)->onSessionBorn(props);
112}
113void PlatformApiWindowStack::on_session_unfocused_cb(
114 ubuntu_ui_session_properties props, void* context) {
115 reinterpret_cast<PlatformApiWindowStack *>(context)->onSessionUnfocused(
116 props);
117}
118void PlatformApiWindowStack::on_session_focused_cb(
119 ubuntu_ui_session_properties props, void* context) {
120 reinterpret_cast<PlatformApiWindowStack *>(context)->onSessionFocused(
121 props);
122}
123
124void PlatformApiWindowStack::on_session_died_cb(
125 ubuntu_ui_session_properties props, void* context) {
126 reinterpret_cast<PlatformApiWindowStack *>(context)->onSessionDied(props);
127}
1280
=== removed file 'window-stack-bridge/PlatformApiWindowStack.h'
--- window-stack-bridge/PlatformApiWindowStack.h 2013-10-31 13:41:01 +0000
+++ window-stack-bridge/PlatformApiWindowStack.h 1970-01-01 00:00:00 +0000
@@ -1,72 +0,0 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Author: Pete Woods <pete.woods@canonical.com>
17 */
18
19#ifndef PLATFORMAPIWINDOWSTACK_H_
20#define PLATFORMAPIWINDOWSTACK_H_
21
22#include <window-stack-bridge/AbstractWindowStack.h>
23
24#include <ubuntu/ui/ubuntu_ui_session_service.h>
25
26class Q_DECL_EXPORT PlatformApiWindowStack: public AbstractWindowStack {
27Q_OBJECT
28
29public:
30 explicit PlatformApiWindowStack(const QDBusConnection &connection,
31 QObject *parent = 0);
32
33 virtual ~PlatformApiWindowStack();
34
35public Q_SLOTS:
36 virtual QString GetAppIdFromPid(uint pid);
37
38 virtual QList<hud::common::WindowInfo> GetWindowStack();
39
40 virtual QStringList GetWindowProperties(uint windowId, const QString &appId,
41 const QStringList &names);
42
43protected:
44 static void on_session_requested_cb(ubuntu_ui_well_known_application app,
45 void* context);
46
47 void onSessionRequested(ubuntu_ui_well_known_application app);
48
49 static void on_session_born_cb(ubuntu_ui_session_properties props,
50 void* context);
51
52 void onSessionBorn(ubuntu_ui_session_properties props);
53
54 static void on_session_unfocused_cb(ubuntu_ui_session_properties props,
55 void* context);
56
57 void onSessionUnfocused(ubuntu_ui_session_properties props);
58
59 static void on_session_focused_cb(ubuntu_ui_session_properties props,
60 void* context);
61
62 void onSessionFocused(ubuntu_ui_session_properties props);
63
64 static void on_session_died_cb(ubuntu_ui_session_properties props,
65 void* context);
66
67 void onSessionDied(ubuntu_ui_session_properties props);
68
69 ubuntu_ui_session_lifecycle_observer m_observer_definition;
70};
71
72#endif /* PLATFORMAPIWINDOWSTACK_H_ */

Subscribers

People subscribed via source and target branches