diff options
| author | manuel <manuel@mausz.at> | 2011-04-12 21:53:36 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-12 21:53:36 +0200 |
| commit | c910e2267d3af30f10b9c659b2d9f9349c596e0d (patch) | |
| tree | c6b531b4d70faa0d88b0f86e81180f30e99b3060 /pacman-c++/animationmanager.cpp | |
| parent | cfbd1b80e7e1f89861c96e6d802a3fe11df00929 (diff) | |
| download | foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.tar.gz foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.tar.bz2 foop-c910e2267d3af30f10b9c659b2d9f9349c596e0d.zip | |
remove animationmanager (for now?)
Diffstat (limited to 'pacman-c++/animationmanager.cpp')
| -rw-r--r-- | pacman-c++/animationmanager.cpp | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/pacman-c++/animationmanager.cpp b/pacman-c++/animationmanager.cpp deleted file mode 100644 index 3880b08..0000000 --- a/pacman-c++/animationmanager.cpp +++ /dev/null | |||
| @@ -1,56 +0,0 @@ | |||
| 1 | #include "animationmanager.h" | ||
| 2 | #include <QtCore/QAbstractAnimation> | ||
| 3 | #include <QtCore/QDebug> | ||
| 4 | |||
| 5 | // the universe's only animation manager | ||
| 6 | AnimationManager *AnimationManager::instance = NULL; | ||
| 7 | |||
| 8 | AnimationManager::AnimationManager() | ||
| 9 | { | ||
| 10 | } | ||
| 11 | |||
| 12 | AnimationManager *AnimationManager::self() | ||
| 13 | { | ||
| 14 | if (!instance) | ||
| 15 | instance = new AnimationManager; | ||
| 16 | return instance; | ||
| 17 | } | ||
| 18 | |||
| 19 | void AnimationManager::registerAnimation(QAbstractAnimation *anim) | ||
| 20 | { | ||
| 21 | QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); | ||
| 22 | animations.append(anim); | ||
| 23 | } | ||
| 24 | |||
| 25 | void AnimationManager::unregisterAnimation_helper(QObject *obj) | ||
| 26 | { | ||
| 27 | unregisterAnimation(static_cast<QAbstractAnimation*>(obj)); | ||
| 28 | } | ||
| 29 | |||
| 30 | void AnimationManager::unregisterAnimation(QAbstractAnimation *anim) | ||
| 31 | { | ||
| 32 | QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); | ||
| 33 | animations.removeAll(anim); | ||
| 34 | } | ||
| 35 | |||
| 36 | void AnimationManager::unregisterAllAnimations() | ||
| 37 | { | ||
| 38 | animations.clear(); | ||
| 39 | } | ||
| 40 | |||
| 41 | void AnimationManager::pauseAll() | ||
| 42 | { | ||
| 43 | foreach (QAbstractAnimation* animation, animations) | ||
| 44 | { | ||
| 45 | if (animation->state() == QAbstractAnimation::Running) | ||
| 46 | animation->pause(); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | void AnimationManager::resumeAll() | ||
| 50 | { | ||
| 51 | foreach (QAbstractAnimation* animation, animations) | ||
| 52 | { | ||
| 53 | if (animation->state() == QAbstractAnimation::Paused) | ||
| 54 | animation->resume(); | ||
| 55 | } | ||
| 56 | } | ||
