aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/presentation.c7
-rw-r--r--src/presentation.h1
-rw-r--r--src/sc_editor.c14
-rw-r--r--src/sc_editor.h2
-rw-r--r--src/slide_sorter.c4
-rw-r--r--src/slide_window.c34
-rw-r--r--src/slide_window.h1
-rw-r--r--src/slideshow.c19
8 files changed, 50 insertions, 32 deletions
diff --git a/src/presentation.c b/src/presentation.c
index ea3080a..d99ec55 100644
--- a/src/presentation.c
+++ b/src/presentation.c
@@ -46,11 +46,6 @@ void free_presentation(struct presentation *p)
int i;
int final = 0;
- if ( p->slideshow != NULL ) {
- end_slideshow(p->slideshow);
- p->slideshow = NULL;
- }
-
for ( i=0; i<p->num_slides; i++ ) {
free_slide(p->slides[i]);
}
@@ -220,8 +215,6 @@ struct presentation *new_presentation()
new->filename = NULL;
new->titlebar = get_titlebar_string(new);
- new->slideshow = NULL;
-
new->slide_width = 1024.0;
new->slide_height = 768.0;
diff --git a/src/presentation.h b/src/presentation.h
index 0841def..fd78a11 100644
--- a/src/presentation.h
+++ b/src/presentation.h
@@ -60,7 +60,6 @@ struct presentation
NarrativeWindow *narrative_window;
SlideWindow *slidewindow;
- SlideShow *slideshow;
struct notes *notes;
struct pr_clock *clock;
diff --git a/src/sc_editor.c b/src/sc_editor.c
index c7ebb26..67d252d 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -58,6 +58,14 @@ static void sc_editor_init(SCEditor *self)
}
+void sc_editor_set_background(SCEditor *e, double r, double g, double b)
+{
+ e->bgcol[0] = r;
+ e->bgcol[1] = g;
+ e->bgcol[2] = b;
+}
+
+
/* Update the view, once it's been edited in some way. */
static void rerender(SCEditor *e)
{
@@ -396,11 +404,7 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr,
/* Overall background */
cairo_rectangle(cr, 0.0, 0.0, width, height);
-// if ( slideshow_linked(e->p->slideshow) ) {
-// cairo_set_source_rgb(cr, 1.0, 0.3, 0.2);
-// } else {
- cairo_set_source_rgb(cr, 0.9, 0.9, 0.9);
-// } FIXME
+ cairo_set_source_rgb(cr, e->bgcol[0], e->bgcol[1], e->bgcol[2]);
cairo_fill(cr);
/* Get the overall size */
diff --git a/src/sc_editor.h b/src/sc_editor.h
index d10cbbd..0026236 100644
--- a/src/sc_editor.h
+++ b/src/sc_editor.h
@@ -109,6 +109,7 @@ struct _sceditor
/* Border surrounding actual slide within drawingarea */
double border_offs_x;
double border_offs_y;
+ double bgcol[3];
/* Rubber band boxes and related stuff */
double start_corner_x;
@@ -147,5 +148,6 @@ extern SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet);
extern void sc_editor_set_size(SCEditor *e, int w, int h);
extern void sc_editor_set_logical_size(SCEditor *e, double w, double h);
extern void sc_editor_redraw(SCEditor *e);
+extern void sc_editor_set_background(SCEditor *e, double r, double g, double b);
#endif /* SC_EDITOR_H */
diff --git a/src/slide_sorter.c b/src/slide_sorter.c
index cdc5879..53bee9d 100644
--- a/src/slide_sorter.c
+++ b/src/slide_sorter.c
@@ -322,7 +322,7 @@ static gboolean dnd_drop(GtkWidget *widget, GdkDragContext *drag_context,
* gets there first. When re-arranging slides, this might not happen */
static void fixup_proj(struct presentation *p, struct slide *s)
{
- slideshow_rerender(p->slideshow);
+// slideshow_rerender(p->slideshow); FIXME
}
@@ -370,7 +370,7 @@ static void dnd_receive(GtkWidget *widget, GdkDragContext *drag_context,
if ( n->dragging_cur_proj_slide ) {
fixup_proj(n->p, s);
- change_proj_slide(n->p->slideshow, s);
+ // FIXME change_proj_slide(n->p->slideshow, s);
}
redraw_slidesorter(n);
diff --git a/src/slide_window.c b/src/slide_window.c
index 2c06de3..c12f9fe 100644
--- a/src/slide_window.c
+++ b/src/slide_window.c
@@ -60,6 +60,8 @@ struct _slidewindow
int n_style_menu;
struct slide *cur_slide; /* FIXME: SPOT inside SCEditor */
+
+ SlideShow *show;
};
@@ -328,9 +330,15 @@ static gint about_sig(GtkWidget *widget, SlideWindow *sw)
}
+void slidewindow_slideshow_ended(SlideWindow *sw)
+{
+ sw->show = NULL;
+}
+
+
static gint start_slideshow_sig(GtkWidget *widget, SlideWindow *sw)
{
- sw->p->slideshow = try_start_slideshow(sw, sw->p);
+ sw->show = try_start_slideshow(sw, sw->p);
return FALSE;
}
@@ -346,8 +354,8 @@ void change_edit_slide(SlideWindow *sw, struct slide *np)
// FIXME notify_notes_slide_changed(sw->p, np);
- if ( slideshow_linked(sw->p->slideshow) ) {
- change_proj_slide(sw->p->slideshow, np);
+ if ( slideshow_linked(sw->show) ) {
+ change_proj_slide(sw->show, np);
} /* else leave the slideshow alone */
}
@@ -468,8 +476,19 @@ static gint delete_frame_sig(GtkWidget *widget, SlideWindow *sw)
}
+static void slidewindow_set_background(SlideWindow *sw)
+{
+ if ( (sw->show != NULL) && !slideshow_linked(sw->show) ) {
+ sc_editor_set_background(sw->sceditor, 1.0, 0.3, 0.2);
+ } else {
+ sc_editor_set_background(sw->sceditor, 0.9, 0.9, 0.9);
+ }
+}
+
+
void slidewindow_redraw(SlideWindow *sw)
{
+ slidewindow_set_background(sw);
sc_editor_redraw(sw->sceditor);
}
@@ -620,6 +639,11 @@ static gboolean key_press_sig(GtkWidget *da, GdkEventKey *event,
case GDK_KEY_Page_Down :
change_slide_forwards(sw);
break;
+
+ case GDK_KEY_b :
+ if ( sw->show != NULL ) {
+ toggle_slideshow_link(sw->show);
+ }
}
return FALSE;
@@ -645,6 +669,7 @@ SlideWindow *slide_window_open(struct presentation *p, GApplication *app)
sw->window = window;
sw->p = p;
sw->cur_slide = p->slides[0];
+ sw->show = NULL;
update_titlebar(p);
@@ -676,6 +701,9 @@ SlideWindow *slide_window_open(struct presentation *p, GApplication *app)
gtk_window_set_default_size(GTK_WINDOW(sw->window), 1024+100, 768+150);
gtk_window_set_resizable(GTK_WINDOW(sw->window), TRUE);
+ /* Initial background colour */
+ slidewindow_set_background(sw);
+
gtk_widget_show_all(window);
return sw;
diff --git a/src/slide_window.h b/src/slide_window.h
index 5b6bc69..e0393fe 100644
--- a/src/slide_window.h
+++ b/src/slide_window.h
@@ -40,5 +40,6 @@ extern void change_slide_last(SlideWindow *sw);
extern struct slide *slidewindow_get_slide(SlideWindow *sw);
extern void slidewindow_redraw(SlideWindow *sw);
+extern void slidewindow_slideshow_ended(SlideWindow *sw);
#endif /* SLIDEWINDOW_H */
diff --git a/src/slideshow.c b/src/slideshow.c
index 77f23cd..4755ed6 100644
--- a/src/slideshow.c
+++ b/src/slideshow.c
@@ -84,8 +84,10 @@ void slideshow_rerender(SlideShow *ss)
static gint ss_destroy_sig(GtkWidget *widget, SlideShow *ss)
{
- g_object_unref(ss->p->slideshow->blank_cursor);
- ss->p->slideshow = NULL;
+ g_object_unref(ss->blank_cursor);
+ slidewindow_slideshow_ended(ss->slide_window);
+ slidewindow_redraw(ss->slide_window);
+ free(ss);
return FALSE;
}
@@ -156,9 +158,6 @@ void end_slideshow(SlideShow *ss)
if ( ss->inhibit != NULL ) do_inhibit(ss->inhibit, 0);
gtk_widget_destroy(ss->drawingarea);
gtk_widget_destroy(ss->window);
- ss->p->slideshow = NULL;
- slidewindow_redraw(ss->slide_window);
- free(ss);
}
@@ -181,15 +180,7 @@ int slideshow_linked(SlideShow *ss)
void check_toggle_blank(SlideShow *ss)
{
- if ( ss != NULL ) {
- //if ( p->prefs->b_splits ) {
- toggle_slideshow_link(ss);
- //} else {
- // p->ss_blank = 1-p->ss_blank;
- // gdk_window_invalidate_rect(p->ss_drawingarea->window,
- // NULL, FALSE);
- //} FIXME!
- }
+ toggle_slideshow_link(ss);
}