blob: ad3f2af87b5ce3b9e580e449c5ac8d8c61428a98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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 mem = 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<mem<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 dylibptr = mem<dylib>;
mem<ITracker> pTracker;
mem<IFilter> pFilter;
mem<IProtocol> pProtocol;
SelectedLibraries(QFrame* frame, dylibptr t, dylibptr p, dylibptr f);
SelectedLibraries() : pTracker(nullptr), pFilter(nullptr), pProtocol(nullptr), correct(false) {}
~SelectedLibraries();
bool correct;
};
|