loader.cpp revision d7b377e29fd939182183ba6998bdf56d66a7f78c
/*
* Loader for external plug-ins.
*
* Authors:
* Moritz Eberl <moritz@semiodesk.com>
*
* Copyright (C) 2016 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "loader.h"
#include "system.h"
#include <exception>
#include <string.h>
#include "dependency.h"
#include "inkscape-version.h"
namespace Inkscape {
namespace Extension {
typedef const gchar *(*_getInkscapeVersion)(void);
{
return false;
}
return true;
}
/**
* @brief Load the actual implementation of a plugin supplied by the plugin.
* @param doc The xml representation of the INX extension configuration.
* @return The implementation of the extension loaded from the plugin.
*/
{
try {
// Iterate over the xml content
while (child_repr != NULL) {
}
// Deal with dependencies if we have them
// try to load it
if( !success ){
// Could not load dependency, we abort
const char *res = g_module_error();
return NULL;
}
}
// Found a plugin to load
// The name of the plugin is actually the library file we want to load
// build the path where to look for the plugin
// we were not able to load the plugin, write warning and abort
const char *res = g_module_error();
return NULL;
}
// Get a handle to the version function of the module
// This didn't work, write warning and abort
const char *res = g_module_error();
return NULL;
}
// Get a handle to the function that delivers the implementation
// This didn't work, write warning and abort
const char *res = g_module_error();
return NULL;
}
// Get version and test against this version
// The versions are different, display warning.
g_warning("Plugin was built against Inkscape version %s, this is %s. The plugin might not be compatible.", version, version_string);
}
return i;
}
}
}
g_warning("Unable to load extension.");
}
return NULL;
}
} // namespace Extension
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace .0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim:filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99: