Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/anidata.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Line(s) | |||||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | AniData::AniData() | 70 | AniData::AniData() | ||
71 | : attribute(AnimationEffect::Opacity) | 71 | : attribute(AnimationEffect::Opacity) | ||
72 | , customCurve(0) // Linear | 72 | , customCurve(0) // Linear | ||
73 | , meta(0) | 73 | , meta(0) | ||
74 | , startTime(0) | 74 | , startTime(0) | ||
75 | , waitAtSource(false) | 75 | , waitAtSource(false) | ||
76 | , keepAtTarget(false) | | |||
77 | , keepAlive(true) | 76 | , keepAlive(true) | ||
78 | { | 77 | { | ||
79 | } | 78 | } | ||
80 | 79 | | |||
81 | AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_, | 80 | AniData::AniData(AnimationEffect::Attribute a, int meta_, const FPx2 &to_, | ||
82 | int delay, const FPx2 &from_, bool waitAtSource_, bool keepAtTarget_, | 81 | int delay, const FPx2 &from_, bool waitAtSource_, | ||
83 | FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive, | 82 | FullScreenEffectLockPtr fullScreenEffectLock_, bool keepAlive, | ||
84 | PreviousWindowPixmapLockPtr previousWindowPixmapLock_) | 83 | PreviousWindowPixmapLockPtr previousWindowPixmapLock_) | ||
85 | : attribute(a) | 84 | : attribute(a) | ||
86 | , from(from_) | 85 | , from(from_) | ||
87 | , to(to_) | 86 | , to(to_) | ||
88 | , meta(meta_) | 87 | , meta(meta_) | ||
89 | , startTime(AnimationEffect::clock() + delay) | 88 | , startTime(AnimationEffect::clock() + delay) | ||
90 | , fullScreenEffectLock(fullScreenEffectLock_) | 89 | , fullScreenEffectLock(fullScreenEffectLock_) | ||
91 | , waitAtSource(waitAtSource_) | 90 | , waitAtSource(waitAtSource_) | ||
92 | , keepAtTarget(keepAtTarget_) | | |||
93 | , keepAlive(keepAlive) | 91 | , keepAlive(keepAlive) | ||
94 | , previousWindowPixmapLock(previousWindowPixmapLock_) | 92 | , previousWindowPixmapLock(previousWindowPixmapLock_) | ||
95 | { | 93 | { | ||
96 | } | 94 | } | ||
97 | 95 | | |||
96 | bool AniData::isActive() const | ||||
97 | { | ||||
98 | if (!timeLine.done()) { | ||||
99 | return true; | ||||
100 | } | ||||
101 | | ||||
102 | if (timeLine.direction() == TimeLine::Backward) { | ||||
103 | return !(terminationFlags & AnimationEffect::TerminateAtSource); | ||||
104 | } | ||||
105 | | ||||
106 | return !(terminationFlags & AnimationEffect::TerminateAtTarget); | ||||
107 | } | ||||
108 | | ||||
98 | static QString attributeString(KWin::AnimationEffect::Attribute attribute) | 109 | static QString attributeString(KWin::AnimationEffect::Attribute attribute) | ||
99 | { | 110 | { | ||
100 | switch (attribute) { | 111 | switch (attribute) { | ||
101 | case KWin::AnimationEffect::Opacity: return QStringLiteral("Opacity"); | 112 | case KWin::AnimationEffect::Opacity: return QStringLiteral("Opacity"); | ||
102 | case KWin::AnimationEffect::Brightness: return QStringLiteral("Brightness"); | 113 | case KWin::AnimationEffect::Brightness: return QStringLiteral("Brightness"); | ||
103 | case KWin::AnimationEffect::Saturation: return QStringLiteral("Saturation"); | 114 | case KWin::AnimationEffect::Saturation: return QStringLiteral("Saturation"); | ||
104 | case KWin::AnimationEffect::Scale: return QStringLiteral("Scale"); | 115 | case KWin::AnimationEffect::Scale: return QStringLiteral("Scale"); | ||
105 | case KWin::AnimationEffect::Translation: return QStringLiteral("Translation"); | 116 | case KWin::AnimationEffect::Translation: return QStringLiteral("Translation"); | ||
Show All 17 Lines |