summaryrefslogtreecommitdiffhomepage
path: root/facetracknoir/plugin-support.h
blob: b539d152197f42c5704e4900b9e29263b386756d (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
52
53
54
55
#pragma once

#include "facetracknoir/plugin-api.hpp"

#include <QWidget>
#include <QDebug>
#include <QString>
#include <QLibrary>
#include <QFrame>

class IDynamicLibraryProvider;

struct SelectedLibraries {
public:
    ITracker* pTracker;
    IFilter* pFilter;
    IProtocol* pProtocol;
    SelectedLibraries(IDynamicLibraryProvider* main = NULL);
    ~SelectedLibraries();
    bool correct;
};

extern SelectedLibraries* Libraries;

struct Metadata;

extern "C" typedef void* (*CTOR_FUNPTR)(void);
extern "C" typedef Metadata* (*METADATA_FUNPTR)(void);
extern "C" typedef void* (*DIALOG_FUNPTR)(void);

class DynamicLibrary {
public:
    DynamicLibrary(const QString& filename);
    ~DynamicLibrary();
    DIALOG_FUNPTR Dialog;
    CTOR_FUNPTR Constructor;
    METADATA_FUNPTR Metadata;
    QString filename;
private:
#if defined(_WIN32)
    QLibrary* handle;
#else
    void* handle;
#endif
};


// XXX TODO it can die if running tracker state separated into class -sh 20141004
class IDynamicLibraryProvider {
public:
    virtual DynamicLibrary* current_tracker1() = 0;
    virtual DynamicLibrary* current_protocol() = 0;
    virtual DynamicLibrary* current_filter() = 0;
    virtual QFrame* get_video_widget() = 0;
};