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>
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_DESKTOPGRID_H
22 #define KWIN_DESKTOPGRID_H
24 #include <kwineffects.h>
30 class DesktopGridEffect
31 : public QObject
, public Effect
37 virtual void prePaintScreen( ScreenPrePaintData
& data
, int time
);
38 virtual void paintScreen( int mask
, QRegion region
, ScreenPaintData
& data
);
39 virtual void postPaintScreen();
40 virtual void prePaintWindow( EffectWindow
* w
, WindowPrePaintData
& data
, int time
);
41 virtual void paintWindow( EffectWindow
* w
, int mask
, QRegion region
, WindowPaintData
& data
);
42 virtual void windowClosed( EffectWindow
* w
);
43 virtual void desktopChanged( int old
);
44 virtual void windowInputMouseEvent( Window w
, QEvent
* e
);
45 virtual void grabbedKeyboardEvent( QKeyEvent
* e
);
46 virtual bool borderActivated( ElectricBorder border
);
50 QRect
desktopRect( int desktop
, bool scaled
) const;
51 int posToDesktop( const QPoint
& pos
) const;
52 QRect
windowRect( EffectWindow
* w
) const; // returns always scaled
53 EffectWindow
* windowAt( const QPoint
& pos
, QRect
* rect
= NULL
) const;
54 void setActive( bool active
);
57 void paintSlide( int mask
, QRegion region
, const ScreenPaintData
& data
);
58 void paintScreenDesktop( int desktop
, int mask
, QRegion region
, ScreenPaintData data
);
59 void slideDesktopChanged( int old
);
60 void setHighlightedDesktop( int desktop
);
64 int highlighted_desktop
;
68 EffectWindow
* window_move
;
69 QPoint window_move_diff
;
70 QPoint window_move_pos
;
73 QPoint slide_start_pos
;
74 bool slide_painting_sticky
;
75 QPoint slide_painting_diff
;
76 ElectricBorder borderActivate
;