From ee5fa34d14288a4ce79d77a0d3a89cc14b16a6b1 Mon Sep 17 00:00:00 2001 From: dam Date: Fri, 31 Mar 2023 01:52:05 +0100 Subject: Implemented initialize_tui. --- curses.jai | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'curses.jai') diff --git a/curses.jai b/curses.jai index bec9db5..866d99e 100644 --- a/curses.jai +++ b/curses.jai @@ -78,12 +78,30 @@ tinfo :: #system_library "libtinfo"; // Required by some of ncurses functions. // I suspect this is an attempt to help the compilers to include libtinfo automatically. // ncurses :: #system_library "libncurses"; ncurses :: #library "libncurses"; -initscr :: () -> *WINDOW #foreign ncurses; -getch :: () -> s8 #foreign ncurses; -endwin :: () -> void #foreign ncurses; - -curs_set :: (visibility: s32) -> s32 #foreign ncurses; -mvaddstr :: (y: s32, x: s32, str: *u8) -> s32 #foreign ncurses; -noecho :: () -> s32 #foreign ncurses; -box :: (win :*WINDOW, verch :u8, horch :u8) -> s32 #foreign ncurses; - + +COLOR_BLACK :: 0; +COLOR_RED :: 1; +COLOR_GREEN :: 2; +COLOR_YELLOW :: 3; +COLOR_BLUE :: 4; +COLOR_MAGENTA :: 5; +COLOR_CYAN :: 6; +COLOR_WHITE :: 7; + +stdscr : *WINDOW; + +initscr :: () -> *WINDOW #foreign ncurses; +getch :: () -> s8 #foreign ncurses; +endwin :: () -> void #foreign ncurses; +cbreak :: () -> void #foreign ncurses; +start_color :: () -> void #foreign ncurses; +use_default_colors :: () -> void #foreign ncurses; + + +keypad :: (win: *WINDOW, bf: bool) -> s32 #foreign ncurses; + +curs_set :: (visibility: s32) -> s32 #foreign ncurses; +mvaddstr :: (y: s32, x: s32, str: *u8) -> s32 #foreign ncurses; +noecho :: () -> s32 #foreign ncurses; +box :: (win: *WINDOW, verch: u8, horch: u8) -> s32 #foreign ncurses; +init_pair :: (pair: s16, f: s16, b: s16) -> s32 #foreign ncurses; -- cgit v1.2.3