summaryrefslogtreecommitdiffstats
path: root/term.h
diff options
context:
space:
mode:
Diffstat (limited to 'term.h')
-rw-r--r--term.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/term.h b/term.h
index 0adbfd13..364b44ef 100644
--- a/term.h
+++ b/term.h
@@ -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 *);