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) { switch (type) {
case FadeAnimation: case FadeAnimation:
if (AnimationScriptEngine::isAnimationRegistered("FadeAnimation")) {
result = create("FadeAnimation", parent);
} else {
result = new Plasma::FadeAnimation(parent); result = new Plasma::FadeAnimation(parent);
}
break; break;
case GrowAnimation: case GrowAnimation:
if (AnimationScriptEngine::isAnimationRegistered("GrowAnimation")) {
result = create("GrowAnimation", parent);
} else {
result = new Plasma::GrowAnimation(parent); result = new Plasma::GrowAnimation(parent);
}
break; break;
case PulseAnimation: case PulseAnimation:
if (AnimationScriptEngine::isAnimationRegistered("PulseAnimation")) {
result = create("PulseAnimation", parent);
} else {
result = new Plasma::PulseAnimation(parent); result = new Plasma::PulseAnimation(parent);
}
break; break;
case RotationAnimation: case RotationAnimation:
if (AnimationScriptEngine::isAnimationRegistered("RotationAnimation")) {
result = create("RotationAnimation", parent);
} else {
result = new Plasma::RotationAnimation(parent); result = new Plasma::RotationAnimation(parent);
}
break; break;
case RotationStackedAnimation: case RotationStackedAnimation:
if (AnimationScriptEngine::isAnimationRegistered("RotationStackedAnimation")) {
result = create("RotationStackedAnimation", parent);
} else {
result = new Plasma::RotationStackedAnimation(parent); result = new Plasma::RotationStackedAnimation(parent);
}
break; break;
case SlideAnimation: case SlideAnimation:
if (AnimationScriptEngine::isAnimationRegistered("SlideAnimation")) {
result = create("SlideAnimation", parent);
} else {
result = new Plasma::SlideAnimation(parent); result = new Plasma::SlideAnimation(parent);
}
break; break;
case GeometryAnimation: case GeometryAnimation:
if (AnimationScriptEngine::isAnimationRegistered("GeometryAnimation")) {
result = create("GeometryAnimation", parent);
} else {
result = new Plasma::GeometryAnimation(parent); result = new Plasma::GeometryAnimation(parent);
}
break; break;
case ZoomAnimation: case ZoomAnimation:
if (AnimationScriptEngine::isAnimationRegistered("ZoomAnimation")) {
result = create("ZoomAnimation", parent);
} else {
result = new Plasma::ZoomAnimation(parent); result = new Plasma::ZoomAnimation(parent);
}
break; break;
case PixmapTransitionAnimation: case PixmapTransitionAnimation:
if (AnimationScriptEngine::isAnimationRegistered("PixmapTransitionAnimation")) {
result = create("PixmapTransitionAnimation", parent);
} else {
result = new Plasma::PixmapTransition(parent); result = new Plasma::PixmapTransition(parent);
}
break; break;
case WaterAnimation: case WaterAnimation:
if (AnimationScriptEngine::isAnimationRegistered("WaterAnimation")) {
result = create("WaterAnimation", parent);
} else {
result = new Plasma::WaterAnimation(parent); result = new Plasma::WaterAnimation(parent);
}
break; break;
default: default:
kDebug() << "Unsupported animation type."; //kDebug() << "Unsupported animation type.";
break;
} }
return result; return result;