From fcdd01f2c9e2664c3d82cd764064a1e6dea70674 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 30 Apr 2019 18:32:50 +0200 Subject: Use GEOMETRY for slide size --- libstorycode/storycode.y | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'libstorycode/storycode.y') diff --git a/libstorycode/storycode.y b/libstorycode/storycode.y index fce8d37..4c418eb 100644 --- a/libstorycode/storycode.y +++ b/libstorycode/storycode.y @@ -73,7 +73,7 @@ %token LEFT CENTER RIGHT %token STRING %token SQOPEN SQCLOSE -%token UNIT VALUE SIZE HEXCOL +%token UNIT VALUE HEXCOL %type narrative %type slide @@ -364,28 +364,15 @@ style_slide: style_slide_def: %empty - /* Doesn't need set_style() */ -| style_slide_def style_slidesize { } /* Call set_style() immediately */ | style_slide_def background { set_style(ctx, "SLIDE"); } +| style_slide_def slide_geom { set_style(ctx, "SLIDE"); } /* The ones below will call set_style() themselves */ | style_slide_def style_slide_prestitle { } | style_slide_def style_slide_text { } | style_slide_def style_slide_title { } ; -style_slidesize: - SIZE length 'x' length { if ( ($2.unit != LENGTH_UNIT) - || ($4.unit != LENGTH_UNIT) ) - { - fprintf(stderr, "Wrong slide size units\n"); - } else { - stylesheet_set_slide_default_size(narrative_get_stylesheet(ctx->n), - $2.len, $4.len); - } - } -; - background: BGCOL colour { copy_col(&ctx->bgcol, $2); ctx->bggrad = GRAD_NONE; @@ -396,6 +383,11 @@ background: ctx->mask |= STYMASK_BGCOL; } ; +slide_geom: + GEOMETRY geometry { ctx->geom = $2; + ctx->mask |= STYMASK_GEOM; } +; + style_slide_prestitle: PRESTITLE '{' styledefs '}' { set_style(ctx, "SLIDE.PRESTITLE"); } ; -- cgit v1.2.3