]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/curses/ffi/ffi.factor
use radix literals
[factor.git] / extra / curses / ffi / ffi.factor
index 2941f66765d0dbfe1e02fda23ececa9569d723f7..c3b0d42cd260b97529c67708352d053b01d794dd 100644 (file)
@@ -5,12 +5,11 @@ alien.syntax classes.struct combinators kernel math system unix.types ;
 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
 
@@ -38,7 +37,7 @@ STRUCT: pdat
 { _pad_bottom NCURSES_SIZE_T }
 { _pad_right NCURSES_SIZE_T } ;
 
-STRUCT: c-window
+STRUCT: WINDOW
 { _cury NCURSES_SIZE_T }
 { _curx NCURSES_SIZE_T }
 
@@ -254,18 +253,20 @@ C-GLOBAL: int COLOR_PAIRS
 
 : 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 - 5 * shift ; inline
+: NCURSES_MOUSE_MASK ( b m -- mask ) swap 1 - 6 * shift ; inline
 
-CONSTANT: NCURSES_BUTTON_RELEASED OCT: 01
-CONSTANT: NCURSES_BUTTON_PRESSED  OCT: 02
-CONSTANT: NCURSES_BUTTON_CLICKED  OCT: 04
-CONSTANT: NCURSES_DOUBLE_CLICKED  OCT: 10
-CONSTANT: NCURSES_TRIPLE_CLICKED  OCT: 20
-CONSTANT: NCURSES_RESERVED_EVENT  OCT: 40
+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 ) ;
@@ -274,3 +275,8 @@ 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 ) ;