aboutsummaryrefslogtreecommitdiff
path: root/src/slide_render.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-05-21 23:42:16 +0200
committerThomas White <taw@bitwiz.org.uk>2011-05-21 23:42:16 +0200
commit18285193ab891014089227a459cfab7c2560af02 (patch)
tree1fcdb08adc359d87e24e60bef69591e6f0c18ede /src/slide_render.c
parent06836da21128e7ce72d06e208b19078e69c70f9c (diff)
Add slide rendering machinery
Diffstat (limited to 'src/slide_render.c')
-rw-r--r--src/slide_render.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/slide_render.c b/src/slide_render.c
new file mode 100644
index 0000000..1966fe7
--- /dev/null
+++ b/src/slide_render.c
@@ -0,0 +1,54 @@
+/*
+ * slide_render.c
+ *
+ * Colloquium - A tiny presentation program
+ *
+ * Copyright (c) 2011 Thomas White <taw@bitwiz.org.uk>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cairo.h>
+
+#include "slide_render.h"
+#include "presentation.h"
+
+
+int render_slide(struct slide *s)
+{
+ cairo_surface_t *surf;
+ cairo_t *cr;
+
+ surf = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
+ s->slide_width, s->slide_height);
+
+ cr = cairo_create(surf);
+
+ cairo_rectangle(cr, 0.0, 0.0, s->slide_width, s->slide_height);
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+ cairo_fill(cr);
+
+ cairo_destroy(cr);
+
+ if ( s->render_cache != NULL ) cairo_surface_destroy(s->render_cache);
+ s->render_cache = surf;
+
+ return 0;
+}