ShortcutTriggerRef

public struct ShortcutTriggerRef : ShortcutTriggerProtocol, GWeakCapturing

GtkShortcutTrigger tracks how a GtkShortcut should be activated.

To find out if a GtkShortcutTrigger triggers, you can call [methodGtk.ShortcutTrigger.trigger] on a GdkEvent.

GtkShortcutTriggers contain functions that allow easy presentation to end users as well as being printed for debugging.

All GtkShortcutTriggers are immutable, you can only specify their properties during construction. If you want to change a trigger, you have to replace it with a new one.

The ShortcutTriggerRef type acts as a lightweight Swift reference to an underlying GtkShortcutTrigger instance. It exposes methods that can operate on this data type through ShortcutTriggerProtocol conformance. Use ShortcutTriggerRef only as an unowned reference to an existing GtkShortcutTrigger instance.

  • ptr
    Untyped pointer to the underlying `GtkShortcutTrigger` instance.
    

    For type-safe access, use the generated, typed pointer shortcut_trigger_ptr property instead.

    Declaration

    Swift

    public let ptr: UnsafeMutableRawPointer!

ShortcutTrigger Class

  • Designated initialiser from the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafeMutablePointer<GtkShortcutTrigger>)
  • Designated initialiser from a constant pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init(_ p: UnsafePointer<GtkShortcutTrigger>)
  • Conditional initialiser from an optional pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafeMutablePointer<GtkShortcutTrigger>?)
  • Conditional initialiser from an optional, non-mutable pointer to the underlying C data type

    Declaration

    Swift

    @inlinable
    init!(_ maybePointer: UnsafePointer<GtkShortcutTrigger>?)
  • Conditional initialiser from an optional gpointer

    Declaration

    Swift

    @inlinable
    init!(gpointer g: gpointer?)
  • Conditional initialiser from an optional, non-mutable gconstpointer

    Declaration

    Swift

    @inlinable
    init!(gconstpointer g: gconstpointer?)
  • Reference intialiser for a related type that implements ShortcutTriggerProtocol

    Declaration

    Swift

    @inlinable
    init<T>(_ other: T) where T : ShortcutTriggerProtocol
  • This factory is syntactic sugar for setting weak pointers wrapped in GWeak<T>

    Declaration

    Swift

    @inlinable
    static func unowned<T>(_ other: T) -> ShortcutTriggerRef where T : ShortcutTriggerProtocol
  • Unsafe typed initialiser. Do not use unless you know the underlying data type the pointer points to conforms to ShortcutTriggerProtocol.

    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 ShortcutTriggerProtocol.

    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 ShortcutTriggerProtocol.

    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 ShortcutTriggerProtocol.

    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 ShortcutTriggerProtocol.

    Declaration

    Swift

    @inlinable
    init(opaquePointer: OpaquePointer)
  • Tries to parse the given string into a trigger.
    

    On success, the parsed trigger is returned. When parsing failed, nil is returned.

    The accepted strings are:

    • never, for GtkNeverTrigger
    • a string parsed by gtk_accelerator_parse(), for a GtkKeyvalTrigger, e.g. &lt;Control&gt;C
    • underscore, followed by a single character, for GtkMnemonicTrigger, e.g. _l
    • two valid trigger strings, separated by a | character, for a GtkAlternativeTrigger: &lt;Control&gt;q|&lt;Control&gt;w

    Note that you will have to escape the &lt; and &gt; characters when specifying triggers in XML files, such as GtkBuilder ui files. Use &lt; instead of &lt; and &gt; instead of &gt;.

    Declaration

    Swift

    @inlinable
    init(string: UnsafePointer<CChar>!)
  • Tries to parse the given string into a trigger.

    On success, the parsed trigger is returned. When parsing failed, nil is returned.

    The accepted strings are:

    • never, for GtkNeverTrigger
    • a string parsed by gtk_accelerator_parse(), for a GtkKeyvalTrigger, e.g. &lt;Control&gt;C
    • underscore, followed by a single character, for GtkMnemonicTrigger, e.g. _l
    • two valid trigger strings, separated by a | character, for a GtkAlternativeTrigger: &lt;Control&gt;q|&lt;Control&gt;w

    Note that you will have to escape the &lt; and &gt; characters when specifying triggers in XML files, such as GtkBuilder ui files. Use &lt; instead of &lt; and &gt; instead of &gt;.

    Declaration

    Swift

    @inlinable
    static func parse(string: UnsafePointer<CChar>!) -> ShortcutTriggerRef!