aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.me.uk>2019-02-22 17:40:21 +0100
committerThomas White <taw@bitwiz.me.uk>2019-02-22 17:40:21 +0100
commitcce16c01a4ef4280b260b72e9bbf9cb4a400d122 (patch)
tree68b72ea414feac2671c490cfaf82e339d031d5a1
parent108384e83edcfd22b09eefe1cc6013d0c4d93f54 (diff)
WIP
-rw-r--r--libstorycode/cairo/render.h29
-rw-r--r--meson.build2
-rw-r--r--src/pdfstorycode.c10
3 files changed, 14 insertions, 27 deletions
diff --git a/libstorycode/cairo/render.h b/libstorycode/cairo/render.h
index 0cfae26..6e5f4ad 100644
--- a/libstorycode/cairo/render.h
+++ b/libstorycode/cairo/render.h
@@ -32,31 +32,8 @@
#include "sc_interp.h"
#include "frame.h"
-/* Convienience function to run the entire pipeline */
-extern cairo_surface_t *render_sc(SCBlock *scblocks, int w, int h,
- double log_w, double log_h,
- Stylesheet *stylesheet, SCCallbackList *cbl,
- ImageStore *is,
- int slide_number, struct frame **ptop,
- PangoLanguage *lang);
-
-/* Interpret StoryCode and measure boxes.
- * Needs to be followed by: wrap_contents() (recursively)
- * recursive_draw()
- */
-extern struct frame *interp_and_shape(SCBlock *scblocks, Stylesheet *stylesheet,
- SCCallbackList *cbl,
- ImageStore *is,
- int slide_number, PangoContext *pc,
- double w, double h, PangoLanguage *lang);
-
-extern void wrap_frame(struct frame *fr, PangoContext *pc);
-extern int recursive_wrap(struct frame *fr, PangoContext *pc);
-
-extern int export_pdf(struct presentation *p, const char *filename);
-
-extern int recursive_draw(struct frame *fr, cairo_t *cr,
- ImageStore *is,
- double min_y, double max_y);
+extern int render_cairo_slide(Slide *s, cairo_t *cr, double log_w, double log_h,
+ Stylesheet *stylesheet, int slide_number,
+ PangoLanguage *lang, PangoContext *pc);
#endif /* RENDER_H */
diff --git a/meson.build b/meson.build
index 38564a0..1fea778 100644
--- a/meson.build
+++ b/meson.build
@@ -108,7 +108,7 @@ executable('pdfstorycode',
['src/pdfstorycode.c',
],
gresources,
- dependencies : [glib_dep, gio_dep, cairo_dep,
+ dependencies : [glib_dep, gio_dep, cairo_dep, pango_dep,
libstorycode_dep, libstorycode_cairo_dep])
diff --git a/src/pdfstorycode.c b/src/pdfstorycode.c
index 6a4de05..5e82d5b 100644
--- a/src/pdfstorycode.c
+++ b/src/pdfstorycode.c
@@ -21,15 +21,25 @@
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <gio/gio.h>
#include <cairo.h>
+#include <cairo-pdf.h>
+#include <pango/pangocairo.h>
#include "storycode.h"
#include "presentation.h"
+#include "slide.h"
+
+#include <libintl.h>
+#define _(x) gettext(x)
static int render_slides_to_pdf(Presentation *p, const char *filename)