[gtk/matthiasc/for-master: 6/11] cssshadowvalue: Add a parsing function
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 6/11] cssshadowvalue: Add a parsing function
- Date: Sat, 6 Feb 2021 21:17:13 +0000 (UTC)
commit be3f352b593e59cf5f784fb3929acacf09f4d9c0
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Feb 5 21:36:22 2021 -0500
cssshadowvalue: Add a parsing function
Add a variant of the parse function that parses
just a single (non-box) shadow, as required for
the drop-shadow filter.
gtk/gtkcssshadowvalue.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index f4d60c9bcd..3afc9592a0 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -514,19 +514,14 @@ fail:
}
GtkCssValue *
-_gtk_css_shadow_value_parse_filter (GtkCssParser *parser)
+gtk_css_shadow_value_parse_filter (GtkCssParser *parser)
{
- GtkCssValue *result;
+ ShadowValue shadow;
- result = _gtk_css_shadow_value_parse (parser, FALSE);
-
- if (result && result->n_shadows != 1)
- {
- gtk_css_parser_error_syntax (parser, "A single shadow is required");
- g_clear_pointer (&result, gtk_css_value_unref);
- }
-
- return result;
+ if (gtk_css_shadow_value_parse_one (parser, FALSE, &shadow))
+ return gtk_css_shadow_value_new (&shadow, 1);
+ else
+ return NULL;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]