2015-10-28 08:55:23 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2009 Adenilson Cavalcanti <adenilson.silva@idnt.org.br>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "animator.h"
|
|
|
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
|
|
|
#include "animations/animation.h"
|
|
|
|
#include "animations/fade_p.h"
|
|
|
|
#include "animations/pulser_p.h"
|
|
|
|
#include "animations/slide_p.h"
|
|
|
|
#include "animations/geometry_p.h"
|
|
|
|
#include "animations/zoom_p.h"
|
|
|
|
#include "animations/pixmaptransition_p.h"
|
|
|
|
#include "theme.h"
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
Plasma::Animation* Animator::create(Animator::Animation type, QObject *parent)
|
|
|
|
{
|
2024-04-16 23:31:47 +03:00
|
|
|
Plasma::Animation *result = nullptr;
|
2015-10-28 08:55:23 +02:00
|
|
|
|
|
|
|
switch (type) {
|
2021-07-29 17:16:43 +03:00
|
|
|
case FadeAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::FadeAnimation(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
2021-07-29 17:16:43 +03:00
|
|
|
case PulseAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::PulseAnimation(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
2021-07-29 17:16:43 +03:00
|
|
|
case SlideAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::SlideAnimation(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
2021-07-29 17:16:43 +03:00
|
|
|
case GeometryAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::GeometryAnimation(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
2021-07-29 17:16:43 +03:00
|
|
|
case ZoomAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::ZoomAnimation(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
2021-07-29 17:16:43 +03:00
|
|
|
case PixmapTransitionAnimation: {
|
2023-05-20 05:22:50 +03:00
|
|
|
result = new Plasma::PixmapTransition(parent);
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default: {
|
2023-05-20 05:22:50 +03:00
|
|
|
kWarning() << "Unsupported animation type" << type;
|
2021-07-29 17:16:43 +03:00
|
|
|
break;
|
2015-10-28 08:55:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Plasma
|
|
|
|
|
|
|
|
#include "moc_animator.cpp"
|
|
|
|
|