summaryrefslogtreecommitdiff
path: root/gtk/gtkbuilderparser.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2019-08-29 16:18:55 +0200
committerMatthias Clasen <mclasen@redhat.com>2019-09-10 12:08:20 -0400
commitff23397701a1ec3073450238a6c3d3f2419aa65e (patch)
tree6297595a18f6d30399bcfdbd104a1e636c822b44 /gtk/gtkbuilderparser.c
parent96b37f4eb8ec0e7598534a83816be7c013fd1c9b (diff)
downloadgtk+-ff23397701a1ec3073450238a6c3d3f2419aa65e.tar.gz
GtkBuilder: Add support for precompiling builder xml
Diffstat (limited to 'gtk/gtkbuilderparser.c')
-rw-r--r--gtk/gtkbuilderparser.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index ac5becec94..40629104ae 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -177,11 +177,18 @@ gtk_buildable_parse_context_parse (GtkBuildableParseContext *context,
{
gboolean res;
- context->ctx = g_markup_parse_context_new (context->internal_callbacks,
- G_MARKUP_TREAT_CDATA_AS_TEXT,
- context, NULL);
- res = g_markup_parse_context_parse (context->ctx, text, text_len, error);
- g_markup_parse_context_free (context->ctx);
+ if (_gtk_buildable_parser_is_precompiled (text, text_len))
+ {
+ res = _gtk_buildable_parser_replay_precompiled (context, text, text_len, error);
+ }
+ else
+ {
+ context->ctx = g_markup_parse_context_new (context->internal_callbacks,
+ G_MARKUP_TREAT_CDATA_AS_TEXT,
+ context, NULL);
+ res = g_markup_parse_context_parse (context->ctx, text, text_len, error);
+ g_markup_parse_context_free (context->ctx);
+ }
return res;
}