1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
6 Copyright (C) 2008 Lucas Murray <lmurray@undefinedfire.com>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
22 #ifndef KWIN_DESKTOPGRID_H
23 #define KWIN_DESKTOPGRID_H
25 #include <kwineffects.h>
31 class DesktopGridEffect
32 : public QObject
, public Effect
38 virtual void reconfigure( ReconfigureFlags
);
39 virtual void prePaintScreen( ScreenPrePaintData
& data
, int time
);
40 virtual void paintScreen( int mask
, QRegion region
, ScreenPaintData
& data
);
41 virtual void postPaintScreen();
42 virtual void prePaintWindow( EffectWindow
* w
, WindowPrePaintData
& data
, int time
);
43 virtual void paintWindow( EffectWindow
* w
, int mask
, QRegion region
, WindowPaintData
& data
);
44 virtual void windowClosed( EffectWindow
* w
);
45 virtual void windowInputMouseEvent( Window w
, QEvent
* e
);
46 virtual void grabbedKeyboardEvent( QKeyEvent
* e
);
47 virtual bool borderActivated( ElectricBorder border
);
49 enum { LayoutPager
, LayoutAutomatic
, LayoutCustom
}; // Layout modes
55 QPointF
scalePos( const QPoint
& pos
, int desktop
, int screen
= -1 ) const;
56 QPoint
unscalePos( const QPoint
& pos
, int* desktop
= NULL
) const;
57 int posToDesktop( const QPoint
& pos
) const;
58 EffectWindow
* windowAt( QPoint pos
) const;
59 void setCurrentDesktop( int desktop
);
60 void setHighlightedDesktop( int desktop
);
61 int desktopToRight( int desktop
, bool wrap
= true ) const;
62 int desktopToLeft( int desktop
, bool wrap
= true ) const;
63 int desktopUp( int desktop
, bool wrap
= true ) const;
64 int desktopDown( int desktop
, bool wrap
= true ) const;
65 void setActive( bool active
);
69 ElectricBorder borderActivate
;
72 Qt::Alignment desktopNameAlignment
;
79 int highlightedDesktop
;
83 EffectWindow
* windowMove
;
84 QPoint windowMoveDiff
;
87 QList
<TimeLine
> hoverTimeline
;
90 Qt::Orientation orientation
;
92 // Per screen variables
93 QList
<double> scale
; // Because the border isn't a ratio each screen is different
94 QList
<double> unscaledBorder
;
95 QList
<QSizeF
> scaledSize
;
96 QList
<QPointF
> scaledOffset
;