Top | ![]() |
![]() |
![]() |
![]() |
void | (*GPluginManagerForeachFunc) () |
void | gplugin_manager_append_path () |
void | gplugin_manager_prepend_path () |
void | gplugin_manager_remove_path () |
void | gplugin_manager_remove_paths () |
void | gplugin_manager_add_default_paths () |
void | gplugin_manager_add_app_paths () |
GList * | gplugin_manager_get_paths () |
gboolean | gplugin_manager_register_loader () |
gboolean | gplugin_manager_unregister_loader () |
void | gplugin_manager_refresh () |
void | gplugin_manager_foreach () |
GSList * | gplugin_manager_find_plugins () |
GSList * | gplugin_manager_find_plugins_with_version () |
GSList * | gplugin_manager_find_plugins_with_state () |
GPluginPlugin * | gplugin_manager_find_plugin () |
GPluginPlugin * | gplugin_manager_find_plugin_with_newest_version () |
GSList * | gplugin_manager_get_plugin_dependencies () |
gboolean | gplugin_manager_load_plugin () |
gboolean | gplugin_manager_unload_plugin () |
GList * | gplugin_manager_list_plugins () |
GObject * | gplugin_manager_get_instance () |
The manager is used to manager all plugins in GPlugin. This includes loading, unloading, querying, checking for new plugins, and so on.
void (*GPluginManagerForeachFunc) (const gchar *id
,GSList *plugins
,gpointer data
);
A callback function for gplugin_manager_foreach()
.
id |
The id of the plugin. |
|
plugins |
A GSList of each plugin that has the id |
|
data |
User data passed to |
void
gplugin_manager_append_path (const gchar *path
);
Adds path
to the end of the list of paths to search for plugins.
void
gplugin_manager_prepend_path (const gchar *path
);
Adds path
to the beginning of the list of paths to search for plugins.
void
gplugin_manager_remove_path (const gchar *path
);
Removes path
from the list of paths to search for plugins.
void
gplugin_manager_remove_paths (void
);
Clears all paths that are set to search for plugins.
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
so users can install additional loaders
themselves.
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
.
GList *
gplugin_manager_get_paths (void
);
Gets the list of paths which will be searched for plugins.
gboolean gplugin_manager_register_loader (GType type
,GError **error
);
Registers type
as an available loader.
gboolean gplugin_manager_unregister_loader (GType type
,GError **error
);
Unregisters type
as an available loader.
void
gplugin_manager_refresh (void
);
Forces a refresh of all plugins found in the search paths.
void gplugin_manager_foreach (GPluginManagerForeachFunc func
,gpointer data
);
Calls func
for each plugin that is known.
GSList *
gplugin_manager_find_plugins (const gchar *id
);
Finds all plugins matching id
.
A GSList of
referenced GPluginPlugin's matching id
. Call
g_slist_free_full()
with a DestroyNotify
of g_object_unref()
on
the returned value when you're done with it.
[element-type GPlugin.Plugin][transfer full]
GSList * gplugin_manager_find_plugins_with_version (const gchar *id
,const gchar *op
,const gchar *version
);
Similar to gplugin_manager_find_plugins()
but only returns plugins whose
versions match op
and version
. This is primarily used for dependency
loading where a plugin may depend on a specific range of versions of another
plugin.
id |
The ID of the plugin to find. |
|
op |
one of <, <=, =, ==, >=, >. |
|
version |
The version to compare against. |
A GSList of
referenced GPluginPlugin's matching id
. Call
g_slist_free_full()
with a DestroyNotify
of g_object_unref()
on
the returned value when you're done with it.
[element-type GPlugin.Plugin][transfer full]
GSList *
gplugin_manager_find_plugins_with_state
(GPluginPluginState state
);
Finds all plugins that currently have a state of state
.
A GSList of
referenced GPluginPlugin's whose state is state
. Call
g_slist_free_full()
with a DestroyNotify
of g_object_unref()
on
the returned value when you're done with it.
[element-type GPlugin.Plugin][transfer full]
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.
A referenced GPluginPlugin instance or NULL
if no plugin matching id
was found.
[transfer full]
GPluginPlugin *
gplugin_manager_find_plugin_with_newest_version
(const gchar *id
);
Calls gplugin_manager_find_plugins()
with id
, and then returns the plugins
with the highest version number or NULL
if no plugins with id
are found.
The GPluginPlugin with an id of id
that has the
highest version number, or NULL
if no plugins were found with id
.
[transfer full]
GSList * gplugin_manager_get_plugin_dependencies (GPluginPlugin *plugin
,GError **error
);
Returns a list of all the GPluginPlugin's that plugin
depends on.
plugin |
The GPluginPlugin whose dependencies to get. |
|
error |
Return address for a GError. |
[out][nullable] |
A GSList of
GPluginPlugin's that plugin
depends on, or NULL
on error
with error
set. Call g_slist_free_full()
with a
DestroyNotify
of g_object_unref()
on the returned value when
you're done with it.
[element-type GPlugin.Plugin][transfer full]
gboolean gplugin_manager_load_plugin (GPluginPlugin *plugin
,GError **error
);
Loads plugin
and all of its 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.
plugin |
GPluginPlugin instance. |
|
error |
return location for a GError or |
[out][nullable] |
gboolean gplugin_manager_unload_plugin (GPluginPlugin *plugin
,GError **error
);
Unloads plugin
. If plugin
has dependencies, they are not unloaded.
plugin |
GPluginPlugin instance. |
|
error |
Return location for a GError or |
[out][nullable] |
GList *
gplugin_manager_list_plugins (void
);
Returns a GList of all plugin id's. Each id should be queried directly for more information.