catch mappings of js to stock anims

svn path=/trunk/KDE/kdelibs/; revision=1120258
This commit is contained in:
Aaron J. Seigo 2010-04-28 18:10:01 +00:00
parent 30551fb5c6
commit cea78a8dd1

View File

@ -71,47 +71,88 @@ Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent)
switch (type) {
case FadeAnimation:
if (AnimationScriptEngine::isAnimationRegistered("FadeAnimation")) {
result = create("FadeAnimation", parent);
} else {
result = new Plasma::FadeAnimation(parent);
}
break;
case GrowAnimation:
if (AnimationScriptEngine::isAnimationRegistered("GrowAnimation")) {
result = create("GrowAnimation", parent);
} else {
result = new Plasma::GrowAnimation(parent);
}
break;
case PulseAnimation:
if (AnimationScriptEngine::isAnimationRegistered("PulseAnimation")) {
result = create("PulseAnimation", parent);
} else {
result = new Plasma::PulseAnimation(parent);
}
break;
case RotationAnimation:
if (AnimationScriptEngine::isAnimationRegistered("RotationAnimation")) {
result = create("RotationAnimation", parent);
} else {
result = new Plasma::RotationAnimation(parent);
}
break;
case RotationStackedAnimation:
if (AnimationScriptEngine::isAnimationRegistered("RotationStackedAnimation")) {
result = create("RotationStackedAnimation", parent);
} else {
result = new Plasma::RotationStackedAnimation(parent);
}
break;
case SlideAnimation:
if (AnimationScriptEngine::isAnimationRegistered("SlideAnimation")) {
result = create("SlideAnimation", parent);
} else {
result = new Plasma::SlideAnimation(parent);
}
break;
case GeometryAnimation:
if (AnimationScriptEngine::isAnimationRegistered("GeometryAnimation")) {
result = create("GeometryAnimation", parent);
} else {
result = new Plasma::GeometryAnimation(parent);
}
break;
case ZoomAnimation:
if (AnimationScriptEngine::isAnimationRegistered("ZoomAnimation")) {
result = create("ZoomAnimation", parent);
} else {
result = new Plasma::ZoomAnimation(parent);
}
break;
case PixmapTransitionAnimation:
if (AnimationScriptEngine::isAnimationRegistered("PixmapTransitionAnimation")) {
result = create("PixmapTransitionAnimation", parent);
} else {
result = new Plasma::PixmapTransition(parent);
}
break;
case WaterAnimation:
if (AnimationScriptEngine::isAnimationRegistered("WaterAnimation")) {
result = create("WaterAnimation", parent);
} else {
result = new Plasma::WaterAnimation(parent);
}
break;
default:
kDebug() << "Unsupported animation type.";
//kDebug() << "Unsupported animation type.";
break;
}
return result;