gtkmm 4.16.0
|
Triggers to track if shortcuts should be activated. More...
#include <gtkmm/shortcuttrigger.h>
Public Member Functions | |
ShortcutTrigger (ShortcutTrigger &&src) noexcept | |
ShortcutTrigger & | operator= (ShortcutTrigger &&src) noexcept |
~ShortcutTrigger () noexcept override | |
GtkShortcutTrigger * | gobj () |
Provides access to the underlying C GObject. | |
const GtkShortcutTrigger * | gobj () const |
Provides access to the underlying C GObject. | |
GtkShortcutTrigger * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Glib::ustring | to_string () const |
Prints the given trigger into a human-readable string. | |
Glib::ustring | to_label (const Glib::RefPtr< const Gdk::Display > &display) const |
Gets textual representation for the given trigger. | |
bool | equal (const Glib::RefPtr< const ShortcutTrigger > &trigger2) const |
Checks if trigger1 and trigger2 trigger under the same conditions. | |
int | compare (const Glib::RefPtr< const ShortcutTrigger > &trigger2) const |
The types of trigger1 and trigger2 are gconstpointer only to allow use of this function as a CompareFunc . | |
Gdk::KeyMatch | trigger (const Glib::RefPtr< const Gdk::Event > & event, bool enable_mnemonics) const |
Checks if the given event triggers self. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< ShortcutTrigger > | parse_string (const Glib::ustring &string) |
Tries to parse the given string into a trigger. | |
Protected Member Functions | |
ShortcutTrigger () | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::ShortcutTrigger > | wrap (GtkShortcutTrigger *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Triggers to track if shortcuts should be activated.
Gtk::ShortcutTrigger is the object used to track if a Gtk::Shortcut should be activated. For this purpose, trigger() can be called on a Gdk::Event.
ShortcutTriggers contain methods that allow easy presentation to end users as well as being printed for debugging.
All ShortcutTriggers 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.
|
noexcept |
|
overridenoexcept |
|
protected |
int Gtk::ShortcutTrigger::compare | ( | const Glib::RefPtr< const ShortcutTrigger > & | trigger2 | ) | const |
The types of trigger1 and trigger2 are gconstpointer
only to allow use of this function as a CompareFunc
.
They must each be a Gtk::ShortcutTrigger
.
trigger2 | A Gtk::ShortcutTrigger . |
bool Gtk::ShortcutTrigger::equal | ( | const Glib::RefPtr< const ShortcutTrigger > & | trigger2 | ) | const |
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 Gtk::ShortcutTrigger
.
trigger2 | A Gtk::ShortcutTrigger . |
true
if trigger1 and trigger2 are equal.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkShortcutTrigger * Gtk::ShortcutTrigger::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
|
static |
Tries to parse the given string into a trigger.
On success, the parsed trigger is returned. When parsing failed, nullptr
is returned.
The accepted strings are:
never
, for Gtk::NeverTrigger
Gtk::KeyvalTrigger
, e.g. <Control>C
Gtk::MnemonicTrigger
, e.g. _l
|
character, for a Gtk::AlternativeTrigger
: <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 >
.
string | The string to parse. |
Gtk::ShortcutTrigger
. Glib::ustring Gtk::ShortcutTrigger::to_label | ( | const Glib::RefPtr< const Gdk::Display > & | display | ) | const |
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.
display | Gdk::Display to print for. |
Glib::ustring Gtk::ShortcutTrigger::to_string | ( | ) | const |
Prints the given trigger into a human-readable string.
This is meant for debugging and logging. The form of the representation may change at any time and is not guaranteed to stay identical.
Gdk::KeyMatch Gtk::ShortcutTrigger::trigger | ( | const Glib::RefPtr< const Gdk::Event > & | event, |
bool | enable_mnemonics | ||
) | const |
Checks if the given event triggers self.
event | The event to check. |
enable_mnemonics | 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. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |