From: SMTP%"DSJ@WKUVX1.WKU.EDU" 7-FEB-1995 12:24:46.84 To: EVERHART CC: Subj: AUGUST94.GRAPHX X-FileServer: Digital Systems Journal File Server Date: Tue, 07 Feb 1995 11:24:40 CST Sender: DSJ-Mgr@WKUVX1.WKU.EDU Errors-To: DSJ-Mgr@WKUVX1.WKU.EDU Warnings-To: <> From: DSJ-Mgr@WKUVX1.WKU.EDU Reply-To: DSJ@WKUVX1.WKU.EDU Subject: AUGUST94.GRAPHX To: EVERHART@arisia.gce.com $! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))' $! $! This archive created: $! Name : GRAPHX $! By : Hunter Goatley $! Date : 11-AUG-1994 16:05:31.12 $! Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK $! $! Credit is due to these people for their original ideas: $! James Gray, Michael Bednarek $! $! To unpack this archive: $! Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required. $! Remove the headers of the first part, up to `cut here' line. $! Execute file as a command procedure. $! $! The following file(s) will be created after unpacking: $! 1. GRAPHX.DSJ;1 $! $ set="set" $ set symbol/scope=(nolocal,noglobal) $ f="SYS$SCRATCH:."+f$getjpi("","PID")+";" $ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ - f=f$parse("SHARE_UNPACK_TEMP",f) $ e="write sys$error ""%UNPACK"", " $ w="write sys$output ""%UNPACK"", " $ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!" $ if f$getsyi("CPU") .gt. 127 then $ goto start $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'" $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped" $ delete 'f'* $ exit $dirok: $ x=f$search(P1) $ if x .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped" $ delete 'f'* $ exit $file_absent: $ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks" $ n=P1 $ if P3 .nes. "" then $ n=f $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n' PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t, SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m; LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX( ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE; PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;c := SUBSTR(s,1,1);s := s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;CASE c FROM ' ' TO '`' ['`'] : COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[' ']: p:=p+1;[INRANGE,OUTRANGE] : COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;PROCEDURE Decode(b)LOCAL m; POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m); IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=1 THEN SkipPartSep;ELSE ProcessLine; MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);t:="0123456789ABCDEF";f:=GET_INFO( COMMAND_LINE,"file_name");o:=CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o, GET_INFO(COMMAND_LINE,"output_file"));QUIT; $ if p3 .eqs. "" then $ goto dl $ open/write fdl &f $ write fdl "RECORD" $ write fdl P3 $ close fdl $ w "-I-CONVRFM, Converting record format to ", P3 $ convert/fdl='f' 'f'-1 'f' $ fa=f$getdvi(f$parse(f),"ALLDEVNAM") $ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM") $ if fa .eqs. Pa then $ rename &f 'f$parse(P1)' $ if fa .nes. Pa then $ copy &f 'f$parse(P1)' $dl: delete 'f'* $ checksum 'P1' $ if checksum$checksum .nes. P2 then $ - e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ exit $ endsubroutine $start: $! $ create 'f' X`5Bfigure`201`5D X Xstatic`20Display`20*display`20=`20NULL; Xstatic`20Window`20window`20=`20NULL; Xstatic`20GC`20drawingAreaGC`20=`20NULL; Xstatic`20GC`20inverseDrawingGC`20=`20NULL; Xstatic`20Pixmap`20pixmapid`20=`20NULL; Xstatic`20unsigned`20long`20screen_width,`20screen_height; XXFontStruct`20*fontInfo; Xchar`20fontList`5B`5D`20=`20"-*-courier-*-*-normal--12-120-*-*-*-*-iso8859-1"; V X X....... X X/* X**++ X**`20`20FUNCTIONAL`20DESCRIPTION: X** X**`20`20`20`20`20`20initXDrawingInfo`20-`20This`20routine`20fetches`20all`20of V`20the`20extra X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20i Vnformation`20needed`20to`20use`20the`20Xlib`20routines. X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20I Vt`20also`20builds`20two`20Graphics`20Contexts`20(GCs)`20and X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20c Vreates`20a`20pixmap`20which`20will`20be`20used`20throughout X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20t Vhe`20program. X** X**`20`20FORMAL`20PARAMETERS: X** X**`20`20`20`20`20`20None X** X**`20`20RETURN`20VALUE: X** X**`20`20`20`20`20`20None X** X**`20`20SIDE`20EFFECTS: X** X**`20`20`20`20`20`20The`20following`20global`20variables`20are`20filled`20in: V X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20display X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20window X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20drawingAreaGC X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20inverseDrawingGC X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20pixmapid X** X**`20`20DESIGN: X** X**`20`20`20`20`20`20None X** X**-- X*/ Xvoid`20initXDrawingInfo`20(`20void`20) X`7B X`20`20`20`20`20`20`20`20XGCValues`20drawingAreaGCValues;`20`20/*`20Hold`20repl Vacement`20values`20for`20GC`20*/ X`20`20`20`20`20`20`20`20XtGCMask`20drawingAreaValueMask;`20`20/*`20Mask:`20whi Vch`20GC`20values`20to`20replace`20*/ X`20`20`20`20`20`20`20`20Pixel`20foreground,`20background;`20`20`20/*`20Color V`20*/ X`20`20`20`20`20`20`20`20int`20depth;`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20/*`20#`20of`20bits`20in`20index`20into`20Colormap`20*/ V X`20`20`20`20`20`20`20`20Screen`20*drawingScreen;`20`20`20`20`20`20`20`20`20`20 V/*`20Screen`20assoc`20with`20drawingArea`20*/ X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Fetch`20the`20display`20and`20the`20window`20as Vsociated`20with`20drawingArea. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20display`20=`20XtDisplay`20(`20widgetList`5B`20k_drawin VgArea`20`5D`20); X`20`20`20`20`20`20`20`20window`20=`20XtWindow`20(`20widgetList`5B`20k_drawingA Vrea`20`5D`20); X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Grab`20other`20values`20associated`20with`20the V`20drawingArea`20widget. X`20`20`20`20`20`20`20`20`20*`20First`20arg`20is`20the`20widget`20id.`20`20Each V`20pair`20after`20that`20indicates X`20`20`20`20`20`20`20`20`20*`20the`20Motif`20resource`20name`20followed`20by V`20a`20pointer`20to`20storage`20for X`20`20`20`20`20`20`20`20`20*`20the`20returned`20value.`20`20NULL`20arg`20termi Vnates`20the`20list. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20XtVaGetValues`20(`20widgetList`5B`20k_drawingArea`20 V`5D, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 VXmNscreen,`20`26drawingScreen,`20`20`20`20/*`20Screen`20info`20structure`20*/ V X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 VXmNdepth,`20`26depth,`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Depth`20of`20 Vcolormap`20idx`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 VXmNforeground,`20`26foreground,`20`20`20/*`20Foreground`20color`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 VXmNbackground,`20`26background,`20`20`20/*`20Background`20color`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 VNULL`20);`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V/*`20End`20or`20arg`20list`20*/ X X`20`20`20`20`20`20`20`20/*`20Fetch`20the`20font`20information`20structure`20fo Vr`20the`20font(s)`20in`20fontList.`20*/ X`20`20`20`20`20`20`20`20fontInfo`20=`20XLoadQueryFont`20(`20display,`20fontLis Vt`20); X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Fill`20in`20the`20mask`20with`20the`20values`20 Vwe`20will`20be`20changing`20(Foreground, X`20`20`20`20`20`20`20`20`20*`20Background,`20LineWidth,`20and`20Font).`20Then V`20move`20those`20values`20into X`20`20`20`20`20`20`20`20`20*`20The`20XGCValues`20structure.`20`20Call`20XtGetG VC`20to`20have`20the`20server`20find`20or X`20`20`20`20`20`20`20`20`20*`20create`20a`20shared`20GC`20for`20us. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20drawingAreaValueMask`20=`20GCForeground`20`7C`20GCBack Vground`20`7C`20GCLineWidth`20 X`7C`20GCFont; X`20`20`20`20`20`20`20`20drawingAreaGCValues.foreground`20=`20foreground; X`20`20`20`20`20`20`20`20drawingAreaGCValues.background`20=`20background; X`20`20`20`20`20`20`20`20drawingAreaGCValues.line_width`20=`201; X`20`20`20`20`20`20`20`20drawingAreaGCValues.font`20=`20fontInfo->fid; X`20`20`20`20`20`20`20`20drawingAreaGC`20=`20XtGetGC`20(`20widgetList`5B`20k_dr VawingArea`20`5D,`20`20/*`20Widget`20id`20 X*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20drawingAreaValueMask,`20`20`20`20`20`20`20`20`20/*`20V Values`20to`20change X*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`26drawingAreaGCValues`20);`20`20`20`20`20`20`20/*`20X VGCValues`20struct X*/ X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Now,`20fill`20in`20the`20mask`20to`20indicate V`20we`20are`20altering`20the`20defaults X`20`20`20`20`20`20`20`20`20*`20for`20Foreground,`20Background,`20and`20Font. V`20`20Then`20move`20the`20new`20values X`20`20`20`20`20`20`20`20`20*`20into`20the`20XGCValues`20structure`20(note`20th Ve`20swap`20of`20Foreground`20and X`20`20`20`20`20`20`20`20`20*`20Background`20color).`20`20Then`20call`20XtGetGC V`20to`20have`20the`20server`20find`20or X`20`20`20`20`20`20`20`20`20*`20create`20a`20second`20shared`20GC`20for`20us. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20drawingAreaValueMask`20=`20GCForeground`20`7C`20GCBack Vground`20`7C`20GCFont; X`20`20`20`20`20`20`20`20drawingAreaGCValues.foreground`20=`20background; X`20`20`20`20`20`20`20`20drawingAreaGCValues.background`20=`20foreground; X`20`20`20`20`20`20`20`20drawingAreaGCValues.font`20=`20fontInfo->fid; X`20`20`20`20`20`20`20`20inverseDrawingGC`20=`20XtGetGC`20(`20widgetList`5B`20k V_drawingArea`20`5D,`20`20/*`20Widget`20 Xid`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20drawingAreaValueMask,`20`20/*`20Values`20to V`20change*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`26drawingAreaGCValues`20);`20/*`20XGCValues V`20struct*/ X X`20`20`20`20`20`20`20`20/*`20Use`20Xlib`20macros`20to`20find`20the`20width`20a Vnd`20height`20of`20the`20screen.`20*/ X`20`20`20`20`20`20`20`20screenWidth`20=`20WidthOfScreen`20(`20drawingScreen`20 V); X`20`20`20`20`20`20`20`20screenHeight`20=`20HeightOfScreen`20(`20drawingScreen V`20); X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Create`20a`20pixmap`20to`20be`20used`20by`20the V`20Xlib`20drawing`20routines. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20pixmapid`20=`20XCreatePixmap`20(`20display,`20`20`20 V`20/*`20Display`20info`20struct*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20RootWindowOfScreen`20(`20drawingScreen`20), X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Window`20t Vo`20assoc`20pixmap`20with`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20screenWidth,`20/*`20Max`20width`20of`20pixmap`20`20 V`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20screenHeight,`20/*`20Max`20height`20of`20pixmap`20* V/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20depth`20);`20`20`20`20`20`20/*`20#`20of`20bits`20in V`20colormap`20index`20`20*/ X`20`20`20`20`20`20`20`20XFillRectangle`20(`20display,`20`20`20`20`20`20`20`20 V`20`20`20`20/*`20Display`20information`20structure`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20pix Vmapid,`20`20`20`20`20`20`20`20`20`20`20/*`20Drawable`20(use`20the`20pixmap)`20 V*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20inv VerseDrawingGC,`20/*`20GC`20(use`20inverseDrawingGC`20to`20erase)`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`200, V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20X`20Ori Vgin`20coordinate*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`200, V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Y`20Ori Vgin`20coordinate*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20scr VeenWidth,`20`20`20`20`20`20`20`20`20`20`20`20/*`20Width`20of`20rectangle`20*/ V X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20scr VeenHeight`20);`20`20`20`20`20`20`20`20`20/*`20Height`20of`20rectangle`20*/ X`7D X X X= X X`5BFigure`203`5D X Xtypedef`20struct`20`7B X`20`20`20`20`20`20`20`20short`20x,`20y;`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20/*`20X,`20Y`20coordinate`20of`20the`20point`20*/ X`7D`20XPoint; X Xtypedef`20struct`20`7B X`20`20`20`20`20`20`20`20short`20x,`20y;`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20/*`20X,`20Y`20coordinate`20of`20the`20upper`20left`20c Vorner Xof`20rectangle`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20unsigned`20short`20width,`20height;`20`20`20/*`20Width V`20and`20height`20of`20the`20rectangle`20*/ X`7D`20XRectangle; X Xtypedef`20struct`20`7B X`20`20`20`20`20`20`20`20short`20`20`20x1,`20y1,`20`20`20`20`20`20`20`20`20/* V`20X,`20Y`20coordinate`20of`20starting`20point`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20x2,`20y2;`20`20`20`20`20`20`20 V`20`20/*`20X,`20Y`20coordinate`20of`20ending`20point`20*/ X`7D`20XSegment; X Xtypedef`20struct`20`7B X`20`20`20`20`20`20`20`20short`20x,`20y;`20`20/*`20X,`20Y`20coordinate`20of`20u Vpper`20left`20corner`20of`20bounding`20 Xrectangle*/ X`20`20`20`20`20`20`20`20unsigned`20short`20width,`20height;`20`20`20/*`20Width V`20and`20height`20of`20bounding`20 Xrectangle`20*/ X`20`20`20`20`20`20`20`20short`20angle1,`20angle2;`20`20`20`20`20`20`20`20`20 V`20`20/*`20angle1`20is`20the`20start`20angle`20in`2064ths`20of`20a`20*/ X X X X X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20/*`20degree`20starting`20from`20the`203`20O'Clock`20position V.`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20/*`20angle2`20is`20the`20ending`20angle`20relative`20to`20*/ V X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20/*`20angle1`20(positive`20angle`20is`20counterclockwise).`20 V*/ X`7D`20XArc; X X= X X`5Bfigure`204`5D X Xunsigned`20int`20interLineGap`20=`202;`20`20`20`20`20`20`20`20`20`20/*`20Small V`20vertical`20gaps`20between`20text`20lines`20 X*/ X X/* X**++ X**`20`20FUNCTIONAL`20DESCRIPTION: X** X**`20`20`20`20`20`20drawLineDesign`20-`20This`20routine`20does`20the`20work`20 Vof`20drawing`20the X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20spirograph-like`20design.`20`20The`20design`20drawn X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20uses`20all`20straight-line`20graphics.`20`20The`20image X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20is`20drawn`20in`20both`20the`20DrawingArea`20window`20and X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20the`20pixmap. X** X**`20`20FORMAL`20PARAMETERS: X** X**`20`20`20`20`20`20radians: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Number`20of`20radians`20to`20do`20 Vcomputation`20for X** X**`20`20`20`20`20`20step: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Interval`20at`20which`20to`20compu Vte`20functions X** X**`20`20`20`20`20`20scaleFactor: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Factor`20for`20sizing`20the`20desi Vgn X** X**`20`20`20`20`20`20maxVarianceX: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Maximum`20amount`20to`20add`20or V`20subtract`20to/from`20scaleFactor X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20on`20computations`20for`20x`20coor Vdinate. X** X**`20`20`20`20`20`20maxVarianceY: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Maximum`20amount`20to`20add`20or V`20subtract`20to/from`20scaleFactor X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20on`20computations`20for`20y`20coor Vdinate. X** X**`20`20`20`20`20`20deltaVarianceX: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Amount`20to`20add`20or`20subtract V`20to/from`20current`20x`20variance`20on X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20each`20iteration. X** X**`20`20`20`20`20`20deltaVarianceY: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Amount`20to`20add`20or`20subtract V`20to/from`20current`20y`20variance`20on X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20each`20iteration. X** X**`20`20RETURN`20VALUE: X** X**`20`20`20`20`20`20None X** X**`20`20SIDE`20EFFECTS: X** X**`20`20`20`20`20`20Image`20is`20drawn`20in`20DrawingArea`20and`20off-screen V`20pixmap. X** X**`20`20DESIGN: X** X**`20`20`20`20`20`20None X** X** X** X**-- X*/ Xvoid`20drawLineDesign`20(`20long`20radians, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20step, V X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20scale VFactor, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20maxVa VrianceX, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20maxVa VrianceY, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20delta VVarianceX, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20delta VVarianceY`20) X`7B X`20`20`20`20`20`20`20`20int`20currentRadian; X`20`20`20`20`20`20`20`20int`20previousX, X`20`20`20`20`20`20`20`20`20`20`20`20previousY, X`20`20`20`20`20`20`20`20`20`20`20`20currentX, X`20`20`20`20`20`20`20`20`20`20`20`20currentY; X`20`20`20`20`20`20`20`20Dimension`20width, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20height; X`20`20`20`20`20`20`20`20unsigned`20long`20localWidth, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20localHeight; V X`20`20`20`20`20`20`20`20long`20currentVarianceX; X`20`20`20`20`20`20`20`20long`20currentVarianceY; X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Temporary`20string`20storage`20for`20descriptiv Ve`20strings`20to`20be X`20`20`20`20`20`20`20`20`20*`20printed`20above`20design. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20char`20tempString1`5B`20LARGE_BUF_SIZE`20`5D, X`20`20`20`20`20`20`20`20`20`20`20`20`20tempString2`5B`20LARGE_BUF_SIZE`20`5D, V X`20`20`20`20`20`20`20`20`20`20`20`20`20tempString3`5B`20LARGE_BUF_SIZE`20`5D; V X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Text`20length`20variables`20to`20compute`20x`20 Voffset`20for`20centering`20of`20the X`20`20`20`20`20`20`20`20`20*`20descriptive`20text`20strings. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20unsigned`20int`20textLength, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength1, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength2, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength3, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textHeight; X`20`20`20`20`20`20`20`20unsigned`20int`20tempYTextPos`20=`200; X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Fetch`20the`20current`20width`20and`20height`20 Vof`20the`20drawingArea.`20`20Then, X`20`20`20`20`20`20`20`20`20*`20copy`20them`20to`20unsigned`20longs`20for`20use V`20later`20in`20XDraw`20routines. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20XtVaGetValues`20(`20widgetList`5B`20k_drawingArea`20 V`5D, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XmNwid Vth,`20`26width, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XmNhei Vght,`20`26height, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20NULL V`20); X`20`20`20`20`20`20`20`20currentWidth`20=`20width; X`20`20`20`20`20`20`20`20currentHeight`20=`20height; X`20`20`20`20`20`20`20`20localWidth`20=`20width; X`20`20`20`20`20`20`20`20localHeight`20=`20height; X X`20`20`20`20`20`20`20`20/*`20Erase`20any`20old`20drawings`20*/ X`20`20`20`20`20`20`20`20clearDrawingArea`20(); X X`20`20`20`20`20`20`20`20/*`20Initialize`20the`20scale`20factor`20variance`20fo Vr`20X`20and`20Y`20coordinates`20*/ X`20`20`20`20`20`20`20`20currentVarianceX`20=`20maxVarianceX; X`20`20`20`20`20`20`20`20currentVarianceY`20=`20maxVarianceY; X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Compute`20the`20first`20X`20and`20Y`20coordinat Ves`20and`20draw`20the`20point X`20`20`20`20`20`20`20`20`20*`20in`20both`20the`20drawingArea`20window`20and`20 Vthe`20offscreen`20Pixmap. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20previousX`20=`20(`20sin`20(`20(double)`200.0`20)`20) V`20*`20(`20scaleFactor`20+`20currentVarianceX`20)`20+ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20localWidth`20/`202 V; X`20`20`20`20`20`20`20`20previousY`20=`20(`20cos`20(`20(double)`200.0`20)`20) V`20*`20(`20scaleFactor`20+`20currentVarianceY`20)`20 X+ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20localHeight`20/`20 V2; X`20`20`20`20`20`20`20`20XDrawPoint`20(`20display,`20`20`20`20`20`20`20`20`20 V`20`20/*`20Display`20(Server`20info`20structure)`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20window,`20`20 V`20`20`20`20`20`20`20`20`20`20/*`20Window`20associated`20with`20drawingArea`20 V`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20drawingAreaGC, V`20`20`20`20`20/*`20Graphics`20context`20to`20use`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousX,`20 V`20`20`20`20`20`20`20`20/*`20X`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousY`20); V`20`20`20`20`20`20`20/*`20Y`20coordinate`20of`20point`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20XDrawPoint`20(`20display,`20`20`20`20`20`20`20`20`20 V`20`20/*`20Display`20(Server`20info`20structure`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20pixmapid,`20`20 V`20`20`20`20`20`20`20`20/*`20Pixmap`20in`20which`20to`20draw`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20drawingAreaGC, V`20`20`20`20`20/*`20Graphics`20context`20to`20use`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousX,`20 V`20`20`20`20`20`20`20`20/*`20X`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousY`20); V`20`20`20`20`20`20`20/*`20Y`20coordinate`20of`20point`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20*/ X`20 X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20For`20each`20point`20in`20the`20requested`20ran Vge: X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Compute`20new`20point`20coordina Vtes X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Adjust`20the`20scale`20factor`20 Vvariance`20for`20X`20and`20Y X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20`20Draw`20from`20current`20locat Vion`20to`20the`20newly`20computed`20point X X X X X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20`20Flush`20the`20display`20to`20 Vprovide`20timely`20updates X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20`20Save`20new`20point`20as`20pre Vvious`20point X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20for`20(`20currentRadian`20=`200;`20currentRadian`20`7E V`7E`20radians;`20currentRadian`20+=`20 Xstep`20) X`20`20`20`20`20`20`20`20`7B X....... X X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20Draw`20to`20the`20new V`20X,Y`20point`20in`20both`20the`20window`20and`20the`20pixmap. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XDrawLine`20(`20display,`20`20 V`20`20`20`20`20/*`20Display`20information`20structure`20`20`20`20`20`20`20`20* V/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20window,`20`20`20`20`20`20`20`20/*`20Window`20in`20which`20to`20draw`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20drawingAreaGC,`20/*`20GC`20to`20use`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20previousX,`20`20`20`20`20/*`20Starting`20point,`20X`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20previousY,`20`20`20`20`20/*`20Starting`20point,`20Y`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20currentX,`20`20`20`20`20`20/*`20Ending`20point,`20X`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20currentY`20);`20`20`20`20/*`20Ending`20point,`20Y`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XDrawLine`20(`20display,`20`20 V`20`20`20`20`20/*`20Display`20information`20structure`20`20`20`20`20`20`20`20* V/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20pixmapid,`20`20`20`20`20`20/*`20Pixmap`20in`20which`20to`20draw`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20drawingAreaGC,`20/*`20GC`20to`20use`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20previousX,`20`20`20`20`20/*`20Starting`20point,`20X`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20previousY,`20`20`20`20`20/*`20Starting`20point,`20Y`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20currentX,`20`20`20`20`20`20/*`20Ending`20point,`20X`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20currentY`20);`20`20`20`20/*`20Ending`20point,`20Y`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XFlush`20(`20display`20);`20 V`20`20`20`20`20`20`20/*`20Bring`20server's`20screen`20up`20to`20date`20`20`20 V`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/*`20Save`20the`20new`20X`20an Vd`20Y`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousX`20=`20currentX; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20previousY`20=`20currentY; X`20`20`20`20`20`20`20`20`7D X....... X`7D X X/* X**++ X**`20`20FUNCTIONAL`20DESCRIPTION: X** X**`20`20`20`20`20`20drawArcDesign`20-`20This`20routine`20does`20the`20work`20o Vf`20drawing`20the X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20spirograph-like`20design.`20`20The`20design`20drawn X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20uses`20all`20arcs`20to`20form`20the`20image.`20`20The`20image X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20is`20drawn`20in`20both`20the`20DrawingArea`20window`20and X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20the`20pixmap. X** X**`20`20FORMAL`20PARAMETERS: X** X**`20`20`20`20`20`20radians: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Number`20of`20radians`20to`20do`20 Vcomputation`20for X** X**`20`20`20`20`20`20step: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Interval`20at`20which`20to`20compu Vte`20functions X** X**`20`20`20`20`20`20scaleFactor: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Factor`20for`20sizing`20the`20desi Vgn X** X**`20`20`20`20`20`20maxVarianceX: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Maximum`20amount`20to`20add`20or V`20subtract`20to/from`20scaleFactor X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20on`20computations`20for`20x`20coor Vdinate. X** X**`20`20`20`20`20`20maxVarianceY: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Maximum`20amount`20to`20add`20or V`20subtract`20to/from`20scaleFactor X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20on`20computations`20for`20y`20coor Vdinate. X** X**`20`20`20`20`20`20deltaVarianceX: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Amount`20to`20add`20or`20subtract V`20to/from`20current`20x`20variance`20on X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20each`20iteration. X** X**`20`20`20`20`20`20deltaVarianceY: X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20Amount`20to`20add`20or`20subtract V`20to/from`20current`20y`20variance`20on X**`20`20`20`20`20`20`20`20`20`20`20`20`20`20each`20iteration. X** X**`20`20RETURN`20VALUE: X** X**`20`20`20`20`20`20None X** X**`20`20SIDE`20EFFECTS: X** X**`20`20`20`20`20`20The`20image`20is`20drawn`20in`20both`20the`20DrawingArea V`20and`20the`20off-screen`20 Xpixmap. X** X**`20`20DESIGN: X** X**`20`20`20`20`20`20None X** X**-- X*/ Xvoid`20drawArcDesign`20(`20long`20radians, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20step, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20scaleFac Vtor, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20maxVaria VnceX, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20maxVaria VnceY, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20deltaVar VianceX, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20long`20deltaVar VianceY`20) X`7B X`20`20`20`20`20`20`20`20int`20currentRadian; X`20`20`20`20`20`20`20`20int`20currentX,`20currentY; X`20`20`20`20`20`20`20`20Dimension`20width,`20height; X`20`20`20`20`20`20`20`20unsigned`20long`20localWidth,`20localHeight; X`20`20`20`20`20`20`20`20unsigned`20long`20halfWidth,`20halfHeight; X`20`20`20`20`20`20`20`20long`20currentVarianceX; X`20`20`20`20`20`20`20`20long`20currentVarianceY; X`20`20`20`20`20`20`20`20long`20startAngle, X`20`20`20`20`20`20`20`20`20`20`20`20`20incrAngle`20=`205760;`20`20/*`20Always V`20use`2090`20degrees`20of`20Arc`20*/ X`20`20`20`20`20`20`20`20const`20static`20long`20angle90`20=`205760,`20`20`20 V`20`20`20`20/*`2090`20degrees`20*`2064`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 Vangle180`20=`2011520,`20`20`20`20`20/*`20180`20degrees`20*`2064`20`20`20`20`20 V*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 Vangle270`20=`2017280;`20`20`20`20`20/*`20270`20degrees`20*`2064`20`20`20`20`20 V*/ X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Temporary`20string`20storage`20for`20descriptiv Ve`20strings`20to`20be X`20`20`20`20`20`20`20`20`20*`20printed`20above`20design. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20char`20tempString1`5B`20LARGE_BUF_SIZE`20`5D, X`20`20`20`20`20`20`20`20`20`20`20`20`20tempString2`5B`20LARGE_BUF_SIZE`20`5D, V X`20`20`20`20`20`20`20`20`20`20`20`20`20tempString3`5B`20LARGE_BUF_SIZE`20`5D; V X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Text`20length`20variables`20to`20compute`20x`20 Voffset`20for`20centering`20of`20the X`20`20`20`20`20`20`20`20`20*`20descriptive`20text`20strings. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20unsigned`20int`20textLength, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength1, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength2, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textLength3, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20textHeight; X`20`20`20`20`20`20`20`20unsigned`20int`20tempYTextPos`20=`200; X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Fetch`20the`20current`20width`20and`20height`20 Vof`20the`20drawingArea.`20`20Then, X`20`20`20`20`20`20`20`20`20*`20copy`20them`20to`20unsigned`20longs`20for`20use V`20later`20in`20XDraw`20routines. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20XtVaGetValues`20(`20widgetList`5B`20k_drawingArea V`20`5D, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XmN Vwidth,`20`26width, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XmN Vheight,`20`26height, X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20NUL VL`20); X`20`20`20`20`20`20`20`20currentWidth`20=`20width; X`20`20`20`20`20`20`20`20currentHeight`20=`20height; X`20`20`20`20`20`20`20`20localWidth`20=`20width; X`20`20`20`20`20`20`20`20localHeight`20=`20height; X`20`20`20`20`20`20`20`20halfWidth`20=`20width`20/`202; X`20`20`20`20`20`20`20`20halfHeight`20=`20height`20/`202; X X`20`20`20`20`20`20`20`20/*`20Erase`20any`20old`20drawings`20*/ X`20`20`20`20`20`20`20`20clearDrawingArea`20(); X X`20`20`20`20`20`20`20`20/*`20Initialize`20the`20scale`20factor`20variance`20fo Vr`20X`20and`20Y`20coordinates`20*/ X`20`20`20`20`20`20`20`20currentVarianceX`20=`20maxVarianceX; X`20`20`20`20`20`20`20`20currentVarianceY`20=`20maxVarianceY; X X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20Compute`20the`20first`20X`20and`20Y`20coordinat Ves`20and`20draw`20the`20point X`20`20`20`20`20`20`20`20`20*`20in`20both`20the`20drawingArea`20window`20and`20 Vthe`20offscreen`20Pixmap. X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20currentX`20=`20(`20sin`20(`20(double)`200.0`20)`20)`20 V*`20(`20scaleFactor`20+`20currentVarianceX`20)`20+ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20halfWidth; X`20`20`20`20`20`20`20`20currentY`20=`20(`20cos`20(`20(double)`200.0`20)`20)`20 V*`20(`20scaleFactor`20+`20currentVarianceY`20)`20+ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20halfHeight; X X`20`20`20`20`20`20`20`20XDrawPoint`20(`20display,`20`20`20`20`20`20`20`20`20 V`20`20/*`20Display`20(Server`20info`20structure)`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20window,`20`20 V`20`20`20`20`20`20`20`20`20`20/*`20Window`20associated`20with`20drawingArea`20 V`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20drawingAreaGC, V`20`20`20`20`20/*`20Graphics`20context`20to`20use`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20currentX,`20`20 V`20`20`20`20`20`20`20`20/*`20X`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20currentY`20); V`20`20`20`20`20`20`20`20/*`20Y`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20XDrawPoint`20(`20display,`20`20`20`20`20`20`20`20`20 V`20`20/*`20Display`20(Server`20info`20structure`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20pixmapid,`20`20 V`20`20`20`20`20`20`20`20/*`20Pixmap`20in`20which`20to`20draw`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20drawingAreaGC, V`20`20`20`20`20/*`20Graphics`20context`20to`20use`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20currentX,`20`20 V`20`20`20`20`20`20`20`20/*`20X`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20currentY`20); V`20`20`20`20`20`20`20`20/*`20Y`20coordinate`20of`20point`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20 X`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20*`20For`20each`20point`20in`20the`20requested`20ran Vge: X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Compute`20new`20point`20coordina Vtes X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Adjust`20the`20scale`20factor`20 Vvariance`20for`20X`20and`20Y X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Draw`20a`2090`20degree`20arc`20f Vrom`20current`20location`20in`20a X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20`20`20`20`20`20`20`20`20directio Vn`20determined`20by`20the`20points`20location`20and X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20`20`20`20`20`20`20`20`20of`20a V`20size`20determined`20by`20the`20maximum`20scale`20factor`20variance. X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Flush`20the`20display`20to`20pro Vvide`20timely`20updates X`20`20`20`20`20`20`20`20`20*`20`20`20`20`20`20Save`20new`20point`20as`20previo Vus`20point X`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20for`20(`20currentRadian`20=`200;`20`20currentRadian`20 V`7E`7E`20radians;`20`20currentRadian`20+=`20 Xstep`20) X`20`20`20`20`20`20`20`20`7B X. X. X. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20Determine`20starting`20 Vangle.`20`20Do`20this`20by`20noting`20which`20quadrant`20the X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20point`20is`20in`20relat Vive`20to`20the`20center`20of`20the`20design.`20`20This`20starting X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20angle`20determines`20th Ve`20direction`20the`20curve`20will`20take. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20if`20(`20(`20currentX`20>=`20h ValfWidth`20)`20`26`26`20(`20currentY`20>=`20halfHeight`20)`20) X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`7B X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20startA Vngle`20=`200; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`7D`20else`20if`20(`20(`20curr VentX`20>=`20halfWidth`20)`20`26`26`20(`20currentY`20`7E`7E`20halfHeight`20)`20 V) X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`7B X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20startAngle`20=`20angle90; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`7D`20 Velse`20if`20(`20(`20currentX`20`7E`7E`20halfWidth`20)`20`26`26`20(`20currentY V`20`7E`7E`20`20`20`20`20`20`20 X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20halfHe Vight`20)`20) X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`7B X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20startAngle`20=`20angle180; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`7D`20else X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`7B X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20startAngle`20=`20angle270; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`7D; X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20/* X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20Draw`20the`20computed V`20Arc`20in`20both`20the`20window`20and`20the`20off-screen X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*`20pixmap. X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XDrawArc`20(`20display,`20`20 V`20`20`20`20`20`20`20`20/*`20Display`20information`20structure`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20window,`20`20`20`20`20`20`20`20`20`20`20/*`20Window`20in`20which`20to`20dra Vw`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20drawingAreaGC,`20`20`20`20/*`20GC`20to`20use`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20currentX,`20`20`20`20`20`20`20`20`20/*`20Starting`20point,`20X`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20currentY,`20`20`20`20`20`20`20`20`20/*`20Starting`20point,`20Y`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20maxVarianceX,`20`20`20`20`20/*`20Width`20of`20bounding`20box`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20maxVarianceY,`20`20`20`20`20/*`20Height`20of`20bounding`20box`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20startAngle,`20`20`20`20`20/*`20Start`20angle`20(relative`20to`203`20O'Clock V)*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20incrAngle`20);`20`20`20`20/*`20End`20angle`20(relative`20to`20start`20angle V)`20*/ X X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20XDrawArc`20(`20display,`20`20 V`20`20`20`20`20`20/*`20Display`20information`20structure`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20pixmapid,`20`20`20`20`20`20`20/*`20Pixmap`20in`20which`20to`20draw`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20drawingAreaGC,`20`20/*`20GC`20to`20use`20`20`20`20`20`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20currentX,`20`20`20`20`20`20`20/*`20Starting`20point,`20X`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20currentY,`20`20`20`20`20`20`20/*`20Starting`20point,`20Y`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20maxVarianceX,`20`20`20/*`20Width`20of`20bounding`20box`20`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20maxVarianceY,`20`20`20/*`20Height`20of`20bounding`20box`20`20`20`20`20`20 V`20`20`20`20`20`20`20`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20startAngle,`20`20`20`20`20/*`20Start`20angle`20(relative`20to`203`20O'Clock V)`20`20*/ X`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20 V`20incrAngle`20);`20`20`20`20/*`20End`20angle`20(relative`20to`20start`20angle V)`20`20*/ X`20`20`20`20`20`20`20`20`7D X. X. X. X`7D X X $ call unpack GRAPHX.DSJ;1 1213154143 "" 44 1 1 $ v=f$verify(v) $ exit