[gtk/wip/otte/nodeeditor2: 27/57] cssparser: Add gtk_css_parser_has_number()



commit 3c6aa84e44d63efe79e32e93c01fcb0208ba4964
Author: Benjamin Otte <otte redhat com>
Date:   Wed May 1 15:27:52 2019 +0200

    cssparser: Add gtk_css_parser_has_number()

 gtk/css/gtkcssparser.c        | 9 +++++++++
 gtk/css/gtkcssparserprivate.h | 1 +
 2 files changed, 10 insertions(+)
---
diff --git a/gtk/css/gtkcssparser.c b/gtk/css/gtkcssparser.c
index e812df259b..2ead2e09af 100644
--- a/gtk/css/gtkcssparser.c
+++ b/gtk/css/gtkcssparser.c
@@ -1000,6 +1000,15 @@ gtk_css_parser_consume_url (GtkCssParser *self)
   return result;
 }
 
+gboolean
+gtk_css_parser_has_number (GtkCssParser *self)
+{
+  return gtk_css_parser_has_token (self, GTK_CSS_TOKEN_SIGNED_NUMBER)
+      || gtk_css_parser_has_token (self, GTK_CSS_TOKEN_SIGNLESS_NUMBER)
+      || gtk_css_parser_has_token (self, GTK_CSS_TOKEN_SIGNED_INTEGER)
+      || gtk_css_parser_has_token (self, GTK_CSS_TOKEN_SIGNLESS_INTEGER);
+}
+
 gboolean
 gtk_css_parser_consume_number (GtkCssParser *self,
                                double       *number)
diff --git a/gtk/css/gtkcssparserprivate.h b/gtk/css/gtkcssparserprivate.h
index 31b44cbce6..520d0eeaa0 100644
--- a/gtk/css/gtkcssparserprivate.h
+++ b/gtk/css/gtkcssparserprivate.h
@@ -118,6 +118,7 @@ gboolean                gtk_css_parser_has_token                (GtkCssParser
                                                                  GtkCssTokenType                 token_type);
 gboolean                gtk_css_parser_has_ident                (GtkCssParser                   *self,
                                                                  const char                     *ident);
+gboolean                gtk_css_parser_has_number               (GtkCssParser                   *self);
 gboolean                gtk_css_parser_has_integer              (GtkCssParser                   *self);
 gboolean                gtk_css_parser_has_function             (GtkCssParser                   *self,
                                                                  const char                     *name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]