Clutter.BindingPool¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w/co |
The unique name of the binding pool |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Clutter.BindingPool(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Container of key bindings. The
Clutter.BindingPoolstruct 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, orNone- Return type:
Finds the
Clutter.BindingPoolwith name.New in version 1.0.
- classmethod get_for_class(klass)¶
- Parameters:
klass (
objectorNone) – aGObject.ObjectClasspointer- Returns:
the binding pool for the given class. The returned
Clutter.BindingPoolis owned by Clutter and should not be freed directly- Return type:
Retrieves the
Clutter.BindingPoolfor the givenGObject.Objectclass and, eventually, creates it. This function is a wrapper aroundClutter.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:
Creates a new
Clutter.BindingPoolthat can be used to store key bindings for an actor. The name must be a unique identifier for the binding pool, so thatClutter.BindingPool.find() will be able to return the correct binding pool.New in version 1.0.
- activate(key_val, modifiers, gobject)¶
- Parameters:
key_val (
int) – the key symbolmodifiers (
Clutter.ModifierType) – bitmask for the modifiersgobject (
GObject.Object) – aGObject.Object
- Returns:
Trueif an action was found and was activated- Return type:
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.Objectinstance is gobject and the user data is the one passed when installing the action withClutter.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 returnFalse.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:
key_val (
int) – a key symbolmodifiers (
Clutter.ModifierType) – a bitmask for the modifiers
- 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:
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:
action_name (
str) – the name of the actionkey_val (
int) – key symbolmodifiers (
Clutter.ModifierType) – bitmask of modifierscallback (
Clutter.BindingActionFunc) – function to be called when the action is activated
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 usingClutter.BindingPool.unblock_action().New in version 1.0.
- install_closure(action_name, key_val, modifiers, closure)¶
- Parameters:
action_name (
str) – the name of the actionkey_val (
int) – key symbolmodifiers (
Clutter.ModifierType) – bitmask of modifiersclosure (
GObject.Closure) – aGObject.Closure
A
GObject.Closurevariant ofClutter.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 usingClutter.BindingPool.unblock_action().New in version 1.0.
- override_action(key_val, modifiers, callback, *data)¶
- Parameters:
key_val (
int) – key symbolmodifiers (
Clutter.ModifierType) – bitmask of modifierscallback (
Clutter.BindingActionFunc) – function to be called when the action is activated
Allows overriding the action for key_val and modifiers inside a
Clutter.BindingPool. SeeClutter.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 usingClutter.BindingPool.unblock_action().New in version 1.0.
- override_closure(key_val, modifiers, closure)¶
- Parameters:
key_val (
int) – key symbolmodifiers (
Clutter.ModifierType) – bitmask of modifiersclosure (
GObject.Closure) – aGObject.Closure
A
GObject.Closurevariant ofClutter.BindingPool.override_action().Allows overriding the action for key_val and modifiers inside a
Clutter.BindingPool. SeeClutter.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 usingClutter.BindingPool.unblock_action().New in version 1.0.
- remove_action(key_val, modifiers)¶
- Parameters:
key_val (
int) – a key symbolmodifiers (
Clutter.ModifierType) – a bitmask for the modifiers
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 withClutter.BindingPool.block_action().New in version 1.0.
Property Details¶
- Clutter.BindingPool.props.name¶
- Name:
name- Type:
- Default Value:
- Flags:
The unique name of the
Clutter.BindingPool.New in version 1.0.