Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GtkShortcutTrigger
tracks how a GtkShortcut
should be activated.
To find out if a GtkShortcutTrigger
triggers, you can call
shortcutTriggerTrigger
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.
Synopsis
- newtype ShortcutTrigger = ShortcutTrigger (ManagedPtr ShortcutTrigger)
- class (GObject o, IsDescendantOf ShortcutTrigger o) => IsShortcutTrigger o
- toShortcutTrigger :: (MonadIO m, IsShortcutTrigger o) => o -> m ShortcutTrigger
- shortcutTriggerCompare :: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) => a -> b -> m Int32
- shortcutTriggerEqual :: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) => a -> b -> m Bool
- shortcutTriggerHash :: (HasCallStack, MonadIO m, IsShortcutTrigger a) => a -> m Word32
- shortcutTriggerParseString :: (HasCallStack, MonadIO m) => Text -> m (Maybe ShortcutTrigger)
- shortcutTriggerPrint :: (HasCallStack, MonadIO m, IsShortcutTrigger a) => a -> String -> m ()
- shortcutTriggerPrintLabel :: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) => a -> b -> String -> m Bool
- shortcutTriggerToLabel :: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) => a -> b -> m Text
- shortcutTriggerToString :: (HasCallStack, MonadIO m, IsShortcutTrigger a) => a -> m Text
- shortcutTriggerTrigger :: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsEvent b) => a -> b -> Bool -> m KeyMatch
Exported types
newtype ShortcutTrigger Source #
Memory-managed wrapper type.
Instances
Eq ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger (==) :: ShortcutTrigger -> ShortcutTrigger -> Bool # (/=) :: ShortcutTrigger -> ShortcutTrigger -> Bool # | |
GObject ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger | |
ManagedPtrNewtype ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger | |
TypedObject ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger | |
HasParentTypes ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger | |
IsGValue (Maybe ShortcutTrigger) Source # | Convert |
Defined in GI.Gtk.Objects.ShortcutTrigger gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe ShortcutTrigger -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe ShortcutTrigger) # | |
type ParentTypes ShortcutTrigger Source # | |
Defined in GI.Gtk.Objects.ShortcutTrigger |
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
(GObject o, IsDescendantOf ShortcutTrigger o) => IsShortcutTrigger o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, compare, equal, forceFloating, freezeNotify, getv, hash, isFloating, notify, notifyByPspec, print, printLabel, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toLabel, toString, trigger, unref, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
compare
shortcutTriggerCompare Source #
:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) | |
=> a |
|
-> b |
|
-> m Int32 | Returns: An integer less than, equal to, or greater than zero if
|
The types of trigger1
and trigger2
are gconstpointer
only to allow
use of this function as a GCompareFunc
.
They must each be a GtkShortcutTrigger
.
equal
:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsShortcutTrigger b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
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
.
hash
:: (HasCallStack, MonadIO m, IsShortcutTrigger a) | |
=> a |
|
-> m Word32 | Returns: a hash value corresponding to |
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
.
parseString
shortcutTriggerParseString Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Maybe ShortcutTrigger) | Returns: a new |
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:
never
, forGtkNeverTrigger
- a string parsed by
acceleratorParse
, for aGtkKeyvalTrigger
, e.g.<Control>C
- underscore, followed by a single character, for
GtkMnemonicTrigger
, e.g._l
- two valid trigger strings, separated by a
|
character, for aGtkAlternativeTrigger
:<Control>q|<Control>w
Note that you will have to escape the <
and >
characters when specifying
triggers in XML files, such as GtkBuilder ui files. Use <
instead of
<
and >
instead of >
.
:: (HasCallStack, MonadIO m, IsShortcutTrigger a) | |
=> a |
|
-> String |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) | |
=> a |
|
-> b |
|
-> String |
|
-> m Bool | Returns: |
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 #
:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsDisplay b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsShortcutTrigger a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsShortcutTrigger a, IsEvent b) | |
=> a |
|
-> b |
|
-> Bool |
|
-> m KeyMatch | Returns: Whether the event triggered the shortcut |
Checks if the given event
triggers self
.