gi-clutter-1.0.5: 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.BindingPool

Description

Container of key bindings. The BindingPool struct is private.

Since: 1.0

Synopsis

Exported types

newtype BindingPool Source #

Memory-managed wrapper type.

Constructors

BindingPool (ManagedPtr BindingPool) 

Instances

Instances details
Eq BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

GObject BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

ManagedPtrNewtype BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

Methods

toManagedPtr :: BindingPool -> ManagedPtr BindingPool

TypedObject BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

Methods

glibType :: IO GType

HasParentTypes BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

IsGValue (Maybe BindingPool) Source #

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

Instance details

Defined in GI.Clutter.Objects.BindingPool

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes BindingPool Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

type ParentTypes BindingPool = '[Object]

class (GObject o, IsDescendantOf BindingPool o) => IsBindingPool o Source #

Type class for types which can be safely cast to BindingPool, for instance with toBindingPool.

Instances

Instances details
(GObject o, IsDescendantOf BindingPool o) => IsBindingPool o Source # 
Instance details

Defined in GI.Clutter.Objects.BindingPool

toBindingPool :: (MonadIO m, IsBindingPool o) => o -> m BindingPool Source #

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

Methods

activate

bindingPoolActivate Source #

Arguments

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

pool: a BindingPool

-> Word32

keyVal: the key symbol

-> [ModifierType]

modifiers: bitmask for the modifiers

-> b

gobject: a Object

-> m Bool

Returns: True if an action was found and was activated

Activates the callback associated to the action that is bound to the keyVal and modifiers pair.

The callback has the following signature:

 void (* callback) (GObject             *gobject,
                    const gchar         *action_name,
                    guint                key_val,
                    ClutterModifierType  modifiers,
                    gpointer             user_data);

Where the Object instance is gobject and the user data is the one passed when installing the action with bindingPoolInstallAction.

If the action bound to the keyVal, modifiers pair has been blocked using bindingPoolBlockAction, the callback will not be invoked, and this function will return False.

Since: 1.0

blockAction

bindingPoolBlockAction Source #

Arguments

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

pool: a BindingPool

-> Text

actionName: an action name

-> m () 

Blocks all the actions with name actionName inside pool.

Since: 1.0

find

bindingPoolFind Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the binding pool to find

-> m BindingPool

Returns: a pointer to the BindingPool, or Nothing

Finds the BindingPool with name.

Since: 1.0

findAction

bindingPoolFindAction Source #

Arguments

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

pool: a BindingPool

-> Word32

keyVal: a key symbol

-> [ModifierType]

modifiers: a bitmask for the modifiers

-> m Text

Returns: the name of the action, if found, or Nothing. The returned string is owned by the binding pool and should never be modified or freed

Retrieves the name of the action matching the given key symbol and modifiers bitmask.

Since: 1.0

getForClass

bindingPoolGetForClass Source #

Arguments

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

klass: a ObjectClass pointer

-> m BindingPool

Returns: the binding pool for the given class. The returned BindingPool is owned by Clutter and should not be freed directly

Retrieves the BindingPool for the given Object class and, eventually, creates it. This function is a wrapper around bindingPoolNew and uses the class type name as the unique name for the binding pool.

Calling this function multiple times will return the same BindingPool.

A binding pool for a class can also be retrieved using bindingPoolFind with the class type name:

 pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance));

Since: 1.0

installAction

bindingPoolInstallAction Source #

Arguments

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

pool: a BindingPool

-> Text

actionName: the name of the action

-> Word32

keyVal: key symbol

-> [ModifierType]

modifiers: bitmask of modifiers

-> BindingActionFunc

callback: function to be called when the action is activated

-> m () 

Installs a new action inside a BindingPool. The action is bound to keyVal and modifiers.

The same action name can be used for multiple keyVal, modifiers pairs.

When an action has been activated using bindingPoolActivate the passed callback will be invoked (with data).

Actions can be blocked with bindingPoolBlockAction and then unblocked using bindingPoolUnblockAction.

Since: 1.0

installClosure

bindingPoolInstallClosure Source #

Arguments

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

pool: a BindingPool

-> Text

actionName: the name of the action

-> Word32

keyVal: key symbol

-> [ModifierType]

modifiers: bitmask of modifiers

-> GClosure b

closure: a Closure

-> m () 

A Closure variant of bindingPoolInstallAction.

Installs a new action inside a BindingPool. The action is bound to keyVal and modifiers.

The same action name can be used for multiple keyVal, modifiers pairs.

When an action has been activated using bindingPoolActivate the passed closure will be invoked.

Actions can be blocked with bindingPoolBlockAction and then unblocked using bindingPoolUnblockAction.

Since: 1.0

new

bindingPoolNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the binding pool

-> m BindingPool

Returns: the newly created binding pool with the given name. Use objectUnref when done.

Creates a new BindingPool that can be used to store key bindings for an actor. The name must be a unique identifier for the binding pool, so that bindingPoolFind will be able to return the correct binding pool.

Since: 1.0

overrideAction

bindingPoolOverrideAction Source #

Arguments

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

pool: a BindingPool

-> Word32

keyVal: key symbol

-> [ModifierType]

modifiers: bitmask of modifiers

-> BindingActionFunc

callback: function to be called when the action is activated

-> m () 

Allows overriding the action for keyVal and modifiers inside a BindingPool. See bindingPoolInstallAction.

When an action has been activated using bindingPoolActivate the passed callback will be invoked (with data).

Actions can be blocked with bindingPoolBlockAction and then unblocked using bindingPoolUnblockAction.

Since: 1.0

overrideClosure

bindingPoolOverrideClosure Source #

Arguments

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

pool: a BindingPool

-> Word32

keyVal: key symbol

-> [ModifierType]

modifiers: bitmask of modifiers

-> GClosure b

closure: a Closure

-> m () 

A Closure variant of bindingPoolOverrideAction.

Allows overriding the action for keyVal and modifiers inside a BindingPool. See bindingPoolInstallClosure.

When an action has been activated using bindingPoolActivate the passed callback will be invoked (with data).

Actions can be blocked with bindingPoolBlockAction and then unblocked using bindingPoolUnblockAction.

Since: 1.0

removeAction

bindingPoolRemoveAction Source #

Arguments

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

pool: a BindingPool

-> Word32

keyVal: a key symbol

-> [ModifierType]

modifiers: a bitmask for the modifiers

-> m () 

Removes the action matching the given keyVal, modifiers pair, if any exists.

Since: 1.0

unblockAction

bindingPoolUnblockAction Source #

Arguments

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

pool: a BindingPool

-> Text

actionName: an action name

-> m () 

Unblockes all the actions with name actionName inside pool.

Unblocking an action does not cause the callback bound to it to be invoked in case bindingPoolActivate was called on an action previously blocked with bindingPoolBlockAction.

Since: 1.0

Properties

name

The unique name of the BindingPool.

Since: 1.0

constructBindingPoolName :: (IsBindingPool o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getBindingPoolName :: (MonadIO m, IsBindingPool o) => o -> m (Maybe Text) Source #

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

get bindingPool #name