Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kwin / effects / desktopgrid.h
blob9f5b4fb7f2b8288f4799579d76da44000a588f33
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>
25 #include <QObject>
27 namespace KWin
30 class DesktopGridEffect
31 : public QObject, public Effect
33 Q_OBJECT
34 public:
35 DesktopGridEffect();
36 ~DesktopGridEffect();
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 );
47 private slots:
48 void toggle();
49 private:
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 );
55 void setup();
56 void finish();
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 );
61 double progress;
62 bool activated;
63 int painting_desktop;
64 int highlighted_desktop;
65 Window input;
66 bool keyboard_grab;
67 bool was_window_move;
68 EffectWindow* window_move;
69 QPoint window_move_diff;
70 QPoint window_move_pos;
71 bool slideEnabled;
72 bool slide;
73 QPoint slide_start_pos;
74 bool slide_painting_sticky;
75 QPoint slide_painting_diff;
76 ElectricBorder borderActivate;
79 } // namespace
81 #endif