aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/presentation.c29
-rw-r--r--src/presentation.h16
-rw-r--r--src/render.c12
-rw-r--r--src/sc_interp.c14
-rw-r--r--tests/render_test.c2
-rw-r--r--tests/render_test_sc1.c2
6 files changed, 4 insertions, 71 deletions
diff --git a/src/presentation.c b/src/presentation.c
index 3e079e6..952688b 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -69,19 +69,6 @@ void free_presentation(struct presentation *p)
}
-static void renumber_slides(struct presentation *p)
-{
- int i;
- for ( i=0; i<p->num_slides; i++ ) {
- if ( p->slides[i]->constants != NULL ) {
- p->slides[i]->constants->slide_number = i+1;
- } else {
- fprintf(stderr, "Slide %i has no constants.\n", i);
- }
- }
-}
-
-
/* "pos" is the index that the caller would like this slide to have */
int insert_slide(struct presentation *p, struct slide *new, int pos)
{
@@ -109,8 +96,6 @@ int insert_slide(struct presentation *p, struct slide *new, int pos)
new->parent = p;
- renumber_slides(p);
-
return 0;
}
@@ -126,8 +111,6 @@ static void delete_slide_index(struct presentation *p, int pos)
p->num_slides--;
/* Don't bother to resize the array */
-
- renumber_slides(p);
}
@@ -154,12 +137,6 @@ struct slide *new_slide()
new->rendered_proj = NULL;
new->rendered_thumb = NULL;
- new->constants = calloc(1, sizeof(struct slide_constants));
- if ( new->constants == NULL ) {
- free(new);
- return NULL;
- }
-
new->top = frame_new();
/* FIXME: Set zero margins etc on top level frame */
@@ -263,12 +240,6 @@ struct presentation *new_presentation()
new = calloc(1, sizeof(struct presentation));
if ( new == NULL ) return NULL;
- new->constants = calloc(1, sizeof(struct presentation_constants));
- if ( new->constants == NULL ) {
- free(new);
- return NULL;
- }
-
num_presentations++;
new->num_presentations = &num_presentations;
diff --git a/src/presentation.h b/src/presentation.h
index 7dac81a..591efe9 100644
--- a/src/presentation.h
+++ b/src/presentation.h
@@ -34,27 +34,11 @@
#include "sc_parse.h"
-struct slide_constants
-{
- int slide_number;
-};
-
-
-struct presentation_constants
-{
- char *title;
- char *author;
- char *date;
-};
-
-
struct slide
{
struct presentation *parent;
struct slide_template *st;
- struct slide_constants *constants;
-
/* Any of these may be NULL */
cairo_surface_t *rendered_proj;
cairo_surface_t *rendered_edit;
diff --git a/src/render.c b/src/render.c
index ea6e573..68c101e 100644
--- a/src/render.c
+++ b/src/render.c
@@ -301,9 +301,7 @@ static int recursive_wrap_and_draw(struct frame *fr, cairo_t *cr,
static int render_frame(cairo_t *cr, struct frame *fr, ImageStore *is,
- enum is_size isz, struct slide_constants *scc,
- struct presentation_constants *pcc,
- PangoContext *pc, SCBlock *scblocks,
+ enum is_size isz, PangoContext *pc, SCBlock *scblocks,
SCBlock *stylesheet)
{
SCInterpreter *scin;
@@ -425,8 +423,7 @@ cairo_surface_t *render_slide(struct slide *s, int w, double ww, double hh,
pc = pango_font_map_create_context(fontmap);
pango_cairo_update_context(cr, pc);
- render_frame(cr, s->top, is, isz, s->constants,
- s->parent->constants, pc, s->parent->scblocks,
+ render_frame(cr, s->top, is, isz, pc, s->parent->scblocks,
s->parent->stylesheet);
cairo_font_options_destroy(fopts);
@@ -489,9 +486,8 @@ int export_pdf(struct presentation *p, const char *filename)
s->top->w = w;
s->top->h = w*r;
- render_frame(cr, s->top, p->is, ISZ_SLIDESHOW, s->constants,
- s->parent->constants, pc, s->parent->scblocks,
- s->parent->stylesheet);
+ render_frame(cr, s->top, p->is, ISZ_SLIDESHOW, pc,
+ s->parent->scblocks, s->parent->stylesheet);
cairo_show_page(cr);
diff --git a/src/sc_interp.c b/src/sc_interp.c
index 8e5868e..c5f25d1 100644
--- a/src/sc_interp.c
+++ b/src/sc_interp.c
@@ -559,20 +559,6 @@ static int check_outputs(SCBlock *bl, SCInterpreter *scin)
options);
}
- } else if ( strcmp(name, "slidenumber")==0) {
- if ( scin->s_constants != NULL ) {
- char *tmp = malloc(64);
- if ( tmp != NULL ) {
- snprintf(tmp, 63, "%i",
- scin->s_constants->slide_number);
- split_words(sc_interp_get_frame(scin)->boxes,
- scin->pc, bl, tmp, scin->lang, 0,
- scin);
- }
- } else {
- printf("No slide constants.\n");
- }
-
} else if ( strcmp(name, "f")==0 ) {
struct frame *fr = sc_block_frame(bl);
diff --git a/tests/render_test.c b/tests/render_test.c
index 67262e4..2bf856d 100644
--- a/tests/render_test.c
+++ b/tests/render_test.c
@@ -96,10 +96,8 @@ int main(int argc, char *argv[])
s.rendered_edit = NULL;
s.rendered_proj = NULL;
s.rendered_thumb = NULL;
- s.constants = NULL;
s.parent = &p;
- p.constants = NULL;
p.scblocks = fr->scblocks;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
diff --git a/tests/render_test_sc1.c b/tests/render_test_sc1.c
index 6a3dd51..4cb0c91 100644
--- a/tests/render_test_sc1.c
+++ b/tests/render_test_sc1.c
@@ -95,9 +95,7 @@ int main(int argc, char *argv[])
s.rendered_proj = NULL;
s.rendered_thumb = NULL;
s.parent = &p;
- s.constants = NULL;
- p.constants = NULL;
p.scblocks = fr->scblocks;
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);