diff --git a/scriptengines/javascript/CMakeLists.txt b/scriptengines/javascript/CMakeLists.txt index d4067946a..1807f2890 100644 --- a/scriptengines/javascript/CMakeLists.txt +++ b/scriptengines/javascript/CMakeLists.txt @@ -2,6 +2,7 @@ set(simple_javascript_engine_SRCS simplejavascriptapplet.cpp + simplebindings/animationgroup.cpp simplebindings/appletinterface.cpp simplebindings/anchorlayout.cpp simplebindings/color.cpp diff --git a/scriptengines/javascript/simplebindings/animationgroup.cpp b/scriptengines/javascript/simplebindings/animationgroup.cpp new file mode 100644 index 000000000..0a372709e --- /dev/null +++ b/scriptengines/javascript/simplebindings/animationgroup.cpp @@ -0,0 +1,85 @@ +#include "animationgroup.h" + + +ParallelAnimationGroup::ParallelAnimationGroup(QObject *parent) + : QParallelAnimationGroup(parent) +{ +} + +void ParallelAnimationGroup::addAnimation(QAbstractAnimation *animation) +{ + QParallelAnimationGroup::addAnimation(animation); +} + +QAbstractAnimation *ParallelAnimationGroup::animationAt(int index) const +{ + return QParallelAnimationGroup::animationAt(index); +} + +int ParallelAnimationGroup::animationCount() const +{ + return QParallelAnimationGroup::animationCount(); +} + +void ParallelAnimationGroup::clearAnimations() +{ + QParallelAnimationGroup::clearAnimations(); +} + +int ParallelAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const +{ + return QParallelAnimationGroup::indexOfAnimation(animation); +} + +void ParallelAnimationGroup::insertAnimationAt(int index, QAbstractAnimation *animation) +{ + QParallelAnimationGroup::insertAnimationAt(index, animation); +} + +void ParallelAnimationGroup::removeAnimation(QAbstractAnimation *animation) +{ + QParallelAnimationGroup::removeAnimation(animation); +} + + +SequentialAnimationGroup::SequentialAnimationGroup(QObject *parent) + : QSequentialAnimationGroup(parent) +{ +} + +void SequentialAnimationGroup::addAnimation(QAbstractAnimation *animation) +{ + QSequentialAnimationGroup::addAnimation(animation); +} + +QAbstractAnimation *SequentialAnimationGroup::animationAt(int index) const +{ + return QSequentialAnimationGroup::animationAt(index); +} + +int SequentialAnimationGroup::animationCount() const +{ + return QSequentialAnimationGroup::animationCount(); +} + +void SequentialAnimationGroup::clearAnimations() +{ + QSequentialAnimationGroup::clearAnimations(); +} + +int SequentialAnimationGroup::indexOfAnimation(QAbstractAnimation *animation) const +{ + return QSequentialAnimationGroup::indexOfAnimation(animation); +} + +void SequentialAnimationGroup::insertAnimationAt(int index, QAbstractAnimation *animation) +{ + QSequentialAnimationGroup::insertAnimationAt(index, animation); +} + +void SequentialAnimationGroup::removeAnimation(QAbstractAnimation *animation) +{ + QSequentialAnimationGroup::removeAnimation(animation); +} + +#include "animationgroup.moc" diff --git a/scriptengines/javascript/simplebindings/animationgroup.h b/scriptengines/javascript/simplebindings/animationgroup.h new file mode 100644 index 000000000..87d32b08a --- /dev/null +++ b/scriptengines/javascript/simplebindings/animationgroup.h @@ -0,0 +1,42 @@ +#ifndef ANIMATIONGROUP_H +#define ANIMATIONGROUP_H + +#include +#include + +class ParallelAnimationGroup : public QParallelAnimationGroup +{ + Q_OBJECT + +public: + ParallelAnimationGroup(QObject *parent); + +public Q_SLOTS: + void addAnimation(QAbstractAnimation * animation); + QAbstractAnimation *animationAt(int index) const; + int animationCount() const; + void clearAnimations(); + int indexOfAnimation(QAbstractAnimation *animation) const; + void insertAnimationAt(int index, QAbstractAnimation * animation); + void removeAnimation(QAbstractAnimation * animation); +}; + +class SequentialAnimationGroup : public QSequentialAnimationGroup +{ + Q_OBJECT + +public: + SequentialAnimationGroup(QObject *parent); + +public Q_SLOTS: + void addAnimation(QAbstractAnimation * animation); + QAbstractAnimation *animationAt(int index) const; + int animationCount() const; + void clearAnimations(); + int indexOfAnimation(QAbstractAnimation *animation) const; + void insertAnimationAt(int index, QAbstractAnimation * animation); + void removeAnimation(QAbstractAnimation * animation); +}; + +#endif + diff --git a/scriptengines/javascript/simplejavascriptapplet.cpp b/scriptengines/javascript/simplejavascriptapplet.cpp index dc5ed2371..e0e10aeed 100644 --- a/scriptengines/javascript/simplejavascriptapplet.cpp +++ b/scriptengines/javascript/simplejavascriptapplet.cpp @@ -45,6 +45,7 @@ #include #include +#include "simplebindings/animationgroup.h" #include "simplebindings/appletinterface.h" #include "simplebindings/filedialogproxy.h" @@ -740,14 +741,14 @@ QScriptValue SimpleJavaScriptApplet::animation(QScriptContext *context, QScriptE QScriptValue SimpleJavaScriptApplet::animationGroup(QScriptContext *context, QScriptEngine *engine) { QGraphicsWidget *parent = extractParent(context, engine); - QSequentialAnimationGroup *group = new QSequentialAnimationGroup(parent); + SequentialAnimationGroup *group = new SequentialAnimationGroup(parent); return engine->newQObject(group); } QScriptValue SimpleJavaScriptApplet::parallelAnimationGroup(QScriptContext *context, QScriptEngine *engine) { QGraphicsWidget *parent = extractParent(context, engine); - QParallelAnimationGroup *group = new QParallelAnimationGroup(parent); + ParallelAnimationGroup *group = new ParallelAnimationGroup(parent); return engine->newQObject(group); }