Commit graph

25 commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
1b68bf1cb4 keyboard: Update code style
No functional changes were introduced. This is purely
aesthetical.
2018-05-29 13:50:17 -03:00
Robert Ancell
5174ae136d keyboard: Replace ifdefs with #pragma once 2018-05-29 15:44:19 +00:00
Robert Ancell
57975633e6 keyboard: Replace GObject boilerplace with G_DECLARE_TYPE 2018-05-29 15:44:19 +00:00
Florian Müllner
5e4fa7bd39 keyboard: Track all key combos
For shortcuts that support more than one binding, we currently simply
ignore all but the first. This makes some sense as we only expose a
single binding in the UI anyway, however it means that any extra
bindings are not taken into account for conflict resolution. In order
to address this in the future, start tracking all bindings of an item.

https://bugzilla.gnome.org/show_bug.cgi?id=673078
2017-07-10 19:29:43 +02:00
Florian Müllner
dccf794897 keyboard: Add dedicated key combo type
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
2017-07-10 19:29:43 +02:00
Georges Basile Stavracas Neto
376459af43 keyboard: add API to track whether a shortcut is default
The current keyboard item API does not track whether the
keyboard shortcut is the default value or not. In order to
properly implement the Reset operation, the keyboard item
must receive this API and ideally handle it internally.

This patch adds the necessary API to CcKeyboardItem to track
whether the shortcut is the default value or not.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-29 13:48:31 -03:00
Georges Basile Stavracas Neto
d85047d36e keyboard: add a group field to CcKeyboardItem
This group field will be consumed by the next patches
in order to provide the correct ordering of elements
in the listbox.

https://bugzilla.gnome.org/show_bug.cgi?id=769063
2016-07-29 13:43:47 -03:00
Georges Basile Stavracas Neto
d940d7bb5d keyboard: make it a template class
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
2016-07-29 13:43:47 -03:00
Christophe Fergeau
4257d8723d keyboard: Remove unused CcKeyboardItem::group
The BindingGroupType is stored in the section tree model instead.

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
b442126db1 keyboard: Remove 'gettext_package' handling
It's part of CcKeyboardItem but nothing uses it. It's also parsed
when loading KeyListEntry XML, but never used. The key description is
translated using Keylist::package before gettext_package is assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
241b4034ce keyboard: Remove unused cc_keyboard_item_get_binding
https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
b7a2d17548 keyboard: Make CcKeyboardItem::binding private
It's not used outside of CcKeyboardItem

https://bugzilla.gnome.org/show_bug.cgi?id=749381
2015-05-15 19:44:00 +02:00
Christophe Fergeau
ba9a8bc8ff keyboard: Add support for hidden keybinding XML data
If a KeyListEntry has a hidden="true" attribute, then the corresponding
binding information will be loaded as usual, but the binding won't be
displayed in the user interface.

This is useful as the keyboard panel will take into account hidden
keybindings when detecting conflicting shortcuts, or to suggest to set a
reverse shortcut.

For now, this will be used for the various reverse mutter keybindings
({switch,cycle}.*-backward) as they should not be shown in the UI, but
we still want the keyboard panel to know about them.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:27 +02:00
Christophe Fergeau
f059f42487 keyboard: Add 'reverse' helpers to CcKeyboardItem
In order to handle shortcuts which can be reversed (for example,
super-space and shift-super-space to switch input methods
forward/backward), we are going to add new attributes to the xml files
describing the keyboard shortcuts to show in the panel.

This commit is a first step towards that and adds the notion of
'reverse' items to CcKeyboardItem.

We will then indicate in the xml description files that
'switch-input-source' is reversed by 'switch-input-source-backward' and
that 'switch-input-source-backward' reverses 'switch-input-source'.

https://bugzilla.gnome.org/show_bug.cgi?id=731618
2014-08-17 20:16:26 +02:00
Daniel Mustieles
2c5951819d Updated FSF's address 2014-01-29 11:27:38 +01:00
Rui Matos
a24f221eeb keyboard: Introduce a BINDING_GROUP_SEPARATOR type for the separator
This way we can control the shortcut section separator position in
case we introduce other types.

https://bugzilla.gnome.org/show_bug.cgi?id=682069
2012-08-20 18:51:39 +02:00
Bastien Nocera
9f107a4760 keyboard: Remove support code for GConf keybindings 2011-11-14 18:09:39 +00:00
Florian Müllner
656d0ee4b0 keyboard: Port custom shortcuts to GSettings
https://bugzilla.gnome.org/show_bug.cgi?id=625899
2011-11-14 18:09:39 +00:00
Bastien Nocera
df493ef93c keyboard: Use GTK+ to parse keys
Instead of some custom code

https://bugzilla.gnome.org/show_bug.cgi?id=663341
2011-11-04 17:00:39 +00:00
Bastien Nocera
6e99f7663a keyboard: Use GtkCellRendererAccel
Instead of custom code. This means loads of code we don't need
to maintain, whoo!
2011-10-27 16:25:35 +01:00
Bastien Nocera
3d5c7b65a6 keyboard: Avoid warnings when adding new shortcuts
We don't want to unset GConf watches if we didn't set them
in the first place.
2011-04-26 15:54:59 +01:00
Bastien Nocera
b77df51384 keyboard: Add _equal() helper function 2011-02-24 04:20:07 +00:00
Bastien Nocera
73f155eaac keyboard: Pass a gettext package when loading GConf
As GConf itself won't be passing us a translated entry by itself.

https://bugzilla.gnome.org/show_bug.cgi?id=576570
2011-02-17 13:00:30 +00:00
Bastien Nocera
27cf30ed54 keyboard: Add support for GSettings shortcuts 2011-02-16 18:00:38 +00:00
Bastien Nocera
5c755904e1 keyboard: Clean up GConf handling
Move most of the horrible GConf monitoring code to a separate
GObject(-ish). While quite ugly, it's not as bad as the code that
used to be there before.

Also fix the setting of KeyEntry->model (or CcKeyboardItem->model now)
to be the correct model (eg. the shortcut model rather than the section
model)
2011-02-16 01:24:49 +00:00