Clutter.BindingPool

g Clutter.BindingPool Clutter.BindingPool GObject.Object GObject.Object GObject.Object->Clutter.BindingPool

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

find (name)

class

get_for_class (klass)

class

new (name)

activate (key_val, modifiers, gobject)

block_action (action_name)

find_action (key_val, modifiers)

install_action (action_name, key_val, modifiers, callback, *data)

install_closure (action_name, key_val, modifiers, closure)

override_action (key_val, modifiers, callback, *data)

override_closure (key_val, modifiers, closure)

remove_action (key_val, modifiers)

unblock_action (action_name)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

The unique name of the binding pool

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Clutter.BindingPool(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Clutter.BindingPoolClass

Container of key bindings. The Clutter.BindingPool struct is private.

New in version 1.0.

classmethod find(name)
Parameters:

name (str) – the name of the binding pool to find

Returns:

a pointer to the Clutter.BindingPool, or None

Return type:

Clutter.BindingPool

Finds the Clutter.BindingPool with name.

New in version 1.0.

classmethod get_for_class(klass)
Parameters:

klass (object or None) – a GObject.ObjectClass pointer

Returns:

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

Return type:

Clutter.BindingPool

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

Calling this function multiple times will return the same Clutter.BindingPool.

A binding pool for a class can also be retrieved using Clutter.BindingPool.find() with the class type name:

pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance));

New in version 1.0.

classmethod new(name)
Parameters:

name (str) – the name of the binding pool

Returns:

the newly created binding pool with the given name. Use GObject.Object.unref() when done.

Return type:

Clutter.BindingPool

Creates a new Clutter.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 Clutter.BindingPool.find() will be able to return the correct binding pool.

New in version 1.0.

activate(key_val, modifiers, gobject)
Parameters:
Returns:

True if an action was found and was activated

Return type:

bool

Activates the callback associated to the action that is bound to the key_val 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 GObject.Object instance is gobject and the user data is the one passed when installing the action with Clutter.BindingPool.install_action().

If the action bound to the key_val, modifiers pair has been blocked using Clutter.BindingPool.block_action(), the callback will not be invoked, and this function will return False.

New in version 1.0.

block_action(action_name)
Parameters:

action_name (str) – an action name

Blocks all the actions with name action_name inside self.

New in version 1.0.

find_action(key_val, modifiers)
Parameters:
Returns:

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

Return type:

str

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

New in version 1.0.

install_action(action_name, key_val, modifiers, callback, *data)
Parameters:

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

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

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

Actions can be blocked with Clutter.BindingPool.block_action() and then unblocked using Clutter.BindingPool.unblock_action().

New in version 1.0.

install_closure(action_name, key_val, modifiers, closure)
Parameters:

A GObject.Closure variant of Clutter.BindingPool.install_action().

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

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

When an action has been activated using Clutter.BindingPool.activate() the passed closure will be invoked.

Actions can be blocked with Clutter.BindingPool.block_action() and then unblocked using Clutter.BindingPool.unblock_action().

New in version 1.0.

override_action(key_val, modifiers, callback, *data)
Parameters:

Allows overriding the action for key_val and modifiers inside a Clutter.BindingPool. See Clutter.BindingPool.install_action().

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

Actions can be blocked with Clutter.BindingPool.block_action() and then unblocked using Clutter.BindingPool.unblock_action().

New in version 1.0.

override_closure(key_val, modifiers, closure)
Parameters:

A GObject.Closure variant of Clutter.BindingPool.override_action().

Allows overriding the action for key_val and modifiers inside a Clutter.BindingPool. See Clutter.BindingPool.install_closure().

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

Actions can be blocked with Clutter.BindingPool.block_action() and then unblocked using Clutter.BindingPool.unblock_action().

New in version 1.0.

remove_action(key_val, modifiers)
Parameters:

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

New in version 1.0.

unblock_action(action_name)
Parameters:

action_name (str) – an action name

Unblockes all the actions with name action_name inside self.

Unblocking an action does not cause the callback bound to it to be invoked in case Clutter.BindingPool.activate() was called on an action previously blocked with Clutter.BindingPool.block_action().

New in version 1.0.

Property Details

Clutter.BindingPool.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The unique name of the Clutter.BindingPool.

New in version 1.0.