/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2008 Martin Gräßlin .
*********************************************************************/
#ifndef KWIN_COVERSWITCH_H
#define KWIN_COVERSWITCH_H
#include
#include
namespace KWin
{
class CoverSwitchEffect
: public QObject, public Effect
{
Q_OBJECT
public:
CoverSwitchEffect();
~CoverSwitchEffect();
virtual void prePaintScreen( ScreenPrePaintData& data, int time );
virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data );
virtual void postPaintScreen();
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
virtual void tabBoxAdded( int mode );
virtual void tabBoxClosed();
virtual void tabBoxUpdated();
private slots:
void slowMotion();
private:
void paintScene( EffectWindow* frontWindow, QList< EffectWindow* >* leftWindows, QList< EffectWindow* >* rightWindows,
float timeFactor, bool reflectedWindows = false );
void paintWindowCover( EffectWindow* w, QRect windowRect, bool reflectedWindow, float opacity = 1.0 );
void paintFrontWindow( EffectWindow* frontWindow, float timeFactor, int width, int leftWindows, int rightWindows, bool reflectedWindow );
void paintWindows( QList< EffectWindow* >* windows, float timeFactor, bool left, bool reflectedWindows, EffectWindow* additionalWindow = NULL );
bool mActivated;
float angle;
bool animateSwitch;
bool animateStart;
bool animateStop;
bool animation;
bool start;
bool stop;
bool forward;
bool reflection;
QTime animationTime;
int animationDuration;
int selectedWindow;
int rearrangeWindows;
bool slowMotionMode;
int slowMotionFactor;
bool stopRequested;
bool startRequested;
};
} // namespace
#endif