1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 2008 Martin Gräßlin <ubuntu@martin-graesslin.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_COVERSWITCH_H
22 #define KWIN_COVERSWITCH_H
31 #include <kwineffects.h>
32 #include <kwinglutils.h>
37 class CoverSwitchEffect
44 virtual void reconfigure( ReconfigureFlags
);
45 virtual void prePaintScreen( ScreenPrePaintData
& data
, int time
);
46 virtual void paintScreen( int mask
, QRegion region
, ScreenPaintData
& data
);
47 virtual void postPaintScreen();
48 virtual void paintWindow( EffectWindow
* w
, int mask
, QRegion region
, WindowPaintData
& data
);
49 virtual void tabBoxAdded( int mode
);
50 virtual void tabBoxClosed();
51 virtual void tabBoxUpdated();
52 virtual void windowInputMouseEvent( Window w
, QEvent
* e
);
54 static bool supported();
56 void paintScene( EffectWindow
* frontWindow
, QList
< EffectWindow
* >* leftWindows
, QList
< EffectWindow
* >* rightWindows
,
57 bool reflectedWindows
= false );
58 void paintWindowCover( EffectWindow
* w
, bool reflectedWindow
, WindowPaintData
& data
);
59 void paintFrontWindow( EffectWindow
* frontWindow
, int width
, int leftWindows
, int rightWindows
, bool reflectedWindow
);
60 void paintWindows( QList
< EffectWindow
* >* windows
, bool left
, bool reflectedWindows
, EffectWindow
* additionalWindow
= NULL
);
63 void calculateFrameSize();
64 void calculateItemSizes();
66 void paintHighlight( QRect area
);
67 void paintWindowThumbnail( EffectWindow
* w
);
68 void paintWindowIcon( EffectWindow
* w
);
79 int animationDuration
;
93 QQueue
<Direction
> scheduled_directions
;
94 EffectWindow
* selected_window
;
96 QList
< EffectWindow
* > leftWindows
;
97 QList
< EffectWindow
* > rightWindows
;
101 bool dynamicThumbnails
;
102 int thumbnailWindows
;
103 QHash
< EffectWindow
*, ItemInfo
* > windows
;
106 int highlight_margin
;
107 QSize item_max_size
; // maximum item display size (including highlight)
109 QColor color_highlight
;
111 EffectWindow
* edge_window
;
112 EffectWindow
* right_window
;
113 QRect highlight_area
;
114 bool highlight_is_set
;
118 class CoverSwitchEffect::ItemInfo
121 QRect area
; // maximal painting area, including any frames/highlights/etc.
125 GLTexture iconTexture
;