1
/***************************************************************************
2
* KBlocks, a falling blocks game for KDE *
3
* Copyright (C) 2009 Mauricio Piacentini <mauricio@tabuleiro.com> *
4
* Zhongjie Cai <squall.leonhart.cai@gmail.com> *
6
* This program is free software; you can redistribute it and/or modify *
7
* it under the terms of the GNU General Public License as published by *
8
* the Free Software Foundation; either version 2 of the License, or *
9
* (at your option) any later version. *
10
***************************************************************************/
11
#include "KBlocksAnimator.h"
13
KBlocksAnimator::KBlocksAnimator()
19
KBlocksAnimator::~KBlocksAnimator()
33
bool KBlocksAnimator::createFadeAnim(const QList<KBlocksSvgItem*> & items, int duration, QTimeLine::Direction direction)
40
mpAnimFade = new KBlocksAnimFade(items, duration, direction);
42
if (direction == QTimeLine::Forward)
44
connect(mpAnimFade, SIGNAL(animationFinished()), this, SLOT(endFadeInAnim()));
48
connect(mpAnimFade, SIGNAL(animationFinished()), this, SLOT(endFadeOutAnim()));
54
bool KBlocksAnimator::deleteFadeAnim()
65
KBlocksAnimFade* KBlocksAnimator::getFadeAnim()
70
bool KBlocksAnimator::createDropAnim(const QList<KBlocksSvgItem*> & items, int duration, QTimeLine::Direction direction)
77
mpAnimDrop = new KBlocksAnimDrop(items, duration, direction);
79
connect(mpAnimDrop, SIGNAL(animationFinished()), this, SLOT(endDropAnim()));
84
bool KBlocksAnimator::deleteDropAnim()
95
KBlocksAnimDrop* KBlocksAnimator::getDropAnim()
100
void KBlocksAnimator::endFadeInAnim()
102
emit animFinished(KBlocks_Animation_Fade_In);
105
void KBlocksAnimator::endFadeOutAnim()
107
emit animFinished(KBlocks_Animation_Fade_Out);
110
void KBlocksAnimator::endDropAnim()
112
emit animFinished(KBlocks_Animation_Drop);