aboutsummaryrefslogtreecommitdiff
path: root/libstorycode/narrative.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-03-30 17:32:24 +0100
committerThomas White <taw@bitwiz.me.uk>2019-03-30 17:32:24 +0100
commit5a1e588c3fbdce549e0b3c487e2671c679890675 (patch)
treece7f29799aa02cec088d2ec676069ae4ac9cac8d /libstorycode/narrative.h
parent96c903e0756e8a85649c1f7d8d6aa1b146b8c038 (diff)
Get rid of Presentation structure
It doesn't have any reason to exist. A Narrative defines the top-level object already. This is, after all, a narrative-based presentation system. This removes a lot of faff surrounding retrieving the Narrative from the Presentation. It also removes a gigantic place for bugs to hide in keeping the Presentation's view of the slides in sync with the Narrative's opinion. What was that quote? "Code is terrible, and we want as little of it as possible in our program."
Diffstat (limited to 'libstorycode/narrative.h')
-rw-r--r--libstorycode/narrative.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libstorycode/narrative.h b/libstorycode/narrative.h
index 193339d..22918e1 100644
--- a/libstorycode/narrative.h
+++ b/libstorycode/narrative.h
@@ -27,13 +27,28 @@
#include <config.h>
#endif
+#include <gio/gio.h>
+
typedef struct _narrative Narrative;
#include "slide.h"
+#include "imagestore.h"
extern Narrative *narrative_new(void);
extern void narrative_free(Narrative *n);
+extern void narrative_add_stylesheet(Narrative *n, Stylesheet *ss);
+extern Stylesheet *narrative_get_stylesheet(Narrative *n);
+
+extern const char *narrative_get_language(Narrative *n);
+extern ImageStore *narrative_get_imagestore(Narrative *n);
+
+extern Narrative *narrative_load(GFile *file);
+extern int narrative_save(Narrative *n, GFile *file);
+
+extern void narrative_set_unsaved(Narrative *n);
+extern int narrative_get_unsaved(Narrative *n);
+
extern void narrative_add_prestitle(Narrative *n, char *text);
extern void narrative_add_bp(Narrative *n, char *text);
extern void narrative_add_text(Narrative *n, char *text);
@@ -43,8 +58,11 @@ extern void narrative_delete_block(Narrative *n, int i1, size_t o1,
int i2, size_t o2);
extern void narrative_split_item(Narrative *n, int i1, size_t o1);
extern int narrative_get_num_items(Narrative *n);
+extern int narrative_get_num_slides(Narrative *n);
extern Slide *narrative_get_slide(Narrative *n, int para);
-extern int narrative_get_slide_number(Narrative *n, int para);
+extern Slide *narrative_get_slide_by_number(Narrative *n, int pos);
+extern int narrative_get_slide_number_for_para(Narrative *n, int para);
+extern int narrative_get_slide_number_for_slide(Narrative *n, Slide *s);
#endif /* NARRATIVE_H */