2020-03-15 13:49:50 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2018 Benjamin Otte
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors: Benjamin Otte <otte@gnome.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GTK_SHORTCUT_TRIGGER_H__
|
|
|
|
#define __GTK_SHORTCUT_TRIGGER_H__
|
|
|
|
|
|
|
|
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
|
|
#error "Only <gtk/gtk.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gtk/gtktypes.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define GTK_TYPE_SHORTCUT_TRIGGER (gtk_shortcut_trigger_get_type ())
|
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GDK_DECLARE_INTERNAL_TYPE (GtkShortcutTrigger, gtk_shortcut_trigger, GTK, SHORTCUT_TRIGGER, GObject)
|
2020-03-15 13:49:50 +00:00
|
|
|
|
2018-08-23 19:07:36 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GtkShortcutTrigger * gtk_shortcut_trigger_parse_string (const char *string);
|
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
char * gtk_shortcut_trigger_to_string (GtkShortcutTrigger *self);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
void gtk_shortcut_trigger_print (GtkShortcutTrigger *self,
|
|
|
|
GString *string);
|
2018-08-13 03:45:12 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
char * gtk_shortcut_trigger_to_label (GtkShortcutTrigger *self,
|
|
|
|
GdkDisplay *display);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
gboolean gtk_shortcut_trigger_print_label (GtkShortcutTrigger *self,
|
|
|
|
GdkDisplay *display,
|
|
|
|
GString *string);
|
2020-03-15 13:49:50 +00:00
|
|
|
|
2018-08-20 07:18:59 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
guint gtk_shortcut_trigger_hash (gconstpointer trigger);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
gboolean gtk_shortcut_trigger_equal (gconstpointer trigger1,
|
|
|
|
gconstpointer trigger2);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-07-24 13:54:49 +00:00
|
|
|
int gtk_shortcut_trigger_compare (gconstpointer trigger1,
|
2018-08-20 07:18:59 +00:00
|
|
|
gconstpointer trigger2);
|
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-04-05 18:40:55 +00:00
|
|
|
GdkKeyMatch gtk_shortcut_trigger_trigger (GtkShortcutTrigger *self,
|
2018-08-16 01:59:24 +00:00
|
|
|
GdkEvent *event,
|
|
|
|
gboolean enable_mnemonics);
|
2020-03-15 13:49:50 +00:00
|
|
|
|
2020-03-19 15:57:02 +00:00
|
|
|
|
|
|
|
#define GTK_TYPE_NEVER_TRIGGER (gtk_never_trigger_get_type())
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkNeverTrigger:
|
|
|
|
*
|
2021-03-01 06:51:18 +00:00
|
|
|
* A `GtkShortcutTrigger` that never triggers.
|
2020-03-19 15:57:02 +00:00
|
|
|
*/
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GDK_DECLARE_INTERNAL_TYPE (GtkNeverTrigger, gtk_never_trigger, GTK, NEVER_TRIGGER, GtkShortcutTrigger)
|
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GtkShortcutTrigger * gtk_never_trigger_get (void);
|
|
|
|
|
2020-03-19 15:57:02 +00:00
|
|
|
#define GTK_TYPE_KEYVAL_TRIGGER (gtk_keyval_trigger_get_type())
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkKeyvalTrigger:
|
|
|
|
*
|
2021-03-01 06:51:18 +00:00
|
|
|
* A `GtkShortcutTrigger` that triggers when a specific keyval and modifiers are pressed.
|
2020-03-19 15:57:02 +00:00
|
|
|
*/
|
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GDK_DECLARE_INTERNAL_TYPE (GtkKeyvalTrigger, gtk_keyval_trigger, GTK, KEYVAL_TRIGGER, GtkShortcutTrigger)
|
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GtkShortcutTrigger * gtk_keyval_trigger_new (guint keyval,
|
|
|
|
GdkModifierType modifiers);
|
2020-03-15 13:49:50 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GdkModifierType gtk_keyval_trigger_get_modifiers (GtkKeyvalTrigger *self);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
guint gtk_keyval_trigger_get_keyval (GtkKeyvalTrigger *self);
|
|
|
|
|
|
|
|
#define GTK_TYPE_MNEMONIC_TRIGGER (gtk_mnemonic_trigger_get_type())
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkMnemonicTrigger:
|
|
|
|
*
|
2021-03-01 06:51:18 +00:00
|
|
|
* A `GtkShortcutTrigger` that triggers when a specific mnemonic is pressed.
|
|
|
|
*
|
|
|
|
* Mnemonics require a *mnemonic modifier* (typically <kbd>Alt</kbd>) to be
|
|
|
|
* pressed together with the mnemonic key.
|
2020-03-19 15:57:02 +00:00
|
|
|
*/
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GDK_DECLARE_INTERNAL_TYPE (GtkMnemonicTrigger, gtk_mnemonic_trigger, GTK, MNEMONIC_TRIGGER, GtkShortcutTrigger)
|
2020-03-15 13:49:50 +00:00
|
|
|
|
2018-08-16 01:59:24 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GtkShortcutTrigger * gtk_mnemonic_trigger_new (guint keyval);
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
guint gtk_mnemonic_trigger_get_keyval (GtkMnemonicTrigger *self);
|
|
|
|
|
|
|
|
#define GTK_TYPE_ALTERNATIVE_TRIGGER (gtk_alternative_trigger_get_type())
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkAlternativeTrigger:
|
|
|
|
*
|
2021-03-01 06:51:18 +00:00
|
|
|
* A `GtkShortcutTrigger` that combines two triggers.
|
|
|
|
*
|
|
|
|
* The `GtkAlternativeTrigger` triggers when either of two trigger.
|
|
|
|
*
|
|
|
|
* This can be cascaded to combine more than two triggers.
|
2020-03-19 15:57:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
GDK_AVAILABLE_IN_ALL
|
|
|
|
GDK_DECLARE_INTERNAL_TYPE (GtkAlternativeTrigger, gtk_alternative_trigger, GTK, ALTERNATIVE_TRIGGER, GtkShortcutTrigger)
|
2018-08-16 01:59:24 +00:00
|
|
|
|
2018-08-05 02:10:11 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GtkShortcutTrigger * gtk_alternative_trigger_new (GtkShortcutTrigger *first,
|
|
|
|
GtkShortcutTrigger *second);
|
2018-08-05 02:10:11 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GtkShortcutTrigger * gtk_alternative_trigger_get_first (GtkAlternativeTrigger *self);
|
2018-08-05 02:10:11 +00:00
|
|
|
GDK_AVAILABLE_IN_ALL
|
2020-03-19 15:57:02 +00:00
|
|
|
GtkShortcutTrigger * gtk_alternative_trigger_get_second (GtkAlternativeTrigger *self);
|
2018-08-05 02:10:11 +00:00
|
|
|
|
2020-03-15 13:49:50 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_SHORTCUT_TRIGGER_H__ */
|