Changeset View
Changeset View
Standalone View
Standalone View
effects/sheet/sheet.cpp
Show All 25 Lines | |||||
26 | #include <QGraphicsRotation> | 26 | #include <QGraphicsRotation> | ||
27 | #include <QVector3D> | 27 | #include <QVector3D> | ||
28 | 28 | | |||
29 | // Effect is based on fade effect by Philip Falkner | 29 | // Effect is based on fade effect by Philip Falkner | ||
30 | 30 | | |||
31 | namespace KWin | 31 | namespace KWin | ||
32 | { | 32 | { | ||
33 | 33 | | |||
34 | static const int IsSheetWindow = 0x22A982D5; | | |||
35 | | ||||
36 | SheetEffect::SheetEffect() | 34 | SheetEffect::SheetEffect() | ||
37 | { | 35 | { | ||
38 | initConfig<SheetConfig>(); | 36 | initConfig<SheetConfig>(); | ||
39 | reconfigure(ReconfigureAll); | 37 | reconfigure(ReconfigureAll); | ||
40 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | 38 | connect(effects, SIGNAL(windowAdded(KWin::EffectWindow*)), this, SLOT(slotWindowAdded(KWin::EffectWindow*))); | ||
41 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | 39 | connect(effects, SIGNAL(windowClosed(KWin::EffectWindow*)), this, SLOT(slotWindowClosed(KWin::EffectWindow*))); | ||
42 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | 40 | connect(effects, SIGNAL(windowDeleted(KWin::EffectWindow*)), this, SLOT(slotWindowDeleted(KWin::EffectWindow*))); | ||
43 | } | 41 | } | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 100 | { | |||
118 | } | 116 | } | ||
119 | effects->postPaintWindow(w); | 117 | effects->postPaintWindow(w); | ||
120 | } | 118 | } | ||
121 | 119 | | |||
122 | void SheetEffect::slotWindowAdded(EffectWindow* w) | 120 | void SheetEffect::slotWindowAdded(EffectWindow* w) | ||
123 | { | 121 | { | ||
124 | if (!isSheetWindow(w)) | 122 | if (!isSheetWindow(w)) | ||
125 | return; | 123 | return; | ||
126 | w->setData(IsSheetWindow, true); | | |||
127 | 124 | | |||
128 | InfoMap::iterator it = windows.find(w); | 125 | InfoMap::iterator it = windows.find(w); | ||
129 | WindowInfo *info = (it == windows.end()) ? &windows[w] : &it.value(); | 126 | WindowInfo *info = (it == windows.end()) ? &windows[w] : &it.value(); | ||
130 | info->added = true; | 127 | info->added = true; | ||
131 | info->closed = false; | 128 | info->closed = false; | ||
132 | info->deleted = false; | 129 | info->deleted = false; | ||
133 | delete info->timeLine; | 130 | delete info->timeLine; | ||
134 | info->timeLine = new QTimeLine(duration); | 131 | info->timeLine = new QTimeLine(duration); | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
176 | 173 | | |||
177 | void SheetEffect::slotWindowDeleted(EffectWindow* w) | 174 | void SheetEffect::slotWindowDeleted(EffectWindow* w) | ||
178 | { | 175 | { | ||
179 | windows.remove(w); | 176 | windows.remove(w); | ||
180 | } | 177 | } | ||
181 | 178 | | |||
182 | bool SheetEffect::isSheetWindow(EffectWindow* w) | 179 | bool SheetEffect::isSheetWindow(EffectWindow* w) | ||
183 | { | 180 | { | ||
184 | return (w->isModal() || w->data(IsSheetWindow).toBool()); | 181 | return w->isModal(); | ||
185 | } | 182 | } | ||
186 | 183 | | |||
187 | bool SheetEffect::isActive() const | 184 | bool SheetEffect::isActive() const | ||
188 | { | 185 | { | ||
189 | return !windows.isEmpty(); | 186 | return !windows.isEmpty(); | ||
190 | } | 187 | } | ||
191 | 188 | | |||
192 | SheetEffect::WindowInfo::WindowInfo() | 189 | SheetEffect::WindowInfo::WindowInfo() | ||
Show All 14 Lines |