![]() |
![]() |
![]() |
Kipinä Internals Reference Manual | ![]() |
---|---|---|---|---|
typedef KPPluginInfo; struct KPPluginInfo_; struct KPPlugin_; typedef KPPlugin; struct KPPluginClass_; KPPlugin* kp_plugin_new (const gchar *file); gboolean kp_plugin_load (KPPlugin *plugin); gboolean kp_plugin_load_by_name (const gchar *name); gboolean kp_plugin_load_by_id (const gchar *id); void kp_plugin_unload (KPPlugin *plugin); void kp_plugin_unload_by_name (const gchar *name); void kp_plugin_scan (const gchar *dir); gboolean kp_plugin_loaded (const gchar *name); GList* kp_plugin_get_plugins (void); GList* kp_plugin_get_plugins_loaded (void); KPPlugin* kp_plugin_get_plugin_by_name (const gchar *name); void kp_plugin_load_plugins (void); gboolean kp_plugin_register (KPPlugin *plugin); #define KP_PLUGIN_INIT (name, initfunc, info)
struct KPPluginInfo_ { unsigned int api_version; char *id; char *name; char *version; char *summary; char *description; char *author; char *homepage; char *requires; /* "simpleplugin,otherplugin" */ gboolean (*load)(KPPlugin *plugin); gboolean (*unload)(KPPlugin *plugin); void (*destroy)(KPPlugin *plugin); };
struct KPPlugin_ { GObject parent_instance; gchar *fn; gboolean loaded; KPPluginInfo *info; GModule *handle; };
KPPlugin* kp_plugin_new (const gchar *file);
Creates a new KPPlugin object and prepare to load it later. This function should probably be called from this module only.
file : |
Full path to the plugin file. |
Returns : | a KPPlugin. |
gboolean kp_plugin_load (KPPlugin *plugin);
Runs a plugin that is registered earlier.
plugin : |
a KPPlugin |
Returns : | TRUE if successful and FALSE otherwise. |
gboolean kp_plugin_load_by_name (const gchar *name);
Load a plugin. See kp_plugin_load()
for more.
name : |
The name of the plugin |
Returns : | TRUE if ok, FALSE otherwise. |
gboolean kp_plugin_load_by_id (const gchar *id);
Load a plugin. See kp_plugin_load()
for more.
id : |
The id of the plugin |
Returns : | TRUE if ok, FALSE otherwise. |
void kp_plugin_unload (KPPlugin *plugin);
Unload the plugin. That means, the plugin will be removed from
the list of loaded plugins and all memory allocated for the plugin
will be freed, but KPPlugin structure must be destroyed too. That
should probably be done by g_object_unref()
.
plugin : |
The plugin |
void kp_plugin_unload_by_name (const gchar *name);
Unloads the plugin with name name
if found from the list
of loaded plugins. See kp_plugin_unload()
for more information.
name : |
the name of the plugin |
void kp_plugin_scan (const gchar *dir);
Scans directory or directories for loadable plugins and adds them to list of available plugins but it will not load them!
dir : |
The directory to scan or NULL to scan default directories. |
gboolean kp_plugin_loaded (const gchar *name);
Checks if plugin named name
is loaded.
name : |
the name of the plugin |
Returns : | TRUE if plugin is loaded and FALSE otherwise. |
KPPlugin* kp_plugin_get_plugin_by_name (const gchar *name);
name : |
|
Returns : |
void kp_plugin_load_plugins (void);
Load all the plugins that are in the config file and marked for loading at the startup.