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 MOCKWINDOMANAGEMENTPOLICY_H
18#define MOCKWINDOMANAGEMENTPOLICY_H
20#include "wmpolicyinterface.h"
26#include <miral/window.h>
28#include <unordered_set>
34// A Fake window management policy for the mock.
35class Q_DECL_EXPORT WindowManagementPolicy : public QObject,
36 public WMPolicyInterface
40 WindowManagementPolicy();
43 static WindowManagementPolicy *instance();
45 // From WMPolicyInterface
46 std::shared_ptr<miral::Workspace> createWorkspace() override;
47 void releaseWorkspace(const std::shared_ptr<miral::Workspace>& workspace) override;
48 void setActiveWorkspace(const std::shared_ptr<miral::Workspace>& workspace) override;
50 void addWindow(const miral::Window& window);
52 void forEachWindowInWorkspace(std::shared_ptr<miral::Workspace> const& workspace,
53 std::function<void(miral::Window const&)> const& callback);
55 void moveWindowToWorkspace(const miral::Window &window, const std::shared_ptr<miral::Workspace> &workspace);
57 void moveWorkspaceContentToWorkspace(const std::shared_ptr<miral::Workspace>& to,
58 const std::shared_ptr<miral::Workspace>& from);
61 void windowAdded(const miral::Window& window);
62 void windowsAddedToWorkspace(const std::shared_ptr<miral::Workspace> &workspace, const std::vector<miral::Window> &windows);
63 void windowsAboutToBeRemovedFromWorkspace(const std::shared_ptr<miral::Workspace> &workspace, const std::vector<miral::Window> &windows);
66 std::weak_ptr<miral::Workspace> m_activeWorkspace;
67 std::shared_ptr<miral::Workspace> m_dummyWorkspace;
68 std::unordered_set<std::shared_ptr<miral::Workspace>> m_workspaces;
70 typedef QMultiMap<std::shared_ptr<miral::Workspace>, miral::Window> WorkspaceWindows;
71 WorkspaceWindows m_windows;
73#endif // UNITY_WINDOWMANAGEMENTPOLICY_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