1
/********************************************************************
2
KWin - the KDE window manager
3
This file is part of the KDE project.
5
Copyright (C) 2009 Nikhil Marathe <nsm.nikhil@gmail.com>
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
17
You should have received a copy of the GNU General Public License
18
along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*********************************************************************/
21
#ifndef KWIN_TILINGLAYOUT_H
22
#define KWIN_TILINGLAYOUT_H
27
#include <kdecoration.h>
39
TilingLayout(Workspace *w);
40
virtual ~TilingLayout();
43
* Reimplement this to decide how the client(s) should
45
* Return true if an actual resize was attempted, false if not ( for whatever reason )
47
virtual bool clientResized(Client *c, const QRect &moveResizeGeom, const QRect &orig);
48
void clientMoved(Client *c, const QRect &moveResizeGeom, const QRect &orig);
49
void clientMinimizeToggled(Client *c);
53
void setLayoutType(int t);
54
int layoutType() const;
56
void addTile(Tile *t);
57
void addTile(Client *c);
58
void removeTile(Tile *t);
59
void removeTile(Client *c);
60
void toggleFloatTile(Client *c);
61
void swapTiles(Tile *a, Tile *b);
62
void reconfigureTiling();
65
* All tiling layouts do not allow the user to manually
66
* resize clients. This method will be called when the user
67
* attempts a resize. Return any valid position to allow
68
* resizing in that direction. currentMode will be the direction
69
* of resize attempted by the user. You do not have to return the same value.
70
* If you do not want to allow resizing at all, or you do not
71
* want to allow resizing for this client, then return KDecorationDefines::PositionCenter.
73
virtual KDecorationDefines::Position resizeMode(Client *c, KDecorationDefines::Position currentMode) const;
75
const QList<Tile *>& tiles() const;
76
Tile* findTile(Client *c) const;
80
* Get a pointer to the Workspace.
82
Workspace * workspace() const;
84
* Get a area in which the Tile can be placed.
86
const QRect layoutArea(Tile *t) const;
88
* Hooks called after a tile is added to
89
* layout and before it is removed.
91
// currently only required by floating layout
92
virtual void postAddTile(Tile *t);
93
virtual void preRemoveTile(Tile *t);
96
int findTilePos(Client *c) const;
97
virtual void arrange(QRect wgeom) = 0;
99
void addTileNoArrange(Tile *t);
100
void removeTileNoArrange(Tile *t);
102
Tile* findTileBelowPoint(const QPoint &p) const;
105
QList<Tile *> m_tiles;
107
Workspace *m_workspace;
110
friend class TilingLayoutFactory;
113
inline void TilingLayout::setLayoutType(int t)
118
inline int TilingLayout::layoutType() const
123
inline const QList<Tile *>& TilingLayout::tiles() const
128
inline Workspace* TilingLayout::workspace() const
133
inline void TilingLayout::postAddTile(Tile *t)
138
inline void TilingLayout::preRemoveTile(Tile *t)