Import madtty, use it to deal with colors from now on as it needs to know what is...
[apps/madmutt.git] / lib-ui / madtty.h
1 /*
2     LICENSE INFORMATION:
3     This program is free software; you can redistribute it and/or
4     modify it under the terms of the GNU Lesser General Public
5     License (LGPL) as published by the Free Software Foundation.
6
7     Please refer to the COPYING file for more information.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     General Public License for more details.
13
14     You should have received a copy of the GNU Lesser General Public
15     License along with this program; if not, write to the Free Software
16     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17
18     Copyright © 2004 Bruno T. C. de Oliveira
19     Copyright © 2006 Pierre Habouzit
20  */
21
22 #ifndef MADTTY_MADTTY_H
23 #define MADTTY_MADTTY_H
24
25 #include <ncurses.h>
26 #include <stdbool.h>
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <sys/types.h>
30 #include <unistd.h>
31 #include <wchar.h>
32
33 void madtty_init_colors(void);
34 int madtty_color_pair(int fg, int bg);
35
36 typedef struct madtty_t madtty_t;
37
38 madtty_t *madtty_create(int rows, int cols);
39 void madtty_resize(madtty_t *, int rows, int cols);
40 void madtty_destroy(madtty_t *);
41 pid_t madtty_forkpty(madtty_t *, const char *, const char *argv[], int *pty);
42 int madtty_getpty(madtty_t *);
43
44 int madtty_process(madtty_t *);
45 void madtty_keypress(madtty_t *, int keycode);
46 void madtty_draw(madtty_t *, WINDOW *win, int startrow, int startcol);
47
48
49 #endif /* MADTTY_MADTTY_H */