IN: curses.ffi
<< "curses" {
- { [ os winnt? ] [ "libcurses.dll" ] }
+ { [ os windows? ] [ "libcurses.dll" ] }
{ [ os macosx? ] [ "libcurses.dylib" ] }
- { [ os unix? ] [ "libncurses.so.5.7" ] }
+ { [ os unix? ] [ "libncursesw.so" ] }
} cond cdecl add-library >>
-C-TYPE: WINDOW
C-TYPE: SCREEN
TYPEDEF: void* va_list
TYPEDEF: chtype attr_t
TYPEDEF: short NCURSES_SIZE_T
TYPEDEF: ushort wchar_t
+TYPEDEF: ulong mmask_t
CONSTANT: CCHARW_MAX 5
{ _pad_bottom NCURSES_SIZE_T }
{ _pad_right NCURSES_SIZE_T } ;
-STRUCT: c-window
+STRUCT: WINDOW
{ _cury NCURSES_SIZE_T }
{ _curx NCURSES_SIZE_T }
{ _bkgrnd cchar_t } ;
+STRUCT: MEVENT
+ { id short }
+ { x int } { y int } { z int }
+ { bstate mmask_t } ;
+
LIBRARY: curses
C-GLOBAL: void* stdscr
FUNCTION: int move ( int y, int x ) ;
FUNCTION: int wmove ( WINDOW* win, int y, int x ) ;
-
FUNCTION: int scroll ( WINDOW* win ) ;
FUNCTION: int scrl ( int n ) ;
FUNCTION: int wscrl ( WINDOW* win, int n ) ;
: COLOR_PAIR ( n -- n' ) 8 shift ; inline foldable
+FUNCTION: int wcolor_set ( WINDOW* win, short color_pair_number, void* opts ) ;
+
FUNCTION: int wattron ( WINDOW* win, int attrs ) ;
FUNCTION: int wattroff ( WINDOW* win, int attrs ) ;
FUNCTION: int wattrset ( WINDOW* win, int attrs ) ;
+
+: NCURSES_MOUSE_MASK ( b m -- mask ) swap 1 - 6 * shift ; inline
+
+CONSTANT: NCURSES_BUTTON_RELEASED 0o01
+CONSTANT: NCURSES_BUTTON_PRESSED 0o02
+CONSTANT: NCURSES_BUTTON_CLICKED 0o04
+CONSTANT: NCURSES_DOUBLE_CLICKED 0o10
+CONSTANT: NCURSES_TRIPLE_CLICKED 0o20
+CONSTANT: NCURSES_RESERVED_EVENT 0o40
+
+FUNCTION: int getmouse ( MEVENT* event ) ;
+FUNCTION: int ungetmouse ( MEVENT* event ) ;
+FUNCTION: mmask_t mousemask ( mmask_t newmask, mmask_t* oldmask ) ;
+FUNCTION: bool wenclose ( WINDOW* win, int y, int x ) ;
+FUNCTION: bool mouse_trafo ( int* pY, int* pX, bool to_screen ) ;
+FUNCTION: bool wmouse_trafo ( WINDOW* win, int* pY, int* pX, bool to_screen ) ;
+FUNCTION: int mouseinterval ( int erval ) ;
+
+FUNCTION: int wborder ( WINDOW* win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br ) ;
+FUNCTION: int box ( WINDOW* win, chtype verch, chtype horch ) ;
+FUNCTION: int whline ( WINDOW* win, chtype ch, int n ) ;
+FUNCTION: int wvline ( WINDOW* win, chtype ch, int n ) ;