aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-cpp/plugins-screensaver.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-10-10 15:29:13 -0400
committerKen Moore <ken@ixsystems.com>2017-10-10 15:29:13 -0400
commit7dd1ca13749571408725ac45e8d1e1d3bbf7c798 (patch)
treeb5158dad070bfd932fc82ff735bb47e74644fce9 /src-qt5/src-cpp/plugins-screensaver.h
parentCleanup a lot of stale/unused files within the Lumina2 souce tree. (diff)
downloadlumina-7dd1ca13749571408725ac45e8d1e1d3bbf7c798.tar.gz
lumina-7dd1ca13749571408725ac45e8d1e1d3bbf7c798.tar.bz2
lumina-7dd1ca13749571408725ac45e8d1e1d3bbf7c798.zip
Write up the new ScreenSaver plugins management class (untested)
Also cleanup a bit more of the documentation for the new plugin system.
Diffstat (limited to 'src-qt5/src-cpp/plugins-screensaver.h')
-rw-r--r--src-qt5/src-cpp/plugins-screensaver.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/src-qt5/src-cpp/plugins-screensaver.h b/src-qt5/src-cpp/plugins-screensaver.h
new file mode 100644
index 00000000..9a7e98f5
--- /dev/null
+++ b/src-qt5/src-cpp/plugins-screensaver.h
@@ -0,0 +1,50 @@
+//===========================================
+// Lumina-desktop source code
+// Copyright (c) 2017, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This is a simple class for managing all the various desktop
+// screensaver plugins that could be available
+//===========================================
+// NOTE:
+// This class has a heirarchy-based lookup system
+// USER plugins > SYSTEM plugins
+// XDG_DATA_HOME/lumina-desktop/screensavers > XDG_DATA_DIRS/lumina-desktop/screensavers
+//===========================================
+#ifndef _LUMINA_DESKTOP_SCREENSAVER_PLUGINS_CLASS_H
+#define _LUMINA_DESKTOP_SCREENSAVER_PLUGINS_CLASS_H
+
+#include <QJsonObject>
+#include <QString>
+#include <QUrl>
+#include <QObject>
+
+class SSPlugin{
+private:
+ QString currentfile;
+
+public:
+ QJsonObject data; //Hazardous to manually modify
+
+ SSPlugin();
+ ~SSPlugin();
+
+ void loadFile(QString path);
+ bool isLoaded();
+
+ bool isValid();
+
+ QString translatedName();
+ QString translatedDescription();
+ QUrl scriptURL();
+};
+
+class SSPluginSystem{
+public:
+ static SSPlugin findPlugin(QString name);
+ static QList<SSPlugin> findAllPlugins(bool validonly = true);
+
+};
+
+#endif
bgstack15