2
* Copyright (C) 2015-2016 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#include "fake_session.h"
22
FakeSession::FakeSession()
24
, m_application(nullptr)
29
FakeSession::~FakeSession()
31
delete m_childSessions;
34
QString FakeSession::name() const { return QString("foo-session"); }
36
unity::shell::application::ApplicationInfoInterface *FakeSession::application() const { return m_application; }
38
MirSurfaceListModel* FakeSession::surfaceList() { return &m_surfaceList; }
40
MirSurfaceListModel* FakeSession::promptSurfaceList() { return &m_promptSurfaceList; }
42
SessionModel *FakeSession::childSessions() const { return m_childSessions; }
44
SessionInterface::State FakeSession::state() const { return m_state; }
46
bool FakeSession::fullscreen() const { return false; }
48
bool FakeSession::live() const { return true; }
50
std::shared_ptr<mir::scene::Session> FakeSession::session() const
55
void FakeSession::registerSurface(MirSurfaceInterface *) {}
57
void FakeSession::setApplication(unity::shell::application::ApplicationInfoInterface *app)
59
if (m_application != app) {
61
Q_EMIT applicationChanged(m_application);
65
void FakeSession::suspend()
67
if (m_state == Running) {
72
void FakeSession::resume()
74
if (m_state == Suspending || m_state == Suspended) {
79
void FakeSession::stop()
84
bool FakeSession::hasClosingSurfaces() const { return false; }
85
bool FakeSession::hadSurface() const { return false; }
87
void FakeSession::close() {}
89
void FakeSession::addChildSession(SessionInterface *) {}
91
void FakeSession::insertChildSession(uint, SessionInterface *) {}
93
void FakeSession::removeChildSession(SessionInterface *) {}
95
void FakeSession::foreachChildSession(const std::function<void (SessionInterface *)> &) const {}
97
std::shared_ptr<mir::scene::PromptSession> FakeSession::activePromptSession() const
99
return std::shared_ptr<mir::scene::PromptSession>();
102
void FakeSession::foreachPromptSession(const std::function<void (const std::shared_ptr<mir::scene::PromptSession> &)> &) const {}
104
void FakeSession::setFullscreen(bool) {}
106
void FakeSession::setLive(const bool) {}
108
void FakeSession::appendPromptSession(const std::shared_ptr<mir::scene::PromptSession> &) {}
110
void FakeSession::removePromptSession(const std::shared_ptr<mir::scene::PromptSession> &) {}
112
void FakeSession::setState(SessionInterface::State state)
114
if (m_state != state) {
116
Q_EMIT stateChanged(m_state);
120
void FakeSession::setSession(std::shared_ptr<mir::scene::Session> session)