summaryrefslogtreecommitdiff
path: root/bk_info.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-04-13 13:17:48 +0000
committerSimon Tatham <anakin@pobox.com>2004-04-13 13:17:48 +0000
commitddd7bf5b8a173f375cf3de92a4493c0b80cc2de3 (patch)
treecc37e6ee1698c33a72eaf3d818df40795908aa18 /bk_info.c
parente9d2a1681a1ba9fa9cee79e197e6d62c3deae7b7 (diff)
downloadhalibut-ddd7bf5b8a173f375cf3de92a4493c0b80cc2de3.zip
halibut-ddd7bf5b8a173f375cf3de92a4493c0b80cc2de3.tar.gz
halibut-ddd7bf5b8a173f375cf3de92a4493c0b80cc2de3.tar.bz2
halibut-ddd7bf5b8a173f375cf3de92a4493c0b80cc2de3.tar.xz
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]
Diffstat (limited to 'bk_info.c')
-rw-r--r--bk_info.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bk_info.c b/bk_info.c
index 23f8628..0d7c032 100644
--- a/bk_info.c
+++ b/bk_info.c
@@ -119,7 +119,7 @@ paragraph *info_config_filename(char *filename)
}
void info_backend(paragraph *sourceform, keywordlist *keywords,
- indexdata *idx) {
+ indexdata *idx, void *unused) {
paragraph *p;
infoconfig conf;
word *prefix, *body, *wp;
@@ -140,8 +140,7 @@ void info_backend(paragraph *sourceform, keywordlist *keywords,
int width = 70, listindentbefore = 1, listindentafter = 3;
int indent_code = 2, index_width = 40;
- IGNORE(keywords); /* we don't happen to need this */
- IGNORE(idx); /* or this */
+ IGNORE(unused);
conf = info_configure(sourceform);
@@ -839,12 +838,14 @@ static int info_width_internal(word *words, int xrefs) {
return 0; /* should never happen */
}
-static int info_width_noxrefs(word *words)
+static int info_width_noxrefs(void *ctx, word *words)
{
+ IGNORE(ctx);
return info_width_internal(words, FALSE);
}
-static int info_width_xrefs(word *words)
+static int info_width_xrefs(void *ctx, word *words)
{
+ IGNORE(ctx);
return info_width_internal(words, TRUE);
}
@@ -866,7 +867,8 @@ static void info_heading(rdstringc *text, word *tprefix,
firstlinewidth = width - length;
wrapwidth = width;
- wrapping = wrap_para(words, firstlinewidth, wrapwidth, info_width_noxrefs);
+ wrapping = wrap_para(words, firstlinewidth, wrapwidth,
+ info_width_noxrefs, NULL, 0);
for (p = wrapping; p; p = p->next) {
info_rdaddwc(&t, p->begin, p->end, FALSE);
length = (t.text ? strlen(t.text) : 0);
@@ -930,7 +932,8 @@ static void info_para(rdstringc *text, word *prefix, char *prefixextra,
} else
e = indent + extraindent;
- wrapping = wrap_para(words, firstlinewidth, width, info_width_xrefs);
+ wrapping = wrap_para(words, firstlinewidth, width, info_width_xrefs,
+ NULL, 0);
for (p = wrapping; p; p = p->next) {
for (i = 0; i < e; i++)
rdaddc(text, ' ');