From ddd7bf5b8a173f375cf3de92a4493c0b80cc2de3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 13 Apr 2004 13:17:48 +0000 Subject: Initial work on PS and PDF output. Because these two backends share an enormous amount of preprocessing and differ only in their final output form, I've introduced a new type of layer called a `pre-backend' (bk_paper.c is one). This takes all the information passed to a normal backend and returns an arbitrary void *, which is cached by the front end and passed on to any backend(s) which state a desire for the output of that particular pre-backend. Thus, all the page layout is done only once, and the PS and PDF backends process the same data structures into two output files. Note that these backends are _very_ unfinished; all sorts of vital things such as section numbers, list markers, and title formatting are missing, the paragraph justification doesn't quite work, and advanced stuff like indexes and PDF interactive features haven't even been started. But this basic framework generates valid output files and is a good starting point, so I'm checking it in. [originally from svn r4058] --- halibut.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'halibut.h') diff --git a/halibut.h b/halibut.h index fd93408..f9d22a2 100644 --- a/halibut.h +++ b/halibut.h @@ -326,7 +326,7 @@ struct tagWrappedLine { int nspaces; /* number of whitespaces in line */ int shortfall; /* how much shorter than max width */ }; -wrappedline *wrap_para(word *, int, int, int (*)(word *)); +wrappedline *wrap_para(word *, int, int, int (*)(void *, word *), void *, int); void wrap_free(wrappedline *); /* @@ -422,31 +422,48 @@ struct userstyle_Tag { /* * bk_text.c */ -void text_backend(paragraph *, keywordlist *, indexdata *); +void text_backend(paragraph *, keywordlist *, indexdata *, void *); paragraph *text_config_filename(char *filename); /* * bk_xhtml.c */ -void xhtml_backend(paragraph *, keywordlist *, indexdata *); +void xhtml_backend(paragraph *, keywordlist *, indexdata *, void *); paragraph *xhtml_config_filename(char *filename); /* * bk_whlp.c */ -void whlp_backend(paragraph *, keywordlist *, indexdata *); +void whlp_backend(paragraph *, keywordlist *, indexdata *, void *); paragraph *whlp_config_filename(char *filename); /* * bk_man.c */ -void man_backend(paragraph *, keywordlist *, indexdata *); +void man_backend(paragraph *, keywordlist *, indexdata *, void *); paragraph *man_config_filename(char *filename); /* * bk_info.c */ -void info_backend(paragraph *, keywordlist *, indexdata *); +void info_backend(paragraph *, keywordlist *, indexdata *, void *); paragraph *info_config_filename(char *filename); +/* + * bk_paper.c + */ +void *paper_pre_backend(paragraph *, keywordlist *, indexdata *); + +/* + * bk_ps.c + */ +void ps_backend(paragraph *, keywordlist *, indexdata *, void *); +paragraph *ps_config_filename(char *filename); + +/* + * bk_pdf.c + */ +void pdf_backend(paragraph *, keywordlist *, indexdata *, void *); +paragraph *pdf_config_filename(char *filename); + #endif -- cgit v1.1