aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2020-04-24 17:53:28 -0400
committerKen Moore <moorekou@gmail.com>2020-04-24 17:55:02 -0400
commitbf545b933bcb59a695702ecfcc7b1fa5f07fa557 (patch)
tree1030e63496788315e279b3c50f59ded8e370afb8 /src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp
parentDisable xscreensaver from auto-start. (diff)
downloadlumina-bf545b933bcb59a695702ecfcc7b1fa5f07fa557.tar.gz
lumina-bf545b933bcb59a695702ecfcc7b1fa5f07fa557.tar.bz2
lumina-bf545b933bcb59a695702ecfcc7b1fa5f07fa557.zip
Initial merge of the screensaver into the main lumina-desktop builds
Diffstat (limited to 'src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp b/src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp
new file mode 100644
index 00000000..9b095fe4
--- /dev/null
+++ b/src-qt5/core/lumina-desktop/src-screensaver/animations/BaseAnimGroup.cpp
@@ -0,0 +1,51 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2015-2017, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+#include "BaseAnimGroup.h"
+
+//Include all the known subclasses here, then add a unique ID for it to the functions at the bottom
+//#include "SampleAnimation.h"
+#include "Fireflies.h"
+#include "Grav.h"
+#include "SampleAnimation.h"
+#include "Text.h"
+#include "ImageSlideshow.h"
+#include "VideoSlideshow.h"
+
+
+QVariant BaseAnimGroup::readSetting(QString variable, QVariant defaultvalue){
+ return DesktopSettings::instance()->value(DesktopSettings::ScreenSaver,
+ "Animations/"+animPlugin+"/"+variable, defaultvalue);
+}
+
+//==============================
+// PLUGIN LOADING/LISTING
+//==============================
+BaseAnimGroup* BaseAnimGroup::NewAnimation(QString type, QWidget *parent){
+ //This is where we place all the known plugin ID's, and load the associated subclass
+ BaseAnimGroup *anim = 0;
+ if(type=="fireflies"){
+ anim = new FirefliesAnimation(parent);
+ }else if(type == "grav") {
+ anim = new GravAnimation(parent);
+ }else if(type == "text") {
+ anim = new TextAnimation(parent);
+ }else if(type == "imageSlideshow") {
+ anim = new ImageAnimation(parent);
+ }else if(type == "videoSlideshow") {
+ anim = new VideoAnimation(parent);
+ }else {
+ //Unknown screensaver, return a blank animation group
+ anim = new BaseAnimGroup(parent);
+ }
+ //tag the animation with the type it is and return it
+ if(anim!=0){ anim->animPlugin = type; }
+ return anim;
+}
+
+QStringList BaseAnimGroup::KnownAnimations(){
+ return (QStringList() << "none" << "grav" << "text" << "imageSlideshow" << "videoSlideshow" << "fireflies");
+}
bgstack15