Package ch.bailu.gtk.gio
Class SettingsSchemaSource
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gio.SettingsSchemaSource
- All Implemented Interfaces:
PointerInterface
This is an opaque structure type. You may not access it directly.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
static SettingsSchemaSource
Gets the default system schema source.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
Looks up a schema with the identifier @schema_id in @source.Looks up a schema with the identifier @schema_id in @source.static SettingsSchemaSource
newFromDirectorySettingsSchemaSource
(Str directory, SettingsSchemaSource parent, boolean trusted) Attempts to create a new schema source corresponding to the contents
of the given directory.static SettingsSchemaSource
newFromDirectorySettingsSchemaSource
(String directory, SettingsSchemaSource parent, boolean trusted) Attempts to create a new schema source corresponding to the contents
of the given directory.ref()
Increase the reference count of @source, returning a new reference.void
unref()
Decrease the reference count of @source, possibly freeing it.Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
SettingsSchemaSource
-
-
Method Details
-
getClassHandler
-
newFromDirectorySettingsSchemaSource
public static SettingsSchemaSource newFromDirectorySettingsSchemaSource(@Nonnull Str directory, @Nullable SettingsSchemaSource parent, boolean trusted) throws AllocationError 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().- Parameters:
directory
- the filename of a directoryparent
- a #GSettingsSchemaSource, or %NULLtrusted
- %TRUE, if the directory is trusted- Returns:
- Throws:
AllocationError
-
newFromDirectorySettingsSchemaSource
public static SettingsSchemaSource newFromDirectorySettingsSchemaSource(String directory, @Nullable SettingsSchemaSource parent, boolean trusted) throws AllocationError 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().- Parameters:
directory
- the filename of a directoryparent
- a #GSettingsSchemaSource, or %NULLtrusted
- %TRUE, if the directory is trusted- Returns:
- Throws:
AllocationError
-
lookup
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.- Parameters:
schema_id
- a schema IDrecursive
- %TRUE if the lookup should be recursive- Returns:
- a new #GSettingsSchema
-
lookup
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.- Parameters:
schema_id
- a schema IDrecursive
- %TRUE if the lookup should be recursive- Returns:
- a new #GSettingsSchema
-
ref
Increase the reference count of @source, returning a new reference.- Returns:
- a new reference to @source
-
unref
public void unref()Decrease the reference count of @source, possibly freeing it. -
getDefault
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, %NULL 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.- Returns:
- the default schema source
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-