summaryrefslogtreecommitdiffhomepage
path: root/opentrack/plugin-support.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-10-19 16:08:46 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-10-19 18:28:08 +0200
commitdd87370ff2818ee3c3d67ba104405b85ee44daba (patch)
treed5ebdf22aaccd0e345ce7a7c2ecb7b7193ea0791 /opentrack/plugin-support.h
parent7e2e341c45b86f76e08d74e056929ad76ff1a383 (diff)
decruft more
Diffstat (limited to 'opentrack/plugin-support.h')
-rw-r--r--opentrack/plugin-support.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/opentrack/plugin-support.h b/opentrack/plugin-support.h
new file mode 100644
index 00000000..238aeb53
--- /dev/null
+++ b/opentrack/plugin-support.h
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "plugin-api.hpp"
+
+#include <QWidget>
+#include <QDebug>
+#include <QString>
+#include <QLibrary>
+#include <QFrame>
+#include <QList>
+
+#include <memory>
+template<typename t> using ptr = std::shared_ptr<t>;
+
+extern "C" typedef void* (*CTOR_FUNPTR)(void);
+extern "C" typedef Metadata* (*METADATA_FUNPTR)(void);
+
+struct dylib {
+ enum Type { Filter, Tracker, Protocol };
+
+ dylib(const QString& filename, Type t);
+ ~dylib();
+ static QList<ptr<dylib>> enum_libraries();
+
+ Type type;
+ QString filename;
+
+ QIcon icon;
+ QString name;
+
+ CTOR_FUNPTR Dialog;
+ CTOR_FUNPTR Constructor;
+ METADATA_FUNPTR Meta;
+private:
+#if defined(_WIN32)
+ QLibrary* handle;
+#else
+ void* handle;
+#endif
+};
+
+struct SelectedLibraries {
+ using dylibtr = ptr<dylib>;
+ ptr<ITracker> pTracker;
+ ptr<IFilter> pFilter;
+ ptr<IProtocol> pProtocol;
+ SelectedLibraries(QFrame* frame, dylibtr t, dylibtr p, dylibtr f);
+ SelectedLibraries() : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) {}
+ ~SelectedLibraries();
+ bool correct;
+}; \ No newline at end of file