Manager API

Manager API — API for managing plugins

Functions

Description

The manager is used to manager all plugins in GPlugin. This includes loading, unloading, querying, checking for new plugins, and so on.

Functions

gplugin_manager_append_path ()

void
gplugin_manager_append_path (const gchar *path);

Adds path to the end of the list of paths to search for plugins.

Parameters

path

A path to add to the end of the plugin search paths

 

gplugin_manager_prepend_path ()

void
gplugin_manager_prepend_path (const gchar *path);

Adds path to the beginning of the list of paths to search for plugins.

Parameters

path

A path to add to the beginning of the plugin search paths

 

gplugin_manager_remove_path ()

void
gplugin_manager_remove_path (const gchar *path);

Removes path from the list of paths to search for plugins.

Parameters

path

A path to remove from the plugin search paths

 

gplugin_manager_remove_paths ()

void
gplugin_manager_remove_paths (void);

Clears all paths that are set to search for plugins.


gplugin_manager_add_default_paths ()

void
gplugin_manager_add_default_paths (void);

Adds the path that GPlugin was installed to to the plugin search path, as well as ${XDG_CONFIG_HOME}/gplugin.


gplugin_manager_add_app_paths ()

void
gplugin_manager_add_app_paths (const gchar *prefix,
                               const gchar *appname);

Adds the application installation path for appname . This will add $prefix/appname /plugins to the list as well as ${XDG_CONFIG_HOME}/appname /plugins.

Parameters

prefix

The installation prefix for the application.

 

appname

The name of the application whose paths to add.

 

gplugin_manager_get_paths ()

GList *
gplugin_manager_get_paths (void);

Gets the list of paths which will be search for plugins.

Returns

list of paths which will be searched for plugins. free the list with g_list_free when done.

[element-type utf8][transfer none]


gplugin_manager_register_loader ()

void
gplugin_manager_register_loader (GType type);

Registers type as an available loader.

Parameters

type

GType of a GPluginLoader

 

gplugin_manager_unregister_loader ()

void
gplugin_manager_unregister_loader (GType type);

Unregisters type as an available loader.

Parameters

type

GType of a GPluginLoader

 

gplugin_manager_refresh ()

void
gplugin_manager_refresh (void);

Forces a refresh of all plugins found in the search paths.


gplugin_manager_find_plugins ()

GSList *
gplugin_manager_find_plugins (const gchar *id);

Finds all plugins matching id .

Parameters

id

id string of the plugin to find

 

Returns

A GSList of referenced GPluginPlugin's matching id . Call gplugin_manager_free_plugin_list on the returned value when you're done with it.

[element-type GPlugin.Plugin][transfer full]


gplugin_manager_free_plugin_list ()

void
gplugin_manager_free_plugin_list (GSList *plugins_list);

Frees the return value of gplugin_manager_find_plugins.

Parameters

plugins_list

Returned value from gplugin_manager_find_plugins.

[element-type GPlugin.Plugin]

gplugin_manager_find_plugin ()

GPluginPlugin *
gplugin_manager_find_plugin (const gchar *id);

Finds the first plugin matching id . This function uses gplugin_manager_find_plugins and returns the first plugin in the list.

Parameters

id

The id of the plugin to find.

 

Returns

A referenced GPluginPlugin instance or NULL if no plugin matching id was found.

[transfer full]


gplugin_manager_get_plugin_dependencies ()

GSList *
gplugin_manager_get_plugin_dependencies
                               (GPluginPlugin *plugin,
                                GError **error);

Returns a list of all the GPluginPlugin's that plugin depends on.

Parameters

plugin

The GPluginPlugin whose dependencies to get.

 

error

Return address for a GError.

 

Returns

A GSList of GPluginPlugin's that plugin depends on, or NULL on error with error set.

[element-type GPlugin.Plugin][transfer full]


gplugin_manager_load_plugin ()

gboolean
gplugin_manager_load_plugin (GPluginPlugin *plugin,
                             GError **error);

Loads plugin and all of it's dependencies. If a dependency can not be loaded, plugin will not be loaded either. However, any other plugins that plugin depends on that were loaded from this call, will not be unloaded.

Parameters

plugin

GPluginPlugin instance

 

error

return location for a GError or null.

[out]

Returns

TRUE if plugin was loaded successfully or already loaded, FALSE otherwise.


gplugin_manager_unload_plugin ()

gboolean
gplugin_manager_unload_plugin (GPluginPlugin *plugin,
                               GError **error);

Unloads plugin . If plugin has dependencies, they are not unloaded.

Parameters

plugin

GPluginPlugin instance

 

error

return location for a GError or null.

[out]

Returns

TRUE if plugin was unloaded successfully or not loaded, FALSE otherwise.


gplugin_manager_list_plugins ()

GList *
gplugin_manager_list_plugins (void);

Returns a GList of all plugin id's. Each id should be queried directly for more information.

Returns

A GList of each unique plugin id.

[element-type utf8][transfer full]


gplugin_manager_get_instance ()

GObject *
gplugin_manager_get_instance (void);

Returns a GObject that is the instance of the plugin manager that is being used.

This is provided so that signals can be connected and should not be tinkered with in any way.

Returns

The GObject that is the instance of the plugin manager.

[transfer none]

Types and Values