Class: Clutter::BindingPool
- Inherits:
-
Object
- Object
- Clutter::BindingPool
- Defined in:
- (unknown)
Class Method Summary collapse
-
.find(name) ⇒ Clutter::BindingPool
Finds the Clutter::BindingPool with name.
-
.get_for_class(klass) ⇒ Clutter::BindingPool
Retrieves the Clutter::BindingPool for the given #GObject class and, eventually, creates it.
Instance Method Summary collapse
-
#activate(key_val, modifiers, gobject) ⇒ Boolean
Activates the callback associated to the action that is bound to the key_val and modifiers pair.
-
#block_action(action_name) ⇒ nil
Blocks all the actions with name action_name inside pool.
-
#find_action(key_val, modifiers) ⇒ String
Retrieves the name of the action matching the given key symbol and modifiers bitmask.
-
#initialize(name) ⇒ Clutter::BindingPool
constructor
Creates a new Clutter::BindingPool that can be used to store key bindings for an actor.
-
#install_action(action_name, key_val, modifiers, callback, data, notify) ⇒ nil
Installs a new action inside a Clutter::BindingPool.
-
#install_closure(action_name, key_val, modifiers, closure) ⇒ nil
A #GClosure variant of clutter_binding_pool_install_action().
-
#name ⇒ String
The unique name of the Clutter::BindingPool.
-
#name=(name) ⇒ String
The unique name of the Clutter::BindingPool.
-
#override_action(key_val, modifiers, callback, data, notify) ⇒ nil
Allows overriding the action for key_val and modifiers inside a Clutter::BindingPool.
-
#override_closure(key_val, modifiers, closure) ⇒ nil
A #GClosure variant of clutter_binding_pool_override_action().
-
#remove_action(key_val, modifiers) ⇒ nil
Removes the action matching the given key_val, modifiers pair, if any exists.
-
#unblock_action(action_name) ⇒ nil
Unblockes all the actions with name action_name inside pool.
Constructor Details
#initialize(name) ⇒ 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_binding_pool_find() will be able to return the correct binding pool.
Class Method Details
.find(name) ⇒ Clutter::BindingPool
Finds the Clutter::BindingPool with name.
.get_for_class(klass) ⇒ Clutter::BindingPool
Retrieves the Clutter::BindingPool for the given #GObject class and, eventually, creates it. This function is a wrapper around clutter_binding_pool_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_binding_pool_find() with the class type name:
|[ pool = clutter_binding_pool_find (G_OBJECT_TYPE_NAME (instance)); ]|
Instance Method Details
#activate(key_val, modifiers, gobject) ⇒ Boolean
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 instance is gobject and the user data is the one passed when installing the action with clutter_binding_pool_install_action().
If the action bound to the key_val, modifiers pair has been blocked using clutter_binding_pool_block_action(), the callback will not be invoked, and this function will return false.
#block_action(action_name) ⇒ nil
Blocks all the actions with name action_name inside pool.
#find_action(key_val, modifiers) ⇒ String
Retrieves the name of the action matching the given key symbol and modifiers bitmask.
#install_action(action_name, key_val, modifiers, callback, data, notify) ⇒ nil
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_binding_pool_activate() the passed callback will be invoked (with data).
Actions can be blocked with clutter_binding_pool_block_action() and then unblocked using clutter_binding_pool_unblock_action().
#install_closure(action_name, key_val, modifiers, closure) ⇒ nil
A #GClosure variant of clutter_binding_pool_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_binding_pool_activate() the passed closure will be invoked.
Actions can be blocked with clutter_binding_pool_block_action() and then unblocked using clutter_binding_pool_unblock_action().
#name ⇒ String
The unique name of the Clutter::BindingPool.
#name=(name) ⇒ String
The unique name of the Clutter::BindingPool.
#override_action(key_val, modifiers, callback, data, notify) ⇒ nil
Allows overriding the action for key_val and modifiers inside a Clutter::BindingPool. See clutter_binding_pool_install_action().
When an action has been activated using clutter_binding_pool_activate() the passed callback will be invoked (with data).
Actions can be blocked with clutter_binding_pool_block_action() and then unblocked using clutter_binding_pool_unblock_action().
#override_closure(key_val, modifiers, closure) ⇒ nil
A #GClosure variant of clutter_binding_pool_override_action().
Allows overriding the action for key_val and modifiers inside a Clutter::BindingPool. See clutter_binding_pool_install_closure().
When an action has been activated using clutter_binding_pool_activate() the passed callback will be invoked (with data).
Actions can be blocked with clutter_binding_pool_block_action() and then unblocked using clutter_binding_pool_unblock_action().
#remove_action(key_val, modifiers) ⇒ nil
Removes the action matching the given key_val, modifiers pair, if any exists.
#unblock_action(action_name) ⇒ nil
Unblockes all the actions with name action_name inside pool.
Unblocking an action does not cause the callback bound to it to be invoked in case clutter_binding_pool_activate() was called on an action previously blocked with clutter_binding_pool_block_action().