aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/colloquium.c17
-rw-r--r--src/narrative_window.c74
-rw-r--r--src/narrative_window.h3
-rw-r--r--src/pdfstorycode.c18
-rw-r--r--src/pr_clock.c3
-rw-r--r--src/slide_window.c28
-rw-r--r--src/slide_window.h2
-rw-r--r--src/slideshow.c14
-rw-r--r--src/slideshow.h4
-rw-r--r--src/testcard.c6
-rw-r--r--src/testcard.h4
11 files changed, 83 insertions, 90 deletions
diff --git a/src/colloquium.c b/src/colloquium.c
index ac60a63..65647ad 100644
--- a/src/colloquium.c
+++ b/src/colloquium.c
@@ -35,7 +35,7 @@
#include <libintl.h>
#define _(x) gettext(x)
-#include <presentation.h>
+#include <narrative.h>
#include "colloquium.h"
#include "narrative_window.h"
@@ -61,16 +61,13 @@ static void colloquium_activate(GApplication *papp)
{
Colloquium *app = COLLOQUIUM(papp);
if ( !app->first_run ) {
- Presentation *p;
Narrative *n;
Stylesheet *ss;
- p = presentation_new();
n = narrative_new();
ss = stylesheet_new();
narrative_add_text(n, strdup(""));
- presentation_add_narrative(p, n);
- presentation_add_stylesheet(p, ss);
- narrative_window_new(p, papp);
+ narrative_add_stylesheet(n, ss);
+ narrative_window_new(n, papp);
}
}
@@ -231,10 +228,10 @@ static void colloquium_open(GApplication *papp, GFile **files, gint n_files,
int i;
for ( i=0; i<n_files; i++ ) {
- Presentation *p;
- p = presentation_load(files[i]);
- if ( p != NULL ) {
- narrative_window_new(p, papp);
+ Narrative *n;
+ n = narrative_load(files[i]);
+ if ( n != NULL ) {
+ narrative_window_new(n, papp);
} else {
char *uri = g_file_get_uri(files[i]);
fprintf(stderr, _("Failed to load presentation '%s'\n"),
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 94515df..772c886 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -33,7 +33,7 @@
#include <libintl.h>
#define _(x) gettext(x)
-#include <presentation.h>
+#include <narrative.h>
#include <gtk/gtknarrativeview.h>
#include "colloquium.h"
@@ -54,7 +54,7 @@ struct _narrative_window
GtkToolItem *blast;
GtkWidget *nv;
GApplication *app;
- Presentation *p;
+ Narrative *n;
GFile *file;
SCSlideshow *show;
int show_no_slides;
@@ -95,7 +95,7 @@ static void update_titlebar(NarrativeWindow *nw)
}
strcat(title, " - Colloquium");
- if ( presentation_get_unsaved(nw->p) ) {
+ if ( narrative_get_unsaved(nw->n) ) {
strcat(title, " *");
}
gtk_window_set_title(GTK_WINDOW(nw->window), title);
@@ -119,7 +119,7 @@ static void update_toolbar(NarrativeWindow *nw)
gtk_widget_set_sensitive(GTK_WIDGET(nw->bprev), TRUE);
}
- n_para = narrative_get_num_items(presentation_get_narrative(nw->p));
+ n_para = narrative_get_num_items(nw->n);
if ( cur_para == n_para - 1 ) {
gtk_widget_set_sensitive(GTK_WIDGET(nw->bnext), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(nw->blast), FALSE);
@@ -137,11 +137,11 @@ static gint saveas_response_sig(GtkWidget *d, gint response,
GFile *file = gtk_file_chooser_get_file(GTK_FILE_CHOOSER(d));
- if ( presentation_save(nw->p, file) ) {
+ if ( narrative_save(nw->n, file) ) {
show_error(nw, _("Failed to save presentation"));
}
- /* save_presentation keeps a reference to both of these */
+ /* save_narrative keeps a reference to both of these */
g_object_unref(file);
}
@@ -190,7 +190,7 @@ static void save_sig(GSimpleAction *action, GVariant *parameter, gpointer vp)
return saveas_sig(NULL, NULL, nw);
}
- presentation_save(nw->p, nw->file);
+ narrative_save(nw->n, nw->file);
}
@@ -212,7 +212,7 @@ static void delete_slide_sig(GSimpleAction *action, GVariant *parameter,
//
// /* Full rerender */
// sc_editor_set_scblock(nw->nv, nw->dummy_top);
-// nw->p->saved = 0;
+// nw->n->saved = 0;
// update_titlebar(nw);
}
@@ -231,7 +231,7 @@ static gint load_ss_response_sig(GtkWidget *d, gint response,
// if ( new_ss != NULL ) {
//
// stylesheet_free(nw->p->stylesheet);
-// nw->p->stylesheet = new_ss;
+// nw->n->stylesheet = new_ss;
// sc_editor_set_stylesheet(nw->nv, new_ss);
//
// /* Full rerender */
@@ -256,7 +256,7 @@ static void stylesheet_changed_sig(GtkWidget *da, NarrativeWindow *nw)
// int i;
//
// /* It might have changed (been created) since last time */
-// sc_editor_set_stylesheet(nw->nv, nw->p->stylesheet);
+// sc_editor_set_stylesheet(nw->nv, nwn>p->stylesheet);
//
// /* Full rerender, first block may have changed */
// sc_editor_set_scblock(nw->nv, nw->dummy_top);
@@ -274,7 +274,7 @@ static void edit_ss_sig(GSimpleAction *action, GVariant *parameter,
// NarrativeWindow *nw = vp;
// StylesheetEditor *se;
//
-// se = stylesheet_editor_new(nw->p);
+// se = stylesheet_editor_new(nw->n);
// gtk_window_set_transient_for(GTK_WINDOW(se), GTK_WINDOW(nw->window));
// g_signal_connect(G_OBJECT(se), "changed",
// G_CALLBACK(stylesheet_changed_sig), nw);
@@ -309,7 +309,7 @@ static void add_slide_sig(GSimpleAction *action, GVariant *parameter,
{
NarrativeWindow *nw = vp;
gtk_narrative_view_add_slide_at_cursor(GTK_NARRATIVE_VIEW(nw->nv));
- presentation_set_unsaved(nw->p);
+ narrative_set_unsaved(nw->n);
update_titlebar(nw);
}
@@ -318,7 +318,7 @@ static void first_para_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
NarrativeWindow *nw = vp;
- int n_paras = narrative_get_num_items(presentation_get_narrative(nw->p));
+ int n_paras = narrative_get_num_items(nw->n);
gtk_narrative_view_set_cursor_para(GTK_NARRATIVE_VIEW(nw->nv), 0);
pr_clock_set_pos(nw->pr_clock,
gtk_narrative_view_get_cursor_para(GTK_NARRATIVE_VIEW(nw->nv)),
@@ -330,7 +330,7 @@ static void first_para_sig(GSimpleAction *action, GVariant *parameter,
static void ss_prev_para(SCSlideshow *ss, void *vp)
{
NarrativeWindow *nw = vp;
- int n_paras = narrative_get_num_items(presentation_get_narrative(nw->p));
+ int n_paras = narrative_get_num_items(nw->n);
if ( gtk_narrative_view_get_cursor_para(GTK_NARRATIVE_VIEW(nw->nv)) == 0 ) return;
gtk_narrative_view_set_cursor_para(GTK_NARRATIVE_VIEW(nw->nv),
gtk_narrative_view_get_cursor_para(GTK_NARRATIVE_VIEW(nw->nv))-1);
@@ -353,12 +353,10 @@ static void ss_next_para(SCSlideshow *ss, void *vp)
{
NarrativeWindow *nw = vp;
Slide *ns;
- Narrative *narr;
GtkNarrativeView *nv;
int n_paras;
- narr = presentation_get_narrative(nw->p);
- n_paras = narrative_get_num_items(narr);
+ n_paras = narrative_get_num_items(nw->n);
nv = GTK_NARRATIVE_VIEW(nw->nv);
if ( gtk_narrative_view_get_cursor_para(nv) == n_paras - 1 ) return;
@@ -371,13 +369,13 @@ static void ss_next_para(SCSlideshow *ss, void *vp)
{
Slide *ns;
gtk_narrative_view_set_cursor_para(nv, i);
- ns = narrative_get_slide(narr, i);
+ ns = narrative_get_slide(nw->n, i);
if ( ns != NULL ) break;
}
}
pr_clock_set_pos(nw->pr_clock, gtk_narrative_view_get_cursor_para(nv), n_paras);
- ns = narrative_get_slide(narr, gtk_narrative_view_get_cursor_para(nv));
+ ns = narrative_get_slide(nw->n, gtk_narrative_view_get_cursor_para(nv));
if ( ns != NULL ) {
sc_slideshow_set_slide(nw->show, ns);
}
@@ -397,7 +395,7 @@ static void last_para_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
NarrativeWindow *nw = vp;
- int n_paras = narrative_get_num_items(presentation_get_narrative(nw->p));
+ int n_paras = narrative_get_num_items(nw->n);
gtk_narrative_view_set_cursor_para(GTK_NARRATIVE_VIEW(nw->nv), -1);
pr_clock_set_pos(nw->pr_clock,
gtk_narrative_view_get_cursor_para(GTK_NARRATIVE_VIEW(nw->nv)),
@@ -417,12 +415,12 @@ static void testcard_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
NarrativeWindow *nw = vp;
- show_testcard(nw->p);
+ show_testcard(nw->n);
}
static gint export_pdf_response_sig(GtkWidget *d, gint response,
- Presentation *p)
+ Narrative *n)
{
// if ( response == GTK_RESPONSE_ACCEPT ) {
// char *filename;
@@ -440,7 +438,7 @@ static gint export_pdf_response_sig(GtkWidget *d, gint response,
static void print_sig(GSimpleAction *action, GVariant *parameter, gpointer vp)
{
//NarrativeWindow *nw = vp;
-// run_printing(nw->p, nw->window);
+// run_printing(nw->n, nw->window);
}
@@ -460,7 +458,7 @@ static void exportpdf_sig(GSimpleAction *action, GVariant *parameter,
// TRUE);
//
// g_signal_connect(G_OBJECT(d), "response",
-// G_CALLBACK(export_pdf_response_sig), nw->p);
+// G_CALLBACK(export_pdf_response_sig), nw->n);
//
// gtk_widget_show_all(d);
}
@@ -476,7 +474,7 @@ static gboolean nw_button_press_sig(GtkWidget *da, GdkEventButton *event,
static void changed_sig(GtkWidget *da, NarrativeWindow *nw)
{
- presentation_set_unsaved(nw->p);
+ narrative_set_unsaved(nw->n);
update_titlebar(nw);
}
@@ -504,7 +502,7 @@ static gboolean nw_double_click_sig(GtkWidget *da, gpointer *pslide,
NarrativeWindow *nw)
{
Slide *slide = (Slide *)pslide;
- slide_window_open(nw->p, slide, nw->app);
+ slide_window_open(nw->n, slide, nw->app);
return FALSE;
}
@@ -575,13 +573,13 @@ static void start_slideshow_here_sig(GSimpleAction *action, GVariant *parameter,
NarrativeWindow *nw = vp;
Slide *slide;
- if ( presentation_get_num_slides(nw->p) == 0 ) return;
+ if ( narrative_get_num_slides(nw->n) == 0 ) return;
- slide = narrative_get_slide(presentation_get_narrative(nw->p),
+ slide = narrative_get_slide(nw->n,
gtk_narrative_view_get_cursor_para(GTK_NARRATIVE_VIEW(nw->nv)));
if ( slide == NULL ) return;
- nw->show = sc_slideshow_new(nw->p, GTK_APPLICATION(nw->app));
+ nw->show = sc_slideshow_new(nw->n, GTK_APPLICATION(nw->app));
if ( nw->show == NULL ) return;
nw->show_no_slides = 0;
@@ -602,9 +600,9 @@ static void start_slideshow_noslides_sig(GSimpleAction *action, GVariant *parame
{
NarrativeWindow *nw = vp;
- if ( presentation_get_num_slides(nw->p) == 0 ) return;
+ if ( narrative_get_num_slides(nw->n) == 0 ) return;
- nw->show = sc_slideshow_new(nw->p, GTK_APPLICATION(nw->app));
+ nw->show = sc_slideshow_new(nw->n, GTK_APPLICATION(nw->app));
if ( nw->show == NULL ) return;
nw->show_no_slides = 1;
@@ -613,7 +611,7 @@ static void start_slideshow_noslides_sig(GSimpleAction *action, GVariant *parame
G_CALLBACK(nw_key_press_sig), nw);
g_signal_connect(G_OBJECT(nw->show), "destroy",
G_CALLBACK(ss_destroy_sig), nw);
- sc_slideshow_set_slide(nw->show, presentation_get_slide_by_number(nw->p, 0));
+ sc_slideshow_set_slide(nw->show, narrative_get_slide_by_number(nw->n, 0));
gtk_narrative_view_set_para_highlight(GTK_NARRATIVE_VIEW(nw->nv), 1);
gtk_narrative_view_set_cursor_para(GTK_NARRATIVE_VIEW(nw->nv), 0);
update_toolbar(nw);
@@ -625,9 +623,9 @@ static void start_slideshow_sig(GSimpleAction *action, GVariant *parameter,
{
NarrativeWindow *nw = vp;
- if ( presentation_get_num_slides(nw->p) == 0 ) return;
+ if ( narrative_get_num_slides(nw->n) == 0 ) return;
- nw->show = sc_slideshow_new(nw->p, GTK_APPLICATION(nw->app));
+ nw->show = sc_slideshow_new(nw->n, GTK_APPLICATION(nw->app));
if ( nw->show == NULL ) return;
nw->show_no_slides = 0;
@@ -636,7 +634,7 @@ static void start_slideshow_sig(GSimpleAction *action, GVariant *parameter,
G_CALLBACK(nw_key_press_sig), nw);
g_signal_connect(G_OBJECT(nw->show), "destroy",
G_CALLBACK(ss_destroy_sig), nw);
- sc_slideshow_set_slide(nw->show, presentation_get_slide_by_number(nw->p, 0));
+ sc_slideshow_set_slide(nw->show, narrative_get_slide_by_number(nw->n, 0));
gtk_narrative_view_set_para_highlight(GTK_NARRATIVE_VIEW(nw->nv), 1);
gtk_narrative_view_set_cursor_para(GTK_NARRATIVE_VIEW(nw->nv), 0);
gtk_widget_show_all(GTK_WIDGET(nw->show));
@@ -690,7 +688,7 @@ GActionEntry nw_entries[] = {
//}
-NarrativeWindow *narrative_window_new(Presentation *p, GApplication *papp)
+NarrativeWindow *narrative_window_new(Narrative *n, GApplication *papp)
{
NarrativeWindow *nw;
GtkWidget *vbox;
@@ -704,7 +702,7 @@ NarrativeWindow *narrative_window_new(Presentation *p, GApplication *papp)
if ( nw == NULL ) return NULL;
nw->app = papp;
- nw->p = p;
+ nw->n = n;
nw->n_slidewindows = 0;
nw->window = gtk_application_window_new(GTK_APPLICATION(app));
@@ -716,7 +714,7 @@ NarrativeWindow *narrative_window_new(Presentation *p, GApplication *papp)
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add(GTK_CONTAINER(nw->window), vbox);
- nw->nv = gtk_narrative_view_new(p);
+ nw->nv = gtk_narrative_view_new(n);
toolbar = gtk_toolbar_new();
gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_ICONS);
diff --git a/src/narrative_window.h b/src/narrative_window.h
index 51c7dcc..a2c769c 100644
--- a/src/narrative_window.h
+++ b/src/narrative_window.h
@@ -29,7 +29,6 @@
typedef struct _narrative_window NarrativeWindow;
-extern NarrativeWindow *narrative_window_new(Presentation *p,
- GApplication *app);
+extern NarrativeWindow *narrative_window_new(Narrative *n, GApplication *app);
#endif /* NARRATIVE_WINDOW_H */
diff --git a/src/pdfstorycode.c b/src/pdfstorycode.c
index 421839d..d09fb47 100644
--- a/src/pdfstorycode.c
+++ b/src/pdfstorycode.c
@@ -35,7 +35,7 @@
#include <pango/pangocairo.h>
#include "storycode.h"
-#include "presentation.h"
+#include "narrative.h"
#include "slide.h"
#include "imagestore.h"
#include "slide_render_cairo.h"
@@ -44,7 +44,7 @@
#define _(x) gettext(x)
-static int render_slides_to_pdf(Presentation *p, ImageStore *is, const char *filename)
+static int render_slides_to_pdf(Narrative *n, ImageStore *is, const char *filename)
{
double w = 2048.0;
cairo_surface_t *surf;
@@ -64,20 +64,20 @@ static int render_slides_to_pdf(Presentation *p, ImageStore *is, const char *fil
sel.para = 0; sel.pos = 0; sel.trail = 0;
- for ( i=0; i<presentation_get_num_slides(p); i++ )
+ for ( i=0; i<narrative_get_num_slides(n); i++ )
{
Slide *s;
double log_w, log_h;
- s = presentation_get_slide_by_number(p, i);
- slide_get_logical_size(s, presentation_get_stylesheet(p),
+ s = narrative_get_slide_by_number(n, i);
+ slide_get_logical_size(s, narrative_get_stylesheet(n),
&log_w, &log_h);
cairo_pdf_surface_set_size(surf, w, w*(log_h/log_w));
cairo_save(cr);
cairo_scale(cr, w/log_w, w/log_w);
- slide_render_cairo(s, cr, is, presentation_get_stylesheet(p),
+ slide_render_cairo(s, cr, is, narrative_get_stylesheet(n),
i, pango_language_get_default(), pc,
NULL, sel, sel);
cairo_show_page(cr);
@@ -98,20 +98,20 @@ int main(int argc, char *argv[])
GBytes *bytes;
const char *text;
size_t len;
- Presentation *p;
+ Narrative *n;
ImageStore *is;
file = g_file_new_for_commandline_arg(argv[1]);
bytes = g_file_load_bytes(file, NULL, NULL, NULL);
text = g_bytes_get_data(bytes, &len);
- p = storycode_parse_presentation(text);
+ n = storycode_parse_presentation(text);
g_bytes_unref(bytes);
is = imagestore_new(".");
imagestore_set_parent(is, g_file_get_parent(file));
/* Render each slide to PDF */
- render_slides_to_pdf(p, is, "slides.pdf");
+ render_slides_to_pdf(n, is, "slides.pdf");
return 0;
}
diff --git a/src/pr_clock.c b/src/pr_clock.c
index aa1348e..ce20153 100644
--- a/src/pr_clock.c
+++ b/src/pr_clock.c
@@ -1,7 +1,7 @@
/*
* pr_clock.c
*
- * Copyright © 2013-2018 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2019 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -32,7 +32,6 @@
#include <libintl.h>
#define _(x) gettext(x)
-#include "presentation.h"
#include "pr_clock.h"
diff --git a/src/slide_window.c b/src/slide_window.c
index 854c1d5..24b91a0 100644
--- a/src/slide_window.c
+++ b/src/slide_window.c
@@ -33,7 +33,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <math.h>
-#include <presentation.h>
+#include <narrative.h>
#include <slide.h>
#include <gtkslideview.h>
@@ -44,7 +44,7 @@
struct _slidewindow
{
GtkWidget *window;
- Presentation *p;
+ Narrative *n;
Slide *slide;
GtkWidget *sv;
};
@@ -94,16 +94,16 @@ static void change_edit_slide(SlideWindow *sw, Slide *np)
static void change_slide_first(SlideWindow *sw)
{
- Slide *s = presentation_get_slide_by_number(sw->p, 0);
+ Slide *s = narrative_get_slide_by_number(sw->n, 0);
if ( s != NULL ) change_edit_slide(sw, s);
}
static void change_slide_backwards(SlideWindow *sw)
{
- int slide_n = presentation_get_slide_number(sw->p, sw->slide);
+ int slide_n = narrative_get_slide_number_for_slide(sw->n, sw->slide);
if ( slide_n > 0 ) {
- Slide *s = presentation_get_slide_by_number(sw->p, slide_n-1);
+ Slide *s = narrative_get_slide_by_number(sw->n, slide_n-1);
change_edit_slide(sw, s);
}
}
@@ -111,16 +111,16 @@ static void change_slide_backwards(SlideWindow *sw)
static void change_slide_forwards(SlideWindow *sw)
{
- int slide_n = presentation_get_slide_number(sw->p, sw->slide);
- Slide *s = presentation_get_slide_by_number(sw->p, slide_n+1);
+ int slide_n = narrative_get_slide_number_for_slide(sw->n, sw->slide);
+ Slide *s = narrative_get_slide_by_number(sw->n, slide_n+1);
if ( s != NULL ) change_edit_slide(sw, s);
}
static void change_slide_last(SlideWindow *sw)
{
- int slide_n = presentation_get_num_slides(sw->p);
- Slide *s = presentation_get_slide_by_number(sw->p, slide_n);
+ int slide_n = narrative_get_num_slides(sw->n);
+ Slide *s = narrative_get_slide_by_number(sw->n, slide_n);
if ( s != NULL ) change_edit_slide(sw, s);
}
@@ -159,7 +159,7 @@ static void last_slide_sig(GSimpleAction *action, GVariant *parameter,
static gboolean sw_close_sig(GtkWidget *w, SlideWindow *sw)
{
- //narrative_window_sw_closed(sw->p->narrative_window, sw);
+ //narrative_window_sw_closed(sw->n->narrative_window, sw);
return FALSE;
}
@@ -204,7 +204,7 @@ GActionEntry sw_entries[] = {
};
-extern SlideWindow *slide_window_open(Presentation *p, Slide *slide,
+extern SlideWindow *slide_window_open(Narrative *n, Slide *slide,
GApplication *papp)
{
GtkWidget *window;
@@ -218,7 +218,7 @@ extern SlideWindow *slide_window_open(Presentation *p, Slide *slide,
window = gtk_application_window_new(GTK_APPLICATION(app));
gtk_window_set_role(GTK_WINDOW(window), "slide");
sw->window = window;
- sw->p = p;
+ sw->n = n;
sw->slide = slide;
g_action_map_add_action_entries(G_ACTION_MAP(window), sw_entries,
@@ -227,12 +227,12 @@ extern SlideWindow *slide_window_open(Presentation *p, Slide *slide,
g_signal_connect(G_OBJECT(window), "destroy",
G_CALLBACK(sw_close_sig), sw);
- sw->sv = gtk_slide_view_new(p, slide);
+ sw->sv = gtk_slide_view_new(n, slide);
g_signal_connect(G_OBJECT(sw->sv), "key-press-event",
G_CALLBACK(sw_key_press_sig), sw);
- slide_get_logical_size(slide, presentation_get_stylesheet(p), &w, &h);
+ slide_get_logical_size(slide, narrative_get_stylesheet(n), &w, &h);
gtk_window_set_default_size(GTK_WINDOW(window), w, h);
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(sw->sv));
diff --git a/src/slide_window.h b/src/slide_window.h
index f59fad1..50a93c4 100644
--- a/src/slide_window.h
+++ b/src/slide_window.h
@@ -29,7 +29,7 @@
typedef struct _slidewindow SlideWindow;
-extern SlideWindow *slide_window_open(Presentation *p, Slide *slide,
+extern SlideWindow *slide_window_open(Narrative *n, Slide *slide,
GApplication *papp);
#endif /* SLIDEWINDOW_H */
diff --git a/src/slideshow.c b/src/slideshow.c
index 1bd1930..692509f 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -33,7 +33,7 @@
#include <libintl.h>
#define _(x) gettext(x)
-#include <presentation.h>
+#include <narrative.h>
#include "slide_render_cairo.h"
#include "slideshow.h"
@@ -90,7 +90,7 @@ static gboolean ss_draw_sig(GtkWidget *da, cairo_t *cr, SCSlideshow *ss)
cairo_fill(cr);
slide_get_logical_size(ss->cur_slide,
- presentation_get_stylesheet(ss->p), &lw, &lh);
+ narrative_get_stylesheet(ss->n), &lw, &lh);
if ( lw/lh > (double)dw/dh ) {
/* Slide is too wide. Letterboxing top/bottom */
@@ -116,12 +116,12 @@ static gboolean ss_draw_sig(GtkWidget *da, cairo_t *cr, SCSlideshow *ss)
cairo_scale(cr, sw/lw, sh/lh);
sel.para = 0; sel.pos = 0; sel.trail = 0;
- n = presentation_get_slide_number(ss->p, ss->cur_slide);
+ n = narrative_get_slide_number_for_slide(ss->n, ss->cur_slide);
pc = pango_cairo_create_context(cr);
slide_render_cairo(ss->cur_slide, cr,
- presentation_get_imagestore(ss->p),
- presentation_get_stylesheet(ss->p),
+ narrative_get_imagestore(ss->n),
+ narrative_get_stylesheet(ss->n),
n, pango_language_get_default(), pc,
NULL, sel, sel);
@@ -160,7 +160,7 @@ void sc_slideshow_set_slide(SCSlideshow *ss, Slide *ns)
}
-SCSlideshow *sc_slideshow_new(Presentation *p, GtkApplication *app)
+SCSlideshow *sc_slideshow_new(Narrative *n, GtkApplication *app)
{
GdkDisplay *display;
int n_monitors;
@@ -170,7 +170,7 @@ SCSlideshow *sc_slideshow_new(Presentation *p, GtkApplication *app)
if ( ss == NULL ) return NULL;
ss->blank = 0;
- ss->p = p;
+ ss->n = n;
ss->cur_slide = NULL;
ss->blank_cursor = NULL;
ss->app = app;
diff --git a/src/slideshow.h b/src/slideshow.h
index 777b9f2..07fc542 100644
--- a/src/slideshow.h
+++ b/src/slideshow.h
@@ -51,7 +51,7 @@ struct _scslideshow
GtkWindow parent_instance;
/* <private> */
- Presentation *p;
+ Narrative *n;
Slide *cur_slide;
GtkWidget *drawingarea;
GdkCursor *blank_cursor;
@@ -72,7 +72,7 @@ struct _scslideshowclass
typedef struct _scslideshow SCSlideshow;
typedef struct _scslideshowclass SCSlideshowClass;
-extern SCSlideshow *sc_slideshow_new(Presentation *p, GtkApplication *app);
+extern SCSlideshow *sc_slideshow_new(Narrative *n, GtkApplication *app);
extern void sc_slideshow_set_slide(SCSlideshow *ss, Slide *ns);
extern Slide *sc_slideshow_get_slide(SCSlideshow *ss);
diff --git a/src/testcard.c b/src/testcard.c
index 2975187..9febf90 100644
--- a/src/testcard.c
+++ b/src/testcard.c
@@ -33,7 +33,7 @@
#include <libintl.h>
#define _(x) gettext(x)
-#include <presentation.h>
+#include <narrative.h>
struct testcard
@@ -236,7 +236,7 @@ static gboolean tc_key_press_sig(GtkWidget *da, GdkEventKey *event,
}
-void show_testcard(Presentation *p)
+void show_testcard(Narrative *n)
{
GdkDisplay *display;
int n_monitors;
@@ -246,7 +246,7 @@ void show_testcard(Presentation *p)
if ( tc == NULL ) return;
tc->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- stylesheet_get_slide_default_size(presentation_get_stylesheet(p),
+ stylesheet_get_slide_default_size(narrative_get_stylesheet(n),
&tc->slide_width, &tc->slide_height);
tc->drawingarea = gtk_drawing_area_new();
diff --git a/src/testcard.h b/src/testcard.h
index da8315f..8e9a4ca 100644
--- a/src/testcard.h
+++ b/src/testcard.h
@@ -27,8 +27,8 @@
#include <config.h>
#endif
-#include <presentation.h>
+#include <narrative.h>
-extern void show_testcard(Presentation *p);
+extern void show_testcard(Narrative *n);
#endif /* TESTCARD_H */