aboutsummaryrefslogtreecommitdiff
path: root/libstorycode
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-03-27 17:57:31 +0100
committerThomas White <taw@bitwiz.me.uk>2019-03-27 17:57:31 +0100
commit47764e46296e8c6921bbc00b95c05ff153699dc2 (patch)
treeb8f0f1b9b13309207a973d94e851103c4abb2877 /libstorycode
parent86f73eac9bd24cde5be223b9973296d479a8deb7 (diff)
Show modified status in narrative title bar
Diffstat (limited to 'libstorycode')
-rw-r--r--libstorycode/presentation.c14
-rw-r--r--libstorycode/presentation.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/libstorycode/presentation.c b/libstorycode/presentation.c
index d862ac0..817a55a 100644
--- a/libstorycode/presentation.c
+++ b/libstorycode/presentation.c
@@ -50,6 +50,7 @@ struct _presentation
int n_slides;
Slide **slides;
int max_slides;
+ int saved;
const char *language;
};
@@ -65,6 +66,7 @@ Presentation *presentation_new()
p->n_slides = 0;
p->max_slides = 0;
p->imagestore = NULL;
+ p->saved = 1;
#ifdef HAVE_PANGO
p->language = pango_language_to_string(pango_language_get_default());
#else
@@ -102,6 +104,18 @@ int presentation_save(Presentation *p, GFile *file)
}
+void presentation_set_unsaved(Presentation *p)
+{
+ p->saved = 0;
+}
+
+
+int presentation_get_unsaved(Presentation *p)
+{
+ return !p->saved;
+}
+
+
void presentation_free(Presentation *p)
{
/* FIXME: Free narrative, slides, imagestore */
diff --git a/libstorycode/presentation.h b/libstorycode/presentation.h
index ad01382..444024b 100644
--- a/libstorycode/presentation.h
+++ b/libstorycode/presentation.h
@@ -39,6 +39,8 @@ extern Presentation *presentation_new(void);
extern Presentation *presentation_load(GFile *file);
extern int presentation_save(Presentation *p, GFile *file);
extern void presentation_free(Presentation *p);
+extern void presentation_set_unsaved(Presentation *p);
+extern int presentation_get_unsaved(Presentation *p);
extern void presentation_add_stylesheet(Presentation *p, Stylesheet *ss);
extern void presentation_add_narrative(Presentation *p, Narrative *n);