{   Computer Systems Research Institute
    University of Toronto

    IBM PC Curses Simulation Module Interface  V3.00
    Author: James R. Cordy
    Date:   March 1984  (Rev Nov 1985)

    Copyright (C) 1984, 1985  The University of Toronto

    This module is the interface to the IBM PC simulation
    of the UNIX Curses package.
}


{ Character Colour Codes }
pervasive const C_BLACK := 0
pervasive const C_BLUE := 1
pervasive const C_GREEN := 2
pervasive const C_CYAN := 3
pervasive const C_RED := 4
pervasive const C_PURPLE := 5
pervasive const C_YELLOW := 6	{ actually brown without standout }
pervasive const C_WHITE := 7
{ "standout" can be used to achieve 8 more character colours;
  for example:
	standout
	colour (C_BLUE)
  will result in high intensity blue (not portable to the TI-PRO). }

{ Background Colour Codes
  The use of these codes is not portable to the TI-PRO
  Use the sum of one foreground and one background colour; for example:
	colour (C_GREEN + B_PURPLE)
  will result in green characters on a purple background.
  C_BLACK + B_WHITE is reverse video on monochrome displays. }
pervasive const B_BLACK := 0
pervasive const B_BLUE := 16
pervasive const B_GREEN := 32
pervasive const B_CYAN := 48
pervasive const B_RED := 64
pervasive const B_PURPLE := 80
pervasive const B_YELLOW := 96
pervasive const B_WHITE := 112


var Curses : external module
    exports (refresh, clear, cursoroff, cursoron, clrtobot, clrtoeol,
	    addch, addstr, printw, move, scrollup, scrolldown,
	    standout, standend, underline, underend, blink, blinkend,
	    colour, colourend, getch, noecho, echo, crmode, nocrmode,
	    raw, noraw, nl, nonl, hasch, getyx, endwin, lines, columns)
    const lines := 25	{ 0..24; 0 is top of screen }
    const columns := 80	{ 0..79; 0 is left of screen }
    procedure refresh = external
    procedure clear = external
    procedure cursoroff = external	{ make cursor invisible (not on IBM) }
    procedure cursoron = external	{ make cursor visible }
    procedure clrtobot = external
    procedure clrtoeol = external
    procedure addch (c : Char) = external	{ display a character }
    procedure addstr (s : packed array 1 .. parameter of Char) = external
    procedure printw (s : packed array 1 .. parameter of Char,
	i : SignedInt) = external
    procedure move (l : SignedInt, c : SignedInt) = external
    procedure scrollup (l1 : SignedInt, lm : SignedInt,
	n : SignedInt) = external
    procedure scrolldown (l1 : SignedInt, lm : SignedInt,
	n : SignedInt) = external
    procedure standout = external	{ boldface on supporting displays }
    procedure standend = external
    procedure underline = external	{ monochrome display only }
    procedure underend = external
    procedure blink = external
    procedure blinkend = external
    procedure colour (c : ShortInt) = external
    procedure colourend = external
    procedure getch (var c : Char) = external
    procedure noecho = external
    procedure echo = external
    procedure crmode = external
    procedure nocrmode = external
    procedure raw = external
    procedure noraw = external
    procedure nl = external
    procedure nonl = external
    function hasch returns result : boolean = external
    procedure getyx (var l : SignedInt, var c : SignedInt) = external
    procedure endwin = external		{ return to standard configuration }
end module
