ShortcutTriggerProtocol

public protocol ShortcutTriggerProtocol : ObjectProtocol

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 ShortcutTriggerProtocol protocol exposes the methods and properties of an underlying GtkShortcutTrigger instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see ShortcutTrigger. Alternatively, use ShortcutTriggerRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkShortcutTrigger instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • shortcut_trigger_ptr Default implementation

    Typed pointer to the underlying GtkShortcutTrigger instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GtkShortcutTrigger instance.

    Declaration

    Swift

    var shortcut_trigger_ptr: UnsafeMutablePointer<GtkShortcutTrigger>! { get }
  • Required Initialiser for types conforming to ShortcutTriggerProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

ShortcutTrigger Class: ShortcutTriggerProtocol extension (methods and fields)

  • compare(trigger2:) Extension method

    The types of trigger1 and trigger2 are gconstpointer only to allow use of this function as a GCompareFunc.

    They must each be a GtkShortcutTrigger.

    Declaration

    Swift

    @inlinable
    func compare<ShortcutTriggerT>(trigger2: ShortcutTriggerT) -> Int where ShortcutTriggerT : ShortcutTriggerProtocol
  • equal(trigger2:) Extension method

    Checks if trigger1 and trigger2 trigger under the same conditions.

    The types of one and two are gconstpointer only to allow use of this function with GHashTable. They must each be a GtkShortcutTrigger.

    Declaration

    Swift

    @inlinable
    func equal<ShortcutTriggerT>(trigger2: ShortcutTriggerT) -> Bool where ShortcutTriggerT : ShortcutTriggerProtocol
  • hash() Extension method

    Generates a hash value for a GtkShortcutTrigger.

    The output of this function is guaranteed to be the same for a given value only per-process. It may change between different processor architectures or even different versions of GTK. Do not use this function as a basis for building protocols or file formats.

    The types of trigger is gconstpointer only to allow use of this function with GHashTable. They must each be a GtkShortcutTrigger.

    Declaration

    Swift

    @inlinable
    func hash() -> Int
  • print(string:) Extension method

    Prints the given trigger into a string for the developer. This is meant for debugging and logging.

    The form of the representation may change at any time and is not guaranteed to stay identical.

    Declaration

    Swift

    @inlinable
    func print<StringTypeT>(string: StringTypeT) where StringTypeT : StringProtocol
  • printLabel(display:string:) Extension method

    Prints the given trigger into a string.

    This function is returning a translated string for presentation to end users for example in menu items or in help texts.

    The display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names.

    The form of the representation may change at any time and is not guaranteed to stay identical.

    Declaration

    Swift

    @inlinable
    func printLabel<DisplayT, StringTypeT>(display: DisplayT, string: StringTypeT) -> Bool where DisplayT : DisplayProtocol, StringTypeT : StringProtocol
  • toLabel(display:) Extension method

    Gets textual representation for the given trigger.

    This function is returning a translated string for presentation to end users for example in menu items or in help texts.

    The display in use may influence the resulting string in various forms, such as resolving hardware keycodes or by causing display-specific modifier names.

    The form of the representation may change at any time and is not guaranteed to stay identical.

    Declaration

    Swift

    @inlinable
    func toLabel<DisplayT>(display: DisplayT) -> String! where DisplayT : DisplayProtocol
  • toString() Extension method

    Prints the given trigger into a human-readable string.

    This is a small wrapper around [methodGtk.ShortcutTrigger.print] to help when debugging.

    Declaration

    Swift

    @inlinable
    func toString() -> String!
  • Checks if the given event triggers self.

    Declaration

    Swift

    @inlinable
    func trigger<EventT>(event: EventT, enableMnemonics: Bool) -> GdkKeyMatch where EventT : EventProtocol