ClutterBindingPool is already "problematic" in terms of memory
management for language bindings and gobject-introspection. It
also lacks a GType.
Turning ClutterBindingPool into a GBoxed would not make much
sense, since it does not adhere to the copy/free semantics. It
could be referenced/unreferenced, but in that case we can just
as well use GObject as a base class instead of reimplemeting
a ref-counted object and then boxing it.
ClutterBindingPool is obviously a terminal class, so we just
hide the instance and class structures.
The clutter_binding_pool_list_actions() was not implemented. The
utility of a call listing all the action names is also debatable:
all the functions related to the key bindings take the key symbol
and modifiers -- except the block_action() and unblock_action()
pair.
As of now, a key binding installed into a BindingPool is always there
and cannot be changed.
This is problematic for sub-classes trying to override the callback
or the action for a given key binding.
This commit adds the ability to override the closure for an existing
key binding inside a binding pool -- assumed the caller knows the
key symbol and modifiers used to install the key binding in the first
place.
* clutter/Makefile.am:
* clutter/clutter.h: Add ClutterBindingPool to the build.
* clutter/clutter-binding-pool.c:
* clutter/clutter-binding-pool.h: Add ClutterBindingPool, a data
structure meant to hold (key symbol, modifiers) pairs and associate
them to a closure. The ClutterBindingPool can be used to install
key bindings for actors and then execute closures inside the
key-press-event signal handlers, removing the need for big
switch() or if() blocks for each key.
* clutter/clutter-event.c: Consistently use "key symbol" instead
of "key value".
* clutter/clutter-event.h: Add more modifier masks.
* clutter/clutter-marshal.list:
* tests/conform/Makefile.am:
* tests/conform/test-binding-pool.c:
* tests/conform/test-conform-main.c: Add ClutterBindingPool
conformance test.
* tests/interactive/Makefile.am:
* tests/interactive/test-binding-pool.c: Add interactive test (and
example code) for the ClutterBindingPool usage.