4
#define MANAGER_VERSION 1 // TODO: Define here the pluginManager version !!! (In pluginManager.h)
5
#define PLUGIN_NAME "iComic" // TODO: Define here the plugin Name
11
10
#include <algorithm>
14
//#include "../gloobus-preview-plugin-manager.h"
14
15
#include "../gloobus-preview-interface-document.h"
16
17
using namespace std;
48
// ============================ Class factories======================================== //
49
// This is "allways the same" code, just change the plugin name in the printf and the
51
extern "C" iDocument* create() {
49
extern "C" interface * create() {
55
extern "C" void destroy(iDocument* p) {
53
extern "C" void destroy(interface * p) {
59
extern "C" int getVersion(){ //To save crashes from older versions
57
extern "C" int getVersion() {
60
58
return MANAGER_VERSION;
63
// ============================== REGISTER ============================================ //
64
// Here is where we register the new plugin, what we do is to add a map with the plugin
65
// name and the mime file types it can load, then, the pluginManager will take care of wich
66
// plugin load, depending on its file type. Just add more than one file type adding this
67
// two lines as many times you want.
69
// itself.filetype = "image/bmp"; // Add another extension supported
70
// pluginVector.push_back(itself); // Add filetype that plugin reads
78
//TODO: Add here the mime filetypes that plugin supports
79
//plugin_filetype itself = {PLUGIN_NAME,EXTENSION,TYPE,PRIORITY}
81
plugin_filetype itself = { PLUGIN_NAME, "application/x-cbz","document",1}; // Initial filetype
83
factory_document[itself.name] = create; // Register the plugin
84
factoryDestroy_document[itself.name] = destroy; // Function for destroy this plugin class
85
pluginVector.push_back(itself); // Add filetype that plugin reads
87
itself.filetype = "application/x-cbr"; // Add another extension supported
88
pluginVector.push_back(itself); // Add filetype that plugin reads
92
proxy p; // When we open the dll with RTLD_NOW it creates p, and in consequence, it registers the plugin
65
PluginManager::register_plugin("comic");
67
PluginManager::register_filetype("application/x-cbz", 1);
68
PluginManager::register_filetype("application/x-cbr", 1);