Top | ![]() |
![]() |
![]() |
![]() |
DzlShortcutContext * | context | Read |
DzlShortcutChord * | current-chord | Read |
DzlShortcutManager * | manager | Read / Write |
GtkWidget * | widget | Read / Write / Construct Only |
DzlShortcutController *
dzl_shortcut_controller_new (GtkWidget *widget
);
DzlShortcutManager *
dzl_shortcut_controller_get_manager (DzlShortcutController *self
);
Gets the DzlShortcutManager associated with this controller.
Generally, this will look for the root controller's manager as mixing and matching managers in a single window hierarchy is not supported.
void dzl_shortcut_controller_set_manager (DzlShortcutController *self
,DzlShortcutManager *manager
);
Sets the “manager” property.
If you set this to NULL
, it will revert to the default DzlShortcutManager
for the process.
DzlShortcutController *
dzl_shortcut_controller_find (GtkWidget *widget
);
Finds the registered DzlShortcutController for a widget.
The controller is created if it does not already exist.
DzlShortcutController *
dzl_shortcut_controller_try_find (GtkWidget *widget
);
Finds the registered DzlShortcutController for a widget.
If no controller is found, NULL
is returned.
DzlShortcutContext *
dzl_shortcut_controller_get_context (DzlShortcutController *self
);
This function gets the “context” property, which is the current context to dispatch events to. An DzlShortcutContext is a group of keybindings that may be activated in response to a single or series of GdkEventKey.
Since: 3.26
void dzl_shortcut_controller_set_context_by_name (DzlShortcutController *self
,const gchar *name
);
Changes the context for the controller to the context matching name
.
Contexts are resolved at runtime through the current theme (and possibly a parent theme if it inherits from one).
Since: 3.26
DzlShortcutContext * dzl_shortcut_controller_get_context_for_phase (DzlShortcutController *self
,DzlShortcutPhase phase
);
Controllers can have a different context for a particular phase, which allows them to activate different keybindings depending if the event in capture, bubble, or dispatch.
Since: 3.26
gboolean dzl_shortcut_controller_execute_command (DzlShortcutController *self
,const gchar *command
);
This method will locate and execute the command matching the id command
.
If the command is not found, FALSE
is returned.
const DzlShortcutChord *
dzl_shortcut_controller_get_current_chord
(DzlShortcutController *self
);
This method gets the “current-chord” property. This is useful if you want to monitor in-progress chord building.
Note that this value will only be valid on the controller for the toplevel widget (a GtkWindow). Chords are not tracked at the individual widget controller level.
void dzl_shortcut_controller_add_command_action (DzlShortcutController *self
,const gchar *command_id
,const gchar *default_accel
,DzlShortcutPhase phase
,const gchar *action
);
void dzl_shortcut_controller_add_command_callback (DzlShortcutController *self
,const gchar *command_id
,const gchar *default_accel
,DzlShortcutPhase phase
,GtkCallback callback
,gpointer callback_data
,GDestroyNotify callback_data_destroy
);
void dzl_shortcut_controller_add_command_signal (DzlShortcutController *self
,const gchar *command_id
,const gchar *default_accel
,DzlShortcutPhase phase
,const gchar *signal_name
,guint n_args
,...
);
#define DZL_TYPE_SHORTCUT_CONTROLLER (dzl_shortcut_controller_get_type())
“context”
property“context” DzlShortcutContext *
The current context of the controller, for dispatch phase.
Flags: Read
“current-chord”
property“current-chord” DzlShortcutChord *
The current chord for the controller.
Flags: Read
“widget”
property“widget” GtkWidget *
The widget for which the controller attached.
Flags: Read / Write / Construct Only
“reset”
signalvoid user_function (DzlShortcutController *dzlshortcutcontroller, gpointer user_data)
This signal is emitted when the shortcut controller is requesting the widget to reset any state it may have regarding the shortcut controller. Such an example might be a modal system that lives outside the controller whose state should be cleared in response to the controller changing modes.
Flags: Action
“set-context-named”
signalvoid user_function (DzlShortcutController *self, gchar *name, gpointer user_data)
This changes the current context on the DzlShortcutController to be the
context matching name
. This is found by looking up the context by name
in the active DzlShortcutTheme.
self |
||
name |
The name of the context |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action