From 8d8eccb93da07559c675f053d5dce3781423b253 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 17 Aug 2015 21:44:08 +0200 Subject: Dispatch table for slideshow controller --- src/slideshow.h | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'src/slideshow.h') diff --git a/src/slideshow.h b/src/slideshow.h index 16bd6e0..99d5549 100644 --- a/src/slideshow.h +++ b/src/slideshow.h @@ -1,7 +1,7 @@ /* * slideshow.h * - * Copyright © 2013-2014 Thomas White + * Copyright © 2013-2015 Thomas White * * This file is part of Colloquium. * @@ -27,12 +27,30 @@ #include #endif -#include "slide_window.h" - /* Opaque data structure representing a slideshow */ typedef struct _slideshow SlideShow; -extern SlideShow *try_start_slideshow(SlideWindow *sw, struct presentation *p); +struct sscontrolfuncs +{ + /* Controller should switch slide forwards or backwards */ + void (*next_slide)(SlideShow *ss, void *vp); + void (*prev_slide)(SlideShow *ss, void *vp); + + /* Controller should return what it thinks is the current slide + * (this might not be what is on the screen, e.g. if the display + * is unlinked) */ + struct slide *(*current_slide)(SlideShow *ss, void *vp); + + /* Controller should update whatever visual representation of + * whether or not the display is linked */ + void (*changed_link)(SlideShow *ss, void *vp); + + /* Slideshow ended (including if you called end_slideshow) */ + void (*end_show)(SlideShow *ss, void *vp); +}; + +extern SlideShow *try_start_slideshow(struct presentation *p, + struct sscontrolfuncs ssc, void *vp); extern void end_slideshow(SlideShow *ss); extern void change_proj_slide(SlideShow *ss, struct slide *np); -- cgit v1.2.3