From don Tue Oct 31 20:32:15 1989 Date: Tue, 31 Oct 89 20:32:15 -0500 To: NeWS-makers@brillig.umd.edu Subject: A neat new window package From: korp@athens.ees.anl.gov (Peter Korp) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This does not work with X11/NeWS yet, but we will enhance it as soon as we get the server. Enjoy. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% BTOL -- VERSION 1.0 %%% (Better Than Op*n L**k) %%% %%% This work was originaly generated to improve on the standard %%% lite window and menu implementations. Besides, we were all getting %%% tired of following those crazy pullright menus 4-5 levels deep. %%% %%% This is Version 1.0 of the BTOL window package %%% Feel free to use this code as you like, provided this header is %%% left intact. If you come up with neat new features, questions, bugs, %%% ideas or whatever let us know, it would be greatly appreciated. %%% %%% %%% Peter A. Korp %%% Argonne National Laboratory %%% Visual Interfaces Section %%% korp@athens.ees.anl.gov %%% %%% David C. Mak %%% Argonne National Laboratory %%% Visual Interfaces Section %%% mak@athens.ees.anl.gov %%% %%% David G. Zawada %%% Argonne National Laboratory %%% Visual Interfaces Section %%% zawada@athens.ees.anl.gov %%% %%% %%% %%% %%% BTOL provides NeWS application programmers with 5 new classes that %%% allow for writing more visually appealing software. These classes %%% implement new: %%% %%% 1) Buttons %%% 2) Menu Buttons %%% 3) Base Windows %%% 4) Menus %%% 5) Application Windows %%% %%% In Developing BTOL, we were aware of the standard lite API and %%% attempted to adhere to it in general, but did not feel BTOL had %%% to made 100% lite compatible. We feel it would require little %%% time to actually make it compatible and will do this if there is %%% enough user interest. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class: BtolButton %%% %%% Purpose: To create a new button that conformed to our interface %%% %%% Useful methods: %%% %%% /new % label => instance %%% - creates a new instance of BtolButton %%% /resetcolors % - => - %%% - reset button colors to specified defaults %%% /sethue % hue => - %%% - set the hue for hsb value of button %%% /sethsb % color => - %%% - set the hsb color for button %%% /Activate % - => - %%% - allows button notify proc notification %%% /DeActivate % - => - %%% - Grays out button and disallow notification %%% /HiLite % - => - %%% - HiLite the button %%% /DeHiLite % - => - %%% - DeHilite the button %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class: BtolMenuButton %%% %%% Purpose: Create a button that can have a submenu off of it %%% %%% Useful methods: %%% %%% /new % Pullright label notifyproc ParentMenu width height => instance %%% - creates a new instance of BtolMenuButton %%% /movesubmenu % - => - %%% - moves the buttons submenu to its current x and y by mapping it %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class: BtolWindow %%% %%% Purpose: Create a window that has an array available for items that %%% will go into window as well as eventmgr. The items are %%% disposed of correctly when you destory the window %%% %%% Useful methods: %%% %%% /new % parentcanvas => instance %%% - creates a new instance of BtolWindow %%% /resetcolors % - => - %%% - reset button colors to specified defaults %%% /sethue % hue => - %%% - set the hue for hsb value of button %%% /sethsb % color => - %%% - set the hsb color for button %%% /hide % - => - %%% - If used from a BtolAppwin, allows the AppWin to hide all of %%% its children when it is deselected %%% /unhide % - => - %%% - If used from a BtolAppwin, allows the AppWin to show all of %%% its children when it is selected %%% /HiLiteFrame % - => - %%% - HiLite the window %%% /DeHiLiteFrame % - => - %%% - DeHilite the window %%% /CreateZapControl % - => - %%% - Creates a control in upper right of window to zap window %%% /CreateCloseControl % - => - %%% - Creates a control in upper left of window to close windows %%% /CreateResizeControl % - => - %%% - Creates resize controls at bottom of screen %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class: BtolMenu %%% %%% Purpose: Create a menu that has walking submenus and conforms to BTOL %%% UI %%% %%% Useful methods: %%% %%% /new % [menuitem names] [actions] => instance %%% - creates a new instance of BtolMenu %%% /resetcolors % - => - %%% - reset menu colors to specified defaults %%% /sethue % hue => - %%% - set the hue for hsb value of button %%% /sethsb % color => - %%% - set the hsb color for menu %%% /dragmenu % - => - %%% - if this menu is a submenu it moves to parents right %%% /detach % - => - %%% - unmaps all submenus %%% /getcmi % - => BtolMenuButton %%% - get current menu item (Button that has its submenu showing) %%% /flipcmi % BtolMenuButton => - %%% - flip the state of current menu item %%% /setcmi % BtolMenuButton => - %%% - set the current menu item %%% /AutoSize % - => - %%% - after all the items are put in a menu run AutoSize to make %%% all the menu items and label fit nice. (Run before mapping) %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class: BtolAppWin %%% %%% Purpose: Create an application window with BTOL look and feel %%% %%% Useful methods: %%% %%% /new % Framelabel => instance -or- canvas => instance %%% - creates a new instance of BtolAppWindow %%% /newsubwin % Framelabel => subwindow %%% - create a subwindow for this application. It will automatically %%% open and close correctly, with the main AppWin %%% /sethue % hue => - %%% - set the hue for hsb value of button %%% /sethsb % color => - %%% - set the hsb color for button %%% /getappwin % - => BtolAppWin %%% - return the AppWindow whose menu is currently showing %%% /setappwin % BtolAppWin => - %%% - set the current AppWindow to be this AppWin %%% /destroychild % subwindow => - %%% - destroys a child subwindow %%% /destroychildren % [subwindows] => - %%% - destroys several child subwindows %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Class structure of BTOL %%% ----------------------- %%% %%% ------------ ------------- %%% |LiteWindow| |LabeledItem| %%% ------------ ------------- %%% | | %%% ------v----- -----v------ %%% |BtolWindow| |BtolButton| %%% ------------ ------------ %%% | | %%% _________|__________ | %%% | | | %%% -------v------- ---v------ ------v--------- %%% |BtolAppWindow| |BtolMenu|<-----|BtolMenuButton| %%% --------------- ---------- ---------------- %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Example -1- %%% %%% A trivial BTOL program. We let the Btol code do all the work. %%% /win framebuffer /new BtolAppWin send def %%% { %%% /PaintClient %%% { %%% 0 fillcanvas %%% 0 1 random 100 mul { random mul random 144 mul random random random setrgbcolor %%% moveto 240 100 lineto stroke } for %%% } def %%% reshapefromuser %%% totop %%% map %%% } win send %%% %%% psh Example -1- again and watch how the menus interact %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Example -2- %%% %%% A simple sample application written for BTOL %%% %%% /AppFont /Courier findfont def %%% /AppFontSize 18 def %%% %%% /changefontsize % dsize => - %%% { %%% /AppFontSize AppFontSize 3 -1 roll add 8 max store %%% %%% AppFont AppFontSize scalefont %%% /paint win send %%% } def %%% %%% %%% /changefont % fontname => - %%% { %%% /AppFont exch findfont store %%% 0 changefontsize %%% } def %%% %%% %%% /colormenu %%% [() dup dup dup dup dup dup dup dup dup] %%% [ {Hue /sethue /getappwin BtolAppWin send send} 9 { dup } repeat ] %%% /new BtolMenu send %%% dup /MenuItems get 0 1 9 %%% { dup 10 div /sethue 3 index 4 -1 roll get send } for pop %%% def %%% %%% /sizemenu %%% [(Enlarge by 2) (Enlarge by 10) (Reduce by 2) (Reduce by 10)] %%% [ { 2 changefontsize } { 10 changefontsize } { -2 changefontsize } { -10 changefontsize } ] /new BtolMenu send def %%% %%% /fontmenu %%% [ %%% (Courier) (Helvetica) (Times-Roman) %%% ] %%% [ { ItemLabel changefont } 2 index length 1 sub { dup } repeat ] /new BtolMenu send def %%% %%% /changefontmenu %%% [ (Font) (Size) ] %%% [ fontmenu sizemenu ] /new BtolMenu send def %%% %%% colormenu %%% /sethue %%% { %%% /Hue exch def %%% /HiLiteColor Hue 0.3 1 hsbcolor def %%% /ShadowColor Hue 1 0.45 hsbcolor def %%% /FaceColor Hue 0.4 .9 hsbcolor def %%% %%% HiLiteFrame %%% paint %%% } %%% put %%% %%% /mainmenu %%% [(Window Color) (Change Font) (Hide) (Quit)] %%% [ %%% colormenu %%% changefontmenu %%% { /flipiconic /getappwin BtolAppWin send send } %%% { /ZapNotify /getappwin BtolAppWin send send } %%% ] /new BtolMenu send def %%% %%% { %%% /FrameLabel (Example #2) def %%% AutoSize %%% } mainmenu send %%% %%% %%% /win framebuffer /new BtolAppWin send def %%% { %%% CreateCloseControl %%% CreateResizeControl %%% /FrameMenu mainmenu def %%% /FrameLabel (A BTOL window! Example #2) def %%% /IconLabel (Example #2) def %%% /PaintClient %%% { %%% gsave %%% 0 fillcanvas %%% 0 1 random 100 mul %%% { %%% random mul random 144 mul %%% random random random setrgbcolor %%% moveto 240 100 lineto stroke %%% } for %%% AppFont AppFontSize scalefont setfont %%% 50 50 moveto (BTOL - it just looks better!) show %%% grestore %%% } def %%% reshapefromuser %%% ClientCanvas /Retained true put %%% totop %%% map %%% } win send %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Have fun with the sample code and please let us know how you like %%% the product. %%% - Dave, Dave and Peter %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict begin % ============================= Btol Button Item ============================= /BtolButton LabeledItem dictbegin /Activated? true def /Hue 0 def /ShadowColor .1 .1 .1 rgbcolor def /HiLiteColor .9 .9 .9 rgbcolor def /FaceColor .7 .7 .7 rgbcolor def /CurrentTextColor ShadowColor def dictend classbegin /new % label notifyproc parentcanvas => instance { % fake a labeled item. dup type /canvastype eq {() /Center 4 2 roll} {() /Center 6 2 roll} ifelse /new super send begin /ItemRadius 0 def /ItemFrame 2 def /ItemBorder null def % /ItemID 0 def %%%DZpatch -- used in dock currentdict end } def /resetcolors { /ShadowColor .1 .1 .1 rgbcolor store /HiLiteColor .9 .9 .9 rgbcolor store /FaceColor .7 .7 .7 rgbcolor store } def /sethue % hue { /Hue exch def /HiLiteColor Hue 0.3 1 hsbcolor def /ShadowColor Hue 1 0.45 hsbcolor def /FaceColor Hue 0.4 .9 hsbcolor def } def /sethsb % color -> - { /FaceColor exch def } def /reshape % x y w h => - { /ItemHeight exch def /ItemWidth exch def LabelSize /LabelHeight exch def /LabelWidth exch def ItemBorder null eq {/ItemBorder ItemFrame def} if /ItemWidth ItemWidth ItemBorder ItemGap add 2 mul LabelWidth add max def /ItemHeight ItemHeight ItemBorder ItemGap add 2 mul LabelHeight add max def /LabelX ItemWidth LabelWidth sub 2 div LabelX add def /LabelY ItemHeight LabelHeight sub 2 div LabelY add def ItemLabel type /stringtype eq { % adjust for descenders /LabelY LabelY ItemFont fontdescent 2 div sub ItemBorder max def } if ItemRadius 0 gt ItemRadius .5 le and { /ItemRadius ItemWidth ItemHeight min ItemRadius mul def } if ItemWidth ItemHeight /reshape super send } def /PaintItem { ItemValue true eq {HiLightButton} {PaintButton} ifelse } def /SetButtonValue % bool => - { /ItemValue exch store ItemValue ItemPaintedValue ne {/paint self send} if } def /ClientDown { Activated? {true SetButtonValue} if } def /ClientUp { Activated? { ItemValue {NotifyUser} if false SetButtonValue StopItem } if } def /ClientEnter {Activated? {true SetButtonValue} if} def /ClientExit {Activated? {false SetButtonValue} if } def /Activate { /CurrentTextColor ShadowColor store /Activated? true def paint } def /DeActivate { gsave /CurrentTextColor FaceColor setcolor currenthsbcolor .2 sub hsbcolor def /Activated? false def paint grestore } def /HiLite { /State true store paint } def /DeHiLite { /State false store paint } def /HiLightButton { gsave HiLiteColor setcolor 0 0 ItemWidth ItemHeight rectpath fill HiLiteColor PaintShadow ShadowColor PaintHiLite HiLiteColor PaintFace ItemFrame dup neg translate %%DZ fix -- block if %% PaintLabel ItemLabel type /stringtype eq { PaintLabel } { ItemLabel ShadowColor 0 0 ItemFont ShowThing } ifelse grestore } def /PaintButton { gsave FaceColor setcolor 0 0 ItemWidth ItemHeight rectpath fill ShadowColor PaintShadow HiLiteColor PaintHiLite FaceColor PaintFace %%DZ fix -- block if %% PaintLabel ItemLabel type /stringtype eq { PaintLabel } { ItemLabel ItemTextColor 0 0 ItemFont ShowThing } ifelse grestore } def /PaintFace % FaceColor => - { setcolor ItemFrame 0 0 ItemWidth ItemHeight insetrect rectpath fill } def /PaintShadow % ShadowColor => - { setcolor 0 0 moveto ItemFrame ItemFrame rlineto ItemWidth ItemFrame 2 mul sub 0 rlineto 0 ItemHeight ItemFrame 2 mul sub rlineto ItemFrame ItemFrame rlineto 0 ItemHeight neg rlineto fill } def /PaintHiLite % HiLiteColor => - { setcolor 0 0 moveto 0 ItemHeight rlineto ItemWidth 0 rlineto ItemFrame neg dup rlineto ItemWidth ItemFrame 2 mul sub neg 0 rlineto 0 ItemHeight ItemFrame 2 mul sub neg rlineto fill } def /PaintLabel { CurrentTextColor setcolor ItemWidth 2 div ItemHeight ItemFont fontheight ItemFont fontdescent sub sub 2 div moveto ItemLabel cshow } def classend def pause pause % =============================BtolMenuButton Item============================= /BtolMenuButton BtolButton dictbegin /State false def /ParentMenu null def /PullRight? false def /ArrowSize 0 def /SubMenu null def dictend classbegin /new % Pullright label notifyproc ParentMenu width height => instance { 2 index /ClientCanvas get 3 1 roll 4 -1 roll 7 1 roll /new super send begin /ItemValue false def /ArrowSize ItemFont fontheight 2 mul 3 div def /PullRight? exch def /ParentMenu exch def 0 0 move PullRight? { /ItemWidth ItemWidth ArrowSize 1.5 mul add def 0 0 ItemWidth ItemHeight reshape } if currentdict end } def /movesubmenu { SubMenu null ne ItemValue true eq and { /map SubMenu send } if } def /resetcolors { /resetcolors super send paint PullRight? { /resetcolors SubMenu send } if } def /sethue % hue => - { dup /sethue super send paint PullRight? { /sethue SubMenu send } { pop } ifelse } def /unmap { SubMenu null ne { /unmap SubMenu send } if } def /ZapNotify { SubMenu null ne { /ZapNotify SubMenu send } if } def /destroy { ZapNotify } def /PaintItem { %State true eq PullRight? and { /paint SubMenu send } if ItemValue true eq State true eq or {HiLightButton} {PaintButton} ifelse gsave PullRight? { ItemValue true eq State true eq or { ItemFrame dup neg translate } if ShadowColor setcolor ItemWidth ArrowSize 1.5 mul sub ItemHeight 2 div translate 0 ArrowSize 2 div neg moveto 0 ArrowSize 2 div lineto .866 ArrowSize mul 0 lineto stroke HiLiteColor setcolor .866 ArrowSize mul 0 moveto 0 ArrowSize 2 div neg lineto stroke } if grestore } def /PaintLabel { CurrentTextColor setcolor 10 ItemHeight ItemFont fontheight ItemFont fontdescent sub sub 2 div moveto ItemLabel show } def classend def pause pause /BtolWindow LiteWindow dictbegin /items null def /itemmgr null def /IsUp? false def /ControlInterests null def /ControlMgr null def /FrameTextColor 0 0 0 rgbcolor def /MenuLabel () def /BorderWidth 0 def /BorderLeft 1 def /BorderBottom 1 def /BorderRight 1 def /BorderTop 0 def /ControlSize 0 def /ControlFrame 2 def /IconFrame 2 def /ShadowColor .1 .1 .1 rgbcolor def /HiLiteColor .9 .9 .9 rgbcolor def /FaceColor .7 .7 .7 rgbcolor def /Resizable? false def /Closable? false def /Zappable? false def dictend classbegin /new % parentcanvas => window { /new super send begin /ClientMenu null def /ControlInterests 15 dict store /FrameFillColor FaceColor def /FrameTextColor ShadowColor def /FrameFont /Times-Roman findfont 18 scalefont def /BorderTop FrameFont fontheight 1.5 mul store /ControlSize FrameFont fontheight store /IconFont /Helvetica findfont 10 scalefont def currentdict end } def /map { /IsUp? true def MoveFrameControls /map super send } def /unmap { /IsUp? false def /unmap super send } def /unhide { IsUp? { /map super send } if } def /hide { IsUp? { /unmap super send } if } def /resetcolors { /ShadowColor .1 .1 .1 rgbcolor store /HiLiteColor .9 .9 .9 rgbcolor store /FaceColor .7 .7 .7 rgbcolor store } def /sethue % hue { /Hue exch def /HiLiteColor Hue 0.3 1 hsbcolor def /ShadowColor Hue 1 0.45 hsbcolor def /FaceColor Hue 0.4 .9 hsbcolor def /FrameFillColor FaceColor def /FrameTextColor ShadowColor def } def /ZapNotify { ClientCanvas /Retained false put FrameCanvas /Retained false put ClientCanvas 0 0 0 0 rectpath reshapecanvas FrameCanvas 0 0 0 0 rectpath reshapecanvas FrameEventMgr null ne { FrameEventMgr killprocess } if itemmgr null ne {itemmgr killprocess} if ControlMgr null ne { ControlMgr killprocess } if currentdict /ZapControl undef currentdict /CloseControl undef currentdict /LeftStretchControl undef currentdict /MiddleStretchControl undef currentdict /RightStretchControl undef currentdict /ControlMgr undef currentdict /FrameEventMgr undef currentdict /ClientCanvas undef currentdict /FrameCanvas undef currentdict /ControlInterests undef currentdict /FrameInterests undef currentdict /items undef } def /CloseNotify { flipiconic } def /destroy { ZapNotify } def /PaintFrame % { PaintFrameBorder 0 FrameHeight BorderTop sub 1 add FrameWidth 1 sub BorderTop 1 sub rectpath gsave FrameFillColor setcolor fill grestore FrameTextColor setcolor stroke PaintFrameControls PaintFrameLabel } def /HiLiteFrame { /FrameFillColor ShadowColor def /FrameTextColor HiLiteColor def paintframe } def /DeHiLiteFrame { /FrameFillColor FaceColor def /FrameTextColor ShadowColor def paintframe } def /IconPaintFace % FaceColor => - { setcolor IconFrame 0 0 IconWidth IconHeight insetrect rectpath fill } def /IconPaintShadow % ShadowColor => - { setcolor 0 0 moveto IconFrame dup rlineto IconWidth IconFrame 2 mul sub 0 rlineto 0 IconHeight IconFrame 2 mul sub rlineto IconFrame dup rlineto 0 IconHeight neg rlineto fill pause } def /IconPaintHiLite % HiLiteColor => - { setcolor 0 0 moveto 0 IconHeight rlineto IconWidth 0 rlineto IconFrame neg dup rlineto IconWidth IconFrame 2 mul sub neg 0 rlineto 0 IconHeight IconFrame 2 mul sub neg rlineto fill pause } def /PaintIconLabel { IconFont setfont 0 IconHeight IconFont fontheight 1.5 mul sub IconWidth IconFont fontheight 1.5 mul rectpath ShadowColor setcolor fill HiLiteColor setcolor IconWidth 2 div IconHeight IconFont fontheight sub moveto IconLabel cshow pause } def /PaintIcon { gsave IconCanvas setcanvas FaceColor fillcanvas IconImage null ne { 0 0 moveto IconImage showicon } if IconLabel null ne { PaintIconLabel } if HiLiteColor IconPaintHiLite ShadowColor IconPaintShadow grestore } def /CreateFrameInterests % - => - (Create frame control interests) { FrameInterests begin /FrameTopEvent PointButton /totop DownTransition FrameCanvas eventmgrinterest def /FrameMoveEvent AdjustButton /slide DownTransition FrameCanvas eventmgrinterest def /FrameMenuEvent MenuButton {} DownTransition FrameCanvas eventmgrinterest def /FrameDamageEvent /Damaged /FixFrame null FrameCanvas eventmgrinterest def /FrameEnterEvent /EnterEvent /EnterFrame [0 2] FrameCanvas eventmgrinterest def /FrameExitEvent /ExitEvent /ExitFrame [0 2] FrameCanvas eventmgrinterest def /FrameDoItEvent /DoItEvent {gsave /ClientData get cvx exec grestore} /Window null eventmgrinterest def /FrameIconicFcnKeyEvent /WindowFunction /flipiconic /FlipIconic FrameCanvas eventmgrinterest def /FrameFrontFcnKeyEvent /WindowFunction /totop /FlipFront FrameCanvas eventmgrinterest def /IconMenuEvent {} def end } def pause /CreateCloseControl { gsave FrameCanvas setcanvas /CloseControl FrameCanvas newcanvas dup begin /Mapped true def /EventsConsumed /AllEvents def end def /Closable? true def ControlInterests begin /FrameCloseEvent PointButton /CloseNotify DownTransition CloseControl eventmgrinterest def end ControlMgr null ne {ControlMgr killprocess} if /ControlMgr ControlInterests forkeventmgr store 0 0 ControlSize dup rectpath CloseControl reshapecanvas grestore } def /CreateZapControl { gsave FrameCanvas setcanvas /ZapControl FrameCanvas newcanvas dup begin /Mapped true def /EventsConsumed /AllEvents def end def /Zappable? true def ControlInterests begin /FrameZapEvent PointButton /destroy DownTransition ZapControl eventmgrinterest def end ControlMgr null ne {ControlMgr killprocess} if /ControlMgr ControlInterests forkeventmgr store 0 0 ControlSize dup rectpath ZapControl reshapecanvas grestore } def /CreateResizeControl { gsave /Resizable? true def /BorderBottom FrameFont fontheight 2 div 10 max def FrameCanvas setcanvas ShapeClientCanvas /LeftStretchControl FrameCanvas newcanvas dup begin /Mapped true def /EventsConsumed /AllEvents def end def /MiddleStretchControl FrameCanvas newcanvas dup begin /Mapped true def /EventsConsumed /AllEvents def end def /RightStretchControl FrameCanvas newcanvas dup begin /Mapped true def /EventsConsumed /AllEvents def end def ControlInterests begin /FrameLeftStretchEvent PointButton {totop stretchcorner} DownTransition LeftStretchControl eventmgrinterest def /FrameMiddleStretchEvent PointButton {totop stretchwindowedge} DownTransition MiddleStretchControl eventmgrinterest def /FrameRightStretchEvent PointButton {totop stretchcorner} DownTransition RightStretchControl eventmgrinterest def end ControlMgr null ne {ControlMgr killprocess} if /ControlMgr ControlInterests forkeventmgr store 0 0 15 BorderBottom rectpath LeftStretchControl reshapecanvas 0 0 FrameWidth 30 sub BorderBottom rectpath MiddleStretchControl reshapecanvas 0 0 15 BorderBottom rectpath RightStretchControl reshapecanvas grestore } def /CreateIconInterests % - => - (Create icon control interests) { FrameInterests begin /IconOpenEvent PointButton /flipiconic DownTransition IconCanvas eventmgrinterest def /IconMoveEvent AdjustButton /slide DownTransition IconCanvas eventmgrinterest def /IconMenuEvent {} def /IconDamageEvent /Damaged /FixIcon null IconCanvas eventmgrinterest def /IconIconicFcnKeyEvent /WindowFunction /flipiconic /FlipIconic IconCanvas eventmgrinterest def /IconFrontFcnKeyEvent /WindowFunction /totop /FlipFront IconCanvas eventmgrinterest def end } def /CreateFrameControls % - => - (Create frame control canvases/items) { } def /CreateFrameCanvas % - => - (Create empty frame canvas) { /FrameCanvas ParentCanvas newcanvas def /ptr /ptr_m FrameCanvas setstandardcursor } def /CreateFrameMenu { } def /CreateIconMenu { } def /MoveFrameControls % - => - ([Re]set frame control shapes) { gsave Closable? { CloseControl setcanvas ControlFrame FrameHeight BorderTop sub BorderTop ControlSize sub 2 div add movecanvas } if Zappable? { ZapControl setcanvas FrameWidth ControlSize ControlFrame add sub FrameHeight BorderTop sub BorderTop ControlSize sub 2 div add movecanvas } if Resizable? { LeftStretchControl setcanvas 0 0 movecanvas MiddleStretchControl setcanvas 0 0 FrameWidth 30 sub BorderBottom rectpath MiddleStretchControl reshapecanvas 15 0 movecanvas RightStretchControl setcanvas FrameWidth 15 sub 0 movecanvas } if grestore } def /PaintFrameBorder { % - => - (Paint frame border areas) ShadowColor strokecanvas } def /PaintFocus { } def /PaintFrameLabel { gsave FrameTextColor setcolor FrameFont setfont FrameWidth 2 div FrameHeight FrameFont fontheight sub moveto FrameLabel cshow grestore } def /ControlPaintFace % FaceColor => - { setcolor ControlFrame 0 0 ControlSize dup insetrect rectpath fill } def /ControlPaintShadow % ShadowColor => - { setcolor 0 0 moveto ControlFrame dup rlineto ControlSize ControlFrame 2 mul sub 0 rlineto 0 ControlSize ControlFrame 2 mul sub rlineto ControlFrame dup rlineto 0 ControlSize neg rlineto fill } def pause /ControlPaintHiLite % HiLiteColor => - { setcolor 0 0 moveto 0 ControlSize rlineto ControlSize 0 rlineto ControlFrame neg dup rlineto ControlSize ControlFrame 2 mul sub neg 0 rlineto 0 ControlSize ControlFrame 2 mul sub neg rlineto fill } def /PaintFrameControls { gsave Closable? { CloseControl setcanvas FaceColor setcolor clippath fill ShadowColor ControlPaintShadow HiLiteColor ControlPaintHiLite FaceColor ControlPaintFace ShadowColor setcolor ControlFrame dup 2 div add 0 0 ControlSize dup insetrect rectpath fill FaceColor setcolor ControlFrame dup add 0 0 ControlSize dup ControlFrame sub insetrect rectpath fill } if Zappable? { ZapControl setcanvas FaceColor setcolor clippath fill ShadowColor ControlPaintShadow HiLiteColor ControlPaintHiLite FaceColor ControlPaintFace ShadowColor setcolor 2 { ControlFrame dup add dup moveto ControlSize ControlFrame dup add sub dup lineto ControlFrame dup add ControlSize ControlFrame dup add sub moveto ControlSize ControlFrame dup add sub ControlFrame dup add lineto stroke -1 0 translate } repeat } if Resizable? { LeftStretchControl setcanvas FaceColor fillcanvas ShadowColor strokecanvas MiddleStretchControl setcanvas FaceColor fillcanvas ShadowColor strokecanvas RightStretchControl setcanvas FaceColor fillcanvas ShadowColor strokecanvas } if grestore } def classend def pause pause /BtolMenu BtolWindow dictbegin /CMI null def /MenuActions null def /MenuChoices null def /MenuItemFont /Helvetica findfont 14 scalefont def /MenuLabelFont /Helvetica-Bold findfont 14 scalefont def /MenuItems null def /MenuItemsEM null def /ParentMenu null def dictend classbegin /new % [menu items names] [actions] => window { framebuffer /new super send begin /MenuActions exch store /MenuChoices exch store /FrameFont MenuLabelFont def /FrameFillColor ShadowColor def /FrameTextColor HiLiteColor def /BorderWidth 0 def /BorderLeft 0 def /BorderRight 0 def /BorderBottom 0 def /BorderTop MenuLabelFont fontheight 10 add def 0 2048 1 1 reshape ClientCanvas /Retained true put MakeMenuItems currentdict end } def /dragmenu { ParentMenu null ne { gsave framebuffer setcanvas ParentMenu /FrameCanvas get getcanvaslocation ParentMenu begin FrameHeight add exch FrameWidth add exch end FrameHeight sub move grestore } if } def /move { /move super send CMI null ne { pause /dragmenu CMI /SubMenu get send } if } def /slide { { GetCanvas setcanvas InteractionLock { 20 dict begin /absmove { gsave %Canvas setcanvas [1 0 0 1 0 0] setmatrix yo add exch xo add exch move grestore pause } def gsave [1 0 0 1 0 0] setmatrix % initmatrix /Canvas currentcanvas def currentcursorlocation /yo exch neg def /xo exch neg def clippath pathbbox /height exch def /width exch def pop pop Canvas parentcanvas createoverlay setcanvas 0 0 { absmove newpath } getanimated waitprocess aload pop absmove grestore end } monitor } fork pop } def /map { CMI null ne { /map CMI /SubMenu get send } if /map super send } def /unmap { /unmap super send CMI null ne { /unmap CMI /SubMenu get send } if } def /totop { CMI null ne { /totop CMI /SubMenu get send } if /totop super send } def /detach % - => - { CMI null ne { /detach CMI /SubMenu get send } if unmap } def /resetcolors { /resetcolors super send HiLiteFrame MenuItems { /resetcolors exch send } forall } def /sethue % hue { dup /sethue super send HiLiteFrame MenuItems { 1 index /sethue 3 -1 roll send } forall pop } def /flipcmi % BtolMenuButton => - { dup CMI eq { dup /State get { pop null setcmi } { setcmi } ifelse } { setcmi } ifelse } def /setcmi % BtolMenuButton => - %%% cmi(Current Menu Item) { CMI null ne { /DeHiLite CMI send /detach CMI /SubMenu get send } if /CMI exch store CMI null ne { /HiLite CMI send {AutoSize totop dragmenu map} CMI /SubMenu get send } if } def /getcmi % - => BtolMenuButton { CMI } def /ReshapeMenuItems % - => - { /tmp MenuItems 0 get /ItemHeight get def 0 1 MenuItems length 1 sub { 1 FrameHeight BorderTop sub tmp 1 add 3 index 1 add mul sub FrameWidth 2 sub tmp /reshape MenuItems 7 -1 roll get send } for } def /AutoSize % called after any change to the frame label or font { gsave FrameFont setfont /FrameWidth FrameLabel ( ) append stringwidth pop def grestore MenuItems { /FrameWidth exch /ItemWidth get FrameWidth max store pause } forall /FrameWidth FrameWidth 2 add def /FrameHeight MenuItems length MenuItems 0 get /ItemHeight get 1 add mul BorderTop add def FrameX FrameY FrameWidth FrameHeight reshape ReshapeMenuItems } def /MakeMenuItems % - => - { /MenuItems [ 0 1 MenuChoices length 1 sub { MenuActions 1 index get type /dicttype eq { MenuChoices self MenuActions 3 index get begin /ParentMenu exch def /FrameLabel exch 2 index get def end true MenuChoices 2 index get { self /flipcmi ParentMenu send } self 0 0 /new BtolMenuButton send dup begin /SubMenu MenuActions 4 -1 roll get def /ItemLabelFont MenuItemFont def end } { false MenuChoices 2 index get MenuActions 4 -1 roll get self 0 0 /new BtolMenuButton send dup begin /ItemLabelFont MenuItemFont def end } ifelse 0 0 /move 3 index send pause } for ] def /MenuItemsEM MenuItems forkitems def AutoSize } def /PaintClient { MenuItems paintitems } def /CreateFrameInterests { % - => - (Create frame control interests) FrameInterests begin /FrameTopEvent PointButton /totop DownTransition FrameCanvas eventmgrinterest def /FrameMoveEvent AdjustButton /slide DownTransition FrameCanvas eventmgrinterest def /FrameDamageEvent /Damaged /FixFrame null FrameCanvas eventmgrinterest def end } def /ZapNotify { MenuItems {/ZapNotify exch send} forall MenuItemsEM null ne { MenuItemsEM killprocess } if /ZapNotify super send currentdict /MenuItems undef currentdict /ParentMenu undef currentdict /CMI undef } def /destroy { ZapNotify } def /CreateFrameMenu {} def /flipiconic {} def classend def pause pause /BtolAppWin BtolWindow dictbegin /Childern null def dictend classbegin /AppWindow null def /TmpAppWin null def /new % label => instance { dup type /stringtype eq {framebuffer} {() exch} ifelse /new super send begin /FrameLabel exch def /IconLabel FrameLabel def /FrameMenu [(Info ...) (Hide) (Quit)] [ {} { /flipiconic /getappwin BtolAppWin send send } { /ZapNotify /getappwin BtolAppWin send send } ] /new BtolMenu send def FrameMenu /FrameLabel FrameLabel put /AutoSize FrameMenu send /PaintClient { FaceColor fillcanvas } def FrameX FrameY 1 1 reshape CreateZapControl currentdict AppWindow null ne { /totop AppWindow send } if /Children [] def end } def /newsubwin { framebuffer /new BtolWindow send dup dup /Children Children dup length 1 add 4 -1 roll arrayinsert def self exch begin /ParentApp exch def /FrameLabel 3 -1 roll def ParentApp begin ShadowColor FaceColor HiLiteColor end /HiLiteColor exch def /FaceColor exch def /ShadowColor exch def /IconLabel FrameLabel def /FrameFillColor ShadowColor def /FrameTextColor HiLiteColor def /PaintClient { FaceColor fillcanvas } def /totop { ParentApp /FrameMenu get /FrameCanvas get /CanvasAbove get null ne ParentApp /FrameMenu get /FrameCanvas get /CanvasBelow get FrameCanvas ne or { ParentApp /setappwin ParentApp send /totop super send /totop ParentApp /FrameMenu get send } if } def /destroy { /unmap self send } def FrameX FrameY 1 1 reshape end } def /flipiconic { /unmap self send /Iconic? Iconic? not def IconX null eq { FrameX FrameY FrameHeight add IconHeight sub /move self send } if ZoomProc /map self send Iconic? not { self setappwin /totop FrameMenu send /map FrameMenu send } { /unmap FrameMenu send } ifelse } def /map { Iconic? not { Children { /unhide exch send } forall } if /map super send } def /unmap { Iconic? not { Children { /hide exch send } forall } if /unmap super send } def /paint % { AppWindow self eq %FrameMenu /FrameCanvas get /Mapped get { /paint FrameMenu send } if /paint super send } def /totop % - => - { self setappwin FrameMenu /FrameCanvas get /CanvasAbove get null ne FrameMenu /FrameCanvas get /CanvasBelow get FrameCanvas ne or { /totop super send /totop FrameMenu send } if } def /resetcolors { /resetcolors super send FrameMenu null ne { /resetcolors FrameMenu send /paint FrameMenu send } if } def /sethue % hue => - { dup /sethue super send FrameMenu null ne { /sethue FrameMenu send } { pop } ifelse AppWindow self eq { HiLiteFrame painticon } if } def /getappwin % - => CurrentAppWindow { AppWindow } def /setappwin % BtolAppWin => - { /TmpAppWin exch store AppWindow TmpAppWin ne { AppWindow null ne { { /unmap FrameMenu send DeHiLiteFrame } AppWindow send } if /AppWindow TmpAppWin store AppWindow null ne { { /map FrameMenu send HiLiteFrame } AppWindow send } if } if } def /setmenu % BtolMenu => - { } def /ZapNotify { /ZapNotify FrameMenu send Children { /ZapNotify exch send } forall self getappwin eq {/AppWindow null store} if /ZapNotify super send } def /destroy { ZapNotify } def /arrayindex % array value => index true | false { 2 dict begin /i 0 def /v exch def false exch { /v load eq {pop i true exit} {/i i 1 add def} ifelse } forall currentdict /v undef currentdict /i undef end } def /destroychild % BtolWin => - { dup Children exch arrayindex { /Children Children 3 -1 roll arraydelete store /ZapNotify exch send } { pop console (Not a child of win\n) [] fprintf } ifelse } def /destroychildren % [BtolWin] => - { { dup Children exch arrayindex { /Children Children 3 -1 roll arraydelete store /ZapNotify exch send } { pop console (Not a child of win\n) [] fprintf } ifelse } forall } def /DeHiLiteFrame { Children { /DeHiLiteFrame exch send } forall /DeHiLiteFrame super send } def /HiLiteFrame { Children { /HiLiteFrame exch send } forall /HiLiteFrame super send } def classend def pause pause end From don Tue Oct 31 20:35:34 1989 Date: Tue, 31 Oct 89 20:35:34 -0500 To: NeWS-makers@brillig.umd.edu Subject: PageView's missing .ps file From: wind!naughton@sun.com (Patrick Naughton) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here is the NeWS toolkit code for PageView, (pageview.ps) that was inadvertantly omitted from the client source in OpenWindows 1.0. -Patrick --->8--- snip here --->8--- %%Title: pageview %%SccsId: @(#)pageview.ps 22.1 89/08/09 % % /ScrollPane ClassCanvas dictbegin /canw 0 def /canh 0 def /depth 0 def /orient 0 def /width 0 def /height 0 def /dpi 0 def /ccan null def /animator null def /image_x 0 def /image_y 0 def /last_x 0 def /last_y 0 def /abs_x 0 def /abs_y 0 def dictend classbegin /FillColor .5 dup dup rgbcolor def /newinit { % - => - /newinit super send initDPI initWidth initHeight /setpagedims self send } def /killanimator { animator null ne { animator /animator null store killprocess } if } def /destroy { /killanimator self send /ccan null def /destroy super send } def /restart { % - => - % given that width, height, dpi, or orientation has changed, restart the LW. /ccan null def /canw width dpi mul def /canh height dpi mul def /depth monochromecanvas dpi maxColorDPI gt or {1} {8} ifelse def canw canh dpi depth orient RESTART_TAG tagprint typedprint typedprint typedprint typedprint typedprint } def /setpagedims { % dpi w h => - /height exch def /width exch def /dpi exch def /restart self send } def /setdpi { % dpi => - /dpi exch def /restart self send } def /setsize { % w h => - 2 copy height eq exch width eq and { pop pop } { /height exch def /width exch def /restart self send } ifelse } def /setpagesize { % page format. (0..3) { 0 { 8.5 11 } 1 { 8.5 14 } 2 { 8.5 4 } } case orient 1 and 1 eq { exch } if /setsize self send } def /setorientation { % 0..3 (up, left, down, right) => - dup orient ne { orient /orient 2 index def xor 1 and 1 eq { height width /setsize self send } { /restart self send } ifelse } { pop } ifelse } def /Print { % 0..2 (thispage, wholedoc, bits) { 0 { 0 PRINT_TAG tagprint typedprint } 1 { 1 PRINT_TAG tagprint typedprint } 2 { ccan setcanvas { currentpage filename } /parent self send send (/tmp/%.page-%.ras) sprintf writecanvas } } case } def /PaintCanvas { FillColor /FillCanvas self send /PaintPannedImage self send } def /PanAbsPage { % event => - /canvas self send setcanvas begin XLocation YLocation end dup Height div canh mul sub exch dup Width div canw mul sub exch /image_y exch def /image_x exch def /PaintPannedImage self send /last_x image_x def /last_y image_y def /animator [ MouseDragged { begin XLocation YLocation end dup Height div canh mul sub exch dup Width div canw mul sub exch /image_y exch def /image_x exch def /PaintPannedImage self send /last_x image_x def /last_y image_y def } null null eventmgrinterest null { pop /killanimator self send } /UpTransition null eventmgrinterest ] forkeventmgr store } def /PanPage { % event => - begin XLocation YLocation end /abs_y exch def /abs_x exch def /animator [ MouseDragged { begin XLocation YLocation end 2 copy abs_y sub /image_y exch image_y add def abs_x sub /image_x exch image_x add def /abs_y exch def /abs_x exch def /PaintPannedImage self send /last_x image_x def /last_y image_y def } null null eventmgrinterest null { pop /killanimator self send } /UpTransition null eventmgrinterest ] forkeventmgr store } def /PaintPannedImage { ccan null ne { gsave Canvas setcanvas gsave 0 0 moveto Width Height rect clip image_x image_y moveto canw canh rect eoclip FillColor FillCanvas grestore initclip image_x image_y translate dpi 72 div dup scale 0 setgray ccan imagecanvas grestore } if } def /SetFilename { % string => - CHANGE_FILE_TAG tagprint typedprint } def /GrabAndStuffSelection { % selection -> bool false exch % assume fails dup null ne { dictbegin /ContentsAscii null def dictend /request 3 -1 roll send dup null ne { /ContentsAscii get dup /UnknownRequest ne { /SetFilename self send pop true % successfull } { pop } ifelse } { pop } ifelse } { pop } ifelse } def /DoTransfer { % event => - dup /Action get % ev Act dup /Source get dup 3 1 roll % ev sel Act sel /GrabAndStuffSelection self send { % ev sel Act pop pop pop } { pop pop redistributeevent } ifelse } def /paintpage { /canvas self send setcanvas /PaintPannedImage self send } def /SetLWCanvas { % ev => - /ClientData get /ccan exch def /paintpage self send } def /MakeInterests { /MakeInterests super send createevent dup begin /Name currentprocess 100 string cvs (0x) search pop pop pop (,) search pop exch pop exch pop def Name ID_TAG tagprint typedprint /Action 1 dict dup begin /LWCanvas /SetLWCanvas self soften buildsend def end def end AdjustButton { /PanAbsPage } BuildCanvasSend /DownTransition /canvas self send eventmgrinterest PointButton { /PanPage } BuildCanvasSend /DownTransition /canvas self send eventmgrinterest /TransferSelection /DoTransfer self soften buildsend null Canvas eventmgrinterest dup /Exclusivity true put } def classend def /PageViewTextControl OpenLookTextControl [] classbegin /CallNotify? { pop true } def /newinit { /newinit super send null 18 null /settextparams self send } def classend def /PageViewNumeric OpenLookNumeric [] classbegin /CallNotify? { pop true } def classend def /SliderGroup ClassBag [/Minvalue /Maxvalue /clientnotifyproc /Label /BX /w] classbegin /Initvalue 1 def % inital value of slider /Gap 8 def % spacing between slider /newinit { % string /notifyproc min max => - /newinit super send /Maxvalue exch def /Minvalue exch def /clientnotifyproc exch cvx def /Label exch def % Create Label Graphic /blabel [ Label /new OpenLookLabelGraphic send ] /addclient self send % Create Numeric Contol /bnumber [ /NumericCallback self soften buildsend framebuffer /new PageViewNumeric send Minvalue Maxvalue /setrange 3 index send 0 /setincrement 2 index send 0 /setdisplaychars 2 index send Initvalue /setvalue 2 index send ] /addclient self send % Create Minimal Value Graphic /bmin [ Minvalue NumberString /new OpenLookLabelGraphic send ] /addclient self send % Create Slider /slider [ /SliderCallback self soften buildsend framebuffer /new OpenLookHorizontalSlider send 1 /setnormalization 2 index send [ /Line 1 ] /setdelta 2 index send Minvalue Maxvalue /setrange 3 index send ] /addclient self send % Create Maximum Value Graphic /bmax [ Maxvalue NumberString /new OpenLookLabelGraphic send ] /addclient self send } def /HorLayout { % yval /thing BX 3 -1 roll /minsize 3 index SendMessage /w 2 index def /reshape 5 index SendMessage /BX BX w add Gap add def pop } def /Layout { % - => - /Layout super send /BX Gap def 0 /blabel /HorLayout self send -4 /bnumber /HorLayout self send 0 /bmin /HorLayout self send BX -1 /BX Width /minsize /bmax SendMessage pop 2 mul sub Gap sub def BX 0 /bmax /HorLayout self send 2 index sub Gap sub /minsize /slider SendMessage exch pop /invalidate /slider SendMessage /reshape /slider SendMessage } def % override /StrokeAndFillCanvas { pop pop pop } def /SendMessage { /sendclient self send } def /SliderCallback { % slider => - /value exch send /setvalue /bnumber SendMessage self clientnotifyproc } def /NumericCallback { % textctrl => - /value exch send /setvalue /slider SendMessage self clientnotifyproc } def /NumberString { 10 string cvs } def /value { % - => number /value /slider SendMessage } def /setvalue { % number => - dup /setvalue /slider SendMessage /setvalue /bnumber SendMessage } def /setrangeandval { % val min max /Maxvalue exch def /Minvalue exch def Minvalue Maxvalue /setrange /bnumber SendMessage Minvalue Maxvalue /setrange /slider SendMessage Minvalue NumberString /setthing /bmin SendMessage Maxvalue NumberString /setthing /bmax SendMessage /setvalue self send } def classend def /PageViewBag ClassBag dictbegin /numberofpages 0 def /currentpage 1 def /filename (noname) def /BX 0 def /BY 0 def /Gap 8 def /LabelWidth 0 def /PaneX 0 def /PaneY 0 def /PaneW 0 def /PaneH 0 def /ConnectionFile null def /ButtonWidth 0 def /ButtonHeight 0 def dictend classbegin /SliderHeight 14 def /geticoninfo { % - => filename can w h filename { ccan canw canh dpi } /PaneView /sendclient self send } def /destroy { /destroy super send ConnectionFile closefile } def /newinit { /newinit super send /ConnectionFile currentfile def /PageButton [ (Page) [ (next) (first) (prev) (last) ] null { /value self send /changepage /sendtarget 4 -1 roll send } framebuffer /newdefault ClassMenu send null OpenLookButtonStack ] /addclient self send /SizeButton [ (Size) [ (USLetter) (Legal) (Envelope) ] [/Exclusive] { /value self send /setpagesize /sendtarget 4 -1 roll send } framebuffer /newdefault ClassMenu send null OpenLookButtonStack ] /addclient self send /DpiButton [ (DPI) [ (36 dpi) (72 dpi) (100 dpi) (150 dpi) (300 dpi) (400 dpi) ] [/Exclusive] { /valuething self send cvx token pop exch pop /setdpi /sendtarget 4 -1 roll send } framebuffer /newdefault ClassMenu send null OpenLookButtonStack ] /addclient self send /OrientationButton [ (Rotation) [ (Upright) (Landscape Left) (UpsideDown) (Landscape Right) ] [/Exclusive] { /value self send /setorientation /sendtarget 4 -1 roll send } framebuffer /newdefault ClassMenu send null OpenLookButtonStack ] /addclient self send /PrintButton [ (Print) [ (This Page on LaserPrinter) (Whole Document on LaserPrinter) (This Page To RasterFile) ] null { /value self send /Print /sendtarget 4 -1 roll send } framebuffer /newdefault ClassMenu send null OpenLookButtonStack ] /addclient self send /Label [ (Load File: ) /new OpenLookLabelGraphic send ] /addclient self send /Text [ /handletextvalue self soften buildsend PageViewTextControl ] /addclient self send /PaneView [ ScrollPane ] /addclient self send /PageSlider [ (Page: ) /handlepageslider self soften buildsend 1 10 SliderGroup ] /addclient self send /PaneView getbyname pop /settarget /OrientationButton /sendclient self send /PaneView getbyname pop /settarget /PrintButton /sendclient self send /PaneView getbyname pop /settarget /SizeButton /sendclient self send /PaneView getbyname pop /settarget /DpiButton /sendclient self send self /settarget /PageButton /sendclient self send } def /paintpage { /paintpage /PaneView /getbyname self send {send} if } def /setfooter { % name currentpage npages => - dup 1 eq numberofpages 1 eq and { pop pop /filename exch def } { /numberofpages exch def /currentpage exch def /filename exch def numberofpages 1 ne { /PageSlider /getbyname self send { currentpage 1 numberofpages /setrangeandval 5 -1 roll send } if /PageButton /getbyname self send { /enable exch send } if } { /PageButton /getbyname self send { /disable exch send } if } ifelse /invalidate self send /paint self send } ifelse (Name: ) filename append (Page: % of %) [ currentpage numberofpages ] sprintf /setfooter /Parent self send send } def /newpage { % int => - /currentpage exch store PAGE_TAG tagprint currentpage typedprint null (Page: % of %) [ currentpage numberofpages ] sprintf /setfooter /Parent self send send /PageSlider /getbyname self send { currentpage /setvalue 3 -1 roll send } if } def /changepage { % 0..3 (next)(first)(prev)(last) { 0 { currentpage 1 add dup numberofpages gt { pop } { newpage } ifelse } 1 { 1 newpage } 2 { currentpage 1 sub dup 0 eq { pop } { newpage } ifelse } 3 { numberofpages newpage } } case } def /handletextvalue { % cv => - currentinputfocus /Text /getbyname self send pop eq { /value exch send /SetFilename /PaneView /getbyname self send {send} if } { pop } ifelse } def /handlepageslider { % cv => - /value exch send newpage } def /LayoutClient { % name [x y w h] angle [Tx Ty] => - gsave aload pop translate rotate aload pop % name x y w h /reshape 6 -1 roll /sendclient self send grestore } def /PlaceButton { BX ButtonWidth Gap add dup add add /size self send pop lt { /BX BX ButtonWidth Gap add add def } { /BX Gap def /BY BY ButtonHeight Gap add sub def } ifelse } def /Layout { % - => - ButtonWidth 0 eq { /minsize /PageButton /sendclient self send % w h [/DpiButton /SizeButton /OrientationButton /PrintButton] { /minsize exch /sendclient self send % w h w' h' exch 4 -1 roll max 3 1 roll max % max(w,w') max(h,h') } forall /ButtonHeight exch store /ButtonWidth exch store } if /BX Width def /BY Height def [/PageButton /DpiButton /SizeButton /OrientationButton /PrintButton] { PlaceButton [0 0 ButtonWidth ButtonHeight] 0 [BX BY] LayoutClient } forall /BX Gap def /BY BY ButtonHeight Gap add sub def /LabelWidth /minsize /Label /sendclient self send pop def /Label [ BX BY LabelWidth ButtonHeight ] 0 [ 0 0 ] LayoutClient /Text [ 0 0 Width Gap 3 mul sub LabelWidth sub ButtonHeight ] 0 [ BX LabelWidth add Gap add BY ] LayoutClient /PaneX Gap def /PaneY Gap def /PaneW Width Gap 2 mul sub def /PaneH BY Gap 2 mul sub def numberofpages 1 gt { /PaneH PaneH Gap sub SliderHeight sub def /PaneY PaneY Gap add SliderHeight add def /PageSlider [ 0 0 PaneW SliderHeight ] 0 [Gap Gap] LayoutClient } { /PageSlider [ 0 0 PaneW SliderHeight ] 0 [Width Gap] LayoutClient } ifelse /PaneView [ 0 0 PaneW PaneH ] 0 [ PaneX PaneY ] LayoutClient } def /minsize { ButtonWidth 2 mul Gap 3 mul add 1 add ButtonHeight Gap add 5 mul SliderHeight add 64 add /minsize super send 3 -1 roll add 3 -2 roll add exch } def /PaintCanvas { FillColor /FillCanvas self send monochromecanvas not { gsave 4 dict begin /x PaneX 2 sub def /y PaneY 1 sub def /w PaneW 3 add def /h PaneH 3 add def FillColor colorhsb pop 1 hsbcolor setcolor x 1 add y moveto w 1 sub 0 rlineto 0 h 1 sub rlineto stroke FillColor colorhsb pop .6666 hsbcolor setcolor x 2 add y 1 add moveto w 3 sub 0 rlineto 0 h 3 sub rlineto stroke FillColor colorhsb pop 0 hsbcolor setcolor x y moveto 0 h rlineto w 0 rlineto stroke FillColor colorhsb pop .3333 hsbcolor setcolor x 1 add y 1 add moveto 0 h 2 sub rlineto w 2 sub 0 rlineto stroke end grestore } if } def classend def /PageViewFrame /defaultclass ClassBaseFrame send [] classbegin classend def /win [PageViewBag] [] framebuffer /newdefault PageViewFrame send def { gsave FillColor FillCanvas gsave /client /sendsuperframe /parent self send send /geticoninfo exch send % filename can w h dpi 0 0 translate 72 div dup scale 64 exch div exch 64 exch div exch scale imagecanvas grestore TextColor setcolor /Lucida-Bright findfont 12 scalefont setfont 32 4 moveto cshow grestore } /seticon win send null /seticonlabel win send (PageView) /setlabel win send framex framey framewidth frameheight /reshape win send /map win send /activate win send --->8--- end of pageview.ps --->8--- ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@sun.com Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080 From don Tue Oct 31 20:35:43 1989 Date: Tue, 31 Oct 89 20:35:43 -0500 To: NeWS-makers@brillig.umd.edu Subject: Updated XNeWS Refcard From: rbogen@EBay.Sun.COM (Richard Bogen) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The previous posting was based on pre-FCS manuals and contained some minor flaws. Here is a more accurate one based on the latest info: ------------------------------------------------------------------- %! % NeWS 2.0 Reference Card % % From: ou@ulowell.UUCP (Chris Katsaounis) % Date: 3 Jul 86 17:04:07 GMT % % Modified: October 20, 1989 by rbogen@sun.com (Richard A. Bogen) % To reflect changes from X11 merge % ========================================================================== % start of my stuff % ========================================================================== % printer error catching errordict begin /handleerror {showpage 100 100 moveto $error /errorname get 30 string cvs show} def end /XNeWS? systemdict /newcanvas known def /pgsize 14 def /captitlesize 14 def /titlesize 12 def /subheadsize 8 def /normsize 6.9 def % was 7 /subsize 5 def /stackfont /Helvetica findfont normsize scalefont def /emphfont /Helvetica-Oblique findfont normsize scalefont def /cmdfont /Helvetica-Bold findfont normsize scalefont def /symfont /Symbol findfont normsize scalefont def /subfont /Helvetica findfont subsize scalefont def /subheadfont /Helvetica-Bold findfont subheadsize scalefont def /extend { 1.0 mul } def /hvb /Helvetica-Bold findfont def /headpage hvb [ pgsize extend 0 0 pgsize 0 0 ] makefont def /headcaptitle hvb [ captitlesize extend 0 0 captitlesize 0 0 ] makefont def /headtitle hvb [ titlesize extend 0 0 titlesize 0 0 ] makefont def /rmargin 234 def % right margin /halign 75 def % horizontal alignment position /vlimit 65 def % lines per page (was 66) /boxheight 14 def % height of title box /linespace 8.48 def % amount to skip per line (was 8.45) /curline 1 def % current line /hpos 0 def % current horizontal position /pageface 0 def % which logical page (0=init, 1=left, 2=mid, 3=right) /pageno 4 def % page number /suboffset 2 def % subscript offset /linewidth .2 def % standard line width /titlexoff 5 def % title x offset /titleyoff 2 def % title y offset /empty (\320) def /pagestring 2 string def /inch { 72 mul } def /printf { print flush } def % - SETUP - % set up initial environment /SETUP { 90 rotate -7 0 translate % left x shift for symmetry newpath 11 inch 3 div -0.5 inch moveto 0 -7.5 inch rlineto 11 inch 2 mul 3 div -0.5 inch moveto 0 -7.5 inch rlineto linewidth setlinewidth stroke 15 -34 translate % true offset 11 inch 3 div neg 0 translate % negative translate so the next PAGE % will return to the same spot. } def % llx lly urx ury "box" - /box { 4 dict begin /ury exch def /urx exch def /lly exch def /llx exch def gsave newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto closepath linewidth setlinewidth stroke grestore end } def % llx lly urx ury lo hi "fountain" - /fountain { 10 dict begin /fend exch def /fstart exch def /ury exch def /urx exch def /lly exch def /llx exch def /flen fend fstart sub 1 add def /fstr flen string def fstart 1 fend { fstr exch dup 255 div 180 mul cos neg 2 div .5 add 255 mul cvi exch fstart sub exch put } for gsave urx ury translate 180 rotate urx llx sub ury lly sub scale % 128 13 sub 10 8 flen 10 8 % [-128 13 add 0 0 10 128 13 sub 0] {fstr} image [flen neg 0 0 10 flen 0] {fstr} image grestore end } def % - PAGE - % start new page % We want to print the pages in a different order so that the Reference Card % can be folded correctly: 5 6 1 2 3 4 /PAGE { /pageno pageno 1 add def pageno 6 gt { /pageno 1 def } if pageno pagestring cvs /pagesubstring exch def pagesubstring printf pageface 3 mod 0 eq pageface 0 gt and { showpage SETUP } if /pageface pageface 1 add def 11 inch 3 div 0 translate % draw the fountain 0 0 rmargin boxheight 48 239 fountain 0 0 rmargin boxheight box % draw "NeWS Reference Card" in outlines newpath titlexoff titleyoff moveto headcaptitle setfont (NeWS 2.0) XNeWS? {gsave .5 setgray show grestore} {true charpath} ifelse headcaptitle setfont ( R) XNeWS? {gsave .5 setgray show grestore} {true charpath} ifelse headtitle setfont (EFERENCE) XNeWS? {gsave .5 setgray show grestore} {true charpath} ifelse headcaptitle setfont ( C) XNeWS? {gsave .5 setgray show grestore} {true charpath} ifelse headtitle setfont (ARD) XNeWS? {gsave .5 setgray show grestore} {true charpath} ifelse XNeWS? not {gsave 1 setgray fill grestore linewidth setlinewidth stroke} if % draw the page number in outlines XNeWS? not {headpage setfont newpath 0 0 moveto pagesubstring true charpath pathbbox pop exch pop exch pop rmargin exch sub titlexoff sub titleyoff newpath moveto pagesubstring true charpath gsave 1 setgray fill grestore linewidth setlinewidth stroke} if newpath 0 0 moveto /curline 0 def NL (. ) printf } def % - NL - % newline function /NL { currentpoint exch pop linespace sub 0 exch moveto /curline curline 1 add def curline vlimit gt { PAGE } if } def % vert VNL - % customized newline function /VNL { currentpoint exch pop exch sub 0 exch moveto /curline curline 1 add def curline vlimit gt { PAGE } if } def % - HNL - % half-newline function /HNL { currentpoint exch pop linespace 2 div sub 0 exch moveto /curline curline 0.5 add def curline vlimit gt { PAGE } if } def % cmd args results "C" - /C { /results exch def /args exch def /cmd exch def stackfont setfont /args load xwidth halign exch sub currentpoint exch pop moveto /args load xshow cmdfont setfont ( ) show cmd show ( ) show currentpoint pop /hpos exch def stackfont setfont /results load xshow NL } def % results "CC" - % for alternate results. Prints only the arrow and the results, aligned % to the previous arrow. /CC { /results exch def currentpoint exch pop hpos exch moveto stackfont setfont /results load xshow NL } def % proc|string RJ - % sets proc or string right justified, in emphfont, without a newline /RJ { /rjarg exch def emphfont setfont /rjarg load xwidth rmargin exch sub currentpoint exch pop moveto /rjarg load xshow } def % proc|string CT - % centers proc or string within the current margins, without a newline /CT { dup xwidth rmargin exch sub 2 div currentpoint exch pop moveto xshow } def % x HT - % horizontal tab -- moves to horizontal position x, leaving y unchanged. /HT { currentpoint exch pop moveto } def % (str1) (str2) (str3) T - % sets three strings in cmdfont in three columns, divided evenly % within 0 and rmargin. /T { cmdfont setfont rmargin 3 div 2 mul HT show rmargin 3 div HT show 0 HT show NL } def % =================== utilities for use within xshow ======================= % subscript /- { /savefont currentfont def subfont setfont currentpoint suboffset sub moveto } def /+ { savefont setfont currentpoint suboffset add moveto } def % turnstile /ts { (|) show -1 0 rmoveto (\261) show } def % prime /' { currentfont symfont setfont (\242) show setfont } def % vertical bar /| { currentfont symfont setfont (\275) show setfont } def % ellipses /... { currentfont symfont setfont (\274) show setfont } def % shorthand /+| {+ |} def % note for version 38.0 /v38 { ((v. 38.0)) RJ } def % ========================================================================== % extended show stuff /xdict 20 dict def xdict begin /arraytype { cvx exec } def /booleantype {} def /dicttype {} def /filetype {} def /fonttype {} def /integertype {} def /marktype {} def /nametype { cvx exec } def /nulltype {} def /operatortype {} def /realtype {} def /savetype {} def /stringtype { show } def end % string xshow - % array xshow - % If given a string, xshow simply shows it. % If given an array, xshow evaluates each element of it, as follows: % string: shows it % array: executes it % name: executes it % all other elements are ignored. /xshow { dup type /stringtype eq { show } { xdict begin { dup type exec } forall end } ifelse } def % string|proc xwidth % finds the x width of a string or proc /xwidth { matrix currentmatrix gsave % get CTM for current device nulldevice % install null device so nothing is output setmatrix % set up previous CTM 0 0 moveto xshow currentpoint pop grestore } def % ========================================================================== % set up initial environment (Page: ) printf SETUP PAGE % ===================== Laserwriter-specific stuff ========================= HNL NL subheadfont setfont (NeWS Datatype Extensions) CT NL NL stackfont setfont (Monitor, color, graphicsstate, and path are simple types.) show NL (Canvas, cursor, event, process, environment,) show NL (colormap, colormapentry, and visual are complex objects) show NL (with key-values accessible as with dictionaries.) show NL NL (/Key) (putValue) (getValue) C HNL NL subheadfont setfont (Canvas) CT NL NL stackfont setfont (/TopCanvas) empty (canvas) C (/BottomCanvas) empty {(canvas)| (null)} C (/CanvasAbove) empty {(canvas) | (null)} C (/CanvasBelow) empty {(canvas) | (null)} C (/TopChild) empty {(canvas) | (null)} C (/Parent) {(canvas) | (null)} {(canvas) | (null)} C (/Transparent) (boolean) (boolean) C (/Mapped) (boolean) (boolean) C (/Retained) (boolean) (boolean) C (/SaveBehind) (boolean) empty C (/Color) empty (boolean) C (/EventsConsumed) (name) (name) C (/Interests) empty (array) C (/Cursor) (cursor) {(cursor) | (null)} C (/Colormap) (colormap) (colormap) C (/Visual) empty (visual) C (/VisualList) empty (array) C (/OverrideRedirect) empty (boolean) C (/BorderWidth) {(null) | (integer)} {(null) | (integer)} C (/UserProps) (dict) (dict) C (/XID) empty (number) C (/SharedFile) (string) (string) C (/RowBytes) empty (number) C (/Grabbed) (boolean) (boolean) C (/GrabToken) empty (integer) C HNL NL subheadfont setfont (Cursor) CT NL NL stackfont setfont (/CursorChar) empty (integer) C (/CursorColor) empty (object) C (/CursorFont) empty (object) C (/MaskChar) empty (integer) C (/MaskColor) empty (object) C (/MaskFont) empty (object) C HNL NL subheadfont setfont (Visual) CT NL NL stackfont setfont (/Size) empty (integer) C (/Class) empty (integer) C (/BitsPerPixel) empty (integer) C HNL NL subheadfont setfont (Colormap) CT NL NL stackfont setfont (/Entries) empty (array) C (/Free) empty (number) C (/Installed) (boolean) (boolean) C (/Visual) empty (object) C PAGE HNL NL subheadfont setfont (Colormapentry) CT NL NL stackfont setfont (/Colormap) empty (object) C (/Mask) empty (integer) C (/Slot) empty (integer) C HNL NL subheadfont setfont (Process) CT NL NL stackfont setfont (/$error) {(null) | (dict)} {(null) | (dict)} C (/errordict) (dict) (dict) C (/DictionaryStack) empty (array) C (/ErrorCode) empty (name) C (/ErrorDetailLevel) (integer) (integer) C (/Execee) empty (object) C (/ExecutionStack) empty (array) C (/Interests) empty (array) C (/OperandStack) empty (array) C (/State) empty (array) C (/Priority) (integer) (integer) C (/ProcessName) (name) (name) C (/Stdout) (file) (file) C (/Stderr) (file) (file) C (/SendContexts) empty (array) C (/SendStack) empty (array) C HNL NL subheadfont setfont (Event) CT NL NL stackfont setfont (/Action) (object) (object) C (/Canvas) {(dict) | (array) | (canvas) | (null)} {(dict) | (array) | (canvas) | (null)} C (/ClientData) (object) (object) C (/Exclusivity) (boolean) (boolean) C (/Interest) empty (event) C (/IsInterest) empty (boolean) C (/IsPreChild) empty (boolean) C (/IsQueued) empty (boolean) C (/KeyState) empty (array) C (/Name) (object) (object) C (/Priority) (number) (number) C (/Process) {(null)|(process)} {(null)|(process)} C (/Serial) empty (number) C (/TimeStamp) (number) (number) C (/XLocation) (number) (number) C (/YLocation) (number) (number) C (/Coordinates) (xnumber ynumber) (xnumber ynumber) C HNL NL subheadfont setfont (Environment) CT NL NL stackfont setfont (/BellDuration) (integer) (integer) C (/BellPitch) (number) (number) C (/BellPercent) (number) (number) C (/KeyClickPercent) (number) (number) C (/Leds) (integer) (integer) C (/AutoRepeat) (boolean) (boolean) C (/KeyRepeatTime) (number) (number) C (/KeyRepeatThresh) (number) (number) C (/MotionCompression) (boolean) (boolean) C (/Threshold) (integer) (integer) C (/AccelNumerator) (number) (number) C (/AccelDenominator) (number) (number) C PAGE %NeWS operators HNL NL subheadfont setfont (NeWS Operators by Type) CT NL NL stackfont setfont HNL NL subheadfont setfont (Path Operators) CT NL NL stackfont setfont (copyarea) (dx dy) empty C (currentpath) empty (path) C (damagepath) empty empty C (emptypath) empty (boolean) C (eocopyarea) (dx dy) empty C (eocurrentpath) empty (path) C (eoextenddamage) empty empty C (eoextenddamageall) empty empty C (extenddamage) empty empty C (extenddamageall) empty empty C (pointinpath) (x y) (boolean) C (setpath) (path) empty C HNL NL subheadfont setfont (Canvas Operators) CT NL NL stackfont setfont (buildimage) (w h bits matrix proc) (canvas) C (canvasesunderpath) empty (array) C (canvasesunderpoint) {(null) | (xnum ynum)} (array) C (canvastobottom) (canvas) empty C (canvastotop) (canvas) empty C (clipcanvas) empty empty C (clipcanvaspath) empty empty C (createdevice) (string) (canvas) C (createoverlay) (canvas) (canvas) C (currentcanvas) empty (canvas) C (eoclipcanvas) empty empty C (eoreshapecanvas) (canvas) empty C (eowritecanvas) {(file) | (string)} empty C (eowritescreen) {(file) | (string)} empty C (getcanvaslocation) (canvas) (x y) C (getcanvashape) empty (path) C (imagecanvas) (canvas) empty C (imagemaskcanvas) (boolean canvas) empty C (insertcanvasabove) (canvas x y) empty C (insertcanvasbelow) (canvas x y) empty C (movecanvas) {(x y)| (x y canvas)} empty C (newcanvas) {(pcan) | (pcan visual cmap)} (ncan) C (readcanvas) {(file) | (string)} (canvas) C (reshapecanvas) {(canvas)| (canvas path width)} empty C (setcanvas) (canvas) empty C (writecanvas) {(file) | (string)} empty C (writescreen) {(file) | (string)} empty C HNL NL subheadfont setfont (Cursor Operators) CT NL NL stackfont setfont (currentcursorlocation) empty (x y) C (getcanvascursor) (canvas) (font char char) C (grabcursor) {(cursor) | (null)} empty C (newcursor) (char char font ) (cursor) C (setcursorlocation) (x y) empty C PAGE HNL NL subheadfont setfont (Colormap Operators) CT NL NL stackfont setfont (createcolormap) (visual) (colormap) C (createcolorsegment) (colormap color) (colormapentry) C (createcolorsegment) (colormap int int) (array) C (currentbackpixel) empty (integer) C (currentpixel) empty (integer) C (getcolor) (cmapseg integer) (color) C (putcolor) (cmapseg int color) empty C (setbackpixel) (integer) empty C (setpixel) (integer) empty C HNL NL subheadfont setfont (Color Operators) CT NL NL stackfont setfont (contrastswithcurrent) (color) (boolean) C (currentbackcolor) empty (color) C (currentcolor) empty (color) C (hsbcolor) (h s b) (color) C (rgbcolor) (r g b) (color) C (setcolor) (color) empty C (setbackcolor) (color) empty C HNL NL subheadfont setfont (Process Operators) CT NL NL stackfont setfont (breakpoint) empty empty C (clearsendcontexts) empty empty C (continueprocess) (process) empty C (createmonitor) empty (monitor) C (currentprocess) empty (process) C (currentshared) empty (boolean) C (defaulterroraction) (object name) empty C (fork) (proc) (process) C (geteventlogger) empty (process) C (getprocesses) empty (array) C (getprocessgroup) {(process) | (null)} (array) C (killprocess) (process) empty C (killprocessgroup) (process) empty C (monitor) (monitor proc) empty C (monitorlocked) (monitor) (boolean) C (newprocessgroup) empty empty C (pause) empty empty C (runprogram) (string) empty C (seteventlogger) (process) empty C (suspendprocess) empty empty C (waitprocess) (process) (value) C PAGE HNL NL subheadfont setfont (Event Operators) CT NL NL stackfont setfont (awaitevent) empty (event) C (blockinputqueue) (num) empty C (countinputqueue) empty (num) C (createevent) empty (event) C (expressinterest) {(event)| (event process)} empty C (getmousetranslation) empty (boolean) C (lasteventkeystate) empty (array) C (lasteventtime) empty (num) C (lasteventx) empty (num) C (lasteventy) empty (num) C (postcrossings) (can can name name bool) empty C (recallevent) (event) empty C (redistributeevent) (event) empty C (revokeinterest) {(event)|(event process)} empty C (sendevent) (event) empty C (unblockinputqueue) empty empty C HNL NL subheadfont setfont (File Operators) CT NL NL stackfont setfont (acceptconnection) (listenfile) (file) C (countfileinputtoken) (file) (integer) C (getfileinputtoken) {(int) | (int file)} (object) C (getsocketlocaladdress) (file) (string) C (getsocketpeername) (file) (string) C (setfileinputtoken) (object int ) empty C (tagprint) (num) empty C (typedprint) (object) empty C (writeobject) (file object) empty C HNL NL subheadfont setfont (Mathematical Operators) CT NL NL stackfont setfont (arccos) (num) (num) C (arcsin) (num) (num) C (arctan) (num) (num) C (max) (num num) (num) C (min) (num num) (num) C (random) empty (num) C HNL NL subheadfont setfont (Keyboard and Mouse Operators) CT NL NL stackfont setfont (getkeyboardtranslation) empty (num) C (getmousetranslation) empty (boolean) C (keyboardtype) empty (num) C (setkeyboardtranslation) (boolean) empty C (setmousetranslation) (boolean) empty C PAGE HNL NL subheadfont setfont (Font Operators) CT NL NL stackfont setfont (currentfontmen) empty (integer) C (encodefont) {(font array) | (font name)} (font) C (enumeratefontdicts) empty (name1) (name2 ...) C (findfilefont) (string) (font) C (fontascent) (font) (integer) C (fontdescent) (font) (integer) C (fontheight) (font) (integer) C (setfontmen) (integer) empty C HNL NL subheadfont setfont (Miscellaneous Operators) CT NL NL stackfont setfont (assert) (boolean errorname) empty C (beep) empty empty C (currentautobind) empty (boolean) C (currentpacking) empty (boolean) C (currentplanemask) empty (integer) C (currentprintermatch) empty (boolean) C (currentrasteropcode) empty (num) C (currentstate) empty (state) C (currenttime) empty (num) C (getcard32) (string integer) (integer) C (getenv) (string1) (string2) C (harden) (object) (object) C (localhostname) empty (string) C (objectdump) (file) empty C (packedarray) (objects int) (packedarray) C (packedarraytype) (object) (boolean) C (pathforallvec) (array) empty C (putcard32) (string integer integer) empty C (putenv) (string1 string2) empty C (refcnt) (object) (integer integer) C (reffinder) {(object) | (object boolean)} empty C (send) {(name object) | (proc object)} empty C (setautobind) (boolean) empty C (setpacking) (boolean) empty C (setplanemask) (integer) empty C (setprintermatch) (boolean) empty C (setrasteropcode) (num) empty C (setshared) (boolean) empty C (setstate) (graphicsstate) empty C (soft) (object) (boolean) C (soften) (object) (object) C (truetype) (object) (name) C (undef) (dictionary key) empty C (vmstatus) empty (avail used size) C %%Trailer showpage From don Thu Nov 2 10:23:25 1989 Date: Thu, 2 Nov 89 10:23:25 -0500 To: NeWS-makers@brillig.umd.edu Subject: Using Glenn Reid's still.ps under X11/NeWS? From: crdgw1!montnaro@uunet.uu.net (Skip Montanaro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'd like to use Glenn Reid's distillery (still.ps - posted recently to comp.lang.postscript) under X11/NeWS to generate PS files that conform to Adobe's structuring conventions, so that I can view them using pageview. Has anybody gotten still.ps to work under X11/NeWS? Thanks, -- Skip Montanaro (montanaro@crdgw1.ge.com) From don Thu Nov 2 10:23:43 1989 Date: Thu, 2 Nov 89 10:23:43 -0500 To: NeWS-makers@brillig.umd.edu Subject: NeWS pockets From: satchmo.oce.orst.edu!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) It appears to me that with a few exceptions, NeWS is used within small pockets of larger organizations (i.e. Bellcore, academia...). With this in mind, how would you suggest that one locates these pockets if one wants to find work as a NeWS programmer? Please send e-mail, and I'll post a summary if there's interest. Thanks for the help, Jim Rudolf rudolf@oce.orst.edu (Addresses in header are bogus) Oregon State University From don Thu Nov 2 10:24:02 1989 Date: Thu, 2 Nov 89 10:24:02 -0500 To: NeWS-makers@brillig.umd.edu Subject: BTOL From: korp@athens.ees.anl.gov (Peter Korp) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) BTOL will run under X11/NeWS if you replace the one occurence of 2048 to 100. Peter korp@athens.ees.anl.gov Argonne National Laboratory From don Mon Nov 6 01:25:31 1989 Date: Mon, 6 Nov 89 01:25:31 -0500 To: NeWS-makers@brillig.umd.edu Subject: A dialog box class From: korp@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % litedialog.ps % ------------- % % Version 1.0 % % A dialog box class implementation % % Date: Sept. 5 1989 % Author: % David G. Zawada % EAIS-VIS % Argonne National Laboratory % zawada@athens.ees.anl.gov % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file contains the class definition for a DialogBox % and a subclass of it, called ModeLess, that allows the % use of buttons within a DialogBox. Icons, similar to % those used on the M*cintosh, also are supported, % provided the flag Icon? is set to true and the % PaintIcon procedure is not null. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Examples: % % %/inch {72 mul} def %/Quit? false def %/quit_notify { Quit? {/destroy qdia send} if} def %/no_notify {/Quit? false store /unmap qdia send quit_notify} def %/yes_notify {/Quit? true store /unmap qdia send quit_notify} def %/mesg (Do you really want to Quit?) def % %/qdia [( YES ) ( NO )] [/yes_notify /no_notify] mesg framebuffer % /new ModeLess send def %{ % /Icon? true def % /PaintIcon { Asterisk } def % 10 4 inch 6 inch 3.5 inch 1.5 inch sizeit % map %} qdia send % %/quit_popdia { /unmap popdia send } def %/popdia [( OK )] [/quit_popdia] (Click on Ok!) framebuffer /new ModeLess send def %{ % /Icon? true def % /PaintIcon { Man } def % 10 6 inch 7.5 inch 3.7 inch 1.5 inch sizeit % map %} popdia send % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Load liteitems for subclasses systemdict /Item known not {($NEWSHOME/lib/NeWS/liteitem.ps) run} if systemdict begin /Dialog Object dictbegin %Instance vars /ParentCanvas null def /DialogCanvas null def /DialogX 0 def /DialogY 0 def /DialogHeight 0 def /DialogWidth 0 def /DialogRadius 10 def % Corner radius for DialogBox frame /DialogInterests null def % Event interests for the DialogBox /DialogEventMgr null def /DialogBorderWidth 6 def /DialogCanvasColor 1 .7 .7 rgbcolor def /DialogBorderColor 0 0 0 rgbcolor def /DialogFontColor DialogBorderColor def /DialogFontSize 14 def /DialogFont /Helvetica-Bold findfont DialogFontSize scalefont def /PaintProcs null def % Damage repair procedure /PaintIcon nullproc def /Icon? false def % Does the DialogBox display an icon in it? /IconSize 45 def /IconBorderWidth 3 def /IconBoxColor 1 1 1 rgbcolor def % The following variables govern the positioning % and wrapping of text within the DialogBox /DialogTextX 0 def /DialogTextY {DialogHeight TopMargin 2 mul sub} def /WordBreak ( ) def % Break the DialogBox text word breaks (ie. spaces) /BreakWidth null def /CurWidth 0 def /LastBreak 0 def /FirstChar 0 def /LastChar 0 def /DialogText () def /RestText () def /NextWord () def /WordWidth 0 def /LineSpacing 2 def /TopMargin DialogFontSize def % Margins defining the region within /BottomMargin DialogFontSize def % which text may be displayed /LeftMargin DialogFontSize def /RightMargin DialogFontSize def /SentenceLength 0 def dictend classbegin /DialogPath {rrectpath} def % Shape of the DialogBox /IconBox {0 0 IconSize IconSize rectpath} def % Border for the Icon /EOLproc {DialogTextX DialogTextY moveto show % End of Line procedure executed after each /DialogTextY DialogTextY DialogFontSize % word break (See breakline routine below) LineSpacing add sub store} def % PROCEDURES /DrawDialog % - => - Paint the DialogBox { gsave DialogCanvas setcanvas DialogCanvasColor fillcanvas /DialogTextX 0 def /DialogTextY { DialogHeight TopMargin 2 mul sub } def Icon? % Calculate the margins for the text display region { /SentenceLength DialogWidth IconSize LeftMargin RightMargin add add sub store /DialogTextX IconSize LeftMargin add store gsave LeftMargin 2 div DialogHeight TopMargin IconSize add sub translate IconBox gsave IconBoxColor setcolor fill grestore DialogBorderColor setcolor IconBorderWidth setlinewidth stroke 1 setlinewidth gsave IconBox clip PaintIcon grestore grestore } { /SentenceLength DialogWidth LeftMargin RightMargin add sub store /DialogTextX LeftMargin store } ifelse DialogBorderColor setcolor DialogBorderWidth setlinewidth DialogRadius 0 0 DialogWidth DialogHeight DialogPath stroke DialogFont setfont DialogFontColor setcolor breakline % Position the text and wrap it if necessary grestore } def % Possible PaintIcon Routines (Asterisk and Man) /wedge {0 0 moveto -10 40 rlineto 20 0 rlineto -10 -40 rlineto} def /angle 45 def /Asterisk % Need to notify user of something urgent { gsave gsave 0 0 0 setrgbcolor IconBox fill grestore IconSize 2 div dup translate .45 .45 scale 360 angle div round { wedge angle rotate} repeat gsave 1 0 0 setrgbcolor fill grestore stroke grestore } def /space {7 0 rmoveto} def /speech {5 0 rlineto space 6 0 rlineto space 3 0 rlineto} def /Man % Give user some general type of information { gsave IconBox gsave 0 setgray fill grestore stroke .45 .45 scale 0 0 moveto 30 0 rlineto 0 40 rlineto 10 0 rlineto 0 60 rlineto -40 0 rlineto 0 -100 rlineto 1 setgray gsave fill grestore 55 80 rmoveto 35 0 rlineto 0 -40 rlineto -45 -20 rlineto 10 20 rlineto 0 40 rlineto gsave fill grestore 0 setgray 4 -5 rmoveto speech 5 {-28 -5 rmoveto speech} repeat -58 -30 rmoveto -20 0 rlineto 10 20 rmoveto 10 0 rlineto stroke newpath 20 80 5 0 360 arc fill grestore } def % METHODS /new % statictext parentcanvas => dialogcanvas { /new super send begin /ParentCanvas exch store /DialogText exch ( ) append store /DialogCanvas ParentCanvas newcanvas store DialogCanvas /Transparent false put DialogCanvas /SaveBehind true put DialogCanvas /EventsConsumed /AllEvents put % Specify DialogBox event interests /DialogInterests 5 dict dup begin /DialogToTopEvent PointButton { DialogCanvas canvastotop } DownTransition DialogCanvas eventmgrinterest def /DialogDamageEvent /Damaged /RepairDialog null DialogCanvas eventmgrinterest def end store /DialogEventMgr DialogInterests forkeventmgr store currentdict end } def /destroy { DialogCanvas /Mapped false put currentprocess killprocessgroup } def /sizeit % r x y w h => - Size the DialogBox { /DialogHeight exch store /DialogWidth exch store /DialogY exch store /DialogX exch store /DialogRadius exch store gsave ParentCanvas setcanvas DialogX DialogY translate DialogRadius 0 0 DialogWidth DialogHeight DialogPath DialogCanvas reshapecanvas grestore } def /RepairDialog % - => - Fork off process to repair any damage { PaintProcs null ne { gsave PaintProcs killprocessgroup DialogCanvas setcanvas newpath clipcanvas damagepath grestore } if /PaintProcs { newprocessgroup CallPaintProcs } fork def } def /CallPaintProcs { gsave DialogCanvas setcanvas damagepath clipcanvas DrawDialog newpath clipcanvas /PaintProcs null store grestore } def /map % Map the DialogBox and bring it to the top of its siblings { DialogCanvas /Mapped true put DialogCanvas canvastotop } def /unmap { DialogCanvas /Mapped false put } def % Hide the DialogBox /move % x y => - Move the DialogBox to the specified coordinates { gsave DialogCanvas setcanvas /DialogY exch store /DialogX exch store DialogX DialogY movecanvas grestore } def /printtext % string => - Change the DialogBox' current message to the specified string { /DialogText exch ( ) append store DrawDialog } def /breakline % - => - Adapted from the BREAKLINES program in Adobe's (Blue) PostScript CookBook { /BreakWidth WordBreak stringwidth pop store /RestText DialogText store /CurWidth 0 store /FirstChar 0 store /LastBreak 0 store /NextWord 0 store { RestText WordBreak search { /NextWord exch store pop /RestText exch store /WordWidth NextWord stringwidth pop store CurWidth WordWidth add SentenceLength gt { DialogText FirstChar LastBreak FirstChar sub getinterval EOLproc /FirstChar LastBreak store /CurWidth WordWidth BreakWidth add store } { /CurWidth CurWidth WordWidth add BreakWidth add store } ifelse /LastBreak LastBreak NextWord length add 1 add store } { pop exit } ifelse } loop /LastChar DialogText length store DialogText FirstChar LastChar FirstChar sub getinterval EOLproc } def classend def /DefaultDialog Dialog def %_______________________________________________________________________________ % ModeLess is a subclass of Dialog which facilitates the incorporation of any % number of ButtonItems into a DialogBox /ModeLess Dialog dictbegin /ButtonLabels [] def % Labels for the buttons /ButtonNotifies [] def % Notify procedures for the buttons /DialogItems null def % Array of ButtonItems dictend classbegin % PROCEDURES /CreateButton % - => - Create a button for each entry in ButtonLabels and store it in DialogItems { /DialogItems [ 0 1 ButtonLabels length 1 sub { ButtonLabels 1 index get ButtonNotifies 3 -1 roll get DialogCanvas 60 0 /new ButtonItem send dup /ItemFrame 3 put } for ] def DialogItems forkitems pop % Activate the buttons } def /MoveButtons % - => - Evenly distribute the buttons along the bottom of the DialogBox { 0 1 DialogItems length 1 sub { DialogWidth DialogItems length 1 add div 1 index 1 add mul DialogItems 2 index get /ItemWidth get 2 div sub BottomMargin 2 div /move DialogItems 5 -1 roll get send } for } def /DrawDialog % - => - Paint the DialogBox and its buttons { /DrawDialog super send DialogItems paintitems } def % METHODS /new % labels notifyprocs statictext parentcanvas => dialog_instance { /new super send begin /ButtonNotifies exch def /ButtonLabels exch def CreateButton currentdict end } def /sizeit % r x y w h Size the DialogBox and position its buttons { /sizeit super send MoveButtons } def classend def end From don Mon Nov 6 01:26:23 1989 Date: Mon, 6 Nov 89 01:26:23 -0500 To: NeWS-makers@brillig.umd.edu Subject: Integers, mod, and some wallpaper patches From: zodiac!sparkyfs!sparkyfs.itstd.sri.com!zwicky@ames.arc.nasa.gov (Elizabeth Zwicky) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Wallpaper, as many of you know, is a little program of mine that wastes CPU cycles charmingly by coloring in the points in a window according to the value of an equation in x and y which you type at it. It calculates the colour to make the points with a mod (by 2 in monochrome, by 6 in colour). You can only mod an integer. Thus, I have learned more about integers in NeWS than I ever wanted to know. In particular, div and exp are both documented in the Red Book as always returning reals. In NeWS, when div returns an integer, it is type integer. This makes sense, given that the NeWS manual says that any real small enough to be an integer (i.e., that will fit in 16 bits of integer and 16 bits of fraction), will be an integer, which will magically look like a real to type. So div should be returning a real, which is small enough to be converted into an integer, which then gets turned back into a real if it has a fractional part. Confusing, but fine. That is, until you get to exp, which really truly does always return a real; "2 2 exp dup = type =" will give you "4 realtype". What a nusiance. Next, we have mod and idiv, both of which are documented in the red book as requiring integer arguments. mod does in fact require arguments of type integer, and will return a typecheck if run on 2.4, 2 2 exp, or any number over 32767. idiv neither requires integer arguments, *nor is guaranteed to return them*; try "2 17 exp 2 idiv type =". I assume this is due to the magic conversion of integers to reals once they get to big; on the other hand, since mod will return a typecheck, it is not helpful. Then again, cvi does no better; try "32768 cvi type =". Just what I wanted; a real result from converting to an integer. And once again, mod will blow up. Enough complaint: on to the promised patches. If you plug this in, and change all existing instances of "mod" to "mod*" you will allow wallpaper to cope with numbers up to 32767^2, which should be enough latitiude to do something amusing: /mod*{ % mod big numbers. Initial stack: number-to-mod number-to-mod-by /to-mod-by exch def /to-mod exch def to-mod 32767 gt { /to-mod-idiv to-mod 32767 idiv cvi def /to-mod-mod to-mod 32767 to-mod-idiv mul sub cvi def to-mod-idiv 32767 to-mod-by mod mul to-mod-mod to-mod-by mod add to-mod-by mod } {to-mod cvi to-mod-by mod} ifelse } def If you replace the definition of "dot" with this, it will scale correctly even under OpenWindows: /dot {-.5 -.5 rmoveto 0 1 rlineto 1 0 rlineto 0 -1 rlineto -1 0 rlineto closepath fill pause} def (This compensates for a new bug in OpenWindows, in which a degenerate line (what you get with 0 0 rlineto) does appear if it is a single dot, even if the linecaps are set to 0, but does not appear at above that size, even if linecap is set to 2. The linecaps matter because the Red Book says so, although I admit to having used the previous NeWS bug, which allowed you to use linecap 1 on single-point paths, giving nice square dots.) Elizabeth From don Mon Nov 6 09:02:26 1989 Date: Mon, 6 Nov 89 09:02:26 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Integers, mod, and some wallpaper patches From: mcsun!sunic!ifi!m2cs.uu.no!tomas@uunet.uu.net (Tomas Felner) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) zwicky@sparkyfs.itstd.sri.com (Elizabeth Zwicky) writes: >In particular, div and exp are both documented in the Red Book as >always returning reals. In NeWS, when div returns an integer, it is >type integer. This makes sense, given that the NeWS manual says that >any real small enough to be an integer (i.e., that will fit in 16 bits >of integer and 16 bits of fraction), will be an integer, which will >magically look like a real to type. So div should be returning a real, >which is small enough to be converted into an integer, which then gets >turned back into a real if it has a fractional part. Confusing, but >fine. That is, until you get to exp, which really truly does always >return a real; "2 2 exp dup = type =" will give you "4 realtype". What >a nusiance. >Next, we have mod and idiv, both of which are documented in the red >book as requiring integer arguments. mod does in fact require >arguments of type integer, and will return a typecheck if run on 2.4, >2 2 exp, or any number over 32767. idiv neither requires integer >arguments, *nor is guaranteed to return them*; try "2 17 exp 2 idiv >type =". I assume this is due to the magic conversion of integers to >reals once they get to big; on the other hand, since mod will return a >typecheck, it is not helpful. Then again, cvi does no better; try >"32768 cvi type =". Just what I wanted; a real result from converting >to an integer. And once again, mod will blow up. I once had a similar problem. Depending on how many zeros you have after the comma you get either a realtype or an integertype. Try the following: "1.0000 dup == type ==", you will get an integertype! If you type: "1.00000 dup == type ==" you will get a realtype!!! Now, which one is correct ?? Tomas -- Tomas Felner Modula-2 CASE Systems AS | Internet: tomas@m2cs.uu.no Maridalsveien 139 | Phone: +47 2 379784 N-0461 Oslo 4, Norway | FAX: +47 2 356448 From don Mon Nov 6 09:02:51 1989 Date: Mon, 6 Nov 89 09:02:51 -0500 To: NeWS-makers@brillig.umd.edu Subject: Flickering canvases From: mcsun!sunic!ifi!m2cs.uu.no!tomas@uunet.uu.net (Tomas Felner) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have a problem with moving canvases that has been bothering me for quite some time. The basic situation is as follows: I have a canvas ontop of which I have another canvas, on top of which another one, etc. I have code to grab one of those canvases with the mouse and move them around. All the canvases on top of the grabbed canvas are then moved together with the grabbed one. When moving this "stack of canvases" the moving of the bottommost canvas goes smoothly, but all the canvases on top of it flicker like crazy! This effect appears with any stack of canvases and with an arbitray number of canvases on top of the bottom canvas. Why is this so? Is there any way to avoid this? Am I doing something wrong? Help !!! Tomas -- Tomas Felner Modula-2 CASE Systems AS | Internet: tomas@m2cs.uu.no Maridalsveien 139 | Phone: +47 2 379784 N-0461 Oslo 4, Norway | FAX: +47 2 356448 From don Mon Nov 6 09:03:32 1989 Date: Mon, 6 Nov 89 09:03:32 -0500 To: NeWS-makers@brillig.umd.edu Subject: NeWS software collection From: don (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is the table of contents of the NeWS software collection I've put together, which is available via anonymous ftp from "tumtum.cs.umd.edu" (128.8.128.49), in the files "NeWS/news-tape.tar.Z" and "NeWS/GoodNeWS1.2.DEV.tar.Z". Don't forget to set binary mode to retrieve them! The file "sums" lists the checksums of the files you can ftp. This collection of software will be made available on the Sun User Group contributed software tape. Enclosed at the end is a SUG contribution form. If you have any software that you would like to donate, or if some of your software is already in the collection, but you have not sent in a form, we would *greatly* appreciate it if you printed out a copy of the form, filled it out, and mailed it in. Also, it makes things a lot easier for everyone if you put a copyright notice on your software stating that it can be redistributed. Thanks a *zillion* to everyone who contributed!! If you have an old preliminary copy of the news-tape directory, you should probably get a fresh one. Lots of nice stuff has been added, and the organizaton has changed (everything has its own directory now, and the names make more sense). If you're making an old copy of the collection available via ftp or whatever, please get the updated version, and thanks!! The news-tape directory is almost 10 meg, without binaries. It includes makefiles so you can compile and clean it all at once. GoodNeWS is about 7.5 meg. If you're looking for some good examples of how to program NeWS, they're in there! -Don ======================================================================== Properties: Covered by a contribution form Good Grasshopper NeWS 1.1 copyright Copyright notice states it can be redistributed Posted to comp.windows.news Posted to comp.lang.postscript Posted to comp.windows.x Contributed by author Available from news-archive@sun.com Standard Sun NeWS 1.1 copyright Based on sources included with NeWS 1.1 Based on sources included with X11/NeWS Based on sources included with X11R3 Made at Sun ~applications~ ~applications/calctool~ Posted to comp.windows.news ~applications/ched~ Available from news-archive@sun.com Standard Sun NeWS 1.1 copyright Made at Sun ~applications/dviview~ Posted to comp.windows.news Based on sources included with NeWS 1.1 ~applications/faces~ Copyright notice states it can be redistributed Posted to comp.windows.news ~applications/gnu-emacs~ Posted to comp.windows.news ~applications/gnuplot~ Copyright notice states it can be redistributed ~applications/micro-emacs~ Copyright notice states it can be redistributed ~applications/news-illustrator~ Copyright notice states it can be redistributed Posted to comp.windows.news ~applications/newsdraw~ Good Grasshopper NeWS 1.1 copyright Posted to comp.windows.news Made at Sun ~applications/newsline~ Good Grasshopper NeWS 1.1 copyright Made at Sun ~applications/paint~ Contributed by author ~applications/paintdemo~ Posted to comp.windows.news ~applications/paper~ Good Grasshopper NeWS 1.1 copyright Based on sources included with NeWS 1.1 ~applications/psterm~ Good Grasshopper NeWS 1.1 copyright Based on sources included with NeWS 1.1 ~applications/surfmodl~ Copyright notice states it can be redistributed ~applications/tree~ Posted to comp.windows.news ~documents~ ~documents/apptalk~ Available from news-archive@sun.com Made at Sun ~documents/info~ Posted to comp.windows.news ~documents/newsdraw~ Contributed by author Made at Sun ~documents/oop~ Contributed by author Made at Sun ~documents/pguide~ Contributed by author Made at Sun ~documents/programming~ Available from news-archive@sun.com Made at Sun ~documents/psiber~ Covered by a contribution form ~documents/refcards~ Posted to comp.lang.postscript Posted to comp.windows.news ~documents/toolkit~ Contributed by author Made at Sun ~documents/tour~ Contributed by author Made at Sun ~examples~ ~examples/codebook~ Copyright notice states it can be redistributed Contributed by author Made at Sun ~examples/debug~ Covered by a contribution form Posted to comp.windows.news ~examples/fontscale~ Covered by a contribution form Posted to comp.windows.news ~examples/func~ Copyright notice states it can be redistributed Available from news-archive@sun.com ~examples/hello-world~ Available from news-archive@sun.com ~examples/input~ Available from news-archive@sun.com Posted to comp.windows.news ~examples/paint2~ Available from news-archive@sun.com Posted to comp.windows.news ~examples/startup~ ~fixedstartup.ps~ Posted to comp.windows.news ~hello.ps~ Covered by a contribution form Posted to comp.windows.news ~initial.ps~ Posted to comp.windows.news ~setup.ps~ Posted to comp.windows.news ~examples/string~ Copyright notice states it can be redistributed Available from news-archive@sun.com ~examples/token~ Posted to comp.windows.news ~fixes~ ~fixes/framemaker~ Posted to comp.windows.news ~fixes/getanimated~ Covered by a contribution form ~fixes/goodnews~ Posted to comp.windows.news ~fixes/illustrator88~ Posted to comp.windows.news ~fixes/xnews~ Posted to comp.windows.news Based on sources included with X11/NeWS ~fonts~ Based on sources included with X11R3 ~fun~ ~fun/15puzzle~ Available from news-archive@sun.com Made at Sun ~fun/3demo~ Covered by a contribution form ~fun/backgrounds~ ~NeWS_root.ps~ Copyright notice states it can be redistributed Available from news-archive@sun.com ~background-menu.ps~ Posted to comp.windows.news ~background.ps~ Posted to comp.windows.news ~granite~ Contributed by author Made at Sun ~graysize.ps~ Covered by a contribution form Posted to comp.windows.news ~yinyang.ps~ Posted to comp.windows.news ~fun/bez~ Posted to comp.windows.news ~fun/blackjack~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/boing~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/breakout~ Contributed by author Made at Sun ~fun/catchme~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/curves~ Copyright notice states it can be redistributed Contributed by author Made at Sun ~fun/dipper~ Posted to comp.windows.news ~fun/display-face~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/dizzy~ Covered by a contribution form Based on sources included with NeWS 1.1 ~fun/eye~ Covered by a contribution form Posted to comp.windows.news ~fun/flower-editor~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/garden~ Posted to comp.windows.news ~fun/ifs~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/interpolate~ Posted to comp.windows.news ~fun/jump~ Posted to comp.windows.news ~fun/kanji~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/lander~ Contributed by author Made at Sun ~fun/mandel~ Contributed by author Made at Sun ~fun/melt~ Covered by a contribution form Posted to comp.windows.news ~fun/mistletoe~ Posted to comp.windows.news Made at Sun ~fun/psgammon~ Copyright notice states it can be redistributed Good Grasshopper NeWS 1.1 copyright ~fun/pspyro~ Posted to comp.windows.news ~fun/ptape~ Covered by a contribution form Posted to comp.windows.news ~fun/puzzle~ Posted to comp.windows.news ~fun/pyramid~ Posted to comp.windows.news ~fun/quine~ Posted to comp.windows.news ~fun/ribbon~ Posted to comp.windows.news Made at Sun ~fun/rose~ Posted to comp.windows.news Made at Sun ~fun/runit~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/spiro-slider~ Copyright notice states it can be redistributed Available from news-archive@sun.com ~fun/spirograph~ Posted to comp.windows.news ~fun/square-limit~ Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/strange~ Posted to comp.windows.news ~fun/testcurve~ Covered by a contribution form ~fun/track~ Posted to comp.windows.news ~fun/visualizer~ Covered by a contribution form Posted to comp.windows.news ~fun/wallpaper~ Posted to comp.windows.news ~fun/wrappingpaper~ Posted to comp.windows.news ~fun/wtf~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~fun/zapper~ Covered by a contribution form Posted to comp.windows.news ~fun/zoom~ Covered by a contribution form ~goodnews~ Covered by a contribution form Copyright notice states it can be redistributed ~pictures~ ~brillig.ps~ Contributed by author ~collage.can~ Contributed by author ~flake.ps~ Contributed by author ~gnu.ps~ Posted to comp.lang.postscript ~honk.ps~ Posted to comp.lang.postscript ~leaf.ps~ Covered by a contribution form Contributed by author ~nerd.ps~ Contributed by author ~porsche.can~ Contributed by author ~punk.can~ Covered by a contribution form Contributed by author ~sun-logo1.ps~ Posted to comp.windows.news ~sun-logo2.ps~ Posted to comp.windows.news ~teeshirt.ps~ Available from news-archive@sun.com ~xlogo.ps~ Posted to comp.windows.x ~yoyo.ps~ Contributed by author ~utilities~ ~utilities/animator~ Covered by a contribution form Copyright notice states it can be redistributed ~utilities/autopull~ Posted to comp.windows.news ~utilities/beeper~ Posted to comp.windows.news ~utilities/bgcolor~ Good Grasshopper NeWS 1.1 copyright ~utilities/bigcur~ Posted to comp.windows.news ~utilities/blankscreen~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/btol~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/calendar~ Copyright notice states it can be redistributed Posted to comp.lang.postscript ~utilities/circularities~ Posted to comp.windows.news ~utilities/class-browser~ Good Grasshopper NeWS 1.1 copyright Posted to comp.windows.news ~utilities/clocks~ ~aniclock~ Posted to comp.windows.news ~dali~ Posted to comp.windows.news Based on sources included with NeWS 1.1 ~digital-clock~ Posted to comp.windows.news ~glass~ Posted to comp.windows.news Based on sources included with NeWS 1.1 ~goodclock~ Posted to comp.windows.news ~nclock~ Copyright notice states it can be redistributed Posted to comp.windows.news ~sunclock~ Good Grasshopper NeWS 1.1 copyright Available from news-archive@sun.com Based on sources included with NeWS 1.1 ~technichron~ Contributed by author Made at Sun ~utilities/colormenu~ Posted to comp.windows.news ~utilities/colors~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/colortable~ Available from news-archive@sun.com Made at Sun ~utilities/colortool~ Copyright notice states it can be redistributed ~utilities/colour~ Posted to comp.windows.news ~utilities/cyber~ Covered by a contribution form Copyright notice states it can be redistributed ~utilities/distillery~ Posted to comp.lang.postscript ~utilities/dragcanvas~ Posted to comp.windows.news ~utilities/drawer~ Contributed by author Made at Sun ~utilities/dumb~ Contributed by author ~utilities/dumper~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/duper~ Contributed by author ~utilities/enhanced~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/exporttonews~ Posted to comp.windows.news ~utilities/graph~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/gravity~ Posted to comp.windows.news ~utilities/icongravity~ Posted to comp.windows.news ~utilities/icons~ Posted to comp.windows.news ~utilities/invertmatrix~ Posted to comp.windows.news ~utilities/journalpanel~ Posted to comp.windows.news Made at Sun ~utilities/keypad~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/keysee~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/knobs~ Contributed by author ~utilities/litedialog~ Posted to comp.windows.news ~utilities/logo~ Contributed by author ~utilities/lps~ Covered by a contribution form ~utilities/mac~ Contributed by author ~utilities/mag~ Covered by a contribution form Posted to comp.windows.news ~utilities/mail-popup~ Posted to comp.windows.news ~utilities/mail-sender~ Posted to comp.windows.news ~utilities/mchoose~ Covered by a contribution form ~utilities/mousee~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/mult~ Posted to comp.windows.news ~utilities/netsecurity~ Posted to comp.windows.news Copyright notice states it can be redistributed ~utilities/newsbiff~ Covered by a contribution form Posted to comp.windows.news ~utilities/newsbomb~ Contributed by author ~utilities/newsmon~ Contributed by author Standard Sun NeWS 1.1 copyright ~utilities/object-browser~ Covered by a contribution form Posted to comp.windows.news ~utilities/pacman~ Covered by a contribution form Posted to comp.windows.news ~utilities/patternfill~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/piemenus~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/plane~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/popup~ Posted to comp.windows.news ~utilities/print-hier~ Posted to comp.windows.news ~utilities/prompt~ Posted to comp.windows.news ~utilities/ps2bits~ Available from news-archive@sun.com Made at Sun ~utilities/ps3d~ Copyright notice states it can be redistributed Posted to comp.lang.postscript ~utilities/psbiff~ Posted to comp.lang.postscript ~utilities/psexec~ Covered by a contribution form Standard Sun NeWS 1.1 copyright Based on sources included with NeWS 1.1 ~utilities/psgraph~ Copyright notice states it can be redistributed Available from news-archive@sun.com Made at Sun ~utilities/pshexec~ Posted to comp.windows.news ~utilities/pspp~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/rpsterm~ Posted to comp.windows.news ~utilities/ruler~ Posted to comp.windows.news ~utilities/save-proc~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/scrollclient~ Posted to comp.windows.news ~utilities/scrolldata~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/scrollwin~ Posted to comp.windows.news ~utilities/softmenu~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/sorts~ Available from news-archive@sun.com ~utilities/stickem~ Contributed by author ~utilities/term~ Covered by a contribution form Copyright notice states it can be redistributed ~utilities/textfield~ Posted to comp.windows.news ~utilities/tooltool~ Available from news-archive@sun.com ~utilities/trackstack~ Posted to comp.windows.news ~utilities/vectorops~ Copyright notice states it can be redistributed Posted to comp.lang.postscript ~utilities/winwin~ Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/xfonts~ Covered by a contribution form Copyright notice states it can be redistributed Posted to comp.windows.news ~utilities/zap~ ~deadwin.ps~ Covered by a contribution form Posted to comp.windows.news ~unmap~ Contributed by author ~winzap~ Contributed by author ======================================================================== Subject: Sun User Group contribution form We are putting together a collection of NeWS software to contribute to the Sun Users Group donated software tape. We would like to use your software on upcoming tape(s). To do this, we have to get a signed release from you that authorizes us to have the software and to reproduce and distribute it. We apologize for the trouble involved; we've tried to make this as painless as possible, within the limitations of the current legal system. We have enclosed a copy of the software contribution form, which you can print out, fill in, sign, and mail to us. A mailing "label" is also enclosed. Don't send it back to us by email; we need your real hardcopy signature. Our lawyers advise us that if you developed these materials in connection with your job, or as an independent contractor working on a job, the materials may be owned by your employer or client. If this is the case, or if you are not sure, either clarify the situation or duplicate the contribution form and have your employer or client fill out a copy too. We can't distribute software if we don't know who the owner is, unless all the possible owners authorize us. By the way, "owner" is roughly equivalent to "copyright holder" here. If you developed the materials with other people, please get your co-authors to sign release forms as well, unless you are authorized to act for the group. If your work is based upon the work of others, please indicate how we can get in touch with them. If you have any questions or comments, feel free to contact Don Hopkins at ...!uunet!mimsy!don, don@brillig.umd.edu, or (301) 454-1517, or the Sun Users Group office at ...!sun!users, users@sun.com, or (415) 336-4343. Thanks for your patience with this BS. See you on the tape! Don Hopkins ...!uunet!mimsy!don or don@brillig.umd.edu the Sun Microsystems User Group tape committee ...!sun!users or users@sun.com Here is my "mailing label": Don Hopkins 5819 Ruatan St. College Park, MD 20740 Sun Microsystems User Group, Inc. CONTRIBUTION TO SOFTWARE TAPE Please include these materials in a Sun User Group donated software tape. I hereby agree to these conditions: 1. The materials continue to be owned by their current owner(s). I give Sun Microsystems User Group (SUG) irrevocable permission to use them and to redistribute them for a fee to its membership and to the public. 2. SUG will require recipients of the tape to agree to follow the conditions imposed in README files in the materials, if any. 3. If the materials are covered by an AT&T Unix source license, I also give SUG permission to compile the materials and to distribute them in binary form to AT&T binary licensees. 4. I authorize SUG to distribute the information on this form describing the contents of the tape. My name and address(es) will only be distributed if I so request by checking the item below. 5. SUG's duplication and distribution of the materials will not infringe any copyright, patent, trade secret, or similar right of any third party. 6. I agree to promptly reimburse SUG for all damages or loss incurred by SUG due to any statement made by me in this form that proves to be false or incorrect. The materials covered by this contribution form are: Rough size of the materials (KB or MB): ___________________________ To the best of my knowledge, the materials are owned by: (also tell us how we can contact the owner(s), if it's not you) Please indicate the trade secret status of the materials: ______ The materials contain no Unix software or documentation. ______ The materials require a Unix source license. Which one(s): ________________________________ ______ Other (please explain) I can authorize you to redistribute the materials because: ______ The materials are public domain. ______ I am the owner. ______ I work for the owner and am authorized by its management. Authorized signature: ________________________________ Company: ________________________________ Title: ________________________________ ______ I am a co-owner and can act for all the owners. ______ I am a co-owner and you also need permission from the other owners. ______ I may be the owner; in case I am, I authorize you. ______ The materials are copyrighted, but redistribution is permitted by the owner. ______ Other (please explain) Would you like to be identified as the donor of these materials? ______ Yes, please put my name and contact info on the tape. ______ No, please just put the materials on the tape. Can the people who receive the materials from us redistribute them? ______ Yes, anyone can redistribute these materials. ______ No, nobody can redistribute these materials. ______ Redistribution conditions are specified in the materials. Signature _______________________________________ Date _______________________________________ Name _______________________________________ Organization _______________________________________ Address _______________________________________ _______________________________________ _______________________________________ Phone _______________________________________ Email _______________________________________ From don Mon Nov 6 10:38:47 1989 Date: Mon, 6 Nov 89 10:38:47 -0500 To: NeWS-makers@brillig.umd.edu Subject: pageview errors From: mrmarx!abvax!calvin!jaz@uunet.uu.net Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am having problems running pageview on a Sun 3/80 under NeWS. I keep getting the following messages after issuing the command "pageview file.ps" Process: 0x302004 Error: undefined Stack: /PageViewFrame /defaultclass Executing: ClassBaseFrame At: Reading file(?,W,R) These message seem to occur on any postscript file. The file prints fine on my postscript printer, and views fine under either psh or psview. Any hints would be appreciated. -Thanks jaz@calvin.icd.ab.com From don Mon Nov 6 21:51:34 1989 Date: Mon, 6 Nov 89 21:51:34 -0500 To: NeWS-makers@brillig.umd.edu Subject: Canvas sizes From: russ@dash.mitre.org (Russell Leighton) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In xnews, `readcanvas' scales the images to the unit square. Given this how do I find out what the actual size of the canvas is? I cannot use `getcanvasshape pathbbox' because it will return 0 0 1 1. Russ. ARPA: russ@dash.mitre.org Russell Leighton MITRE Signal Processing Lab 7525 Colshire Dr. McLean, Va. 22102 USA From don Mon Nov 6 21:52:00 1989 Date: Mon, 6 Nov 89 21:52:00 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: A dialog box class From: att!cbnewsc!bwong@ucbvax.Berkeley.EDU (bruce.f.wong) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Can someone help me understand why /destroy is designed the way it is in the Lite toolkit ? destroy in Dialog: /destroy { DialogCanvas /Mapped false put currentprocess killprocessgroup } def DestroyClient, called by /destroy, in LiteWindow: /DestroyClient { % - => - (Destroy client canvas &c.) % currentprocess killprocessgroup FrameEventMgr null ne {FrameEventMgr killprocessgroup} if } def o Why would you want to do a killprocessgroup instead of a killprocess ? A killprocess will get rid of the event manager for that window but a killprocessgroup will get rid of other unrelated event managers. o In Dialog, why unmap the DialogCanvas ? -- Bruce F. Wong ATT Bell Laboratories att!iexist!bwong 200 Park Plaza, Rm 1B-232 708-713-5111 Naperville, Ill 60566-7050 From don Mon Nov 6 21:52:06 1989 Date: Mon, 6 Nov 89 21:52:06 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS software collection From: agate!helios.ee.lbl.gov!ace.ee.lbl.gov!jef@ucbvax.Berkeley.EDU (Jef Poskanzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Thanks, Don, that's great stuff. Except: } ~yoyo.ps~ } Contributed by author No, it wasn't. This file is not for distribution. Don, please remove it from your tar file. Everyone who has retrieved the tar file already, please remove it from your directory tree. --- Jef Jef Poskanzer jef@well.sf.ca.us {ucbvax, apple, hplabs}!well!jef "History tends to exaggerate." -- Col. Green From don Mon Nov 6 21:52:47 1989 Date: Mon, 6 Nov 89 21:52:47 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Integers, mod, and some wallpaper patches From: haven!ncifcrf!toms@purdue.edu (Tom Schneider) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hi folks! I am running a Sun 4 and want to attach another machine to it for my student. The machine should have PostScript graphics capability. Possibilities currently available don't work: 1. I could get a Sparcstation1 from Sun, to run off the disk on my machine. Unfortunately, although Sparcstations use the same chip, they apparently use a different memory management scheme at the moment and so I'd have to duplicate a huge amount of Unix code to be able to run it. That's no good because of the diskspace it would take. Besides, these things are pretty expensive. 2. I could get an NCD X-11 terminal. Then I could get a program that produces PostScript on X-11. Such a program exists - it is called Ps view, and it is sold by ImageSoft. Unfortunately they don't have a port to Sun 4 and only might have one by January. So I'd have to wait around. That's not so good for my student. Does someone has another idea how to get this kind of setup? Is anyone thinking about building a NeWS terminal??? Tom Schneider National Cancer Institute Laboratory of Mathematical Biology Frederick, Maryland 21701-1013 toms@ncifcrf.gov From don Tue Nov 7 18:02:25 1989 Date: Tue, 7 Nov 89 18:02:25 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Canvas sizes From: Rafael Bracho Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Regarding Russell Leighton's request: >In xnews, `readcanvas' scales the images to the unit square. >Given this how do I find out what the actual size of >the canvas is? I cannot use `getcanvasshape pathbbox' >because it will return 0 0 1 1. Do the following (assume can is the result of readcanvas): gsave can setcanvas 1 1 dtransform abs exch abs grestore The result will be the width and height of the canvas. Note that I used the undocumented (at least in the pre-FCS documentation) function 'abs' in both numbers although only the height will be negative. This is because I don't know if NeWS 3.0 will have its internal origin in the upper right hand corner, due to some X.12 requirements. {:-) Rafael Bracho rxb@asc.slb.com From don Tue Nov 7 18:03:12 1989 Date: Tue, 7 Nov 89 18:03:12 -0500 To: NeWS-makers@brillig.umd.edu Subject: Canvas sizes From: russ@dash.mitre.org (Russell Leighton) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Thanks for your response: >In xnews, `readcanvas' scales the images to the unit square. >Given this how do I find out what the actual size of >the canvas is? I cannot use `getcanvasshape pathbbox' >because it will return 0 0 1 1. Do the following (assume can is the result of readcanvas): gsave can setcanvas 1 1 dtransform abs exch abs grestore The result will be the width and height of the canvas. Note that I used the undocumented (at least in the pre-FCS documentation) function 'abs' in both numbers although only the height will be negative. This is because I don't know if NeWS 3.0 will have its internal origin in the upper right hand corner, due to some X.12 requirements. {:-) Rafael Bracho rxb@asc.slb.com This is another response I got: Try something like this: readcanvas % c dup % c c setcanvas % c initclip clippath pathbbox % c x y w h This works under 1.1, but not under xnews. In fact, it causes a horrible crash under a beta version of xnews. Instead, use the new call, getbbox: readcanvas dup % c c false getbbox % c x y w h John Martin Philips Labs jcm@philabs.philips.com tel (914) 945-6406 Russ. From don Tue Nov 7 18:03:46 1989 Date: Tue, 7 Nov 89 18:03:46 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Canvas sizes From: Rafael Bracho Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) With regards to the other suggestion you got: >Try something like this: > >readcanvas % c >dup % c c >setcanvas % c >initclip >clippath >pathbbox % c x y w h > >This works under 1.1, but not under xnews. In fact, it causes a horrible >crash under a beta version of xnews. It wasn't supposed to work under 1.1 because, according to the Red Book, pathbbox should execute the error 'nocurrentpoint' if the path is empty. > Instead, use the new call, getbbox: > >readcanvas dup % c c >false getbbox % c x y w h This one does work but there is no documentation on getbbox. It looks like the boolean controls whether getbbox will return 'llx lly urx ury', if true, or 'llx lly w h', if false. Rafael Bracho rxb@asc.slb.com From don Tue Nov 7 20:25:36 1989 Date: Tue, 7 Nov 89 20:25:36 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Another machine for your student From: earle@poseur.jpl.nasa.gov (Greg Earle - Sun JPL on-site Software Support) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >1. I could get a Sparcstation1 from Sun, to run off the disk on my >machine. Unfortunately, although Sparcstations use the same chip, they >apparently use a different memory management scheme at the moment and so >I'd have to duplicate a huge amount of Unix code to be able to run it. Whatever gives you that idea? To add a SPARCstation-1 as a diskless client of a Sun-4, one merely installs the SunOS 4.0.3c `/usr' files (Sun-4c_Usr) on top of the existing Sun-4 binaries (they are upwardly compatible), and then one installs the Sun-4c specific `kvm' binaries (the ones that have to deal with that `different memory management scheme' and - more importantly - the other kernel architecture differences, like the S-bus) into a separate directory that the SPARCstation-1 mounts. Those separate files take up a whole whopping 2.085 Mbytes of disk space. Combine that with the 7 Mb root filesystem for the client, and the default 14+ Mbyte swap space, and you'll have used up less than 25 Mbytes of disk space to serve the diskless Sun-4/60. >Besides, these things are pretty expensive. Naahhh. A diskless SPARCstation-1, especially monochrome, is hardly expensive. Since you work for a government institute, NCI probably gets the standard Sun Government discount, which means SPARCstation-1's cost almost nothing. JPL is buying them hand over fist these days, which is helping to make my life more complicated (see below) :^) The cost of an NCD X Terminal is hardly negligible, either. And it sounds like the ImageSoft software that you speak of will only allow previewing of PostScript documents and figures in an X window; this is something that you can get for free these days. On the other hand, if you were to run Sun's OpenWindows (X11/NeWS) software on a diskless SPARCstation-1, you get the power of NeWS and the ability to use NeWS' PostScript capabilities in your X11 windows. Disclaimer: I work for Sun. Of course I'm biased. But your reason #1 has no basis in fact, and I don't think that your reason #2 has sufficient capability for what you really want for your student. (But these are still my opinions only; I do not speak for Sun.) - Greg Earle Sun Microsystems, Inc. - JPL on-site Software Support earle@poseur.JPL.NASA.GOV (Direct) earle@Sun.COM (Indirect) From don Tue Nov 7 20:25:46 1989 Date: Tue, 7 Nov 89 20:25:46 -0500 To: NeWS-makers@brillig.umd.edu Subject: pageview errors on SUN 3/80. From: Gordon Joly Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) As a matter of interest, is there a special distribution of NeWS for 68030 based machines? Gordon Joly. From don Tue Nov 7 20:28:21 1989 Date: Tue, 7 Nov 89 20:28:21 -0500 To: NeWS-makers@brillig.umd.edu Subject: Dialog /destroy explained From: korp@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We designed /destroy to do a killprocessgroup for two reasons. 1) we tried to use a killprocess but for some reason that never seemed to actually kill all of relevant event managers or references to objects we created. 2) Since we couldn't get killprocess to work and the designers of the Lite toolkit used killprocessgroup we just copied what they did and chalked it up to just another bug. Dialog unmaps the DialogCanvas because we used to get zombie canvases on the screen while testing and debugging it. If you look in the definition of litewindow you will see that /DestroyFrame does/did the same thing with the frame and icon canvases while using killprocess. Since this code is now commented out I assume killprocessgroup cleared up their problems too. Peter Argonne National Laboratory korp@athens.ees.anl.gov From don Tue Nov 7 20:29:17 1989 Date: Tue, 7 Nov 89 20:29:17 -0500 To: NeWS-makers@brillig.umd.edu Subject: Ring the bell, slowly, from NeWS server side From: philmtl!philabs!ppgbms!paul@uunet.uu.net (Paul Evan Matz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A couple of weeks ago, I posted a request for information on ringing the bell on a 386i. As it turned out, the one response I got, from Christopher Calabrese at AT&T (thanks Chris), is a C function that runs on the client side. Unfortunately, because it is called from the client side, it has to figure out if it's running on the same machine as the NeWS server, etc., so it ends up being quite a bit more complex than I initial thought. Well, one of our local NeWS experts (Pablo Gonzalez, philabs!ppgbms!pablo), after looking at Chris's code, figured he'd try and write to the keyboard directly from the server. So, here it is. We've put it back into GNU emacs, and psterm. So far, it seems ok. Beats the visual bell. Thanks again to Chris Calabrese. _____________________________________________________________ |Regards, One Campus Drive | |Paul Matz PPG Biomedical Systems | |914-741-4685 Pleasantville, NY. 10570| ------------------------------------------------------------- path ppgbms!moe!paul@philabs.philips.com ------------------------------------------------------------- %% *** % Copyright (c) 1989 PPG Biomedical Systems % All rights reserved - % May be freely distributed with this header attached. % % DESCRIPTION: This is the code that was put into GNU emacs % and Grasshopper psterm to cause the keyboard, connected to % the server machine, to beep. Not particularly optimized. % % Created on Nov. 5, 1989 by Pablo Gonzalez % %/ % Sends a BELL character (\02) to the keyboard (/dev/kbd); Pauses for % a while, then deactives the bell by sending (\03) /Beep { % - => - % Open the keyboard file (/dev/kbd) (w) file % fd dup % fd fd % Send BELL character to keyboard 2 write % fd dup % fd fd flushfile % fd % Pause for a while .005 sleep % Turn off BELL dup % fd fd 3 write % fd flushfile % - } def From don Thu Nov 9 15:58:11 1989 Date: Thu, 9 Nov 89 15:58:11 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Flickering canvases From: sgi!shinobu!odin!ramoth.esd.sgi.com!msc@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <1989Nov6.111754.11056@m2cs.uu.no>, tomas@m2cs.uu.no (Tomas Felner) writes: > I have a problem with moving canvases that has been bothering me for > quite some time. The basic situation is as follows: I have a canvas > ontop of which I have another canvas, on top of which another one, etc. I > have code to grab one of those canvases with the mouse and move them around. > All the canvases on top of the grabbed canvas are then moved together > with the grabbed one. When moving this "stack of canvases" the moving of > the bottommost canvas goes smoothly, but all the canvases on top of it > flicker like crazy! This effect appears with any stack of canvases and > with an arbitray number of canvases on top of the bottom canvas. You don't say what version of NeWS you are running... In NeWS 1.1 (and 4Sight) when you move a canvas containing opaque children, the opaque children are unmapped while the canvas is moved then remapped. This may be the cause of your flickering. The unmapping was done to ensure that some obscure case involving retained canvases and save unders would work correctly. I believe Sun found this to be unnecessary so NeWS 2.0 (X11/NeWS) doesn't unmap the canvases anymore. -- From the TARDIS of Mark Callow msc@ramoth.sgi.com, ...{ames,decwrl}!sgi!msc "There is much virtue in a window. It is to a human being as a frame is to a painting, as a proscenium to a play. It strongly defines its content." From don Thu Nov 9 15:58:49 1989 Date: Thu, 9 Nov 89 15:58:49 -0500 To: NeWS-makers@brillig.umd.edu Subject: Application Launcher From: zawada@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Congratulations on obtaining a copy of EXPRESS!!! This file is an archive which contains: README.express express.ps me.ras.uu ScrollDataItem. To unarchive this file type ar xv 'filename' Special Notes me.ras.uu is a uuencoded raster file which must be de-coded by uudecode me.ras.uu ScrollDataItem. must be renamed to ScrollDataItem.ps ------------- Cut Here --------------- Cut Here ------------ ! README.express 624748393 117 100 100644 2774 ` %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % EXPRESS v1.0 % % Date: October 18, 1989 % Author: % David G. Zawada % EAIS-VIS % Argonne National Laboratory % zawada@athens.ees.anl.gov % % Technical Advisors: % Peter A. Korp % EAIS-VIS % Argonne National Laboratory % korp@athens.ees.anl.gov % % David C. Mak % EAIS-VIS % Argonne National Laboratory % mak@athens.ees.anl.gov % % % Accompanying files: % -> ScrollDataItem.ps % -> me.ras % % EXPRESS is a quick launch facility which displays % a list of user-specified applications in a menu with % a touch of the designated HotKey. % % IMPORTANT !!! % Before running EXPRESS, the environment variable % EXPRESS_HOME must be set to the path specifying the % location of the files me.ras and ScrollDataItem.ps. % To run EXPRESS, simply type 'psh express.ps'. However, % I strongly recommend that you add an item to your NeWS % rootmenu to perform this task. A line, similar to the % following, in your user.ps file will acheive this goal: % % 0 (Activate Express) % { (psh "path to express"/express.ps) forkunix } % /insertitem rootmenu send % % Now, EXPRESS can be launched from a menu selection, % which I prefer since my typing skills are minimal. % Also, EXPRESS is only a mouse click away. % % After launching EXPRESS for the first time, the 'RIGHT' % key is set as the HotKey and the EXPRESS menu contains % the following items: % % Terminal <- Sun psterm window % Cancel <- no action % About Express <- EXPRESS credits % Configure Express <- Allows customization % Disable Express <- Deactivates EXPRESS % % These items are hardcoded and cannot be changed by % EXPRESS itself. The Configure option, however, displays % a control panel which allows for the customization of % the applications accessible through EXPRESS, the fonts % used by EXPRESS, and the HotKey which launches EXPRESS. % Currently, only the F-, L-, and R-function keys, as % well as the LEFT and RIGHT keys, may be designated as % the HotKey. Also, only the Sun3 keyboard layout is % supported at present. % % A neat feature of EXPRESS is that it can be configured % to execute virtually any piece of NeWS/PostScript code. % Suppose there is a file called win.ps which opens a % NeWS window. You can tell EXPRESS how to launch this % program by accessing the Application Customizer and % entering "psh win.ps" in the Application to add field % and setting the Application type CycleItem to NeWS. % EXPRESS will simply fork off the process "psh win.ps". %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% express_pd.ps 626557502 117 100 100644 35994 ` %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % EXPRESS v1.0 % % Date: October 18, 1989 % Author: % David G. Zawada % EAIS-VIS % Argonne National Laboratory % zawada@athens.ees.anl.gov % % Technical Advisors: % Peter A. Korp % EAIS-VIS % Argonne National Laboratory % korp@athens.ees.anl.gov % % David C. Mak % EAIS-VIS % Argonne National Laboratory % mak@athens.ees.anl.gov % % % Accompanying files: % -> ScrollDataItem.ps % -> me.ras % % EXPRESS is a quick launch facility which displays % a list of user-specified applications in a menu with % a touch of the designated HotKey. % % IMPORTANT !!! % Before running EXPRESS, the environment variable % EXPRESS_HOME must be set to the path specifying the % location of the files me.ras and ScrollDataItem.ps. % To run EXPRESS, simply type 'psh express.ps'. However, % I strongly recommend that you add an item to your NeWS % rootmenu to perform this task. A line, similar to the % following, in your user.ps file will acheive this goal: % % 0 (Activate Express) % { (psh "path to express"/express.ps) forkunix } % /insertitem rootmenu send % % Now, EXPRESS can be launched from a menu selection, % which I prefer since my typing skills are minimal. % Also, EXPRESS is only a mouse click away. % % After launching EXPRESS for the first time, the 'RIGHT' % key is set as the HotKey and the EXPRESS menu contains % the following items: % % Terminal <- Sun psterm window % Cancel <- no action % About Express <- EXPRESS credits % Configure Express <- Allows customization % Disable Express <- Deactivates EXPRESS % % These items are hardcoded and cannot be changed by % EXPRESS itself. The Configure option, however, displays % a control panel which allows for the customization of % the applications accessible through EXPRESS, the fonts % used by EXPRESS, and the HotKey which launches EXPRESS. % Currently, only the F-, L-, and R-function keys, as % well as the LEFT and RIGHT keys, may be designated as % the HotKey. Also, only the Sun3 keyboard layout is % supported at present. % % A neat feature of EXPRESS is that it can be configured % to execute virtually any piece of NeWS/PostScript code. % Suppose there is a file called win.ps which opens a % NeWS window. You can tell EXPRESS how to launch this % program by accessing the Application Customizer and % entering "psh win.ps" in the Application to add field % and setting the Application type CycleItem to NeWS. % EXPRESS will simply fork off the process "psh win.ps". %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict /ScrollDataItem known not % Make sure SDI is available { (EXPRESS_HOME) getenv (/ScrollDataItem.ps) append run } if version (1.1) eq { keyboardtype 3 eq % enable the Left key -- Why does NeWS disable it? { systemdict /keyboard_positions get /FunctionLeft [ 120 systemdict /UI_private get /keyStation get exec /function ] put } if } if systemdict /ExpressDict 100 dict put % put all the Express code in its own dictionary ExpressDict begin /createfile? false def % does the defaults file (.expressapps) need to be created? /expressfile null def /NumDefaultMenuEntries 7 def /HotKey /FunctionRight def /writefile % - > - write out the current EXPRESS settings { pause % Just Being Nice /expressfile ($HOME/.expressapps) (w) file store expressfile ([\n) writestring ExpressMenu /MenuKeys get 0 1 2 index length NumDefaultMenuEntries 1 add sub { expressfile 2 index 3 -1 roll get (\() exch append (\)\n) append writestring } for expressfile (]\n\n) writestring pause % Just Being Nice expressfile ([\n) writestring ExpressMenu /MenuActions get 0 1 2 index length NumDefaultMenuEntries 1 add sub { expressfile 2 index 3 -1 roll get (\() exch append (\)\n) append writestring } for expressfile (]\n) writestring [ ButFnt MenFnt SDIFnt TIFnt ] { (\() exch convertfont (\)\n) append append expressfile exch writestring } forall expressfile (\() HotKey 100 string cvs (\)\n) append append writestring expressfile closefile } def /getfntname % font => string containing fontname and pt_size { 200 string cvs (font\() search pop pop pop (\)) search pop 3 1 roll pop pop ( ) append } def /convertfont % (font&size) => (font size) put space betwn font and size { getfntname dup 0 1 index length 3 sub getinterval ( ) 3 -1 roll dup length 3 sub 3 getinterval append append } def /verifyfile % filename => boolean does filename exist? { { (r) file } stopped { pop pop false } { closefile true } ifelse } def ($HOME/.expressapps) verifyfile % if defaults file exists, read it in { ExpressDict begin ($HOME/.expressapps) run /HotKey exch cvn store /TIFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /SDIFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /MenFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /ButFnt exch ( ) search pop findfont 3 1 roll pop cvi scalefont def /UserMenuActions exch def /UserMenuKeys exch def end % ExpressDict } { % otherwise, set default fonts and ... ExpressDict begin /ButFnt /Times-Bold findfont 14 scalefont def /MenFnt /Helvetica-Bold findfont 12 scalefont def /SDIFnt /Helvetica-Bold findfont 14 scalefont def /TIFnt /Screen-Bold findfont 14 scalefont def end % ExpressDict /createfile? true store % ... indicate default file needs to be created } ifelse gsave % get screen dimensions framebuffer setcanvas clippath pathbbox /ScreenHeight exch def /ScreenWidth exch def pop pop grestore /calc_wincoords % w h => x y w h coords that will center window on screen { 1 index 1 index ScreenHeight exch sub 2 div 4 1 roll ScreenWidth exch sub 2 div 4 1 roll } def %%%%%%%%%%%%%%%%%%%%%% %% About EXPRESS stuff %%%%%%%%%%%%%%%%%%%%%% /aboutEM null def /aboutcan framebuffer newcanvas def aboutcan /Transparent false put aboutcan /Retained true put aboutcan /Mapped false put 0 0 463 313 rectpath aboutcan reshapecanvas /about_express % display EXPRESS credits { ExpressDict begin gsave aboutcan setcanvas 300 dup movecanvas aboutcan canvastotop aboutcan /Mapped true put gsave % scale and load in my picture !!! (kind of Mac-ish, huh?) 463 313 scale pause (EXPRESS_HOME) getenv (/me.ras) append readcanvas imagecanvas grestore newpath 128 8 329 20 rectpath 0 0 0 rgbcolor 1 1 1 rgbcolor ColorDisplay? { pop pop 0 0 1 rgbcolor ColorDict /MediumSpringGreen get } if setcolor fill setcolor newpath 2 128 8 329 20 rectframe eofill /Symbol findfont 14 scalefont setfont 131 14 moveto (\323) show /Helvetica-Bold findfont 12 scalefont setfont 142 14 moveto ( Argonne National Lab by Dave Zawada -- Version 1.0) show /aboutEM % display credits until Left Mouse Button pressed [ PointButton { aboutcan /Mapped false put aboutEM killprocess } /DownTransition aboutcan eventmgrinterest ] forkeventmgr store grestore end % ExpressDict } def %% End About EXPRESS %%%%%%%%%%%%%%%%%%%%%%%%% %% EXPRESS Control Panel %%%%%%%%%%%%%%%%%%%%%%%%% /cpButtonSize 0 def % size of buttons to use -- depends on ButFnt /cpButtonX 10 def /cpitemsEM null def /appsChanges? false def % Changes made to application list? /fntChanges? false def % Changes made to font list? /hkChanges? false def % Change made to HotKey? /cp framebuffer /new SunViewWindow send def { 300 dup 200 400 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if cpitems paintitems } def /FrameFont /Helvetica-Bold findfont 14 scalefont def /FrameLabel (EXPRESS Control Panel) def /flipiconic {} def /stretchcorner {} def } cp send /cpcan cp /ClientCanvas get def %-------------------- %--- button notifies %-------------------- /abut_notify { /unmap cp send configapps } def % Display Application Customizer /fbut_notify { /unmap cp send configfnt } def % Display Font Customizer /hkbut_notify { /unmap cp send confighk } def % Display HotKey Customizer /sbut_notify { % Save any changes and write them out to the defaults file ExpressDict begin hkChanges? { HotKey unbindkey /HotKey (Function) hkitems /msg get /ItemObject get append cvn store HotKey 20 string cvs (Function) search pop pop pop dup /printstring hkitems /msg get send cvn /CurntHK exch store setHotKey hkcan_notify /hkChanges? false store } if fntChanges? { /ButFnt tmpButFnt store /MenFnt tmpMenFnt store % Bizarre, but must create a NEW menu to reflect the font change { /MenuFont MenFnt store /SaveMenuKeys MenuKeys store /SaveMenuActions MenuActions store } ExpressMenu send /ExpressMenu SaveMenuKeys SaveMenuActions /new DefaultMenu send store adjustmenu /SDIFnt tmpSDIFnt store /TIFnt tmpTIFnt store update_configwin update_hkwin update_cp } if writefile /unmap cp send cpitemsEM null ne { cpitemsEM killprocess /cpitemsEM null store } if end % ExpressDict } def /cbut_notify % - > - cancel ALL changes { can_notify cancel_notify hkcan_notify /unmap cp send cpitemsEM null ne { cpitemsEM killprocess /cpitemsEM null store } if } def /cpitems 5 dict dup begin /abut (Change Installed Applications) /abut_notify cpcan 0 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /cpButtonSize abut /ItemWidth get store /fbut (Change Fonts) /fbut_notify cpcan cpButtonSize 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /hkbut(Change HotKey) /hkbut_notify cpcan cpButtonSize 0 /new ButtonItem send dup /ItemFrame 2 put dup /ItemLabelFont ButFnt put 0 0 /move 3 index send def /sbut(Save) /sbut_notify cpcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ButFnt def /ItemFillColor 1 0 0 rgbcolor def end 0 0 /move 3 index send def /cbut(Cancel) /cbut_notify cpcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ButFnt def /ItemFillColor 1 1 0 rgbcolor def end 0 0 /move 3 index send def end % cpitems def /poscpitems % - > - Postion cpitems based on the max button size in cpitems { cpitems begin cpButtonX dup /move sbut send cpButtonX cpButtonSize add cbut /ItemWidth get sub 10 /move cbut send cbut /ItemHeight get cpButtonX dup 1.5 mul 2 index add /move hkbut send cpButtonX dup 2 mul 2 index 2 mul add /move fbut send cpButtonX dup 2.5 mul 3 -1 roll 3 mul add /move abut send end % cpitems } def { cpButtonX 2.5 mul cpButtonSize add cpButtonX 3.5 mul cpitems /cbut get /ItemHeight get 4 mul BorderTop BorderBottom add add add calc_wincoords reshape } cp send poscpitems %% End Control Panel %%%%%%%%%%%%%%%% %% Font Adjuster %%%%%%%%%%%%%%%% /FontChange? false def /tmpButFnt ButFnt def /tmpMenFnt MenFnt def /tmpSDIFnt SDIFnt def /tmpTIFnt TIFnt def /Fonts [ % the fonts to choose from [ (Boston) dup cvn findfont 14 scalefont ] [ (Courier) dup cvn findfont 14 scalefont ] [ (Courier-Bold) dup cvn findfont 14 scalefont ] [ (Courier-BoldOblique) dup cvn findfont 14 scalefont ] [ (Courier-Oblique) dup cvn findfont 14 scalefont ] [ (Helvetica) dup cvn findfont 14 scalefont ] [ (Helvetica-Bold) dup cvn findfont 14 scalefont ] [ (Helvetica-BoldOblique) dup cvn findfont 14 scalefont ] [ (Helvetica-Oblique) dup cvn findfont 14 scalefont ] [ (Screen) dup cvn findfont 14 scalefont ] [ (Screen-Bold) dup cvn findfont 14 scalefont ] [ (Times-Bold) dup cvn findfont 14 scalefont ] [ (Times-BoldItalic) dup cvn findfont 14 scalefont ] [ (Times-Italic) dup cvn findfont 14 scalefont ] [ (Times-Roman) dup cvn findfont 14 scalefont ] ] def /PtSizes [ [(12)] [(14)] [(18)] [(24)] ] def % font point sizes /fwitemsEM null def /fwin framebuffer /new SunViewWindow send def { 200 300 810 240 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if fwinitems paintitems } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (EXPRESS Font Customizer for ) (USER) getenv append def /flipiconic {} def /stretchcorner {} def } fwin send /fwcan fwin /ClientCanvas get def /configfnt % - > - configure and display the Font Customizer window { ExpressDict begin /fwitemsEM fwinitems forkitems store fwinitems begin (%) [ tmpButFnt getfntname ] /printf mb send (%) [ tmpMenFnt getfntname ] /printf mm send (%) [ tmpSDIFnt getfntname ] /printf msdi send (%) [ tmpTIFnt getfntname ] /printf mti send end % fwinitems { totop map } fwin send end % ExpressDict } def %-------------------- %--- button notifies %-------------------- /getfontselection % - => font boolean converts string returned by SDI into a font object { fwinitems begin fntSDI /ItemValue get dup null ne { Fonts exch get 0 get cvn findfont PtSizes ptsz /ItemValue get 1 get get 0 get cvi scalefont true } { pop false } ifelse end % fwinitems } def % The following four notify procs update there respective msg items % to reflect font changes. /sti_notify { getfontselection { dup ExpressDict /tmpTIFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mti get send ExpressDict /fntChanges? true put } if } def /ssdi_notify { getfontselection { dup ExpressDict /tmpSDIFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /msdi get send ExpressDict /fntChanges? true put } if } def /sm_notify { getfontselection { dup ExpressDict /tmpMenFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mm get send ExpressDict /fntChanges? true put } if } def /sb_notify { getfontselection { dup ExpressDict /tmpButFnt 3 -1 roll put getfntname (%) [ 3 -1 roll ] /printf fwinitems /mb get send ExpressDict /fntChanges? true put } if } def /savfnt_notify % Don't do anything { ExpressDict begin /unmap fwin send fwitemsEM null ne { fwitemsEM killprocess /fwitemsEM null store } if { totop map } cp send end % ExpressDict } def /cancel_notify % Restore previous font settings { ExpressDict begin /fntChanges? false store /tmpButFnt ButFnt store /tmpMenFnt MenFnt store /tmpSDIFnt SDIFnt store /tmpTIFnt TIFnt store /unmap fwin send fwitemsEM null ne { fwitemsEM killprocess /fwitemsEM null store } if { totop map } cp send end % ExpressDict } def % The following update routines will rescale all of the various configure % windows to account for changes made to the fonts to be utilized in % control items. /update_cp { cpitems begin [ abut sbut cbut ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } exch send } forall /cpButtonSize abut /ItemWidth get store [ fbut hkbut ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 cpButtonSize 0 reshape } exch send } forall end % cpitems { cpButtonX 2.5 mul cpButtonSize add cpButtonX 3.5 mul cpitems /cbut get /ItemHeight get 4 mul BorderTop BorderBottom add add add calc_wincoords reshape } cp send poscpitems } def /update_configwin { items begin /cfTISize gsave TIFnt setfont (Reference in Menu as: ) stringbbox grestore pop 3 1 roll pop pop 2 mul store /cfSDISize gsave SDIFnt setfont ( Installed Applications ) stringbbox grestore pop 3 1 roll pop pop store { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } cancel_but send /cfButtonSize cancel_but /ItemWidth get store [ add_but del_but done_but ] { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 cfButtonSize 0 reshape } exch send } forall { /ItemFont SDIFnt def /ItemLabelFont SDIFnt def } appsSDI send [ apptoadd appref ] { { /ItemFont TIFnt def /ItemLabelFont TIFnt def /LabelX 0 def /LabelY 0 def /ObjectX 0 def /ObjectY 0 def 0 0 cfTISize 0 reshape TI_resetarray } exch send } forall { /ItemFont TIFnt def /ItemLabelFont TIFnt def /LabelX 0 def /LabelY 0 def /ObjectX 0 def /ObjectY 0 def 0 0 0 0 reshape } filetype send end % items { 30 cfSDISize cfButtonSize cfTISize add add add 30 cfSDISize BorderTop BorderBottom add add add calc_wincoords reshape } configwin send poscfitems } def /update_hkwin { hkitems begin /msg (The current Hot Key is ) ( ) /Right {} hkcan 0 0 /new MessageItem send ColorDisplay? { dup /ItemFillColor ColorDict /LightBlue get put } if dup /ItemFont TIFnt put dup /ItemLabelFont TIFnt put 0 0 /move 3 index send store { /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } dup save_but send can_but send { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 0 0 reshape } Right send /hkButtonSize Right /ItemWidth get store { /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } 0 index Left send Right send fkeys { { % Hokey, but needed to re-center the label /ItemLabelFont ButFnt def /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } exch cvn cvx exec send } forall end % hkitems { hkButtonSize dup 15 mul exch 6 mul BorderTop BorderBottom add add calc_wincoords reshape } hkwin send poshkitems } def %----------------------- %--- end button notifies %----------------------- /fwinitems 12 dict dup begin /fntSDI fwcan {} /new ScrollDataItem send def { /AllowMultipleSelect? false def /ShowItemSeperators false def /HScrollbar? false def ColorDisplay? { /BufferColor ColorDict /Aquamarine get def /ItemTextColor 0 0 1 rgbcolor def } if /ItemLabel (FONTS) def /ItemLabelFont /Helvetica-Bold findfont 13 scalefont def /ItemLabelColor 0 0 0 rgbcolor def /ItemHighLightColor 0 0 0 rgbcolor def Fonts setdata 10 dup 200 dup reshape } fntSDI send /ptsz ( Point Size ) PtSizes /Bottom {} fwcan 0 0 /new ArrayItem send 225 100 /move 3 index send def /savebut (SAVE) /savfnt_notify fwcan 80 0 /new ButtonItem send dup /ItemRadius 0 put 225 50 /move 3 index send def /canbut (CANCEL) /cancel_notify fwcan 80 0 /new ButtonItem send dup /ItemRadius 0 put 225 10 /move 3 index send def /sb (Set Button Font) /sb_notify fwcan 165 0 /new ButtonItem send 315 160 /move 3 index send def /sm (Set Menu Font) /sm_notify fwcan 165 0 /new ButtonItem send 315 110 /move 3 index send def /ssdi (Set ScrollDataItem Font) /ssdi_notify fwcan 165 0 /new ButtonItem send 315 60 /move 3 index send def /sti (Set TextItem Font) /sti_notify fwcan 165 0 /new ButtonItem send 315 10 /move 3 index send def /mb (Button Font is ) ButFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 165 /move 3 index send def /mm (Menu Font is ) MenFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 115 /move 3 index send def /msdi (ScrollDataItem Font is ) SDIFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 65 /move 3 index send def /mti (TextItem Font is ) TIFnt getfntname /Right {} fwcan 300 0 /new MessageItem send 490 15 /move 3 index send def end def fwinitems { 0 index /ItemFrame 2 put ColorDisplay? { /ItemFillColor ColorDict /LightBlue get put } { pop } ifelse } forall %%% End Font Adjuster %%%%%%%%%%%%%%%%%%%%% %% Set Hot Keys Stuff %%%%%%%%%%%%%%%%%%%%% /HKColor ColorDisplay? { 0 1 1 rgbcolor } { 0.7 0.7 0.7 rgbcolor } ifelse def /HKColorerase 1 1 1 rgbcolor def /CurntHK HotKey 20 string cvs (Function) search pop pop pop cvn def /hkButtonSize 0 def /ButtonX 0 def /ButtonY 0 def /fkeys % The possible HotKey choices [ (L1) (L2) (L3) (L4) (L5) (L6) (L7) (L8) (L9) (L10) (F1) (F2) (F3) (F4) (F5) (F6) (F7) (F8) (F9) (R1) (R2) (R3) (R4) (R5) (R6) (R7) (R8) (R9) (R10) (R11) (R12) (R13) (R14) (R15) ] def /hkitemsEM null def /hkwin framebuffer /new SunViewWindow send def { 200 300 600 320 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ColorDisplay? { ColorDict /LightBlue get fillcanvas } if ExpressDict /hkitems get paintitems } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (Set the EXPRESS Hot Key for ) (USER) getenv append def /stretchcorner {} def /flipiconic {} def } hkwin send /hkcan hkwin /ClientCanvas get def /confighk % Display the current HotKey and map the HotKey Customizer window { pause ExpressDict begin /hkitemsEM hkitems forkitems store CurntHK 10 string cvs /printstring hkitems /msg get send { /ItemFillColor HKColor def paint } hkitems CurntHK get send { totop map } hkwin send end % ExpressDict } def %------------- %--- Item Notifies %----------------- /hks_notify { ExpressDict begin { /ItemFillColor HKColorerase def paint } hkitems CurntHK get send /CurntHK ItemLabel cvn store { /ItemFillColor HKColor def } hkitems CurntHK get send ItemLabel /printstring hkitems /msg get send end % ExpressDict } def /save_notify % Don't do anything { ExpressDict begin /hkChanges? true store /unmap hkwin send hkitemsEM null ne { hkitemsEM killprocess /hkitemsEM null store } if { totop map } cp send end % ExpressDict } def /hkcan_notify % Reset to previous HotKey { ExpressDict begin /hkChanges? false store /unmap hkwin send { /ItemFillColor HKColorerase def paint } hkitems CurntHK get send /CurntHK HotKey 20 string cvs (Function) search pop pop pop cvn store { /ItemFillColor HKColor def } hkitems CurntHK get send hkitemsEM null ne { hkitemsEM killprocess /hkitemsEM null store } if { totop map } cp send end % ExpressDict } def pause pause % Just Being Nice /hkitems 40 dict dup begin /Right (Right) /hks_notify hkcan 0 hkButtonSize /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def /hkButtonSize Right /ItemWidth get store { /LabelX 0 def /LabelY 0 def 0 0 hkButtonSize dup reshape } Right send /Left (Left) /hks_notify hkcan hkButtonSize dup /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def 0 1 fkeys length 1 sub { fkeys exch get dup cvn exch /hks_notify hkcan hkButtonSize dup /new ButtonItem send dup begin /ItemLabelFont ButFnt def /ItemFrame 1 def /ItemRadius 0 def /ClientUp { ItemValue { NotifyUser } if false SetButtonValue /ItemValue null store paint StopItem } def end 0 0 /move 3 index send def } for /msg (The current Hot Key is ) ( ) /Right {} hkcan 0 0 /new MessageItem send ColorDisplay? { dup /ItemFillColor ColorDict /LightBlue get put } if dup /ItemFont TIFnt put dup /ItemLabelFont TIFnt put 0 0 /move 3 index send def /save_but ( Save Change ) /save_notify hkcan 100 0 /new ButtonItem send dup begin /ItemFrame 1 def /ItemLabelFont ButFnt def /ItemFillColor 1 0 0 rgbcolor def end 0 0 /move 3 index send def /can_but ( Cancel ) /hkcan_notify hkcan 100 0 /new ButtonItem send dup begin /ItemFrame 1 def /ItemLabelFont ButFnt def /ItemFillColor 1 1 0 rgbcolor def end 0 0 /move 3 index send def end def pause /poshkitems { % Reposition the buttons /ButtonX 10 store /ButtonY hkButtonSize 4.5 mul store 0 2 9 { ButtonX ButtonY /move hkitems fkeys 5 index get cvn get send ButtonX hkButtonSize 1 sub add ButtonY /move hkitems fkeys 6 -1 roll 1 add get cvn get send /ButtonY ButtonY hkButtonSize 1 sub sub store } for pause /ButtonX 20 hkButtonSize 2 mul add store /ButtonY hkButtonSize 4.5 mul store 10 1 18 { ButtonX ButtonY /move hkitems fkeys 6 -1 roll get cvn get send /ButtonX ButtonX hkButtonSize 1 sub add store } for pause /ButtonX 25 hkButtonSize 11 mul add store /ButtonY hkButtonSize 4.5 mul store 19 3 33 { ButtonX ButtonY /move hkitems fkeys 5 index get cvn get send ButtonX hkButtonSize 1 sub add ButtonY /move hkitems fkeys 5 index 1 add get cvn get send ButtonX hkButtonSize 1 sub 2 mul add ButtonY /move hkitems fkeys 6 -1 roll 2 add get cvn get send /ButtonY ButtonY hkButtonSize 1 sub sub store } for hkitems begin hkButtonSize dup 3 mul exch 0.6 mul /move Left send hkButtonSize dup 10 mul exch 0.6 mul /move Right send { hkButtonSize dup 3.5 mul exch 3.5 mul move } msg send { hkButtonSize dup 2 mul ItemWidth 2 div add exch 2 mul move } save_but send { hkButtonSize dup 10 mul ItemWidth 2 div sub exch 2 mul move } can_but send end % hkitems } def { hkButtonSize dup 15 mul exch 6 mul BorderTop BorderBottom add add calc_wincoords reshape } hkwin send poshkitems /setHotKey % - > - Activate the desired HotKey { HotKey { ExpressDict begin ExpressMenu /MenuCanvas get null ne cp /FrameCanvas get /Mapped get configwin /FrameCanvas get /Mapped get fwin /FrameCanvas get /Mapped get hkwin /FrameCanvas get /Mapped get aboutcan /Mapped get or or or or or not { /showat ExpressMenu send } if end % ExpressDict } bindkey } def %% End Hot Keys %%%%%%%%%%%%%%%%%%%% %% Configure Express %%%%%%%%%%%%%%%%%%%% /cfButtonSize 0 def /cfTISize gsave TIFnt setfont (Reference in Menu as: ) stringbbox grestore pop 3 1 roll pop pop 2.5 mul def /cfSDISize gsave SDIFnt setfont ( Installed Applications ) stringbbox grestore pop 3 1 roll pop pop def /FileType ( forkunix) def /SaveSDIData [] def /SaveMenuItems null def /SaveMenuKeys null def /SaveMenuActions null def /itemsEM null def /configwin framebuffer /new SunViewWindow send def { 250 400 500 220 reshape FrameInterests /FrameMenuEvent undef FrameInterests /ClientMenuEvent undef /PaintClient { ExpressDict begin ColorDisplay? { ColorDict /LightBlue get fillcanvas } if items paintitems 0 setgray TIFnt setfont 10 cfSDISize cfButtonSize 2 mul add add items /cancel_but get /ItemHeight get 3.2 mul moveto (Application type is) show end % ExpressDict } def /FrameFont /Helvetica-BoldOblique findfont 14 scalefont def /FrameLabel (EXPRESS Application Customizer for ) (USER) getenv append def /flipiconic {} def /stretchcorner {} def } configwin send /cwcan configwin /ClientCanvas get def /configapps % Clear the TextItems and map the Application Customizer window { ExpressDict begin /itemsEM items forkitems store { TI_resetarray items /apptoadd get send TI_resetarray items /appref get send totop map } configwin send end % ExpressDict } def %----------------- %--- Item Notifies %----------------- /fil_notify { ExpressDict /FileType ItemValue 0 eq { ( forkunix) } { ( fork_sunview1_tty) } ifelse put } def /TI_resetarray { { gsave ItemCanvas setcanvas restorefocus /LINEKILL ItemText send /ItemPaintedValue () def /ItemValue () def removefocus paint grestore } } def /add_notify { ExpressDict begin /appsChanges? true store items begin apptoadd /ItemValue get () append appref /ItemValue get dup () eq { pop dup (\() 1 index append (\)) append FileType append cvx } { () append dup (\() 4 -1 roll append (\)) append FileType append cvx } ifelse 0 3 1 roll /insertitem ExpressMenu send 0 /additem appsSDI send TI_resetarray apptoadd send TI_resetarray appref send end % items end % ExpressDict } def /del_notify { ExpressDict begin /appsChanges? true store items begin appsSDI /ItemValue get dup null ne { 0 index /deleteitem appsSDI send /deleteitem ExpressMenu send } { pop } ifelse end % items end % ExpressDict } def /can_notify % Restore previous SDI values { ExpressDict begin /appsChanges? false store /unmap configwin send SaveSDIData /setdata items /appsSDI get send { /MenuItems SaveMenuItems def /MenuKeys SaveMenuKeys def /MenuActions SaveMenuActions def /MenuWidth null def } ExpressMenu send itemsEM null ne { itemsEM killprocess /itemsEM null store } if { totop map } cp send end % ExpressDict } def /db_notify % Don't do anything { ExpressDict begin /unmap configwin send itemsEM null ne { itemsEM killprocess } if { totop map } cp send end % ExpressDict } def /items 8 dict dup begin /cancel_but ( Cancel ) ExpressDict /can_notify get cwcan 0 0 /new ButtonItem send dup begin /ItemFrame 2 def ColorDisplay? { /ItemFillColor 1 1 0 rgbcolor def } if /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /cfButtonSize cancel_but /ItemWidth get store /add_but ( Add ) ExpressDict /add_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /del_but ( Delete ) ExpressDict /del_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /done_but ( Done ) ExpressDict /db_notify get cwcan cfButtonSize 0 /new ButtonItem send dup begin /ItemFrame 2 def ColorDisplay? { /ItemFillColor 1 0 0 rgbcolor def } if /ItemLabelFont ExpressDict /ButFnt get def end 0 0 /move 3 index send def /appsSDI cwcan {} /new ScrollDataItem send def { /AllowMultipleSelect? false def /ShowItemSeperators false def /HScrollbar? false def ColorDisplay? { /BufferColor ColorDict /Aquamarine get def /ItemTextColor 0 0 1 rgbcolor def } if /ItemLabel ( Installed Applications ) def /ItemLabelFont ExpressDict /SDIFnt get def /ItemFont ExpressDict /SDIFnt get def /ItemLabelColor 0 0 0 rgbcolor def /ItemHighLightColor 0 0 0 rgbcolor def } appsSDI send /apptoadd (Application to add: ) () /Right {} cwcan cfTISize 0 /new TextItem send dup /ItemFont ExpressDict /TIFnt get put dup /ItemLabelFont ExpressDict /TIFnt get put 0 0 /move 3 index send def /appref (Reference in Menu as: ) () /Right {} cwcan cfTISize 0 /new TextItem send dup /ItemFont ExpressDict /TIFnt get put dup /ItemLabelFont ExpressDict /TIFnt get put 0 0 /move 3 index send def /filetype /cycle [ (NeWS) (SunView) ] /Right /fil_notify cwcan 0 0 /new CycleItem send dup begin /LabelY 0 def /ItemFont ExpressDict /TIFnt get def ColorDisplay? { /ItemFillColor ColorDict /LightBlue get def } if end 0 0 /move 3 index send def end def pause /poscfitems { ExpressDict begin items begin { 10 dup cfSDISize dup reshape 450 SizeAllData reshapebuffer ShowObjectData } appsSDI send 10 cfSDISize cfButtonSize 2 div add add { 0 index 10 move ItemHeight 1.5 mul 5 add } done_but send { 1 index exch move ItemHeight 3 mul } del_but send 1 index exch /move add_but send cfButtonSize 1.5 mul add 10 /move cancel_but send ColorDisplay? { [ apptoadd appref ] { begin /ItemFillColor ColorDict /LightBlue get def ItemText begin /TextFill ItemFillColor store end end } forall } if 10 cfSDISize cfButtonSize 2 div add add dup cancel_but /ItemHeight get 4 mul /move appref send cancel_but /ItemHeight get 4 mul appref /ItemHeight get 10 add add /move apptoadd send 10 cfSDISize cfButtonSize 2.1 mul add add gsave TIFnt setfont (Application type is) stringbbox grestore pop 3 1 roll pop pop add cancel_but /ItemHeight get 3 mul /move filetype send end % items end % ExpressDict } def { 30 cfSDISize cfButtonSize cfTISize add add add 30 cfSDISize BorderTop BorderBottom add add add calc_wincoords reshape } configwin send poscfitems %% End Configure Apps %%%%%%%%%%%%%%%%%%%%% %% Express Menu Stuff %%%%%%%%%%%%%%%%%%%%% /configure % Save current SDI and ExpressMenu settings and { % display the EXPRESS Configuration Control Panel pause ExpressDict begin /SaveSDIData /getdata items /appsSDI get send store /SaveMenuItems ExpressMenu /MenuItems get store /SaveMenuKeys ExpressMenu /MenuKeys get store /SaveMenuActions ExpressMenu /MenuActions get store /cpitemsEM cpitems forkitems store { totop map } cp send end % ExpressDict } def /ExpressMenu % Create default EXPRESS menu [ (Terminal) { (psterm -t sun -f) forkunix } (~~~~~~~~~~~~~) {} (Cancel) {} (~~~~~~~~~~~~~) {} (About Express) ExpressDict /about_express get (Configure Express) ExpressDict /configure get (Disable Express) { ExpressDict begin itemsEM null ne { itemsEM killprocess } if hkitemsEM null ne { hkitemsEM killprocess } if end % ExpressDict ExpressDict { ExpressDict exch undef } forall systemdict /ExpressDict undef HotKey unbindkey keyboardtype 3 eq % deactivate Left key { systemdict /keyboard_positions get /LeftMeta [ 120 systemdict /UI_private get /keyStation get exec /shift_key ] put } if } ] /new DefaultMenu send def pause % Just Being Nice /adjustmenu % - > - Customize the look of ExpressMenu { { ColorDisplay? { /MenuBorderColor ColorDict /MediumBlue get def /MenuFillColor ColorDict /LightBlue get def /MenuTextColor ColorDict /Blue get def } if /MenuFont ExpressDict /MenFnt get def /Frame 3 def /reshape { MenuGSave framebuffer setcanvas 10 0 Border ArrayWidth ArrayHeight rrectpath MenuCanvas reshapecanvas /rtarr /rtarr_m MenuCanvas setstandardcursor grestore } def /PaintBox % [color] value => - { dup null ne { MenuItems exch get begin X Y W H end rectpath dup type /colortype ne { MenuTextColor } if setcolor stroke } { pop } ifelse } def /PaintMenuValue { MenuGSave MenuFillColor PaintedValue PaintBox MenuTextColor MenuValue PaintBox /PaintedValue MenuValue store grestore } def /PaintMenuFrame { MenuFillColor fillcanvas Frame 0 ne { MenuBorderColor setcolor Frame 10 0 Border ArrayWidth ArrayHeight rrectframe eofill } if } def } ExpressMenu send } def %% End Menu Stuff pause adjustmenu createfile? % create the defaults file (.expressapps) if it doesn't exist { writefile [] [] } { % otherwise, load in the stored applications pause 0 1 UserMenuKeys length 1 sub { dup UserMenuKeys exch get dup { ObjectData length additem } items /appsSDI get send UserMenuActions 2 index get cvx /insertitem ExpressMenu send } for } ifelse setHotKey % activate the HotKey end % ExpressDict me.ras.uu 624748972 117 100 100666 201227 ` begin 666 me.ras M6:9JE0 <\ $Y " "-U ! 0 P#_ #]_O_\ /W^__P _ M?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _ M?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _ M?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _ M?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _ M?[__ #]_O_\ /W^__P _?[__ #]_O_\ /W^__P _?[_P#Q&C92;HJFPM\;-U-OBZ?< _P ? M'Q\?'Q\?'Q\?'Q\?'Q\?'Q\?'Q\?'Q\?/S\_/S\_/S\_/S\_/S\_/S\_/S\_ M/S\_/U]?7U]?7U]?7U]?7U]?7U]?7U]?7U]?7U]_?W]_?W]_?W]_?W]_?W]_ M?W]_?W]_?W]_GY^?GY^?GY^?GY^?GY^?GY^?GY^?GY^?G[^_O[^_O[^_O[^_ MO[^_O[^_O[^_O[^_O[_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?________ M________________________\ \7'R instance % % array,string /setdata => - % Array is an array of the data to be displayed. Each element % of the array can have the following forms... % string -- display a simple string in scroll area. % array -- parse each elemnt of the array in RIGHT % to LEFT order. Each element of the array % can be of the following forms... % string -- display a simple string % array -- parse array righ to left % color -- set color for future commands % font -- set font for future text % x y -- perform a releative move by x y % /name -- display icon called 'name' % A given entry may be as complex as you want with multiple % strings being display in different fonts with different colors % all moved around with respect to each other intermixed with % icons. Even very comples entries are considered as ONE object % for the purposes of selecting it.. % WARNING: markers may NOT be used in the arrays. If the are the % item will stop displaying at that point while leaving trash % on the stack... % % item_number /deleteitem => - % Delete an item from the list of displayable objects. % If the item_number is out of range then the command will % be ignored. item_number is zero referenced. % % array,string item_number /additem => - % Add an item to the list of displayable objects. % The item added will appear BEFORE or above the item forwhich % the item_number is specified. To append an item to the list % you must add the item before the the first item after the % end of the list. No blank nodes will be added. If you add % an item to the list before an item that past the end % of the list then a suffecient number of EMPTY entries will % be added to the list to allow the new entry to be added. % % array,string item_number /changeitem => - % Replace the object associated with an item. If the % item_number is out of range this command is ignored. % % - /getdata => array % Array that has been build up with with setdata and the % change data routines. % % x y w h /reshape => - % Move and reshape the item... % % % Usefull Class and instance variables: % /AllowMultipleSelect? (default false) % If this is set to true then the user can selected move % then one object. If this is false then selecting a different % object unselects the previous one. % WARNING: This command MUST be issued before any data is % downloaded set with /setdata. Else a /DeclareItemValueArray % must be issued. % % /HScrollBar? (default true) % /VScrollBar? (default true) % Should these scroll bars be displayed... % % /BufferColor (default 1 1 1 rgbcolor) % Background color to be used for the scroll area % % /ItemTextColor (default 0 0 0 rgbcolor) % Default color to be used by ites in the scroll area. % % /ItemHighLightColor (default 0 0 0 rgbcolor) % When an item is selected the background behind the item is % filled with this color. The item it then draw with a default % color of 'BufferColor' % % /ItemLabel (default null) % A label used at the top of the item % % /ItemLabelFont (default Times-Roman.12) % The font used to display the item label % % /ItemLabelColor (default 0 0 0 rgbcolor) % The color used to display the item label % % /ShowItemSeperators (default false) % Should seperator lines be draw between items % in the scroll area. % % /ItemSpacing (default 4) % How much extra space should every item in the scroll % area be seperated by. % % /ItemBorderColor (default 0 0 0 rgbcolor) % Color of the item border. % % /ItemFillColor (default 1 1 1 rgbcolor) % Color to be used to fill scroll areas and item label. % % /ItemValue % Value of last item selected. (zero referenced) % Possible values for this variables may include 'null' % which would indicate that nothing has been selected or % 0-x indicating the item selected. % % /ItemValueArray % Array of items selected. This item ONLY exists if % 'AllowMultipleSelect?' is set true. Possible values for % elements of this array include 0 or 'null' indicating % that the item is not selected. A 1 indicates that the % item has been selected. % % For changes to the following variables to be seen a % /ShowObjectData call must be issued: % /BufferColor, /ItemTextColor, /ItemHighLightColor % /ShowItemSeperators, /ItemSpacing % % For changes to the following variables to be seen a % /ReshapeScrollbars or /reshape call must be issued: % /ItemLabel, /ItemLabelFont, /HScrollbar?, /VScrollbar? % % Example: % % % can is assumed to be a predefined canvas. % % /foo can {ItemValue (%\n) printf} /new ScrollDataItem send def % { % /AllowMultipleSelect? true def % /HScrollbar? false def % /BufferColor 1 1 0 rgbcolor def % /ItemTextColor 0 0 1 rgbcolor def % /ItemHighLightColor .7 .7 .7 rgbcolor def % /ItemLabel (This is a TEST []) def % /ItemLabelFont /Times-Bold findfont 24 scalefont def % /ItemLabelColor 1 0 0 rgbcolor def % % calling reshape here means we don't have to call /ReshapeScrollbars % 50 50 200 315 reshape % /ShowItemSeperators true def % } foo send % % /fooa [foo] def % /foom fooa forkitems def % fooa paintitems % % [ % (hello) % [(hello) 20 0 (there)] % [(hello small) /Times-Roman findfont 10 scalefont] % [(hello big) /Times-Bold findfont 30 scalefont] % % [(hello red) 1 0 0 rgbcolor] % % [(hello 1) /Times-Bold findfont 10 scalefont % (hello 2) /Times-Italic findfont 20 scalefont] % % [(hello 3) /Times-Bold findfont 10 scalefont % 20 20 % (hello 4) /Times-Italic findfont 20 scalefont] % [/boy1 /boy2] % [/horse5 0 1 0 rgbcolor] % ] /setdata foo send % % (padding) 30 /additem foo send % } def % % systemdict /SimpleScrollbar known not { (NeWS/liteitem.ps) run} if /PicScrollbar SimpleScrollbar % ptag= dictbegin /MouseInItem? false def /ScrollMonitor null def /ScrollProcess null def /ScrollDelay 1 60 div 20 div def % 1/10 second /LastX null def /LastY null def dictend classbegin /new { /new super send begin /ScrollMonitor createmonitor def currentdict end } def /StartItem { TrackInterests { exch pop /ClientData get begin /MyOwner /MyOwner GetFromCurrentEvent def end } forall /StartItem super send /maketrackinterests self send } def /ClientDown { % - => - CurrentEvent begin XLocation YLocation end /LastY exch def /LastX exch def SetScrollMotion /MouseInItem? true def HiliteItem DoScroll ScrollMonitor { ScrollProcess null ne { ScrollProcess killprocess } if /ScrollProcess { InteractiveScroll } fork def } monitor } def /InteractiveScroll { { ScrollDelay sleep ScrollMonitor { EventInItem? { DoScroll } if } monitor } loop } def /ClientUp { % - => - ScrollMonitor { ScrollProcess null ne { ScrollProcess killprocess } if /ScrollProcess null def } monitor /MouseInItem? false def UnhiliteItem ItemValue ItemInitialValue ne { NotifyUser % This is used when we are using this scroll bar in other items... % NOTE: If we are in the context of an event then the opperand % stack should look like: % |- EventMgrDict ... mark ... % If We are not in the context of an event the % 'GetFromCurrentEvent' will error out after pushing the % first object on the opperand stack onto the stack again. % This will result in pushing an extra mark onto the stack... % Look in 'GetFromCurrentEvent', 'CurrentEvent', % 'EventMgrDict'. /foobar count 1 sub index type /dicttype eq { mark { /Notify /MyOwner GetFromCurrentEvent send } stopped pop cleartomark } if pop } if } def /ClientDrag { % - => - CurrentEvent begin XLocation YLocation end /LastY exch def /LastX exch def CheckItem } def /PaintBar { } def /EraseBox { } def /PaintButtons { /PaintButtons super send } def /PaintBox { % - => - (paint box) gsave 10 dict begin /x 1 def /w ItemWidth 2 sub def % % fill in the whole bar % ItemFillColor setcolor x ButtonSize w ItemHeight ButtonSize dup add sub rectpath fill % % fill in the view_window bar % BarViewPercent 1 gt { .5 setgray x ButtonSize w ItemHeight ButtonSize dup add sub rectpath fill } { ItemValue BarMin sub BarMax BarMin sub div BarViewPercent mul /lower exch def /y ItemValue ValueToY def ItemHeight ButtonSize dup add BoxSize add sub dup lower mul /d exch def BarViewPercent mul /h exch def .5 setgray x y d sub w h BoxSize add rectpath fill } ifelse % % fill in the small scroll box % ItemValue BoxPath BoxFillColor setcolor gsave fill grestore ItemBorderColor setcolor eofill end /ItemPaintedValue ItemValue def grestore NotifyUser % This is used when we are using this scroll bar in other items... % NOTE: If we are in the context of an event then the opperand % stack should look like: % |- EventMgrDict ... mark ... % If We are not in the context of an event the % 'GetFromCurrentEvent' will error out after pushing the % first object on the opperand stack onto the stack again. % This will result in pushing an extra mark onto the stack... % Look in 'GetFromCurrentEvent', 'CurrentEvent', 'EventMgrDict'. /foobar count 1 sub index type /dicttype eq { mark { /Notify /MyOwner GetFromCurrentEvent send } stopped pop cleartomark } if pop } def /EventInItem? { % - => bool ScrollMotion { /ScrollAbsolute { false } /ScrollPageForward % top { LastX dup 0 ge exch ButtonSize le LastY ItemValue ValueToY ButtonSize add ge LastY ItemHeight ButtonSize sub le and and and } /ScrollPageBackward % bottom { LastX dup 0 ge exch ButtonSize le LastY ButtonSize ge LastY ItemValue ValueToY le and and and } /ScrollLineForward % top { LastX 0 ge LastX ButtonSize le LastY ItemHeight ButtonSize sub ge LastY ItemHeight le and and and } /ScrollLineBackward % bottom { LastX 0 ge LastX ButtonSize le LastY 0 ge LastY ButtonSize le and and and } } case } def /CheckItem { ScrollMotion { /ScrollAbsolute { DoScroll } /ScrollPageForward % top { /MouseInItem? EventInItem? def } /ScrollPageBackward % bottom { /MouseInItem? EventInItem? def } /ScrollLineForward % top { EventInItem? dup { MouseInItem? not { HiliteItem } if } { MouseInItem? { UnhiliteItem } if } ifelse /MouseInItem? exch def } /ScrollLineBackward % bottom { EventInItem? dup { MouseInItem? not { HiliteItem } if } { MouseInItem? { UnhiliteItem } if } ifelse /MouseInItem? exch def } } case } def /HiliteItem { ScrollMotion { /ScrollAbsolute { } /ScrollPageForward { } /ScrollPageBackward { } /ScrollLineForward % top { 0 ItemHeight ButtonSize ButtonSize neg rectpath 5 setrasteropcode fill } /ScrollLineBackward % bottom { 0 0 ButtonSize ButtonSize rectpath 5 setrasteropcode fill } } case } def /UnhiliteItem { gsave ScrollMotion { /ScrollAbsolute {} /ScrollPageForward {} /ScrollPageBackward {} /ScrollLineForward % top { 0 ItemHeight ButtonSize sub ButtonSize ButtonSize rectpath clip PaintButtons } /ScrollLineBackward % bottom { 0 0 ButtonSize ButtonSize rectpath clip PaintButtons } } case grestore } def classend def /ScrollRegionItem Item % ptag= dictbegin /BufferCanvas null def /BufferWidth 0 def /BufferHeight 0 def /HScrollbar null def /VScrollbar null def /HScrollbar? true def /VScrollbar? true def /HScrollWidth 0 def /VScrollWidth 0 def /ScrollWidth 16 def /ZoomFactor 1 def /LabelHeight 0 def % this gets set in 'ReshapeScrollbars'... dictend classbegin /ItemLabel null def /ItemLabelColor 0 0 0 rgbcolor def /ItemLabelFont /Times-Roman findfont 12 scalefont def % /fontoffset { % font => offset % dup fontheight exch /FontBBox get 0 get mul neg % } def /NotifyUserDown { % x y => - pop pop } def /NotifyUserUp { % x y => - pop pop } def /NotifyUserDrag { % x y => - pop pop } def /NotifyUserEnter { % x y => - pop pop } def /NotifyUserExit { % x y => - pop pop } def /new { % parentcanvas width height => instance /new super send begin /BufferHeight ItemHeight def /BufferWidth ItemWidth def CreateScrollbars CreateBuffer currentdict end } def /destroy { % HScrollbar null ne { % null /setowner HScrollbar send % } if % VScrollbar null ne { % null /setowner VScrollbar send % } if %% BufferCanvas /Mapped false put %% /BufferCanvas null def } def /setzoom { % zoomfactor => - /ZoomFactor exch def } def /reshape { % x y w h => - /reshape super send ReshapeScrollbars } def /reshapebuffer { % w h => - /BufferHeight exch def /BufferWidth exch def ReshapeBuffer ReshapeScrollbars } def /getcanvas { BufferCanvas } def /updatecanvas { PaintBuffer } def /makestartinterests { /makestartinterests HScrollbar send /makestartinterests VScrollbar send [ exch aload length 2 add -1 roll aload pop ] % join 2 arrays dup { /MyOwner self PutInEventMgrInterest } forall /makestartinterests super send [ exch aload length 2 add -1 roll aload pop ] % join 2 arrays } def /PaintItem { gsave PaintBuffer /paint VScrollbar send /paint HScrollbar send % paint the outline ItemCanvas setcanvas ItemBorderColor setcolor 0 HScrollWidth 1 add ItemWidth VScrollWidth sub ItemHeight HScrollWidth sub LabelHeight sub 1 sub rectpath stroke ItemLabel null ne { % paint the label area ItemFillColor setcolor 0 ItemHeight LabelHeight sub 2 sub ItemWidth LabelHeight 2 add rectpath fill % paint the label outline ItemBorderColor setcolor 0 ItemHeight LabelHeight sub 2 sub ItemWidth 1 sub LabelHeight 2 add rectpath stroke % paint the label text ItemLabelColor setcolor ItemLabelFont setfont ItemWidth ItemLabel stringwidth pop sub 2 div ItemHeight LabelHeight sub ItemLabelFont fontdescent add 1 sub moveto ItemLabel show } if grestore } def /Notify { % (picture got notified\n) [] dbgprintf NotifyUser PaintBuffer } def /PaintBuffer { % (PaintBuffer begin \n) [ ] dbgprintf gsave ItemCanvas setcanvas % % compute clipping region % 1 HScrollWidth 1 add ItemWidth VScrollWidth sub 2 sub LabelHeight 0 ne { ItemHeight HScrollWidth sub LabelHeight sub 4 sub } { ItemHeight HScrollWidth sub 2 sub } ifelse rectpath % (clip to % % % %\n) [ pathbbox ] dbgprintf clip % % Clear the item.... % /BufferColor where { pop BufferColor fillcanvas } if % % compute translation % BufferWidth ZoomFactor mul ItemWidth sub VScrollWidth add neg dup 0 lt { 1 /getvalue HScrollbar send sub mul } { pop 0 } ifelse BufferHeight ZoomFactor mul ItemHeight sub HScrollWidth add LabelHeight add neg dup 0 lt { 1 /getvalue VScrollbar send sub mul } { } ifelse HScrollWidth add % 2 copy (translate by % %\n) [ 4 2 roll ] dbgprintf translate BufferWidth BufferHeight % 2 copy (scale by % %\n) [ 4 2 roll ] dbgprintf scale ZoomFactor dup scale pause BufferCanvas imagecanvas pause grestore % (PaintBuffer end\n) [ ] dbgprintf } def /CreateBuffer { % - => - /BufferCanvas framebuffer newcanvas def BufferCanvas /Retained true put BufferCanvas /Opaque true put ReshapeBuffer } def /ReshapeBuffer { % - => - gsave framebuffer setcanvas 0 0 BufferWidth BufferHeight rectpath BufferCanvas reshapecanvas grestore } def /CreateScrollbars { % - => - % (begin CreateScrollbars\n) [] dbgprintf /HScrollWidth HScrollbar? { ScrollWidth } { 0 } ifelse def /VScrollWidth VScrollbar? { ScrollWidth } { 0 } ifelse def ItemWidth VScrollWidth le { /VScrollWidth ItemWidth 2 div def } if ItemHeight HScrollWidth le { /HScrollWidth ItemHeight 2 div def } if /HScrollbar [1 0 .01 .1 ItemWidth VScrollWidth sub BufferWidth div ] 1 {} ItemCanvas /new PicScrollbar send dup /BarVertical? false put def /VScrollbar [1 0 .01 .1 ItemHeight HScrollWidth sub BufferHeight div ] 0 {} ItemCanvas /new PicScrollbar send def % self /setowner HScrollbar send % self /setowner VScrollbar send % (end CreateScrollbars\n) [] dbgprintf } def /ReshapeScrollbars { /HScrollWidth HScrollbar? { ScrollWidth } { 0 } ifelse def /VScrollWidth VScrollbar? { ScrollWidth } { 0 } ifelse def /LabelHeight ItemLabelFont null ne ItemLabel null ne and {ItemLabelFont fontheight} {0} ifelse def ItemWidth VScrollWidth le { /VScrollWidth ItemWidth 2 div def } if ItemHeight HScrollWidth le { /HScrollWidth ItemHeight 2 div def } if ItemHeight LabelHeight HScrollWidth add le { /LabelHeight ItemHeight 4 div def } if 10 dict begin /h ItemHeight def /w ItemWidth def [1 0 .01 .1 ItemWidth VScrollWidth sub BufferWidth div ] /setrange HScrollbar send [1 0 .01 .1 ItemHeight HScrollWidth sub LabelHeight sub BufferHeight div ] /setrange VScrollbar send HScrollbar? { 0 0 w VScrollWidth sub HScrollWidth } { 0 0 0 0 } ifelse % 4 copy (hscroll % % % %\n) [ 6 2 roll ] dbgprintf /reshape HScrollbar send LabelHeight 0 ne { VScrollbar? { w VScrollWidth sub HScrollWidth VScrollWidth h HScrollWidth sub LabelHeight sub 2 sub} { 0 0 0 0 } ifelse } { VScrollbar? { w VScrollWidth sub HScrollWidth VScrollWidth h HScrollWidth sub} { 0 0 0 0 } ifelse } ifelse % 4 copy (vscroll % % % %\n) [ 6 2 roll ] dbgprintf end /reshape VScrollbar send } def /ClientDown { % (Picture ClientDown\n) [] dbgprintf % compute translation % BufferWidth ZoomFactor mul ItemWidth sub VScrollWidth add neg dup 0 lt { 1 /getvalue HScrollbar send sub mul } { pop 0 } ifelse BufferHeight ZoomFactor mul ItemHeight sub HScrollWidth add LabelHeight add neg dup 0 lt { 1 /getvalue VScrollbar send sub mul } { } ifelse HScrollWidth add % translatex translatey CurrentEvent /YLocation get sub neg exch CurrentEvent /XLocation get sub neg exch 2 copy /tmpy exch def /tmpx exch def % tmpx tmpy (tmpx % tmpy %\n) printf % (n: % %\n) [ tmpx tmpy ] dbgprintf { /NotifyUserDown self send } fork } def /ClientUp { % (Picture ClientUp\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserUp self send } def /ClientDrag { % (client drag\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserDrag self send } def /ClientEnter { %% (client enter\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserEnter self send } def /ClientExit { %% (client exit\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserExit self send } def classend def /ScrollDataItem ScrollRegionItem % ptag= dictbegin /ObjectData [] def /ObjectSizes [] def /ObjectOffsets [] def /LocalUserNotify {} def /NumItems 0 def /LastSelect null def /ItemValueArray [] def dictend classbegin % Class variables /BufferColor 1 1 1 rgbcolor def /AllowMultipleSelect? false def /ItemHighLightColor 0 0 0 rgbcolor def /ItemSpacing 4 def /ShowItemSeperators false def % Methods /new { % parent_canvas notify => instence exch 1 1 /new super send begin /LocalUserNotify exch def currentdict end } def /setdata { % array => - /ObjectData exch def /SizeAllData self send 450 exch /reshapebuffer self send AllowMultipleSelect? { /DeclareItemValueArray self send } { /LastSelect null def } ifelse /ShowObjectData self send } def /getdata { % - => array ObjectData } def % if item_number is out of bounds for the data then % the command will be ignored.. % item_number is zero referenced. /deleteitem { % item_number => - 10 dict begin /foo exch def /fool ObjectData length def foo 0 lt foo fool ge or not { % delete an item out of the ObjectData array /fooa fool 1 sub array def ObjectData 0 foo getinterval fooa copy pop ObjectData foo 1 add fool foo sub 1 sub getinterval fooa exch foo exch putinterval currentdict fooa end /ObjectData exch def begin % delete an item out of the ItemValueArray array AllowMultipleSelect? { /fooa fool 1 sub array def ItemValueArray 0 foo getinterval fooa copy pop ItemValueArray foo 1 add fool foo sub 1 sub getinterval fooa exch foo exch putinterval currentdict fooa end /ItemValueArray exch def begin } { ItemValue foo eq { /ItemValue null store /LastSelect null store } if } ifelse end /SizeAllData self send 450 exch /reshapebuffer self send /ShowObjectData self send } { end } ifelse } def % add an item to the list % if we are adding past the end of the list then we expand % the list with empty strings to add the item. % item_number is zero referenced. % This is all very convluted code put hopefully we can deal with % anysized array. We should never load the array in part or in % in whole onto the operand stack... /additem { % item_label item_number => - 10 dict begin % some helpfull constants /foon exch def /fooi exch def /fool ObjectData length def % if we are out of bounds then don't do anything foon 0 lt not { % check to see if we need to extend the array with % null strings. foon fool gt { /fooa foon array def ObjectData fooa copy pop currentdict fooa end /ObjectData exch def begin /fool foon def AllowMultipleSelect? { /fooa foon array def ItemValueArray fooa copy pop currentdict fooa end /ItemValueArray exch def begin } if } if % if we are inserting before the first element after % the end of the list then just append to the list foon fool eq { % append to list /fooa fool 1 add array def ObjectData fooa copy pop fooa fool fooi put currentdict fooa end /ObjectData exch def begin AllowMultipleSelect? { /fooa fool 1 add array def ItemValueArray fooa copy pop currentdict fooa end /ItemValueArray exch def begin } if } { % move the list down and insert an item. /fooa fool 1 add array def ObjectData 0 foon getinterval fooa copy pop ObjectData foon fool foon sub getinterval fooa exch foon 1 add exch putinterval fooa foon fooi put currentdict fooa end /ObjectData exch def begin AllowMultipleSelect? { /fooa fool 1 add array def ItemValueArray 0 foon getinterval fooa copy pop ItemValueArray foon fool foon sub getinterval fooa exch foon 1 add exch putinterval currentdict fooa end /ItemValueArray exch def begin } if } ifelse end /SizeAllData self send 450 exch /reshapebuffer self send /ShowObjectData self send } { end } ifelse } def % Change an item.. % If item does not allready exist then add it.. % If item was selected is will remain selected.. /changeitem { % item_label item_number => - 10 dict begin /foon exch def /fooi exch def /fool ObjectData length def % are we out of bounds? foon 0 ge { % should we call additem? foon fool ge { % call additem. fooi foon end /additem self send } { % just change the item ObjectData foon fooi put end /SizeAllData self send 450 exch /reshapebuffer self send /ShowObjectData self send } ifelse } { end } ifelse } def /DeclareItemValueArray { % - => - /ItemValueArray ObjectData length array def ObjectData length 0 ne { 0 1 ObjectData length 1 sub { ItemValueArray exch 0 put } for } if } def /SizeAllData { % - => total_size /ObjectSizes ObjectData length array def /ObjectOffsets ObjectData length array def 10 dict begin /t ItemSpacing def ObjectData length 0 ne { gsave ItemFont setfont ObjectData length 1 sub -1 0 { /i exch def ObjectOffsets i t put ObjectData i get /ThingSize self send exch pop dup ObjectSizes i 3 -1 roll put t add ItemSpacing add /t exch def } for grestore } if t end } def /ShowObjectData { % - => - gsave % First we are going to fix up the buffer. % set up the defaults BufferCanvas setcanvas BufferColor fillcanvas ItemTextColor setcolor ItemFont setfont % loop over all the data items writing them out ObjectData length 0 ne { 0 1 ObjectData length 1 sub { PutItemText } for } if % go through and hilight those items that have been % selected. AllowMultipleSelect? { % Redraw all the multiple selected stuff. % Are the arrays the same length and are they % none zero. This is a sanity check. ItemValueArray length ObjectData length eq ObjectData length 0 ne and { % Loop over all the items finding highlighed % items and redrawing them. 10 dict begin 0 1 ObjectData length 1 sub { /i exch def ItemValueArray i get 1 eq { ItemHighLightColor setcolor i FillItemBox BufferColor setcolor i PutItemText } if } for end } if } { % Redraw the single highlighted item. LastSelect null ne { ItemHighLightColor setcolor LastSelect FillItemBox BufferColor setcolor LastSelect PutItemText } if } ifelse grestore % Now that we are finished with the buffer paint the % the buffer and the items as a whole onto the canvas. /PaintItem self send } def /ShowThingDict 20 dict dup begin /fonttype {setfont dup type exec} def /colortype {setcolor dup type exec} def /integertype {rmoveto dup type exec} def /realtype {rmoveto dup type exec} def /stringtype { 0 currentfont fontdescent rmoveto show 0 currentfont fontdescent neg rmoveto dup type exec } def /nametype { gsave iconfont setfont icondict exch get cvis dup show stringbbox 4 2 roll pop pop pop grestore 0 rmoveto dup type exec } def /arraytype { dup xcheck { /paint exch exec dup type exec } { aload pop dup type exec } ifelse } def /dicttype {/paint exch send dup type exec} def /marktype { pop } def /nulltype { pop dup type exec} def end def /ShowThing { % object => - gsave ShowThingDict begin mark exch dup type exec end grestore } def /ThingSizeDict 20 dict dup begin /x 0 def /y 0 def /mx 0 def /my 0 def /fonttype {setfont dup type exec} def % /colortype {setcolor dup type exec} def % color shouldn't affect size. /colortype {pop dup type exec} def /integertype { y exch add /y exch def y my gt { /my y def } if x exch add /x exch def x mx gt { /mx x def } if dup type exec } def /realtype { y exch add /y exch def y my gt { /my y def } if x exch add /x exch def x mx gt { /mx x def } if dup type exec } def /stringtype { stringwidth pop x exch add /x exch def x mx gt { /mx x def } if currentfont fontheight y exch add dup my gt { /my exch def } { pop } ifelse dup type exec } def /nametype { gsave iconfont setfont icondict exch get cvis stringbbox % x y w h y exch add % x y w y+h 3 -1 roll % x w y+h y neg dup % x w y+h -y -y 3 1 roll add % x w -y y+h+(-y) 1 add dup my gt { /my exch def } { pop } ifelse y exch add /y exch def x exch add % ... x x+w exch neg add % ... x+w+(-x) /x exch def x mx gt { /mx x def } if grestore dup type exec } def /arraytype { dup xcheck { % x y /size => x y mx my x y /size 4 -1 roll exec /my exch def /mx exch def /y exch def /x exch def dup type exec } { aload pop dup type exec } ifelse } def /dicttype { % x y /size => x y mx my x y /size 4 -1 roll send /my exch def /mx exch def /y exch def /x exch def dup type exec } def /marktype { pop } def /nulltype { pop dup type exec} def end def /ThingSize { % object => xoff yoff gsave ThingSizeDict begin /x 0 def /y 0 def /mx 0 def /my 0 def mark exch dup type exec mx my end grestore } def /PutItemText { % item_number => - dup ObjectOffsets exch get 5 exch moveto dup ObjectData exch get /ShowThing self send ShowItemSeperators { ObjectOffsets exch get 0 exch ItemSpacing 2 div sub moveto 450 0 rlineto stroke } { pop } ifelse } def /FillItemBox { % item_number => - dup ObjectOffsets exch get 0 exch ItemSpacing 2 div sub 1 sub moveto 450 0 rlineto ObjectSizes exch get 0 exch ItemSpacing add rlineto -450 0 rlineto closepath fill } def /NotifyUserDown { % x y => - gsave /FindItem self send BufferCanvas setcanvas ItemFont setfont AllowMultipleSelect? not { LastSelect null ne { BufferColor setcolor LastSelect FillItemBox ItemTextColor setcolor LastSelect PutItemText } if dup LastSelect eq { pop /LastSelect null def /ItemValue null def } { dup /LastSelect exch def /ItemValue exch def ItemValue null ne { ItemHighLightColor setcolor ItemValue FillItemBox BufferColor setcolor ItemValue PutItemText } if } ifelse } { /ItemValue exch def ItemValue null ne { ItemValueArray ItemValue get 1 eq { BufferColor setcolor ItemValue FillItemBox ItemTextColor setcolor ItemValue PutItemText ItemValueArray ItemValue 0 put } { % 0 BufferHeight ItemValue 1 add 18 mul sub % 3 sub 450 18 rectpath ItemHighLightColor setcolor ItemValue FillItemBox BufferColor setcolor ItemValue PutItemText ItemValueArray ItemValue 1 put } ifelse } if } ifelse grestore /updatecanvas self send /LocalUserNotify self send } def /FindItem { % x y => item_number 10 dict begin exch pop /y exch def y 0 lt y BufferHeight gt or not ObjectData length 0 gt and { /a null def 0 1 ObjectData length 1 sub { /i exch def ObjectOffsets i get y le { /a i def exit } if } for a } { null } ifelse end } def classend def From don Thu Nov 9 15:59:25 1989 Date: Thu, 9 Nov 89 15:59:25 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Flickering canvases From: eru!luth!sunic!ifi!m2cs.uu.no!tomas@bloom-beacon.mit.edu (Tomas Felner) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) msc@ramoth.esd.sgi.com (Mark Callow) writes: >In article <1989Nov6.111754.11056@m2cs.uu.no>, tomas@m2cs.uu.no (Tomas >Felner) writes: >> I have a problem with moving canvases that has been bothering me for >> quite some time. The basic situation is as follows: I have a canvas >> ontop of which I have another canvas, on top of which another one, etc. I >> have code to grab one of those canvases with the mouse and move them around. >> All the canvases on top of the grabbed canvas are then moved together >> with the grabbed one. When moving this "stack of canvases" the moving of >> the bottommost canvas goes smoothly, but all the canvases on top of it >> flicker like crazy! This effect appears with any stack of canvases and >> with an arbitray number of canvases on top of the bottom canvas. >You don't say what version of NeWS you are running... Sorry, it's NeWS 1.1 on a Sun 3/50. >In NeWS 1.1 (and 4Sight) when you move a canvas containing opaque children, >the opaque children are unmapped while the canvas is moved then remapped. >This may be the cause of your flickering. The unmapping was done to ensure >that some obscure case involving retained canvases and save unders would >work correctly. I believe Sun found this to be unnecessary so NeWS 2.0 >(X11/NeWS) doesn't unmap the canvases anymore. Is there any way to avoid this mapping/unmapping under NeWS 1.1 or does anyone have a good solution for this. I haven't ported my stuff to X11/NeWS yet, but if it works there, I guess I have to look into it (I have to do it anyway sooner or later). Tomas -- Tomas Felner Modula-2 CASE Systems AS | Internet: tomas@m2cs.uu.no Maridalsveien 139 | Phone: +47 2 379784 N-0461 Oslo 4, Norway | FAX: +47 2 356448 From don Thu Nov 9 16:00:03 1989 Date: Thu, 9 Nov 89 16:00:03 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: another machine for your student From: Kemp@DOCKMASTER.ARPA Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In response to: >> Besides, these things [SPARCstation-1's] are pretty expensive. Greg Earle replies: > Naahhh. A diskless SPARCstation-1, especially monochrome, is hardly > expensive. Since you work for a government institute, NCI probably > gets the standard Sun Government discount, which means SPARCstation-1's > cost almost nothing. That used to be true. I just found out that our Government discount has been cut almost in half. That's not to say they aren't still a great deal, it's just that their cost is a little farther from nothing than it was before. Our standard unit of currency is the SS-1 now. For example, a particular software package that used to cost $xx,xxx now costs 2.5 SS-1's. Any software that is less than 1 SS-1 is relatively easy to justify; anything more than that had better be pretty d*mn good if we are going to deprive an engineer or two of a desktop workstation in order to buy it. Dave Kemp From don Fri Nov 10 16:59:27 1989 Date: Fri, 10 Nov 89 16:59:27 -0500 To: NeWS-makers@brillig.umd.edu Subject: Nasty Bugs in X11/NeWS From: korp@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There appears to be a nasty bug in X11/NeWS. If you setcanvas to some canvas, translate, create a path and then attempt to fill the path, the whole canvas gets filled. Stroke also is affected, but not as often as fill. Several programs seem to fail with this bug. Is there a workaround? When will this be fixed. I use a 4/260 with 110Mb of swap space, when I ask for a retained canvas that is 900x900 I don't get it. I know asking for a retained canvas is only supposed to be a hint, but my machine has more than enough space to store this canvas. How does the X11/NeWS server decide when to grant retained canvases? Peter Argonne National Laboratory korp@athens.ees.anl.gov From don Sat Nov 11 18:55:23 1989 Date: Sat, 11 Nov 89 18:55:23 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Nasty Bugs in X11/NeWS From: Rafael Bracho Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Regarding your comment: >There appears to be a nasty bug in X11/NeWS. If you setcanvas to >some canvas, translate, create a path and then attempt to fill the >path, the whole canvas gets filled. Stroke also is affected, but >not as often as fill. Several programs seem to fail with this bug. I'm probably confused but the following code works just as you expect under X11/NeWS (my input is marked with '>'): plutionium- psh >executive Welcome to X11/NeWS Version 1.0 >framebuffer newcanvas >gsave >framebuffer setcanvas >50 50 translate >0 0 100 100 rectpath >dup reshapecanvas >stack canvas(0x491ad0,100x100,unmapped) >grestore >setcanvas >currentcanvas /Mapped true put >black setcolor >0 0 100 100 rectpath fill >white setcolor >20 20 translate >0 0 30 30 rectpath fill >currentcanvas /Mapped false put >grestore >quit psh: NeWS server disconnected plutonium- Am I missing something? Rafael Bracho rxb@asc.slb.com From don Sat Nov 11 19:01:11 1989 Date: Sat, 11 Nov 89 19:01:11 -0500 To: NeWS-makers@brillig.umd.edu Subject: 1990 NFS/X11/NeWS Connectathon From: boutique!lhatt@sun.com (Linda Hatt) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The following is a call for participation in Connectathon 1990. Connectathon is an interconnectivity testing event intended as an engineering test of NFS, X11 and NeWS implementations. If you have an implementation that you would like to test at Connectathon, please follow the instructions below. Linda Cwiak Connectathon 1990 Coordinator ------------------------------------------------------------------------ Dear NFS, X11 and NeWS vendor: Connectathon is starting to sizzle the network for the year 1990!! You are invited to participate. Connectathon is a networking proving ground allowing participating vendors an opportunity to test their NFS, X11, and NeWS Client and Server implementations. In one convenient location you will be linking together with other vendors' workstations, personal computers, supercomputers, mainframes, and minicomputers, sharing resources and files over local- and wide-area networks. Each vendor sends its development engineers, with machines and source code, to test and debug their implementations. The past Connectathon hosted more than 65 vendors, and we expect a record turnout this year. Why? Let me tell you about one of last year's participants. He told us that he got more accomplished during seven days of Connectathon than he could have in several years in his office. This year, we are expecting a significant increase in the number of Window application vendors. Connectathon 1990 will also introduce an FDDI fiber backbone and testing of NFS over ISO/OSI transport protocols. As in previous years, there will be seminars with guest speakers addressing issues in NFS, X11 and NeWS technologies. Your marketing staff, press relations personnel, and customers may attend the Press Day/Open House on the last day of testing - Wednesday, February 21, 1990. The Press Day is a good opportunity to promote your company's NFS or Windows implementation. Except for this day, the entire event is for development engineers only. General Connectathon Information: o Connectathon will be held at the San Mateo Expo Center in San Mateo, CA from February 7-21, 1990. Testing continues 24 hours a day. o To provide space, electrical, and security resources to you, Connectathon will charge separately for space and for your implementation. This year you can pay by check, purchase order, VISA or MasterCard. These fees are Non-Refundable. o Registration deadline is DECEMBER 15, 1989. We have enclosed a registration form that must be completed and returned with your payment to Connectathon 1990 Headquarters (150 Post Street, Suite 405, San Francisco, CA 94108). Please submit a seperate registration form for each implementation. o Once we have received your 4-page registration form, along with payment, we will send you a confirmation packet with your booth number, shipping instructions, nearby hotels, and a more detailed calendar of Connectathon 1990 events. If you have any questions regarding Connectathon, contact Linda Cwiak of Sun Microsystems at 415-336-4717 or send email to cthon@sun.com. We look forward to seeing you at Connectathon 1990! Sincerely, Larry Garlick Vice President, Distributed Systems Sun Microsystems, Inc. Helpful information when filling out the Connectathon 1990 registration form: 1. The company name and implementation name are used to identify each implementation for tracking purposes. An implementation is the entity which is being tested. The name is usually a description of a platform, such as an OS or hardware name. The implementation is further identified as NFS, X11, NeWS, or NFS over OSI. For example, if you are a computer vendor who ships two different operating systems, you might have 3 implementations to test: NFS on OS/A, NFS on OS/B and X11 on OS/B. Each needs a separate registration form. There is a $750.00 charge for each implementation you plan to test. The primary contact listed on the form is the person to whom the confirmation packet will be sent and the person we will call if we have questions about your registration. Our Press Relations department would like to know who to contact at your company in Press Relations to plan the Press Day. 2. If you are sharing another implementation's booth check "no" and put the name of the company and implementation that you are sharing space with. Make sure the implementation that you are sharing a booth with has reserved and paid for a booth. In other words, if you are filling out a second registration form for your second implementation and you want to use the same booth for both, you do not need to fill in the booth information again. We have 3 booth configurations this year: small (approx. 35 sq. ft.), medium (approx 70 sq. ft.) and large (approx 105 sq. ft.). Each booth includes a specific amount of space, electricity and Ethernet connections. In the brackets preceding the booth size put the number of each size booth that you require and write the dollar amount in on page 2. (tables are 6' by 3') If you need additional electrical power, call Linda Cwiak at (415) 336-4717 and let her know what you require. She will give you ordering and cost information to include on your registration form. We would prefer you order additional electrical instead of getting a larger booth to accommodate your electrical needs. You may also call the same number to get information about costs and ordering of a personal phone line or T1 line in your booth. 3. Cabletron will provide transceivers for every Ethernet connection. We need to know what kind of transceiver to reserve for you, thick or thin Ethernet. Some companies bring more than one machine to test a given implementation. Please indicate how many machines you will have actually testing this implementation (do not include network analyzers or machines that you may bring to do development on). Please indicate whether your implementation is client-only, server-only, or client/server. We need to know approximately what day your machines will be installed (not the delivery day). Then indicate whether your delivery will be via professional carriers (trucking line or air cargo) or you will bring it in yourself. If you are delivering via a carrier, trucks can arrive Monday, Feb. 5 and Tuesday, Feb. 6 from 9:00am to 4:00pm and Wednesday, Feb. 7 from 9:00am to 12:00pm. These will be the only times trucks can arrive. If you plan to deliver your own equipment and it is too heavy to carry, you will need to bring it in at the times listed above. If it is light enough to hand carry, you can carry your machines in up until Feb. 13. You will not be able to use any type of cart with wheels. 4. Will an other implementation share the space in this booth? If so, please put the company/implementation name here. 5. & 6. During stage 2 of Connectathon, there will be a series of talks and discussions in an informal setting. Many of these talks will be given by Sun engineers on upcoming product or future directions. If you are interested in presenting a talk or leading a discussion on NFS, X11 or NeWS technology, list the title of the talk here. Someone will contact you with more details. 7. Implementation fee: $750.00 per implementation (fill one form out per implementation). Booth fee: Depends on the size of booth you chose (if you checked "no", leave this line blank.) Extra electrical fee: If you require extra electrical please call Linda Cwiak at (415) 336-4717 for the cost. Total amount: Add up the above amounts to determine your payment for this implementation. Pages 3 & 4 of the forms are self explanatory. Once we have received your registration forms along with payment, we will send you a confirmation packet. The confirmation packet will have your booth number, shipping instructions, nearby hotels, a more detailed calendar of Connectathon 1990. Connectathon 1990 Registration Form Return completed forms to: FILL OUT ONE FORM PER IMPLEMENTATION Connectathon 1990 Headquarters DEADLINE DECEMBER 15, 1989 150 Post Street Suite 405 San Francisco, CA 94108 FAX number: 415-986-8551 1. Full company name:_______________________ Identifying name for implementation: _________________________ (i.e., VMS, User-level, SVR4) [] NFS [] NeWS [] X11 [] NFS over OSI Primary contact for Connectathon Participation: _____________________ Mailing address: _________________________________ _________________________________ Phone number: _________________________________ Fax number: _________________________________ Electronic mail address: _________________________ Press Relations contact: ________________________________________ Phone number: __________________________________ 2. Do you need a booth ? ( If you already reserved a booth on a separate form, check "no" and skip to step 5. Only fill in the booth information again if you need an additional booth. Please note: Booth space is assigned on a first come, first served basis. [ ] No. This implementation will be tested in another booth, registered under the following: Company name: _____________________________ Name of implementation: _______________________ [ ] NFS [ ] NeWS [ ] X11 [ ] NFS over OSI [ ] Yes. I prefer the following booth size: [ ] Small -- Includes Approximately 35 sq ft with 1 table 1 Ethernet drop 4 outlets (20 amp total) Cost: $500.00 [ ] Medium -- Includes Approximately 70 sq ft with 2 tables 2 Ethernet drops 8 outelets (40 amp total) [ ] 1 220 V circuit or [ ] 4 addtl outlets (20 amp total) Cost: $1,000.00 [ ] Large -- Includes Approximately 105 sq ft with 3 tables 3 Ethernet drops 12 outlets (60 amp total) [ ] 1 220 V circuit or [ ] 4 addtl outlets (20 amp total) 1 custom circuit specify: ________________ Cost: $1,500.00 If you have different electrical requirements than those in your booth choice, or you would like a personal phone line or T1 line installed in your booth, please call Linda Cwiak at (415) 336-4717 for cost and ordering information. Connectathon 1990 Registration Form (page 2) 3. What type of Ethernet will you need? [ ] Thick [ ] Thin Number of machines that will actually be testing: ____________ Type of implementation: [ ] Client and Server [ ] Client Only [ ] Server Only Approximate installation date (between Feb. 7-13) _______________ Are you going to [ ] Ship or [ ] Hand deliver your machines? Name of shipping company? __________________________ 4. Will any other implementation be tested in this booth? [] yes []no If yes, name of company: ________________________________ Name of implementation: _________________________________ [ ] NFS [ ] NeWS [ ] X11 [ ] NFS over OSI 5. Would you like to give an informal presentation or lead a discussion about [ ] NFS [ ] X11 [ ] NeWS technology Please indicate topic and/or title _______________________________ __________________________________________________________________ 6. What topic would you like Sun engineers to address in informal seminars? ___________________________________________________________________ ___________________________________________________________________ 7. Implementation fee: $750.00 Booth fee (if any): $______________(enter 0 if sharing another implementation's booth) Extra electrical fee $______________(if you need extra electrical contact Linda Cwiak at 415-336-4717) TOTAL AMOUNT: $______________ Method of payment: [] check [] MasterCard [] Purchase Order [] VISA credit card number: ________________________ expiration date_________ Name:____________________________ Signature__________________________ Connectathon 1990 Registration Form (page 3) Connectathon 1990 Attendee Form Company Name:____________________________________________ Implementation Name:_____________________________________ [] NFS [] X11 [] NeWS [] NFS over OSI Full names and titles of engineers who will be testing and fixing bugs on this implementation. This should be development egineers for the implementation being tested. Limit four per implementation. Name Title 1.___________________________ ___________________________ 2.___________________________ ___________________________ 3.___________________________ ___________________________ 4.___________________________ ___________________________ Full names and titles of field service technicians who may by installing equipment 2/7-2/13. Limit two per implementation. Name Title 1.___________________________ ____________________________ 2.___________________________ ____________________________ Full names and titles of marketing representatives who will be attending on February 21, the Open House Day. No limit. Name Title 1.___________________________ ____________________________ 2.___________________________ ____________________________ 3.___________________________ ____________________________ 4.___________________________ ____________________________ Full names and titles of press relations personnel who will be attendint the Press Event on February 21. No limit. Name Title 1.___________________________ _____________________________ 2.___________________________ _____________________________ 3.___________________________ _____________________________ 4.___________________________ _____________________________ Connectathon 1990 Registration Form (page 4) Booth Identification Sign: Company name:______________________________ Implementation name:_______________________ [] NFS [] X11 [] NeWS [] NFS over OSI Each booth will be supplied with a standard booth sign showing the participants' company name. Please type your company name exactly the way that you want it to appear on your booth sign. --------------------------------------------------- | | | | | | --------------------------------------------------- From don Sat Nov 11 19:01:29 1989 Date: Sat, 11 Nov 89 19:01:29 -0500 To: NeWS-makers@brillig.umd.edu Subject: Don Hopkins PSIberspace - where can I get it? From: mcsun!ukc!strath-cs!cs.glasgow.ac.uk!cathy@uunet.uu.net (Catherine Anne Wood) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have heard wonderful things about Don Hopkins NeWS debugger, PSIberspace. Has this been posted to the network? I have a collection of other great stuff he has posted - it seems I may have missed this one. Is it public domain - if so where do I get it?. A NeWS debugger I could definately use. Thanks, Cathy. -- ARPANet: cathy%cs.glasgow.ac.uk@nsfnet-relay.ac.uk JANET: cathy@uk.ac.glasgow.cs UseNet: mcvax!ukc!cs.glasgow.ac.uk!cathy Mail: Cathy Wood, Computer Science, 17 Lilybank Gardens, GB-GLASGOW G12 8QQ : 041 339-8855 ext 6040 From don Sat Nov 11 19:02:04 1989 Date: Sat, 11 Nov 89 19:02:04 -0500 To: NeWS-makers@brillig.umd.edu Subject: Affordable NeWS From: ficc!peter@uunet.uu.net (Peter da Silva) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I asked this in comp.windows.misc, and was redirected to this group. I have become infatuated with the idea of running NeWS on *something*. Unfortunately, I can't afford much hardware. Is there any way to get a useful NeWS implementation on a commodity computer? Useful: running under MS-DOS or MacOS doesn't count, because the underlying environment is too poor. A server only system doesn't count, because I need a client as well. Commodity computer: Costs less than the downpayment on a family car... i.e., you don't need a secured loan to afford one. That writes off anything from Sun, for example. -- `-_-' Peter da Silva . 'U` -------------- +1 713 274 5180. "*Real* wizards don't whine about how they paid their dues" -- Quentin Johnson quent@atanasoff.cs.iastate.edu From don Tue Nov 14 06:08:13 1989 Date: Tue, 14 Nov 89 06:08:13 -0500 To: NeWS-makers@brillig.umd.edu Subject: Don Hopkins PSIberspace - where can I get it? From: don (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The current version of the PSIBER Space Deck is available via anonymous ftp from tumtum.cs.umd.edu, in the file "NeWS/cyber.shar.Z". (It's also in news-tape/utilities/cyber directory if you get "NeWS/news-tape.tar.Z".) I'm going to test it out under X11/NeWS FCS, and post the whole thing, as well as a paper about it, right after the Usenix Monterey Graphics Workshop, where I'm presenting the paper and a video tape on November 17. It's kinda big (especially the illustrations in the paper), so I want to make sure the version I post will work for everybody else. I hope to see some of y'all at the conference! -Don From don Mon Nov 20 02:48:13 1989 Date: Mon, 20 Nov 89 02:48:13 -0500 To: NeWS-makers@brillig.umd.edu Subject: Express followup From: zawada@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I recently sent a quick-launch facility called Express to NeWS-makers. Due to file size limitations, however, the message was not delivered to some sites. If you have not received Express and would like to, it is available via anonymous ftp from tumtum.cs.umd.edu (128.8.128.49). For those of you without anonymous ftp access, let me know and I will send you the individual files. Dave Zawada zawada@athens.ees.anl.gov From don Mon Nov 20 02:48:33 1989 Date: Mon, 20 Nov 89 02:48:33 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Don Hopkins PSIberspace - where can I get it? From: philmtl!philabs!ppgbms!pablo@uunet.uu.net (Pablo Gonzalez) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <3724@epi.cs.glasgow.ac.uk>, cathy@cs.glasgow.ac.uk (Catherine Anne Wood) writes: > > > I have heard wonderful things about Don Hopkins NeWS debugger, > PSIberspace. Has this been posted to the network? I have a > collection of other great stuff he has posted - it seems I may > have missed this one. > > Is it public domain - if so where do I get it?. A NeWS debugger > I could definately use. > > A GOOD NeWS debugger is definitely something that is lacking in our shop (and probably in most of the NeWS development community). I would also appreciate any information on how/where I can get a copy of PSIberspace. Thanks, Pablo Gonzalez One Campus Drive Pleasantville, N.Y. 10570 (914) 741-4626 path ppgbms!moe!pablo@philabs.phillips.com From don Mon Nov 20 02:48:59 1989 Date: Mon, 20 Nov 89 02:48:59 -0500 To: NeWS-makers@brillig.umd.edu Subject: getting NeWS/X11 for universities From: root@sbcs.sunysb.edu (Systems Staff) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Ok, we've been had. According to our local sales rep news/x11 merge is "on hold", but clearly other people in this newsgroup seem to have it. What is the trick? I have access to the stuff through a local company I consult with, but would like to arrange access for the university. Who do I call and what will it cost? What other goodies are available, eg OpenLook, interface builders, etc? Rick Spanbauer State U of NY/Stony Brook From don Mon Nov 20 02:49:20 1989 Date: Mon, 20 Nov 89 02:49:20 -0500 To: NeWS-makers@brillig.umd.edu Subject: xnews and X -- input focus problem From: news@bellcore.com (news) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Apologies if this has been answered before, but... I'm using "OpenWindows(tm) 1.0". I'm prevented from running xnews full-time by the following problem: I can't get keyboard information to some Xt applications. The two applications both respond fine to mouse input, but this is not sufficient. One of them is the "xdvi" program -- if that helps. The applications and the server are running on the same Sun-4 running 4.0.3c. Both applications use the Athena Widget set. The keyboard input gets sent to the window the X application was started from, by the way. Thanks for any suggestions.... Nat Howard nrh@bellcore.com From don Mon Nov 20 02:52:11 1989 Date: Mon, 20 Nov 89 02:52:11 -0500 To: NeWS-makers@brillig.umd.edu Subject: Do transparent canvases receive damage events? From: mips!prls!philabs!ppgbms!pablo@apple.com (Pablo Gonzalez) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Is it correct to say that if a canvas is transparent, it will never receive damage events? We are currently running NeWS 1.1. In the code that I have written, it appears that if the canvas is transparent NeWS will not generate damage events for it. Is this true in X11/NeWS? or is it a bug in NeWS 1.1 that X11/NeWS has fixed? I am posing this question because I do not recall reading anything in the NeWS 1.1 reference manual that explicitly states that transparent canvases do not receive damage events. Thanks, Pablo Gonzalez One Campus Drive Pleasantville, N.Y. 10570 (914) 741-4626 path ppgbms!moe!pablo@philabs.phillips.com From don Mon Nov 20 02:52:18 1989 Date: Mon, 20 Nov 89 02:52:18 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: xnews and X -- input focus problem From: crdgw1!montnaro@uunet.uu.net (Skip Montanaro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The incompatibility between X/NeWS (with its ICCCM-compliant window manager and toolkit) and older X applications is getting rather well-known these days. Another person here at GE CRD just posted a note about this problem to comp.windows.x. I've reproduced it below. Placing "*Input: true" in .Xdefaults worked for me, at least it cured xdvi's problems. I haven't had the opportunity to try other applications yet. Apparently Phil tried xfig, xdbx, and xman, however. From shaffer@athena.crd.ge.com Wed Nov 15 17:13:12 1989 Organization: General Electric Corp. R&D, Schenectady, NY From: shaffer@athena.crd.ge.com Subject: Re: Has anyone fixed xfig and xdbx to work with Open Windows? Date: 15 Nov 89 17:37:30 GMT A couple of days ago I posted this query. I got one response which didn't answer the question, but a couple of other messages posted gave me the information to do what I wanted. There are two ways: 1) Fixes the problem in general (works for xfig, xdbx, and xman, at least): add to your ~/.Xdefaults file the line: *Input: true and restart xnews. 2) Patch the source code for xfig and xdbx (I tried xman and couldn't find the right place). In xdbx, patch the file windows.c thus: 120a121,129 > /* ask window manager for input focus: */ > { > XWMHints wmhints; > wmhints = XGetWMHints((XtDisplay(vpane), XtWindow(vpane)); > wmhints.input = True; > wmhints.flags = InputHint; > XSetWMHints(XtDisplay(vpane), XtWindow(vpane), &wmhints); > } > In xfig, patch main.c similarly, after (around line 333) "XtRealizeWidget(tool);" only change "vpane" above to "tool". Phillip L. Shaffer shaffer@crd.ge.com GE Corporate Research & Development uunet!crd.ge.com!shaffer Building KW, Room D211 P.O. Box 8, Schenectady NY 12301 -- Skip Montanaro (montanaro@crdgw1.ge.com) From don Mon Nov 20 02:53:08 1989 Date: Mon, 20 Nov 89 02:53:08 -0500 To: NeWS-makers@brillig.umd.edu Subject: Scrolling in NeWS - is it possible? From: mcsun!ukc!strath-cs!cs.glasgow.ac.uk!cathy@uunet.uu.net (Catherine Anne Wood) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A week ago I started what I thought would be an afternoons work at the most. I decided to implement a generic scrollable window. Regardless of what was created in it, all its contents would scroll. A week lateer I have decided it is impossible in NeWS (version 1.1 anyway) yet common sense tells me it can't be ... it must be possible to have scrollable windows, surely? Let me explain the problem a bit more. A scrolling canvas is possible, just translate the canvas, and anything drawn on the canvas gets redrawn in the correct position - but any sub canvas of the scolling canvas do not move i.e buttons, textfields, all liteitems. Thus if you have drawn a bounding box rouns some items, the background canvas will scroll, positioning the box in the correct place, but the items in the window do not move. I have tried all sorts of other solutions, like makeing the ClientCanvas of the window, bigger than the window but clipped to the window size, and simulating scrlling by moving the ClientCanvas - works in theory, but there is a strange implementation "feature" in NeWS that does not allow canvases to protrude above or to the left of its parent canvas. It thinks it can, but it just "bangs" against the top or left border on the screen. This may all sound a bit confusing - but basically what I am asking is has anyone out there found a way of scrolling liteitems together with background graphics ? If so please mail me ... any ideas or parts of solutions would be helpful. It must be possible, have I missed something obvious? Thanks in advance, Cathy -- ARPANet: cathy%cs.glasgow.ac.uk@nsfnet-relay.ac.uk JANET: cathy@uk.ac.glasgow.cs UseNet: mcvax!ukc!cs.glasgow.ac.uk!cathy Mail: Cathy Wood, Computer Science, 17 Lilybank Gardens, GB-GLASGOW G12 8QQ : 041 339-8855 ext 6040 From don Mon Nov 20 02:53:13 1989 Date: Mon, 20 Nov 89 02:53:13 -0500 To: NeWS-makers@brillig.umd.edu Subject: NeWS SIG at SUG From: appserv!krempel@sun.com (Henry Krempel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) SPECIAL INTEREST GROUP ANNOUNCEMENT X11/NeWS BOF at Sun User's Group Anaheim Ca Room: Capistrano A&B Date: Thursday, December 7, 1989 Time: 5:15 to 6:15 p.m. Session Code: T50 This will include a presentations on "Using the NeWS side of X11/NeWS" by Henry Krempel (Sun Microsystems) and "Porting NeWSdraw to X11/NeWS" by Bruce Schwartz (Sun Microsystems) There is no charge and live demos will (electronic gods willing) be included. On the SUG schedule, this will be listed as: SIG-NeWS Toolkit, but will include more than just the NeWS toolkit. Henry B. J. Krempel Sun Microsystems MS 16-08 2550 Garcia Avenue Mountain View, California 94043 From don Mon Nov 20 03:30:15 1989 Date: Mon, 20 Nov 89 03:30:15 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: xnews and X -- input focus problem From: eru!luth!sunic!mcsun!ukc!icdoc!sot-ecs!lac@bloom-beacon.mit.edu (Les Carr) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) news@bellcore.bellcore.com (news) writes: >I'm prevented from running xnews full-time by the following problem: I >can't get keyboard information to some Xt applications. The two >applications both respond fine to mouse input, but this is not >sufficient. One of them is the "xdvi" program -- if that helps. The >applications and the server are running on the same Sun-4 running >4.0.3c. Both applications use the Athena Widget set. I have had similar problems at our site. We are running xnews on a SUN4/110 with a CLX client on a remote 3/60. The problem is that output windows are fine, but key press/release events don't get from the X-server to the CLX process. Further investigation reveals that it isn't possible to `focus' the X-server's keyboard onto a window thrown up by the remote client on the server's display. With the current focus set to the new window, mouse button events travel fine, but when you hit keys they appear in the last window you had selected, not the one in focus! Any clues would be very very very welcome indeed! === L.Carr@ecs.soton.ac.uk Les Carr Tel: +44 703 593649 Dept of Electronics and Computer Science Fax: +44 703 593939 University of Southampton Telex: 47661 SOTONU G Southampton SO9 5NH England -- L.Carr@ecs.soton.ac.uk Les Carr Tel: +44 703 593649 Dept of Electronics and Computer Science Fax: +44 703 593939 University of Southampton Telex: 47661 SOTONU G Southampton SO9 5NH England From don Mon Nov 20 03:30:24 1989 Date: Mon, 20 Nov 89 03:30:24 -0500 To: NeWS-makers@brillig.umd.edu Subject: NeWS forms From: eru!luth!sunic!mcsun!ukc!tcdcs!iclitc!robert@bloom-beacon.mit.edu (Robert O'Dea) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We are currently developing a keyboard driven forms package to run under NeWS 1.1 using liteitems. TextItems on a form should be able to grab the input focus regardless of mouse position. We also wish to pass the focus back and forth between TextItems on a form (i.e. to implement tabbing between fields). So far we have been able to get a text item to retain the focus once it has been activated by a mouse click (by doing /DefaultMode setinputfocus). However we cannot grab the focus or exchange focus between two TextItems. Can anyone out there help? Responses by mail please and we will summarise on the net. -------------------------------- Robert O'Dea ICL ITC South County Business Park Leopardstown, Dublin 18, Ireland. +353-1-956644 ext 248 robert@icl.ie From don Mon Nov 20 03:30:38 1989 Date: Mon, 20 Nov 89 03:30:38 -0500 To: NeWS-makers@brillig.umd.edu Subject: Need a quick hack... From: snorkelwacker!spdcc!xylogics!world!bzs@tut.cis.ohio-state.edu (Barry Shein) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm writing an article (for Sun/Expert) on X11 & NeWS. I've written a simple program showing how input and output works under X11 and need an equivalent in NeWS. I'd prefer if someone who considers themselves a NeWS hacker (er, aficionado) would write it (I will give you credit, unless you don't want it, some people are wanted by the FBI I guess.) The program I need is very simple: create a window, put "Hello World" into it (reasonably centered), on mouse-down (any button, or a particular button, doesn't matter) the text changes to "Goodbye World" (clear and redraw text is fine), when the button is released the program exits. It shouldn't use any toolkits or tools, just straight, hand-coded NeWS/Postscript. Short and exemplary is much better than, oh, dealing with detail issues of color screens (you can assume mono if it makes it simpler) or whatever. Its only purpose is to say "here's what a very simple program that actually does some input/output looks like in each system". Thanks. -- -Barry Shein Software Tool & Die, Purveyors to the Trade | bzs@world.std.com 1330 Beacon St, Brookline, MA 02146, (617) 739-0202 | {xylogics,uunet}world!bzs From don Thu Nov 23 00:14:58 1989 Date: Thu, 23 Nov 89 00:14:58 -0500 To: NeWS-makers@brillig.umd.edu Subject: A Choice Item class From: korp@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% liteChoice.ps %%% ------------- %%% %%% Version 1.0 %%% %%% A psuedo-implementation of SunView choice item %%% %%% Date: Sept. 25 1989 %%% Author: %%% David C. Mak %%% Argonne National Laboratory %%% Visual Interfaces Section %%% mak@athens.ees.anl.gov %%% %%% %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% This file contains the class definition for a ChoiceItem. It is similar %%% to the SunView Choice item, except it does not have a menu associated %%% with it. There is an area to click to select all items and on to %%% deselect all items. %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% %%% Example: %%% %%% /items 10 dict dup begin %%% /features (Options) [(Sort)(List)(Erase)(Modify)] {} %%% ClientCanvas 0 0 /new ChoiceItem send %%% 0 0 /move 3 index send def %%% end def %%% items forkitems pop %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% systemdict begin /ChoiceItem Item dictbegin /TempChoiceStates null def /tempjunk null def /ChoiceOnMark /panel_check_on def /ChoiceOffMark /panel_check_off def /ChoiceLabels [] def /ChoiceStates [] def /ItemLabel null def /ItemLabelColor 0 0 0 rgbcolor def /ItemLabelFont /Times-Roman findfont 18 scalefont def /ChoiceColor 0 0 0 rgbcolor def /ChoiceFont ItemLabelFont def /ChoiceMarkOffset 5 def /ChoiceLabelOffset ChoiceMarkOffset 25 add def /LabelGap 5 def /ControlSize ItemLabelFont fontheight def /NotifyUser nullproc def dictend classbegin /new % label [choice_label] Notifyproc canvas => instance { /new super send begin /NotifyUser exch store /ChoiceLabels exch store /ItemLabel exch store /ChoiceStates [ ChoiceLabels length { false } repeat ] store ItemHeight null eq { /ItemHeight 0 store /ItemWidth 0 store } if AutoSize currentdict end } def /setdata % [choice_label] [Choice values] => - { /TempChoiceStates exch store /ChoiceLabels exch store /ChoiceStates [ TempChoiceStates { 1 eq {true}{false} ifelse } forall ] store ItemHeight null eq { /ItemHeight 0 store /ItemWidth 0 store } if AutoSize } def /getalltruestring % - => (string with #s) { /tempjunk ( ) store 0 1 ChoiceLabels length 1 sub { dup ChoiceStates 1 index get not {pop pop} { 5 string cvs /tempjunk tempjunk ( ) 4 -1 roll append append store } ifelse } for tempjunk } def /reshape % x y w h => - { /reshape super send /ControlSize ItemLabelFont fontheight store } def /SelectAllControlDetail % - => - { ItemWidth ControlSize LabelGap add dup add sub ItemHeight ItemLabelFont fontheight LabelGap add sub moveto ControlSize dup rlineto ControlSize neg 0 rmoveto ControlSize dup neg rlineto } def /SelectAllControlBB % - => - { ItemWidth ControlSize LabelGap add dup add sub ItemHeight ItemLabelFont fontheight LabelGap add sub ControlSize dup rectpath } def /ClearAllControlBB % - => - { ItemWidth ControlSize LabelGap add sub ItemHeight ItemLabelFont fontheight LabelGap add sub ControlSize dup rectpath } def /PaintControls % - => - { 0 setgray % Paint the Select All Control SelectAllControlBB stroke SelectAllControlDetail stroke % Paint the Clear All Control ClearAllControlBB stroke } def /PaintLabel % - => - { gsave LabelGap ItemHeight currentfont fontheight LabelGap add sub moveto ItemLabelFont setfont ItemLabelColor setcolor ItemLabel show grestore } def /PaintBorder % - => - { gsave 0 strokecanvas 0 ItemHeight currentfont fontheight LabelGap 2 mul add sub ItemWidth -3 rectpath stroke grestore } def /PaintChoices % - => - { gsave 0 ItemHeight ChoiceFont fontheight LabelGap 2 mul add sub translate 0 1 ChoiceStates length 1 sub { ChoiceLabels 1 index get 0 1 index ChoiceFont ThingSize exch pop LabelGap add neg translate ChoiceColor ChoiceLabelOffset -2 ChoiceFont ShowThing ChoiceStates exch get { ChoiceOnMark } { ChoiceOffMark } ifelse ChoiceColor ChoiceMarkOffset 2 ChoiceFont ShowThing } for grestore } def /PaintItem % - => - { gsave ItemFillColor setcolor clippath fill /PaintBorder self send /PaintLabel self send /PaintControls self send /PaintChoices self send /PaintBorder self send grestore } def /AutoSize % - => - { gsave ItemLabelFont setfont /ItemWidth ItemWidth ItemLabel ItemLabelFont ThingSize pop LabelGap dup add add ControlSize LabelGap add dup add add max store ChoiceFont setfont ChoiceLabels { ChoiceFont ThingSize pop ChoiceLabelOffset add LabelGap add 10 add /ItemWidth exch ItemWidth max store } forall grestore /ItemHeight ItemHeight ItemLabelFont fontheight LabelGap dup add add ChoiceLabels { ChoiceFont ThingSize exch pop LabelGap add add } forall LabelGap add max store 0 0 ItemWidth ItemHeight /reshape self send } def /ClientUp % - => - { NotifyUser cvx exec } def /ClientDown % - => - { newpath SelectAllControlBB currentcursorlocation pointinpath { /SelectAll self send } if newpath ClearAllControlBB currentcursorlocation pointinpath { /ClearAll self send } if ItemHeight ItemLabelFont fontheight LabelGap dup add add sub currentcursorlocation exch pop sub dup 0 ge { 0 1 ChoiceLabels length 1 sub { ChoiceLabels 1 index get ChoiceFont ThingSize LabelGap add exch pop 3 -1 roll exch sub exch 1 index 0 le { /FlipState self send exit } { pop } ifelse } for pop } { pop } ifelse } def /getvalue % - => [ ] { [ 0 1 ChoiceLabels length 1 sub { ChoiceStates 1 index get not { pop } if } for ] } def /ClientDrag % - => - { } def /ClientEnter % - => - { } def /ClientExit % - => - { } def /FlipState % index => - { ItemHeight ItemLabelFont fontheight LabelGap dup add add sub 0 1 3 index { ChoiceLabels exch get ChoiceFont ThingSize LabelGap add exch pop sub } for exch ChoiceStates 1 index get { ChoiceStates exch false put ChoiceOffMark ChoiceOnMark } { ChoiceStates exch true put ChoiceOnMark ChoiceOffMark } ifelse ItemFillColor ChoiceMarkOffset 4 index 2 add ChoiceFont ShowThing ChoiceColor ChoiceMarkOffset 4 -1 roll 2 add ChoiceFont ShowThing } def /SelectAll { /ChoiceStates [ ChoiceLabels length { true } repeat ] store /paint self send } def /ClearAll { /ChoiceStates [ ChoiceLabels length { false } repeat ] store /paint self send } def classend def end Peter korp@athens.ees.anl.gov Argonne National Laboratory From don Thu Nov 23 00:15:25 1989 Date: Thu, 23 Nov 89 00:15:25 -0500 To: NeWS-makers@brillig.umd.edu Subject: BTOL 1.1 From: korp@tripoli.ees.anl.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Version 1.1 of BTOL is now available. If you are interested in obtaining a copy, please let me know via mail. Version 1.1 now includes proper tear off menus. Peter korp@athens.ees.anl.gov Argonne National Laboratory From don Thu Nov 23 00:16:23 1989 Date: Thu, 23 Nov 89 00:16:23 -0500 To: NeWS-makers@brillig.umd.edu Subject: Name of the Initialization file From: steely.rutgers.edu!bohler@topaz.rutgers.edu (BOHLER) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Would anyone be able to mail me the file in which the NeWS commands are stored which tell NeWS what windows to open and options to run upon entering NeWS. I would be very greatful. Steve Bohler. From don Thu Nov 23 00:16:37 1989 Date: Thu, 23 Nov 89 00:16:37 -0500 To: NeWS-makers@brillig.umd.edu Subject: Re: Do transparent canvases receive damage events? From: "bryan_kramer.TORHO"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I too had a lot of trouble with damage events... I don't know about transparency, but I did discover that when using lite, only one canvas got the event. In particular, for a lite window, the frame canvas always got the damage events, not the client canvas. I tore my hair out for days before discovering this. Bryan M. Kramer Xerox Canada Inc.