[gtk/wip/baedert/nodeeditor] rendernodeparser: Parse text nodes
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/nodeeditor] rendernodeparser: Parse text nodes
- Date: Tue, 23 Apr 2019 05:13:21 +0000 (UTC)
commit 7514781071b812261ace79a448e399a31c929f2f
Author: Timm Bäder <mail baedert org>
Date: Tue Apr 23 07:11:58 2019 +0200
rendernodeparser: Parse text nodes
Actually just pretend to parse them until we've figured out what to do
about those.
gsk/gskrendernodeparser.c | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index 2f79ef4975..3b62aa6972 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -475,6 +475,13 @@ parse_colors4 (GtkCssParser *parser,
return parse_semicolon (parser);
}
+static gboolean
+parse_font (GtkCssParser *parser,
+ gpointer out_font)
+{
+ return FALSE;
+}
+
static gboolean
parse_node (GtkCssParser *parser, gpointer out_node);
@@ -770,6 +777,26 @@ parse_cross_fade_node (GtkCssParser *parser)
return result;
}
+static GskRenderNode *
+parse_text_node (GtkCssParser *parser)
+{
+ PangoFont *font = NULL;
+ float x = 0;
+ float y = 0;
+ GdkRGBA color = { 0, 0, 0, 0 };
+ const Declaration declarations[] = {
+ { "font", parse_font, &font },
+ { "x", parse_double, &x },
+ { "y", parse_double, &y },
+ { "color", parse_color, &color }
+ };
+
+ /* TODO: Check font parsing? */
+ parse_declarations (parser, declarations, G_N_ELEMENTS(declarations));
+
+ return gsk_color_node_new (&color, &GRAPHENE_RECT_INIT (x, y - 10, 100, 20));
+}
+
static GskRenderNode *
parse_clip_node (GtkCssParser *parser)
{
@@ -863,8 +890,8 @@ parse_node (GtkCssParser *parser,
{ "blend", parse_blend_node },
#endif
{ "cross-fade", parse_cross_fade_node },
-#if 0
{ "text", parse_text_node },
+#if 0
{ "blur", parse_blur_node },
#endif
{ "debug", parse_debug_node }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]