--- a/gplugin/gplugin-loader.c Mon Feb 17 21:08:07 2020 -0600
+++ b/gplugin/gplugin-loader.c Tue Feb 18 01:28:55 2020 -0600
@@ -1,5 +1,5 @@
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -20,24 +20,23 @@
#include <gplugin/gplugin-core.h>
+ * SECTION:gplugin-loader + * @Title: Plugin Loader + * @Short_description: Abstract class for loading plugins + * GPluginLoader defines the base behavior for loaders of all languages. * The standard _get_type macro for #GPluginLoader.
- * SECTION:gplugin-loader
- * @Title: Plugin Loader Interface
- * @Short_description: interface for loading plugins
- * A PluginLoader has to implement the interface described here for GPlugin to
- * be able to use it to load plugins.
- * An abstract data type that should not be accessed directly.
+ * An abstract class that should not be accessed directly. @@ -52,11 +51,11 @@
* @unload: The unload vfunc is called when the plugin manager wants to unload
* a previously loaded plugin from this loader.
- * #GPluginLoader class defines the behavior for loading plugins.
+ * #GPluginLoaderClass defines the behavior for loading plugins. /******************************************************************************
+ * GObject Implementation *****************************************************************************/
G_DEFINE_ABSTRACT_TYPE(GPluginLoader, gplugin_loader, G_TYPE_OBJECT);
@@ -74,14 +73,15 @@
* gplugin_loader_query_plugin:
- * @loader: #GPluginLoader instance performing the query
- * @filename: filename to query
- * @error: return location for a GError, or NULL
+ * @loader: The #GPluginLoader instance performing the query. + * @filename: The filename to query. + * @error: (nullable): The return location for a #GError, or %NULL. - * This function is called by the plugin manager to ask a loader to query the
- * given file and determine if it's a usable plugin.
+ * This function is called by the plugin manager to ask @loader to query + * @filename and determine if it's a usable plugin. - * Return value: (transfer full): A #GPluginPlugin instance or NULL on failure
+ * Return value: (transfer full): A #GPluginPlugin instance or %NULL on gplugin_loader_query_plugin(GPluginLoader *loader,
@@ -104,14 +104,14 @@
* gplugin_loader_load_plugin:
- * @loader: #GPluginLoader instance performing the load
- * @plugin: #GPluginPlugin instance to load
- * @error: return location for a GError, or NULL
+ * @loader: The #GPluginLoader instance performing the load. + * @plugin: The #GPluginPlugin instance to load. + * @error: (nullable): The return location for a #GError, or %NULL. - * This function is called by the plugin manager to ask a loader to load the
+ * This function is called by the plugin manager to ask @loader to load - * Return value: TRUE if @plugin was loaded successfully, FALSE otherwise
+ * Return value: %TRUE if @plugin was loaded successfully, %FALSE otherwise. gplugin_loader_load_plugin(GPluginLoader *loader,
@@ -139,14 +139,14 @@
* gplugin_loader_unload_plugin:
- * @loader: #GPluginLoader instance performing the unload
- * @plugin: #GPluginPlugin instance to unload
- * @error: return location for a GError, or NULL
+ * @loader: The #GPluginLoader instance performing the unload. + * @plugin: The #GPluginPlugin instance to unload. + * @error: (nullable): The return location for a #GError, or %NULL. - * This function is called by the plugin manager to ask a loader to unload the
+ * This function is called by the plugin manager to ask @loader to unload - * Return value: TRUE if @plugin was unloaded successfully, FALSE otherwise
+ * Return value: %TRUE if @plugin was unloaded successfully, %FALSE otherwise. gplugin_loader_unload_plugin(GPluginLoader *loader,
@@ -174,9 +174,11 @@
* gplugin_loader_class_get_supported_extensions:
- * @klass: #GPluginLoader instance
+ * @klass: The #GPluginLoaderClass. - * Returns a #GSList of string for which extensions the loader supports.
+ * Returns a #GSList of strings containing the extensions that the loader + * supports. Each extension should not include the dot. For example: so, * Return value: (element-type utf8) (transfer container): A #GSList of
* extensions that the loader supports.
@@ -190,4 +192,3 @@
--- a/gplugin/gplugin-manager.c Mon Feb 17 21:08:07 2020 -0600
+++ b/gplugin/gplugin-manager.c Tue Feb 18 01:28:55 2020 -0600
@@ -380,7 +380,7 @@
GPluginPluginState state =
gplugin_plugin_get_state(plugin);
- /* The plugin is in our "view", check it's state. If it's
+ /* The plugin is in our "view", check its state. If it's * queried or loaded, move on to the next one.
if(state == GPLUGIN_PLUGIN_STATE_QUERIED ||
@@ -409,7 +409,7 @@
- /* Check the GError, if it's set, output it's message and
+ /* Check the GError, if it's set, output its message and if(plugin == NULL || error) {
@@ -1056,7 +1056,7 @@
* gplugin_manager_append_path:
- * @path: A path to add to the end of the plugin search paths
+ * @path: A path to add to the end of the plugin search paths. * Adds @path to the end of the list of paths to search for plugins.
@@ -1075,7 +1075,7 @@
* gplugin_manager_prepend_path:
- * @path: A path to add to the beginning of the plugin search paths
+ * @path: A path to add to the beginning of the plugin search paths. * Adds @path to the beginning of the list of paths to search for plugins.
@@ -1094,7 +1094,7 @@
* gplugin_manager_remove_path:
- * @path: A path to remove from the plugin search paths
+ * @path: A path to remove from the plugin search paths. * Removes @path from the list of paths to search for plugins.
@@ -1133,7 +1133,8 @@
* gplugin_manager_add_default_paths:
* Adds the path that GPlugin was installed to to the plugin search path, as
- * well as ${XDG_CONFIG_HOME}/gplugin.
+ * well as `${XDG_CONFIG_HOME}/gplugin` so users can install additional loaders gplugin_manager_add_default_paths(void) {
@@ -1155,8 +1156,8 @@
* @appname: The name of the application whose paths to add.
* Adds the application installation path for @appname. This will add
- * $prefix/@appname/plugins to the list as well as
- * ${XDG_CONFIG_HOME}/@appname/plugins.
+ * `@prefix/@appname/plugins` to the list as well as + * `${XDG_CONFIG_HOME}/@appname/plugins`. gplugin_manager_add_app_paths(const gchar *prefix,
@@ -1178,10 +1179,10 @@
* gplugin_manager_get_paths:
- * Gets the list of paths which will be search for plugins.
+ * Gets the list of paths which will be searched for plugins. - * Return value: (element-type utf8) (transfer none): list of paths which will
- * be searched for plugins.
+ * Returns: (element-type utf8) (transfer none): The list of paths which will + * be searched for plugins. gplugin_manager_get_paths(void) {
@@ -1199,7 +1200,7 @@
* gplugin_manager_register_loader:
- * @type: #GType of a #GPluginLoader
+ * @type: #GType of a #GPluginLoader. * Registers @type as an available loader.
@@ -1217,7 +1218,7 @@
* gplugin_manager_unregister_loader:
- * @type: #GType of a #GPluginLoader
+ * @type: #GType of a #GPluginLoader. * Unregisters @type as an available loader.
@@ -1252,14 +1253,14 @@
* gplugin_manager_find_plugins:
- * @id: id string of the plugin to find
+ * @id: id string of the plugin to find. * Finds all plugins matching @id.
- * Return value: (element-type GPlugin.Plugin) (transfer full): A #GSList of
- * referenced #GPluginPlugin's matching @id. Call
- * #gplugin_manager_free_plugin_list on the returned value
- * when you're done with it.
+ * Returns: (element-type GPlugin.Plugin) (transfer full): A #GSList of + * referenced #GPluginPlugin's matching @id. Call + * #gplugin_manager_free_plugin_list on the returned value when you're gplugin_manager_find_plugins(const gchar *id) {
@@ -1368,9 +1369,9 @@
* gplugin_manager_free_plugin_list:
* @plugins_list: (element-type GPlugin.Plugin) (nullable): Returned value from
- * #gplugin_manager_find_plugins
+ * #gplugin_manager_find_plugins. - * Frees the return value of #gplugin_manager_find_plugins.
+ * Frees the returned value of #gplugin_manager_find_plugins. gplugin_manager_free_plugin_list(GSList *plugins_list) {
@@ -1422,12 +1423,12 @@
* gplugin_manager_get_plugin_dependencies:
* @plugin: The #GPluginPlugin whose dependencies to get.
- * @error: Return address for a #GError.
+ * @error: (out) (nullable): Return address for a #GError. * Returns a list of all the #GPluginPlugin's that @plugin depends on.
* Return value: (element-type GPlugin.Plugin) (transfer full): A #GSList of
- * #GPluginPlugin's that @plugin depends on, or NULL on error
+ * #GPluginPlugin's that @plugin depends on, or %NULL on error * with @error set. Call #gplugin_manager_free_plugin_list on
* the returned value when you're done with it.
@@ -1451,15 +1452,15 @@
* gplugin_manager_load_plugin:
- * @plugin: #GPluginPlugin instance
- * @error: (out): return location for a #GError or null
+ * @plugin: #GPluginPlugin instance. + * @error: (out) (nullable): return location for a #GError or %NULL. - * Loads @plugin and all of it's dependencies. If a dependency can not be
+ * 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.
- * Return value: TRUE if @plugin was loaded successfully or already loaded,
+ * Return value: %TRUE if @plugin was loaded successfully or already loaded, gplugin_manager_load_plugin(GPluginPlugin *plugin, GError **error) {
@@ -1480,13 +1481,13 @@
* gplugin_manager_unload_plugin:
- * @plugin: #GPluginPlugin instance
- * @error: (out): return location for a #GError or null
+ * @plugin: #GPluginPlugin instance. + * @error: (out) (nullable): Return location for a #GError or %NULL. * Unloads @plugin. If @plugin has dependencies, they are not unloaded.
- * Return value: TRUE if @plugin was unloaded successfully or not loaded,
+ * Returns: %TRUE if @plugin was unloaded successfully or not loaded, %FALSE gplugin_manager_unload_plugin(GPluginPlugin *plugin, GError **error) {
@@ -1538,8 +1539,8 @@
* This is provided so that signals can be connected and should not be tinkered
- * Return Value: (transfer none): The #GObject that is the instance of the
+ * Returns: (transfer none): The #GObject that is the instance of the plugin gplugin_manager_get_instance(void) {
@@ -1548,4 +1549,3 @@
--- a/gplugin/gplugin-plugin-info.c Mon Feb 17 21:08:07 2020 -0600
+++ b/gplugin/gplugin-plugin-info.c Tue Feb 18 01:28:55 2020 -0600
@@ -1,5 +1,5 @@
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -24,7 +24,7 @@
* SECTION:gplugin-plugin-info
* @Title: Plugin Info Objects
- * @Short_description: information about plugins
+ * @Short_description: information about plugins. * #GPluginPluginInfo holds metadata for plugins.
@@ -474,7 +474,7 @@
* format: <application or library>/<name of the plugin>.
* For example, the python loader in GPlugin has an id of
- * "gplugin/python-plugin-loader".
+ * "gplugin/python-loader". properties[PROP_ID] = g_param_spec_string(
@@ -489,14 +489,16 @@
* The GPlugin ABI version that the plugin was compiled against.
- * GPlugin only uses the first byte (0xff000000) of this value. The
+ * GPlugin only uses the first byte (`0xff000000`) of this value. The * remaining 3 bytes are available for the application to use.
* Take the following example from an application:
+ * |[<!-- language="C" --> * #define ABI_VERSION (GPLUGIN_NATIVE_ABI_VERSION |
* (APPLICATION_MAJOR_VERSION << 8) |
* (APPLICATION_MINOR_VERSION))
* The application here uses the thrid and fourth bytes, but could use
@@ -513,7 +515,7 @@
* Whether or not the plugin is considered an "internal" plugin.
properties[PROP_INTERNAL] = g_param_spec_boolean(
@@ -530,7 +532,7 @@
* This is used by the loaders and may be useful to your application as
properties[PROP_LOQ] = g_param_spec_boolean(
"load-on-query", "load-on-query",
@@ -542,7 +544,7 @@
* GPluginPluginInfo:bind-local:
- * Determines whether the plugin should be have it's symbols bound locally.
+ * Determines whether the plugin should be have its symbols bound locally. * Note: This should only be used by the native plugin loader.
@@ -568,7 +570,7 @@
* GPluginPluginInfo:version:
- * The version of the plugin.
+ * The version of the plugin. Preferably a semantic version. properties[PROP_VERSION] = g_param_spec_string(
@@ -583,8 +585,8 @@
* The short name of the license.
* It is recommended to use the identifier of the license from
- * http://dep.debian.net/deps/dep5/#license-specification and should be
- * "Other" for licenses that are not mentioned in DEP5.
+ * https://spdx.org/licenses/ and should be "Other" for licenses that are * If a plugin has multiple license, they should be separated by a pipe
* (|). In the odd case that you have multiple licenses that are used at
@@ -601,7 +603,7 @@
* GPluginPluginInfo:license-text:
* The text of the license for this plugin. This should only be used when
- * the plugin is licensed under a license that is not listed in DEP5.
+ * the plugin is licensed under a license that is not listed at spdx.org. properties[PROP_LICENSE_TEXT] = g_param_spec_string(
"license-text", "license text",
@@ -614,7 +616,7 @@
* GPluginPluginInfo:license-url:
* The url to the text of the license. This should primarily only be used
- * for licenses not listed in DEP5.
+ * for licenses not listed at spdx.org. properties[PROP_LICENSE_URL] = g_param_spec_string(
"license-url", "license url",
@@ -682,11 +684,10 @@
* GPluginPluginInfo:authors:
- * A gchar ** of the names and email addresses of the authors.
+ * A list of the names and email addresses of the authors. * It is recommended to use the RFC 822, 2822 format of:
- * "First Last <user@domain.com>" with additional authors separated by a
+ * "`First Last <user@domain.com>". properties[PROP_AUTHORS] = g_param_spec_boxed(
@@ -740,18 +741,18 @@
* gplugin_plugin_info_new: (skip)
- * @id: The id of the plugin
- * @abi_version: The GPlugin ABI version that the plugin uses
+ * @id: The id of the plugin. + * @abi_version: The GPlugin ABI version that the plugin uses. * @...: name/value pairs of properties to set, followed by %NULL.
* Creates a new GPluginPluginInfo instance.
- * Returns: The new GPluginPluginInfo instance.
+ * Returns: (transfer full): The new GPluginPluginInfo instance. * gplugin_plugin_info_get_id:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the id that the plugin identifies itself as.
@@ -770,7 +771,7 @@
* gplugin_plugin_info_get_abi_version:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the ABI or Application Binary Interface version that the plugin
* is supposed to work against.
@@ -790,13 +791,13 @@
* gplugin_plugin_info_get_internal:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns where or not this plugin is is considered an internal plugin. An
* internal plugin would be something like a plugin loader or another plugin
* that should not be shown to users.
- * Returns: TRUE if the plugin is internal, FALSE otherwise.
+ * Returns: %TRUE if the plugin is internal, %FALSE otherwise. gplugin_plugin_info_get_internal(GPluginPluginInfo *info) {
@@ -811,14 +812,14 @@
* gplugin_plugin_info_get_load_on_query:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns whether or not this plugin should be loaded when queried. This is
* useful for internal plugins that are adding functionality and should always
* be turned on. The plugin loaders use this to make sure all plugins can
- * Returns: TRUE if the plugin should be loaded on query, FALSE otherwise.
+ * Returns: %TRUE if the plugin should be loaded on query, %FALSE otherwise. gplugin_plugin_info_get_load_on_query(GPluginPluginInfo *info) {
@@ -833,7 +834,7 @@
* gplugin_plugin_info_get_name:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the name of the plugin as specified in @info.
@@ -852,7 +853,7 @@
* gplugin_plugin_info_get_version:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the version of the plugin as specified in @info.
@@ -871,7 +872,7 @@
* gplugin_plugin_info_get_license_id:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the liences id for the plugin as specified in @info.
@@ -890,7 +891,7 @@
* gplugin_plugin_info_get_license_text:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the license text for the plugin as specified in @info.
@@ -909,7 +910,7 @@
* gplugin_plugin_info_get_license_url:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the url of the license for the plugin as specified in @info
@@ -928,7 +929,7 @@
* gplugin_plugin_info_get_icon:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the name of the icon for the plugin as specified in @info.
@@ -947,7 +948,7 @@
* gplugin_plugin_info_get_summary:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the summery for the plugin as specified in @info.
@@ -966,7 +967,7 @@
* gplugin_plugin_info_get_description:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the description for the plugin as specified in @info.
@@ -985,7 +986,7 @@
* gplugin_plugin_info_get_category:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the category of the plugin as specified in @info.
@@ -1004,7 +1005,7 @@
* gplugin_plugin_info_get_authors:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the authors of the plugin as specified in @info.
@@ -1023,7 +1024,7 @@
* gplugin_plugin_info_get_help:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the help text for the plugin as specified in @info.
@@ -1042,7 +1043,7 @@
* gplugin_plugin_info_get_website:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the website for the plugin as specified in @info.
@@ -1061,7 +1062,7 @@
* gplugin_plugin_info_get_dependencies:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * Returns the dependencies of the plugins as specified in @info.
@@ -1081,12 +1082,12 @@
* gplugin_plugin_info_get_bind_local:
- * @info: #GPluginPluginInfo instance
+ * @info: The #GPluginPluginInfo instance. * This function is only used by the native plugin loader.
- * Returns: TRUE if the plugin has requested to be loaded with it's symbols
- * bound locally, FALSE if they should bind be bound globally.
+ * Returns: %TRUE if the plugin has requested to be loaded with its symbols + * bound locally, %FALSE if they should bind be bound globally. gplugin_plugin_info_get_bind_local(GPluginPluginInfo *info) {
@@ -1098,4 +1099,3 @@
--- a/gplugin/gplugin-plugin.c Mon Feb 17 21:08:07 2020 -0600
+++ b/gplugin/gplugin-plugin.c Tue Feb 18 01:28:55 2020 -0600
@@ -1,5 +1,5 @@
- * Copyright (C) 2011-2014 Gary Kramlich <grim@reaperworld.com>
+ * Copyright (C) 2011-2020 Gary Kramlich <grim@reaperworld.com> * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,25 +22,25 @@
- * @Title: Plugin Objects
- * @Short_description: abstract plugin implementation
+ * @Title: Plugin Interface + * @Short_description: The plugin interface that all plugins must implement. - * #GPluginPlugin is an abstract class that tracks the state of a plugin. It
- * is subclassed by each loader for them to add additional data for their
+ * #GPluginPlugin is an interface that defines the behavior of plugins. It + * is implemented by each loader which add additional data for their - * @GPLUGIN_PLUGIN_STATE_UNKNOWN: The state of the plugin is unknown
+ * @GPLUGIN_PLUGIN_STATE_UNKNOWN: The state of the plugin is unknown. * @GPLUGIN_PLUGIN_STATE_ERROR: There was an error loading or unloading the
- * @GPLUGIN_PLUGIN_STATE_QUERIED: The plugin has been queried but not loaded
- * @GPLUGIN_PLUGIN_STATE_REQUERY: The plugin should be requeried
- * @GPLUGIN_PLUGIN_STATE_LOADED: The plugin is loaded
- * @GPLUGIN_PLUGIN_STATE_LOAD_FAILED: The plugin failed to load
+ * @GPLUGIN_PLUGIN_STATE_QUERIED: The plugin has been queried but not loaded. + * @GPLUGIN_PLUGIN_STATE_REQUERY: The plugin should be requeried. + * @GPLUGIN_PLUGIN_STATE_LOADED: The plugin is loaded. + * @GPLUGIN_PLUGIN_STATE_LOAD_FAILED: The plugin failed to load. - * The expected states of a plugin.
+ * The known states of a plugin. @@ -57,7 +57,8 @@
* GPluginPluginInterface:
- * @state_changed: The class closure for the #GPluginPlugin::state-changed signal.
+ * @state_changed: The class closure for the #GPluginPlugin::state-changed * The interface that defines the behavior of plugins, including properties and
@@ -162,11 +163,11 @@
* gplugin_plugin_get_filename:
- * @plugin: #GPluginPlugin instance
+ * @plugin: The #GPluginPlugin instance. * Returns the filename that @plugin was loaded from.
- * Returns: (transfer full): The filename of @plugin
+ * Returns: (transfer full): The filename of @plugin. gplugin_plugin_get_filename(GPluginPlugin *plugin) {
@@ -181,11 +182,11 @@
* gplugin_plugin_get_loader:
- * @plugin: #GPluginPlugin instance
+ * @plugin: The #GPluginPlugin instance. * Returns the #GPluginLoader that loaded @plugin.
- * Returns: (transfer full): The #GPluginLoader that loaded @plugin
+ * Returns: (transfer full): The #GPluginLoader that loaded @plugin. gplugin_plugin_get_loader(GPluginPlugin *plugin) {
@@ -200,11 +201,11 @@
* gplugin_plugin_get_info:
- * @plugin: #GPluginPlugin instance
+ * @plugin: The #GPluginPlugin instance. * Returns the #GPluginPluginInfo for @plugin.
- * Returns: (transfer full): The #GPluginPluginInfo instance for @plugin
+ * Returns: (transfer full): The #GPluginPluginInfo instance for @plugin. gplugin_plugin_get_info(GPluginPlugin *plugin) {
@@ -219,11 +220,11 @@
* gplugin_plugin_get_state:
- * @plugin: #GPluginPlugin instance
+ * @plugin: The #GPluginPlugin instance. - * Gets the current state of @plugin
+ * Gets the current state of @plugin. - * Returns: (transfer full): The current state of @plugin
+ * Returns: (transfer full): The current state of @plugin. gplugin_plugin_get_state(GPluginPlugin *plugin) {
@@ -238,8 +239,8 @@
* gplugin_plugin_set_state:
- * @plugin: #GPluginPlugin instance
- * @state: new #GPluginPluginState for @plugin
+ * @plugin: The #GPluginPlugin instance. + * @state: A new #GPluginPluginState for @plugin. * Changes the state of @plugin to @state. This function should only be called