• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
  • deprecated
animationdriver.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2007 Aaron Seigo <aseigo@kde.org>
3 * 2007 Alexis Ménard <darktears31@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Library General Public License as
7 * published by the Free Software Foundation; either version 2, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#include "animationdriver.h"
22
23#include <QPainter>
24#include <QGraphicsItem>
25
26namespace Plasma
27{
28
29AnimationDriver::AnimationDriver(QObject *parent)
30 : QObject(parent),
31 d(0)
32{
33}
34
35AnimationDriver::~AnimationDriver()
36{
37}
38
39int AnimationDriver::animationFps(Plasma::Animator::Animation animation) const
40{
41 Q_UNUSED(animation)
42 return 0;
43}
44
45int AnimationDriver::movementAnimationFps(Plasma::Animator::Movement movement) const
46{
47 Q_UNUSED(movement)
48 return 40;
49}
50
51int AnimationDriver::elementAnimationFps(Plasma::Animator::Animation animation) const
52{
53 Q_UNUSED(animation)
54 return 0;
55}
56
57int AnimationDriver::animationDuration(Plasma::Animator::Animation) const
58{
59 return 200;
60}
61
62int AnimationDriver::movementAnimationDuration(Plasma::Animator::Movement movement) const
63{
64 switch (movement) {
65 case Animator::FastSlideInMovement:
66 case Animator::FastSlideOutMovement:
67 return 150;
68 break;
69 default:
70 break;
71 }
72
73 return 250;
74}
75
76int AnimationDriver::elementAnimationDuration(Plasma::Animator::Animation) const
77{
78 return 333;
79}
80
81Animator::CurveShape AnimationDriver::animationCurve(Plasma::Animator::Animation) const
82{
83 return Animator::EaseInOutCurve;
84}
85
86Animator::CurveShape AnimationDriver::movementAnimationCurve(Plasma::Animator::Movement) const
87{
88 return Animator::EaseInOutCurve;
89}
90
91Animator::CurveShape AnimationDriver::elementAnimationCurve(Plasma::Animator::Animation) const
92{
93 return Animator::EaseInOutCurve;
94}
95
96QPixmap AnimationDriver::elementAppear(qreal progress, const QPixmap &pixmap)
97{
98 Q_UNUSED(progress)
99 return pixmap;
100}
101
102QPixmap AnimationDriver::elementDisappear(qreal progress, const QPixmap &pixmap)
103{
104 Q_UNUSED(progress)
105 QPixmap pix(pixmap.size());
106 pix.fill(Qt::transparent);
107
108 return pix;
109}
110
111void AnimationDriver::itemAppear(qreal frame, QGraphicsItem *item)
112{
113 Q_UNUSED(frame)
114 Q_UNUSED(item)
115}
116
117void AnimationDriver::itemDisappear(qreal frame, QGraphicsItem *item)
118{
119 Q_UNUSED(frame)
120 Q_UNUSED(item)
121}
122
123void AnimationDriver::itemActivated(qreal frame, QGraphicsItem *item)
124{
125 Q_UNUSED(frame)
126 Q_UNUSED(item)
127}
128
129void AnimationDriver::itemSlideIn(qreal progress, QGraphicsItem *item, const QPoint &start, const QPoint &destination)
130{
131 double x = start.x() + (destination.x() - start.x()) * progress;
132 double y = start.y() + (destination.y() - start.y()) * progress;
133 item->setPos(x, y);
134}
135
136void AnimationDriver::itemSlideOut(qreal progress, QGraphicsItem *item, const QPoint &start, const QPoint &destination)
137{
138 //kDebug();
139 double x = start.x() + (destination.x() - start.x()) * progress;
140 double y = start.y() + (destination.y() - start.y()) * progress;
141 item->setPos(x, y);
142}
143
144} // Plasma namespace
145
146#include "../animationdriver.moc"
animationdriver.h
Plasma::Animator::Movement
Movement
Definition: animator.h:81
Plasma::Animator::FastSlideOutMovement
@ FastSlideOutMovement
Definition: animator.h:85
Plasma::Animator::FastSlideInMovement
@ FastSlideInMovement
Definition: animator.h:84
Plasma::Animator::CurveShape
CurveShape
Definition: animator.h:73
Plasma::Animator::EaseInOutCurve
@ EaseInOutCurve
Definition: animator.h:76
Plasma::Animator::Animation
Animation
Definition: animator.h:55
QObject
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal