CHAPTER19INTERLISP-DDISPLAYFACILITIESThischapterdescribesthefunctionsthatsupportthedisplayandtheinteractionwithprogramsthatusethedisplay.First,abriefintroductoryviewofusingtheInterlisp-DdisplayandhowsomeoftheotherInterlispfacilitieshavebeenextendedtoincludedisplayinterfaces.ThetwoscreenimagesatleftshowsomeofthedisplayfeaturesasusedbyexploratoryprogrammingtoolsoftheInterlisp-Denvironment.Thescreenisdividedintoseveralrectangularareasorwindows,eachofwhichprovidesaviewontosomedataorprocessandwhichcanbereshapedandrepositionedatwillbytheuser.Whentheyoverlap,theoccludedportionofthelowerwindowisautomaticallysaved,sothatitcanberestoredwhentheoverlappingwindowisremoved.Sincethedisplayisbitmapped,eachwindowcancontainanarbitrarymixtureoftext,lines,curves,andhalf-toneandsolidareaimages.Thetypescriptwindowisintheupperleftcornerofthescreen.Itcorrespondstotheoutputchannel.Init,theuserhasdenedaprogram(factorial)andhasthenimmediatelyrunit,givinganinputof4andgettingaresultof24.Next,hequeriesthestateofhislesusingthelepackagefunction,ndingthatonelehasbeenchanged(previously)andonefunction()hasbeendenedbutnotassociatedwithanyleyet.Theusersetsthevalueofto0incommand74,andthesystemnotesthatthisisachangeandaddstothesetof``changedobjects''thatmightneedtobesaved.Then,theuserrunshisprogram,givingitaparsetreeforthesentence``Myuncle'sstoryaboutthewarwillboreyoutotears''.Thisopensupthebigwindowontherightinwhichthesentencediagramisdrawn.Usingthemouse,theuserstartstomovethenodeontheleft(whichisinvertedtoshowthatitisbeingmoved).Whilethemoveistakingplace,theuserinterruptsthetreeeditorusingControl-H,whichsuspendsthecomputationandcausesthree``break''windowstoappearontopoftheloweredgeofthetypescript.Thesearepartofthewindowbreakpackage.Thesmallestwindowshowsthedynamicstateofthecomputation,whichhasbeenbrokeninsideasubprogramcalled.Thewindowtotherightshowsthevalueofthelocalvariablesboundby.Oneofthemhasbeenselected(andsoappearsinverted)andinresponse,itsvaluehasbeenshowninmoredetailinthewindowatthelowerleftofthescreen.Theuserhasmarkedoneofthecomponentvaluesassuspiciousbydrawingonitusingthewindowcommand.Inaddition,hehasaskedtoexaminethecontentsofthecomponent,whichusedthefunctiontoopenabitmapeditwindowtotheright.Thisshowsanenlargedcopyoftheactualimagethatisbeingmovedbythetreeeditor.Insidethelargestbreakwindow,theuserhasaskedsomequestionsabout,andqueriedthevalueof(now66).Usingthelispuserspackage,theMasterscopecommandbroughtupthehorizontaltreediagramontheleft,whichshowswhichsubprogramscalleachother,startingat.Eachnodeinthecalltreeproducedbythecommandisanactiveelementwhichwillrespondtotheuser'sselectingitwiththemouse.Inthesecondimage,theuserhasselectedthesubprogram,whichhascauseditscodetoberetrievedfromthele()ontheremoteleserver()whereitwasstoredanddisplayedinthe``Browserprintoutwindow''whichhasbeenopenedatmiddleright.UserprogramsandextendedLispforms(likeforanddo)arehighlightedbysystemgeneratedfontchanges.Byselectingnodesinthewindow,theusercouldalsohaveeditedorobtainedasummarydescriptionofanyofthe19.1TFFILES?FDRAWBETWEENDRAWBETWEENEDITTREENPFOLLOW/CURSOR"FOLLOW/CURSORFrame"FOLLOW/CURSORPAINTBITMAPEDITBMNPFOLLOW/CURSORDRAWBETWEENBROWSERSHOWPATHSFOLLOW/CURSORSHOWPATHSSHOWNODEDEMO>LATTICERPHYLUMSHOWPATHS|\%L,V %'*- xO  P S#((9*/X24~ ;\>~DGjM  TO !%&*y, 2J38;p>|BCFALS n ,!#@(), 369S=B1CFXJ  W " *+ 26(7:a ?A I  <!j %(*035h9f>@C,FMGb  %(Z 0K2469d=>AsDE  kZU.$&j .3@5$89<2>CCGD 1"R$)~* 2E5:=SB>D=Bq \!i$'6*-z?k  ?H"c$)X++-24@ ;=@7D=  akh$ +-0h3 ;>3?D1F6<  z"e$v)\+/+13W6N:<? Dh:zfq"M' /U24:?;<?BpG^8  `  ~#v&(v,79J:<.BDG7/ z-ID"/:03t57u=CE5  F2 %w&p*,-e136U8>xAFy0  )}a!$(*-/a468<<=ADR/8 K #:&=)+/[479;>yCD-  9i!$U()x-136 =?{B9F7+ T %S(,X/5):<A*C;EG*G  b gL!$L%(/-<069j>CG( sR "%l(-m1i2 :%I& $I& (y+/2g6 7:[=CyG%VJ $C),.395DHF7#  Sa %'Y)-e/1x38~;G>2@EH&"  @Xy !&(*-/5?@oB4G e  ].K ( 0&4.7f9DFn .M l#')/v247&=ADF nh  KV "%c)',2AcB0Dn  m7"'0 5;|= ,v %(|-02u5]9~=A #  |%'& ),.136j<>} >e #/(c*,[0%56: <`A6BEO Q$P$ ,03o79=>@Fy1  6u!$ (*.4R5<9=:=A"C   N%#0%(-/p47;7AEC  @o $&+a14:8 & n%V " ;j e#!?5;?6w n )E #; @E&1/G @ !} `m$dPOSITIONsubprograms.Instead,theusertoldMasterscope(inthebreaktypescriptwindow)toeditwhereveranyonecallstheprogram(alinedrawingfunction).Thisrequestcausesthesystemtoconsultits(dynamicallymaintained)databaseofinformationaboutuserprograms,whereinitndsthatthesubprogramcalls.Itthereforeloadsthecodeforintoaneditwindowwhichappearsunderthe``Browserprintoutwindow''.Thesystemthenautomaticallyndsandunderlinestherst(andonly)callon.Onthepreviousline,isusedasavariable(theonetheusersetandinterrogatedearlier).Thesystem,however,knowsthatthisisnotasubprogramcall,soithasbeenskipped.Iftheusermakesanychangetointheeditor,notonlywillthechangetakeeectimmediately,butwillbemarkedasneedingtobeupdatedinitsleandtheinformationaboutitintheprogramdatabasewillbeupdated.This,inturn,willcausethewindowtoberepainted,asitsdisplaymaynolongerbevalid.TheInterlisp-Ddisplayfacilityhasseverallayers.Atthelowestlevelareroutineswhichviewthedisplayasacollectionofbitsandprovidesprimitivesformovingblocksofbitsaround().Theconceptsimportanttothislevelarepositions,regionsandbitmaps.Thenextlevelisthedisplaystream,anabstractionthatimplementsclippingtorectangularareasofthescreen,lineandcurvedrawing,andprintingtothescreenindierentfonts.Theconceptsimportanttothislevelarefontsanddisplaystreams.Ontheinputside,thereisalowlevelinterfaceforreadingthedisplayinputdevices,thecursorlocationandthemousebuttons.Theinputandoutputcometogetheratthenextlevel,thewindowsystemwhichallowsareasofthescreenusedbydierentprogramstooverlapbykeepingtrackofinformationcoveredandprovidingcontrolprimitivesformouseinteraction.Thischapterisorganizedaccordingtotheselevels.19.1POSITIONApositiondenotesapointinanX,Ycoordinatesystem.Aisaninstanceofarecordwitheldsandandismanipulatedwiththestandardrecordpackagefacilities.Forexample,createsapositionrepresentingthepoint(10,20).[Function]Returnsifisa;otherwise.19.2REGIONARegiondenotesarectangularareainacoordinatesystem.Regionsarecharacterizedbythecoordinatesoftheirbottomleftcornerandtheirwidthandheight.Aisarecordwithelds,,,and.Itcanbemanipulatedwiththestandardrecordpackagefacilities.Thereareaccessfunctionsfortherecordthatreturnstheandoftheregion.Thefollowingfunctionsareprovidedformanipulatingregions:[Function]Returnsaninstanceoftherecordwhichhas,,and19.2DRAWBETWEENSHOWLINKDRAWBETWEENSHOWLINKDRAWBETWEENDRAWBETWEENSHOWLINKSHOWLINKSHOWPATHSBITBLTPOSITIONXCOORDYCOORD(createPOSITIONXCOORD_10YCOORD_20)(POSITIONP)POSITIONNILREGIONLEFTBOTTOMWIDTHHEIGHTREGIONTOPRIGHT(CREATEREGION)REGIONXXXLEFTBOTTOMWIDTHHEIGHTLEFTBOTTOMWIDTH|b'&x\: Y5 u!f #)%) 06y8u;AFW !'& .17;>YC#E#U   ` 8" $ +/39?H@DuGTD "%&(N.`2 48!ADGR %/2$(*y0384;[ CG(P )E*+.I06^C_DH0OR \=YZ ? '-V065:?ABDF7HM N,#T$'I*K.155>@CGjL  D & /249;@BDJa   nr P -!#,%+03L5:;>@+CF+H 4[ $h&',/157E  &n[#(L*B,04 6X;?BE/D  I %(*-1[35:l?AqDGBk f>E !&)/36E9;e=BG@  !5# *q.#027x:c=OACG(? _BB$${'-S358<>BDE/=y ^e #&,m.35:>>CXE; 0 ^#&*.y35D7:> @UEf:. 92!x#)/1057=@BZ 8 ; #|%*; 15:;AH06  r|/ ix+Z -! (j-68:?bA,BgF) 9H ''*7,26]; AqD(,192K7r ?-AtD% C5 #d5 "Z*<.B |@ ix k"9 N 8!" ).36 >\@JB 6  = ##&+Z2b349&<5C$It] %>(O*064{9 ?CE  W!"%+724[6   # +t C5 :$%-15;AG((o"}`m$xW TD^ :P! 9 M7L(H I|D:+Z/9) ( 4"I(+)% #d#+96,?C }(.- )} :(}`m$px% *#d $ :8bY569<>B(DW"&([+W/35I8E;?>CEU}R%&+&x<CQ>*"~&(* 135:>< AO "$n)^*.037;=_B C[FyM}J"2"#kx<CIH!%'G)-l/ 0 516;>;@EGr!#v'/1468=DC5 B4%y 01:;u>@B ?C5 >Lq)s*,C248:Z<:ATG< !'.9C5 7; %+.&79HDEHs0 c!'*}+/6i7D >?lF|( ix$}    Y%_*+.?138;9;0?AzB "  Q  M8!&g .L04L68<>H@E}!1 I%&)/f149<AE3G {8f "%u'*-H1Y35 >?@D_EG I I!%'^(~+-:.057;?> GT@  c$%(P+/58A;?ACFy  =v#Xd" qp} $m),`.25: =?i FY Q !!f#.~1v>0IJ (J)?4u5j8;j?DoG>  ^^gA K#&O(*0;3S5; C5 6#)+(o"}p`m$*x\:'+19Y5 ),,/k2R -{Q>FJ *G,D %B7 ? &>L<,p9 %3Q 1,0&gD@| )4 > J ,  }p`m$|x\:R R{RMR{$R( R{,JJ{JJ J$J)xD $B+q? >L <%9[>72p6V(3Q{(1#+57?G0)!1 $!}p`m$BITBLT[Function]Returnstheheightofinpixels.[Function]Returnsthenumberofbitsperpixelof.Thefunctionsusedtomanipulatebitmapsare:[Function]Createsandreturnsanewbitmapwhichispixelswidebypixelshigh,withpitsperpixel.Ifis,thedefaultis1.[Function]Ifisbetween0andthemaximumvalueforapixelin,thepixel()ischangedtoandtheoldvalueisreturned.Ifis,isnotchangedbutthevalueofthepixelisreturned.Ifisanythingelse,anerrorisgenerated.If()isoutsidethelimitsof,0isreturnedandnopixelsarechanged.canalsobeawindow.[Function]Returnsanewbitmapwhichisacopyof(samedimensionsandcontents).[Function]Returnsanewbitmapthatistimesaswideasandtimesashigh.Eachpixelofiscopiedintoatimesblockofpixels.If,defaultsto4,to1.Therearetwodistinguishedbitmapsthatarereadbythehardwaretobecomevisibleasthescreenandthecursor.Thescreenisabitmap(=1024)wideby(=808)high.Thecursorisabitmap(=16)wideby(=16)high.Theyareaccessedby:[Function]Returnsthescreenbitmap.[Function]Returnsthecursorbitmap.Note:Thecursorbitmapcanbechangedwiththefunction(page19.16).19.4BITBLTistheprimitivefunctionformovingbitsfromonebitmaptoanother.Itissimilartothefunctionthatisusedinothersystems.[Function]anddeneapairofrectangles,oneineachoftheand19.4(BITMAPHEIGHT)(BITSPERPIXEL)(BITMAPCREATE)NIL(BITMAPBIT)NIL(BITMAPCOPY)(EXPANDBITMAP)NILSCREENWIDTHSCREENHEIGHTCURSORWIDTHCURSORHEIGHT(SCREENBITMAP)(CURSORBITMAP)CURSORBITBLTRASTEROP(BITBLT)BITMAPBITMAPBITMAPBITMAPWIDTHHEIGHTBITSPERPIXELWIDTHHEIGHTBITSPERPIXELBITSPERPIXELBITMAPXYNEWVALUENEWVALUEBITMAPX,YNEWVALUENEWVALUEBITMAPNEWVALUEX,YBITMAPBITMAPBITMAPBITMAPBITMAPWIDTHFACTORHEIGHTFACTORWIDTHFACTORBITMAPHEIGHTFACTORBITMAPWIDTHFACTORHEIGHTFACTORWIDTHFACTORHEIGHTFACTORSOURCEBITMAPSOURCELEFTSOURCEBOTTOMDESTINATIONBITMAPDESTINATIONLEFTDESTINATIONBOTTOMWIDTHHEIGHTSOURCETYPEOPERATIONTEXTURECLIPPINGREGIONWIDTHHEIGHTSOURCEBITMAPDESTINATIONBITMAP|b1'x\:C5 Z6#l*S,WC5 U6$^&(+'.4R   #OC5 N9d$$%^([-187_;Y>EL!'l* ,~0e;? ?BBFHPIC5 G ":')+.s58;6<@FGFC%d.Y13r59:AD!["% *],/ 24:69; A2B!#'b( /1O346I;=ATGHAQ![#`'G)47=:;=>LC5 < %k)i*+/'59 @C 9C5 75"' *559;?G(6V!%&*-a07+8k<?X4%* ,1x5@FRHQ3 !#_0  V p #%) +-35J:i>@{BG(._  Im).1>}CaG, #N&3/7d; >@FU)C5 (7#l% C5 #d7#a ^h"'A)+1"4:6AEW|; ixf5 ]%8'+-2D39_:<@BDh0(_E C5 Yn %(),.:-(o!}`m$lx\: ZW ZO (L<I "D>L 9 .43K._E 3 ,X ( ) % ^<  0 k E!}`m$\x\:Z%$WU0CO  N92@L9 1 I*l$!CGIhAFC'*,3BF$GDCBF$GB1CAQ/>L<09: %*U+$7+01~A6V2'@VE E4 !6;<3 k[$'M/4D <B  PF"&+/3:  0F3<A }T`m$INTERLISP-DDISPLAYFACILITIESwhoseleft,bottomcornersareat,respectively,(,)and(,).Iftheserectanglesoverlaptheboundariesofeitherbitmaptheyarebothreducedinsize(withouttranslation)sothattheytwithintheirrespectiveboundaries.Ifisnon-itshouldbeaandisinterpretedasaclippingregionwithin;clippingtothisregionmayfurtherreducethedeningrectangles.These(possiblyreduced)rectanglesdenethesourceanddestinationrectanglesfor.andcanalsobedisplaystreamsorwindows,inwhichcasetheirassociatedbitmapsareused.Themodeoftransferringbitsisdenedbyand.andspecifybooleanfunctionsthatareusedtodetermine,respectively,themethodofcombiningbitswiththeandtheoperationbetweentheseresultantbitsand.isagraypattern,asdescribedonpage19.6.(Note:Thealignmentofthetexturepatternwithissuchthattheoriginofthedestinationbitmapisatanintersectionofthe``tiles.'')specieshowtocombinethebitsfromwiththebitsfrom(abackgroundpattern)toproducea``Source''.Thisisdesignedtoallowcharactersandgurestobeplacedonabackground.SourceFortheandcase,theargumenttoisignored.Forthecase,the,,andargumentsareignored.specieshowthissourceiscombinedwiththebitsinandstoredbackinto.becomesSourceSourceSourceSource,,,anddefaultto0.anddefaulttothewidthandheightofthe.defaultstowhite.defaultsto.defaultsto.Ifisnotprovided,noadditionalclippingisdone.returnsifanybitsweremoved;otherwise.Note:andacceptwindowsanddisplaystreamsastheirbitmaparguments.Inthesecases,theremainingargumentsareinterpretedasvaluesinthecoordinatesystemofthewindowordisplaystreamandtheoperationofthefunctionsaretranslatedandclippedaccordingly.Ifawindowordisplaystreamisusedasthedestinationto,itsclippingregionlimitstheoperationinvolved.19.5NILREGIONBITBLTBITBLTINPUTINVERT(NOT)TEXTUREINPUTINVERTBITBLTTEXTUREREPLACEPAINT(OR)INVERT(XOR)ERASE(AND(NOT))INPUTREPLACEBITBLTTNILBITBLTBITMAPBITBITBLTSOURCELEFTSOURCEBOTTOMDESTINATIONLEFTDESTINATIONBOTTOMCLIPPINGREGIONDESTINATIONBITMAPSOURCEBITMAPDESTINATIONBITMAPSOURCETYPEOPERATIONSOURCETYPEOPERATIONSOURCEBITMAPTEXTUREDESTINATIONBITMAPTEXTURESOURCETYPESOURCEBITMAPTEXTURESOURCETYPESOURCEBITMAPSOURCEBITMAPTEXTURETEXTURESOURCEBITMAPSOURCELEFTSOURCEBOTTOMOPERATIONDESTINATIONBITMAPDESTINATIONBITMAPOPERATIONDESTINATIONBITMAPDESTINATIONBITMAPDESTINATIONBITMAPDESTINATIONBITMAPSOURCELEFTSOURCEBOTTOMDESTINATIONLEFTDESTINATIONBOTTOMWIDTHHEIGHTSOURCEBITMAPTEXTURESOURCETYPEOPERATIONCLIPPINGREGION|b' %'*- x\: u3sT"& .9:=(IZpX$&(+0/2(379:>H;D i< %(*)/>04 :=ACEBk   >22   (/;68D>/@0q  /" "0U69N-l "K(+.0?BzF+ ')'$" ,-Z1)6*:?E@G( Z!!#}/S6X;i<c i"**7x8;LAlCl  4  )!$'&*2  #z)S,61608 ;}@Z H  m0 " )+/1j3 :|>@BH m ?"U(N* 038w @IABH pV ")j*F,1g59m;A(o }d`m$HxWI VS'+JaB;- 8} 8p)5" 241 Cw$ "( " 0" 1d -5c$4/4 $`"}d`m$jx\:&)/b2=BZ  X=; WI<A) S-0]9? OR#')/307:GB/FMM@CJL5; CE  2+.A>  2;` 8p#>5V2"|0q>%(-l  2d7 +  (  ' " !$H % %   2",1 B %) 0A6D|c,h } `m$TEXTURE19.5TEXTUREATexturedenotesapatternofgraywhichcanbeusedbyto(conceptually)tessellatetheplanetoformaninnitesheetofgray.Itiscurrentlya4by4pattern.Texturesarecreatedinteractivelyusingthefunctionorfrombitmapsusingthefollowingfunction.[Function]Returnsatextureobjectthatwillproducethetextureof.Ifistoolarge,itslowerleftportionisused.Ifistoosmall,itisrepeatedtolloutthetexture.[Function]Returnsifitisatexture,i.e.alegaltextureargumentto.Thecommontextureswhiteandblackareavailableassystemconstantsand.Theglobalvariableisusedbymanysystemfacilitiesasabackgroundgrayshadeandcanbesetbytheuser.Theoriginalbackgroundshadeofthewindowsystemiskeptin.Thebackgroundshadecanbechangedbythefollowingfunction:[Function]Changesthebackgroundshadeofthewindowsystem.determinesthepatternofthebackground.Ifisatexture,thenthebackgroundissimplypaintedwithit.Ifisa,thebackgroundistesselated(tiled)withittocoverthescreen.Ifis,itchangestotheoriginalshade,thevalueof.Itreturnsthepreviousvalueofthebackground.19.6SAVINGBITMAPSBitmapscanbesavedonleswiththelepackagecommand(page11.22).ThefollowingtwofunctionstranslatebitmapsintoandoutofarepresentationwhichmaybeusedtotransferbitmapsbetweenInterlispandothercomputersystems'representations.[Function]Createsabitmapbyreadinganexpression(writtenby)fromtheprimaryinputchannel.[Function]Printsthebitmapontheprimaryoutputchannelinaformatthatcanbereadbackinby.19.7SCREENOPERATIONThefollowingfunctionscontrolthedisplayscreen.19.6BITBLTEDITSHADE(CREATETEXTUREFROMBITMAP)(TEXTUREP)BITBLTWHITESHADEBLACKSHADEGRAYSHADEWINDOWBACKGROUNDSHADE(CHANGEBACKGROUND)BITMAPTWINDOWBACKGROUNDSHADEVARS(READBITMAP)PRINTBITMAP(PRINTBITMAP)READBITMAPBITMAPBITMAPBITMAPBITMAPOBJECTOBJECTSHADESHADESHADESHADESHADEBITMAPBITMAP|b1&C\8 ixW vw- 8$A&(+3u5! > CF!V-  [!8' (4)f+^,17k9>~ F7T  I$+'*.0;QC5 O"&)b,1P38C>?rFGuN7[* #R(#)-=35<7;<>3CEcGjLIC5 G"#x$&7'`,\./3-7=DD  ) "%(R)+.09<GH=C;  &>W!2$&)2 .q/138m;Z?ADEGA  1 c"#%'*,/0U3AFgG?  pN0!*#%'8),3 AG3' CS!A#%'B 0j47:=?jD% U~!?&"C5 !/"$)+ 2s7BD G C5 '),]16 ;-<>BE_G9*| ix  u$(o }`m$xW-TQ #I G?D3 ?' C;A4< 7* 6T,4)&"" !/9  9! !}`m$TxQO9@N7.ISG< ;E;9*r7#6T&""}pL`m$:INTERLISP-DDISPLAYFACILITIES[NoSpreadFunction]Setstheinterpretationofthebitsinthescreenbitmap.Ifis,a0bitwillbedisplayedaswhite,otherwisea0bitwillbedisplayedasblack.returnstheprevioussetting.Ifisnotgiven,willreturnthecurrentsettingwithoutchanginganything.Note:ThisfunctiononlyworksontheXerox1100andXerox1108.[Function]Setstherateatwhichthescreenisrefreshed.isoneofor.Ifis,thescreenwillberefreshedatthesamerateasTV(60cyclespersecond).Thismakesthepicturelookbetterwhenvideotapingthescreen.Note:Changingtheratemaychangethedimensionsofthedisplayonthepicturetube.Severalfunctionsareprovidedforturningothedisplay(partiallyorcompletely).Seepage18.22.19.8CHARACTERSANDFONTSFontscontrolthewaycharacterslookwhenprintedonthescreenoragraphicsprinter.Fontsaredenedbyadistinctivestyleor(suchasGachaorTimesRoman),a(suchas10points),and(suchasboldoritalic).Fontsalsohaveathatindicatestheorientationofcharactersonthescreenorpage.Anormalhorizontalfont(alsocalledaportraitfont)hasarotationof0;therotationofavertical(landscape)fontis90degrees.Whilethespecicationallowsanycombination,inpracticetheuserwillndthatonlycertaincombinationsoffamilies,sizes,faces,androtationsareavailable.Inspecifyingafonttothefunctionsdescribedbelow,aisrepresentedbyaliteralatom,abyapositiveinteger,andabyathree-elementlistoftheform.,whichindicatesthethicknessofthecharacters,canbe,,or;canbeor;andcanbe,,or,indicatinghowspreadoutthecharactersare.Forconvenience,facesmayalsobespeciedbythree-characteratoms,whereeachcharacteristherstletterofthecorrespondingeld.Thus,isasynonymfor.Inaddition,certaincommonfacecombinationsmaybeindicatedbyspecialliteralatoms:========Afontalsohastheproperties,,and(=+),and,foreachcharacter,awidthandbitpattern.Theisthemaximumheightofanycharacterinthefontfromitsbaseline(theprintingposition).Theisthemaximumextentofanycharacterbelowthebaseline,suchasthelowerpartofa``p.''ThereforethetoplineofacharacterwillbeatBase+-1,whilethebottomlinewillbeatBase-.Thewidthofeachcharacterspecieshowastream'spositionwillchangewhenthecharacterisprinted.ThismayhavebothanXandaYcomponent(e.g.,forlandscapefonts),anditvariesfromcharactertocharacterinvariablepitchfonts.19.7(VIDEOCOLOR)NILVIDEOCOLORVIDEOCOLOR(VIDEORATE)NORMALTAPETAPEFAMILYSIZEFACEROTATIONFAMILYSIZEFACE(WEIGHTSLOPEEXPANSION)WEIGHTBOLDMEDIUMLIGHTSLOPEITALICREGULAREXPANSIONREGULARCOMPRESSEDEXPANDEDMRR(MEDIUMREGULARREGULAR)STANDARD(MEDIUMREGULARREGULAR)MRRITALIC(MEDIUMITALICREGULAR)MIRBOLD(BOLDREGULARREGULAR)BRRBOLDITALIC(BOLDITALICREGULAR)BIRASCENTDESCENTHEIGHTASCENTDESCENTASCENTDESCENTASCENTDESCENTBLACKFLGBLACKFLGBLACKFLGTYPETYPETYPE|b' %'*- x\:<CZG &'*-V/316(;DIXLZ!n')}-45V68;=DEWI e$',x1N9:= UOz %)/4R$'5+3-7/369=OC5 M!%'p+, 7<8;?BtGH\LMr C!)#'*,{24)6:<>ACmGjJQ s$'+.26:n>AEI ="%*, 4)58><>ANEE  #&(]- 24 <?)Bm|> i (x:t  \t  $z)=+3-13`4{9>BD8  x!v#'e) 2[7P:<>iCR7)  TX"+N.#36@ =?? EqG5 &U #&*+04S67=%>@BH&3  :/##'B) 1z58V @BXG27  a-D %1&,[/36Q;>M /2   D+, &@*1J2 :<='A D-  !<7!"G%*-C/1jI+!#& ,/m4:;AGT*A EU%C'/9:BC (  6 G! )-024:H<5?E& 3!;"%U .E18:6;aA:%P]^$>), 479?AE#  ('z%5 "& 3 "V)8*92:BDgG  9 #,)-0/6;<?EGD  pccT '302(4;5?oAAC >"f%e'9(,2|47:X<-=sCsF:HF  0"%c'X(2259;a>D~ S  B k$3&,.369=S@BDHGHR  d!%#%/),z2]4 9;@DG(o }``m$x\: ZF|WI @ O hM<D-LM8T3zE7)$/2+E-(4;@ + 1d5=]B*A c)0 ;&5Cw%P    }) ^' s$ (K#V-5G=&|D*# ,"}``m$x\:_Z=?CCWI258FO*M3LM} $`m$.CharactersandFontsTheinformationaboutaparticularfontisrepresentedinafontdescriptor.Thefollowingfunctionsmanipulatefontdescriptors:[Function]Returnsafontdescriptorforthespeciedfont.isanintegerindicatingthesizeofthefontinpoints.speciesthefacecharacteristicsinoneoftheformatslistedabove;ifis,isused.,whichspeciestheorientationofthefont,is0(or)foraportraitfontand90foralandscapefont.indicatestheoutputdeviceforthefont.ForInterlisp-D,thepossiblevaluesforareforthedisplayscreenandforPressprinters.defaultsto.Fordisplayfonts,looksforalewiththeappropriatename(suchasforafont),searchingthroughdirectoriesonthelist.Iftheleisfound,itisreadintoafontdescriptor.Iftheleisnotfound,looksforfontswithlessfaceinformation(inthisexample,)andfakestheremainingfaces(suchasbydoublingthebitpatternofeachcharacterorslantingit).Ifnoappropriatelysizedfontisfound,theactionofthefunctionisdeterminedby.Ifis,itgeneratesaerrorwiththenameofthemostspecicletried(intheexample);otherwise,returns.ForPressfonts,accessesthewidthsinformationforthefontfromafont-dictionarylewhosenameisinthelist(usuallyinitializedinthesite-greetingletocontainatleast.Thatdictionarymustcontaininformationforthefaceasspecied;thereisnoacceptablefakingalgorithmforhard-copyfonts.Thewidthandheightinformationforpressfontsisexpressedinmicas(=10microns=1/2540inch),notinscreen-pointunits.Theargumenttomayalsobealist,inwhichcaseitisinterpretedasa---quadruple.Thus,isequivalentto.mayalsobeafontdescriptor,inwhichcasethatdescriptorissimplyreturned.[Function]Returnsifisafontdescriptor;otherwise.Thefollowingfunctionstakeafontasoneargument.Thisargumentmusteitherbeaparticularfontdescriptororcoerceabletoafontdescriptor.Adisplaystreamiscoercedtoitscurrentfont,awindowiscoercedtothecurrentfontofitsdisplaystream,andanythingelseiscoercedbyapplyingtoit.[Function]Returnsthevalueofthepropertyoffont.maybeoneof,,,,,,,,,,or.[NoSpreadFunction]Returnsafontdescriptorthatisacopyofthefont,butwhichdiersfrominthat'spropertiesarereplacedbythespeciedproperties19.8(FONTCREATE)NILSTANDARDNILDISPLAYPRESSDISPLAYFONTCREATESTRIKETIMESROMAN8BI.STRIKETIMESROMAN8BOLDITALICFONTDIRECTORIESFONTCREATETIMESROMAN8I.STRIKENILFILENOTFOUNDTIMESROMAN8BI.STRIKEFONTCREATENILFONTCREATEFONTWIDTHSFILES{DSK}FONTS.WIDTHS)FONTCREATE(FONTCREATE'(GACHA10BOLD))(FONTCREATE'GACHA10'BOLD)(FONTP)NILFONTCREATE(FONTPROP)FAMILYSIZEFACEWEIGHTSLOPEEXPANSIONDEVICEASCENTDESCENTHEIGHTROTATION(FONTCOPY)FAMILYSIZEFACEROTATIONDEVICENOERRORFLGSIZEFACEFACEROTATIONDEVICEDEVICEDEVICENOERRORFLGNOERRORFLGFAMILYFAMILYSIZEFACEROTATIONFAMILYXXXFONTPROPPROPFONTPROPOLDFONTPROP1VAL1PROP2VAL2OLDFONTOLDFONTOLDFONT|b'#3 *,x\:   v#%0 ,./3 :=CZ   WC5 U! (V*-p3R:C TD2 !}$&s/a47{:CrEMH&R0"',09:DEPt &q(1*-/Y05^6d89>ADFpHOR&,N.3279<0?Bz GM(#F*e3527<%@NGL+%*2tI4+J.07l9<> F!G\g.0F!E" )+.<=?QAD E{D !$ ,-02t36yCGBk$I # +j-0JFG(@F$U'+-^/s5Z7: >@C?x!!"$ ->03519<@5ADh=yF +,7;<>gD;#l&)&-.1\49<=?ADi:.(t) 9P@7)K*w/16] =@BmETH5 "&*+-R/>C 38z#%P&+-?E@CCl 27'  '*,/1U7;;<> E0 #8&*o-<137 ?fAE Hs.#_%',.3U739;R?|C+&(1'4\7Y9|:=?CFHs*A  &u)u,4u <(&( /|I& #%:&) 026:"=) CEq%P"JC5 5 "Z#&o 0X   )A "e%/,:/r59==G?W@ F S w %x'+0168?:>B"CKHsT rM"'*{0(24K9T;P  C5 > $ &(-*3%5B;AzDG4^#_'.<3BgFy g; (*f 03m9;*=Cl (o }`m$xW 5R.21P2M,BL,I"z 1G\-20 ;n= E0OD: Bk6'=y9HE;:.0e =7)! 5130%+( *A@ (_ 1{ ;ArC"J  -NT@  ^ $)2/w4=Cd&  +"}`m$xWIN !}#$#'-(14U7TD+,@-R))*r>?lAAOR!M%tL =y"'L*.P26+M@*A" "%&)*+[-s.S/0&D7"J SA(*89Q=:> S! Ix  I ; !#W I% &|'* I( 5~8 g"&= } h`m$INTERLISP-DDISPLAYFACILITIESandvalues.Thus,willreturnaboldpressfontwithallotherpropertiesthesameasthoseof.acceptsallthepropertiesthatinterrogatesexceptfor,,and.Iftherstpropertyisalist,itistakentobethesequence.Thus,isequivalenttotheexampleabove.[Function]isanintegerthatrepresentsavalidcharacter(asreturnedby).Returnstheamountbywhichastream'sX-positionwillbeincrementedwhenthecharacterisprinted.[Function]Like,butreturnstheYcomponentofthecharacter'swidth,theamountbywhichastream'sY-positionwillbeincrementedwhenthecharacterisprinted.Thiswillbezeroformostcharactersinnormalportraitfonts,butmaybenon-zeroforlandscapefontsorforvector-drawingfonts.[Function]Returnstheamountbywhichastream'sX-positionwillbeincrementediftheprintnamefortheInterlisp-Dobjectisprintedinfont.Ifisadisplaystream,itsfontisused.Ifisnon-,the-pnameofwithrespecttothereadtableisused.[Function]Returnstheregionoccupiedbyifitwereprintedatthecurrentlocationin.Thisisusefulfordeterminingwheretextisinawindowtoallowtheusertoselectit.Theargumentsandarepassedto.Itissometimesusefultosimulateanunavailablefontortouseafontwithcharacteristicsdierentfromtheinterpretationsprovidedbythesystem.Thefollowingfunctionallowstheusertotellthesystemwhatfontdescriptortouseforgivencharacteristics.[Function]Indicatestothesystemthatisthefontwiththecharacteristics.Ifis,thefontassociatedwiththesecharacteristicsisclearedandwillberecreatedthenexttimeitisneeded.Aswithand,iscoercedtoafontdescriptorifitisnotonealready.[Function]Returnsthefontthatwouldbeusedasthedefault(ifwerespeciedasafontargument)fordevice.Ifisafontdescriptor,itissettobethedefaultfontfor.Thefollowingfunctionsallowtheusertoaccessandchangethebitmapsforindividualcharactersinadisplayfont.[Function]Returnsabitmapcontainingacopyoftheimageofthecharacterinthefont.19.9(FONTCOPY'WEIGHT'BOLD'DEVICE'PRESS)FONTCOPYFONTPROPASCENTDESCENTHEIGHT(FONTCOPY'(WEIGHTBOLDDEVICEPRESS))(CHARWIDTH)CHCON1(CHARWIDTHY)CHARWIDTH(STRINGWIDTH)NILPRIN2(STRINGREGION)STRINGWIDTH(SETFONTDESCRIPTOR)NILFONTPROPFONTCOPY(DEFAULTFONT)NIL(GETCHARBITMAP)FONTFONTPROP1VAL1PROP2VAL2FONTCHARCODEFONTCHARCODECHARCODEFONTSTRFONTPRIN2FLGRDTBLSTRFONTFONTPRIN2FLGSTRRDTBLSTRWINDOWPRIN2FLGRDTBLSTRWINDOWPRIN2FLGRDTBLFAMILYSIZEFACEROTATIONDEVICEFONTFONTFAMILYSIZEFACEROTATIONDEVICEFONTFONTDEVICEFONT_DEVICEFONTDEVICECHARCODEFONTCHARCODEFONT|b' %'*- x\A )Z' $+'+>.04 ;>_B0D3H&X#')+ 2+< ChGWO#$},V-K.1\469;i<?_@BQF(GU})*D*x+2*T(!) 0414>9PC5 OY 8"&)W /04,9<AHM3$8&0*8+_02&7a:; CGL IC5 Gb"#&+}./7T9O; BGE"#)4*/24 B{DGBqff%)V+-T1i6?lC5 = $&+/,238;= EG< f #C (*q13B84:@yAvG'H:{y!k#h&x(,04}6 ;P BH02 "&(: /36o79Y:k?{ADF0S!.6G8<G-  g Z ( *,.x0258,@Fy,4  =MN$D'-2x68;=u?BF*  >^J'C5 %[!4%,-k/25$=%*./r14} :=A$" S"$*,/3 4R5:<G( _#&$)+D,l/X 578s9C5 G"%)+/Q1%38t=AFH!;#|,<-24548& >@GACEGJ6%  E"T$(<+ /2;79 @o FHP KC5 (" )*.L0268m:H0  W(o"}`m$hx\A$V07<CwX4WO'LU5BT!P 7OYC~I Gb?l 'k:{8>5 *40> ' 6q$=,/"?  G:sK !"}`m$xx\A,-|XeUU@YUpU@ U!#|U@%,U&C&U@(U>b?!P*OYIhf?le!|#E< .==CC:{-28,O5$.$E&4*+20(e-|1's+"#0#&~'_))-3 3%(F)78f;Y<?@-@CCEFM$='' ;1x'./b!rK,@D; }`m$ DisplayStreams[Function]Changesthebitmapimageofthecharacterinthefonttothebitmap.Currently,mustbethesamewidthandheightasthecurrentimageforinthefont.Userscaninteractivelyeditcharactersusingthefunction(page20.10).19.9DISPLAYSTREAMSStreamsareusedasthebasisforallI/Ooperations.Filesareimplementedasstreamsthatcansupportcharacterprintingandreadingoperations,andlepointermanipulation.Displaystreamsareatypeofstreamthatalsoprovidesaninterfacefortranslation,clipping,andguregenerationonbitmaps.Alloftheoperationsthatcanappliedtostreamscanbeappliedtodisplaystreams.Forexample,adisplaystreamcanbepassedastheargumentto,toprintsomethingonthebitmapofadisplaystream.Inaddition,specialfunctionsareprovidedtodrawlinesandcurvesandperformothergraphicaloperationsondisplaystreams.Callingthesefunctionsonastreamthatisnotadisplaystreamwillgenerateanerror.Windowsarecloselyrelatedtodisplaystreamsandcanbethoughtofasatypeofdisplaystream.(Inthenearfuture,windowswillbeatypeofdisplaystream.)Allofthefunctionsthatoperateondisplaystreamsalsoacceptwindows.Displaystreamscanbecreatedwiththefollowingfunction:[Function]Returnsadisplaystream,withinitialsettingsasindicatedbelow.Ifisspecied,itisusedasthedestinationbitmap,otherwisethescreenbitmapisused.Eachwindowhasanassociateddisplaystream.Togetthewindowofaparticulardisplaystream,use:[Function]Returnsthewindowassociatedwith,creatingawindowifonedoesnotexist.Returnsifthedestinationofisnotascreenbitmapthatsupportsawindowsystem.19.9.1ManipulatingDisplayStreamsThefollowingfunctionsmanipulatetheeldsofadisplaystream(theymayalsobegivenawindow,inwhichcasetheassociateddisplaystreamisused).Thesefunctionsreturntheoldvalue(theonebeingreplaced).Avalueofforthenewvaluewillreturnthecurrentsettingwithoutchangingit.Thesefunctionsdonotchangeanyofthebitsinthedisplaystream'sdestinationbitmap;justtheeectoffutureoperationsdonethroughthedisplaystream.Warning:ThewindowsystemmaintainstheDestination,XOset,YOset,andClippingRegioneldsofeachwindow'sdisplaystream,adjustingthemduringwindowoperations.Usersshouldbeverycarefulaboutchangingtheseeldsinawindow'sdisplaystream(with,,,or).19.10(PUTCHARBITMAP)EDITCHARPRINT(DSPCREATE)(WFROMDS)NILNILDSPDESTINATIONDSPXOFFSETDSPYOFFSETDSPCLIPPINGREGIONCHARCODEFONTNEWCHARBITMAPCHARCODEFONTNEWCHARBITMAPNEWCHARBITMAPCHARCODEFONTDESTINATIONDESTINATIONDISPLAYSTREAMDISPLAYSTREAMDISPLAYSTREAM|b'$)x[C5 ZRL$(*-:gEGX'X(I :|=?BoEW[ >"'`+h468?KT  F  !($.h37|L ixHy (J #] *. 0g 8:r?lBBDF 5 $&)J.# 7C<]AaCEH&E. c:!K# *0d3$7 =?EH&C  n :*$'v).0f59;=CE/A F &'z),h2471;=s>C&H@= *$x"G#'h*-Y14S9=FC5 >  %$& '%+.D/23$7<&>D5F; xl"1'8*,.357n8;=BcG9  Uymi"${)6.1!25O;T>,CE/8F 5A kZ 7"(2'@tDE 6 B `_N#&6 .39P<. FAD  ]%).]3 ;?DF g3m !',40?I S.#:("}4`m$x[ -`T',A"}2< ]'@ #&Q: 4 @ "}4l`m$8x[,"t%F ZR36hABoXk= .1 W-1 ;<2<*Q0A&FM'@{%.2#5:}`m$RINTERLISP-DDISPLAYFACILITIES[Function]Destination:Thebitmapthatthedisplaystreammodies.Thiscanbeeitherthescreenbitmap,oranauxilliarybitmapinordertoconstructgures,possiblysavethem,andthendisplaytheminasingleoperation.Initiallythescreenbitmap.[Function][Function]XOset:TheXoriginofthedisplaystream'scoordinatesysteminthedestinationbitmap'scoordinatesystem.Initially0(noX-coordinatetranslation).YOset:TheYoriginofthedisplaystream'scoordinatesysteminthedestinationbitmap'scoordinatesystem.Initially0(noY-coordinatetranslation).Displaystreamshavetheirowncoordinatesystem.Havingthecoordinatesystemlocaltothedisplaystreamallowsobjectstobedisplayedatdierentplacesbytranslatingthedisplaystream'scoordinatesystemrelativetoitsdestinationbitmap.[Function]ClippingRegion:Aregionthatlimitstheextentofcharactersprintedandlinesdrawn(inthedisplaystream'scoordinatesystem).Initiallysetsothatnoclippingoccurs.[Function][Function]XPosition:ThecurrentXposition.Initially0.YPosition:ThecurrentYposition.Initially0.andspecifythe``currentposition''ofthedisplaystream,theposition(inthedisplaystream'scoordinatesystem)wherethenextprintingoperationwillstartfrom.Thefunctionswhichprintcharactersordrawonadisplaystreamupdatethesevaluesappropriately.[Function]Texture:Atexturethatisthebackgroundpatternusedforthedisplaystream.Initiallythevalueof.[Function]Font:AFontDescriptorthatspeciesthefontusedwhenprintingcharacterstothedisplaystream.InitiallyGacha10.Note:determinesitsnewfontdescriptorfrombythesamecoercionrulesthatanduse,withoneadditionalpossibility:Ifisalistoftheformwhereisacceptableasafont-propertyto,thenthenewfontisobtainedby.[Function]LeftMargin:AnintegerthatistheXpositionafteranend-of-line(inthedisplaystream'scoordinatesystem)-initially0.[Function]RightMargin:AnintegerthatisthemaximumXpositionthatcharacterswill19.11(DSPDESTINATION)(DSPXOFFSET)(DSPYOFFSET)(DSPCLIPPINGREGION)(DSPXPOSITION)(DSPYPOSITION)DSPXPOSITIONDSPYPOSITION(DSPTEXTURE)WHITESHADE(DSPFONT)DSPFONTFONTPROPFONTCOPY()FONTCOPY(FONTCOPY(DSPFONTNILDISPLAYSTREAM))(DSPLEFTMARGIN)(DSPRIGHTMARGIN)DESTINATIONDISPLAYSTREAMXOFFSETDISPLAYSTREAMYOFFSETDISPLAYSTREAMREGIONDISPLAYSTREAMXPOSITIONDISPLAYSTREAMYPOSITIONDISPLAYSTREAMTEXTUREDISPLAYSTREAMFONTDISPLAYSTREAMFONTFONTPROP1VAL1PROP2VAL2PROP1PROP1VAL1PROP2VAL2XPOSITIONDISPLAYSTREAMXPOSITIONDISPLAYSTREAM|b' %'*- x\:C5 Z "u'1* ,t105;>ACGX "$ */1L5 6<AFWI9!\& )+<,e0L 6<>lBTDC5 RC5 P1 !%'H).T3 :[>@B OR1 #(./8136 9 LM0 !%'H).T3 :[>@B J1 #(./8136 9 G!%(X+f 227S<0> EfEs$L(-6135<.=CGDW N %E* 155:q<= DAQC5 ?"d$(+/v26M82 >CF>  m%!*m 106;=?BD<`9[C5 7C5 6 o!D& '-V2q3  n!D& '-T2p0")/J36;q AGBE/._8$&).n3 :?DAF,#>&)*-c0T6h:> DFn+#(|,0, (C5 &iR$%'(+D 27;G=@=E$",!C5 C '*f/2L5M8A D^$.147) = D}"Wg }667Nx9AC4 |l#=+,/2d5i8n9?}@AB6xCoC5 + !&)h*-M.427y9v< =@BE/ #(). C5  #W(/+:,/6;8=@ G4(!}`m$x\: *TD $R $AQ )9[ 'A7 'A0 $ ( $$$} ! m~'"$E7|%A #j B ( ("}`m$lx\:] q$TDlRtAQ#9[,!Z7,!Z(!{:m9C:EF"%&(s")*,,"-/@0"2\3 4"=<>@01m3[45um78:(m;=D=m?"1 ]# "} `m$DrawingonWindowsandDisplayStreamsbeprintedat(inthedisplaystream'scoordinatesystem)-initiallythevalueof.Thisdetermineswhenanendoflineisautomaticallyinsertedbytheprintingfunctions.Thelinelengthofawindowordisplaystream(asreturnedby,page6.8)iscomputedbydividingthedistancebetweentheleftandrightmarginsbythewidthofanuppercase``A''inthecurrentfont.ThelinelengthischangedwhenevertheFont,LeftMargin,orRightMarginarechanged.[Function]SourceType:Thesourcetypeusedwhenprintingcharacterstothedisplaystream.Mustbeeitheror.Initially.[Function]Operation:Thedefaultoperation(,,,or)usedwhenprintingordrawingonthedisplaystream.Initially.[Function]LineFeed:AnintegerthatspeciestheYincrementforeachlinefeed,normallynegative.Initiallyminustheheightoftheinitialfont(Gacha10).[Function]Scroll:Aagthatdeterminesthescrollingbehaviorofthedisplaystream;eitheror.If,thebitsinthedisplaystreams'sdestinationaremovedafteranylinefeedthatmovesthecurrentpositionoutofthedestinationbitmap.Anybitsmovedoutofthecurrentclippingregionarelost.DoesnotadjusttheXOset,YOset,orClippingRegionelds.Initially.(Note:ifis,theScrolleldischanged,andthepreviousvalueisreturned.)19.9.2DrawingonWindowsandDisplayStreams[Function]Fillsofthedestinationbitmap(withintheclippingregion)with(apatternofbits).Ifis,thewholedestination(withintheclippingregion)isused.Iforare,thevaluesfromareused.[Function]Fillsinacircularareaofradiusaboutthepoint(,)inthedestinationbitmapofwith.'spositionisleftat(,).[Function]SetstheXpositionoftoitsleftmargin,setsitsYpositiontothetopoftheclippingregionminusthefontascent,andllsitsdestinationbitmapwithitsbackgroundTexture.[Function]Changesthecurrentpositionoftothepoint.[Function]Changesthecurrentpositiontothepointcoordinatesawayfromcurrent19.12SCREENWIDTHLINELENGTH(DSPSOURCETYPE)BITBLTINPUTINVERTINPUT(DSPOPERATION)BITBLTREPLACEPAINTINVERTERASEREPLACE(DSPLINEFEED)(DSPSCROLL)ONOFFONOFFNILnot(DSPFILL)NILNIL(FILLCIRCLE)(DSPRESET)(MOVETO)(,)(RELMOVETO)(,)SOURCETYPEDISPLAYSTREAMOPERATIONDISPLAYSTREAMDELTAYDISPLAYSTREAMSWITCHSETTINGDISPLAYSTREAMSWITCHSETTINGREGIONTEXTUREOPERATIONDISPLAYSTREAMREGIONTEXTUREREGIONTEXTUREOPERATIONDISPLAYSTREAMXYRADIUSTEXTUREDISPLAYSTREAMRADIUSXYDISPLAYSTREAMTEXTUREDISPLAYSTREAMXYDISPLAYSTREAMDISPLAYSTREAMXYDISPLAYSTREAMDISPLAYSTREAMXYDXDYDISPLAYSTREAMDXDY|b'"G$@* ,1x\: t"%G*/ 6s;<ADWH&Z !$ +/14Q68:9 BGXA U  "h&) .99=D@AsGTD C>!#&, .0i4@57>8ABER  Z0$&z*+ 13 ;> OC5 M ' .15: A6BE/LM &"*12];IHC5 G !B+61;7<BMC HE#%*,/938CBC5 AQ %(. 02+8;>ZD?"&)*-`/1u5]8H=D'G>6E ##(-j1457;D=ADt4j (,4149WE#I2!$*-F/5-8:> |._ i^$Mx)C5 (U!# */4;6;@w&!&-2836\: BQG% !#'/9>?B(Fy#d"?$ ^C5 "%'047c;@jB z)2%=:>DEHFm'hC5 [#/1y3K5:=N? @EG6 #(D,.269m<> E.w $qC5 0$R)579A C5 !#r$*)Y*-H7! >UAE(!}`m$xZ U0 O )M"wLM%,x7yIH 'G%18R=BDE=B $o< (+9[ e4j1F|{2"nx) /&/% < ^ -h gq )=?4@ "M !03U5!}`m$xO#IH!B%[<* "E4j: ){(!%*(UC&( % )b15#d ^p#'+;<V",P3%7SmOhS%B)pq\C+G/u>\@ *8g !12}4,4!}P`m$INTERLISP-DDISPLAYFACILITIESpositionof.[Function]ChangestheXpositiontotheleftedgeofandtheYpositiontothetopoflessthefontheightof.Thisisthebeginningpositionofthetoplineoftextinthisregion.Ifis,theclippingregionofisused.Note:thisdoesnotsettheXpositiontotheleftmarginlikethefunctiondoes.[Function]Backsupoveracharacterwhichisscreenpointswide.llsthebackedoverareawiththedisplaystream'sbackgroundtextureanddecreasestheXpositionby.IfthiswouldputtheXpositionlessthan'sleftmargin,itsoperationisstoppedattheleftmargin.Itreturnsifanybitswerewritten,otherwise.[Function]Printssothatisitcenteredwithinofthe.Ifis,willbecenteredintheclippingregionof.19.9.3DrawingLinesandCurvesInterlisp-Dprovidesseveralfunctionsfordrawinglinesandcurvesontothedestinationbitmapofadisplaystreamorwindow.Thecurvedrawingfunctionstaketheiroperationfromthedisplaystream,whileforstraightlinestheOperationmaybespeciedasanargumenttothedrawingfunction,withthedisplaystream'soperationonlybeingusedbydefault.Thefollowingfunctionsproducestraightlinesofthespeciedwidth(inscreenpoints;thedefaultis1)inthedisplaystream'sdestinationbitmap.Theydonotallow``brush''patterns;however,theydosupportmodeinwhichredrawingalinewilleraseit.Thesefunctionsareintendedforinteractiveapplicationswhereeciencyisimportant.canbeusedtodrawlineswithbrushes.[Function]Drawsalinefromthecurrentpositiontothepointontothedestinationbitmapof.Thepositionofissetto.Ifthedestinationbitmaphasmultiplebitsperpixel,isacolorspecicationthatdeterminesthecolorusedtodrawtheline(Seepage19.44).Ifis,thiswillbetheof.[Function]Drawsalinefromthecurrentpositiontothepointcoordinatesawayontothedestinationbitmapof.Thepositionofissettotheendoftheline.[Function]Drawsalinefromthepointtothepointontothedestinationbitmapof.Thepositionofissetto.[Function]Drawsalinefromthepointtothepointontothedestination19.13(MOVETOUPPERLEFT)NILDSPRESET(DSPBACKUP)DSPBACKUPTNIL(CENTERPRINTINREGION)NILBITBLTINVERTDRAWCURVE(DRAWTO)(,)(,)NILDSPCOLOR(RELDRAWTO)(,)(DRAWLINE)(,)(,)(,)(DRAWBETWEEN)DISPLAYSTREAMDISPLAYSTREAMREGIONREGIONREGIONDISPLAYSTREAMREGIONDISPLAYSTREAMWIDTHDISPLAYSTREAMDISPLAYSTREAMWIDTHWIDTHDISPLAYSTREAMEXPREGIONDISPLAYSTREAMEXPREGIONDISPLAYSTREAMREGIONEXPDISPLAYSTREAMXYWIDTHOPERATIONDISPLAYSTREAMCOLORXYDISPLAYSTREAMDISPLAYSTREAMXYCOLORCOLORDISPLAYSTREAMDXDYWIDTHOPERATIONDISPLAYSTREAMCOLORDXDYDISPLAYSTREAMDISPLAYSTREAMX1Y1X2Y2WIDTHOPERATIONDISPLAYSTREAMCOLORX1Y1X2Y2DISPLAYSTREAMDISPLAYSTREAMX2Y2POSITION1POSITION2WIDTHOPERATIONDISPLAYSTREAMCOLORPOSITION1POSITION2|b' %'*- x\:(Y5C5 W7!-&p(#*-0J7_:<~>CSEGjU!>#&*67_:v;>;DTD~!d#<&'*/6:;>]CH&R"<#'`+K-13579>@dBE/PO)^MC5 LM(+-#3(7U=AF7J"$](+.14 8= E9IW W"$9)r/~0U14m8;=i>D*FG\!#%_*R,2 3t8:CE.Ea"* BC5 A ` "$$%g*4N5BTC?e\"#)~++-27B|; i@x6 UI "'*-147 =BD"E/4 j? "1(<+E4<:r=@XE3Q  _ #%+v-%/5<69K>DeG1  $&.  'L#'C)'+157<=ACHs-   R !w'*,/3P8>DG+Z d'K#$'l*-q/D349;`AC5 ) { +.w0f35L8;? &C5 %  Q #&*0P24=@dB #dU(!(+1=^>@F ^h "Z&)`.1X3<3=>B c !T#' *6+/514(7%:Z>E!IE(w4CC5 h] 3#&7+0|2J4? Fc. $-(458S=,6!#&C5 q7#k%/s1.3=5@qB U(!(+1=^>@G C5 !"%/_039=@B ("}`m$hxY5 'TD8^P"!M "4JE'B .?e4.+Z)#& 0X% 8H9;#dBD?EF|!; 4|h8;= 7q)+. 7D9;BDG ?}`m$x\:"Y54c#)W2U],p0TD1bRM*NLM"8I+hG\B$(A /8@@HYV u1 %F*,e/3,69B= DuEW JMcY #'*0 7<]BIV S$:%&*-4.05. ;>ACETe  v=! ),/48:'=X@B$DHsR !&Ob:O wb$+,-1590;|?5N < #Z&A(L. /16F;Z?A H0Ln s"$%])X*045?YCTDH0J G  ] wGY!r#R$l)-/)347;C<?:C F    "F$ &f*Y,.7 5M8:_? C  +H# &) +049?S@FHAr  2 XR %(7,-158# >G@BH&? T "X$),/367:>e@BG>' ?  c$*-06;>AC>EG<  qtOe$M%+X.1$7;E=?AX HR:  k]#n)+?-28Y[@%BH&60 oM"* 1r366 3+C5 1 )+,6._057O;H=ADE/"&,j13628<>B@BG.:B!$; +G,3+5C5 ) h"*.08< >L E.'#.05w79?z@F&D $G&~).1486>A( H0$ nC5 &"%'+F/=@\AE"&*7,59<; C-H&}!+,/Y347;=?D& 79U>@`CI1 {"$ -/D17H:=W@G  _&|h i  !%''x  XY $"$%+2,. 6T;@pE^Hs(!}`m$xW>CV 1O@GN 2Ln 12f7)= {?5x:960"%<3+ 3+5 1)4a67';F<>" n"02r4!DF|H+  }`m$rx\[ ";26B[HU3+*A"#(-)1%/=+5pq!"v',)&586'|$(<="G$156~:j<?F@ n 1d"13I}"';'-1EGS!} $`m$INTERLISP-DDISPLAYFACILITIESinitializedtobeadisplaystreamatthetopofthescreen,butthatinitialsettingcanbemodiedbythefunction.[Function]Selectsthedisplaystreamorwindowtobetheterminaloutputchannel,andreturnsthepreviousterminaloutputdisplaystream.putsintoscrollingmodeandcallswiththenumberoflinesthatwilltintogivenitscurrentFontandClippingRegion.Thelinelengthofiscomputed(likeanyotherdisplaystream)fromitsLeftMargin,RightMargin,andFont.Ifoneoftheseeldsischanged,itslinelengthisrecalculated.Ifoneoftheeldsusedtocomputethenumberoflines(suchastheClippingRegionorFont)changes,isnotautomaticallyrecomputed.willcauseittoberecomputed.Ifthewindowsystemisactive,thelinebuerissavedintheoldwindow,andthelinebuerissettotheonesavedinthewindowofthenewdisplaystream,ortoanewlycreatedlinebuer(ifitdoesnothaveone).Caution:Itispossibletomovethetoanonvisibledisplaystreamortoawindowwhosecurrentpositionisnotinitsclippingregion.[Function]Setstheshapethatblinksatthelocationofthenextoutputtothe.iseither(1)-nochanges,returnsarepresentingthecurrentcaret,(2)-turnsthecareto,or(3)awhichgivesthenewcaretshape.Thehotspotofindicateswhichpointinthenewcaretbitmapshouldbelocatedatthecurrentoutputposition.Thepreviouscaretisreturned.[Function]Ifisgreaterthan0,itisthenumberoflinesofoutputthatwillbeprintedtobeforethepageisheld.Apageisheldbeforethe+1lineisprintedtowithoutinterveninginputifthereisnoterminalinputwaitingtoberead.Theoutputisheldwiththescreenvideoreverseduntilacharacteristyped.Outputholdingisdisabledifis0.returnstheprevioussetting.19.11CURSORANDMOUSEThescreenrelativepositionatwhichthecursorbitmapisbeingdisplayedcanbereadorsetusingthefunctions:[Function]Thisreturnsthelocationofthecursorinthecoordinatesystemof(thecurrentdisplaystream,ifis).Ifisa,itwillbereused,andreturned.Ifisnon-,itshouldbeapositionandthecursorwillbepositionedat.19.15TTYDISPLAYSTREAM(TTYDISPLAYSTREAM)TTYDISPLAYSTREAMPAGEHEIGHTTTYDISPLAYSTREAMPAGEHEIGHT(TTYDISPLAYSTREAM(TTYDISPLAYSTREAM))TTYTTYDISPLAYSTREAM(CARET)TTYDISPLAYSTREAMNILCURSOROFFCURSOR(PAGEHEIGHT)TTYDISPLAYSTREAMTTYDISPLAYSTREAMPAGEHEIGHT(CURSORPOSITION)NILPOSITIONNILDISPLAYSTREAMDISPLAYSTREAMDISPLAYSTREAMDISPLAYSTREAMNEWCARETNEWCARETNEWCARETNNNNNEWPOSITIONDISPLAYSTREAMOLDPOSITIONDISPLAYSTREAMDISPLAYSTREAMOLDPOSITIONNEWPOSITIONNEWPOSITION|b' %'*- x\: BF"I$&(-~026;/=?E~GZ WC5 U> \#r')+9;r=u?A~EoG^TDq$&4(#+-)02569R%'*-A03?jBmDGjP4B!d"035E7)9=?ORW /1@37:<@oBDM $ -/35>79=0@B>HL c".#'s(+-7/36L7:l=?BDFJaV p )c+-/=>ArFHL@BFH0G<De |$&>*r,/d3h48{:"&(1*b,/h03%67:G;Kk7)^ %*+-38v?ArBG5s /%n&s*,f/2D46<=ADF3""'1q237>;j?(@CvF27>!##=$[("),m.Q1]3L58^<8?8A'DHs0-C5 +7 $%'%(+0N25d7.;>AKCMH0*A%*+,0157J:<;?uCGJ(| 06 =]A%BFMG& %8&(,).314~7y:s<@Di%Pd"o$(-24:=/>#U$<| ix"  T!#',-18:<?ACG| wC5 E!&(P*.0I2 9==+$)6:-<>CYD#Ee "% )7+- 4w>( }$`m$xZaW # TD>~R6 OR"*Ja4 H :/ZD>?{:t 8=7)'Y95"]7m- *A("%P@ w 4+7@!}$ `m$dxW :U/32RP%):t7)x3),-+:*AFb%P;w] % + ?DCs++6/d> 3 6 !}0`m$`MouseButtonTesting[Function]MovesthecursorpointsintheXdirectionandpointsintheYdirection.anddefaultto0.Thecursorcanbechangedlikeanyotherbitmapbyingintoitorpointingadisplaystreamatitandprintingordrawingcurves.Formostapplications,itisalsonecessarytolocatethe-apointwithinthebyareawhichisusedtodetermineapositionforthecursor.Alsoforsomeapplicationsitisnecessarytosaveandrestorethecursor.TheCursorrecordandthefollowingfunctionsprovidethesecapabilities.ACursorrecordhaseldsand,thelatterathatgivesthelocationofthehotspotinsidethecursor.[Function]Returnsacursorobjectwhichhasasitsimageandthelocation(,)asthehotspot.Ifisa,itisusedasthehotspot.Ifhasdimensionsdierentfromby,thelesserofthewidthsandthelesseroftheheightsareusedtodeterminethebitsthatactuallygetcopiedintothelowerleftcornerofthecursor.Ifis,0isused.Ifis,-1isused.Thedefaultcursorisanuparrowwithitstipintheupperleftcorneranditshotspotat(0,-1).[Function]Returnsarecordinstancethatcontains(acopyof)thecurrentcursorspecication.Ifisarecordinstance,thecursorwillbesettothevaluesin.Ifis,thecursorwillbesettothedefaultcursor,anupwardleftpointingarrow.[Function]Ifisarecordinstance,thecursorwillbesettothevaluesin.Thisdoesnotreturntheoldcursor,andtherefore,providesawayofchangingthecursorwithoutusingstorage.[Function]Invertsthecursor.ThereareseveralcursorsdenedinInterlisp-Dthatmaybeofinteresttousers.Oneoftheseis,anhourglassshapeusedbythesystemtoindicatethatalongcomputationisinprogress.scanbesavedonaleusingthelepackagecommand,orthelepackagecommand.19.11.1MouseButtonTestingTherearevariousgraphicalinputdevicesthatcanbereadfromInterlisp-D.Thedevicesusedinthismannerare:adevicecalledamouse,whichhasthreekeysandsteersthecursor,andsevenuninterpretedkeysonthekeyboard.(SomeXerox1100systemsmayalsohaveasmall,ve-keykeyset.)Thefollowingmacrosareprovidedtotestthestateoftheseinputdevices.(Thethreekeysonthemouse(oftencalledbuttons)arereferredtobytheirlocation:left,middle,orright.)[Macro]Readsthemousestateandreturnsifthatstateisdescribedby.19.16(ADJUSTCURSORPOSITION)BITBLThotspotCURSORWIDTHCURSORHEIGHTpointCURSORBITMAPCURSORHOTSPOTPOSITION(CURSORCREATE)POSITIONCURSORWIDTHCURSORHEIGHTNILNILCURSORHEIGHTCURSORHEIGHT(CURSOR)CURSORCURSORTDEFAULTCURSOR(SETCURSOR)CURSOR(FLIPCURSOR)WAITINGCURSORCURSORCURSORSUGLYVARS(MOUSESTATE)TDELTAXDELTAYDELTAXDELTAYDELTAXDELTAYBITMAPXYBITMAPXYXBITMAPXYNEWCURSOR_NEWCURSORNEWCURSORNEWCURSORNEWCURSOR_NEWCURSORNEWCURSORBUTTONFORMBUTTONFORM|b'"'g+x\:C5 Z$(!,S.027?D$EHRX #++/1WU    l$(/2J5,68\=?CHFTD  a5u "&B .Q/1P4::h<4@HGHR  *H-517257n=BmGP  U%]@ !#;$*,/2Q69G>@EOR  ;D [# +-W16P8G(M$&*A,1358X;O?MAJC5 I%"`&*2g4%6:)<?^DEG"H0G\2 $%-.0L15M7)9D?CAEGD'!v%P'&).z04B6 <?$ADBkk!I#'}).L0 2q78:%>?@=AEHs@,%)%&([,>/ 38 9;|@D"FH0? u$'u)N+.0O;<^<C5 :t$ (-06q8=;=>=@E8 *+2c6CEG7)j )*478:>ACEG5J+a,=.+3'5;2~C5 0!n")d-3659<;>@(ADH0/2 s#&)_-0 279 @2EG-^5!%*.j*C5 (>% /! '(, /R138:?dBDHs$7z"&](+/169;3>x FH0" [4" "%6*]67J8BdD | ix l~I$2'")+/2 8:-='BEmG>w   $'*-0Q46b:=AE   a1 O#(+.T1269D;@C+ x "m%)/2^59 ;={AE V#z&E+@- D K"%(.0d3C68><I( }`m$x\: &U*{TDBxR  {?xOR< M J G\'E(+ 4/ Bk;@ ?1 < :tU8,7)6G5 u 2~ 0#* $7  0;=  -"}`m$|x\:ht"$P%%Z"%%:==>X 8 %(-()J:I-'EFJG\"B Bk8G<ve8!$y7)!$,K/2~*0/2x  @JF(!}`m$INTERLISP-DDISPLAYFACILITIEScanbeoneofthekeyindicators,,or;theatom(indicatingallkeysareup);theform;oraformof,,orappliedtoanyvalidbuttonform.Forexample:willbetrueiftheleftmousebuttonisdown.willbetrueiftheleftmousebuttonistheonlyonedown.willbetrueifeithertheleftmousebuttonisuporthemiddlemousebuttonisdown.[Macro]Similarto,butteststhevalueofratherthangettingthecurrentstate.Thisisusefulfordeterminingwhichkeyscausedatobetrue.[Macro]isasdescribedin.Waitsuntilistrueoruntilmillisecondshaveelapsed.Thevalueofisifwassatisedbeforeittimedout,otherwise.Ifis,itwaitsindenitely.Itcompilesintoanopenloopthatcallsthewaitbackgroundfunction.Thisformshouldnotbeusedinsidethewaitbackgroundfunction.doesnotuseanystorageduringitswaitloop.Themacrosandareidenticaltoandexceptthattheyalsocheckthestateoftheve-ngerkeysetaswellasthestateofthemousebuttons.Thatistheycheckthestateofboththemouseandthekeyset.Thus,iftheleftmousebuttonwastheonlymousebuttonhelddown,wouldbeeventhoughakeysetkeywasdown;whereaswouldbeifakeysetbuttonweredown.Thenamesofthekeysetkeysare:,,,and.19.11.2LowLevelAccesstoMouseThissectiondescribesthelowlevelaccesstothegraphicalinputdevicesandcanbeskippedbymostusers.Graphicalinputinformationisrepresentedinthefollowingglobalvariables:[Variable]TheXpositionofthecursorinabsolutescreencoordinates.Alsoseethefunctionbelow.[Variable]TheYpositionofthecursorinabsolutescreencoordinates.Alsoseethefunctionbelow.[Variable]An8-bitnumberthathasbitsoncorrespondingtothemousebuttonsthataredown:istheleftmousebutton,istherightbutton,isthemiddlebutton.(Bits,,,,andgivethestateofthekeysetkeys,fromlefttoright,ifyouhaveakeyset.)19.17LEFTMIDDLERIGHTUP(ONLY)ANDORNOT(MOUSESTATELEFT)(MOUSESTATE(ONLYLEFT))(MOUSESTATE(OR(NOTLEFT)MIDDLE))(LASTMOUSESTATE)MOUSESTATELASTMOUSEBUTTONSMOUSESTATE(UNTILMOUSESTATE)MOUSESTATEUNTILMOUSESTATETNILNILTTYTTYUNTILMOUSESTATEKEYSETSTATELASTKEYSETSTATEMOUSESTATELASTMOUSESTATE(MOUSESTATE(ONLYLEFT))T(KEYSETSTATE(ONLYLEFT))NILLEFTKEYLEFTMIDDLEKEYMIDDLEKEYRIGHTMIDDLEKEYRIGHTKEYLASTMOUSEXLASTMOUSEXLASTMOUSEYLASTMOUSEYLASTMOUSEBUTTONS4Q2Q1Q200Q100Q40Q20Q10QBUTTONFORMKEYBUTTONFORMBUTTONFORMINTERVALBUTTONFORMBUTTONFORMINTERVALBUTTONFORMINTERVAL|b' %'*- x\8!#%(*Z,/ 9L?R@MFcGZ #%(*-/;<>*?3BxFIX!#]&).294WGmzy #r&*v/0U^[K #%%* .02k58IS(*,/047$9=BNCEGRUJ % &xOPDMm&'a),/R2BFLu$(+-14f $-GZDE "U$*.4E5$9EFD\# *-3T69HsBh #&u+0 1l5`8:@A@_" *T+147:>ADD? "),j047U9x<AF=w X3&69";>CjH;8  *(,M./1;7&  @J(G$ "$'+/146C8;=@,DF5  B?J #'n*5,15t69V;@DB?DG3  {v#26S9=ACGJ25  +/467A;k=f?C'/0  $[%1f9G(-|)& iu&`x$  "Y y$&o(.27:w= ?.DjF#  O z (G),Q2^6} C p{!C"%V)+,04 <?B Dh C  {!B"%V)+,04 <?B Dhz uC #L"%(}+H-x 68k:?wDG)X!$(K/$0}26<>:@E<"v%):*/25#8R: j@CF?C=w%8 63- >t 3X 'm,x8S25 & 1/0&z 2S: -     z u )-:#S&, }P`m$x\8Z8@OP];GZ4!%v&%E"() 46h @B WI'#% .12sTDC R  ( +.W258;@BEhH0P"//0236/;i@)BCFORWLM   j#'+-2<6 IHC5 G"$M&+-2136 =HIDC5 B"$M&+-2136 =HI?C5 >L R"$t&o)l+6.S1&3~7L9;dGzH\< "$e*l8:$=1;!$(T+&-/5G;zAgG9[ >(4<7!$n' +74C5 3 3$0'),147:wI1e .=9:GRH/2 J"(+Q149<?:B9D^.t ##%'+-~/38=>BD|& ix" C &4,K.249 B H;  u4 % +r-3N8 ?@ G(E z }!/">'*+24 5/:<;< B  Tr 56"%+. 03+57Z=@D "L'~+Z136V8C FMT knY O =r #%+04

@9BH o !&(-[18pABGj^  $ d '.x0 8X;>BTF  }   5"'"-136 ;&=BGT  Hb"$m*y("},`m$>x\: Z19E Xh%2i>TD P # IH D ? h<%b+? ;8<\BI9[# ) 5L= 7[4 3 @ 1e . == 2:D^ },<`m$pxIH/G>CD/B>C? >L>EE<*"}hX`m$:INTERLISP-DDISPLAYFACILITIES[NoSpreadFunction]Thewindowworldisturnedonifisandoifis.returnsthepreviousstateofthewindowworld(or).Ifisgivennoarguments,itsimplyreturnsthecurrentstatewithoutaectingthewindowworld.19.12.1WhatareWindows?Awindowspeciesaregionofthescreen,adisplaystream,alocationinanocclusionstack,functionsthatgetcalledwhenthewindowundergoescertainactions,andvariousotheritemsofinformation.Thebasicmodelisthatawindowisapassivecollectionofbits(onthescreen).Ontopofthisbasiclevel,thesystemsupportsmanydierenttypesofwindowsthatarelinkedtothedatastructuresdisplayedinthemandprovideselectionandredisplayingroutines.Inaddition,itispossiblefortheusertocreatenewtypesofwindowsbyprovidingselectionanddisplayingfunctionsforthem.Windowsareorderedindepthfromusertobackground.Windowsinfrontofothersobscurethelatter.Operatingonawindowgenerallybringsittothetop.Windowsarelocatedatacertainpositiononthescreen.Eachwindowhasaclippingregionthatconnesallbitssplashedatittoaregionthatallowsaborderaroundthewindow,andatitleaboveit.Eachwindowhasadisplaystreamassociatedwithit,andeitherawindoworitsdisplaystreamcanbepassedinterchangeablytoallsystemfunctions.Therearedependenciesbetweenthewindowanditsdisplaystreamthattheusershouldnotdisturb.Forinstance,thedestinationbitmapofthedisplaystreamofawindowmustalwaysbe.TheXOset,YOset,andClippingRegionattributesofthedisplaystreamshouldnotbechanged.Atsomefuturedate,thenotionsofwindowanddisplaystreamwillbemerged.Windowscanbecreatedbytheuserinteractively,underprogramcontrol,ormaybecreatedautomaticallybythesystem.Windowsareinoneoftwostates:``open''or``closed''.Inan``open''state,awindowisontheocclusionstackandthereforevisibleonthescreen(unlessitiscoveredbyotheropenwindows)andaccessibletomouseoperations.Ina``closed''state,awindowisnotontheocclusionstackandthereforenotvisibleandnotaccessibletomouseoperations.Anyattempttoprintordrawonaclosedwindowwillopenit.WhenInterlisp-Dstartsup,therearethreewindowsonthescreen:atopleveltypescriptwindow,awindowcontainingtheInterlisp-Dlogo,andapromptwindow.Thetopleveltypescriptwindowcorrespondstotheleintheprocesswheretheread-eval-printloopisoperating.Thelogowindowisboundtothevariableuntilitisclosed.Thepromptwindowisusedfortheprintingofhelporpromptingmessages.Itisavailabletouserprogramsthroughthefollowingfunctions:[Variable]Globalvariablecontainingthepromptwindow.[NoSpreadFunction]Printsinthepromptwindow.[Function]Clearsthepromptwindow.19.19(WINDOWWORLD)TNILWINDOWWORLDTNILWINDOWWORLD(SCREENBITMAP)TEXECLOGOWPROMPTWINDOW(PROMPTPRINT)(CLRPROMPT)FLAGFLAGFLAGEXPEXP|b' %'*- x\:<CZ\c#+$u(*/246;?`Xf$q')y+1 56;X= HsWI:" $ %C).$0d5 8=BvDU|Q> i0xL =| $%*/06"79@CK4   J$)j.a159=3> GI  TKl# ):*-/2M7{9<<=@CGG _0 "q(*-.1_3 5b8a >DFWFC   !g'-(./1H6x8:=?}CnFLD  NH!! (].U0A X{. #%: -V3j58:R>xCE? ]a"$%(< 8v#B%=',F/4738R=AD;G  y $&"*/S17.9; =A8B   ^ &*?,)/3)49;=BGT6  ZJ" )2-@/ 8&=@ E@H4 @!&)j.1L 8=<>@Eq3Q  ,'),179 C 1  (j} &(,Z046r;`=+BfE/0 X- Y4 '+1W6L7:<Ar +Z  C(U GO!#% +-/t4B78>?{A~C&  h)n#*')0*/15}8?(A H0% P  Q!# (U),O.b06:]=!CE#d   MP "{%{*,//1V467<ADCG\ ^  F3 #t(*-125 8* >NCD  }+ _!&,U/615 ;W@ H0  G # &(,O/o0 7s:F=OBsCH0m  M>M!#(-/c247@<>=AYC E&#(+1) C >!p (#*/f<Cq 0"'s lC5 8#(!} x`m$0x\: Z0<@ X58> 3Q m  > l } xh`m$-004M59:?D+FO  f |9!$(&(%,-3 9;@BJCN7  iA# %y(-C/36:Z;?@<GL d "M'd),/G35:=^?=@EGJ k $ %,0359/<@_AB IF   "(*),# 29<@=BFH0G  I"$%g)z,P 2D8>BB#& -/J1 36B;<?BjEGG(AO("$)B*-W2}4w6;=?B>J8>B<N#&+o,0(27=?T@0Cs98>B7#%Q',.17<ADG?6TQ !r$3N8>B1<$%'?,2g4 ;s>SAG0$&*+O/3)5;;?oAG4.]Q!#`%'^-(;<@+X8>B)E!#~(*)e,c035t:?EG( 8"$)_+.3p5;@CE&gN'\)+.047f:T<AyBE/$ -%?*.0\4~6;?^ FH#!% ,z 8>Bp  &226k8>Bb* m$Z&"*F,1359;= @DFn \ R#s$)+H05357<@GJz-o *"'+368 a"&]')|+1%527 >^@qB 8]!!&V)$,14t8b9J <:J9 3N 0.]05 +X ( &g!  p) k  Caz.8 }p`m$PINTERLISP-DDISPLAYFACILITIEStheentirewindowcorrectly,tryasmallerwindoworonewithfewerblackbitsinit.Togetahardcopyofanarbitrarypartofthescreenthatcrosseswindowboundaries,usethecommandinthebackgroundmenu(below).[WindowMenuCommand]Promptsforaregiononthescreenandmakesanewwindowwhosebitsareasnapshotofthebitscurrentlyinthatregion.Usefulforsavingsomeparticularlychoiceimagebeforethewindowimagechanges.Occasionally,auserwillhaveanumberoflargewindowsonthescreen,makingitdiculttoaccessthosewindowsbeingused.Tohelpwiththeproblemofscreenspacemanagement,theInterlisp-Dwindowsystemallowsthecreationof.Aniconisasmallrectangle(containingtextorabitmap)whichisa``shrunken-down''formofaparticularwindow.Usingtheandcommands,theusercanshrinkwindowsnotcurrentlybeingusedintoicons,andquicklyrestoretheoriginalwindowsatanytime.[WindowMenuCommand]Removesthewindowfromthescreenandbringsupitsicon.(See,page19.27.)Thewindowcanberestoredbyselectingfromthewindowcommandmenuoftheicon.Ifthebuttonispressedwhilethecursorisinanicon,thewindowcommandmenuwillcontainaslightlydierentsetofcommands.Theandcommandsareremoved,andthecommandisreplacedwiththecommand:[WindowMenuCommand]Restoresthewindowassociatedwiththisiconandremovestheicon.(See,page19.28.)Ifthebuttonispressedwhilethecursorisnotinanywindow,a``backgroundmenu''appearswiththefollowingoperations:[WindowMenuCommand]Callsthefunction(page18.4),whichwritesoutallofthedirtypagesofthevirtualmemory.Aftera,anduntilthepagefaulthandlerisnextforcedtowriteoutadirtypage,yourvirtualmemoryimagewillbecontinuable(asofthe)shouldyouexperienceasystemcrashorotherdisaster.[WindowMenuCommand]Thesameasthecommanddescribedabove.[WindowMenuCommand]Promptsforaregiononthescreen,makesapressleandsendsittotheprinter.Theprintingisdonewith(page18.18),soifisnon-,theimagewillbesentthere,ratherthanto.Somebuilt-infacilitiesandLispuserspackagesaddcommandstothebackgroundmenu,toprovideaneasywayofcallingthedierentfacilities.Theusercandeterminewhatthesenewcommandsdobyholdingthebuttondownforafewsecondsovertheiteminquestion;anexplanatorymessagewillbeprintedinthepromptwindow.19.21HARDCOPYSNAPIconsSHRINKEXPANDSHRINKSHRINKWEXPANDRIGHTREDISPLAYCLEARSHRINKEXPANDEXPANDEXPANDWRIGHTSAVEVMSAVEVMSAVEVMSAVEVMSNAPSNAPHARDCOPYHARDCOPYWFULLPRESSPRINTERNIL(PRINTINGHOST)RIGHT|b' %'*- x\8+;# )+-O2:79rZs Z!')+1o4q6I8=@ DX  !|+1q35z <@U8>BTA? %O'x).S1,569?-C{F?HRf1!$U*A,.38_:>B P$;&+/M )C,"/#'.,.15:g;@BFFALK 1 h"(*Y.2~ ;= BDJ p]H y"%'_(,>2" 9\<=?%D[HsH ! M "(,4=5D|FGZ  x^"z%(,q/)48:?EG?E B8>BA  S%)B+0837z9;>E?I?c"'*S,M13>BND=!#%:  w!<#')O+-/}0g28>fBOE9 >-&!-%4;>jDG7mz@'4h8>B2 ?$> *}-m/25L:<@:I1.  Z!$#(i),{.C067 @/D,q  an )l8>B'C),-1 5A9m<>*@BF& v Z&*A014M7:@/ENF${!W#%$(,E/49=@gBn ""#(_+ 137;<@v8>B*|%,;2`%8>BU ~$&)-13 68;?F@BHDz!e$0B48:rU1!%(?*.-048E   K!?')025 <A BG)  w %(+-4q7;>EG  Q! "M%*.-^/34:= D  T^D(}`m$xX#U {J#xH/<7B A C ?c9E: 9$07m "54h 2C . )l '#p& +" *"% z(;9 }`m$hChangingEntriesontheWindowCommandMenusThefollowingfunctionsprovideafunctionalinterfacetotheinteractivewindowoperationssothatuserprogramscancallthemdirectly.[Function]Ifis,itcalls.Ifisashrunkenwindow,itbringsupthe``iconwindow''menu.Ifisaunshrunkenwindow,itbringsupthewindowmenu.Theinitialitemsinthesemenusaredescribedabove.Iftheuserselectsoneoftheitemsfromtheprovidedmenu,thatitemisedto.Ifisnotaor,itreturns.[Function]Bringsupthebackgroundmenu.Theinitialitemsinthismenuaredescribedabove.Iftheuserselectsoneoftheitemsfromthemenu,thatitemised.19.12.3ChangingEntriesontheWindowCommandMenusThewindowcommandmenusforunshrunkenwindows,shrunkenwindows,andthebackgroundarecachedinthevariables,,and.Tochangetheentriesinthesemenus,theusershouldchangethechangethemenu``commandlists''inthevariables,,and,andsettheappropriatemenuvariabletoanon-,sothemenuwillberecreated.Thisprovidesawayofaddingcommandstothemenu,ofchangingitsfontorofrestoringthemenuifitgetsclobbered.The``commandlists''areintheformatoftheeldofamenu(seepage19.39),exceptasspeciedbelow.Note:commandmenusarerecreatedusingthecurrentvalueof.[Variable][Variable]Themenuthatisbroughtupinresponsetoarightbuttoninanunshrunkenwindowisstoredonthevariable.Ifissettoanon-,themenuwillberecreatedfromthelistofcommands.Theofeachcommandaddedtoshouldbeafunctionnamethatwillbeedtothewindow.[Variable][Variable]Themenuthatisbroughtupinresponsetoarightbuttoninashrunkenwindowisstoredonthevariable.Ifitis,itisrecreatedfromthelistofcommands.Theofeachcommandaddedafunctionnamethatwillbeedtothewindow.[Variable][Variable]Themenuthatisbroughtupinresponsetoarightbuttoninthebackgroundisstoredonthevariable.Ifitis,itisrecreatedfromthelistofcommands.Theofeachcommandaddedtoshouldbeaformthatwillbeed.19.22(DOWINDOWCOM)NILDOBACKGROUNDCOMAPPLYWINDOWNIL(DOBACKGROUNDCOM)EVALWindowMenuIconWindowMenuBackgroundMenuWindowMenuCommandsIconWindowMenuCommandsBackgroundMenuCommandsMENUITEMSMENUFONTWindowMenuWindowMenuCommandsWindowMenuWindowMenuMENUWindowMenuCommandsCADRWindowMenuCommandsAPPLYIconWindowMenuIconWindowMenuCommandsIconWindowMenuNILIconWindowMenuCommandsCADRAPPLYBackgroundMenuBackgroundMenuCommandsBackgroundMenuNILBackgroundMenuCommandsCADRBackgroundMenuCommandsEVALWINDOWWINDOWWINDOWWINDOWWINDOWWINDOW|b', C$&)P.5x\:  < %+u-0/ 6R; B<D FZ  WC5 U"#f$4-4<=g>vD^TDj"%+08T9;, BHR %-),Q0+35b8=-?qEPsa"%9&)=,0528N<|??BYGOR&(P*1y567LMC5 J ` (-048:\=+A7CI' "'<)+-157a;>bAFK|D i91#*Ox@8  Np '-4:\=D? G> C!./>q@8BG< s:.?"'* .1@58<^?AD(;G ,L-B%BEG9 AK#7$%(*,.0 7:?@CEO7 Un 4!$&(--03586|95 @B6V  [X- $%&*-05F9;?@3Q  3 $z&+/B70KC .C -W !' (*/1259;=L D+Z!n.0:[;=?r@FG)8 -& )+../EG(^ '+8<A0C/Dh&ib. &(*,#dC !C h2 "@'_)\*023.6i:<[=pC`Hsr 013j489j:<AEOG^23:z<2?aE'D"$'t-/133"C |C !b"()*N,1348%<>h@ Hs0 013j489j:<AEOG^23:z<2?aE,S0237F:<B("}`m$|xW 1U 'PCOR+3<LM IB>8 " 2 ;G /96VA3Q00K . +Z& 1y CQ)6(,&i"#d ! r%. 6 >6')c" | 0%. 6 >6S>"}`m$xWU ;6T:TD2U6ORS!%6}$`m$,INTERLISP-DDISPLAYFACILITIES19.12.4CoordinateSystemsOnewayofthinkingofawindowisasa``view''ontoanobject(e.g.agraph,ale,apicture,etc.)Theobjecthasitsownnaturalcoordinatesystemintermsofwhichitssubpartsarelaidout.Whenthewindowiscreated,theXOsetandYOsetofthewindow'sdisplaystreamaresettomaptheoriginoftheobject'scoordinatesystemintothelowerleftpointofthewindow'sinteriorregion.Atthesametime,theClippingRegionofthedisplaystreamissettocorrespondtotheinteriorofthewindow.Fromthenon,thedisplaystream'scoordinatesystemistranslatedanditsclippingregionadjustedwheneverthewindowismoved,scrolledorreshaped.Thereareseveraldistinctregionsassociatedwithawindowviewinganobject.First,thereisaregioninthewindow'scoordinatesystemthatcontainsthecompleteimageoftheobject.Thisregion(whichcanonlybedeterminedbyapplicationprogramswithknowledgeofthe``semantics''oftheobject)isstoredasthepropertyofthewindow(page19.32).Second,theclippingregionofthewindow(obtainablewiththefunction)speciestheportionoftheobjectthatisactuallyvisibleinthewindow.Thisissetsothatitcorrespondstotheinteriorofthewindow(notincludingtheborderortitle).Finally,thereistheregiononthescreenthatspeciesthetotalareathatthewindowoccupies,includingtheborderandtitle.Thisregion(inscreencoordinates)isstoredasthepropertyofthewindow(page19.33).19.12.5ScrollingThewindowsystemsupportstheideaofscrollingthecontentsofawindow.Scrollingregionsareontheleftandthebottomedgeofeachwindow.Thescrollingregionswillonlybeactiveifthewindowhasawindowproperty(page19.31).Ifawindowhasaandthecursormovesfrominsidethatwindowintoitsscrollingregionandremainsthereformilliseconds(initially1000),ascrollbarappears.Thevalueoftheglobalvariable(initially24)determinesthesizeofthescrollingregion.Thekeyisusedtoindicateupwardorleftwardscrollingbytheamountnecessarytomovetheselectedpositiontothetoportheleftedge.Thekeyisusedtoindicatedownwardorrightwardscrollingbytheamountnecessarytomovethetoporleftedgetotheselectedposition.Thekeyisusedtoindicateglobalplacementoftheobjectwithinthewindow(similarto``thumbing''abook).Inthescrollregion,thepartoftheobjectthatisbeingviewedbythewindowismarkedwithagrayshade.Ifthewholescrollbaristhoughtofastheentireobject,theshadedportionistheportioncurrentlybeingviewed.Thiswillonlyoccurwhenthewindow``knows''howbigtheobjectis(seewindowproperty,page19.32).Whenthebuttonisreleasedinascrollregion,thefunctioniscalled.callsthescrollingfunctionassociatedwiththewindowtodotheactualscrollingandprovidesaprogrammableentrytothescrollingoperation.[Function]Callsthewindowpropertyofthewindowwithargu-ments,,and.Seewindowproperty,page19.31.Thefunctionthattracksthemousewhileitisinthescrollregionis.19.23EXTENTDSPCLIPPINGREGIONREGIONSCROLLFNSCROLLFNSCROLLWAITTIMESCROLLBARWIDTHLEFTRIGHTMIDDLEEXTENTSCROLLWSCROLLW(SCROLLW)SCROLLFNSCROLLFNSCROLL.HANDLERWINDOWDELTAXDELTAYCONTINUOUSFLGWINDOWWINDOWDELTAXDELTAYCONTINUOUSFLG|b' %'*- \: i sxW   }X!}#N$)U,.267V@&C`ER   r!V#'*-/18 <ACFcQ>  j r"&(`*~,- 3F47V<>=@YF O  * L #%')< /2m4`9>CM  IpJ  H| $()6.c3z5o:=AJBCH0IH  Ve 0 %(b.Q2g4+6;T>xBGTG     $'.0x2 :I;>BBDH0E NN j$(-0!5_9;B=B DW  L"#)F+0i24i8t;5<AEGB j #8$'"+-/57=@)DFBA t9vy# %+0-036l8=C?e  Eh $$U , -r136;@B]D=  |9[ ix4  (j!#)s+1z3Q4:@EgG3Q  a/ h7!~'p*^/47:<@BAD1  yW #(*a+03u<>AXE0  Zc9jJ-#(*/3B ._ y=!$'), 0FA G, 1y<#*-.}13K8g=V? D_+  s|P!',[. 03 47p9> EHs)n  ."(f*i,179=p?BRDF'  J6!$Y%)*0 49:<? C0G&#   _#  QKI $');- 136r;=>BVEF!x F;"E#%'+/2G6;<??D  ]b "$* /247;"A=C*X [&)W+/X04r8;8=CGWI-#%_+#./2u4 :;?CEUd'+-/0E3B S_$"S#&d*f,0q56g:^;@CEGRXL"@'h)-/47!<> B4OR"Q$),l.P056<>?@DFM"'u*.[0y6:=?BjD/GL)2+ 13#579e@ EFG(* 68><>EpE$Bk!l%.L3V5~8BHF?$f$r';,.p035X7=B=CEG=yw "&2(-o/@17|9CF%!"#w)r 03Y6u9y;# &D+/x2U8:>AG"Jz!(-0M3 ;_AUEr &)- 248/:?CH #d%K&),/2S79xAmCBEY."#&<+./247(;R<@`CFA "]$*T,/<13i79 :=.@BMDk 6!$k(*+.>024:CRDhS"M't)!.'/O2$3 9;ANCD.c&(<.>AG!#&({+.1c3 :U<? FHF!'*M,0=7SG4q l$n%+C,D/ 47:N?DF !$^69=b?EVG4 !!#?(4 48,(}`m$x\: U 5 LCwJa H3sG0Ep!Bk'E=y;:.;5=>3/2 =,* 5(+3%A"J5o =c)/2H8K l( ' !* !}\`m$~x\:]X $0H '&GA" J@2E3??@=y>?vG[H*;==:.128/P0 78o* "i#(%(()+: 4"J*.=ct!#^$$ lL "} t`m$~INTERLISP-DDISPLAYFACILITIES19.12.6ProgrammaticWindowOperations[Function]Createsanewwindow.indicateswhereandhowlargethewindowshouldbebyspecifyingtheexteriorregionofthewindow(theusableheightandwidthoftheresultingwindowwillbesmallerthantheheightandwidthoftheregionbytwicethebordersizeandfurtherlesstheheightofthetitle,ifany).Ifis,iscalledtoprompttheuserforaregion.Ifisnon-,itisprintedintheborderatthetopofthewindow.Theisprintedusingtheglobaldisplaystream.Thustheheightofthetitlewillbe.Ifisanumber,itisusedasthebordersize.Ifisnotanumber,thewindowwillhaveaborder(initially4)bitswide.Ifisnon-,thewindowwillnotbeopened,i.e.displayedonthescreen.[Function]Returnsifisawindow,otherwise.[Function]Returns,ifisanopenwindow(hasnotbeenclosed);otherwise.[Function]Returnsalistofallactivewindows.[Function]Returnsthewindowwhichcontainsthepositioninscreencoordinatesofifisa,theposition(,)ifandarenumbers,orthepositionofthecursorifis.Returnsifthecoordinatesarenotinanywindow.Iftheyareinmorethanonewindow,itreturnstheuppermost.Example:returnsthewindowthatthecursorisin.[Function]Ifisadisplaystream,itisreturned.Ifisawindow,itsdisplaystreamisreturned.Ifis,itevaluates(whichshouldbeanatom).Ifitsvalueisawindow,itisreopenedifitisclosed,andreturned.Ifitsvalueisnotawindow,issettoanewlycreatedwindow(promptinguserforregion)andreturned.Ifis,anewwindowiscreatedandreturned.Iforaregivenandawindowisinvolved,theorpropertyofthewindowisreset.The=caseismostusefulforprogramsthatwanttodisplaytheiroutputinawindow,butwanttoreusethesamewindoweachtimetheyarecalled.Thenon-casesaregoodfordecodingadisplaystreamargumentpassedtoafunction.[Function]Returnsthewidthofthewindownecessarytohavepointsinits19.25(CREATEW)NILGETREGIONNILWindowTitleDisplayStream(FONTPROPWindowTitleDisplayStream'HEIGHT)WBorderNIL(WINDOWP)NIL(OPENWP)NIL(OPENWINDOWS)(WHICHW)POSITIONNILNIL(WHICHW)(DECODE/WINDOW/OR/DISPLAYSTREAM)NILNEWTITLEBORDERNILNIL(WIDTHIFWINDOW)REGIONTITLEBORDERNOOPENFLGREGIONREGIONTITLETITLEBORDERBORDERNOOPENFLGXXXWINDOWWINDOWWINDOWXYXXXYXYXDSORWWINDOWVARTITLEBORDERDSORWDSORWDSORWWINDOWVARWINDOWVARDSORWTITLEBORDERDSORWINTERIORWIDTHBORDERINTERIORWIDTH|b' %'*- \: i K xWC5 V0~ y+a157:=@KEeT "@$).-/2l7:>C5ERT!=&Y(*/259.;?A[CGQ>:"$'z,!.15R7 9m<=AHsO,#$(y*&/ 1i4_67LQ#$O%&+x-/>35 7D9;*=fCJ!#( ,EUFbIHu!D$'N*hG_D &!J&(){,.W05"8L?f@C:D^B*!%&?1 68<:?!V"( (+S03057<?TEtG>L;GC5 95 "[#, 6C5 4"k#+.,.28;$=Ab3Q 0KC5 . >!#'+C5 )s$(.]0657@EG&"}#X+,/R 68;Y=?EOF% 4"W%*+02 "%),1D46m:<C5 Y8!%*,3-41:CiGo!;$&3'O,. /j5a679[=@{FHhR9 g.=/1348=zB  !$+Z16 7 8W;f@B?G(#_*-03o49;!A HwM"$'@,.29O=@BWE"&',f/456B:CG+ 3#W&p)s+0-28<>dAC}!(,o./E C5 I#1$'Y,24WB%FNH(}`m$^xW )FOL!J1+IH,5/GB*?%;G S9)6 4F0K + 4(UF&(" CLED"9?.;G{964!@%)F+\)EH(U*+0.q2&1$').-027'YEj58%g(6:<h%*+,0$<%w48$ d!Z 7=!}p`m$ProgrammaticWindowOperationsinteriorifthewidthoftheborderis.Ifis,thedefaultbordersizeisused.[Function]Returnstheheightofthewindownecessarytohavepointsinitsinteriorwithaborderofand,ifisnon-,atitle.Ifis,thedefaultbordersizeisused.andareusefulforcalculatingthewidthandheightforacalltoforthepurposeofpositioningawindow.Interlisp-Dprovidesasetofoperationswhichapplytoanywindow.Inadditiontobeingavailableasfunctions,mostofthesearealsoavailableviathestandardmouseinterface.Seepage19.20[Function]Bringstothetopofthestackofoverlappingwindows,guaranteeingthatitisentirelyvisible.Ifisclosed,itisopened.Thisisdoneautomaticallywheneveraprintingordrawingoperationoccurstothewindow.Ifis,theofiscalled(page19.30).Ifis,itisnotcalled,whichallowsatocallwithoutcausinganinniteloop.[Function]Reshapestotheregion,orpromptsforaregion(with,page19.37)ifnoneissupplied.Callsthewindow's,ifany(page19.31).[Function]callsthefunctionorfunctionsonthewindowpropertyof,ifany(page19.30).Ifoneofthesistheatomorreturnstheatomasavalue,returnswithoutdoinganythingfurther.Otherwise,removesfromthewindowstackandrestoresthebitsitisobscuring.Ifwasclosed,isreturnedasthevalue.Ifitwasnotclosed,(forexamplebecauseitsreturnedtheatom),isreturnedasthevalue.canberestoredinthesameplacewiththesamecontents(reopened)bycallingorbyusingitasthesourceofadisplayoperation.[Function]Ifisaclosedwindow,callsthefunctionorfunctionsonthewindowpropertyof,ifany(page19.30).Ifoneofthesistheatom,thewindowwillnotbeopened.Otherwisethewindowisplacedontheocclusionstackofwindowsanditscontentsdisplayedonthescreen.Ifisanopenwindow,itreturns.[Function]Movestothepositionspeciedbyandaccordingtothefollowingrules:Ifis,(page19.36)iscalledtoreadapositionfrom19.26NILWBorder(HEIGHTIFWINDOW)NILNILWBorderWIDTHIFWINDOWHEIGHTIFWINDOWGETBOXPOSITION(TOTOPW)NILTOTOPFNTTOTOPFNTOTOPW(SHAPEW)GETREGIONRESHAPEFN(CLOSEW)CLOSEWCLOSEFNCLOSEFNDON'TDON'TCLOSEWCLOSEWCLOSEFNDON'TNILOPENW(OPENW)OPENWOPENFNOPENFNDON'TNIL(MOVEW)NILGETBOXPOSITIONBORDERBORDERINTERIORHEIGHTTITLEFLGBORDERINTERIORHEIGHTBORDERTITLEFLGBORDERWINDOWNOCALLTOPWFNWINDOWWINDOWNOCALLTOPWFNWINDOWNOCALLTOPWFNWINDOWNEWREGIONWINDOWNEWREGIONWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWPOSorXYWINDOWPOSorXYPOSorX|b'F ('-y x\8R $&)r.45=uABE9Z%,&WC5 U#G$'D,^2_4BQFdHTAy $,5/378]=>k?BRr#s'02dOt$' +6- 4u6:=ADOEH0M3n ! ()J U0 "&*,/N5I71<>~B`H0IF <M$#%(<-2' 8K:>"FAC5 D!#t%(@),Q/1t 8> GBb\$)+,1m24)9<>Ar AO$;%+E1i57V9>J$:(E)=28:;?CrH\<"$%'S(+_/38,?A:!#(07C5 6T$#&(468=@SAFL46 #l'(,p-479GH}3E0C5 .]w #d)+1Y36>;H&,"`&I+f-/1:9;n=?H+K(* +5:@D2)l )4(7y9>B5D's &H-0\:<3AC~E& __#&|+09>@H${!#]%!u " 'V)+i.2~57;{@ G "${(!)v+"-1349Y C5 %u!"x&147j=?ECG'./037/;=4?A{H<#$'/,/V149@C Hs3 K&H)+b135:@BEP o"]%+K,3C5 !#"%V*k/6G:@AC= 8!.2O6R7;=,@4ALFy( }`m$Rx\8?ZW .TA;R*O A M FA !5>J%+<$9lDO7 4@0 .]A~,4XC6+#/)l#& 2DU${ '%,"HCk1O  8"l }`m$x\8/7W] "()U77 TA&05D:FAD B%)>JC84 8:<76T",-G0,)l.]2''+49!u%_)t-'U 18 8}`m$INTERLISP-DDISPLAYFACILITIEStheuser.Ifisa,isused.Ifandareboth,apositioniscreatedusingastheandasthe.Ifisa,apositioniscreatedusingitsastheandasthe.Ifisnotopenandisnon-,thewindowwillbemovedwithoutbeingopened.Otherwise,itwillbeopened.Ifhastheatomasaproperty(page19.32),thewindowwillnotbemoved.Ifhasanyothernon-valueasaproperty,itshouldbeafunctionorlistoffunctionsthatwillbecalledbeforethewindowismovedwiththeasanargument.Ifitreturnstheatom,thewindowwillnotbemoved.Ifitreturnsaposition,thewindowwillbemovedtothatpositioninsteadoftheonespeciedbyand.Iftherearemorethanones,thelastonetoreturnavalueistheonethatdetermineswherethewindowismovedto.Ifismovedandhasawindowpropertyof(page19.32),itshouldbeafunctionoralistoffunctionsthatwillbecalledafterthewindowismovedwithasanargument.returnsthenewposition,orifthewindowcouldnotbemoved.[Function]Likeformovingwindowsbutisinterpretedrelativetothecurrentpositionof.Example:Thefollowingcodemovestotherightonescreenpoint.[Function]Fillswithitsbackgroundtexture,changesitscoordinatesystemsothattheoriginisthelowerleftcornerofthewindow,setsitsXpositiontotheleftmarginandsetsitsYpositiontothebaselineoftheuppermostlineoftext,ie.thetopofthewindowlessthefontascent.[Function]Putsonthebottomofthestackbymovingallthewindowsthatitcoversinfrontofit.[Function]Redisplaytheregionofthewindow.Ifis,theentirewindowisredisplayed.Ifis,anddoesn'thavea(page19.32),willnotchangeandthemessage``Thatwindowdoesn'thaveaREPAINTFN''willbeprintedinthepromptwindow.[Function]makesasmalliconwhichrepresentsandremoves19.27POSITIONNUMBERPXCOORDYCOORDREGIONLEFTXCOORDBOTTOMYCOORDNILDON'TMOVEFNNILMOVEFNDON'TMOVEFNAFTERMOVEFNMOVEWNIL(RELMOVEW)MOVEW(RELMOVEW(createPOSITIONXCOORD_1YCOORD_0))(CLEARW)(BURYW)(REDISPLAYW)NILNILREPAINTFN(SHRINKW)SHRINKWPOSorXPOSorXPOSorXYPOSorXYPOSorXWINDOWPOSorXWINDOWWINDOWWINDOWPOSorXYWINDOWWINDOWWINDOWWINDOWPOSITIONPOSITIONWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWWINDOWREGIONALWAYSFLGREGIONWINDOWREGIONALWAYSFLGWINDOWWINDOWWINDOWTOWHATICONPOSITIONEXPANDFNWINDOWWINDOW|b' %'*- x\8Y3L'.,./V-B"%4./06R7<EGT5!E"*ZQ %&(-V.37l=P?G(O5&IL 4"%-7.346;>@hDK2n '(+-H- !#,-4:%=BUDF0S#M*l,/>28c;=wCD  &X(,*y,B2M5*79=BGDC;0!)+J-X4\57o<<>FGA!#) *+017q9?ACH0?q$\&(p+07m:;=T@C*F>J_ #'%(W* .9/f3469@D-G6T8"+-[/J3N^! #i&T+024q9=`?A0IC5 .N!k&<+4T5 <AJBE,$*% +.u47BNDF+XP%NC5 # #% -279 @E7G"'H"V&@(-E/ 17K: < =CDGj \k7!#%*,/ 2;569J@6CDGw. %(F*-C5   }"w$)+3-0279;AD]EfSzaC5 7 *,/F9; BIFnG "1 *387-8@EkHo#A-Y/2@69c;@D` *Z-.35n7< C5 2"#'*. ;>r(!}`m$2xY3 uV-(T%PQ 9ZAO!?L1MH-'b.F5z>C;BR>JT9o'+ {m. ') 59DH. }`m$WindowPropertiesfromthescreen.Iconshaveadierentwindowcommandmenuthatcontains``''insteadof``''.Thecommandcallswhichreturnstheshrunkenwindowtoitsoriginalsizeandplace.Theproperty(page19.30)ofthewindowaectstheoperationof.Ifthepropertyofistheatom,prints``Can'tshrinkthatwindow''intheandreturns.Otherwise,thepropertyofthewindowistreatedasa(listof)function(s)toapplyto;ifanyreturnstheatom,prints``Can'tshrinkthatwindow''intheandreturns.,ifgiven,indicatestheimagetheiconwindowwillhave.Ifisastring,atomorlist,theicon'simagewillbethatstring(currentlyimplementedasatitle-onlywindowwithasthetitle.)Ifisa,theicon'simagewillbeacopyofthebitmap.Ifisa,thatwindowwillbeusedastheicon.Ifisnotgiven(asisthecasewheninvokedfromthewindowcommand),thenthefollowingapplyinturn:(1)Ifthewindowhasanproperty(page19.31),itgetscalledwitharguments,whereisthewindowbeingshrunkandisthepreviouslycreatedicon,ifany.Theshouldreturnoneoftheentitiesdescribedaboveorreturntheifitdoesnotwanttochangeit.(2)Ifthewindowhasanproperty(page19.31),itisusedasthevalueof.(3)Ifthewindowhasneitheranorproperty,theiconwillbe'stitleor,ifdoesn'thaveatitle,thedateandtimeoftheiconcreation.givesthepositionthatthenewiconwillbeonthescreen.Ifitis,theiconwillbeinthecornerofthewindowfurthestfromthecenterofthescreen.Inallcasestheiconiscachedontheproperty(page19.31)ofsorepeatingreusesthesameicon(unlessoverriddenbythedescribedabove).Thustochangetheiconitisnecessarytoremovethepropertyorcallexplicitlygivingaargument.[Function]Restoresthewindowforwhichisanicon,andremovestheiconfromthescreen.Ifthe(page19.31)windowpropertyofthemainwindowistheatom,thewindowwon'tbeexpanded.Otherwise,thewindowwillberestoredtoitsoriginalsizeandlocationandthe(orlistoffunctions)willbeappliedtoit.19.12.7WindowPropertiesThebehaviorofawindowiscontrolledbyasetofwindowproperties.Someoftheseareusedbythesystem.However,anyarbitrarypropertynamemaybeusedbyauserprogramtoassociateinformationwithawindow.Formanyapplicationstheuserwillassociatethestructurebeingdisplayedwithitswindowusingaproperty.Thefollowingfunctionsprovideforreadingandsettingwindowproperties:19.28EXPANDSHRINKEXPANDEXPANDWSHRINKFNSHRINKWSHRINKFNDON'TSHRINKWPROMPTWINDOWSHRINKFNDON'TSHRINKWPROMPTWINDOWBITMAPWINDOWSHRINKICONFN()ICONFNICONICONFNICONNILICONWINDOWSHRINKWICONFNICONWINDOWSHRINKW(EXPANDW)EXPANDFNDON'TEXPANDFNWINDOWWINDOWWINDOWTOWHATTOWHATTOWHATTOWHATTOWHATTOWHATWINDOWOLDICONWINDOWOLDICONTOWHATOLDICONTOWHATWINDOWWINDOWICONPOSITIONWINDOWTOWHATICONICON|b'#)E x\8=#&*o+16=pADZa#{%O+ -5<)EXU$)+-b2g57U!'*.0@2=XAuCTA%!M*0.78;"BR$&,.F;-=C P!.&(i*/1<57p8;;<= DqFOP!E#(++2:V>SBGM}), .JO#j)$+/25":W=AHsH$ "%2'+/2j4l7J;0 A GZjk %.03-7;>@AFGE"?$1%](*j,29d:AADDO>w!$#A # #(&)&*-039+<D?c"0$*.0w4&6f8:x?BF=C!%{&)-0DE<~!:&[*.7q8;- AF:r%)-02s:?E8o& '(,.138I:3<_=@IEvG7&!$)<*+//0356=>@B[D5,&,Z2_47:ACmFKH}3"=%&),)/+1569<0!$&,5/ 1w4o7|:1<->=@EGHs/0, m s#!%&)'-v/216;?>AEG-*"2%t' +.40?CH&(,*0h26|9>T EgG':@#o(,-2v479K:@BG% &&'0 6:A"C5 I$'S/026#8>r@DGC](6,0D5;?=?C,Hs !"%*6./6 =@E>G %(z+A03K=?UACk RO>!$"| i x  [L "$&"(O*/R 5?6~:b<,?B(EsG <#+&)+/4172i5h:<BZ =  9 #}&);,14:m>iDH "(-057<AB (!} `m$ xZV%0?QUcTAD#>CwR0 POP.3M! GZAE;A ??cDO=7rD :ro7&5 (f/0*6 (%':% *q" C 5 } `m$xxU7;TA15OPgJ^BDGG GZ)*-8:=LE35C8A ;=8Iy<1_:r469`8 7&8:F=5<@30 (%<=@y"{ +w } `m$INTERLISP-DDISPLAYFACILITIES[NoSpreadFunction]Returnsthepreviousvalueof'saspect.Ifisgiven,(evenifgivenas),itisstoredasthenewaspect.Someaspectscannotbesetbytheuserandwillgenerateerrors.Anynamethatisnotrecognizedisstoredonapropertylistassociatedwiththewindow.[Function]addsanewitemtoawindowproperty.Ifistoanelementofthepropertyofthewindow,nothingisadded.Ifthecurrentpropertyisnotalist,itismadealistbeforeadded.returnsthepreviousproperty.Thenewitemalwaysgoesontheendofthelist.(Note:Iftheorderofitemsinthelistisimportant,thelistcanbemodiedusing.)isusefulforaddingorfunctionstoawindowwithoutaectingitsexistingfunctions.[Function]deletesfromthewindowpropertyofandreturnsthepreviouslistifwasanelement.Ifwasnotamemberofwindowproperty,isreturned.19.12.7.1MouseFunctionWindowPropertiesThesepropertiesallowtheusertocontroltheresponsetomouseactivityinawindow.Thevalueoftheseproperties,ifnon-,shouldbeafunctionthatwillbecalled(withthewindowasargument)whenthespeciedeventoccurs.Note:thesefunctionsshouldbe``self-contained'',communicatingwiththeoutsideworldsolelyviatheirwindowargument,e.g.,bysettingwindowproperties.Inparticular,thesefunctionsshouldnotexpecttoaccessvariablesboundonthestack,asthestackcontextisformallyundenedatthetimethesefunctionsarecalled.Sincethefunctionsareinvokedasynchronously,theyperformanyinputoperationsfromtheirownwindow.[WindowProperty]Wheneverabuttongoesdowninthewindowandtheprocessassociatedwiththewindow(storedundertheproperty)isnotthettyprocess,theiscalled.Thedefaultis(page18.34)whichgivestheprocessassociatedwiththewindowthettyandcallsthe.[WindowProperty]Wheneverthemousemovesintothewindow,theiscalled.[WindowProperty]Theiscalledwhenthecursorleavesthewindow.[WindowProperty]Theiscalledwheneverthecursorhasmovedandisinsidethewindow.Thisallowsawindowfunctiontoimplement``active''regionswithinitselfbyhavingitsdetermineifthecursorisinaregionofinterest,andifso,performsomeaction.19.29(WINDOWPROP)NIL(WINDOWADDPROP)WINDOWADDPROPEQWINDOWADDPROPWINDOWPROPWINDOWADDPROPOPENFNCLOSEFN(WINDOWDELPROP)WINDOWDELPROPNILNILTTYWINDOWENTRYFNPROCESSWINDOWENTRYFNGIVE.TTY.PROCESSBUTTONEVENTFNCURSORINFNCURSORINFNCURSOROUTFNCURSOROUTFNCURSORMOVEDFNCURSORMOVEDFNCURSORMOVEDFNWINDOWPROPNEWVALUEWINDOWPROPNEWVALUEPROPPROPWINDOWPROPITEMTOADDITEMTOADDPROPWINDOWITEMTOADDWINDOWPROPITEMTODELETEITEMTODELETEPROPWINDOWITEMTODELETEITEMTODELETEPROP|b' %'*- x\:<CZ%I)0\5;D<EXl $&+'(-&.1C8<@EeWI"%v(-18CEfMH &b'*+./15d69 EfL#')/m58E;!>3BEGJaZl!*%' )i-.2t46{8: @C,EgGHi)w6>7;=HG $%&,168j=p DC5 Bk#X26+8>2H&@ %([.*0<?AH\?!$k&(-p/'4N=:AB|: q  x6V  C.#\%+A,1,578>HADFW4 U/%,'*,0{4 6e;=5CG3 ?0  {}!$ (} 2&5G7<}@nDTF._ {y$ + , 3g6<AiCH0,  ;!#'^,&-29h:=L@gC+  ;`$<.01;6<.? Fy)n  01&i=C$p$v'+-0>58;@' F#L$(298:C<?AG!x#P$*-%2AE1 "(M /325;P>-@CG,"'=C8 $)*,.]3?$@|=C$>%)-M/37:;=C+%'r+n14 8@:?GBCxGK Q$j%*/18i =BSF 2+2 35:0;=b>BD :[#(&(}p`m$jx\: %/X"ER (AP GL H! * BGD *Bk ?>4+9'&i #+!x 3, ' 69 | |  +  !}p`m$lx\:/:q!#Z+/113<@UAX485WI46Rg %P>ACOR%&8\<M=vB:Dg Bk(' D E@2Q ? 9; }`m$|EventWindowProperties[WindowProperty]Theiscalledwheneverthereisachangeinthestate(upordown)ofthemousebuttonsinsidethewindow.Changestothemousestatewhiletheisrunningwillnotbeinterpretedasnewbuttonevents,andthewillnotbere-invoked.[WindowProperty]Theiscalledinlieuofthestandardwindowmenuoperationwhenthekeyisdepressedinawindow.Morespecically,theiscalledinsteadofthewhen.Ifthekeyistobetreatedlikeanyotherkeyinawindow,supplyandwiththesamefunction.Note:Whenanapplicationprogramdenesitsown,thereisaconventionthatthedefault,(page19.22),maybeexecutedbydepressingthekeywhenthecursorisintheheaderorborderofawindow.Userprogramsareencouragedtofollowthisconvention.19.12.7.2EventWindowProperties[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctionsthatarecalledjustbeforeawindowisclosedby(page19.26).(Note:Iftheofthelistisaword,itistreatedasasinglefunction.)Thefunction(s)willbecalledwiththewindowasasingleargument.Ifanyofthesaretheatom,orifthevaluereturnedbyanyofthesistheatom,thewindowwillnotbeclosed.Note:Ashouldnotcallonitsargument.[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctions.Ifoneofthesistheatom,thewindowwillnotbeopened.Otherwise,thesarecalledafterawindowhasbeenopenedby(page19.26),withthewindowasasingleargument.[WindowProperty]Ifnon-,wheneverthewindowisbroughttothetop,theiscalled(withthewindowasasingleargument).Thisfunctionmaybeusedtobringacollectionofwindowstothetoptogether.Iftheargumentof(page19.26)isnon-,theofthewindowisnotcalled,whichprovidesawayofavoidinginniteloopswhenusingfromwithina.[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctionsthatarecalledjustbeforeawindowisshrunkenby(page19.27),withthewindowasasingleargument.Ifanyofthesaretheatom,19.30BUTTONEVENTFNBUTTONEVENTFNBUTTONEVENTFNBUTTONEVENTFNRIGHTBUTTONFNRIGHTBUTTONFN(DOWINDOWCOM)RIGHTRIGHTBUTTONFNBUTTONEVENTFN(MOUSESTATE(ONLYRIGHT))RIGHTRIGHTBUTTONFNBUTTONEVENTFNRIGHTBUTTONFNRIGHTBUTTONFNDOWINDOWCOMRIGHTCLOSEFNCLOSEFNCLOSEWCARLAMBDACLOSEFNDON'TCLOSEFNDON'TCLOSEFNCLOSEWOPENFNOPENFNOPENFNDON'TOPENFNOPENWTOTOPFNNILTOTOPFNTOTOPWNILTOTOPFNTOTOPWTOTOPFNSHRINKFNSHRINKFNSHRINKWSHRINKFNDON'TNOCALLTOPWFN|b'"%+3 x\:=CZ&@'+2K578=?BEgHX$@)--'/5):CF,WI%[&+.|02 9;e>DBG(U%t(*,~. R=CP&,'+-0k2B4:u?COR#'/24;[=|?F!M ,.268dF+L,.7/7T:;=?DiG?JaH &H61DbGH E! (.T24BCGCHD !$3>BWFBk! (0269,=?@CoH@$'.0T 79N=@! |<` qN x7=C6V %+./14:]<=:?oA G4  %&K+,158<AlEG3 7} !({,E-.3V459 @5B 1eSE <#X%*,-18]9<>>FG/!!"$&C(,254M7 8A:B`CFc.$:&)V+E+#'*n246b(=C&i$*a,./38:;=?Y EG4$o "#|%-.16;8;y=yC # )"&)*0%26:AEr!x"B#%)r=C@z%(8-y.4I68;pDfE'X#$&7*? 14:=?CDH %7&)B+|'.B6g:?@F4G"S')+/49:=?E.0L(2+/6+=C!'=,/126<>k?BC  #')/.g/5>xBEF :/ "%,."02|;<>AQI(}`m$|x\: Z WI U R P OR *M!@ : L !&2oJa* 8 E7 D( 4 Bk+/7 6Vu43>3 #1e@/;Y.+,( &ib$)u# <r =|0iC0"1+  8 :4D}`m$x|c!Y}H `m$INTERLISP-DDISPLAYFACILITIESorifthevaluereturnedbyanyofthesistheatom,thewindowwillnotbeshrunk.[WindowProperty]If(page19.27)iscalledwithoutbegingivenaargument(asisthecasewheninvokedfromthewindowcommand)andthewindow'spropertyisnon-,thenitgetscalledwithtwoarguments,thewindowbeingshrunkandthepreviouslycreatedicon,ifany.Theshouldreturnoneoftheentitiesdescribedonpage19.27orreturnthepreviouslycreatediconifitdoesnotwanttochangeit.[WindowProperty]If(page19.27)iscalledwithoutbeinggivenaargument,thewindow'spropertyis,andthepropertyisnon-,thenitisusedasthevalueof.[WindowProperty]Wheneveraniconiscreated,itiscachedonthepropertyofthewindow,socallingagainwillreusethesameicon(unlessoverriddenbythe.Thus,tochangetheiconitisnecessarytoremovethepropertyorcall(page19.27)explicitlygivingaargument.[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctions.Ifoneofthesistheatom,thewindowwillnotbeexpanded.Otherwise,thesarecalledafterthewindowhasbeenexpandedby(page19.28),withthewindowasasingleargument.[WindowProperty]Ifthepropertyis,thewindowwillnotscroll.Otherwise,itshouldbeafunctionoffourarguments:(1)thewindowbeingscrolled,(2)thedistancetoscrollinthehorizontaldirection(positivetoright,negativetoleft),(3)thedistancetoscrollintheverticaldirection(positiveup,negativedown),and(4)aagwhichisifthescrollingbuttonisbeinghelddown.Formoreinformation,see(page19.24).Formostscrollingwindows,thefunctionshouldbe(page19.24).[WindowProperty]Theispassedastheargumentto(page19.37)whenthewindowisreshaped.[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctionsthatarecalledwhenawindowisreshapedby(page19.26).Iftheisoralistcontaining,thewindowwillnotbereshaped.Otherwise,thefunction(s)arecalledafterthewindowhasbeenreshaped,itscoordinatesystemreadjustedtothenewposition,thetitleandborderdisplayed,andtheinteriorlledwithtexture.Theshoulddisplayanyadditionalinformationneededtocompletethewindow'simageinthenewpositionandshape.Theiscalledwiththreearguments:(1)thewindowinitsreshapedform,(2)abitmap19.31CLOSEFNDON'TICONFNSHRINKWSHRINKICONFNNILICONFNICONSHRINKWICONFNNILICONNILICONWINDOWICONWINDOWSHRINKWICONFNICONWINDOWSHRINKWEXPANDFNEXPANDFNEXPANDFNDON'TEXPANDFNEXPANDWSCROLLFNSCROLLFNNILTSCROLL.HANDLERSCROLLFNSCROLLBYREPAINTFNNEWREGIONFNNEWREGIONFNGETREGIONRESHAPEFNRESHAPEFNSHAPEWRESHAPEFNDON'TDON'TRESHAPEFNRESHAPEFNTOWHATTOWHATTOWHATTOWHATTOWHATNEWREGIONFN|b' %'*- x\8j) &g(b+,467n9A{BXDZOW=CU#')W-h26q:?AvGTAwg"'^*27>AyCR6"$8)|*Y-}.158;W BXDPw "%= +045~8A1EOP%8*1026]:7<9@CA Mkm ""%O'+,1lJ=CH#{')-2669@GGZ#C(,-0r6(?iAC 25&')e+34v6<>ANCK1 ()?+/3W5;B=AuG/v !&3)K+02{37,q=C*"(+,/43692=V DEe)& r">%U ,.1L6:d?B"D'gJ! (.4I6-:?AE#G%"}$=&+1g79?CF{H$4L^!2"$*.0k4:7Y;>kB "&G*.1W4:7@? !2N6 =C>$&V*,9?cv#'%*,=C"D'F,/015:<=?A>GG!Z"l'}(.59>?j " -.e058q:<C  "&),>1M36<> EfV ,"$*],/W16T <?OAFb  +/4^7 = E T8!'+-P/27:> e 0# *-/{46\8;>ACE.(!}`m$x\8/=HW UDTA-)R&P;J H8GZ*P2@B A < ?c#B=:9 9/6 4h2 /X1!K/v,q *h)y$4" B # > A VG0kA)` " A!}@`m$xU;=<?OP# #H; <?E$G%(935E8>/p "} ,`m$6MiscellaneousPropertieswiththecontentsoftheoldwindow,and(3)theregionwithinthebitmapthatcontainstheoldimage.Thisfunctionisprovidedsothatuserscanreformatwindowcontentsorwhatever.(page19.33)isthedefaultandshouldbeusefulformanywindows.[WindowProperty]Thewindowpropertycanbeasinglefunctionoralistoffunctionsthatarecalledtorepaintpartsofthewindowby(page19.27).Thesarecalledwithtwoarguments:thewindowandtheregioninthecoordinatesofthewindow'sdisplaystreamoftheareathatshouldberepainted.Beforetheiscalled,theclippingregionofthewindowissettoclipalldisplayoperationstotheareaofinterestsothatthecandisplaytheentirewindowcontentsandtheresultswillbeappropriatelyclipped.(Note:(page19.27)shouldnotbeusedinsbecauseitresetsthewindow'scoordinatesystem.Ifawantstoclearitsregionrst,itshoulduse(page19.12).)[WindowProperty]Iftheis,thewindowwillnotbemovedby(page19.26).Otherwise,iftheisnon-,itshouldbeafunctionoralistoffunctionsthatwillbecalledbeforeawindowismovedwithtwoarguments:thewindowbeingmovedandthenewpositionofthelowerleftcornerinscreencoordinates.Ifthereturns,thewindowwillnotbemoved.Ifthereturnsa,thewindowwillbemovedtothatposition.Otherwise,thewindowwillbemovedtothespeciednewposition.[WindowProperty]Ifnon-,itshouldbeafunctionoralistoffunctionsthatwillbecalledafterthewindowismoved(by,page19.26)withthewindowasanargument.19.12.7.3MiscellaneousProperties[WindowProperty]Accessesthetitleofthewindow.Ifatitleisaddedtoawindowwhosetitleisorthetitleisremoved(setto)fromawindowwithatitle,thewindow'sexterior(itsregiononthescreen)isenlargedorreducedtoaccomodatethechangewithoutchangingthewindow'sinterior.Forexample,changesthetitleoftobe``Results''.removesthetitleof.[WindowProperty]Accessesthewidthoftheborderofthewindow.Theborderwillhaveatmost2pointofwhite(butnevermorethanhalf)andtherestblack.Thedefaultborderisthevalueoftheglobalvariable(initially4).[WindowProperty]Usedtolimitscrollingoperations(seepage19.23).Accessestheextentregionofthewindow.Ifnon-,theisaregioninthewindow'sdisplaystreamthatcontainsthecompleteimageoftheobjectbeingviewedbythewindow.Userprogramsareresponsibleforupdatingthe.Thefunctions,19.32RESHAPEBYREPAINTFNREPAINTFNREPAINTFNREDISPLAYWREPAINTFNREPAINTFNREPAINTFNCLEARWREPAINTFNREPAINTFNDSPFILLMOVEFNMOVEFNDON'TMOVEWMOVEFNNILMOVEFNDON'TMOVEFNPOSITIONAFTERMOVEFNNILMOVEWTITLENILNIL(WINDOWPROP'TITLE"Results")(WINDOWPROP'TITLENIL)BORDERWBorderEXTENTNILEXTENTEXTENTUNIONREGIONSWINDOWWINDOWWINDOWWINDOW|b'"! + x\:\"$'<)/k2@47;c?BBGZF"'+7028:=AsD=X""#9=}ABE9WI[ $'*TD=CR"'-023R7I<>?BCPt "l'*,<.3>BkGOR6 ]"&*, 4A6<>AUEGM  #B)\.!24s69<AfCl L&(,v.448:B<ACTEzG3Jaq %/&)g,t.C345 7BE/H#\(+.!25F7M ?ExG^!C%* ,.25;<BCGEp $*7+5t9|;T>@E;HC$(@=C?.!)&'*/E14o6f:AEs=y q'(.?/0Z467=2>@B8C;bt#')G.048: B5D:.z "%3(*-s/715s7BD 8J!{*+-3I68:@+A6c$R%;',/167:@ G5=v!e%')/2}27=C04yb %I'F(|-/13M5;=@BF.* %+,/379c>@7B%|* q h x&#=C$}t #$'-/14 5:;=OBG"!X$k&,.3d48T9?3BDG!1"%")i+u-249;i@Bd  #), 27:F,247?nAACW @179s<>CN;=CF#%[',F.0q6=9=@TCEEHI #'+2.\01469=@EfJn #)'H2 8RD=CG X% ,/x27=8?CH& !g&'/1 2>68A:@Eq So"&(, -04.7<>@F  &(.r56i9I("}8`m$xX*1TD RP5 ORLJa:dG4 Ep-5C@ ?"<=y"+8&MDO627 0.'&# "X0@ # @ '-; J,zD  $&) 0> }8`m$x9j=@!%=B$} T`m$ INTERLISP-DDISPLAYFACILITIES,etc.(page19.3)areusefulforcomputinganewextentregion.Insomesituations,itisusefultodeneanthatonlyexistsinonedimension.Thismaybedonebyspecifyinganregionwithawidthorheightof.handlingrecognizesthissituationasmeaningthatthenegativedimensionisunknown.[WindowProperty]Ifthewindowpropertyisnon-,itshouldbeaandwillbemadetheTTYprocessby(page18.34),thedefaultproperty.Thisimplementsthemechanismbywhichthekeyboardisassociatedwithdierentprocesses.[WindowProperty]Iftheisnon-,itwillbecalledwiththewindowasasingleargumentwhenthewindowisfull(i.e.,whenenoughhasbeenprintedsincethelastinteractionsothatthenextcharacterprintedwillcauseinformationtobescrolledothetopofthewindow.)Iftheis,thesystemfunction(page19.33)iscalled.Note:isonlycalledonwindowswhicharetheofsomeprocess(seepage19.15).Thefollowingpropertiesareread-only(i.e.theirpropertyvaluescannotbechangedusing.[WindowProperty]Valueisthedisplaystreamofthewindow.Allsystemfunctionswilloperateoneitherthewindoworitsdisplaystream.[WindowProperty][WindowProperty]Valueistheheightandwidthoftheinteriorofthewindow(theusablespacenotcountingtheborderandtitle).[WindowProperty]Valueisaregion(inscreencoordinates)indicatingwherethewindow(countingtheborderandtitle)islocatedonthescreen.19.12.8AuxiliaryFunctions[Function]Itstheoldregioncontentsintothelowerleftcornerofthenewregion.Ifthenewshapeislargerineitherorbothdimensions,thenewareasexposedaretothetopandrightoftheoldimage.Whenthishappens,calls's(page19.32)todisplaythenewlyexposedregion'scontents.Notethatthismayresultintwocallstothe.[Function]Ifthewindowproperty(page19.33)is,whenthewindowisfullthesystemfunctioniscalled.simplyreturnsiftherearecharactersinthetype-inbuerfor,otherwiseitinvertsthewindow19.33EXTENDREGIONEXTENTEXTENT-1SCROLLFNEXTENTPROCESSPROCESSNILPROCESSGIVE.TTY.PROCESSWINDOWENTRYFNPAGEFULLFNPAGEFULLFNNILTTYPAGEFULLFNNILPAGEFULLFNPAGEFULLFNTTYDISPLAYSTREAMWINDOWPROPDSPHEIGHTWIDTHREGION(RESHAPEBYREPAINTFN)BITBLTRESHAPEBYREPAINTFNREPAINTFNREPAINTFN(PAGEFULLFN)PAGEFULLFNNILPAGEFULLFNPAGEFULLFNWINDOWOLDIMAGEOLDREGIONWINDOWWINDOWWINDOW|b' %'*- x\:!"%K),k.25 ;= ?DY5 $t&',4.02:=A9E9G4W  "R%m'w+- 3;R?BD"HUy(+- 47o= >DGTD")E*Q>=CO;"&'a- .346&:<DkG4M $,)E9=BE9LM#*.k 6<9@CGJ %z(. G=CEX%&+,.s1M3l7:=gBDEDW!$ )C*-X0x4:90;?CGBs $k&P)?+.49<@ H0A !#&'*a02o=ABEf?e&)-/@<`$C%(v,C. 379:^!$'7   #kx!$a'-(1I57<I4=C3 1$i(*--35:@BG1e#$&+]._=C,=C+ o#&b*E,.b3L57i<?oCGj)nR$'&&i=C$?"%$)w 1O 7;>tC#{!0$t%*,.| iUxTC5 !e#'-O02h6!8<>p@CH\ "%'+-C0v 7:K=0@EH0c :"$K&)-14q 1)-2 38;1?TD!#&q)r-:.146I@6C5 lZ l.2i6g:B; >@EGT ,.[;@@DFW ! ">$')l-586% O1H=M+LM G E )\BGA 4 ?r?e <` ;7@ 4 ._ , &i T /c:9!8 Z l% 7 # 2 "}4`m$xT %(F/ !/4 "},`m$*Example:AScrollableWindowandwaitsfortheusertotypeacharacter.isuseradvisable.19.12.9Example:AScrollableWindowThefollowingisasimpleexampleshowinghowonemightcreateascrollablewindow.createsawindowthatdisplaystheprettyprintedexpression.Thewindowproperties,,andareusedforsavingthisexpression,andtheinitialwindowposition.Usingthisinformation,simplyreinitializesthewindowposition,andprettyprintstheexpressionagain.Notethatthewholeexpressionisreformattedeverytime,evenifonlyasmallpartactuallylieswithinthewindow.Ifthiswindowwasgoingtobeusedtodisplayverylargestructures,itwouldbedesirabletoimplementamoresophisticatedthatonlyredisplaysthatpartoftheexpressionwithinthewindow.However,thisschemewouldbesatisfactoryifmostoftheitemstobedisplayedaresmall.resetsthewindow(andstorestheinitialwindowposition),callstodisplaythewindow'sexpression,andthensetsthepropertyofthewindowsothatwillbeabletohandlescrollingand``thumbing''correctly.19.34PAGEFULLFNCREATE.PPWINDOWEXPRPPEXPRPPORIGXPPORIGYREPAINT.PPWINDOWREPAINTFNRESHAPE.PPWINDOWREPAINT.PPWINDOWEXTENTSCROLLBYREPAINTFN(DEFINEQ(CREATE.PPWINDOW[LAMBDA(EXPR)(*rrb``4-OCT-8212:06'')(*createsawindowthatdisplaysaprettyprintedexpression.)(PROG(WINDOW)(*asktheuserforapieceofthescreenandmakeitintoawindow.)(SETQWINDOW(CREATEWNIL"PPwindow"))(*puttheexpressiononthepropertylistofthewindowsothattherepaintandreshapefunctionscanaccessit.)(WINDOWPROPWINDOW(QUOTEPPEXPR)EXPR)(*settherepaintandreshapefunctions.)(WINDOWPROPWINDOW(QUOTEREPAINTFN)(FUNCTIONREPAINT.PPWINDOW))(WINDOWPROPWINDOW(QUOTERESHAPEFN)(FUNCTIONRESHAPE.PPWINDOW))(*makethescrollfunctionSCROLLBYREPAINTFN,asystemfunctionthatusestherepaintfunctiontodoscrolling.)(WINDOWPROPWINDOW(QUOTESCROLLFN)(FUNCTIONSCROLLBYREPAINTFN))(*callthereshapefunctiontoinitiallyprinttheexpressionandcalculateitsextent.)(RESHAPE.PPWINDOWWINDOW)|b' B&O' .5x\:[ "n%d'*+G :<> |W iw \xSq  8a5$'*>.1203Y 9qPl32"%w*-Y16{ @ADN g$&(k+-24 ;>q@DM ;i7 -s2 9t<AXG(Kz S h"$'@+L 23o :>BEcFI #[ %'y*&/[2579<>C_FyH/ z?&':* :=@ GF  E z%+^.37e9u @B-EGD  ?.HAP"|%~)/+`,/1B46~:@8    U!%(+4c:e<?QAvDG>aP F!&v)+. 6N8'(!}`m$x\:1 Pl =VN]CM NH/2A <@8.i> ; 8B 6 S{'T) +R,-1)34'T) -.36|3Q'T(,t1 x0 HS{'T) +-024979S._'T+t.13.576x,S]?$(++{+'T) +v- 4`6\)n'T,.0279''T).B05&#'T). x$}S h"I(+"h{'T) +'-{24!1'T xS h"I(+ h$@S h"I(+ h${'T) ,/2O'T8F9'T,/~2k4'T,.V0F x^S h"I(+h${'T) +-283 l'T,Q/1 8 'T-.x !S!r!}x`m$fINTERLISP-DDISPLAYFACILITIES19.35(RETURNWINDOW])(REPAINT.PPWINDOW[LAMBDA(WINDOWREGION)(*rrb``4-OCT-8211:52'')(*therepaintingfunctionforawindowwithaprettyprintedexpression.Thisrepaintingfunctionignorestheregiontoberepaintedandrepaintstheentirewindow.)(*setthewindowpositiontothebeginningoftheprettyprintingoftheexpression.)(MOVETO(WINDOWPROPWINDOW(QUOTEPPORIGX))(WINDOWPROPWINDOW(QUOTEPPORIGY))WINDOW)(PRINTDEF(WINDOWPROPWINDOW(QUOTEPPEXPR))0NILNILNILWINDOW])(RESHAPE.PPWINDOW[LAMBDA(WINDOW)(*rrb``4-OCT-8212:01'')(*thereshapefunctionforawindowwithaprettyprintedexpression.)(PROG(BTM)(*setthepositionofthewindowsothattherstcharacterappearsintheupperleftcornerandsavetheXandYfortherepaintfunction.)(DSPRESETWINDOW)(WINDOWPROPWINDOW(QUOTEPPORIGX)(DSPXPOSITIONNILWINDOW))(WINDOWPROPWINDOW(QUOTEPPORIGY)(DSPYPOSITIONNILWINDOW))(*calltherepaintfunctiontoprettyprinttheexpressioninthenewlyclearedwindow.)(REPAINT.PPWINDOWWINDOW)(*savetheregionactuallycoveredbytheprettyprintedexpressionsothatthescrollingroutineswillknowwheretostop.Theprettyprintingoftheexpressiondoesacarriagereturnafterthelastpieceoftheexpressionprintedsothatthecurrentpositionisthebaselineofthenextlineoftext.Hencethelastvisiblepieceoftheexpression(BTM)istheendingpositionplustheheightofthefontabovethebaselinee.gitsASCENT.)(WINDOWPROPWINDOW(QUOTEEXTENT)(createREGIONLEFT_0|b' %'*- x("}$`m$x\GS W U S {'T) +R,-1)3R*. "%&L+$.$/_3<7 Q*> !&(-.069)O`*wL'T) +%-x2R7e9Jn'T-/615iH'T)+] xG# H #)E} #)CB1 H %+@]!r; :; S{'T) +R,-1)38'T) +`0F2576'T)[,0/30r4S5J'T(+x3 HS{0Y*J\ "W$_'0(+.0468;.*|B"%}')X,-/2 69'x+gS)S h"I(+(h (++&vS h"I(+$h (++{#+'T) +-257!'T+5.02<47p'T)-2#4*x9S!r{SOy"'n)O+/45{7:H*Ri"%).-.2148;*) "#'@+Y.03y68*Y "%H'"),A/0258W*}B P$&)y-1256c8*H "F%'*F.h02f5?9 *C:,x S h"I(+  t!r}$`m$|InteractiveDisplayFunctions19.13INTERACTIVEDISPLAYFUNCTIONSThefollowingfunctionsallowtheusertointeractivelyspecifypositionsorregionsonthedisplayscreen.[Function]Returnsathatisspeciedbytheuser.waitsfortheusertopressandreleasetheleftbuttonofthemouseandreturnsthecursorpositionatthetimeofrelease.Ifisa,thepositionwillbeinthecoordinatesystemof'sdisplaystream.Ifis,thepositionwillbeinscreencoordinates.Ifisa,thecursorwillbechangedtoitwhileisrunning.Ifis,thevalueofthesystemvariablewillbeusedasthecursor.[Function]Allowstheusertopositiona``ghost''regionofsizebyonthescreen,andreturnstheofthelowerleftcorneroftheregion.Ifisnon-,rstprintsitinthe.thenchangesthecursortoabox(usingtheglobalvariable).Ifandarenumbers,theyaretakentobetheoriginalpositionoftheregion,andthecursorismovedtothenearestcornerofthatregion.Theuseristhenfreetomovethecursoraroundthescreen.Whenamousebuttonisdepressed,aghostregionislockedtothecursorsothatifthecursorismoved,theghostregionmoveswithit.Ifandarenumbers,thecorneroftheoriginalregionthatisnearestthecursorpositionatthetimethebuttonispressedislocked,otherwisethelowerleftcornerislocked.Theusercanchangetoanothercornerbycontinuingtoholddowntheleftbuttonandholdingdowntherightbuttonalso.Withbothbuttonsdown,thecursorcanbemovedacrossthescreenwithouteectontheghostregionframe.Whentherightbuttonisreleased,themousewillsnaptothenearestcorner,whichwillthenbecomelockedtothecursor.Whenallbuttonsarereleased,thelowerleftcorneroftheregionisreturned.Ifisa,thereturnedpositionwillbein'scoordinatesystem;otherwiseitwillbeinscreencoordinates.Example:19.36BOTTOM_[SETQBTM(IPLUS(DSPYPOSITIONNILWINDOW)(FONTPROPWINDOW(QUOTEASCENT]WIDTH_(WINDOWPROPWINDOW(QUOTEWIDTH))HEIGHT_(IDIFFERENCE(WINDOWPROPWINDOW(QUOTEHEIGHT))BTM]))(GETPOSITION)POSITIONGETPOSITIONWINDOWNILCURSORGETPOSITIONNILCROSSHAIRS(GETBOXPOSITION)POSITIONNILGETBOXPOSITIONPROMPTWINDOWGETBOXPOSITIONBOXCURSORWINDOW(GETBOXPOSITION100200NILNILNIL"Specifythepositionofthecommandarea.")WINDOWCURSORWINDOWWINDOWWINDOWCURSORCURSORWIDTHHEIGHTORGXORGYWINDOWPROMPTMSGWIDTHHEIGHTPROMPTMSGORGXORGYORGXORGYWINDOWWINDOW|b' ',G i  5xC  l!#l +'/57B<> @gE@C5 >%|(])/14AE0G=@ z#k()*-r246;<>.CE;[ #%d*d129"9<<AjDEG9 |# *2+0o5=1A8B+D8OM:" )02R89\;?BDs6V(()/U6o:b;A=AKCEf5%(l*[-/@11C5 0Ya"#)X*/4R68=EMG.u$b.z0p3 79>L@BBH\- !1&v3e6 9;<I+g$'c,/;35d69=@cD)6 &f-6/58;>@~BtD(y %O'*@.Z/4$58 <@BEF&vpZ!$&/),/0N47L<@ A&Eo$  $(*U.0o278;=?cCE#+"=&)+18; AFCH&!4i#&(n-L/449;h=AHCHs")+~/S16.7<?BE99g"$ +-047)9>2@F" %)8,158K<?1A9E0#'),\0/49=@^CHsH<#&q)+=-2/6:=a@wE|i $&,.h4$6:s<A]C*EX&(D./j17t<?qAlH}W d#T)x*-v/e15G R(}`m$x\G!r'T*0 DWV +1i7KU!r -6 7K=,CRe-6P @ >+7 ;49>8O3x6c 75 1 8.&- #'8 > +g ))xL%(t+/-2 #j&.V047:"}`m$x@;+09$)7=;k8O+Z601]S!#&6'*.020Y9@- M)"S$)"*#+-/[46T %C$GS}|`m$hINTERLISP-DDISPLAYFACILITIESpromptstheuserfora100wideby200highregionandreturnsitslowerleftcornerinscreencoordinates.[Function]Letstheuserspecifyanewregionandreturnsthatregioninscreencoordinates.promptsforaregionbydisplayingafour-prongedboxnexttothecursorarrow.Iftheuserpressestheleftbutton,onecornerofa``ghost''regionoutlineislockedtothatpointandtheoppositecornerislockedtothecursor.Asthecursormoves,theoutlineexpands.Tospecifyaregion,theusermovesthecursortoonecorneroftheintendedregion,pressestheleftbutton,movesthecursortotheoppositecornerwhileholdingdowntheleftbutton,andthenreleasesthebutton.Ifisaandtheuserpressesthemiddlebutton,thecorneroffarthestfromthecursorpositionisxedandthecornernearestthecursorislockedtothecursor.Onecanswitchfromonecornertoanotherwhilepositioningtheregion.Tochangetoanothercorner,continuetoholddowntheleftbuttonandholddowntherightbuttonalso.Withbothbuttonsdown,thecursorcanbemovedacrossthescreenwithouteectontheghostregionframe.Whentherightbuttonisreleased,thecursorwillsnaptothenearestcorner,whichwillbecomethemovingcorner.Inthisway,theregionmaybemovedalloverthescreen,beforeitssizeandpositionisnalized.and,ifgiven,arethesmallestandthatthereturnedregionwillhave.Iftheuserspeciedregionissmaller,itwillbeincreasedinwidthorheighttothesedimensions.Ifisnon-,itwillbecalledtodeterminevaluesforthepositionsofthecorners.Thisprovidesawayof``ltering''prospectiveregions;forinstance,byrestrictingtheregiontolieonanarbitrarygrid.Whentheuserisspecifyingaregion,theregionisdeterminedbytwoofitscorners,onethatisxedandonethatistrackingthecursor.Eachtimethecursormovesoramousebuttonispressed,iscalledwiththreearguments:,thepositionofthexedcorneroftheprospectiveregion;,thepositionoftheoppositecorneroftheprospectiveregion;and.allowsthecalleroftopassinformationtothe.Thersttimeabuttonispressed,isandisthepositiontheuserselectedforthexedcornerofthenewregion.Inthiscase,thepositionreturnedbywillbeusedforthexedcornerinsteadoftheoneproposedbytheuser.Forallothercalls,isthepositionofthexedcorner(asreturnedbythepreviouscall)andisthenewpositiontheuserselectedfortheoppositecorner.Inthesecases,thevalueofisusedfortheoppositecornerinsteadoftheoneproposedbytheuser.Inallcases,theghostregionisdrawnwiththevaluesreturnedby.[Function]Performsthesamepromptingasandreturnsthespeciedbytheuserinsteadoftheofitslowerleftcorner.19.37(GETREGION)GETREGIONREGIONWIDTHHEIGHTNILGETREGIONNIL(GETBOXREGION)GETBOXPOSITIONREGIONPOSITIONMINWIDTHMINHEIGHTINITREGIONNEWREGIONFNNEWREGIONFNARGINITREGIONINITREGIONMINWIDTHMINHEIGHTNEWREGIONFNNEWREGIONFNFIXEDPOINTMOVINGPOINTNEWREGIONFNARGNEWREGIONFNARGNEWREGIONFNMOVINGPOINTFIXEDPOINTNEWREGIONFNFIXEDPOINTMOVINGPOINTNEWREGIONFNNEWREGIONFNWIDTHHEIGHTORGXORGYWINDOWPROMPTMSG|b' %'*- x\:>"$@%Q'+,/`2k690=?C7EZS WC5 U. 9$&$)$-x0A57<9=BD TD%Y'(-M/b 67G:=?BEGR "1$',m.1l6N9=q?@@EPN"!#&*B,/\49.:?@CGOR"j#'%*d0278=@ C"GM %&)/a4-8;>CGLa% )],157:c?ADJaG\ "d)+.(158<ACH&E$(*.459;>YBGD;!#J%A !$a&+!,157 <2>uC.E9?eT["(*N-|1D36:=:@hD0F=#&R+M/y168:?-C@E< "%(-158f;@JAG:t!#&*/36q;>CH8@h#&(-[/C2U495=z?NAD7)4#()+/K14H>G2~*$L'+T,/~28b<>YCEG0V#4$)-*._ -"$")g**+g-/35?;?AD,-V $ )*-}/- 5 <B D=* "n&(b*S,[.M37_;w=@B@ H(+p"# +,/1)27:=C>ADG'<r %),,[.27H9:L>C)D%!#%'6*k. <=@QEG#G #M *}78;#@XBD^"J2+ (A-[B=DU)[,.%1x36C9>%BDG4"%(B*6-9A:=BXDFxh#q%W'-0;=5?BWG"$* .04Z8-:>C3!i' +w0H2!47k=?B EGwm!q%'+P.h04:EqC5  r$3+89<A &GA!$)C*46L8%;>^(!} (`m$jxW @TDG\#4#9A\-& #3q 6-+ DO &-X!} (``m$8xW*u"E *x 4 ?G\% E 4#!- % 5i #/01"J0Q ;_=c Hq < ))+91 h 1C h24@ w< q !$&P(-/)0} `m$tMenus19.14MENUSAmenuisbasicallyameansofselectingfromalistofitems.Thesystemprovidescommonlayoutandinteractiveuserselectionmechanisms,thencallsauser-suppliedfunctionwhenaselectionhasbeenconrmed.Thetwomajorconstituentsofamenuarealistofitemsanda``whenselectedfunction.''Thelabelthatappearsforeachitemistheitemitselffornon-lists,oritsiftheitemisalist.Themenuincludesapositiononthescreenwhereitwillbedisplayedandameansofspecifyingtheplaceinthemenuthatistobeputatthatposition.Inaddition,thereareamultitudeofdierentformattingparametersforspecifyingfont,size,andlayout.Whenamenuiscreated,itsunspeciedeldsarelledwithdefaultsanditsscreenimageiscomputedandsaved.Menuscanbeeitherpopuporxed.Ifxedmenusareused,themenumustbeincludedinawindow.[Function]Thisfunctionprovidesmenusthatpopupwhentheyareused.Itdisplaysat(inscreencoordinates)andwaitsfortheusertoselectanitemwithamousekey.Whileanykeyisdown,theselectedmenuitemisvideoreversed.Whenallkeysarereleased,'seldiscalledwiththreearguments:(1)theitemselected,(2)themenu,and(3)thelastmousekeyreleased(,,or),andreturnsitsvalue.Ifnoitemisselected,returns.Ifis,themenuisbroughtupatthevaluefrom'seld,ifitisa,oratthecurrentcursorposition.Theorientationofwithrespecttothespeciedpositionisdeterminedbyitseld.[Function]Thisfunctionprovidesmenusthatremainactiveinwindows.displaysatin(isdefaultedasinexceptthatitisinwindowcoordinates).isaddedtothepropertyof.Theandofarereplacedwith,sothatwillbeactiveduringwait.ofissettorestore'simagewhenthewindowisreshaped.Whenanitemisselected,thevalueoftheeldofiscalledwiththreearguments:(1)theitemselected,(2)themenu,and(3)themousekeythattheitemwasselectedwith(,,or).Morethanonemenucanbeputinawindow,butamenucanonlybeaddedtoonewindowatatime.Ifisnotgiven,awindowiscreatedat(inscreencoordinates)thatisthesizeof.returnsthewindowintowhichisplaced.[Function]Thisfunctionremovesfromthewindow.Ifistheonlymenuinthewindowandisnon-,itswindowwillbeclosed(by).Ifis,thelistofcurrentlyactive(open)windowsissearchedforonethatcontains.Ifnonisfound,doesnothing.19.38CAR(MENU)WHENSELECTEDFNLEFTMIDDLERIGHTMENUMENUNILNILMENUPOSITIONPOSITIONMENUOFFSET(ADDMENU)ADDMENUMENUMENUCURSORINFNBUTTONEVENTFNMENUBUTTONFNTTYRESHAPEFNWHENSELECTEDFNLEFTMIDDLERIGHTADDMENU(DELETEMENU)NILCLOSEWNILDELETEMENUMENUPOSITIONMENUPOSITIONMENUPOSITIONMENUMENUMENUWINDOWPOSITION_MENUPOSITIONWINDOWPOSITIONMENUWINDOWWINDOWMENUWINDOWMENUMENUWINDOWPOSITIONMENUMENUMENUCLOSEFLGFROMWINDOWMENUFROMWINDOWMENUCLOSEFLGFROMWINDOWMENU|b1'\8 ixW N`${()h+-2s5x:?EV-  XV $'9*M+~.i39x=1>aD FT G< "$%),C-/158S9>Ca R  8'q "X$'+]-0g35a:a;>;AlBDGQ<  Ph"&(C+-30576;=V CFLO  7m  &(.a14J5|;=C M 6  "'+,02*7Q91 @fD FbLK  , b&)~IF vf!M"&.*,0k26:;AC9D_FAC5 D E%*D-/258;4? @B!&& -04C68<=ACFAOP $'*,+/2Y7;>@AD? #a,:y=?$C+FW>  #)&>+-04F69;V=BD<^|!{"p(~)057s;=?BD]:"#+M/:02l6F7<>@}BFy97&*8+s,-56[79k;@CDI7mr !\'*".0_28I=|> FH5 2C5 1 [%*p-P267D/v/$-g46z<?E-j% #% 3349`;_B?H&,+){7? APF*!"$+.m0x4|<)H&(!."+,r04E6;=YCG':D!$4')8X;yAVBF%9 "t$'*?/24k8;r=@DqG#$'+1289=@CzGT"H*$'+(_,G.138"9<ACbDH\ s!1%,&E+\,1l9,;A?f Gn#` "%*>-536C5 M )[,.<=C(D~Fy%E/ 0568>;A CGj"&'*Q,.{4n8s<BD<VV(E) *-k.<"?O(}`m$xR7IFA ,?. <^p$K,: .,9r .5 2 #1>1/vA=-> ,+ ,% * 9?':, #(u,4K (3n$[V37 }`m$txFAgDEBN?):%97m# 2{&"/v9'+D--.,+97=e*'x('u':=9 21r!S'tM%\45;?(()-C! V$ }`m$INTERLISP-DDISPLAYFACILITIES19.14.1MenuFieldsAmenuisadatatypewiththefollowingelds:[MenuField]Thelistofitemstoappearinthemenu.Ifanitemisalist,itswillappearinthemenu.Iftheitem(orits)isabitmap,thebitmapwillbedisplayedinthemenu.Thedefaultselectionfunctionsinterpreteachitemasalistofthreeelements:alabel,aformwhosevalueisreturneduponselection,andahelpstringthatisprintedinthepromptwindowwhentheuserpressesamousekeywiththecursorpointingtothisitem.[MenuField]Afunctiontobecalledwhenanitemisselected.Thefunctioniscalledwiththreearguments:(1)theitemselected,(2)themenu,and(3)themousekeythattheitemwasselectedwith(,,or).Thedefaultfunctionevaluatesandreturnsthevalueoftheoftheitemifthereisone,orsimplyreturnstheitemifitisnotalistorifitsis.[MenuField]Thefunctionwhichiscalledwhentheuserhasheldamousekeyonanitemformilliseconds(initially1200).Thefunctioniscalledwiththreearguments:(1)theitemselected,(2)themenu,and(3)themousekeythattheitemwasselectedwith(,,or).isintendedforpromptingusers.Thedefaultiswhichprints(inthepromptwindow)thethirdelementoftheitemor,ifthereisnotathirdelement,thestring``Thisitemwillbeselectedwhenthebuttonisreleased.''[MenuField]Ifwascalled,willbecalled:(1)whenthecursorleavestheitem,(2)whenamousekeyisreleased,or(3)whenanotherkeyispressed.Thefunctioniscalledwiththesamethreeargumentvaluesusedtocall.Thedefaultisthefunction(page19.19),whichjustclearsthepromptwindow.[MenuField]Thepositionofthemenutobeusedifthecalltoordoesnotspecifyaposition.Forpopupmenus,thisisinscreencoordinates.Forxedmenus,itisinthecoordinatesofthewindowthemenuisin.Thepointwithinthemenuimagethatisplacedatthispositionisdeterminedby.Ifis,themenuwillbebroughtupatthecursorposition.[MenuField]Thepositioninthemenuimagethatistobelocatedat.Thedefaultosetis(0,0).Forexample,tobringupamenuwiththecursoroveraparticularmenuitem,setitstoapositionwithinthatitemandsetitsto.[MenuField]Thefontinwhichtheitemswillbeappearinthemenu.Defaultisthevalueof19.39ITEMSCARCARWHENSELECTEDFNLEFTMIDDLERIGHTDEFAULTWHENSELECTEDFNCADRCADRNILWHENHELDFNMENUHELDWAITLEFTMIDDLERIGHTWHENHELDFNDEFAULTMENUHELDFNWHENUNHELDFNWHENHELDFNWHENUNHELDFNWHENHELDFNWHENUNHELDFNCLRPROMPTMENUPOSITIONMENUADDMENUMENUOFFSETMENUPOSITIONNILMENUOFFSETMENUPOSITIONMENUOFFSETMENUPOSITIONNILMENUFONT|b' %'*- \8 igxW wTs"TAsES("\$(*n,1s358:9:=BEZQm "/$'*8./1L27:.>ACOZ 7#'-h3h9,:AsE9Y $%)-A/25#8D9v=@qB~DvG7"k *\ /47=^>CFW6  !L#' ,.1v58:=kADG4h#&b*80J1R7tBD&2 %(,=!ACECG1"?$(-P/1w4683;=6?@DS/v!$'h)W.2048:e ,qAsE*"5$368=I?CCE)&h"$o(N).(028[:K<@}EHs'@ %%'%+).Q04I7>BNEGT% !#$3358#F!$4 "&(-!/AsE!$>(8*, /a03V5;D!Gjr$''+03X46;> CFx>p!6# +,/N47:<~>AE" $&U*,X/4I5 = GwH\"?&/' )h-E/179 :=A?AsEG !$w(,/1H3#5?:&EGh 8!%(.0O46B7;>A7EH !%]'2g4"5Y:>ADGV$(K QAsE B#\%)~,6.5246;~@BDpH&( }`m$xT S(?Q,+G B). 6%AOA?D>: 7 4h&+@3@9y 2.=,q *9 )R % ) =!/ 7=?  # G; )m V % Q }0`m$zMenuFields,initiallyHelvetica10.[MenuField]Ifspecied,atitlewillappearinalineabovethemenu.Thetitlewillbeinthesamefontaswindowtitles.[MenuField]Ifnon-,themenuitemsarecentered;otherwisetheyareleft-justied.[MenuField][MenuField]Theseeldscontroltheshapeofthemenuintermsofrowsandcolumns.Ifisgiven,themenuwillhavethatnumberofrows.Ifisgiven,themenuwillhavethatnumberofcolumns.Ifonlyoneisgiven,theotheronewillbecalculatedtogeneratetheminimalrectangularmenu.(Normallyonlyoneoforisgiven.)Ifneitherisgiven,theitemswillbeinonecolumn.[MenuField]Theheightofeachitemboxinthemenu.Ifnotspecied,itwillbethemaximumoftheheightoftheandtheheightsofanybitmapsappearingaslabels.[MenuField]Thewidthofeachitemboxinthemenu.Ifnotspecied,itwillbethewidthofthelargestiteminthemenu.[MenuField]Thesizeoftheborderaroundeachitembox.Ifnotspecied,0(noborder)isused.[MenuField]Thesizeoftheoutlinearoundtheentiremenu.Ifnotspecied,amaximumof1andtheisused.[MenuField](popupmenusonly)Ifisnon-,thepositionofthemenuosetisseteachtimeaselectionisconrmedsothatthemenuwillcomeupnexttimeinthesamepositionrelativetothecursor.Thiswillcausethemenutoreappearinthesameplaceonthescreenifthecursorhasnotmovedsincethelastselection.Thisisimplementedbychangingtheeldoneachuse.Ifistheatomortheatom,onlytheXortheYcoordinateoftheeldwillbechanged.Forexample,bysettingthepositionto(-1,0)andsettingto,themenuwillpopupsothatthecursorisjusttotheleftofthelastitemselected.Thisisthesettingofthewindowcommandmenus.Thefollowingeldsarereadonly.[MenuField]Returnstheheightoftheentiremenu.19.40MENUFONTTITLECENTERFLGNILMENUROWSMENUCOLUMNSMENUROWSMENUCOLUMNSMENUROWSMENUCOLUMNSITEMHEIGHTMENUFONTITEMWIDTHMENUBORDERSIZEMENUOUTLINESIZEMENUBORDERSIZECHANGEOFFSETFLGCHANGEOFFSETFLGNILMENUOFFSETCHANGEOFFSETFLGXYMENUOFFSETMENUOFFSETCHANGEOFFSETFLGYIMAGEHEIGHT|b'%)x\8_;$5*EY3AsEW5@ x#Q&*,T-0N4[6;S>7ACEGU  $RAsEQ<'kG!%)(+y1}7:<?gN7AsELAsEJ$'+%-/359;q>AH\IF f$}&*-038:>G-X#&),23:9;?ACTGE? "w (*02[7 >C=DUo&k13g8!9>X?CF7BO> ?AsE>p G#i&)**-1y25V;E<?,ACb<^L!b*-|/4p68=DE9YAsE7i (#]&)C*-\13[5;=4?AD@H&6 Z!|#)%3AsE1b^3!&A+.c15069^?{@CeHs/,AsE+~)!B%*-05T69L?G@rFH)l[)*j&gAsE$q $V24N9:h<ACF##n"& 'y-J.57:=ACG!u!%t*/1H38h;>3ADMH0p:!%N(+-13l5:0<?RCG*? #%n -/5A[DF)+U-2479;<?BOCEHR ] +G.X028;mA3C%G9 %'(+.L?BCF_9Y!*$&r*,&.0257G9,%'9)-1a2 9 Hs=3G!;#,.>|8 iC@x1e O"#$(-t27R8?rBC/ ra 0 g#*&Q(,r.-02(48<>DF,  o6!$$&*,02f4: ApCF  Is }"#& + (!}`m$x\: Q P%9M $Kz F B$ $>@Y4j !r#)1eS4V>%/,  "I#%'T)*,^. /+?)n  'h (+ 1i3&# $}?""I# {S]"I{6 $f*x]{"_%_'xDh#  #%),^3:@C S'T),^3:@C {{h#!"x(P !}`m$xQ*P%$]M ]Kz-3F]IE*+=0zB$* [#@*02639X>-G=3( } \`m$JGridFunctionsThisexpressiondisplaysapopupmenuwithtwoitems,and,andwaitsfortheusertoselectone.Ifisselected,iscalled.Ifisselected,iscalled.Ifneitheroftheseisselected,theformreturns.Thepurposeofthisexampleistoshowsomegoodpracticestofollowwhenusingmenus.First,themenuisonlycreatedonce,andsavedinthevariable.Thisismoreecientifthemenuisusedmorethanonce.Second,alloftheinformationaboutthemenuiskeptinoneplace,whichmakesiteasytounderstandandedit.Third,theformsevaluatedasaresultofselectingsomethingfromthemenuarepartofthecodeandhencewillbeknowntomasterscope(asopposedtothesituationiftheformswerestoredaspartoftheitems).Fourth,theitemsinthemenuhavehelpstringsfortheuser.Finally,thecodeiscommented(alwaysworththetrouble).19.15GRIDFUNCTIONSAGridisapartitioningofanarbitrarycoordinatesystem(hereafterreferredtoasthe``sourcesystem'')intorectangles.ThissubsectiondescribesfunctionsthatoperateonGrids.ItincludesfunctionstodrawtheoutlineofaGrid,totranslatebetweenpositionsinasourcesystemandGridcoordinates(thecoordinatesoftherectanglewhichcontainsagivenposition),andtoshadeGridrectangles.AGridisdenedbyits``unitgrid'',aregion(calledaGridSpec)whichistheoriginrectangleoftheGridintermsofthesourcesystem.ItsistheX-coordinateoftheleftedgeoftheoriginrectangle,itsistheY-coordinateofthebottomedgeoftheoriginrectangle,itsisthewidthofthegridrectangles,anditsistheheightofthegridrectangles.[Function]Outlinesthegriddenedbywhichisrectangleswideandrectangleshighon.Eachboxinthegridhasaborderwithinitthatispointsoneachside;sotheresultinglinesinthegridare2*thick.Ifistheatom,insteadofaborderthelowerleftpointofeachgridrectanglewillbeturnedon.Ifisnon-,itshouldbeatextureandtheborderlineswillbedrawninthatshade.[Function]Shadesthegridrectangle(,)ofwithtextureusingon.isinterpretedthesameasfor.ThefollowingtwofunctionsmapfromtheX,YcoordinatesofthesourcesystemintotheGridX,Ycoordinates:[Function]ReturnstheGridX-coordinate(intheGridspeciedby)thatcontainsthesourcesystemX-coordinate.[Function]ReturnstheGridY-coordinate(intheGridspeciedby)thatcontainsthesourcesystemY-coordinate.19.42(B-SELECTED(*ifBisselected)(DOBTHING))(PROGN(*userselectedoutsidethemenu)NIL)))ABADOATHINGBDOBTHINGNILFOOMENULEFTBOTTOMWIDTHHEIGHT(GRID)POINTNIL(SHADEGRIDBOX)GRID(GRIDXCOORD)(GRIDYCOORD)GRIDSPECUNITSWIDEUNITSHIGHGRIDBORDERDISPLAYSTREAMGRIDSHADEGRIDSPECUNITSWIDEUNITSHIGHDISPLAYSTREAMGRIDBORDERGRIDBORDERGRIDBORDERGRIDSHADEXYSHADEOPERATIONGRIDSPECGRIDBORDERDISPLAYSTREAMXYGRIDSPECSHADEOPERATIONDISPLAYSTREAMGRIDBORDERXCOORDGRIDSPECGRIDSPECXCOORDYCOORDGRIDSPECGRIDSPECYCOORD|b'%"(NxW  "%(l-1H2 48I:<?AxE1H\U V '"$?127;8=?OBD]TJ  IQE  vl!%`(.O/47;F@%CFO  Pb!g(!',4- 015 :,;=ACFMM  KH{ $ '*e.R/247e;`?yCE H0LT &K"L(*N+/p1@6=A CGJ  <$% -/5(69>>@?BFI  #Q'(+2/ 2s5:BfGGb  0 !3|@? ix; ^  "v )@- 49\;<?6D=:4   $+%..3Q5:<^AH08  hF{="'-/05 9=>ADnF3   E?} "Y )*-%/246: AHs1  < mh  V"$Q(B .f46:8<\>@WC* 0R  s " -MC5 +9"'0U4s=W CG(* % (%4458j;<? ADGEf([!)-/36L8:Q?CDF&#'13G5=5>BDKEf%* $s&R),25{7<$? Hs#j#%&+N.0`48:<@BET eC5 6!L'(`)*y25>#-I. 58;=CB  1 6#%( 04249)=@CgFo iC5 F"$) *-/28@ADO"$G 0=C5 sG"$( *-/28@AD O"$F 0E(!}`m$x\A{{h#! "x(F Z{{]  %o'x,2W,h0qU b![)TJ\O&S36B1020Ry-M @&9#jf e @?~i 1 9!}`m$vx-M% .%2T9+)5**.N([!< &I )J %@ eg"%, 6:/'(,:8B/FM$ i:++! s: +!} `m$|INTERLISP-DDISPLAYFACILITIESThefollowingtwofunctionsmapfromtheGridX,YcoordinatesintotheX,Ycoordinatesofthesourcesystem:[Function]ReturnsthesourcesystemX-coordinateoftheleftedgeofaGridrectangleatGridX-coordinate(intheGridspeciedby).[Function]ReturnsthesourcesystemY-coordinateofthebottomedgeofaGridrectangleatGridY-coordinate(intheGridspeciedby).19.16COLORGRAPHICSThecolorboardsontheXerox1100andtheXerox1132dierindesign.TheXerox1100boardsupports4bitsperpixelcolor.TheXerox1132supports4or8bitsperpixel.Alloftheuser'scodeshouldbewritteninhigherlevelmachineindependentfunctions.Bothcolorboardsproduceanimagethatis640pixelswideby480pixelshigh.Theimagecanbethoughtofasapaint-by-numberpaintingwherethenumberofapixelisitsvalue.Thenumberofbitsperpixel(4ontheXerox1100,4or8ontheXerox1132)determinesthenumberofdierencecolorsthatcanbedisplayedatonetime.Whenthereare4bpp,16colorscanbedisplayedatonce.Whenthereare8bpp,256colorscanbedisplayedatonce.Amappingtablecalleda``colormap''determineswhatcoloractuallyappearsforeachpixelvalue.Acolormapgivesthecolorintermsofhowmuchofthethreeprimarycolors(red,greenandblue)displayedonthescreenforeachpossiblepixelvalue.Inthefollowingsections,thenotionsof``colormap'',and``color''aredescribed.19.16.1ColorBitmapsA``colorbitmap''isactuallyjustabitmapthatallowsmorethanonebitperpixel.Totestwhetherabitmapisa``colorbitmap'',usethefollowingform:Colorbitmapsarecreatedbycalling(page19.4)withaargumentofanythingotherthan1or.Currently,anyvalueofexcept1,4,8or(defaultsto1)willcauseanerror.A4bitperpixelcolorscreenbitmapusesapproximately76kofstorage.Thereisonlyonesuchbitmap.Thefollowingfunctionprovidesaccesstoit:[Function]Returnsthecolorbitmapthatisbeingorwillbedisplayedonthecolordisplay.Thiswillbeifthecolordisplayhasneverbeenturnedon(see,page19.47).19.43(LEFTOFGRIDCOORD)(BOTTOMOFGRIDCOORD)Note:ThissectiondescribestheInterlisp-Dfacilitiesforusingacolordisplay.TousethesefacilitiesyouneedtohaveaXerox1100orXerox1132withacolordisplayattached,andyoumustloadintheLispUserslesCOLOR.DCOMandLLCOLOR.DCOM(automaticallyloadedbyCOLOR.DCOM).(NEQ(fetch(BITMAPBITMAPBITSPERPIXEL)of)1)BITMAPCREATENILNIL(COLORSCREENBITMAP)NILCOLORDISPLAYGRIDXGRIDSPECGRIDXGRIDSPECGRIDYGRIDSPECGRIDYGRIDSPECXXBITSPERPIXELBITSPERPIXEL|b' %'*- x\:  " $k'* 247<:, AsC/EZ WC5 U #C')% /1q369E:;??EFTD' $E&j(,!19Q>C5 O2#{')o 0+14;8AEG+  } $D*i,y.3"5i8=A[EG*A l["&)Y.20 |% i<x!x I$'+/257:B>s@CSH aj!;'G  Z,Q0=37AH&" Gt #&0)497:AD  C!#C5 &"@&)p*.W/2x4A:5<>LAF b #a&+.32 5y9<I ("}`m$^xW #Q> ${Bk  7 "$ ),1/149;>hA GH@  "%' *c.479<?A\C? x {x1 {" +/x1 {x +.0! "?r  c> }t`m$xW48TD"3Q>M#>&B7. 8o "+ !}hP`m$:ColorSpecications[Variable]Aglobalvariablesettoathatcoverstheentirecolordisplayscreen.Currentlythisis.[Variable]Thewidthofthecolordisplay.Currently640.[Variable]Theheightofthecolordisplay.Currently480.19.16.2ColorSpecicationsAcolormapmapsacolornumber(from0to2-1)intotheintensitiesofthethreecolorguns(red,greenandblue).Eachentryinthecolormaphas8bitsforeachoftheprimarycolorsallowing256levelsperprimaryor224possiblecolors(notallofwhicharedistincttothehumaneye).WithinInterlisp-Dprograms,colorscanbemanipulatedasnumbers,red-green-bluetriples,names,orhue-lightness-saturationtriples.Anyfunctionthattakesacolorwillacceptanyofthedierentspecications.Ifanumberisgiven,itwillbethecolornumberusedintheoperation.Itmustbevalidforthecolorbitmapusedintheoperation.(Sincealloftheroutinesthatuseacolorneedtodetermineitsnumber,itisfastesttousenumbersforcolors.describedbelowprovidesawaytotranslateintonumbersfromtheotherrepresentations.)Ared-green-blue(RGB)tripleisalistofthreenumbersbetween0and255.TherstelementgivestheintensityforRED,thesecondforGREENandthethirdforBLUE.WhenanRGBtripleisused,thecurrentcolormapissearchedtondthecolorwiththecorrectintensities.Ifnoneisfound,anerrorisgenerated.(Thatis,noattemptismadebythesystemtoassigncolornumberstointensitiesautomatically.)ExampleofanRGBtripleis(255255255)whichgivesthecolorwhite.Therecordwithelds,,andisprovidedtomanipulateRGBtriples.Acolornameisanatomthatisontheassociation-list.Theofthecolorname'sentrywillbeusedasthecolorcorrespondingtothecolorname.Thiscanbeanyoftheotherrepresentations.(Note:Itcanevenbeanothercolorname.Loopsinthenamespacesuchaswouldbecausedbyputtingandonarecheckedforbythesystem.)Severalcolornamesareavailableintheinitialsystemandareintendedtoallowcolorprogramswrittenbydierentuserstocoexist.Theseare:19.44WHOLECOLORDISPLAYREGION(CREATEREGION00640480)COLORSCREENWIDTHCOLORSCREENHEIGHTCOLORNUMBERPRGBREDGREENBLUECOLORNAMESCDR'(RED.CRIMSON)'(CRIMSON.RED)COLORNAMESnotBITSPERPIXEL|b'#'s x\:C Zj#,%'e.168<@jEPX 7UC TD|Z "o%+1TQ>C O| i"&A+r1|K4 i< xF L= #%I' 0l0258 >@SBFcE*  cz #%(S,/L13Z6-8;=@zECO D C!nCO#)-W0249;@BE9A  e ry#w&' /179=@EE@   4  X#)[,m0.15^8N<?ADS>] ;X  ~ m #(,+-0X 738<1>2ACFc9  !%#"$'T,/23?6:0;BvD^8  C ,2;6F;<?AG6g Y3b t N"$(1-347;<>5AFn1  ^NLa!'j*4,0!2q73;]=`ADFL0  r`D!x$w&*-0h5 <>-ACYG.q   M0"M#{% (+-20482;ACw , W S#%g(t+ .2"57;l?B+%  %4!&( /3E( uu?" (3y4S:.;>?AFL&z  vT "F#&W).18358Y:C E#/(38=@%B,D! K k"&+I. 0f6(7;?E.  p(}`m$Px\: Z(X! -/[1 4fU Q> 8 !w ,F+%( + 7&#/ #$* {6 }`m$NxG9' } `m$INTERLISP-DDISPLAYFACILITIESnameRGBnumberindefaultcolormap01234567Ahue-lightness-saturationtripleisalistofthreenumbers.Therstnumber(hue)isbetween0and355andindicatesapositionindegreesonacolorwheel(blueat0,redat120andgreenat240).Thesecond(lightness)isabetween0and1whichindicateshowmuchtotalintensityisinthecolor.Thethird(saturation)isabetween0and1whichindicateshowdisparatethethreeprimarylevelsare.Therecordwithelds,,andisprovidedtomanipulateHLStriples.Example:thecolorblueisrepresentedinHLSnotationby(0.51.0).[Function]Returnsthecolornumber(osetintothescreencolormap)of.shouldbeeither(1)apositivenumberlessthanthemaximumnumberofcolors,(2)acolorname,(3)anRGBtriple,or(4)anHLStriple.Ifisoneoftheaboveandisfoundinthescreencolormap,itscolornumberinthescreencolormapisreturned.Ifnot,anerrorisgeneratedunlessisnon-,inwhichcaseisreturned.[Function]ReturnsifisanRGBtriple;otherwise.[Function]ReturnsifisanHLStriple;otherwise.19.16.3ColorMapsThescreencolormapholdstheinformationaboutwhatcolorisdisplayedonthecolorscreenforeachpixelvalueinthecolorscreenbitmap.Thevaluesinthecurrentscreencolormapmaybechangedandthischangewillbereectedinthecolorsbeingdisplayedatthenextverticalretrace(approximately1/30ofasecond).Changingthecolormapcanbeusedtogetdramaticeects.[Function]Createsacolormapforascreenthathasbitsperpixel.Ifis,thenumberofbitsperpixelistakenfromthecurrentcolordisplaysetting.speciestheinitialcolorsthatshouldbeinthemap.Ifisnot,itshouldbealistofcolorspecications19.45BLACK(000)BLUE(00255)GREEN(02550)CYAN(0255255)RED(25500)MAGENTA(2550255)YELLOW(2552550)WHITE(255255255)FLOATPFLOATPHLSHUELIGHTNESSSATURATION(COLORNUMBERP)NILNIL(RGBP)NIL(HLSP)NIL(COLORMAPCREATE)NILNILCOLORBITSPERPIXELNOERRFLGCOLORCOLORCOLORNOERRFLGXXXXXXINTENSITIESBITSPERPIXELBITSPERPIXELBITSPERPIXELINTENSITIESINTENSITIES|b' %'*- x[y [*5:  BfF1!1"U%)-D.0^24_69=_>BEO@nBG:  d A"#&', 14:=9@F9  z )f*Z6)7=?T F7v %" &(1+02464qC5 2#(i,/226:*=D 1%*%"$K%*/2p58 >CE/i"{$&*%."/237@;jAC#EG- $%%(Z,3&58=?BFc,4]"$`'L)U,.c4@qAG:H0*!#'C5 %5 "Z$I'/ "C5 !85 "Z$I'. | i<xo   %)y,0n18:&<@DdF  T" $)*-$16'9<?AG(#  "2/#'&,.038=. F~  Vg!~$%)/*-#2xC5 a"2%(1).=1_=@CqH\ -!%:&N(.B023 59P:>BE T 6-36:2>cAbFH0 1U(:).016)8F9<=A (!}`m$xX+ "E#U3 U&"E#R! "E%O "E%L$ L#%I #%F #'PC C#'P'%"!8x]  4( - %  }|`m$TColorMaps(otherthancolornumbers),e.g.thelistofRGBtriplesreturnedbythefunction(below).Ifis,thedefaultisthevalueof(ifis4)or(ifis8).[Function]Returnsifitisacolormapthathasbitsperpixel;otherwise.Ifis,itreturnsifitiseithera4bitsperpixeloran8bitsperpixelcolormap.[Function]Returnsalistoftheintensitylevelsof(defaultis)inaformacceptedby.Thislistcanbewrittenonleandthusprovidesawayofsavingcolormapspecications.[Function]Ifisacolormap,itreturnsacolormapthatcontainsthesamecolorintensitiesas;otherwiseitreturnsacolormapwithdefaultcolorvalues.[Function]Readsandsetsthecolormapthatisusedbythecolordisplay.Ifisnon-,itshouldbeacolormapandsetsthesystemcolormaptobethatcolormap.Returnsthepreviousvalueofthescreencolormap.Ifis,thecurrentscreencolormapisreturnedwithoutchange.[Function]Returnsacolormapwhichisdierentshadesofoneormoreoftheprimarycolors.Forexample,givesacolormapofdierentshadesofgray;givesdierentshadesofred.Thefollowingfunctionsareprovidedtoaccessandchangetheintensitylevelsinacolormap.[Function]Setstheprimaryintensitiesofcolornumberinthecolormaptotheonesspeciedby.canbeeitheranRGBtriple,anHLStripleoracolorname.Returns.[Function]Setsandreadstheintensityleveloftheprimarycolor(either,or)forthecolornumberinthecolormap.Ifisanumberbetween0and255,itisset.Thepreviousvalueoftheintensityofisreturned.[Function]Addstotheintensityoftheprimarycolor(either,or)foreverycolornumberin.[Function]Rotatesasequenceofcolorsin.Therotationmovestheintensityvaluesofcolornumberintocolornumber+1,theintensityvaluesofcolornumber+1intocolornumber+2,etc.and'svaluesinto.19.46INTENSITIESFROMCOLORMAPNIL\DEFAULTCOLORINTENSITIES\DEFAULT8BITCOLORINTENSITIES(COLORMAPP)NILNIL(INTENSITIESFROMCOLORMAP)(SCREENCOLORMAP)COLORMAPCREATE(COLORMAPCOPY)(SCREENCOLORMAP)NILSCREENCOLORMAPNIL(MAPOFACOLOR)(MAPOFACOLOR'(REDGREENBLUE))(MAPOFACOLOR'RED)(SETCOLORINTENSITY)NIL(COLORLEVEL)REDGREENBLUE(ADJUSTCOLORMAP)REDGREENBLUE(ROTATECOLORMAP)INTENSITIESBITSPERPIXELBITSPERPIXELCOLORMAP?BITSPERPIXELCOLORMAP?BITSPERPIXELBITSPERPIXELCOLORMAP?COLORMAPCOLORMAPCOLORMAPBITSPERPIXELCOLORMAPCOLORMAPNEWCOLORMAPNEWCOLORMAPNEWCOLORMAPPRIMARIESCOLORMAPCOLORNUMBERCOLORSPECCOLORNUMBERCOLORMAPCOLORSPECCOLORSPECCOLORMAPCOLORNUMBERPRIMARYCOLORNEWLEVELPRIMARYCOLORCOLORNUMBERCOLORMAPNEWLEVELPRIMARYCOLORPRIMARYCOLORDELTACOLORMAPDELTAPRIMARYCOLORCOLORMAPCOLORMAPSTARTCOLORTHRUCOLORCOLORMAPSTARTCOLORSTARTCOLORSTARTCOLORSTARTCOLORTHRUCOLORSTARTCOLOR|b'&)x\:-#*.14;6d:q? EGZ17BFVGXF #:E FrHWI/:<'TDC5 R%&()*.14@CiFP !,L0G1.2?B@B CGvHORE !#%'*-wLMC5 J!E#v$&x(,o5J:;HIE`#I01469x;Y=?AD4FG\0Y!."$'*- DWC5 B "'#Y&*V+0k158?;@zBFcA  &u'S-Y.3 4+7:=zBE\>C5 <`k!#V&),-1/3!5v8>:G ]$&'+/.9=?AFc9kZ!&$(;-n/5V8:=AGDH\7o!%&)-258:?D4jC5 2m"%j)+J1 57:nBJC_F/xY#=$8;|AE`G,s   "&)O-0P59;M@CF&#E!#&,6#?$ACG$}A@!.$~($)+.2:!xC5 !w$ )-A/.17(E{,, %d&(+/&>@CFw(D)*/5^69A<)=|>ADSMa$12}C5 6!$P*+.c3AI^!|"y$(e+19C5 |#P$(1X249>@DE?p+-1t>ADS } .G037DnGT "#r'2(}`m$BxZiCX%\WITD $&P-LM %J;yI%5 DW &7> !':0 7o#^4j 1$r /^4i9s/x(r 3_)n 3$}7!x 7,4" -6F|  0}\`m$xZ9 X; WI1 TD*v R|7M P# 7G9LM!lJ-0yDW. B0A |!>]/<`?BaD7ox4j)na!$:,+.'4S6&#%.1F7!9!xX&I+ .d1:?B,4z6% &+g.]!x"($v%5&)k6iu7]@*EGSP#,%(1+-R0M146_9O:>?BF1GTO4"2#%+5-183i6Mkinx#&W(+,Z.036;N=@_B-DFKH%`'*/Q12K5:?AyCuGG $*-C269D=>ACfEEtny!$(>-/S15a9C=?@CPGjCv$'e*w, 36:/=@CFcB)  ;"&+>/603?7;rACFW@s#a%'a+/ 5"7 >_ E>_%' . 0[4w68:[<?B;G=8 %+r/1{58.;=@G4;*9$&U(-18;<>:CFc9 #'R+/L06(8&=|Eo8Fa!#o%%',z.;03k91CFc+$'*C-/1"5=b?|'@ i" $x"  (L1":$(+2.3G469P>ADFc!6 j!$% ,13 :U=AC@E  K~UC5 6#'u*+.I16q7:YCC5 : $%&*,/ 27@B^GHe"'q 69J;?HsC!"i%'I)-1L4BUCIIL H!$R',.S0n2D#R!%~*W/ 6#9=ADu #k&).3L8E;C=BFn V"'),/(!}`m$\x[ %P )O8=8'z;4G9?+9 @} 2:")EF|!}l`m$Bx[]<ZR23CP _. ' 1:09e;- AC6c @!} h`m$DPrintingandDrawinginColor19.16.5PrintingandDrawinginColorThecurrentcolorimplementationallowsdisplaystreamstooperateoncolorbitmaps.Thefollowingtwofunctionssetthecolorinwhichadisplaystreamprintsordraws:[Function]Setstheforegroundcolorofadisplaystream.Returnsthepreviousforegroundcolor.Ifis,itreturnsthecurrentforegroundcolorwithoutchanginganything.Thedefaultforegroundcoloris7,whichiswhiteinthedefaultcolormap.[Function]Setsthebackgroundcolorofadisplaystream.Returnsthepreviousbackgroundcolor.Ifis,itreturnsthecurrentbackgroundcolorwithoutchanginganything.Thedefaultbackgroundcoloris0whichisblackinthedefaultcolormap.,thelineandcurvedrawingroutinesandtheprintingroutinesknowhowtooperateonadisplaystreamthathasacolorbitmapasitsdestination.Followingaresomenotesaboutthem.(page19.4)Wheningfromacolorbitmapontoanothercolorbitmapwiththesamebitsperpixel,theoperations,andaredoneonabitlevel;notonapixellevel.Thuspaintingcolor3ontocolor10willresultincolor11.Wheningfromablackandwhitebitmapontoacolorbitmap,the1bitswillappearintheandthe0bitsin.Currently,istheonlyoperationthatissupportedingfromblackandwhitetocolor.Thisoperationisfairlyexpensive;ifthesamebitmapisgoingtobeputupseveraltimesinthesamecoloritisfastertocreateacolorcopythenbltthecolorcopy.Iftheisandtheisacolorbitmap,theargumentistakentobeacolor.Thus,tollanareawiththecolor,do:Curvedrawing(page19.14)Forthefunctions,and,thenotionofabrushhasbeenextendedtoincludeacolor.Abrushcanbealistoftheform.Abrushcanalsobeabitmap,whichcanbecolorbitmap.Linedrawing(page19.13)Thelinedrawingfunctionshavebeenextendedtotakeanotherargumentwhichisthecolorthelineistoappearinifthedestinationofthedisplaystreamisacolorbitmap.Iftheargumentis,theofthedisplaystreamisused.PrintingPrintingonlyworks(currently)inmode.Thecharacterswillhaveaforegroundcolorofandabackgroundof.Thersttimeacharacterisprintedinanewcolor,thecolorimagescorrespondingtothe19.48(DSPCOLOR)NIL(DSPBACKCOLOR)NILBITBLTBITBLTBITBLTPAINTINVERTERASEBITBLTDSPCOLORDSPBACKCOLORREPLACEBITBLTTEXTUREBLUE(BITBLTNILNILNIL5075100200'TEXTURE'REPLACE'BLUE)DRAWCIRCLEDRAWELLIPSEDRAWCURVE()NILDSPCOLORREPLACEDSPCOLORDSPBACKCOLORCOLORDISPLAYSTREAMCOLORCOLORDISPLAYSTREAMCOLORSOURCETYPEDESTINATIONBITMAPTEXTURECOLORBITMAPSHAPESIZECOLORCOLOR|b' u%(d-/\: iXwxW   "',.?3#5&8>TA(G3V0 ]#d'+-|S*C5 Q& $f()+"/5A:=B O"$&'(^-/|4J ;s>DN9(!% -020389=b?*AFcLIC5 G $(')+*/5 :O<BY FC"%&(%,/53 ;>DD+!% -12389=_?(AFcB?i U%(;*/48;=@BDE/>L X#9 m '.k04L7;;Gz6 #@&'+u043q8<@CFc9> ^" -3;?=@BDF!7F $p'-I015#8:=)@BF4 #'3(,v/e3\8E;=@FH3Q\!#y-@0 236BYCK 1W!$*-|.:C<?C{F 0Xf &(+ 236H9>|?CEjG^._i""#&R)-k.0Q4 59;->BERG, )/$C,$.>@#ATD( _&'+-Z/J0t4t8G9<=@DFc&i  Rb+D6@^AMCH&mL"(*a/J046D:1<>?BGD Fy%&(8,.|1434)9!=?AnD  #k'u""b(T+.46d9S>SDpHsw"#%*/+-=/ 68T:?aCE9Fc&,<0@10:<?0CHs+ &  a$ +38; BlECH  "v+.n/ 7PC7D-G "#~(]*+R.M2248)< EG(!}X`m$xS* !O#I $FC#l? ;G 9)T.[643Q%8D 159)%&i#d_!%2F47P:> E!" ,2 8$-3 &-_ $H9" }X`m$zxS*SOGI. FC+)1F6n (#d(t*}8 #!#!}@p`m$NINTERLISP-DDISPLAYFACILITIEScurrentfontarecalculatedandcached.Thustherstcharactermaytakeawhiletoappearbutsucceedingcharactersprintquickly.19.16.6UsingtheCursorontheColorScreenThecursorcanbemovedtothecolorscreen.Whileonthecolorscreen,thecursorisplacedusingmode,thuswithsomecolormapsitmaybehardtosee.Itisautomaticallytakendownwheneveranoperationisperformedthatchangesanybitsonthecolorscreen.Whilethecursorisonthecolorscreen,theblackandwhitecursoriscleared.[Function]mustbeeitherthevalueoforthevalueof.movesthecursorontothespeciedscreen.Thevaluereturnedisthescreenbitmapthatthecursorwasonbeforewascalled.19.16.7MiscellaneousColorFunctionsThefollowingfunctionsprovidesomecommonoperationsoncolorbitmapsanddisplaystreams.[Function]Fillstheregioninwiththecolor,usingtheoperation.[Function]Fillsanareainthecolorbitmapwithacolor.[Function]Createsandreturnsacolorbitmapcopyingtheblackandwhitebitmap.Thereturnedcolorbitmapwillhavecolornumberinthosepixelsofthatwere1andinthosepixelsofthatwere0.Thisprovidesawayofproducingacolorbitmapfromablackandwhitebitmap.Note:thisisafairlyexpensiveoperationintermsofbothtimeandspace.19.16.8Demonstrationprograms[Function]Bringsupamenuofcolordemonstrationprograms.Thesystemwillcyclethroughtheentriesonthemenuautomatically,allowingeachtorunforasmallxedamountoftime(typically40seconds).Selectingoneoftheentriesinthemenuwillcauseittostartthatprogram.[Function]RunstheInterlisp-Dlogodemonstrationuntilabuttonispressedthenadds19.49XOR(CHANGECURSORSCREEN)(COLORSCREENBITMAP)(SCREENBITMAP)CHANGECURSORSCREENCHANGECURSORSCREEN(COLORFILL)(COLORFILLAREA)(COLORIZEBITMAP)Thefollowingfunctionsprovidesomedemonstrationsofthecolordisplay.TheseareavailableintheLispusersleCOLORDEMO.DCOM.(COLORDEMO)(COLORDEMO1)SCREENBITMAPSCREENBITMAPREGIONCOLORNUMBERCOLORBITMAPOPERATIONREGIONCOLORBITMAPCOLORNUMBEROPERATIONLEFTBOTTOMWIDTHHEIGHTCOLORNUMBERCOLORBITMAPOPERATIONBITMAP0COLOR1COLORBITSPERPIXELBITMAP1COLORBITMAP0COLORBITMAP|b' %'*- x\8xp! (A+0936*8>ADF,ZS U '? -1 |V- i[:2"axQ  ~p!&F*],e.2C695=b>C*P# 7T1| $&)e+,.Q/1f 9=AGN} j "%/'+),158<*=?AEPL  IbIC5 H-!%',.2EsGFO(9=@#DPGDZ"L%5(.026;>n@EGC;+.>|> i `2x:r  !\' -/3,8_;?7mC5 5O'2r58EAF74!'R/C5 . !N#'&+.0+C5 )_b$!%[(-25L9;?I' $=)&, /3>>D@,DH&&#m$-</26>$ADF$n$@! ")/*L-2\56:j=@E"E s&,.2O47@:b=|c i xTC5 "$' 07u:>>AFD@!(#' 06: ;>A=BFxb! ')0?608:=<ACFOV!$& C5 G #%) 2_57s<5=C-F("}`m$xQFI $AH-4F )C;7m 4K1U F+ 1"{  =x (*_,/48:@>ACY x ! {xT !}`m$dxI H- 7m*U#F%-!1?5!(+Y;>04! ($F1U %+4-58#?C+]"%(r )_DW'8;&'*8!}`m$jDemonstrationprograms.Thebuttonwillbringupamenuthatallowschangingthespeedofrotationoredittingthecolormap.Thebuttonwillrotatethecolormapinthekineticarea.[Function]Putsupatestpatternofsize,thenrotatesthecolormap.ThespeedofrotationofthecolormapisdeterminedbytheYpositionofthecursor.Thebuttonwillbringupamenuthatallowseditingofthecolormaporchangingthecolormaptoamapofdierentshadesofonecolor.[Function]Runscolorkineticinaregionofthecolordisplayusingcolorsthrough.[Function]Drawsaseriesofconcentricrectanglesofincreasingsizeinincreasingcolornumbers.determinesthesizeoftherectangles.Thiscanthenbe``run''bycallingdescribedbelow.[Function]Drawsaseriesofconcentricrectanglesofsizeinincreasingcolornumbers.determineswhetherthecolornumbersincreaseordecrease.Thiscanthenbe``run''bycallingdescribedbelow.[Function]Drawsaseriesofconcentriccirclesonthecolorscreeninincreasingcolornumbers.Thecircleswillbeofsize.Thiscanthenbe``run''bycallingdescribedbelow.[Function]Displaysapatternofcolorsonthecolordisplay.Thisisusefulwheneditingacolormap.Thepatternhassquaresofthe16possiblecolorslayedoutintworowsatthetopofthescreen.Colors0through7inthetoprow.Colors8through15inthenextrow.Thebottompartofthescreenisthenlayeredwithbarsofwidthwiththeconsecutivecolornumbers.Thepatternisdesignedsothateverycolorhasaborderwitheveryothercolor(unlessistoolargetoallowroomforeverycolor-about20).[Function]Goesintoaninnitelooprotatingthescreencolormap.Thecolorsbetween(default0)and(defaultmaximumcolor)arerotated.Ifisgiven,iscalledeachtimethecolormapischanged.Thisprovidesaneasywayof``animating''screenimages.[Function]RunsaversionofthePolygonsprogramonthecolorscreen.19.50COLORKINETICMIDDLELEFT(COLORDEMO2)MIDDLE(COLORKINETIC)(TUNNEL)ROTATEIT(MINESHAFT)ROTATEIT(WELL)ROTATEIT(SHOWCOLORTESTPATTERN)(ROTATEIT)(DISMISS)Note:ThefollowingfunctionisavailableintheLispusersleCOLORPOLYGONS.DCOM.(COLORPOLYDEMO)SIZESIZEREGIONFIRSTCOLORLASTCOLORREGIONFIRSTCOLORLASTCOLORSPEEDSPEEDNOUTFLGNOUTFLGNNBARSIZEBARSIZEBARSIZEBEGINCOLORENDCOLORWAITBEGINCOLORENDCOLORWAITWAITCOLORDS|b'"B +x\:!"+ /2/579!=?DZ$&+.A15%(*], 47R9=??NCbE|A %>C5 <`1!# *^ 0279q @!C: $)7+~.4x9;KAFDGF9+ 1E6C5 4j "7 (,.14d8: @vC2[e "$S'(+u-0268[C1.C5 ,sP#s%J)h+. 174:l;@*CH*!u&#(-c/1`378h36'8;@A:F]H0' W#.'*,.3"47<?B%!0 (,25i:5;AzCNF,$7G/#' *.2D<>L@DdF7"L!8$%)C5 n| %(.805;8=0@>Ds@ A%c'1-6O<@CH\[-,.269O;?`BD G"6%7( ) 15C5 DBk!."%C+0258~(}d`m$ x\: %xZ8lU RDOLM +E xA > 9#6 2<. !v &!+{  uD"$8&,px.{x S }d`m$pxUTD(LM[!k$)J)\AyGI"uEB>*<`5:62&.h'DK$77SE K"#@).()}L`m$| TIMESROMANGACHACMS  TIMESROMAN  TIMESROMAN CMSY  ( 2N9 C N X Va dj 4s ~  H z t f l : 6 ^ "  &  ! + 5=jDJ S ^ h 0qyd 4 h f Z <j/3ͻ chapwp.PRESSSANNELLASEPTEMBER 15, 1983 13:25:31