Package ch.bailu.gtk.gtk
Class Shortcut
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.Shortcut
- All Implemented Interfaces:
PointerInterface
A `GtkShortcut` describes a keyboard shortcut.
It contains a description of how to trigger the shortcut via a
[class@Gtk.ShortcutTrigger] and a way to activate the shortcut
on a widget via a [class@Gtk.ShortcutAction].
The actual work is usually done via [class@Gtk.ShortcutController],
which decides if and when to activate a shortcut. Using that controller
directly however is rarely necessary as various higher level
convenience APIs exist on `GtkWidget`s that make it easier to use
shortcuts in GTK.
`GtkShortcut` does provide functionality to make it easy for users
to work with shortcuts, either by providing informational strings
for display purposes or by allowing shortcuts to be configured.
It contains a description of how to trigger the shortcut via a
[class@Gtk.ShortcutTrigger] and a way to activate the shortcut
on a widget via a [class@Gtk.ShortcutAction].
The actual work is usually done via [class@Gtk.ShortcutController],
which decides if and when to activate a shortcut. Using that controller
directly however is rarely necessary as various higher level
convenience APIs exist on `GtkWidget`s that make it easier to use
shortcuts in GTK.
`GtkShortcut` does provide functionality to make it easy for users
to work with shortcuts, either by providing informational strings
for display purposes or by allowing shortcuts to be configured.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionShortcut
(ShortcutTrigger trigger, ShortcutAction action) Creates a new `GtkShortcut` that is triggered by
@trigger and then activates @action.Shortcut
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionGets the action that is activated by this shortcut.Gets the arguments that are passed when activating the shortcut.static ClassHandler
static int
static long
static TypeSystem.TypeSize
Gets the trigger used to trigger @self.static long
static TypeSystem.TypeSize
static Shortcut
newWithArgumentsShortcut
(ShortcutTrigger trigger, ShortcutAction action, Str format_string, Object... _elipse) Creates a new `GtkShortcut` that is triggered by @trigger and then activates
@action with arguments given by @format_string.static Shortcut
newWithArgumentsShortcut
(ShortcutTrigger trigger, ShortcutAction action, String format_string, Object... _elipse) Creates a new `GtkShortcut` that is triggered by @trigger and then activates
@action with arguments given by @format_string.void
setAction
(ShortcutAction action) Sets the new action for @self to be @action.void
setArguments
(Variant args) Sets the arguments to pass when activating the shortcut.void
setTrigger
(ShortcutTrigger trigger) Sets the new trigger for @self to be @trigger.Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Constructor Details
-
Shortcut
-
Shortcut
Creates a new `GtkShortcut` that is triggered by
@trigger and then activates @action.- Parameters:
trigger
- The trigger that will trigger the shortcutaction
- The action that will be activated upon triggering
-
-
Method Details
-
getClassHandler
-
newWithArgumentsShortcut
public static Shortcut newWithArgumentsShortcut(@Nullable ShortcutTrigger trigger, @Nullable ShortcutAction action, @Nullable Str format_string, Object... _elipse) Creates a new `GtkShortcut` that is triggered by @trigger and then activates
@action with arguments given by @format_string.- Parameters:
trigger
- The trigger that will trigger the shortcutaction
- The action that will be activated upon triggeringformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string.- Returns:
- a new `GtkShortcut`
-
newWithArgumentsShortcut
public static Shortcut newWithArgumentsShortcut(@Nullable ShortcutTrigger trigger, @Nullable ShortcutAction action, String format_string, Object... _elipse) Creates a new `GtkShortcut` that is triggered by @trigger and then activates
@action with arguments given by @format_string.- Parameters:
trigger
- The trigger that will trigger the shortcutaction
- The action that will be activated upon triggeringformat_string
- GVariant format string for arguments or %NULL for no arguments_elipse
- arguments, as given by format string.- Returns:
- a new `GtkShortcut`
-
getAction
Gets the action that is activated by this shortcut.- Returns:
- the action
-
getArguments
Gets the arguments that are passed when activating the shortcut.- Returns:
- the arguments
-
getTrigger
Gets the trigger used to trigger @self.- Returns:
- the trigger used
-
setAction
Sets the new action for @self to be @action.- Parameters:
action
- The new action. If the @action is %NULL, the nothing action will be used.
-
setArguments
Sets the arguments to pass when activating the shortcut.- Parameters:
args
- arguments to pass when activating @self
-
setTrigger
Sets the new trigger for @self to be @trigger.- Parameters:
trigger
- The new trigger. If the @trigger is %NULL, the never trigger will be used.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-