Tracks how a GtkShortcut can 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.
function Compare
(Self : not null access Gtk_Shortcut_Trigger_Record;
Trigger2 : not null access Gtk_Shortcut_Trigger_Record'Class)
return Glib.Gint
The types of Trigger1 and Trigger2 are gconstpointer only to allow use of this function as a GCompareFunc. They must each be a GtkShortcutTrigger.
a GtkShortcutTrigger
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.
function Equal
(Self : not null access Gtk_Shortcut_Trigger_Record;
Trigger2 : not null access Gtk_Shortcut_Trigger_Record'Class)
return Boolean
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.
a GtkShortcutTrigger
True if Trigger1 and Trigger2 are equal
function Get_Type return Glib.GType
procedure Gtk_New (Self : out Gtk_Shortcut_Trigger; String : UTF8_String)
Tries to parse the given string into a trigger. On success, the parsed trigger is returned. When parsing failed, null is returned. The accepted strings are:
never, for GtkNeverTrigger - a string parsed by
gtk_accelerator_parse, for a GtkKeyvalTrigger, e.g. <Control>C - underscore, followed by a single character, for GtkMnemonicTrigger, e.g. _l - two valid trigger strings, separated by a | character, for a GtkAlternativeTrigger: <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 >. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the string to parse
type Gtk_Shortcut_Trigger is access all Gtk_Shortcut_Trigger_Record'Class;
function Gtk_Shortcut_Trigger_Parse_String
(String : UTF8_String) return Gtk_Shortcut_Trigger
Tries to parse the given string into a trigger. On success, the parsed trigger is returned. When parsing failed, null is returned. The accepted strings are:
never, for GtkNeverTrigger - a string parsed by
gtk_accelerator_parse, for a GtkKeyvalTrigger, e.g. <Control>C - underscore, followed by a single character, for GtkMnemonicTrigger, e.g. _l - two valid trigger strings, separated by a | character, for a GtkAlternativeTrigger: <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 >.
the string to parse
type Gtk_Shortcut_Trigger_Record is new GObject_Record with null record;
function Hash
(Self : not null access Gtk_Shortcut_Trigger_Record) return Guint
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.
a hash value corresponding to Trigger
procedure Initialize
(Self : not null access Gtk_Shortcut_Trigger_Record'Class;
String : UTF8_String)
Tries to parse the given string into a trigger. On success, the parsed trigger is returned. When parsing failed, null is returned. The accepted strings are:
never, for GtkNeverTrigger - a string parsed by
gtk_accelerator_parse, for a GtkKeyvalTrigger, e.g. <Control>C - underscore, followed by a single character, for GtkMnemonicTrigger, e.g. _l - two valid trigger strings, separated by a | character, for a GtkAlternativeTrigger: <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 >. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
the string to parse
procedure Print
(Self : not null access Gtk_Shortcut_Trigger_Record;
String : Glib.String.Gstring)
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.
a GString to print into
function Print_Label
(Self : not null access Gtk_Shortcut_Trigger_Record;
Display : not null access Gdk.Display.Gdk_Display_Record'Class;
String : Glib.String.Gstring) return Boolean
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.
GdkDisplay to print for
a GString to print into
True if something was printed or False if the trigger did not have a textual representation suitable for end users.
function To_Label
(Self : not null access Gtk_Shortcut_Trigger_Record;
Display : not null access Gdk.Display.Gdk_Display_Record'Class)
return UTF8_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.
GdkDisplay to print for
a new string
function To_String
(Self : not null access Gtk_Shortcut_Trigger_Record)
return UTF8_String
Prints the given trigger into a human-readable string. This is a small wrapper around [methodGtk.ShortcutTrigger.print] to help when debugging.
a new string
function Trigger
(Self : not null access Gtk_Shortcut_Trigger_Record;
Event : Gdk.Event.Gdk_Event;
Enable_Mnemonics : Boolean) return Gdk.Key_Match.Gdk_Key_Match
Checks if the given Event triggers Self.
the event to check
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.
Whether the event triggered the shortcut