Benjamin Otte
9a03c8b4d8
gtk: Remove bindings
...
The whole binding functionality is now handled by shortcuts.
2020-03-25 23:14:27 -04:00
Emmanuele Bassi
f02521c502
Remove bindings activation from GtkEventControllerKey
...
We're going to use shortcuts soon.
2020-03-25 22:36:03 -04:00
Matthias Clasen
c1247a7993
popover: Add keynav keybindings
...
The shortcut controllers are limited to same-native,
so we need to duplicate the Tab and arrow key bindings
for focus handling, as well as the Enter bindings for
activation.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
b2a747b4d4
popovermenu: Port to shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
c1ee2fd54a
accelgroup: Actually have a default mod mask
...
Don't just use a value without initializing it.
2020-03-25 22:36:03 -04:00
Benjamin Otte
4c7b00fd20
treeview: Redo event forwarding hack
...
Reorder the event controllers so that key forwarding to the search
entries really happens after shortcut triggering.
2020-03-25 22:36:03 -04:00
Benjamin Otte
3fba7f9dce
combobox: Redo key event forwarding hack
...
Instead of manualling invoking bindings, we now reorder event
controllers inside the treemenu, so that shortcuts run before the event
forwarding.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
7ca4a94768
widget: Add private accessor to event controllers
2020-03-25 22:36:03 -04:00
Benjamin Otte
1df0a5eab5
iconview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6a005c815e
infobar: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
cb09211ace
label: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
e430e0e2ff
listbox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6ad1078595
notebook: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
cd7e9dcc27
scale: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
8752f613d7
scalebutton: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
f54d3a3aca
scrolledwindow: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
db525ef213
searchentry: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
3f00e42ec9
shortcutssection: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
d5fa5b9594
shortcutswindow: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
2e5fc35e51
flowbox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6ff94f3637
paned: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
80888d7111
spinbutton: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
48b46c8d08
textview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
df457cadfc
filechooserwidget: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
58e8f2332d
shortcutcontroller: Add gtk_shortcut_controller_add_shortcut()
...
... and gtk_shortcut_controller_remove_shortcut().
2020-03-25 22:36:03 -04:00
Benjamin Otte
376dc4d169
shortcutcontroller: Add private API for running class shortcuts
...
We don't want regular users to be able to run class shortcuts in their
controllers, so we have to special case that.
2020-03-25 22:36:03 -04:00
Benjamin Otte
dfd81f9c64
treeview: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
6d418134ee
widget: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
02646d74f4
dialog: Port binding to use shortcuts
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
d62be573ad
text: Port to widget shortcuts
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
17eef48835
Allow installing bindings bound to actions
...
This is just convenience code around GtkShortcut, just like bindings for
signal emission and callback invocation.
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
7ffea02eb4
shortcut: Add action activation
2020-03-25 22:36:03 -04:00
Emmanuele Bassi
0b75edc0e1
bindings: Export action activation internally
...
We're going to use it, just like we use the signal emission code.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d4bba7de88
shortcut: Add gtk_shortcut_set_callback()
...
... and gtk_widget_class_add_binding() to go with it.
This allows shortcuts to invoke manually added callbacks.
2020-03-25 22:36:03 -04:00
Benjamin Otte
a8902da4bc
assistant: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
8ff18b3d39
combobox: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
81fa63260e
trigger: Add an alternative trigger
...
And use it.
I just added it to GtkWidget just to show that I can.
The real reason I want it is for gamepad/joystick triggers
in games, so that it becomes possible to select 2 different
triggers (gamepad and keyboard) for the same shortcut.
2020-03-25 22:36:03 -04:00
Matthias Clasen
6d452f1eb8
shortcut: Add GtkShortcutTrigger
...
Triggers are meant to describe how to trigger a shortcut.
So far only a keyval + modifiers trigger exists.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d51b8ff058
window: Port bindings to use shortcuts
2020-03-25 22:36:03 -04:00
Benjamin Otte
b11263ae91
bindings: Add more variant types
...
Also marshal types that the code in gtkbindings.c doesn't use. These
will be used by gtk_widget_class_add_binding_signal().
2020-03-25 22:36:03 -04:00
Benjamin Otte
0eb1228902
widget: Add gtk_widget_class_add_shortcut()
...
This allows adding shortcuts as a replacement for keybindings.
2020-03-25 22:36:03 -04:00
Benjamin Otte
d8603864a9
gtk: Add GtkShortcut
...
This is the base class for what is about to take over all sorts of
keyboard shortcuts. The initial version barely deals with keybindings.
2020-03-25 22:36:03 -04:00
Benjamin Otte
f9ee703af4
bindings: Split out function to invoke an action signal
...
We want to use that in shortcuts later.
2020-03-25 22:36:03 -04:00
Benjamin Otte
a232107122
shortcutcontroller: Introduce
...
This is a very barebones controller that currently does nothing but
activate the binding signals. Yay.
And because we have bindings on every widget (Yes, a GtkGrid has a
keybinding - 2 in fact), we need that controller everywhere.
2020-03-25 22:36:03 -04:00
Benjamin Otte
27834b04ae
bindings: Make gtk_binding_parse_signal() use GVariantBuilder
...
And because it's the last user of GtkBindingArg and
gtk_binding_entry_add_signall(), also remove those two.
2020-03-25 22:36:03 -04:00
Benjamin Otte
cbe207a8de
bindings: Parse into GVariantBuilder directly
...
Avoids the indirection via GtkBindingArg
2020-03-25 22:36:03 -04:00
Benjamin Otte
1cab5e03ca
bindings: Add gtk_binding_entry_add_signal_variant()
...
This function is the replacement for
gtk_binding_entry_add_signall().
The GVariant will be demarshalled and passed to the action signal upon
binding activation. The same rules apply as used to apply for
GtkBindingArg, in that long, double and string args are now replaced by
"x", "d" and "s" variant types.
2020-03-25 22:36:03 -04:00
Benjamin Otte
f8c523fa72
bindings: Replace GtkBindingArg arguments with GVariant
...
So far, this only replaces invocation, not yet parsing.
2020-03-25 22:36:03 -04:00
Matthias Clasen
e17db0abde
Merge branch 'matthiasc/for-master2' into 'master'
...
Matthiasc/for master2
See merge request GNOME/gtk!1568
2020-03-26 02:30:54 +00:00
Matthias Clasen
cc9c45a47a
Merge branch 'matthiasc/for-master' into 'master'
...
Matthiasc/for master
See merge request GNOME/gtk!1567
2020-03-26 01:54:30 +00:00