diff options
author | Steven Barth <steven@midlink.org> | 2008-08-31 11:16:52 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-08-31 11:16:52 +0000 |
commit | df52b711a78dbe8808628ae873acc1f3edefb1cf (patch) | |
tree | 00b4c145e7ab0501a6de277478b659d51e50fc92 /contrib/luacurses/src/luacurses.h | |
parent | 36c76090638e80d1cb9ad2dd060aae65976f24c8 (diff) |
Reorganise luacurses
Diffstat (limited to 'contrib/luacurses/src/luacurses.h')
-rw-r--r-- | contrib/luacurses/src/luacurses.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/luacurses/src/luacurses.h b/contrib/luacurses/src/luacurses.h new file mode 100644 index 0000000000..2dc426c93f --- /dev/null +++ b/contrib/luacurses/src/luacurses.h @@ -0,0 +1,38 @@ + +#include <curses.h> + +#define MKLUALIB_META_CURSES_SCREEN "SCREEN*" + +SCREEN* luacurses_toscreen(lua_State* L, int index); +SCREEN** luacurses_newscreen(lua_State* L); +void luacurses_regscreen(lua_State* L, const char* name, SCREEN* userdata); + +#define MKLUALIB_META_CURSES_WINDOW "WINDOW*" + +WINDOW* luacurses_towindow(lua_State* L, int index); +WINDOW** luacurses_newwindow(lua_State* L); +void luacurses_regwindow(lua_State* L, const char* name, WINDOW* userdata); + +#define MKLUALIB_META_CURSES_FILE "FILE*" + +FILE* tofile(lua_State* L, int index); +FILE** newfile(lua_State* L); +void luacurses_regfile(lua_State* L, const char* name, FILE* f); + +char* luacurses_wgetnstr(WINDOW* w, int n); +char* luacurses_wgetstr(WINDOW* w); + +#define luacurses_mvwgetnstr(w, y, x, n) (wmove(w, y, x) == ERR ? 0 : luacurses_wgetnstr(w, n)) +#define luacurses_getnstr(n) luacurses_wgetnstr(stdscr, n) +#define luacurses_mvgetnstr(y, x, n) luacurses_mvwgetnstr(stdscr, y, x, n) + +char* luacurses_window_tostring(WINDOW* w); +char* luacurses_screen_tostring(SCREEN* s); + +#define luacurses_window_free(w) {delwin(w); w = 0;} +#define luacurses_screen_free(s) {delscreen(s); s = 0;} + +bool luacurses_getmouse(short* id, int* x, int* y, int* z, mmask_t* bstate); +bool luacurses_ungetmouse (short id, int x, int y, int z, mmask_t bstate); +mmask_t luacurses_addmousemask(mmask_t m); + |