• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

animator.cpp

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2007 Aaron Seigo <aseigo@kde.org>
00003  *             2007 Alexis Ménard <darktears31@gmail.com>
00004  *
00005  *   This program is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU Library General Public License as
00007  *   published by the Free Software Foundation; either version 2, or
00008  *   (at your option) any later version.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details
00014  *
00015  *   You should have received a copy of the GNU Library General Public
00016  *   License along with this program; if not, write to the
00017  *   Free Software Foundation, Inc.,
00018  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00019  */
00020 
00021 #include "animator.h"
00022 
00023 #include <QPainter>
00024 #include <QGraphicsItem>
00025 
00026 namespace Plasma
00027 {
00028 
00029 Animator::Animator(QObject *parent)
00030     : QObject(parent),
00031       d(0)
00032 {
00033 }
00034 
00035 Animator::~Animator()
00036 {
00037 }
00038 
00039 int Animator::framesPerSecond(Plasma::Phase::Animation animation)
00040 {
00041     Q_UNUSED(animation)
00042     return 0;
00043 }
00044 
00045 int Animator::framesPerSecond(Plasma::Phase::Movement movement)
00046 {
00047     Q_UNUSED(movement)
00048     return 20;
00049 }
00050 
00051 int Animator::framesPerSecond(Plasma::Phase::ElementAnimation animation)
00052 {
00053     Q_UNUSED(animation)
00054     return 0;
00055 }
00056 
00057 Phase::CurveShape Animator::curve(Plasma::Phase::Animation)
00058 {
00059     return Phase::EaseInOutCurve;
00060 }
00061 
00062 Phase::CurveShape Animator::curve(Plasma::Phase::Movement)
00063 {
00064     return Phase::EaseInOutCurve;
00065 }
00066 
00067 Phase::CurveShape Animator::curve(Plasma::Phase::ElementAnimation)
00068 {
00069     return Phase::EaseInOutCurve;
00070 }
00071 
00072 QPixmap Animator::elementAppear(qreal frame, const QPixmap& pixmap)
00073 {
00074     Q_UNUSED(frame)
00075     return pixmap;
00076 }
00077 
00078 QPixmap Animator::elementDisappear(qreal frame, const QPixmap& pixmap)
00079 {
00080     Q_UNUSED(frame)
00081     QPixmap pix(pixmap.size());
00082     pix.fill(Qt::transparent);
00083 
00084     return pix;
00085 }
00086 
00087 void Animator::appear(qreal frame, QGraphicsItem* item)
00088 {
00089     Q_UNUSED(frame)
00090     Q_UNUSED(item)
00091 }
00092 
00093 void Animator::disappear(qreal frame, QGraphicsItem* item)
00094 {
00095     Q_UNUSED(frame)
00096     Q_UNUSED(item)
00097 }
00098 
00099 void Animator::activate(qreal frame, QGraphicsItem* item)
00100 {
00101     Q_UNUSED(frame)
00102     Q_UNUSED(item)
00103 }
00104 
00105 void Animator::frameAppear(qreal frame, QGraphicsItem* item, const QRegion& drawable)
00106 {
00107     Q_UNUSED(frame)
00108     Q_UNUSED(item)
00109     Q_UNUSED(drawable)
00110 }
00111 
00112 void Animator::slideIn(qreal progress, QGraphicsItem *item, const QPoint &start, const QPoint &destination)
00113 {
00114     double x = start.x() + (destination.x() - start.x()) * progress;
00115     double y = start.y() + (destination.y() - start.y()) * progress;
00116     item->setPos(x, y);
00117 }
00118 
00119 void Animator::slideOut(qreal progress, QGraphicsItem *item, const QPoint &start, const QPoint &destination)
00120 {
00121     //kDebug();
00122     double x = start.x() + (destination.x() - start.x()) * progress;
00123     double y = start.y() + (destination.y() - start.y()) * progress;
00124     item->setPos(x, y);
00125 }
00126 
00127 } // Plasma namespace
00128 
00129 #include "animator.moc"

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal