aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-01-08 09:16:30 +0100
committerThomas White <taw@bitwiz.org.uk>2016-01-08 09:16:30 +0100
commiteb80ba714729010d00bb2f212c3e770b0706f64b (patch)
tree00e6c75608ff01018789a04d54ebe010ecc5a7c8 /src
parente003d06d57c6b8fb2e221592bb85a95a03941292 (diff)
Narrative window slideshow stuff
Diffstat (limited to 'src')
-rw-r--r--src/narrative_window.c28
-rw-r--r--src/presentation.c4
2 files changed, 24 insertions, 8 deletions
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 807305f..6e09d71 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -217,30 +217,46 @@ static void ss_prev_slide(SlideShow *ss, void *vp)
static void first_slide_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
- //NarrativeWindow *nw = vp;
+ NarrativeWindow *nw = vp;
+ SCBlock *tt;
+
+ tt = first_slide(nw->p);
+ if ( tt == NULL ) return; /* Fail */
+ nw->sel_slide = tt;
+ if ( slideshow_linked(nw->show) ) {
+ change_proj_slide(nw->show, nw->sel_slide);
+ } /* else leave the slideshow alone */
+ update_toolbar(nw);
}
static void prev_slide_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
- //NarrativeWindow *nw = vp;
- //ss_prev_slide(NULL, vp);
+ ss_prev_slide(NULL, vp);
}
static void next_slide_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
- //NarrativeWindow *nw = vp;
- //ss_next_slide(NULL, vp);
+ ss_next_slide(NULL, vp);
}
static void last_slide_sig(GSimpleAction *action, GVariant *parameter,
gpointer vp)
{
- //NarrativeWindow *nw = vp;
+ NarrativeWindow *nw = vp;
+ SCBlock *tt;
+
+ tt = last_slide(nw->p);
+ if ( tt == NULL ) return; /* Fail */
+ nw->sel_slide = tt;
+ if ( slideshow_linked(nw->show) ) {
+ change_proj_slide(nw->show, nw->sel_slide);
+ } /* else leave the slideshow alone */
+ update_toolbar(nw);
}
diff --git a/src/presentation.c b/src/presentation.c
index 2e439f8..98f9ecc 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -263,7 +263,7 @@ SCBlock *first_slide(struct presentation *p)
while ( bl != NULL ) {
if ( safe_strcmp(sc_block_name(bl), "slide") == 0 ) {
- return bl;
+ return sc_block_child(bl);
}
bl = sc_block_next(bl);
}
@@ -288,7 +288,7 @@ SCBlock *last_slide(struct presentation *p)
if ( l == NULL ) {
fprintf(stderr, "Couldn't find last slide!\n");
}
- return l;
+ return sc_block_child(l);
}