aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am4
-rw-r--r--data/sky.pngbin0 -> 135796 bytes
-rw-r--r--src/narrative_window.c1
-rw-r--r--src/sc_editor.c29
-rw-r--r--src/sc_editor.h1
5 files changed, 34 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 5d29aaf..8583b99 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,6 +30,10 @@ EXTRA_DIST += src/presentation.h src/render.h src/wrap.h \
src/default_stylesheet.o: src/default_stylesheet.sty
ld -r -b binary -o src/default_stylesheet.o src/default_stylesheet.sty
+colloquiumdir = $(datadir)/colloquium
+colloquium_DATA = data/sky.png data/canvas.png
+EXTRA_DIST += $(colloquium_DATA)
+
iconsdir = $(datadir)/icons/hicolor/scalable/apps
icons_DATA = data/colloquium.svg
EXTRA_DIST += $(icons_DATA)
diff --git a/data/sky.png b/data/sky.png
new file mode 100644
index 0000000..ba0d4fe
--- /dev/null
+++ b/data/sky.png
Binary files differ
diff --git a/src/narrative_window.c b/src/narrative_window.c
index 9c58c86..38f259d 100644
--- a/src/narrative_window.c
+++ b/src/narrative_window.c
@@ -217,6 +217,7 @@ NarrativeWindow *narrative_window_new(struct presentation *p, GApplication *app)
sc_editor_set_size(nw->sceditor, 640, 1024);
sc_editor_set_logical_size(nw->sceditor, 640.0, 1024.0);
+ sc_editor_set_background(nw->sceditor, 0.9, 0.9, 0.9);
g_signal_connect(G_OBJECT(nw->sceditor), "button-press-event",
G_CALLBACK(button_press_sig), nw);
diff --git a/src/sc_editor.c b/src/sc_editor.c
index f357514..1a081aa 100644
--- a/src/sc_editor.c
+++ b/src/sc_editor.c
@@ -394,6 +394,24 @@ static void draw_overlay(cairo_t *cr, SCEditor *e)
}
+static void tile_pixbuf(cairo_t *cr, GdkPixbuf *pb, int width, int height)
+{
+ int nx, ny, ix, iy, bgw, bgh;
+
+ bgw = gdk_pixbuf_get_width(pb);
+ bgh = gdk_pixbuf_get_height(pb);
+ nx = width/bgw + 1;
+ ny = height/bgh+ 1;
+ for ( ix=0; ix<nx; ix++ ) {
+ for ( iy=0; iy<ny; iy++ ) {
+ gdk_cairo_set_source_pixbuf(cr, pb, ix*bgw, iy*bgh);
+ cairo_rectangle(cr, ix*bgw, iy*bgh, width, height);
+ cairo_fill(cr);
+ }
+ }
+}
+
+
static gboolean draw_sig(GtkWidget *da, cairo_t *cr,
SCEditor *e)
{
@@ -404,8 +422,9 @@ static gboolean draw_sig(GtkWidget *da, cairo_t *cr,
height = gtk_widget_get_allocated_height(GTK_WIDGET(da));
/* Overall background */
+ tile_pixbuf(cr, e->bg_pixbuf, width, height);
+ cairo_set_source_rgba(cr, e->bgcol[0], e->bgcol[1], e->bgcol[2], 0.5);
cairo_rectangle(cr, 0.0, 0.0, width, height);
- cairo_set_source_rgb(cr, e->bgcol[0], e->bgcol[1], e->bgcol[2]);
cairo_fill(cr);
/* Get the overall size */
@@ -1402,6 +1421,7 @@ SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet)
{
SCEditor *sceditor;
GtkTargetEntry targets[1];
+ GError *err;
sceditor = g_object_new(SC_TYPE_EDITOR, NULL);
@@ -1415,6 +1435,13 @@ SCEditor *sc_editor_new(SCBlock *scblocks, SCBlock *stylesheet)
sceditor->stylesheet = stylesheet;
sceditor->slidenum = 0;
+ err = NULL;
+ sceditor->bg_pixbuf = gdk_pixbuf_new_from_file(DATADIR"/colloquium/sky.png", &err);
+ if ( sceditor->bg_pixbuf == NULL ) {
+ fprintf(stderr, "Failed to load background: %s\n",
+ err->message);
+ }
+
rerender(sceditor);
gtk_widget_set_size_request(GTK_WIDGET(sceditor),
diff --git a/src/sc_editor.h b/src/sc_editor.h
index 8bfcd59..509ce0e 100644
--- a/src/sc_editor.h
+++ b/src/sc_editor.h
@@ -110,6 +110,7 @@ struct _sceditor
double border_offs_x;
double border_offs_y;
double bgcol[3];
+ GdkPixbuf *bg_pixbuf;
/* Rubber band boxes and related stuff */
double start_corner_x;