Changeset View
Standalone View
libkwineffects/anidata_p.h
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
74 | class KWINEFFECTS_EXPORT AniData { | 74 | class KWINEFFECTS_EXPORT AniData { | ||
75 | public: | 75 | public: | ||
76 | AniData(); | 76 | AniData(); | ||
77 | AniData(AnimationEffect::Attribute a, int meta, const FPx2 &to, | 77 | AniData(AnimationEffect::Attribute a, int meta, const FPx2 &to, | ||
78 | int delay, const FPx2 &from, bool waitAtSource, | 78 | int delay, const FPx2 &from, bool waitAtSource, | ||
79 | bool keepAtTarget = false, FullScreenEffectLockPtr=FullScreenEffectLockPtr(), | 79 | bool keepAtTarget = false, FullScreenEffectLockPtr=FullScreenEffectLockPtr(), | ||
80 | bool keepAlive = true, PreviousWindowPixmapLockPtr previousWindowPixmapLock = {}); | 80 | bool keepAlive = true, PreviousWindowPixmapLockPtr previousWindowPixmapLock = {}); | ||
81 | 81 | | |||
82 | bool isActive() const; | ||||
83 | | ||||
82 | inline bool isOneDimensional() const { | 84 | inline bool isOneDimensional() const { | ||
83 | return from[0] == from[1] && to[0] == to[1]; | 85 | return from[0] == from[1] && to[0] == to[1]; | ||
84 | } | 86 | } | ||
85 | 87 | | |||
86 | quint64 id{0}; | 88 | quint64 id{0}; | ||
87 | QString debugInfo() const; | 89 | QString debugInfo() const; | ||
88 | AnimationEffect::Attribute attribute; | 90 | AnimationEffect::Attribute attribute; | ||
89 | int customCurve; | 91 | int customCurve; | ||
90 | FPx2 from, to; | 92 | FPx2 from, to; | ||
91 | TimeLine timeLine; | 93 | TimeLine timeLine; | ||
92 | uint meta; | 94 | uint meta; | ||
93 | qint64 startTime; | 95 | qint64 startTime; | ||
94 | QSharedPointer<FullScreenEffectLock> fullScreenEffectLock; | 96 | QSharedPointer<FullScreenEffectLock> fullScreenEffectLock; | ||
95 | bool waitAtSource, keepAtTarget; | 97 | bool waitAtSource, keepAtTarget; | ||
96 | bool keepAlive; | 98 | bool keepAlive; | ||
97 | KeepAliveLockPtr keepAliveLock; | 99 | KeepAliveLockPtr keepAliveLock; | ||
98 | PreviousWindowPixmapLockPtr previousWindowPixmapLock; | 100 | PreviousWindowPixmapLockPtr previousWindowPixmapLock; | ||
101 | AnimationEffect::TerminationPolicy terminationPolicy = AnimationEffect::TerminateAtSource; | ||||
davidedmundson: Would it be feasible to have matching names and types for keepAtTarget and keepAtSource. | |||||
So, instead of having two booleans, we would have a single enum, right? zzag: So, instead of having two booleans, we would have a single enum, right?
Yeah, it makes sense… | |||||
Instead of bool keepAtTarget; We have either: AnimationEffect::TerminationPolicy targetTerminationPolicy; OR AnimationEffect::TerminationPolicy terminationPolicy; which has flags for {DontTerminate, TerminateAtSource, TerminateAtTarget} That then becomes related to this patch as we'd have to name things appropriately davidedmundson: Instead of
bool keepAtTarget;
AnimationEffect::TerminationPolicy terminationPolicy;
We have… | |||||
With TerminateAtTarget, effects can then change type of animation (animate vs set).
If we have the following TerminationPolicy enum TerminationPolicy { DontTerminate, Terminate }; maybe it can work out, but I doubt whether it would be simpler than just using two booleans (bool terminateAtSource and bool terminateAtTarget). zzag: > which has flags for {DontTerminate, TerminateAtSource, TerminateAtTarget}
With… | |||||
99 | }; | 102 | }; | ||
100 | 103 | | |||
101 | } // namespace | 104 | } // namespace | ||
102 | 105 | | |||
103 | QDebug operator<<(QDebug dbg, const KWin::AniData &a); | 106 | QDebug operator<<(QDebug dbg, const KWin::AniData &a); | ||
104 | 107 | | |||
105 | #endif // ANIDATA_H | 108 | #endif // ANIDATA_H |
Would it be feasible to have matching names and types for keepAtTarget and keepAtSource. They're effectively doing the same thing