;skip 1 ;vsp 6 ;squish ;lftmar 0 ;topmar 0 ;botmar 0 ;rgtmar 0 ;dfont TIMESROMAN10,TIMESROMAN10,TIMESROMAN10I,HELVETICA10,TIMESROMAN18B,TIMESROMAN12B,TIMESROMAN12B,GACHA10,GACHA10B,MATH10,HIPPO10 ""A  New Window System q1 utext scroll windows "`  1. text scroll windows "( PTextscrollwindowsprovideasimplemeansofmaintainingadisplayofanumberoflines  ofthesametypewithscrolling.Forexample,itisusedbytheerrorhandlertodisplaya  backtraceoftheerror,onefunctionframeperline.Eachitemoccupiesoneandonlyoneline  ofthedisplay,itsdisplayisautomaticallytruncatedifitdoesnott.(Seefor  scrollwindowsofamuchmorecomplicatedsort,whichcandisplayitemsofmanydierent  typesatthesametime,andwithaprovisoforunderstandingwraparound.)Atextscrollwindow  hasaninstancevariabletv:items,whichisanarrayoftheitemsthemselves. Whenever  redisplayhappens(eitherfromscrollingora:refreshmessage),thismessageissentforeach  itemtobedisplayed.Theavortv:text-scroll-windowprovidesthefollowing.  "  :print-itemitemline-noitem-no itemistheitem-no'thitemoftv:items,whichshouldbedisplayedonline-no.Itshould bedisplayedstartingatthecurrentcursorposition.Thedefaultisjusttoprin1item.  "  tv:top-item Variable  "  :set-top-itemnew-top-item tv:top-itemistheindexintotv:itemsoftheitemtobedisplayedontherstlineofthe window. " PThefollowingauxiliarymessagesarealsodened.  "  :put-last-item-in-window Thismakessurethatthebottommostitemintv:itemsisdisplayedonthescreen, scrollingdowntoitifitisnot.  "  :append-itemnew-item new-itemisaddedontotheendoftv:items,withappropriateredisplay.  "  :delete-itemitem-no Theitem-no'thelementoftv:itemsisdeletedfromthearray,withappropriateredisplay.  "  :insert-itemitem-nonew-item new-itemisinsertedintotv:itemsbeforeitem-no,withappropriateredisplay.  "  :redisplaystartend Thisistheinternalfunctionthatcausesthe:print-itemmessagetogetsentforeachline intherangestarttoend,whicharescreenlineindices.Itshouldnotberedened,but daemonsmaybeplacedonittonotechangesinthescreenlayout.(Forexample,see .) ""  DSK:LMWIND;TSCROL 7 Z4-OCT-80 ""A  New Window System q2 function text scroll windows "`  :scroll-redisplaynew-topdelta Thisistheinternalscrollingfunctionwhichcausespartialredisplaywithbitblt'ingand thensendsthe:redisplaymessagefortherest.new-topisthenewtv:top-item,and deltathenumberoflinesactuallytobescrolled.Thismessageshouldnotberedened, butdaemonsmaybeplacesonit.  "@  1.1 function text scroll windows " PFunctiontextscrollwindowsprovideforaparticularfunctiontogetcalledtodisplayan  item.Theyareimplementedbythetv:function-text-scroll-windowavor.  "  tv:print-function Variable  tv:print-function-arg Variable  tv:*line-no-being-printed Variable tv:print-functionisthefunctioncalledbythe:print-item,withargumentsoftheitem, tv:print-function-arg,thewindowitself,andtheindexofitemintv:items.Inaddition, thespecialvariabletv:*line-no-being-printedisboundtothescreenlineonwhichthe printingbeingdone(mostthingswillnotneeditsincethecursorpositioniscorrect).  "  :setuplist listisalistoftv:print-function,tv:print-function-arg,alistoftheitemsthemselves, andoptionally,theinitialtv:top-itemandlabel.Everythingissetupcorrectlyfrom thesevariables.Thisisprobablythemostconvenientwayofmaintainingthem.  "  text-scroll-window-typeout-mixin(Flavor Thiscanbeaddedtoaavorcontainingtv:text-scroll-windowandallowsforproper interactionwithatypeoutwindowandpartialredisplayovertheareaitclobbers.  "  :flush-typeout Ifthetypeoutwindowisactive,thisdeexposesit,andmakessurethatredisplayknows thatthelineshavebeenclobbered.  "  displayed-items-text-scroll-window(Flavor  "  tv:displayed-items Variable tv:displayed-itemsisanarrayoftheitemsactuallydisplayedonthescreen.Thisavor ensuresthatredisplaymaintainsthatlistcorrectly.Itcancontainforexamplemouse sensitiveitems(seeespeciallysensitvetextscrollwindows)). """(  DSK:LMWIND;TSCROL 7 Z4-OCT-80 ""A  New Window System q3 Amouse sensitve text scroll windows "`  1.2 mouse sensitve text scroll windows " PWindowsofavortv:mouse-senstive-text-scroll-windowimplementscrollingwindowspart  orallofwhoseitemscanbemousesensitive.Aswithmenusandothermousesensitiveitem  typeout,whenthemouseismovedoverthesensitiveitemitsareaishighlighted,andwhenit  isclickeduponit,somesortofselectionofthatitemtakesplace(seebelow).  "  :itemitemtype&optionalfunction&restprint-args itemisdisplayed,bycallingfunction,whichdefaultstoprin1,withtheitemitselfand print-args.Thelimitsofthistypeoutarerememeberedintheappropriateelementof thetv:displayed-itemsdatastructure.typeisthetypeofitem(seebelow).  "  tv:sensitive-item-types Variable  "  :set-sensitive-item-types tv:sensitive-item-typesiseitheralistoftype'swhicharesensitivetothemouse,ortif theyarealltobemousesensitive. " PWhenthemouseisclickedonamousesensitiveitem,alistofthetype,theitemitself,  thewindowandthemousecharacterisplacedinthewindow'sio-buer.  "  text-scroll-window-empty-gray-hack(Flavor Whenwindowsofthistypehaveanemptyarrayfortv:items,theirinteriorisgrayed out.  """""""  DSK:LMWIND;TSCROL 7 Z4-OCT-80 ""A  New Window System q4 9Flavor Index "` uFlavor Index  "d  displayed-items-text-scroll-window Z. . &. L2  text-scroll-window-empty-gray-hack d. . ). L3  text-scroll-window-typeout-mixin D. f. . *. L2 "*  Z4-OCT-80 ""A  New Window System q5 #Message Index "` \Message Index  "d  :append-item ]. ~. . @. a. . #. D. f. . *. L1  :delete-item L. l.  . ,. L. l.  . ,. L. l.  . ,. L1  :ush-typeout a. . #. D. e. . '. H. i.  . +. L2  :insert-item F. f. . &. F. f. . '. H. i.  . +. L1  :item ~. . @. a. . #. D. e. . '. H. i.  . +. L3  :print-item ?. `. . ". C. d. . &. G. h.  . *. L1  :put-last-item-in-window `. . ". D. f. . *. L1  :redisplay 4. V. x. . <. ^. . ". D. f. . *. L1  :scroll-redisplay {. . =. ^. . ". D. f. . *. L2  :set-sensitive-item-types X. z. . @. c. . ). L3  :set-top-item U. w. . ;. ].  !. C. e. . ). L1  :setup . &. F. f. . &. F. f. . '. H. i.  . +. L2 "*  Z4-OCT-80 ""A  New Window System q6 #Variable Index "` `Variable Index "d  tv:*line-no-being-printed s. . 3. S. s. . 3. S. s. . 3. S. t. . 6. W. x. . :. [. |. . >. _. . !. B2  tv:displayed-items . 5. U. u. . 5. U. u. . 5. U. u. . 5. U. u. . 6. W. x. . :. [. |. . >. _. . !. B2  tv:print-function .  . @. `. .  . @. `. .  . @. `. .  . @. `. .  . @. `. . . @. `. . . @. `. . !. B2  tv:print-function-arg .. N. n. . .. N. n. . .. O. p. . 2. S. t. . 6. W. x. . :. [. |. . >. _. . !. B2  tv:sensitive-item-types E. f. . (. I. j.  . ,. M. n. . 0. Q. r. . 4. U. v. . 8. Y. z. . <. ]. ~. . B3  tv:top-item A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. B1 """"""""""{  Z4-OCT-80 ""A  New Window System q1 Table of Contents "` >Table of Contents "d  1. text scroll windows >. ^. ~. . >. ^. ~. . >. ^. ~. . >. ^. ~. . >. ^. ~. . >. ^. ~. . >. _. . !. B1  1.1 function text scroll windows A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. A. a. . !. B2  1.2 mouse sensitve text scroll windows . .. O. p. . 2. S. t. . 6. W. x. . :. [. |. . >. _. . !. B3 "  Flavor Index W. w. . 7. W. w. . 7. W. w. . 7. W. w. . 7. W. w. . 7. W. x. . :. [. |. . >. _. . !. B4  Message Index m. . -. M. m. . -. M. m. . .. O. p. . 2. S. t. . 6. W. x. . :. [. |. . >. _. . !. B5  Variable Index m. . -. M. m. . -. M. m. . .. O. p. . 2. S. t. . 6. W. x. . :. [. |. . >. _. . !. B6 """"""""""h  Z4-OCT-80