module Curses:sig..end
Bindings to the ncurses library.
Beware, all coordinates are passed y first, then x.
Functions whose name start with a "w" take as first argument the window the
function applies to.
Functions whose name start with "mv" take as first two arguments the
coordinates y and x of the point to move the cursor to. For example
mvaddch y x ch is the same as move y x; addch ch.
type window
Windows.
type screen
Screens.
type terminal
Terminals.
typechtype =int
Characters. Usual characters can be converted from/to chtype using
char_of_int and int_of_char. See also get_acs_codes for characters
useful for drawing and the Key module for special input characters.
typeattr_t =int
Attributes are lorings of flags which are defined in the A module.
typeerr =bool
A return value. false means that an error occured.
val initscr : unit -> windowInitialize the curses library.
val endwin : unit -> unitRestore the terminal (should be called before exiting).
val isendwin : unit -> boolHas endwin been called without any subsequent call to werefresh?
val newterm : string -> Unix.file_descr -> Unix.file_descr -> screenCreate a new terminal.
val set_term : screen -> unitSwitch terminal.
val delscreen : screen -> unitDelete a screen.
val stdscr : unit -> windowval getyx : window -> int * intGet the current cursor position.
val getparyx : window -> int * int
val getbegyx : window -> int * int
val getmaxyx : window -> int * int
val move : int -> int -> errMove the cursor.
val wmove : window -> int -> int -> errmodule Acs:sig..end
Predefined characters.
val get_acs_codes : unit -> Acs.acsGet the predefined characters.
val addch : chtype -> errAdd a character at the current position, then advance the cursor.
val waddch : window -> chtype -> err
val mvaddch : int -> int -> chtype -> err
val mvwaddch : window -> int -> int -> chtype -> err
val echochar : chtype -> errechochar ch is equivalent to addch ch followed by refresh ().
val wechochar : window -> chtype -> err
val addchstr : chtype array -> errAdd a sequence of characters at the current position. See also addstr.
val waddchstr : window -> chtype array -> err
val mvaddchstr : int -> int -> chtype array -> err
val mvwaddchstr : window -> int -> int -> chtype array -> err
val addchnstr : chtype array -> int -> int -> err
val waddchnstr : window -> chtype array -> int -> int -> err
val mvaddchnstr : int -> int -> chtype array -> int -> int -> err
val mvwaddchnstr : window ->
int -> int -> chtype array -> int -> int -> err
val addstr : string -> errAdd a string at the current position.
val waddstr : window -> string -> err
val mvaddstr : int -> int -> string -> err
val mvwaddstr : window -> int -> int -> string -> err
val addnstr : string -> int -> int -> err
val waddnstr : window -> string -> int -> int -> err
val mvaddnstr : int -> int -> string -> int -> int -> err
val mvwaddnstr : window -> int -> int -> string -> int -> int -> err
val insch : chtype -> errInsert a character before cursor.
val winsch : window -> chtype -> err
val mvinsch : int -> int -> chtype -> err
val mvwinsch : window -> int -> int -> chtype -> err
val insstr : string -> errInsert a string before cursor.
val winsstr : window -> string -> err
val mvinsstr : int -> int -> string -> err
val mvwinsstr : window -> int -> int -> string -> err
val insnstr : string -> int -> int -> err
val winsnstr : window -> string -> int -> int -> err
val mvinsnstr : int -> int -> string -> int -> int -> err
val mvwinsnstr : window -> int -> int -> string -> int -> int -> err
val delch : unit -> errDelete a character.
val wdelch : window -> err
val mvdelch : int -> int -> err
val mvwdelch : window -> int -> int -> errmodule A:sig..end
Attributes.
module WA:sig..end
New series of highlight attributes.
val attroff : int -> unitTurn off the attributes given in argument (see the A module).
val wattroff : window -> int -> unit
val attron : int -> unitTurn on the attributes given in argument.
val wattron : window -> int -> unit
val attrset : int -> unitSet the attributes.
val wattrset : window -> int -> unit
val standend : unit -> unit
val wstandend : window -> unit
val standout : unit -> unit
val wstandout : window -> unit
val attr_off : attr_t -> unitTurn off the attributes given in argument (see the WA module).
val wattr_off : window -> attr_t -> unit
val attr_on : attr_t -> unit
val wattr_on : window -> attr_t -> unit
val attr_set : attr_t -> int -> unit
val wattr_set : window -> attr_t -> int -> unit
val chgat : int -> attr_t -> int -> unitchgat n attr color changes the attributes of n characters.
val wchgat : window -> int -> attr_t -> int -> unit
val mvchgat : int -> int -> int -> attr_t -> int -> unit
val mvwchgat : window -> int -> int -> int -> attr_t -> int -> unit
val inch : unit -> chtypeGet the attributes of the caracter at current position.
val winch : window -> chtype
val mvinch : int -> int -> chtype
val mvwinch : window -> int -> int -> chtype
val inchstr : chtype array -> errGet the attributes of a sequence of characters.
val winchstr : window -> chtype array -> err
val mvinchstr : int -> int -> chtype array -> err
val mvwinchstr : window -> int -> int -> chtype array -> err
val inchnstr : chtype array -> int -> int -> err
val winchnstr : window -> chtype array -> int -> int -> err
val mvinchnstr : int -> int -> chtype array -> int -> int -> err
val mvwinchnstr : window ->
int -> int -> chtype array -> int -> int -> err
val instr : string -> errGet the attributes of a string.
val winstr : window -> string -> err
val mvinstr : int -> int -> string -> err
val mvwinstr : window -> int -> int -> string -> err
val innstr : string -> int -> int -> err
val winnstr : window -> string -> int -> int -> err
val mvinnstr : int -> int -> string -> int -> int -> err
val mvwinnstr : window -> int -> int -> string -> int -> int -> errval bkgdset : chtype -> unitSet the background of the current character.
val wbkgdset : window -> chtype -> unit
val bkgd : chtype -> unitSet the background of every character.
val wbkgd : window -> chtype -> unit
val getbkgd : window -> chtypeGet the current background.
val deleteln : unit -> errDelete a line.
val wdeleteln : window -> err
val insdelln : int -> errinsdelln n inserts n lines above the current line if n is positive or
deletes -n lines if n is negative.
val winsdelln : window -> int -> err
val insertln : unit -> errInsert a blank line above the current line.
val winsertln : window -> errmodule Key:sig..end
Special keys.
val getch : unit -> intRead a character in a window.
val wgetch : window -> int
val mvgetch : int -> int -> int
val mvwgetch : window -> int -> int -> int
val ungetch : int -> err
val getstr : string -> errRead a string in a window.
val wgetstr : window -> string -> err
val mvgetstr : int -> int -> string -> err
val mvwgetstr : window -> int -> int -> string -> err
val getnstr : string -> int -> int -> err
val wgetnstr : window -> string -> int -> int -> err
val mvgetnstr : int -> int -> string -> int -> int -> err
val mvwgetnstr : window -> int -> int -> string -> int -> int -> errval newwin : int -> int -> int -> int -> windownewwin l c y x create a new window with l lines, c columns. The upper
left-hand corner is at (x,y).
val delwin : window -> errDelete a window.
val mvwin : window -> int -> int -> errMove a window.
val subwin : window -> int -> int -> int -> int -> windowsubwin l c y x create a subwindow with l lines and c columns at
screen-relative position (x,y).
val derwin : window -> int -> int -> int -> int -> windowSame as subwin excepting that the position (x,y) is relative to the
parent window.
val mvderwin : window -> int -> int -> errMove a derived windw.
val dupwin : window -> windowDuplicate a window.
val wsyncup : window -> unit
val syncok : window -> bool -> errIf syncok is called with true as second argument, wsyncup is called
automatically whenever there is a change in the window.
val wcursyncup : window -> unit
val wsyncdown : window -> unit
val winch_handler_on : unit -> unit
val winch_handler_off : unit -> unit
val get_size : unit -> int * int
val get_size_fd : Unix.file_descr -> int * int
val null_window : windowval refresh : unit -> errRefresh windows.
val wrefresh : window -> err
val wnoutrefresh : window -> err
val doupdate : unit -> err
val redrawwin : window -> err
val wredrawln : window -> int -> int -> err
val wresize : window -> int -> int -> err
val resizeterm : int -> int -> err
val scroll : window -> err
val scrl : int -> err
val wscrl : window -> int -> err
val touchwin : window -> err
val touchline : window -> int -> int -> err
val untouchwin : window -> err
val wtouchln : window -> int -> int -> bool -> err
val is_linetouched : window -> int -> int
val is_wintouched : window -> bool
val erase : unit -> unitClear a window.
val werase : window -> unit
val clear : unit -> unit
val wclear : window -> unit
val clrtobot : unit -> unit
val wclrtobot : window -> unit
val clrtoeol : unit -> unit
val wclrtoeol : window -> unitval overlay : window -> window -> erroverlay srcwin dstwin overlays srcwin on top of dstwin.
val overwrite : window -> window -> err
val copywin : window ->
window -> int -> int -> int -> int -> int -> int -> bool -> errval border : chtype ->
chtype ->
chtype ->
chtype ->
chtype -> chtype -> chtype -> chtype -> unitDraw a box around the edges of a window.
val wborder : window ->
chtype ->
chtype ->
chtype ->
chtype ->
chtype -> chtype -> chtype -> chtype -> unit
val box : window -> chtype -> chtype -> unitDraw a box.
val hline : chtype -> int -> unitDraw an horizontal line.
val whline : window -> chtype -> int -> unit
val mvhline : int -> int -> chtype -> int -> unit
val mvwhline : window -> int -> int -> chtype -> int -> unit
val vline : chtype -> int -> unitDraw a vertical line.
val wvline : window -> chtype -> int -> unit
val mvvline : int -> int -> chtype -> int -> unit
val mvwvline : window -> int -> int -> chtype -> int -> unitA pad is like a window except that it is not restricted by the screen size, and is not necessarily associated with a particular part of the screen.
val newpad : int -> int -> windowCreate a new pad.
val subpad : window -> int -> int -> int -> int -> window
val prefresh : window -> int -> int -> int -> int -> int -> int -> err
val pnoutrefresh : window -> int -> int -> int -> int -> int -> int -> err
val pechochar : window -> chtype -> errmodule Color:sig..end
Colors.
val start_color : unit -> err
val use_default_colors : unit -> err
val init_pair : int -> int -> int -> err
val init_color : int -> int -> int -> int -> err
val has_colors : unit -> bool
val can_change_color : unit -> bool
val color_content : int -> int * int * int
val pair_content : int -> int * int
val colors : unit -> int
val color_pairs : unit -> intval cbreak : unit -> errDisable line buffering.
val halfdelay : int -> errSimilar to cbreak but with delay.
val nocbreak : unit -> errEnable line buffering (waits for characters until newline is typed).
val echo : unit -> errDon't echo typed characters.
val noecho : unit -> errEcho typed characters.
val intrflush : window -> bool -> err
val keypad : window -> bool -> err
val meta : window -> bool -> err
val nodelay : window -> bool -> err
val raw : unit -> err
val noraw : unit -> err
val noqiflush : unit -> unit
val qiflush : unit -> unit
val notimeout : window -> bool -> err
val timeout : int -> unit
val wtimeout : window -> int -> unit
val typeahead : Unix.file_descr -> err
val notypeahead : unit -> errval clearok : window -> bool -> unitIf called with true as second argument, the next call to wrefresh with
this window will clear the streen completely and redraw the entire screen
from scratch.
val idlok : window -> bool -> unit
val idcok : window -> bool -> unit
val immedok : window -> bool -> unit
val leaveok : window -> bool -> unit
val setscrreg : int -> int -> err
val wsetscrreg : window -> int -> int -> err
val scrollok : window -> bool -> unit
val nl : unit -> unit
val nonl : unit -> unitval slk_init : int -> errInitialize soft labels.
val slk_set : int -> string -> int -> err
val slk_refresh : unit -> err
val slk_noutrefresh : unit -> err
val slk_label : int -> string
val slk_clear : unit -> err
val slk_restore : unit -> err
val slk_touch : unit -> err
val slk_attron : attr_t -> err
val slk_attroff : attr_t -> err
val slk_attrset : attr_t -> errval mousemask : int -> int * intSets the mouse mask.
val beep : unit -> errRing a bell.
val flash : unit -> errFlash the screen.
val unctrl : chtype -> string
val keyname : int -> string
val filter : unit -> unit
val use_env : bool -> unit
val putwin : window -> Unix.file_descr -> err
val getwin : Unix.file_descr -> window
val delay_output : int -> err
val flushinp : unit -> unitval scr_dump : string -> errDump the current screen to a file.
val scr_restore : string -> err
val scr_init : string -> err
val scr_set : string -> errval baudrate : unit -> intGet the speed of a terminal (in bits per second).
val erasechar : unit -> charGet user's current erase character.
val has_ic : unit -> boolHas the terminal insert- and delete-character capabilites?
val has_il : unit -> boolHas the terminal insert- and delete-line capabilites?
val killchar : unit -> charGet user's current line kill character.
val longname : unit -> stringGet a description of the terminal.
val termattrs : unit -> attr_t
val termname : unit -> string
val tgetent : string -> bool
val tgetflag : string -> bool
val tgetnum : string -> int
val tgetstr : string -> bool
val tgoto : string -> int -> int -> string
val setupterm : string -> Unix.file_descr -> err
val setterm : string -> err
val cur_term : unit -> terminal
val set_curterm : terminal -> terminal
val del_curterm : terminal -> err
val restartterm : string -> Unix.file_descr -> err
val putp : string -> err
val vidattr : chtype -> err
val mvcur : int -> int -> int -> int -> err
val tigetflag : string -> bool
val tigetnum : string -> int
val tigetstr : string -> string
val tputs : string -> int -> (char -> unit) -> err
val vidputs : chtype -> (char -> unit) -> err
val tparm : string -> int array -> string
val bool_terminfo_variable : int -> string * string * string
val num_terminfo_variable : int -> string * string * string
val str_terminfo_variable : int -> string * string * string
val bool_terminfo_variables : (string, string * string) Stdlib.Hashtbl.t
val num_terminfo_variables : (string, string * string) Stdlib.Hashtbl.t
val str_terminfo_variables : (string, string * string) Stdlib.Hashtbl.tval def_prog_mode : unit -> unitSave the current terminal modes as the "program" state for use by the
reser_prog_mod and reset_shell_mode functions.
val def_shell_mode : unit -> unit
val reset_prog_mode : unit -> unit
val reset_shell_mode : unit -> unit
val resetty : unit -> unit
val savetty : unit -> unit
val getsyx : unit -> int * int
val setsyx : int -> int -> unit
val curs_set : int -> err
val napms : int -> unit
val ripoffline : bool -> unit
val get_ripoff : unit -> window * intmodule Curses_config:sig..end