6fb78d11e977d161bcf4a84ea9017ca84188c1af
[fbpad.git] / fbpad.h
blob6fb78d11e977d161bcf4a84ea9017ca84188c1af
1 /* fbpad header file */
3 #define MIN(a, b) ((a) < (b) ? (a) : (b))
4 #define MAX(a, b) ((a) > (b) ? (a) : (b))
6 #define ESC 27 /* escape code */
7 #define MAXCHARS (1 << 15) /* maximum characters on screen */
8 #define MAXDOTS (1 << 10) /* maximum pixels in glyphs */
10 /* term.c */
11 #define TERM_HIDDEN 0
12 #define TERM_VISIBLE 1
13 #define TERM_REDRAW 2
15 struct term_state {
16 int row, col;
17 int fg, bg;
18 int mode;
21 struct term {
22 int screen[MAXCHARS];
23 char fgs[MAXCHARS];
24 char bgs[MAXCHARS];
25 struct term_state cur, sav;
26 int fd;
27 int pid;
28 int top, bot;
31 void term_load(struct term *term, int visible);
32 void term_save(struct term *term);
34 void term_read(void);
35 void term_send(int c);
36 void term_exec(char *cmd);
37 void term_end(void);
38 void term_screenshot(void);
40 /* pad.c */
41 #define FN_I 0x10
42 #define FN_B 0x20
44 int pad_init(void);
45 void pad_free(void);
46 void pad_put(int ch, int r, int c, int fg, int bg);
47 int pad_rows(void);
48 int pad_cols(void);
49 void pad_blank(int c);
50 void pad_blankrow(int r, int bg);
52 /* font.c */
53 struct font *font_open(char *path);
54 void font_free(struct font *font);
55 int font_rows(struct font *font);
56 int font_cols(struct font *font);
57 int font_bitmap(struct font *font, void *dst, int c);
59 /* scrsnap.c */
60 void scr_snap(void *owner);
61 int scr_load(void *owner);
62 void scr_free(void *owner);