Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Clutter.Objects.Behaviour
Description
Behaviour
-struct contains only private data and should
be accessed with the functions below.
Since: 0.2
Synopsis
- newtype Behaviour = Behaviour (ManagedPtr Behaviour)
- class (GObject o, IsDescendantOf Behaviour o) => IsBehaviour o
- toBehaviour :: (MonadIO m, IsBehaviour o) => o -> m Behaviour
- behaviourActorsForeach :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> BehaviourForeachFunc -> m ()
- behaviourApply :: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) => a -> b -> m ()
- behaviourGetActors :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> m [Actor]
- behaviourGetAlpha :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> m Alpha
- behaviourGetNActors :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> m Int32
- behaviourGetNthActor :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> Int32 -> m Actor
- behaviourIsApplied :: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) => a -> b -> m Bool
- behaviourRemove :: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) => a -> b -> m ()
- behaviourRemoveAll :: (HasCallStack, MonadIO m, IsBehaviour a) => a -> m ()
- behaviourSetAlpha :: (HasCallStack, MonadIO m, IsBehaviour a, IsAlpha b) => a -> b -> m ()
- constructBehaviourAlpha :: (IsBehaviour o, MonadIO m, IsAlpha a) => a -> m (GValueConstruct o)
- getBehaviourAlpha :: (MonadIO m, IsBehaviour o) => o -> m Alpha
- setBehaviourAlpha :: (MonadIO m, IsBehaviour o, IsAlpha a) => o -> a -> m ()
- type BehaviourAppliedCallback = Actor -> IO ()
- afterBehaviourApplied :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourAppliedCallback) -> m SignalHandlerId
- onBehaviourApplied :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourAppliedCallback) -> m SignalHandlerId
- type BehaviourRemovedCallback = Actor -> IO ()
- afterBehaviourRemoved :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourRemovedCallback) -> m SignalHandlerId
- onBehaviourRemoved :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourRemovedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Behaviour Source # | |
GObject Behaviour Source # | |
Defined in GI.Clutter.Objects.Behaviour | |
ManagedPtrNewtype Behaviour Source # | |
Defined in GI.Clutter.Objects.Behaviour Methods toManagedPtr :: Behaviour -> ManagedPtr Behaviour | |
TypedObject Behaviour Source # | |
Defined in GI.Clutter.Objects.Behaviour | |
HasParentTypes Behaviour Source # | |
Defined in GI.Clutter.Objects.Behaviour | |
IsGValue (Maybe Behaviour) Source # | Convert |
Defined in GI.Clutter.Objects.Behaviour Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Behaviour -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Behaviour) | |
type ParentTypes Behaviour Source # | |
Defined in GI.Clutter.Objects.Behaviour |
class (GObject o, IsDescendantOf Behaviour o) => IsBehaviour o Source #
Type class for types which can be safely cast to Behaviour
, for instance with toBehaviour
.
Instances
(GObject o, IsDescendantOf Behaviour o) => IsBehaviour o Source # | |
Defined in GI.Clutter.Objects.Behaviour |
toBehaviour :: (MonadIO m, IsBehaviour o) => o -> m Behaviour Source #
Methods
Click to display all available methods, including inherited ones
Methods
actorsForeach, apply, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isApplied, isFloating, notify, notifyByPspec, parseCustomNode, ref, refSink, remove, removeAll, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getActors, getAlpha, getData, getId, getNActors, getNthActor, getProperty, getQdata.
Setters
setAlpha, setCustomProperty, setData, setDataFull, setId, setProperty.
actorsForeach
behaviourActorsForeach Source #
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> BehaviourForeachFunc |
|
-> m () |
Deprecated: (Since version 1.6)
Calls func
for every actor driven by behave
.
Since: 0.2
apply
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) | |
=> a |
|
-> b |
|
-> m () |
Deprecated: (Since version 1.6)
Applies behave
to actor
. This function adds a reference on
the actor.
Since: 0.2
getActors
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> m [Actor] | Returns: a list of
actors. You should free the returned list with |
Deprecated: (Since version 1.6)
Retrieves all the actors to which behave
applies. It is not recommended
for derived classes to use this in there alpha notify method but use
clutter_behaviour_actors_foreach
as it avoids alot of needless allocations.
Since: 0.2
getAlpha
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> m Alpha | Returns: a |
getNActors
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> m Int32 | Returns: The number of applied actors |
Deprecated: (Since version 1.6)
Gets the number of actors this behaviour is applied too.
Since: 0.2
getNthActor
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> Int32 |
|
-> m Actor | Returns: A Clutter actor or NULL if |
Deprecated: (Since version 1.6)
Gets an actor the behaviour was applied to referenced by index num.
Since: 0.2
isApplied
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: TRUE if actor has behaviour. FALSE otherwise. |
Deprecated: (Since version 1.6)
Check if behave
applied to actor
.
Since: 0.4
remove
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a, IsActor b) | |
=> a |
|
-> b |
|
-> m () |
Deprecated: (Since version 1.6)
Removes actor
from the list of Actor
s to which
behave
applies. This function removes a reference on the actor.
Since: 0.2
removeAll
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a) | |
=> a |
|
-> m () |
Deprecated: (Since version 1.6)
Removes every actor from the list that behave
holds.
Since: 0.4
setAlpha
Arguments
:: (HasCallStack, MonadIO m, IsBehaviour a, IsAlpha b) | |
=> a |
|
-> b | |
-> m () |
Deprecated: (Since version 1.6)
Binds alpha
to a Behaviour
. The Alpha
object
is what makes a behaviour work: for each tick of the timeline
used by Alpha
a new value of the alpha parameter is
computed by the alpha function; the value should be used by
the Behaviour
to update one or more properties of the
actors to which the behaviour applies.
If alpha
is not Nothing
, the Behaviour
will take ownership
of the Alpha
instance.
Since: 0.2
Properties
alpha
The Alpha
object used to drive this behaviour. A Alpha
object binds a Timeline
and a function which computes a value
(the "alpha") depending on the time. Each time the alpha value changes
the alpha-notify virtual function is called.
Since: 0.2
constructBehaviourAlpha :: (IsBehaviour o, MonadIO m, IsAlpha a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “alpha
” property. This is rarely needed directly, but it is used by new
.
getBehaviourAlpha :: (MonadIO m, IsBehaviour o) => o -> m Alpha Source #
Get the value of the “alpha
” property.
When overloading is enabled, this is equivalent to
get
behaviour #alpha
setBehaviourAlpha :: (MonadIO m, IsBehaviour o, IsAlpha a) => o -> a -> m () Source #
Set the value of the “alpha
” property.
When overloading is enabled, this is equivalent to
set
behaviour [ #alpha:=
value ]
Signals
applied
type BehaviourAppliedCallback Source #
Deprecated: (Since version 1.6)
The apply signal is emitted each time the behaviour is applied to an actor.
Since: 0.4
afterBehaviourApplied :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourAppliedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the applied signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
behaviour #applied 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.
onBehaviourApplied :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourAppliedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the applied signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
behaviour #applied callback
removed
type BehaviourRemovedCallback Source #
Deprecated: (Since version 1.6)
The removed signal is emitted each time a behaviour is not applied to an actor anymore.
Since: 0.4
afterBehaviourRemoved :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the removed signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
behaviour #removed 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.
onBehaviourRemoved :: (IsBehaviour a, MonadIO m) => a -> ((?self :: a) => BehaviourRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the removed signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
behaviour #removed callback