 : wcread ( n window -- string )
     [ encoding>> ] [ ptr>> ] bi (wcread) ;
 : cread ( n -- string ) current-window get wcread ;
-
-: wgetch ( window -- key ) ptr>> (wgetch) ;
-: getch ( -- key ) current-window get wgetch ;
-
-: waddch ( ch window -- ) ptr>> (waddch) ;
-: addch ( ch -- ) current-window get waddch ;
 
 : werase ( window -- ) ptr>> ffi:werase curses-error ;
 : erase ( -- ) current-window get werase ;


: mousemask ( mask -- newmask oldmask )
    0 <ulong> [ ffi:mousemask ] keep *ulong ;

: wcrefresh ( window -- ) ptr>> (wcrefresh) ;
: crefresh ( -- ) current-window get wcrefresh ;

: wgetch ( window -- key ) ptr>> (wgetch) ;
: getch ( -- key ) current-window get wgetch ;

: waddch ( ch window -- ) ptr>> (waddch) ;
: addch ( ch -- ) current-window get waddch ;

: wcnl ( window -- ) [ CHAR: \n ] dip waddch ;
: cnl ( -- ) current-window get wcnl ;

: wcwrite ( string window -- ) ptr>> (wcwrite) ;
: cwrite ( string -- ) current-window get wcwrite ;

: wcprint ( string window -- )
    ptr>> [ (wcwrite) ] [ CHAR: \n swap (waddch) ] bi ;
: cprint ( string -- ) current-window get wcprint ;

: wcprintf ( string window -- )
    ptr>> [ (wcwrite) ] [ CHAR: \n swap (waddch) ]
    [ (wcrefresh) ] tri ;
: cprintf ( string -- ) current-window get wcprintf ;

