diff options
Diffstat (limited to 'src/sc_interp.c')
-rw-r--r-- | src/sc_interp.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/sc_interp.c b/src/sc_interp.c index 07f09a5..ae746f6 100644 --- a/src/sc_interp.c +++ b/src/sc_interp.c @@ -986,6 +986,18 @@ static void output_frame(SCInterpreter *scin, SCBlock *bl, Stylesheet *ss, } +static cairo_surface_t *draw_maths(int w, int h, void *bvp, void *vp) +{ + SCBlock *bl = bvp; + cairo_surface_t *surf; + + surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h); + printf("maths! '%s'\n", sc_block_contents(sc_block_child(bl))); + printf("render at %i x %i\n", w, h); + return surf; +} + + static int check_outputs(SCBlock *bl, SCInterpreter *scin, Stylesheet *ss) { const char *name = sc_block_name(bl); @@ -1009,6 +1021,19 @@ static int check_outputs(SCBlock *bl, SCInterpreter *scin, Stylesheet *ss) options); } + } else if ( (strcmp(name, "maths")==0) || (strcmp(name, "math")==0) ) { + double w, h; + char *filename; + if ( parse_image_options(options, sc_interp_get_frame(scin), + &w, &h, &filename) == 0 ) + { + add_callback_para(sc_interp_get_frame(scin), bl, + w, h, draw_maths, NULL, bl, NULL); + } else { + fprintf(stderr, _("Invalid image options '%s'\n"), + options); + } + } else if ( strcmp(name, "f")==0 ) { output_frame(scin, bl, ss, "$.slide.frame"); |