2 * Copyright (C) 2017 Canonical, Ltd.
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.
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.
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/>.
17#ifndef WINDOWMANAGER_WORKSPACE_H
18#define WINDOWMANAGER_WORKSPACE_H
23#include <QSharedPointer>
29class TopLevelWindowModel;
31namespace miral { class Workspace; }
35 namespace application {
36 class MirSurfaceInterface;
41class Workspace : public QObject
44 Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
45 Q_PROPERTY(TopLevelWindowModel* windowModel READ windowModel CONSTANT)
49 virtual void assign(WorkspaceModel* model, const QVariant& index = QVariant());
50 virtual void unassign();
52 virtual bool isActive() const = 0;
53 virtual TopLevelWindowModel *windowModel() const = 0;
55 std::shared_ptr<miral::Workspace> workspace() const { return m_workspace; }
56 bool isAssigned() const;
59 virtual void activate() = 0;
65 void activeChanged(bool);
68 Workspace(QObject *parent = nullptr);
69 Workspace(Workspace const& other);
71 std::shared_ptr<miral::Workspace> m_workspace;
72 WorkspaceModel* m_model;
75class ConcreteWorkspace : public Workspace
78 explicit ConcreteWorkspace(QObject *parent = nullptr);
81 bool isActive() const override { return m_active; }
82 TopLevelWindowModel *windowModel() const override;
83 void activate() override;
87 const QScopedPointer<TopLevelWindowModel> m_windowModel;
90class ProxyWorkspace : public Workspace
94 explicit ProxyWorkspace(Workspace*const workspace);
95 ~ProxyWorkspace() = default;
97 Q_INVOKABLE void assign(WorkspaceModel* model, const QVariant& index = QVariant()) override;
99 bool isActive() const override;
100 TopLevelWindowModel *windowModel() const override;
101 void activate() override;
103 Workspace* proxyObject() const { return m_original.data(); }
106 void unassign() override;
109 const QPointer<Workspace> m_original;
112#endif // WINDOWMANAGER_WORKSPACE_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list