config.h: fix COLOR6 for cyan
[fbpad.git] / fbpad.h
blobb479d1b6424968de0844dc49b257c72ac2851fa4
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 */
13 /* isdw.c */
14 #define DWCHAR 0x40000000u /* 2nd half of a fullwidth char */
16 int isdw(int c);
17 int iszw(int c);
19 /* term.c */
20 struct term_state {
21 int row, col;
22 int fg, bg;
23 int mode;
26 struct term {
27 int screen[NROWS * NCOLS];
28 int hist[NHIST * NCOLS];
29 short fgs[NROWS * NCOLS];
30 short bgs[NROWS * NCOLS];
31 struct term_state cur, sav;
32 int histtail; /* the next history row */
33 int fd;
34 int pid;
35 int top, bot;
38 void term_load(struct term *term, int visible);
39 void term_save(struct term *term);
41 void term_read(void);
42 void term_send(int c);
43 void term_exec(char **args);
44 void term_end(void);
45 void term_screenshot(void);
46 void term_hist(int pos);
47 void term_redraw(void);
49 /* pad.c */
50 #define FN_I 0x100
51 #define FN_B 0x200
53 int pad_init(void);
54 void pad_free(void);
55 int pad_font(char *fr, char *fi, char *fb);
56 void pad_put(int ch, int r, int c, int fg, int bg);
57 int pad_rows(void);
58 int pad_cols(void);
59 void pad_blank(int c);
60 void pad_blankrow(int r, int bg);
62 /* font.c */
63 struct font *font_open(char *path);
64 void font_free(struct font *font);
65 int font_rows(struct font *font);
66 int font_cols(struct font *font);
67 int font_bitmap(struct font *font, void *dst, int c);
69 /* scrsnap.c */
70 void scr_snap(void *owner);
71 int scr_load(void *owner);
72 void scr_free(void *owner);