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"
19#include "MockScreens.h"
20#include "MockScreenWindow.h"
22#include "ScreenAttached.h"
24#include "TopLevelWindowModel.h"
26#include "WorkspaceManager.h"
28#include "WorkspaceModel.h"
29#include "WindowManagementPolicy.h"
33static const QString notInstantiatable = QStringLiteral("Not instantiatable");
35static QObject *workspace_manager(QQmlEngine *engine, QJSEngine *scriptEngine)
38 Q_UNUSED(scriptEngine)
39 return WorkspaceManager::instance();
41QObject* screensSingleton(QQmlEngine* engine, QJSEngine* scriptEngine) {
43 Q_UNUSED(scriptEngine);
44 return new Screens(MockScreens::instance());
47void WindowManagerPlugin::registerTypes(const char *uri)
49 qmlRegisterType<TopLevelWindowModel>(uri, 1, 0, "TopLevelWindowModel");
50 qmlRegisterSingletonType<WorkspaceManager>(uri, 1, 0, "WorkspaceManager", workspace_manager);
51 qmlRegisterUncreatableType<WorkspaceModel>(uri, 1, 0, "WorkspaceModel", notInstantiatable);
52 qmlRegisterSingletonType<Screens>(uri, 1, 0, "Screens", screensSingleton);
53 qmlRegisterUncreatableType<qtmir::ScreenMode>(uri, 1, 0, "ScreenMode", notInstantiatable);
54 qmlRegisterUncreatableType<Workspace>(uri, 1, 0, "Workspace", notInstantiatable);
56 qRegisterMetaType<Screen*>("Screen*");
57 qRegisterMetaType<ScreensProxy*>("ScreensProxy*");
58 qRegisterMetaType<Workspace*>("Workspace*");
60 qRegisterMetaType<Window*>("Window*");
61 qRegisterMetaType<QAbstractListModel*>("QAbstractListModel*");
63 qmlRegisterType<MockScreenWindow>(uri, 1, 0, "ScreenWindow");
64 qmlRegisterRevision<QWindow,1>(uri, 1, 0);
66 qmlRegisterUncreatableType<WMScreen>(uri, 1, 0, "WMScreen", notInstantiatable);
69void WindowManagerPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
71 QQmlExtensionPlugin::initializeEngine(engine, uri);
73 // Make sure we've initialized the wm policy.
74 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