term: allow specifying command arguments
[fbpad.git] / fbpad.h
blob09007776be0c38d349dd352f0805a2f05ae5f160
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 /* isdw.c */
11 #define DWCHAR 0x40000000u /* 2nd half of a fullwidth char */
13 int isdw(int c);
14 int iszw(int c);
16 /* term.c */
17 #define TERM_HIDDEN 0
18 #define TERM_VISIBLE 1
19 #define TERM_REDRAW 2
21 struct term_state {
22 int row, col;
23 int fg, bg;
24 int mode;
27 struct term {
28 int screen[MAXCHARS];
29 char fgs[MAXCHARS];
30 char bgs[MAXCHARS];
31 struct term_state cur, sav;
32 int fd;
33 int pid;
34 int top, bot;
37 void term_load(struct term *term, int visible);
38 void term_save(struct term *term);
40 void term_read(void);
41 void term_send(int c);
42 void term_exec(char **args);
43 void term_end(void);
44 void term_screenshot(void);
46 /* pad.c */
47 #define FN_I 0x10
48 #define FN_B 0x20
50 int pad_init(void);
51 void pad_free(void);
52 void pad_put(int ch, int r, int c, int fg, int bg);
53 int pad_rows(void);
54 int pad_cols(void);
55 void pad_blank(int c);
56 void pad_blankrow(int r, int bg);
58 /* font.c */
59 struct font *font_open(char *path);
60 void font_free(struct font *font);
61 int font_rows(struct font *font);
62 int font_cols(struct font *font);
63 int font_bitmap(struct font *font, void *dst, int c);
65 /* scrsnap.c */
66 void scr_snap(void *owner);
67 int scr_load(void *owner);
68 void scr_free(void *owner);