ShortcutActionRef
public struct ShortcutActionRef : ShortcutActionProtocol, GWeakCapturing
GtkShortcutAction encodes an action that can be triggered by a
keyboard shortcut.
GtkShortcutActions contain functions that allow easy presentation
to end users as well as being printed for debugging.
All GtkShortcutActions are immutable, you can only specify their
properties during construction. If you want to change a action, you
have to replace it with a new one. If you need to pass arguments to
an action, these are specified by the higher-level GtkShortcut object.
To activate a GtkShortcutAction manually, [methodGtk.ShortcutAction.activate]
can be called.
GTK provides various actions:
- [class
Gtk.MnemonicAction]: a shortcut action that callsgtk_widget_mnemonic_activate() - [class
Gtk.CallbackAction]: a shortcut action that invokes a given callback - [class
Gtk.SignalAction]: a shortcut action that emits a given signal - [class
Gtk.ActivateAction]: a shortcut action that callsgtk_widget_activate() - [class
Gtk.NamedAction]: a shortcut action that callsgtk_widget_activate_action() - [class
Gtk.NothingAction]: a shortcut action that does nothing
The ShortcutActionRef type acts as a lightweight Swift reference to an underlying GtkShortcutAction instance.
It exposes methods that can operate on this data type through ShortcutActionProtocol conformance.
Use ShortcutActionRef only as an unowned reference to an existing GtkShortcutAction instance.
-
Untyped pointer to the underlying `GtkShortcutAction` instance.For type-safe access, use the generated, typed pointer
shortcut_action_ptrproperty instead.Declaration
Swift
public let ptr: UnsafeMutableRawPointer!
-
Designated initialiser from the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafeMutablePointer<GtkShortcutAction>) -
Designated initialiser from a constant pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init(_ p: UnsafePointer<GtkShortcutAction>) -
Conditional initialiser from an optional pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafeMutablePointer<GtkShortcutAction>?) -
Conditional initialiser from an optional, non-mutable pointer to the underlying
Cdata typeDeclaration
Swift
@inlinable init!(_ maybePointer: UnsafePointer<GtkShortcutAction>?) -
Conditional initialiser from an optional
gpointerDeclaration
Swift
@inlinable init!(gpointer g: gpointer?) -
Conditional initialiser from an optional, non-mutable
gconstpointerDeclaration
Swift
@inlinable init!(gconstpointer g: gconstpointer?) -
Reference intialiser for a related type that implements
ShortcutActionProtocolDeclaration
Swift
@inlinable init<T>(_ other: T) where T : ShortcutActionProtocol -
This factory is syntactic sugar for setting weak pointers wrapped in
GWeak<T>Declaration
Swift
@inlinable static func unowned<T>(_ other: T) -> ShortcutActionRef where T : ShortcutActionProtocol -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutActionProtocol.Declaration
Swift
@inlinable init<T>(cPointer: UnsafeMutablePointer<T>) -
Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutActionProtocol.Declaration
Swift
@inlinable init<T>(constPointer: UnsafePointer<T>) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutActionProtocol.Declaration
Swift
@inlinable init(mutating raw: UnsafeRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutActionProtocol.Declaration
Swift
@inlinable init(raw: UnsafeMutableRawPointer) -
Unsafe untyped initialiser. Do not use unless you know the underlying data type the pointer points to conforms to
ShortcutActionProtocol.Declaration
Swift
@inlinable init(opaquePointer: OpaquePointer) -
Tries to parse the given string into an action.On success, the parsed action is returned. When parsing failed,
nilis returned.The accepted strings are:
nothing, forGtkNothingActionactivate, forGtkActivateActionmnemonic-activate, forGtkMnemonicActionaction(NAME), for aGtkNamedActionfor the action namedNAMEsignal(NAME), for aGtkSignalActionfor the signalNAME
Declaration
Swift
@inlinable init(string: UnsafePointer<CChar>!) -
Tries to parse the given string into an action.
On success, the parsed action is returned. When parsing failed,
nilis returned.The accepted strings are:
nothing, forGtkNothingActionactivate, forGtkActivateActionmnemonic-activate, forGtkMnemonicActionaction(NAME), for aGtkNamedActionfor the action namedNAMEsignal(NAME), for aGtkSignalActionfor the signalNAME
Declaration
Swift
@inlinable static func parse(string: UnsafePointer<CChar>!) -> ShortcutActionRef!
View on GitHub
Install in Dash
ShortcutActionRef Structure Reference