![]() |
![]() |
![]() |
![]() |
A PluginLoader has to implement the interface described here for GPlugin to be able to use it to load plugins.
GSList *
gplugin_loader_class_get_supported_extensions
(GPluginLoaderClass *klass
);
Returns a GSList of string for which extensions the loader supports.
GPluginPlugin * gplugin_loader_query_plugin (GPluginLoader *loader
,const gchar *filename
,GError **error
);
This function is called by the plugin manager to ask a loader to query the given file and determine if it's a usable plugin.
loader |
GPluginLoader instance performing the query |
|
filename |
filename to query |
|
error |
return location for a GError, or NULL |
gboolean gplugin_loader_load_plugin (GPluginLoader *loader
,GPluginPlugin *plugin
,GError **error
);
This function is called by the plugin manager to ask a loader to load the given plugin.
loader |
GPluginLoader instance performing the load |
|
plugin |
GPluginPlugin instance to load |
|
error |
return location for a GError, or NULL |
gboolean gplugin_loader_unload_plugin (GPluginLoader *loader
,GPluginPlugin *plugin
,GError **error
);
This function is called by the plugin manager to ask a loader to unload the given plugin.
loader |
GPluginLoader instance performing the unload |
|
plugin |
GPluginPlugin instance to unload |
|
error |
return location for a GError, or NULL |
#define GPLUGIN_TYPE_LOADER (gplugin_loader_get_type())
The standard _get_type macro for GPluginLoader.
struct GPluginLoaderClass { GSList *(*supported_extensions)(GPluginLoaderClass *klass); GPluginPlugin *(*query)(GPluginLoader *loader, const gchar *filename, GError **error); gboolean (*load)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error); gboolean (*unload)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error); };
GPluginLoader class defines the behavior for loading plugins.
The supported_extensions vfunc returns a GList of file extensions that this loader supports without the leading dot. For example: 'so', 'dll', 'py', etc. |
||
The query vfunc is called when the plugin manager needs to query a
plugin that has a file extension from |
||
The load vfunc is called when the plugin manager wants to load a plugin that was previously queried by this loader. |
||
The unload vfunc is called when the plugin manager wants to unload a previously loaded plugin from this loader. |