Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinanimationeffect.h
Show First 20 Lines • Show All 156 Lines • ▼ Show 20 Line(s) | 153 | protected: | |||
---|---|---|---|---|---|
157 | * @param a - The @enum Attribute to manipulate | 157 | * @param a - The @enum Attribute to manipulate | ||
158 | * @param meta - Basically a wildcard to carry various extra information, eg. the anchor, relativity or rotation axis. You will probably use require it when performing Generic animations. | 158 | * @param meta - Basically a wildcard to carry various extra information, eg. the anchor, relativity or rotation axis. You will probably use require it when performing Generic animations. | ||
159 | * @param ms - How long the transition will last | 159 | * @param ms - How long the transition will last | ||
160 | * @param to - The target value. FPx2 is an agnostic two component float type (like QPointF or QSizeF, but without requiring to be either and supporting an invalid state) | 160 | * @param to - The target value. FPx2 is an agnostic two component float type (like QPointF or QSizeF, but without requiring to be either and supporting an invalid state) | ||
161 | * @param shape - How the animation progresses, eg. Linear progresses constantly while Exponential start slow and becomes very fast in the end | 161 | * @param shape - How the animation progresses, eg. Linear progresses constantly while Exponential start slow and becomes very fast in the end | ||
162 | * @param delay - When the animation will start compared to "now" (the window will remain at the "from" position until then) | 162 | * @param delay - When the animation will start compared to "now" (the window will remain at the "from" position until then) | ||
163 | * @param from - The starting value, the default is invalid, ie. the attribute for the window is not transformed in the beginning | 163 | * @param from - The starting value, the default is invalid, ie. the attribute for the window is not transformed in the beginning | ||
164 | * @param fullScreen - Sets this effect as the active full screen effect for the duration of the animation | 164 | * @param fullScreen - Sets this effect as the active full screen effect for the duration of the animation | ||
165 | * @param keepAlive - Whether closed windows should be kept alive during animation | ||||
165 | * @return an ID that you can use to cancel a running animation | 166 | * @return an ID that you can use to cancel a running animation | ||
166 | */ | 167 | */ | ||
167 | quint64 animate( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false) | 168 | quint64 animate( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false, bool keepAlive = true) | ||
168 | { return p_animate(w, a, meta, ms, to, curve, delay, from, false, fullScreen); } | 169 | { return p_animate(w, a, meta, ms, to, curve, delay, from, false, fullScreen, keepAlive); } | ||
169 | 170 | | |||
170 | /** | 171 | /** | ||
171 | * Equal to ::animate() with one important difference: | 172 | * Equal to ::animate() with one important difference: | ||
172 | * The target value for the attribute is kept until you ::cancel() this animation | 173 | * The target value for the attribute is kept until you ::cancel() this animation | ||
173 | * @return an ID that you need to use to cancel this manipulation | 174 | * @return an ID that you need to use to cancel this manipulation | ||
174 | */ | 175 | */ | ||
175 | quint64 set( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false) | 176 | quint64 set( EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve = QEasingCurve(), int delay = 0, FPx2 from = FPx2(), bool fullScreen = false, bool keepAlive = true) | ||
176 | { return p_animate(w, a, meta, ms, to, curve, delay, from, true, fullScreen); } | 177 | { return p_animate(w, a, meta, ms, to, curve, delay, from, true, fullScreen, keepAlive); } | ||
177 | 178 | | |||
178 | /** | 179 | /** | ||
179 | * this allows to alter the target (but not type or curve) of a running animation | 180 | * this allows to alter the target (but not type or curve) of a running animation | ||
180 | * with the ID @param animationId | 181 | * with the ID @param animationId | ||
181 | * @param newTarget alters the "to" parameter of the animation | 182 | * @param newTarget alters the "to" parameter of the animation | ||
182 | * If @param newRemainingTime allows to lengthen (or shorten) the remaining time | 183 | * If @param newRemainingTime allows to lengthen (or shorten) the remaining time | ||
183 | * of the animation. By default (-1) the remaining time remains unchanged | 184 | * of the animation. By default (-1) the remaining time remains unchanged | ||
184 | * | 185 | * | ||
Show All 22 Lines | |||||
207 | */ | 208 | */ | ||
208 | virtual void genericAnimation( EffectWindow *w, WindowPaintData &data, float progress, uint meta ) | 209 | virtual void genericAnimation( EffectWindow *w, WindowPaintData &data, float progress, uint meta ) | ||
209 | {Q_UNUSED(w); Q_UNUSED(data); Q_UNUSED(progress); Q_UNUSED(meta);} | 210 | {Q_UNUSED(w); Q_UNUSED(data); Q_UNUSED(progress); Q_UNUSED(meta);} | ||
210 | 211 | | |||
211 | //Internal for unit tests | 212 | //Internal for unit tests | ||
212 | AniMap state() const; | 213 | AniMap state() const; | ||
213 | 214 | | |||
214 | private: | 215 | private: | ||
215 | quint64 p_animate(EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect); | 216 | quint64 p_animate(EffectWindow *w, Attribute a, uint meta, int ms, FPx2 to, QEasingCurve curve, int delay, FPx2 from, bool keepAtTarget, bool fullScreenEffect, bool keepAlive); | ||
216 | QRect clipRect(const QRect &windowRect, const AniData&) const; | 217 | QRect clipRect(const QRect &windowRect, const AniData&) const; | ||
217 | void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; | 218 | void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; | ||
218 | float interpolated( const AniData&, int i = 0 ) const; | 219 | float interpolated( const AniData&, int i = 0 ) const; | ||
219 | float progress( const AniData& ) const; | 220 | float progress( const AniData& ) const; | ||
220 | void disconnectGeometryChanges(); | 221 | void disconnectGeometryChanges(); | ||
221 | void updateLayerRepaints(); | 222 | void updateLayerRepaints(); | ||
222 | void validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, const EffectWindow *w) const; | 223 | void validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, const EffectWindow *w) const; | ||
223 | private Q_SLOTS: | 224 | private Q_SLOTS: | ||
Show All 17 Lines |