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

Plasma

pendulumcurve.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010 Bruno Abinader <bruno.abinader@indt.org.br>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #include "pendulumcurve_p.h"
00019 
00025 static qreal pendulumFunction(qreal progress)
00026 {
00027     if (progress <= 0.25) {
00028         progress *= 4;
00029     } else if (progress <= 0.50) {
00030         progress -= 0.25;
00031         progress *= 4;
00032         progress = 1 - progress;
00033     } else if (progress <= 0.75) {
00034         progress -= 0.50;
00035         progress *= -4;
00036     } else {
00037         progress -= 0.75;
00038         progress *= 4;
00039         progress = 1 - progress;
00040         progress *= -1;
00041     }
00042     return progress;
00043 }
00044 
00045 namespace Plasma
00046 {
00047 
00048 PendulumCurve::PendulumCurve()
00049     : QEasingCurve()
00050 {
00051     setCustomType(pendulumFunction);
00052 }
00053 
00054 } // namespace Plasma

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • 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
Generated for kdelibs by doxygen 1.7.3
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