%! % % This file is a product of Sun Microsystems, Inc. and is provided for % unrestricted use provided that this legend is included on all tape % media and as a part of the software program in whole or part. % Users may copy, modify or distribute this file at will. % % THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE % WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR % PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. % % This file is provided with no support and without any obligation on the % part of Sun Microsystems, Inc. to assist in its use, correction, % modification or enhancement. % % SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE % INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE % OR ANY PART THEREOF. % % In no event will Sun Microsystems, Inc. be liable for any lost revenue % or profits or other special, indirect and consequential damages, even % if Sun has been advised of the possibility of such damages. % % Sun Microsystems, Inc. % 2550 Garcia Avenue % Mountain View, California 94043 % % Copyright (c) 1988 by Sun Microsystems, Inc. % (Loading...) [] dbgprintf /Item where { pop } { systemdict begin (NeWS/liteitem.ps) LoadFile end } ifelse %systemdict begin (NeWS/psview/pw.ps) LoadFile end %systemdict begin (NeWS/psview/menubar.ps) LoadFile end %systemdict begin (NeWS/psview/newslinewin.ps) LoadFile end /PicWindow where { pop } { systemdict begin (NeWS/psview/pw.ps) LoadFile end } ifelse /MenuBar where { pop } { systemdict begin (NeWS/psview/menubar.ps) LoadFile end } ifelse /NewsLineWin where { pop } { systemdict begin (NeWS/psview/newslinewin.ps) LoadFile end } ifelse % /cat % bytes infile outfile { % 3 copy (cat: % % %\n) [ 5 2 roll ] dbgprintf 10 dict begin % local variables! /outfile exch def /infile exch def /bytes exch def /strlen 1024 def 0 strlen bytes strlen sub { % (% ) [ 3 2 roll ] dbgprintf infile strlen string readstring pop outfile exch writestring pause } for infile bytes strlen mod string readstring pop outfile exch writestring end } def /ps_paint { gsave /getcanvas PSPic send setcanvas Scale dup scale BG fillcanvas FG setcolor PGC grestore /paint PSPic send } def % /PGC { /@DictHeight countdictstack def @Dicts length 1 sub -1 0 { @Dicts exch get begin } for mark { (/tmp/psview.out) run } errored{ cleartomark } if { countdictstack @DictHeight le { exit } if end } loop } def % /SetPageCount { % page /PageCount exch store PageCount /setcurrent PSWin send } def /new_page { % page -> - SetPageCount pagetag PageCount typedprint } def /NEXT { PageCount 1 add dup MAX gt {pop} { new_page } ifelse } def /PREV { PageCount 1 sub dup MIN lt {pop} { new_page } ifelse } def /REDIS { PageCount new_page } def /FIRST { MIN new_page } def /LAST { MAX new_page } def /EXIT { exittag } def /PageCount 1 def % current page number, initially = 1 /SetMinMax { % int int -> - userdict begin /MAX exch def /MIN exch def end MIN MAX /setminmax PSWin send } def /DPI 80 def /NeWSDPI 72 def /Scale DPI NeWSDPI div def /PageWidthInInches 8.5 def /PageHeightInInches 11.0 def /WinX 0 def /WinY 0 def /WinWidth PageWidthInInches 1 sub DPI mul cvi def /WinHeight PageHeightInInches 1 sub DPI mul cvi def /PSWin PageWidthInInches DPI mul cvi PageHeightInInches DPI mul cvi framebuffer /new NewsLineWin send def WinX WinY WinWidth WinHeight /reshapeview PSWin send 1 2 SetMinMax [ (About NewsLine...) { currentcursorlocation [ ( NewsLine ) ( (c) 1988 Bruce V. Schwartz ) ] popmsg } ] /new BarMenu send (Info) {} /addmenu PSWin send [ (Print) { (cd /tmp; cat laser.out prolog.out psview.out | lpr) forkunix } (NeWS Print) { (cd /tmp; cat laser.out prolog.out psview.out | psh) forkunix } % (-----) { } % (Quit) { EXIT } ] /new BarMenu send (File) {} /addmenu PSWin send /SendFileTag { filetag typedprint typedprint 1 SetPageCount } def [ % (Cover Letter) { (xxx) (pguide/cover-letter.ps) SendFileTag } (Table Of Contents) { (xxx) (pguide/TOC.ps) SendFileTag } (Introduction) { (xxx) (pguide/introduction.ps) SendFileTag } (Chapter 1) { (xxx) (pguide/chapter1.ps) SendFileTag } (Chapter 2) { (xxx) (pguide/chapter2.ps) SendFileTag } (Chapter 3) { (xxx) (pguide/chapter3.ps) SendFileTag } (Chapter 4) { (xxx) (pguide/chapter4.ps) SendFileTag } (Chapter 5) { (xxx) (pguide/chapter5.ps) SendFileTag } (Chapter 6) { (xxx) (pguide/chapter6.ps) SendFileTag } (Chapter 7) { (xxx) (pguide/chapter7.ps) SendFileTag } (Chapter 8) { (xxx) (pguide/chapter8.ps) SendFileTag } (Chapter 9) { (xxx) (pguide/chapter9.ps) SendFileTag } (Appendix A) { (xxx) (pguide/appendixa.ps) SendFileTag } (Appendix B) { (xxx) (pguide/appendixb.ps) SendFileTag } (Appendix C) { (xxx) (pguide/appendixc.ps) SendFileTag } % (columbia) { (columbia) (/usr/NeWS/smi/columbia.ps) SendFileTag } % (nozzle) { (nozzle) (/usr/NeWS/smi/nozzle.ps) SendFileTag } % (overview) { (overview) (/usr/NeWS/smi/overview.ps) SendFileTag } ] /new BarMenu send (Chapter) {} /addmenu PSWin send % { ClientMenu } PSWin send (Page) {} /addmenu PSWin send /SetDPI { userdict /DPI 2 index put pop userdict /Scale DPI NeWSDPI div put PageWidthInInches DPI mul cvi PageHeightInInches DPI mul cvi /reshapebuffer PSWin send % /paint PSPic send ps_paint } def [ ( 72 DPI: Macintosh resolution) { 72 SetDPI } ( 80 DPI: standard Sun monitor) { 80 SetDPI } (110 DPI: funky color Sun monitor) { 114 SetDPI } (120 DPI: hi-res Sun monitor) { 120 SetDPI } (Native x 2.00) { NeWSDPI 2.00 mul SetDPI } (Native x 1.50) { NeWSDPI 1.50 mul SetDPI } (Native x 1.25) { NeWSDPI 1.25 mul SetDPI } (Native x 1.00) { NeWSDPI 1.00 mul SetDPI } (Native x 0.75) { NeWSDPI 0.75 mul SetDPI } (Native x 0.50) { NeWSDPI 0.50 mul SetDPI } ( Special ) { GlobalDPI SetDPI } ] /new BarMenu send (Settings ) {} /addmenu PSWin send /PSPic /getpic PSWin send def .5 /setvalue PSPic /HScrollbar get send .5 /setvalue PSPic /VScrollbar get send /map PSWin send % % % Create handlers for each key /handlers 100 dict def handlers begin % FunctionF7 { NEXT } def % 'F7 ' % FunctionF6 { PREV } def % 'F6 ' 32 { NEXT } def % ' ' 43 { NEXT } def % '+' 8 { PREV } def % '\b' 45 { PREV } def % '-' 48 { FIRST} def % '0' 60 { FIRST} def % '<' 44 { FIRST} def % ',' 62 { LAST } def % '>' 46 { LAST } def % ',' 36 { LAST } def % '$' 3 { EXIT } def % ^C % /LeftMouseButton {NEXT} def end { % done as a separate process so the file reading % process can exit PSWin /ClientCanvas get setcanvas % Start the input handler systemdict /Selections known { % The new extended input system currentcanvas addkbdinterests pop } if createevent dup begin /Name 200 dict dup begin 0 1 127 { dup def } for /LeftMouseButton dup def end def /Action /DownTransition def /Canvas currentcanvas def end expressinterest % Input handling loop { clear /CurrentEventX awaitevent def CurrentEventX /Name get dup handlers exch known { handlers exch get cvx exec } if } loop } fork clear % Attempt to do smooth fades, (it didn't work) /ScrollOut { gsave {ItemCanvas setcanvas } PSPic send % 16 is scrollwidth 0 16 ViewWidth 16 sub ViewHeight 16 sub rectpath clip BG setcolor BG fillcanvas 0 { clippath 0 DPI neg copyarea 0 ViewHeight ViewWidth DPI neg rectpath fill } repeat grestore } def % (done\n) [] dbgprintf