From 244f80ed15ace68b3c3de7e5aa147bb80ab4274a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 11 Dec 2014 20:06:56 +0100 Subject: Fix narrative stylesheet --- src/narrative_window.c | 2 +- src/sc_editor.c | 28 ++++++++++++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/narrative_window.c b/src/narrative_window.c index df52390..c5994ad 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -190,7 +190,7 @@ static void update_toolbar(NarrativeWindow *nw) static SCBlock *narrative_stylesheet() { - return sc_parse("\\ss[slide]{\nSLIDE\n}"); + return sc_parse("\\stylesheet{\\ss[slide]{\nSLIDE\n}}"); } diff --git a/src/sc_editor.c b/src/sc_editor.c index 82c283a..ca64c8e 100644 --- a/src/sc_editor.c +++ b/src/sc_editor.c @@ -73,11 +73,6 @@ static void rerender(SCEditor *e) cairo_surface_destroy(e->surface); } - int i=0; - do { - printf("---%i: %p\n", i, e->stylesheets[i]); - i++; - } while ( e->stylesheets[i-1] != NULL ); e->surface = render_sc(e->scblocks, e->w, e->h, e->log_w, e->log_h, e->stylesheets, e->is, ISZ_EDITOR, e->slidenum); } @@ -1447,6 +1442,26 @@ void sc_editor_set_top_frame_editable(SCEditor *e, int top_frame_editable) } +static SCBlock **copy_ss_list(SCBlock **stylesheets) +{ + int n_ss = 0; + int i = 0; + SCBlock **ssc; + + if ( stylesheets == NULL ) return NULL; + + while ( stylesheets[n_ss] != NULL ) n_ss++; + n_ss++; /* One more for sentinel */ + + ssc = malloc(n_ss*sizeof(SCBlock *)); + if ( ssc == NULL ) return NULL; + + for ( i=0; ilog_w = 100; sceditor->log_h = 100; sceditor->is = imagestore_new(); - sceditor->stylesheets = stylesheets; sceditor->slidenum = 0; sceditor->min_border = 0.0; sceditor->top_editable = 0; + sceditor->stylesheets = copy_ss_list(stylesheets); + err = NULL; sceditor->bg_pixbuf = gdk_pixbuf_new_from_file(DATADIR"/colloquium/sky.png", &err); if ( sceditor->bg_pixbuf == NULL ) { -- cgit v1.2.3