Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinanimationeffect.h
Show All 22 Lines | |||||
23 | #define ANIMATION_EFFECT_H | 23 | #define ANIMATION_EFFECT_H | ||
24 | 24 | | |||
25 | #include <QEasingCurve> | 25 | #include <QEasingCurve> | ||
26 | #include <QElapsedTimer> | 26 | #include <QElapsedTimer> | ||
27 | #include <qmath.h> | 27 | #include <qmath.h> | ||
28 | #include <kwineffects.h> | 28 | #include <kwineffects.h> | ||
29 | #include <kwineffects_export.h> | 29 | #include <kwineffects_export.h> | ||
30 | 30 | | |||
31 | | ||||
32 | namespace KWin | 31 | namespace KWin | ||
33 | { | 32 | { | ||
34 | 33 | | |||
35 | class KWINEFFECTS_EXPORT FPx2 { | 34 | class KWINEFFECTS_EXPORT FPx2 { | ||
36 | public: | 35 | public: | ||
37 | FPx2() { f[0] = f[1] = 0.0; valid = false; } | 36 | FPx2() { f[0] = f[1] = 0.0; valid = false; } | ||
38 | explicit FPx2(float v) { f[0] = f[1] = v; valid = true; } | 37 | explicit FPx2(float v) { f[0] = f[1] = v; valid = true; } | ||
39 | FPx2(float v1, float v2) { f[0] = v1; f[1] = v2; valid = true; } | 38 | FPx2(float v1, float v2) { f[0] = v1; f[1] = v2; valid = true; } | ||
▲ Show 20 Lines • Show All 344 Lines • ▼ Show 20 Line(s) | 382 | private: | |||
384 | 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); | 383 | 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); | ||
385 | QRect clipRect(const QRect &windowRect, const AniData&) const; | 384 | QRect clipRect(const QRect &windowRect, const AniData&) const; | ||
386 | void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; | 385 | void clipWindow(const EffectWindow *, const AniData &, WindowQuadList &) const; | ||
387 | float interpolated( const AniData&, int i = 0 ) const; | 386 | float interpolated( const AniData&, int i = 0 ) const; | ||
388 | float progress( const AniData& ) const; | 387 | float progress( const AniData& ) const; | ||
389 | void disconnectGeometryChanges(); | 388 | void disconnectGeometryChanges(); | ||
390 | void updateLayerRepaints(); | 389 | void updateLayerRepaints(); | ||
391 | void validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, const EffectWindow *w) const; | 390 | void validate(Attribute a, uint &meta, FPx2 *from, FPx2 *to, const EffectWindow *w) const; | ||
391 | | ||||
392 | private Q_SLOTS: | 392 | private Q_SLOTS: | ||
393 | void init(); | 393 | void init(); | ||
394 | void triggerRepaint(); | 394 | void triggerRepaint(); | ||
395 | void _windowClosed( KWin::EffectWindow* w ); | 395 | void _windowClosed( KWin::EffectWindow* w ); | ||
396 | void _windowDeleted( KWin::EffectWindow* w ); | 396 | void _windowDeleted( KWin::EffectWindow* w ); | ||
397 | void _expandedGeometryChanged(KWin::EffectWindow *w, const QRect &old); | 397 | void _expandedGeometryChanged(KWin::EffectWindow *w, const QRect &old); | ||
398 | | ||||
398 | private: | 399 | private: | ||
399 | static QElapsedTimer s_clock; | 400 | static QElapsedTimer s_clock; | ||
400 | AnimationEffectPrivate * const d_ptr; | 401 | AnimationEffectPrivate * const d_ptr; | ||
401 | Q_DECLARE_PRIVATE(AnimationEffect) | 402 | Q_DECLARE_PRIVATE(AnimationEffect) | ||
402 | Q_DISABLE_COPY(AnimationEffect) | 403 | Q_DISABLE_COPY(AnimationEffect) | ||
403 | }; | 404 | }; | ||
404 | 405 | | |||
405 | | ||||
406 | } // namespace | 406 | } // namespace | ||
407 | | ||||
407 | QDebug operator<<(QDebug dbg, const KWin::FPx2 &fpx2); | 408 | QDebug operator<<(QDebug dbg, const KWin::FPx2 &fpx2); | ||
408 | 409 | | |||
409 | Q_DECLARE_METATYPE(KWin::FPx2) | 410 | Q_DECLARE_METATYPE(KWin::FPx2) | ||
410 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::AnimationEffect::TerminationFlags) | 411 | Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::AnimationEffect::TerminationFlags) | ||
411 | 412 | | |||
412 | #endif // ANIMATION_EFFECT_H | 413 | #endif // ANIMATION_EFFECT_H |