File indexing completed on 2024-04-14 03:58:52
0001 /* 0002 * Copyright 1999 by Martin R. Jones <mjones@kde.org> 0003 * Copyright 2010 by Stefan Böhmann <kde@hilefoks.org> 0004 * 0005 * This program is free software; you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation; either version 2 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program; if not, write to the Free Software 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef AMORANIMATION_H 0020 #define AMORANIMATION_H 0021 0022 #include <QPoint> 0023 #include <QSize> 0024 #include <QStringList> 0025 #include <QVector> 0026 0027 class QPixmap; 0028 class QSettings; 0029 0030 class AmorAnimation 0031 { 0032 public: 0033 explicit AmorAnimation(const QSettings *config); 0034 0035 void reset(); 0036 bool next(); 0037 int frameNum() const; 0038 bool validFrame() const; 0039 int totalMovement() const; 0040 QSize maximumSize() const; 0041 0042 int delay() const; 0043 QPoint hotspot() const; 0044 int movement() const; 0045 0046 const QPixmap *frame(); 0047 0048 protected: 0049 void readConfig(const QSettings *config); 0050 0051 protected: 0052 int mCurrent; // current frame in sequence 0053 QStringList mSequence; // sequence of images to display 0054 QVector<int> mDelay; // delay between frames 0055 QVector<QPoint> mHotspot; // the hotspot in a frame 0056 QVector<int> mMovement; // the distance to move between frames 0057 int mTotalMovement; // the total distance this animation moves 0058 QSize mMaximumSize; // the maximum size of any frame 0059 }; 0060 0061 0062 #endif 0063 0064 // kate: word-wrap off; encoding utf-8; indent-width 4; tab-width 4; line-numbers on; mixed-indent off; remove-trailing-space-save on; replace-tabs-save on; replace-tabs on; space-indent on; 0065 // vim:set spell et sw=4 ts=4 nowrap cino=l1,cs,U1: