Xfconf.Channel¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The name of the channel |
||
r/w/co |
Whether or not this instance is a singleton |
||
r/w/co |
Base property path |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted whenever a property on channel has changed. |
Fields¶
- Inherited:
Class Details¶
- class Xfconf.Channel(**kwargs)¶
- Bases:
- Abstract:
No
An opaque structure that holds state about a channel.
- classmethod get(channel_name)¶
- Parameters:
channel_name (
str
) – A channel name.- Returns:
An
Xfconf.Channel
singleton.- Return type:
Either creates a new channel, or fetches a singleton object for channel_name. This function always returns a valid object; no checking is done to see if the channel exists or has a valid name.
The reference count of the returned channel is owned by libxfconf.
New in version 4.5.91.
- classmethod new(channel_name)¶
- Parameters:
channel_name (
str
) – A channel name.- Returns:
A new
Xfconf.Channel
. Release withGObject.Object.unref
() when no longer needed.- Return type:
Creates a new channel using name as the channel’s identifier. This function always returns a valid object; no checking is done to see if the channel exists or has a valid name.
Note: use of this function is not recommended, in favor of
Xfconf.Channel.get
(), which returns a singleton object and saves a little memory. However,Xfconf.Channel.new
() can be useful in some cases where you want to tie anXfconf.Channel
's lifetime (and thus the lifetime of connected signals and boundGObject.Object
properties) to the lifetime of another object.Also note that each channel has its own cache, so if you create 2 new channels with the same name, it will double the dbus traffic, so in this cases it is highly recommended to use
Xfconf.Channel.get
().
- classmethod new_with_property_base(channel_name, property_base)¶
- Parameters:
- Returns:
A new
Xfconf.Channel
. Release withGObject.Object.unref
() when no longer needed.- Return type:
Creates a new channel using name as the channel’s identifier, restricting the accessible properties to be rooted at property_base. This function always returns a valid object; no checking is done to see if the channel exists or has a valid name.
New in version 4.5.92.
- get_arrayv(property)¶
- Parameters:
property (
str
) – A property string.- Returns:
A newly-allocated
GLib.PtrArray
on success, orNone
on failure.- Return type:
[
GObject.Value
] orNone
Gets an array property on self and returns it as a
GLib.PtrArray
, which can be freed withXfconf.array_free
() when no longer needed.
- get_bool(property, default_value)¶
- Parameters:
- Returns:
The boolean value, or, if property is not in self, default_value is returned.
- Return type:
Retrieves the boolean value associated with property on self.
- get_double(property, default_value)¶
- Parameters:
- Returns:
The double value, or, if property is not in self, default_value is returned.
- Return type:
Retrieves the double value associated with property on self.
- get_int(property, default_value)¶
- Parameters:
- Returns:
The int value, or, if property is not in self, default_value is returned.
- Return type:
Retrieves the int value associated with property on self.
- get_named_struct(property, struct_name, value_struct)¶
-
Gets a property from self and fills in value_struct using the retrieved values. The struct_name parameter is the same name that must have been used to register the struct’s layout with
Xfconf.named_struct_register
().
- get_properties(property_base)¶
- Parameters:
property_base (
str
) – The base property name of properties to retrieve.- Returns:
A newly-allocated
GLib.HashTable
, which should be freed withGLib.HashTable.destroy
() when no longer needed.- Return type:
{
str
:GObject.Value
}
Retrieves multiple properties from self and stores them in a
GLib.HashTable
in which the keys correspond to the string (str
*) property names, and the values correspond to variant (GObject.Value
*) values. The keys and values are owned by the hash table and should be copied if needed. The value of the property specified by property_base (if it exists) and all sub-properties are retrieved. To retrieve all properties in the channel, specify “/” orNone
for property_base.
- get_property(property, value)¶
- Parameters:
property (
str
) – A string property name.value (
GObject.Value
) – AGObject.Value
.
- Returns:
True
if the property was retrieved successfully,False
otherwise.- Return type:
Gets a property on self and stores it in value. The caller is responsible for calling
GObject.Value.unset
() when finished with value.This function can be called with an initialized or uninitialized value. If value is initialized to a particular type, libxfconf will attempt to convert the value returned from the configuration store to that type if they don’t match. If the value type returned from the configuration store is an array type, each element of the array will be converted to the type of value. If value is uninitialized, the value in the configuration store will be returned in its native type.
- get_string(property, default_value)¶
- Parameters:
- Returns:
A newly-allocated string which should be freed with
GLib.free
() when no longer needed. If property is not in self, aGLib.strdup
()ed copy of default_value is returned.- Return type:
Retrieves the string value associated with property on self.
- get_string_list(property)¶
- Parameters:
property (
str
) – A property name.- Returns:
A newly-allocated string list which should be freed with
GLib.strfreev
() when no longer needed. If property is not in self,None
is returned.- Return type:
[
str
]
Retrieves the string list value associated with property on self.
- get_structv(property, value_struct, n_members, member_types)¶
- Parameters:
property (
str
) – A string property name.value_struct (
object
orNone
) – A pointer to a struct in which to store values.n_members (
int
) – The number of data members in the struct.member_types (
GObject.GType
) – An array of n_membersGObject.GType
s.
- Returns:
True
if the property was retrieved successfully,False
oherwise.- Return type:
Gets a property on self and stores it as members of the value_struct struct. The member_types array should hold a
GObject.GType
for each member of the struct.Note: Struct members can only be non-pointer types such as int, boolean, double, etc.
- get_uint(property, default_value)¶
- Parameters:
- Returns:
The uint value, or, if property is not in self, default_value is returned.
- Return type:
Retrieves the unsigned int value associated with property on self.
- get_uint64(property, default_value)¶
- Parameters:
- Returns:
The uint64 value, or, if property is not in self, default_value is returned.
- Return type:
Retrieves the 64-bit int value associated with property on self.
- has_property(property)¶
- Parameters:
property (
str
) – A property name.- Returns:
- Return type:
Checks to see if property exists on self.
- is_property_locked(property)¶
- Parameters:
property (
str
) – A property name.- Returns:
- Return type:
Queries whether or not property on self is locked by system policy. If the property is locked, calls to
Xfconf.Channel.set_property
() (or any of the “set” family of functions) orXfconf.Channel.reset_property
() will fail.New in version 4.5.91.
- reset_property(property_base, recursive)¶
- Parameters:
Resets properties starting at (and including) property_base. If recursive is
True
, will also reset all properties that are under property_base in the property hierarchy.A bit of an explanation as to what this function actually does: Since Xfconf backends are expected to support setting defaults via what you might call “optional schema,” you can’t really “remove” properties. Since the client library can’t know if a channel provides default values (or even if the backend supports it!), at best it can only reset properties to their default values.
The property_base parameter can be
None
or the empty string (“”), in which case the channel root (“/”) will be assumed. Of course,True
must be passed for recursive in this case.New in version 4.5.91.
- set_arrayv(property, values)¶
- Parameters:
property (
str
) – A property string.values ([
GObject.Value
]) – AGLib.PtrArray
ofGObject.Value
s.
- Returns:
- Return type:
Sets an array property on self, using the values in the provided values array.
- set_bool(property, value)¶
- Parameters:
- Returns:
- Return type:
Sets value for property on self in the configuration store.
- set_double(property, value)¶
- Parameters:
- Returns:
- Return type:
Sets value for property on self in the configuration store.
- set_int(property, value)¶
- Parameters:
- Returns:
- Return type:
Sets value for property on self in the configuration store.
- set_named_struct(property, struct_name, value_struct)¶
- Parameters:
- Returns:
- Return type:
Sets a property on self using the members of value_struct as the array of values. The struct_name parameter is the same name that must have been used to register the struct’s layout with
Xfconf.named_struct_register
().
- set_property(property, value)¶
- Parameters:
property (
str
) – A string property name.value (
GObject.Value
) – AGObject.Value
.
- Returns:
- Return type:
Sets the value stored in value to a property on self.
Note: The configuration store backend almost certainly supports only a restricted set of value types.
- set_string(property, value)¶
- Parameters:
- Returns:
- Return type:
Sets value for property on self in the configuration store.
- set_string_list(property, values)¶
- Parameters:
- Returns:
- Return type:
Sets values for property on self in the configuration store.
- set_structv(property, value_struct, n_members, member_types)¶
- Parameters:
property (
str
) – A string property name.value_struct (
object
orNone
) – A pointer to a struct from which to take values.n_members (
int
) – The number of data members in the struct.member_types (
GObject.GType
) – An array of n_membersGObject.GType
s.
- Returns:
- Return type:
Sets a property on self using the members of value_struct as a value array. The member_types array should hold a
GObject.GType
for each member of the struct.
- set_uint(property, value)¶
- Parameters:
- Returns:
- Return type:
Sets value for property on self in the configuration store.
Signal Details¶
- Xfconf.Channel.signals.property_changed(channel, property, value)¶
- Signal Name:
property-changed
- Flags:
- Parameters:
channel (
Xfconf.Channel
) – The object which received the signalproperty (
str
) – The property that changed.value (
GObject.Value
) – The new value.
Emitted whenever a property on channel has changed. If the change was caused by the removal of property, value will be unset; you should test this with
G_VALUE_TYPE(value) == G_TYPE_INVALID
Property Details¶
- Xfconf.Channel.props.channel_name¶
- Name:
channel-name
- Type:
- Default Value:
- Flags:
The string identifier used for this channel.
- Xfconf.Channel.props.is_singleton¶
- Name:
is-singleton
- Type:
- Default Value:
- Flags:
Identifies the instance of the class as a singleton instance or not. This is mainly used internally by
Xfconf.Channel
but may be useful for API users.