3.13 <GSettingsSchemaSource>

Structure: <GSettingsSchemaSource>

This is an opaque structure type. You may not access it directly.

Procedures

Procedure: settings-schema-source:get-default ⇒ %return

Gets the default system schema source.

This function is not required for normal uses of <GSettings> but it may be useful to authors of plugin management systems or to those who want to introspect the content of schemas.

If no schemas are installed, #f will be returned.

The returned source may actually consist of multiple schema sources from different directories, depending on which directories were given in XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR. For this reason, all lookups performed against the default source should probably be done recursively.

%return

Returned: a <GSettingsSchemaSource>, or #f.

the default schema source

Method: settings-schema-source:list-schemas self recursive ⇒ non-relocatable relocatable
Method: list-schemas self recursive ⇒ non-relocatable relocatable

Lists the schemas in a given source.

If recursive is #t then include parent sources. If #f then only include the schemas from one source (ie: one directory). You probably want #t.

Non-relocatable schemas are those for which you can call settings:new. Relocatable schemas are those for which you must use settings:new-with-path.

Do not call this function from normal programs. This is designed for use by database editors, commandline tools, etc.

self

Passed: a <GSettingsSchemaSource>.

a <GSettingsSchemaSource>

recursive

Passed: a boolean.

if we should recurse

non-relocatable

Returned: a vector, each a string.

the list of non-relocatable schemas, in no defined order

relocatable

Returned: a vector, each a string.

the list of relocatable schemas, in no defined order

Method: settings-schema-source:lookup self schema-id recursive ⇒ %return
Method: lookup self schema-id recursive ⇒ %return

Looks up a schema with the identifier schema-id in self.

This function is not required for normal uses of <GSettings> but it may be useful to authors of plugin management systems or to those who want to introspect the content of schemas.

If the schema isn’t found directly in self and recursive is #t then the parent sources will also be checked.

If the schema isn’t found, #f is returned.

self

Passed: a <GSettingsSchemaSource>.

a <GSettingsSchemaSource>

schema-id

Passed: a string.

a schema ID

recursive

Passed: a boolean.

#t if the lookup should be recursive

%return

Returned: a <GSettingsSchema>, or #f.

a new <GSettingsSchema>

Procedure: settings-schema-source:new-from-directory directory parent trusted ⇒ %return

Attempts to create a new schema source corresponding to the contents of the given directory.

This function is not required for normal uses of <GSettings> but it may be useful to authors of plugin management systems.

The directory should contain a file called gschemas.compiled as produced by the [glib-compile-schemas][glib-compile-schemas] tool.

If trusted is #t then gschemas.compiled is trusted not to be corrupted. This assumption has a performance advantage, but can result in crashes or inconsistent behaviour in the case of a corrupted file. Generally, you should set trusted to #t for files installed by the system and to #f for files in the home directory.

In either case, an empty file or some types of corruption in the file will result in inval being returned.

If parent is non-#f then there are two effects.

First, if settings-schema-source:lookup is called with the recursive flag set to #t and the schema can not be found in the source, the lookup will recurse to the parent.

Second, any references to other schemas specified within this source (ie: child or extends) references may be resolved from the parent.

For this second reason, except in very unusual situations, the parent should probably be given as the default schema source, as returned by settings-schema-source-get-default.

directory

Passed: a file name, as a string.

the filename of a directory

parent

Passed: a <GSettingsSchemaSource>, or #f.

a <GSettingsSchemaSource>, or #f

trusted

Passed: a boolean.

#t, if the directory is trusted

%return

Returned: a <GSettingsSchemaSource>.

Method: settings-schema-source:ref self ⇒ %return
Method: ref self ⇒ %return

Increase the reference count of self, returning a new reference.

self

Passed: a <GSettingsSchemaSource>.

a <GSettingsSchemaSource>

%return

Returned: a <GSettingsSchemaSource>.

a new reference to self

Method: settings-schema-source:unref self
Method: unref self

Decrease the reference count of self, possibly freeing it.

self

Passed: a <GSettingsSchemaSource>.

a <GSettingsSchemaSource>