e6069e9cf6
Reverting r700026 and changing floats to doubles again. I'd probably like to change even the ones interfacing with OpenGL which I've left for now. svn path=/trunk/KDE/kdebase/workspace/; revision=707987
62 lines
1.8 KiB
C++
62 lines
1.8 KiB
C++
/*****************************************************************
|
|
KWin - the KDE window manager
|
|
This file is part of the KDE project.
|
|
|
|
Copyright (C) 2007 Philip Falkner <philip.falkner@gmail.com>
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
******************************************************************/
|
|
|
|
#ifndef KWIN_FADE_H
|
|
#define KWIN_FADE_H
|
|
|
|
#include <kwineffects.h>
|
|
|
|
namespace KWin
|
|
{
|
|
|
|
class FadeEffect
|
|
: public Effect
|
|
{
|
|
public:
|
|
FadeEffect();
|
|
virtual void prePaintScreen( ScreenPrePaintData& data, int time );
|
|
virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time );
|
|
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
// TODO react also on virtual desktop changes
|
|
virtual void windowOpacityChanged( EffectWindow* c, double old_opacity );
|
|
virtual void windowAdded( EffectWindow* c );
|
|
virtual void windowClosed( EffectWindow* c );
|
|
virtual void windowDeleted( EffectWindow* c );
|
|
|
|
bool isFadeWindow( EffectWindow* w );
|
|
private:
|
|
class WindowInfo;
|
|
QHash< const EffectWindow*, WindowInfo > windows;
|
|
double fadeInStep, fadeOutStep;
|
|
int fadeInTime, fadeOutTime;
|
|
bool fadeWindows;
|
|
};
|
|
|
|
class FadeEffect::WindowInfo
|
|
{
|
|
public:
|
|
WindowInfo()
|
|
: fadeInStep( 0.0 )
|
|
, fadeOutStep( 0.0 )
|
|
, opacity( 1.0 )
|
|
, saturation( 1.0 )
|
|
, brightness( 1.0 )
|
|
, deleted( false )
|
|
{}
|
|
double fadeInStep, fadeOutStep;
|
|
double opacity;
|
|
double saturation, brightness;
|
|
bool deleted;
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif
|