![]() |
![]() |
![]() |
Ethos Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Prerequisites |
EthosPluginLoader; EthosPluginLoaderIface; const gchar* ethos_plugin_loader_get_name (EthosPluginLoader *plugin_loader
); void ethos_plugin_loader_initialize (EthosPluginLoader *plugin_loader
,EthosManager *manager
); void ethos_plugin_loader_unload (EthosPluginLoader *plugin_loader
); EthosPlugin* ethos_plugin_loader_load (EthosPluginLoader *plugin_loader
,EthosPluginInfo *plugin_info
,GError **error
); void ethos_plugin_loader_gc (EthosPluginLoader *plugin_loader
); void ethos_plugin_loader_register_plugin (EthosPluginLoader *plugin_loader
,EthosPlugin *plugin
);
The EthosPluginLoader interface is responsible for loading plugins during runtime. Plugins can specify a plugin-loader that should load them in their plugin desciption file. This is done using the Loader keyword such as follows.
[Test Plugin] Name=Sample Loader=python Module=sample IAge=1
In this example, the EthosPythonLoader will be used to load the plugin. The python loader, like all loaders, requires that the Module keyword is set. In this case, the module is "sample", so the python loader will look for "sample.py" to load the plugin.
typedef struct { GObjectClass parent_class; const gchar* (*get_name) (EthosPluginLoader *plugin_loader); void (*initialize) (EthosPluginLoader *plugin_loader, EthosManager *manager); void (*unload) (EthosPluginLoader *plugin_loader); EthosPlugin* (*load) (EthosPluginLoader *plugin_loader, EthosPluginInfo *plugin_info, GError **error); void (*gc) (EthosPluginLoader *plugin_loader); void (*register_plugin) (EthosPluginLoader *plugin_loader, EthosPlugin *plugin); void (*reserved1) (void); void (*reserved2) (void); void (*reserved3) (void); void (*reserved4) (void); } EthosPluginLoaderIface;
const gchar* ethos_plugin_loader_get_name (EthosPluginLoader *plugin_loader
);
Retrieves the name of the plugin loader. The default plugin loader's name
is NULL
.
|
An EthosPluginLoader |
Returns : |
The name of the plugin loader or NULL
|
void ethos_plugin_loader_initialize (EthosPluginLoader *plugin_loader
,EthosManager *manager
);
Initializes the plugin loader.
|
An EthosPluginLoader |
|
An EthosManager |
void ethos_plugin_loader_unload (EthosPluginLoader *plugin_loader
);
Unloads the plugin loader and cleans up related resources.
|
An EthosPluginLoader |
EthosPlugin* ethos_plugin_loader_load (EthosPluginLoader *plugin_loader
,EthosPluginInfo *plugin_info
,GError **error
);
Creates an instance of the plugin from the information in the
plugin_info
object.
In case of failure, error
is set and NULL
is returned.
|
An EthosPluginLoader |
|
An EthosPluginInfo |
|
A location for a GError or NULL
|
Returns : |
The newly created EthosPlugin instance or NULL .
|
void ethos_plugin_loader_gc (EthosPluginLoader *plugin_loader
);
Runs the garbage collector for an associated vm for the plugin loader.
|
An EthosPluginLoader |
void ethos_plugin_loader_register_plugin (EthosPluginLoader *plugin_loader
,EthosPlugin *plugin
);
For plugin-loaders that do not support creation of GObjectClass's during runtime, this method can be used to instantiate a plugin instance and the plugin-loader will be notified. For example, a JavaScript plugin may create an instance of EthosPlugin and connect signals rather than creating its own child class.
See ethos_register_runtime_plugin()
.
|
An EthosPluginLoader |
|
An EthosPlugin |