diff --git a/applethandle_p.h b/applethandle_p.h index 30780cff5..e64ef94d9 100644 --- a/applethandle_p.h +++ b/applethandle_p.h @@ -87,7 +87,7 @@ class AppletHandle : public QObject, public QGraphicsItem Applet *m_applet; qreal m_opacity; FadeType m_anim; - Phase::AnimId m_animId; + int m_animId; qreal m_angle; qreal m_tempAngle; qreal m_scaleWidth; diff --git a/desktoptoolbox.cpp b/desktoptoolbox.cpp index 18a9e8d69..a6fe14850 100644 --- a/desktoptoolbox.cpp +++ b/desktoptoolbox.cpp @@ -89,7 +89,7 @@ public: KIcon icon; EmptyGraphicsItem *toolBacker; QTime stopwatch; - Plasma::Phase::AnimId animId; + int animId; qreal animFrame; }; diff --git a/paneltoolbox.cpp b/paneltoolbox.cpp index 734ac0d4a..c88681441 100644 --- a/paneltoolbox.cpp +++ b/paneltoolbox.cpp @@ -88,7 +88,7 @@ public: KIcon icon; EmptyGraphicsItem *toolBacker; QTime stopwatch; - Plasma::Phase::AnimId animId; + int animId; qreal animFrame; }; diff --git a/phase.cpp b/phase.cpp index 41407b0e6..159db7b41 100644 --- a/phase.cpp +++ b/phase.cpp @@ -82,7 +82,7 @@ struct CustomAnimationState int currentFrame; int interval; int currentInterval; - Phase::AnimId id; + int id; QObject* receiver; char* slot; }; @@ -104,7 +104,7 @@ class Phase::Private qDeleteAll(animatedElements); qDeleteAll(movingItems); - QMutableMapIterator it(customAnims); + QMutableMapIterator it(customAnims); while (it.hasNext()) { delete it.value()->slot; delete it.value(); @@ -171,8 +171,8 @@ class Phase::Private // and really making the code fun ;) QMap animatedItems; QMap movingItems; - QMap animatedElements; - QMap customAnims; + QMap animatedElements; + QMap customAnims; }; class PhaseSingleton @@ -230,7 +230,7 @@ void Phase::movingItemDestroyed(QObject* o) void Phase::animatedElementDestroyed(QObject* o) { - QMutableMapIterator it(d->animatedElements); + QMutableMapIterator it(d->animatedElements); while (it.hasNext()) { it.next(); if (it.value()->qobj == o) { @@ -242,7 +242,7 @@ void Phase::animatedElementDestroyed(QObject* o) void Phase::customAnimReceiverDestroyed(QObject* o) { - QMutableMapIterator it(d->customAnims); + QMutableMapIterator it(d->customAnims); while (it.hasNext()) { if (it.next().value()->receiver == o) { delete it.value()->slot; @@ -342,7 +342,7 @@ void Phase::moveItem(QGraphicsItem* item, Movement movement, const QPoint &desti } } -Phase::AnimId Phase::customAnimation(int frames, int duration, Phase::CurveShape curve, +int Phase::customAnimation(int frames, int duration, Phase::CurveShape curve, QObject* receiver, const char* slot) { if (frames < 1 || duration < 1 || !receiver || !slot) { @@ -378,9 +378,9 @@ Phase::AnimId Phase::customAnimation(int frames, int duration, Phase::CurveShape return state->id; } -void Phase::stopCustomAnimation(AnimId id) +void Phase::stopCustomAnimation(int id) { - QMap::iterator it = d->customAnims.find(id); + QMap::iterator it = d->customAnims.find(id); if (it != d->customAnims.end()) { delete [] it.value()->slot; delete it.value(); @@ -389,7 +389,7 @@ void Phase::stopCustomAnimation(AnimId id) //kDebug() << "stopCustomAnimation(AnimId " << id << ") done"; } -Phase::AnimId Phase::animateElement(QGraphicsItem *item, ElementAnimation animation) +int Phase::animateElement(QGraphicsItem *item, ElementAnimation animation) { //kDebug() << "startElementAnimation(AnimId " << animation << ")"; ElementAnimationState *state = new ElementAnimationState; @@ -430,9 +430,9 @@ Phase::AnimId Phase::animateElement(QGraphicsItem *item, ElementAnimation animat return state->id; } -void Phase::stopElementAnimation(AnimId id) +void Phase::stopElementAnimation(int id) { - QMap::iterator it = d->animatedElements.find(id); + QMap::iterator it = d->animatedElements.find(id); if (it != d->animatedElements.end()) { delete it.value(); d->animatedElements.erase(it); @@ -440,9 +440,9 @@ void Phase::stopElementAnimation(AnimId id) //kDebug() << "stopElementAnimation(AnimId " << id << ") done"; } -void Phase::setInitialPixmap(AnimId id, const QPixmap &pixmap) +void Phase::setInitialPixmap(int id, const QPixmap &pixmap) { - QMap::iterator it = d->animatedElements.find(id); + QMap::iterator it = d->animatedElements.find(id); if (it == d->animatedElements.end()) { kDebug() << "Phase::setInitialPixmap(" << id << ") found no entry for it!"; @@ -452,9 +452,9 @@ void Phase::setInitialPixmap(AnimId id, const QPixmap &pixmap) it.value()->pixmap = pixmap; } -QPixmap Phase::currentPixmap(AnimId id) +QPixmap Phase::currentPixmap(int id) { - QMap::const_iterator it = d->animatedElements.find(id); + QMap::const_iterator it = d->animatedElements.find(id); if (it == d->animatedElements.constEnd()) { //kDebug() << "Phase::currentPixmap(" << id << ") found no entry for it!"; diff --git a/phase.h b/phase.h index ce1c31bf0..9a50b92ba 100644 --- a/phase.h +++ b/phase.h @@ -72,8 +72,6 @@ public: FastSlideOutMovement }; - typedef int AnimId; - /** * Singleton accessor **/ @@ -99,7 +97,7 @@ public: * * @return an id that can be used to identify this animation. */ - Q_INVOKABLE AnimId customAnimation(int frames, int duration, Phase::CurveShape curve, + Q_INVOKABLE int customAnimation(int frames, int duration, Phase::CurveShape curve, QObject* receiver, const char* method); /** @@ -109,12 +107,12 @@ public: * * @arg id the id of the animation as returned by customAnimation */ - Q_INVOKABLE void stopCustomAnimation(AnimId id); + Q_INVOKABLE void stopCustomAnimation(int id); - Q_INVOKABLE AnimId animateElement(QGraphicsItem *obj, ElementAnimation); - Q_INVOKABLE void stopElementAnimation(AnimId id); - Q_INVOKABLE void setInitialPixmap(AnimId id, const QPixmap &pixmap); - Q_INVOKABLE QPixmap currentPixmap(AnimId id); + Q_INVOKABLE int animateElement(QGraphicsItem *obj, ElementAnimation); + Q_INVOKABLE void stopElementAnimation(int id); + Q_INVOKABLE void setInitialPixmap(int id, const QPixmap &pixmap); + Q_INVOKABLE QPixmap currentPixmap(int id); /** * Can be used to query if there are other animations happening. This way @@ -127,8 +125,8 @@ public: Q_SIGNALS: void animationFinished(QGraphicsItem *item, Plasma::Phase::Animation anim); void movementFinished(QGraphicsItem *item); - void elementAnimationFinished(Plasma::Phase::AnimId id); - void customAnimationFinished(Plasma::Phase::AnimId id); + void elementAnimationFinished(int id); + void customAnimationFinished(int id); protected: void timerEvent(QTimerEvent *event); diff --git a/widgets/icon.cpp b/widgets/icon.cpp index a4119940a..fbcd84101 100644 --- a/widgets/icon.cpp +++ b/widgets/icon.cpp @@ -230,7 +230,7 @@ bool IconAction::event(QEvent::Type type, const QPointF &pos) return false; } -Phase::AnimId IconAction::animationId() const +int IconAction::animationId() const { return m_animationId; } diff --git a/widgets/icon_p.h b/widgets/icon_p.h index 2b945ca93..65dd89e2f 100644 --- a/widgets/icon_p.h +++ b/widgets/icon_p.h @@ -51,7 +51,7 @@ public: void hide(); bool isVisible() const; - Phase::AnimId animationId() const; + int animationId() const; QAction* action() const; void paint(QPainter *painter) const; @@ -79,7 +79,7 @@ private: bool m_selected; bool m_visible; - Phase::AnimId m_animationId; + int m_animationId; }; @@ -171,7 +171,7 @@ public: QColor textColor; QColor shadowColor; bool m_fadeIn; - Phase::AnimId m_hoverAnimId; + int m_hoverAnimId; qreal m_hoverAlpha; QSizeF iconSize; QIcon icon;