summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilder.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-08-23 21:07:36 +0200
committerMatthias Clasen <mclasen@redhat.com>2020-03-18 23:00:51 -0400
commit5218dd6a342830c5001316fd5057eadab840420d (patch)
tree77ffc7ab735992887010d56757201d045260a8cf /gtk/gtkbuilder.c
parentdf792a088db2de76f3f98ab30695814f3e93e2a9 (diff)
downloadgtk+-5218dd6a342830c5001316fd5057eadab840420d.tar.gz
shortcuttrigger: Add gtk_shortcut_triger_new_parse_string()
And hook it up into the GtkBuilder infrastructure.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r--gtk/gtkbuilder.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index ba3f367ddc..e841be2ea1 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -219,12 +219,14 @@
#include "gtkbuilderscopeprivate.h"
#include "gtkdebug.h"
#include "gtkmain.h"
+#include "gtkicontheme.h"
#include "gtkintl.h"
#include "gtkprivate.h"
+#include "gtkshortcuttrigger.h"
+#include "gtktestutils.h"
#include "gtktypebuiltins.h"
#include "gtkicontheme.h"
#include "gtkiconthemeprivate.h"
-#include "gdkpixbufutilsprivate.h"
static void gtk_builder_finalize (GObject *object);
static void gtk_builder_set_property (GObject *object,
@@ -2092,6 +2094,22 @@ gtk_builder_value_from_string_type (GtkBuilder *builder,
ret = FALSE;
}
}
+ else if (G_VALUE_HOLDS (value, GTK_TYPE_SHORTCUT_TRIGGER))
+ {
+ GtkShortcutTrigger *trigger = gtk_shortcut_trigger_parse_string (string);
+
+ if (trigger)
+ g_value_take_boxed (value, trigger);
+ else
+ {
+ g_set_error (error,
+ GTK_BUILDER_ERROR,
+ GTK_BUILDER_ERROR_INVALID_VALUE,
+ "Could not parse shortcut trigger '%s'",
+ string);
+ ret = FALSE;
+ }
+ }
else if (G_VALUE_HOLDS (value, G_TYPE_STRV))
{
gchar **vector = g_strsplit (string, "\n", 0);