[gtk+/wip/otte/tokenizer: 63/78] cssimage: Add token parser for builtin images
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/tokenizer: 63/78] cssimage: Add token parser for builtin images
- Date: Fri, 25 Nov 2016 22:42:56 +0000 (UTC)
commit 63b1e50835156ff0d44776c3e6984db9b6f18706
Author: Benjamin Otte <otte redhat com>
Date: Sun Mar 27 15:14:19 2016 +0200
cssimage: Add token parser for builtin images
gtk/gtkcssimagebuiltin.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index 012abba..4b1727e 100644
--- a/gtk/gtkcssimagebuiltin.c
+++ b/gtk/gtkcssimagebuiltin.c
@@ -794,6 +794,24 @@ gtk_css_image_builtin_parse (GtkCssImage *image,
return TRUE;
}
+static gboolean
+gtk_css_image_builtin_token_parse (GtkCssImage *image,
+ GtkCssTokenSource *source)
+{
+ const GtkCssToken *token;
+
+ token = gtk_css_token_source_get_token (source);
+
+ if (!gtk_css_token_is_ident (token, "builtin"))
+ {
+ gtk_css_token_source_error (source, "Expected 'builtin'");
+ gtk_css_token_source_consume_all (source);
+ return FALSE;
+ }
+
+ gtk_css_token_source_consume_token (source);
+ return TRUE;
+}
static void
gtk_css_image_builtin_print (GtkCssImage *image,
GString *string)
@@ -864,6 +882,7 @@ gtk_css_image_builtin_class_init (GtkCssImageBuiltinClass *klass)
image_class->draw = gtk_css_image_builtin_real_draw;
image_class->parse = gtk_css_image_builtin_parse;
+ image_class->token_parse = gtk_css_image_builtin_token_parse;
image_class->print = gtk_css_image_builtin_print;
image_class->compute = gtk_css_image_builtin_compute;
image_class->equal = gtk_css_image_builtin_equal;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]