css: Turn number values into a virtual type

GtkCssNumberValue is now a base class for numbers.

Actual numbers are now implemented in GtkCssDimensionValue. The name is
borrowed from the CSS spec, so there.
This commit is contained in:
Benjamin Otte
2016-02-12 06:25:50 +01:00
parent e2d966eda5
commit b246d55472
6 changed files with 371 additions and 258 deletions

View File

@ -19,8 +19,7 @@
#include "gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkwin32themeprivate.h"
#include "gtkcssdimensionvalueprivate.h"
#include <errno.h>
#include <string.h>
@ -605,8 +604,8 @@ _gtk_css_parser_has_number (GtkCssParser *parser)
}
GtkCssValue *
_gtk_css_number_value_parse (GtkCssParser *parser,
GtkCssNumberParseFlags flags)
gtk_css_dimension_value_parse (GtkCssParser *parser,
GtkCssNumberParseFlags flags)
{
static const struct {
const char *name;
@ -721,7 +720,7 @@ _gtk_css_number_value_parse (GtkCssParser *parser,
_gtk_css_parser_skip_whitespace (parser);
return _gtk_css_number_value_new (value, unit);
return gtk_css_dimension_value_new (value, unit);
}
/* XXX: we should introduce GtkCssLenght that deals with