From fc1c6cfb1a3ccf5e816b5254ec7dec7d0db6ebf5 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 9 May 2024 22:38:31 -0400 Subject: [PATCH] css parser: Add gtk_css_parser_get_bytes Gets the bytes that the parser is operating on. --- gtk/css/gtkcssparser.c | 6 ++++++ gtk/css/gtkcssparserprivate.h | 1 + 2 files changed, 7 insertions(+) diff --git a/gtk/css/gtkcssparser.c b/gtk/css/gtkcssparser.c index bdecc2c729..4160565242 100644 --- a/gtk/css/gtkcssparser.c +++ b/gtk/css/gtkcssparser.c @@ -228,6 +228,12 @@ gtk_css_parser_get_file (GtkCssParser *self) return self->file; } +GBytes * +gtk_css_parser_get_bytes (GtkCssParser *self) +{ + return gtk_css_tokenizer_get_bytes (gtk_css_tokenizers_get (&self->tokenizers, 0)->tokenizer); +} + /** * gtk_css_parser_resolve_url: * @self: a `GtkCssParser` diff --git a/gtk/css/gtkcssparserprivate.h b/gtk/css/gtkcssparserprivate.h index d4bc031623..d7a4c68386 100644 --- a/gtk/css/gtkcssparserprivate.h +++ b/gtk/css/gtkcssparserprivate.h @@ -70,6 +70,7 @@ GtkCssParser * gtk_css_parser_ref (GtkCssParser void gtk_css_parser_unref (GtkCssParser *self); GFile * gtk_css_parser_get_file (GtkCssParser *self) G_GNUC_PURE; +GBytes * gtk_css_parser_get_bytes (GtkCssParser *self) G_GNUC_PURE; GFile * gtk_css_parser_resolve_url (GtkCssParser *self, const char *url);