summaryrefslogtreecommitdiff
path: root/gtk/gtkcsspositionvalue.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-12-10 03:26:24 +0100
committerBenjamin Otte <otte@redhat.com>2016-12-10 04:32:55 +0100
commitd7148a47182e0b0ca286243101d3774c6b3d4be5 (patch)
tree12edf50d4ed91fb931bdf1ebe5e9d583b3e0bc31 /gtk/gtkcsspositionvalue.c
parent438ad208e7734e66bee56201f1d82a913907839a (diff)
downloadgtk+-d7148a47182e0b0ca286243101d3774c6b3d4be5.tar.gz
css: Add "border-spacing" CSS property
It's using a GtkCssPositionValue, even though that name is wrong. But the functionality of managing 2 lengths is exactly what we want. Nobody is using this yet.
Diffstat (limited to 'gtk/gtkcsspositionvalue.c')
-rw-r--r--gtk/gtkcsspositionvalue.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkcsspositionvalue.c b/gtk/gtkcsspositionvalue.c
index 9102b16bb0..62ecc68b57 100644
--- a/gtk/gtkcsspositionvalue.c
+++ b/gtk/gtkcsspositionvalue.c
@@ -291,6 +291,32 @@ _gtk_css_position_value_try_parse (GtkCssParser *parser)
return position_value_parse (parser, TRUE);
}
+GtkCssValue *
+gtk_css_position_value_parse_spacing (GtkCssParser *parser)
+{
+ GtkCssValue *x, *y;
+
+ x = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_LENGTH | GTK_CSS_POSITIVE_ONLY);
+ if (x == NULL)
+ return NULL;
+
+ if (gtk_css_number_value_can_parse (parser))
+ {
+ y = _gtk_css_number_value_parse (parser, GTK_CSS_PARSE_LENGTH | GTK_CSS_POSITIVE_ONLY);
+ if (y == NULL)
+ {
+ _gtk_css_value_unref (x);
+ return NULL;
+ }
+ }
+ else
+ {
+ y = _gtk_css_value_ref (x);
+ }
+
+ return _gtk_css_position_value_new (x, y);
+}
+
double
_gtk_css_position_value_get_x (const GtkCssValue *position,
double one_hundred_percent)