diff options
author | Paolo Borelli <pborelli@gnome.org> | 2012-01-05 15:47:23 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-01-09 18:37:58 +0100 |
commit | fee09e726f9b46ca56dde0962ffd582eef4f2b18 (patch) | |
tree | 6838a6c7965bfc148cce4cf9486713b32c012455 /gtk/gtkcssparser.c | |
parent | fce45757cb7eae2a85be7b26b0299ebaac3721c0 (diff) | |
download | gtk+-fee09e726f9b46ca56dde0962ffd582eef4f2b18.tar.gz |
Introduce _gtk_css_parser_try_length
This starts to introduce the proper API abstraction for when we will
support different units
Diffstat (limited to 'gtk/gtkcssparser.c')
-rw-r--r-- | gtk/gtkcssparser.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkcssparser.c b/gtk/gtkcssparser.c index 8bdcfc291d..a136466ee5 100644 --- a/gtk/gtkcssparser.c +++ b/gtk/gtkcssparser.c @@ -578,6 +578,23 @@ _gtk_css_parser_try_double (GtkCssParser *parser, return TRUE; } +/* XXX: we should introduce GtkCssLenght that deals with + * different kind of units */ +gboolean +_gtk_css_parser_try_length (GtkCssParser *parser, + int *value) +{ + if (!_gtk_css_parser_try_int (parser, value)) + return FALSE; + + /* FIXME: _try_uint skips spaces while the + * spec forbids them + */ + _gtk_css_parser_try (parser, "px", TRUE); + + return TRUE; +} + gboolean _gtk_css_parser_try_enum (GtkCssParser *parser, GType enum_type, |