From 86790d75487fda0aa5fccaf01d10ab00035047ad Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 21 Nov 2014 23:54:08 +0100 Subject: Get rid of slide.top --- src/presentation.c | 9 ++------- src/presentation.h | 4 +--- src/render.c | 26 +++++++++++++++++++++----- 3 files changed, 24 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/presentation.c b/src/presentation.c index 69fa23b..ea3080a 100644 --- a/src/presentation.c +++ b/src/presentation.c @@ -129,9 +129,6 @@ struct slide *new_slide() new = calloc(1, sizeof(struct slide)); if ( new == NULL ) return NULL; - new->top = frame_new(); - /* FIXME: Set zero margins etc on top level frame */ - new->scblocks = NULL; new->notes = NULL; @@ -377,8 +374,6 @@ int load_presentation(struct presentation *p, const char *filename) if ( s != NULL ) { s->scblocks = sc_block_child(block); - s->top = frame_new(); - s->top->scblocks = sc_block_child(block); attach_notes(s); } @@ -419,12 +414,12 @@ static struct frame *find_parent(struct frame *fr, struct frame *search) } -void delete_subframe(struct slide *s, struct frame *fr) +void delete_subframe(struct frame *top, struct frame *fr) { struct frame *parent; int i, idx, found; - parent = find_parent(s->top, fr); + parent = find_parent(top, fr); if ( parent == NULL ) { fprintf(stderr, "Couldn't find parent when deleting frame.\n"); return; diff --git a/src/presentation.h b/src/presentation.h index 197a298..0841def 100644 --- a/src/presentation.h +++ b/src/presentation.h @@ -44,8 +44,6 @@ struct slide struct presentation *parent; struct slide_template *st; - struct frame *top; - SCBlock *scblocks; SCBlock *notes; }; @@ -93,7 +91,7 @@ extern int insert_slide(struct presentation *p, struct slide *s, int pos); extern void free_slide(struct slide *s); extern void delete_slide(struct presentation *p, struct slide *s); -extern void delete_subframe(struct slide *s, struct frame *fr); +extern void delete_subframe(struct frame *top, struct frame *fr); extern char *packed_sc(struct frame *fr); diff --git a/src/render.c b/src/render.c index 364b7bd..21a6973 100644 --- a/src/render.c +++ b/src/render.c @@ -443,6 +443,7 @@ int export_pdf(struct presentation *p, const char *filename) for ( i=0; inum_slides; i++ ) { struct slide *s; + struct frame top; s = p->slides[i]; @@ -454,13 +455,28 @@ int export_pdf(struct presentation *p, const char *filename) cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_fill(cr); - s->top->x = 0.0; - s->top->y = 0.0; - s->top->w = w; - s->top->h = w*r; + top.x = 0.0; + top.y = 0.0; + top.children = NULL; + top.num_children = 0; + top.max_children = 0; + top.lines = NULL; + top.n_lines = 0; + top.max_lines = 0; + top.pad_l = 0; + top.pad_r = 0; + top.pad_t = 0; + top.pad_b = 0; + top.w = w; + top.h = w*r; + top.grad = GRAD_NONE; + top.bgcol[0] = 1.0; + top.bgcol[1] = 1.0; + top.bgcol[2] = 1.0; + top.bgcol[3] = 1.0; render_sc_to_surface(s->scblocks, surf, cr, p->slide_width, - p->slide_height, s->top, p->stylesheet, + p->slide_height, &top, p->stylesheet, p->is, ISZ_SLIDESHOW, i); cairo_restore(cr); -- cgit v1.2.3