From 78e87a1faaa7f81181223d60eeeec83be7ba6fd8 Mon Sep 17 00:00:00 2001 From: sbosse Date: Thu, 17 Oct 2024 23:43:23 +0200 Subject: [PATCH] Thu 17 Oct 23:42:52 CEST 2024 --- include/library/nwindow.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/library/nwindow.h diff --git a/include/library/nwindow.h b/include/library/nwindow.h new file mode 100644 index 0000000..4286c79 --- /dev/null +++ b/include/library/nwindow.h @@ -0,0 +1,35 @@ +#ifndef NANOWIN_H +#define NANOWIN_H + +#include +#include + +struct nwindow * nw_create_default(); +struct nwindow * nw_create_child( struct nwindow *parent, int x, int y, int width, int height ); +struct nwindow * nw_create_from_fd( int fd ); + +int nw_width( struct nwindow *w ); +int nw_height( struct nwindow *w ); + +char nw_getchar( struct nwindow *w, int blocking ); + +int nw_next_event( struct nwindow *w, struct event *e ); +int nw_read_events( struct nwindow *w, struct event *e, int count, int timeout ); +int nw_post_events( struct nwindow *w, const struct event *e, int count ); + +int nw_move( struct nwindow *w, int x, int y ); +int nw_resize( struct nwindow *w, int width, int height ); +int nw_fd( struct nwindow *w ); + +void nw_fgcolor( struct nwindow *w, int r, int g, int b ); +void nw_bgcolor( struct nwindow *w, int r, int g, int b ); +void nw_clear ( struct nwindow *w, int x, int y, int width, int height ); +void nw_line ( struct nwindow *w, int x, int y, int width, int height ); +void nw_rect ( struct nwindow *w, int x, int y, int width, int height ); +void nw_char ( struct nwindow *w, int x, int y, char c ); +void nw_string ( struct nwindow *w, int x, int y, const char *s ); +void nw_flush ( struct nwindow *w ); + + + +#endif