2 * Copyright (C) 2016 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#include "WindowManagerPlugin.h"
21#include "MockScreens.h"
22#include "ScreenWindow.h"
23#include "TopLevelWindowModel.h"
25#include "WorkspaceManager.h"
27#include "WorkspaceModel.h"
28#include "WindowManagementPolicy.h"
32static QObject *workspace_manager(QQmlEngine *engine, QJSEngine *scriptEngine)
35 Q_UNUSED(scriptEngine)
36 return WorkspaceManager::instance();
38QObject* screensSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
40 Q_UNUSED(scriptEngine);
41 QSharedPointer<qtmir::Screens> mockScreens(new MockScreens());
42 return new Screens(mockScreens);
45void WindowManagerPlugin::registerTypes(const char *uri)
47 qmlRegisterType<TopLevelWindowModel>(uri, 1, 0, "TopLevelWindowModel");
48 qmlRegisterSingletonType<WorkspaceManager>(uri, 1, 0, "WorkspaceManager", workspace_manager);
49 qmlRegisterUncreatableType<WorkspaceModel>(uri, 1, 0, "WorkspaceModel", "Not a creatable type");
50 qmlRegisterSingletonType<Screens>(uri, 1, 0, "Screens", screensSingleton);
51 qmlRegisterUncreatableType<qtmir::ScreenMode>(uri, 1, 0, "ScreenMode", "ScreenMode is not creatable.");
52 qmlRegisterUncreatableType<Workspace>(uri, 1, 0, "Workspace", "Workspace is not creatable.");
54 qRegisterMetaType<Screen*>("Screen*");
55 qRegisterMetaType<ScreensProxy*>("ScreensProxy*");
56 qRegisterMetaType<Workspace*>("Workspace*");
58 qRegisterMetaType<Window*>("Window*");
59 qRegisterMetaType<QAbstractListModel*>("QAbstractListModel*");
61 qmlRegisterType<ScreenWindow>(uri, 1, 0, "ScreenWindow");
62 qmlRegisterRevision<QWindow,1>(uri, 1, 0);
65void WindowManagerPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
67 QQmlExtensionPlugin::initializeEngine(engine, uri);
69 // Make sure we've initialized the wm policy.
70 WindowManagementPolicy::instance();
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