Clutter.State

g Clutter.Scriptable Clutter.Scriptable Clutter.State Clutter.State Clutter.Scriptable->Clutter.State GObject.GInterface GObject.GInterface GObject.GInterface->Clutter.Scriptable GObject.Object GObject.Object GObject.Object->Clutter.State

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Clutter.Scriptable (4)

Structs:

GObject.ObjectClass (5)

class

new ()

get_animator (source_state_name, target_state_name)

get_duration (source_state_name, target_state_name)

get_keys (source_state_name, target_state_name, object, property_name)

get_state ()

get_states ()

get_timeline ()

remove_key (source_state_name, target_state_name, object, property_name)

set_animator (source_state_name, target_state_name, animator)

set_duration (source_state_name, target_state_name, duration)

set_key (source_state_name, target_state_name, object, property_name, mode, value, pre_delay, post_delay)

set_state (target_state_name)

warp_to_state (target_state_name)

Virtual Methods

Inherited:

GObject.Object (7), Clutter.Scriptable (4)

do_completed ()

Properties

Name

Type

Flags

Short Description

duration

int

r/w

Default transition duration deprecated

state

str

r/w

Currently set state, (transition to this state might not be complete) deprecated

Signals

Inherited:

GObject.Object (1)

Name

Short Description

completed

The ::completed signal is emitted when a Clutter.State reaches the target state specified by Clutter.State.set_state() or Clutter.State.warp_to_state(). deprecated

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Clutter.State(**kwargs)
Bases:

GObject.Object, Clutter.Scriptable

Abstract:

No

Structure:

Clutter.StateClass

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

New in version 1.4.

classmethod new()
Returns:

the newly create Clutter.State instance

Return type:

Clutter.State

Creates a new Clutter.State

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_animator(source_state_name, target_state_name)
Parameters:
  • source_state_name (str) – the name of a source state

  • target_state_name (str) – the name of a target state

Returns:

a Clutter.Animator instance, or None

Return type:

Clutter.Animator

Retrieves the Clutter.Animator that is being used for transitioning between the two states, if any has been set

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_duration(source_state_name, target_state_name)
Parameters:
  • source_state_name (str or None) – the name of the source state to get the duration of, or None

  • target_state_name (str or None) – the name of the source state to get the duration of, or None

Returns:

the duration, in milliseconds

Return type:

int

Queries the duration used for transitions between a source and target state pair

The semantics for the query are the same as the semantics used for setting the duration with Clutter.State.set_duration()

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_keys(source_state_name, target_state_name, object, property_name)
Parameters:
  • source_state_name (str or None) – the source transition name to query, or None for all source states

  • target_state_name (str or None) – the target transition name to query, or None for all target states

  • object (GObject.Object or None) – the specific object instance to list keys for, or None for all managed objects

  • property_name (str or None) – the property name to search for, or None for all properties.

Returns:

a newly allocated GLib.List of Clutter.StateKey s. The contents of the returned list are owned by the Clutter.State and should not be modified or freed. Use g_list_free() to free the resources allocated by the returned list when done using it

Return type:

[Clutter.StateKey]

Returns a list of pointers to opaque structures with accessor functions that describe the keys added to an animator.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_state()
Returns:

a string containing the target state. The returned string is owned by the Clutter.State and should not be modified or freed

Return type:

str

Queries the currently set target state.

During a transition this function will return the target of the transition.

This function is useful when called from handlers of the Clutter.State ::completed signal.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_states()
Returns:

a newly allocated GLib.List of state names. The contents of the returned GLib.List are owned by the Clutter.State and should not be modified or freed. Use g_list_free() to free the resources allocated by the returned list when done using it

Return type:

[str]

Gets a list of all the state names managed by this Clutter.State.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

get_timeline()
Returns:

the Clutter.Timeline that drives the state change animations. The returned timeline is owned by the Clutter.State and it should not be unreferenced directly

Return type:

Clutter.Timeline

Gets the timeline driving the Clutter.State

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

remove_key(source_state_name, target_state_name, object, property_name)
Parameters:
  • source_state_name (str or None) – the source state name to query, or None for all source states

  • target_state_name (str or None) – the target state name to query, or None for all target states

  • object (GObject.Object or None) – the specific object instance to list keys for, or None for all managed objects

  • property_name (str or None) – the property name to search for, or None for all properties.

Removes all keys matching the search criteria passed in arguments.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

set_animator(source_state_name, target_state_name, animator)
Parameters:

Specifies a Clutter.Animator to be used when transitioning between the two named states.

The animator allows specifying a transition between the state that is more elaborate than the basic transitions allowed by the tweening of properties defined in the Clutter.State keys.

If animator is None it will unset an existing animator.

Clutter.State will take a reference on the passed animator, if any

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

set_duration(source_state_name, target_state_name, duration)
Parameters:
  • source_state_name (str or None) – the name of the source state, or None

  • target_state_name (str or None) – the name of the target state, or None

  • duration (int) – the duration of the transition, in milliseconds

Sets the duration of a transition.

If both state names are None the default duration for self is set.

If only target_state_name is specified, the passed duration becomes the default duration for transitions to the target state.

If both states names are specified, the passed duration only applies to the specified transition.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

set_key(source_state_name, target_state_name, object, property_name, mode, value, pre_delay, post_delay)
Parameters:
  • source_state_name (str or None) – the source transition to specify transition for, or None to specify the default fallback when a more specific source state doesn’t exist.

  • target_state_name (str) – the name of the transition to set a key value for.

  • object (GObject.Object) – the GObject.Object to set a key for

  • property_name (str) – the property to set a key for

  • mode (int) – the id of the alpha function to use

  • value (GObject.Value) – the value for property_name of object in state_name

  • pre_delay (float) – relative time of the transition to be idle in the beginning of the transition

  • post_delay (float) – relative time of the transition to be idle in the end of the transition

Returns:

the Clutter.State instance, allowing chaining of multiple calls

Return type:

Clutter.State

Sets one specific end key for a state name, object, property_name combination.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

set_state(target_state_name)
Parameters:

target_state_name (str) – the state to transition to

Returns:

the Clutter.Timeline that drives the state transition. The returned timeline is owned by the Clutter.State and it should not be unreferenced

Return type:

Clutter.Timeline

Change the current state of Clutter.State to target_state_name.

The state will animate during its transition, see Clutter.State.warp_to_state for animation-free state switching.

Setting a None state will stop the current animation and unset the current state, but keys will be left intact.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

warp_to_state(target_state_name)
Parameters:

target_state_name (str) – the state to transition to

Returns:

the Clutter.Timeline that drives the state transition. The returned timeline is owned by the Clutter.State and it should not be unreferenced

Return type:

Clutter.Timeline

Change to the specified target state immediately with no animation.

See Clutter.State.set_state().

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

do_completed() virtual

Signal Details

Clutter.State.signals.completed(state)
Signal Name:

completed

Flags:

RUN_LAST

Parameters:

state (Clutter.State) – The object which received the signal

The ::completed signal is emitted when a Clutter.State reaches the target state specified by Clutter.State.set_state() or Clutter.State.warp_to_state().

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

Property Details

Clutter.State.props.duration
Name:

duration

Type:

int

Default Value:

1000

Flags:

READABLE, WRITABLE

Default duration used if an duration has not been specified for a specific source/target state pair. The values is in milliseconds.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead

Clutter.State.props.state
Name:

state

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The currently set target state, setting it causes the state machine to transition to the new state, use Clutter.State.warp_to_state() to change state without a transition.

New in version 1.4.

Deprecated since version 1.12: Use Clutter.KeyframeTransition and Clutter.TransitionGroup instead