This commit includes all the changes that seem to be necessary for
CcKeyboardItem to be used for dealing with multiple keybindings, without
(yet) changing the user interface to expose this.
The `primary_combo` and `binding` fields of `CcKeyboardItem` are
removed, in favor of the existing `key_combos`. No combination is
"primary", since all of them can now be seen and changed equally.
We treat `CcKeyboardItem.key_combos` as a set, that a combo can be added
to or removed from. Though it continues to be represented as a `GList`,
instead of a `GHashTable`, to preserve ordering.
A lot of the keyboard panel code relied on the assumption that only one
combo can be set for each setting, so this required a variety of
miscellaneous changes.
We currently store keyval, keycode and mask that make up a particular
key combo separately. However as we want to consider multiple bindings
for a single item, it makes more sense to combine them in a dedicated
struct type.
https://bugzilla.gnome.org/show_bug.cgi?id=673078
gtk_accelerator_valid() doesn't accept Tab as keyval, so using it to
check whether a shortcut is valid breaks commonly used shortcuts like
Alt+Tab. Unbreak those by adding a small wrapper that special-cases
Tab-with-modifiers.
https://bugzilla.gnome.org/show_bug.cgi?id=771058
The accelerator formatting method itself is copied from
GtkCellRendererAccel, and will be used throughout the code
to format the accelerators just like they used to be before
moving to the listbox.
https://bugzilla.gnome.org/show_bug.cgi?id=769063
To allow a much easier porting to the new layout, the keyboard
panel is now a template class. That has various implications on
the code organization:
- The keyboard-shortcuts.c was responsible for filling the shortcuts.
Because it relied on the GtkBuilder of the panel, most of its code
was moved to the CcKeyboardPanel class.
- The unused code from the keyboard panel class had to be removed in
order to make it work again.
- All the hash tables and widgets are now part of the CcKeyboardPanel
structure.
- The interface elements have a single entry point.
https://bugzilla.gnome.org/show_bug.cgi?id=769063