X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-ui%2Fmadtty.h;h=0c780f433b14e16bf58b94910f403c909b01e31a;hp=38c2651afd3b5a73786b69f584d345b40606811a;hb=95986f5aee1c2ee7d12c4b1e4bc47874856c5831;hpb=3438f31945bb94bc4f4b9603ac47fcde03d5c073;ds=sidebyside diff --git a/lib-ui/madtty.h b/lib-ui/madtty.h index 38c2651..0c780f4 100644 --- a/lib-ui/madtty.h +++ b/lib-ui/madtty.h @@ -24,20 +24,46 @@ #include -void madtty_init_colors(void); -int madtty_color_pair(int fg, int bg); +enum { + /* means escape sequence was handled */ + MADTTY_HANDLER_OK, + /* means the escape sequence was not recognized yet, but + * there is hope that it still will once more characters + * arrive (i.e. it is not yet complete). + * + * The library will thus continue collecting characters + * and calling the handler as each character arrives until + * either OK or NOWAY is returned. + */ + MADTTY_HANDLER_NOTYET, + /* means the escape sequence was not recognized, and there + * is no chance that it will even if more characters are + * added to it. + */ + MADTTY_HANDLER_NOWAY +}; typedef struct madtty_t madtty_t; +typedef int (*madtty_handler_t)(madtty_t *, char *es); + +void madtty_init_colors(void); +void madtty_init_vt100_graphics(void); +void madtty_set_handler(madtty_t *, madtty_handler_t); +void madtty_set_data(madtty_t *, void *); +void *madtty_get_data(madtty_t *); +int madtty_color_pair(int fg, int bg); madtty_t *madtty_create(int rows, int cols); void madtty_resize(madtty_t *, int rows, int cols); void madtty_destroy(madtty_t *); pid_t madtty_forkpty(madtty_t *, const char *, const char *argv[], int *pty); int madtty_getpty(madtty_t *); +unsigned madtty_cursor(madtty_t *t); int madtty_process(madtty_t *); void madtty_keypress(madtty_t *, int keycode); +void madtty_keypress_sequence(madtty_t *, const char *seq); +void madtty_dirty(madtty_t *t); void madtty_draw(madtty_t *, WINDOW *win, int startrow, int startcol); - #endif /* MADTTY_MADTTY_H */