From don@brillig.umd.edu Fri Sep 2 03:32:42 1988 Date: Fri, 2 Sep 88 03:32:42 EDT To: NeWS-makers@brillig.umd.edu Subject: Information asked about NeWS toolkits From: mcvax!hp4nl!botter!star.cs.vu.nl!sylvia%cs.vu.nl@uunet.uu.net (Sylvia van Egmond) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I would like to know whether there is a NeWS toolkit with the same functionality as Sunview. The toolkit must be easy to use for application-programmers. Please reply by email. Sylvia van Egmond From don@brillig.umd.edu Fri Sep 2 03:33:11 1988 Date: Fri, 2 Sep 88 03:33:11 EDT To: NeWS-makers@brillig.umd.edu Subject: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: kimba!hvr@sun.com (Heather Rose) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <1082@imagine.PAWL.RPI.EDU> jefu@pawl13.pawl.rpi.edu (Jeffrey Putnam) writes: >Me too. But I would like to add that I think that the window has >essentially closed. Alot of people said that UNIX would never catch on for alot of the same reasons that people are saying NeWS will not catch on: to unreliable, too hard to learn, too big. But, as the market has demanded more performance, UNIX has caught on more and more. I think the same thing could happen with NeWS. X11 has many very serious limitations that NeWS addresses. And as people need more functionality and do not find it in X[foo], then they will chose a new windowing system which could be NeWS or whatever else is the wizziest thing on the market. Besides, X is not the only other windowing system on the market today: SunView, Mac Windows, MS Windows, .... I think this group of people (USENET) is skewed towards X because of the type of people who read these groups. One thing X will have a big problem with is input from new devices (according to Jim Gettys at the Bay Area X User's Group meeting). NeWS has a very simple and clean input design which could be easily extended to receive input from any type of device. Another problem I see with X is lack of standards: no standard toolkit and no standard look and feel. Whenever we have a new rev of X, we also have to have a whole new slew of toolkits...mostly a complete re-write. NeWS will have more stability in the next release with NDE and Open Look. And even with future releases of NeWS...it will not change much because it has been relatively well-designed in the first place. Jim Gettys said that X was just a hacked together project that DEC latched on to. So even if a company were to write it's own toolkit in NeWS...that code would remain much more constant across releases than an X toolkit. One more point about NeWS: I think the biggest complaint aside from "too buggy" is that it is too difficult to understand for most programmers. I think that is the reason why we do not see 101 public domain NeWS toolkits on the market. Learning object-oriented programming and PostScript (a stack-based language) is a challenge. But this issue should be addressed by the new toolkit, NDE. We'll see what happens with windowing in the next year or so. Really, as far as the masses are concerned...they are still using glass tty's or little tiny Mac screens with Mac Windows. Most colleges still do not have bit-mapped displays for their undergrads (something other than Mac)...that is a vast market that is as yet untapped. I think it's premature to say that the window-wars are over and X has won. Geez... most colleges don't even offer a course on windowing systems... Most engineers still graduate only knowing FORTRAN as a programming language. Most people don't even read USENET or even know what it is... Personally, I think the window-wars will begin once machines like the Mac II become cheap enough for the masses to buy. And easy enough for the masses to use... Heather Rose disclaimer: of course these opinions are my own...nobody else would want them! From don@brillig.umd.edu Fri Sep 2 03:34:24 1988 Date: Fri, 2 Sep 88 03:34:24 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: steinmetz!vdsvax!barnett@itsgw.rpi.edu (Bruce G. Barnett) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) As a programmer, NeWS excites me more than SunView or X Windows. The flexibility allows for innovation in user interfaces. I have mentioned this before. NeWS is suffering from technology lag: Few are developing NeWS applications because there aren't many machines that have NeWS servers. Few companies are supporting NeWS servers because there aren't many applications. Catch-22. Until this is resolved, we won't see NeWS blossom. I can see several things that may change this: 1. NDE is so powerful that developing new applications will be trivial. 2. NeWS becomes a standard for the SysV.4 machines. Imagine if a 396-clone has a better window system than an Apollo/HP/DEC/etc workstation without NeWS? 3. There are several applications that demonstrate NeWS is more desirable. Examples might be: using NeWS over a 9600 baud modem. (I would LOVE to run my Sun window system at home on a $2000 computer with color, etc.) WYSIWYG - NeWS seems to be an ideal mechanism to interactively manipulate text and graphics. You can draw a diagram, and then paste it into a document. resizing - NeWS can redraw any window to any scale with little programming. Some applications might find this very desirable. 4. Hardware advances - if graphic accelerators can provide an abstraction at a higher level, drawing complex objects can be optimized more than simple pixels/lines. e.g. curved lines. But at this time, applications in X-windows are more portable, provided you are willing to maintain the software yourself. -- Bruce G. Barnett uunet!steinmetz!barnett From don@brillig.umd.edu Fri Sep 2 03:36:09 1988 Date: Fri, 2 Sep 88 03:36:09 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS gap From: gondor.cs.psu.edu!schwartz@psuvax1.psu.edu (Scott Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Several posters have commented on the reasons for the apparent dominance of X over NeWS. Several correctly pointed out that the problem is that that NeWS doesn't have a very large user base, and hence there is less pressure for developers to come through with new ports/products. I think that the fundamental issue is this: NeWS is a complicated system, it takes lots of programing effort just to make it work at all. Look at how long it took sun to get 1.1 out. The next release (2.0?) is still vaporware, as far as I know. So what to do? The current plan seems to be: keep it under wraps and just plug away on it. This at least means that Sun will maximize their profits per NeWS licence sold. Of course, it means that they will not necessarily sell very many licences. One alternative is to do like the MIT/DEC gang did. Give (some of) the source away. Then you have tons of people who are greatly inspired to contribute to the well being of the product. Any incentive for Sun to do this? It would win respect from programers, for one thing. It would probably lead to their concept being widely supported; wouldn't it nice to originate a second "de-facto" standard? Also, what's to loose? X is free and widely used and is the de-facto standard now. You gotta do something drastic to dislodge an incumbent, usually. /suit { asbestos } def -- Scott Schwartz schwartz@gondor.cs.psu.edu schwartz@psuvaxg.bitnet From don@brillig.umd.edu Fri Sep 2 03:45:06 1988 Date: Fri, 2 Sep 88 03:45:06 EDT To: NeWS-makers@brillig.umd.edu Subject: InterViews port update From: cadnetix.COM!gad@uunet.uu.net (Gordon Durand) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Some time ago, I volunteered to try to port InterViews to NeWS in my spare time. A great deal has happened since then, so here's an update on our status: We are currently awaiting a beta tape of InterViews 2.4, which contains some reorganizations which should ease porting. We have received corporate blessing to port InterViews to SunView as an official project, but not to NeWS. Apparently the feeling is that porting to straight NeWS is a waste of time given the upcoming X11/NeWS merge. The bottom line: a port to SunView is underway, while a port to NeWS is on the back burner. As of this Friday, I will no longer be with Cadnetix. My new company isn't on the net (I hope to change this) and doesn't use Suns or NeWS. Anyway, it looks like my involvement with an InterViews port is likely at an end. The person here at Cadnetix who is working on a SunView port is Jim Sharpe (sharp@cadnetix.com). The resultant port will be put back into the public domain. Anyway, such is the state of affairs. Hopefully my net.absence will be short-lived. Bye. Gordon Durand / gad@cadnetix.com / {uunet,boulder}!cadnetix!gad From don@brillig.umd.edu Fri Sep 2 03:45:15 1988 Date: Fri, 2 Sep 88 03:45:15 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS object browser & error handler From: eagle!icdoc!Ist!jh@ucbvax.Berkeley.EDU (Jeremy Huxtable) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I keep hearing on the net about various NeWS class browsers but have yet to see one. What I do have though, is my own object browser and editor which I wrote one afternoon to rectify this loss. You may find this useful if you don't already have something similar. To go with the object browser, there is an error handler, which pops up a browser on your process whenever an error occurs. I, at least, find this extremely useful. Notes: - This is an Object browser, not a Class browser. - It was thrown together very quickly in order to answer a need, and probably needs rewriting. - I would like to do more work on it, but I am leaving for distant parts in a couple of weeks, and will not be able to do more or answer many questions unless you are quick. - It needs lots of clever extensions, new features, etc., provided by anyone who is willing. I won't be here to receive them though. - It is, though, very useful. Jeremy Huxtable. ----------------------cut here-------------------- #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh browser.ps <<'END_OF_browser.ps' X%! /usr/NeWS/bin/psh X X% NeWS object browser and editor (NeWS1.1) X% X% Jeremy Huxtable X% X% Mon Jul 25 17:36:06 BST 1988 X X% This file implements a NeWS object browser and editor. A browser is X% a window which may be popped up onto any array or dictionary and X% lets you view and alter the contents. X% Firstly, the ArrayBrowser: X% X% Viewing: X% This displays an array in vertical form, the first element at X% the top. A scrollbar is provided to let you look at all of X% long arrays. Clicking the PointButton on an element X% in the display will pop up a sub-browser onto that element, X% provided that it is an array or dictionary. There is no point X% having browsers for integers etc. X% Editing: X% Clicking the AdjustButton on an element will pop up an editing X% window for that element. This is a window containing a text item X% and two buttons. The first button, marked "Put", evaluates the X% contents of the text item and replaces it in the array where you X% originally clicked. When the browser is redisplayed, you will X% see the change displayed. The second button, marked "Null", X% is a short cut, and sets the element to null. This is useful when X% you are trying to break cyclic reference chains. X% X% Next the DictBrowser: X% X% This is essentially the same as an ArrayBrowser, but displays X% pairs of keys/values in no particular order. The mouse buttons X% can be used in the same way as for the ArrayBrowser. X% X% The FontBrowser: X% This has two views: a) as a dictionary, and b) as a font. X% Switch between the two by selecting from the menu. X% X% The ProcessBrowser, CanvasBrowser, and EventBrowser: X% X% These are the same as DictBrowsers, but have menu options which X% allow you to manupulate the object being browsed. You can kill, X% suspend, or continue processes, map/unmap canvases or move them X% to the top or bottom, and revoke interest in events. The last X% of these is particularly interesting as all processes waiting X% on the events will die with "invalidaccess" errors. Revoking X% interest is the quickest way of zapping cyclic references. X X% BUGS: X% - reference counting problems, browsers will not zap until their X% children have been zapped. X% - display of dictionaries is not good, should calculate the widths X% of keys and values. X% - dictionary entries should be sorted. X% - the horizontal scrollbar doesn't do anything yet. X% - scrollbars don't work properly for FontBrowsers. X% - should have different views of the same object, maybe combine X% it with Don Hopkins' visualising window. X% - the subclassing is bit messy and shows that this thing evolved. X% It did only take an afternoon to write initially though. X Xsystemdict /Item known not { (NeWS/liteitem.ps) run } if X X/EditWindow DefaultWindow [ X /EditItems % Items in the window X /EditObject % Object being edited X /EditKey % Key in object X] Xclassbegin X /FrameLabel (Object Editor) def X X /new { % object key => instance X /new super send begin X /EditKey exch cvlit def X /EditObject exch cvlit def X /EditItems null def X /NewValue () def X currentdict X end X } def X X /gettopleft { X 320 140 X fboverlay setcanvas getclick 2 index sub % Subtract height from y to select top left X 4 2 roll reshape X } def X X /PaintClient { X EditItems paintitems X } def X X /do_proc { % proc => X errored { X (Error: %) [$error /errorname get] X /printf X } { X () /printstring X } ifelse X EditItems /message_item get send X } def X X /set_value { X /NewValue exch def X } def X X /activate { X /EditItems 6 dict dup begin X /edit_string (Value:) EditObject EditKey get cvstring /Right X [ /ItemValue cvx self /set_value exch /send cvx ] cvx X ClientCanvas /new TextItem send X 10 75 260 0 /reshape 5 index send def X X /message_item () () /Right X nullproc X ClientCanvas /new MessageItem send X 10 45 240 0 /reshape 5 index send def X X /ok_button (Put) X [ self /do_edit exch /send cvx ] cvx X ClientCanvas /new ButtonItem send X dup /ItemFrame 1 put X dup /ItemRadius 0.2 put X 80 10 60 15 /reshape 5 index send def X X /null_button (Null) X [ self /do_null exch /send cvx ] cvx X ClientCanvas /new ButtonItem send X dup /ItemFrame 1 put X dup /ItemRadius 0.2 put X 150 10 60 15 /reshape 5 index send def X X end def X EditItems forkitems pop X map X } def X X /do_edit { X { X { X clear X NewValue cvx exec X EditObject EditKey 3 2 roll put X } do_proc X } fork waitprocess pop X } def X X /do_null { X { EditObject EditKey null put } do_proc X } def X X /destroy { X /EditItems null def X /destroy super send X } def X Xclassend def X X/ZapScrollWindow ScrollWindow [] Xclassbegin X /CreateFrameControls { % - => - X /CreateFrameControls super send X gsave X FrameCanvas setcanvas X /ZapControl FrameCanvas newcanvas dup begin X /Mapped true def X /EventsConsumed /AllEvents def X end def X 0 0 BorderTop BorderRight rectpath ZapControl reshapecanvas X grestore X } def % CreateFrameControls X X /CreateFrameInterests { % - => - X /CreateFrameInterests super send X FrameInterests begin X /FrameZapEvent X PointButton /destroy X DownTransition ZapControl eventmgrinterest def X end X } def % CreateFrameInterests X X /MoveFrameControls { % - => - X /MoveFrameControls super send X gsave X ZapControl setcanvas X FrameWidth BorderRight sub X FrameHeight BorderTop sub movecanvas X grestore X } def % MoveFrameControls X X /PaintFrameControls { % - => - X /PaintFrameControls super send X gsave X ZapControl setcanvas 2 4 moveto /panel_check_off showicon X grestore X } def % PaintFrameControls X Xclassend def X X/ScrollingWidget ZapScrollWindow [ X /EventMgr X /Contents X /ContentsCanvas X /Lines X /VisibleLines X /StartLine X /StartCol X] Xclassbegin X /LMargin 3 def X /TextFont /Times-Roman findfont 14 scalefont def X X /new { % label contents parent => instance X /new super send begin X /Contents exch def X /FrameLabel exch def X /Lines Contents length def X /StartLine 0 def X /VisibleLines 0 def X currentdict X end X } def X X /autoshape { % x y => X 200 X Lines 40 min TextFont fontheight mul X BorderTop add BorderBottom add LMargin add reshape X } def X X /createscrollbars { % - => - (Create scrollbar canvases/items) X /HScrollbar X [0 1 .01 .1 null] 0 X [ /ItemValue cvx self /pan exch /send cvx ] cvx X FrameCanvas /new SimpleScrollbar send X dup /BarVertical? false put X def X /VScrollbar X [1 0 .01 .1 null] 0 X [ /ItemValue cvx self /scroll exch /send cvx ] cvx X FrameCanvas /new SimpleScrollbar send X def X } def X X /PaintClient { % - => - X ClientCanvas setcanvas X 1 fillcanvas 0 setgray X TextFont setfont X /VisibleLines ClientHeight currentfont fontheight div round def X LMargin ClientHeight currentfont fontheight sub moveto X StartLine 1 StartLine VisibleLines add Contents length 1 sub min { X ShowLine X LMargin currentpoint exch pop moveto X 0 currentfont fontheight neg rmoveto X } for X } def X X /ShowLine { X Contents exch get X cvstring show X } def X X /scroll { % lineno => X Lines mul X /StartLine exch floor def X PaintClient X } def X X /pan { X /StartCol exch def X PaintClient X } def X X /YValueToLine { % event => lineno true, or false X ClientCanvas setcanvas X /YLocation get X ClientHeight exch sub X TextFont fontheight div floor StartLine add X dup dup 0 ge exch Lines lt and X dup not { exch pop } if X } def X X /pointbutton { % event => - X YValueToLine { X select X } if X } def X X /adjustbutton { % event => - X YValueToLine { X Contents exch start_editor X } if X } def X X /select { % lineno => - X SubClassResponsibility! X } def X X /map { X /map super send X /EventMgr [ X PointButton [ self /pointbutton exch /send cvx ] cvx X DownTransition ClientCanvas eventmgrinterest X AdjustButton [ self /adjustbutton exch /send cvx ] cvx X DownTransition ClientCanvas eventmgrinterest X ] forkeventmgr def X } def X X /destroy { X EventMgr null ne { EventMgr killprocess /EventMgr null def } if X { /NotifyUser null def } HScrollbar send X { /NotifyUser null def } VScrollbar send X /ClientMenu null def X /destroy super send X } def X Xclassend def X X/Browser ScrollingWidget [] Xclassbegin X /TextFont /Times-Roman findfont 14 scalefont def X X /new { % array parent => instance X /new super send begin X /ClientMenu [ X menuitems X ] /new DefaultMenu send def X currentdict X end X } def X X /select { % lineno => - X SubClassResponsibility! X } def X X /browse { % label object => X FrameX 30 add FrameY 30 add 4 2 roll ParentCanvas start_browser X } def X X /menuitems { X (Zap) [ self /destroy exch /send cvx ] cvx X } def X X /start_editor { % object key => X { X newprocessgroup X framebuffer /new EditWindow send X /gettopleft 1 index send X /activate exch send X } fork pop pop pop X } def X Xclassend def X X/ArrayBrowser Browser [] Xclassbegin X /select { % lineno => - X Contents exch get dup cvstring exch browse X } def Xclassend def X X/DictBrowser Browser [ X /BrowserObject X] Xclassbegin X /new { X exch dup dictkeys exch 4 1 roll exch X /new super send begin X /BrowserObject exch def X currentdict X end X } def X X /adjustbutton { % event => - X YValueToLine { X BrowserObject Contents 3 2 roll get start_editor X } if X } def X X /ShowLine { X ClientWidth 2 div 0 rmoveto currentpoint X Contents 3 index get X cvstring rshow X moveto X ( : ) show X Contents exch get X BrowserObject exch get %cvlit X cvstring show X } def X X /select { % lineno => - X Contents exch get dup cvstring exch X BrowserObject exch get browse X } def X X /do_proc { % proc => X BrowserObject exch load errored pop X pause PaintClient X } def X Xclassend def X X/FontBrowser DictBrowser Xdictbegin X /FontView false def Xdictend Xclassbegin X /PaintClient { % - => - X FontView { X ClientCanvas setcanvas X 1 fillcanvas 0 setgray X BrowserObject setfont X /VisibleLines ClientHeight currentfont fontheight div round def X LMargin ClientHeight currentfont fontheight sub moveto X StartLine 1 StartLine VisibleLines add Contents length 1 sub min { X [ X 0 1 16 { dup 2 add index 16 mul add } for X ] cvas show X pop X LMargin currentpoint exch pop moveto X 0 currentfont fontheight neg rmoveto X } for X } { X /PaintClient super send X } ifelse X } def X X /menuitems { X (Font) [ true self /set_view exch /send cvx ] cvx X (Dictionary) [ false self /set_view exch /send cvx ] cvx X /menuitems super send X } def X X /set_view { % bool => X /FontView exch def X PaintClient X } def X X /pointbutton { % - => - X FontView not { /pointbutton super send } if X } def X X /adjustbutton { % - => - X FontView not { /adjustbutton super send } if X } def X Xclassend def X X/ProcessBrowser DictBrowser [] Xclassbegin X /menuitems { X (Kill) [ /killprocess self /do_proc exch /send cvx ] cvx X (Kill Group) [ /killprocessgroup self /do_proc exch /send cvx ] cvx X (Suspend) [ /suspendprocess self /do_proc exch /send cvx ] cvx X (Continue) [ /continueprocess self /do_proc exch /send cvx ] cvx X /menuitems super send X } def Xclassend def X X/EventBrowser DictBrowser [] Xclassbegin X /menuitems { X (Revoke Interest) [ /revokeinterest self /do_proc exch /send cvx ] cvx X /menuitems super send X } def Xclassend def X X/CanvasBrowser DictBrowser [] Xclassbegin X /menuitems { X (Top) [ /canvastotop self /do_proc exch /send cvx ] cvx X (Bottom) [ /canvastobottom self /do_proc exch /send cvx ] cvx X (Map) [ /mapcanvas self /do_proc exch /send cvx ] cvx X (Unmap) [ /unmapcanvas self /do_proc exch /send cvx ] cvx X /menuitems super send X } def Xclassend def X X/cvstring { % value => string X dup type /stringtype eq { X ((%)) sprintf X } { X dup type /nametype eq 1 index xcheck not and { X (/%) sprintf X } { X 100 string cvs X } ifelse X } ifelse X} def X X% This function sorts an array into alphabetic order, and should be used X% for ordering dictionary keys so you can find them. Unfortunately, it is too X% slow to be of much use. Anyone fancy writing a fast sort in PostScript? X/sortarray { % array => array X dup X 4 dict begin X /a exch def X 0 1 a length 1 sub { X /i exch def X /ai a i get cvstring def X 0 1 i 1 sub { X /j exch def X ai a j get cvstring lt { X a i get a j get X a i 3 2 roll put X a j 3 2 roll put X } if X } for X } for X end X} def X X/dictkeys { % dict => [keys] X [ exch X { pop } forall X ] X % comment out the next line to stop sorting dictionaries X dup length 40 le { sortarray } if X} def X X/BrowserDict 10 dict dup begin X /dicttype { DictBrowser } def X /arraytype { ArrayBrowser } def X /canvastype { CanvasBrowser } def X /fonttype { FontBrowser } def X /processtype { ProcessBrowser } def X /eventtype { EventBrowser } def Xend def X X/start_browser { % x y label object parent => X exch cvlit X BrowserDict 1 index type known { X { X newprocessgroup X exch /new BrowserDict 3 index type get exec send X 3 1 roll X /autoshape 3 index send X /map exch send X } fork pop X } if X 5 {pop} repeat X} def X X% The following pops up a browser onto systemdict: X% X% 0 0 (systemdict) systemdict framebuffer start_browser X X% End of browser code. END_OF_browser.ps if test 13449 -ne `wc -c error.ps <<'END_OF_error.ps' X%! /usr/NeWS/bin/psh X X% NeWS error handler using the object browser (NeWS1.1) X% X% Jeremy Huxtable X% X% Mon Jul 25 17:36:06 BST 1988 X X% This file implements a NeWS error handler which allow you to actually X% read your error messages before they shoot of the top of your terminal X% emulator. When an error occurs, the error handler creates a dictionary X% containing useful information about the error and the current process X% and pops up a browser onto it. X% Thus when you get an error, instead of 546 lines of fast-moving text, X% you get a neat little window and can admire the error at your leisure. X% As well as this, you can of course follow all the links in the dictionary X% and find just where the error occurred. If you are lucky, you might be X% able to break all the cyclic references to things and get rid of all X% those dead windows that tend to pile up during protracted debugging X% sessions. X X% Bugs and missing features: X% - There should be an execution stack browser thet lets you X% see the execution stack in full, with the current operator X% in bold print or something. X% - I can't get this to load if I put it in my "user.ps" - I X% get an error executing "acceptconnection" (interrupted X% system call)!. X Xsystemdict begin X X% Change this path name to your own:- Xsystemdict /Browser known not { (ps/lib/browser.ps) run } if X X/MyErrorDict dictbegin X StandardErrorNames { {MyErrorHandler} def } forall Xdictend def X X/MyErrorHandler { X % Must be careful with manipulating the stacks here, as otherwise X % our private stuff will appear in the browser! X /errordict OldErrorDict store X pop % Get rid of the "offending command" from stack X % create a dictionary of useful info. Note that we must get the X % process' stacks now as otherwise they disappear when the "killprocess" X % is done. X currentprocess /DictionaryStack get X 7 dict begin X /DictionaryStack exch def X currentprocess /OperandStack get /OperandStack exch def X /ExecutionStack X currentprocess /ExecutionStack get X 0 1 index length 4 sub getinterval X def % Remove this error handler from exec stack X /Interests currentprocess /Interests get def X /Error $error /errorname get def X /Executing $error /command get def X /Process currentprocess def X currentdict X end X 50 600 (Error) 4 3 roll X framebuffer start_browser X /errordict MyErrorDict store X currentprocess killprocess X} def X X/OldErrorDict systemdict /errordict known {errordict} {null} ifelse def X/errordict MyErrorDict def X Xend X% End of error handler code. END_OF_error.ps if test 2579 -ne `wc -c hvr@sun.UUCP (Heather Rose) writes: >In article <1082@imagine.PAWL.RPI.EDU> jefu@pawl13.pawl.rpi.edu (Jeffrey Putnam) writes: >>Me too. But I would like to add that I think that the window has >>essentially closed. > >Alot of people said that UNIX would never catch on for alot of the same >reasons that people are saying NeWS will not catch on: to unreliable, >too hard to learn, too big. But, as the >market has demanded more performance, UNIX has caught on more and more. >I think the same thing could happen with NeWS. X11 has many very serious >limitations that NeWS addresses. And as people need more functionality >and do not find it in X[foo], then they will chose a new windowing system >which could be NeWS or whatever else is the wizziest thing on the market. NeWS has serious limitations itself. I used to be paid to write code that X supports easily, and NeWS is not able to support at all. I personally consider X's limitations, such as they are, less of a problem than NeWS limitations, as they are. > >One thing X will have a big problem with is input from new devices >(according to Jim Gettys at the Bay Area X User's Group meeting). NeWS >has a very simple and clean input design which could be easily extended >to receive input from any type of device. What I have said on numerous occasions is that living with broken "features" is a bad idea. In the early V11 design, we included support for multiple input devices, but found when we implemented the design that it was seriously flawed. Rather than live with a bad design, we removed this support in the core X specification. People are working on X extensions now to "get it right", and support your favorite knobs, dials, buzz boxes, etc. For example, look at the Digital VS8000, which has quite a complex button box. I would hope that this becomes standardized soon; there are proposals on the table for this now. You are invited to review them. > >Another problem I see with X is lack of standards: no standard toolkit >and no standard look and feel. Whenever we have a new rev of X, we also >have to have a whole new slew of toolkits...mostly a complete re-write. >NeWS will have more stability in the next release with NDE and Open Look. The toolkit intrinsics are now quite stable and available. As for look and feel, there are competing "standards"; only time will tell which of Xui, Open Look, etc. become the true standard. But standards form when people agree, and declaring something a "standard" does not make it "the standard" until such agreement is reached. >And even with future releases of NeWS...it will not change much because >it has been relatively well-designed in the first place. Jim Gettys said >that X was just a hacked together project that DEC latched on to. So even if a >company were to write it's own toolkit in NeWS...that code would remain >much more constant across releases than an X toolkit. I've never said X was a hacked together project DEC latched onto; in no location, at no time. X up through version 10 was what a very small number (approximately 2-3) people could do. It was successful beyond our wildest dreams. But rather than allowing something that was seriously limited become so widely used that it could not be dislodged, we completley redesigned X in version 11, and completely reimplemented it. The redesign was done completely openly, with input from many talented people in many companies. This is hardly "hacked up". > >Heather Rose > >disclaimer: of course these opinions are my own...nobody else would > want them! Yup. And I'd recommend listening to what people actually say before you quote someone. Jim Gettys Digital Equipment Corporation Systems Research Center From don@brillig.umd.edu Fri Sep 2 04:21:00 1988 Date: Fri, 2 Sep 88 04:21:00 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: att!whuts!homxb!homxc!brt@ucbvax.Berkeley.EDU (B.REYTBLAT) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'd like to address some of the misconceptions in the referenced article. In article <66437@sun.uucp>, hvr%kimba@Sun.COM (Heather Rose) writes: > In article <1082@imagine.PAWL.RPI.EDU> jefu@pawl13.pawl.rpi.edu (Jeffrey Putnam) writes: > >Me too. But I would like to add that I think that the window has > >essentially closed. > > Alot of people said that UNIX would never catch on for alot of the same > reasons that people are saying NeWS will not catch on: to unreliable, > too hard to learn, too big. But, as the > market has demanded more performance, UNIX has caught on more and more. > I think the same thing could happen with NeWS. X11 has many very serious > limitations that NeWS addresses. And as people need more functionality > and do not find it in X[foo], then they will chose a new windowing system > which could be NeWS or whatever else is the wizziest thing on the market. So far, so good. Here's where we part company: > Besides, X is not the only other windowing system on the market today: > SunView, Dead as a door nail. > Mac Windows, MS Windows, .... Not pertinent to the UNIX market. > I think this group of people > (USENET) is skewed towards X because of the type of people who read > these groups. May be. Maybe not. Data? > > One thing X will have a big problem with is input from new devices > (according to Jim Gettys at the Bay Area X User's Group meeting). NeWS > has a very simple and clean input design which could be easily extended > to receive input from any type of device. > > Another problem I see with X is lack of standards: no standard toolkit > and no standard look and feel. "One good thing about standards, is that there are so many to choose from": X Toolkit standards: MIT Xt Intrinsics approved in August MIT Core Widget Set spec being worked on even as we speak :-) X L&F standards: Athena (here & now) DECwindows (here & now) HP NewWave (here & now) OPEN LOOK (if and when it is actually available to the market) NeWS Toolkit standards: NDE (if and when it is actually available to the market) NeWS L&F standards: OPEN LOOK (if and when it is actually available to the market) Summary: X standards do exist in all but one area. NeWS standards have been delayed yet again (into next year now). >Whenever we have a new rev of X, we also > have to have a whole new slew of toolkits...mostly a complete re-write. That was true in X10.4 -> X11r1 and in X11r1 -> X11r2. It is NOT true for X11r2 -> X11r3. > NeWS will have more stability in the next release with NDE and Open Look. ^^^^ When NDE and OPEN LOOK are actually available, and on more than just Sun machines, come back we'll look at the problem again. > And even with future releases of NeWS...it will not change much because > it has been relatively well-designed in the first place. Jim Gettys said > that X was just a hacked together project that DEC latched on to. So even if a > company were to write it's own toolkit in NeWS...that code would remain > much more constant across releases than an X toolkit. Prove it. I can argue the opposite: - X has a large base of users and contributors concerned with portability. - NeWS has Joy, Gosling, and a few other people. Bright people, but few nonetheless. And they appear to be more concerned with selling iron than the MIT Consortium. > One more point about NeWS: I think the biggest complaint aside from > "too buggy" is that it is too difficult to understand for most programmers. > I think that is the reason why we do not see 101 public domain NeWS > toolkits on the market. Learning object-oriented programming and PostScript > (a stack-based language) is a challenge. But this issue should be > addressed by the new toolkit, NDE. In soc.women this argument is called "blaming the victim" :-) But seriously, folks, OO programming is actually easier to teach then other forms. I've done it. [ more stuff deleted ] > > Heather Rose > > disclaimer: of course these opinions are my own...nobody else would > want them! Editorial : - I actually think NeWS is a better way of doing things than X - The dual X11/NeWS server is the best approach to combining X with another window system. - I like Sun HW. I run a network of several machines for myself and others. I've recommended them to others. - I think Sun is digging its own grave by the following actions: + Denigrading X (as in the article referenced) + Refusing to deliver a product quality X11 server to the market in a timely way. I am aware of the promised delivery of the X11/NeWS server. Its not soon enough. I need a fast server yesterday. + Refusing to deliver an X based OPEN LOOK implementation, source compatible with other implementations of OPEN LOOK. These actions might have gone by without consequences, had there not been viable alternatives to consider: + Sony workstations + DEC workstations + Tektronix workstations + HP workstations + Compaqs with a 3rd party color board and awsomely fast servers. this list is in no particular order. - A better way of introducing NeWS would have been: + Become a leader in the X market by delivering the best price/performance X11 server (Sun is quite capable of doing it) + Introduce the dual server about 1.5-2 years later as added functionality. Ben Reytblat homxc!brt Disclaimer: These opinions are my own. They do not represent anyone's views but my own. I'm not connected with any organization making policy decisions. From don@brillig.umd.edu Fri Sep 2 04:21:23 1988 Date: Fri, 2 Sep 88 04:21:23 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: kimba!hvr@sun.com (Heather Rose) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13317@jumbo.dec.com> jg@jumbo.UUCP (Jim Gettys) writes: > >I've never said X was a hacked together project DEC latched onto; in >no location, at no time. You are of course right you never said those words. What I interpreted as "hacked up" was the X10 project that 2-3 people worked on with much success. X11 was a complete re-design as far as I know that DEC wanted very knowledgeable people like yourself to fully re-think through and implement. What I see as "lost effort" so to speak are the applications written for X10. I understand HP has a very nice implementation of X10 with many goodies. I don't want to seem "anti-X11" since it is something I will be using alot of in the near future. I have used X10 and liked it quite a bit. I was very impressed with that work. >Yup. And I'd recommend listening to what people actually say before >you quote someone. If I offended you, I am very sorry. It was never my intention to do so. Thanks for taking the time to educate me, I appreciate it! Heather Rose disclaimer: these opinions are mine, mine, all mine! From don@brillig.umd.edu Sun Sep 4 04:53:09 1988 Date: Sun, 4 Sep 88 04:53:09 EDT To: NeWS-makers@brillig.umd.edu Subject: Questions about windowing systems: NeWS? From: Steven.Hoover@edrc.cmu.edu Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There seems to be a proliferation of graphics tools and windowing systems for Sun machines and I'm confused. So please excuse my ignorance and help me by answering some very basic questions. I realize that these may require some long uninteresting answers to the experienced SUN hackers out there so please mail your responses to me. I will summarize if there is interest. 1.) Under SunOS 4.0 what are the functions of Suntools, SunView, SunCGI, Xwindows and NeWs? 2.) To what extent are any of the above compatible or mutually exclusive? and most importantly 3.) If I have a Sun-3/160 running 4.0 and NeWs networked with another unix workstation (Specfically an IRIS 4-D system) which runs NeWs what functionality does this give me? Thanks, Steve Hoover sph@edrc.cmu.edu Department of Mechanical Engineering Carnegie-Mellon University Pittsburgh, PA 15217 From don@brillig.umd.edu Sun Sep 4 04:53:19 1988 Date: Sun, 4 Sep 88 04:53:19 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: jumbo!jg@decwrl.dec.com (Jim Gettys) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <66437@sun.uucp> hvr@sun.UUCP (Heather Rose) writes: >In article <1082@imagine.PAWL.RPI.EDU> jefu@pawl13.pawl.rpi.edu (Jeffrey Putnam) writes: >>Me too. But I would like to add that I think that the window has >>essentially closed. > >Alot of people said that UNIX would never catch on for alot of the same >reasons that people are saying NeWS will not catch on: to unreliable, >too hard to learn, too big. But, as the >market has demanded more performance, UNIX has caught on more and more. >I think the same thing could happen with NeWS. X11 has many very serious >limitations that NeWS addresses. And as people need more functionality >and do not find it in X[foo], then they will chose a new windowing system >which could be NeWS or whatever else is the wizziest thing on the market. NeWS has serious limitations itself. I used to be paid to write code that X supports easily, and NeWS is not able to support at all. I personally consider X's limitations, such as they are, less of a problem than NeWS limitations, as they are. > >One thing X will have a big problem with is input from new devices >(according to Jim Gettys at the Bay Area X User's Group meeting). NeWS >has a very simple and clean input design which could be easily extended >to receive input from any type of device. What I have said on numerous occasions is that living with broken "features" is a bad idea. In the early V11 design, we included support for multiple input devices, but found when we implemented the design that it was seriously flawed. Rather than live with a bad design, we removed this support in the core X specification. People are working on X extensions now to "get it right", and support your favorite knobs, dials, buzz boxes, etc. For example, look at the Digital VS8000, which has quite a complex button box. I would hope that this becomes standardized soon; there are proposals on the table for this now. You are invited to review them. > >Another problem I see with X is lack of standards: no standard toolkit >and no standard look and feel. Whenever we have a new rev of X, we also >have to have a whole new slew of toolkits...mostly a complete re-write. >NeWS will have more stability in the next release with NDE and Open Look. The toolkit intrinsics are now quite stable and available. As for look and feel, there are competing "standards"; only time will tell which of Xui, Open Look, etc. become the true standard. But standards form when people agree, and declaring something a "standard" does not make it "the standard" until such agreement is reached. >And even with future releases of NeWS...it will not change much because >it has been relatively well-designed in the first place. Jim Gettys said >that X was just a hacked together project that DEC latched on to. So even if a >company were to write it's own toolkit in NeWS...that code would remain >much more constant across releases than an X toolkit. I've never said X was a hacked together project DEC latched onto; in no location, at no time. X up through version 10 was what a very small number (approximately 2-3) people could do. It was successful beyond our wildest dreams. But rather than allowing something that was seriously limited become so widely used that it could not be dislodged, we completley redesigned X in version 11, and completely reimplemented it. The redesign was done completely openly, with input from many talented people in many companies. This is hardly "hacked up". > >Heather Rose > >disclaimer: of course these opinions are my own...nobody else would > want them! Yup. And I'd recommend listening to what people actually say before you quote someone. Jim Gettys Digital Equipment Corporation Systems Research Center From don@brillig.umd.edu Sun Sep 4 04:53:26 1988 Date: Sun, 4 Sep 88 04:53:26 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: From: mailrus!uflorida!novavax!hcx1!brian@ames.arc.nasa.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > One thing X will have a big problem with is input from new devices There hasn't been a flood of new devices over the past ten years, with the exception of "specialty" devices (eg tablets for CAD'ers). Basically, you've got the keyboard, and you've got the mouse. Until we grow more hands or evolve differently, we probably won't see many new input devices. True, NeWS has the advantage here, but I don't see it tipping the scales much. > Another problem I see with X is lack of standards: no standard toolkit > and no standard look and feel. Whenever we have a new rev of X, we also > have to have a whole new slew of toolkits...mostly a complete re-write. > NeWS will have more stability in the next release with NDE and Open Look. Open Look won't be available over X? It really depends on which user interface becomes the standard. > We'll see what happens with windowing in the next year or so. Really, > as far as the masses are concerned...they are still using glass tty's A good point - I wonder how long it will take before we're rid of them? The winner of the Windows War will not be decided by technical merit (I'd give it to NeWS there) or ease of use -- it will be decided by the vendors writing the applications. The window system should be fairly transparent - it's the application the customer or programmer really cares about. If I were so bold to predict a winner, I'd pick X. ----- brian email: brian@hcx1.SSD.HARRIS.COM From don@brillig.umd.edu Sun Sep 4 04:53:30 1988 Date: Sun, 4 Sep 88 04:53:30 EDT To: NeWS-makers@brillig.umd.edu Subject: Window Warz From: prisma!mo@uunet.UU.NET (Mike O'Dell) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There has been a lot of conversation about "Has X Won the Window Wars?" I can't understand why supposedly technically-minded people INSIST on talking about winners and losers. No window system on UNIX has anything remotely like the software available on the Macintosh, so if you are inclined to use "market choice" as your yardstick, THEY ALL LOSE. Clearly, no Unix devote' likes this bit of fact, so we gotta argue over other things. I understand the problem - people want to go off and implement software, but want to make sure they pick "the right one." Sorry, the world doesn't accomodate such things. There is no "right one" simply because they all have serious problems. A few examples, not to pick on anyone in particular (1) X is a way to do device-dependent graphics across a network - changing screen resolution screws the application. This doesn't happen with NeWS. There is also the toolkit issue. (2) NeWS suffers from needing two programming languages, one worse than most assemblers. This could change soon, however. It is still complex but flexible. NeWS needs a toolkit, too. (3) WINDOW SYSTEMS DON'T MATTER. It is the consistency of the look and feel of ALL applications that matters. NOTHING is worse than having 5 applications up on your bottle and each one looks and acts differently. Don't try claiming this ain't happening, 'cause it is. Until this is addressed, you are asking the wrong questions when you mutter about window system choices. (4) Open Look is coming. This will be a powerful force since it will be implemented on both X and NeWS, obviating the issue of which window system you write for (assuming the Open Look toolkit designers do a good job). Open Look will not be the answer to Life, the Universe, and Everything, but it will make it possible to write quality visual software for Unix that will run on more than one platform; something that is largely impossible at the moment. My opinions are my own. Noone else would want them. -Mike O'Dell From don@brillig.umd.edu Sun Sep 4 04:54:53 1988 Date: Sun, 4 Sep 88 04:54:53 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Sun color 3/60 on NeWS From: neptune!pvo3366@orstcs.CS.ORST.EDU (Paul O'Neill) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <610@modular.UUCP> hagen@modular.UUCP (Jeffrey R. Hagen) writes: >In NeWS on a Sun color 3/60, if you forget to open up a console window >and you write something to the console, the black and white console >message scribbles over the NeWS screen. Repair doesn't clear it. > >psh >PaintRoot >^D > > doesn't clear it. The only resort I know is to restart the news_server. > ............ You need to get the overlay plane back to specifying the 8-bit frame buffer in those areas where it is now specifying the monochrome frame buffer. Execute the following from any terminal: switcher -e 0 Paul O'Neill pvo@oce.orst.edu Coastal Imaging Lab OSU--Oceanography Corvallis, OR 97331 503-754-3251 02) 746-9127 arizona!modular!hagen From don@brillig.umd.edu Sun Sep 4 04:55:08 1988 Date: Sun, 4 Sep 88 04:55:08 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Sun color 3/60 on NeWS From: tomlin@hc.dspo.gov (Bob Tomlinson) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) in article <610@modular.UUCP>, hagen@modular.UUCP (Jeffrey R. Hagen) says: > > In NeWS on a Sun color 3/60, if you forget to open up a console window > and you write something to the console, the black and white console > message scribbles over the NeWS screen. Repair doesn't clear it. Yeah, you need to do run the "switcher -n" command to switch your framebuffer back to the color framebuffer for that part of the screen which got written on. Simply change the repaint menu selection (from user.ps): 0 (Repaint All) { PaintRoot {/paint self send} AllWin (switcher -n) forkunix } /changeitem repairmenu send -- Bob Tomlinson -- tomlin@hc.dspo.gov -- (505) 667-8495 Los Alamos National Laboratory -- MEE-10/Data Systems From don@brillig.umd.edu Sun Sep 4 04:55:39 1988 Date: Sun, 4 Sep 88 04:55:39 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: From: phri!roy@nyu.edu (Roy Smith) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) brian@hcx1.SSD.HARRIS.COM writes: > There hasn't been a flood of new devices over the past ten years, with > the exception of "specialty" devices (eg tablets for CAD'ers). Basically, > you've got the keyboard, and you've got the mouse. Until we grow more > hands or evolve differently, we probably won't see many new input devices. This is probably circular reasoning. You claim we don't have to support multiple input devices because they don't exist. I claim they don't exist because they are hard to support. In addition to mice and tablets (essentially the same thing), people like Silicon Graphics already support dial-and-button boxes as standard I/O (well, mostly I) devices. Touch screens are becomming popular; I use one every time I use a cash machine. And, if you want esoterica, try things like Richard Feldman's joystring, a sort of 6-degree-of-freedom-with-tactile-feedback 3-d joystick (designed for use in pairs, one per hand). -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network" From don@brillig.umd.edu Sun Sep 4 04:56:00 1988 Date: Sun, 4 Sep 88 04:56:00 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Sun color 3/60 on NeWS From: david@sun.com (David DiGiacomo) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <610@modular.UUCP> hagen@modular.UUCP (Jeffrey R. Hagen) writes: >In NeWS on a Sun color 3/60, if you forget to open up a console window >and you write something to the console, the black and white console >message scribbles over the NeWS screen. Repair doesn't clear it. > >psh >PaintRoot >^D > > doesn't clear it. The only resort I know is to restart the news_server. > >I notice repair works in this case on the black and white 3/50. > >Does anybody out there know how to beat this one? switcher -e 0 -- David DiGiacomo, Sun Microsystems, Mt. View, CA sun!david david@sun.com From don@brillig.umd.edu Sun Sep 4 04:57:19 1988 Date: Sun, 4 Sep 88 04:57:19 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS classes From: neptune!rudolf@orstcs.CS.ORST.EDU (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have a question regarding the litewin.ps file that comes with NeWS. According to the NeWS Manual, a method is invoked by: /method object send and the statement will be executed once the dictionaries for the object's class and any superclasses are pushed on the dict stack. I'm confused by the fact that, within the LiteWindow class def- inition, there are comments that separate methods, utilities, frame procs, etc. And not all of them are invoked using the syntax above. For example, in the last section, Utilities, the procedure /CheckCanvases invokes (method?) /CreateIconCanvas without using the 'send' syntax above. Does this mean that no dicts are pushed on the dict stack when it is invoked? Are the dicts pushed only when the 'send' form is used? I ask this because I've created a subclass, Foo, under LiteWindow, and I've over-ridden some of LiteWindow's methods in class Foo. What has happened is that when I indirectly invoke /CreateIconCanvas while mapping a window of class Foo, only systemdict and userdict are on the dict stack. Therefore the reference to ParentCanvas is undefined since it is in the LiteWindow dict. To sum up my question, is it common to invoke methods without using the 'send' syntax? And if so, is it acceptable to do an explicit 'LiteWindow begin ... end' within methods that are invoked without 'send' so that NeWS can find the class variables it is looking for? Thanks for the help, Jim Rudolf rudolf@oce.orst.edu College of Oceanography Oregon State University, Corvallis, Oregon From don@brillig.umd.edu Sun Sep 4 06:24:23 1988 Date: Sun, 4 Sep 88 06:24:23 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS/2: "The First Graphics Window System for OS/2" From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There's an ad in the September 1988 issue of Computer Language magazine, on page 120, from ImageSoft, for the NeWS/2 window system, for OS/2. (I'm not associated with ImageSoft -- I just saw their ad.) Here are some interesting excerpts. Has anybody seen this system in action? Impressions? Predictions? -Don ArchiTech "Opening Windows on the World of OS/2" NeWS/2 The First Graphics Window System for OS/2 NeWS/2 is a full implementation of NeWS 1.1, and brings to the OS/2 world these unique features: * networking capability using client-window server model. * a graphics model that delivers high performance on a wide range of hardware. * extensibility: the ability to adapt to diverse application needs. * excellent interactive performance. * hardware operating system and device independance. * true WYSIWYG: because the same PostScript code used for display is used by your PostScript laser printer. * Applications can now be developed on Sun workstations and delivered on PCs. NeWS/2 is not simply a 'port' from UNIX to OS/2, it also offers the following: * NeWS/2 server can be accessed thru named pipes from any machine on a LAN-Manager network. * running in its own session, NeWS/2 does not preclude using Microsoft's Presentation Manager in another session. * Full VIO-compatible windows allow OS/2 character based applications to run unmodified under NeWS/2. * PostScript support for output to non-PostScript printers (LaserJet, and graphic capable dot matrix printers.) OPEN LOOK will be available under NeWS/2 upon its release by AT&T and Sun Microsystems. To order, or for more information, call ImageSoft (800) 245-8840. Requires: IBM-AT or compatible, OS/2, 3 button mouse and 3Mb of memory recommended. List price $495. From don@brillig.umd.edu Mon Sep 5 01:33:24 1988 Date: Mon, 5 Sep 88 01:33:24 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS support for Emacs 18.52 available From: Chris Maio Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A NeWS interface for GNU Emacs 18.52 is now available on columbia.edu in pub/ps-emacs.tar.Z, or via mail. This release is compatible with Emacs versions 18.49 through 18.52, and NeWS versions 1.0 and 1.1. No new functionality has been introduced over that offfered by previous versions, but all known bugs and compatibility problems have been addressed. Included in the patch kit is major mode for editing PostScript code which PostScript programmers may find useful in and of itself. The Internet name servers are still advertising an obsolete address for columbia.edu, so if you have trouble connecting the ftp server, try specifying an alternate address (128.59.16.1 or 128.121.13.2). To get the NeWS interface kit via mail, send a message containing the line "send NeWS emacs-support" to archive-server@columbia.edu. The shar file that will be returned is approximately 75k bytes long. Chris From don@brillig.umd.edu Wed Sep 7 10:08:07 1988 Date: Wed, 7 Sep 88 10:08:07 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Window Warz From: necntc!encore!bzs@ames.arc.nasa.gov (Barry Shein) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) From: mo@prisma.UUCP (Mike O'Dell) >(1) X is a way to do device-dependent graphics across a network - > changing screen resolution screws the application. > This doesn't happen with NeWS. There is also the toolkit issue. I've been thinking about this and wonder if X has received too bad a rap on this issue. To some extent this is an observation that the X primitives are at a lower layer than NeWS primitives (ie. NeWS certainly at some point translates to screen coordinates, it's just that that layer is not generally visible.) The only real weakness in X on this count (and it's serious) is the lack of scaled font machinery in the server. If that were there then device independant graphics could be left to the toolkits. I suppose the whole geometry thing has to go out the window (so to speak) also, encouraging things like =200x400 anywhere is a wrong thought (although applications like xterm take it in row/columns which is just fine.) That needs more thinking although the answer will be simple (one obvious solution is to go for a troff'like notion of units, 2ix4i means 2 by 4 inches, 200px400p means 200 by 400 points etc, basically trivia to implement, unlike the font machinery stuff which is hard.) Proof: Crispin Goswell's postscript interpreter runs just fine under X (it even has its own scaled font machinery which is not the place for it, but it does work, given support in the server it could be moved out.) I also have a half-written X toolkit which uses arbitrary units for specifying all sizes, scaled fonts were the big bugaboo that have slowed me down. X servers are happy to return the size of the screen in inches and the number of pixels available in each direction (and pixel depth), once that's queried the toolkit can appear device independant. So the real misunderstanding is the level at which X and NeWS sit. X is a remote device manager to a great extent, NeWS more resembles a toolkit which might sit above something like an X (Goswell's ps interpreter comes so close to this that it's hard to deny outright.) Other than that I think Mike is right on the mark here, abstracting to a look and feel will resolve the issue to a great extent. In fact, I believe my comments above strengthen Mike's points, people are probably asking the wrong question. -Barry Shein, ||Encore|| From don@brillig.umd.edu Wed Sep 7 10:08:12 1988 Date: Wed, 7 Sep 88 10:08:12 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Window Warz From: steinmetz!vdsvax!barnett@itsgw.rpi.edu (Bruce G. Barnett) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809021443.AA12775@uunet.UU.NET> mo@prisma.UUCP (Mike O'Dell) writes: | |There has been a lot of conversation about "Has X Won the Window Wars?" | |I can't understand why supposedly technically-minded people INSIST on |talking about winners and losers. No window system on UNIX has anything |remotely like the software available on the Macintosh, so if you are |inclined to use "market choice" as your yardstick, THEY ALL LOSE. I can't believe you have so completely missed the point. First of all, I express doubt that any software package on the Mac can compete with the several packages we purchased for our Unix workstations. (One package costs more than $50,000). Second, if you had to develop a large complex application you want running on as broad a base a possible, which window system would you choose to spend all of you effort in? Us technically-minded people aren't *using* the packages on current window systems, but *developing* packages for future window systems. Look and feel are important issues, sure. But if you had to start writing code tomorrow, you would have to make a decision. Now. -- Bruce G. Barnett uunet!steinmetz!barnett From don@brillig.umd.edu Wed Sep 7 10:08:21 1988 Date: Wed, 7 Sep 88 10:08:21 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: att!ihlpf!spock@ucbvax.Berkeley.EDU (Weiss) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13317@jumbo.dec.com> jg@jumbo.UUCP (Jim Gettys) writes: >NeWS has serious limitations itself. I used to be paid to write code that >X supports easily, and NeWS is not able to support at all. I personally >consider X's limitations, such as they are, less of a problem than >NeWS limitations, as they are. I have seen a number of articles that give X's shortcomings, but I can't think of one that gives NeWS's. Can you give the NeWS limitations? -- Ed Weiss "I thought it was generally accepted, sir, that att!ihlpf!spock vulcans are an advanced and most honorable race." "They are, they are. And damn annoying at times." From don@brillig.umd.edu Wed Sep 7 10:09:05 1988 Date: Wed, 7 Sep 88 10:09:05 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Window Warz From: voder!wlbr!mh@ucbvax.Berkeley.EDU (Mike Hoegeman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809021443.AA12775@uunet.UU.NET> mo@prisma.UUCP (Mike O'Dell) writes: > .etc.... >the world doesn't accomodate such things. There is no "right one" >simply because they all have serious problems. A few examples, >not to pick on anyone in particular > .etc... > >(2) NeWS suffers from needing two programming languages, one worse than > most assemblers. This could change soon, however. > It is still complex but flexible. NeWS needs a toolkit, too. Classifying PostScript as "worse than most assemblers" is inane at best. Have you ever programmed in postscript for more than a day?. If you have, my apologies. I'll take your opinion at face value. If you have'nt then please don't make such cavalier statements. Where I work one person was really afraid of the prospect of having to write PostScript code. Once they got into it though THEY PREFERRED IT TO WRITING C CODE !!!. I myself write in PostScript and C daily and have no problems switching between the two. It's really not that big of a deal and the power you get with PostScript makes it well worth the trouble it takes (which is no worse than C in my opinion) to learn it. In short don't knock it till you've tried it. -mike From don@brillig.umd.edu Wed Sep 7 10:14:09 1988 Date: Wed, 7 Sep 88 10:14:09 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: pasteur!dent.Berkeley.EDU!davidh@ucbvax.Berkeley.EDU (David S. Harrison) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > I have seen a number of articles that give X's shortcomings, but > I can't think of one that gives NeWS's. Can you give the NeWS > limitations? 1. No primitives for modifying colormaps. 2. No support for plane masks on multi-plane devices. 3. No support for interlocked tiling of filled regions. David Harrison UC Berkeley Electronics Research Lab (davidh@ic.Berkeley.EDU) (...!ucbvax!ucbcad!davidh) From don@brillig.umd.edu Wed Sep 7 10:14:24 1988 Date: Wed, 7 Sep 88 10:14:24 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Questions about windowing systems: NeWS? From: aramis.rutgers.edu!athos.rutgers.edu!hedrick@rutgers.edu (Charles Hedrick) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) 1.) Under SunOS 4.0 what are the functions of Suntools, SunView, SunCGI, Xwindows and NeWs? Suntools and SunView are the same thing. SunView is the newer name. SunCGI is a particular graphics package, not a window system. The version of SunCGI I am familiar with uses SunView for window management. (I recall that there's a new release of one of the Sun graphics packages that uses NeWS, but I don't recall which one.) X and NeWS are in effect alternatives to SunView. From a normal user's point of view the differences are - X or NeWS are both network oriented, so you can run an application on one machine and it can use a different machine's screen. This is not possible with SunView (yet). - Software availability. Because SunView is the primary Sun-supported system, it has a full set of system applications (terminal emulator, debugger, mail system, etc.) Third-party software for the Sun is most likely to use SunView. Because X is widely used in the university community, it also has a good set of applications, but commercial software that you buy probably won't support it. NeWS has very little software available for it, though there are a few stunning examples. 2.) To what extent are any of the above compatible or mutually exclusive? In general each of SunView, NeWS, and X is intended to run alone. It is possible to mix them to some extent, but screen behavior is likely to be less than optimal. Examples: SunView and NeWS: you can run SunView applications under NeWS. However there will be a small blank border around each SunView window. Also, screen refereshes are not always properly coordinated. SunView and X: there is a now a tool which will allow you to run X under SunView. In effect you run X inside one SunView window. You must create that window once, when you start X. It must be in the upper left corner of the screen (?), and can't be resized or moved. There's also a thing called overview, but I'm not very familiar with it. This will all change later this year, when Sun releases a merged window system. It will include a reimplementation of SunView that uses X, and it will allow X and NeWS to coexist fully. 3.) If I have a Sun-3/160 running 4.0 and NeWs networked with another unix workstation (Specfically an IRIS 4-D system) which runs NeWs what functionality does this give me? I don't know anything about the Iris. However in theory the Sun and Iris can use each other's display screens. This could allow you to make use of software that is only available on one from the other. The software involved would have to run under NeWS. So don't expect the IRIS to be able to access SunView applications on your Sun. Also, to the extent that the Iris is attractive because of special-purpose graphics hardware, you'd need to make sure that the NeWS implementation is able to take advantage of that hardware. From don@brillig.umd.edu Wed Sep 7 10:15:45 1988 Date: Wed, 7 Sep 88 10:15:45 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: phri!roy@nyu.edu (Roy Smith) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <6002@ihlpf.ATT.COM> spock@ihlpf.UUCP (Ed-Weiss) writes: > I have seen a number of articles that give X's shortcomings, but > I can't think of one that gives NeWS's. Can you give the NeWS limitations? How about, "it's slow". I should qualify that; NeWS 1.1 is slow on a 4-Mbyte 3/50 because it pages so much. It works just dandy on a 8-Mbyte 3/160. Whether this bloatatiousness is inherent in NeWS or just an implementation problem remains to be seen. My guess is that it should be possible to implement NeWS in a much smaller package, but that's just a guess. Sun may be good at some things, but writing small programs isn't one of them. -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network" rom don@brillig.umd.edu Wed Sep 7 10:15:14 1988 Date: Wed, 7 Sep 88 10:15:14 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Has X Won the Window Wars? (was Re: Is NeWS UseABLE?) From: steinmetz!vdsvax!barnett@itsgw.rpi.edu (Bruce G. Barnett) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <6002@ihlpf.ATT.COM> spock@ihlpf.UUCP (Ed-Weiss) writes: |Can you give the NeWS limitations? When displaying VLSI layers, it is convenient to have translucent colors, so you can see all of the layers, and not just the top. I realize that rasterops on colored areas don't really make sense, but there are some packages that make use of this "feature". (I agree. This does seem a hack.) What is the best way to use NeWS to accomplish this? -- Bruce G. Barnett uunet!steinmetz!barnett From don@brillig.umd.edu Wed Sep 7 10:17:15 1988 Date: Wed, 7 Sep 88 10:17:15 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS faults From: hanauma!rick@labrea.stanford.edu (Richard Ottolini) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) "PostScript is like Chinese food--- an hour later you can't understand what you had written." Reverse Polish languages are very powerful compared to the amount of computer resources they require, but force the programmer to think in contorted non-problem oriented manner. On another topic I find NeWS very defficient it its imaging capabilities. You have no control over how an image is interpolated onto pixels or good color models. There are scientific data images that I don't want distorted by spline interpolation. Jim Gosling, one of NeWS architects, desires to be independent of bitplane and color table hardware. I believe that the settransfer function can be generalized for color mapping between one description of color (e.g. psuedo-color) into the displayed image without making it machine dependent. From don@brillig.umd.edu Wed Sep 7 10:39:15 1988 Date: Wed, 7 Sep 88 10:39:15 EDT To: NeWS-makers@brillig.umd.edu Subject: SUN FLASH! (Folio) From: sundc!joel@Sun.COM (Joel McClung - Federal TS Mgr Sun Washington DC) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) ----- Begin Included Message ----- From sun!relations!press Tue Sep 6 21:59:13 1988 Date: Tue, 6 Sep 88 17:04:12 PDT From: sun!relations!press Confirmed-By: Mail Confirm Daemon on Mailhost To: relations!allsun Subject: SUN FLASH! (Folio) -+This message has been approved for distribution to this alias+- The following announcement was made today: SUN MICROSYSTEMS ACQUIRES FOLIO, INC. MOUNTAIN VIEW, Calif. --September 6, 1988--Sun Microsystems, Inc., today announced that it has acquired Folio, Inc., a private company engaged in the development and sale of typographic and imaging technologies for use in electronic publishing. Terms of the acquisition were not disclosed. Folio supplies intelligent font-scaling technology, a key component in the development of electronic publishing applications. This technology is essential for creating scalable fonts with graphic arts quality for a wide variety of raster output devices, including display screens, printers and electronic typesetters. Folio products are the first to automate this time-consuming process. "Folio technology represents a breakthrough because it accepts any font format," said Scott McNealy, president and CEO of Sun Microsystems. "This allows the user to buy from multiple sources and take advantage of the wide variety of type design available around the world. Folio products are in line with Sun's open computing philosophy." Folio's TypeMaker(TM) and TypeScaler(TM) software packages allow computer and peripheral manufacturers, system integrators, and application software developers to produce and use a single set of fonts across a variety of output devices--a key component in providing a device-independent graphics environment. The Folio products reinforce Sun's commitment to the electronic publishing and presentation graphics markets, which demand high-quality scalable type faces. Folio, founded in 1987, will operate as a wholly owned subsidiary and will continue to license its products directly. Both Folio and Sun are located in Mountain View, Calif. From don@brillig.umd.edu Thu Sep 8 10:49:46 1988 Date: Thu, 8 Sep 88 10:49:46 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS faults From: James Peterson Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > "PostScript is like Chinese food--- an hour later you can't understand what > you had written." I can write similar code in any language I write; To prevent this, I try to write code which is commented, uses meaningful variable names, small and meaningful procedures, and so on. As a result, I have had no problem reading, understanding and modifying PostScript code 3 to 4 months after it was written. I would suggest that problems like this are a failure of the writer, not the language. jim From don@brillig.umd.edu Thu Sep 8 10:50:01 1988 Date: Thu, 8 Sep 88 10:50:01 EDT To: NeWS-makers@brillig.umd.edu Subject: Postscript From: prisma!mo@uunet.UU.NET (Mike O'Dell) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) One reader took great umbrage at my somewhat whimsical description of Postscript as "being worse than most assemblers." As a language, I consider Postscript to be a real landmark in the semantic domain. It is a language for imaging. Syntactically, I find it problematic at least. This particular reader claims to have no problem with the language; I applaud him and his compatriots. Personally, I would rather like to see the power expressed in a syntax I already understand, like infix. Call me a crusty ol' curmudgeon. So, don't get me wrong: I LIKE Postscript and what it does. How it looks on the page and how long it takes me to figure out what is going on (probably because I don't have time to work at it for long periods of time) ain't my favorite thing. -Mike From don@brillig.umd.edu Thu Sep 8 10:50:08 1988 Date: Thu, 8 Sep 88 10:50:08 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Questions about windowing systems From: adobe!greid@decwrl.dec.com Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The Display PostScript system from Adobe provides all the power of the PostScript imaging model and font library and still lets you take advantage of a standard windowing environment like X windows. It is, in a sense, the best of both worlds: * C-language procedural interface to PostScript programming, providing for PostScript-language toolbox implementations with C library calling conventions. * Full and complete implementation of the PostScript language plus many extensions for speed and highly interactive use. * Client/Server model with many simultaneous contexts handled independently by the server. Many options for sharing and communication. * Full font library compatibility with PostScript printers, so you can compose and actually print with many different fonts. * Bug-free softare from Adobe :-) * Coming soon to a system software house near you. Make sure you're on our contact list. Be the first on your block to get fast-breaking news and information on the Display PostScript system. To become a member of the Adobe Developer Association, please contact Cynthia Johnston, our Developer Support Representative, at 415-962-2013 or send her mail as "adobe!johnston". She will send you an application form. If you just want information but are not a software developer, mention that to her. Glenn Reid Adobe Systems From don@brillig.umd.edu Fri Sep 9 16:12:04 1988 Date: Fri, 9 Sep 88 16:12:04 EDT To: NeWS-makers@brillig.umd.edu From: gerard@cgl.ucsf.EDU Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hello, Could you please send me information about 'NeWS-makers'. Is it a NeWS discussion group? If this is the case, I would like to ask one question. NeWS has some implementation of Smalltalk's class mechanism. I would like to take advantage of this object-oriented environment, and write several .cps files talking to one framework .c file written in C++ (and not C). Glockenspiel is going to release CommonView, a window library in C++ for NeWS, but I would like to have more freedom and interact directly with NeWS. One obvious solution is to rewrite the CPS program in C++. However, I would like to know if nobody has done this before. Do you know it there exits a C++ interface for NeWS. Thank you gerard@cgl.ucsf.edu From don@brillig.umd.edu Fri Sep 9 16:15:01 1988 Date: Fri, 9 Sep 88 16:15:01 EDT To: NeWS-makers@brillig.umd.edu Subject: Problems with canvas paths From: mcvax!unido!ecrcvax!johng@uunet.uu.net (John Gregor) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) AAaaaarghh!! (There, I feel better now.) I'm being bitten by a 'feature' in NeWS 1.1. It seems that the path returned by clippath can't be used by any of the path operators (stroke, pathforall, pathforallvec, etc.). Fill seems to work ok. It seems that sun is already aware of the problem because util.ps has a hack in strokecanvas to get around it (only for rectangular canvases though). Question #1: Can anybody with source (or at Sun) explain why this irregularity occurs? Question #2: The reason I need this is that I want to resize, rotate, and otherwise fondle the shape of canvases. I'd really rather not have to keep the information hidden elsewhere. Any ideas on how to do this? (Yes, I know about reshapecanvas, I just need to know the old path first.) Feature #2: It seems that doing a currentpath, changing canvases, then doing a setpath doesn't work. But this could have been yet another manifestation of the same problem. [mild flame] Several people have done postscript interpreters for X singlehandedly. With working fonts (try printing rotated text in NeWS, grrrrr). Why can't an entire project team at Sun get this stuff right? Sigh... -- John Gregor johng%ecrcvax.UUCP@pyramid.COM  1,, From news-makers-request@brillig.umd.edu Fri Sep 9 12:23:51 1988 Date: 9 Sep 88 03:55:37 GMT From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Organization: Silicon Graphics Inc, Mountain View, CA Subject: Re: Questions about windowing systems Sender: news-makers-request@brillig.umd.edu To: news-makers@brillig.umd.edu *** EOOH *** Date: 9 Sep 88 03:55:37 GMT From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Subject: Re: Questions about windowing systems To: news-makers@brillig.umd.edu In article <8809072114.AA17658@ondine.LOCAL>, greid@adobe.UUCP writes: > > The Display PostScript system from Adobe provides all the power of the > PostScript imaging model and font library and still lets you take > advantage of a standard windowing environment like X windows. It is, in > a sense, the best of both worlds: > > * Full and complete implementation of the PostScript language > plus many extensions for speed and highly interactive use. Since Display PostScript deals only with output, the application has to implement inverse transformations so that when a user selects something she's looking at in Display PostScript space, the application can tell what it was. All input from X comes in screen space. I'm sure you can have Display PostScript perform the inverse transformation but that seems to mean a round trip to the server in addition to the trip the screen-space input already took getting back from the server. This makes interactive applications kind of hard. I could be completely wrong. There may be some extension I'm not aware of that takes care of this. I hope I am wrong. Let me know. -Mark -- From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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."  1,, From news-makers-request@brillig.umd.edu Fri Sep 9 12:26:14 1988 Date: 9 Sep 88 03:40:12 GMT From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Organization: Silicon Graphics Inc, Mountain View, CA Subject: Re: Window Warz Sender: news-makers-request@brillig.umd.edu To: news-makers@brillig.umd.edu *** EOOH *** Date: 9 Sep 88 03:40:12 GMT From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Subject: Re: Window Warz To: news-makers@brillig.umd.edu In article <3562@encore.UUCP>, bzs@encore.UUCP (Barry Shein) writes: > > From: mo@prisma.UUCP (Mike O'Dell) > >(1) X is a way to do device-dependent graphics across a network - > > changing screen resolution screws the application. > > This doesn't happen with NeWS. There is also the toolkit issue. > > I've been thinking about this and wonder if X has received too bad a > > The only real weakness in X on this count (and it's serious) is the > lack of scaled font machinery in the server. If that were there then > device independant graphics could be left to the toolkits. Barry greatly oversimplifies the problem. Having the window server deal only in screen-coordinates presents two major problems: 1. It places a huge burden clients (i.e. application programmers) that wish to be device independent and to change size to fill their windows after a resize. Most clients want to do this. 2. It makes it impossible to use transformation hardware to support the rather basic operations mentioned above. Transformation hardware can only be used by providing extensions that give different imaging models or by allowing the client to bypass the X server and draw to the hardware directly. If the server handles the transformations the client writers job is greatly simplified and transformation hardware can be used. Transformation hardware is going to become much more common in the next few years and people are naturally going to want to use it. It will be an awful shame if the window system bars all standard clients from access to that hardware. Geometry is a giant leap ahead of pixels. -- From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Fri Sep 9 16:17:58 1988 Date: Fri, 9 Sep 88 16:17:58 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Questions about windowing systems From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809072114.AA17658@ondine.LOCAL>, greid@adobe.UUCP writes: > > The Display PostScript system from Adobe provides all the power of the > PostScript imaging model and font library and still lets you take > advantage of a standard windowing environment like X windows. It is, in > a sense, the best of both worlds: > > * Full and complete implementation of the PostScript language > plus many extensions for speed and highly interactive use. Since Display PostScript deals only with output, the application has to implement inverse transformations so that when a user selects something she's looking at in Display PostScript space, the application can tell what it was. All input from X comes in screen space. I'm sure you can have Display PostScript perform the inverse transformation but that seems to mean a round trip to the server in addition to the trip the screen-space input already took getting back from the server. This makes interactive applications kind of hard. I could be completely wrong. There may be some extension I'm not aware of that takes care of this. I hope I am wrong. Let me know. -Mark -- >From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Fri Sep 9 16:18:09 1988 Date: Fri, 9 Sep 88 16:18:09 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Window Warz From: sgi!msc@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <3562@encore.UUCP>, bzs@encore.UUCP (Barry Shein) writes: > > From: mo@prisma.UUCP (Mike O'Dell) > >(1) X is a way to do device-dependent graphics across a network - > > changing screen resolution screws the application. > > This doesn't happen with NeWS. There is also the toolkit issue. > > I've been thinking about this and wonder if X has received too bad a > > The only real weakness in X on this count (and it's serious) is the > lack of scaled font machinery in the server. If that were there then > device independant graphics could be left to the toolkits. Barry greatly oversimplifies the problem. Having the window server deal only in screen-coordinates presents two major problems: 1. It places a huge burden clients (i.e. application programmers) that wish to be device independent and to change size to fill their windows after a resize. Most clients want to do this. 2. It makes it impossible to use transformation hardware to support the rather basic operations mentioned above. Transformation hardware can only be used by providing extensions that give different imaging models or by allowing the client to bypass the X server and draw to the hardware directly. If the server handles the transformations the client writers job is greatly simplified and transformation hardware can be used. Transformation hardware is going to become much more common in the next few years and people are naturally going to want to use it. It will be an awful shame if the window system bars all standard clients from access to that hardware. Geometry is a giant leap ahead of pixels. -- >From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Fri Sep 9 17:13:44 1988 Date: Fri, 9 Sep 88 17:13:44 EDT To: NeWS-makers@brillig.umd.edu Subject: ImageSoft phone number (OS/2 NeWS) From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Since I've already gotten a couple of requests from people outside of the US for a non-800 number for ImageSoft, I'm posting it to the net as well as sending it to those who asked. The phone number for ImageSoft (the company selling NeWS for OS/2) is (718) 746-9069. They're based in New York city. -Don From don@brillig.umd.edu Sat Sep 10 16:08:44 1988 Date: Sat, 10 Sep 88 16:08:44 EDT To: NeWS-makers@brillig.umd.edu Subject: performance of Sun's NeWS/X server From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Now that Sun is demonstrating their integrated NeWS/X server, does anyone have impressions of its NeWS performance with respect to the native 1.1 server? Thanks in advance. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org From don@brillig.umd.edu Sat Sep 10 16:08:52 1988 Date: Sat, 10 Sep 88 16:08:52 EDT To: NeWS-makers@brillig.umd.edu Subject: anyone seen Gosling's NeWS book yet? From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Has anyone seen the book on NeWS by Gosling and company? What about just the table of contents? Would it be asking too much :-) to get one of the authors to post the table of contents to the news group? Thanks in advance. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org From don@brillig.umd.edu Tue Sep 13 18:27:16 1988 Date: Tue, 13 Sep 88 18:27:16 EDT To: NeWS-makers@brillig.umd.edu Subject: journal is dangerous From: mcvax!enea!kth!draken!klas@uunet.uu.net (Klas Heggemann) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) NeWS users must be aware of the possiblilty to 'eavesdrop' their work using e g journal.ps. I tried to record, as user nobody, what was going on. It was really easy to check everything I did, including the password for su-sessions!! Anybody can use the journaling while you use NeWS for you daily work. They just log in on your machine and use psh to talk to the NeWS-server (which they may do since the localhost is in the newshost-list). I also noticed that a playback of a session may not really play what happend. Instead it plays the events, which may really do something else then when you recorded it. E g I zapped a window while recording a session. Doing a playback resulted in a choice in the rootmenu instead of the window frame menu, a choice that lead to the destruction of all windows!! From don@brillig.umd.edu Wed Sep 14 00:10:55 1988 Date: Wed, 14 Sep 88 00:10:55 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Postscript From: rehmi@dot.unipress.com (Rehmi Post) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >From: rutgers!uunet.uu.net!prisma!mo (Mike O'Dell) >>(2) NeWS suffers from needing two programming languages, one worse than >> most assemblers. This could change soon, however. >One reader took great umbrage at my somewhat whimsical description >of Postscript as "being worse than most assemblers." ... Oh! I thought you were referring to C -- I couldn't have agreed more. Was it Dick Gabriel who mentioned that C had set software engineering in the US back by almost a decade? Now that you mention it, PostScript is a neat little object-oriented assembly language. Granted, the confusion between errors and stop/stopped and exit/loop could stand smoothing out, but where else (besides lisp) is it so easy to build new control constructs? In a slightly more serious vein, does anyone know of efforts underway to develop a generalized PostScript engine in silicon? Or is everyone concentrating on making either YARISC or Smalltalk chips? With ASSQ hardware, PostScript would really churn. rehmi From don@brillig.umd.edu Wed Sep 14 00:17:35 1988 Date: Wed, 14 Sep 88 00:17:35 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Questions about windowing systems From: pyramid!ncc!lyndon@hplabs.hp.com (Lyndon Nerenberg) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809072114.AA17658@ondine.LOCAL> greid@adobe.UUCP writes: >Make sure you're on our contact list. Be the first on your block to >get fast-breaking news and information on the Display PostScript >system. Say what? I've forgotten how long we've been on the developer list. We have NEVER received a piece of mail (electronic or otherwise) about anything! What gives? Do we just keep getting lost? or are there no announcements coming from Adobe these days? (Nobody ever told us about TranScript 2.0 ...) I've complained about this before in private mail -- never heard a word back. So, now I ask again in public: What gives? -- VE6BBM {alberta,pyramid,uunet}!ncc!lyndon lyndon@Nexus.CA From don@brillig.umd.edu Wed Sep 14 13:30:23 1988 Date: Wed, 14 Sep 88 13:30:23 EDT To: NeWS-makers@brillig.umd.edu Subject: currentpath / setpath From: pixar!mike@ucbvax.Berkeley.EDU (Mike Russell) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There have been several questions recently (from zwicky and others) re the currentpath and setpath operators. These operators allow the current path to be saved and used later. I was particularly interested in saving these paths and rapidly re-displaying them with different clipping, scaling, and rotation. After following several leads, I've given up on that particular problem, and will simply use imagecanvas to do the transform. As zwicky (sorry I lost your real name) guessed, currentpath and setpath save and restore a path that is suitable for filling, but not stroking. The path may not be scaled or rotated, however I think translation may be faked via a transparent canvas. Here's a snippet of code that saves two paths and plays with them. 0 0 moveto 10 0 lineto 10 10 lineto 0 10 lineto closepath /a currentpath def newpath 100 100 moveto 110 100 lineto 110 110 lineto 100 110 lineto closepath /b currentpath def a setpath 0 setgray fill b setpath fill 1 setgray a setpath fill b setpath fill I'm curious if anyone else has found further functionality in currentpath and setpath. -- Mike Russell ucbvax!pixar!mike Trust in Allah, but tie your camel first. From don@brillig.umd.edu Wed Sep 14 20:03:21 1988 Date: Wed, 14 Sep 88 20:03:21 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: hardware Postscript accelerators From: hanauma!rick@labrea.stanford.edu (Richard Ottolini) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A floating point chip manufacturer (Weitek?) recently introducted a hardware accelerators for PostScript processors. PostScript interpreters do most of their computations in floating point or fixed point which slows down CPUs considerably. On the other hand, Adobe has shown realtime screen PostScript (Display PostScript) at various conventions, done solely with conventional FPUs (screens have only 12% the pixels as paper). Display PostScript on the NeXT is even faster, but I don't know if there is hardware assist. From don@brillig.umd.edu Thu Sep 15 21:27:45 1988 Date: Thu, 15 Sep 88 21:27:45 EDT To: NeWS-makers@brillig.umd.edu Subject: Color PostScript screendump for NeWS From: nyser!cmx!krempel@itsgw.rpi.edu (Henry BJ Krempel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Is there a way to get a screendump in NeWS that is PostScript? This seems like it ought to be easy to do (theoretically). I already know of ways to get the pixels out and then convert them to PostScript, but it would be quicker to send the PostScript directly. Also, is there a way to get a screendump of everything on the Screen (the SunView windows too, if any)? Has anyone written a drawing editor for NeWS that saves in PostScript? The M*cPaint program I got off the net seems to save in bitmap format.-- Henry B. J. Krempel Northeast Parallel Architectures Center (NPAC) Syracuse University 250 Machinery Hall, Syracuse, N.Y. 13244 From don@brillig.umd.edu Thu Sep 15 21:27:56 1988 Date: Thu, 15 Sep 88 21:27:56 EDT To: NeWS-makers@brillig.umd.edu Subject: Freeing Memory in NeWS From: att!ihlpf!spock@ucbvax.Berkeley.EDU (Weiss) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've run out of memory in NeWS a couple of times when I've been playing with lots of canvases with lots of subcanvases. Each canvas also has a process looking for events. I'm wondering how to make sure that these canvases are garbage collected. A possible list of things to do to insure that canvases are garbage collected: 1.) Remove all references to the canvas in my dictionaries 2.) Unmap the canvas 3.) Destroy all processes awaiting events for the canvas Is this necessary and sufficient? Can I just unmap a parent canvas and forget about the children? Do I need to turn off retained? I am running 3.4 and 4.0 with NeWS 1.1. -- Ed Weiss "I thought it was generally accepted, sir, that att!ihlpf!spock vulcans are an advanced and most honorable race." "They are, they are. And damn annoying at times." From don@brillig.umd.edu Thu Sep 15 21:28:06 1988 Date: Thu, 15 Sep 88 21:28:06 EDT To: NeWS-makers@brillig.umd.edu Subject: Stuffing under 4.0 From: att!ihlpf!spock@ucbvax.Berkeley.EDU (Weiss) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Context: Using LiteWindows in NeWS 1.1 under 4.0 Problem: If I select mulutiple lines in one litewindow, move to another and stuff them, I only get the first line. Multiple lines get sent just fine under 3.4 Anyone else seen this? Any fix? -- Ed Weiss "I thought it was generally accepted, sir, that att!ihlpf!spock vulcans are an advanced and most honorable race." "They are, they are. And damn annoying at times." From don@brillig.umd.edu Thu Sep 15 21:28:29 1988 Date: Thu, 15 Sep 88 21:28:29 EDT To: NeWS-makers@brillig.umd.edu Subject: LiteWindows and destroy From: att!ihlpf!spock@ucbvax.Berkeley.EDU (Weiss) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) If I create a litewindow and then choose Zap from the frame menu, I get an error message. The code for the destroy function is incorrect. If I create a new window object which inherits from litewindow, what do I need to do to make sure everything gets cleaned up? I'm using NeWS 1.1 under 4.0. -- Ed Weiss "I thought it was generally accepted, sir, that att!ihlpf!spock vulcans are an advanced and most honorable race." "They are, they are. And damn annoying at times." From don@brillig.umd.edu Thu Sep 15 21:28:43 1988 Date: Thu, 15 Sep 88 21:28:43 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS Job Opportunities From: ramy@Sun.COM (Ramy Akras) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The following consulting and permanent positions for Software Engineers are open at the Software Products Division of Sun Microsystems, Inc., in Mountain View, CA. Advanced Window Systems Development ----------------------------------- Working closely with the developers of the state-of-the-art X11/NeWS window system, you will design and implement automated validation tools for future OPEN LOOK(TM) environments. In this challenging and exciting position, you will contribute to the next generation of industry-standard Open Systems window platforms by drawing upon your background in graphics, window systems, user interfaces, and networking. Requires a BSCS (MSCS preferred), 2-4 years UNIX/C programming experience. Experience with the PostScript(R) language, the NeWS(TM) window system are a definite advantage. Please respond to: Ramy Akras Sun Microsystems, Inc. M/S 14-49 2550 Garcia Avenue Mountain View, California 94043 email: {hplabs|decwrl|decvax|pyramid}!sun!ramy or ramy@sun.com No phone calls please. From don@brillig.umd.edu Fri Sep 16 11:54:38 1988 Date: Fri, 16 Sep 88 11:54:38 EDT To: NeWS-makers@brillig.umd.edu Subject: Color PostScript screendump for NeWS From: dwf%hope@LANL.GOV (Forslund) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The surfmodl and gnuplot programs on tumtum.cs.umd.edu have example code which dumps the window to a postscript printer. David Forslund MS E531 Los Alamos National Laboratory Los Alamos, NM 87545 (505) 665-1907 (dwf@lanl.gov)  From don@brillig.umd.edu Fri Sep 16 11:54:53 1988 Date: Fri, 16 Sep 88 11:54:53 EDT To: NeWS-makers@brillig.umd.edu Subject: OPEN LOOK QUESTION From: att!codas!ablnc!reza@ucbvax.Berkeley.EDU (Reza Ebrahimi ) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does anyone out there know what kind of terminals (character terminal, specially 630 terminals) will be supported by the OPEN LOOK software? I also need to know where I can get specifications for the product. I appreciate your help. Reza Ebrahimi AT&T From don@brillig.umd.edu Sun Sep 18 03:15:49 1988 Date: Sun, 18 Sep 88 03:15:49 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: OPEN LOOK QUESTION From: sgi!archer@ucbvax.Berkeley.EDU (Archer Sully) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <564@ablnc.ATT.COM>, reza@ablnc.ATT.COM (Reza Ebrahimi ) writes: > Does anyone out there know what kind of terminals (character terminal, > specially 630 terminals) will be supported by the OPEN LOOK software? > I also need to know where I can get specifications for the product. > > I appreciate your help. > > Reza Ebrahimi > AT&T OPEN LOOK (tm) is not supported on any character terminals, as it assumes bitmap capability and some sort of pointer device such as a mouse. OPEN LOOK is otherwise hardware independent. In principal, OPEN LOOK should be available for just about any graphics hardware, as its whole objective is to specify a window system independent UI. Thus we will be seeing OPEN LOOK implemented on top of NeWS and X, and anything else anyone wants to come up with. I don't have a source for the spec in front of me, but it should be available from Sun. -- From don@brillig.umd.edu Sun Sep 18 03:15:59 1988 Date: Sun, 18 Sep 88 03:15:59 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: OPEN LOOK QUESTION From: allosaur.cis.ohio-state.edu!bob@tut.cis.ohio-state.edu (Bob Sutterfield) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <22088@sgi.SGI.COM> archer@elysium.SGI.COM (Archer Sully) |In article <564@ablnc.ATT.COM>, reza@ablnc.ATT.COM (Reza Ebrahimi ) writes: |> ...I also need to know where I can get specifications for the product... |...it should be available from Sun. Or from AT&T. They are said to be developing an X11 implementation of it. Depending upon where you work, if you walk down the hall a little way, you may find someone working on it. -=- Zippy sez, --Bob NEWARK has been REZONED!! DES MOINES has been REZONED!! From don@brillig.umd.edu Sun Sep 18 03:16:08 1988 Date: Sun, 18 Sep 88 03:16:08 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Freeing Memory in NeWS From: voder!wlbr!mh@ucbvax.Berkeley.EDU (Mike Hoegeman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <6149@ihlpf.ATT.COM> spock@ihlpf.UUCP (Ed-Weiss) writes: >I've run out of memory in NeWS a couple of times when I've >been playing with lots of canvases with lots of subcanvases. >Each canvas also has a process looking for events. I'm wondering >how to make sure that these canvases are garbage collected. >A possible list of things to do to insure that canvases are >garbage collected: > 1.) Remove all references to the canvas in my dictionaries > 2.) Unmap the canvas > 3.) Destroy all processes awaiting events for the canvas >Is this necessary and sufficient? Can I just unmap a parent canvas >and forget about the children? Do I need to turn off retained? Usually, just unmapping a parent canvas does'nt hack it. If your canvases are retained it probably does almost nothing as far as reclaiming memory goes. To ensure you are gc'ing everything under a parent canvas start a new process group for your parent canvas environment using newprocessgroup , then when you want to blast everything associated with that parent recursively from the parent down do a revokeinterest on the list of interests contained in each canvas . these are contained under the /Interests (sic?) key of the canvas dict. then do a killprocessgroup Unless you're doing something really wierd this cleans up stuff pretty good. If you cannot do a killprocessgroup from some reason you might want to stick in each canvas the process id for the event mgr associated with it as you start it up. Then when it comes time to clean up you can just recurse down from your parent canvas merrily killing the eventmgr processes with killprocess as you go downwards. If you put stuff in systemdict you gotta clean it up yourself by doing something like systemdict /thingie undef. I think in the NeWS manual near the start they have a little blurb that talks about how stuff gets garbage collected. worth checking out. Hope this helps. -mike From don@brillig.umd.edu Sun Sep 18 03:16:24 1988 Date: Sun, 18 Sep 88 03:16:24 EDT To: NeWS-makers@brillig.umd.edu Subject: commercially available NeWS-based software From: sgi!daisy!jaime@ucbvax.Berkeley.EDU (Jaime Cordera) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've been reading a lot of postings on NeWS vs. X. This has been a discussion of that feature vs this shortcoming and such. I'd like to get a feeling for a more practical measure. Working for an X-based vendor, I see a lot of software that is X-based, displayed at places such as the recent Xhibition conference at MIT. Is there a similiar trade show for NeWS ? What kind of NeWS-based products are available ? I could ask Sun (and have), but I'd also like to know about non-Sun based News products. Thanks, Jaime -- uucp: {atari, nsc, pyramid, imagen, uunet}!daisy!jaime arpanet: atari!daisy!jaime@ames.arc.nasa.gov From don@brillig.umd.edu Sun Sep 18 03:16:50 1988 Date: Sun, 18 Sep 88 03:16:50 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Color PostScript screendump for NeWS From: amdahl!pyramid!prls!philabs!Sandeep@ames.arc.nasa.gov.Mehta%bebop.Berkeley.EDU@ucbvax.Berkeley.EDU (Sandeep Mehta) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <620@cmx.npac.syr.edu>, krempel@cmx (Henry BJ Krempel) writes: > >Is there a way to get a screendump in NeWS that is PostScript? >This seems like it ought to be easy to do (theoretically). The old screendump command works in NeWs. to convert Sun raster format to PostScript use any of the public domain programs like sun2ps or psraster. Since I use the LaserWriter all the time my dump alias is: alias scdump 'screendump | psraster | lpr' I have not tried dumping both SunView and NeWS windows together, but I should think that it would work too. sandeep -- Sandeep Mehta uunet!philabs!bebop!sxm Philips Laboratories sxm@philabs.philips.com From don@brillig.umd.edu Sun Sep 18 19:25:10 1988 Date: Sun, 18 Sep 88 19:25:10 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: commercially available NeWS-based software From: necntc!encore!bzs@ames.arc.nasa.gov (Barry Shein) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) From: jaime@daisy.UUCP (Jaime Cordera) >I'd like to get a feeling for a more practical measure. Working for an >X-based vendor, I see a lot of software that is X-based, displayed at >places such as the recent Xhibition conference at MIT. Is there a similiar >trade show for NeWS ? What kind of NeWS-based products are available ? I would hope you'll see a fair amount of NeWS software at the trade show at the Sun User's Group Conference in December. The phone number (to get on the mailing list) is 415-960-1300, e-mail to sun!users. Joining SUG is of course the preferred method for getting on the mailing list. -Barry Shein, ||Encore|| P.S. I certainly *do* have an interest, I'm on the SUG Board of Directors, no disclaimers expressed or implied! From don@brillig.umd.edu Mon Sep 19 02:41:14 1988 Date: Mon, 19 Sep 88 02:41:14 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: don@brillig.umd.edu (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hey all you Forth enthusiasts (and antagonists!!!) out there: If you want a powerful flexible object oriented multitasking interactive PostScript programming environment, then get NeWS! NeWS officially stands for "Network extensible Window System", but once you see it in action, you'll realize that it really means "Neat Window System!" c(-; NeWS was written to be portable, and it currently runs on a wide variety of machine's: Silicon Graphics, Sun, Mac II (under AUX), PS/2 and other 386 boxes (under OS/2), and many other systems. I could go on and on about how great it is to have a window system with the high level, device independent PostScript imaging model, and how much fun you can have with arbitrarily shaped windows, and what a performance win it is to have an extension language built into the window system that can perform local input processing and feedback, and its profound impact on client-server network traffic, and what an interactive programming environment means for the rapid prototyping of user interfaces, but I'll leave such discussions for comp.windows.news. The issue here is PostScript, the *programming language*! (Like xerox, the verb ;-) PostScript is a cross between Forth and Lisp. Objects are typed, like in Lisp. PostScript procedures can be passed around as arguments on the stack, and manipulated like any other data type, since they're just executable arrays. (i.e. "if" takes 2 arguments: a boolean and a procedure to execute (if the boolean's true)) Arrays are polymorphic -- each element can be an object of any type. Dictionaries can be used like Lisp association lists or Forth vocabularies. To define procedures and variables, you associate names with executable arrays and other values, in dictionaries. The scope is defined by the contents of the dictionary stack, searched top to bottom. PostScript procedures can have named local variables just by pushing a new dictionary onto the dict stack, storing into it the arguments passed on the parameter stack, and other local variables, and popping the dict stack before exiting. Names in PostScript are more like atoms in Lisp than like words in Forth: they don't have value slots or parameter fields -- they are associated with values in dictionaries. To execute a name, it is looked up on the dictionary stack, and its associated value is executed. One thing that makes NeWS such a powerful environment is Owen Densmore's object oriented PostScript programming package. It provides a Smalltalk-like class mechanism, using the dictionary stack to implement inheritence. NeWS user interface objects such as menus, windows, buttons, and scroll bars are defined as classes. You can customize their look and feel by defining subclasses of these objects, saving time and reusing code by building on top of what is already there. The NeWS server is a MuLTiTaSKiNG PostScript interpreter, with an event queue, and a hierarchy of arbitrarily shaped overlapping drawing surfaces (canvases). Lightweight PostScript processes live together in the server, sharing code and data. Keyboard and mouse input generate events, which are put on the event queue and delivered to interested processes in the order that they happened. NeWS processes can communicate with each other by sharing data and sending events. NeWS provides monitors to synchronize access to shared data structures. You express interest in the types of event you want, and loop awaiting and servicing them. You can fork off processes to manage interactive objects, service events, do background processing, or whatever you like -- they're cheap! There is also a PostScript debugger that lets you enter broken processes, examine their guts, fix them up, and send them on their way. NeWS smoothly incorporates many important extensions to the PostScript language. Certain NeWS data types, such as processes, canvases, and events, behave just like dictionaries. You can even push them onto the dictionary stack. A process dictionary contains keys like /ExecutionStack, /OperandStack, /State, and /Interests, and a canvas dictionary contains keys like /Mapped, /Parent, /CanvasBelow, /Color, and /Retained. Reading and writing the values of these keys can have magical effects. For example, setting /Mapped in a canvas dictionary to true makes it appear on the screen; the /XLocation and /YLocation keys of an event are automatically transformed in terms of the current coordinate system. If you want to learn PostScript, NeWS is the way to go -- it's an exciting and gratifying programming environment! Don't waste your time trying to learn an interactive interpretive language like PostScript by spooling files to a laser printer. NeWS isn't just for Display -- it's for Interaction! You can take a look and feel for yourself, if you go to the Sun User Group Southwest Regional Conference in Albuquerque, on September 30th. I'll be demonstrating the HyperTIES hypermedia browser, and the UniPress Emacs text editor, two NeWS applications I've worked on that make extensive use of interactive PostScript. If you want to know more, send me mail or post questions to the "comp.windows.news" newsgroup (or the Internet mailing list "NeWS-makers@brillig.umd.edu"). (If you want to be added to the mailing list, please send me mail at the address "NeWS-makers-REQUEST@brillig.umd.edu".) -Don don@brillig.umd.edu ...!uunet!mimsy!don From don@brillig.umd.edu Mon Sep 19 23:20:02 1988 Date: Mon, 19 Sep 88 23:20:02 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: phri!roy@nyu.edu (Roy Smith) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) don@brillig.umd.edu.UUCP (Don Hopkins) writes: > If you want to learn PostScript, NeWS is the way to go -- it's an exciting > and gratifying programming environment! Don't waste your time trying to > learn an interactive interpretive language like PostScript by spooling files > to a laser printer. NeWS isn't just for Display -- it's for Interaction! While I happen to be a true-blue fan of PostScript, and at least a mild afficiando of NeWS, I can't agree that learning NeWS is the way to learn PostScript. It's like trying to learn yacc at the same time you are learning C, or trying to appreciate Shakespere at the same time you are learning how to read. NeWS in a complex system and you can't hope to understand what is going on unless you already know the fundementals of how PostScript works. -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network" From don@brillig.umd.edu Mon Sep 19 23:22:04 1988 Date: Mon, 19 Sep 88 23:22:04 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: voder!wlbr!mh@ucbvax.Berkeley.EDU (Mike Hoegeman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <3492@phri.UUCP> roy@phri.UUCP (Roy Smith) writes: >don@brillig.umd.edu.UUCP (Don Hopkins) writes: >> If you want to learn PostScript, NeWS is the way to go -- it's an exciting >> and gratifying programming environment! Don't waste your time trying to >> learn an interactive interpretive language like PostScript by >> - spooling files >> to a laser printer. NeWS isn't just for Display -- it's for Interaction! > > While I happen to be a true-blue fan of PostScript, and at least a >mild afficiando of NeWS, I can't agree that learning NeWS is the way to learn >PostScript. It's like trying to learn yacc at the same time you are learning >C, >or trying to appreciate Shakespere at the same time you are learning how to >read. NeWS in a complex system and you can't hope to understand what is going >on unless you already know the fundementals of how PostScript works. I think your analogies are pretty weak. You make it seem like there is tons and tons of NeWS stuff you have to learn before ever getting your hands on PostScript and that simply is not true. No one says you HAVE to start out using the NeWS extensions to postscript. You can just fire up a psh (PostScript Shell) which gives you an environment pretty similar to that of a plain 'ol printer and start typing away!! Here's all you have to do. newshost % psh newshost % executive Welcome to NeWS 1.1 erasepage 10 10 moveto (Hello world!) show : ...etc... : And, As Don was trying pointing out IT's INTERACTIVE !! Using a printer to do PostScript development on is downright primitive in comparison. How would you prefer to program in C? By submitting batch jobs via ftp to some remote machine where it get's compiled and then it mails you back the errors from the compiler? This is pretty much what you have to put up with if you are programming in PosctrScript via a printer. You don't really have to get into using processes, classes, etc.. at first if you don't want to but you get the bonus of an interactive environment and the debugger which is worth the price of NeWS alone if need to do alot of postscript debugging. -mike From don@brillig.umd.edu Tue Sep 20 19:09:19 1988 Date: Tue, 20 Sep 88 19:09:19 EDT To: NeWS-makers@brillig.umd.edu Subject: Why you shouldn't use NeWS as a tool to learn PostScript From: phri!roy@nyu.edu (Roy Smith) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) mh@wlbr.eaton.com.UUCP (Mike Hoegeman) writes: > Here's all you have to do. > > newshost % psh > newshost % executive > Welcome to NeWS 1.1 > erasepage 10 10 moveto (Hello world!) show > : > ...etc... > : > Yeah, well, that's sort of my point. I just tried doing exactly that. What I got was the background pattern blanking out. The window in which I ran the psh happened to be in the lower-left corner of my screen, so I figured maybe the "Hellow world!" was hiding underneath it. When I dragged it away, instead of finding the message, I got the grey background redrawn wherever I dragged the window from. Feeding that line to psh again did indeed give me the message down in the lower-left corner of the screen. Hardly intuitive, and even with this simplest of examples, you're already having to worry about things like windows. Of course, you might simply use psview instead of psh, but that has it's own subtle non-PostScript-isms like not having to put a showpage on the end, and not dealing very well with rotated or scaled fonts. Well, OK, maybe that's not so bad. Let's see what happens when I feed that same bit of PostScript to a LaserWriter: %%[ Error: invalidaccess; OffendingCommand: show ]%% %%[ Flushing: rest of job (to end-of-file) will be ignored ]%% Hmm, that's odd. Of course, the reason is that I had no current font set. This didn't bother NeWS because NeWS seems to have a default current font already set when you fire up a psh. I still maintain that NeWS is different enough from PostScript to make in inadvisable to use the former as a tool for learning the latter. -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network" From don@brillig.umd.edu Wed Sep 21 00:43:28 1988 Date: Wed, 21 Sep 88 00:43:28 EDT To: NeWS-makers@brillig.umd.edu Subject: 3-D pyramid fractal for NeWS From: gerard@cgl.ucsf.EDU Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net > I still maintain that NeWS is different enough from PostScript to > make in inadvisable to use the former as a tool for learning the latter. Roy, Curt.McDowell (cm26+@andrew.cmu.edu) has recently posted (in comp.graphics) an interesting 3-D pyramid fractal, written in PostScript. You can adjust the viewing angle by modifying alpha and beta parameters. Unfortunately, sending the program to a laser printer is not very fast. You can also view it with psview, but it is also slow. However, by modifying SLIGHTLY Curt's program, to run it under NeWS, You get a much faster response time, and you can learn some PostScript tips (I did !). Nota bene, The program below has been written by Curt McDowell, I just made some small modifications to run it with NeWS. (More than 3/4 is `pure' PostScript less than 1/4 is NeWS !). ___________________________________________________________________________ #! /usr/NeWS/bin/psh % | Z % alpha -> Rotation around the Z axis | % (front corner moving left) |_________ X % beta -> Rotation around the Y / % (top corner moving away) / % / Y /alpha -11 def /beta -10 def /shadeleft 1 def /shaderight 0.1 def /pagew 300 def /pageh 400 def /StartSize 1.6 def /MinSize 0.2 def /sina alpha sin def /sinb beta sin def /cosa alpha cos def /cosb beta cos def % Transformation from 3-D coordinates to 2-D /xform % alpha,beta,x,y,z ==> x',y' { /zz exch def /yy exch def /xx exch def /Beta exch def /Alpha exch def yy Alpha cos mul xx Alpha sin mul sub pagew 2 div mul % Compute X and pagew 2 div add % leave on stack xx Beta sin mul Alpha cos mul yy Alpha sin mul Beta sin mul add zz Beta cos mul add pageh 2 div mul % Compute Y and pageh 2 div add % leave on stack } def % Constants /sqr3o4 3 sqrt 4 div def /sqr3o2 3 sqrt 2 div def /sqr3o6 3 sqrt 6 div def /sqr6o3 6 sqrt 3 div def /sqr3o12 3 sqrt 12 div def /sqr6o6 6 sqrt 6 div def /pyramid % alpha,beta,x,y,z,size ==> -- { gsave /size exch def /z exch def /y exch def /x exch def /beta exch def /alpha exch def % (ax, ay) = Left bottom point alpha beta x y z xform /ay exch def /ax exch def % (bx, by) = bottom front point alpha beta sqr3o2 size mul x add size 2 div y add z xform /by exch def /bx exch def % (cx, cy) = Right bottom point alpha beta x size y add z xform /cy exch def /cx exch def % (dx, dy) = top point alpha beta sqr3o6 size mul x add size 2 div y add sqr6o3 size mul z add xform /dy exch def /dx exch def % Fill the 2 visible faces with different shades ax ay moveto bx by lineto dx dy lineto closepath shadeleft setgray fill cx cy moveto bx by lineto dx dy lineto closepath shaderight setgray fill % Draw the 5 visible segments 0 setgray 0.1 72 div setlinewidth ax ay moveto bx by lineto cx cy lineto dx dy lineto closepath dx dy moveto bx by lineto stroke grestore } def % Recursive routine to build a pyramid out of subpyramids /buildsave { alpha beta x y z size } def /buildrest { /size exch def /z exch def /y exch def /x exch def /beta exch def /alpha exch def } def /build { % alpha,beta,x,y,z,size ==> -- /size exch def /z exch def /y exch def /x exch def /beta exch def /alpha exch def size MinSize lt { buildsave alpha beta x y z size pyramid buildrest } { buildsave alpha beta x y z size 2 div build buildrest buildsave alpha beta x size 2 div y add z size 2 div build buildrest buildsave alpha beta sqr3o12 size mul x add size 4 div y add sqr6o6 size mul z add size 2 div build buildrest alpha beta sqr3o4 size mul x add size 4 div y add z size 2 div build } ifelse } def /go { Zrot Yrot 0 StartSize -2 div StartSize sqr6o6 mul -2 div StartSize build } def /main { /Zrot 1 def /Yrot 1 def /Zrotchoice [(-180)(-120)(-90)(-20)(-10)(0)(10)(20)(30)] [{ /Zrot currentkey cvi store /paint win send}] /new DefaultMenu send def /Yrotchoice [(-180)(-120)(-100)(-80)(-60)(-50) (-30)(-20)(-10)(0)(10)(20)(30)] [{ /Yrot currentkey cvi store /paint win send}] /new DefaultMenu send def /setstartsize [(0.5)(1.0)(1.5)(2)(2.5)(3.0)] [{ /StartSize currentkey cvr store /paint win send}] /new DefaultMenu send def /setminsize [(0.2)(0.5)(1.0)(1.5)] [{ /MinSize currentkey cvr store /paint win send}] /new DefaultMenu send def /win framebuffer /new DefaultWindow send def { /PaintClient { gsave alpha go grestore } def /FrameLabel (Receptor) def /PaintIcon {} def /ClientMenu [ (Z Rotation =>) Zrotchoice (Y Rotation =>) Yrotchoice (StartSize =>) setstartsize (MinSize =>) setminsize ] /new DefaultMenu send def } win send 500 600 400 600 /reshape win send /map win send } def main From don@brillig.umd.edu Wed Sep 21 00:46:37 1988 Date: Wed, 21 Sep 88 00:46:37 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you shouldn't use NeWS as a tool to learn PostScript From: toms@ncifcrf.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I think that once you get over the initial problems (like having windows over where you are drawing) that the psh environment is perfect for learning PostScript; that is exactly what I did. I needed a jump start from a friend, but after that it was really great to see my results directly. So I vote for using psh under NeWS as a GREAT way to learn pure PostScript; you don't need to know very much NeWSisms at all. Tom Schneider National Cancer Institute Laboratory of Mathematical Biology Frederick, Maryland toms@ncifcrf.gov From don@brillig.umd.edu Wed Sep 21 10:28:08 1988 Date: Wed, 21 Sep 88 10:28:08 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you should use NeWS as a tool to learn PostScript From: brillig.umd.edu!don@mimsy.umd.edu (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Date: 20 Sep 88 14:53:14 GMT From: phri!roy@nyu.edu (Roy Smith) Subject: Why you shouldn't use NeWS as a tool to learn PostScript [...] I still maintain that NeWS is different enough from PostScript to make in inadvisable to use the former as a tool for learning the latter. -- Roy Smith, System Administrator Public Health Research Institute {allegra,philabs,cmcl2,rutgers}!phri!roy -or- phri!roy@uunet.uu.net "The connector is the network" My argument, which applies to interpretive languages in general, is that it's easier to learn a language in an interactive programming environment than in a batch environment. Direct access and immediate feedback gives a programmer immersed in an interpretive environment intimate experience with the language, and incentive to experiment. The problems that you describe are minor compatibility issues, not fundamental learnability issues. PostScript is very different than the languages most people are used to. The syntax of PostScript is extremely simple, but if you're ever going to be able to harness its power, you've got to understand the semantics. And playing around with an interactive interpreter is a quick and fun way to find out how it works. The fact that the PostScript interpreter in NeWS is different than the PostScript interpreter (whatever brand it is) that runs in your laser printer doesn't mean that it's harder to learn PostScript in NeWS. Of course NeWS is different: it has extensions, and it has bugs. But the fact that NeWS is an interactive programming environment that can give immediate visual feedback on the screen is a far more important issue to someone interested in learning a new language. Metaphorically, I'm saying that it's better to learn Spanish by living in Spain, than by writing letters to people in Spain. You're saying that it's inadvisable to learn Spanish by living to Spain, if you want to write letters to people in Mexico. c(-; -Don don@brillig.umd.edu ...!uunet!mimsy!don From don@brillig.umd.edu Wed Sep 21 10:30:16 1988 Date: Wed, 21 Sep 88 10:30:16 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Color PostScript screendump for NeWS From: campfire!scout@sun.com (David LaVallee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's a little cut and paste and sketch program that uses the file /tmp/clip as its storage. NeWS stores the "clip" as a run-length encoded sun raster file (B+W or Color). I have used this program to clip stuff for B+W and color raster printers, on a Sun with TRANSCRIPT software this is one way to print the rasterfile to a LaserWriter: /usr/lib/rasfilters/convert.2 /tmp/clip | pssun | lpr --Scoutly %%NeWS1.1 %%author: David A. LaVallee %%title: paint2 [/x0 /y0 /x1 /y1 /x /y /win /can] {null def} forall /win framebuffer /new DefaultWindow send def /reshapefromuser win send { /ClientMenu [ (cut) { framebuffer createoverlay setcanvas getwholerect waitprocess aload pop framebuffer setcanvas points2rect rectpath (/tmp/clip) writescreen } (paste) { can createoverlay setcanvas getwholerect waitprocess aload pop can setcanvas points2rect gsave 4 2 roll translate scale {(/tmp/clip) readcanvas imagecanvas} stopped {pop} if grestore } ] /new DefaultMenu send def } win send /map win send /can win /ClientCanvas get def can /Retained true put /paintit {0 setgray x1 y1 moveto x y lineto stroke} def /setxy { /x1 x store /y1 y store begin /x XLocation store /y YLocation store end } def /paintbrush { 10 dict begin currentcursorlocation /y exch store /x exch store /x0 x store /y0 y store /x1 x store /y1 y store paintit [ null {currentprocess killprocess} /UpTransition null eventmgrinterest MouseDragged {setxy paintit} null null eventmgrinterest ] forkeventmgr pop end } def /PaintEventMgr [ PointButton { can setcanvas paintbrush } /DownTransition can eventmgrinterest ] forkeventmgr def From don@brillig.umd.edu Wed Sep 21 15:41:56 1988 Date: Wed, 21 Sep 88 15:41:56 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: steinmetz!barnett%grymoire.steinmetz.ge.com@itsgw.rpi.edu (Bruce G. Barnett) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <23378@wlbr.EATON.COM>, mh@wlbr (Mike Hoegeman) writes: > You can just fire up a psh (PostScript Shell) A much easier way is to use the postscript.el mode that comes with the GNU-emacs/NeWS package on columbia.edu. Then edit your postscript file, type C-c C-c, and the postscript is displayed on the screen. Change one line, whatever, type C-c C-c again, and you see the differences. You may have to write something that draws a blank box as the image is temporary, and a new image overwrites the old one. (without clearing). But this is a very easy way to learn what postscript is doing, and requires NO knowledge of NeWS other than starting, installation, etc. You can learn NeWS by adding extensions later. -- -- Bruce G. Barnett uunet!steinmetz!barnett From don@brillig.umd.edu Wed Sep 21 15:42:01 1988 Date: Wed, 21 Sep 88 15:42:01 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you should use NeWS as a tool to learn PostScript From: Chris Walters Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Plus, just think of all the paper you save using NeWS :-) -- Chris --------------------------------+------------------------------------------ Chris Walters | walters%community-chest@gateway.mitre.org The Mitre Corporation, W97-z665 | walters@mitre.arpa 7525 Colshire Drive | (703) 883-6159 McLean, VA 22102 | Standard Disclaimer Applies --------------------------------+------------------------------------------ From don@brillig.umd.edu Wed Sep 21 21:37:37 1988 Date: Wed, 21 Sep 88 21:37:37 EDT To: NeWS-makers@brillig.umd.edu Subject: Why is NeWS better than Display PostScript? From: brianc@daedalus.ucsf.EDU (Brian Colfer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Why would any want Display PostScript (like NeXT) when NeWS sounds so good? -- =============================================================================== Brian : UC San Francisco :...!{ucbvax,uunet}!daedalus.ucsf.edu!brianc Colfer : Dept. of Lab. Medicine : brianc@daedalus.ucsf.edu : PH. 415-476-2325 : BRIANC@UCSFCCA.BITNET =============================================================================== From don@brillig.umd.edu Wed Sep 21 21:38:10 1988 Date: Wed, 21 Sep 88 21:38:10 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you should use NeWS as a tool to learn PostScript From: uhccux!lee@humu.nosc.mil (Greg Lee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >From article <13655@mimsy.UUCP>, by don@brillig.umd.edu (Don Hopkins): "... " going to be able to harness its power, you've got to understand the " semantics. And playing around with an interactive interpreter is a " quick and fun way to find out how it works. Maybe not all readers of this discussion know that you can do a certain amount of playing around without NeWS. The PS interpreter inside the Apple LW, at least, has an interactive mode. You can can have it calculate and display values on your screen, so long as the values have string values. For images, you have to wait for a page to print, though, so that slows things down. Greg, lee@uhccux.uhcc.hawaii.edu From don@brillig.umd.edu Thu Sep 22 20:10:24 1988 Date: Thu, 22 Sep 88 20:10:24 EDT To: NeWS-makers@brillig.umd.edu Subject: Learning PostScript From: adobe!ondine!greid@decwrl.dec.com (Glenn Reid) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > My argument, which applies to interpretive languages in general, is > that it's easier to learn a language in an interactive programming > environment than in a batch environment. Direct access and immediate > feedback gives a programmer immersed in an interpretive environment > intimate experience with the language, and incentive to experiment. > PostScript is very different than the languages most people are used > to. The syntax of PostScript is extremely simple, but if you're ever > going to be able to harness its power, you've got to understand the > semantics. And playing around with an interactive interpreter is a > quick and fun way to find out how it works. > -Don I would say that there are several levels of becoming proficient with the PostScripot language, and that (at least at the beginning), it can be very helpful to have some interactive response so you can test things out. However, once you get past a pretty simplistic level, you get very tired of retyping a line of code because you got it wrong: PS> /Times-Roman fondfont 12 scalefont setfont %%[Error: undefined; OffendingCommand: fondfont]%% PS> /Times-Roman findfont 12 scalefont setfont PS> (Hello world!) show %%[Error: nocurrentpoint; OffendingCommand: show]%% PS> 0 0 moveto (:LSJDFLKJSF) show This is about where you put the whole thing into a file, and do this instead: PS> (myprog.ps) run Which gets you back into batch mode, sort of.... The final point that is forgotten is that you can use a printer in interactive mode, which, although it is not as visual (without wasting a bit of paper), at least lets you get a "feel" for the language. I do this all the time to examine some part of my program to see what sequence of operators is necessary to pluck something from an array or whether "putinverval" really works like I think it does. A PostScript printer, after all, is just a computer with a serial port, to which you hook up a terminal (or emulator), just like the old days :-) You still have to type "executive", of course. Cheers, Glenn Reid Adobe Systems From don@brillig.umd.edu Thu Sep 22 20:10:54 1988 Date: Thu, 22 Sep 88 20:10:54 EDT To: NeWS-makers@brillig.umd.edu Subject: Anyone got a 'sprite' implementation for NeWS? From: ius3.ius.cs.cmu.edu!ralphw@pt.cs.cmu.edu (Ralph Hyre) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) By 'sprite' I mean a provision for a graphical object which you can easily animate simply by changing two location in their object's 'position' register. I'd be happy to see this for X, but I don't know of anyone (except maybe Ardent?) who uses their extension mechanism, and I don't want to have to worry about shoving the extension code into the servers for each machine I run across. I'm a NeWS and Postscript neophyte. BTW, has anyone looked at porting NeWS to the TI 34020/FP chip combination? It seems like it should be a real screamer. Thanks. -- - Ralph W. Hyre, Jr. Internet: ralphw@ius2.cs.cmu.edu Phone:(412)268-{2847,3275} CMU-{BUGS,DARK} Amateur Packet Radio: N3FGW@W2XO, or c/o W3VC, CMU Radio Club, Pittsburgh, PA "You can do what you want with my computer, but leave me alone!8-)" -- - Ralph W. Hyre, Jr. Internet: ralphw@ius2.cs.cmu.edu Phone:(412)268-{2847,3275} CMU-{BUGS,DARK} Amateur Packet Radio: N3FGW@W2XO, or c/o W3VC, CMU Radio Club, Pittsburgh, PA "You can do what you want with my computer, but leave me alone!8-)" From don@brillig.umd.edu Thu Sep 22 20:11:36 1988 Date: Thu, 22 Sep 88 20:11:36 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Learning PostScript From: haven!ncifcrf!toms@ames.arc.nasa.gov (Tom Schneider) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <4227@adobe.COM> greid@adobe.UUCP (Glenn Reid) writes: >However, once you get past a pretty simplistic level, you get >very tired of retyping a line of code because you got it wrong: >... >This is about where you put the whole thing into a file, and do this >instead: >... >Which gets you back into batch mode, sort of.... Nope! I had two windows open. In one I had my editor, and I modified the code there. In the other window I ran psh. Then I could play by stuffing things from one window to the other (there might be an easier way to do this with a smarter editor like gemacs). So I could try out all kinds of things VERY quickly, which is the whole point of this discussion; to learn something it is best to be able to play around with it. So waiting around for the printer to print is no good... (I've assumed, for the purposes of this discussion, that a person has a choice between talking to the NeWS server via psh or to a printer. With no choice, either would be great.) Try this two window trick! Once you are set up, its great for testing all those neat \bells&whistles. And you end up with permanant code in a file if you want... Tom Schneider toms@ncifcrf.gov From don@brillig.umd.edu Thu Sep 22 20:12:04 1988 Date: Thu, 22 Sep 88 20:12:04 EDT To: NeWS-makers@brillig.umd.edu Subject: Anybody want to beta test a NeWS indenter?!? From: siegel@hc.dspo.gov (josh Siegel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I threw together a NeWS indenter over the last week while cleaning up some NeWS code I had written. It is primitive but it does the job... Does anybody wish a copy of it before I post it to the world as a whole? (the source is 12K) Example: cdef foo() /hello { /hi 2 def [ this is a test] [ of my code ] gsave 2 2 moveto 4 4 lineto stroke grestore } def /bye 6 def turns into: cdef foo() /hello { /hi 2 def [ this is a test] [ of my code ] gsave 2 2 moveto 4 4 lineto stroke grestore } def /bye 6 def It also has a whole bunch of style options for local tastes... --Josh Siegel -- Josh Siegel (siegel@hc.dspo.gov) I like using a C-47A "puff dragon" to go shooting beer cans with. From don@brillig.umd.edu Thu Sep 22 20:17:06 1988 Date: Thu, 22 Sep 88 20:17:06 EDT To: NeWS-makers@brillig.umd.edu From: BARTHO%CGEUGE54.BITNET@CUNYVM.CUNY.EDU Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hello Don, I just read your panhegeric description of NeWS in the recent comp.lang.forth conference. An old user of forth since 12 years, i am still loocking for new reinterpretation of forth, and NeWS seams an interesting one. Does NeWS relates in some form to the HP28c/s ? The similarities are striking ! Now what and how is NeWS available ? (executable, sample files, doc etc) I have 2 sun 3/60 (8MB+68881), 1 vax 780/vms, ~12 pc (AT&T 6300 and ibm AT) and 6 Atari 1040 ST. On the sun and Atari, i use Mike Bradley forthmacs, very good ... Thank you for information (direct or through comp.lang.forth) Yours sincerely, Paul Bartholdi Address : bartho@cgeuge54.bitnet or Paul Bartholdi Observatoire de Geneve CH-1290 Sauverny Switzerland PS I sent a request to be added to your mailing list at news-makers-request@brillig.umd.edu . From don@brillig.umd.edu Thu Sep 22 20:21:30 1988 Date: Thu, 22 Sep 88 20:21:30 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why is NeWS better than Display PostScript? From: jumbo!jg@decwrl.dec.com (Jim Gettys) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809212112.AA18188@daedalus> brianc@DAEDALUS.UCSF.EDU (Brian Colfer) writes: >Why would any want Display PostScript (like NeXT) when NeWS sounds >so good? > Because its PostScript (TM) without any ifs, ands, ors, or buts.... From don@brillig.umd.edu Thu Sep 22 22:37:52 1988 Date: Thu, 22 Sep 88 22:37:52 EDT To: NeWS-makers@brillig.umd.edu Subject: Forth Preprocessor From: mcvax!ukc!strath-cs!glasgow!orr@uunet.uu.net (Fraser Orr) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The discussion on the usefulness (or not) of a forth preprocessor has been blazing for quite a while now. I feel that progress toward any kind of conclusion or concordance is hidered by the discussion being a mixture of several issues. I reckon that separate discussion of these issues would be of benefit. Most of the posters have agreed that raw forth is not really sufficient but have claimed that forth gives you the ability to extend the language and environment to make the language more useful. I see the issues as follows. 1) What are the features that must be added to forth to bring it up to scratch You've heard me babbling on about this before, type checking, local variables, abstracting away from the parameter stack, record types, syntax, abstract types (i.e. types with user controlled operations) etc etc etc 2) Is it better to implement these by use of extensible language features or by using a preprocessor. I think it is much better to use a preprocessor since this puts the expense of these necessary features onto the compile stage(or definition stage - by the way when I talk about a preprocessor I would process each function as it was typed, not have a big compile stage at the end. That way the compile time is not really noticed.) instead of (in the case of the extensible approach) having this expense every time you run the program. A classic example of this is types. Some systems mark the elements on the stack with their type (e.g. PostScript), thus requiring run time type checking. This is expensive and since it gives dynamic binding, not good. Hubert Matthews suggested that these wonder forth chips should be extended to have an extra stack for this purpose (the do it in hardware approach), this certainly doesn't deal with the dynamic binding issue though and seems to be rather a waste of memory and chip space (yes I suppose forth has plenty of both to waste...) 3) Is it useful in a language/environment that is usually used by a single programmer to have these extensions standardised so that more than just that programmer can follow programs produced using these extensions. Yes it is useful to have standards, because it means that the programmer can communicate with the rest of humanity. Standards are also useful since it saves a great deal of duplicated work the world over. It is my attitude that if you can copy it why write it?! :-> I would be interested to hear your comments on the above (if you address each topic in a seperate article with subject lines like "New Features for Forth", "Extensible or Preprocesor" and "Single User Standards" then the discussion will not get all mixed up again.) I should also say that people might not agree with some of the assertions I have made in question 3 above, again I would be interested to hear your comments under the appropriate subject. Regards, ===Fraser From don@brillig.umd.edu Sun Sep 25 01:49:42 1988 Date: Sun, 25 Sep 88 01:49:42 EDT To: NeWS-makers@brillig.umd.edu Subject: The NeWS Book From: mcvax!ritd.co.uk!mr@uunet.UU.NET Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have been trying to track down "The NeWS Book" by Arden,Gosling, Rosenthal with local (UK) suppliers; they inform me that it will not be published until March/April 1989. Anyone got better info? TIA, Martin Reed, Racal Imaging Systems Ltd +--------------------------------------------------------+ |uucp: mr@ritd.co.uk,{uunet!ukc!ritd,sun!sunuk!brains}!mr| `Just hold |Global String: +44 252 622144 | these two |Paper: 309 Fleet Road, Fleet, Hants, England, GU13 8BU | wires...' +--------------------------------------------------------+ Nobody is responsible for anything I say. Including me. From don@brillig.umd.edu Sun Sep 25 01:50:22 1988 Date: Sun, 25 Sep 88 01:50:22 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you should use NeWS as a tool to learn PostScript From: super!rminnich@uunet.uu.net (Ronald G Minnich) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13655@mimsy.UUCP> don@brillig.umd.edu.UUCP (Don Hopkins) writes: >The fact that the PostScript interpreter in NeWS is different than the >PostScript interpreter (whatever brand it is) that runs in your laser >printer doesn't mean that it's harder to learn PostScript in NeWS. Of Actually, there is one problem with playing with NeWS that i have found. You screw up, and you blow your window manager out of the water. Then it is almost impossible to determine the state of the world, given that you have canvasses floating around that have no (seeming) process attached to them, and you can't change your focus, and ... I would much prefer having an X window with a PS interpreter in it for learning. Then i only have to worry about blowing up that window, not my whole server. I liked NeWS a lot, but it is too fragile. Sure, it has lightweight tasks and all that other nice event handling built in. When i started learning it it really looked like the 'right way to go'; in fact, it still does. Sometimes there is a difference between the right way to go and the thing that works. I think X11 works. For example, NeWS has no protection. You can just go trash the interpreter's universe and then find yourself in a very unhappy state without a paddle. No fun. I have yet to trash the X server in the ways i trashed the NeWS server. It could be that NeWS is just running under the wrong OS. A good impedance match of NeWs to OS would be a NeWS on the amiga, as much of what NeWS does (event queues, lightweight tasks, etc.) has an almost eery resemblance to what the amiga Rom Kernel and Intuition support. And the same problems exist, too, the biggest being no protection. Maybe NeWs would be better under Mach ... ? I notice that there have been comparisons of NeWS to Unix, in the sense that NeWS represents a technically superior system much as Unix one time represented a technically superior system that might not have caught on. There is one key difference. By the time Unix really started to catch on, it was no longer technically superior. In fact nowadays we are more bound by its limitations than overawed by its abilities. If i had to compare NeWS to an OS, i would compare it to the Apollo Domain system or Multics, which are technically superior but have also remained vendor-specific and hence something of a niche system. I think the analogy that really holds is Unix --> X11, Multics --> NeWS. And we all know which OS 'won' in the sense of being 'universal'. We also have a pretty good idea which is better, i think ... ron From don@brillig.umd.edu Sun Sep 25 01:50:51 1988 Date: Sun, 25 Sep 88 01:50:51 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why you should use NeWS as a tool to learn PostScript From: clyde!watmath!utgpu!utzoo!dciem!trigraph!john@bellcore.com (John Chew) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <2407@uhccux.uhcc.hawaii.edu> lee@uhccux.uhcc.hawaii.edu (Greg Lee) writes: >Maybe not all readers of this discussion know that you can do a >certain amount of playing around without NeWS. The PS interpreter >inside the Apple LW, at least, has an interactive mode. You can >can have it calculate and display values on your screen, so long >as the values have string values. For images, you have to wait >for a page to print, though, so that slows things down. > > Greg, lee@uhccux.uhcc.hawaii.edu If you have a Mac, another good way to learn PostScript is to buy a copy of LaserTalk, by Emerald City Software (with whom I have no connection, other than by virtue of being a satisfied customer). LaserTalk is a PostScript programming environment with basic debugging features (breakpointing, stepping and tracing through code, dictionary browsing, continuous display of a user-configurable set of status variables), a reasonable editor, and an online hierarchical copy of the operator summary in the Red Book. You can also preview a page image on your screen at varying resolution without running off hardcopy. I could not do any serious PostScript work without LaserTalk or something like it. Programming PostScript blindly and running off hardcopy to test it is an obscene idea from the dark ages of batch programming and punched cards. Connecting a terminal to a LaserWriter and talking to its interactive interpreter is still a pretty sick idea. It's like debugging a graphics program in C without a debugger or a raster device. I wish I had an opinion on NeWS, but that'll have to wait until we get a Sun here.... John Chew -- john j. chew, iii poslfit@utorgpu.bitnet trigraph, inc. poslfit@gpu.utcs.toronto.edu toronto, canada {uunet!mnetor!utzoo,utgpu,utcsri}!trigraph!john [it is my opinion that these are solely my opinions.] From don@brillig.umd.edu Sun Sep 25 01:50:59 1988 Date: Sun, 25 Sep 88 01:50:59 EDT To: NeWS-makers@brillig.umd.edu Subject: A screensaver for NeWS and X11/NeWS window managers From: bates@stat.wisc.edu (Douglas M. Bates) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does anyone have code for a screensaver for NeWS? My environment is NeWS 1.0 (but I hope to upgrade to NeWS 1.1 very soon) on Sun-3's under SunOS 4.0. By a screensaver, I mean something that monitors keystrokes and mouse movements and blanks the screen if there has been no activity for a set period of time. On a somewhat different note, are specifications for the X11/NeWS server to be incorporated in SunOS 4.1 available? I can imagine how a single server can merge the functions of an X server and a NeWS server but I can't think of how a window manager is going to function if both styles of windows can be displayed simultaneously. From don@brillig.umd.edu Sun Sep 25 01:54:11 1988 Date: Sun, 25 Sep 88 01:54:11 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: pacbell!unet!childers@ames.arc.nasa.gov (Richard Childers) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13613@mimsy.UUCP> don@brillig.umd.edu.UUCP (Don Hopkins) writes: >Hey all you Forth enthusiasts (and antagonists!!!) out there: Postscript is, *at best*, a highly specialized subset of Forth ... >You can take a look and feel for yourself, if you go to the Sun User >Group Southwest Regional Conference in Albuquerque, on September 30th. Ah, I knew there was *something* commercial involved. >I'll be demonstrating the HyperTIES hypermedia browser, and the >UniPress Emacs text editor, two NeWS applications I've worked on that >make extensive use of interactive PostScript. And selling them, no doubt. Please don't use the Usenet for advertising, covertly or overtly. -- "The leech's kiss, the squid's embrace, ..!{amdahl,ames,oliveb,pacbell}! The prurient ape's defiling touch: childers@chaos.unet.pacbell.COM And do you like the human race ? No, not much." -- Aldous Huxley, 'Ape And Essence' From don@brillig.umd.edu Sun Sep 25 01:54:30 1988 Date: Sun, 25 Sep 88 01:54:30 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: ron@topaz.rutgers.edu (Ron Natalie) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Lighten up, chum. HyperTies and pie-menus are Don's research projects at the University of Maryland. Don has done more than anyone outside of Sun (perhaps even inside of Sun as well) to further the interactive postscript environment as provided by NeWS. Don's stuff is of such a high quality that Sun goes out of their way to make sure that there is a workstation at his disposal to demonstrate whatever he's cooked up this time. From don@brillig.umd.edu Sun Sep 25 01:54:56 1988 Date: Sun, 25 Sep 88 01:54:56 EDT To: NeWS-makers@brillig.umd.edu Subject: Learning PostScript (was Why you should{n't} use NeWS...) From: peregrine!zardoz!dhw68k!dauith@elroy.jpl.nasa.gov (David B. Shapiro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The majority opinion seems to be that NeWS is indeed a good way to learn PostScript. I've seen ads for NeWS on a Mac II, but nothing for lesser Macs -- is there anything? If not, what *is* the best way to learn PS on a Mac (and no, I *don't* have sufficient access to a LaserWriter :-( ) David Shapiro UUCP: ...{hplabs, trwrb}!felix!dhw68k!dauith Internet: dauith@dhw68k.cts.com -- UUCP: ...{hplabs, trwrb}!felix!dhw68k!dauith Internet: dauith@dhw68k.cts.com From don@brillig.umd.edu Sun Sep 25 01:56:27 1988 Date: Sun, 25 Sep 88 01:56:27 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Why is NeWS better than Display PostScript? From: mtxinu!sybase!kiwi!barry@ucbvax.Berkeley.EDU (barry klawans) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809212112.AA18188@daedalus> brianc@DAEDALUS.UCSF.EDU (Brian Colfer) writes: >Why would any want Display PostScript (like NeXT) when NeWS sounds >so good? One BIG difference between Display Postscript and NeWS is that NeWS is an environment. NeWS includes a windowing system written in Postscript, while Display Postscript (at least as I understand it) only deals with the contents of windows. In other words if you are using display postscript you talk to some window system (ie NeXT's) to open a window, and then you use Postscript to describe the contents of the window. This suggests to me that talking to a Display Postscript window will be similar to talking to a window. If you want to play around with Postscript where you can have an open window running an interactive Postscript session with the output going to another window, NeWS seems like the choice. I won't pass judgement on which is the prefered platform for commercial applications until I get a chance to work with Display Postscript. Barry Klawans Any opinions given are mine, not my company's. They don't want them. UUCP: {mtxinu,sun,pyramid,pacbell}!sybase!barry "All of my friends are traitors." - Manuel M. Costa From don@brillig.umd.edu Sun Sep 25 01:58:05 1988 Date: Sun, 25 Sep 88 01:58:05 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: type checking (I want PostScript) -- give NeWS a try! From: cat.cmu.edu!ns@pt.cs.cmu.edu (Nicholas Spies) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Could someone explain the relation between NeWS and Display PostScript? Also, does anyone know _why_ PostScript and Forth are similar? Is it just a consequence of both being stack-based, or was PostScript developed from Forth? Or from L* (L-star)? (L* was developed at CMU some years ago and also used datatyping of stack items; sorry I don't name of its author offhand...) I've always wondered what might constitute the smallest set of language primitives that would allow the construction of an arbitrary number of program constructs of arbitrary complexity (that is, "any program"). Forth, as defined in F-83, has about 130 language primitives (of which, usually, only a third or so are Forth "primitives" defined in machine code, depending on the taste of the implementor). In contrast, POP-11 (mentioned by Dick Pountain in Byte a while ago) is based on a vitual machine that has only 17 instructions (it is also stack-based). POP-11 combines aspects of Forth, LISP, Prolog and even Pascal: it compiles to VM instructions and in interpreted (sort of like Forth); makes extensive used of lists; has built-in sophisticated pattern-matching and database support, but looks fairly much like a structured procedural language. You also have access to compiler, as in Forth... As a further digression, factorial of n can be calculated in POP-11 with: define fact(n); if n == 1 then 1 else n * fact(n-1) endif; enddefine; Although Forth is fun to work with, its primitives seem rather arbitrary, with (useful) oddities such as -TRAILING, >BODY and TIB having the same official status as DUP and SWAP. Perhaps Forth standardization (which I feel is sine qua non for its general acceptance) would benefit from factoring and defining genuine, irreducable primitives on the one hand, and then the environment/I-O aspects of the language in terms of these primitives, of course leaving actual details of implementation to implementors. Distilling Forth down to a smaller set of kernal primitives might make it more consistant and, paradoxically, closer to the minimalist philosophy espoused by Chuck Moore than Forth as it now exists... Alpha-POP for the Mac is available from: Cognitive Appliations Ltd Computable Functions, Inc. 4 Sillwood Terrace 35 South Orchard Drive Brighton Amherst, MA 01002 BN1 2LR 413-253-7637 England My only connection with Alpha-POP or its authors is as a satisfied customer. -- Nicholas Spies ns@cat.cmu.edu.arpa Center for Design of Educational Computing Carnegie Mellon University From don@brillig.umd.edu Thu Sep 29 13:23:05 1988 Date: Thu, 29 Sep 88 13:23:05 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: A screensaver for NeWS and X11/NeWS window managers From: salt!pepper!gerber@uunet.UU.NET (Andrew Gerber) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >Does anyone have code for a screensaver for NeWS? I have been using the Sun-supplied screenblank program under both NeWS and SunView and have been very satisfied. The line in my rc.local file that starts the screenblanker looks like this: /usr/bin/screenblank -d 900; (echo -n ' screenblank') >/dev/console ----------------------------------------------------------------------------- Andrew S. Gerber | McDonnell Douglas Communication Industry Systems uunet!salt!gerber | 5299 DTC Blvd, Englewood, CO 80111 salt!gerber@uunet.uu.net | (303) 220 6231 ----------------------------------------------------------------------------- From don@brillig.umd.edu Thu Sep 29 13:23:11 1988 Date: Thu, 29 Sep 88 13:23:11 EDT To: NeWS-makers@brillig.umd.edu Subject: remote NeWS servers - request for info From: mcvax!ukc!stl!stc!idec!prlhp1!colers@uunet.uu.net (Richard Cole) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hi, we are running NeWS 1.1 on SUNs. I have been trying to produce output on a remote server to no avail ! I have followed the procedure in the Sun NeWS manual; setenv NEWSSERVER `setnewshost xxxx` say -b"Hi" Hi where xxxx is the id of the Sun running the server. I get the following message on the server Network security violation: Rejected connection from yyyy where yyyy is the id of the mechine originating the message. I am new to NeWS so any help would be appreciated. Thanks in advance -- Richard Cole colers@prl.philips.co.uk From don@brillig.umd.edu Thu Sep 29 13:24:23 1988 Date: Thu, 29 Sep 88 13:24:23 EDT To: NeWS-makers@brillig.umd.edu Subject: KeySee: A program to monitor and display your keyboard From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) One good hack deserves another. Ever since I got ahold of Don Hopkins's MouSee I have been toying with writing something that does for the Keyboard what MouSee does for the Mouse. This is the result. Among other things, KeySee demonstrates how to use dictionaries as interest names, how to handle raw keyboard input, how to manage canvases with LOTS of items, how to play games with the icon, how to trick items into displaying other than where they really are (i.e.: in the icon), and how to subclass items and windows. Note that this program will only work on systems that have Sun-3 style keyboards. This includes, I believe, all Sun-3s and Sun-4s and possibly even some of the newer Sun-2s. Enjoy, Stan Switzer sjs@ctt.bellcore.com -------------------------------------------------------------------- #!/usr/NeWS/bin/psh % % KeySee: % Display the keyboard. % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % /KeyItem LabeledItem dictbegin /ItemDownColor .5 .5 .5 rgbcolor def /ItemRadius 4 def /Station null def dictend classbegin /new { % label canvas width height => instance () /Center nullproc 6 3 roll /new super send begin ItemLabel /OU eq { % over/under key label /LowerLabel exch def /UpperLabel exch def } if currentdict end } def /ItemLabelFont /Times-Roman findfont 10 scalefont def /SetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store ItemValue ItemPaintedValue ne {/paint self send} if } def /JustSetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store } def /KS 2 def /PaintItem { ItemRadius KS 2 idiv dup ItemWidth KS sub ItemHeight KS sub rrectpath gsave ItemFillColor ItemValue null ne { ItemValue { pop ItemDownColor } if } if setcolor fill grestore ItemBorderColor setcolor stroke ShowLabel } def /OU { % over-under proc % if the Label is a proc, it is executed passing "true" to draw it % and "false" to return the width and height. % Hack: we pretend that the labels have no width and then % cshow them. { % draw it 0 currentfont fontdescent 2 idiv rmoveto gsave 0 currentfont fontheight rmoveto UpperLabel cshow grestore LowerLabel cshow } { 0 currentfont fontheight 2 mul } ifelse } def /reshape { % x y w h /reshape super send LabelSize % w h ItemHeight exch sub 2 div /LabelY exch def ItemWidth exch sub 2 div /LabelX exch def } def /SetStation { % stationcode => - 16#6F00 add % This is magic /Station exch def } def classend def /DummyKeyItem KeyItem [ ] classbegin /new { % canvas width height => instance () 4 1 roll /new super send } def /PaintItem { } def /SetStation { pop } def classend def /KeeSee DefaultWindow dictbegin /Items null def /ItemList null def /TmpDict null def /Watcher null def /IconKey null def dictbegin dictend classbegin /new { /new super send begin /PaintClient { ClientFillColor fillcanvas ClientCanvas setcanvas ItemList { paintitems } forall } def /TmpDict 20 dict def currentdict end } def /FrameLabel (Key See) def /IconLabel FrameLabel def /KeyWidth 24 def % Width (&Height) of Std Key /Border 4 def % border around keyboard proper /Key { % (Label) WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new KeyItem send pause } def /Dummy { % WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new DummyKeyItem send } def /CreateClientCanvas { /CreateClientCanvas super send % various items: /Items dictbegin (A) 0 get 1 (Z) 0 get { 1 string dup 0 4 -1 roll put dup 1 string copy cvn exch 1 Key def } for /D1 (!)(1)/OU 1 Key def /D2 (@)(2)/OU 1 Key def /D3 (#)(3)/OU 1 Key def /D4 ($)(4)/OU 1 Key def /D5 (%)(5)/OU 1 Key def /D6 (^)(6)/OU 1 Key def /D7 (&)(7)/OU 1 Key def /D8 (*)(8)/OU 1 Key def /D9 (\()(9)/OU 1 Key def /D0 (\))(0)/OU 1 Key def /Caps (Caps) 1.25 Key def /Left (Left) 1.5 Key def /Space () 9 Key def /SPC (Space) 2.25 Key def 0 0 /move SPC send /Right (Right) 1.5 Key def /Alt (Alt) 1.75 Key def /LShift (Shift) 2.25 Key def /RShift (Shift) 1.75 Key def /LF (LF) 1 Key def /L-C (<)(,)/OU 1 Key def /G-P (>)(.)/OU 1 Key def /Q-S (?)(/)/OU 1 Key def /Ctl (Ctl) 1.75 Key def /C-S (:)(;)/OU 1 Key def /Q-Q (")(')/OU 1 Key def /Ret (Return) 2.25 Key def /Tab (Tab) 1.5 Key def /O-B ({)([)/OU 1 Key def /C-B (})(])/OU 1 Key def /Del (Del) 1.5 Key def /Esc (Esc) 1 Key def /U-D (_)(-)/OU 1 Key def /P-E (+)(=)/OU 1 Key def /V-B (|)(\\)/OU 1 Key def /T-Q (~)(`)/OU 1 Key def /F1 (F1) 1 Key def /F2 (F2) 1 Key def /F3 (F3) 2 Key def /F4 (F4) 2 Key def /F5 (F5) 2 Key def /F6 (F6) 2 Key def /F7 (F7) 2 Key def /F8 (F8) 1 Key def /F9 (F9) 1 Key def /BS (BS) 1 Key def /L1 (L1) 1 Key def /L2 (L2) 1 Key def /X1 .5 Dummy def /L3 (L3) 1 Key def /L4 (L4) 1 Key def /X2 .5 Dummy def /L5 (L5) 1 Key def /L6 (L6) 1 Key def /X3 .5 Dummy def /L7 (L7) 1 Key def /L8 (L8) 1 Key def /X4 .5 Dummy def /L9 (L9) 1 Key def /L10 (L10) 1 Key def /X5 .5 Dummy def /X0 2.5 Dummy def /X6 .5 Dummy def /R1 (R1) 1 Key def /R2 (R2) 1 Key def /R3 (R3) 1 Key def /X7 .5 Dummy def /R4 (R4) 1 Key def /R5 (R5) 1 Key def /R6 (R6) 1 Key def /X8 .5 Dummy def /R7 (R7) 1 Key def /R8 (R8) 1 Key def /R9 (R9) 1 Key def /X9 .5 Dummy def /R10 (R10) 1 Key def /R11 (R11) 1 Key def /R12 (R12) 1 Key def /X10 .5 Dummy def /R13 (R13) 1 Key def /R14 (R14) 1 Key def /R15 (R15) 1 Key def dictend store % Display order /ItemList Items begin [ % Key rows from bottom to top [ X0 119 Caps Left Space Right 19 Alt ] Station [ 95 L9 97 L10 X5 99 LShift Z X C V B N M L-C G-P Q-S RShift LF X10 112 R13 R14 R15 ] Station [ 72 L7 L8 X4 76 Ctl A S D F G H J K L C-S Q-Q 89 Ret X9 91 R10 R11 R12 ] Station [ 49 L5 51 L6 X3 53 Tab Q W E R T Y U I O P O-B C-B Del X8 68 R7 R8 R9 ] Station [ 25 L3 L4 X2 29 Esc D1 D2 D3 D4 D5 D6 D7 D8 D9 D0 U-D P-E 88 V-B 42 T-Q X7 45 R4 R5 R6 ] Station [ 1 L1 3 L2 X1 5 F1 F2 8 F3 10 F4 12 F5 14 F6 16 F7 F8 F9 43 BS X6 21 R1 R2 R3 ] Station ] end store } def /PaintIconKey { % paints IconKey centered in icon IconKey null ne { { ItemHeight ItemWidth } IconKey send IconWidth exch sub 2 idiv exch IconHeight exch sub 2 idiv gsave translate /PaintItem IconKey send grestore } if } def /PaintIcon { gsave IconCanvas setcanvas IconFillColor fillcanvas IconBorderColor strokecanvas IconTextColor setcolor PaintIconKey PaintIconLabel grestore } def /flipiconic { /flipiconic super send Iconic? { painticon } if % update icon image } def /SetIconKey { gsave IconCanvas setcanvas IconKey null ne { % erase previous key image { ItemWidth ItemHeight } IconKey send IconWidth 2 index sub 2 idiv IconHeight 2 index sub 2 idiv moveto rect IconFillColor setshade fill } if JustSetIconKey IconTextColor setcolor PaintIconKey grestore } def /JustSetIconKey { Items begin dup Space eq { % normal space bar is too big! /ItemValue get SPC dup /ItemValue 4 -1 roll put } if end /IconKey exch def } def /watch { % start event loop Watcher null ne { Watcher killprocess } if /Watcher { createevent dup begin /Name dictbegin % dict: keycode => item Items { exch pop dup /Station get dup null eq { pop pop } { exch def } ifelse } forall dictend def /Priority 10 def end expressinterest { awaitevent begin % Note: Name is key item because of interest /Name dict pause % perhaps this will let us do real work first % "self /foo exch send" keeps the method compiler % from removing self send. This is important to that % when (Just)SetIconKey is invoked it will end up % setting IconKey in the object, not in the event. % failing to do this results in having the interest % (which is apparently reused for all keyboard events) % referencing an item and consequently its parent (the % ClientCanvas), causing the canvas to just stick around % forever. Probably defing bogus entries in events should % be an error. This was no fun to find. Action /DownTransition eq Iconic? { /JustSetKeyValue Name send Name self /SetIconKey exch send } { /SetKeyValue Name send Name self /JustSetIconKey exch send } ifelse end } loop } fork def } def /Station { % [ KeyItems-and-indexes ] => [ KeyItems ] % sets the station codes in the array's items. mark exch 0 exch { % [ item item ... n currentitem dup type /integertype eq { exch pop } { 2 copy /SetStation exch send exch 1 add } ifelse } forall pop ] } def /ShapeClientCanvas { % This is a real good way to position items! /ShapeClientCanvas super send Recalc % recalc layout params ClientCanvas setcanvas % now, move the items to their rightful places TmpDict begin /SepX 0 def /SepY 0 def /Y Border def ItemList { /X Border def /MaxH 0 def { X Y /move 3 index send /ItemHeight 1 index send dup MaxH gt { /MaxH exch def } { pop } ifelse /ItemWidth exch send X add SepX add /X exch store } forall /Y Y MaxH SepY add add def } forall end Watcher null eq { watch } if } def /placeit { % one click placement and sizing gsave fboverlay setcanvas getclick grestore BorderLeft BorderRight add 21 KeyWidth mul add Border 2 mul add BorderTop BorderBottom add 6 KeyWidth mul add Border 2 mul add 3 -1 roll 1 index sub 3 1 roll % % ulx uly w h => llx lly w h reshape } def /Recalc { % - => - -- recalculates various layout parameters % for when I decide to handle resizing! } def classend def /win framebuffer /new KeeSee send def /placeit win send /map win send % ----- If anything follows this line it is not part of the program ----- From don@brillig.umd.edu Thu Sep 29 13:23:47 1988 Date: Thu, 29 Sep 88 13:23:47 EDT To: NeWS-makers@brillig.umd.edu Subject: KeySee (Update!): Monitors AND simulates keyboard. From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) After posting KeySee it occurred to me that it could just as well simulate input as monitor it. The following slightly modified version allows you to "type" using your mouse (of course you'll have to use "click-to-type" mode to make use of this feature). In order to make it possible to enter shifted keys, the left shift, the left meta and the control key are "sticky": one click is down, another is up. Please be aware that pressing the KeySee shift "button" affects your real keyboard as well as your virtual keyboard. Again, it will need some modification to work correctly for non Sun-3 style keyboards. Enjoy, Stan Switzer sjs@ctt.bellcore.com P.S. It is interesting to see how many simultaneous down keys can be detected. It is also interesting how "L1" works. Note that "Alt" is known to NeWS as "F10". --------------------------------------------------------------------- #!/usr/NeWS/bin/psh % % KeySee: % Display the keyboard and simulate keyboard input. % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % /KeyItem LabeledItem dictbegin /ItemDownColor .5 .5 .5 rgbcolor def /ItemRadius 4 def /Station null def /StickyKey? false def /ItemValue false def dictend classbegin /new { % label canvas width height => instance () /Center nullproc 6 3 roll /new super send begin ItemLabel /OU eq { % over/under key label /LowerLabel exch def /UpperLabel exch def } if currentdict end } def /ItemLabelFont /Times-Roman findfont 10 scalefont def /SetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store ItemValue ItemPaintedValue ne {/paint self send} if } def /JustSetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store } def /KS 2 def /PaintItem { ItemRadius KS 2 idiv dup ItemWidth KS sub ItemHeight KS sub rrectpath gsave ItemFillColor ItemValue null ne { ItemValue { pop ItemDownColor } if } if setcolor fill grestore ItemBorderColor setcolor stroke ShowLabel } def /OU { % over-under proc % if the Label is a proc, it is executed passing "true" to draw it % and "false" to return the width and height. % Hack: we pretend that the labels have no width and then % cshow them. { % draw it 0 currentfont fontdescent 2 idiv rmoveto gsave 0 currentfont fontheight rmoveto UpperLabel cshow grestore LowerLabel cshow } { 0 currentfont fontheight 2 mul } ifelse } def /reshape { % x y w h /reshape super send LabelSize % w h ItemHeight exch sub 2 div /LabelY exch def ItemWidth exch sub 2 div /LabelX exch def } def /SetStation { % stationcode => - 16#6F00 add % This is magic /Station exch def } def /ClientDown { true FakeKey } def /ClientUp { false FakeKey } def /FakeKey { StickyKey? { dup { /ItemValue ItemValue not store } if } { /ItemValue exch store true } ifelse { createevent dup begin /Name Station def /Action ItemValue /DownTransition /UpTransition ifelse def end sendevent } if } def /SetSticky { /StickyKey? exch def } def classend def /DummyKeyItem KeyItem [ ] classbegin /new { % canvas width height => instance () 4 1 roll /new super send } def /PaintItem { } def /SetStation { pop } def classend def /KeeSee DefaultWindow dictbegin /Items null def /ItemList null def /TmpDict null def /Watcher null def /IconKey null def /ItemProc null def dictbegin dictend classbegin /new { /new super send begin /PaintClient { ClientFillColor fillcanvas ClientCanvas setcanvas ItemList { paintitems } forall } def /TmpDict 20 dict def currentdict end } def /FrameLabel (Key See) def /IconLabel FrameLabel def /KeyWidth 24 def % Width (&Height) of Std Key /Border 4 def % border around keyboard proper /Key { % (Label) WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new KeyItem send pause } def /Dummy { % WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new DummyKeyItem send } def /Sticky { % item => item true /SetSticky 2 index send } def /CreateClientCanvas { /CreateClientCanvas super send % various items: /Items dictbegin (A) 0 get 1 (Z) 0 get { 1 string dup 0 4 -1 roll put dup 1 string copy cvn exch 1 Key def } for /D1 (!)(1)/OU 1 Key def /D2 (@)(2)/OU 1 Key def /D3 (#)(3)/OU 1 Key def /D4 ($)(4)/OU 1 Key def /D5 (%)(5)/OU 1 Key def /D6 (^)(6)/OU 1 Key def /D7 (&)(7)/OU 1 Key def /D8 (*)(8)/OU 1 Key def /D9 (\()(9)/OU 1 Key def /D0 (\))(0)/OU 1 Key def /Caps (Caps) 1.25 Key def /Left (Left) 1.5 Key Sticky def /Space () 9 Key def /SPC (Space) 2.25 Key def 0 0 /move SPC send /Right (Right) 1.5 Key def /Alt (Alt) 1.75 Key def /LShift (Shift) 2.25 Key Sticky def /RShift (Shift) 1.75 Key def /LF (LF) 1 Key def /L-C (<)(,)/OU 1 Key def /G-P (>)(.)/OU 1 Key def /Q-S (?)(/)/OU 1 Key def /Ctl (Ctl) 1.75 Key Sticky def /C-S (:)(;)/OU 1 Key def /Q-Q (")(')/OU 1 Key def /Ret (Return) 2.25 Key def /Tab (Tab) 1.5 Key def /O-B ({)([)/OU 1 Key def /C-B (})(])/OU 1 Key def /Del (Del) 1.5 Key def /Esc (Esc) 1 Key def /U-D (_)(-)/OU 1 Key def /P-E (+)(=)/OU 1 Key def /V-B (|)(\\)/OU 1 Key def /T-Q (~)(`)/OU 1 Key def /F1 (F1) 1 Key def /F2 (F2) 1 Key def /F3 (F3) 2 Key def /F4 (F4) 2 Key def /F5 (F5) 2 Key def /F6 (F6) 2 Key def /F7 (F7) 2 Key def /F8 (F8) 1 Key def /F9 (F9) 1 Key def /BS (BS) 1 Key def /L1 (L1) 1 Key def /L2 (L2) 1 Key def /X1 .5 Dummy def /L3 (L3) 1 Key def /L4 (L4) 1 Key def /X2 .5 Dummy def /L5 (L5) 1 Key def /L6 (L6) 1 Key def /X3 .5 Dummy def /L7 (L7) 1 Key def /L8 (L8) 1 Key def /X4 .5 Dummy def /L9 (L9) 1 Key def /L10 (L10) 1 Key def /X5 .5 Dummy def /X0 2.5 Dummy def /X6 .5 Dummy def /R1 (R1) 1 Key def /R2 (R2) 1 Key def /R3 (R3) 1 Key def /X7 .5 Dummy def /R4 (R4) 1 Key def /R5 (R5) 1 Key def /R6 (R6) 1 Key def /X8 .5 Dummy def /R7 (R7) 1 Key def /R8 (R8) 1 Key def /R9 (R9) 1 Key def /X9 .5 Dummy def /R10 (R10) 1 Key def /R11 (R11) 1 Key def /R12 (R12) 1 Key def /X10 .5 Dummy def /R13 (R13) 1 Key def /R14 (R14) 1 Key def /R15 (R15) 1 Key def dictend store % Display order /ItemList Items begin [ % Key rows from bottom to top [ X0 119 Caps Left Space Right 19 Alt ] Station [ 95 L9 97 L10 X5 99 LShift Z X C V B N M L-C G-P Q-S RShift LF X10 112 R13 R14 R15 ] Station [ 72 L7 L8 X4 76 Ctl A S D F G H J K L C-S Q-Q 89 Ret X9 91 R10 R11 R12 ] Station [ 49 L5 51 L6 X3 53 Tab Q W E R T Y U I O P O-B C-B Del X8 68 R7 R8 R9 ] Station [ 25 L3 L4 X2 29 Esc D1 D2 D3 D4 D5 D6 D7 D8 D9 D0 U-D P-E 88 V-B 42 T-Q X7 45 R4 R5 R6 ] Station [ 1 L1 3 L2 X1 5 F1 F2 8 F3 10 F4 12 F5 14 F6 16 F7 F8 F9 43 BS X6 21 R1 R2 R3 ] Station ] end store /ItemProc Items forkitems store } def /PaintIconKey { % paints IconKey centered in icon IconKey null ne { { ItemHeight ItemWidth } IconKey send IconWidth exch sub 2 idiv exch IconHeight exch sub 2 idiv gsave translate /PaintItem IconKey send grestore } if } def /PaintIcon { gsave IconCanvas setcanvas IconFillColor fillcanvas IconBorderColor strokecanvas IconTextColor setcolor PaintIconKey PaintIconLabel grestore } def /flipiconic { /flipiconic super send Iconic? { painticon } if % update icon image } def /SetIconKey { gsave IconCanvas setcanvas IconKey null ne { % erase previous key image { ItemWidth ItemHeight } IconKey send IconWidth 2 index sub 2 idiv IconHeight 2 index sub 2 idiv moveto rect IconFillColor setshade fill } if JustSetIconKey IconTextColor setcolor PaintIconKey grestore } def /JustSetIconKey { Items begin dup Space eq { % normal space bar is too big! /ItemValue get SPC dup /ItemValue 4 -1 roll put } if end /IconKey exch def } def /watch { % start event loop Watcher null ne { Watcher killprocess } if /Watcher { createevent dup begin /Name dictbegin % dict: keycode => item Items { exch pop dup /Station get dup null eq { pop pop } { exch def } ifelse } forall dictend def /Priority 10 def end expressinterest { awaitevent begin % Note: Name is key item because of interest /Name dict pause % perhaps this will let us do real work first % "self /foo exch send" keeps the method compiler % from removing self send. This is important to that % when (Just)SetIconKey is invoked it will end up % setting IconKey in the object, not in the event. % failing to do this results in having the interest % (which is apparently reused for all keyboard events) % referencing an item and consequently its parent (the % ClientCanvas), causing the canvas to just stick around % forever. Probably defing bogus entries in events should % be an error. This was no fun to find. Action /DownTransition eq Iconic? { /JustSetKeyValue Name send Name self /SetIconKey exch send } { /SetKeyValue Name send Name self /JustSetIconKey exch send } ifelse end } loop } fork def } def /Station { % [ KeyItems-and-indexes ] => [ KeyItems ] % sets the station codes in the array's items. mark exch 0 exch { % [ item item ... n currentitem dup type /integertype eq { exch pop } { 2 copy /SetStation exch send exch 1 add } ifelse } forall pop ] } def /ShapeClientCanvas { % This is a real good way to position items! /ShapeClientCanvas super send Recalc % recalc layout params ClientCanvas setcanvas % now, move the items to their rightful places TmpDict begin /SepX 0 def /SepY 0 def /Y Border def ItemList { /X Border def /MaxH 0 def { X Y /move 3 index send /ItemHeight 1 index send dup MaxH gt { /MaxH exch def } { pop } ifelse /ItemWidth exch send X add SepX add /X exch store } forall /Y Y MaxH SepY add add def } forall end Watcher null eq { watch } if } def /placeit { % one click placement and sizing gsave fboverlay setcanvas getclick grestore BorderLeft BorderRight add 21 KeyWidth mul add Border 2 mul add BorderTop BorderBottom add 6 KeyWidth mul add Border 2 mul add 3 -1 roll 1 index sub 3 1 roll % % ulx uly w h => llx lly w h reshape } def /Recalc { % - => - -- recalculates various layout parameters % for when I decide to handle resizing! } def classend def /win framebuffer /new KeeSee send def /placeit win send /map win send % ---- anything after this line is not part of the program ---- From don@brillig.umd.edu Thu Sep 29 13:24:02 1988 Date: Thu, 29 Sep 88 13:24:02 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: KeySee (Update Again!): Stupid bug fix From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am *SO* embarrrassed. Previous versions of KeySee neglected to load "liteitem.ps" before using it. I always have "liteitem" based tools running, so the problem never hit me. Anyway, here is a "correct" version. I'd just post the fix, but there is a new feature as well: you can turn on or off the keyboard monitoring feature (since it is pretty slow on some machines) with a cycle button. Sorry for the wasted net bandwidth, but at least it's not as big as "hproff" :-) Brickbats and accolades to: Stan Switzer sjs@ctt.bellcore.com ---------------------------------------------------------- #!/usr/NeWS/bin/psh % % KeySee: % Display the keyboard and simulate keyboard input. % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % systemdict /Item known not { (NeWS/liteitem.ps) run } if /KeyItem LabeledItem dictbegin /ItemDownColor .5 .5 .5 rgbcolor def /ItemRadius 4 def /Station null def /StickyKey? false def /ItemValue false def dictend classbegin /new { % label canvas width height => instance () /Center nullproc 6 3 roll /new super send begin ItemLabel /OU eq { % over/under key label /LowerLabel exch def /UpperLabel exch def } if currentdict end } def /ItemLabelFont /Times-Roman findfont 10 scalefont def /SetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store ItemValue ItemPaintedValue ne {/paint self send} if } def /JustSetKeyValue { % bool => - -- true == down, false == up /ItemValue exch store } def /KS 2 def /PaintItem { ItemRadius KS 2 idiv dup ItemWidth KS sub ItemHeight KS sub rrectpath gsave ItemFillColor ItemValue null ne { ItemValue { pop ItemDownColor } if } if setcolor fill grestore ItemBorderColor setcolor stroke ShowLabel } def /OU { % over-under proc % if the Label is a proc, it is executed passing "true" to draw it % and "false" to return the width and height. % Hack: we pretend that the labels have no width and then % cshow them. { % draw it 0 currentfont fontdescent 2 idiv rmoveto gsave 0 currentfont fontheight rmoveto UpperLabel cshow grestore LowerLabel cshow } { 0 currentfont fontheight 2 mul } ifelse } def /reshape { % x y w h /reshape super send LabelSize % w h ItemHeight exch sub 2 div /LabelY exch def ItemWidth exch sub 2 div /LabelX exch def } def /SetStation { % stationcode => - 16#6F00 add % This is magic /Station exch def } def /ClientDown { true FakeKey } def /ClientUp { false FakeKey } def /FakeKey { StickyKey? { dup { /ItemValue ItemValue not store } if } { /ItemValue exch store true } ifelse { createevent dup begin /Name Station def /Action ItemValue /DownTransition /UpTransition ifelse def end sendevent } if } def /SetSticky { /StickyKey? exch def } def classend def /DummyKeyItem KeyItem [ ] classbegin /new { % canvas width height => instance () 4 1 roll /new super send } def /PaintItem { } def /SetStation { pop } def classend def /OnOffItem CycleItem dictbegin /Station null def dictend classbegin /new { % notify can => instance /cycle [ (On) (Off) ] /Right 5 3 roll 0 0 /new super send } def /SetStation { pop } def classend def /KeeSee DefaultWindow dictbegin /Items null def /ItemList null def /TmpDict null def /Watcher null def /IconKey null def /ItemProc null def dictbegin dictend classbegin /new { /new super send begin /PaintClient { ClientFillColor fillcanvas ClientCanvas setcanvas ItemList { paintitems } forall } def /TmpDict 20 dict def currentdict end } def /FrameLabel (Key See) def /IconLabel FrameLabel def /KeyWidth 24 def % Width (&Height) of Std Key /Border 4 def % border around keyboard proper /Key { % (Label) WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new KeyItem send pause } def /Dummy { % WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new DummyKeyItem send } def /Sticky { % item => item true /SetSticky 2 index send } def /CreateClientCanvas { /CreateClientCanvas super send % various items: /Items dictbegin (A) 0 get 1 (Z) 0 get { 1 string dup 0 4 -1 roll put dup 1 string copy cvn exch 1 Key def } for /D1 (!)(1)/OU 1 Key def /D2 (@)(2)/OU 1 Key def /D3 (#)(3)/OU 1 Key def /D4 ($)(4)/OU 1 Key def /D5 (%)(5)/OU 1 Key def /D6 (^)(6)/OU 1 Key def /D7 (&)(7)/OU 1 Key def /D8 (*)(8)/OU 1 Key def /D9 (\()(9)/OU 1 Key def /D0 (\))(0)/OU 1 Key def /Caps (Caps) 1.25 Key def /Left (Left) 1.5 Key Sticky def /Space () 9 Key def /SPC (Space) 2.25 Key def 0 0 /move SPC send /Right (Right) 1.5 Key def /Alt (Alt) 1.75 Key def /LShift (Shift) 2.25 Key Sticky def /RShift (Shift) 1.75 Key def /LF (LF) 1 Key def /L-C (<)(,)/OU 1 Key def /G-P (>)(.)/OU 1 Key def /Q-S (?)(/)/OU 1 Key def /Ctl (Ctl) 1.75 Key Sticky def /C-S (:)(;)/OU 1 Key def /Q-Q (")(')/OU 1 Key def /Ret (Return) 2.25 Key def /Tab (Tab) 1.5 Key def /O-B ({)([)/OU 1 Key def /C-B (})(])/OU 1 Key def /Del (Del) 1.5 Key def /Esc (Esc) 1 Key def /U-D (_)(-)/OU 1 Key def /P-E (+)(=)/OU 1 Key def /V-B (|)(\\)/OU 1 Key def /T-Q (~)(`)/OU 1 Key def /F1 (F1) 1 Key def /F2 (F2) 1 Key def /F3 (F3) 2 Key def /F4 (F4) 2 Key def /F5 (F5) 2 Key def /F6 (F6) 2 Key def /F7 (F7) 2 Key def /F8 (F8) 1 Key def /F9 (F9) 1 Key def /BS (BS) 1 Key def /L1 (L1) 1 Key def /L2 (L2) 1 Key def /X1 .5 Dummy def /L3 (L3) 1 Key def /L4 (L4) 1 Key def /X2 .5 Dummy def /L5 (L5) 1 Key def /L6 (L6) 1 Key def /X3 .5 Dummy def /L7 (L7) 1 Key def /L8 (L8) 1 Key def /X4 .5 Dummy def /L9 (L9) 1 Key def /L10 (L10) 1 Key def /X5 .5 Dummy def /X0 2.5 Dummy def /X6 .5 Dummy def /R1 (R1) 1 Key def /R2 (R2) 1 Key def /R3 (R3) 1 Key def /X7 .5 Dummy def /R4 (R4) 1 Key def /R5 (R5) 1 Key def /R6 (R6) 1 Key def /X8 .5 Dummy def /R7 (R7) 1 Key def /R8 (R8) 1 Key def /R9 (R9) 1 Key def /X9 .5 Dummy def /R10 (R10) 1 Key def /R11 (R11) 1 Key def /R12 (R12) 1 Key def /X10 .5 Dummy def /R13 (R13) 1 Key def /R14 (R14) 1 Key def /R15 (R15) 1 Key def /X11 .5 Dummy def /OnOff { ItemValue 0 eq { /watch } { /stopwatch } ifelse ThisWindow send } ClientCanvas /new OnOffItem send def 0 0 /move OnOff send % needs to be put somewhere dictend store % Display order /ItemList Items begin [ % Key rows from bottom to top [ X0 119 Caps Left Space Right 19 Alt X11 OnOff ] Station [ 95 L9 97 L10 X5 99 LShift Z X C V B N M L-C G-P Q-S RShift LF X10 112 R13 R14 R15 ] Station [ 72 L7 L8 X4 76 Ctl A S D F G H J K L C-S Q-Q 89 Ret X9 91 R10 R11 R12 ] Station [ 49 L5 51 L6 X3 53 Tab Q W E R T Y U I O P O-B C-B Del X8 68 R7 R8 R9 ] Station [ 25 L3 L4 X2 29 Esc D1 D2 D3 D4 D5 D6 D7 D8 D9 D0 U-D P-E 88 V-B 42 T-Q X7 45 R4 R5 R6 ] Station [ 1 L1 3 L2 X1 5 F1 F2 8 F3 10 F4 12 F5 14 F6 16 F7 F8 F9 43 BS X6 21 R1 R2 R3 ] Station ] end store /ItemProc Items forkitems store } def /PaintIconKey { % paints IconKey centered in icon IconKey null ne { { ItemHeight ItemWidth } IconKey send IconWidth exch sub 2 idiv exch IconHeight exch sub 2 idiv gsave translate /PaintItem IconKey send grestore } if } def /PaintIcon { gsave IconCanvas setcanvas IconFillColor fillcanvas IconBorderColor strokecanvas IconTextColor setcolor PaintIconKey PaintIconLabel grestore } def /flipiconic { /flipiconic super send Iconic? { painticon } if % update icon image } def /SetIconKey { gsave IconCanvas setcanvas IconKey null ne { % erase previous key image { ItemWidth ItemHeight } IconKey send IconWidth 2 index sub 2 idiv IconHeight 2 index sub 2 idiv moveto rect IconFillColor setshade fill } if JustSetIconKey IconTextColor setcolor PaintIconKey grestore } def /JustSetIconKey { Items begin dup Space eq { % normal space bar is too big! /ItemValue get SPC dup /ItemValue 4 -1 roll put } if end /IconKey exch def } def /stopwatch { % stop event loop Watcher null ne { Watcher killprocess } if } def /watch { % start event loop stopwatch /Watcher { createevent dup begin /Name dictbegin % dict: keycode => item Items { exch pop dup /Station get dup null eq { pop pop } { exch def } ifelse } forall dictend def /Priority 10 def end expressinterest { awaitevent begin % Note: Name is key item because of interest /Name dict pause % perhaps this will let us do real work first % "self /foo exch send" keeps the method compiler % from removing self send. This is important to that % when (Just)SetIconKey is invoked it will end up % setting IconKey in the object, not in the event. % failing to do this results in having the interest % (which is apparently reused for all keyboard events) % referencing an item and consequently its parent (the % ClientCanvas), causing the canvas to just stick around % forever. Probably defing bogus entries in events should % be an error. This was no fun to find. Action /DownTransition eq Iconic? { /JustSetKeyValue Name send Name self /SetIconKey exch send } { /SetKeyValue Name send Name self /JustSetIconKey exch send } ifelse end } loop } fork def } def /Station { % [ KeyItems-and-indexes ] => [ KeyItems ] % sets the station codes in the array's items. mark exch 0 exch { % [ item item ... n currentitem dup type /integertype eq { exch pop } { 2 copy /SetStation exch send exch 1 add } ifelse } forall pop ] } def /ShapeClientCanvas { % This is a real good way to position items! /ShapeClientCanvas super send Recalc % recalc layout params ClientCanvas setcanvas % now, move the items to their rightful places TmpDict begin /SepX 0 def /SepY 0 def /Y Border def ItemList { /X Border def /MaxH 0 def { X Y /move 3 index send /ItemHeight 1 index send dup MaxH gt { /MaxH exch def } { pop } ifelse /ItemWidth exch send X add SepX add /X exch store } forall /Y Y MaxH SepY add add def } forall end Watcher null eq { watch } if } def /placeit { % one click placement and sizing gsave fboverlay setcanvas getclick grestore BorderLeft BorderRight add 21 KeyWidth mul add Border 2 mul add BorderTop BorderBottom add 6 KeyWidth mul add Border 2 mul add 3 -1 roll 1 index sub 3 1 roll % % ulx uly w h => llx lly w h reshape } def /Recalc { % - => - -- recalculates various layout parameters % for when I decide to handle resizing! } def classend def /win framebuffer /new KeeSee send def /placeit win send /map win send % ----- If anything follows this line it is not part of the program! ----- From don@brillig.umd.edu Thu Sep 29 13:27:25 1988 Date: Thu, 29 Sep 88 13:27:25 EDT To: NeWS-makers@brillig.umd.edu Subject: Finder and other mac-bits... From: siegel@hc.dspo.gov (josh Siegel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A couple of months back, somebody mentioned they had written a finder for NeWS. Has anybody really done this? Also, I foudn mentioned of a mac.ps file... does anybody have a copy of this mythical file? thanks much --Josh Siegel -- Josh Siegel (siegel@hc.dspo.gov) I like using a C-47A "puff dragon" to go shooting beer cans with. From don@brillig.umd.edu Thu Sep 29 13:31:53 1988 Date: Thu, 29 Sep 88 13:31:53 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers - request for info From: allosaur.cis.ohio-state.edu!bob@tut.cis.ohio-state.edu (Bob Sutterfield) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > Network security violation: > Rejected connection from yyyy You need to use newshost. # newshost: add, remove or show the registry of hosts that are allowed to # connect to the NeWS server -=- Zippy sez, --Bob There's a little picture of ED MCMAHON doing BAD THINGS to JOAN RIVERS in a $200,000 MALIBU BEACH HOUSE!! From don@brillig.umd.edu Thu Sep 29 13:32:17 1988 Date: Thu, 29 Sep 88 13:32:17 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Anyone got a 'sprite' implementation for NeWS? From: ken@gatech.edu (Ken Seefried iii) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > >BTW, has anyone looked at porting NeWS to the TI 34020/FP chip combination? >It seems like it should be a real screamer. > > - Ralph W. Hyre, Jr. >Internet: ralphw@ius2.cs.cmu.edu Phone:(412)268-{2847,3275} CMU-{BUGS,DARK} Yes, its been thought of. Yes, it will be done in one form or another. Yes, it will scream. Unfortunately, the 34020 in not availible yet. I don't have the announcement that I recieved from TI, but i think they were targeting Q1 '89. Look for boards for the Mac II and PC/AT around Summer '89. NeWS i could not guess on. Also...the boards will be pretty pricey for a while, as i have heard the target price is $500 each for the 34020 and the 34083. They hope that will drop an order of magnatude by 1990. ken seefried iii ...!{akgua, allegra, amd, harpo, hplabs, ken@gatech.edu inhp4, masscomp, rlgvax, sb1, uf-cgrl, ccastks@gitvm1.bitnet unmvax, ut-ngp, ut-sally}!gatech!ken From don@brillig.umd.edu Thu Sep 29 13:32:58 1988 Date: Thu, 29 Sep 88 13:32:58 EDT To: NeWS-makers@brillig.umd.edu Subject: info request From: romeo!aw@cs.duke.edu (Angus Wang) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am new to comp.windows.news but have been programming with X11R2 a fair amount. I have heard a lot about Sun using NeWS with their Sun4's. A few questions : - Is NeWS available for distribution like X is from MIT? - Where could I find a good introductory manual/text about the features of NeWS? Angus Wang ----- Department of Computer Science, Duke University, Durham, NC 27706 UUCP : decvax!duke!aw CSNET: aw@duke ARPA : aw@cs.duke.edu Department of Computer Science, Duke University, Durham, NC 27706 UUCP : decvax!duke!aw CSNET: aw@duke ARPA : aw@cs.duke.edu From don@brillig.umd.edu Thu Sep 29 13:33:15 1988 Date: Thu, 29 Sep 88 13:33:15 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers - request for info From: birdland!rberlin@sun.com (Rich Berlin) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <643@prlhp1.prl.philips.co.uk> colers@prlhp1.prl.philips.co.uk (Richard Cole) writes: > > Hi, > we are running NeWS 1.1 on SUNs. I have been trying to produce > output on a remote server to no avail ! I have followed the > procedure in the Sun NeWS manual; > > setenv NEWSSERVER `setnewshost xxxx` > say -b"Hi" Hi > > where xxxx is the id of the Sun running the server. > > I get the following message on the server > > Network security violation: > Rejected connection from yyyy > > where yyyy is the id of the mechine originating the message. > > I am new to NeWS so any help would be appreciated. > > Thanks in advance > -- > Richard Cole > colers@prl.philips.co.uk > NeWS (like X) maintains a list of "trusted" hosts, i.e. machines for which the server agrees to bring up windows. To make machine yyyy a trusted host, you must execute the command newshost add yyyy on machine xxxx. There are other options besides "add" to the newshost program; read the man page (in $NEWSHOME/man/{man1,cat1}newshost.1) for details. -- Rich From don@brillig.umd.edu Tue Oct 4 23:02:23 1988 Date: Tue, 4 Oct 88 23:02:23 EDT To: NeWS-makers@brillig.umd.edu Subject: Input example program, NeWS to C From: scout%zyzzyva@Sun.COM (David LaVallee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) What follows is a shar file that contains a NeWS server program (cn.cps) and a C program (cn.c). The program cn is an example of getting three types of common input from the window system into a C client. MENU: C recieves an index token corresponding to the menu choice CLICK: mouse clicks send C their scaled x,y location KEYBOARD: sends C a string that the user was editing in the NeWS window. --scout #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # Makefile # cn.c # cn.cps # This archive created: Fri Sep 23 08:48:45 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'Makefile' then echo shar: "will not over-write existing file 'Makefile'" else cat << \SHAR_EOF > 'Makefile' CFILES = cn.c CPSFILES = cn.cps LIBS = -I/usr/NeWS/include -L/usr/NeWS/lib -lcps CFLAGS = -O cn: $(CFILES) $(CPSFILES) cps $(CPSFILES) $(CC) $(CFILES) $(CFLAGS) $(LIBS) SHAR_EOF fi if test -f 'cn.c' then echo shar: "will not over-write existing file 'cn.c'" else cat << \SHAR_EOF > 'cn.c' /* * cn --C to NeWS example program * * This program shows input to a C program through a network window * under NeWS. Three types of input are illustrated: mouse (scaled to * window co-ordinates), menu (returns int), and keyboard (keyboard * input is edited and buffered and echoed in the NeWS server. The * input string is "flushed" to the C client in a single packet * on a ). * * David A. LaVallee Sun Microsystems, Inc. * cps cn.cps;cc cn.c -o cn -I$NEWSHOME/include -L$NEWSHOME/lib -lcps * cps cn.cps;cc cn.c -o cn.4 -I$NEWSHOME/include -L$NEWSHOME/lib-sparc -lcps */ #include "cn.h" int mouse_x, mouse_y, menu_index; char kbstring[300]; main() { start_window(); window_input_loop(); exit(0); } start_window() { ps_open_PostScript(); ps_initialize(); ps_flush_PostScript(); } window_input_loop() { printf("starting input loop\n"); while (!psio_eof(PostScript)) { if (ps_kbinput(kbstring)) { printf("%s\n", kbstring); } else if (ps_mouse_click(&mouse_x, &mouse_y)) { printf("Mouse at %d, %d\n", mouse_x, mouse_y); } else if (ps_menu_choice(&menu_index)) { printf("Menu index %d\n", menu_index); } else exit(-1); }; } SHAR_EOF fi if test -f 'cn.cps' then echo shar: "will not over-write existing file 'cn.cps'" else cat << \SHAR_EOF > 'cn.cps' %! % keyboard example program 2 #define MOUSETAG 100 #define MENUTAG 101 #define KBTAG 102 cdef ps_mouse_click(int mouse_x, mouse_y) => MOUSETAG (mouse_x, mouse_y) cdef ps_menu_choice(int menu_index) => MENUTAG (menu_index) cdef ps_kbinput(string kbstring) => KBTAG (kbstring) cdef ps_initialize() %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% TEXT STORAGE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /inputtext () def /textx 40 def /initx 40 def /texty 15 def /inity 15 def /textfont /Times-Roman findfont 24 scalefont def /cleartext { can setcanvas 1 setgray initx inity moveto inputtext show /inputtext () def 0 setgray /textx initx store /texty inity store } def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% KEY HANDLING PROCEEDURES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /addchar { cvis dup inputtext exch append /inputtext exch store textfont setfont can setcanvas textx texty moveto show currentpoint /texty exch def /textx exch def textx texty setcursorlocation } def /deletechar { inputtext () ne { inputtext dup length 1 sub get cvis inputtext dup length 1 sub 0 exch getinterval can setcanvas textfont setfont initx inity moveto dup stringwidth pop 0 rmoveto exch currentpoint /texty exch store /textx exch store 1 setgray show 0 setgray /inputtext exch store textx texty setcursorlocation } if } def /deleteline { cleartext textx texty setcursorlocation } def /returnkey { KBTAG tagprint inputtext typedprint cleartext textx texty setcursorlocation } def /handlers 200 dict dup begin 0 1 127 { dup [ exch /addchar cvx ] cvx def } for 13 {returnkey} def /EditBackChar {deletechar} def /EditBackLine {deleteline} def end def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% INITIALIZE A WINDOW %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /repair { /Symbol findfont 24 scalefont setfont initx inity moveto (/) dup stringwidth pop neg 0 rmoveto show /Times-Roman findfont 24 scalefont setfont inputtext show } def /win framebuffer /new DefaultWindow send def /reshapefromuser win send { /PaintClient {repair} def /FrameLabel (C example program) def /ClientMenu [ (first choice) {MENUTAG tagprint 0 typedprint} (second choice) {MENUTAG tagprint 1 typedprint} ] /new DefaultMenu send def } win send /map win send /can win /ClientCanvas get def /MouseClickEventMgr [ PointButton { MOUSETAG tagprint begin can setcanvas XLocation typedprint YLocation typedprint end } /DownTransition can eventmgrinterest ] forkeventmgr def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% KEYBOARD INPUT LOOP %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% { can setcanvas currentcanvas addkbdinterests pop currentcanvas addeditkeysinterest pop { awaitevent /Name get dup handlers exch known { handlers exch get exec } { pop } ifelse } loop } fork SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Tue Oct 4 23:03:41 1988 Date: Tue, 4 Oct 88 23:03:41 EDT To: NeWS-makers@brillig.umd.edu Subject: more references to learn PostScript From: scout%zyzzyva@Sun.COM (David LaVallee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The point should be made that PostScript is VERY worth learning regardless of the learning resources you have available. This message will enumerate a number of the resources I have called on to teach PostScript language and NeWS. I have the bias of having been a graphic designer before getting into this computer stuff. PostScript is found in "many" (understatement intended) printers at a variety of resolutions and numbers of colors. All of the window systems of the (near, and past-present) future leverage PostScript in some fashion. In the early days of PostScript my development environment consisted of the Adobe "Blue" book, and cat-ing files to the LaserWriter, counting the number of times the yellow light blinked to determine how far my program had got. The situation is much better today: The Bible: Book: Adobe Systems Inc.: PostScript Reference Addison-Wesley the "Red" book Beginner-Intermediate: Book: D Holzgang, Understanding PostScript Programing Sybex Book: Adobe Systems Inc.: PostScript Tutorial and CookBook Addison-Wesley the "Blue" book MacSW: -LaserTalk, by Emerald City Software -the Cricket products -Adobe Illustrator -Aldus Freehand (appologies if I've left out any, it's just that I don't follow Mac software availability too closely) Advanced Book: Adobe Systems Inc.: PostScript Program Design Addison-Wesley the "Green" book (I can't wait for the cyan, yellow, and magenta books) Book: Bove, Davis, Rhodes: Adobe Illustrator, official handbook Bantam Computer Books especially chapter 6... Paper: O Densmore: Object Oriented Programming in NeWS Nov. 1986, USENIX Monterey Computer Graphics Workshop SW: NeWS on Sun, SGI, Mac, Amiga, VAX, RT, ISI, OS2, etcetera. Also of interest: Book: Alex White: How to Spec Type published by Watson-Guptill, a good introduction to Graphic Design with a bent on typography. Book: S Ambron, and K Hooper: Interactive Multimedia Microsoft Press Book: G Holzmann: Beyond Photography, the Digital Darkroom Prentice Hall (more on this one later) --scout From don@brillig.umd.edu Tue Oct 4 23:06:22 1988 Date: Tue, 4 Oct 88 23:06:22 EDT To: NeWS-makers@brillig.umd.edu Subject: Kanji: Browse the kanji font From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In order to make up for so many postings of KeySee, I submit my kanji font browser program for your enjoyment. The Kanji font has normal ASCII glyphs in the regular ASCII range, but if a character is greater than 127, it and the next character are taken to represent Kanji characters. Basically, only the ASCII printable character range with the high bit on is mapped. The rest of the range is unmapped (sort of, see comments). The program could be quite a bit simpler, but it diddles the scrollbar (resulting in one whose bubble is proportional to the region displayed) and implements "copyarea" scrolling, among other tweaks. For what its worth, my wife's last name is (\307\317). Enjoy, Stan Switzer sjs@ctt.bellcore.com P.S.: I have an even newer and better version of KeySee now, but I can't quite bring myself to post it again unless enough people mail me requesting it. ----------- snip snip ------------------------ #!/usr/NeWS/bin/psh % % Explore the Kanji font % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % % Notes: % % It seems that Kanji is encoded by pairs of hyper-printable-ASCII % characters. If we were to give each Kanji char a number "n" % beginning at 0, then "n", in terms of the pair (a,b) is given by % n = 96*(a-160) + (b-160) % The -160 term comes from subtracting 128 for hyperASCII and 32 % for printable ASCII. There are many ways to get the same character % (when, for instance, b is not in the "normal" range of 160-255). % This analysis is based on trial and error and error and .... % % For the sake of nomenclature, we will call this number the "ordinal" % of the character % % Seems to crash NeWS server at dec 245,69 and 244,165: % maxOrdinal is not arbitrary! /F { exch findfont exch scalefont } def /cvoi { (8#) exch append cvx stopped 0 if } def /cvos { 8 (ZZZZZ) cvrs } def /pair2ord { 160 sub exch 160 sub 96 mul add } def /ord2pair { dup 96 idiv 160 add exch 96 mod 160 add } def /nxtpair { 1 add dup 255 gt { pop 1 add 160 } if } def /pair2char { (ZZ) dup 0 4 index put dup 1 3 index put } def systemdict /Item known not { (NeWS/liteitem.ps) run } if /SmallButton ButtonItem [] classbegin /new { /new super send begin /ItemBorder null def /ItemFrame 2 def /ItemGap 3 def /ItemRadius .2 def currentdict end } def classend def /BetterBar SimpleScrollbar dictbegin /BoxSize 1 def dictend classbegin /SetScale { BoxSize % leave on stack for later /BoxSize BarMax BarMin sub BarPageValue exch div abs ItemHeight ButtonSize dup add sub mul 12 max def /SetScale super send BoxSize ne { /paint self send } if } def /BoxPath { ValueToY ItemFrame ItemWidth .15 mul 3 -1 roll % dx x y ItemWidth .7 mul BoxSize rectframe } def classend def /VScrollWindow DefaultWindow dictbegin /VScrollbar null def /LeftSide? true def dictend classbegin /ScrollWidth 18 def /BorderWidth 16 def /BorderLeft { LeftSide? ScrollWidth BorderWidth ifelse } def /BorderRight { LeftSide? BorderWidth ScrollWidth ifelse } def /destroy { % - => - (Create frame control canvases/items) /VScrollbar null def /destroy super send } def /CreateFrameControls { % - => - (Create frame control canvases/items) /CreateFrameControls super send /VScrollbar [1 0 .01 .1 null] 0 {} FrameCanvas /new BetterBar send def } def /CreateFrameInterests { % - => - (Create frame control interests) /CreateFrameInterests super send FrameInterests begin % Append the scroll bar "start" interests to the frame interests. % The odd "forall" is used to create unique names for inclusion % in the frame interests dictionary. /makestartinterests VScrollbar send { (VScrollbar) 1 index /Name get cvx 100 string cvs append cvn exch def } forall end } def /MoveFrameControls { % - => - ([Re]set frame control shapes) /MoveFrameControls super send LeftSide? 0 { FrameWidth BorderRight sub } ifelse BorderBottom 1 sub ScrollWidth FrameHeight BorderBottom sub BorderTop sub 2 add /reshape VScrollbar send } def /PaintFrameControls { % - => - (Paint frame control areas) gsave /PaintFrameControls super send /paint VScrollbar send grestore } def classend def /KanjiDemo VScrollWindow dictbegin /Size 24 def /Kanji /Kanji //Size F def /Roman /Times-Roman 12 F def /Symbol /Symbol 18 F def /BigSym /Symbol 36 F def /FrameLabel (Kanji Demo) def /Items null def /ItemList null def /ItemProc null def /Ordinal 0 def /minOrdinal 0 def /maxOrdinal 8068 def % Empirical constant /ClientMenu null def % initialized on canvas create /TmpDict null def % Layout Params, set in Recalc: /Descend null def /ItemX null def /RowLabelX null def /Col0 null def /ColWidth null def /nCols null def /ItemY null def /ColLabelY null def /Row0 null def /RowHeight null def /nRows null def dictend classbegin /new { /new super send begin /PaintClient { ClientFillColor fillcanvas ClientCanvas setcanvas ItemList paintitems 0 nRows paint-me } def /TmpDict 20 dict store currentdict end } def /CreateFrameControls { /CreateFrameControls super send % attach scroll proc VScrollbar begin /NotifyUser { ItemValue /SCROLL ThisWindow send } def end } def /CreateClientCanvas { /CreateClientCanvas super send % various items: /Items dictbegin /nextpage (Next Page) { +1 /PAGE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def /prevpage (Prev Page) { -1 /PAGE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def /nexthalfpage (Up Half Page) { +.5 /PAGE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def /prevhalfpage (Down Half Page) { -.5 /PAGE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def /nextline (Up Line) { +1 /LINE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def /prevline (Down Line) { -1 /LINE ThisWindow send } ClientCanvas 0 0 /new SmallButton send def dictend store % Display order (dictionaries do not retain order): /ItemList Items begin [ nextpage prevpage nexthalfpage prevhalfpage nextline prevline ] end store /ItemProc ItemList forkitems store } def /ShapeClientCanvas { /ShapeClientCanvas super send Recalc % recalc layoput params % Menus (here instead of in /new so FrameMenu is already set): ClientMenu null eq { /ClientMenu [ % Menu items: %(Next Page) { +1 /PAGE ThisWindow send } %(Prev Page) { -1 /PAGE ThisWindow send } %(Up Line) { +1 /LINE ThisWindow send } %(Down Line) { -1 /LINE ThisWindow send } %(Zap) { /destroy ThisWindow send } [(\335) Symbol] { +1 /PAGE ThisWindow send } [(\337) Symbol] { -1 /PAGE ThisWindow send } [(\255) Symbol] { +1 /LINE ThisWindow send } [(\257) Symbol] { -1 /LINE ThisWindow send } (24 pt.) { 24 /SIZE ThisWindow send } (16 pt.) { 16 /SIZE ThisWindow send } %[(\247) BigSym] { /destroy ThisWindow send } [(\304) BigSym] { /destroy ThisWindow send } /sun30 FrameMenu ] /new DefaultMenu send store { % Menu options: /LayoutStyle [4 2] def /CenterItems? false def } ClientMenu send } if ClientCanvas setcanvas % now, move the items to their rightful places TmpDict begin /X ItemX def /Y ItemY def /Sep 5 def ItemList { X Y /move 3 index send /ItemWidth exch send X add Sep add /X exch store } forall end } def /Recalc { % - => - -- recalculates various layout parameters /Descend Kanji fontdescent store /ItemX 5 store /RowLabelX ItemX store /Col0 60 store /ColWidth Size 6 add store /nCols ClientWidth Col0 sub ColWidth div cvi store /ItemY ClientHeight 30 sub store /ColLabelY ItemY store /Row0 ColLabelY 20 sub store /RowHeight Size 6 add store /nRows ColLabelY Descend sub RowHeight div cvi store } def /ColRnd { % where => where nCols idiv nCols mul % round to lower multiple of nCols } def /SCROLL { % where => - ColRnd GoToChar } def /PAGE { % npages => - nCols nRows mul mul Ordinal add ColRnd GoToChar } def /LINE { % nlines => - nCols mul Ordinal add GoToChar } def /SIZE { % size => - ClientCanvas setcanvas 0 nRows erase-me /Size exch store /Kanji /Kanji Size F store Recalc DoIt } def /DoIt { Ordinal 0 lt { /Ordinal 0 store } if ClientCanvas setcanvas 0 nRows erase-me 0 nRows paint-me } def /FasterDoIt { % +/-rows => ClientCanvas setcanvas TmpDict begin /slide exch def slide 0 lt { % down 0 nRows slide add slide slide-me 0 slide neg erase-me 0 slide neg paint-me } { % up slide nRows slide sub slide slide-me nRows slide sub slide erase-me nRows slide sub slide paint-me } ifelse end } def /GoToChar { % Ordinal => dup minOrdinal lt { pop minOrdinal } if dup maxOrdinal gt { pop maxOrdinal } if cvi Ordinal exch /Ordinal exch store TmpDict begin /OldOrd exch def /Diff Ordinal OldOrd sub def /DiffRows Diff nCols idiv def DiffRows abs nRows lt Diff nCols mod 0 eq and { DiffRows true } false ifelse end //FasterDoIt //DoIt ifelse } def /slide-me { % fstrow nrows dist => - % 3 copy 3 array astore (% % % slide-me\n) exch dbgprintf TmpDict begin /dist exch RowHeight mul def /nr exch RowHeight mul def /fstr exch RowHeight mul def 0 ColLabelY nr sub fstr sub Descend sub ClientWidth nr rectpath 0 dist copyarea fill end } def /erase-me { % fstrow nrows => - % 2 copy 2 array astore (% % erase-me\n) exch dbgprintf TmpDict begin gsave /nr exch RowHeight mul def /fstr exch RowHeight mul def 0 ColLabelY nr sub fstr sub Descend sub ClientWidth nr rectpath ClientFillColor setshade fill grestore end } def % written to avoid multiplication especially especially division % in the inner loops. Don't know whether it really matters, though. /paint-me { % fstrow nrows => - % 2 copy 2 array astore (% % paint-me\n) exch dbgprintf textcolor setshade TmpDict begin /nr exch def /fstr exch def /N Ordinal fstr nCols mul add def /R ColLabelY fstr RowHeight mul sub def /More? N maxOrdinal le def N ord2pair nr { /R R RowHeight sub store RowLabelX R moveto More? { 2 copy Roman setfont exch cvos show (,)show cvos show } if Kanji setfont /C Col0 def nCols { C R moveto /C C ColWidth add store N maxOrdinal gt { /More? false store } { pair2char show nxtpair /N N 1 add store } ifelse } repeat pause % give other pgms a chance } repeat pop pop [ maxOrdinal minOrdinal nCols dup nRows mul null ] /setrange VScrollbar send Ordinal /setvalue VScrollbar send end } def classend def /win framebuffer /new KanjiDemo send def /reshapefromuser win send /map win send % ----- if anything follows this line it is not part of the program ----- From don@brillig.umd.edu Tue Oct 4 23:09:09 1988 Date: Tue, 4 Oct 88 23:09:09 EDT To: NeWS-makers@brillig.umd.edu Subject: Hello from INTEROP88 From: elbereth.rutgers.edu!ron.rutgers.edu!ron@rutgers.edu (Ron Natalie) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I love a trade show that I can walk into almost any booth and get logged in at reasonable speed to my home machine. One neat experiment was that The Wollongong Group provided a Sun 3/60C for a public mail reading terminal. It was lacking a windowing system, so I decided to see if I could start up NeWS on it. In order to do that, I NFS mounted the /usr partition from a Rutgers machine and Symlinked /usr/NeWS to the appropriate directory. This worked amazingly well. (The guys from the Apple booth thought that NeWS was pretty neat, I showed them how to change the menus by just editing the user.ps file.) -Ron From don@brillig.umd.edu Tue Oct 4 23:12:17 1988 Date: Tue, 4 Oct 88 23:12:17 EDT To: NeWS-makers@brillig.umd.edu Subject: wbounce: drop everything (an animation) From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's a little something I threw together several months ago: It bounces a spinning globe around in a window. NeWS hacks may want to look at the code, as it contains a number of vestigal features that are pretty simple to extract for other abuses. Of greatest interest is an object that implements "bouncing things", with the default thing (unless overriden) being a simple rectangle. Also, the code illustrates a technique for using imagecanvas for double-buffering. Hack on, Stan Switzer sjs@ctt.bellcore.com -------------------------------------------------- #!/usr/NeWS/bin/psh % % Drop Everything % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % % various useful GP utilities: /outside { % x lowx highx => false -or- closest true dup 3 index lt { 3 1 roll pop pop true } { pop dup 2 index gt { exch pop true } { pop pop false } ifelse } ifelse } def /decrease { % n decr => n' -- decrease n toward zero, not beyond exch dup 0 lt { add dup 0 gt { pop 0 } if } { exch sub dup 0 lt { pop 0 } if } ifelse } def % Sleazy way to modify enclosing window variables /W+ { % /name incr => ThisWindow begin exch dup load 3 -1 roll add store end } def /W* { % /name factor => ThisWindow begin exch dup load 3 -1 roll mul store end } def /W= { % /name val => ThisWindow begin store end } def /BouncingThing DefaultWindow dictbegin /ThingWidth 32 def /ThingHeight 32 def /SqueezeX 0 def /SqueezeY 0 def /UnSqueeze 3 def /Xcount 0 def /Ycount 0 def /MaxCount 15 def /X 0 def /Y 0 def /dX 16 def /dY 0 def /d2X 0 def /d2Y -2 def /dT .10 60 div def /dragX 0 def /dragY .25 def /BackGroundColor 1 def /ThingColor 0 def /FrameLabel (Bouncing Thing) def /CanW 0 def /CanH 0 def /AnimateProcess null def /PaintClient { BackGroundColor fillcanvas show-thing } def /wheredrawn null def dictend classbegin /new { /new super send begin /wheredrawn 4 array store /ClientMenu [ (Bigger) { /ThingWidth 4 W+ /ThingHeight 4 W+ } (Smaller) { /ThingWidth -4 W+ /ThingHeight -4 W+ } (Flatter) { /ThingWidth 4 W+ } (Taller) { /ThingHeight 4 W+ } (Faster) { /dT 1 1.5 div W* } (Slower) { /dT 1.5 W* } (More Gravity) { /d2Y -1 W+ } (Less Gravity) { /d2Y 1 W+ } (More Drag) { /dragY .05 W+ } (Less Drag) { /dragY -.05 W+ } (Zap) { /destroy ThisWindow send } ] /new DefaultMenu send def currentdict end } def /start { true animate } def /stop { false animate } def /animate { { AnimateProcess null eq { /AnimateProcess { animateproc } fork store } { AnimateProcess continueprocess } ifelse } { AnimateProcess null ne { AnimateProcess suspendprocess } if } ifelse } def /reshape { % x y w h => - /reshape super send gsave ClientCanvas setcanvas clippath pathbbox 4 -2 roll pop pop % w h /CanH exch store /CanW exch store grestore } def /erase-thing { % X Y Width Heigth => - rectpath BackGroundColor setshade fill } def /compute-thing nullproc def % X Y Width Heigth => X Y Width Height /draw-thing { % X Y Width Height => - % intended to be overriden rectpath fill } def /show-thing { % - => - X cvi Y cvi Width cvi Height cvi /compute-thing self send wheredrawn aload pop /erase-thing self send ThingColor setshade 4 copy wheredrawn astore pop /draw-thing self send } def /animate-step { % - => - % acceleration /dX dX d2X add store /dY dY d2Y add store % velocity /X X dX add store /Y Y dY add store % "friction" /dX dX dragX decrease store /dY dY dragY decrease store % position (bounce off of walls) 123 X 0 CanW Width sub outside { % X rebound /X exch store /dX dX neg store Xcount 1 add dup /Xcount exch store MaxCount gt { /dX dX kickX add X 0 ne { neg } if store } if /SqueezeX ThingWidth .5 mul store X 0 ne { /X X SqueezeX add store } if } { % no rebound /Xcount 0 store /SqueezeX SqueezeX UnSqueeze sub dup 0 lt { pop 0 } if store } ifelse Y 0 CanH Height sub outside { % Y rebound /Y exch store /dY dY neg store Ycount 1 add dup /Ycount exch store MaxCount gt { /dY dY kickY add Y 0 ne { neg } if store } if /SqueezeY ThingHeight .5 mul store Y 0 ne { /Y Y SqueezeY add store } if } { % no rebound /Ycount 0 store /SqueezeY SqueezeY UnSqueeze sub dup 0 lt { pop 0 } if store } ifelse % draw it ClientCanvas setcanvas show-thing 123 ne { ZZZ } if } def /kickX { CanW Width sub d2X mul abs dup add sqrt } def /kickY { CanH Height sub d2Y mul abs dup add sqrt } def /Width { ThingWidth SqueezeX sub } def /Height { ThingHeight SqueezeY sub } def /animateproc { % - => - % initial conditions /X 0 store /Y CanH Height sub store X Y ThingWidth ThingHeight wheredrawn astore pop % create a timer event event interest /TimerInterest createevent store TimerInterest begin /Name /DelayOver def currentdict end dup expressinterest % create a timer event and start it off createevent copy begin /TimeStamp currenttime dT add def currentdict end sendevent { % loop awaitevent begin /TimeStamp % TimeStamp % Makes up for lost time currenttime % Accepts its loss dT add def currentdict end sendevent % and do a step animate-step } loop } def classend def /BouncingWorld BouncingThing dictbegin /BackGroundColor 0 def /ThingColor ColorDisplay? { 0 1 0 rgbcolor } { 1 } ifelse def /FrameLabel (Bouncing World) def /NImages 30 def /ImageNo 0 def /ImageVec null def dictend classbegin /new { /new super send begin /ImageVec [ 1 1 NImages { pop null } for ] store currentdict end } def /LoadImage { % nbr => image -- side-effect, saves image in vec ImageVec exch dup 1 add 10 string cvs (/usr/NeWS/smi/globes/globe) exch append (.im1) append readcanvas dup 4 1 roll put } def /Image { % - => image ImageNo dup ImageVec exch get % nbr image-or-null dup null eq { pop dup LoadImage } if % nbr image exch 1 add dup NImages ge { pop 0 } if /ImageNo exch store % image } def /draw-thing { % X Y W H => - gsave 4 2 roll translate scale false Image imagemaskcanvas grestore } def classend def % Following is same w/ double-buffering. /FasterBouncingWorld BouncingWorld dictbegin /FrameLabel (Double-Buffered Bouncing World) def /TmpCan null def dictend classbegin /new { /new super send begin /TmpCan framebuffer newcanvas store TmpCan /Transparent false put TmpCan /Retained true put currentdict end } def /compute-thing { % X Y W H => X Y W H -- precompute the image gsave framebuffer setcanvas 0 0 moveto 2 copy rect TmpCan reshapecanvas TmpCan setcanvas BackGroundColor fillcanvas ThingColor setshade 0 0 moveto 2 copy scale false Image imagemaskcanvas grestore } def /draw-thing { % X Y W H => gsave 4 2 roll translate scale TmpCan imagecanvas grestore } def classend def % Tilted bouncing world /TiltedBouncingWorld BouncingWorld dictbegin /FrameLabel (Tilted Bouncing World) def dictend classbegin % draw it tilted /draw-thing { % X Y W H => - gsave 4 2 roll translate scale .5 .5 translate -22.5 rotate -.5 -.5 translate true Image imagemaskcanvas grestore } def % eliminate screen sh*t /erase-thing { % X Y Width Heigth => - 4 add 4 1 roll 4 add 4 1 roll 2 sub 4 1 roll 2 sub 4 1 roll rectpath BackGroundColor setshade fill } def classend def /win framebuffer /new FasterBouncingWorld send def /reshapefromuser win send /map win send /start win send % win begin AnimateProcess waitprocess % to wait, if we want to use == for dbg From don@brillig.umd.edu Tue Oct 4 23:15:50 1988 Date: Tue, 4 Oct 88 23:15:50 EDT To: NeWS-makers@brillig.umd.edu Subject: Fun and Games with window backgrounds From: salt.uucp!gerber@uunet.uu.net (Andrew Gerber) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've hacked up my user.ps file to display images from $NEWSHOME/smi in the background. (Replacing the boring blue background). The following code from user.ps is really only good for color Suns (I have a color 4/110). Running this stuff on a b/w 3/50 is agonizingly slow. Thanks to whoever posted the screendump stuff; I snarfed part of that code for this. Note that I aviod the -hires files; they seem to cause NeWS to crash with timeout errors. The code below also shows how to modify your menus. Note that you may have to change the directory path in /setback if your NeWS files do not live in /usr/NeWS. Also this code contains the patch to RepaintAll that fixes the problems repainting on color workstations. At the very end of the file, Nterm defaults are set. I happen to like a smaller font and a blue window background. The last line brings up the saturn image if you are running on a color workstation. ----------------------------------------------------------------------------- Andrew S. Gerber | McDonnell Douglas Communication Industry Systems uunet!salt!gerber | 5299 DTC Blvd, Englewood, CO 80111 salt!gerber@uunet.uu.net | (303) 220 6231 ----------------------------------------------------------------------------- -----------------------Cut Here--------------------------------------- % USER.PS file will be executed by init.ps % Your user.ps file allows you to over-ride all the standard defaults % and to do your own initialization. % Make sure to "protect" your defaults via the following: % /Foo where { pop % Foo begin % < changes to Foo's defaults % /mymenu [ % (Foo =>) foomenu % (Test!) {(test) forkunix} % (Color Wheel!) {(colorwheel) forkunix} % ] /new DefaultMenu send def % 0 (My Menu =>) mymenu /insertitem rootmenu send %/DebuggingServer? false def % set true in your user.ps if you're debugging. % Initialization % Main is run by PS as soon as it has processed init.ps % The default main starts up the root event mgr and starts % an executive if debugging. If you are using telnet to talk % to your PS server, make sure to use the executive: % Note that the default 144 can by changing NeWS_socket in your user.ps %/NeWS_socket % { (NEWSSOCKET) getenv } stopped % { pop (%socketl144) } if % def /blue { systemdict begin /PaintRoot { gsave framebuffer setcanvas DefaultRootGrayOrColor dup type /colortype eq {setcolor} {setgray} ifelse clippath fill grestore } def end PaintRoot {/paint self send} AllWin } def /setback { systemdict begin % You may have to change the following line if your NeWS % files do not live in /usr/NeWS (/usr/NeWS/smi/) exch append (.im8) append /ImageFileName exch def /PaintRoot { gsave fboverlay setcanvas framebuffer setcanvas 1152 900 scale ImageFileName readcanvas imagecanvas grestore } def end PaintRoot {/paint self send} AllWin (switcher -e 0) forkunix } def % STARTUP.PS file first one read in by init.ps (NeWS/litemenu.ps) LoadFile { % Default Root Menu; here so user.ps can over-ride & modify. /ntermmenu [ % Console gets autolinewrap turned on and 400 lines (VT102 Console) { (nterm -C -aw -sl 400) forkunix } (VT102) { (nterm) forkunix } ] /new DefaultMenu send def /fixedterminalmenu [ (sun) { (psterm -f -t sun) forkunix } (Console) { (psterm -f -C -t h19) forkunix } (H19) { (psterm -f -t h19) forkunix } (bitgraph) { (psterm -f -t bitgraph) forkunix } (vt100) { (psterm -f -t vt100) forkunix } (wyse) { (psterm -f -t wyse) forkunix } (tvi925) { (psterm -f -t tvi925) forkunix } ] /new DefaultMenu send def /terminalmenu [ (sun) { (psterm -t sun) forkunix } (Console) { (psterm -C -t h19) forkunix } (Fixed Startup =>) fixedterminalmenu (H19) { (psterm -t h19) forkunix } (bitgraph) { (psterm -t bitgraph) forkunix } (vt100) { (psterm -t vt100) forkunix } (wyse) { (psterm -t wyse) forkunix } (tvi925) { (psterm -t tvi925) forkunix } ] /new DefaultMenu send def /clockmenu [ (Plain) { (roundclock) RunDemoProgram } (Plain (seconds)) { (roundclock -s) RunDemoProgram } (Fancy) { (roundclock -f) RunDemoProgram } (Fancy (seconds)) { (roundclock -f -s) RunDemoProgram } ] /new DefaultMenu send def /applicationsmenu [ (Load Average) { (psload) forkunix } (Calculator) { (calcul) RunDemoPshScript } (Journal) { (journalling) RunDemoPshScript } (Clocks =>) clockmenu ] /new DefaultMenu send def /AllWin { % proc => - (Distributes proc to all windows!!) createevent dup begin /Name /DoItEvent def /Action /Window def /ClientData 2 index def end sendevent pop } def /backgroundmenu [ (angel) { (angel) setback} (bf) { (bf) setback} (bryce) { (brice) setback} (blue) { blue } (cherries) { (cherries) setback } (ermine) { (ermine) setback } (fuji) {(fuji) setback } (geese) {(geese) setback } (harem) {(harem) setback } (joshua) {(joshua) setback } (lady) {(lady) setback } (lascruces) {(lascruces) setback } (man) {(man) setback } (mona) {(mona) setback } (new_york) {(new_york) setback } (pagosa) {(pagosa) setback } (puppet) {(puppet) setback } (saturn) {(saturn) setback } (shroom) {(shroom) setback } (snow) {(snow) setback } (stjerome) {(stjerome) setback } (stormy) {(stormy) setback } (sun3110) {(sun3110) setback } (sun350) {(sun350) setback } (taj) {(taj) setback } (virgin) {(virgin) setback } (virgino) {(virgino) setback } (vla) {(vla) setback } (washing) {(washing) setback } (writing) {(writing) setback } (zion) {(zion) setback } ] /new DefaultMenu send def /repairmenu [ (Repaint All) { PaintRoot {/paint self send} AllWin (switcher -e 0) forkunix } (Reset Input) { createevent dup begin /Name UserProfile /ViewStop known { UserProfile /ViewStop get } { 16#6f01 % default to L1 } ifelse def /Action /DownTransition def end dup sendevent createevent copy dup /Action /UpTransition put sendevent } ] /new DefaultMenu send def /exitcleanly { % Destroy all windows that know /destroy {/destroy self send} AllWin % Wait 3 seconds for console to die 0.05 sleep % Clear the screen framebuffer setcanvas 1 setgray clippath fill % Terminate the server ^C } def /exitnewsmenu [ (Yes, really!) { exitcleanly } (No, not really.) {} ] /new DefaultMenu send def /rootmenu [ (Applications =>) applicationsmenu (Terminals =>) fixedterminalmenu (Scrolling Prototype =>) ntermmenu (Background =>) backgroundmenu (Repair =>) repairmenu (Exit NeWS) { exitcleanly } ] /new DefaultMenu send def } if (NeWS/litewin.ps) LoadFile { % Demo menus loaded here because of window dependancies. (NeWS/demomenu.ps) LoadFile pop } if UserProfile begin /NtermFontName /Screen def /NtermFillColor .56 .35 1 hsbcolor def /NtermTextColor 0 0 0 rgbcolor def /NtermFontHeight 12 def end currentcanvas /Color get {(saturn) setback} if From don@brillig.umd.edu Tue Oct 4 23:18:02 1988 Date: Tue, 4 Oct 88 23:18:02 EDT To: NeWS-makers@brillig.umd.edu Subject: psview bug From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There is a bug in psview which appears when displaying many of the files generated by psroff. The error only occurs when attempting to display the first page of a document. Psh'ing the program generated by psroff executes correctly. Included is the troff input file (no macros necessary), the NeWS error, and the psroff output file. I am running on a Sun 3/160 with NeWS 1.1 under SunOS 3.4. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org ------------------------------------------------------------------------------ The OSF. Just say NO. ------------------------------------------------------------------------------ Troff input file ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- .\" A two page document .ce This is the centered line on page one. .bp .ce This is the centered line on page two. NeWS error ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ---- Process: 0x10E3A4 Error: nocurrentpoint Stack: dictionary[42] dictionary[42] dictionary[2100] /FrameEventMgr /MenuEventMgr event(0x203634) /PaintProcess (d) 96 Executing: 'currentpoint' At: {'exch' *'currentpoint' 'pop' 'exch' 'moveto' 'show'} In: {/@DictHeight 'countdictstack' 'def' @Dicts 'length' 1 'sub' -1 0 array{4} 'for' 10 s 0 xH 0 xS 1 f 10 f 96 (d) *Y 4280 (d) X 1 f 2114 768 (This) N 2276 (is) X 2349 (a) X 2405 (centered) X 2698 (line.) X 2 p array{6} 'loop'} In: {PSCanvas 'setcanvas' 'initmatrix' 'clippath' 'pathbbox' 792 'div' 'exch' 612 'div' 'min' 'dup' 'scale' 'pop' 'pop' 'pathbbox' 2 'div' 'exch' 2 'div' 'exch' 'translate' 'pop' 'pop' 306 'neg' 396 'neg' 'translate' FG `setcolor' DoBox array{15} 'if' /paint PSItem `send' FrameBorderColor strokecanvas startmatrix `concat' *PGC} In: {*ps_paint} In: {'gsave' FrameCanvas 'setcanvas' FixClient? array{2} 'if' PaintFrame? array{1} 'if' ClientCanvas 'null' 'ne' array{2} 'if' *PaintClient FixClient? array{4} 'if' /PaintProcess 'null' 'store' 'grestore'} In: {`newprocessgroup' *CallPaintProcs} Psroff output file ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- %!PS-Adobe-1.0 %%Creator: spc-np1:marshall (Eric Marshall,260J,3911838,4815067) %%Title: stdin (ditroff) %%CreationDate: Thu Sep 29 08:16:49 1988 %%EndComments % lib/psdit.pro -- prolog for psdit (ditroff) files % Copyright (c) 1984, 1985 Adobe Systems Incorporated. All Rights Reserved. % last edit: shore Sat Nov 23 20:28:03 1985 % RCSID: $Header: psdit.pro,v 2.1 85/11/24 12:19:43 shore Rel $ /$DITroff 140 dict def $DITroff begin /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def /xi {0 72 11 mul translate 72 resolution div dup neg scale 0 0 moveto /fontnum 1 def /fontsize 10 def /fontheight 10 def /fontslant 0 def F /pagesave save def}def /PB{save /psv exch def currentpoint translate resolution 72 div dup neg scale 0 0 moveto}def /PE{psv restore}def /arctoobig 90 def /arctoosmall .05 def /m1 matrix def /m2 matrix def /m3 matrix def /oldmat matrix def /tan{dup sin exch cos div}def /point{resolution 72 div mul}def /dround {transform round exch round exch itransform}def /xT{/devname exch def}def /xr{/mh exch def /my exch def /resolution exch def}def /xp{}def /xs{docsave restore end}def /xt{}def /xf{/fontname exch def /slotno exch def fontnames slotno get fontname eq not {fonts slotno fontname findfont put fontnames slotno fontname put}if}def /xH{/fontheight exch def F}def /xS{/fontslant exch def F}def /s{/fontsize exch def /fontheight fontsize def F}def /f{/fontnum exch def F}def /F{fontheight 0 le {/fontheight fontsize def}if fonts fontnum get fontsize point 0 0 fontheight point neg 0 0 m1 astore fontslant 0 ne{1 0 fontslant tan 1 0 0 m2 astore m3 concatmatrix}if makefont setfont .04 fontsize point mul 0 dround pop setlinewidth}def /X{exch currentpoint exch pop moveto show}def /N{3 1 roll moveto show}def /Y{exch currentpoint pop exch moveto show}def /S{show}def /ditpush{}def/ditpop{}def /AX{3 -1 roll currentpoint exch pop moveto 0 exch ashow}def /AN{4 2 roll moveto 0 exch ashow}def /AY{3 -1 roll currentpoint pop exch moveto 0 exch ashow}def /AS{0 exch ashow}def /MX{currentpoint exch pop moveto}def /MY{currentpoint pop exch moveto}def /MXY{moveto}def /cb{pop}def % action on unknown char -- nothing for now /n{}def/w{}def /p{pop showpage pagesave restore /pagesave save def}def /abspoint{currentpoint exch pop add exch currentpoint pop add exch}def /distance{dup mul exch dup mul add sqrt}def /dstroke{currentpoint stroke moveto}def /Dl{2 copy gsave rlineto stroke grestore rmoveto}def /arcellipse{/diamv exch def /diamh exch def oldmat currentmatrix pop currentpoint translate 1 diamv diamh div scale /rad diamh 2 div def currentpoint exch rad add exch rad -180 180 arc oldmat setmatrix}def /Dc{dup arcellipse dstroke}def /De{arcellipse dstroke}def /Da{/endv exch def /endh exch def /centerv exch def /centerh exch def /cradius centerv centerv mul centerh centerh mul add sqrt def /eradius endv endv mul endh endh mul add sqrt def /endang endv endh atan def /startang centerv neg centerh neg atan def /sweep startang endang sub dup 0 lt{360 add}if def sweep arctoobig gt {/midang startang sweep 2 div sub def /midrad cradius eradius add 2 div def /midh midang cos midrad mul def /midv midang sin midrad mul def midh neg midv neg endh endv centerh centerv midh midv Da currentpoint moveto Da} {sweep arctoosmall ge {/controldelt 1 sweep 2 div cos sub 3 sweep 2 div sin mul div 4 mul def centerv neg controldelt mul centerh controldelt mul endv neg controldelt mul centerh add endh add endh controldelt mul centerv add endv add centerh endh add centerv endv add rcurveto dstroke} {centerh endh add centerv endv add rlineto dstroke}ifelse}ifelse}def /Barray 200 array def % 200 values in a wiggle /D~{mark}def /D~~{counttomark Barray exch 0 exch getinterval astore /Bcontrol exch def pop /Blen Bcontrol length def Blen 4 ge Blen 2 mod 0 eq and {Bcontrol 0 get Bcontrol 1 get abspoint /Ycont exch def /Xcont exch def Bcontrol 0 2 copy get 2 mul put Bcontrol 1 2 copy get 2 mul put Bcontrol Blen 2 sub 2 copy get 2 mul put Bcontrol Blen 1 sub 2 copy get 2 mul put /Ybi /Xbi currentpoint 3 1 roll def def 0 2 Blen 4 sub {/i exch def Bcontrol i get 3 div Bcontrol i 1 add get 3 div Bcontrol i get 3 mul Bcontrol i 2 add get add 6 div Bcontrol i 1 add get 3 mul Bcontrol i 3 add get add 6 div /Xbi Xcont Bcontrol i 2 add get 2 div add def /Ybi Ycont Bcontrol i 3 add get 2 div add def /Xcont Xcont Bcontrol i 2 add get add def /Ycont Ycont Bcontrol i 3 add get add def Xbi currentpoint pop sub Ybi currentpoint exch pop sub rcurveto }for dstroke}if}def end /ditstart{$DITroff begin /nfonts 60 def % NFONTS makedev/ditroff dependent! /fonts[nfonts{0}repeat]def /fontnames[nfonts{()}repeat]def /docsave save def }def % character outcalls /oc {/pswid exch def /cc exch def /name exch def /ditwid pswid fontsize mul resolution mul 72000 div def /ditsiz fontsize resolution mul 72 div def ocprocs name known{ocprocs name get exec}{name cb} ifelse}def /fractm [.65 0 0 .6 0 0] def /fraction {/fden exch def /fnum exch def gsave /cf currentfont def cf fractm makefont setfont 0 .3 dm 2 copy neg rmoveto fnum show rmoveto currentfont cf setfont(\244)show setfont fden show grestore ditwid 0 rmoveto} def /oce {grestore ditwid 0 rmoveto}def /dm {ditsiz mul}def /ocprocs 50 dict def ocprocs begin (14){(1)(4)fraction}def (12){(1)(2)fraction}def (34){(3)(4)fraction}def (13){(1)(3)fraction}def (23){(2)(3)fraction}def (18){(1)(8)fraction}def (38){(3)(8)fraction}def (58){(5)(8)fraction}def (78){(7)(8)fraction}def (sr){gsave 0 .06 dm rmoveto(\326)show oce}def (is){gsave 0 .15 dm rmoveto(\362)show oce}def (->){gsave 0 .02 dm rmoveto(\256)show oce}def (<-){gsave 0 .02 dm rmoveto(\254)show oce}def (==){gsave 0 .05 dm rmoveto(\272)show oce}def end % an attempt at a PostScript FONT to implement ditroff special chars % this will enable us to % cache the little buggers % generate faster, more compact PS out of psdit % confuse everyone (including myself)! 50 dict dup begin /FontType 3 def /FontName /DIThacks def /FontMatrix [.001 0 0 .001 0 0] def /FontBBox [-260 -260 900 900] def% a lie but ... /Encoding 256 array def 0 1 255{Encoding exch /.notdef put}for Encoding dup 8#040/space put %space dup 8#110/rc put %right ceil dup 8#111/lt put %left top curl dup 8#112/bv put %bold vert dup 8#113/lk put %left mid curl dup 8#114/lb put %left bot curl dup 8#115/rt put %right top curl dup 8#116/rk put %right mid curl dup 8#117/rb put %right bot curl dup 8#120/rf put %right floor dup 8#121/lf put %left floor dup 8#122/lc put %left ceil dup 8#140/sq put %square dup 8#141/bx put %box dup 8#142/ci put %circle dup 8#143/br put %box rule dup 8#144/rn put %root extender dup 8#145/vr put %vertical rule dup 8#146/ob put %outline bullet dup 8#147/bu put %bullet dup 8#150/ru put %rule dup 8#151/ul put %underline pop /DITfd 100 dict def /BuildChar{0 begin /cc exch def /fd exch def /charname fd /Encoding get cc get def /charwid fd /Metrics get charname get def /charproc fd /CharProcs get charname get def charwid 0 fd /FontBBox get aload pop setcachedevice 2 setlinejoin 40 setlinewidth newpath 0 0 moveto gsave charproc grestore end}def /BuildChar load 0 DITfd put %/UniqueID 5 def /CharProcs 50 dict def CharProcs begin /space{}def /.notdef{}def /ru{500 0 rls}def /rn{0 840 moveto 500 0 rls}def /vr{0 800 moveto 0 -770 rls}def /bv{0 800 moveto 0 -1000 rls}def /br{0 750 moveto 0 -1000 rls}def /ul{0 -140 moveto 500 0 rls}def /ob{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath stroke}def /bu{200 250 rmoveto currentpoint newpath 200 0 360 arc closepath fill}def /sq{80 0 rmoveto currentpoint dround newpath moveto 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath stroke}def /bx{80 0 rmoveto currentpoint dround newpath moveto 640 0 rlineto 0 640 rlineto -640 0 rlineto closepath fill}def /ci{500 360 rmoveto currentpoint newpath 333 0 360 arc 50 setlinewidth stroke}def /lt{0 -200 moveto 0 550 rlineto currx 800 2cx s4 add exch s4 a4p stroke}def /lb{0 800 moveto 0 -550 rlineto currx -200 2cx s4 add exch s4 a4p stroke}def /rt{0 -200 moveto 0 550 rlineto currx 800 2cx s4 sub exch s4 a4p stroke}def /rb{0 800 moveto 0 -500 rlineto currx -200 2cx s4 sub exch s4 a4p stroke}def /lk{0 800 moveto 0 300 -300 300 s4 arcto pop pop 1000 sub 0 300 4 2 roll s4 a4p 0 -200 lineto stroke}def /rk{0 800 moveto 0 300 s2 300 s4 arcto pop pop 1000 sub 0 300 4 2 roll s4 a4p 0 -200 lineto stroke}def /lf{0 800 moveto 0 -1000 rlineto s4 0 rls}def /rf{0 800 moveto 0 -1000 rlineto s4 neg 0 rls}def /lc{0 -200 moveto 0 1000 rlineto s4 0 rls}def /rc{0 -200 moveto 0 1000 rlineto s4 neg 0 rls}def end /Metrics 50 dict def Metrics begin /.notdef 0 def /space 500 def /ru 500 def /br 0 def /lt 416 def /lb 416 def /rt 416 def /rb 416 def /lk 416 def /rk 416 def /rc 416 def /lc 416 def /rf 416 def /lf 416 def /bv 416 def /ob 350 def /bu 350 def /ci 750 def /bx 750 def /sq 750 def /rn 500 def /ul 500 def /vr 0 def end DITfd begin /s2 500 def /s4 250 def /s3 333 def /a4p{arcto pop pop pop pop}def /2cx{2 copy exch}def /rls{rlineto stroke}def /currx{currentpoint pop}def /dround{transform round exch round exch itransform} def end end /DIThacks exch definefont pop ditstart (psc)xT 576 1 1 xr 1(Times-Roman)xf 1 f 2(Times-Italic)xf 2 f 3(Times-Bold)xf 3 f 4(Times-BoldItalic)xf 4 f 5(Helvetica)xf 5 f 6(Helvetica-Bold)xf 6 f 7(Courier)xf 7 f 8(Courier-Bold)xf 8 f 9(Symbol)xf 9 f 10(DIThacks)xf 10 f 10 s 1 f xi %%EndProlog %%Page: 1 1 10 s 0 xH 0 xS 1 f 10 f 96(d)Y 4280(d)X 1 f 2114 768(This)N 2276(is)X 2349(a)X 2405(centered)X 2698(line.)X 2 p %%Page: 2 2 10 s 0 xH 0 xS 1 f 3 f 10 f 0 90(d)N 4280(d)X 1 f 748 768(This)N 910(is)X 983(the)X 1101(centered)X 1394(line)X 1534(on)X 1634(page)X 1806(two.)X 10 f 0 6424(d)N 4280(d)X 2 p %%Trailer xt xs From don@brillig.umd.edu Tue Oct 4 23:19:06 1988 Date: Tue, 4 Oct 88 23:19:06 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Hello from INTEROP88 From: kwe@bu-cs.bu.edu (kwe@bu-it.bu.edu (Kent W. England)) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article ron@ron.rutgers.edu (Ron Natalie) writes: >I love a trade show that I can walk into almost any booth and >get logged in at reasonable speed to my home machine. I thought that the "Show and Tel-Net" [ha ha] was very effective. I spent a lot of time banging on terminal servers while I was at the show. In fact, I read your article while connected from a telnet session on a PC on token ring in U-B's booth in Santa Clara into my home system in Boston. And it was fast. The show nets were registered with the NIC, the nameservers worked, SNMP worked and a hell of a lot of stuff interoperated. I thought that InterOp was a very good demonstration of how seriously many vendors are taking interoperability. Value added is now added on top of the (standard) protocols and not with different and proprietary (for their own sake) protocols. Wave of the future? I saw a lot of product differentiation, it just wasn't at the protocol level, thank god. Had a lot of fun, too. From don@brillig.umd.edu Tue Oct 4 23:19:58 1988 Date: Tue, 4 Oct 88 23:19:58 EDT To: NeWS-makers@brillig.umd.edu Subject: RunIt: Run an icon sequence along bottom of your screen From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The following is a little ditty I threw together when I was learning NeWS. I'm particularly fond of "RunIt eye", but most people prefer "RunIt race". Please exercise discression with the "@" and "@@" options. Stan Switzer sjs@ctt.bellcore.com ---------------------------------------------- #!/bin/sh # # runit: animate an icon sequence across the bottom of the screen # # Copyright (C) 1988 by Stan Switzer. All rights reserved. # This program is provided for unrestricted use, provided that this # copyright message is preserved. There is no warranty, and no author # or distributer accepts responsibility for any damage caused by this # program. # # Stan Switzer sjs@ctt.bellcore.com # # This program is an elaboration on a theme by Randy Jackson. # It was one of my first NeWS programs, so don't look for any elegant # hacks in here. # # usage: # runit [options] [thing] # options: # +, - a bit faster or slower # -y how high up the screen # @ run it on someone else's system # @@ a sneakier way to do the same # things: # horse (default), race, man, boy, eye, trek, and # other more boring things that you can find at # the end of the file THING=horse SPEED=0 SYS= Y= CMD=psh N=/usr/NeWS/bin for ARG do case "$ARG" in [+\-][0123456789]* ) SPEED="$ARG";; -y* ) Y="{ `expr "$ARG" : '-y\(.*\)'` } setY";; @@* ) SYS=`expr "$ARG" : '..\(.*\)'` CMD="rsh $SYS sh -c 'NEWSSERVER=\"`setnewshost $SYS`\" $N/psh'";; @* ) SYS=`expr "$ARG" : '.\(.*\)'`;; * ) THING="$ARG";; esac done if test "X$THING" = Xrace then for THING in "horse -y'1.5 in'" "horse -y'1 in' -2" \ "horse -y'2 in' +3" "horse -y'0 in' +7" \ "horse -y'.5 in' +3" "boy +10" do eval $0 $THING; sleep 1 done exit fi if test -z "$NEWSHOME"; then NEWSHOME=/usr/NeWS; fi case $PATH in */NeWS/bin ) ;; * ) PATH=$PATH:$NEWSHOME/bin; export PATH;; esac if test -n "$SYS" then if NEWSSERVER=`setnewshost $SYS` then export NEWSSERVER else exit 1 fi fi { cat <<-! ; echo "$Y $SPEED /$THING runit"; } | $CMD /fillbox {DefaultRootGrayOrColor setshade fill} def /runnergray DefaultRootGrayOrColor setshade currenthsbcolor exch pop exch pop .5 lt 1 0 ifelse def /setY { stopped { (bad Y spec) == exit } if /Y exch def } def /in { 72 mul } def /inch { 72 mul } def /cm { in 2.54 div } def /Y 4 def /X 0 def /intrst null def /delay { intrst null eq { /intrst createevent def intrst begin /Name /DelayOver def currentdict end dup expressinterest createevent copy begin /TimeStamp currenttime delayamt add def currentdict end sendevent } if awaitevent begin % /TimeStamp TimeStamp delayamt add def % Makes up for lost time /TimeStamp currenttime delayamt add def % Accepts its loss currentdict end sendevent } def /tostring { 1 string dup 0 icondict 5 -1 roll get put } def /onestep { % icon-string -> - dup /X X Xinc add def X Y moveto runnergray setgray show delay X Y moveto stringbbox 4 -2 roll rmoveto rect fillbox } def /steps { % [icon-strings] -> { onestep } forall } def /tostrings { [ exch //tostring forall ] } def /iconfont (Icon) findfont 12 scalefont def /runthing { % Iter [ iconnames ] delay Incr -> /Xinc exch def 6000 div /delayamt exch def gsave iconfont setfont tostrings exch { dup steps } repeat grestore } def /runit { % speedinc thing -> - dup runners exch known not { (unknown runner: ) print == pop } { runners exch get /icondesc exch def neg % negate speec inc icondesc 1 get add % add default speed /speed exch def getcanvasshape setpath pathbbox pop exch pop exch sub % frame width icondesc 0 get length icondesc 2 get mul div 1 add % repeat count icondesc 0 get speed icondesc 2 get { runthing } fork pop } ifelse } def /runners 100 dict def runners begin /horse [ [ /horse1 /horse2 /horse3 /horse4 /horse5 ] 10 8 ] def /man [ [ /man1 /man2 /man3 /man4 /man5 ] 10 3.5 ] def /boy [ [ /boy1 /boy2 /boy3 /boy4 ] 20 7 ] def /eye [ [ /eye1 /eye1 /eye2 /eye3 /eye4 /eye_bld3 /eye_bld2 /eye_bld1 /eye_bld2 /eye_bld3 /eye4 /eye3 /eye2 /eye1 ] 10 3 ] def /bulb [ [ /bulb ] 5 4 ] def /sun [ [ /client ] 10 3 ] def /rip [ [ /dead ] 10 3 ] def /trek [ [ /trek ] 6 4 ] def /logo [ [ /sun30 ] 10 3 ] def /biglogo [ [ /sun ] 10 3 ] def /bozo [ [ /no_bozos ] 10 3 ] def /nuke [ [ /nuke ] 10 3 ] def end ! # --- if anything follows this line, it is not part of the program --- From don@brillig.umd.edu Tue Oct 4 23:21:40 1988 Date: Tue, 4 Oct 88 23:21:40 EDT To: NeWS-makers@brillig.umd.edu Subject: insignificant zeros crash server, film at 11 ... From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) It sounds weird to me, but both of the following programs cause the server to dump core: [ 4.00000 ] 0 setdash 100 100 moveto 200 100 lineto stroke and [ 00004.0 ] 0 setdash 100 100 moveto 200 100 lineto stroke Why? Because there are too many insignificant zeros in the value specified in the dash pattern array! No, really. If you remove one of the insignificant trailing/leading zeros from either program, the program executes correctly. I am running on a Sun 3/160 running NeWS 1.1 under SunOS 3.4. Some dbx information concerning the core image follows. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org ------------------------------------------------------------------------------ The OSF. Just say NO. ------------------------------------------------------------------------------ % dbx /usr/NeWS/bin/news_server-mc68010.debug core Reading symbolic information... Read 37102 symbols (dbx) where _malloc_at_addr(0xfffc4000) at 0x7dfee malloc(0xfffc355c) at 0x7da1b realloc(0x240650, 0xfffc355c) at 0x7dd91 enlarge_path(gc = 0xa9170), line 129 in "flattenpath.c" cs_dashpath(gc = 0x12e90c), line 262 in "flattenpath.c" PostScript(ee = 0x12e8c4), line 3066 in "operators.h" run_process(ee = 0x12e8c4), line 431 in "sched.c" run_readers(read_mask = 0xefffd44), line 480 in "sched.c" RunScheduler(), line 162 in "sched.c" main(argc = 1, argv = 0xefffd94, 0xefffd9c), line 1139 in "PostScript.c" (dbx) dump gc = 0xa9170 (dbx) quit % From don@brillig.umd.edu Tue Oct 4 23:22:11 1988 Date: Tue, 4 Oct 88 23:22:11 EDT To: NeWS-makers@brillig.umd.edu Subject: Help From: sm.unisys.com!csun!polyslo!lchirica@oberon.usc.edu (Laurian Chirica) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Could someone please sketch a solution to the following problem? Let's say I want two people to play a board game on two different hosts/workstations. They need to see and update identical copies of the same window. Changes made by any user on his/her window should show up on the other's window. How can this be accomplished? Can a client access two servers at the same time (or dynamically change the server)? Does someone have example code which does this sort of thing? Any hints on how to approach this problem would be appreciated. TIA, --Laurian PS. Is there a comp.source.news group? If not, maybe it is time to have one so people who (in my opinion) make very useful contribution with their code do not feel guilty about posting large files in this group. -- Laurian M. Chirica ..!ihnp4!csun\ Computer Science Department ..!ucbvax!voder | California Polytechnic State University ..!sdcrdcf!csun |!polyslo!lchirica San Luis Obispo, CA 93407-(805)756-1332 ..!lll-crg!csustan/ From don@brillig.umd.edu Tue Oct 4 23:22:47 1988 Date: Tue, 4 Oct 88 23:22:47 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers - request for info From: salt.uucp!gerber@uunet.uu.net (Andrew Gerber) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <643@prlhp1.prl.philips.co.uk> colers@prlhp1.prl.philips.co.uk (Richard Cole) writes: > >Hi, > we are running NeWS 1.1 on SUNs. I have been trying to produce >output on a remote server to no avail ! I have followed the >procedure in the Sun NeWS manual; Read your manual a bit more! (Even though the NeWS 1.1 manual is pretty deficient). The command "newshost" is used to allow remote NeWS servers to connect to a given workstation. If you were on machine salt, to let machine pepper pop up NeWS windows remotely you would say: salt% newshost add pepper Also setting the systemdict entry /NetSecurityWanted to false will disable network security. Does anyone know what newshost enable and disable do? They are not described on the newshost manual page. ----------------------------------------------------------------------------- Andrew S. Gerber | McDonnell Douglas Communication Industry Systems uunet!salt!gerber | 5299 DTC Blvd, Englewood, CO 80111 salt!gerber@uunet.uu.net | (303) 220 6231 ----------------------------------------------------------------------------- From don@brillig.umd.edu Tue Oct 4 23:24:41 1988 Date: Tue, 4 Oct 88 23:24:41 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers From: James Peterson Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Rich Berlin writes: > > In article <643@prlhp1.prl.philips.co.uk> Richard Cole writes: > > > > I get the following message on the server > > > > Network security violation: > > Rejected connection from yyyy > > > > where yyyy is the id of the mechine originating the message. > > ... To make machine yyyy a trusted > host, you must execute the command > > newshost add yyyy > > on machine xxxx. Another possibility is to modify the value of NetSecurityWanted in lib/NeWS/init.ps: /NetSecurityWanted false def % false if everyone is allowed to connect By default this variable is shipped as true. If it is true, then network security is used, as Rich described. When it is false, the entire process is ignored and any machine can access any other -- much easier in a trusted environment. (In theory, if NetSecurityWanted is false, an undergraduate with access to the Internet at Berkeley could pop windows up on a screen at Maryland, so you have to consider ALL machines that can access yours). jim From don@brillig.umd.edu Tue Oct 4 23:25:10 1988 Date: Tue, 4 Oct 88 23:25:10 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers - request for info From: bvs@Sun.COM (Bruce Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) You can also put the line: /NetSecurityWanted false store in your user.ps file on the server. That lets anyone access the server. -Bruce From don@brillig.umd.edu Tue Oct 4 23:58:32 1988 Date: Tue, 4 Oct 88 23:58:32 EDT To: NeWS-makers@brillig.umd.edu Subject: Help From: sm.unisys.com!csun!polyslo!lchirica@oberon.usc.edu (Laurian Chirica) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Could someone please sketch a solution to the following problem? Let's say I want two people to play a board game on two different hosts/workstations. They need to see and update identical copies of the same window. Changes made by any user on his/her window should show up on the other's window. How can this be accomplished? Can a client access two servers at the same time (or dynamically change the server)? Does someone have example code which does this sort of thing? Any hints on how to approach this problem would be appreciated. TIA, --Laurian PS. Is there a comp.source.news group? If not, maybe it is time to have one so people who (in my opinion) make very useful contribution with their code do not feel guilty about posting large files in this group. -- Laurian M. Chirica ..!ihnp4!csun\ Computer Science Department ..!ucbvax!voder | California Polytechnic State University ..!sdcrdcf!csun |!polyslo!lchirica San Luis Obispo, CA 93407-(805)756-1332 ..!lll-crg!csustan/ From don@brillig.umd.edu Wed Oct 5 00:18:48 1988 Date: Wed, 5 Oct 88 00:18:48 EDT To: NeWS-makers@brillig.umd.edu Subject: SunView on X11 From: rprobst@sun.com (Richard Probst) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In separate messages, Antonio Romero and Roderick Sprattling asked about porting SunView applications to X11. The easiest way to move SunView applications to X11 is to hope that someone else will port the SunView toolkit to X11, with as much source compatibility as possible. That is exactly what Sun has done. The second version of SunView, called View2, is an X11 toolkit currently in alpha test by application developers within Sun. View2 uses Xlib, but not the Xt intrinsics. That is, it is not a set of widgets. Instead, we took the existing SunView code and moved it onto Xlib. The benefit of this is that we kept a high degree of source compatibility. SunView applications can be converted to View2 applications in a small number of days. We did not strive for full recompile-&-go source compatibility, because moving to a network window system does introduce some unavoidable changes, but the conversion is simple and fairly mechanical. Many Sun applications have been converted and are being tested. View2-based tools are now up and running on Sun3, Sun4, Sun386i, and on a microVax in our engineering lab. On the Suns, View2 runs on top of X11/NeWS. On the microVax, View2 runs on top of X11R3. Sun will not ship the microVax port; it was done purely to demonstrate portability. View2 provides the OPEN LOOK user interface. To get full OPEN LOOK on the screen, you also need to use an OPEN LOOK window manager. View2-based tools can work with other window managers, such as uwm, but do not then look like the OPEN LOOK spec (and since Sun has adopted OPEN LOOK as our UI policy, we don't intend to test this configuration). View2 communicates with a window manager according to the ICCCM draft standard. To dispel possible confusion, note that there are several toolkits implementing the OPEN LOOK user interface. OPEN LOOK is a spec, not a toolkit. Other announced OPEN LOOK toolkits are Xt+ from AT&T, and NDE (which runs on top of the NeWS side of X11/NeWS). The View2 libraries will ship with the X11/NeWS server in 1989. Beta sites have already been selected and contacted. --Richard Probst (rprobst@sun.com) Manager for SunView and View2 From don@brillig.umd.edu Thu Oct 6 22:13:39 1988 Date: Thu, 6 Oct 88 22:13:39 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers From: elbereth.rutgers.edu!ron.rutgers.edu!ron@rutgers.edu (Ron Natalie) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Worse than popping up windows, which is only annoying, they can execute UNIX commands through your interpretter with out you even noticing. -Ron From don@brillig.umd.edu Thu Oct 6 22:14:23 1988 Date: Thu, 6 Oct 88 22:14:23 EDT To: NeWS-makers@brillig.umd.edu Subject: Bug in psterm... From: siegel@hc.dspo.gov (josh Siegel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Below is a report and not a fix to a bug in psterm.... Seems psterm tries to optimise the work in does on the screen and messes up. The code below is for a psterm running the sun termcap. It is just a editing sequence on a single line. One thing to notice is that the faster the sequence comes out, the worse it looks. at 0 it is VERY bad, and 50000 it is bad, at 100000 it is getting there and at 200000 it is exactly what it should look like. Anybody have any fixes for this yet? thanks much... --Josh Siegel ---- char script[]={109, 97, 105, 108, 114, 99, 8, 8, 8, 8, 27, 91, 64, 116, 105, 8, 27, 91, 64, 104, 105, 8, 105, 27, 91, 64, 105, 108, 8, 8, 27, 91, 64, 115, 105, 8, 27, 91, 64, 32, 105, 8, 105, 27, 91, 64, 105, 108, 8, 8, 27, 91, 64, 115, 105, 8, 27, 91, 64, 32, 105, 8, 27, 91, 64, 97, 105, 8, 27, 91, 64, 32, 105, 8, 27, 91, 64, 116, 105, 8, 27, 91, 64, 101, 105, 8, 27, 91, 64, 115, 105, 8, 27, 91, 64, 116, 105, 8, 13, 13, 10, 0}; main(argc,argv) int argc; char *argv[]; { char c,*p; int sl; if(argc>1) sl = atoi(argv[1]); else sl = 0; p = script; while((c = *p++)!=0) { write(1,&c,1); usleep(sl); } } -- Josh Siegel (siegel@hc.dspo.gov) I like using a C-47A "puff dragon" to go shooting beer cans with. From don@brillig.umd.edu Thu Oct 6 22:14:31 1988 Date: Thu, 6 Oct 88 22:14:31 EDT To: NeWS-makers@brillig.umd.edu Subject: Iterated Function Sequence Fractal Generator. From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Pointalist Fractals. I'd like to point out that this program would run alot faster if the "x y matrix => x' y'" version of "transform" actually worked. As ALLways, Enjoy! Stan Switzer "Thou shalt not have no idea." sjs@ctt.bellcore.com P.S.: Please note that my news poster insists on building a bogus "from" field. Mail only to the address in my signature line. P.P.S.: Maybe someday I'll post something useful. ----------------------------------------------------- #!/bin/sh # # ifs: "Iterated Function Sequence" fractals # # Copyright (C) 1988 by Stan Switzer. All rights reserved. # This program is provided for unrestricted use, provided that this # copyright message is preserved. There is no warranty, and no author # or distributer accepts responsibility for any damage caused by this # program. # # Stan Switzer sjs@ctt.bellcore.com # # Invocation: # ifs [fern|square|tree|tri] # # The default fractal patern is the name of the command (supposing # it is linked to "tree", for instance), and failing that "fern". # The fern looks best when the window is somewhat taller than wide. # # If you prefer, you can have it draw in the icon when closed by setting # /DrawInIcon? to true. This has the disadvantage of using CPU cycles # when the window is closed. Caveat Hacktor. # # The idea for this came from an article in "Byte." For the record, I # do not usually read that magazine. Details below. if test -z "$1"; then set `basename $0`; fi case "$1" in *tri*|[Ss]ier*) X=SierpinskiTriangle;; *squ*) X=Square;; *tree*) X=Tree;; *fern*|*) X=Fern;; esac # the arrays below work as follows: # /name [ [view-transform] # [ transform-1 prob-1 ] # [ transform-2 prob-2 ] # . . . # [ transform-n prob-n ] # ] def # # An iterated function sequence simply iterates the transformations # beginning with some random point according to the specified probabilities. # The first 20 iterations are thrown away in order to allow it to # converge. Basically, the transformations describe the self-similarities # and the probabilities are essentially the ratios of the areas of the # parts to the whole. # # Note that there were typos in the article in the transforms for the # fern. I have also made some aesthetic imporvements to the "tree" to # give the trunk some width. # # Finally, I'd like to comment that this program would really scream if # NeWS implemented the "x y matrix => x' y'" for of transform. I have # to do this the hard way instead. { cat <<-! /DrawInIcon? false def /SierpinskiTriangle [ [ .45 0 0 .9 .05 .05 ] [ 0.50 0.00 0.00 0.50 0.00 0.00 0.33 ] [ 0.50 0.00 0.00 0.50 1.00 0.00 0.33 ] [ 0.50 0.00 0.00 0.50 0.50 0.50 0.33 ] ] def /Fern [ [ -.15 0 0 .095 .5 0 ] [ 0.85 0.04 -0.04 0.85 0.00 1.60 0.85 ] [ 0.20 -0.26 0.23 0.22 0.00 1.60 0.07 ] [ -0.15 -0.28 -0.26 0.24 0.00 0.44 0.07 ] [ 0.00 0.00 0.00 0.16 0.00 0.00 0.01 ] ] def /Tree [ [ 1.75 0 0 2 .5 0 ] [ 0.42 -0.42 0.42 0.42 0.00 0.20 0.40 ] [ 0.42 0.42 -0.42 0.42 0.00 0.20 0.40 ] %[ 0.10 0.00 0.00 0.10 0.00 0.20 0.15 ] %[ 0.02 0.02 0.02 0.50 0.00 0.00 0.05 ] [ 0.02 0.01 0.01 0.50 0.00 0.00 0.10 ] [ 0.03 0.01 0.01 -0.40 0.00 0.20 0.10 ] ] def /Square [ [ .5 0 0 .5 .25 .25 ] [ 0.50 0.00 0.00 0.50 0.00 0.00 0.25 ] [ 0.50 0.00 0.00 0.50 0.50 0.00 0.25 ] [ 0.50 0.00 0.00 0.50 0.00 0.50 0.25 ] [ 0.50 0.00 0.00 0.50 0.50 0.50 0.25 ] ] def /SetCode { % codearray dup dup length 1 sub 1 exch getinterval [ exch { [ exch dup 6 get exch 0 6 getinterval ] } forall ] /codes exch def codes dup length 1 sub get 0 1000 put 0 get /viewxform exch def } def /choosecode { random codes { % 0-1 code dup 0 get 3 -1 roll exch sub dup 0 le { pop exit } if exch pop } forall 1 get } def /xfm /transform load def /xfm { % x y mat 2 index 1 index 0 get mul % x y mat xa 2 index 2 index 2 get mul add % x y mat xa+yc 1 index 4 get add % x y mat x' 3 index 2 index 1 get mul % x y mat x' xb 3 index 3 index 3 get mul add % x y mat x' xb+yd 2 index 5 get add % x y mat x' y' 5 2 roll pop pop pop } def /X { choosecode xfm } def /P { moveto 0 0 rlineto stroke } def /IFSWindow DefaultWindow dictbegin /reshaped? false def /rescale? false def /drawproc null def dictend classbegin /reshape { /reshape super send /reshaped? true store } def /flipiconic { /flipiconic super send DrawInIcon? { /rescale? true store } { drawproc Iconic? { stop-it } { start-it } ifelse } ifelse } def DrawInIcon? { /CreateIconCanvas { /CreateIconCanvas super send IconCanvas begin /Transparent false def /Retained true def end } def } if /CreateFrameCanvas { /CreateFrameCanvas super send FrameCanvas begin /Transparent false def /Retained true def end } def /DrawingCanvas { Iconic? IconCanvas ClientCanvas ifelse } def /stop-it { drawproc null ne { drawproc killprocess } if /drawproc null def } def /start-it { stop-it /rescale? true def /drawproc { random random 20 /X load repeat % iterate initial random pt { reshaped? { /rescale? true def } if rescale? { DrawingCanvas win send setcanvas clippath pathbbox scale pop pop viewxform concat /rescale? false store } if reshaped? { ClientFillColor fillcanvas 0 setgray /reshaped? false store } if 5 { X 2 copy P } repeat pause } loop } fork store } def classend def /main { /reshaped? false def /win framebuffer /new IFSWindow send def % Create a window { /IconLabel DrawInIcon? { pop pop } { exch def } ifelse /FrameLabel exch def } win send /reshapefromuser win send % Shape it. /map win send % Map the window. (Damage causes PaintClient to be called) /start-it win send } def /Go { SetCode main } def ! echo "(IFS Fractal: $X) ($X) $X Go" } | psh From don@brillig.umd.edu Thu Oct 6 22:26:27 1988 Date: Thu, 6 Oct 88 22:26:27 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Bug in psterm... From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) You're right -- there really is a bug in psterm! Two questions, though: Who's mathis? What's a testilrc? At least it didn't pop up any windows or fork off any Unix processes! c(-; -Don From don@brillig.umd.edu Fri Oct 7 19:32:42 1988 Date: Fri, 7 Oct 88 19:32:42 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: psview bug From: Greg Earle Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is because apparently `psview' has no notion of currentpoint when it enters the first page. It blows up when it first tries to execute the `X' definition (which is nearly almost immediate in `psdit' output). If you insert a 0 0 moveto immediately below the %%Page: 1 1 (i.e., before the actual code) then `psview' will work, and no ill effects are incurred. Obviously, one would rather not have to edit the PostScript output file every time one wants to use `psview', so I reported it (rather casually, as opposed to formally) to Steve Evans on the vendor exhibit floor at June Usenix (I told you I reported it casually (^: ). I've no idea what the fix is; I hope Steve had an Elephantine memory enough so that someone could check into it. - Greg Earle Sun Los Angeles Consulting earle@Sun.COM earle@mahendo.JPL.NASA.GOV (Guest account) From don@brillig.umd.edu Sat Oct 8 19:18:18 1988 Date: Sat, 8 Oct 88 19:18:18 EDT To: NeWS-makers@brillig.umd.edu Subject: latest sun-4 news server, reliable? From: polya!polya.stanford.EDU!ham@labrea.stanford.edu (Peter R. Ham) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm trying to convince my project group to use NeWS rather than X11 to develop a graphical environment for an object oriented programming language. At stanford, we just got a bunch of Sun 4's. Is the latest version of NeWS that comes with sun 4's reliable enough for development work? One of the arguments against NeWS is that all of the available implementations are too buggy. Also, is there any public on-line documentation about NeWS (like a manual), so that I can make a better decision about what system to use. Peter From don@brillig.umd.edu Sat Oct 8 19:18:30 1988 Date: Sat, 8 Oct 88 19:18:30 EDT To: NeWS-makers@brillig.umd.edu Subject: which os for NeWS? From: polya!polya.stanford.EDU!ham@labrea.stanford.edu (Peter R. Ham) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Which version of the Sun Os is needed for the latest and greatest version of NewS to run on Sun4's and Sun3's? Peter From don@brillig.umd.edu Sat Oct 8 19:19:07 1988 Date: Sat, 8 Oct 88 19:19:07 EDT To: NeWS-makers@brillig.umd.edu Subject: On-line NeWS documentation From: polya!polya.stanford.EDU!ham@labrea.stanford.edu (Peter R. Ham) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I need som NeWS documenation fast. Is there any publicly availble on-line documentation for news? How about a book available in book stores? I'm trying to decide wheter to use X11 or NeWS and need a closer look at NeWS, first. Peter From don@brillig.umd.edu Sat Oct 8 19:19:50 1988 Date: Sat, 8 Oct 88 19:19:50 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: X and/or NeWS terminals From: mcvax!enea!pvab!robert@uunet.uu.net (Robert Claeson) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <178@hsi86.hsi.UUCP>, wright@hsi.UUCP (Gary Wright) writes: > Ok, I have seen some discussion about X terminals and have even seen > some actual hardware but I haven't seen much talk about a NeWS > terminal. Does anyone know of such a beast? > I would guess that NeWS would even run better than X in this > configuration because of the smaller amount of data that needs to go > across the link. But... NeWS requires a more powerful processor and more memory than X. Note: I like NeWS. -- Robert Claeson, ERBE DATA AB, P.O. Box 77, S-175 22 Jarfalla, Sweden Tel: +46 758-202 50 Fax: +46 758-197 20 Email: robert@pvab.se (soon rclaeson@erbe.se) From don@brillig.umd.edu Sat Oct 8 19:21:47 1988 Date: Sat, 8 Oct 88 19:21:47 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: latest sun-4 news server, reliable? From: siegel@hc.dspo.gov (josh Siegel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <4351@polya.Stanford.EDU> ham@polya.stanford.EDU (Peter R. Ham) writes: > >At stanford, we just got a bunch of Sun 4's. Is the latest >version of NeWS that comes with sun 4's reliable enough for >development work? definitly... we have developed several very large applications under NeWS now. > >One of the arguments against NeWS is that all of the >available implementations are too buggy. Not the release of NeWS 1.1... it is for the most part very clean. > >Also, is there any public on-line documentation about NeWS >(like a manual), so that I can make a better decision about >what system to use. Peter nope. Not that I know of. Don't you have a manual? You said it came with your machine. > > --Josh Siegel -- Josh Siegel (siegel@hc.dspo.gov) I like using a C-47A "puff dragon" to go shooting beer cans with. From don@brillig.umd.edu Thu Oct 13 03:59:35 1988 Date: Thu, 13 Oct 88 03:59:35 EDT To: NeWS-makers@brillig.umd.edu Subject: ruler application From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here is my first full NeWS application, the always popular *ruler*. Not just one ruler mind you, but three! The kind of rulers supported are English, Metric, and Unit. I almost forgot to mention that the ruler can be displayed either horizontally or vertically. Will the features ever stop? The only machine specific stuff about the ruler is the variable /units_per_inch, which is set to the number of units per inch :-) If your version of NeWS supports a correct default user space, set it to 72, otherwise figure the value out somehow. Sun NeWS 1.1 has the default user space set to be the monitor resolution, and the standard Sun monochrome monitor (which is what I have) has 83 pixels per inch. Enjoy. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org ------------------------------------------------------------------------------ The OSF. Just say NO. ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- #! /usr/NeWS/bin/psh % % An English, Metric, and Unit ruler. % %% Sun NeWS 1.1 bug fixes -------------------------------------------- % default user space equals the device resolution rather than % 72 units per inch, standard Sun monochrome monitor resolution is /units_per_inch 83 def % work around show bug when using rotated text on monochrome % monitors, individually emit each character of the string /SHOW { { cvis show } forall } def %% Global Definitions ------------------------------------------------ % upper case letters are 17 units tall for 24 point Times-Bold % font (so says charpath and pathbbox) /half_text_height 8.5 def % kinds of rulers /english 1 def /metric 2 def /unit 3 def /ruler_kind unit def /horizontal_ruler? true def /ruler_width 0 def % logical width /ruler_height 0 def % logical height /ruler_menu [ (English) { /ruler_kind english store draw_ruler } (Metric) { /ruler_kind metric store draw_ruler } (Unit) { /ruler_kind unit store draw_ruler } (Vertical Ruler) { make_vertical_ruler } (Stretch Edge) { getfbclick pop pop /stretchwindowedge ThisWindow send } (Quit) { currentprocess killprocessgroup } ] /new DefaultMenu send def %% English Stuff ---------------------------------------------------------- /english_hash_distance units_per_inch 8 div def /english_unit_width units_per_inch def % % Draw the ruler markings for an English ruler. % /draw_english_markings { % draw_hash_labels? => - /draw_hash_labels? exch def /hash_counter 1 def /current_hash_label 1 def english_hash_distance english_hash_distance ruler_width english_unit_width add { /x exch def x 0 moveto 0 hash_counter 8 eq { % inch draw_hash_labels? { (Inch) draw_ruler_kind current_hash_label x draw_hash_label } if /current_hash_label current_hash_label 1 add def /hash_counter 0 def 20 } { hash_counter 4 eq { % 1/2 inch 12.5 } { hash_counter 2 mod 0 eq { % 1/4 inch 8 } { % 1/8 inch 5 } ifelse } ifelse } ifelse rlineto stroke /hash_counter hash_counter 1 add def } for } def %% Metric Stuff ---------------------------------------------------------- /metric_hash_distance units_per_inch 25.4 div def /metric_unit_width metric_hash_distance 50 mul def % % Draw the ruler markings for a Metric ruler. % /draw_metric_markings { % draw_hash_labels? => - /draw_hash_labels? exch def /hash_counter 1 def /current_hash_label 5 def metric_hash_distance metric_hash_distance ruler_width metric_unit_width add { /x exch def x 0 moveto 0 hash_counter 10 mod 0 eq { % centimeter hash_counter 50 eq { draw_hash_labels? { (CM) draw_ruler_kind current_hash_label x draw_hash_label } if /current_hash_label current_hash_label 5 add def /hash_counter 0 def } if 20 } { % millimeter 5 } ifelse rlineto stroke /hash_counter hash_counter 1 add def } for } def %% Unit Stuff ---------------------------------------------------------- /unit_hash_distance 10 def /unit_unit_width 100 def % % Draw the ruler markings for a Unit ruler. % /draw_unit_markings { % draw_hash_labels? => - /draw_hash_labels? exch def /hash_counter 1 def /current_hash_label 100 def unit_hash_distance unit_hash_distance ruler_width unit_unit_width add { /x exch def x 0 moveto 0 hash_counter 10 mod 0 eq { % 100 units 20 draw_hash_labels? { (Unit) draw_ruler_kind current_hash_label x draw_hash_label } if /current_hash_label current_hash_label 100 add def /hash_counter 0 def } { hash_counter 5 mod 0 eq { % 50 units 10 } { % 10 units 5 } ifelse } ifelse rlineto stroke /hash_counter hash_counter 1 add def } for } def %% Ruler Stuff ---------------------------------------------------------- % % Convert the horizontal ruler into a vertical ruler. % /make_vertical_ruler { % - => - /horizontal_ruler? false store % pivot the ruler about its center point /center_x win /FrameX get ruler_width 2 div add def /center_y win /FrameY get ruler_height 2 div add def center_x ruler_height 2 div sub center_y ruler_width 2 div sub ruler_height ruler_width /reshape win send % change menu entry back to "Horizontal Ruler" 3 (Horizontal Ruler) { make_horizontal_ruler } /changeitem ruler_menu send } def % % Convert the vertical ruler into a horizontal ruler. % /make_horizontal_ruler { % - => - /horizontal_ruler? true store % pivot the ruler about its center point /center_x win /FrameX get ruler_height 2 div add def /center_y win /FrameY get ruler_width 2 div add def center_x ruler_width 2 div sub center_y ruler_height 2 div sub ruler_width ruler_height /reshape win send % change menu entry back to "Vertical Ruler" 3 (Vertical Ruler) { make_vertical_ruler } /changeitem ruler_menu send } def % % Draw the kind of the ruler, English, Metric, or Unit. % /draw_ruler_kind { % ruler_kind => - gsave 10 ruler_height 2 idiv half_text_height sub moveto SHOW grestore } def % % Draw one of the ruler hash labels centered within the ruler. % /draw_hash_label { % x_position hash_label => - /x exch def /hash_label exch def /label_string 4 string def hash_label label_string cvs stringwidth pop /half_string_width exch 2 idiv def x half_string_width sub ruler_height 2 idiv half_text_height sub gsave moveto label_string SHOW grestore } def % % Draw the hash marks on the edge of the ruler. % /draw_hash_marks { % - => - 0 0 moveto % draw the bottom and top hash marks 1 1 2 { % invert the Y axis for the hash marks on the top 2 eq { 0 ruler_height translate [ 1 0 0 -1 0 0 ] concat false % draw_hash_labels? parameter to draw_XXX_markings routines } { true % draw_hash_labels? parameter to draw_XXX_markings routines } ifelse ruler_kind english eq { draw_english_markings } { ruler_kind metric eq { draw_metric_markings } { draw_unit_markings } ifelse } ifelse } for } def % % Draw the entire ruler. % /draw_ruler { % - => - win /ClientCanvas get setcanvas erasepage 0 strokecanvas % set up ruler for either horizontal or vertical display horizontal_ruler? { /ruler_width win /ClientWidth get store /ruler_height win /ClientHeight get store } { /ruler_width win /ClientHeight get store /ruler_height win /ClientWidth get store 0 ruler_width translate -90 rotate } ifelse draw_hash_marks } def %% Main ---------------------------------------------------------- /Times-Bold findfont 24 scalefont setfont /win framebuffer /new DefaultWindow send def { % remove the frame border, and redefine its associated methods /BorderLeft 0 def /BorderBottom 0 def /BorderRight 0 def /BorderTop 0 def /PaintFrame nullproc def /PaintFocus nullproc def /PaintClient { draw_ruler } def % redefine the menu /ClientMenu ruler_menu def } win send 150 450 850 90 /reshape win send /map win send From don@brillig.umd.edu Thu Oct 13 04:00:17 1988 Date: Thu, 13 Oct 88 04:00:17 EDT To: NeWS-makers@brillig.umd.edu Subject: Significant zeros - Is there a fix? From: rochester!rocksanne!norm@cu-arpa.cs.cornell.edu (Norm Zeck) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) With all the noted problems of significant zeros in floating point numbers, does anyone have a work around using cps? Looks like limiting the precision to four decmial places in pprintf may work. But has anyone fixed this? I have also tried using the "fixed" type of 16.16 (16 bit integer, 16 bit fraction represented as a long, but pprintf gets a memory violation in the code for parsing %e (fixed) numbers. -------------- Norm Zeck Xerox Corp. 800 Phillips Rd. 128-29E Webster N. Y., 14580 ARPA: NZeck.Wbst@Xerox.com UUCP: {decvax, allegra, seismo, cmcl2}!rochester!rocksanne!norm Phone: [USA] (716) 422 6246 -------------- From don@brillig.umd.edu Thu Oct 13 04:00:34 1988 Date: Thu, 13 Oct 88 04:00:34 EDT To: NeWS-makers@brillig.umd.edu Subject: Where's the FAX ? From: nyser!cmx!krempel@itsgw.rpi.edu (Henry BJ Krempel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does anyone know of a way to hook up a FAX machine to a Sun and view the result in a NeWS window? -- Henry B. J. Krempel Northeast Parallel Architectures Center (NPAC) Syracuse University 250 Machinery Hall, Syracuse, N.Y. 13244 From don@brillig.umd.edu Thu Oct 13 23:04:18 1988 Date: Thu, 13 Oct 88 23:04:18 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS based MicroEMACS From: uxg.cso.uiuc.edu!uxe.cso.uiuc.edu!ove@uxc.cso.uiuc.edu Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A NeWS based version of MicroEMACS is available via anonymous ftp from ftp.ncsa.uiuc.edu, in the directory Sun3/ue/NeWS. It requires NeWS v1.1, and has been tested on Suns and on a Cray 2 (Unicos). It is designed to reduce the interrupt load on the host, and does so to the level of a line editor. This is important in situations where the host, such as a Cray, is inefficient at such things. Using it on a Cray requires that the necessary parts of the NeWS client side library be ported. If anyone needs this I can put it on the ftp server as well, but my port was minimal (no guarantees for other applications). This is a preliminary version which is made available to get some feedback. Some things that will probably change are: 1) The mouse behaviour is inconsistent with Sun conventions. 2) The entire front end source is downloaded to the server every time the editor is invoked. It should check to see if it is locally available before doing so. 3) Not quite flashy enough to entice nontechnical users. Suggestions and modifications are welcome. Roger Ove ove@ncsa.uiuc.edu From don@brillig.umd.edu Thu Oct 13 23:04:40 1988 Date: Thu, 13 Oct 88 23:04:40 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: remote NeWS servers From: steinmetz!vdsvax!montnaro@itsgw.rpi.edu (Skip Montanaro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) James Peterson writes: Rich Berlin writes: > ... To make machine yyyy a trusted > host, you must execute the command > > newshost add yyyy > > on machine xxxx. Another possibility is to modify the value of NetSecurityWanted in lib/NeWS/init.ps: /NetSecurityWanted false def % false if everyone is allowed to connect Ay, Ay, Ay! Don't do this in /usr/NeWS/lib/NeWS/init.ps!!! You should not make the assumption that all users that access /usr/NeWS (possibly via NFS) want what little security exists to be disabled. Have the user execute the above line from his/her ~/user.ps Better yet, users should leave NetSecurityWanted true, then enable specific machines to communicate via lines like: RemoteHostRegistry /moose true put which allows client programs on "moose" to connect to my machine's server. -- Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa) From don@brillig.umd.edu Thu Oct 13 23:04:52 1988 Date: Thu, 13 Oct 88 23:04:52 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Where's the FAX ? From: prisma!mo@uunet.UU.NET Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Isn't buying a SCSI scanner easier? From don@brillig.umd.edu Fri Oct 14 04:51:23 1988 Date: Fri, 14 Oct 88 04:51:23 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Significant zeros - Is there a fix? From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > I have also tried using the "fixed" type of 16.16 (16 bit integer, > 16 bit fraction represented as a long, but pprintf gets a memory > violation in the code for parsing %e (fixed) numbers. I found this one a few months ago, but forgot to post the fix. I don't have the checked fix on this machine, but it went something like this; in function pprintf file ctops.c look for case 'e': at the bottom of the while loop you will see n = *np++; change this to if(cnt > 0) n = *np++; -greg. From don@brillig.umd.edu Fri Oct 14 04:51:30 1988 Date: Fri, 14 Oct 88 04:51:30 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: X and/or NeWS terminals From: mcvax!enea!kth!draken!bmc1!kuling!irf@uunet.uu.net (Bo Thide) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <1811@ogccse.ogc.edu> wm@ogccse.UUCP (Wm Leler) writes: >>> Ok, I have seen some discussion about X terminals and have even seen GraphOn has a series of hi-res terminals which are said to be usable as X displays. We have now 3 GO250 terminals and are egarely awaiting software from GraphOn to see whether this is true or not. The GO2xx series terminals use a quite efficient compress algorithm in order to increase the effective transfer speed of bitmaps etc. Max baud rate is 57600 but the compress trick can increase that by almost a factor of 10 sometimes. GO250 is VERY fast. I use mine over a 38400 line to my HP9000/350 without any problems - no terminfo/termcap delays are necessary. --Bo -- >>> Bo Thide', Swedish Institute of Space Physics, S-755 90 Uppsala, Sweden <<< Phone (+46) 18-300020. Telex: 76036 (IRFUPP S). UUCP: ..enea!kuling!irfu!bt From don@brillig.umd.edu Sat Oct 15 00:01:27 1988 Date: Sat, 15 Oct 88 00:01:27 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: insignificant zeros crash server, film at 11 ... From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8810040723.AA04993@brillig.umd.edu>, marshall@software.ORG (Eric Marshall) writes: > > It sounds weird to me, but both of the following programs > cause the server to dump core: > > [ 4.00000 ] 0 setdash > 100 100 moveto > 200 100 lineto stroke > and > [ 00004.0 ] 0 setdash > 100 100 moveto > 200 100 lineto stroke The following change fixes this problem (thanks to James for the fix) In the routine setdash() in server/nucleus/misc.c change case real_type: buf[i] = optop->value.real; break; to case real_type: buf[i] = fractf(optop->value.real); break; -- From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Sat Oct 15 00:01:41 1988 Date: Sat, 15 Oct 88 00:01:41 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: psview bug From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8809300237.AA23796@brillig.umd.edu>, marshall@software.ORG (Eric Marshall) writes: > > There is a bug in psview which appears when displaying > many of the files generated by psroff. The error only occurs > when attempting to display the first page of a document. Psh'ing > > NeWS error ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ---- > Process: 0x10E3A4 Error: nocurrentpoint We had this problem as well so I fixed it. I asumed that our psroff must be different from the one they use at Sun since it clearly worked for them. The fix is to add the line 0 0 moveto to psview.cps as shown below cdef ps_startpage() /@DictHeight countdictstack def @Dicts length 1 sub -1 0 { @Dicts exch get begin } for PGC { /@DictHeight countdictstack def @Dicts length 1 sub -1 0 { @Dicts exch get begin } for * 200 dict begin ****** 0 0 moveto cdef ps_endpage() * end . . . You might also want to add the lines 200 dict begin . . end as shown above since there are many PS programs that define lots of things on each page. I have sent these changes to Sun. Hopefully they will be included in the next psview. -- From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Sat Oct 15 00:02:39 1988 Date: Sat, 15 Oct 88 00:02:39 EDT To: NeWS-makers@brillig.umd.edu Subject: Where's the FAX ? From: berry%intrepid.s1.gov@mordor.s1.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >> prisma!mo said: >> >>Isn't buying a SCSI scanner easier? Not if you need to buy them for everyone in the world who might want to send you a fax. --berry From don@brillig.umd.edu Sat Oct 15 03:58:42 1988 Date: Sat, 15 Oct 88 03:58:42 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: X and/or NeWS terminals From: mailrus!uflorida!haven!vrdxhq!verdix!ogccse!wm@rutgers.edu (Wm Leler) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >> Ok, I have seen some discussion about X terminals and have even seen >> some actual hardware but I haven't seen much talk about a NeWS >> terminal. Does anyone know of such a beast? > >> I would guess that NeWS would even run better than X in this >> configuration because of the smaller amount of data that needs to go >> across the link. There are some people at Queen Mary College (part of University College of London? -- in the UK) that are working on an inexpensive NeWS terminal. Their hardware is transputer based, not for the parallelism, per se, but for the raw speed, low cost, and other advantages of the transputer. They want to make it cheap enough so that one might buy it for home and run it over a 2400 baud phone line, but it also includes ethernet. William Roberts at QMC also has an archive of interesting NeWS and PostScript software. He was the original author of the "eye that tracks the mouse position" demo (among other things). Of course, any workstation that runs NeWS could be used as a NeWS terminal (such as a Sun, Cogent XTM, Silicon Graphics workstation, or Mac II) and given the continual decrease in the price of workstations (well, with the exception of the Mac :-), that might be a pretty good option soon. wm From don@brillig.umd.edu Sun Oct 16 02:20:31 1988 Date: Sun, 16 Oct 88 02:20:31 EDT To: NeWS-makers@brillig.umd.edu Subject: Reporting bugs in NeWS and other software products from Sun From: kimba!hvr@sun.com (Heather Rose) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Just to let you all know. If you would like to report a bug you've found in NeWS or any other Sun software product, you can send a description of the problem to the ...!sun!sunbugs alias. This allows customers without support contracts or without warrenty contracts to report the bugs they encounter. This applies to documentation problems, software problems, or even a feature you would like to see added. In your bug reports, be sure to include the following to make evaluation go faster: what release you're running (type "cat /etc/motd" if you don't know) what product you're using what machine architecture you're using (sun3/110, sun4/260, etc...) a brief description of the bug a statement about how important that this bug is fixed. a workaround for the bug if you've found one a code segment or sequence of commands to reproduce the bug The last point is the most important! It's difficult to evaluate a bug unless it can be reproduced in a sufficiently small segment of code. Those who send to sun!sunbugs are generally not contacted after submitting a bug, but these things are looked at, evaluated, and appreciated. So, if you would like to see particular bugs fixed, it's best to submit a bug report. If anyone has any particular issues they would like to discuss, just send me email and I will attempt to address them. Please do not send me bug reports, send them to sun!sunbugs. Thanks, Heather Rose Tech. Support Engineer From don@brillig.umd.edu Tue Oct 18 00:13:04 1988 Date: Tue, 18 Oct 88 00:13:04 EDT To: NeWS-makers@brillig.umd.edu Subject: invisible class variables From: socrates.ucsf.edu!pett@cgl.ucsf.edu (Eric Pettersen%CGL) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've come across an annoying shortcoming in the NeWS class mechanism implementation. There is no clean way to access the class variables of a superclass while a subclass is being defined. They are not available at class definition time, not even via "super send". It would seem logical to me that one should be able to define the class variables of a subclass in terms of the class variables of the superclass. Is there a good reason a subclass definition should not be able to get the superclass class variables? Eric Pettersen pett@cgl.ucsf.edu ...!ucbvax!ucsfcgl!pett From don@brillig.umd.edu Thu Oct 20 19:50:14 1988 Date: Thu, 20 Oct 88 19:50:14 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS Special Interest Group at SUG From: repo.unipress!mg@unipress.unipress.com (required by law) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We will be holding another NeWS Special Interest Group meeting at the Sun User Group Conference in Miami. The exact time is not yet final; we'll announce it as soon as we know. The conference itself will be held December 4 to December 7. If there's something you'd like to talk about at the NeWS SIG, or if you have any interesting NeWS demos, or video tapes that you'd like to show, please RSVP to news-breakers@unipress.com or call Mark Krieger at (201) 985 8000. At present, our plans include the following: 1) C2PS C-to-PostScript compiler, presented by UniPress Software. 2) OS/2 NeWS, presented by Maurice Balick of Architec. 3) NDE overview, presented by Ralph Derrickson of Sun. 4) Question and answer session with NeWS developers. In particular, we are interested in matching those who have done NeWS ports and tools with those who are, or would like to be, using NeWS for real work. (We know of no existing forum for this sort of interaction.) Mike Gallaher UniPress Software ---------------------------------------------------------------------- Here are the minutes from the last NeWS SIG held at SUG last December in San Jose. Meeting convened 10:30 a.m. Mark Krieger introduced himself and welcomed the group. Saul Wold (Sun) demonstrated the trader workstation he had written to run under NeWS. Hugh Daniel (Wedge) demonstrated Wedge's Macintosh NeWS port. Don Hopkins (U-Md) demonstrated pie menus, a PostScript terminal program, and a journaling demo he had created. Mike Gallaher (UniPress) discussed the NeWS version of UniPress Emacs, and NetScript, a communication protocol language/user interface toolkit that allows any library to be used as an interpretive network server, and which supports a portable user-interface toolkit on NeWS, SunView, and character terminals. Greg Cockroft and Marty Picco (Parallax) demonstrated pNeWS, a NeWS port with integrated live video, still video frame grabbing, and graphics over video. A lively question-and-answer period followed. Some questions were specific in marketing or technical nature, and were directly addressed to the many Sun NeWS people in attendance. Others were more philosophical "NeWS community" topics of general discussion; a great deal of conversation focused on what Sun is doing to battle it out with X Windows, and how the NeWS community can help in establishing NeWS as a recognized standard, supported by other vendors with the same commitment allotted to X. The meeting was concluded at approximately 12:00 noon with a short thank-you from Mark Krieger. An informal demo period followed, which ended at 12:30. From don@brillig.umd.edu Thu Oct 20 19:51:04 1988 Date: Thu, 20 Oct 88 19:51:04 EDT To: NeWS-makers@brillig.umd.edu Subject: Test sites needed for C-to-PostScript compiler From: repo.unipress!mg@unipress.unipress.com (required by law) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We at UniPress have developed a C to PostScript compiler, which compiles K&R C (except for goto's) into equivalent PostScript suitable for running under NeWS, or on a LaserWriter, or just about any PS interpreter. (We've got one of those, too, but it's not a product yet.) C2PS includes a linker, CPS stub generator, and some runtime libraries for NeWS. Binaries are available for Sun 3, Sun 4 and Silicon Graphics 4D. We are looking for test sites. If you would like a free copy of C2PS to try, call Mark Krieger at (201) 985 8000. We will select 5 or 6 test sites very soon, in preparation for a production release in January 89. Test sites will get a copy of the production release at no cost. Mike Gallaher UniPress Software From don@brillig.umd.edu Sat Oct 22 05:21:32 1988 Date: Sat, 22 Oct 88 05:21:32 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: invisible class variables From: unisyn!matheny@boulder.colorado.edu (John Matheny) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <11188@cgl.ucsf.EDU> pett@socrates.ucsf.edu (Eric Pettersen%CGL) writes: >... There is no clean way to access the class variables of a >superclass while a subclass is being defined. Unfortunately, "super" is not defined while defining a subclass. A kludge I have used is to name explicitly the class that the variable is in instead of using "super". So, to access "Foo" in the parent class "ParentClass" you can use "/Foo ParentClass send". -- John Matheny Internet: matheny@Unisyn.COM UUCP: uunet!unisyn!matheny Unisyn, Inc., 3300 Mitchell Lane, Boulder, CO 80301 +1 303 443 7878 From don@brillig.umd.edu Sat Oct 22 05:21:39 1988 Date: Sat, 22 Oct 88 05:21:39 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: How to use spreadsheet program /usr/NeWS/bin/sc? From: mcvax!hp4nl!tnosoes!tom@uunet.uu.net (Tom Vijlbrief) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <174@shapetc.UUCP> brouwer@shapetc.UUCP (Gerrit Brouwer ) writes: >Our NeWS 1.1 distribution for SUN contains /usr/NeWS/bin/sc, >which turns out to be a spreadsheet program. It invites you to >type ? for help, but it cannot find any manual pages on sc. Can >anyone give information or even a list of commands for this use- >ful application? This sc is a port of the public domain sc Unix spreadsheet calculator. A newer version was posted a few months ago. The sources of the news 'sc' are in: /usr/NeWS/clientsrc/client/sc. There is also a man page in that directory: sc.man I advise getting the newer version, it is much better, although it does not run under NeWS (which offers no advantages). (Like any other screen oriented Unix program it uses the /etc/termcap database and it will ofcourse run in a normal psterm window). Tom =============================================================================== Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 62 77 3769 DE Soesterberg E-mail: tnosoes!tom@mcvax.cwi.nl The Netherlands or: uunet!mcvax!tnosoes!tom =============================================================================== From don@brillig.umd.edu Sat Oct 22 05:21:46 1988 Date: Sat, 22 Oct 88 05:21:46 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS display of Grayscale images From: munnari!mimir!hugin!augean!sirius!gtravan@uunet.uu.net (George Travan) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) could someone provide a NeWS novice with some relevant demo code to display 8 bit graylevel images? I have some 512*512*8 bit images which i would like to display using NeWS. (each byte represents a pixel gray level). I generate these files from my C programs so i would be most interested in C client postscript interface procedures. any help would be appreciated. george travan ACSNET: gtravan@sirius.ua.oz From don@brillig.umd.edu Sat Oct 22 23:58:10 1988 Date: Sat, 22 Oct 88 23:58:10 EDT To: NeWS-makers@brillig.umd.edu Subject: How to use spreadsheet program /usr/NeWS/bin/sc? From: mcvax!hp4nl!shapetc!brouwer@uunet.uu.net (Gerrit Brouwer ) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Our NeWS 1.1 distribution for SUN contains /usr/NeWS/bin/sc, which turns out to be a spreadsheet program. It invites you to type ? for help, but it cannot find any manual pages on sc. Can anyone give information or even a list of commands for this use- ful application? Gerrit Brouwer Xelion b.v. Postbus 88 2600 AB Delft Netherlands From don@brillig.umd.edu Sat Oct 22 23:59:01 1988 Date: Sat, 22 Oct 88 23:59:01 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS/cps difficulties From: neptune!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm building a small application that consists of a C side and a NeWS side. On the C side I've got a loop that does: while (!feof(PostScriptInput) && !ferror(PostScriptInput)) if (ui_menuHit(object)) {/* Assorted work... */ ... } and in my cps file I have: #define MENUHIT_TAG 1 and a window with something like: /ClientMenu [(foo) {MENUHIT_TAG tagprint currentkey typedprint}] [(bar) {MENUHIT_TAG tagprint currentkey typedprint}] /new DefaultMenu send and finally a cps definition: cdef ui_menuHit(string obj) => MENUHIT_TAG (obj) Everything works fine most of the time. But without getting into a lot of detail, when I push the objects that are displayed onto a stack (of my own creation) and display new objects, the menu selections are no longer passed back to the C side. If I add a printf to the /ClientMenu proc definitions, the output comes to my console so I know the menu code is working. To make it even more interesting, if I get rid of the new objects, pop the original objects off my stack and display them as they were originally, the packets are again transmitted to the C side. My question: Is it possible that my menu proc is sending the packets but the C side is not accepting them? Are there any common mistakes I might be making to cause this? Could I be doing something to my environment to make this happen? I don't see how moving a couple of my own structures around should have an effect on anything. Many thanks for the help! ---------------------------------------------------------------------------- Jim Rudolf College of Oceanography rudolf@oce.orst.edu Oregon State University, Corvallis, Oregon ---------------------------------------------------------------------------- From don@brillig.umd.edu Sat Oct 22 23:59:07 1988 Date: Sat, 22 Oct 88 23:59:07 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: more references to learn PostScript From: uhccux!lee@humu.nosc.mil (Greg Lee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >From article <8809300004.AA02405@zyzzyva.sun.com>, by scout%zyzzyva@SUN.COM (David LaVallee): Thanks for the references. But I'd like to disrecommend: " Book: D Holzgang, Understanding PostScript Programing " Sybex Not enough examples, mostly repeats material in the Blue book, condescending tone ("Now we're going to examine the concept of ..."). Greg, lee@uhccux.uhcc.hawaii.edu From don@brillig.umd.edu Sat Oct 22 23:59:26 1988 Date: Sat, 22 Oct 88 23:59:26 EDT To: NeWS-makers@brillig.umd.edu Subject: Trouble with dictionaries From: neptune!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've been pulling my hair out for a few days with a dictionary problem. I want to share data between a C/cps application and other psh's. As the NeWS manual recommends, I make an entry in user.ps like: systemdict /foodict 100 dict put foodict begin so that this dict will be on the dict stack for each psh I run. It looks like when I start NeWS and run a psh, foodict is between systemdict and userdict. When my C/cps code runs, it APPEARS that I have the same dict environment as I do in the psh: systemdict, foodict, then an empty dict (userdict?) on top. Since I want to add new stuff to foodict, I want it to be the currentdict. So I pop the dictstack to get rid of the empty dict. When I do this, my application's window will not go away when I zap it. If I leave the empty dict on the stack, the window goes away as it should; but then all definitions made by the C/cps code will go into the formerly empty dict instead of foodict and the other psh's won't be able to find the data & procs they're looking for. Where have I screwed up? This type of thing can't be as difficult as I'm making it. Are there any words of wisdom from the net? Thanks for the help! ---------------------------------------------------------------------------- Jim Rudolf College of Oceanography rudolf@oce.orst.edu Oregon State University, Corvallis, Oregon ---------------------------------------------------------------------------- From don@brillig.umd.edu Sun Oct 23 00:02:53 1988 Date: Sun, 23 Oct 88 00:02:53 EDT To: NeWS-makers@brillig.umd.edu Subject: Error: timeout - how can I change time limits? From: mcvax!cernvax!cui!dimitri@uunet.uu.net (KONSTANTAS Dimitri) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here is my contribution to NeWS problems: I have a big raster image (1536x2048x8) which I wount to see with the showimage program. But it seems that the time limits are rather small for loading the image: I always get a Proccess: ...... Error: timeout Stack: canvas(1536x2048,unmapped,root,retained) Executing: readcanvas The question is obvious: how can I change the time limits? Any ideas? I went through the manuals and didn't found anything (obviously I missed it !!) Thanks for the help dimitri -------------------------------------------------------------------------- Dimitri Konstantas | UUCP : mcvax!cernvax!cui!dimitri Centre Universitaire d'Informatique | EARN : dimitri@cgeuge51.bitnet Univeristy of Geneva | EAN : dimitri@cui.unige.ch -------------------------------------------------------------------------- From don@brillig.umd.edu Sun Oct 23 00:03:01 1988 Date: Sun, 23 Oct 88 00:03:01 EDT To: NeWS-makers@brillig.umd.edu Subject: Canvases in negative space From: mcvax!unido!ecrcvax!andy@uunet.uu.net (Andrew Dwelly) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Oh dear, oh dear, oh dear....... Suppose I wanted to draw a picture, where some of the elements are selectable by the user (e.g. they have canvases over them, or are drawn on canvases). Because this is a fairly big picture I want the user to scroll around it. The manual is a little obscure about movecanvas (NeWS 1.1 by the way) but it had always seemed to work in the past. Well opening, locating and moving canvases around parents with transfomed spaces is so odd, that I can't believe that no one has ever run into it before. It is all somehow connected to the fact that if the parent has 0,0 in the bottom left hand corner, any children can not be moved or opened in negative space - try moving a window off the frame buffer left and up, as opposed to right and down. This applies to abitary windows, not just the framebuffer. This may be a design 'feature', but it makes it difficult to write a window manager, where the framebuffer represents only a small amount of window space that the user can scroll around. A collegue of mine spent an unhappy weekend creating a family of oddly behaving programs showing this sort of thing (thanks johng), I've simplified one, removed the four letter words :-) and posted it at the end of this message. It opens a canvas with 0,0 in the middle, and trys to open a child in the lower left hand corner, that is, entirely in negative space. Now then :- Given that johng and I aren't misunderstanding something, in which case could someone show us (well me anyway) the error of our ways. 1) Is there any way to fudge this ? writing programs that allow scrolling behavior is quite difficult at the moment. 2) Is there any way of getting Sun's attention so that it might be fixed at some point in the future, we haven't had much luck in the past with this sort of thing (rotated fonts for example). I realize that it's traditional to flame Sun at this point, but for all the good it's done you may as well be flaming a lump of granite. A pity as well, as they should be feeling the hot breath of display postscript on their necks after the NeXT roll out. Andrew Dwelly E.C.R.C. UUCP: mcvax!unido!ecrcvax!andy ArabellaStrasse 17 or pyramid!ecrcvax!andy D-8000 Muenchen 81, West Germany UUCP Domain: andy@ecrcvax.UUCP [Bump, Crash ...... Listen; who swears ? Christopher Robin has fallen down stairs.] ------------------------------------------------------------------------------- #! /usr/NeWS/bin/psh % Make a canvas /can framebuffer newcanvas def % Make path with 0,0 at the centre 150 150 translate newpath -100 -100 moveto 200 200 rect can reshapecanvas % express an interest for the canvas createevent dup begin /Name /RightMouseButton def /Action /DownTransition def /Canvas can def end expressinterest can /Transparent false put can /Retained true put can /Mapped true put % Draw cross hairs through 0,0 can setcanvas 1 setlinequality 1.0 fillcanvas 0 setgray newpath 0 -100 moveto 0 200 rlineto stroke -100 0 moveto 200 0 rlineto stroke % Open child in lower left hand corner /child can newcanvas def child setcanvas newpath -100 -100 moveto % <--- This is the lower left hand corner, right ? 50 50 rect child reshapecanvas child setcanvas % express an interest for the canvas createevent dup begin /Name /RightMouseButton def /Action /DownTransition def /Canvas child def end expressinterest child /Transparent false put child /Retained true put child /Mapped true put % Then what the #$@!!! is it doing here 0.5 fillcanvas can setcanvas (\nThis is where the child thinks it is now: % % \n) [child getcanvaslocation] printf % ArGH!!!!!!, getcanvas location manages to be wrong in both child and parent % coordinate spaces, how do they do it.... (\nJust to prove that the parent is correct, let's draw two more crosshairs.\n) print (\nClick Right button.\n) print {awaitevent exit} loop 0 setgray -100 -100 moveto 200 200 rlineto 100 -100 moveto -200 200 rlineto stroke (\nClick to quit.\n) print {awaitevent exit} loop % And this is just with translation. You won't believe what rotating does % to the situation. From don@brillig.umd.edu Sun Oct 23 00:32:20 1988 Date: Sun, 23 Oct 88 00:32:20 EDT To: NeWS-makers@brillig.umd.edu Subject: getcolors: saves the current screen colors From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Ok, fine. Now I have pretty colors on my screen. Do I have to set them up every time I log in? What a hassle! No problem. This little ditty produces a postscript program that when run sets your colors back to what they are right now. If you have all been good little hackers, you will have already installed my window patches in your user.ps file. One of the last things that file does is to check to see if a file called "color.ps" or "mono.ps" exists (in the current directory, presumably $HOME) and if so runs it. Suggested use: 1) Get the colors just the way you like them. (Use good judgement. Other people may have to look at your screen someday!) 2) On a color workstation: getcolors >~/color.ps 3) On a mono workstation: getcolors >~/mono.ps Again, as always, enjoy! Stan Switzer sjs@ctt.bellcore.com P.S.: Ignore article's reply address since my poster mungs it; use signature address instead. ------------------------------------------------------------- #!/usr/NeWS/bin/psh % % getcolors: output postscript program to restore current colors. % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % /OrigColor currentcolor def /Ip { 100 mul dup 99 gt { pop (1) print } { (0.)print .501 add cvi dup 10 lt { (0) print } if (xxxxx) cvs print } ifelse } def /P { dup type /Z type eq { dup 50 string cvs (/) print print } if dup type 11 type eq { dup Ip } if dup type .1 type eq { dup Ip } if dup type () type eq { dup print } if pop } def /X { ( ) print [ exch dup load setshade currentrgbcolor ] { P ( ) print } forall ( rgbcolor store\n) print } def /X? { currentdict 1 index known { X } { pop } ifelse } def /DefaultRootGrayOrColor X /backgroundcolor X /textcolor X LiteWindow begin (LiteWindow begin\n) print ( /ClientFillColor backgroundcolor store\n) print /FrameFillColor X /KeyFocusColor X /IconFillColor X /IconBorderColor X /IconTextColor X (end\n) print end UserProfile begin (UserProfile begin\n) print /NtermTextColor X? /NtermFillColor X? /NtermCaretColor X? (end\n) print end ({ framebuffer setcanvas PaintRoot\n) print ( { /setfgcolor where { pop % Hack Warning (find nterm windows)\n) print ( /NtermTextColor UserProfile 1 index known { UserProfile exch get\n)print ( dup /setfgcolor Text send /setfgcolor Win send } { pop } ifelse\n) print ( /NtermFillColor UserProfile 1 index known { UserProfile exch get\n) print ( dup /setbgcolor Text send /setbgcolor Win send } { pop } ifelse\n) print ( /NtermCaretColor UserProfile 1 index known { UserProfile exch get\n) print ( /setcaretcolor Text send } { pop } ifelse \n) print ( } if /paint self send} AllWin } fork pop\n) print 10 { pause } repeat OrigColor setcolor % ---- anything below this line is NOT part of the program ---- From don@brillig.umd.edu Sun Oct 23 00:32:36 1988 Date: Sun, 23 Oct 88 00:32:36 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: getcolors -- My favortite color scheme From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) While I'm at it, I figure I might as well post my mono.ps and color.ps files. Snazzy, yet tasteful and understated. I find that they wear well. If you want to "test-drive" these colors, just getcolors >savecolors psh stanscolor.ps If you don't like it: psh savecolors Stan Switzer sjs@ctt.bellcore.com "KeySee 1.1 coming soon" P.S.: Ignore article's reply address since my poster mungs it; use signature address instead. P.P.S.: While I'm at it I might as well ask if "backgroundcolor" and "textcolor" are really good ideas or whether (window) class variables like ClientFillColor and (the hypothetical) ClientTextColor make more sense. P.P.P.S.: Does anyone know any tricks that would let me aim "setcolor" at a *particular* window. I suppose I could add another interest to LiteWindow that is called /Execute and which executes its /Action. Then I'd create a framebuffer overlay, make its cursor a crosshair (neatness counts), wait for a SelectButton event, mutate it to a /Execute event, stick a procedure to see if we found a window (gotta be careful!) and change some color attribute in the /Action, and redistribute the event. Two questions: 1) is there an easier way? and 2) Can I do it without modifying the window class? P.P.P.P.S: These PP*S's are getting out of hand. -----------mono.ps-------------------------------------------------- /DefaultRootGrayOrColor 0.88 0.88 0.88 rgbcolor store /backgroundcolor 1 1 1 rgbcolor store /textcolor 0.00 0.00 0.00 rgbcolor store LiteWindow begin /ClientFillColor backgroundcolor store /FrameFillColor 0.50 0.50 0.50 rgbcolor store /KeyFocusColor 0.00 0.00 0.00 rgbcolor store end UserProfile begin /NtermTextColor 0.00 0.00 0.00 rgbcolor store /NtermFillColor 1 1 1 rgbcolor store /NtermCaretColor 0.00 0.00 0.00 rgbcolor store end { framebuffer setcanvas PaintRoot { /setfgcolor where { pop % Hack Warning (find nterm windows) /NtermTextColor UserProfile 1 index known { UserProfile exch get dup /setfgcolor Text send /setfgcolor Win send } { pop } ifelse /NtermFillColor UserProfile 1 index known { UserProfile exch get dup /setbgcolor Text send /setbgcolor Win send } { pop } ifelse /NtermCaretColor UserProfile 1 index known { UserProfile exch get /setcaretcolor Text send } { pop } ifelse } if /paint self send} AllWin } fork pop -----------color.ps------------------------------------------------- /DefaultRootGrayOrColor 0.00 0.63 0.68 rgbcolor store /backgroundcolor 0.82 1 1 rgbcolor store /textcolor 0.00 0.00 0.00 rgbcolor store LiteWindow begin /ClientFillColor backgroundcolor store /FrameFillColor 0.70 0.50 0.50 rgbcolor store /KeyFocusColor 0.00 1 1 rgbcolor store end UserProfile begin /NtermFillColor 0.82 1 1 rgbcolor store end { framebuffer setcanvas PaintRoot { /setfgcolor where { pop % Hack Warning (find nterm windows) /NtermTextColor UserProfile 1 index known { UserProfile exch get dup /setfgcolor Text send /setfgcolor Win send } { pop } ifelse /NtermFillColor UserProfile 1 index known { UserProfile exch get dup /setbgcolor Text send /setbgcolor Win send } { pop } ifelse /NtermCaretColor UserProfile 1 index known { UserProfile exch get /setcaretcolor Text send } { pop } ifelse } if /paint self send} AllWin } fork pop -----------END------------------------------------------------------ From don@brillig.umd.edu Sun Oct 23 00:32:47 1988 Date: Sun, 23 Oct 88 00:32:47 EDT To: NeWS-makers@brillig.umd.edu Subject: LiteWindow patches to allow pretty colors. From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The following patches can be placed in your user.ps to fix a few problems in LiteWindow. This is pretty much a must if you want to take full advantage of "setcolor" posted previously. Problems addressed: 1) Handles ClientFillColor properly 2) Clips painting of frame fill so that it doesn't flash the client canvas first 3) Cures anemia of the focus bar, giving several options. The default is a bar rather than a line. On monochroms displays this has the advantage of allowing frame and focus colors in other than just black and white. 4) On monochrome systems, makes sure there is white under frame label. 5) For good measure, I've thrown in my caps-lock disable feature since I surely can't be the only one with a clumsy left hand. 6) And to make this all work for you, I've provided an "aesthetics" sub-menu that you can hook in to your rootmenu if you wish. Again, as always, enjoy! Stan Switzer sjs@ctt.bellcore.com P.S.: Ignore article's reply address as my poster mungs it; use signature address instead. ------------------------------------------------------------- % % modify LiteWindow % LiteWindow begin % so that repaint does not flash client canvas: /PaintFrameBorder { % - => - (Paint frame border areas) ClientCanvas dup null eq { pop } { gsave setcanvas ClientFillColor fillcanvas grestore } ifelse clippath pathbbox rectpath BorderLeft .5 sub BorderBottom .5 sub FrameWidth BorderLeft BorderRight add sub 1 add FrameHeight BorderBottom BorderTop add sub 1 add FramePath gsave FrameFillColor setshade eofill grestore FrameBorderColor setshade stroke FrameBorderColor strokecanvas } def % to cure anemia of the focus bar: /PaintFocus { gsave FrameCanvas setcanvas KeyFocus? {KeyFocusColor} {FrameFillColor} ifelse setcolor FocusStyle { /Lines { FocusLines aload pop { BorderTop FocusLines aload pop exch pop add div mul FrameHeight exch sub ControlSize exch moveto FrameFont setfont FrameLabel stringwidth pop ( ) stringwidth pop add dup FrameWidth exch sub 2 div ControlSize sub dup 0 rlineto exch 0 rmoveto 0 rlineto stroke } for } /Bar { BorderTop FocusWidth mul dup BorderTop exch sub 2 div FrameHeight exch sub ControlSize exch moveto FrameFont setfont FrameLabel stringwidth pop ( ) stringwidth pop add FrameWidth exch sub 2 div ControlSize sub % Focus-width x-size dup 0 rlineto exch dup neg 0 exch rlineto exch dup neg 0 rlineto currentpoint closepath moveto 0 2 index rmoveto dup FrameWidth BorderRight sub ControlSize sub exch sub 0 rmoveto dup 0 rlineto exch dup neg 0 exch rlineto exch dup neg 0 rlineto closepath fill } } case grestore } def % so you can read the frame label: /PaintFrameLabel { % - => - (Paint frame text label) FrameWidth 2 div FrameHeight BorderTop sub BorderTop currentfont fontascent sub 2 div currentfont fontdescent max 1 add add moveto FrameLabel ( ) append ( ) exch append dup stringwidth exch 2 div neg exch rmoveto ColorDisplay? not { dup gsave false charpath LabelFillColor setcolor fill grestore } if show } def % focus style control variables /FocusStyle /Bar def /FocusWidth .4 def /FocusLines [ 3 1 5 ] def % 3 lines % set style for a window (send to LiteWindow to change for all!) /setfocusstyle { /FocusStyle exch def } def /setfocuslines { /FocusLines exch def } def /setfocuswidth { /FocusWidth exch def } def /FrameFillColor 1 1 1 rgbcolor store /KeyFocusColor .25 .25 .25 rgbcolor store /LabelFillColor ClientFillColor def end % % Disable Caps-Lock Key % /CapsEnable { UI_private begin /compute_shift_states exch { { % enabled version (original) /letter_shift_state control_keys_down 0 gt 0 { caps_keys_down 0 gt shift_keys_down 0 gt or 1 2 ifelse } ifelse store /other_shift_state control_keys_down 0 gt 0 { shift_keys_down 0 gt 1 2 ifelse } ifelse store } } { { % disabled version /other_shift_state control_keys_down 0 gt 0 { shift_keys_down 0 gt 1 2 ifelse } ifelse store /letter_shift_state other_shift_state store } } ifelse store reset_shift_state end } def false CapsEnable % change "false" to "true" to enable by default % controls above customizations, include in your root menu if you wish /AestheticsMenu [ (Focus Style =>) [ (Bar Focus) {/Bar /setfocusstyle LiteWindow send } (Light Line Focus) { {[ 1 1 1 ]setfocuslines /Lines setfocusstyle} LiteWindow send } (Bold Line Focus) { {[ 3 1 5 ]setfocuslines /Lines setfocusstyle} LiteWindow send } (Bolder Line Focus) { {[ 2 1 6 ]setfocuslines /Lines setfocusstyle} LiteWindow send } ] /new DefaultMenu send (Shift Keys =>) [ (Caps Lock Enable) { true CapsEnable } (Caps Lock Disable) { false CapsEnable } ] /new DefaultMenu send ] /new DefaultMenu send def % see if user has saved favorite color scheme ColorDisplay? (color.ps) (mono.ps) ifelse LoadFile pop PaintRoot % ---------- end ---------- From don@brillig.umd.edu Sun Oct 23 00:33:13 1988 Date: Sun, 23 Oct 88 00:33:13 EDT To: NeWS-makers@brillig.umd.edu Subject: setcolor: change colors of various things From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This program allows you to set your screen colors to other than the boring defaults. It is also a pretty good way to browse for nice colors to use for a color application. Depending on whether your system supports color, you will either get three RGB sliders of one "gray" slider. The RGB sliders can be changed to HSB from the menu the color remains the same, this allows you to diddle a color in either model until you get it "just right." Unfortunately, due to the fact that NeWS doesn't really handle ClientFillColor correctly, changing the fill color or frame color will not really work right. I'll post some patches in a subsequent posting to fix this all up. This is one of my earlier NeWS programs, so it's kinda gross internally. Sure makes a pretty screen, 'tho. Note to Don: Please replace the version on tumtum, as this one has a few new features and a few bug fixes. As always, enjoy! Stan Switzer sjs@ctt.bellcore.com P.S.: Ignore article's reply address as my poster mungs it; use signature address instead. ------------------------------------------------------------- #! /usr/NeWS/bin/psh % % setcolor: control colors of various things on the screen % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % systemdict /Item known not { (NeWS/liteitem.ps) run } if /PointFromUser { % => x y gsave fboverlay setcanvas %% Use ParentCanvas! getclick grestore } def /Xform { % ulx uly w h -> llx lly w h 3 -1 roll 1 index sub 3 1 roll } def /GrayMax 100 def gsave DefaultRootGrayOrColor setshade currentrgbcolor /Val3 exch GrayMax mul def /Val2 exch GrayMax mul def /Val1 exch GrayMax mul def /Lab1 (R:) def /Lab2 (G:) def /Lab3 (B:) def ColorDisplay? not { /Lab3 (Gray:) def } if grestore /SetCol { [ Val1 Val2 Val3 ] { GrayMax div } forall ColorOp items /showcolor get /SetColor exch send } def /SetOp { load dup /ColorOp load ne { ChgModel } if /ColorOp exch store items begin { /ItemLabel Lab1 store } Slider1 send { /ItemLabel Lab2 store } Slider2 send { /ItemLabel Lab3 store } Slider3 send end SetCol } def /ChgModel { gsave [ Val1 Val2 Val3 ] { GrayMax div } forall 3 index /rgbcolor load eq { sethsbcolor currentrgbcolor } { setrgbcolor currenthsbcolor } ifelse [ /Val3 /Val2 /Val1 ] { exch GrayMax mul cvi store } forall grestore items begin % NB: only used on color display Val1 /setvalue Slider1 send Val2 /setvalue Slider2 send Val3 /setvalue Slider3 send end } def /ColorOp ColorDisplay? { /rgbcolor load } { {exch pop exch pop dup dup rgbcolor } } ifelse def /ReDisp { /paint win send } def /DoSetColor { ItemValue store SetCol } def /SetRoot { /DefaultRootGrayOrColor exch store ColorDisplay? not { /DefaultRootGrayOrColor Val3 GrayMax div store } if { framebuffer setcanvas PaintRoot } fork pop } def /FrameFixer { gsave FrameCanvas setcanvas 0 0 FrameWidth FrameHeight rectpath BorderLeft BorderBottom translate 0 0 FrameWidth BorderLeft BorderRight add sub FrameHeight BorderBottom BorderTop add sub rectpath BorderLeft neg BorderBottom neg translate eoclipcanvas PaintFrame newpath clipcanvas grestore} def /AllPaint { {/paint self send} AllWin } def /AllIcon { { IconCanvas null ne { PaintIcon } if } AllWin } def /AllFrame { //FrameFixer AllWin } def /AllNterm { { /setfgcolor where { pop % Hack Warning /NtermTextColor UserProfile 1 index known { UserProfile exch get dup /setfgcolor Text send /setfgcolor Win send } { pop } ifelse /NtermFillColor UserProfile 1 index known { UserProfile exch get dup /setbgcolor Text send /setbgcolor Win send } { pop } ifelse /NtermCaretColor UserProfile 1 index known { UserProfile exch get /setcaretcolor Text send } { pop } ifelse /paint self send } if } AllWin } def /WinSet { LiteWindow begin exch store end } def /SetFrame { /FrameFillColor WinSet AllFrame } def /SetIconText { /IconTextColor WinSet AllIcon } def /SetIconBorder { /IconBorderColor WinSet AllIcon } def /SetIconFill { /IconFillColor WinSet AllIcon } def /SetFill { dup /backgroundcolor exch store /ClientFillColor WinSet AllPaint } def /SetText { /textcolor exch store AllPaint } def /SetNText { tocolor UserProfile begin /NtermTextColor exch def end AllNterm } def /SetNFill { tocolor UserProfile begin /NtermFillColor exch def end AllNterm } def /SetNCaret { tocolor UserProfile begin /NtermCaretColor exch def end AllNterm } def /SetFocus { /KeyFocusColor WinSet /PaintFocus win send } def /tocolor { dup type /colortype ne { dup dup rgbcolor } if } def /SetProc /SetRoot load def /SetTarget { load /SetProc exch store currentkey win begin /FrameLabel exch def end //FrameFixer win send } def /DoSetIt { items /showcolor get /ItemValue get SetProc } def /ColorItem LabeledItem dictbegin /ItemHighLighted? false def /ItemTextColor 0 0 0 rgbcolor def /ItemBorderColor null def dictend classbegin /new { % initcolor label notifyproc parentcanvas (width height) => instance % fake a labeled item. dup type /canvastype eq {() /Center 4 2 roll} {() /Center 6 2 roll} ifelse /new super send begin /ItemRadius .5 def /ItemFrame 4 def /ItemBorder null def % /ItemGap 6 def /ItemValue exch def currentdict end } 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 /SetColor { /ItemValue exch store /paint self send } def /PaintItem { ItemHighLighted? { ItemBorderColor setshade ItemRadius clippath pathbbox points2rect rrectpath fill ItemFrame } { 0 } ifelse ItemRadius clippath pathbbox points2rect insetrrect rrectpath ItemValue setshade fill /ItemTextColor currenthsbcolor exch pop exch pop .495 le % want black on gray. 1 0 ifelse dup dup rgbcolor store /ItemBorderColor ItemTextColor store ShowLabel } def /HighLight { % bool => - ItemHighLighted? exch /ItemHighLighted? exch store ItemHighLighted? ne {/paint self send} if } def /ClientDown {true HighLight} def /ClientUp { ItemHighLighted? {NotifyUser} if false HighLight StopItem } def /ClientEnter {true HighLight} def /ClientExit {false HighLight} def classend def /TrackerItem SliderItem [] classbegin /ClientDrag { /ClientDrag super send NotifyUser } def classend def /createitems { /items 50 dict dup begin /showcolor [ Val1 Val2 Val3 ] { GrayMax div } forall rgbcolor (Set it) /DoSetIt can 30 33 /new ColorItem send begin /ItemRadius .3 def /ItemFrame 3 def currentdict end 5 ColorDisplay? { 40 } { 5 } ifelse /move 3 index send def ColorDisplay? { /Slider1 Lab1 [0 GrayMax Val1 round ] /Right { /Val1 DoSetColor } can 220 30 /new TrackerItem send 62 75 /move 3 index send def /Slider2 Lab2 [0 GrayMax Val2 round ] /Right { /Val2 DoSetColor } can 220 30 /new TrackerItem send 62 40 /move 3 index send def } if /Slider3 Lab3 [0 GrayMax Val3 round ] /Right { /Val3 DoSetColor } can 220 30 /new TrackerItem send 62 5 /move 3 index send def end def } def /main { /win framebuffer /new DefaultWindow send def % Create a window { /PaintClient { ClientFillColor fillcanvas items paintitems } def /FrameLabel (Root Color) def /ClientMenu [ (Root Color) { /SetRoot SetTarget } (Frame Color) { /SetFrame SetTarget } (Focus Color) { /SetFocus SetTarget } (Fill Color) { /SetFill SetTarget } (Text Color) { /SetText SetTarget } (Nterm Fill Color) { /SetNFill SetTarget } (Nterm Text Color) { /SetNText SetTarget } (Nterm Caret Color) { /SetNCaret SetTarget } (Icon Fill Color) { /SetIconFill SetTarget } (Icon Text Color) { /SetIconText SetTarget } (Icon Border Color) { /SetIconBorder SetTarget } ColorDisplay? { (RGB Model) { /Lab1(R:)store/Lab2(G:)store/Lab3(B:)store /rgbcolor SetOp ReDisp } (HSB Model) { /Lab1(H:)store/Lab2(S:)store/Lab3(B:)store /hsbcolor SetOp ReDisp } } if (Zap) { /destroy win send } ] /new DefaultMenu send def } win send % /reshapefromuser win send % Reshape from user. PointFromUser 320 ColorDisplay?{145}{75}ifelse Xform /reshape win send /map win send % Map the window & install window event manager. % (Damage causes PaintClient to be called) /can win /ClientCanvas get def % Get the window canvas % Create all the items. createitems SetCol /itemmgr items forkitems def } def main % --- anything following this line is NOT part of the program! From don@brillig.umd.edu Sun Oct 23 08:56:03 1988 Date: Sun, 23 Oct 88 08:56:03 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Trouble with dictionaries From: voder!mas1!jdn@ucbvax.Berkeley.EDU (Jeff Nisewanger) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <11151@bellcore.bellcore.com> sjs@ctt.bellcore.com (Stan Switzer) writes: >In article <6965@orstcs.CS.ORST.EDU> rudolf@neptune.uucp (Jim Rudolf) writes: >> I want to share data between a C/cps application and >> other psh's. As the NeWS manual recommends, I make an entry >> in user.ps like: >> >> systemdict /foodict 100 dict put >> foodict begin >> >> so that this dict will be on the dict stack for each psh I run. It > >What I suggest is: > 1) Don't do anything in user.ps > 2) In your applications, include the following: > systemdict /foodict known not { > systemdict /foodict 100 dict put > } if > foodict begin > > end > 3) Be careful to specifically put the window object in userdict. > 4) Finally, if you can manage it, it would be better not to do > "foodict begin ... end" except in the specific regions that > access the common variables, and leave the ground state of the > dictionary at "systemdict userdict". > When Jim refered to the NeWS Manual I think he was referring to page 173 in Appendix A "Using NeWS" (March 29, 1987). I think he needs to read the passage one more time. The suggestion made was to make a dictionary in your user.ps file by saying something like: % Define my VDI emulation routines systemdict /myVDIdict known not { systemdict /myVDIdict 50 dict put myVDIdict begin /VDIrange 34200 def etc. end } if The "if" test guarantees that the dictionary will be created once. By placing the dictionary into systemdict it can then be shared by all processes that access it making it their current dictionary like so: myVDIdict begin VDIrange 4 mul etc. end or by using "get" "store" and "put". Jim's mistake was leaving his "foodict" on the dictionary stack so that it would be inherited by all other processes exactly like systemdict and userdict. Jeff Nisewanger Measurex Automation Systems .....apple!mas1!jdn From don@brillig.umd.edu Sun Oct 23 08:56:14 1988 Date: Sun, 23 Oct 88 08:56:14 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Error: timeout - how can I change time limits? From: wind!naughton@sun.com (Patrick Naughton) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <246@cui.UUCP> dimitri@cui.UUCP (KONSTANTAS Dimitri) writes: > >Here is my contribution to NeWS problems: >I have a big raster image (1536x2048x8) which I wount to >see with the showimage program. >But it seems that the time limits are rather small for loading >the image: I always get a > Proccess: ...... Error: timeout > Stack: canvas(1536x2048,unmapped,root,retained) > Executing: readcanvas >The question is obvious: how can I change the time limits? >-------------------------------------------------------------------------- >Dimitri Konstantas | UUCP : mcvax!cernvax!cui!dimitri >Centre Universitaire d'Informatique | EARN : dimitri@cgeuge51.bitnet >Univeristy of Geneva | EAN : dimitri@cui.unige.ch >-------------------------------------------------------------------------- Put this in your user.ps: statusdict begin 0 setjobtimeout end % "0 setjobtimeout" means never time out... % ...a dangerous practice in general, but it will solve your problem. This is documented on page 304 of the red book. The default timeout for NeWS 1.1 is 15 seconds. ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@Sun.COM Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080 From don@brillig.umd.edu Sun Oct 23 08:56:43 1988 Date: Sun, 23 Oct 88 08:56:43 EDT To: NeWS-makers@brillig.umd.edu Subject: Re^2: getcolors -- My favortite color scheme From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Oops! In article <11144@bellcore.bellcore.com> I write: > If you want to "test-drive" these colors, just > getcolors >savecolors > psh stanscolor.ps Then type "echo PaintRoot | psh" to make the colors show up. Alternatively, you can select "Repaint All" from the root menu. > If you don't like it: > psh savecolors Likewise It's always something! I'm sure you understand how it is. Stan Switzer sjs@ctt.bellcore.com From don@brillig.umd.edu Sun Oct 23 08:57:17 1988 Date: Sun, 23 Oct 88 08:57:17 EDT To: NeWS-makers@brillig.umd.edu Subject: stringbbox bugs From: socrates.ucsf.edu!pett@cgl.ucsf.edu (Eric Pettersen%CGL) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I don't know if this has been mentioned before but... stringbbox is hosed two different ways: 1) It doesn't return what it is documented to return. Both Sun and SGI documentation say: (string) stringbbox => lower_left_x lower_left_y width height when in fact it returns upper right x and y instead of width and height. This can be easily worked around by using "stringbbox points2rect" instead of just stringbbox. 2) It doesn't do the right thing when handed a null string: a) [Sun] : () stringbbox => 0 900 0 900 b) [SGI] : () stringbbox => 0 773.6962 0 773.6962 Happy Bug Hunting Eric Pettersen pett@cgl.ucsf.edu ...!ucbvax!ucsfcgl!pett From don@brillig.umd.edu Sun Oct 23 08:57:32 1988 Date: Sun, 23 Oct 88 08:57:32 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Trouble with dictionaries From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <6965@orstcs.CS.ORST.EDU> rudolf@neptune.uucp (Jim Rudolf) writes: > I want to share data between a C/cps application and > other psh's. As the NeWS manual recommends, I make an entry > in user.ps like: > > systemdict /foodict 100 dict put > foodict begin > > so that this dict will be on the dict stack for each psh I run. It > looks like when I start NeWS and run a psh, foodict is between > systemdict and userdict. When my C/cps code runs, it APPEARS that > I have the same dict environment as I do in the psh: systemdict, > foodict, then an empty dict (userdict?) on top. Since I want to > add new stuff to foodict, I want it to be the currentdict. So > I pop the dictstack to get rid of the empty dict. When I do this, > my application's window will not go away when I zap it. Windows go away because their canvases go away. Canvases go away because the references to them go away. The references to window canvases go away because their LiteWindow objects go away. LiteWindow objects go away because all references to them go away. Window objects are usually referenced in userdict which goes away when the process using it goes away which happens when the /destroy method kills it. Whew! Now, in your scheme you have def-ed the window into foodict, thereby upsetting the delicate balance of NaTURE. Baring other complications, the window will go away if you do "systemdict /foodict null def." What I suggest is: 1) Don't do anything in user.ps 2) In your applications, include the following: systemdict /foodict known not { systemdict /foodict 100 dict put } if foodict begin end 3) Be careful to specifically put the window object in userdict. 4) Finally, if you can manage it, it would be better not to do "foodict begin ... end" except in the specific regions that access the common variables, and leave the ground state of the dictionary at "systemdict userdict". > Thanks for the help! You're welcome! I posted this instead of mailing because it is a common problem and probably of interest to others as well. The way the scenario typically unfolds is a bit different, though. Usually when it happens to me, the villan is some item (which references the canvas) which I accidentally manage to def into something global. Systemdict is an obvious candidate, but there are some other less likely places: events and class objects come immediately to mind. Finally, be careful not to set up circular linkages among dictionaries -- especially LiteWindows, as this is a sure way to have an annoying window carcass messing up your screen. Stan Switzer sjs@ctt.bellcore.com "Thou shalt not commit adulthood" From don@brillig.umd.edu Mon Oct 24 03:26:53 1988 Date: Mon, 24 Oct 88 03:26:53 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Error: timeout - how can I change time limits? From: gregm@Sun.COM (Greg McLaughlin) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is standard PostScript (ie: you'll find it in the Red Book). statusdict begin n setjobtimeout end NeWS 1.1 has a bug that will require you to do a pause after the above code for the new timeout to take effect. The value "n" is in seconds, and 0 set the timeout to infinity. In NeWS this is on a per process basis, so you need to modify showimage itself. Hope this helps, Greg McLaughlin Sun Microsystems Inc. From don@brillig.umd.edu Tue Oct 25 10:41:42 1988 Date: Tue, 25 Oct 88 10:41:42 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS display of Grayscale images From: campfire!scout@sun.com (David LaVallee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <144@sirius.ua.oz> gtravan@sirius.ua.oz (George Travan) writes: > > could someone provide a NeWS novice with some relevant demo code to display >8 bit graylevel images? I have some 512*512*8 bit images which i would like >to display using NeWS. (each byte represents a pixel gray level). I generate >these files from my C programs so i would be most interested in C client >postscript interface procedures. any help would be appreciated. > > george travan ACSNET: gtravan@sirius.ua.oz > The image and buildimage operators in NeWS create canvases (canvi) at various depths: 1 = monochrome, may be used as a bit mask with imagemask operator 4 = grey scale (but I haven't used this one) 8 = grey scale 256 value ramp 24 = true color RGB888 The depth of the image is independant of the output device (screen) depth. I send images over as strings (strings can have characters with values > 128). The caveat is that strings can only be MAXINT long (~35000 characters), most images are larger than that. Therefor I send a string for each scanline into an array of strings, and assemble the image in NeWS out of that structure. Using scanlines makes the C side easier as well, here's a clip from a current hackery project, the performance is good: from display.c: display(pix) /* pix is an array of scanlines */ unsigned char **pix { int y; ps_clear_scanlines(); /* clear the old image */ for (y = 0; y < DEF_Y; y++) /* for each y send the scanline */ ps_scanline(pix[y], DEF_X); ps_repaint() /* push a repaint token */ ps_flush_PostScript(); /* flush those lil'packets */ } from display.cps cdef ps_clear_scanlines() /scanlines [] store cdef ps_scanline(cstring scanline) /scanlines scanlines [scanline] append store cdef ps_repaint() /paintclient win send . . . % the pictures I was using were 250x200x8, this should be generalized /repairpicture { 30 clippath pathbbox insetrect rectpath clip clippath pathbbox 200 div exch 250 div exch min dup scale pop pop clippath pathbbox 2 div 200 2 div sub exch 2 div 250 2 div sub exch translate pop pop 250 200 scale gsave .5 setgray 0 0 1 1 rectpath fill grestore %%%%%%%%%%%%%%%%% %% THIS IS THE IMPORTANT STUFF /next 0 def 250 200 8 [250 0 0 -200 0 200] { scanlines next get /next next 1 add store } image %% %%%%%%%%%%%%%%%%% } def { /PaintClient {repairpicture} def } win send . . . regards, --scout From don@brillig.umd.edu Tue Oct 25 10:42:05 1988 Date: Tue, 25 Oct 88 10:42:05 EDT To: NeWS-makers@brillig.umd.edu Subject: Using NeWS to create code portable between Unix and non-Unix machines From: master!rburns@sun.com (Randy Burns) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have a friend that wants to port a fairly complicated piece of software from an Amiga to a Sun, Mac II and PC class machines. He is looking for a toolkit that is available on all three of these machines. The closes we've found so far is a product called the Extensible Virtual Toolkit which can be used to write C code that can be ported and ran under either MS-Windows or the Mac Windowing system. I have seen reference to NeWS implementations for the PC and Mac. Would these be suitable for porting code between these three machines or are they really more for use running PC as NeWS clients for UNIX machines? From don@brillig.umd.edu Tue Oct 25 10:42:30 1988 Date: Tue, 25 Oct 88 10:42:30 EDT To: NeWS-makers@brillig.umd.edu Subject: Wallpaper for the Mind From: pterodactyl.cis.ohio-state.edu!zwicky@tut.cis.ohio-state.edu (Elizabeth D. Zwicky) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This program colors in a window, picking the color of each point by calculating the value of a formula in x and y. Unfortunately, you must specify the formula in PostScript (I wasn't up to writing a small mathematical language to use to specify the formula in). It is cute in black and white, and spectacular in colour. Elizabeth Zwicky (zwicky@cis.ohio-state.edu) Cut Here==================================================================== #!/usr/NeWS/bin/psh % Set up LiteItem if nothing else has systemdict /Item known not { (NeWS/liteitem.ps) run } if % If I redefine something, I want it redefined! false setautobind % Predefinitions /height null def /width null def /Red 1 0 0 rgbcolor def /Blue 0 0 1 rgbcolor def /Green .2 1 .4 rgbcolor def /Yellow 1 1 0 rgbcolor def /Purple .7 0 1 rgbcolor def /Orange 1 .5 0 rgbcolor def /colors [Red Blue Green Yellow Purple Orange] def /startx{1} def /starty{1} def /div*{ dup 0 eq {pop pop 0}{div}ifelse}def /magnify 1 def /x{realx magnify div}def /y{realy magnify div} def /detail 1 def /formula{x cos y mul y sin x mul add} def /function{ formula detail mul}def /first true def /helpwindow null def % Draw a dot; works with linecap 1 or 2 on NeWS, but only with 1 in standard /dot{ 0 0 rlineto stroke pause} def % Draw a row of dots /line{ width{ gsave colorcanvas {colors function cvi 6 mod abs get setcolor dot} {function cvi 2 mod abs 1 eq {dot} if} ifelse grestore 1 0 rmoveto /realx realx 1 add def }repeat }def % Draw a windowfull of rows /square{ width 0 rmoveto height{ width neg 1 rmoveto /realx startx def /realy realy 1 add def line }repeat }def % Create window to draw in /paperwindow framebuffer /new DefaultWindow send def {% Set up main window /PaintClient{ % Clear, reset size, position, color, current point, % and redraw erasepage clipcanvaspath pathbbox /height exch store /width exch store 0 setgray 1 1 moveto /realx startx def /realy starty def square } def /FrameLabel (Wallpaper) def /destroy{% Will die even during redraw PaintProcess null ne {PaintProcess killprocessgroup} if FrameEventMgr null ne {FrameEventMgr killprocessgroup} if } def /ClientMenu [ (Zoom In) {/magnify magnify 2 mul store /paint paperwindow send} (Zoom Out) {/magnify magnify 2 div store /paint paperwindow send} (Add Detail) {/detail detail 2 mul store /paint paperwindow send} (Remove Detail) {/detail detail 2 div store /paint paperwindow send} (Move Bottom Left Corner) { /xhair /xhair_m paperwindow /ClientCanvas get setstandardcursor getclick /starty exch starty add store /startx exch startx add store /ptr /ptr_m paperwindow /ClientCanvas get setstandardcursor /paint paperwindow send } (Help) {first {help} if } ] /new DefaultMenu send def }paperwindow send /help {% Put up help file in window % Make help window /helpwindow framebuffer /new DefaultWindow send store (Times-Roman) findfont 14 scalefont setfont 0 0 310 460 /reshape helpwindow send framebuffer setcanvas paperwindow /FrameCanvas get getcanvaslocation 570 sub /move helpwindow send helpwindow /ClientCanvas get setcanvas { /PaintClient{ clippath pathbbox /place exch def pop pop pop helptext { /place place 14 sub def 5 place moveto show } forall } def /destroy { % Gentle destroy; does not take other things with it helpwindow /IconCanvas get /Mapped false put helpwindow /FrameCanvas get /Mapped false put helpwindow /ClientCanvas get /Mapped false put helpwindow /FrameEventMgr get killprocess /first true store }def } helpwindow send /first false store /map helpwindow send } def % Actually put main window up /reshapefromuser paperwindow send /map paperwindow send % Create, position and size formulawindow /formulawindow framebuffer /new DefaultWindow send def 100 100 300 110 /reshape formulawindow send paperwindow /FrameCanvas get getcanvaslocation 110 sub /move formulawindow send % Don't want the string every time it's changed; gonotify really % does the notification /formulanotify {} def /gonotify{/formula itemdict /formulaitem get /ItemValue get dup length string copy cvx store /paint paperwindow send} def /itemdict dictbegin /formulaitem (Formula:)(x cos y mul y sin x mul add) /Right /formulanotify formulawindow /ClientCanvas get 1500 10 %Plenty long for real complex formulas! /new TextItem send dup 0 0 /move 3 index send pop def /goitem (Press When Formula Is Correct) /gonotify formulawindow /ClientCanvas get 10 40 /new ButtonItem send dup 0 30 /move 3 index send pop def dictend def itemdict paintitems itemdict forkitems {/PaintClient {itemdict paintitems} def /destroy{paperwindow /PaintProcess get null ne {paperwindow /PaintProcess get killprocessgroup} if paperwindow /FrameEventMgr get null ne {paperwindow /FrameEventMgr get killprocessgroup} if} def } formulawindow send /map formulawindow send /helptext[ ("Wallpaper" was inspired by one of Martin) (Gardner's Mathematical Recreations columns) (in the magazine "Scientific American". It) (colors in a coordinate plane by) (calculating the value of formula in x and) (y for the x and y values of that point,) (and picking a color based on that value.) (On a color display it uses 6 colors, which) (are meant to be red, blue, yellow, purple,) (green and orange. On a monochrome screen) (it uses only black and white.) ( ) (The formula is specified in the lower) (window in PostScript. A special function,) (div*, is available; it is exactly like) ("div" except that if you attempt to divide) (by zero it returns zero instead of an) (error.) ( ) (The "Zoom In" and "Zoom Out" menu options) (change the magnification of the plane by) (factors of 2; it starts out at device) (resolution. Similarly, the "Add Detail") (and "Remove Detail" menu options change a) (multiplier that is applied to the result) (of the formula by factors of 2. The) (multiplier starts at 1. "Move Bottom Left) (Corner" places the bottom left corner at) (the point on the plane indicated by your) (next click (it starts at 0,0).) ]def From don@brillig.umd.edu Wed Oct 26 03:01:31 1988 Date: Wed, 26 Oct 88 03:01:31 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Wallpaper for the Mind From: toms@ncifcrf.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Very nice. Now, I zapped one part of the multipart window, and I find a residue that is sticking around; won't go away, won't respond. What do I do to get rid of this? (I've got a big crunch going in background that I don't want to disturb, so restarting NeWS is out for another day or two...) Tom Syracuse, N.Y. 13244 From don@brillig.umd.edu Wed Oct 26 03:01:34 1988 Date: Wed, 26 Oct 88 03:01:34 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: MicroTimes interview with John Warnock of Adobe From: adobe!ondine!greid@decwrl.dec.com (Glenn Reid) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > [MicroTimes is 'California's computer magazine', back issues available for > $4 from +1 415 652 3810. The interview is from the Nov88 issue, pg 52.] > > Steve Guttman and Mary Eisenhart interviewed John Warnock, founder of Adobe, > at a recent conference. He mentions Sun and NeWS several times, e.g.: > > "Q: Sun has some kind of Display PostScript system interpreter in their > NeWS system. Does that make them a competitor in any sense? > A: They've implemented their own interpreter, I guess. I would rather > have that kind of competitor than this Presentation Manager stuff. > At least they're spiritually for the same purposes." > > "Q: Are there any UNIX machines that PostScript graphics are currently > running on? > A: There's Sun's implementation of NeWS... No, there really isn't, except > in our laboratories. Actually, NeXT will be the first Display PostScript > platform." > > To me it sounds like he thinks NeWS really *is* a PostScript implementation, > but keeps remembering that the Adobe lawyers tell him to say it isn't... Adobe lawyers work for John Warnock, and he doesn't have to be reminded of anything.:-) In this interview, Dr. Warnock is simply acknowledging Sun's efforts in implementing a clone PostScript language interpreter. If you read the last Q and A above one more time, Sun's implementation of NeWS does run PostScript graphics on UNIX machines, in a sense, but it is referred to as an implementation of NeWS, not of PostScript. All very tricky legal landmines, but I can assure you that Dr. Warnock knows exactly what NeWS is, and I think the important message in between the lines here is that Adobe has a great interest in Sun Microsystems, and would love to see them use our Display PostScript implementation rather than a "clone." Disclaimer: I work at Adobe Systems and this is not an impartial commentary, although I like to think it is at least reasonable.... Glenn Reid Adobe Systems From don@brillig.umd.edu Wed Oct 26 03:05:13 1988 Date: Wed, 26 Oct 88 03:05:13 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Canvases in negative space From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) There are two problems here: 1. movecanvas moves the current canvas to x y relative to its parent. The problem is that x & y are in the coordinate system of the canvas being moved but are relative to the parents origin. This is very tricky. This is fixed in xnews. A new movecanvas operator takes an extra argument, the canvas, and moves it to an absolute x, y in the canvases own coordinate system. 2. The second problem is that the underlying pixrect code does not understand how to make region pixrects that are to top or left of the primary pixrect. The underlying code called by movecanvas as tests to prevent -ve x or y values. It sets them to zero. I don't know if this is fixed in xnews. We fixed it in our NeWS server. -- From the TARDIS of Mark Callow msc@sgi.sgi.com, ...{ames,decwrl,sun}!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@brillig.umd.edu Wed Oct 26 11:15:08 1988 Date: Wed, 26 Oct 88 11:15:08 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: MicroTimes interview with John Warnock of Adobe From: unisyn!matheny@boulder.colorado.edu (John Matheny) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <4259@adobe.COM> greid@adobe.UUCP (Glenn Reid) writes: >All very tricky legal landmines, but I can assure you that Dr. Warnock >knows exactly what NeWS is, and I think the important message in >between the lines here is that Adobe has a great interest in Sun >Microsystems, and would love to see them use our Display PostScript >implementation rather than a "clone." Adobe and the PostScript language enjoy a great deal of respect and credibility in the marketplace. Most of this is directly transferrable to Display PostScript and will undoubtably give it an initial market advantage over NeWS. However, the fact is that Display PostScript lacks many of the capabilites of NeWS that are essential. Therefore, I would like to encourage Adobe and Sun to work with each other and merge the two systems. This action would assure the advancement of the state-of-the-art of display and user interface technology. BTW -- The idea of using PostScript for screen displays was originated at Sun by James Gosling & Co. and was implemented in NeWS long before Display PostScript. That makes Display PostScript the "clone", no? -- John Matheny Internet: matheny@Unisyn.COM UUCP: uunet!unisyn!matheny Unisyn, Inc., 3300 Mitchell Lane, Boulder, CO 80301 +1 303 443 7878 From don@brillig.umd.edu Wed Oct 26 11:15:35 1988 Date: Wed, 26 Oct 88 11:15:35 EDT To: NeWS-makers@brillig.umd.edu Subject: NeWS vs. Display PostScript From: neptune!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <407@unisyn.COM> matheny@Unisyn.COM (John Matheny) writes: >...However, the fact is that Display >PostScript lacks many of the capabilites of NeWS that are essential. I had assumed that NeWS and Display PostScript had similar function. Can someone enlighten me (and the net if you like) as to what the differences are? What are the strengths and weaknesses of each? Thanks for the info, ---------------------------------------------------------------------------- Jim Rudolf College of Oceanography rudolf@oce.orst.edu Oregon State University, Corvallis, Oregon ---------------------------------------------------------------------------- From don@brillig.umd.edu Fri Oct 28 23:14:33 1988 Date: Fri, 28 Oct 88 23:14:33 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: MicroTimes interview with John Warnock of Adobe From: "Michael_Powers.Henr801M"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) John Matheny writes: >BTW -- The idea of using PostScript for screen displays was originated >at Sun by James Gosling & Co. and was implemented in NeWS long before >Display PostScript. That makes Display PostScript the "clone", no? Actually, this should say the "idea of EXTENDING Postcript to be a FULL FLEDGED WINDOW SYSTEM" was originated by Jame Gosling. From what I understand (and certainly how it works inside Xerox) anyone who wishes to test a Page Description Language implementation usually creates some type of Screen Display code to see it work prior to actually hooking the system up to a printer. Therefore Display Postscript probably has existed in various forms for a long long time. The slowness of it all in times past probably hindered people from saying "Hey, what if we actually used this as our display engine...". Just thought I'd throw in my two cents Mike Powers powers.henr801m@xerox.com Xerox Corp. 1350 Jefferson Road, Rochester, NY 14623 From don@brillig.umd.edu Fri Oct 28 23:14:43 1988 Date: Fri, 28 Oct 88 23:14:43 EDT To: NeWS-makers@brillig.umd.edu Subject: KeySee 1.1: A few bug fixes, a few new features From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Thanks to a lot of good net feedback I have made a number of improvements to the original KeySee. Since KeySee is now about a month old and hasn't changed any in about half of that time, I figured there'd be no harm in posting this (hopefully final) newer version: KeySee 1.1. New features: 1) You can change focus mode from cursor-follows-mouse to click-to-type with a button. 2) Middle and right mouse buttons map to control and shift. A trivial change allows you to substitute "meta" for one or the other. 3) Pressing L5 and L7 with your mouse now does the "expected" thing. 4) Eliminate certain key "pumping" problems. 5) If KeySee is too slow for your taste, look at the documentation on "SpeedHacks". 6) Generous internal and functional documentation has been added. Readers interested in more detail may enquire within. Notes: 1) If somehow the keyboard gets stuck in Caps mode or Control mode, remebmer that how can hit "L1" to clear the problem. 2) If keyboard input seems to be going to the wrong window, make sure that you are'nt in click-to-type mode. Enjoy, Stan Switzer sjs@ctt.bellcore.com "Thou shalt not have no idea" P.S.: Ignore bogus reply path, use signature address only. ---------------------------------------------------------- #!/usr/NeWS/bin/psh % % KeySee: Display the keyboard and simulate keyboard input. % % Copyright (C) 1988 by Stan Switzer. All rights reserved. % This program is provided for unrestricted use, provided that this % copyright message is preserved. There is no warranty, and no author % or distributer accepts responsibility for any damage caused by this % program. % % Mon KeySee, mon key do. % % Stan Switzer sjs@ctt.bellcore.com % --------------------------------------- % Sept. 29, 1988 Stan Switzer % % One good hack deserves another. Ever since Don Hopkins posted his % MouSee I have been toying with the idea of writing something that % does for the keyboard what MouSee does for the Mouse. This is the % result. % % The original version of this program simply displayed the status of % the keyboard. It soon occured to me that it could just as easily % simulate keyboard input. Not long afterward I added the on/off switch % and made it load "liteitem.ps" if it wasn't already loaded. % Josh Siegel suggested binding control and shift to the other mouse % keys, which turned out to be quite practical. Another suggestion was % to display the keycaps according to the current bindings (and related % ideas), which did not turn out to be practical. Perhaps someone else % will take up the cause. % % Thanks to comp.windows.news readers who put up with (numerous) early % versions of this program, and who provided valuable feedback for new % features. % % The following features of the program may need some explanation: % + KeySee assumes you have a Sun-3 style keyboard. This is true % of all Sun-3 and Sun-4 "kb" devices, but not the 386i. % It is relatively simple to accomodate other keyboard layouts. % + The On/Off button determines whether keyboard monitoring is % enabled. % + The Cursor/Click button controls the keyboard focus mode: % "cursor follows mouse" or "click to type." Note that the button % changes even if you change focus mode by other means! % + Ctl, Left Shift, and Left (meta) are "sticky." One press turns % it on, another turns it off. % + The Adjust button is "Ctl" and the Menu button is "Shift" except % that they are not sticky. % + When the monitor is "Off," the keyboard doesn't highlight mouse % operations. This is a feature, not a bug. The cute thing here is % when you press "A" with your mouse, it doesn't gray out because % you pressed it (like a button would) but because it really thinks % you pressed the "A" key. If the monitor is off, it just doesn't % know. It would be easy to "fix" but I'm not sure it's broken. % If enough people feel strongly about it I'll change it. % + Note what happens if you press L5 or L7 with your mouse! For this % to work it is important that simulated events have proper screen % coordinates (/XLocation and /YLocation values). % + Note what happens when you press the *real* L1 key. Apparently the % kernel hides the L1 down in case you also hit "A" and then gives you % *both* a down and up event when (if!) the key comes up again. % + Keys will not simulate down or up events if they are already in the % result state. This is to prevent key "pumping" where you manage to % create more down events than up. This is particularly important in % the case of shift keys. % + Because KeySee operates as close to the raw keyboard as possible, % simulated events look very real -- even to the extent that KeySee % shifts work with real keys and real shifts work with KeySee key % hits. About the only difference is that the /KeyState interest field % isn't (cannot be) set. Apparently /KeyState isn't really used for % much. Perhaps someone can explain SCANNER in user_edit_template(UI.ps) % to me. Possibly /KeyState would be useful for mouse events so that % you detect shifted mouse buttons, etc. Better would be to use % the {shift|caps|meta|control}_keys_down entries in UI_private. % + Serious NeWS hacks might want to look at some of the comments in here. % There are some good tricks (many learned from Don Hopkins's code and % quite a few learned the old-fashioned way) and important observations % documented here. The following techniques are illustrated here: % - Dictionaries as interest /Names; event handling. % - Raw keyboard input handling. % - Managing canvases with LOTS of items. % - Playing games with the icon. % - Tricking items into drawing themselves somewhere besides where they % really live (i.e.: in the icon!) % - Subclassing of items and windows. I strongly suggest subclassing % windows rather than "defing" things in to a vanilla window. % - How I learned to stop worrying and love polymorphism % (Dr. Strangehack) % + KeySee is a bit slow on a 3/50. Especially if you run two or more! % % Oct. 1, 1988 SJS % % + Simplified mouse menu and adjust button handling. Changing the menu % key to the meta will now only require an extremely trival change. % Search for "meta" below to find the code. % + Despite precautions taken to avoid the situation it is sometimes % possible to "pump" a key (it isn't easy, mind you, just possible) % if you should find keys inexplicably stuck in caps or control mode, % hit "L1" to reset the keystate. % + An interesting and perplexing problem occurs when KeySee is run in % color (non-retained) and it is partially obscured by another canvas. % When you press the L5 button and the key comes up, it attempts to % redraw itself to the "up" color, but the canvas is clipped to the % damage path, rendering the redraw ineffective. There doesn't seem % to be any good solution to this problem. % % Oct. 4, 1988 SJS % % + Stopped dummy (spacer) buttons from sending events. Previously, they % sent bogus but apparently harmless events with "null" as the name. % % Oct. 6, 1988 SJS % % + Added "xor" style highlighting code. If you find KeySee too slow, % find "/SpeedHacks? false def" and change "false" to "true". % % Oct. 11, 1988 SJS % + Changed cycle items to use prevailing background and text colors % to be sure that they can be seen when the background is black. % There's no accounting for taste. % % Oct. 26, 1988 SJS % + As there have been no changes to KeySee for nearly a month, % it, in its present state, shall be called KeySee 1.1 and % released for (I hope) one final time. % systemdict /Item known not { (NeWS/liteitem.ps) run } if /KeyItem LabeledItem dictbegin /ItemDownColor .5 .5 .5 rgbcolor def /ItemRadius 4 def /Station null def /StickyKey? false def /ItemValue false def dictend classbegin /new { % label canvas width height => instance () /Center nullproc 6 3 roll /new super send begin ItemLabel /OU eq { % over/under key label /LowerLabel exch def /UpperLabel exch def } if currentdict end } def /SpeedHacks? false def % enable speed hacks? /ItemLabelFont /Times-Roman findfont 10 scalefont def /setvalue { % bool => - -- true == down, false == up /ItemValue exch store ItemValue ItemPaintedValue ne { SpeedHacks? { gsave ItemCanvas setcanvas HiLightKey grestore /ItemPaintedValue ItemValue def } { /paint self send } ifelse } if } def /JustSetvalue { % bool => - -- paint but don't draw it /ItemValue exch store } def /PaintIfNeeded { % - => - -- draw it if needed ItemValue ItemPaintedValue ne {/paint self send} if } def /KS 2 def % Key Separation /ItemShape { % bool => - -- shape of item (false->inset) { ItemRadius KS 2 idiv dup ItemWidth KS sub ItemHeight KS sub } { ItemRadius .5 sub KS 2 idiv .5 add dup ItemWidth KS sub 1 sub ItemHeight KS sub 1 sub } ifelse rrectpath } def /PaintItem { true ItemShape gsave ItemFillColor ItemValue null ne { SpeedHacks? not ItemValue and { pop ItemDownColor } if } if setcolor fill grestore ItemBorderColor setcolor stroke ShowLabel SpeedHacks? ItemValue and { HiLightKey } if } def /HiLightKey { gsave false ItemShape 0 setgray 5 setrasteropcode fill grestore } def /OU { % over-under proc % if the Label is a sym, it is executed passing "true" to draw it % and "false" to return the width and height. % Hack: we pretend that the labels have no width and then % cshow them. { % draw it 0 currentfont fontdescent 1 add 2 idiv rmoveto gsave 0 currentfont fontheight rmoveto UpperLabel cshow grestore LowerLabel cshow } { % size it 0 currentfont fontheight 2 mul } ifelse } def /reshape { % x y w h /reshape super send LabelSize % w h ItemHeight exch sub 2 div /LabelY exch def ItemWidth exch sub 2 div /LabelX exch def } def /SetStation { % stationcode => - 16#6F00 add % This is magic /Station exch def } def /ClientDown { true FakeKey } def /ClientUp { false FakeKey } def /FakeKey { % bool(true==down) => - -- fake a key transition StickyKey? { { ItemValue not ReallyFakeKey } if } { ReallyFakeKey } ifelse } def /ReallyFakeKey { % bool(true==down) -- bypass sticky goo dup ItemValue ne exch /ItemValue exch store { createevent dup begin /Name Station def /Action ItemValue /DownTransition /UpTransition ifelse def gsave framebuffer setcanvas currentcursorlocation /YLocation exch def /XLocation exch def grestore end sendevent } if } def /SetSticky { /StickyKey? exch def } def classend def /DummyKeyItem KeyItem [ ] % just uses up space classbegin /new { % canvas width height => instance () 4 1 roll /new super send } def /ReallyFakeKey { pop } def % don't send key events /PaintItem nullproc def /SetStation { pop } def classend def % really a cycle item but reaponds to some "KeyItem" messages: /CycleKey CycleItem dictbegin /Station null def dictend classbegin /new { % choices notify can w h => instance /cycle 6 1 roll /Right 5 1 roll /new super send } def /SetStation { pop } def /PaintIfNeeded nullproc def classend def /KeeSee DefaultWindow dictbegin /Items null def /ItemList null def /TmpDict null def /Watcher null def /IconKey null def /ItemProc null def /EventProc null def dictbegin dictend classbegin /new { /new super send begin /PaintClient { ClientFillColor fillcanvas ClientCanvas setcanvas ItemList { paintitems } forall } def /TmpDict 20 dict def currentdict end } def /FrameLabel (Key See) def /IconLabel FrameLabel def /KeyWidth 24 def % Width (&Height) of Std Key /Border 4 def % border around keyboard proper /Key { % (Label) WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new KeyItem send pause } def /Dummy { % WidthFactor => item KeyWidth mul ClientCanvas exch KeyWidth /new DummyKeyItem send } def /Sticky { % item => item true /SetSticky 2 index send } def /CreateClientCanvas { /CreateClientCanvas super send % various items: /Items dictbegin (A) 0 get 1 (Z) 0 get { % alpha keys 1 string dup 0 4 -1 roll put dup 1 string copy cvn exch 1 Key def } for /D1 (!)(1)/OU 1 Key def /D2 (@)(2)/OU 1 Key def /D3 (#)(3)/OU 1 Key def /D4 ($)(4)/OU 1 Key def /D5 (%)(5)/OU 1 Key def /D6 (^)(6)/OU 1 Key def /D7 (&)(7)/OU 1 Key def /D8 (*)(8)/OU 1 Key def /D9 (\()(9)/OU 1 Key def /D0 (\))(0)/OU 1 Key def /Caps (Caps) 1.25 Key def /Left (Left) 1.5 Key Sticky def /Space () 9 Key def /SPC (Space) 2.25 Key def 0 0 /move SPC send /Right (Right) 1.5 Key def /Alt (Alt) 1.75 Key def /LShift (Shift) 2.25 Key Sticky def /RShift (Shift) 1.75 Key def /LF (LF) 1 Key def /L-C (<)(,)/OU 1 Key def /G-P (>)(.)/OU 1 Key def /Q-S (?)(/)/OU 1 Key def /Ctl (Ctl) 1.75 Key Sticky def /C-S (:)(;)/OU 1 Key def /Q-Q (")(')/OU 1 Key def /Ret (Return) 2.25 Key def /Tab (Tab) 1.5 Key def /O-B ({)([)/OU 1 Key def /C-B (})(])/OU 1 Key def /Del (Del) 1.5 Key def /Esc (Esc) 1 Key def /U-D (_)(-)/OU 1 Key def /P-E (+)(=)/OU 1 Key def /V-B (|)(\\)/OU 1 Key def /T-Q (~)(`)/OU 1 Key def /F1 (F1) 1 Key def /F2 (F2) 1 Key def /F3 (F3) 2 Key def /F4 (F4) 2 Key def /F5 (F5) 2 Key def /F6 (F6) 2 Key def /F7 (F7) 2 Key def /F8 (F8) 1 Key def /F9 (F9) 1 Key def /BS (BS) 1 Key def /L1 (L1) 1 Key def /L2 (L2) 1 Key def /X1 .5 Dummy def /L3 (L3) 1 Key def /L4 (L4) 1 Key def /X2 .5 Dummy def /L5 (L5) 1 Key def /L6 (L6) 1 Key def /X3 .5 Dummy def /L7 (L7) 1 Key def /L8 (L8) 1 Key def /X4 .5 Dummy def /L9 (L9) 1 Key def /L10 (L10) 1 Key def /X5 .5 Dummy def /X6 .5 Dummy def /R1 (R1) 1 Key def /R2 (R2) 1 Key def /R3 (R3) 1 Key def /X7 .5 Dummy def /R4 (R4) 1 Key def /R5 (R5) 1 Key def /R6 (R6) 1 Key def /X8 .5 Dummy def /R7 (R7) 1 Key def /R8 (R8) 1 Key def /R9 (R9) 1 Key def /X9 .5 Dummy def /R10 (R10) 1 Key def /R11 (R11) 1 Key def /R12 (R12) 1 Key def /X10 .5 Dummy def /R13 (R13) 1 Key def /R14 (R14) 1 Key def /R15 (R15) 1 Key def /X11 .5 Dummy def /OnOff [ (On) (Off) ] { ItemValue 0 eq /watch /stopwatch ifelse ThisWindow send } ClientCanvas KeyWidth dup 2.5 mul exch /new CycleKey send def textcolor ClientFillColor { /ItemFillColor exch def /ItemTextColor exch def } OnOff send /Mode [ (Cursor) (Click) ] { ItemValue 0 eq /CursorFocus /ClickFocus ifelse setfocusmode } ClientCanvas KeyWidth dup 3 mul exch /new CycleKey send def textcolor ClientFillColor { /ItemFillColor exch def /ItemTextColor exch def } Mode send Mode /ItemValue UI_private /FocusMode get /CursorFocus eq 0 1 ifelse put dictend store % Display order /ItemList Items begin [ % Key rows from bottom to top [ OnOff 119 Caps Left Space Right 19 Alt X11 Mode ] Station [ 95 L9 97 L10 X5 99 LShift Z X C V B N M L-C G-P Q-S RShift LF X10 112 R13 R14 R15 ] Station [ 72 L7 L8 X4 76 Ctl A S D F G H J K L C-S Q-Q 89 Ret X9 91 R10 R11 R12 ] Station [ 49 L5 51 L6 X3 53 Tab Q W E R T Y U I O P O-B C-B Del X8 68 R7 R8 R9 ] Station [ 25 L3 L4 X2 29 Esc D1 D2 D3 D4 D5 D6 D7 D8 D9 D0 U-D P-E 88 V-B 42 T-Q X7 45 R4 R5 R6 ] Station [ 1 L1 3 L2 X1 5 F1 F2 8 F3 10 F4 12 F5 14 F6 16 F7 F8 F9 43 BS X6 21 R1 R2 R3 ] Station ] end store /ItemProc Items forkitems store } def /IconWidth 64 def /IconHeight 48 def /PaintIconKey { % paints IconKey centered in icon % a tasty hack! IconKey null ne { { ItemHeight ItemWidth } IconKey send IconWidth exch sub 2 idiv exch IconHeight exch sub 2 idiv 6 add gsave translate /PaintItem IconKey send grestore } if } def /PaintIcon { gsave IconCanvas setcanvas IconFillColor fillcanvas IconBorderColor strokecanvas IconTextColor setcolor PaintIconKey PaintIconLabel grestore } def /flipiconic { /flipiconic super send Iconic? { painticon % update icon image } { % we don't paint items when they are not displayed, so update. ItemList { { /PaintIfNeeded exch send } forall } forall } ifelse } def /SetIconKey { gsave IconCanvas setcanvas IconKey null ne { % erase previous key image { ItemWidth ItemHeight } IconKey send IconWidth 2 index sub 2 idiv IconHeight 2 index sub 2 idiv 6 add moveto rect IconFillColor setshade fill } if JustSetIconKey IconTextColor setcolor PaintIconKey grestore } def /JustSetIconKey { Items begin dup Space eq { % normal space bar is too big! /ItemValue get SPC dup /ItemValue 4 -1 roll put } if end /IconKey exch def } def /eventmonitor { % start eventmonitor EventProc null ne { EventProc killprocess } if /EventProc { createevent dup begin /Name /SetFocusPolicy def % focus mode change /Priority 10 def end expressinterest createevent dup begin /Name [ MenuButton AdjustButton ] def /Action [ /UpTransition /DownTransition ] def /Canvas ClientCanvas def % evidence suggests that mouse events are exclusive whether % you want it or not! /Exclusivity true def end expressinterest { awaitevent begin % invoke name w/ Action as param: % "0 pop" keeps "self send" from being expunged Action Name self 0 pop send end } loop } fork def } def /FakeKey { % action key => - Items exch get % action keyitem exch /DownTransition eq exch % bool keyitem /ReallyFakeKey exch send % bypass sticky key handling } def AdjustButton { /Ctl FakeKey } def % action => - MenuButton { /LShift FakeKey } def % action => - % if you prefer "shift" % MenuButton { /Left FakeKey } def % action => - % if you prefer "meta" /SetFocusPolicy { % action => - % action is new mode /CursorFocus eq 0 1 ifelse /setvalue Items /Mode get send } def /stopwatch { % stop event loop Watcher null ne { Watcher killprocess } if } def /watch { % start event loop stopwatch /Watcher { createevent dup begin /Name dictbegin % dict: keycode => item Items { exch pop dup /Station get dup null eq { pop pop } { exch def } ifelse } forall dictend def /Priority 10 def end expressinterest { awaitevent begin % Note: Name is key item because of interest /Name dict pause % perhaps this will let us do real work first % "self /foo exch send" keeps the method compiler % from removing self send. This is important to that % when (Just)SetIconKey is invoked it will end up % setting IconKey in the object, not in the event. % failing to do this results in having the interest % (which is apparently reused for all keyboard events) % referencing an item and consequently its parent (the % ClientCanvas), causing the canvas to just stick around % forever. Probably defing bogus entries in events should % be an error. This was no fun to find. Action /DownTransition eq Iconic? { /JustSetvalue Name send Name self /SetIconKey exch send } { /setvalue Name send Name self /JustSetIconKey exch send } ifelse end } loop } fork def } def /Station { % [ KeyItems-and-indexes ] => [ KeyItems ] % sets the station codes in the array's items. mark exch 0 exch { % [ item item ... n currentitem dup type /integertype eq { exch pop } { 2 copy /SetStation exch send exch 1 add } ifelse } forall pop ] } def /ShapeClientCanvas { % This is a real good way to position items! /ShapeClientCanvas super send Recalc % recalc layout params ClientCanvas setcanvas % now, move the items to their rightful places TmpDict begin /SepX 0 def /SepY 0 def /Y Border def ItemList { /X Border def /MaxH 0 def { X Y /move 3 index send /ItemHeight 1 index send dup MaxH gt { /MaxH exch def } { pop } ifelse /ItemWidth exch send X add SepX add /X exch store } forall /Y Y MaxH SepY add add def } forall end Watcher null eq { watch } if EventProc null eq { eventmonitor } if } def /placeit { % one click placement and sizing gsave fboverlay setcanvas getclick grestore BorderLeft BorderRight add 21 KeyWidth mul add Border 2 mul add BorderTop BorderBottom add 6 KeyWidth mul add Border 2 mul add 3 -1 roll 1 index sub 3 1 roll % % ulx uly w h => llx lly w h reshape } def /Recalc { % - => - -- recalculates various layout parameters % for when I decide to handle resizing! } def classend def /win framebuffer /new KeeSee send def /placeit win send /map win send % ----- Anything after this line is not part of the program ----- From don@brillig.umd.edu Sat Oct 29 00:44:56 1988 Date: Sat, 29 Oct 88 00:44:56 EDT To: NeWS-makers@brillig.umd.edu Subject: re: NeWS vs. Display Postscript From: Mark Richer Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > However, the fact is that Display PostScript lacks many of the > capabilites of NeWS that are essential. Therefore, I would like to > encourage Adobe and Sun to work with each other and merge the two > systems. This action would assure the advancement of the > state-of-the-art of display and user interface technology. FLAME ON: Who wouldn't like to see these companies and the other hardware and system software companies really work together for a change. As far as I can see the only reason is greed. Companies want to get on top of the heap with their proprietary hardware and/or software. We have wars between DOS and OS/2, wars over the next AT bus, wars over the Unix standard, so of course we are going to have wars over Postscript. Is there a true Postscript standard? No, unless you think that Adobe's Postscript is the standard --- the reason is because Adobe's font technology is proprietary. As a result we will have several standards for Postscript fonts. That is NOT A STANDARD. That hurts end-users and that hurts developers. But it brings in nice profits in the short term and keeps stock holders and Wall Street (talk about greed!) happy. So CEOs can keeping telling us how fulfilling it is to be changing the world, but it's hard to believe a word of it. Actions speak louder than words. Display Posctscript and NeWs are both here to stay --- exactly how mcuh success either will have will be determined over time. Yes, it would be very nice to have Adobe and Sun work together to agree on a common denominator with regard to displaying postscript on computer screens. Adobe should accept the fact that Sun has the right to develop their own postscript system software for display on screens and stop this nonsense about Sun adopting Display Postscript. That kind of talk seems designed to confuse consumers (call FUD, fear, uncertainty, and doubt), but most programmers are much too sophisticated for this nonsense. I just find it irritating --- like recent political ads. Are that many people that easily manipulated? Perhaps "1984" really happened and no one noticed! If Adobe doesn't want to get involved in establishing standards for building a windowing system out of Postscript that is fine. But it will be to everyone's benefit if they agree with Sun on the graphics layer so the developers can port their code easily. What's good for developers is good for end-users is what's good for the hardware/system software vendors. Don't kid yourself, this industry will suffer in a few years if it doesn't get its act together. We've seen prosperity come and go in the computer industry and I'm afraid we are headed for a downturn. The artificial memory shortage (artificially created at least) and battles over standards will likely accelerate a downward turn. Fighting is nonproductive. Even the Soviets, with their economic woes, have realized this. Wake up America. FLAME OFF Mark My opinions have resulted from the interference of alien beings and are not the responsibility of any earthling including myself, and they are not the responsibility of an earthling institution. ------- From don@brillig.umd.edu Sat Oct 29 00:46:15 1988 Date: Sat, 29 Oct 88 00:46:15 EDT To: NeWS-makers@brillig.umd.edu Subject: glass.c From: "Michael_Powers.Henr801M"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Note: Here is a see through clock implementation which consists of two files (glass.c and glass.cps). Mike Powers powers.henr801m@xerox.com %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Glass Clock by Michael Powers (powers.henr801m@xerox.com) % Copyright (C) 1988 Xerox Corp. % % Back end disclaimer: % % This program is provided free for unrestricted use and % redistribution provided that this header is included. % No author (that be me), company (that be Xerox), or % distributor (that be me again) accepts % liability for any problems, lost revenues, or damages. % % glass.c % cc -o glass glass.c -I /usr/NeWS/include /usr/NeWS/lib/libcps.a % % notes: % Glass is an implementation of a NeWS clock that I wrote to % experiment with shaped canvases. The clock is shaped like the % the hands and tick marks thereby allowing you to "see through' % the face to whatever lies behind. Because of the bug concerning % stroking a canvas path the face must redraw every time it is % updated (gross). % One note on the use of glass. I would not suggest using the % -s option (second hand) since the updating chews up lots of time. % Perhaps a few more pauses would help here but I doubt it. % Enjoy! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #include #ifdef SYSVREF #include #include #include #include #else #include #endif #include #include "glass.h" #include #include "psio.h" main (argc, argv) char **argv; { int show_seconds = 0; int lmin = -1, lhour = -1, lsec = -1; while (--argc > 0) { if ((++argv)[0][0] == '-') switch (argv[0][1]) { case 's': show_seconds = 1; break; default: fprintf (stderr, "glassclock: illegal option: %s\n", argv[0]); exit (-1); } else { fprintf (stderr, "glassclock: illegal option: %s\n", argv[0]); exit (-1); } } if (ps_open_PostScript () == 0) { fprintf (stderr, "No NeWS server\n"); exit (-1); } ps_createclock (); /* initialize glass clock window */ while (1) { register struct tm *tm; #ifdef SYSVREF time_t now; #else long now; #endif now = time (0); tm = localtime (&now); tm->tm_hour = tm->tm_hour * 5 + tm->tm_min / 12; if (tm->tm_min != lmin || (show_seconds && tm->tm_sec != lsec) || tm->tm_hour != lhour) ps_update (tm->tm_hour,tm->tm_min,tm->tm_sec,show_seconds); lsec = tm->tm_sec; lmin = tm->tm_min; lhour = tm->tm_hour; ps_flush_PostScript (); { int n; #ifdef SYSVREF struct pollfd msk[1]; static int t = 0; #else int msk = 1 << psio_fileno (PostScriptInput); static struct timeval t; #endif #ifdef SYSVREF msk[0].fd = psio_fileno (PostScriptInput); msk[0].events = POLLIN; #endif #ifdef SYSVREF now = (show_seconds ? 1 : 60 - tm->tm_sec) * 1000; t = now > 60000 ? 60000 : now; if (poll(msk, 1, t) > 0) #else now = show_seconds ? 1 : 60 - tm->tm_sec; t.tv_sec = now > 60 ? 60 : now; if (select (32, &msk, 0, 0, &t) > 0) #endif { char buf[1000]; n = read (psio_fileno (PostScriptInput), buf, sizeof buf); if (n == 0) exit (0); else perror ("read"); } } } } From don@brillig.umd.edu Sat Oct 29 00:49:22 1988 Date: Sat, 29 Oct 88 00:49:22 EDT To: NeWS-makers@brillig.umd.edu Subject: glass.cps From: "Michael_Powers.Henr801M"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Note: Heres the other half (glass.cps) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Glass Clock by Michael Powers (powers.henr801m@xerox.com) % Copyright (C) 1988 Xerox Corp. % % Back end disclaimer: % % This program is provided free for unrestricted use and % redistribution provided that this header is included. % No author (that be me), company (that be Xerox), or % distributor (that be me again) accepts % liability for any problems, lost revenue, or damages. % % Misc disclaimer: % % The postscript isn't pretty, the clock face isn't pretty, % and the author isn't pretty. % % glass.cps % just run it through cps to generate glass.h % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cdef ps_createclock() /Hour 0 def /Min 0 def /Sec 0 def /ShowSeconds? 0 def /HourLength 25 def /HourWidth 6 def /MinLength 38 def /MinWidth 4 def /SecLength 38 def /SecWidth 2 def /draw_hand { % rad wid rot => dup rotate 3 1 roll dup 2 div neg 3 moveto dup 0 rlineto exch dup 0 exch rlineto exch neg 0 rlineto neg 0 exch rlineto neg rotate } def /draw_face { 50 50 translate ShowSeconds? 1 eq {SecLength SecWidth Sec draw_hand} if MinLength MinWidth Min draw_hand HourLength HourWidth Hour draw_hand 12 {-2 42 moveto 4 0 rlineto 0 6 rlineto -4 0 rlineto 0 -6 rlineto 30 rotate} repeat } def /window framebuffer /new DefaultWindow send def { /IconLabel (Clock) def /PaintClient { gsave ClientCanvas setcanvas 1 fillcanvas FrameWidth 100 div FrameHeight 100 div scale 48 52 translate 0 setgray 2 setlinewidth gsave HourLength HourWidth Hour draw_hand gsave 1 setgray fill grestore stroke pause MinLength MinWidth Min draw_hand gsave 1 setgray fill grestore stroke pause ShowSeconds? 1 eq {SecLength SecWidth Sec draw_hand . gsave 1 setgray fill grestore stroke} if 12 {-2 42 moveto 4 0 rlineto 0 6 rlineto -4 0 rlineto 0 -6 rlineto 30 rotate} repeat gsave 1 setgray fill grestore stroke grestore } def /ShapeFrameCanvas { gsave ParentCanvas setcanvas FrameX FrameY translate FrameWidth 100 div FrameHeight 100 div scale draw_face FrameCanvas setcanvasshape grestore } def /ShapeClientCanvas { gsave FrameCanvas setcanvas 0 0 FrameWidth FrameHeight rectpath ClientCanvas setcanvasshape grestore } def /PaintFrame { } def /PaintFocus { gsave FrameCanvas setcanvas FrameWidth 100 div FrameHeight 100 div scale KeyFocus? {1} {0} ifelse setgray 1 setlinewidth 48 48 43 0 360 arc stroke grestore } def } window send /reshapefromuser window send % Shape it. /map window send % Map the window. (Damage causes PaintClient to be called) window /ClientCanvas get setcanvas cdef ps_update(hour,min,sec,show) gsave /Hour hour 6 neg mul store /Min min 6 neg mul store /Sec sec 6 neg mul store /ShowSeconds? show store /ShapeFrameCanvas window send grestore From don@brillig.umd.edu Sat Oct 29 00:49:28 1988 Date: Sat, 29 Oct 88 00:49:28 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: Canvases in negative space From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <21066@sgi.SGI.COM> msc@canth.SGI.COM (Mark Callow) writes: > 2. The second problem is that the underlying pixrect code does > not understand how to make region pixrects that are to top > or left of the primary pixrect. The underlying code called > by movecanvas as tests to prevent -ve x or y values. It > sets them to zero. I'm glad you guys fixed this problem, and I hope Sun does the same. Some things would be quite a bit simpler without this restriction. But ... As with any other "feature," nice or not, changing its behavior will lead to some interesting effects. An funny one comes to mind: Closing a window for the first time places the icon at the upper left corner of the window. If the window were placed such that the upper left corner were off-screen (currently an impossibility) then the icon would materialize off-screen and there would be no way to open the window again! Myself, I have already hacked a window subclass (based on Don Hopkins neatwin.ps) that initially places the window at the mouse cursor. In addition, pushing the "close button" with "Middle" causes an "iconize and slide icon" behavior. Stan Switzer sjs@ctt.bellcore.com From don@brillig.umd.edu Sat Oct 29 00:49:37 1988 Date: Sat, 29 Oct 88 00:49:37 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: MicroTimes interview with John Warnock of Adobe From: auspex!guy@uunet.uu.net (Guy Harris) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >All very tricky legal landmines, but I can assure you that Dr. Warnock >knows exactly what NeWS is, and I think the important message in >between the lines here is that Adobe has a great interest in Sun >Microsystems, and would love to see them use our Display PostScript >implementation rather than a "clone." In other words, you've either extended PostScript to handle input devices, or would love to see Sun extend Display PostScript in such a fashion so that it *could* replace the current interpreter in NeWS? From don@brillig.umd.edu Sat Oct 29 00:50:28 1988 Date: Sat, 29 Oct 88 00:50:28 EDT To: NeWS-makers@brillig.umd.edu Subject: F1 is in my way From: toms@ncifcrf.gov Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I keep hitting the F1 button on my Sun keyboard, instead of or while I go for the Esc key when I'm working in a Suntools window. This puts me in capitals and leads to disaster on occasion. Can someone tell me how to remove this assignment? It's a bad design (from my viewpoint ;-) since there already is a capitals key that stays out of my way. Tom From don@brillig.umd.edu Sat Oct 29 00:51:17 1988 Date: Sat, 29 Oct 88 00:51:17 EDT To: NeWS-makers@brillig.umd.edu Subject: Re: MicroTimes interview with John Warnock of Adobe From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <317@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes in response to Glen Reid: > >All very tricky legal landmines, but I can assure you that Dr. Warnock > >knows exactly what NeWS is, and I think the important message in > >between the lines here is that Adobe has a great interest in Sun > >Microsystems, and would love to see them use our Display PostScript > >implementation rather than a "clone." > > In other words, you've either extended PostScript to handle input > devices, or would love to see Sun extend Display PostScript in such a > fashion so that it *could* replace the current interpreter in NeWS? This is starting to get interesting. And here we have ringside seats! I think it is obvious that a company that is trying to create a commodity workstation market and a company that makes its money by selling a line of software will have different vested interests in areas such as these. Clearly Sun's position is enhanced and Adobe's position is somewhat diminished by a product like NeWS. I don't see how it could be otherwise. Too bad. They're both great products. Given the current market dynamics, it will never be enough for a software company to build a great product and sit on it. A viable software house will need a continuous stream of new software to keep ahead of the me-toos and the GNUs of the world (God bless 'em). (Of course, another approach would be to build a good piece of software and play a dirty trick on your competitors like licensing it to them on reasonable terms, thereby gaining the good will of the industry and the customer base and promoting the development of standards in the bargain. Anyone recognize NFS here? Again, though, the existance of NFS did a great deal to create the market that Sun hoped to capture. Sun could afford to be generous here.) So, it's a complicated world, but I guess we already knew that. Back to the original topic: Can we expect NeWS and Display PostScript to converge? I know a bit about NeWS, and I know a bit about PostScript, but I haven't found any particularly useful info about Display Postsctipt (perhaps I'm not looking in the right places). I do know this: Sun's NeWS has introduced few gratuitous incompatabilities with Postscript (and they have been beaten about the head with a wet fish for those few that they did). Has Adobe returned the favor? In particular, does Display PostScript have anything like the following features? Have they followed Sun's lead or gone off in a different direction? 1) Canvases 2) Color objects 3) processes (fork) 4) monitors 5) overlays 6) copyarea 7) damage 8) tokenized or compressed input 9) objects as dictionaries 10) events and interests Speaking only for myself, Stan Switzer sjs@ctt.bellcore.com "Iron fist Philosophy / Is your life worth a painting?" From don@brillig.umd.edu Mon Oct 31 17:50:09 1988 Date: Mon, 31 Oct 88 17:50:09 EST To: NeWS-makers@brillig.umd.edu Subject: glass.c and glass.cps resend From: "Michael_Powers.Henr801M"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Note: Here is a see through clock implementation which consists of two files (glass.c and glass.cps). Mike Powers powers.henr801m@xerox.com %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Glass Clock by Michael Powers (powers.henr801m@xerox.com) % Copyright (C) 1988 Xerox Corp. % % Back end disclaimer: % % This program is provided free for unrestricted use and % redistribution provided that this header is included. % No author (that be me), company (that be Xerox), or % distributor (that be me again) accepts % liability for any problems, lost revenues, or damages. % % glass.c % cc -o glass glass.c -I /usr/NeWS/include /usr/NeWS/lib/libcps.a % % notes: % Glass is an implementation of a NeWS clock that I wrote to % experiment with shaped canvases. The clock is shaped like the % the hands and tick marks thereby allowing you to "see through' % the face to whatever lies behind. Because of the bug concerning % stroking a canvas path the face must redraw every time it is % updated (gross). % One note on the use of glass. I would not suggest using the % -s option (second hand) since the updating chews up lots of time. % Perhaps a few more pauses would help here but I doubt it. % Enjoy! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #include #ifdef SYSVREF #include #include #include #include #else #include #endif #include #include "glass.h" #include #include "psio.h" main (argc, argv) char **argv; { int show_seconds = 0; int lmin = -1, lhour = -1, lsec = -1; while (--argc > 0) { if ((++argv)[0][0] == '-') switch (argv[0][1]) { case 's': show_seconds = 1; break; default: fprintf (stderr, "glassclock: illegal option: %s\n", argv[0]); exit (-1); } else { fprintf (stderr, "glassclock: illegal option: %s\n", argv[0]); exit (-1); } } if (ps_open_PostScript () == 0) { fprintf (stderr, "No NeWS server\n"); exit (-1); } ps_createclock (); /* initialize glass clock window */ while (1) { register struct tm *tm; #ifdef SYSVREF time_t now; #else long now; #endif now = time (0); tm = localtime (&now); tm->tm_hour = tm->tm_hour * 5 + tm->tm_min / 12; if (tm->tm_min != lmin || (show_seconds && tm->tm_sec != lsec) || tm->tm_hour != lhour) ps_update (tm->tm_hour,tm->tm_min,tm->tm_sec,show_seconds); lsec = tm->tm_sec; lmin = tm->tm_min; lhour = tm->tm_hour; ps_flush_PostScript (); { int n; #ifdef SYSVREF struct pollfd msk[1]; static int t = 0; #else int msk = 1 << psio_fileno (PostScriptInput); static struct timeval t; #endif #ifdef SYSVREF msk[0].fd = psio_fileno (PostScriptInput); msk[0].events = POLLIN; #endif #ifdef SYSVREF now = (show_seconds ? 1 : 60 - tm->tm_sec) * 1000; t = now > 60000 ? 60000 : now; if (poll(msk, 1, t) > 0) #else now = show_seconds ? 1 : 60 - tm->tm_sec; t.tv_sec = now > 60 ? 60 : now; if (select (32, &msk, 0, 0, &t) > 0) #endif { char buf[1000]; n = read (psio_fileno (PostScriptInput), buf, sizeof buf); if (n == 0) exit (0); else perror ("read"); } } } } cut here 8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8<8< %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Glass Clock by Michael Powers (powers.henr801m@xerox.com) % Copyright (C) 1988 Xerox Corp. % % Back end disclaimer: % % This program is provided free for unrestricted use and % redistribution provided that this header is included. % No author (that be me), company (that be Xerox), or % distributor (that be me again) accepts % liability for any problems, lost revenue, or damages. % % Misc disclaimer: % % The postscript isn't pretty, the clock face isn't pretty, % and the author isn't pretty. % % glass.cps % just run it through cps to generate glass.h % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% cdef ps_createclock() /Hour 0 def /Min 0 def /Sec 0 def /ShowSeconds? 0 def /HourLength 25 def /HourWidth 6 def /MinLength 38 def /MinWidth 4 def /SecLength 38 def /SecWidth 2 def /draw_hand { % rad wid rot => dup rotate 3 1 roll dup 2 div neg 3 moveto dup 0 rlineto exch dup 0 exch rlineto exch neg 0 rlineto neg 0 exch rlineto neg rotate } def /draw_face { 50 50 translate ShowSeconds? 1 eq {SecLength SecWidth Sec draw_hand} if MinLength MinWidth Min draw_hand HourLength HourWidth Hour draw_hand 12 {-2 42 moveto 4 0 rlineto 0 6 rlineto -4 0 rlineto 0 -6 rlineto 30 rotate} repeat } def /window framebuffer /new DefaultWindow send def { /IconLabel (Clock) def /PaintClient { gsave ClientCanvas setcanvas 1 fillcanvas FrameWidth 100 div FrameHeight 100 div scale 48 52 translate 0 setgray 2 setlinewidth gsave HourLength HourWidth Hour draw_hand gsave 1 setgray fill grestore stroke pause MinLength MinWidth Min draw_hand gsave 1 setgray fill grestore stroke pause ShowSeconds? 1 eq {SecLength SecWidth Sec draw_hand . gsave 1 setgray fill grestore stroke} if 12 {-2 42 moveto 4 0 rlineto 0 6 rlineto -4 0 rlineto 0 -6 rlineto 30 rotate} repeat gsave 1 setgray fill grestore stroke grestore } def /ShapeFrameCanvas { gsave ParentCanvas setcanvas FrameX FrameY translate FrameWidth 100 div FrameHeight 100 div scale draw_face FrameCanvas setcanvasshape grestore } def /ShapeClientCanvas { gsave FrameCanvas setcanvas 0 0 FrameWidth FrameHeight rectpath ClientCanvas setcanvasshape grestore } def /PaintFrame { } def /PaintFocus { gsave FrameCanvas setcanvas FrameWidth 100 div FrameHeight 100 div scale KeyFocus? {1} {0} ifelse setgray 1 setlinewidth 48 48 43 0 360 arc stroke grestore } def } window send /reshapefromuser window send % Shape it. /map window send % Map the window. (Damage causes PaintClient to be called) window /ClientCanvas get setcanvas cdef ps_update(hour,min,sec,show) gsave /Hour hour 6 neg mul store /Min min 6 neg mul store /Sec sec 6 neg mul store /ShowSeconds? show store /ShapeFrameCanvas window send grestore From don@brillig.umd.edu Mon Oct 31 17:50:15 1988 Date: Mon, 31 Oct 88 17:50:15 EST To: NeWS-makers@brillig.umd.edu Subject: class browser From: ssc-vax!benoni@beaver.cs.washington.edu (Charles L Ditzel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) A short while back someone from Sun posted a class browser, unfortunately my copy was munged. I would appreciate somehow getting my hands on it...but how? From don@brillig.umd.edu Mon Oct 31 17:51:43 1988 Date: Mon, 31 Oct 88 17:51:43 EST To: NeWS-makers@brillig.umd.edu Subject: window locks breaking and SunOS 4.0 NeWS From: ssc-vax!benoni@beaver.cs.washington.edu (Charles L Ditzel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) 1) I am running NeWS on SunOS 4.0 and am looking for people that have done the same. The performance seems to be almost as bad as X :-), any clues why ? (and yes, i have : define(LOGHOST,1) in syslog.conf). I would appreciate any hints as to how improve things under 4.0. 2) I keep getting : Window lock broken after time limit exceeded by pid XXX where 187 obviously varies...does anyone have a clue as to why NeWS is complaining? 3) Finally, is Sun going to come out with a NeWS 1.1 recompilation to take advantage of 4.0 ? Thanks in advance Charles Ditzel uw-beaver!ssc-vax!benoni From don@brillig.umd.edu Tue Nov 1 02:51:41 1988 Date: Tue, 1 Nov 88 02:51:41 EST To: NeWS-makers@brillig.umd.edu Subject: new, improved psterm available? From: mailrus!cwjcc!hal!nic.MR.NET!eta!rscott@ames.arc.nasa.gov (Rich Scott) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I seem to recall that someone said on the net a few months ago that they were going to post a new, improved, and much faster version of 'psterm' for NeWS 1.1 users. Has anything come of this? I don't remember who the original poster was (Grasshopper Group?) --- Rich Scott uucp: {rutgers,amdahl,ihnp4}!meccts!eta!rscott ETA Systems domain: rscott@eta.unix.eta.com Saint Paul, MN arpa: eta!rscott@uxc.cso.uiuc.edu -or- rscott@gonzo.eta.com "Heck-a-slammin'" - S. Easton/P.R. Nelson From don@brillig.umd.edu Tue Nov 1 20:29:40 1988 Date: Tue, 1 Nov 88 20:29:40 EST To: NeWS-makers@brillig.umd.edu Subject: Re: window locks breaking and SunOS 4.0 NeWS From: "S. Holmes (Consulting Detective)" Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >> >> 2) I keep getting : >> Window lock broken after time limit xceeded by pid XXX >> where 187 obviously varies...does anyone have a clue as to why >> NeWS is complaining? >> ... >> Charles Ditzel >> uw-beaver!ssc-vax!benoni I have been getting that, too, on a 3/260, OS 4.0 running *Suntools*, and would also like to see any explaination for it. Sun didn't give a very satisfactory response. Basically, some programs don't work under OS 4.0 yet. Steve Holmes sjh@math.purdue.edu From don@brillig.umd.edu Tue Nov 1 20:31:07 1988 Date: Tue, 1 Nov 88 20:31:07 EST To: NeWS-makers@brillig.umd.edu Subject: Dithering From: russ%yummy@gateway.mitre.org Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Automatic dithering in NeWS is a great feature, BUT, I want to turn it OFF sometimes so I can display images that reflect the actual data. How can I turn off the dithering when rendering a canvas in a window? Thanks, Russ ARPA: russ%yummy@gateway.mitre.org Russell Leighton M.S. Z406 MITRE Signal Processing Lab 7525 Colshire Dr. McLean, Va. 22102 USA From don@brillig.umd.edu Tue Nov 1 20:45:45 1988 Date: Tue, 1 Nov 88 20:45:45 EST To: NeWS-makers@brillig.umd.edu Subject: Graphic display of binary search tree manipulation in NeWS From: gondor.cs.psu.edu!callahan@psuvax1.psu.edu (Paul B. Callahan) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The follow shar file contains the code for NeWS window program that allows the user to "edit" binary search trees. It is contained in the files treeedit.c, and treeedit.cps. The executable csh file cctreeedit will compile it into treeedit if your system is configured in the same way as the one I used. The editor is easy to use. The default initial tree is just a single node. The left mouse button causes a tree rotation on the edge going into a node, if it is clicked directly on the node. If it is clicked far away, it allows gradual movement of the current node. The middle mouse button is used to select the node it is clicked on as the current node. The right button causes insertion of a node in a place determined by the x coordinate of the mouse location. Finally, the screen button DELETE deletes the current node. When the window is zapped, the c program outputs an RPN expression for the tree to stdout. This sort of expression can also be input as the current tree using the -i option. Have fun, and reply with any feedback or suggestions. -----------------------cut here---------------------- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create: # cctreeedit # treeedit.c # treeedit.cps # This archive created: Mon Oct 31 21:05:54 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'cctreeedit' then echo shar: "will not over-write existing file 'cctreeedit'" else cat << \SHAR_EOF > 'cctreeedit' cps treeedit.cps cc -o treeedit treeedit.c /usr/NeWS/lib/libcps.a -I/usr/NeWS/include SHAR_EOF chmod +x 'cctreeedit' fi if test -f 'treeedit.c' then echo shar: "will not over-write existing file 'treeedit.c'" else cat << \SHAR_EOF > 'treeedit.c' #include #include "treeedit.h" #define MaxNodes 1000 #define MaxCol 1 #define MaxRow 1 struct bst { struct bst *left; struct bst *right; int rank; int depth; }; typedef struct bst * item; item stack[MaxNodes]; int StackPtr; initstack() {StackPtr=0;} push(node) item node; { if (StackPtr>=MaxNodes) { printf("Stack Overflow\n"); exit(1); } else stack[StackPtr++]=node; } pop(node) item *node; { if (StackPtr==0) { printf("Stack Underflow\n"); exit(1); } else *node=stack[--StackPtr]; } construct() { struct bst *node,*nodel,*noder; char c; while ((c=getchar())!='\n') { node=(struct bst *) malloc(sizeof(struct bst)); node->left=NULL; node->right=NULL; if (c=='.') { push(node); } else if (c=='l') { pop(&nodel); node->left=nodel; push(node); } else if (c=='r') { pop(&noder); node->right=noder; push(node); } else { pop(&noder); node->right=noder; pop(&nodel); node->left=nodel; push(node); } } } findxy(root,rank,depth,maxdepth) struct bst *root; int *rank,depth,*maxdepth; { if (root!=NULL) { if (depth>*maxdepth) *maxdepth=depth; findxy(root->left,rank,depth+1,maxdepth); root->rank=*rank; root->depth=depth; (*rank)++; findxy(root->right,rank,depth+1,maxdepth); } } draw(id,root) struct bst *root; int id; { cps_drawnode(id,root->rank,root->depth); if (root->left!=NULL) { cps_drawedge(id, root->rank,root->depth, root->left->rank,root->left->depth); draw(id,root->left); } if (root->right!=NULL) { cps_drawedge(id, root->rank,root->depth, root->right->rank,root->right->depth); draw(id,root->right); } } postout(root) struct bst *root; { int typenode; static char nodechar[]=".rlb"; typenode=0; if (root->left!=NULL) { postout(root->left); typenode+=2; } if (root->right!=NULL) { postout(root->right); typenode++; } printf("%c",nodechar[typenode]); } main(argc,argv) char **argv; { char c; struct bst *root; int maxdepth, rank; struct bst *rotabout,*newrot,*tempnode,*next,*parent; struct bst **insplace; int id,cnum; int opt,done,x,rotx,tempx; float geomx; if (ps_open_PostScript()==0) { fprintf(stderr,"No NeWS is bad news\n"); exit(1); } ps_flush_PostScript(); opt=0; while (--argc>0) opt=((++argv)[0][0]=='-'); if (!opt) { root=(struct bst *) malloc(sizeof(struct bst)); root->left=NULL; root->right=NULL; } else if (argv[0][1]=='i') { done=0; while (!done) { initstack(); construct(); pop(&root); if (StackPtr>0) printf("Not a tree\n"); else done=1; } } else { fprintf(stderr,"invalid option %c\n",argv[0]); exit(-1); } rotabout=root; rank=0; maxdepth=0; findxy(root,&rank,0,&maxdepth); cps_initwindow(rank-1,maxdepth,rotabout->rank,rotabout->depth); while (!psio_error(PostScriptInput)) { if (cps_damage(&id)) { draw(id,root); cps_Wcirc(id,rotabout->rank,rotabout->depth); cps_exit(id); } else if (cps_rightbutton(&id,&geomx)) { insplace=&root; while ((*insplace)!=NULL) { if ((float) ((*insplace)->rank) > geomx) insplace=&((*insplace)->left); else insplace=&((*insplace)->right); } *insplace=(struct bst *) malloc(sizeof(struct bst)); (*insplace)->left=NULL; (*insplace)->right=NULL; rank=0; maxdepth=0; findxy(root,&rank,0,&maxdepth); cps_clearandrescale(id,rank-1,maxdepth); cps_exit(id); } else if (cps_midbutton(&id,&geomx)) { x = (int) (geomx+0.5); rotx=rotabout->rank; next=root; while (next!=NULL) { tempnode=next; tempx=tempnode->rank; if ((tempx > x) && (tempx > rotx)) next=tempnode->left; else if ((tempx < x) && (tempx < rotx)) next=tempnode->right; else next=NULL; } while (rotabout!=tempnode) { cps_Bcirc(id,rotabout->rank,rotabout->depth); pop(&rotabout); cps_Wcirc(id,rotabout->rank,rotabout->depth); } while (rotabout->rank!=x) { cps_Bcirc(id,rotabout->rank,rotabout->depth); push(rotabout); if (rotabout->rank>x) rotabout=rotabout->left; else rotabout=rotabout->right; cps_Wcirc(id,rotabout->rank,rotabout->depth); } cps_exit(id); } else if (cps_delbutton(&id)) { if ((root->left!=NULL) || (root->right!=NULL)) switch((rotabout->left!=NULL)*2+(rotabout->right!=NULL)) { case 0: pop(&tempnode); if (tempnode->left==rotabout) tempnode->left=NULL; else tempnode->right=NULL; break; case 1: if (root==rotabout) root=rotabout->right; else { pop(&tempnode); if (tempnode->left==rotabout) tempnode->left=rotabout->right; else tempnode->right=rotabout->right; } break; case 2: if (root==rotabout) root=rotabout->left; else { pop(&tempnode); if (tempnode->left==rotabout) tempnode->left=rotabout->left; else tempnode->right=rotabout->left; } break; case 3: parent=rotabout; tempnode=parent->left; if (tempnode->right==NULL) parent->left=tempnode->left; else { while (tempnode->right!=NULL) { parent=tempnode; tempnode=parent->right; } parent->right=tempnode->left; } break; } initstack(); rotabout=root; maxdepth=0; rank=0; findxy(root,&rank,0,&maxdepth); cps_clearandrescale(id,rank-1,maxdepth); cps_exit(id); } else if (cps_get_comm(&id,&cnum)) { switch(cnum) { case 0: if (StackPtr>0) { cps_Bcirc(id,rotabout->rank,rotabout->depth); pop(&rotabout); cps_Wcirc(id,rotabout->rank,rotabout->depth); } break; case 1: if ((rotabout->left)!=NULL) { push(rotabout); cps_Bcirc(id,rotabout->rank,rotabout->depth); rotabout=rotabout->left; cps_Wcirc(id,rotabout->rank,rotabout->depth); } break; case 2: if ((rotabout->right)!=NULL) { push(rotabout); cps_Bcirc(id,rotabout->rank,rotabout->depth); rotabout=rotabout->right; cps_Wcirc(id,rotabout->rank,rotabout->depth); } break; case 3: if (StackPtr>0) { pop(&newrot); if (StackPtr==0) root=rotabout; else { pop(&tempnode); push(tempnode); if ((tempnode->right)==newrot) tempnode->right=rotabout; else tempnode->left=rotabout; } if (newrot->left==rotabout) { newrot->left=rotabout->right; rotabout->right=newrot; } else { newrot->right=rotabout->left; rotabout->left=newrot; } rank=0; maxdepth=0; findxy(root,&rank,0,&maxdepth); cps_clearandrescale(id,rank-1,maxdepth); } break; } cps_exit(id); } else if (cps_done() || psio_eof(PostScriptInput)) break; } postout(root); printf("\n"); } SHAR_EOF fi if test -f 'treeedit.cps' then echo shar: "will not over-write existing file 'treeedit.cps'" else cat << \SHAR_EOF > 'treeedit.cps' #define LMB_TAG 1 #define DAMAGE_TAG 2 #define DONE_TAG 3 #define MMB_TAG 4 #define RMB_TAG 5 #define DELB_TAG 6 cdef cps_initwindow(int sx,int sy,int xrot,int yrot) systemdict /Item known not { (NeWS/liteitem.ps) run } if /LMB /LeftMouseButton def /MMB /MiddleMouseButton def /RMB /RightMouseButton def yrot xrot userdict begin /xrot exch def /yrot exch def end /downeventinterest {/DownTransition ClientCanvas eventmgrinterest} def /startinput { /ButtonMgr[ LMB {LMB_TAG getdirection} downeventinterest MMB {MMB_TAG getgeomx} downeventinterest RMB {RMB_TAG getgeomx} downeventinterest ]forkeventmgr store } def /repair { DAMAGE_TAG tagprint uniquecid dup typedprint [exch cidinterest] forkeventmgr waitprocess pop } def /makescale { /y exch def /x exch def 4 2 roll pop pop y 0.5 add div exch x 1.5 add div exch scale 0.01 setlinewidth 0 y 0.5 add translate 1 -1 scale 0.75 0.25 translate } def /TreeWindow DefaultWindow dictbegin /ScaleX sx def /ScaleY sy def /DelButtonHeight 45 def /DelButtonWidth 60 def /FrameLabel (Tree) def /ButtonMgr null def dictend classbegin /CreateClientCanvas { /CreateClientCanvas super send /items 1 dict dup begin /DelButton (Delete) {DELB_TAG screenbutton} FrameCanvas DelButtonWidth 0 /new ButtonItem send dup /ItemBorderColor 0 0 0 rgbcolor put def end def /itemmgr items forkitems def } def /RescaleCanvas { /ScaleY exch def /ScaleX exch def setcanvas [1 0 0 1 0 0] setmatrix 0 exch translate initclip clippath pathbbox ScaleX ScaleY makescale currentcanvas reshapecanvas } def /ShapeClientCanvas { gsave /ShapeClientCanvas super send currentcanvas FrameCanvas setcanvas FrameWidth 2 div DelButtonWidth 2 div sub BorderBottom 5 add /move window /items get /DelButton get send setcanvas grestore } def /PaintClient { 1 fillcanvas repair /paint items /DelButton get send } def /PaintIcon { 0.75 0.498 0.196 rgbcolor fillcanvas repair } def /flipiconic { /flipiconic super send Iconic? IconCanvas /Retained get and {/paint self send} if } def /move { Iconic? {IconHeight sub} if /move super send } def /DestroyClient { itemmgr killprocess ButtonMgr killprocess DONE_TAG tagprint } def /ForkFrameEventMgr{ /ForkFrameEventMgr super send startinput } def /ClientPath { 4 copy rectpath DelButtonHeight sub 0 DelButtonHeight translate ScaleX ScaleY makescale } def /IconPath { 4 copy rectpath ScaleX ScaleY makescale } def classend def /window framebuffer /new TreeWindow send def /reshapefromuser window send /map window send /getdirection { ClientCanvas setcanvas tagprint uniquecid dup typedprint exch begin YLocation userdict /yrot get sub dup mul XLocation userdict /xrot get sub 3 div dup mul add 0.09 lt {3} {YLocation userdict /yrot get gt {XLocation userdict /xrot get lt {1} {2} ifelse} {0} ifelse} ifelse end typedprint [exch cidinterest] forkeventmgr waitprocess pop } def /getgeomx { ClientCanvas setcanvas tagprint uniquecid dup typedprint exch begin XLocation end typedprint [exch cidinterest] forkeventmgr waitprocess pop } def /screenbutton { window begin ClientCanvas setcanvas tagprint uniquecid dup typedprint [exch cidinterest] forkeventmgr waitprocess pop end } def cdef cps_get_comm(int id, int cnum) => LMB_TAG(id,cnum) cdef cps_midbutton(int id, float geomx) => MMB_TAG(id,geomx) cdef cps_rightbutton(int id, float geomx) => RMB_TAG(id,geomx) cdef cps_delbutton(int id) => DELB_TAG(id) cdef cps_damage(int id) => DAMAGE_TAG(id) cdef cps_done() => DONE_TAG() cdef cps_exit(int id) id {exit} sendcidevent cdef cps_clearandrescale(int id, int sx, int sy) id { DelButtonHeight ClientCanvas sx sy /RescaleCanvas window send 0 IconCanvas sx sy /RescaleCanvas window send ClientCanvas setcanvas gsave [1 0 0 1 0 0] setmatrix initclip clippath pathbbox 0 DelButtonHeight translate DelButtonHeight sub rectpath 1 setgray fill grestore repair pause} sendcidevent cdef cps_drawedge(int id, int x1, int y1, int x2, int y2) id { x1 y1 moveto x2 y2 lineto 0 setgray stroke pause} sendcidevent cdef cps_drawnode(int id, int x,int y) id { gsave x y translate 3 1 scale 0 0 0.25 0 360 arc 0 setgray fill grestore pause} sendcidevent cdef cps_Wcirc(int id,int x,int y) id { gsave x y translate 3 1 scale 0 0 0.1 0 360 arc 1 setgray fill grestore userdict begin /xrot x def /yrot y def end pause} sendcidevent cdef cps_Bcirc(int id,int x,int y) id { gsave x y translate 3 1 scale 0 0 0.1 0 360 arc 0 setgray fill grestore pause} sendcidevent SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Nov 2 06:28:40 1988 Date: Wed, 2 Nov 88 06:28:40 EST To: NeWS-makers@brillig.umd.edu Subject: Job Posting From: sunmicro!batten@sun.com (Bruce Batten {CSD Window Systems Product Manager}) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The Customer Support Division of Sun Microsystems is looking for a technical support engineer to help us deliver our next generation of windowing products (i.e. X11, NeWS, SunView). Please refer to posting #2228 in "misc.jobs.offered". Thanks, Bruce Batten From don@brillig.umd.edu Wed Nov 2 06:28:46 1988 Date: Wed, 2 Nov 88 06:28:46 EST To: NeWS-makers@brillig.umd.edu Subject: Enhanced NeWS class browser... [ Part 2-2 ] From: cimshop!rhess@uunet.uu.net (Richard Hess) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # litePicWin.ps # This archive created: Tue Nov 1 08:56:21 1988 export PATH; PATH=/bin:$PATH echo shar: extracting "'litePicWin.ps'" '(19052 characters)' if test -f 'litePicWin.ps' then echo shar: will not over-write existing file "'litePicWin.ps'" else sed 's/^%//' << \SHAR_EOF > 'litePicWin.ps' %% [ litePicWin.ps ] %% modified: rhess %% ----------------------------------------------------------------------------- %%% $Header: pw.ps,v 1.3 88/06/14 17:17:52 bvs Locked $ %% ----------------------------------------------------------------------------- %% This file contains the classes used by the class browser. %% The classes included are: %% PicItem -- an Item similar in concept to the NeWS1.1 textcanvas %% PicWindow -- a LiteWindow that holds PicItems %% PicScroll -- a SimpleScrollbar with a few modifications (auto scrolling) %% %% This code was mostly written in August 1987 but was revised to work with %% NeWS 1.1 in May 1988. Feel free to use it as you will. %% %% Bruce V. Schwartz %% Sun Microsystems %% bvs@sun.com %% ----------------------------------------------------------------------------- %%% This file contains classes: PicWindow PicScroll PicItem %% ----------------------------------------------------------------------------- % %systemdict begin % systemdict /Item known not { (NeWS/liteitem.ps) run } if % systemdict /SimpleScrollbar known not { (NeWS/liteitem.ps) run } if %end % %/PicWindow LiteWindow %dictbegin % /PicArray [] def %dictend %classbegin % /FrameTextColor 1 1 1 rgbcolor def % /FrameFillColor 0 0 0 rgbcolor def % % /BorderWidth 4 def % /BorderLeft BorderWidth def % /BorderBottom BorderWidth def % /BorderRight BorderWidth def % /BorderTop 16 def % % /reshapefromuser {} def % /PaintFocus { % gsave FrameCanvas setcanvas % KeyFocus? {KeyFocusColor} {1 1 1 rgbcolor} ifelse setcolor % 1 1 BorderWidth 2 sub FrameHeight % BorderTop sub 1 sub rectpath fill % 1 1 FrameWidth 2 sub % BorderWidth 2 sub rectpath fill % FrameWidth BorderWidth sub 1 add 1 % BorderWidth 2 sub FrameHeight % BorderTop sub 1 sub rectpath fill % grestore % } def % /PaintFrameLabel { % gsave % FrameTextColor setcolor FrameFont setfont % BorderWidth 2 mul ControlSize add FrameHeight 12 sub moveto % FrameLabel show % % Temp: clear client here! FIX SOON!!! % ClientCanvas setcanvas 1 fillcanvas % grestore % } def % /CreateFrameInterests { % - => - (Create frame control interests) % FrameInterests begin % /FrameCloseEvent % PointButton /flipiconic % DownTransition CloseControl eventmgrinterest def % /FrameTopEvent % PointButton {Iconic?{flipiconic}{totop}ifelse} % DownTransition FrameCanvas eventmgrinterest def % /FrameMoveEvent % AdjustButton /slide % DownTransition FrameCanvas eventmgrinterest def % /FrameMenuEvent % MenuButton {Iconic? not { /showat FrameMenu send } if } % 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 % end % } def % /CreateFrameMenu { % - => - (Create frame menu) % % Note: Store menu in class to share menus, especially if retained. % /FrameMenu [ % (Move) {/slide ThisWindow send} % (Move Constrained) % {getfbclick pop pop /slideconstrained ThisWindow send} % (Top) {/totop ThisWindow send} % (Bottom) {/tobottom ThisWindow send} % (Zap) {/destroy ThisWindow send} % (Redisplay) {/paint ThisWindow send} % (Close) {/flipiconic ThisWindow send} % ] /new DefaultMenu send def % } def % /CreateIconMenu { % - => - (Create icon menu) % % Note: Store menu in class to share menus, especially if retained. % /IconMenu [ % (Move) {/slide ThisWindow send} % (Top) {/totop ThisWindow send} % (Bottom) {/tobottom ThisWindow send} % (Zap) {/destroy ThisWindow send} % (Redisplay) {/paint ThisWindow send} % (Open) {/flipiconic ThisWindow send} % ] /new DefaultMenu send def % } def % /CreateFrameControls { % - => - (Create frame control canvases/items) % gsave % FrameCanvas setcanvas % /CloseControl FrameCanvas newcanvas dup begin % /Mapped true def % /EventsConsumed /AllEvents def % end def % 0 0 ControlSize dup BorderTop le exch BorderLeft le or % {ControlSize ControlSize} {BorderTop BorderTop} ifelse % rectpath CloseControl reshapecanvas % grestore % } def % /MoveFrameControls { % - => - ([Re]set frame control shapes) % gsave % CloseControl setcanvas % BorderWidth % FrameHeight BorderTop sub BorderTop ControlSize sub 2 div add % movecanvas % grestore % } def % /PaintFrameControls { % - => - (Paint frame control areas) % gsave % because of the set canvas % 1 setgray % CloseControl setcanvas 0 1 moveto /cycle showicon % grestore % } def % % /PaintIcon % { % 1 fillcanvas % 0 strokecanvas % 0 setgray % IconWidth 2 div 1 sub IconHeight 4 div 5 sub 5 Sunlogo % } def % /PaintClient % { % %% (paint client %\n) [ PicArray ] dbgprintf % %% PicArray { ( %\n) [ 3 2 roll ] dbgprintf } forall % PicArray paintitems % } def % /setpicarray % { % /PicArray exch def % } def % /destroy % { % %% (destroying arrays\n) [] dbgprintf % PicArray { /destroy exch send } forall % %% (destroying window\n) [] dbgprintf % /destroy super send % %% (destroyed window\n) [] dbgprintf % } def %classend %def % %/PicScroll SimpleScrollbar %dictbegin % /Owner null def % /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 % /setowner { % /Owner exch def % } def % % /ClientDown { % - => - % CurrentEvent begin XLocation YLocation end % /LastY exch def % /LastX exch def % SetScrollMotion % /MouseInItem? true def % HiliteItem % DoScroll % ScrollProcess null ne % { ScrollMonitor { ScrollProcess killprocess } monitor } % if % /ScrollProcess { InteractiveScroll } fork def % } def % % /InteractiveScroll { % { % ScrollDelay sleep % ScrollMonitor { EventInItem? { DoScroll } if } monitor % } loop % } def % % /ClientUp { % - => - % ScrollMonitor { ScrollProcess killprocess } monitor % /ScrollProcess null def % /MouseInItem? false def % UnhiliteItem % ItemValue ItemInitialValue ne { /Notify Owner send } if % } def % % /ClientDrag { % - => - % CurrentEvent begin XLocation YLocation end % /LastY exch def % /LastX exch def % CheckItem % } def % % /PaintBar { } def % /EraseBox { } def % /PaintButtons { % BarViewPercent 1 gt { /PaintButtons super send } if % } def % % /PaintBox { % - => - (paint box) % %(PaintBox %\n) [ BarViewPercent ] dbgprintf % %(pause...) [] dbgprintf 1 60 div sleep (!!\n) [] dbgprintf % gsave % 10 dict begin % % /x 1 def % /w ItemWidth 2 sub def % % BarViewPercent 1 le % { % .5 setgray % x ButtonSize w ItemHeight ButtonSize dup add sub rectpath fill % } % { % 1 1 BarViewPercent div sub 1 ItemValue sub mul % ItemHeight ButtonSize dup add sub mul ButtonSize add % /y exch def % % 1 BarViewPercent div ItemHeight ButtonSize dup add sub mul % /h exch def % % % % % do the normal bar % % % ItemFillColor setcolor % x ButtonSize w y ButtonSize sub rectpath fill % x y h add w ItemHeight ButtonSize sub y sub h sub rectpath fill % % % % % do the big scroll box % % % /ybut ItemValue ValueToY def % .5 setgray % x y w ybut y sub rectpath fill % x ybut ButtonSize add w h ButtonSize sub ybut sub y add rectpath fill % % % % do the little scroll box % % % ItemValue BoxPath % BoxFillColor setcolor gsave fill grestore % ItemBorderColor setcolor eofill % } ifelse % end % /ItemPaintedValue ItemValue def % grestore % % /Notify Owner send % } 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 % BarViewPercent 1 le { pop false } if % } 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 % % %/PicItem Item %dictbegin % /BufferCanvas null def % /BufferWidth 0 def % /BufferHeight 0 def % /BufferMin 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 % % /NotifyUserDown { pop pop } def % x y => - % /NotifyUserUp { pop pop } def % x y => - % /NotifyUserDrag { pop pop } def % x y => - % /NotifyUserEnter { pop pop } def % x y => - % /NotifyUserExit { pop pop } def % x y => - % %dictend %classbegin % /new { % parentcanvas width height => instance % % (new begin\n) [] dbgprintf % /new super send % begin % /BufferHeight ItemHeight def % /BufferWidth ItemWidth def % CreateScrollbars % CreateBuffer % currentdict % end % % (new end\n) [] dbgprintf % } 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 % /makestartinterests super send % [ exch aload length 2 add -1 roll aload pop ] % join 2 arrays % } def % % /PaintItem { % %% (PaintItem begin\n) [] dbgprintf % %% ItemCanvas setcanvas .9 fillcanvas % PaintBuffer % /paint VScrollbar send % /paint HScrollbar send % %% (PaintItem end\n) [] dbgprintf % } def % % /Notify { % % (PicItem got notified\n) [] dbgprintf % NotifyUser % PaintBuffer % } def % % /PaintBuffer { % % (PaintBuffer begin \n) [ ] dbgprintf % gsave % ItemCanvas setcanvas % % % % compute clipping region % % % 0 % HScrollWidth % ItemWidth VScrollWidth sub % ItemHeight HScrollWidth sub % rectpath % % (clip to % % % %\n) [ pathbbox ] dbgprintf % clip % % % % % 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 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 % gsave % ItemCanvas setcanvas % 0 0 0 rgbcolor strokecanvas % 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 ScrollWidth 2 div def } if % ItemHeight HScrollWidth le { /HScrollWidth ScrollWidth 2 div def } if % % /HScrollbar % [1 0 .01 .1 BufferWidth ItemWidth VScrollWidth sub div ] % 1 {} ItemCanvas % /new PicScroll send % dup /BarVertical? false put % def % /VScrollbar % [1 0 .01 .1 BufferHeight ItemHeight HScrollWidth sub div ] % 1 {} ItemCanvas % /new PicScroll 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 % 10 dict begin % /h ItemHeight def /w ItemWidth def % /s ScrollWidth def % % [1 0 .01 .1 BufferWidth ItemWidth VScrollWidth sub div ] % /setrange HScrollbar send % [1 0 .01 .1 BufferHeight ItemHeight HScrollWidth sub div ] % /setrange VScrollbar send % % % HScrollbar? % { 0 0 w VScrollWidth sub s } % { 0 0 0 0 } % ifelse % % 4 copy (hscroll % % % %\n) [ 6 2 roll ] dbgprintf % /reshape HScrollbar send % % VScrollbar? % { w s sub HScrollWidth s h HScrollWidth sub } % { 0 0 0 0 } % ifelse % % 4 copy (vscroll % % % %\n) [ 6 2 roll ] dbgprintf % /reshape VScrollbar send % end % } def % % /ClientDown { % % (PicItem 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 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 % % (n: %\n) [ NotifyUserDown ] dbgprintf % { NotifyUserDown } fork % % } def % % /ClientUp { % % (PicItem ClientUp\n) [] dbgprintf % CurrentEvent begin XLocation YLocation end % NotifyUserUp % } def % % /ClientDrag { % % (client drag\n) [] dbgprintf % CurrentEvent begin XLocation YLocation end % NotifyUserDrag % } def % % /ClientEnter { % %% (client enter\n) [] dbgprintf % CurrentEvent begin XLocation YLocation end NotifyUserEnter % } def % % /ClientExit { % %% (client exit\n) [] dbgprintf % CurrentEvent begin XLocation YLocation end NotifyUserExit % } def % %classend %def % %% ------------------------------------------------------------------------ SHAR_EOF fi # end of overwriting check # End of shell archive exit 0 ------------------------------------------------------------------------------- WHO: Richard Hess BELL: [415] 940-1400 [ext.342] TITLE: Project Manager CORP: Consilium [ User Interface Services ] SNAIL: 1945 Charleston Road UUCP: ...!uunet!cimshop!rhess Mountain View, CA 94043 ------------------------------------------------------------------------------- From don@brillig.umd.edu Wed Nov 2 06:28:58 1988 Date: Wed, 2 Nov 88 06:28:58 EST To: NeWS-makers@brillig.umd.edu Subject: Enhanced NeWS class browser... [ Part 1-2 ] From: cimshop!rhess@uunet.uu.net (Richard Hess) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # liteBrowser # liteBrowser.ps # This archive created: Tue Nov 1 08:55:56 1988 export PATH; PATH=/bin:$PATH echo shar: extracting "'liteBrowser'" '(240 characters)' if test -f 'liteBrowser' then echo shar: will not over-write existing file "'liteBrowser'" else sed 's/^%//' << \SHAR_EOF > 'liteBrowser' %: %# [ liteBrowser ] %# original: rhess %# ----------------------------------------------------------------------------- % %echo "(NeWS/liteBrowser.ps)run" | psh % %# ------------------------------------------------------------------------ SHAR_EOF chmod +x 'liteBrowser' fi # end of overwriting check echo shar: extracting "'liteBrowser.ps'" '(18617 characters)' if test -f 'liteBrowser.ps' then echo shar: will not over-write existing file "'liteBrowser.ps'" else sed 's/^%//' << \SHAR_EOF > 'liteBrowser.ps' %% [ liteBrowser.ps ] %% modified: rhess [ 6-16-88 ] %% ----------------------------------------------------------------------------- %%% $Header: browse.ps,v 1.2 88/06/14 17:17:45 bvs Locked $ %% ----------------------------------------------------------------------------- %% %% This file contains a NeWS server class browser. %% %% The browser is built on the classes defined in pw.ps. The class %% browser has 5 panes. It is similar in appearance to the Smalltalk %% browser. The first pane on the top of the window contains the list of %% classes in the server. The next 3 contain the list of methods, class %% variables, and instance variables associated with the selected class in %% the first pane. The bottom pane is used to display information about %% the current selection. %% %% This code was mostly written in August 1987 but was revised to work with %% NeWS 1.1 in May 1988. Feel free to use it as you will. %% %% Bruce V. Schwartz %% Sun Microsystems %% bvs@sun.com %% ----------------------------------------------------------------------------- % %userdict begin % %/BrowserPopup % [ rhess ] % 200 200 % [ (liteBrowser:) % ( NeWS Class Browser... ) % ( [ rhess ]) % ] popmsg def % %userdict /PicWindow known not { (NeWS/litePicWin.ps) run } if % %/Font15 /Times-Roman findfont 15 scalefont def % %/StartWait { % userdict begin % /SaveCursor [ currentcanvas getcanvascursor ] def % /hourg /hourg_m fboverlay setstandardcursor % end %} def % %/EndWait { % userdict begin % SaveCursor aload pop setcanvascursor % end %} def % %/DoubleBubbleSort % keyarray valuearray => - (sorts in place) %{ % %% 2 copy (double % %\n) [ 4 2 roll ] dbgprintf % %% StartWait % 20 dict begin % /values exch def % /keys exch def % /bound keys length 1 sub def % /check 0 def % { % /t -1 def % 0 1 bound 1 sub % { % /i exch def % /j i 1 add def % /keysi keys i get def % /keysj keys j get def % keysi keysj gt % { % keys i keysj put % keys j keysi put % /valuesi values i get cvlit def % /valuesj values j get cvlit def % values i valuesj put % values j valuesi put % /t j def % } if % } for % t -1 eq % { exit } % { /bound t def } % ifelse % pause % } loop % end % %% EndWait %} def % %/CreateBrowser { % - => - [ rhess ] % /PicArray [ ] def % /win framebuffer /new PicWindow send def % { % /MenuProc { SetupBrowser } def % /FrameLabel (NeWS Class Browser...) def % } /doit win send % 100 100 806 520 /reshape win send % { 7 ([ Reset ]) { SetupBrowser } /insertitem FrameMenu send } win send % /map win send % % /ClassKeys [] def % /InstKeys [] def % /MethodKeys [] def % /VarKeys [] def % % /ClassPic win /ClientCanvas get 300 1000 /new PicItem send def % /MethodPic win /ClientCanvas get 300 1000 /new PicItem send def % /VarPic win /ClientCanvas get 300 1000 /new PicItem send def % /InstPic win /ClientCanvas get 300 1000 /new PicItem send def % /TextPic win /ClientCanvas get 800 600 /new PicItem send def % % [ ClassPic MethodPic VarPic InstPic ] % { { /BufferMin 255 def } exch send } % forall % { /BufferMin 255 def } TextPic send % % /PicArray [ ClassPic InstPic MethodPic VarPic TextPic ] def % PicArray /setpicarray win send % % ClassPic /HScrollbar? false put % InstPic /HScrollbar? false put % MethodPic /HScrollbar? false put % VarPic /HScrollbar? false put % TextPic /HScrollbar? false put % % 000 250 200 250 /reshape ClassPic send % 200 250 200 250 /reshape MethodPic send % 400 250 200 250 /reshape VarPic send % 600 250 200 250 /reshape InstPic send % 0 0 800 250 /reshape TextPic send % % /ClassColor 1 .8 .8 rgbcolor def % /InstColor 1 .8 1 rgbcolor def % /MethodColor .8 1 .8 rgbcolor def % /VarColor .8 .8 1 rgbcolor def % % /TextColor .8 .8 .8 rgbcolor def [ orig. ]... % /TextColor 1 1 1 rgbcolor def % % ClassPic /NotifyUserDown { userdict /ClassPick get exec } put % InstPic /NotifyUserDown { userdict /InstPick get exec } put % MethodPic /NotifyUserDown { userdict /MethodPick get exec } put % VarPic /NotifyUserDown { userdict /VarPick get exec } put % % /BrowserMgr null def % SetupBrowser %} def % %/SetupBrowser { % - => - [ rhess ] % LastClassPick null ne { /LastClassPick null store } if % LastInstPick null ne { null SetInstPick } if % LastMethodPick null ne { null SetMethodPick } if % LastVarPick null ne { null SetVarPick } if % % 0 /setvalue ClassPic /VScrollbar get send % 0 /setvalue InstPic /VScrollbar get send % 0 /setvalue MethodPic /VScrollbar get send % 0 /setvalue VarPic /VScrollbar get send % 0 /setvalue TextPic /VScrollbar get send % % [] ClassColor ClassPic ShowArray % [] MethodColor MethodPic ShowArray % [] VarColor VarPic ShowArray % [] InstColor InstPic ShowArray % [] 0.8 0.8 0.8 rgbcolor TextPic ShowArray % % gsave % Font15 setfont % 0 setgray % InstPic /ItemCanvas get setcanvas % 5 230 moveto (Class Insts) show % MethodPic /ItemCanvas get setcanvas % 5 230 moveto (Class Methods) show % VarPic /ItemCanvas get setcanvas % 5 230 moveto (Class Vars) show % TextPic /ItemCanvas get setcanvas % 5 230 moveto (Text) show % grestore % % BrowserMgr null eq % { /BrowserMgr PicArray forkitems def } % if % % /ArrayDepth 0 def % DoClasses %} def % %/ShowArray { % array color pic % 10 dict begin % /pic exch def % /color exch def % /a exch def % % Font15 setfont % [ /BufferWidth cvx % a length 18 mul 15 add /BufferMin cvx /max cvx % /reshapebuffer cvx ] cvx % pic send % { /paint VScrollbar send % /paint HScrollbar send } % pic send % % /getcanvas pic send setcanvas % color fillcanvas % % 0 0 0 rgbcolor setcolor % /k pic /BufferHeight get def % a % { % /k k 18 sub def % 5 k % moveto % show % } forall % /updatecanvas pic send % end %} def % %/DoClasses { % /getcanvas ClassPic send setcanvas % 10 dict begin % /ClassKeys [] def % /ClassVals [] def % % [ systemdict userdict ] % { % { % /val exch cvlit def % /key exch cvlit def % val type /dicttype eq % { % val /ClassName known % { % /ClassKeys % ClassKeys 999 key 256 string cvs arrayinsert def % /ClassVals ClassVals 999 val arrayinsert def % } % if % } % if % pause % } forall % } forall % ClassKeys % ClassVals % end % % /ClassVals exch def % /ClassKeys exch def % ClassKeys ClassVals DoubleBubbleSort % ClassKeys ClassColor ClassPic ShowArray %} def % %/DoMethods { % classdict => - % 10 dict begin % /classdict exch def % /MethodKeys [] def % /MethodVals [] def % classdict % { % /val exch def % /key exch def % /val load type /arraytype eq % /val load xcheck % and % { % /MethodKeys MethodKeys 999 key 256 string cvs arrayinsert def % /MethodVals MethodVals 999 /val load cvlit arrayinsert def % } % if % pause % } forall % MethodKeys % MethodVals % end % % userdict begin % /MethodVals exch def % /MethodKeys exch def % MethodKeys MethodVals DoubleBubbleSort % % MethodKeys MethodColor MethodPic ShowArray % end % %} def % %/DoVars { % classdict => - % 10 dict begin % /classdict exch def % /VarKeys [] def % /VarVals [] def % classdict % { % /val exch def % /key exch def % /val load type /arraytype eq % /val load xcheck % and not % { % /VarKeys VarKeys 999 key 256 string cvs arrayinsert def % /VarVals VarVals 999 /val load cvlit arrayinsert def % } % if % pause % } forall % VarKeys % VarVals % end % % userdict begin % /VarVals exch def % /VarKeys exch def % VarKeys VarVals DoubleBubbleSort % % VarKeys VarColor VarPic ShowArray % end % %} def % %/DoInsts { % classdict => - % %(DoInsts begin***\n) [] dbgprintf % 10 dict begin % /classdict exch def % /InstKeys [] def % /InstVals [] def % classdict /InstanceVarDict get % dup null eq { pop [] } if % { % /val exch def % /key exch def % /InstKeys InstKeys 999 key 256 string cvs arrayinsert def % /InstVals InstVals 999 /val load arrayinsert def % pause % } forall % InstKeys % InstVals % end % % userdict begin % /InstVals exch def % /InstKeys exch def % InstKeys InstVals DoubleBubbleSort % % InstKeys InstColor InstPic ShowArray % end % % %(DoInsts end***\n) [] dbgprintf %} def % % %/LastClassPick null def %/LastInstPick null def %/LastMethodPick null def %/LastVarPick null def % %/ClassPick % x y => - %{ % userdict begin % Font15 setfont % LastClassPick null ne % { % null SetMethodPick % null SetVarPick % null SetInstPick % gsave % %(unhilite %\n) [ LastClassPick ] dbgprintf % /getcanvas ClassPic send setcanvas % 0 ClassPic /BufferHeight get % LastClassPick 1 add 18 mul sub 3 sub 300 18 rectpath % ClassColor setcolor fill % 0 0 0 rgbcolor setcolor % 5 ClassPic /BufferHeight get % LastClassPick 1 add 18 mul sub moveto ClassKeys % LastClassPick get show % grestore % } if % % 10 dict begin % /y exch def % /x exch def % % %% put scroll bars back to top % 0 /setvalue InstPic /VScrollbar get send % 0 /setvalue MethodPic /VScrollbar get send % 0 /setvalue VarPic /VScrollbar get send % 0 /setvalue TextPic /VScrollbar get send % % /k ClassPic /BufferHeight get y sub 18 div floor def % %(pick is % \n ) [ k ] dbgprintf % k ClassKeys length 1 sub le % { % %(pick is % \n ) [ ClassKeys k get ] dbgprintf % /getcanvas ClassPic send setcanvas % %(hilite %\n) [ k ] dbgprintf % 0 ClassPic /BufferHeight get k 1 add 18 mul sub 3 sub 300 18 rectpath % 0 0 0 rgbcolor setcolor fill % ClassColor setcolor % 0 5 ClassPic /BufferHeight get % k 1 add 18 mul sub moveto ClassKeys k get show % /updatecanvas ClassPic send % [] MethodColor MethodPic ShowArray % [] VarColor VarPic ShowArray % [] InstColor InstPic ShowArray % [] TextColor TextPic ShowArray % [ % (CLASS ") ClassKeys k get 256 string cvs (") append append % ClassVals k get /ParentDictArray known % { % ClassVals k get /ParentDictArray get % ParentDictArray % { % /ClassName get 256 string cvs ( ) exch append % } forall % } if % ] TextColor TextPic ShowArray % ClassVals k get DoMethods % ClassVals k get DoVars % ClassVals k get DoInsts % k % } % { % /updatecanvas ClassPic send % null % } ifelse % end % /LastClassPick exch def % % end %} def % %/SetInstPick {pop} def %/SetInstPick % newpick => - %{ % userdict begin % Font15 setfont % LastInstPick null ne % { % gsave % /getcanvas InstPic send setcanvas % 0 InstPic /BufferHeight get % LastInstPick 1 add 18 mul sub 3 sub 300 18 rectpath % InstColor setcolor fill % 0 0 0 rgbcolor setcolor % 5 InstPic /BufferHeight get LastInstPick 1 add 18 mul sub moveto % InstKeys LastInstPick get show % grestore % } if % /LastInstPick exch def % pick up newpick % %% (new InstPick is % \n ) [ LastInstPick ] dbgprintf % LastInstPick null ne % { % /getcanvas InstPic send setcanvas % 0 InstPic /BufferHeight get % LastInstPick 1 add 18 mul sub 3 sub 300 18 rectpath % 0 0 0 rgbcolor setcolor fill % InstColor setcolor % 0 5 InstPic /BufferHeight get LastInstPick 1 add 18 mul sub moveto % InstKeys LastInstPick get show % } if % /updatecanvas InstPic send % LastInstPick null ne % { % [] TextColor TextPic ShowArray % [ % (INSTANCE VARIABLE) % ( ") InstKeys LastInstPick get 256 string cvs (") % append append append % InstVals LastInstPick get type % { % /arraytype { () InstVals LastInstPick get ExpandArray } % /dicttype { () InstVals LastInstPick get ExpandDict } % /Default {() InstVals LastInstPick get 256 string cvs append} % } % case % ] TextColor TextPic ShowArray % } if % end %} def %/InstPick %{ % null SetMethodPick % null SetVarPick % userdict begin % % 10 dict begin % /y exch def % /x exch def % /k InstPic /BufferHeight get y sub 18 div floor def % % %% put text scroll bar back to top % 0 /setvalue TextPic /VScrollbar get send % % %% (pick is % \n ) [ k ] dbgprintf % k dup % end % InstKeys length 1 sub le % { SetInstPick } % { pop } % ifelse % end %} def % %/ExpandArray { % string array => strings [ rhess ] % ArrayDepth 0 eq % { exch ({) append exch % /ArrayDepth ArrayDepth 1 add def % () ArrayDepth { ( ) append } repeat exch } % { exch () ArrayDepth { ( ) append } repeat % 2 copy eq % { pop ({ ) append exch } % { ({ ) append 3 -1 roll } % ifelse % /ArrayDepth ArrayDepth 1 add def } % ifelse % { % dup type /arraytype eq % { % ExpandArray % } % { % cvlit 256 string cvs append ( ) append % dup stringwidth pop 700 gt { % () ArrayDepth { ( ) append } repeat % } if % } ifelse % } forall % /ArrayDepth ArrayDepth 1 sub def % ArrayDepth 0 eq % { (}) } % { (}) append % () ArrayDepth { ( ) append } repeat } % ifelse %} def % %/ExpandDict { % dict => strings % { % 256 string cvs ( ) exch append exch % 256 string cvs ( ) exch append % { dup stringwidth pop 250 lt { ( ) append } { exit } ifelse } loop % exch append % } forall %} def % %/SetMethodPick % newpick => - %{ % userdict begin % Font15 setfont % LastMethodPick null ne % { % gsave % /getcanvas MethodPic send setcanvas % 0 MethodPic /BufferHeight get % LastMethodPick 1 add 18 mul sub 3 sub 300 18 rectpath % MethodColor setcolor fill % 0 0 0 rgbcolor setcolor % 5 MethodPic /BufferHeight get LastMethodPick 1 add 18 mul sub moveto % MethodKeys LastMethodPick get show % grestore % } if % /LastMethodPick exch def % pick up newpick % %% (new MethodPick is % \n ) [ LastMethodPick ] dbgprintf % LastMethodPick null ne % { % /getcanvas MethodPic send setcanvas % 0 MethodPic /BufferHeight get % LastMethodPick 1 add 18 mul sub 3 sub 300 18 rectpath % 0 0 0 rgbcolor setcolor fill % MethodColor setcolor % 0 5 MethodPic /BufferHeight get LastMethodPick 1 add 18 mul sub moveto % MethodKeys LastMethodPick get show % } if % /updatecanvas MethodPic send % LastMethodPick null ne % { % [] TextColor TextPic ShowArray % [ % (METHOD ") MethodKeys LastMethodPick get % 256 string cvs (") append append % () MethodVals LastMethodPick get ExpandArray % ] TextColor TextPic ShowArray % } if % end %} def %/MethodPick %{ % null SetVarPick % null SetInstPick % userdict begin % % 10 dict begin % /y exch def % /x exch def % /k MethodPic /BufferHeight get y sub 18 div floor def % % %% put text scroll bar back to top % 0 /setvalue TextPic /VScrollbar get send % % %% (pick is % \n ) [ k ] dbgprintf % k dup % end % MethodKeys length 1 sub le % { SetMethodPick } % { pop } % ifelse % end %} def % %/SetVarPick % newpick => - %{ % userdict begin % Font15 setfont % LastVarPick null ne % { % gsave % /getcanvas VarPic send setcanvas % 0 VarPic /BufferHeight get % LastVarPick 1 add 18 mul sub 3 sub 300 18 rectpath % VarColor setcolor fill % 0 0 0 rgbcolor setcolor % 5 VarPic /BufferHeight get LastVarPick 1 add 18 mul sub moveto % VarKeys LastVarPick get show % grestore % } if % /LastVarPick exch def % pick up newpick % %% (new VarPick is % \n ) [ LastVarPick ] dbgprintf % LastVarPick null ne % { % /getcanvas VarPic send setcanvas % %(hilite %\n) [ LastVarPick ] dbgprintf % 0 VarPic /BufferHeight get % LastVarPick 1 add 18 mul sub 3 sub 300 18 rectpath % 0 0 0 rgbcolor setcolor fill % VarColor setcolor % 0 5 VarPic /BufferHeight get LastVarPick 1 add 18 mul sub moveto % VarKeys LastVarPick get show % } if % /updatecanvas VarPic send % LastVarPick null ne % { % [] TextColor TextPic ShowArray % [ % (CLASS VARIABLE) % ( ") VarKeys LastVarPick get 256 string cvs (") % append append append % VarVals LastVarPick get type % %dup (type was %\n) [ 3 2 roll ] dbgprintf % { % /arraytype { () VarVals LastVarPick get ExpandArray } % /dicttype { () VarVals LastVarPick get ExpandDict } % /Default { () VarVals LastVarPick get 256 string cvs append } % } % case % ] TextColor TextPic ShowArray % } if % end %} def %/VarPick %{ % null SetMethodPick % null SetInstPick % % userdict begin % 10 dict begin % /y exch def % /x exch def % /k VarPic /BufferHeight get y sub 18 div floor def % % %% put text scroll bar back to top % 0 /setvalue TextPic /VScrollbar get send % % %% (pick is % \n ) [ k ] dbgprintf % k dup % end % % VarKeys length 1 sub le % { SetVarPick } % { pop } % ifelse % end %} def % %BrowserPopup killprocess % [ rhess ] % %CreateBrowser % [ rhess ] % %end % %% ------------------------------------------------------------------------ SHAR_EOF fi # end of overwriting check # End of shell archive exit 0 ------------------------------------------------------------------------------- WHO: Richard Hess BELL: [415] 940-1400 [ext.342] TITLE: Project Manager CORP: Consilium [ User Interface Services ] SNAIL: 1945 Charleston Road UUCP: ...!uunet!cimshop!rhess Mountain View, CA 94043 ------------------------------------------------------------------------------- From don@brillig.umd.edu Wed Nov 2 17:12:45 1988 Date: Wed, 2 Nov 88 17:12:45 EST To: NeWS-makers@brillig.umd.edu Subject: "User Interface Toolkit in Object-Oriented Postscript" From: Mark Richer Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have a reminder to look for an article titled "User Interface Toolkit in Object-Oriented Postscript" by Densmore, et al in COmputer Graphics Forum. I don't have access to this journal (despite my Stanford account, I am no longer at or near Stanford so going to the CS library there is not a practical suggestion). Does someone have a net address or US mail address for Densmore or one of the other authors? I was thinking of requesting a copy of the paper directly from one of the authors. Thanks, Mark Richer 1041 Lake Street San Francisco, CA 94118 ------- From don@brillig.umd.edu Wed Nov 2 18:12:18 1988 Date: Wed, 2 Nov 88 18:12:18 EST To: NeWS-makers@brillig.umd.edu Subject: "User Interface Toolkit in Object-Oriented Postscript" From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's an old message with info about the paper you're looking for. You should be able to order the proceedings with the paper from the USENIX association. In any case, Owen's address is "owen@sun.com". -Don From don@brillig.umd.edu Sat Mar 28 00:54:49 1987 Date: Sat, 28 Mar 87 00:54:49 EST From: NeWS-makers-request@brillig.umd.edu Sender: don@brillig.umd.edu Errors-To: NeWS-makers-request@brillig.umd.edu To: news-makers@brillig.umd.edu Subject: SunDew paper, and USENIX Proceedings A paper by James Gosling about SunDew (now known as NeWS), called "SunDew: A Distributed and Extensible Window System", appears in the book "Methodology of Window Management" (ed. F.R.A. Hopgood, Springer-Verlag (1985)), which is the proceedings of an Alvey Workshop held in April of 1985, in Abingdon, UK. It contains papers by Gosling, Rosenthal, and Teitelman, and others, about several window systems, including SunDew, SunWindows, Andrew, SmallTalk, Pilot, Cedar, Saphire, and more. Owen Densmore's paper, "Object Oriented Programming in NeWS" appears in the Monterey Graphics Proceedings (Nov. 1986). Article 59 of comp.org.usenix: From: peter@usenix.UUCP (Peter Salus) Subject: USENIX Proceedings Keywords: USENIX, Proceedings, Graphics, Washington DC Date: 18 Feb 87 18:02:15 GMT Organization: USENIX Association, El Cerrito, CA There have been several inquiries concerning USENIX proceedings. The Washington, DC, Proceedings are available at $20/copy, US and Canadian postage included. For *overseas* delivery add $5/copy surface mail, $25/copy airmail. The Monterey Graphics Proceedings (Nov. 1986) are available at $10/copy; plus $5/copy overseas surface mail, $15/copy airmail. All orders must be prepaid in US dollars (checks payable on a US bank). Orders should be sent to USENIX Association PO Box 7 El Cerrito, CA 94530 All other USENIX proceedings (*except* San Diego, 1983, and Toronto, 1983) are still available, though the numbers still available vary widely. There is a full list in each bimonthly issue of ;login:. If you need further information, inquire of usenix!office or phone 415-528-UNIX. There are also some (not many) back issues of ;login: available at $3/copy. Peter H. Salus Executive Director From don@brillig.umd.edu Wed Nov 2 18:14:38 1988 Date: Wed, 2 Nov 88 18:14:38 EST To: NeWS-makers@brillig.umd.edu Subject: Terminal emulator for NeWS window system From: bbn.com!rsalz@bbn.com (Rich Salz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) [ I have been asked, as part of the posting for "psterm" in the Usenet newsgroup comp.sources.unix to post this announcement here. My apologies to John Gilmore and company for losing some of their exact wording. -rich $alz ] The Grasshopper Group took Sun's psterm and worked it over to make a much better terminal emulator for NeWS. We also worked with Sun to clarify the copyright to make it clear that it can be redistributed by anyone on any machine. This package has been posted to the Usenet newsgroup comp.sources.unix, which is available as the mailing list unix-sources@brl.mil (contact unix-sources-request@brl.mil). This note is being posted as a followup-to the source posting; vnews users can use "p" to get to the code. This psterm has: scroll bars whole screen font changes and variable width fonts whole screen point size changes resizing can change rows/cols *or* point size rectangular and "hot" selections numerous bug fixes (more will be needed) The Grasshopper Group modifications to psterm are by Eric Messick, from designs by ||ugh Daniel & Eric Messick. The installation has been tested on SunOS4.0 on Sparc and 68020 and A/UX on the Machintosh-II. We encourage you to use and improve it; send us back the changes. Send flowers, brickbats, picture postcards and diff files to: tech@toad.com or to Grasshopper Group, 212 Clayton St., San Francisco, CA 94117. -- Please send comp.sources.unix-related mail to rsalz@uunet.uu.net. From don@brillig.umd.edu Wed Nov 2 22:48:01 1988 Date: Wed, 2 Nov 88 22:48:01 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Dithering From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > Automatic dithering in NeWS is a great feature, BUT, > I want to turn it OFF sometimes so I can display > images that reflect the actual data. > > How can I turn off the dithering when rendering > a canvas in a window? This has been a popular question. NeWS has a static color table. When you bring in a foreign 8 bit color image, it simply picks close colors. 24 bit files are dithered into the static color table. I don't believe there is any dither taking place for 8 bit images. The only solution would be to somehow change the color lookup table on the display, without the help of NeWS. Of course everything else on the display will look like junk. -greg. From don@brillig.umd.edu Fri Nov 4 15:02:16 1988 Date: Fri, 4 Nov 88 15:02:16 EST To: NeWS-makers@brillig.umd.edu Subject: Dithering From: russ%yummy@gateway.mitre.org Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >> Automatic dithering in NeWS is a great feature, BUT, >> I want to turn it OFF sometimes so I can display >> images that reflect the actual data. > I don't believe there is any dither taking place for 8 bit images. It's more the "smoothing" between pixels that is disastering our stuff. If you create a canvas of (basically) random color pixels, when you render a magnified version you get odd star bursts of colors and other odd things !?! Sometimes we need to just have pixel replication so we get squares of color. Right now we have to draw individual squares which tends to be deathly slow. Is there anyway to turn off the interpolating feature (?) so we can quickly render what the computer is taking as random arrays of colors? From don@brillig.umd.edu Sun Nov 6 00:26:08 1988 Date: Sun, 6 Nov 88 00:26:08 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Dithering From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >It's more the "smoothing" between pixels that is disastering our stuff. If you create >a canvas of (basically) random color pixels, when you render a magnified version >you get odd star bursts of colors and other odd things !?! Sometimes we need >to just have pixel replication so we get squares of color. Right now we have >to draw individual squares which tends to be deathly slow. > >Is there anyway to turn off the interpolating feature (?) so we can quickly render >what the computer is taking as random arrays of colors? If you use the NeWS static color table your colors will not be touched. There are 2 ways to get this table, either use adb and grab 256 chars after red_map, blue_map, green_map, or dump a color image file with writecanvas and grab its colortable. If you blow the image up with writecanvas, limit the scale factor to whole integer multiples of the original width and height. Since the Sun implementation simply grabs more pixel as you scale, you will get the affect of enlarged pixels. Note: this has the bad point of making your code specific to a particular NeWS implementation. The correct way would be to enlarge the bitmaps on the lient size and send over the images with a 1to1 transformation to screen pixels. -greg. From don@brillig.umd.edu Mon Nov 7 18:44:34 1988 Date: Mon, 7 Nov 88 18:44:34 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS for PC's From: mcvax!enea!naggum!isncr!m2cs!frode@uunet.uu.net (Frode Odegard) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We're looking for the supplier of the NeWS ports to OS/2 and XENIX on PC's. We have all sorts of questions about performance, network support and support for different graphics adapters. So.. can anyone give me a company name or perhaps even an address?? - Frode From don@brillig.umd.edu Wed Nov 9 02:17:27 1988 Date: Wed, 9 Nov 88 02:17:27 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS for PC's From: wind!naughton@sun.com (Patrick Naughton) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <105@m2cs.naggum.se> frode@m2cs.naggum.se (Frode Odegard) writes: >We're looking for the supplier of the NeWS ports to OS/2 and XENIX >on PC's. We have all sorts of questions about performance, network >support and support for different graphics adapters. > >So.. can anyone give me a company name or perhaps even an address?? > - Frode These guys gave an impressive demo of NEWS 1.1 running on a monochrome Compaq 386 running OS/2 at Sun last month. Here's the info off a business card I was given: Maurice Balick, Chairman Architech Corporation 850 Carroll Street Brooklyn, New York 11215 (718) 622-8577 ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@Sun.COM Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080 From don@brillig.umd.edu Wed Nov 9 02:17:45 1988 Date: Wed, 9 Nov 88 02:17:45 EST To: NeWS-makers@brillig.umd.edu Subject: server stuff in upper case mode From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Occasionally the server gets stuff only printing upper case characters. Does anyone a work around to unstick the server? Thanks in advance. Eric Marshall Software Productivity Consortium 1880 North Campus Commons Drive Reston, VA 22091 (703) 391-1838 CSNET: marshall@software.org ARPANET: marshall%software.org@relay.cs.net OR @relay.cs.net:marshall@software.org ------------------------------------------------------------------------------ The OSF. Just say NO. From don@brillig.umd.edu Wed Nov 9 07:35:32 1988 Date: Wed, 9 Nov 88 07:35:32 EST To: NeWS-makers@brillig.umd.edu Subject: Timeout Error under Psh, news 1.1 From: sun.soe.clarkson.edu!bkc@tcgould.tn.cornell.edu (Brad Clements) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We recently upgraded from NeWS 1.0 to 1.1 Several PostScript 'programs' that used to work under version 1, psh, now return Timeout Error under version 1.1 There is a lot of computation going on in the PostScript code and I'm wondering if the Psh is not waiting for the news server to finish. Does anyone know what causes this and how I can fix it, we (strangely enough) don't have any documentation for 1.1 yet (its in the mail) Brad Clements Clarkson University From don@brillig.umd.edu Thu Nov 10 20:22:12 1988 Date: Thu, 10 Nov 88 20:22:12 EST To: NeWS-makers@brillig.umd.edu Subject: Grasshopper psterm From: aramis.rutgers.edu!geneva.rutgers.edu!hedrick@rutgers.edu (Charles Hedrick) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've been using the new psterm from the Grasshopper group since about 5 minutes after we got the posting. (I was desperate for a reasonable terminal emulator.) I appreciate the work, and I'm generally very pleased with the way it works. However I've got a few problems, and I'm curious whether anybody knows what's going on. First, it feels slow. I'm not all that concerned about how long NeWS takes to do complex operations. However when I type I'm very sensitive to echo delay. The old psterm and Gnu Emacs with NeWS support don't cause me any trouble, but the new psterm causes just enough echo delay to be annoying. Second, I have trouble exiting. With the old psterm, and all other NeWS programs, when I kill the program, the window goes away. With the new psterm, I can't get rid of the window. Neither exiting from the shell inside it, doing "zap" in the menu, nor killing the process helps. I can make "zap" work by modifying psterm.ps, but I still can't make it go away if I exit from the shell. The modification to make zap work is to add the two lines with /Mapped false below: /destroy { /Scrollbar null def IconCanvas /Mapped false put FrameCanvas /Mapped false put /destroy super send } def Finally, if I try it with retained windows disabled, results are a bit odd. As long as the window is on top, things work fine. But if it's occluded, I tend to have whole lines of text missing. From don@brillig.umd.edu Thu Nov 10 20:23:00 1988 Date: Thu, 10 Nov 88 20:23:00 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Grasshopper psterm From: jcricket!sjs@bellcore.com (Stan Switzer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) hedrick@geneva.rutgers.edu (Charles Hedrick) writes: > First, it feels slow. I'm not all that concerned about how long NeWS > takes to do complex operations. However when I type I'm very > sensitive to echo delay. The old psterm and Gnu Emacs with NeWS > support don't cause me any trouble, but the new psterm causes just > enough echo delay to be annoying. I don't exactly like to look a gift horse in the mouth, but I'd have to agree. Don't take this too hard Grasshopper, but the extended psterm isn't really any closer to "production quality" than the original was. True, the new features are nifty, but it's still rough around the edges. > .... I can make "zap" work by modifying psterm.ps, but I still > can't make it go away if I exit from the shell. The modification > to make zap work is to add the two lines with /Mapped false below: > /destroy { > /Scrollbar null def > IconCanvas /Mapped false put > FrameCanvas /Mapped false put > /destroy super send > } def I STRONGLY recommend against this. It cures the symptom but not the disease. If the canvas stays visible it is because some reference remains, and if, as you said later, the canvas is retained, then there is a good bit of memory tied up in that canvas--especially in color. Unless you actually lose every reference, you are just hiding a massive memory leakage. Probably there is a reference loop among the dictionaries used in the program. I'd whip out Don's Hopkins' amazing "Pseudo-Scientific Visualizer" (the class browser for the other half of your brain) to debug this one if I were you. But I'm not -- I have other fish to fry. Oh, and while I'm at it, here's one more person who'd LOVE to have someone from Adobe post a technical summary of the new features in Display Postscript. I mean, unless you post some actual information, you are just as bad as the Eiffel partisans sniping in the C++ newsgroup. (Too bad, too, Eiffel is a decent language, though you'd never know it from the postings.) You guys at Adobe do good work -- let us in on it. Stan Switzer sjs@ctt.bellcore.com "A verb, Senator Kennedy, we need a verb!" From don@brillig.umd.edu Fri Nov 11 21:05:34 1988 Date: Fri, 11 Nov 88 21:05:34 EST To: NeWS-makers@brillig.umd.edu Subject: Adobe Display PostScript documentation available From: adobe!ondine!greid@decwrl.dec.com (Glenn Reid) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We have published an alpha version of the Display PostScript system documentation. It is available directly from Adobe for $30.00. It is a three-ring binder with approximately 300 pages of detailed information. The PostScript language extensions are all documented, along with the rest of the system componenets, including the Client Library, the "pswrap" utility, and the color operators. Also included is a short Perspective for Developers, which gives a good overview of the system. Please send a [good] check or money order to: DPS Reference Manual Offer Adobe Systems Incorporated 1585 Charleston Road P.O. Box 7900 Mountain View, CA 94039-7900 Also mention if you are interested in an application form for our Adobe Developers' Association, to stay informed. Glenn Reid Adobe Systems Incorporated Developer Tools & Strategies From don@brillig.umd.edu Sat Nov 12 04:17:49 1988 Date: Sat, 12 Nov 88 04:17:49 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Adobe Display PostScript documentation available From: trevor@media-lab.media.mit.edu (Trevor Darrell) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <4290@adobe.COM> greid@ondine.UUCP (Glenn Reid) writes: >We have published an alpha version of the Display PostScript system >documentation. It is available directly from Adobe for $30.00. It is ... >Library, the "pswrap" utility, and the color operators. Also included >is a short Perspective for Developers, which gives a good overview of >the system. Could someone please post something similar to this ``perspectives for developers'' to summarize the nature of the PostScript extensions present in Display PostScript? Perhaps Abode could post the article directly. There is much curiosity about the nature of windowing extensions to PostScript (w.r.t NeWS and other implementations) and it would certainly be a service to provide some accurate information about Display PostScript for the various dicussions to chew on rather than the usual 2rd hand impressions... --trevor From don@brillig.umd.edu Mon Nov 14 05:47:16 1988 Date: Mon, 14 Nov 88 05:47:16 EST To: NeWS-makers@brillig.umd.edu Subject: Bug-fix for psterm From: joyce!cslb!porthos!aida@ames.arc.nasa.gov (Hitoshi Aida) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The behavior of automatic scrolling in psterm (terminal emulator in NeWS) is not correct after setting scroll region. Here is fix. *** tcap_ops.c Fri Nov 11 16:55:46 1988 --- tcap_ops.c.org Mon Feb 22 11:00:55 1988 *************** *** 1101,1110 **** return; } } ! if (Dot.y == BottomLineOfScrollRegion) ! sf_op(t); ! else if (Dot.y < LinesPerScreen - 1) Dot.y++; MoveCursor(); } --- 1101,1111 ---- return; } } ! if (Dot.y < LinesPerScreen - 1) Dot.y++; + else { + sf_op(t); + } MoveCursor(); } -------- Hitoshi AIDA (aida@csl.sri.com) Computer Science Laboratory, SRI International From don@brillig.umd.edu Mon Nov 14 19:45:03 1988 Date: Mon, 14 Nov 88 19:45:03 EST To: NeWS-makers@brillig.umd.edu Subject: Porting NeWS to HP9000/350's From: Knut Skog Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We are contemplating porting NeWS to some HP9000/350 mashines. Is there anyone out there who will share their experiance with us. How much time does it takes to complete the port and keep it updated, assuming the job beeing done by qualified systems people? Much obliged Knut Skog From don@brillig.umd.edu Tue Nov 15 11:12:38 1988 Date: Tue, 15 Nov 88 11:12:38 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Porting NeWS to HP9000/350's From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >We are contemplating porting NeWS to some HP9000/350 mashines. >Is there anyone out there who will share their experiance with us. >How much time does it takes to complete the port and keep it updated, >assuming the job beeing done by qualified systems people? Assuming you have a solid C compiler, it can take anywhere from 2 weeks to months of effort, depending on the display device. 2 weeks being for a dumb framebuffer. You can get something running in a under a month on a smart framebuffer, but you will spend alot of time getting desirable performance. I've done one of each, so if you get started, I'll be happy to answer more detailed questions. We must all do our part to stop the evil spread of X11, unless of course we are getting paid to do X11 programming. I wish Sun would put some real effort into the product to make at least technically equal to Display PostScript with NeXT extensions. (Bug fixes, and real fonts, real thickline code) -greg.