Sets our main struct and passes it to the parent class.
A destructor is present on this object, but not explicitly documented in the source.
Get the ID of schema.
Gets the key named name from schema.
Gets the path associated with schema, or NULL.
Get the main Gtk struct
the main Gtk struct as a void*
Checks if schema has a key named name.
Gets the list of children in schema.
Introspects the list of keys on schema.
Increase the reference count of schema, returning a new reference.
Decrease the reference count of schema, possibly freeing it.
the main Gtk struct
The gio.SettingsSchemaSource and gio.SettingsSchema APIs provide a mechanism for advanced control over the loading of schemas and a mechanism for introspecting their content.
Plugin loading systems that wish to provide plugins a way to access settings face the problem of how to make the schemas for these settings visible to GSettings. Typically, a plugin will want to ship the schema along with itself and it won't be installed into the standard system directories for schemas.
gio.SettingsSchemaSource provides a mechanism for dealing with this by allowing the creation of a new 'schema source' from which schemas can be acquired. This schema source can then become part of the metadata associated with the plugin and queried whenever the plugin requires access to some settings.
Consider the following example:
The code above shows how hooks should be added to the code that initialises (or enables) the plugin to create the schema source and how an API can be added to the plugin system to provide a convenient way for the plugin to access its settings, using the schemas that it ships.
From the standpoint of the plugin, it would need to ensure that it ships a gschemas.compiled file as part of itself, and then simply do the following:
{ GSettings *settings; gint some_value; settings = plugin_get_settings (self, NULL); some_value = g_settings_get_int (settings, "some-value"); ... }
It's also possible that the plugin system expects the schema source files (ie: .gschema.xml files) instead of a gschemas.compiled file. In that case, the plugin loading system must compile the schemas for itself before attempting to create the settings source.