Select Git revision
tilingmanager.js
tilingmanager.js 16.20 KiB
/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2012 Mathias Gottschlag <mgottschlag@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/
Qt.include("signal.js");
Qt.include("tile.js");
Qt.include("tilelist.js");
Qt.include("layout.js");
Qt.include("spirallayout.js");
Qt.include("halflayout.js");
Qt.include("bladelayout.js");
Qt.include("tiling.js");
Qt.include("tests.js");
/**
* Class which manages all layouts, connects the various signals and handlers
* and implements all keyboard shortcuts.
* @class
*/
function TilingManager() {
/**
* Default layout type which is selected for new layouts.
*/
this.defaultLayout = HalfLayout;
/**
* List of all available layout types.
*/
this.availableLayouts = [
HalfLayout,
BladeLayout,
SpiralLayout/*,
ZigZagLayout,
ColumnLayout,
RowLayout,
GridLayout,
MaximizedLayout,
FloatingLayout*/
];
for (var i = 0; i < this.availableLayouts.length; i++) {
this.availableLayouts[i].index = i;
}
/**
* Number of desktops in the system.
*/
this.desktopCount = workspace.desktopGridWidth
* workspace.desktopGridHeight;
/**
* Number of screens in the system.
*/
this.screenCount = workspace.numScreens;
/**
* Array containing a list of layouts for every desktop. Each of the lists