home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
drdobbs
/
1988
/
04
/
porter
/
porter.ls1
next >
Wrap
Text File
|
1979-12-31
|
2KB
|
44 lines
DEFINITION MODULE LineDwg;
EXPORT QUALIFIED
width, height, CharWidth, CharHeight, PaintMode, Px, Py,
mode, dot, line, paint, copyArea, clear, Write, WriteString;
TYPE PaintMode = (replace, add, invert, erase);
VAR Px, Py : INTEGER; (* Current coordinates of drawing pen *)
mode : PaintMode; (* Current mode for paint and copy *)
width : INTEGER; (* Width of picture area, read-only *)
height : INTEGER; (* Height of picture area, read-only *)
CharWidth : INTEGER; (* Width of a character *)
CharHeight : INTEGER; (* Height of a character *)
PROCEDURE dot (c : CARDINAL; x, y : INTEGER);
(* Place a dot at coordinate x, y in color c *)
PROCEDURE line (d, n : CARDINAL);
(* Draw a line of length n in direction d
(angle = 45 * d degrees) *)
PROCEDURE paint (c : CARDINAL; x, y, w, h : INTEGER);
(* Paint the rectangular area at x, y of width w and
height h in color c, where 0 = white, 1 = light gray,
2 = dark gray, 3 = black *)
(* Note: This proc is also called 'area' by Wirth *)
PROCEDURE copyArea (sx, sy, dx, dy, dw, dh : INTEGER);
(* Copy rectangular area at sx, sy into rectangle at dx, dy
of width dw and height dh *)
PROCEDURE clear; (* Clear the screen *)
(* Note: Also places display in EGA 640 x 350 color mode *)
PROCEDURE Write (ch : CHAR); (* Write ch at pen's position *)
PROCEDURE WriteString (s : ARRAY OF CHAR);
END LineDwg.