X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=visor;a=blobdiff_plain;f=visor%2Fsrc%2Fterm.h;fp=visor%2Fsrc%2Fterm.h;h=82ccd16aa56677ec6d908a674c3021406f023f9b;hp=a5cc3346ef2643c2aa6d25b607eb3dfea21fc9f7;hb=519bb5db64dd400724d8beedd10bf54d8cf2b7af;hpb=94c867869ece77f27cf3c8b637d44e13d86f5b88 diff --git a/visor/src/term.h b/visor/src/term.h index a5cc334..82ccd16 100644 --- a/visor/src/term.h +++ b/visor/src/term.h @@ -1,9 +1,50 @@ #ifndef TERM_H_ #define TERM_H_ +enum term_event_type { + TERM_EV_KEY, + TERM_EV_RESIZE, + TERM_EV_MBUTTON, + TERM_EV_MMOTION +}; + +struct term_ev_any { + int type; +}; + +struct term_ev_resize { + int type; + int width, height; +}; + +struct term_ev_mbutton { + int type; + /* TODO */ +}; + +struct term_ev_mmotion { + int type; + int x, y; +}; + +union term_event { + struct term_ev_any any; + struct term_ev_resize resize; + struct term_ev_mbutton mbutton; + struct term_ev_mmotion mmotion; +}; + int term_init(const char *ttypath); void term_cleanup(void); +void term_getsize(int *width, int *height); +void term_resize_func(void (*func)(int, int)); + +void term_send(const char *s, int size); +void term_puts(const char *s); +void term_printf(const char *fmt, ...); +void term_flush(void); + void term_clear(void); int term_getchar(void);