Listing: 1 (******************************************************************************) 2 (* TPATTERN.MOD *) 3 (* *) 4 (* MetaWINDOW HOWTO: program series. Demonstrates patterns and shapes. *) 5 (* Transcribed from TPATTERN.C METAGRAPHICS SOFTWARE CORPORATION (c) 1987-1989*) 6 (* *) 7 (* PSW 10/31/90 02:44am *) 8 (******************************************************************************) 9 10 MODULE TPattern; 11 (* 12 * Graphix 13 * Release 3.7 14 * (c) Copyright 1986-1992 PMI 15 * Green Bay, Wisconsin 16 * (414) 468-6040 17 * All rights reserved 18 * 19 *) 20 21 IMPORT GrConst; 22 IMPORT GrPorts; 23 IMPORT Meta; 24 IMPORT GrQry; 25 IMPORT IO; 26 27 FROM GrConst IMPORT rect, point, polyHead; ***** ^ duplicate identifier 28 29 VAR 30 GrafixCard, 31 CommPort: INTEGER; 32 sR,R: rect; 33 ScrnXmax, 34 ScrnYmax, 35 x,y,z, 36 dx,dy, 37 dxx,dyy, 38 h,i,j,k, 39 clr,pat, 40 object: INTEGER; 41 p_pts: ARRAY[0..6] OF point; (* The polygon point series *) ***** ^ not supported yet ***** ^ not supported yet 42 p_hdr: polyHead; (* the polygon header array *) 43 44 45 BEGIN 46 (* init the system *) 47 48 GrQry.GrQuery(GrafixCard, CommPort); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 49 50 i := Meta.InitGrafix(-GrafixCard); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 51 52 IF (i # 0) THEN 53 (* Display reason for no go *) 54 GrQry.GrInitErr(GrafixCard, CommPort, i); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 55 END; 56 57 IO.WrStr('TPATTERN - Color and pattern display'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 IO.WrLn; IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 59 IO.WrStr('What object to use ?'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 60 IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet 61 IO.WrStr(' 1) Rectangles'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 62 IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet 63 IO.WrStr(' 2) RoundRectangles'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 64 IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet 65 IO.WrStr(' 3) Ovals'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 66 IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet 67 IO.WrStr(' 4) Arcs'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 68 IO.WrLn; ***** ^ not supported yet ***** ^ not supported yet 69 IO.WrStr(' 5) Polygons [ ]'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 70 IO.WrChar(CHR(8)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 71 IO.WrChar(CHR(8)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 72 73 object := IO.RdInt(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 75 IF (object < 1) OR (object > 5) THEN 76 GrQry.GrQuit('Illegal object!', 1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 77 END; 78 79 Meta.SetDisplay(GrConst.GrafPg0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 80 Meta.ScreenRect(sR); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 81 Meta.EraseRect(sR); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 82 Meta.RasterOp(GrConst.zREPz); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 83 ScrnXmax := sR.Xmax; ***** ^ not supported yet ***** ^ not supported yet 84 ScrnYmax := sR.Ymax; ***** ^ not supported yet ***** ^ not supported yet 85 86 (* set up the polygon header array *) 87 p_hdr.polyBgn := 0; ***** ^ not supported yet ***** ^ not supported yet 88 p_hdr.polyEnd := 6; ***** ^ not supported yet ***** ^ not supported yet 89 p_hdr.polyRect := sR; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 90 91 dx := (ScrnXmax+1) DIV 8; 92 dy := (ScrnYmax+1) DIV 4; 93 dxx := dx DIV 5; 94 dyy := dy DIV 6; 95 96 clr := Meta.QueryColors(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 97 k := clr - 1; 98 99 FOR h := 0 TO 15 DO 100 INC(k, 31); ***** ^ undeclared identifier ***** ^ not supported yet 101 pat := 0; 102 y := 0; 103 104 FOR i := 0 TO 3 DO (* 4 down *) 105 x := 0; 106 FOR j := 0 TO 7 DO (* 8 across *) 107 Meta.SetRect(R, x, y, x+(dx-dxx), y+(dy-dyy)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 108 Meta.BackColor(k); Meta.PenColor(clr-k); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 109 110 CASE object OF 111 | 1: 112 Meta.FillRect(R, pat); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 113 Meta.FrameRect(R); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 114 | 2: 115 Meta.FillRoundRect(R, dxx, dyy, pat); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 116 Meta.FrameRoundRect(R, dxx, dyy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 117 | 3: 118 Meta.FillOval(R, pat); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 119 Meta.FrameOval(R); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 120 | 4: 121 Meta.FillArc(R, pat*80, 450, pat); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 122 Meta.FrameArc(R, pat*80, 450); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 123 | 5: 124 z := 0; 125 126 p_pts[z].X := x; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 127 p_pts[z].Y := y; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 128 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 129 130 p_pts[z].X := x + ((dx-dxx) DIV 2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 131 p_pts[z].Y := y + (dy-dyy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 132 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 133 134 p_pts[z].X := x + (dx-dxx); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 135 p_pts[z].Y := y; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 136 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 137 138 p_pts[z].X := x + (dx-dxx); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 139 p_pts[z].Y := y + (dy-dyy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 140 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 141 142 p_pts[z].X := x + ((dx-dxx) DIV 2); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 143 p_pts[z].Y := y; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 144 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 145 146 p_pts[z].X := x; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 147 p_pts[z].Y := y + (dy-dyy); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 148 INC(z); ***** ^ undeclared identifier ***** ^ not supported yet 149 150 p_pts[z].X := x; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 151 p_pts[z].Y := y; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 152 153 Meta.FillPoly(1, ADR(p_hdr), ADR(p_pts), pat) ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 154 END; 155 156 INC(x, dx); ***** ^ undeclared identifier ***** ^ not supported yet 157 INC(pat); ***** ^ undeclared identifier ***** ^ not supported yet 158 INC(k) ***** ^ undeclared identifier ***** ^ not supported yet 159 END; 160 161 INC(y, dy) ***** ^ undeclared identifier ***** ^ not supported yet 162 END 163 END; 164 165 GrQry.GrQuit('', 0) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 166 END TPattern. 204 errors