Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: GSettingsSchemaSource

[12:7] extends: object

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

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • GSettingsSchemaSource (directory = null, parent = null, trusted = null)

    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 %TRUE 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 %TRUE for files installed by the system and to %FALSE for files in the home directory. In either case, an empty file or some types of corruption in the file will result in %G_FILE_ERROR_INVAL being returned. If @parent is non-%NULL then there are two effects. First, if g_settings_schema_source_lookup() is called with the @recursive flag set to %TRUE 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 g_settings_schema_source_get_default().
    • @p directory is the filename of a directory.
    • @p parent is a #GSettingsSchemaSource, or %NULL.
    • @p trusted is %TRUE, if the directory is trusted.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • list_schemas (bool recursive)

    Lists the schemas in a given source. If @recursive is %TRUE then include parent sources. If %FALSE then only include the schemas from one source (ie: one directory). You probably want %TRUE. Non-relocatable schemas are those for which you can call g_settings_new(). Relocatable schemas are those for which you must use g_settings_new_with_path(). Do not call this function from normal programs. This is designed for use by database editors, commandline tools, etc.

    • @p recursive is if we should recurse.
    • @p non_relocatable is the list of non-relocatable schemas, in no defined order.
    • @p relocatable is the list of relocatable schemas, in no defined order.
    • @r None.
  • lookup (string schema_id, bool recursive)

    Looks up a schema with the identifier @schema_id in @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 the schema isn't found directly in

    • @source and @recursive is %TRUE then the parent sources will also be checked. If the schema isn't found, %NULL is returned.
    • @p schema_id is a schema ID.
    • @p recursive is %TRUE if the lookup should be recursive.
    • @r a new #GSettingsSchema.
  • ref ()

    Increase the reference count of @source, returning a new reference.

    • @r a new reference to @source.
  • unref ()

    Decrease the reference count of @source, possibly freeing it.

    • @r None.