Cosmetics

This commit is contained in:
Matthias Clasen 2024-06-02 09:25:52 -04:00
parent 62b9a4af75
commit 20392e8840
2 changed files with 30 additions and 30 deletions

View File

@ -664,6 +664,29 @@ gtk_css_color_value_new_current_color (void)
/* }}} */ /* }}} */
/* {{{ Parsing */ /* {{{ Parsing */
gboolean
gtk_css_color_value_can_parse (GtkCssParser *parser)
{
/* This is way too generous, but meh... */
return gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_IDENT)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_AT_KEYWORD)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_HASH_ID)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_HASH_UNRESTRICTED)
|| gtk_css_parser_has_function (parser, "lighter")
|| gtk_css_parser_has_function (parser, "darker")
|| gtk_css_parser_has_function (parser, "shade")
|| gtk_css_parser_has_function (parser, "alpha")
|| gtk_css_parser_has_function (parser, "mix")
|| gtk_css_parser_has_function (parser, "hsl")
|| gtk_css_parser_has_function (parser, "hsla")
|| gtk_css_parser_has_function (parser, "rgb")
|| gtk_css_parser_has_function (parser, "rgba")
|| gtk_css_parser_has_function (parser, "hwb")
|| gtk_css_parser_has_function (parser, "oklab")
|| gtk_css_parser_has_function (parser, "oklch")
|| gtk_css_parser_has_function (parser, "color");
}
typedef struct typedef struct
{ {
GtkCssValue *color; GtkCssValue *color;
@ -727,29 +750,6 @@ parse_color_number (GtkCssParser *parser,
} }
} }
gboolean
gtk_css_color_value_can_parse (GtkCssParser *parser)
{
/* This is way too generous, but meh... */
return gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_IDENT)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_AT_KEYWORD)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_HASH_ID)
|| gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_HASH_UNRESTRICTED)
|| gtk_css_parser_has_function (parser, "lighter")
|| gtk_css_parser_has_function (parser, "darker")
|| gtk_css_parser_has_function (parser, "shade")
|| gtk_css_parser_has_function (parser, "alpha")
|| gtk_css_parser_has_function (parser, "mix")
|| gtk_css_parser_has_function (parser, "hsl")
|| gtk_css_parser_has_function (parser, "hsla")
|| gtk_css_parser_has_function (parser, "rgb")
|| gtk_css_parser_has_function (parser, "rgba")
|| gtk_css_parser_has_function (parser, "hwb")
|| gtk_css_parser_has_function (parser, "oklab")
|| gtk_css_parser_has_function (parser, "oklch")
|| gtk_css_parser_has_function (parser, "color");
}
typedef struct typedef struct
{ {
GdkRGBA *rgba; GdkRGBA *rgba;

View File

@ -1314,7 +1314,7 @@ gtk_css_arg2_value_new (guint type,
return gtk_css_dimension_value_new (v, unit); return gtk_css_dimension_value_new (v, unit);
} }
/* This funciton is called at parsing time, so units are not /* This function is called at parsing time, so units are not
* canonical, and length values can't necessarily be unified. * canonical, and length values can't necessarily be unified.
*/ */
GtkCssValue * GtkCssValue *