## GObject Property Bindings

GObject Property Bindings

## Synopsis

                        EBinding;
                        EMutualBinding;
    gboolean            (*EBindingTransform)                (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);
    EBinding *          e_binding_new                       (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property);
    EBinding *          e_binding_new_full                  (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property,
                                                             EBindingTransform transform,
                                                             GDestroyNotify destroy_notify,
                                                             gpointer user_data);
    EBinding *          e_binding_new_with_negation         (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property);
    void                e_binding_unbind                    (EBinding *binding);
    EMutualBinding *    e_mutual_binding_new                (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2);
    EMutualBinding *    e_mutual_binding_new_full           (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2,
                                                             EBindingTransform transform,
                                                             EBindingTransform reverse_transform,
                                                             GDestroyNotify destroy_notify,
                                                             gpointer user_data);
    EMutualBinding *    e_mutual_binding_new_with_negation  (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2);
    void                e_mutual_binding_unbind             (EMutualBinding *binding);
    gboolean            e_binding_transform_color_to_string (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);
    gboolean            e_binding_transform_string_to_color (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);

## Description

## Details

### EBinding

    typedef struct {
    } EBinding;

### EMutualBinding

    typedef struct {
    } EMutualBinding;

### EBindingTransform ()

    gboolean            (*EBindingTransform)                (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);

`src_value` : |
`dst_value` : |
`user_data` : |
Returns : |

### e_binding_new ()

    EBinding *          e_binding_new                       (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property);

One-way binds `src_property` in `src_object` to `dst_property` in `dst_object`.

Before binding the value of `dst_property` is set to the value of `src_property`.

`src_object` : | The source GObject.
`src_property` : | The name of the property to bind from.
`dst_object` : | The destination GObject.
`dst_property` : | The name of the property to bind to.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects is finalized.

### e_binding_new_full ()

    EBinding *          e_binding_new_full                  (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property,
                                                             EBindingTransform transform,
                                                             GDestroyNotify destroy_notify,
                                                             gpointer user_data);

One-way binds `src_property` in `src_object` to `dst_property` in `dst_object`.

Before binding the value of `dst_property` is set to the value of `src_property`.

`src_object` : | The source GObject.
`src_property` : | The name of the property to bind from.
`dst_object` : | The destination GObject.
`dst_property` : | The name of the property to bind to.
`transform` : | Transformation function or `NULL`.
`destroy_notify` : | Callback function that is called on disconnection with `user_data` or `NULL`.
`user_data` : | User data associated with the binding.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects is finalized.

### e_binding_new_with_negation ()

    EBinding *          e_binding_new_with_negation         (gpointer src_object,
                                                             const gchar *src_property,
                                                             gpointer dst_object,
                                                             const gchar *dst_property);

Convenience function for binding with boolean negation of value.

`src_object` : | The source GObject.
`src_property` : | The name of the property to bind from.
`dst_object` : | The destination GObject.
`dst_property` : | The name of the property to bind to.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects is finalized.

### e_binding_unbind ()

    void                e_binding_unbind                    (EBinding *binding);

Disconnects the binding between two properties. Should be rarely used by applications.

This functions also calls the `destroy_notify` function that was specified when `binding` was created.

`binding` : | An EBinding to unbind.

### e_mutual_binding_new ()

    EMutualBinding *    e_mutual_binding_new                (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2);

Mutually binds values of two properties.

Before binding the value of `property2` is set to the value of `property1`.

`object1` : | The first GObject.
`property1` : | The first property to bind.
`object2` : | The second GObject.
`property2` : | The second property to bind.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects is finalized.

### e_mutual_binding_new_full ()

    EMutualBinding *    e_mutual_binding_new_full           (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2,
                                                             EBindingTransform transform,
                                                             EBindingTransform reverse_transform,
                                                             GDestroyNotify destroy_notify,
                                                             gpointer user_data);

Mutually binds values of two properties.

Before binding the value of `property2` is set to the value of `property1`.

Both `transform` and `reverse_transform` should simultaneously be `NULL` or non-`NULL`. If they are non-`NULL`, they should be reverse in each other.

`object1` : | The first GObject.
`property1` : | The first property to bind.
`object2` : | The second GObject.
`property2` : | The second property to bind.
`transform` : | Transformation function or `NULL`.
`reverse_transform` : | The inverse transformation function or `NULL`.
`destroy_notify` : | Callback function called on disconnection with `user_data` as argument or `NULL`.
`user_data` : | User data associated with the binding.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects is finalized.

### e_mutual_binding_new_with_negation ()

    EMutualBinding *    e_mutual_binding_new_with_negation  (gpointer object1,
                                                             const gchar *property1,
                                                             gpointer object2,
                                                             const gchar *property2);

Convenience function for binding with boolean negation of value.

`object1` : | The first GObject.
`property1` : | The first property to bind.
`object2` : | The second GObject.
`property2` : | The second property to bind.
Returns : | The descriptor of the binding. It is automatically removed if one of the objects if finalized.

### e_mutual_binding_unbind ()

    void                e_mutual_binding_unbind             (EMutualBinding *binding);

Disconnects the binding between two properties. Should be rarely used by applications.

This functions also calls the `destroy_notify` function that was specified when `binding` was created.

`binding` : | An EMutualBinding to unbind.

### e_binding_transform_color_to_string ()

    gboolean            e_binding_transform_color_to_string (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);

Transforms a GdkColor value to a color string specification.

`src_value` : | a GValue of type GDK_TYPE_COLOR
`dst_value` : | a GValue of type G_TYPE_STRING
`user_data` : | not used
Returns : | `TRUE` always

### e_binding_transform_string_to_color ()

    gboolean            e_binding_transform_string_to_color (const GValue *src_value,
                                                             GValue *dst_value,
                                                             gpointer user_data);

Transforms a color string specification to a GdkColor.

`src_value` : | a GValue of type G_TYPE_STRING
`dst_value` : | a GValue of type GDK_TYPE_COLOR
`user_data` : | not used
Returns : | `TRUE` if color string specification was valid