X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=visor;a=blobdiff_plain;f=visor%2Fsrc%2Fterm.h;h=82ccd16aa56677ec6d908a674c3021406f023f9b;hp=fd2a4c44fd9c0a06a2dd10161803104926a78e3e;hb=519bb5db64dd400724d8beedd10bf54d8cf2b7af;hpb=c21ad1b67f3bb33cda9a85006486a6d88116a731 diff --git a/visor/src/term.h b/visor/src/term.h index fd2a4c4..82ccd16 100644 --- a/visor/src/term.h +++ b/visor/src/term.h @@ -1,9 +1,51 @@ #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); #endif /* TERM_H_ */