summaryrefslogtreecommitdiff
path: root/gtk/gtkcssparser.c
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2012-01-05 15:47:23 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-09 18:37:58 +0100
commitfee09e726f9b46ca56dde0962ffd582eef4f2b18 (patch)
tree6838a6c7965bfc148cce4cf9486713b32c012455 /gtk/gtkcssparser.c
parentfce45757cb7eae2a85be7b26b0299ebaac3721c0 (diff)
downloadgtk+-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.c17
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,