X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=madtty%2Fmadtty.h;h=2859bfe3bf4ee86d2733d37dea43ba05ce1e8877;hb=refs%2Fheads%2Fmaster;hp=cd9e7d4d07d2c9b3644bcceed0bd1cde1c20d6a7;hpb=c3f780f9456ff7adde5b8041596e200a9b41c588;p=apps%2Fmadtty.git diff --git a/madtty/madtty.h b/madtty/madtty.h index cd9e7d4..2859bfe 100644 --- a/madtty/madtty.h +++ b/madtty/madtty.h @@ -30,9 +30,34 @@ #include #include -void madtty_initialize(void); +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); @@ -44,5 +69,4 @@ int madtty_process(madtty_t *); void madtty_keypress(madtty_t *, int keycode); void madtty_draw(madtty_t *, WINDOW *win, int startrow, int startcol); - #endif /* MADTTY_MADTTY_H */