2007-06-08 07:24:19 +02:00
|
|
|
/*
|
2007-08-06 13:20:02 +02:00
|
|
|
* Copyright 2007 Aaron Seigo <aseigo@kde.org>
|
2007-07-06 18:26:48 +02:00
|
|
|
* 2007 Alexis Ménard <darktears31@gmail.com>
|
2007-06-08 07:24:19 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
2007-09-14 21:06:18 +02:00
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
2007-06-08 07:24:19 +02:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "animator.h"
|
|
|
|
|
2007-06-19 23:53:19 +02:00
|
|
|
#include <QPainter>
|
2007-07-06 18:26:48 +02:00
|
|
|
#include <QGraphicsItem>
|
2007-06-19 23:53:19 +02:00
|
|
|
|
2007-06-08 07:24:19 +02:00
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2007-08-29 04:45:20 +02:00
|
|
|
Animator::Animator(QObject *parent)
|
2007-07-06 12:28:28 +02:00
|
|
|
: QObject(parent),
|
|
|
|
d(0)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Animator::~Animator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-06-24 23:36:00 +02:00
|
|
|
int Animator::framesPerSecond(Plasma::Phase::Animation animation)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
2007-06-19 23:53:19 +02:00
|
|
|
Q_UNUSED(animation)
|
2007-06-08 07:24:19 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-07-04 11:36:50 +02:00
|
|
|
int Animator::framesPerSecond(Plasma::Phase::Movement movement)
|
|
|
|
{
|
|
|
|
Q_UNUSED(movement)
|
2007-07-06 18:26:48 +02:00
|
|
|
return 10;
|
2007-07-04 11:36:50 +02:00
|
|
|
}
|
|
|
|
|
2007-06-24 23:36:00 +02:00
|
|
|
int Animator::framesPerSecond(Plasma::Phase::ElementAnimation animation)
|
2007-06-19 23:53:19 +02:00
|
|
|
{
|
|
|
|
Q_UNUSED(animation)
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-06-25 07:57:47 +02:00
|
|
|
Phase::CurveShape Animator::curve(Plasma::Phase::Animation)
|
|
|
|
{
|
|
|
|
return Phase::EaseInOutCurve;
|
|
|
|
}
|
|
|
|
|
2007-07-04 11:36:50 +02:00
|
|
|
Phase::CurveShape Animator::curve(Plasma::Phase::Movement)
|
|
|
|
{
|
|
|
|
return Phase::EaseInOutCurve;
|
|
|
|
}
|
|
|
|
|
2007-06-25 07:57:47 +02:00
|
|
|
Phase::CurveShape Animator::curve(Plasma::Phase::ElementAnimation)
|
|
|
|
{
|
|
|
|
return Phase::EaseInOutCurve;
|
|
|
|
}
|
|
|
|
|
2007-06-19 23:53:19 +02:00
|
|
|
QPixmap Animator::elementAppear(qreal frame, const QPixmap& pixmap)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
Q_UNUSED(frame)
|
2007-06-19 23:53:19 +02:00
|
|
|
return pixmap;
|
2007-06-08 07:24:19 +02:00
|
|
|
}
|
|
|
|
|
2007-06-19 23:53:19 +02:00
|
|
|
QPixmap Animator::elementDisappear(qreal frame, const QPixmap& pixmap)
|
|
|
|
{
|
|
|
|
Q_UNUSED(frame)
|
|
|
|
QPixmap pix(pixmap.size());
|
2007-06-21 01:33:26 +02:00
|
|
|
pix.fill(Qt::transparent);
|
2007-06-19 23:53:19 +02:00
|
|
|
|
|
|
|
return pix;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Animator::appear(qreal frame, QGraphicsItem* item)
|
2007-06-10 09:09:07 +02:00
|
|
|
{
|
2007-06-19 23:53:19 +02:00
|
|
|
Q_UNUSED(frame)
|
2007-06-10 09:09:07 +02:00
|
|
|
Q_UNUSED(item)
|
|
|
|
}
|
|
|
|
|
|
|
|
void Animator::disappear(qreal frame, QGraphicsItem* item)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
Q_UNUSED(frame)
|
|
|
|
Q_UNUSED(item)
|
|
|
|
}
|
|
|
|
|
2007-06-10 09:09:07 +02:00
|
|
|
void Animator::activate(qreal frame, QGraphicsItem* item)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
Q_UNUSED(frame)
|
|
|
|
Q_UNUSED(item)
|
|
|
|
}
|
|
|
|
|
2007-06-10 09:09:07 +02:00
|
|
|
void Animator::frameAppear(qreal frame, QGraphicsItem* item, const QRegion& drawable)
|
2007-06-08 07:24:19 +02:00
|
|
|
{
|
|
|
|
Q_UNUSED(frame)
|
|
|
|
Q_UNUSED(item)
|
|
|
|
Q_UNUSED(drawable)
|
|
|
|
}
|
|
|
|
|
2007-07-20 10:06:27 +02:00
|
|
|
void Animator::slideIn(qreal progress, QGraphicsItem *item, const QPoint &destination)
|
2007-07-04 11:36:50 +02:00
|
|
|
{
|
2007-07-27 18:34:01 +02:00
|
|
|
//FIXME: rewrite
|
2007-07-06 18:26:48 +02:00
|
|
|
Q_UNUSED(progress);
|
2007-07-27 18:34:01 +02:00
|
|
|
item->translate(-destination.x(), -destination.y());
|
2007-07-04 11:36:50 +02:00
|
|
|
}
|
|
|
|
|
2007-07-20 10:06:27 +02:00
|
|
|
void Animator::slideOut(qreal progress, QGraphicsItem *item, const QPoint &destination)
|
2007-07-04 11:36:50 +02:00
|
|
|
{
|
2007-07-27 18:34:01 +02:00
|
|
|
//FIXME: rewrite
|
2007-07-06 18:26:48 +02:00
|
|
|
Q_UNUSED(progress);
|
2007-08-20 23:33:48 +02:00
|
|
|
//kDebug();
|
2007-07-27 18:34:01 +02:00
|
|
|
item->translate(destination.x(), destination.y());
|
2007-07-04 11:36:50 +02:00
|
|
|
}
|
|
|
|
|
2007-06-08 07:24:19 +02:00
|
|
|
void Animator::renderBackground(QImage& background)
|
|
|
|
{
|
|
|
|
Q_UNUSED(background)
|
|
|
|
}
|
|
|
|
|
2007-06-08 09:23:09 +02:00
|
|
|
} // Plasma namespace
|
2007-06-08 07:24:19 +02:00
|
|
|
|
|
|
|
#include "animator.moc"
|