diff --git a/docs/rst/c_api.rst b/docs/rst/c_api.rst index c2e27153..f1b7631d 100644 --- a/docs/rst/c_api.rst +++ b/docs/rst/c_api.rst @@ -34,6 +34,7 @@ C API Documentation c_api/spa_pod_api.rst c_api/plugin_api.rst c_api/component_loader_api.rst + c_api/settings_api.rst c_api/session_item_api.rst c_api/si_interfaces_api.rst c_api/si_factory_api.rst diff --git a/docs/rst/c_api/meson.build b/docs/rst/c_api/meson.build index 64788056..8b4f634f 100644 --- a/docs/rst/c_api/meson.build +++ b/docs/rst/c_api/meson.build @@ -22,6 +22,7 @@ sphinx_files += files( 'properties_api.rst', 'proxy_api.rst', 'session_item_api.rst', + 'settings_api.rst', 'si_factory_api.rst', 'si_interfaces_api.rst', 'spa_device_api.rst', diff --git a/docs/rst/c_api/settings_api.rst b/docs/rst/c_api/settings_api.rst new file mode 100644 index 00000000..0cb3189b --- /dev/null +++ b/docs/rst/c_api/settings_api.rst @@ -0,0 +1,17 @@ +.. _settings_api: + +Settings +======== +.. graphviz:: + :align: center + + digraph inheritance { + rankdir=LR; + GObject -> WpObject; + WpObject -> WpSettings; + } + +.. doxygenstruct:: WpSettings + +.. doxygengroup:: wpsettings + :content-only: diff --git a/lib/wp/settings.c b/lib/wp/settings.c index efe0cda4..33137dcd 100644 --- a/lib/wp/settings.c +++ b/lib/wp/settings.c @@ -15,17 +15,16 @@ #include "log.h" #include "private/registry.h" -/*! \defgroup wpsetttings WpSettings */ +/*! \defgroup wpsettings WpSettings */ /*! * \struct WpSettings * - * WpSettings loads and parses `sm-settings`(default value) metadata(contains - * wireplumber settings and rules). It provides APIs to its clients(modules, - * lua scripts etc) to access and change them. + * WpSettings loads and parses the "sm-settings" (default value) metadata, which + * contains wireplumber settings and rules. It provides APIs to its clients + * (modules, lua scripts etc) to access and change them. * * Being a WpObject subclass, the settings inherits WpObject's activation * system. - * */ struct _WpSettings @@ -70,13 +69,13 @@ wp_settings_init (WpSettings * self) /*! - * \brief gets the boolean value of a setting. + * \brief Gets the boolean value of a setting * - * \ingroup wpsetting - * \param self the handle + * \ingroup wpsettings + * \param self the settings object * \param setting name of the setting - * \param value(out): the boolean value of the setting - * \returns: TRUE if the setting is defined, FALSE otherwise + * \param value (out): the boolean value of the setting + * \returns TRUE if the setting is defined, FALSE otherwise */ gboolean wp_settings_get_boolean (WpSettings *self, const gchar *setting, @@ -98,13 +97,12 @@ wp_settings_get_boolean (WpSettings *self, const gchar *setting, } /*! - * \brief gets the string value of a setting. - * - * \ingroup wpsetting - * \param self the handle + * \brief Gets the string value of a setting + * \ingroup wpsettings + * \param self the settings object * \param setting name of the setting - * \param value(out): the string value of the setting - * \returns: TRUE if the setting is defined, FALSE otherwise + * \param value (out): the string value of the setting + * \returns TRUE if the setting is defined, FALSE otherwise */ gboolean wp_settings_get_string (WpSettings *self, const gchar *setting, @@ -126,12 +124,12 @@ wp_settings_get_string (WpSettings *self, const gchar *setting, } /*! - * \brief gets the integer(signed) value of a setting. - * - * \ingroup wpsetting - * \param self the handle - * \param value(out): the integer value of the setting - * \returns: TRUE if the setting is defined, FALSE otherwise + * \brief Gets the integer (signed) value of a setting + * \ingroup wpsettings + * \param self the settings object + * \param setting name of the setting + * \param val (out): the integer value of the setting + * \returns TRUE if the setting is defined, FALSE otherwise */ gboolean wp_settings_get_int (WpSettings *self, const gchar *setting, @@ -154,22 +152,22 @@ wp_settings_get_int (WpSettings *self, const gchar *setting, } /*! - * \brief applies the rules and returns the applied props. + * \brief Applies the rules and returns the applied properties. * - * This funtion applies the rules on the client properties and if - * there is a match, returns true and also copies the applied props. + * This function applies the rules on the client properties and if + * there is a match, it returns TRUE and also copies the applied properties. * - * \ingroup wpsetting - * \param self the handle - * \param rule name of the rule, this will match with the section mentioned + * \ingroup wpsettings + * \param self the settings object + * \param rule name of the rule; this will match with the section mentioned * in the conf file. - * \param client_props client props array, these properties are inputs on which - * the rules are applied. - * \param applied_props (nullable) the resultant actions/properties as a result - * of the application of rules are copied, if this is null props will be - * appended to client_props. - * \returns TRUE if there is a match for the client_props and returns the - * applied props for the match. + * \param client_props (transfer none)(inout): client properties array; these + * properties are inputs on which the rules are applied. + * \param applied_props (transfer none)(nullable)(out): the resultant + * actions/properties as a result of the application of rules are copied; + * if this is NULL, properties will be appended to \a client_props instead + * \returns TRUE if there is a match for the client_props and the + * applied properties are returned, FALSE otherwise */ gboolean wp_settings_apply_rule (WpSettings *self, const gchar *rule, @@ -247,18 +245,18 @@ check_metadata_name (gpointer g_object, gpointer metadata_name) /*! - * \brief Returns the wpsettings instance that is associated with the + * \brief Returns the WpSettings instance that is associated with the * given core. * * This method will also create the instance and register it with the core * if it had not been created before. * - * \ingroup wpsetting + * \ingroup wpsettings * \param core the core - * \param metadata_name (nullable) the name of the metadata with which this - * object should is associated. `sm-settings` is the default value picked if - * none is supplied. - * \returns: (transfer full) the wpsettings instance + * \param metadata_name (nullable): the name of the metadata with which this + * object is associated. `sm-settings` is the default value picked if + * NULL is supplied. + * \returns (transfer full): the WpSettings instance */ WpSettings * wp_settings_get_instance (WpCore *core, const gchar *metadata_name) diff --git a/lib/wp/settings.h b/lib/wp/settings.h index a78bb851..79af91a1 100644 --- a/lib/wp/settings.h +++ b/lib/wp/settings.h @@ -17,8 +17,8 @@ G_BEGIN_DECLS * \brief Flags to be used as WpObjectFeatures on WpSettings subclasses. * \ingroup wpsettings */ -typedef enum { - /* loads the metadata */ +typedef enum { /*< flags >*/ + /*! Loads the settings */ WP_SETTINGS_LOADED = (1 << 0), } WpSettingsFeatures;