summaryrefslogtreecommitdiffstatshomepage
path: root/term.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-06-07 20:57:09 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-06-07 20:57:09 +0000
commit46dd3365d4def0a50cf065f76bc39e52dfa71d82 (patch)
tree74b9fa659fcc01b96403653d79d3b6d33e020e85 /term.h
parent330def09deee27bc7f1f70f0870aebf0eeddd62c (diff)
downloadmandoc-46dd3365d4def0a50cf065f76bc39e52dfa71d82.tar.gz
mandoc-46dd3365d4def0a50cf065f76bc39e52dfa71d82.tar.zst
mandoc-46dd3365d4def0a50cf065f76bc39e52dfa71d82.zip
First check-in of PostScript output. This does not change any logic
within term.c, but does add a small shim over putchar() that switches on the output engine. Prints, for this initial version, only monospace and without font decorations. It's a start.
Diffstat (limited to 'term.h')
-rw-r--r--term.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/term.h b/term.h
index 09e24295..bf54e5d6 100644
--- a/term.h
+++ b/term.h
@@ -1,4 +1,4 @@
-/* $Id: term.h,v 1.57 2010/05/24 21:51:20 schwarze Exp $ */
+/* $Id: term.h,v 1.58 2010/06/07 20:57:09 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -19,10 +19,17 @@
__BEGIN_DECLS
+struct termp;
+
enum termenc {
TERMENC_ASCII
};
+enum termtype {
+ TERMTYPE_CHAR,
+ TERMTYPE_PS
+};
+
enum termfont {
TERMFONT_NONE = 0,
TERMFONT_BOLD,
@@ -31,7 +38,10 @@ enum termfont {
#define TERM_MAXMARGIN 100000 /* FIXME */
+typedef void (*term_margin)(struct termp *, const void *);
+
struct termp {
+ enum termtype type;
size_t defrmargin; /* Right margin of the device.. */
size_t rmargin; /* Current right margin. */
size_t maxrmargin; /* Max right margin. */
@@ -60,12 +70,24 @@ struct termp {
enum termfont fontl; /* Last font set. */
enum termfont fontq[10]; /* Symmetric fonts. */
int fonti; /* Index of font stack. */
+ term_margin headf; /* invoked to print head */
+ term_margin footf; /* invoked to print foot */
+ const void *argf; /* arg for headf/footf */
+ int psstate; /* -Tps: state of ps output */
+#define PS_INLINE (1 << 0)
+#define PS_MARGINS (1 << 1)
+ size_t pscol; /* -Tps: visible column */
+ size_t psrow; /* -Tps: visible row */
+ size_t pspage; /* -Tps: current page */
};
void term_newln(struct termp *);
void term_vspace(struct termp *);
void term_word(struct termp *, const char *);
void term_flushln(struct termp *);
+void term_begin(struct termp *, term_margin,
+ term_margin, const void *);
+void term_end(struct termp *);
size_t term_hspan(const struct roffsu *);
size_t term_vspan(const struct roffsu *);