Xfconf-GObject Binding

Xfconf-GObject Binding — Functions to bind Xfconf properties to GObject properties

Synopsis

void                xfconf_g_property_bind              (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         GType xfconf_property_type,
                                                         gpointer object,
                                                         const gchar *object_property);
void                xfconf_g_property_unbind            (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         gpointer object,
                                                         const gchar *object_property);
void                xfconf_g_property_unbind_all        (gpointer object);
void                xfconf_g_property_bind_gdkcolor     (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         gpointer object,
                                                         const gchar *object_property);

Description

Often it may be useful to bind an Xfconf property to a GObject property. Settings dialogs often display the current value of an Xfconf property, and a user may edit the value to change the value in the Xfconf store. If the Xfconf property changes outside the settings dialog, the user will usually want to see the settings dialog automatically update to reflect the new value. With a single line of code, Xfconf's binding functionality can automate all this.

Details

xfconf_g_property_bind ()

void                xfconf_g_property_bind              (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         GType xfconf_property_type,
                                                         gpointer object,
                                                         const gchar *object_property);

Binds an Xfconf property to a GObject property. If the property is changed via either the GObject or Xfconf, the corresponding property will also be updated.

Note that xfconf_property_type is required since xfconf_property may or may not already exist in the Xfconf store. The type of object_property will be determined automatically. If the two types do not match, a conversion will be attempted.

channel :

An XfconfChannel.

xfconf_property :

A property on channel.

xfconf_property_type :

The type of xfconf_property.

object :

A GObject.

object_property :

A valid property on object.

xfconf_g_property_unbind ()

void                xfconf_g_property_unbind            (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         gpointer object,
                                                         const gchar *object_property);

Causes an Xfconf channel previously bound to a GObject property (see xfconf_g_property_bind()) to no longer be bound.

channel :

An XfconfChannel.

xfconf_property :

A bound property on channel.

object :

A GObject.

object_property :

A bound property on object.

xfconf_g_property_unbind_all ()

void                xfconf_g_property_unbind_all        (gpointer object);

Unbinds all Xfconf channel bindings (see xfconf_g_property_bind()) to the GObject.

object :

A GObject.

xfconf_g_property_bind_gdkcolor ()

void                xfconf_g_property_bind_gdkcolor     (XfconfChannel *channel,
                                                         const gchar *xfconf_property,
                                                         gpointer object,
                                                         const gchar *object_property);

Binds an Xfconf property to a GObject property of type GDK_TYPE_COLOR (aka a GdkColor struct). If the property is changed via either the GObject or Xfconf, the corresponding property will also be updated.

This is a special-case binding; the GdkColor struct is not ideal as-is for binding to a property, so it is stored in the Xfconf store as four 16-bit unsigned ints (red, green, blue, alpha). Since GdkColor (currently) only supports RGB and not RGBA, the last value will always be set to 0xFFFF.

channel :

An XfconfChannel.

xfconf_property :

A property on channel.

object :

A GObject.

object_property :

A valid property on object.