gi-clutter-1.0.3: clutter GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Clutter.Objects.State

Description

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

Since: 1.4

Synopsis

Exported types

newtype State Source #

Memory-managed wrapper type.

Constructors

State (ManagedPtr State) 

Instances

Instances details
Eq State Source # 
Instance details

Defined in GI.Clutter.Objects.State

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

GObject State Source # 
Instance details

Defined in GI.Clutter.Objects.State

ManagedPtrNewtype State Source # 
Instance details

Defined in GI.Clutter.Objects.State

Methods

toManagedPtr :: State -> ManagedPtr State

TypedObject State Source # 
Instance details

Defined in GI.Clutter.Objects.State

Methods

glibType :: IO GType

HasParentTypes State Source # 
Instance details

Defined in GI.Clutter.Objects.State

IsGValue (Maybe State) Source #

Convert State to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Clutter.Objects.State

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe State -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe State)

type ParentTypes State Source # 
Instance details

Defined in GI.Clutter.Objects.State

type ParentTypes State = '[Object, Scriptable]

class (GObject o, IsDescendantOf State o) => IsState o Source #

Type class for types which can be safely cast to State, for instance with toState.

Instances

Instances details
(GObject o, IsDescendantOf State o) => IsState o Source # 
Instance details

Defined in GI.Clutter.Objects.State

toState :: (MonadIO m, IsState o) => o -> m State Source #

Cast to State, for types for which this is known to be safe. For general casts, use castTo.

Methods

getAnimator

stateGetAnimator Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State instance.

-> Text

sourceStateName: the name of a source state

-> Text

targetStateName: the name of a target state

-> m Animator

Returns: a Animator instance, or Nothing

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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

Since: 1.4

getDuration

stateGetDuration Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> Maybe Text

sourceStateName: the name of the source state to get the duration of, or Nothing

-> Maybe Text

targetStateName: the name of the source state to get the duration of, or Nothing

-> m Word32

Returns: the duration, in milliseconds

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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 stateSetDuration

Since: 1.4

getKeys

stateGetKeys Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a, IsObject b) 
=> a

state: a State instance.

-> Maybe Text

sourceStateName: the source transition name to query, or Nothing for all source states

-> Maybe Text

targetStateName: the target transition name to query, or Nothing for all target states

-> Maybe b

object: the specific object instance to list keys for, or Nothing for all managed objects

-> Maybe Text

propertyName: the property name to search for, or Nothing for all properties.

-> m [StateKey]

Returns: a newly allocated List of StateKeys. The contents of the returned list are owned by the 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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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

Since: 1.4

getState

stateGetState Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> m Text

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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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 State::completed signal.

Since: 1.4

getStates

stateGetStates Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State instance.

-> m [Text]

Returns: a newly allocated List of state names. The contents of the returned List are owned by the 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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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

Since: 1.4

getTimeline

stateGetTimeline Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> m Timeline

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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Gets the timeline driving the State

Since: 1.4

new

stateNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m State

Returns: the newly create State instance

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Creates a new State

Since: 1.4

removeKey

stateRemoveKey Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a, IsObject b) 
=> a

state: a State instance.

-> Maybe Text

sourceStateName: the source state name to query, or Nothing for all source states

-> Maybe Text

targetStateName: the target state name to query, or Nothing for all target states

-> Maybe b

object: the specific object instance to list keys for, or Nothing for all managed objects

-> Maybe Text

propertyName: the property name to search for, or Nothing for all properties.

-> m () 

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Removes all keys matching the search criteria passed in arguments.

Since: 1.4

setAnimator

stateSetAnimator Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a, IsAnimator b) 
=> a

state: a State instance.

-> Text

sourceStateName: the name of a source state

-> Text

targetStateName: the name of a target state

-> Maybe b

animator: a Animator instance, or Nothing to unset an existing Animator

-> m () 

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Specifies a 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 State keys.

If animator is Nothing it will unset an existing animator.

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

Since: 1.4

setDuration

stateSetDuration Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> Maybe Text

sourceStateName: the name of the source state, or Nothing

-> Maybe Text

targetStateName: the name of the target state, or Nothing

-> Word32

duration: the duration of the transition, in milliseconds

-> m () 

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Sets the duration of a transition.

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

If only targetStateName 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.

Since: 1.4

setKey

stateSetKey Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a, IsObject b) 
=> a

state: a State instance.

-> Maybe Text

sourceStateName: the source transition to specify transition for, or Nothing to specify the default fallback when a more specific source state doesn't exist.

-> Text

targetStateName: the name of the transition to set a key value for.

-> b

object: the Object to set a key for

-> Text

propertyName: the property to set a key for

-> Word32

mode: the id of the alpha function to use

-> GValue

value: the value for property_name of object in state_name

-> Double

preDelay: relative time of the transition to be idle in the beginning of the transition

-> Double

postDelay: relative time of the transition to be idle in the end of the transition

-> m State

Returns: the State instance, allowing chaining of multiple calls

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

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

Since: 1.4

setState

stateSetState Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> Text

targetStateName: the state to transition to

-> m Timeline

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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Change the current state of State to targetStateName.

The state will animate during its transition, see clutter_state_warp_to_state for animation-free state switching.

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

Since: 1.4

warpToState

stateWarpToState Source #

Arguments

:: (HasCallStack, MonadIO m, IsState a) 
=> a

state: a State

-> Text

targetStateName: the state to transition to

-> m Timeline

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

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

Change to the specified target state immediately with no animation.

See stateSetState.

Since: 1.4

Properties

duration

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

Since: 1.4

constructStateDuration :: (IsState o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “duration” property. This is rarely needed directly, but it is used by new.

getStateDuration :: (MonadIO m, IsState o) => o -> m Word32 Source #

Get the value of the “duration” property. When overloading is enabled, this is equivalent to

get state #duration

setStateDuration :: (MonadIO m, IsState o) => o -> Word32 -> m () Source #

Set the value of the “duration” property. When overloading is enabled, this is equivalent to

set state [ #duration := value ]

state

The currently set target state, setting it causes the state machine to transition to the new state, use stateWarpToState to change state without a transition.

Since: 1.4

clearStateState :: (MonadIO m, IsState o) => o -> m () Source #

Set the value of the “state” property to Nothing. When overloading is enabled, this is equivalent to

clear #state

constructStateState :: (IsState o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “state” property. This is rarely needed directly, but it is used by new.

getStateState :: (MonadIO m, IsState o) => o -> m Text Source #

Get the value of the “state” property. When overloading is enabled, this is equivalent to

get state #state

setStateState :: (MonadIO m, IsState o) => o -> Text -> m () Source #

Set the value of the “state” property. When overloading is enabled, this is equivalent to

set state [ #state := value ]

Signals

completed

type StateCompletedCallback = IO () Source #

Deprecated: (Since version 1.12)Use KeyframeTransition and TransitionGroup instead

The completed signal is emitted when a State reaches the target state specified by stateSetState or stateWarpToState.

Since: 1.4

afterStateCompleted :: (IsState a, MonadIO m) => a -> ((?self :: a) => StateCompletedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the completed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after state #completed callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onStateCompleted :: (IsState a, MonadIO m) => a -> ((?self :: a) => StateCompletedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the completed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on state #completed callback