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 () |
GSList * | gplugin_manager_get_loaders () |
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 () |
GPluginManager * | gplugin_manager_get_default () |
void | load-plugin-failed | Run Last |
void | loaded-plugin | Run Last |
gboolean | loading-plugin | Run Last |
void | unload-plugin-failed | Run Last |
void | unloaded-plugin | Run Last |
gboolean | unloading-plugin | Run Last |
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 (GPluginManager *manager
,const gchar *path
);
Adds path
to the end of the list of paths to search for plugins.
manager |
The GPluginManager instance. |
|
path |
A path to add to the end of the plugin search paths. |
void gplugin_manager_prepend_path (GPluginManager *manager
,const gchar *path
);
Adds path
to the beginning of the list of paths to search for plugins.
manager |
The GPluginManager instance. |
|
path |
A path to add to the beginning of the plugin search paths. |
void gplugin_manager_remove_path (GPluginManager *manager
,const gchar *path
);
Removes path
from the list of paths to search for plugins.
void
gplugin_manager_remove_paths (GPluginManager *manager
);
Clears all paths that are set to search for plugins.
void
gplugin_manager_add_default_paths (GPluginManager *manager
);
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 (GPluginManager *manager
,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
.
manager |
The GPluginManager instance. |
|
prefix |
The installation prefix for the application. |
|
appname |
The name of the application whose paths to add. |
GList *
gplugin_manager_get_paths (GPluginManager *manager
);
Gets the list of paths which will be searched for plugins.
gboolean gplugin_manager_register_loader (GPluginManager *manager
,GType type
,GError **error
);
Registers type
as an available loader.
manager |
The GPluginManager instance. |
|
type |
GType of a GPluginLoader. |
|
error |
The return address for a GError. |
[out][nullable] |
gboolean gplugin_manager_unregister_loader (GPluginManager *manager
,GType type
,GError **error
);
Unregisters type
as an available loader.
manager |
The GPluginManager instance. |
|
type |
GType of a GPluginLoader. |
|
error |
The return address for a GError. |
[out][nullable] |
GSList *
gplugin_manager_get_loaders (GPluginManager *manager
);
Returns a list of all registered GPluginLoader's.
void
gplugin_manager_refresh (GPluginManager *manager
);
Forces a refresh of all plugins found in the search paths.
void gplugin_manager_foreach (GPluginManager *manager
,GPluginManagerForeachFunc func
,gpointer data
);
Calls func
for each plugin that is known.
manager |
The GPluginManager instance. |
|
func |
The GPluginManagerForeachFunc to call. |
[scope call] |
data |
User data to pass to func. |
GSList * gplugin_manager_find_plugins (GPluginManager *manager
,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 (GPluginManager *manager
,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.
manager |
The GPluginManager instance. |
|
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 (GPluginManager *manager
,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 (GPluginManager *manager
,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 (GPluginManager *manager
,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 (GPluginManager *manager
,GPluginPlugin *plugin
,GError **error
);
Returns a list of all the GPluginPlugin's that plugin
depends on.
manager |
The GPluginManager instance. |
|
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 (GPluginManager *manager
,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.
manager |
The GPluginManager instance. |
|
plugin |
GPluginPlugin instance. |
|
error |
return location for a GError or |
[out][nullable] |
gboolean gplugin_manager_unload_plugin (GPluginManager *manager
,GPluginPlugin *plugin
,GError **error
);
Unloads plugin
. If plugin
has dependencies, they are not unloaded.
manager |
The GPluginManager instance. |
|
plugin |
GPluginPlugin instance. |
|
error |
Return location for a GError or |
[out][nullable] |
GList *
gplugin_manager_list_plugins (GPluginManager *manager
);
Returns a GList of all plugin id's. Each id should be queried directly for more information.
GPluginManager *
gplugin_manager_get_default (void
);
Gets the default GPluginManager in GPlugin.
Since: 0.33.0
struct GPluginManagerClass { gboolean (*loading_plugin)( GPluginManager *manager, GPluginPlugin *plugin, GError **error); void (*loaded_plugin)(GPluginManager *manager, GPluginPlugin *plugin); void (*load_failed)(GPluginManager *manager, GPluginPlugin *plugin); gboolean (*unloading_plugin)( GPluginManager *manager, GPluginPlugin *plugin, GError **error); void (*unloaded_plugin)(GPluginManager *manager, GPluginPlugin *plugin); void ( *unload_plugin_failed)(GPluginManager *manager, GPluginPlugin *plugin); };
Virtual function table for GPluginManager.
“load-plugin-failed”
signalvoid user_function (GPluginManager *manager, GObject *plugin, gpointer user_data)
emitted after a plugin fails to load.
manager |
The GPluginManager instance. |
|
plugin |
The GPluginPlugin that failed to load. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“loaded-plugin”
signalvoid user_function (GPluginManager *manager, GObject *plugin, gpointer user_data)
emitted after a plugin is loaded.
manager |
the gpluginpluginmanager instance. |
|
plugin |
the gpluginplugin that's about to be loaded. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“loading-plugin”
signalgboolean user_function (GPluginManager *manager, GObject *plugin, gpointer error, gpointer user_data)
Emitted before plugin
is loaded.
Return FALSE to stop loading
manager |
The GPluginManager instance. |
|
plugin |
The GPluginPlugin that's about to be loaded. |
|
error |
Return address for a GError. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“unload-plugin-failed”
signalvoid user_function (GPluginManager *manager, GObject *plugin, gpointer user_data)
Emitted when manager
was asked to unload plugin
, but plugin
returned
FALSE
when its unload function was called.
manager |
The GPluginManager instance. |
|
plugin |
The GPluginPlugin instance that failed to unload. |
|
error |
A GError instance. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“unloaded-plugin”
signalvoid user_function (GPluginManager *manager, GObject *plugin, gpointer user_data)
emitted after a plugin is successfully unloaded.
manager |
the gpluginpluginmanager instance. |
|
plugin |
the gpluginplugin that's about to be loaded. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“unloading-plugin”
signalgboolean user_function (GPluginManager *manager, GObject *plugin, gpointer error, gpointer user_data)
emitted before a plugin is unloaded.
Return FALSE to stop unloading
manager |
the GPluginManager instance. |
|
plugin |
the GPluginPlugin that's about to be unloaded. |
|
error |
Return address for a GError. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last