1 /* fbpad header file */
3 #define MIN(a, b) ((a) < (b) ? (a) : (b))
4 #define MAX(a, b) ((a) > (b) ? (a) : (b))
5 #define LEN(a) (sizeof(a) / sizeof((a)[0]))
7 #define ESC 27 /* escape code */
8 #define NCOLS 256 /* maximum number of screen columns */
9 #define NROWS 128 /* maximum number of screen rows */
10 #define NDOTS 1024 /* maximum pixels in glyphs */
11 #define NHIST 128 /* scrolling history lines */
14 #define DWCHAR 0x40000000u /* 2nd half of a fullwidth char */
21 #define TERM_VISIBLE 1
31 int screen
[NROWS
* NCOLS
];
32 int hist
[NHIST
* NCOLS
];
33 char fgs
[NROWS
* NCOLS
];
34 char bgs
[NROWS
* NCOLS
];
35 struct term_state cur
, sav
;
36 int histtail
; /* the next history row */
42 void term_load(struct term
*term
, int visible
);
43 void term_save(struct term
*term
);
46 void term_send(int c
);
47 void term_exec(char **args
);
49 void term_screenshot(void);
50 void term_hist(int pos
);
58 void pad_put(int ch
, int r
, int c
, int fg
, int bg
);
61 void pad_blank(int c
);
62 void pad_blankrow(int r
, int bg
);
65 struct font
*font_open(char *path
);
66 void font_free(struct font
*font
);
67 int font_rows(struct font
*font
);
68 int font_cols(struct font
*font
);
69 int font_bitmap(struct font
*font
, void *dst
, int c
);
72 void scr_snap(void *owner
);
73 int scr_load(void *owner
);
74 void scr_free(void *owner
);