Plasma
Go to the documentation of this file.
19 #include "private/animator_p.h"
24 #include "animations/animationscriptengine_p.h"
25 #include "animations/fade_p.h"
26 #include "animations/grow_p.h"
27 #include "animations/pulser_p.h"
28 #include "animations/rotation_p.h"
29 #include "animations/slide_p.h"
30 #include "animations/rotationstacked_p.h"
31 #include "animations/geometry_p.h"
32 #include "animations/zoom_p.h"
33 #include "animations/pixmaptransition_p.h"
34 #include "animations/water_p.h"
35 #include "animations/pendulumcurve_p.h"
36 #include "animations/javascriptanimation_p.h"
42 QHash<Animator::Animation, Animator::Animation> AnimatorPrivate::s_stockAnimMappings;
43 QHash<Animator::Animation, QString> AnimatorPrivate::s_loadableAnimMappings;
51 s_loadableAnimMappings.remove(from);
52 s_stockAnimMappings.insert(from, to);
57 s_stockAnimMappings.remove(from);
58 s_loadableAnimMappings.insert(from, to);
63 if (AnimatorPrivate::s_stockAnimMappings.contains(
type)) {
64 return create(AnimatorPrivate::s_stockAnimMappings.value(
type));
65 }
else if (AnimatorPrivate::s_loadableAnimMappings.contains(
type)) {
66 const QString anim = AnimatorPrivate::s_loadableAnimMappings.value(
type);
67 return create(anim, parent);
74 result =
create(
"FadeAnimation", parent);
76 result =
new Plasma::FadeAnimation(parent);
81 result =
create(
"GrowAnimation", parent);
83 result =
new Plasma::GrowAnimation(parent);
88 result =
create(
"PulseAnimation", parent);
90 result =
new Plasma::PulseAnimation(parent);
95 result =
create(
"RotationAnimation", parent);
97 result =
new Plasma::RotationAnimation(parent);
102 result =
create(
"RotationStackedAnimation", parent);
104 result =
new Plasma::RotationStackedAnimation(parent);
109 result =
create(
"SlideAnimation", parent);
111 result =
new Plasma::SlideAnimation(parent);
116 result =
create(
"GeometryAnimation", parent);
118 result =
new Plasma::GeometryAnimation(parent);
123 result =
create(
"ZoomAnimation", parent);
125 result =
new Plasma::ZoomAnimation(parent);
130 result =
create(
"PixmapTransitionAnimation", parent);
132 result =
new Plasma::PixmapTransition(parent);
137 result =
create(
"WaterAnimation", parent);
139 result =
new Plasma::WaterAnimation(parent);
157 result.setType(QEasingCurve::InQuad);
161 result.setType(QEasingCurve::OutQuad);
165 result.setType(QEasingCurve::InOutQuad);
169 result.setType(QEasingCurve::Linear);
173 result = PendulumCurve();
177 kDebug() <<
"Unsupported easing curve type.";
192 if (path.isEmpty()) {
210 return new Plasma::JavascriptAnimation(anim, parent);
215 #include <animator.moc>
Abstract representation of a single animation.
bool isAnimationRegistered(const QString &anim)
Namespace for everything in libplasma.
bool loadScript(const QString &path, const QString &prefix)
Q_INVOKABLE QString animationPath(const QString &name) const
Retrieves the path for the script file that contains a given Javascript animation.
@ RotationStackedAnimation
static Theme * defaultTheme()
Singleton pattern accessor.
void addToLoadFailures(const QString &anim)
static Plasma::Animation * create(Animator::Animation type, QObject *parent=0)
Factory to build new animation objects.
bool animationFailedToLoad(const QString &anim)
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
@ PixmapTransitionAnimation
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 27 2020 00:00:00 by
doxygen 1.8.20 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.