aboutsummaryrefslogtreecommitdiff
path: root/src/slideshow.h
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2016-05-17 23:44:50 +0200
committerThomas White <taw@bitwiz.org.uk>2016-05-17 23:44:50 +0200
commit0818526f58cbb1927733f16fe665552194fe9228 (patch)
tree9b177f486f1c4e1534227a762f2ea90fa7ba9b24 /src/slideshow.h
parentff3e44a3e2b09b5eb1c7b2c199bb1321ce7d41dc (diff)
GObjectify the slideshow
Diffstat (limited to 'src/slideshow.h')
-rw-r--r--src/slideshow.h66
1 files changed, 39 insertions, 27 deletions
diff --git a/src/slideshow.h b/src/slideshow.h
index 5c8b808..2ffc577 100644
--- a/src/slideshow.h
+++ b/src/slideshow.h
@@ -1,7 +1,7 @@
/*
* slideshow.h
*
- * Copyright © 2013-2015 Thomas White <taw@bitwiz.org.uk>
+ * Copyright © 2013-2016 Thomas White <taw@bitwiz.org.uk>
*
* This file is part of Colloquium.
*
@@ -27,40 +27,52 @@
#include <config.h>
#endif
-/* Opaque data structure representing a slideshow */
-typedef struct _slideshow SlideShow;
+#define SC_TYPE_SLIDESHOW (sc_slideshow_get_type())
-struct sscontrolfuncs
-{
- /* Controller should switch slide forwards or backwards */
- void (*next_slide)(SlideShow *ss, void *vp);
- void (*prev_slide)(SlideShow *ss, void *vp);
+#define SC_SLIDESHOW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ SC_TYPE_SLIDESHOW, SCEditor))
+
+#define SC_IS_SLIDESHOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ SC_TYPE_SLIDESHOW))
- /* 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) */
- SCBlock *(*current_slide)(void *vp);
+#define SC_SLIDESHOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), \
+ SC_TYPE_SLIDESHOW, SCEditorClass))
- /* Controller should update whatever visual representation of
- * whether or not the display is linked */
- void (*changed_link)(SlideShow *ss, void *vp);
+#define SC_IS_SLIDESHOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), \
+ SC_TYPE_SLIDESHOW))
- /* Slideshow ended (including if you called end_slideshow) */
- void (*end_show)(SlideShow *ss, void *vp);
+#define SC_SLIDESHOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \
+ SC_TYPE_SLIDESHOW, SCSlideShowClass))
+
+struct _scslideshow
+{
+ GtkWindow parent_instance;
+
+ /* <private> */
+ struct presentation *p;
+ SCBlock *cur_slide;
+ GtkWidget *drawingarea;
+ GdkCursor *blank_cursor;
+ int blank;
+ char geom[256];
+ int slide_width;
+ int slide_height;
+ struct inhibit_sys *inhibit;
+ int linked;
+ cairo_surface_t *surface;
+ struct frame *top;
};
-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, SCBlock *np);
-extern SCBlock *slideshow_slide(SlideShow *ss);
+struct _scslideshowclass
+{
+ GtkWindowClass parent_class;
+};
-extern void toggle_slideshow_link(SlideShow *ss);
-extern int slideshow_linked(SlideShow *ss);
-extern void check_toggle_blank(SlideShow *ss);
+typedef struct _scslideshow SCSlideshow;
+typedef struct _scslideshowclass SCSlideshowClass;
-extern void redraw_slideshow(SlideShow *ss);
-extern void slideshow_rerender(SlideShow *ss);
+extern SCSlideshow *sc_slideshow_new(struct presentation *p);
+extern void sc_slideshow_set_slide(SCSlideshow *ss, SCBlock *ns);
#endif /* SLIDESHOW_H */