From c910e2267d3af30f10b9c659b2d9f9349c596e0d Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 12 Apr 2011 21:53:36 +0200 Subject: remove animationmanager (for now?) --- pacman-c++/animationmanager.cpp | 56 ----------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 pacman-c++/animationmanager.cpp (limited to 'pacman-c++/animationmanager.cpp') 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 @@ -#include "animationmanager.h" -#include -#include - -// the universe's only animation manager -AnimationManager *AnimationManager::instance = NULL; - -AnimationManager::AnimationManager() -{ -} - -AnimationManager *AnimationManager::self() -{ - if (!instance) - instance = new AnimationManager; - return instance; -} - -void AnimationManager::registerAnimation(QAbstractAnimation *anim) -{ - QObject::connect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); - animations.append(anim); -} - -void AnimationManager::unregisterAnimation_helper(QObject *obj) -{ - unregisterAnimation(static_cast(obj)); -} - -void AnimationManager::unregisterAnimation(QAbstractAnimation *anim) -{ - QObject::disconnect(anim, SIGNAL(destroyed(QObject*)), this, SLOT(unregisterAnimation_helper(QObject*))); - animations.removeAll(anim); -} - -void AnimationManager::unregisterAllAnimations() -{ - animations.clear(); -} - -void AnimationManager::pauseAll() -{ - foreach (QAbstractAnimation* animation, animations) - { - if (animation->state() == QAbstractAnimation::Running) - animation->pause(); - } -} -void AnimationManager::resumeAll() -{ - foreach (QAbstractAnimation* animation, animations) - { - if (animation->state() == QAbstractAnimation::Paused) - animation->resume(); - } -} -- cgit v1.2.3