gi-gtk-4.0.4: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ShortcutTrigger

Description

ShortcutTrigger is the object used to track if a Shortcut should be activated. For this purpose, shortcutTriggerTrigger can be called on a Event.

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.

Synopsis

Exported types

newtype ShortcutTrigger Source #

Memory-managed wrapper type.

Constructors

ShortcutTrigger (ManagedPtr ShortcutTrigger) 

Instances

Instances details
Eq ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

GObject ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

ManagedPtrNewtype ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

TypedObject ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

Methods

glibType :: IO GType

HasParentTypes ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

IsGValue (Maybe ShortcutTrigger) Source #

Convert ShortcutTrigger to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ShortcutTrigger -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ShortcutTrigger)

type ParentTypes ShortcutTrigger Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

type ParentTypes ShortcutTrigger = '[Object]

class (GObject o, IsDescendantOf ShortcutTrigger o) => IsShortcutTrigger o Source #

Type class for types which can be safely cast to ShortcutTrigger, for instance with toShortcutTrigger.

Instances

Instances details
(GObject o, IsDescendantOf ShortcutTrigger o) => IsShortcutTrigger o Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutTrigger

toShortcutTrigger :: (MonadIO m, IsShortcutTrigger o) => o -> m ShortcutTrigger Source #

Cast to ShortcutTrigger, for types for which this is known to be safe. For general casts, use castTo.

Methods

compare

shortcutTriggerCompare Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) 
=> a

trigger1: a ShortcutTrigger

-> b

trigger2: a ShortcutTrigger

-> m Int32

Returns: An integer less than, equal to, or greater than zero if trigger1 is found, respectively, to be less than, to match, or be greater than trigger2.

The types of trigger1 and trigger2 are gconstpointer only to allow use of this function as a CompareFunc. They must each be a ShortcutTrigger.

equal

shortcutTriggerEqual Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) 
=> a

trigger1: a ShortcutTrigger

-> b

trigger2: a ShortcutTrigger

-> m Bool

Returns: True if trigger1 and trigger2 are equal

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 HashTable. They must each be a ShortcutTrigger.

hash

shortcutTriggerHash Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a) 
=> a

trigger: a ShortcutTrigger

-> m Word32

Returns: a hash value corresponding to trigger

Generates a hash value for a ShortcutTrigger.

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 HashTable. They must each be a ShortcutTrigger.

parseString

shortcutTriggerParseString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

string: the string to parse

-> m (Maybe ShortcutTrigger)

Returns: a new ShortcutTrigger or Nothing on error

Tries to parse the given string into a trigger. On success, the parsed trigger is returned. When parsing failed, Nothing is returned.

The accepted strings are:

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

print

shortcutTriggerPrint Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a) 
=> a

self: a ShortcutTrigger

-> String

string: a String to print into

-> m () 

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.

printLabel

shortcutTriggerPrintLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) 
=> a

self: a ShortcutTrigger

-> b

display: Display to print for

-> String

string: a String to print into

-> m Bool

Returns: True if something was printed or False if the trigger did not have a textual representation suitable for end users.

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.

toLabel

shortcutTriggerToLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) 
=> a

self: a ShortcutTrigger

-> b

display: Display to print for

-> m Text

Returns: a new string

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.

toString

shortcutTriggerToString Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a) 
=> a

self: a ShortcutTrigger

-> m Text

Returns: a new string

Prints the given trigger into a human-readable string. This is a small wrapper around shortcutTriggerPrint to help when debugging.

trigger

shortcutTriggerTrigger Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsEvent b) 
=> a

self: a ShortcutTrigger

-> b

event: the event to check

-> Bool

enableMnemonics: True if mnemonics should trigger. Usually the value of this property is determined by checking that the passed in event is a Key event and has the right modifiers set.

-> m KeyMatch

Returns: Whether the event triggered the shortcut

Checks if the given event triggers self.