From d36470bcebf57644464754f5ef045a4f8d057c2b Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 24 Dec 2014 17:22:49 +0000 Subject: Structure for callback mechanism --- src/narrative_window.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/narrative_window.c') diff --git a/src/narrative_window.c b/src/narrative_window.c index b5ecf9f..da1d8f1 100644 --- a/src/narrative_window.c +++ b/src/narrative_window.c @@ -190,7 +190,14 @@ static void update_toolbar(NarrativeWindow *nw) static SCBlock *narrative_stylesheet() { - return sc_parse("\\stylesheet{\\ss[slide]{\nSLIDE\n}}"); + return sc_parse("\\stylesheet{\\ss[slide]{\n\\callback[sthumb]\n}}"); +} + + +static cairo_surface_t *render_thumbnail(SCBlock *scblocks, void *vp) +{ + struct presentation *p = vp; + return NULL; } @@ -202,6 +209,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) GtkWidget *toolbar; GtkToolItem *button; SCBlock *stylesheets[3]; + SCCallbackList *cbl; if ( p->narrative_window != NULL ) { fprintf(stderr, "Narrative window is already open!\n"); @@ -229,6 +237,8 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app) stylesheets[1] = narrative_stylesheet(); stylesheets[2] = NULL; nw->sceditor = sc_editor_new(nw->p->scblocks, stylesheets); + cbl = sc_callback_list_new(); + sc_editor_set_callbacks(nw->sceditor, cbl); toolbar = gtk_toolbar_new(); gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS); -- cgit v1.2.3