 
 : wcread ( n window -- string )
     [ encoding>> ] [ ptr>> ] bi (wcread) ;
-: curses-read ( n -- string ) current-window get wcread ;
+: cread ( n -- string ) current-window get wcread ;
 
 : wgetch ( window -- key ) ptr>> (wgetch) ;
 : getch ( -- key ) current-window get wgetch ;


: fill-in-type ( mouse-event substate -- )
    {
        { BUTTON1_RELEASED       [ +released+ >>type drop ] }
        { BUTTON1_PRESSED        [ +pressed+  >>type drop ] }
        { BUTTON1_CLICKED        [ +clicked+  >>type drop ] }
        { BUTTON1_DOUBLE_CLICKED [ +double+   >>type drop ] }
        { BUTTON1_TRIPLE_CLICKED [ +triple+   >>type drop ] }
    } case ; inline

: fill-in-bstate ( mouse-event bstate -- )
    2dup {

: >BOOLEAN ( ? -- TRUE/FALSE ) ffi:TRUE ffi:FALSE ? ; inline

: curses-pointer-error ( ptr/f -- ptr )
    [ curses-failed ] unless* ; inline
: curses-error ( n -- ) ffi:ERR = [ curses-failed ] when ;

PRIVATE>
