Add setTransformed() helper method

svn path=/trunk/KDE/kdebase/workspace/; revision=689913
This commit is contained in:
Rivo Laks 2007-07-19 14:05:59 +00:00
parent 96aba51960
commit 7273d0ddb5
12 changed files with 22 additions and 12 deletions

View file

@ -33,7 +33,7 @@ void ShakyMoveEffect::prePaintScreen( ScreenPrePaintData& data, int time )
void ShakyMoveEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
{
if( windows.contains( w ))
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
effects->prePaintWindow( w, data, time );
}

View file

@ -39,7 +39,7 @@ void WavyWindowsEffect::prePaintScreen( ScreenPrePaintData& data, int time )
void WavyWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
{
// This window will be transformed by the effect
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
// Check if OpenGL compositing is used
// Request the window to be divided into cells which are at most 30x30
// pixels big

View file

@ -87,7 +87,7 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& dat
if( w->isOnAllDesktops())
{
if( slide_painting_sticky )
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
else
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
}
@ -104,7 +104,7 @@ void DesktopGridEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& dat
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
if( w == window_move )
{
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
if( w->isOnAllDesktops() && painting_desktop != posToDesktop( window_move_pos - window_move_diff ))
w->disablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
}

View file

@ -30,7 +30,7 @@ void DrunkenEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, i
{
windows[ w ] += time / 1000.;
if( windows[ w ] < 1 )
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
else
windows.remove( w );
}

View file

@ -122,7 +122,7 @@ void ExplosionEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data,
if( mWindows[ w ] < 1 )
{
data.setTranslucent();
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
}
else

View file

@ -32,7 +32,7 @@ void FallApartEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data,
if( windows[ w ] < 1 )
{
windows[ w ] += time / 1000.;
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
// Request the window to be divided into cells
data.quads = data.quads.makeGrid( 40 );

View file

@ -32,7 +32,7 @@ void FlameEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int
if( windows[ w ] < 1 )
{
windows[ w ] += time / 500.;
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DELETE );
data.quads = data.quads.splitAtY( windows[ w ] * w->height());
}

View file

@ -55,7 +55,7 @@ void MinimizeAnimationEffect::prePaintWindow( EffectWindow* w, WindowPrePaintDat
if( mAnimationProgress.contains( w ))
{
// We'll transform this window
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
}
else

View file

@ -101,7 +101,7 @@ void PresentWindowsEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData&
if( mWindowData.contains(w) )
{
// This window will be transformed by the effect
data.mask |= Effect::PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_MINIMIZE );
w->enablePainting( EffectWindow::PAINT_DISABLED_BY_DESKTOP );
// If it's minimized window or on another desktop and effect is not

View file

@ -28,7 +28,7 @@ void ScaleInEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, i
{
windows[ w ] += time / 500.; // complete change in 500ms
if( windows[ w ] < 1 )
data.mask |= PAINT_WINDOW_TRANSFORMED;
data.setTransformed();
else
windows.remove( w );
}

View file

@ -29,6 +29,12 @@ void WindowPrePaintData::setTranslucent()
clip = QRegion(); // cannot clip, will be transparent
}
void WindowPrePaintData::setTransformed()
{
mask |= Effect::PAINT_WINDOW_TRANSFORMED;
}
WindowPaintData::WindowPaintData()
: opacity( 1.0 )
, contents_opacity( 1.0 )

View file

@ -434,10 +434,14 @@ class KWIN_EXPORT WindowPrePaintData
QRegion clip;
WindowQuadList quads;
/**
* Simple helper than sets data to say the window will be painted as non-opaque.
* Simple helper that sets data to say the window will be painted as non-opaque.
* Takes also care of changing the regions.
*/
void setTranslucent();
/**
* Helper to mark that this window will be transformed
**/
void setTransformed();
};
class KWIN_EXPORT WindowPaintData