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>
28#include "WindowManagerGlobal.h"
31class TopLevelWindowModel;
34namespace miral { class Workspace; }
38 namespace application {
39 class MirSurfaceInterface;
44class WINDOWMANAGERQML_EXPORT Workspace : public QObject
47 Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
48 Q_PROPERTY(TopLevelWindowModel* windowModel READ windowModel CONSTANT)
52 virtual void assign(WorkspaceModel* model, const QVariant& index = QVariant());
53 virtual void unassign();
55 virtual bool isActive() const = 0;
56 virtual TopLevelWindowModel *windowModel() const = 0;
57 virtual void setCurrentOn(Screen*) = 0;
59 std::shared_ptr<miral::Workspace> workspace() const { return m_workspace; }
60 bool isAssigned() const;
61 Q_INVOKABLE bool isSameAs(Workspace*) const;
64 virtual void activate() = 0;
70 void activeChanged(bool);
73 Workspace(QObject *parent = nullptr);
74 Workspace(Workspace const& other);
76 std::shared_ptr<miral::Workspace> m_workspace;
77 WorkspaceModel* m_model;
80class WINDOWMANAGERQML_EXPORT ConcreteWorkspace : public Workspace
85 bool isActive() const override { return m_active; }
86 TopLevelWindowModel *windowModel() const override;
87 void activate() override;
88 void setCurrentOn(Screen*) override;
91 explicit ConcreteWorkspace(QObject *parent = nullptr);
94 const QScopedPointer<TopLevelWindowModel> m_windowModel;
96 friend class WorkspaceManager;
99class ProxyWorkspace : public Workspace
103 explicit ProxyWorkspace(Workspace*const workspace);
104 ~ProxyWorkspace() = default;
106 Q_INVOKABLE void assign(WorkspaceModel* model, const QVariant& index = QVariant()) override;
108 bool isActive() const override;
109 TopLevelWindowModel *windowModel() const override;
110 void activate() override;
111 void setCurrentOn(Screen*) override;
113 Workspace* proxyObject() const { return m_original.data(); }
116 void unassign() override;
119 const QPointer<Workspace> m_original;
122#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