[gtk/wip/otte/nodeeditor2: 24/55] cssparser: Add gtk_css_parser_has_number()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/nodeeditor2: 24/55] cssparser: Add gtk_css_parser_has_number()
- Date: Sat, 4 May 2019 08:15:29 +0000 (UTC)
commit 68f14887685b38bb65cde24a20ce4b0eb28171ce
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]