## ClutterTransition

ClutterTransition — Transition between two values

## Functions

void | clutter_transition_set_from ()
void | clutter_transition_set_from_value ()
void | clutter_transition_set_to ()
void | clutter_transition_set_to_value ()
void | clutter_transition_set_interval ()
ClutterInterval * | clutter_transition_get_interval ()
void | clutter_transition_set_animatable ()
ClutterAnimatable * | clutter_transition_get_animatable ()
void | clutter_transition_set_remove_on_complete ()
gboolean | clutter_transition_get_remove_on_complete ()

## Properties

ClutterAnimatable * | animatable | Read / Write
ClutterInterval * | interval | Read / Write
gboolean | remove-on-complete | Read / Write

## Types and Values

| ClutterTransition
struct | ClutterTransitionClass

## Object Hierarchy

        GObject
        ╰── ClutterTimeline
            ╰── ClutterTransition
                ├── ClutterPropertyTransition
                ╰── ClutterTransitionGroup

## Implemented Interfaces

ClutterTransition implements ClutterScriptable.

## Description

ClutterTransition is an abstract subclass of ClutterTimeline that computes the interpolation between two values, stored by a ClutterInterval.

## Functions

### clutter_transition_set_from ()

    void
    clutter_transition_set_from (ClutterTransition *transition,
                                 GType value_type,
                                 ...);

Sets the initial value of the transition.

This is a convenience function that will either create the ClutterInterval used by `transition` , or will update it if the “interval” is already set.

If `transition` already has a “interval” set, then `value` must hold the same type, or a transformable type, as the interval's “value-type” property.

This is a convenience function for the C API; language bindings should use `clutter_transition_set_from_value()` instead.

[skip]

#### Parameters

transition | a ClutterTransition |
value_type | the type of the value to set |
... | the initial value |

Since: 1.12

### clutter_transition_set_from_value ()

    void
    clutter_transition_set_from_value (ClutterTransition *transition,
                                       const GValue *value);

Sets the initial value of the transition.

This is a convenience function that will either create the ClutterInterval used by `transition` , or will update it if the “interval” is already set.

This function will copy the contents of `value` , so it is safe to call `g_value_unset()` after it returns.

If `transition` already has a “interval” set, then `value` must hold the same type, or a transformable type, as the interval's “value-type” property.

This function is meant to be used by language bindings.

[rename-to clutter_transition_set_from]

#### Parameters

transition | a ClutterTransition |
value | a GValue with the initial value of the transition |

Since: 1.12

### clutter_transition_set_to ()

    void
    clutter_transition_set_to (ClutterTransition *transition,
                               GType value_type,
                               ...);

Sets the final value of the transition.

This is a convenience function that will either create the ClutterInterval used by `transition` , or will update it if the “interval” is already set.

If `transition` already has a “interval” set, then `value` must hold the same type, or a transformable type, as the interval's “value-type” property.

This is a convenience function for the C API; language bindings should use `clutter_transition_set_to_value()` instead.

[skip]

#### Parameters

transition | a ClutterTransition |
value_type | the type of the value to set |
... | the final value |

Since: 1.12

### clutter_transition_set_to_value ()

    void
    clutter_transition_set_to_value (ClutterTransition *transition,
                                     const GValue *value);

Sets the final value of the transition.

This is a convenience function that will either create the ClutterInterval used by `transition` , or will update it if the “interval” is already set.

This function will copy the contents of `value` , so it is safe to call `g_value_unset()` after it returns.

If `transition` already has a “interval” set, then `value` must hold the same type, or a transformable type, as the interval's “value-type” property.

This function is meant to be used by language bindings.

[rename-to clutter_transition_set_to]

#### Parameters

transition | a ClutterTransition |
value | a GValue with the final value of the transition |

Since: 1.12

### clutter_transition_set_interval ()

    void
    clutter_transition_set_interval (ClutterTransition *transition,
                                     ClutterInterval *interval);

Sets the “interval” property using `interval` .

The `transition` will acquire a reference on the `interval` , sinking the floating flag on it if necessary.

#### Parameters

transition | a ClutterTransition |
interval | a ClutterInterval, or `NULL`. | [allow-none]

Since: 1.10

### clutter_transition_get_interval ()

    ClutterInterval *
    clutter_transition_get_interval (ClutterTransition *transition);

Retrieves the interval set using `clutter_transition_set_interval()`

#### Parameters

transition | a ClutterTransition |

#### Returns

a ClutterInterval, or `NULL`; the returned interval is owned by the ClutterTransition and it should not be freed directly.

[transfer none]

Since: 1.10

### clutter_transition_set_animatable ()

    void
    clutter_transition_set_animatable (ClutterTransition *transition,
                                       ClutterAnimatable *animatable);

Sets the “animatable” property.

The `transition` will acquire a reference to the `animatable` instance, and will call the `ClutterTransitionClass.attached()` virtual function.

If an existing ClutterAnimatable is attached to `transition` , the reference will be released, and the `ClutterTransitionClass.detached()` virtual function will be called.

#### Parameters

transition | a ClutterTransition |
animatable | a ClutterAnimatable, or `NULL`. | [allow-none]

Since: 1.10

### clutter_transition_get_animatable ()

    ClutterAnimatable *
    clutter_transition_get_animatable (ClutterTransition *transition);

Retrieves the ClutterAnimatable set using `clutter_transition_set_animatable()`.

#### Parameters

transition | a ClutterTransition |

#### Returns

a ClutterAnimatable, or `NULL`; the returned animatable is owned by the ClutterTransition, and it should not be freed directly.

[transfer none]

Since: 1.10

### clutter_transition_set_remove_on_complete ()

    void
    clutter_transition_set_remove_on_complete
                                   (ClutterTransition *transition,
                                    gboolean remove_complete);

Sets whether `transition` should be detached from the ClutterAnimatable set using `clutter_transition_set_animatable()` when the “completed” signal is emitted.

#### Parameters

transition | a ClutterTransition |
remove_complete | whether to detach `transition` when complete |

Since: 1.10

### clutter_transition_get_remove_on_complete ()

    gboolean
    clutter_transition_get_remove_on_complete
                                   (ClutterTransition *transition);

Retrieves the value of the “remove-on-complete” property.

#### Parameters

transition | a ClutterTransition |

#### Returns

`TRUE` if the `transition` should be detached when complete, and `FALSE` otherwise

Since: 1.10

## Types and Values

### ClutterTransition

    typedef struct _ClutterTransition ClutterTransition;

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

Since: 1.10

### struct ClutterTransitionClass

    struct ClutterTransitionClass {
      void (* attached) (ClutterTransition *transition,
                         ClutterAnimatable *animatable);
      void (* detached) (ClutterTransition *transition,
                         ClutterAnimatable *animatable);

      void (* compute_value) (ClutterTransition *transition,
                              ClutterAnimatable *animatable,
                              ClutterInterval   *interval,
                              gdouble            progress);
    };

The ClutterTransitionClass structure contains private data.

#### Members

`attached` () | virtual function; called when a transition is attached to a ClutterAnimatable instance |
`detached` () | virtual function; called when a transition is detached from a ClutterAnimatable instance |
`compute_value` () | virtual function; called each frame to compute and apply the interpolation of the interval |

Since: 1.10

## Property Details

### The `“animatable”` property

      “animatable”               ClutterAnimatable *

The ClutterAnimatable instance currently being animated.

Flags: Read / Write

Since: 1.10

### The `“interval”` property

      “interval”                 ClutterInterval *

The ClutterInterval used to describe the initial and final states of the transition.

Flags: Read / Write

Since: 1.10

### The `“remove-on-complete”` property

      “remove-on-complete”       gboolean

Whether the ClutterTransition should be automatically detached from the “animatable” instance whenever the “stopped” signal is emitted.

The “remove-on-complete” property takes into account the value of the “repeat-count” property, and it only detaches the transition if the transition is not repeating.

Flags: Read / Write

Default value: FALSE

Since: 1.10