From 54b33a62d7d1dd5e70ee2d54a0bba51a59bac76f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 3 Oct 2019 16:47:38 +0200 Subject: Get rid of spctx completely --- libstorycode/storycode.y | 312 +++++++++++++++++++++++++++++------------------ 1 file changed, 194 insertions(+), 118 deletions(-) (limited to 'libstorycode/storycode.y') diff --git a/libstorycode/storycode.y b/libstorycode/storycode.y index a0d4757..c6ba2eb 100644 --- a/libstorycode/storycode.y +++ b/libstorycode/storycode.y @@ -31,7 +31,30 @@ #include "slide.h" #include "stylesheet.h" - #include "scparse_priv.h" + enum style_mask + { + STYMASK_GEOM = 1<<0, + STYMASK_FONT = 1<<1, + STYMASK_ALIGNMENT = 1<<2, + STYMASK_PADDING = 1<<3, + STYMASK_PARASPACE = 1<<4, + STYMASK_FGCOL = 1<<5, + STYMASK_BGCOL = 1<<6, + }; + + struct style + { + enum style_mask mask; + struct frame_geom geom; + char *font; + enum alignment alignment; + struct length padding[4]; + struct length paraspace[4]; + struct colour fgcol; + enum gradient bggrad; + struct colour bgcol; + struct colour bgcol2; + }; struct paragraph { struct text_run *runs; @@ -59,6 +82,8 @@ struct paragraph para; struct many_paragraphs many_paragraphs; + struct style style; + struct length len; struct length lenquad[4]; struct frame_geom geom; @@ -77,7 +102,7 @@ extern int sclex(); extern int scparse(); - void scerror(struct scpctx *ctx, const char *s); + void scerror(Narrative *n, const char *s); extern int lineno; %} @@ -105,11 +130,11 @@ %type narrative %type slide %type slide_parts -%type stylesheet %type slide_part -%type textframe -%type slide_prestitle -%type slidetitle +%type imageframe +%type slidetitle +%type textframe +%type slide_prestitle %type multi_line_string %type text_line %type slide_bulletpoint @@ -118,9 +143,22 @@ %type RUN_TEXT %type one_or_more_runs +%type stylesheet +%type