| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754 |
- Listing:
- 1 (******************************************************************************)
- 2 (* COLORPAL.MOD *)
- 3 (* *)
- 4 (* MetaWINDOW HOWTO: program series. Demonstrates usage of Read / Write / *)
- 5 (* LoadPalette. *)
- 6 (* Transcribed from COLORPAL.C METAGRAPHICS SOFTWARE CORPORATION (c) 1987-1989*)
- 7 (* *)
- 8 (* PSW 06/28/91 08:30am *)
- 9 (******************************************************************************)
- 10
- 11 MODULE ColorPal;
- 12 (*
- 13 * Graphix
- 14 * Release 3.7
- 15 * (c) Copyright 1986-1992 PMI
- 16 * Green Bay, Wisconsin
- 17 * (414) 468-6040
- 18 * All rights reserved
- 19 *
- 20 *)
- 21
- 22 IMPORT GrConst;
- 23 IMPORT GrPorts;
- 24 IMPORT GrFonts;
- 25 IMPORT Meta;
- 26 IMPORT GrQry;
- 27 IMPORT IO;
- 28 IMPORT Str;
- 29 IMPORT Lib;
- 30
- 31 FROM GrConst IMPORT rect, point, event, palData;
- ***** ^ duplicate identifier
- 32 FROM GrPorts IMPORT adsPort;
- ***** ^ duplicate identifier
- 33 FROM GrFonts IMPORT adsFont;
- ***** ^ duplicate identifier
- 34 FROM Storage IMPORT ALLOCATE, DEALLOCATE;
- 35
- 36 CONST
- 37 MOUSE_RIGHT = 0100H;
- 38 MOUSE_LEFT = 0400H;
- 39 EGAADJUST = 4000H;
- 40
- 41
- 42 VAR
- 43 GrafixCard,
- 44 CommPort: INTEGER;
- 45 control: ARRAY [0..3] OF LONGINT;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 paltype: INTEGER;
- 47 palColors: ARRAY[0..1] OF palData;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 48 max_colors,
- 49 colors: INTEGER;
- 50 OK: BOOLEAN;
- 51 i,
- 52 selPalEntry,
- 53 curs, buttons,
- 54 x, y, speed: INTEGER;
- 55 scrnR: rect;
- 56 myevent: event;
- 57 cursor_pt: point;
- 58 thePort: adsPort; (* pointer to default MetaWINDOW port *)
- 59 buf, fntpath: ARRAY [0..25] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 60 val: ARRAY[0..10] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 61 fontbuf: adsFont;
- 62
- 63 (* default EGA style palette *)
- 64
- 65 palette: ARRAY [0..15] OF WORD;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 66
- 67 (*** Draw a screen full of boxes, one for each color combination. ***)
- 68
- 69 PROCEDURE draw_palette();
- 70 VAR
- 71 color: INTEGER;
- 72 r: rect;
- 73 BEGIN
- 74
- 75 Meta.MoveTo(0, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 76
- 77 IF max_colors > 16 THEN
- 78 Meta.SetRect(r, 0, 0, 30, 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 79
- 80 FOR color := 0 TO max_colors DO
- 81 Meta.PenColor(color);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 82 Meta.PaintRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 83 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 84 Meta.FrameRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 85
- 86 Meta.OffsetRect(r, 40, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 87
- 88 IF r.Xmax > 640 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 89 r.Xmin := 0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 90 r.Xmax := 30;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 91 Meta.OffsetRect(r, 0, 50);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 92 END;
- 93 END;
- 94 ELSE
- 95 Meta.SetRect(r, 0, 0, 100, 100);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 96
- 97 FOR color := 0 TO max_colors DO
- 98 Meta.PenColor(color);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 99 Meta.PaintRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 100 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 101 Meta.FrameRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 102
- 103 Meta.MoveTo(r.Xmin + 49, r.Ymax + 35);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 104 Str.IntToStr(LONGINT(color), val, 10, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 105 Meta.DrawString(val);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 106
- 107 Meta.OffsetRect(r, 150, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 108
- 109 IF r.Xmax > 599 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 110 r.Xmin := 0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 111 r.Xmax := 100;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 112 Meta.OffsetRect(r, 0, 200);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 113 END
- 114 END
- 115 END
- 116 END draw_palette;
- ***** ^ not supported yet
- 117
- 118
- 119 (*** Check to see if thepoint is in one of the palette display boxes. ***)
- 120 (*** Returns the palette entry corresponding to that box, or -1 if not ***)
- 121 (*** in any box ***)
- 122
- 123 PROCEDURE check_palette(VAR thepoint: point): INTEGER;
- 124 VAR
- 125 color: INTEGER;
- 126 r: rect;
- 127 BEGIN
- 128
- 129 Meta.MoveTo(0, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 130
- 131 IF max_colors > 16 THEN
- 132 Meta.SetRect(r, 0, 0, 30, 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 133
- 134 FOR color := 0 TO max_colors DO
- 135 IF Meta.PtInRect(thepoint, r) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 136 RETURN color;
- 137 END;
- 138
- 139 Meta.OffsetRect(r, 40, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 140
- 141 IF r.Xmax > 640 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 142 r.Xmin := 0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 143 r.Xmax := 30;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 144 Meta.OffsetRect(r, 0, 50);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 145 END
- 146 END
- 147 ELSE
- 148 Meta.SetRect(r, 0, 0, 100, 100);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 149
- 150 FOR color := 0 TO max_colors DO
- 151 IF Meta.PtInRect(thepoint, r) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 152 RETURN color;
- 153 END;
- 154
- 155 Meta.OffsetRect(r, 150, 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 156 IF r.Xmax > 599 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 157 r.Xmin := 0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 158 r.Xmax := 100;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 159 Meta.OffsetRect(r, 0, 200);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 160 END
- 161 END
- 162 END;
- 163
- 164 RETURN -1;
- 165 END check_palette;
- ***** ^ not supported yet
- 166
- 167
- 168 PROCEDURE Insert(VAR S1: ARRAY OF CHAR; S2: ARRAY OF CHAR; Pos, Width: CARDINAL);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 169 VAR
- 170 L1, L2, i: CARDINAL;
- 171 BEGIN
- 172 L1 := HIGH(S1);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 173 L2 := Str.Length(S2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 174
- 175 IF (Pos + Width) > L1 THEN
- 176 RETURN
- 177 END;
- 178
- 179 IF L2 > Width THEN
- 180 RETURN
- 181 END;
- 182
- 183 FOR i := 0 TO L2 DO
- 184 S1[Pos + i] := S2[i];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 185 END;
- 186
- 187 FOR i := Pos + L2 TO Pos + Width DO
- 188 S1[i] := ' ';
- ***** ^ not supported yet
- ***** ^ not supported yet
- 189 END;
- 190 END Insert;
- ***** ^ not supported yet
- 191
- 192 (*** Fill the color mixing rectangle with color 'palval'. ***)
- 193
- 194 PROCEDURE draw_clr_rect(palval: CARDINAL);
- 195 VAR
- 196 color_rect: rect;
- 197 BEGIN
- 198 Meta.SetRect(color_rect, 0, 0, 100, 100);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 199 Meta.OffsetRect(color_rect, 725, 100);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 200 Meta.PenColor(palval);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 201 Meta.ProtectRect(color_rect);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 202 Meta.PaintRect(color_rect);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 203 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 204 Meta.FrameRect(color_rect);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 205 Meta.ProtectOff();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 206
- 207 Str.IntToStr(LONGINT(palval), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 208 Str.Append(val, ':');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 209 Insert(buf, val, 0, 24);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 210
- 211 IF paltype = 1 THEN (* analog palette *)
- 212 Str.IntToStr(LONGINT(palColors[0].palRed), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 213 Insert(buf, val, 6, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 214 Str.IntToStr(LONGINT(palColors[0].palGreen), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 215 Insert(buf, val, 12, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 216 Str.IntToStr(LONGINT(palColors[0].palBlue), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 217 Insert(buf, val, 18, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 218 ELSE
- 219 Insert(buf, val, 0, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 220 Str.IntToStr(LONGINT(palette[palval]), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 221 Insert(buf, val, 6, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 222 END;
- 223
- 224 buf[24] := CHR(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 225
- 226 Meta.MoveTo(650, 100 - 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 227 Meta.DrawString(buf);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 228 END draw_clr_rect;
- ***** ^ not supported yet
- 229
- 230
- 231 PROCEDURE draw_control(num:INTEGER);
- 232 VAR
- 233 r: rect;
- 234 i, x, y: INTEGER;
- 235 color: CHAR;
- 236 BEGIN
- 237
- 238 CASE num OF
- 239 | 0: x := 670; color := 'R';
- 240 | 1: x := 770; color := 'G';
- 241 | 2: x := 870; color := 'B';
- 242 ELSE
- 243 RETURN;
- 244 END;
- 245
- 246 y := 300;
- 247
- 248 (* draw scale *)
- 249 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 250 Meta.MoveTo(x, y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 251 Meta.LineRel(0, 500);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 252
- 253 Meta.MoveTo(x, y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 254 Meta.LineTo(x - 20, y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 255
- 256 Meta.MoveTo(x, y + 500);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 257 Meta.LineTo(x - 20, y + 500);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 258
- 259 FOR i := y TO y + 500 BY 20 DO
- 260 Meta.MoveTo(x, i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 261 Meta.LineTo(x - 10, i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 262 END;
- 263
- 264 (* draw 'R' 'G' or 'B' *)
- 265 Meta.MoveTo(x, y - 30);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 266 Meta.DrawChar(color);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 267
- 268 (* draw '+/-' control *)
- 269 INC(y, 520);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 270 Meta.SetRect(r, x - 30, y, x + 30, y + 50);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 271 Meta.FrameRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 272 Meta.MoveTo(x, y);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 273 Meta.LineTo(x, y + 50);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 274
- 275 Meta.MoveTo(r.Xmin + 5, y + 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 276 Meta.DrawChar('+');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 277
- 278 Meta.MoveTo(x + 5, y + 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 279 Meta.DrawChar('-');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 280 END draw_control;
- ***** ^ not supported yet
- 281
- 282 (*** Draw the control panel ***)
- 283
- 284 PROCEDURE draw_panel();
- 285 BEGIN
- 286 Meta.PenColor(GrConst.White);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 287
- 288 draw_control(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 289 draw_control(1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 290 draw_control(2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 291 draw_clr_rect(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 292 END draw_panel;
- ***** ^ not supported yet
- 293
- 294
- 295 (*** Draw a thermometer type indicator bar for control 'num'. ***)
- 296
- 297 PROCEDURE draw_indicator(num: CARDINAL);
- 298 VAR
- 299 x, y, i: CARDINAL;
- 300 r: rect;
- 301 BEGIN
- 302
- 303 x := 670 + 100 * num;
- 304 y := 300;
- 305
- 306 (* compute scale factor *)
- 307 i := CARDINAL(control[num] DIV 131); (* 0xFFFF / 500 appx := 131 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 308
- 309 (* fill on part *)
- 310 Meta.SetRect(r, x + 1, y + 500 - i, x + 10, y + 500);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 311 Meta.ProtectRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 312 Meta.PaintRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 313 Meta.ProtectOff();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 314
- 315 (* erase off part *)
- 316 Meta.SetRect(r, x + 1, y, x + 10, y + 500 - i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 317 Meta.ProtectRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 318 Meta.EraseRect(r);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 319 Meta.ProtectOff();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 320 END draw_indicator;
- ***** ^ not supported yet
- 321
- 322 (*** Check to see if thepoint is in one of the control knobs. Returns knob ***)
- 323 (*** number or -1 if not in any knob. ***)
- 324
- 325 PROCEDURE check_panel(VAR thepoint: point): INTEGER;
- 326 VAR
- 327 knob, x, y: INTEGER;
- 328 r: rect;
- 329 BEGIN
- 330 y := 300 + 520;
- 331
- 332 FOR knob := 0 TO 2 DO
- 333 x := 670 + 100 * knob;
- 334
- 335 Meta.SetRect(r, x - 30, y, x + 30, y + 50);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 336
- 337 IF (Meta.PtInRect(thepoint, r)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 338 r.Xmin := (r.Xmax + r.Xmin) DIV 2;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 339
- 340 IF Meta.PtInRect(thepoint, r) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 341 RETURN (knob * 2 + 1);
- 342 END;
- 343
- 344 RETURN (knob * 2);
- 345 END;
- 346 END;
- 347
- 348 RETURN -1;
- 349 END check_panel;
- ***** ^ not supported yet
- 350
- 351 (*** Analog palette version ***)
- 352
- 353 (*** For color number entry 'palval' change color register entry. ***)
- 354
- 355 PROCEDURE ANmix_color(palval: CARDINAL);
- 356 VAR
- 357 BEGIN
- 358 palColors[0].palRed := WORD(control[0]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 359 palColors[0].palGreen := WORD(control[1]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 360 palColors[0].palBlue := WORD(control[2]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 361
- 362 Meta.WritePalette(0, palval, palval, palColors);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 363
- 364 Str.IntToStr(LONGINT(palval), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 365 Str.Append(val, ':');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 366 Insert(buf, val, 0, 24);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 367 Str.IntToStr(LONGINT(palColors[0].palRed), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 368 Insert(buf, val, 6, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 369 Str.IntToStr(LONGINT(palColors[0].palGreen), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 370 Insert(buf, val, 12, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 371 Str.IntToStr(LONGINT(palColors[0].palBlue), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 372 Insert(buf, val, 18, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 373 buf[24] := CHR(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 374
- 375 Meta.MoveTo(650, 100 - 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 376 Meta.DrawString(buf);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 377 END ANmix_color;
- ***** ^ not supported yet
- 378
- 379 (*** Get color value of palval and set controls. ***)
- 380
- 381 PROCEDURE ANunmix_color(palval: CARDINAL);
- 382 BEGIN
- 383 Meta.ReadPalette(0, palval, palval, palColors);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 384 control[0] := LONGINT(palColors[0].palRed);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 385 control[1] := LONGINT(palColors[0].palGreen);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 386 control[2] := LONGINT(palColors[0].palBlue);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 387 END ANunmix_color;
- ***** ^ not supported yet
- 388
- 389 (* digital palette version *)
- 390
- 391 (*** For palette entry 'palval', mix the current control values per EGA, ***)
- 392 (*** store in palette array, and change hardware palette entry. ***)
- 393
- 394 PROCEDURE EGAmix_color(palval: CARDINAL);
- 395 VAR
- 396 red, green, blue, mix: WORD;
- ***** ^ undeclared identifier
- 397 paletteVals: ARRAY [0..0] OF WORD;
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- 398 BEGIN
- 399 red := WORD(control[0] DIV EGAADJUST);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 400 green := WORD(control[1] DIV EGAADJUST);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 401 blue := WORD(control[2] DIV EGAADJUST);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 402
- 403 mix := 0;
- ***** ^ not supported yet
- 404
- 405 IF INTEGER(BITSET(blue) * BITSET(0001H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 406 mix := BITSET(mix) + BITSET(0008H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 407 END;
- 408 IF INTEGER(BITSET(blue) * BITSET(0002H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 409 mix := BITSET(mix) + BITSET(0001H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 410 END;
- 411
- 412 IF INTEGER(BITSET(green) * BITSET(0001H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 413 mix := BITSET(mix) + BITSET(0010H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 414 END;
- 415 IF INTEGER(BITSET(green) * BITSET(0002H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 416 mix := BITSET(mix) + BITSET(0002H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 417 END;
- 418
- 419 IF INTEGER(BITSET(red) * BITSET(0001H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 420 mix := BITSET(mix) + BITSET(0020H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 421 END;
- 422 IF INTEGER(BITSET(red) * BITSET(0002H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 423 mix := BITSET(mix) + BITSET(0004H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 424 END;
- 425
- 426 Str.IntToStr(LONGINT(palval), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 427 Str.Append(val, ':');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 428 Insert(buf, val, 0, 24);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 429 Str.IntToStr(LONGINT(mix), val, 16, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 430 Insert(buf, val, 6, 6);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 431 buf[24] := CHR(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 432
- 433 Meta.MoveTo(650, 100 - 40);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 434 Meta.DrawString(buf);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 435
- 436 paletteVals[0] := mix;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 437 Meta.LoadPalette(palval, palval, paletteVals);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 438 END EGAmix_color;
- ***** ^ not supported yet
- 439
- 440 (*** Take color value of palval apart per EGA and set global control array ***)
- 441 (*** to its components. ***)
- 442
- 443 PROCEDURE EGAunmix_color(palval: CARDINAL);
- 444 VAR
- 445 red, green, blue, mix: WORD;
- ***** ^ undeclared identifier
- 446 BEGIN
- 447
- 448 red := 0;
- ***** ^ not supported yet
- 449 green := 0;
- ***** ^ not supported yet
- 450 blue := 0;
- ***** ^ not supported yet
- 451
- 452 mix := WORD(palette[palval]);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 453
- 454 IF INTEGER(BITSET(mix) * BITSET(0008H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 455 blue := BITSET(blue) + BITSET(0001H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 456 END;
- 457 IF INTEGER(BITSET(mix) * BITSET(0001H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 458 blue := BITSET(blue) + BITSET(0002H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 459 END;
- 460
- 461 IF INTEGER(BITSET(mix) * BITSET(0010H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 462 green := BITSET(green) + BITSET(0001H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 463 END;
- 464 IF INTEGER(BITSET(mix) * BITSET(0002H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 465 green := BITSET(green) + BITSET(0002H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 466 END;
- 467
- 468 IF INTEGER(BITSET(mix) * BITSET(0020H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 469 red := BITSET(red) + BITSET(0001H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 470 END;
- 471 IF INTEGER(BITSET(mix) * BITSET(0004H)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 472 red := BITSET(red) + BITSET(0002H);
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 473 END;
- 474
- 475 control[0] := LONGINT(red) * EGAADJUST;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 476 control[1] := LONGINT(green) * EGAADJUST;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 477 control[2] := LONGINT(blue) * EGAADJUST;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 478 END EGAunmix_color;
- ***** ^ not supported yet
- 479
- 480
- 481 PROCEDURE mix_color(palval: CARDINAL);
- 482 BEGIN
- 483 CASE paltype OF
- 484 | 1: ANmix_color(palval);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 485 | 2: EGAmix_color(palval);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 486 ELSE
- 487 GrQry.GrQuit('Device does not support a changeable color set', 1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 488 END;
- 489 END mix_color;
- ***** ^ not supported yet
- 490
- 491
- 492 PROCEDURE unmix_color(palval: CARDINAL);
- 493 BEGIN
- 494 CASE paltype OF
- 495 | 1: ANunmix_color(palval);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 496 | 2: EGAunmix_color(palval);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 497 ELSE
- 498 GrQry.GrQuit('Device does not support a changeable color set', 1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 499 END;
- 500 END unmix_color;
- ***** ^ not supported yet
- 501
- 502 (*** Load the specified font. ***)
- 503
- 504 PROCEDURE LoadFont(VAR fontName: ARRAY OF CHAR);
- ***** ^ not supported yet
- 505 VAR
- 506 Dir: GrConst.dirRec;
- ***** ^ not supported yet
- 507 qErr,
- 508 loadErr: INTEGER;
- 509 path: ARRAY[0..80] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 510 fontBuf: GrFonts.adsFont;
- ***** ^ not supported yet
- 511 BEGIN
- 512 Str.Copy(path, fontName);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 513 loadErr := -1; (* Preempt Error *)
- 514 qErr := Meta.FileQuery(path, Dir, 1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 515
- 516 IF (qErr # 1) THEN
- 517 (* No font file in default dir, try environment variable *)
- 518 Lib.EnvironmentFind("METAPATH", path);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 519
- 520 IF (path[0] # CHR(0)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 521 (* found the env parm, try using the path listed there *)
- 522
- 523 IF (path[Str.Length(path)] # '\') THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 524 (* If no trailing slash, add one *)
- 525 Str.Append(path, '\');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 526 END;
- 527
- 528 Str.Append(path, fontName);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 529 qErr := Meta.FileQuery(path, Dir, 1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 530 END;
- 531 END;
- 532
- 533 IF (qErr = 1) THEN
- 534 (* we got our file *)
- 535 ALLOCATE(ADDRESS(fontBuf), VAL(CARDINAL, Dir.fileSize + 1));
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 536
- 537 IF (fontBuf # NIL) THEN
- ***** ^ not supported yet
- 538 (* We got our memory *)
- 539 loadErr := Meta.FileLoad(path, ADDRESS(fontBuf), VAL(CARDINAL, Dir.fileSize+1));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 540 IF loadErr <= 0 THEN
- 541 DEALLOCATE(ADDRESS(fontBuf), VAL(CARDINAL, Dir.fileSize + 1));
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 542 END;
- 543 Meta.SetFont(ADDRESS(fontBuf));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 544 END;
- 545 END;
- 546
- 547 IF (loadErr > 0) THEN
- 548 (* clear out system load error *)
- 549 qErr := Meta.QueryError();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 550 ELSE
- 551 (* beep if font load probs *)
- 552 IO.WrChar(CHR(7));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 553 Str.Copy(fontName, 'Using internal SYSTEM08.FNT');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 554 END;
- 555 END LoadFont;
- ***** ^ not supported yet
- 556
- 557
- 558 BEGIN
- 559
- 560 (* init the system *)
- 561
- 562 GrQry.GrQuery(GrafixCard, CommPort);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 563
- 564 i := Meta.InitGrafix(-GrafixCard);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 565
- 566 IF (i # 0) THEN
- 567 (* Display reason for no go *)
- 568 GrQry.GrInitErr(GrafixCard, CommPort, i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 569 END;
- 570
- 571 (* Default EGA palette. *)
- 572
- 573 palette[0] := 0;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 574 palette[1] := 1;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 575 palette[2] := 2;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 576 palette[3] := 3;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 577 palette[4] := 4;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 578 palette[5] := 5;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 579 palette[6] := 14H;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 580 palette[7] := 7;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 581 palette[8] := 38H;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 582 palette[9] := 39H;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 583 palette[10] := 3AH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 584 palette[11] := 3BH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 585 palette[12] := 3CH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 586 palette[13] := 3DH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 587 palette[14] := 3EH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 588 palette[15] := 3FH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 589
- 590 Meta.SetDisplay(GrConst.GrafPg0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 591 Meta.InitMouse(CommPort);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 592 Meta.ScreenRect(scrnR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 593 Meta.LimitMouse(scrnR.Xmin, scrnR.Ymin, scrnR.Xmax, scrnR.Ymax);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 594
- 595 Meta.SetRect(scrnR, 0, 0, 1000, 1000);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 596 Meta.VirtualRect(scrnR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 597 Meta.EraseRect(scrnR);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 598
- 599 (* load the font *)
- 600 Meta.GetPort(thePort);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 601 i := thePort^.portBMap^.devClass;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 602
- 603 IF thePort^.portBMap^.pixPlanes > 1 THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 604 i := INTEGER(BITSET(i) * BITSET(0FFF8H));
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 605 END;
- 606
- 607 Str.Copy(fntpath, 'SYSTEM');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 608 Str.IntToStr(LONGINT(i), val, 10, OK);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 609 Str.Append(fntpath, val);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 610 Str.Append(fntpath, '.FNT');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 611
- 612 LoadFont(fntpath);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 613
- 614 max_colors := Meta.QueryColors();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 615
- 616 paltype := 0;
- 617
- 618 IF max_colors = 255 THEN
- 619 paltype := 1; (* Use analog palette routines *)
- 620 ELSIF GrafixCard = GrConst.EGA640x480 THEN (* this is a vga in 16 color modes *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 621 (* Use VGA 640x480 in analog mode *)
- 622 FOR i := 0 TO 15 DO
- 623 palette[i] := i; (* set array for vga stuff *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- 624 END;
- 625
- 626 Meta.LoadPalette(0, 15, palette); (* set digital palette *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 627
- 628 palColors[0].palRed := 0FFFFH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 629 palColors[0].palGreen := 0FFFFH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 630 palColors[0].palBlue := 0FFFFH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 631
- 632 Meta.WritePalette(0, 0FH, 0FH, palColors[0]); (* make sure white is set *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 633 paltype := 1; (* Use anlog palette routines *)
- 634 ELSIF thePort^.portBMap^.devType = 1 THEN (* EGA ?, not 640x480 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 635 paltype := 2; (* Use EGA palette routines *)
- 636 END;
- 637
- 638 (* draw the palette *)
- 639 draw_palette();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 640
- 641 (* draw the control panel *)
- 642 draw_panel();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 643
- 644 (* turn on cursor tracking *)
- 645 Meta.TrackCursor(TRUE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 646 Meta.ShowCursor();
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 647
- 648 (* turn on event system *)
- 649 Meta.EventQueue(TRUE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 650
- 651 (* start with palette entry 0 *)
- 652 selPalEntry := 0;
- 653 unmix_color(selPalEntry);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 654 draw_indicator(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 655 draw_indicator(1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 656 draw_indicator(2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 657 draw_clr_rect(selPalEntry);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 658
- 659 speed := 1; (* initialize the control speed *)
- 660 (* process events *)
- 661 LOOP
- 662 (* get an event *)
- 663 OK := Meta.KeyEvent(FALSE, myevent);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 664 cursor_pt.X := myevent.CursorX;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 665 cursor_pt.Y := myevent.CursorY;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 666
- 667 (* if we had a mouse event *)
- 668 IF OK & (myevent.ASCII = CHR(0)) & (myevent.ScanCode = BYTE(0)) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 669 (* right button is exit *)
- 670 IF INTEGER(BITSET(myevent.State) * BITSET(MOUSE_RIGHT)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 671 EXIT;
- 672 END;
- 673
- 674 (* left button is select *)
- 675 IF INTEGER(BITSET(myevent.State) * BITSET(MOUSE_LEFT)) # 0 THEN
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 676 (* clicked a palette box ? *)
- 677 i := check_palette(cursor_pt);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 678 IF (i >= 0) THEN
- 679 (* select palette entry for editing *)
- 680 selPalEntry := i;
- 681 unmix_color(selPalEntry);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 682 draw_indicator(0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 683 draw_indicator(1);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 684 draw_indicator(2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 685 draw_clr_rect(selPalEntry);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 686 ELSE
- 687 (* clicked a control ? *)
- 688 buttons := 1;
- 689
- 690 LOOP
- 691 i := check_panel(cursor_pt);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 692
- 693 IF (i < 0) OR (buttons = 0) THEN
- 694 EXIT;
- 695 END;
- 696 (* adjust selected control *)
- 697 CASE i OF
- 698 | 0: INC(control[0], LONGINT(speed)); i := 0;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 699 | 1: DEC(control[0], LONGINT(speed)); i := 0;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 700 | 2: INC(control[1], LONGINT(speed)); i := 1;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 701 | 3: DEC(control[1], LONGINT(speed)); i := 1;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 702 | 4: INC(control[2], LONGINT(speed)); i := 2;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 703 | 5: DEC(control[2], LONGINT(speed)); i := 2;
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 704 ELSE
- 705 i := 0;
- 706 END;
- 707
- 708 (* move fast or slow *)
- 709 IF speed < 7FFH THEN
- 710 INC(speed, 3FH);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 711 ELSE
- 712 speed := 7FFH; (* fast slow move *)
- 713 END;
- 714
- 715 (* keep in range *)
- 716 IF (control[i] > 0FFFFH) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 717 control[i] := 0FFFFH;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 718 END;
- 719 IF (control[i] < 0) THEN
- ***** ^ not supported yet
- ***** ^ not supported yet
- 720 control[i] := 0H;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 721 END;
- 722
- 723 (* update control indicator *)
- 724 draw_indicator(i);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 725
- 726 (* update the palette *)
- 727 mix_color(selPalEntry);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 728
- 729 (* read current cursor position *)
- 730 Meta.QueryCursor(x, y, curs, buttons);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 731 cursor_pt.X := x;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 732 cursor_pt.Y := y;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 733 END; (* end of while on a control *)
- 734 END;
- 735 END; (* end of if left button *)
- 736 END; (* end of if mouse event *)
- 737 IF (speed > 80H) THEN
- 738 DEC(speed, 7FH);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 739 ELSE
- 740 speed := 1; (* slow move *)
- 741 END;
- 742 END; (* end of while(True) *)
- 743
- 744 GrQry.GrQuit('', 0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 745 END ColorPal.
- 1003 errors
|