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
You can Freely distribute this program under the GNU General Public
8
License. See the file "COPYING" for the exact licensing terms.
9
******************************************************************/
19
KWIN_EFFECT(flame, FlameEffect)
21
void FlameEffect::prePaintScreen(ScreenPrePaintData& data, int time)
23
if (!windows.isEmpty())
24
data.mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS;
25
effects->prePaintScreen(data, time);
28
void FlameEffect::prePaintWindow(EffectWindow* w, WindowPrePaintData& data, int time)
30
if (windows.contains(w)) {
31
if (windows[ w ] < 1) {
32
windows[ w ] += time / 500.;
33
data.setTransformed();
34
w->enablePainting(EffectWindow::PAINT_DISABLED_BY_DELETE);
35
data.quads = data.quads.splitAtY(windows[ w ] * w->height());
41
effects->prePaintWindow(w, data, time);
44
void FlameEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
46
if (windows.contains(w)) {
47
WindowQuadList new_quads;
48
double ylimit = windows[ w ] * w->height(); // parts above this are already away
49
foreach (const WindowQuad & quad, data.quads) {
50
if (quad.bottom() <= ylimit)
52
new_quads.append(quad);
54
if (new_quads.isEmpty())
55
return; // nothing to paint
56
data.quads = new_quads;
58
effects->paintWindow(w, mask, region, data);
61
void FlameEffect::postPaintWindow(EffectWindow* w)
63
if (windows.contains(w))
64
effects->addRepaint(w->geometry()); // workspace, since the window under it will need painting too
65
effects->postPaintScreen();
68
void FlameEffect::windowClosed(EffectWindow* c)
74
void FlameEffect::windowDeleted(EffectWindow* c)