From dd87370ff2818ee3c3d67ba104405b85ee44daba Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 19 Oct 2014 16:08:46 +0200 Subject: decruft more --- opentrack/plugin-support.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 opentrack/plugin-support.h (limited to 'opentrack/plugin-support.h') 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 +#include +#include +#include +#include +#include + +#include +template using ptr = std::shared_ptr; + +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> 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; + ptr pTracker; + ptr pFilter; + ptr 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 -- cgit v1.2.3