## ClutterConstraint ClutterConstraint — Abstract class for constraints on position or size |

## Synopsis

                        ClutterConstraint;
    struct              ClutterConstraintClass;

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActorMeta
                   +----ClutterConstraint
                         +----ClutterAlignConstraint
                         +----ClutterBindConstraint

## Description

ClutterConstraint is a base abstract class for modifiers of a ClutterActor position or size.

A ClutterConstraint sub-class should contain the logic for modifying the position or size of the ClutterActor to which it is applied, by updating the actor's allocation. Each ClutterConstraint can change the allocation of the actor to which they are applied by overriding the ``update_allocation()`` virtual function.

### Implemting a ClutterConstraint

Creating a sub-class of ClutterConstraint requires the implementation of the ``update_allocation()`` virtual function.

The ``update_allocation()`` virtual function is called during the allocation sequence of a ClutterActor, and allows any ClutterConstraint attached to that actor to modify the allocation before it is passed to the ``allocate()`` implementation.

The ClutterActorBox passed to the ``update_allocation()`` implementation contains the original allocation of the ClutterActor, plus the eventual modifications applied by the other ClutterConstraints.

### Note

Constraints are queried in the same order as they were applied using `clutter_actor_add_constraint()` or `clutter_actor_add_constraint_with_name()`.

It is not necessary for a ClutterConstraint sub-class to chain up to the parent's implementation.

If a ClutterConstraint is parametrized - i.e. if it contains properties that affect the way the constraint is implemented - it should call `clutter_actor_queue_relayout()` on the actor to which it is attached to whenever any parameter is changed. The actor to which it is attached can be recovered at any point using `clutter_actor_meta_get_actor()`.

ClutterConstraint is available since Clutter 1.4

## Details

### ClutterConstraint

    typedef struct _ClutterConstraint ClutterConstraint;

The ClutterConstraint structure contains only private data and should be accessed using the provided API

Since 1.4

### struct ClutterConstraintClass

    struct ClutterConstraintClass {
    };

The ClutterConstraintClass structure contains only private data

Since 1.4

## See Also

ClutterAction