2007-04-29 17:35:43 +00:00
|
|
|
/*****************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
#ifndef KWIN_DESKTOPGRID_H
|
|
|
|
#define KWIN_DESKTOPGRID_H
|
|
|
|
|
|
|
|
#include <kwineffects.h>
|
|
|
|
#include <qobject.h>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class DesktopGridEffect
|
|
|
|
: public QObject, public Effect
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
DesktopGridEffect();
|
2007-07-07 14:01:32 +00:00
|
|
|
virtual void prePaintScreen( ScreenPrePaintData& data, int time );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data );
|
|
|
|
virtual void postPaintScreen();
|
2007-07-07 14:01:32 +00:00
|
|
|
virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
virtual void windowClosed( EffectWindow* w );
|
|
|
|
virtual void desktopChanged( int old );
|
|
|
|
virtual void windowInputMouseEvent( Window w, QEvent* e );
|
|
|
|
virtual void grabbedKeyboardEvent( QKeyEvent* e );
|
|
|
|
private slots:
|
|
|
|
void toggle();
|
|
|
|
private:
|
|
|
|
QRect desktopRect( int desktop, bool scaled ) const;
|
|
|
|
int posToDesktop( const QPoint& pos ) const;
|
|
|
|
QRect windowRect( EffectWindow* w ) const; // returns always scaled
|
|
|
|
EffectWindow* windowAt( const QPoint& pos, QRect* rect = NULL ) const;
|
|
|
|
void setActive( bool active );
|
|
|
|
void setup();
|
|
|
|
void finish();
|
|
|
|
void paintSlide( int mask, QRegion region, const ScreenPaintData& data );
|
|
|
|
void paintScreenDesktop( int desktop, int mask, QRegion region, ScreenPaintData data );
|
|
|
|
void slideDesktopChanged( int old );
|
2007-11-20 16:17:08 +00:00
|
|
|
void setHighlightedDesktop( int desktop );
|
2007-09-03 15:00:43 +00:00
|
|
|
double progress;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool activated;
|
|
|
|
int painting_desktop;
|
2007-11-20 16:17:08 +00:00
|
|
|
int highlighted_desktop;
|
2007-04-29 17:35:43 +00:00
|
|
|
Window input;
|
|
|
|
bool keyboard_grab;
|
|
|
|
bool was_window_move;
|
|
|
|
EffectWindow* window_move;
|
|
|
|
QPoint window_move_diff;
|
|
|
|
QPoint window_move_pos;
|
2007-07-02 17:56:46 +00:00
|
|
|
bool slideEnabled;
|
2007-04-29 17:35:43 +00:00
|
|
|
bool slide;
|
|
|
|
QPoint slide_start_pos;
|
|
|
|
bool slide_painting_sticky;
|
|
|
|
QPoint slide_painting_diff;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|