aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-01-27 23:05:21 +0100
committerThomas White <taw@bitwiz.org.uk>2013-01-27 23:05:21 +0100
commitbb1735dcec49bb73ffb67af87cf5f7f8919af8b5 (patch)
tree767842d8e52f37064ff3ad8fceffa6cfea3c89c9 /src
parent0315095d2fb04f4cdf12c7484d8a0a89dff5329d (diff)
Slide change logic etc
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.c16
-rw-r--r--src/presentation.c2
-rw-r--r--src/render.c4
-rw-r--r--src/stylesheet.c1
4 files changed, 11 insertions, 12 deletions
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 109a940..6f6a23a 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -43,18 +43,12 @@ static void rerender_slide(struct presentation *p, PangoContext *pc)
int w, h;
struct slide *s = p->cur_edit_slide;
- if ( s->rendered_thumb != NULL ) {
- cairo_surface_destroy(s->rendered_thumb);
- }
+ free_render_buffers(s);
w = p->thumb_slide_width;
h = (p->slide_height/p->slide_width) * w;
s->rendered_thumb = render_slide(s, w, h);
- if ( s->rendered_edit != NULL ) {
- cairo_surface_destroy(s->rendered_edit);
- }
-
w = p->edit_slide_width;
h = (p->slide_height/p->slide_width) * w;
s->rendered_edit = render_slide(s, w, h);
@@ -62,10 +56,6 @@ static void rerender_slide(struct presentation *p, PangoContext *pc)
/* Is this slide currently being displayed on the projector? */
if ( s == s->parent->cur_proj_slide ) {
- if ( s->rendered_proj != NULL ) {
- cairo_surface_destroy(s->rendered_proj);
- }
-
w = s->parent->proj_slide_width;
h = (s->parent->slide_height/s->parent->slide_width) * w;
s->rendered_proj = render_slide(s, w, h);
@@ -429,9 +419,11 @@ static gint start_slideshow_sig(GtkWidget *widget, struct presentation *p)
void notify_slide_changed(struct presentation *p, struct slide *np)
{
+ free_render_buffers(p->cur_edit_slide);
p->cur_edit_slide = np;
+ rerender_slide(p, p->pc);
- /* FIXME: Free old rendered stuff */
+ set_selection(p, NULL);
update_toolbar(p);
redraw(p);
diff --git a/src/presentation.c b/src/presentation.c
index 74f9c3c..d26321d 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -447,6 +447,8 @@ void set_selection(struct presentation *p, struct frame *fr)
{
p->selection[0] = fr;
p->n_selection = 1;
+
+ if ( fr == NULL ) p->n_selection = 0;
}
diff --git a/src/render.c b/src/render.c
index 628dc99..2405c10 100644
--- a/src/render.c
+++ b/src/render.c
@@ -575,6 +575,10 @@ void free_render_buffers(struct slide *s)
if ( s->rendered_thumb != NULL ) {
cairo_surface_destroy(s->rendered_thumb);
}
+
+ s->rendered_edit = NULL;
+ s->rendered_proj = NULL;
+ s->rendered_thumb = NULL;
}
diff --git a/src/stylesheet.c b/src/stylesheet.c
index a70df5b..4a22d2a 100644
--- a/src/stylesheet.c
+++ b/src/stylesheet.c
@@ -134,6 +134,7 @@ void default_stylesheet(StyleSheet *ss)
sty->lop.h_units = UNITS_SLIDE;
sty->lop.x = 0.0;
sty->lop.y = 0.0;
+ sty->sc_prologue = strdup("\\bgcol{#00a6eb}\\fgcol{#ffffff}");
add_to_template(slide, sty);
}