From don@brillig.umd.edu Tue Nov 15 11:13:17 1988 Date: Tue, 15 Nov 88 11:13:17 EST To: NeWS-makers@brillig.umd.edu Subject: Looking for info on a NeWS equivilent to TTY windows From: aplcen!aplcomm!aplpy.jhuapl.edu!mws@mimsy.umd.edu (Michael W. Stalnaker) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm looking for a way to open a terminal window in NeWS and send data to and from it from a C program: eg: fork a terminal window with a shell session, and grab it's stdin and stdout so I can send data to the shell, but have the results visible in the window. If anybody has any ideas on this, I'd love to hear about it. --Mike Stalnaker mws@aplvax.jhuapl.edu From don@brillig.umd.edu Tue Nov 15 16:40:04 1988 Date: Tue, 15 Nov 88 16:40:04 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Grasshopper psterm From: munnari!bruce!goanna!ajk@uunet.uu.net (Alan Kent) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have had problems with its screen redrawing. If I get a full page of output before it starts to draw it, it seems to just not bother doing any output. Quite often I do a ls -l but all I get out is the next prompt, or a few lines of output if I am lucky. I only have 4megs on a Sun 3/60 (and NeWS 1.1) so NeWS runs pretty slow (it pages to death). When I rlogin to a faster machine its quite easy to get large backlogs in output. vi on the remote machines also messes up quite frequently (probably due to same reason). I have not tried toggling the fast-redraw option yet, but it would be better if psterm worked properly in the first place. Overall it looks good, but still a little buggy. Alan Kent Dept. of Comp. Sci, RMIT, ACSnet: ajk@goanna.cs.rmit.oz.au GPO BOX 2476 V, ARPA: ajk%goanna.cs.rmit.oz.au@uunet.uu.net Melbourne, 3001 CSNET: ajk%goanna.cs.rmit.oz.au@australia AUSTRALIA UUCP: ...!uunet!goanna.cs.rmit.oz.au!ajk From don@brillig.umd.edu Tue Nov 15 16:40:14 1988 Date: Tue, 15 Nov 88 16:40:14 EST To: NeWS-makers@brillig.umd.edu Subject: Fun with forkunix From: steinmetz!vdsvax!montnaro@uunet.uu.net (Skip Montanaro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've been trying to get around a bug in NeWS that makes starting programs from user.ps unreliable. (It's bug #1004790. It's been around since NeWS 1.0 and is still present in 1.1. I'll send the workaround to anyone interested.) The symptom is that when starting programs from user.ps, such as: (psterm -ls -bg -li 16 -co 80 -sl 128 -C) forkunix (emacs) forkunix sometimes the windows show up, but most times not. Sometimes it appears that only the first command doesn't get run, so I reasoned, what's the simplest command forkunix might accept so I could use it as a sacrificial command (as it were)? The empty string! I tried executing () forkunix from a psh session and got a core file plus some pyrotechnics, apparently due to gazillions of newlines sent to whatever window the cursor was in. I eventually had to kill and restart the NeWS server to get straightened out again. When running the -debug version of the server, the screen mangling disappeared, but the core file remained. This appears to be a bug in the implementation of forkunix (passing a NULL to strchr()). It should be more graceful in the face of such (admittedly stupid) input. I've posted an official bug report to hotline@sun.com. -- Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa) From don@brillig.umd.edu Wed Nov 16 06:08:50 1988 Date: Wed, 16 Nov 88 06:08:50 EST To: NeWS-makers@brillig.umd.edu Subject: psterm and neatwin bug fixes From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's a fix for psterm to make it work with neatwin.ps, or any other window class that doesn't have its own BorderRight class variable: In psterm.ps, in the definition of the PSTermWindow class: replace "DefaultWindow /BorderRight get" with "/BorderRight DefaultWindow send". Also there is a bug in netwin.ps that is tickled by psterm's overriding the flipiconic method. (Which neatwin should use but doesn't.) The fix: Replace the definition of the /flipmove method in neatwin.ps with the following: /flipmove { gsave flipiconic framebuffer setcanvas CurrentEvent begin XLocation YLocation end Iconic? { exch IconWidth 2 div sub exch IconHeight 2 div sub } { exch FrameWidth 2 div sub exch FrameHeight 2 div sub } ifelse move slide grestore } def -Don From don@brillig.umd.edu Thu Nov 17 00:11:58 1988 Date: Thu, 17 Nov 88 00:11:58 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS 1.1 on Apollo? From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does anyone know if NeWS 1.1 has been ported to the Apollo? I know NeWS 1.0 was. 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 Thu Nov 17 18:26:48 1988 Date: Thu, 17 Nov 88 18:26:48 EST To: NeWS-makers@brillig.umd.edu Subject: Gosling's NeWS book due out in 2/89 ... From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The recent CACM lists Gosling's NeWS book due out in February 1989 at a tentative price of $39. Does anyone know if copies will show up at the upcoming Miami SUG? 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 Fri Nov 18 08:43:15 1988 Date: Fri, 18 Nov 88 08:43:15 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Editor theorems From: vsedev!logan@uunet.uu.net (James Logan III) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <335@swbatl.UUCP> iso@swbatl.UUCP (SWBT Info Systems Guest Acct) writes: >I'm looking for pointers to info about editors (both character and bit-mapped). >Things like best time/space complexity for screen updates, inserts, deletes, >and so on. I'll be happy to summarize to the net if there's enough interest. >In general, I'd like to find out what theorems/proofs, if any, have been >developed. I am also interested. Please post to the net. -Jim -- Jim Logan logan@vsedev.vse.com (703) 892-0002 uucp: ..!uunet!vsedev!logan inet: logan%vsedev.vse.com@uunet.uu.net From don@brillig.umd.edu Fri Nov 18 08:43:41 1988 Date: Fri, 18 Nov 88 08:43:41 EST To: NeWS-makers@brillig.umd.edu Subject: psterm (NeWS terminal emulator) "official" patch #1 From: mailrus!cwjcc!hal!nic.MR.NET!xanth!hoptoad!gnu@purdue.edu (John Gilmore) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This context diff updates the original posted version of psterm (version Grass-1, patch level 0) to patch level 1. IMPORTANT: Before performing these changes, cd to the psterm source directory and execute the command: mv psterm.ps psterm_1.ps *then* apply the patches using "patch -p": patch -p < [thisfilename] The mv command is because we made the psterm.ps file name version- specific, so that different versions of psterm can coexist on the same server. If you have installed the patchlevel 0 version of psterm, you can leave the original psterm.ps file installed in /usr/NeWS/lib on the server, in case any patchlevel 0 psterm binaries connect to your server. People who have never installed patchlevel 0, or who have replaced all the level 0 binaries, only need a copy of psterm_1.ps in /usr/NeWS/lib, since you don't expect any level 0 psterms to try to connect to this machine. See the patch to the BUGS file below. Changes in this patch #1 The psterm.ps file has been renamed to psterm_1.ps, and it creates a PostScript dictionary named PSTermDict_1. The "1" will be incremented in future releases if the interface between the psterm binary and the psterm PostScript code changes. This change allows multiple versions of psterm to coexist on the same screen (e.g. due to terminal sessions from different hosts). If psterm_V.ps [V = version number] does not exist on the server's system, the client side now attempts to copy the local version across the network. This permits psterm to be run with no change to the server machine -- it can just be installed on the client(s) -- and further improves multiple version compatability. Optionally installing psterm_V.ps on the server improves performance slightly the first time you run psterm. The installation section of the Makefile has been expanded to chown and chgrp to bin the files it installs; it also chmod's the files to known modes. The procedure also correctly installs on System V systems where a ``busy'' text file cannot be deleted. Two bugs in -ixy are fixed. A bug which caused psterm to fail if DefaultWindow was a subclass of LiteWindow (instead of LiteWindow itself) is fixed. The iconcanvas is now reshaped in the same manner as it is in LiteWindow. Both methods are correct. The server side now remembers how long the scrollbar is. A bug which caused the font size from -fs to be ignored if the font is specified with -F is fixed. A bug which caused the window to be opened about 35 points lower than specified by -xy is fixed. Some initialization code is rearranged to avoid timing problems in psterm.ps. The termcap and terminfo files are updated to remove the :ul: parameter, which should not be there. We also removed parentheses from the long terminal names, as they cause problems. We removed spurious Grasshopper copyright notices from the ref/config_* files. These files, like all the other Grasshopper changes, are public domain. We removed information from the ref/config_* files that wasn't relevant to psterm. They are rearranged to (hopefully) allow easier creation of new config files. Documentation and sample files have been updated. The patch level is upgraded from 0 to 1. Index: patchlevel.h Prereq: 0 diff -rc ./patchlevel.h ../psterm.update/patchlevel.h *** ./patchlevel.h Tue Nov 15 21:12:58 1988 --- ../psterm.update/patchlevel.h Tue Nov 15 21:41:47 1988 *************** *** 1 **** ! #define PATCHLEVEL 0 --- 1 ---- ! #define PATCHLEVEL 1 diff -rc ./psterm.tcap ../psterm.update/psterm.tcap diff -rc ./BUGS ../psterm.update/BUGS *** ./BUGS Tue Nov 15 21:12:58 1988 --- ../psterm.update/BUGS Tue Nov 15 21:41:47 1988 *************** *** 1,5 **** # Psterm Bug List ! # @(#)$Header: BUGS,v 1.3 88/10/03 18:57:58 gnu Release $ PSTerm was an experiment in general purpose terminal emulators. It was a very interesting experiment, and taught us how to do a few --- 1,5 ---- # Psterm Bug List ! # @(#)$Header: /u/eric/client/psterm/RCS/BUGS,v 1.4 88/11/15 21:38:58 eric Update $ PSTerm was an experiment in general purpose terminal emulators. It was a very interesting experiment, and taught us how to do a few *************** *** 61,63 **** --- 61,82 ---- worth the extra effort to fix. See the README file for more discussion of problems with the psterm concept. + + ------------------- + + COMPATABILITY PROBLEMS: + + All versions of psterm released by Grasshopper should not interfere with + the original Sun psterm. + + The version of psterm released (on floppy disk) with MacNews 1.1.01 is + incompatable with patchlevel 0. Windows from these two releases + cannot be freely intermingled on a single screen. + + Patchlevel 1 (and all later releases) should not interfere with any + previous or later versions released by Grasshopper. HOWEVER, versions + beyond patchlevel 0 will not support patchlevel 0. The file psterm.ps + must be retained in order to run patchlevel 0 psterms. Patchlevel 1 + does not contain a copy of psterm.ps. If you expect to encounter + patchlevel 0 psterms, make sure psterm.ps is installed in + /usr/NeWS/lib. diff -rc ./Makefile ../psterm.update/Makefile *** ./Makefile Tue Nov 15 21:12:59 1988 --- ../psterm.update/Makefile Tue Nov 15 21:41:48 1988 *************** *** 26,32 **** # # # @(#)Makefile.psterm 9.9 88/01/19 ! # @(#)$Header: Makefile,v 2.4 88/10/04 19:17:36 eric Release $ # # Copyright (c) 1987 by Sun Microsystems, Inc. # --- 26,32 ---- # # # @(#)Makefile.psterm 9.9 88/01/19 ! # @(#)$Header: /u/eric/client/psterm/RCS/Makefile,v 2.7 88/11/15 21:18:04 eric Update $ # # Copyright (c) 1987 by Sun Microsystems, Inc. # *************** *** 119,125 **** display.c SHAR3 = ref/config_aux \ ref/config_sunos \ ! psterm.ps \ selection.c \ sys5.c SHAR4 = tcap.cps \ --- 119,125 ---- display.c SHAR3 = ref/config_aux \ ref/config_sunos \ ! psterm_1.ps \ selection.c \ sys5.c SHAR4 = tcap.cps \ *************** *** 127,132 **** --- 127,134 ---- tcap_parse.c \ termcap.h + PSCODE = psterm_1.ps + all: psterm lint: tcap.h *************** *** 137,147 **** tcap.h: tcap.cps ! install: psterm psterm.ps ! rm -f ${BINDIR}/psterm ${LIBDIR}/psterm.ps cp psterm ${BINDIR} ! cp psterm.ps ${LIBDIR}/psterm.ps cp psterm.1 ${MANDIR}/psterm.${MANEXT} clean: rm -f *.o psterm tcap tcap.h *.BAK *~ --- 139,159 ---- tcap.h: tcap.cps ! install: psterm ${PSCODE} ! cd ${LIBDIR} ; rm -f ${PSCODE} ! cd ${BINDIR} ; mv psterm RemoveMe.$$$$ ; rm -f RemoveMe.$$$$ ! @echo You may have to remove ${BINDIR}/RemoveMe.\* manually on ! @echo systems which cannot delete busy text files cp psterm ${BINDIR} ! -chown bin ${BINDIR}/psterm ! -chgrp bin ${BINDIR}/psterm ! chmod 755 ${BINDIR}/psterm ! cp ${PSCODE} ${LIBDIR} ! -cd ${LIBDIR} ; chown bin ${PSCODE} ! -cd ${LIBDIR} ; chgrp bin ${PSCODE} ! cd ${LIBDIR} ; chmod 644 ${PSCODE} cp psterm.1 ${MANDIR}/psterm.${MANEXT} + chmod 644 ${MANDIR}/psterm.${MANEXT} clean: rm -f *.o psterm tcap tcap.h *.BAK *~ diff -rc ./README ../psterm.update/README *** ./README Wed Nov 16 00:29:31 1988 --- ../psterm.update/README Wed Nov 16 01:09:43 1988 *************** *** 7,18 **** it's best to use the "psterm" termcap entry unless you have special requirements. ! This is release Grass-1 of psterm from the Grasshopper Group. The ! original source from Sun Microsystems' NeWS 1.1 release is freely ! distributable under Sun's copyright, reproduced below. (Sun modified ! the copyright after the release, and supplied us the revised wording ! that is used here.) The modifications to that source which were made at ! the Grasshopper Group are in the public domain. The Grasshopper Group sells and supports NeWS-related products. Our first product is MacNews, a port of NeWS for A/UX on the Macintosh-II. --- 7,18 ---- it's best to use the "psterm" termcap entry unless you have special requirements. ! This is release Grass-1 (Patch Level 1) of psterm from the Grasshopper ! Group. The original source from Sun Microsystems' NeWS 1.1 release is ! freely distributable under Sun's copyright, reproduced below. (Sun ! modified the copyright after the release, and supplied us the revised ! wording that is used here.) The modifications to that source which ! were made at the Grasshopper Group are in the public domain. The Grasshopper Group sells and supports NeWS-related products. Our first product is MacNews, a port of NeWS for A/UX on the Macintosh-II. *************** *** 64,70 **** make install to install the psterm binary in /usr/NeWS/bin/psterm, the PostScript ! code in /usr/NeWS/lib/psterm.ps, and the man page in /usr/man/manl/psterm.l. Edit the Makefile if this is inappropriate on your system. A tutorial called UsingPSTerm is also included. --- 64,70 ---- make install to install the psterm binary in /usr/NeWS/bin/psterm, the PostScript ! code in /usr/NeWS/lib/psterm_1.ps, and the man page in /usr/man/manl/psterm.l. Edit the Makefile if this is inappropriate on your system. A tutorial called UsingPSTerm is also included. *************** *** 112,120 **** main.c argument processing, main() patchlevel.h revision level psterm.1 man page - psterm.ps PostScript code psterm.tcap termcap entries psterm.tinfo terminfo entries ref/config_aux A/UX specific configuration information ref/config_sunos SunOS configuration information sampl.pstermrc example .pstermrc file --- 112,120 ---- main.c argument processing, main() patchlevel.h revision level psterm.1 man page psterm.tcap termcap entries psterm.tinfo terminfo entries + psterm_1.ps PostScript code ref/config_aux A/UX specific configuration information ref/config_sunos SunOS configuration information sampl.pstermrc example .pstermrc file *************** *** 213,216 **** * Mountain View, California 94043 */ ! @(#)$Header: README,v 2.4 88/10/04 19:17:18 eric Release $ --- 213,216 ---- * Mountain View, California 94043 */ ! @(#)$Header: /u/eric/client/psterm/RCS/README,v 2.6 88/11/16 00:52:03 gnu Exp $ diff -rc ./UsingPSTerm ../psterm.update/UsingPSTerm *** ./UsingPSTerm Tue Nov 15 21:13:01 1988 --- ../psterm.update/UsingPSTerm Tue Nov 15 21:41:50 1988 *************** *** 6,12 **** by Eric Messick ! @(#)$Header: UsingPSTerm,v 2.1 88/10/03 18:17:14 eric Release $ Starting psterm. --- 6,12 ---- by Eric Messick ! @(#)$Header: /u/eric/client/psterm/RCS/UsingPSTerm,v 2.2 88/11/10 17:25:18 eric Update $ Starting psterm. *************** *** 137,147 **** Following the other command line options, you can specify a command ! and arguments to be executed in lieu of your shell. Starting psterm from a Menu The default root menu has entries for starting a psterm. These just --- 137,162 ---- Following the other command line options, you can specify a command ! and arguments to be executed in lieu of your shell. Several commands ! that are very useful are: + psterm /bin/login -p username + which opens a psterm window and prompts for username's password. The + -p tells login to pass the environment through, so your shell will + know what kind of terminal you're on. If you leave off the username: + psterm /bin/login -p + it will prompt for it. You can also connect to another host via tip: + + psterm tip hostname + + and when you get out of tip, the window will go away. + + + + Starting psterm from a Menu The default root menu has entries for starting a psterm. These just *************** *** 150,156 **** and redirects its stdin stdout and stderr, generally to /dev/null. When psterm sees that it has been started this way, it doesn't bother to fork itself (see -fg and -bg, above). You can create your own menu ! entries to do this in your .litewin.rc file. See the example files. --- 165,171 ---- and redirects its stdin stdout and stderr, generally to /dev/null. When psterm sees that it has been started this way, it doesn't bother to fork itself (see -fg and -bg, above). You can create your own menu ! entries to do this in your user.ps file. See the example files. *************** *** 188,194 **** wants to talk to, you need to make sure that the news_server is willing to talk back. You have to either get the remote host into the list of hosts that your local server will talk to, or set ! /NetSecurityWanted to false in you .litewin.rc. See the example files. --- 203,209 ---- wants to talk to, you need to make sure that the news_server is willing to talk back. You have to either get the remote host into the list of hosts that your local server will talk to, or set ! /NetSecurityWanted to false in your user.ps. See the example files. diff -rc ./display.c ../psterm.update/display.c *** ./display.c Tue Nov 15 21:13:10 1988 --- ../psterm.update/display.c Tue Nov 15 21:41:58 1988 *************** *** 38,44 **** #ifndef lint static char sccsid[] = "@(#)display.c 9.5 88/01/19 Copyright 1985 Sun Micro"; static char RCSid[] = ! "@(#)$Header: display.c,v 2.2 88/10/04 05:11:23 eric Release $"; #endif /* --- 38,44 ---- #ifndef lint static char sccsid[] = "@(#)display.c 9.5 88/01/19 Copyright 1985 Sun Micro"; static char RCSid[] = ! "@(#)$Header: display.c,v 2.3 88/11/08 19:35:07 eric Update $"; #endif /* *************** *** 362,367 **** --- 362,368 ---- PSFILE *f; char frametitle[100]; char host[100]; + char buf[2]; f = Connect_To_Server(); if (f==NULL) return NULL; *************** *** 369,374 **** --- 370,383 ---- PSDefs(reload); psio_flush(PostScript); + if (read(psio_fileno(PostScriptInput), buf, 2) != 2) { + perror("PostScriptInput"); + return NULL; + } + if (buf[0]!='y') + if (JamItDownTheSocket()) + return NULL; + if (framelabel == NULL) { static char te[] = " terminal emulator"; sprintf(frametitle, "%.*s%s", *************** *** 395,400 **** --- 404,431 ---- psio_flush(PostScript); return (f); } + + JamItDownTheSocket() + { + int f, nread; + char buf[4096], *s; + + if ((f=open("psterm_1.ps", O_RDONLY)) < 0) + if ((f=open("/usr/NeWS/lib/psterm_1.ps", O_RDONLY)) < 0) + Fatal("Cannot access %s", "psterm_1.ps"); + nread = read(f, buf, 4096); + while (nread>0) { + s = buf; + while(nread-- > 0) + psio_putc(*s++, PostScript); + nread = read(f, buf, 4096); + } + if (nread<0) + perror("psterm_1.ps"); + close(f); + return nread; + } + PostScriptErrorMessage(s) char *s; diff -rc ./main.c ../psterm.update/main.c *** ./main.c Tue Nov 15 21:13:09 1988 --- ../psterm.update/main.c Tue Nov 15 21:41:57 1988 *************** *** 37,43 **** #ifndef lint static char sccsid[] = "@(#)main.c 9.7 88/01/19 Copyright 1985 Sun Micro"; ! static char RCSid[] = "@(#)$Header: main.c,v 2.2 88/10/04 04:22:48 eric Release $"; #endif /* --- 37,43 ---- #ifndef lint static char sccsid[] = "@(#)main.c 9.7 88/01/19 Copyright 1985 Sun Micro"; ! static char RCSid[] = "@(#)$Header: main.c,v 2.3 88/10/25 12:57:34 eric Update $"; #endif /* *************** *** 180,186 **** if (--argc > 0) iconx = atoi(*++argv); if (--argc > 0) ! iconx = atoi(*++argv); if (iconx >= 0 && icony >= 0) continue; } --- 180,186 ---- if (--argc > 0) iconx = atoi(*++argv); if (--argc > 0) ! icony = atoi(*++argv); if (iconx >= 0 && icony >= 0) continue; } *** ./psterm.tcap Tue Nov 15 21:13:05 1988 --- ../psterm.update/psterm.tcap Tue Nov 15 21:41:54 1988 *************** *** 1,6 **** # ! # Grasshopper Group NeWS Termcaps 1.8 -HD 88/08/23 ! # @(#)$Header: psterm.tcap,v 2.1 88/09/23 19:12:35 hugh Release $ # # nterm is a fancy vt220 terminal emulator for the NeWS window system nt|nterm:\ --- 1,6 ---- # ! # Grasshopper Group NeWS Termcaps 2.0 -HD 88/10/24 ! # @(#)$Header: psterm.tcap,v 2.2 88/10/27 18:47:29 eric Update $ # # nterm is a fancy vt220 terminal emulator for the NeWS window system nt|nterm:\ *************** *** 17,23 **** :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ :ti=\E[2J\E[?47h:te=\E[?47l:im=\E[4h:ei=\E[4l:\ :ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E: ! nt|nterms|nterm terminal emulator (small)(NeWS window system):\ :co#80:li#24:tc=nterm: # # Termcap for NeWS's psterm from Eric Messick & Hugh Daniel --- 17,24 ---- :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\ :ti=\E[2J\E[?47h:te=\E[?47l:im=\E[4h:ei=\E[4l:\ :ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E: ! # Small nterm terminal emulator termcap ! nt|nterms|small nterm:\ :co#80:li#24:tc=nterm: # # Termcap for NeWS's psterm from Eric Messick & Hugh Daniel *************** *** 36,45 **** :me=\EN*:mr=\EOr:nd=\EV:pt:rc=\034:rs=\EN*:sc=\035:\ :se=\ENo:sf=\EW:sl=\EOl:so=\EOo:sr=\EX:te=\ENt:\ :ti=\EOt:ts=\EOl:ue=\ENu:\ ! :le=\ET:ll=\EU:ul:up=\EY:us=\EOu:vb=\EZ:\ :co#80:li#34: # This is a faster termcap for psterm, Warning: if you use this termcap ! # some control characters you type will do strange things to the screen. p1|psterm-fast:\ :am:bs:al=^A:cd=^B:ce=^C:cl=^L:cm=^D%d;%d;:cs=^E%d;%d;:\ :dc=^F:dl=^K:do=^P:ei=^Ni:el=^Nl:fs=^Nl:\ --- 37,47 ---- :me=\EN*:mr=\EOr:nd=\EV:pt:rc=\034:rs=\EN*:sc=\035:\ :se=\ENo:sf=\EW:sl=\EOl:so=\EOo:sr=\EX:te=\ENt:\ :ti=\EOt:ts=\EOl:ue=\ENu:\ ! :le=\ET:ll=\EU:up=\EY:us=\EOu:vb=\EZ:\ :co#80:li#34: # This is a faster termcap for psterm, Warning: if you use this termcap ! # some control characters you type will do strange things to the screen ! # on systems that echo typed control characters to the users terminal. p1|psterm-fast:\ :am:bs:al=^A:cd=^B:ce=^C:cl=^L:cm=^D%d;%d;:cs=^E%d;%d;:\ :dc=^F:dl=^K:do=^P:ei=^Ni:el=^Nl:fs=^Nl:\ *************** *** 49,54 **** :me=^N*:mr=^Or:nd=^V:pt:rc=\034:rs=^N*:sc=\035:\ :se=^No:sf=^W:sl=^Ol:so=^Oo:sr=^X:te=^Nt:\ :ti=^Ot:ts=^Ol:ue=^Nu:\ ! :le=^T:ll=^U:ul:up=^Y:us=^Ou:vb=^Z:\ :co#80:li#34: #### End of stuff added by Grasshopper Group --- 51,56 ---- :me=^N*:mr=^Or:nd=^V:pt:rc=\034:rs=^N*:sc=\035:\ :se=^No:sf=^W:sl=^Ol:so=^Oo:sr=^X:te=^Nt:\ :ti=^Ot:ts=^Ol:ue=^Nu:\ ! :le=^T:ll=^U:up=^Y:us=^Ou:vb=^Z:\ :co#80:li#34: #### End of stuff added by Grasshopper Group diff -rc ./psterm.tinfo ../psterm.update/psterm.tinfo *** ./psterm.tinfo Tue Nov 15 21:13:05 1988 --- ../psterm.update/psterm.tinfo Tue Nov 15 21:41:54 1988 *************** *** 1,6 **** # ! # Grasshopper Group NeWS Termcaps 1.9 -HD 88/9/03 ! # @(#)$Header: psterm.tinfo,v 2.2 88/10/05 17:36:11 eric Release $ # # nterm is a fancy vt220 terminal emulator for the NeWS window system nterm, --- 1,6 ---- # ! # Grasshopper Group NeWS Termcaps 2.0 -HD 88/10/24 ! # @(#)$Header: psterm.tinfo,v 2.3 88/10/27 18:47:45 eric Update $ # # nterm is a fancy vt220 terminal emulator for the NeWS window system nterm, *************** *** 51,57 **** kcub1=\b, nel=\r\n, ind=\n, use=psterm-basic, psterm|psterm-basic|psterm-80x34, ! am, km, hs, ul, cols#80, lines#34, bel=^G, cr=\r, csr=\EE%p1%d;%p2%d;, clear=\f, el=\EC, ed=\EB, --- 51,57 ---- kcub1=\b, nel=\r\n, ind=\n, use=psterm-basic, psterm|psterm-basic|psterm-80x34, ! am, km, hs, cols#80, lines#34, bel=^G, cr=\r, csr=\EE%p1%d;%p2%d;, clear=\f, el=\EC, ed=\EB, *************** *** 72,78 **** # some control characters you type will do strange things to the screen # on systems that echo typed control characters to the users terminal. psterm-fast, ! am, km, hs, ul, cols#80, lines#34, bel=^G, cr=\r, csr=^E%p1%d;%p2%d;, clear=\f, el=^C, ed=^B, --- 72,78 ---- # some control characters you type will do strange things to the screen # on systems that echo typed control characters to the users terminal. psterm-fast, ! am, km, hs, cols#80, lines#34, bel=^G, cr=\r, csr=^E%p1%d;%p2%d;, clear=\f, el=^C, ed=^B, diff -rc ./psterm_1.ps ../psterm.update/psterm_1.ps *** ./psterm_1.ps Wed Nov 16 01:11:39 1988 --- ../psterm.update/psterm_1.ps Wed Nov 16 01:09:43 1988 *************** *** 36,42 **** % % % "@(#)psterm.ps 1.0 88/06/09 SMI ! % "@(#)$Header: psterm.ps,v 2.3 88/10/05 17:45:46 eric Release $ % % Copyright (c) 1985 by Sun Microsystems, Inc. %/ --- 36,42 ---- % % % "@(#)psterm.ps 1.0 88/06/09 SMI ! % "@(#)$Header: /u/eric/client/psterm/RCS/psterm_1.ps,v 2.14 88/11/11 20:44:00 eric Update $ % % Copyright (c) 1985 by Sun Microsystems, Inc. %/ *************** *** 45,54 **** pause systemdict begin ! /PSTermDict 150 dict def end ! PSTermDict begin % user customization of these items can be done in ~/.pstermrc --- 45,54 ---- pause systemdict begin ! /PSTermDict_1 150 dict def end ! PSTermDict_1 begin % user customization of these items can be done in ~/.pstermrc *************** *** 65,71 **** /EdgeBottom 1 def /ScrollbarWidth 16 def ! /Shrink_To_Cols_Lines true def % contract window to nearest integral size --- 65,72 ---- /EdgeBottom 1 def /ScrollbarWidth 16 def ! /ScrollBarMinBoxSize 8 def ! % minimum height of scroll bar box /Shrink_To_Cols_Lines true def % contract window to nearest integral size *************** *** 283,289 **** } (Version to Frame Label){ ! ($Header: psterm.ps,v 2.3 88/10/05 17:45:46 eric Release $) 8 1 index length 9 sub getinterval SL } ] /new DefaultMenu send def --- 284,290 ---- } (Version to Frame Label){ ! ($Header: /u/eric/client/psterm/RCS/psterm_1.ps,v 2.14 88/11/11 20:44:00 eric Update $) 8 1 index length 9 sub getinterval SL } ] /new DefaultMenu send def *************** *** 305,311 **** BarMax BarMin sub div def /BoxSize BarViewPercent BarScale mul neg ItemHeight ButtonSize 2 mul sub min ! 5 max def } def /ValueToY { % value -> y --- 306,312 ---- BarMax BarMin sub div def /BoxSize BarViewPercent BarScale mul neg ItemHeight ButtonSize 2 mul sub min ! ScrollBarMinBoxSize max def } def /ValueToY { % value -> y *************** *** 312,321 **** BarMin BarViewPercent sub dup 0 le { pop ButtonSize } { ! exch ! 1 index exch sub ! 1 index BarMax sub div mul neg BarScale mul ButtonSize add } ifelse } def /YToValue { % y -> value --- 313,323 ---- BarMin BarViewPercent sub dup 0 le { pop ButtonSize } { ! sub BarViewPercent sub BarScale mul ButtonSize add + BoxSize sub + ButtonSize max + ItemHeight ButtonSize sub BoxSize sub min } ifelse } def /YToValue { % y -> value *************** *** 323,329 **** BarScale div BarMin add .5 add truncate CheckValueBounds } def - /ferd pop /CheckValueBounds { % value => value (in range) BarMax max BarMin BarViewPercent sub min } def --- 325,330 ---- *************** *** 361,368 **** /Scrollbar null def /ScrollbarActive false def dictend ! cl ! assbegin /BorderRight { ScrollbarActive { { --- 362,368 ---- /Scrollbar null def /ScrollbarActive false def dictend ! classbegin /BorderRight { ScrollbarActive { { *************** *** 370,376 **** BorderRight max } DefaultWindow send } { ! DefaultWindow /BorderRight get } ifelse } def --- 370,376 ---- BorderRight max } DefaultWindow send } { ! { BorderRight } DefaultWindow send } ifelse } def *************** *** 470,477 **** /MoveFrameControls super send ScrollbarActive { FrameWidth BorderRight sub ! ControlSize 1 s ! ub ScrollbarWidth FrameHeight ControlSize sub BorderTop sub 2 add /reshape Scrollbar send --- 470,476 ---- /MoveFrameControls super send ScrollbarActive { FrameWidth BorderRight sub ! ControlSize 1 sub ScrollbarWidth FrameHeight ControlSize sub BorderTop sub 2 add /reshape Scrollbar send *************** *** 504,514 **** /ShapeIconCanvas { gsave ParentCanvas setcanvas - IconX null ne { - IconX IconY translate - } if 0 0 IconWidth IconHeight IconPath IconCanvas reshapecanvas grestore } def --- 503,515 ---- /ShapeIconCanvas { gsave ParentCanvas setcanvas 0 0 IconWidth IconHeight IconPath IconCanvas reshapecanvas + IconX null ne { + IconCanvas setcanvas + [1 0 0 1 0 0] setmatrix + IconX IconY movecanvas + } if grestore } def *************** *** 517,525 **** /makemenus { /ResizeMenu [ (Changing Font Size determines:) {} - () { - } () {} (Changing Lines/Cols determines:) {} () {} () {} --- 518,525 ---- /makemenus { /ResizeMenu [ (Changing Font Size determines:) {} () {} + () {} (Changing Lines/Cols determines:) {} () {} () {} *************** *** 597,602 **** --- 597,603 ---- grestore /TSB { % on/off => - ``toggle'' scrollbar + dup /ScrollSaveLength exch store 0 eq { /ScrollbarOff } { /ScrollbarOn } ifelse MyWindow send } def /SSBV { % totallines currentpos => - set scrollbar value *************** *** 1281,1288 **** /createwindow { % x y fs col line framelabel iconlabel font starticonic iconx icony pause - /IconInitialX exch store /IconInitialY exch store /StartIconic exch store /InitialFont exch store /MyIconLabel exch store --- 1282,1289 ---- /createwindow { % x y fs col line framelabel iconlabel font starticonic iconx icony pause /IconInitialY exch store + /IconInitialX exch store /StartIconic exch store /InitialFont exch store /MyIconLabel exch store *************** *** 1289,1295 **** /MyFrameLabel exch store /Window_lines exch store /Window_cols exch store ! /SelectedFontSize exch store /Window_y exch store /Window_x exch store --- 1290,1296 ---- /MyFrameLabel exch store /Window_lines exch store /Window_cols exch store ! /CommandLineFontSize exch store /Window_y exch store /Window_x exch store *************** *** 1297,1303 **** /UserWindowCustom load MyWindow send ! Window_x Window_y 0 0 /doreshape MyWindow send % this calls checkcanvases to set up FrameMenu ... ugh... { --- 1298,1304 ---- /UserWindowCustom load MyWindow send ! Window_x Window_y 100 100 /doreshape MyWindow send % this calls checkcanvases to set up FrameMenu ... ugh... { *************** *** 1325,1345 **** /Window_cols DefaultCols store } if ! SelectedFontSize 0 le ! { /SelectedFontSize DefaultFontSize store } if { InitialFont findfont } errored not { InitialFont ChangeFont } if ! SelectedFontSize ChangeFontSize ! ! MyWindow /ClientCanvas get setcanvas ! ! InitialReshapeFromUser { /reshapefromuser MyWindow send } if ! StartIconic 0 ne { /flipiconic MyWindow send } if ! /map MyWindow send ! pause /MySetTransform createevent store --- 1326,1340 ---- /Window_cols DefaultCols store } if ! CommandLineFontSize 0 le ! { /CommandLineFontSize DefaultFontSize store } if { InitialFont findfont } errored not { InitialFont ChangeFont } if ! CommandLineFontSize ChangeFontSize ! { ClientCanvas setcanvas } MyWindow send /MySetTransform createevent store *************** *** 1356,1368 **** /Canvas currentcanvas def end } def /startinput { /childprocess null store - resetscale - ( ) 0 0 CU - pause { systemdict /Selections known { { ClientCanvas } MyWindow send --- 1351,1363 ---- /Canvas currentcanvas def end + { ClientCanvas /Retained get not } MyWindow send + FastRepaint and { { ToggleFastRepaint } MyWindow send } if + } def /startinput { /childprocess null store { systemdict /Selections known { { ClientCanvas } MyWindow send *************** *** 1518,1524 **** --- 1513,1534 ---- end } loop } fork /childprocess exch store + pause pause + + InitialReshapeFromUser + { /reshapefromuser MyWindow send } if + + StartIconic 0 ne + { /flipiconic MyWindow send } if + + resetscale + ( ) 0 0 CU + pause + + /map MyWindow send + + pause } def /StretchOpen { % called from -ui StretchOpen *************** *** 1530,1535 **** --- 1540,1546 ---- /Term_Font DefaultTerminalFont findfont def /SelectedFont Term_Font def /SelectedFontSize DefaultFontSize def + /CommandLineFontSize DefaultFontSize def /ScaledFont Term_Font def /InitialFont Term_Font def /InitialReshapeFromUser false def *************** *** 1544,1549 **** --- 1555,1561 ---- /UseCopyArea DefaultUseCopyArea not def % likewise /CurrentMatrix matrix def /CurrentSelection () def + /ScrollSaveLength 0 def /char_width 1 def /char_height 1 def diff -rc ./sampl.user.ps ../psterm.update/sampl.user.ps *** ./sampl.user.ps Tue Nov 15 21:13:04 1988 --- ../psterm.update/sampl.user.ps Tue Nov 15 21:41:53 1988 *************** *** 1,5 **** % ! % @(#)$Header: sampl.user.ps,v 2.1 88/10/04 05:59:50 gnu Release $ % to use this file, copy it to ~/user.ps % --- 1,5 ---- % ! % @(#)$Header: /u/eric/client/psterm/RCS/sampl.user.ps,v 2.2 88/11/10 17:05:50 eric Update $ % to use this file, copy it to ~/user.ps % *************** *** 212,218 **** /DefaultRootGrayOrColor {.5 .5 .5 hsbcolor} def framebuffer /Retained false put PaintRoot end } - % (wedge) { (pscode/wl.root.ps) run PaintRoot } (dull) { systemdict begin /PaintRoot systemdict /DullPaintRoot get def PaintRoot /RootImageCanvas null def end } --- 212,217 ---- *************** *** 224,234 **** /loginmenu [ (local) { term forkunix } % change rsh below to remsh under A/UX ! (hoptoad) { (rsh hoptoad ) term append forkunix } ! (polliwog) { (rsh polliwog ) term append forkunix } ! (pondscum) { (rsh pondscum ) term append forkunix } (console) { (psterm -C -t sun -sl 512 -il Console -fl Console) forkunix } ] /new DefaultMenu send def 0 (Roots =>) roots /insertitem rootmenu send --- 223,241 ---- /loginmenu [ (local) { term forkunix } % change rsh below to remsh under A/UX ! (yourhost) { (rsh yourhost ) term append forkunix } ! (myhost) { (rsh myhost ) term append forkunix } (console) { (psterm -C -t sun -sl 512 -il Console -fl Console) forkunix } + % you can put a command at the end of the command line too: + (login) { (psterm /bin/login -p) forkunix } + % make it ask for user name and passwd + (login me) { (psterm /bin/login -p me) forkunix } + % make it ask for passwd for me + (login you) { (psterm /bin/login -p you) forkunix } + % make it log you in + (tip out) { (psterm tip out) forkunix } + % when the tip dies, the window goes away! ] /new DefaultMenu send def 0 (Roots =>) roots /insertitem rootmenu send *************** *** 242,254 **** initialrootimage setrootpicture } { PaintRoot } ifelse end ! startclock { ! (/usr/NeWS/demo/roundclock -s) forkunix pause ! } if ! startconsole { ! (psterm -C -t sun -sl 512 -il Console -fl Console) forkunix pause ! } if /dragframe? false store % false means continuously repaint --- 249,267 ---- initialrootimage setrootpicture } { PaintRoot } ifelse end ! { ! pause pause % allow server to start accpting connections ! startclock { ! (/usr/NeWS/demo/roundclock -s) forkunix pause ! } if ! ! startconsole { ! (psterm -C -t sun -sl 512 -il Console -fl Console) ! forkunix pause ! } if ! ! } fork /dragframe? false store % false means continuously repaint diff -rc ./tcap.cps ../psterm.update/tcap.cps *** ./tcap.cps Tue Nov 15 21:13:19 1988 --- ../psterm.update/tcap.cps Tue Nov 15 21:42:05 1988 *************** *** 36,76 **** % % % "@(#)tcap.cps 9.5 88/01/19 SMI ! % "@(#)$Header: tcap.cps,v 2.2 88/10/04 05:59:57 gnu Release $ % % Copyright (c) 1985 by Sun Microsystems, Inc. %/ cdef PSDefs(reload) ! systemdict /LoadingPSTerm known { createevent dup begin ! /Name [/PSTimer /PSTermLoaded] def end expressinterest createevent dup begin /Name /PSTimer def ! /TimeStamp currenttime .5 add def end sendevent awaitevent pop } if pause ! systemdict /PSTermDict known not reload 0 ne or { ! systemdict /LoadingPSTerm true put ! systemdict /PSTermDict undef ! (psterm.ps) LoadFile pop } if pause cdef PSInitCode(string userinit) ! PSTermDict /UserCodeLoaded known not { (.pstermrc) LoadFile pop ! PSTermDict /UserCodeLoaded true put ! systemdict /LoadingPSTerm undef createevent dup begin ! /Name /PSTermLoaded def /TimeStamp currenttime def end sendevent } if pause ! userdict end PSTermDict begin begin ! % PSTermDict begin dictstackexch PSTermInit ! PSTermDict userinit known { userinit cvx exec } if cdef CreateWindow(x, y, fs, col, lines, string framelabel, string iconlabel, string initialfont, starticonic, iconx, icony) --- 36,87 ---- % % % "@(#)tcap.cps 9.5 88/01/19 SMI ! % "@(#)$Header: tcap.cps,v 2.5 88/11/08 19:35:45 eric Update $ % % Copyright (c) 1985 by Sun Microsystems, Inc. %/ + % note: all instinces of PSTermDict_n and psterm_n.ps should + % have a value of n which matches PATCHLEVEL as defined in + % patchlevel.h. this mechinism is used to allow a single + % news_server to bring up psterm windows on multiple machines + % running different versions of psterm. + cdef PSDefs(reload) ! systemdict /LoadingPSTerm_1 known { createevent dup begin ! /Name [/PSTimer /PSTermLoaded_1] def end expressinterest createevent dup begin /Name /PSTimer def ! /TimeStamp currenttime 1 add def end sendevent awaitevent pop } if pause ! systemdict /PSTermDict_1 known not reload 0 ne or { ! systemdict /LoadingPSTerm_1 true put ! systemdict /PSTermDict_1 undef ! (psterm_1.ps) LoadFile pop } if pause + systemdict /PSTermDict_1 known { + (y\n) print + } { + (n\n) print + } ifelse cdef PSInitCode(string userinit) ! PSTermDict_1 /UserCodeLoaded known not { (.pstermrc) LoadFile pop ! PSTermDict_1 /UserCodeLoaded true put ! systemdict /LoadingPSTerm_1 undef createevent dup begin ! /Name /PSTermLoaded_1 def /TimeStamp currenttime def end sendevent } if pause ! userdict end PSTermDict_1 begin begin ! % PSTermDict_1 begin dictstackexch PSTermInit ! PSTermDict_1 userinit known { userinit cvx exec } if cdef CreateWindow(x, y, fs, col, lines, string framelabel, string iconlabel, string initialfont, starticonic, iconx, icony) diff -rc ./ref/config_aux ../psterm.update/ref/config_aux *** ./ref/config_aux Tue Nov 15 21:13:12 1988 --- ../psterm.update/ref/config_aux Tue Nov 15 21:41:59 1988 *************** *** 1,29 **** ! /* ref/config.h -- Configuration and other very global information ! * Hugh Daniel 88/1/15 (c) Copyright, Grasshopper Group ! * @(#)$Header: config_aux,v 2.0 88/09/16 01:39:55 eric Release $ */ - /* RCS ID - */ - #define FNDELAY O_NDELAY - - /* Compile time controls for system dependances - */ - #define mc68000 /* Things we do have in A/UX */ #define HAVE_SELECT ! #define HAVE_SOCKETS ! #define HAVE_BSDSYSTIME ! /* Useed by psterm & nterm -HD */ ! #define HAVE_SYSV_TTYS ! #define HAVE_PUTTULINE #define HAVE_TERMCAP - #define HAVE_STRINGS_H ! /* Things that we dont have ! #define HAVE_MMAN_H ! */ #ifndef bcopy #define bcopy(s1, s2, len) { \ register char *s__s = (char *)(s1); \ --- 1,26 ---- ! /* ref/config_aux -- Configuration and other very global information ! * ! * @(#)$Header: config_aux,v 2.1 88/11/09 17:03:08 eric Update $ */ /* Things we do have in A/UX */ + + #define HAVE_FNDELAY #define HAVE_SELECT ! #define HAVE_SYSV_TTYS #define HAVE_TERMCAP ! #ifdef undef ! /* Things we don't have in A/UX */ + #define HAVE_BSD_TTYS + #define HAVE_VFORK + #define HAVE_WAIT3 + + #endif + + #define FNDELAY O_NDELAY + #ifndef bcopy #define bcopy(s1, s2, len) { \ register char *s__s = (char *)(s1); \ *************** *** 44,49 **** #define bzero(s, n) memset(s, '\0', n) #endif #define bcmp(s1, s2, n) memcmp(s1, s2, n) - - #define srandom(n) srand(n) - #define gettimeofday(time, tz) _gettimeofday(time) --- 41,43 ---- diff -rc ./ref/config_sunos ../psterm.update/ref/config_sunos *** ./ref/config_sunos Tue Nov 15 21:13:12 1988 --- ../psterm.update/ref/config_sunos Tue Nov 15 21:42:00 1988 *************** *** 1,19 **** /* ref/config_sunos -- Configuration and other very global information ! * Hugh Daniel 88/1/15 (c) Copyright, Grasshopper Group ! * @(#)$Header: config_sunos,v 2.0 88/09/16 01:40:11 eric Release $ */ - /* RCS ID - */ /* Things we do have in sunos */ ! #define HAVE_SELECT ! #define HAVE_SOCKETS ! #define HAVE_BSDSYSTIME ! /* Useed by psterm & nterm -HD */ #define HAVE_BSD_TTYS ! /*#define HAVE_PUTTULINE */ #define HAVE_TERMCAP - #define HAVE_STRINGS_H - - /* #define HAVE_MMAN_H */ #define HAVE_VFORK --- 1,20 ---- /* ref/config_sunos -- Configuration and other very global information ! * ! * @(#)$Header: config_sunos,v 2.1 88/11/09 17:04:02 eric Update $ */ /* Things we do have in sunos */ ! #define HAVE_BSD_TTYS ! #define HAVE_FNDELAY ! #define HAVE_SELECT #define HAVE_TERMCAP #define HAVE_VFORK + #define HAVE_WAIT3 + + #ifdef undef + /* Things we don't have in sunos */ + + #define HAVE_SYSV_TTYS + + #endif -- John Gilmore {sun,pacbell,uunet,pyramid,amdahl}!hoptoad!gnu gnu@toad.com "The network *is* the confuser." From don@brillig.umd.edu Fri Nov 18 08:44:12 1988 Date: Fri, 18 Nov 88 08:44:12 EST To: NeWS-makers@brillig.umd.edu Subject: New Scroll data item From: thaeler@hc.dspo.gov (Bret K. Thaeler) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is a NeWS item that allows you to specify a set data to be put inside of it. It then allows you to scroll through this data selecting stuff. If you have ever seen the old Class Browser this code originally did the scrolling of the item names and stuff. But, this code has been cleaned up to remove cycles in the data to facilitate garbage collection. This code also has just a whole bunch of new options and capabilities. A fairly complex example has been included at the bottom of the first block of comments. Happy NeWSing.... ------------------------------------------------------------------------------- Bret K. Thaeler ARPA: thaeler@hc.dspo.gov | /// Amiga Los Alamos National Labs, MEE-10 UUCP: hc!thaeler | /// user Programming Grunt | \\\ /// Of: (505) 667-8495 Ho: (505) 662-3124 | \\\/// And dam I instinctively used the Vulcan death grip. | \/// proud of it --------------------------- Starts here --------------------------- % A large portion of this code originaly came from: %%%% %%%% %%%% 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 %%%% % % Feel free to use this code as you like. Any questions, bugs, ideas, % problems, whatever would be grealy appreciated. % % Bret K. Thaeler % Los Alamos National Labs (MEE-10) % thaeler@hc.dspo.gov % % % THIS is VERSION 1.0..... % % % ScrollDataItem: % This item provides a simple way to display information in a % scrollable data item. Furthermore the data display may be selected % causing it to by highlight and a notify routine to be called. % % Usefull methods: % parent_canvas notify_proc /new => instance % % array,string /setdata => - % Array is an array of the data to be displayed. Each element % of the array can have the following forms... % string -- display a simple string in scroll area. % array -- parse each elemnt of the array in RIGHT % to LEFT order. Each element of the array % can be of the following forms... % string -- display a simple string % array -- parse array righ to left % color -- set color for future commands % font -- set font for future text % x y -- perform a releative move by x y % /name -- display icon called 'name' % A given entry may be as complex as you want with multiple % strings being display in different fonts with different colors % all moved around with respect to each other intermixed with % icons. Even very comples entries are considered as ONE object % for the purposes of selecting it.. % WARNING: markers may NOT be used in the arrays. If the are the % item will stop displaying at that point while leaving trash % on the stack... % % item_number /deleteitem => - % Delete an item from the list of displayable objects. % If the item_number is out of range then the command will % be ignored. item_number is zero referenced. % % array,string item_number /additem => - % Add an item to the list of displayable objects. % The item added will appear BEFORE or above the item forwhich % the item_number is specified. To append an item to the list % you must add the item before the the first item after the % end of the list. No blank nodes will be added. If you add % an item to the list before an item that past the end % of the list then a suffecient number of EMPTY entries will % be added to the list to allow the new entry to be added. % % array,string item_number /changeitem => - % Replace the object associated with an item. If the % item_number is out of range this command is ignored. % % - /getdata => array % Array that has been build up with with setdata and the % change data routines. % % x y w h /reshape => - % Move and reshape the item... % % % Usefull Class and instance variables: % /AllowMultipleSelect? (default false) % If this is set to true then the user can selected move % then one object. If this is false then selecting a different % object unselects the previous one. % WARNING: This command MUST be issued before any data is % downloaded set with /setdata. Else a /DeclareItemValueArray % must be issued. % % /HScrollBar? (default true) % /VScrollBar? (default true) % Should these scroll bars be displayed... % % /BufferColor (default 1 1 1 rgbcolor) % Background color to be used for the scroll area % % /ItemTextColor (default 0 0 0 rgbcolor) % Default color to be used by ites in the scroll area. % % /ItemHighLightColor (default 0 0 0 rgbcolor) % When an item is selected the background behind the item is % filled with this color. The item it then draw with a default % color of 'BufferColor' % % /ItemLabel (default null) % A label used at the top of the item % % /ItemLabelFont (default Times-Roman.12) % The font used to display the item label % % /ItemLabelColor (default 0 0 0 rgbcolor) % The color used to display the item label % % /ShowItemSeperators (default false) % Should seperator lines be draw between items % in the scroll area. % % /ItemSpacing (default 4) % How much extra space should every item in the scroll % area be seperated by. % % /ItemBorderColor (default 0 0 0 rgbcolor) % Color of the item border. % % /ItemFillColor (default 1 1 1 rgbcolor) % Color to be used to fill scroll areas and item label. % % /ItemValue % Value of last item selected. (zero referenced) % Possible values for this variables may include 'null' % which would indicate that nothing has been selected or % 0-x indicating the item selected. % % /ItemValueArray % Array of items selected. This item ONLY exists if % 'AllowMultipleSelect?' is set true. Possible values for % elements of this array include 0 or 'null' indicating % that the item is not selected. A 1 indicates that the % item has been selected. % % For changes to the following variables to be seen a % /ShowObjectData call must be issued: % /BufferColor, /ItemTextColor, /ItemHighLightColor % /ShowItemSeperators, /ItemSpacing % % Example: % % % can is assumed to be a predefined canvas. % % /foo can {ItemValue (%\n) printf} /new ScrollDataItem send def % { % /AllowMultipleSelect? true def % /HScrollbar? false def % /BufferColor 1 1 0 rgbcolor def % /ItemTextColor 0 0 1 rgbcolor def % /ItemHighLightColor .7 .7 .7 rgbcolor def % 50 50 200 315 reshape % /ItemLabel (This is a TEST []) def % /ItemLabelFont /Times-Bold findfont 24 scalefont def % /ItemLabelColor 1 0 0 rgbcolor def % /ShowItemSeperators true def % } foo send % % /fooa [foo] def % /foom fooa forkitems def % fooa paintitems % % [ % (hello) % [(hello) 20 0 (there)] % [(hello small) /Times-Roman findfont 10 scalefont] % [(hello big) /Times-Bold findfont 30 scalefont] % % [(hello red) 1 0 0 rgbcolor] % % [(hello 1) /Times-Bold findfont 10 scalefont % (hello 2) /Times-Italic findfont 20 scalefont] % % [(hello 3) /Times-Bold findfont 10 scalefont % 20 20 % (hello 4) /Times-Italic findfont 20 scalefont] % [/boy1 /boy2] % [/horse5 0 1 0 rgbcolor] % ] /setdata foo send % % (padding) 30 /additem foo send % } def % % systemdict /SimpleScrollbar known not { (NeWS/liteitem.ps) run} if /PicScrollbar SimpleScrollbar dictbegin /MouseInItem? false def /ScrollMonitor null def /ScrollProcess null def /ScrollDelay 1 60 div 20 div def % 1/10 second /LastX null def /LastY null def dictend classbegin /new { /new super send begin /ScrollMonitor createmonitor def currentdict end } def /StartItem { TrackInterests { exch pop /ClientData get begin /MyOwner /MyOwner GetFromCurrentEvent def end } forall /StartItem super send /maketrackinterests self send } def /ClientDown { % - => - CurrentEvent begin XLocation YLocation end /LastY exch def /LastX exch def SetScrollMotion /MouseInItem? true def HiliteItem DoScroll ScrollMonitor { ScrollProcess null ne { ScrollProcess killprocess } if /ScrollProcess { InteractiveScroll } fork def } monitor } def /InteractiveScroll { { ScrollDelay sleep ScrollMonitor { EventInItem? { DoScroll } if } monitor } loop } def /ClientUp { % - => - ScrollMonitor { ScrollProcess null ne { ScrollProcess killprocess } if /ScrollProcess null def } monitor /MouseInItem? false def UnhiliteItem ItemValue ItemInitialValue ne { NotifyUser % This is used when we are using this scroll bar in other items... % NOTE: If we are in the context of an event then the opperand % stack should look like: % |- EventMgrDict ... mark ... % If We are not in the context of an event the % 'GetFromCurrentEvent' will error out after pushing the % first object on the opperand stack onto the stack again. % This will result in pushing an extra mark onto the stack... % Look in 'GetFromCurrentEvent', 'CurrentEvent', % 'EventMgrDict'. /foobar count 1 sub index type /dicttype eq { mark { /Notify /MyOwner GetFromCurrentEvent send } stopped pop cleartomark } if pop } if } def /ClientDrag { % - => - CurrentEvent begin XLocation YLocation end /LastY exch def /LastX exch def CheckItem } def /PaintBar { } def /EraseBox { } def /PaintButtons { /PaintButtons super send } def /PaintBox { % - => - (paint box) gsave 10 dict begin /x 1 def /w ItemWidth 2 sub def % % fill in the whole bar % ItemFillColor setcolor x ButtonSize w ItemHeight ButtonSize dup add sub rectpath fill % % fill in the view_window bar % BarViewPercent 1 gt { .5 setgray x ButtonSize w ItemHeight ButtonSize dup add sub rectpath fill } { ItemValue BarMin sub BarMax BarMin sub div BarViewPercent mul /lower exch def /y ItemValue ValueToY def ItemHeight ButtonSize dup add BoxSize add sub dup lower mul /d exch def BarViewPercent mul /h exch def .5 setgray x y d sub w h BoxSize add rectpath fill } ifelse % % fill in the small scroll box % ItemValue BoxPath BoxFillColor setcolor gsave fill grestore ItemBorderColor setcolor eofill end /ItemPaintedValue ItemValue def grestore NotifyUser % This is used when we are using this scroll bar in other items... % NOTE: If we are in the context of an event then the opperand % stack should look like: % |- EventMgrDict ... mark ... % If We are not in the context of an event the % 'GetFromCurrentEvent' will error out after pushing the % first object on the opperand stack onto the stack again. % This will result in pushing an extra mark onto the stack... % Look in 'GetFromCurrentEvent', 'CurrentEvent', 'EventMgrDict'. /foobar count 1 sub index type /dicttype eq { mark { /Notify /MyOwner GetFromCurrentEvent send } stopped pop cleartomark } if pop } def /EventInItem? { % - => bool ScrollMotion { /ScrollAbsolute { false } /ScrollPageForward % top { LastX dup 0 ge exch ButtonSize le LastY ItemValue ValueToY ButtonSize add ge LastY ItemHeight ButtonSize sub le and and and } /ScrollPageBackward % bottom { LastX dup 0 ge exch ButtonSize le LastY ButtonSize ge LastY ItemValue ValueToY le and and and } /ScrollLineForward % top { LastX 0 ge LastX ButtonSize le LastY ItemHeight ButtonSize sub ge LastY ItemHeight le and and and } /ScrollLineBackward % bottom { LastX 0 ge LastX ButtonSize le LastY 0 ge LastY ButtonSize le and and and } } case } def /CheckItem { ScrollMotion { /ScrollAbsolute { DoScroll } /ScrollPageForward % top { /MouseInItem? EventInItem? def } /ScrollPageBackward % bottom { /MouseInItem? EventInItem? def } /ScrollLineForward % top { EventInItem? dup { MouseInItem? not { HiliteItem } if } { MouseInItem? { UnhiliteItem } if } ifelse /MouseInItem? exch def } /ScrollLineBackward % bottom { EventInItem? dup { MouseInItem? not { HiliteItem } if } { MouseInItem? { UnhiliteItem } if } ifelse /MouseInItem? exch def } } case } def /HiliteItem { ScrollMotion { /ScrollAbsolute { } /ScrollPageForward { } /ScrollPageBackward { } /ScrollLineForward % top { 0 ItemHeight ButtonSize ButtonSize neg rectpath 5 setrasteropcode fill } /ScrollLineBackward % bottom { 0 0 ButtonSize ButtonSize rectpath 5 setrasteropcode fill } } case } def /UnhiliteItem { gsave ScrollMotion { /ScrollAbsolute {} /ScrollPageForward {} /ScrollPageBackward {} /ScrollLineForward % top { 0 ItemHeight ButtonSize sub ButtonSize ButtonSize rectpath clip PaintButtons } /ScrollLineBackward % bottom { 0 0 ButtonSize ButtonSize rectpath clip PaintButtons } } case grestore } def classend def /ScrollRegionItem Item dictbegin /BufferCanvas null def /BufferWidth 0 def /BufferHeight 0 def /HScrollbar null def /VScrollbar null def /HScrollbar? true def /VScrollbar? true def /HScrollWidth 0 def /VScrollWidth 0 def /ScrollWidth 16 def /ZoomFactor 1 def /LabelHeight 0 def % this gets set in 'ReshapeScrollbars'... dictend classbegin /ItemLabel null def /ItemLabelColor 0 0 0 rgbcolor def /ItemLabelFont /Times-Roman findfont 12 scalefont def % /fontoffset { % font => offset % dup fontheight exch /FontBBox get 0 get mul neg % } def /NotifyUserDown { % x y => - pop pop } def /NotifyUserUp { % x y => - pop pop } def /NotifyUserDrag { % x y => - pop pop } def /NotifyUserEnter { % x y => - pop pop } def /NotifyUserExit { % x y => - pop pop } def /new { % parentcanvas width height => instance /new super send begin /BufferHeight ItemHeight def /BufferWidth ItemWidth def CreateScrollbars CreateBuffer currentdict end } def /destroy { % HScrollbar null ne { % null /setowner HScrollbar send % } if % VScrollbar null ne { % null /setowner VScrollbar send % } if %% BufferCanvas /Mapped false put %% /BufferCanvas null def } def /setzoom { % zoomfactor => - /ZoomFactor exch def } def /reshape { % x y w h => - /reshape super send ReshapeScrollbars } def /reshapebuffer { % w h => - /BufferHeight exch def /BufferWidth exch def ReshapeBuffer ReshapeScrollbars } def /getcanvas { BufferCanvas } def /updatecanvas { PaintBuffer } def /makestartinterests { /makestartinterests HScrollbar send /makestartinterests VScrollbar send [ exch aload length 2 add -1 roll aload pop ] % join 2 arrays dup { /MyOwner self PutInEventMgrInterest } forall /makestartinterests super send [ exch aload length 2 add -1 roll aload pop ] % join 2 arrays } def /PaintItem { gsave PaintBuffer /paint VScrollbar send /paint HScrollbar send % paint the outline ItemCanvas setcanvas ItemBorderColor setcolor 0 HScrollWidth 1 add ItemWidth VScrollWidth sub ItemHeight HScrollWidth sub LabelHeight sub 1 sub rectpath stroke ItemLabel null ne { % paint the label area ItemFillColor setcolor 0 ItemHeight LabelHeight sub 2 sub ItemWidth LabelHeight 2 add rectpath fill % paint the label outline ItemBorderColor setcolor 0 ItemHeight LabelHeight sub 2 sub ItemWidth 1 sub LabelHeight 2 add rectpath stroke % paint the label text ItemLabelColor setcolor ItemLabelFont setfont ItemWidth ItemLabel stringwidth pop sub 2 div ItemHeight LabelHeight sub ItemLabelFont fontdescent add 1 sub moveto ItemLabel show } if grestore } def /Notify { % (picture got notified\n) [] dbgprintf NotifyUser PaintBuffer } def /PaintBuffer { % (PaintBuffer begin \n) [ ] dbgprintf gsave ItemCanvas setcanvas % % compute clipping region % 1 HScrollWidth 1 add ItemWidth VScrollWidth sub 2 sub LabelHeight 0 ne { ItemHeight HScrollWidth sub LabelHeight sub 4 sub } { ItemHeight HScrollWidth sub 2 sub } ifelse rectpath % (clip to % % % %\n) [ pathbbox ] dbgprintf clip % % Clear the item.... % /BufferColor where { pop BufferColor fillcanvas } if % % compute translation % BufferWidth ZoomFactor mul ItemWidth sub VScrollWidth add neg dup 0 lt { 1 /getvalue HScrollbar send sub mul } { pop 0 } ifelse BufferHeight ZoomFactor mul ItemHeight sub HScrollWidth add LabelHeight add neg dup 0 lt { 1 /getvalue VScrollbar send sub mul } { } ifelse HScrollWidth add % 2 copy (translate by % %\n) [ 4 2 roll ] dbgprintf translate BufferWidth BufferHeight % 2 copy (scale by % %\n) [ 4 2 roll ] dbgprintf scale ZoomFactor dup scale pause BufferCanvas imagecanvas pause grestore % (PaintBuffer end\n) [ ] dbgprintf } def /CreateBuffer { % - => - /BufferCanvas framebuffer newcanvas def BufferCanvas /Retained true put BufferCanvas /Opaque true put ReshapeBuffer } def /ReshapeBuffer { % - => - gsave framebuffer setcanvas 0 0 BufferWidth BufferHeight rectpath BufferCanvas reshapecanvas grestore } def /CreateScrollbars { % - => - % (begin CreateScrollbars\n) [] dbgprintf /HScrollWidth HScrollbar? { ScrollWidth } { 0 } ifelse def /VScrollWidth VScrollbar? { ScrollWidth } { 0 } ifelse def ItemWidth VScrollWidth le { /VScrollWidth ItemWidth 2 div def } if ItemHeight HScrollWidth le { /HScrollWidth ItemHeight 2 div def } if /HScrollbar [1 0 .01 .1 ItemWidth VScrollWidth sub BufferWidth div ] 1 {} ItemCanvas /new PicScrollbar send dup /BarVertical? false put def /VScrollbar [1 0 .01 .1 ItemHeight HScrollWidth sub BufferHeight div ] 0 {} ItemCanvas /new PicScrollbar send def % self /setowner HScrollbar send % self /setowner VScrollbar send % (end CreateScrollbars\n) [] dbgprintf } def /ReshapeScrollbars { /HScrollWidth HScrollbar? { ScrollWidth } { 0 } ifelse def /VScrollWidth VScrollbar? { ScrollWidth } { 0 } ifelse def /LabelHeight ItemLabelFont null ne ItemLabel null ne and {ItemLabelFont fontheight} {0} ifelse def ItemWidth VScrollWidth le { /VScrollWidth ItemWidth 2 div def } if ItemHeight HScrollWidth le { /HScrollWidth ItemHeight 2 div def } if ItemHeight LabelHeight HScrollWidth add le { /LabelHeight ItemHeight 4 div def } if 10 dict begin /h ItemHeight def /w ItemWidth def [1 0 .01 .1 ItemWidth VScrollWidth sub BufferWidth div ] /setrange HScrollbar send [1 0 .01 .1 ItemHeight HScrollWidth sub LabelHeight sub BufferHeight div ] /setrange VScrollbar send HScrollbar? { 0 0 w VScrollWidth sub HScrollWidth } { 0 0 0 0 } ifelse % 4 copy (hscroll % % % %\n) [ 6 2 roll ] dbgprintf /reshape HScrollbar send LabelHeight 0 ne { VScrollbar? { w VScrollWidth sub HScrollWidth VScrollWidth h HScrollWidth sub LabelHeight sub 2 sub} { 0 0 0 0 } ifelse } { VScrollbar? { w VScrollWidth sub HScrollWidth VScrollWidth h HScrollWidth sub} { 0 0 0 0 } ifelse } ifelse % 4 copy (vscroll % % % %\n) [ 6 2 roll ] dbgprintf end /reshape VScrollbar send } def /ClientDown { % (Picture ClientDown\n) [] dbgprintf % compute translation % BufferWidth ZoomFactor mul ItemWidth sub VScrollWidth add neg dup 0 lt { 1 /getvalue HScrollbar send sub mul } { pop 0 } ifelse BufferHeight ZoomFactor mul ItemHeight sub HScrollWidth add LabelHeight add neg dup 0 lt { 1 /getvalue VScrollbar send sub mul } { } ifelse HScrollWidth add % translatex translatey CurrentEvent /YLocation get sub neg exch CurrentEvent /XLocation get sub neg exch 2 copy /tmpy exch def /tmpx exch def % tmpx tmpy (tmpx % tmpy %\n) printf % (n: % %\n) [ tmpx tmpy ] dbgprintf { /NotifyUserDown self send } fork } def /ClientUp { % (Picture ClientUp\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserUp self send } def /ClientDrag { % (client drag\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserDrag self send } def /ClientEnter { %% (client enter\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserEnter self send } def /ClientExit { %% (client exit\n) [] dbgprintf CurrentEvent begin XLocation YLocation end /NotifyUserExit self send } def classend def /ScrollDataItem ScrollRegionItem dictbegin /ObjectData [] def /ObjectSizes [] def /ObjectOffsets [] def /LocalUserNotify {} def /NumItems 0 def /LastSelect null def /ItemValueArray [] def dictend classbegin % Class variables /BufferColor 1 1 1 rgbcolor def /AllowMultipleSelect? false def /ItemHighLightColor 0 0 0 rgbcolor def /ItemSpacing 4 def /ShowItemSeperators false def % Methods /new { % parent_canvas notify => instence exch 1 1 /new super send begin /LocalUserNotify exch def currentdict end } def /setdata { % array => - /ObjectData exch def /SizeAllData self send 300 exch /reshapebuffer self send AllowMultipleSelect? { /DeclareItemValueArray self send } if /ShowObjectData self send } def /getdata { % - => array ObjectData } def % if item_number is out of bounds for the data then % the command will be ignored.. % item_number is zero referenced. /deleteitem { % item_number => - 10 dict begin /foo exch def /fool ObjectData length def foo 0 lt foo fool ge or not { % delete an item out of the ObjectData array /fooa fool 1 sub array def ObjectData 0 foo getinterval fooa copy pop ObjectData foo 1 add fool foo sub 1 sub getinterval fooa exch foo exch putinterval currentdict fooa end /ObjectData exch def begin % delete an item out of the ItemValueArray array AllowMultipleSelect? { /fooa fool 1 sub array def ItemValueArray 0 foo getinterval fooa copy pop ItemValueArray foo 1 add fool foo sub 1 sub getinterval fooa exch foo exch putinterval currentdict fooa end /ItemValueArray exch def begin } if end /SizeAllData self send 300 exch /reshapebuffer self send /ShowObjectData self send } { end } ifelse } def % add an item to the list % if we are adding past the end of the list then we expand % the list with empty strings to add the item. % item_number is zero referenced. % This is all very convluted code put hopefully we can deal with % anysized array. We should never load the array in part or in % in whole onto the operand stack... /additem { % item_label item_number => - 10 dict begin % some helpfull constants /foon exch def /fooi exch def /fool ObjectData length def % if we are out of bounds then don't do anything foon 0 lt not { % check to see if we need to extend the array with % null strings. foon fool gt { /fooa foon array def ObjectData fooa copy pop currentdict fooa end /ObjectData exch def begin /fool foon def AllowMultipleSelect? { /fooa foon array def ItemValueArray fooa copy pop currentdict fooa end /ItemValueArray exch def begin } if } if % if we are inserting before the first element after % the end of the list then just append to the list foon fool eq { % append to list /fooa fool 1 add array def ObjectData fooa copy pop fooa fool fooi put currentdict fooa end /ObjectData exch def begin AllowMultipleSelect? { /fooa fool 1 add array def ItemValueArray fooa copy pop currentdict fooa end /ItemValueArray exch def begin } if } { % move the list down and insert an item. /fooa fool 1 add array def ObjectData 0 foon getinterval fooa copy pop ObjectData foon fool foon sub getinterval fooa exch foon 1 add exch putinterval fooa foon fooi put currentdict fooa end /ObjectData exch def begin AllowMultipleSelect? { /fooa fool 1 add array def ItemValueArray 0 foon getinterval fooa copy pop ItemValueArray foon fool foon sub getinterval fooa exch foon 1 add exch putinterval currentdict fooa end /ItemValueArray exch def begin } if } ifelse end /SizeAllData self send 300 exch /reshapebuffer self send /ShowObjectData self send } { end } ifelse } def % Change an item.. % If item does not allready exist then add it.. % If item was selected is will remain selected.. /changeitem { % item_label item_number => - 10 dict begin /foon exch def /fooi exch def /fool ObjectData length def % are we out of bounds? foon 0 ge { % should we call additem? foon fool ge { % call additem. fooi foon end /additem self send } { % just change the item ObjectData foon fooi put end /SizeAllData self send 300 exch /reshapebuffer self send /ShowObjectData self send } ifelse } { end } ifelse } def /DeclareItemValueArray { % - => - /ItemValueArray ObjectData length array def ObjectData length 0 ne { 0 1 ObjectData length 1 sub { ItemValueArray exch 0 put } for } if } def /SizeAllData { % - => total_size /ObjectSizes ObjectData length array def /ObjectOffsets ObjectData length array def 10 dict begin /t ItemSpacing def ObjectData length 0 ne { gsave ItemFont setfont ObjectData length 1 sub -1 0 { /i exch def ObjectOffsets i t put ObjectData i get /ThingSize self send exch pop dup ObjectSizes i 3 -1 roll put t add ItemSpacing add /t exch def } for grestore } if t end } def /ShowObjectData { % - => - gsave % First we are going to fix up the buffer. % set up the defaults BufferCanvas setcanvas BufferColor fillcanvas ItemTextColor setcolor ItemFont setfont % loop over all the data items writing them out ObjectData length 0 ne { 0 1 ObjectData length 1 sub { PutItemText } for } if % go through and hilight those items that have been % selected. AllowMultipleSelect? { % Redraw all the multiple selected stuff. % Are the arrays the same length and are they % none zero. This is a sanity check. ItemValueArray length ObjectData length eq ObjectData length 0 ne and { % Loop over all the items finding highlighed % items and redrawing them. 10 dict begin 0 1 ObjectData length 1 sub { /i exch def ItemValueArray i get 1 eq { ItemHighLightColor setcolor i FillItemBox BufferColor setcolor i PutItemText } if } for end } if } { % Redraw the single highlighted item. LastSelect null ne { ItemHighLightColor setcolor LastSelect FillItemBox BufferColor setcolor LastSelect PutItemText } if } ifelse grestore % Now that we are finished with the buffer paint the % the buffer and the items as a whole onto the canvas. /PaintItem self send } def /ShowThingDict 20 dict dup begin /fonttype {setfont dup type exec} def /colortype {setcolor dup type exec} def /integertype {rmoveto dup type exec} def /realtype {rmoveto dup type exec} def /stringtype { 0 currentfont fontdescent rmoveto show 0 currentfont fontdescent neg rmoveto dup type exec } def /nametype { gsave iconfont setfont icondict exch get cvis dup show stringbbox 4 2 roll pop pop pop grestore 0 rmoveto dup type exec } def /arraytype { dup xcheck { /paint exch exec dup type exec } { aload pop dup type exec } ifelse } def /dicttype {/paint exch send dup type exec} def /marktype { pop } def /nulltype { pop dup type exec} def end def /ShowThing { % object => - gsave ShowThingDict begin mark exch dup type exec end grestore } def /ThingSizeDict 20 dict dup begin /x 0 def /y 0 def /mx 0 def /my 0 def /fonttype {setfont dup type exec} def % /colortype {setcolor dup type exec} def % color shouldn't affect size. /colortype {pop dup type exec} def /integertype { y exch add /y exch def y my gt { /my y def } if x exch add /x exch def x mx gt { /mx x def } if dup type exec } def /realtype { y exch add /y exch def y my gt { /my y def } if x exch add /x exch def x mx gt { /mx x def } if dup type exec } def /stringtype { stringwidth pop x exch add /x exch def x mx gt { /mx x def } if currentfont fontheight y exch add dup my gt { /my exch def } { pop } ifelse dup type exec } def /nametype { gsave iconfont setfont icondict exch get cvis stringbbox % x y w h y exch add % x y w y+h 3 -1 roll % x w y+h y neg dup % x w y+h -y -y 3 1 roll add % x w -y y+h+(-y) 1 add dup my gt { /my exch def } { pop } ifelse y exch add /y exch def x exch add % ... x x+w exch neg add % ... x+w+(-x) /x exch def x mx gt { /mx x def } if grestore dup type exec } def /arraytype { dup xcheck { % x y /size => x y mx my x y /size 4 -1 roll exec /my exch def /mx exch def /y exch def /x exch def dup type exec } { aload pop dup type exec } ifelse } def /dicttype { % x y /size => x y mx my x y /size 4 -1 roll send /my exch def /mx exch def /y exch def /x exch def dup type exec } def /marktype { pop } def /nulltype { pop dup type exec} def end def /ThingSize { % object => xoff yoff gsave ThingSizeDict begin /x 0 def /y 0 def /mx 0 def /my 0 def mark exch dup type exec mx my end grestore } def /PutItemText { % item_number => - dup ObjectOffsets exch get 5 exch moveto dup ObjectData exch get /ShowThing self send ShowItemSeperators { ObjectOffsets exch get 0 exch ItemSpacing 2 div sub moveto 300 0 rlineto stroke } { pop } ifelse } def /FillItemBox { % item_number => - dup ObjectOffsets exch get 0 exch ItemSpacing 2 div sub 1 sub moveto 300 0 rlineto ObjectSizes exch get 0 exch ItemSpacing add rlineto -300 0 rlineto closepath fill } def /NotifyUserDown { % x y => - gsave /FindItem self send BufferCanvas setcanvas ItemFont setfont AllowMultipleSelect? not { LastSelect null ne { BufferColor setcolor LastSelect FillItemBox ItemTextColor setcolor LastSelect PutItemText } if dup LastSelect eq { pop /LastSelect null def /ItemValue null def } { dup /LastSelect exch def /ItemValue exch def ItemValue null ne { ItemHighLightColor setcolor ItemValue FillItemBox BufferColor setcolor ItemValue PutItemText } if } ifelse } { /ItemValue exch def ItemValue null ne { ItemValueArray ItemValue get 1 eq { BufferColor setcolor ItemValue FillItemBox ItemTextColor setcolor ItemValue PutItemText ItemValueArray ItemValue 0 put } { % 0 BufferHeight ItemValue 1 add 18 mul sub % 3 sub 300 18 rectpath ItemHighLightColor setcolor ItemValue FillItemBox BufferColor setcolor ItemValue PutItemText ItemValueArray ItemValue 1 put } ifelse } if } ifelse grestore /updatecanvas self send /LocalUserNotify self send } def /FindItem { % x y => item_number 10 dict begin exch pop /y exch def y 0 lt y BufferHeight gt or not ObjectData length 0 gt and { /a null def 0 1 ObjectData length 1 sub { /i exch def ObjectOffsets i get y le { /a i def exit } if } for a } { null } ifelse end } def classend def From don@brillig.umd.edu Fri Nov 18 08:44:32 1988 Date: Fri, 18 Nov 88 08:44:32 EST To: NeWS-makers@brillig.umd.edu Subject: PSTerm patchlevel 1 From: steinmetz!vdsvax!montnaro@uunet.uu.net (Skip Montanaro) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I just installed patch #1 for psterm as distributed by Grasshopper. One thing to note: PSTermDict should be changed to PSTermDict_1 in users' files where it occurs. This includes ~/.pstermrc and the sampl.pstermrc file distributed by Grasshopper. The man page should also make mention of the new versioning scheme. -- Skip Montanaro (montanaro@sprite.steinmetz.ge.com, montanaro@ge-crd.arpa) From don@brillig.umd.edu Sat Nov 19 19:38:56 1988 Date: Sat, 19 Nov 88 19:38:56 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: mcvax!hp4nl!philmds!nlgvax!tom@uunet.uu.net (Tom van Peer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <5897@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >montnaro@sprite.steinmetz.ge.com (Skip Montanaro) wrote: >> I've been trying to get around a bug in NeWS that makes starting programs >> from user.ps unreliable. (It's bug #1004790. It's been around since NeWS 1.0 >> and is still present in 1.1. I'll send the workaround to anyone interested.) >> The symptom is that when starting programs from user.ps, such as: >> >> (psterm -ls -bg -li 16 -co 80 -sl 128 -C) forkunix >> (emacs) forkunix >> >> sometimes the windows show up, but most times not. > >I believe this is because at the time user.ps runs, the server has not >yet started accepting connections. Let me first state that I don't know about bug #1004790 (so please flame mildly if the following doesn't work). When looking at init.ps I find that &main is run after the server has started. So if you define &main in user.ps and put your forkunixes in there like: /&main { go! % necessarry to get processes running. (psterm -ls -bg -li 16 -co 80 -sl 128 -C) forkunix (emacs) forkunix } def everything should work fine. -- Tom van Peer Nederlands Philips Bedrijven, Dependance Nat. Lab. Building XP Willem Alexanderlaan 7B, 5664 AN Geldrop - The Netherlands. Tel: +31-40-892334 E-mail: mcvax!philmds!nlgvax!tom or tom@pcg.philips.nl From don@brillig.umd.edu Sat Nov 19 19:39:00 1988 Date: Sat, 19 Nov 88 19:39:00 EST To: NeWS-makers@brillig.umd.edu Subject: Connectathon for ONC/NFS, X11 and NeWS Annual Testing From: commuter!beepy@sun.com (Brian Pawlowski) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) To NFS/ONC, X11 and NeWS Developers, Sun Microsystems, Inc. is hosting the annual Connectathon event in February 1989. Connectathon was set up for developers of ONC and NFS implementations to test against other implementations. (NFS - Network File System, ONC - Open Network Computing). For the first time this year, X11 and NeWS window system testing will also be performed. Vendors send their engineers and machines to test interoperability of with all other vendors present. It's an unsurpassed opportunity to test your completed implementation or implementation in progress in a large multivendor, heterogeneous environment. Last year, we had approximately 50 implementations of ONC from over 40 vendors for a week of intensive testing. Connectathon also represents a unique opportunity developers to share ideas while testing their implementations. As in previous Connectathon's we will be running technical tracks, which in the past included presentations on NFS testing, NFS implementations (UNIX and non-UNIX), and the impending NFS protocol revision. Connectathon '89 will be held on February 13-17 near Mountain View, CA. The week prior is available for set up of machines at the site. February 20 and 21 are available for press and marketing relations for those vendors/developers who want to show their product. Registration is underway, and space is quickly filling up. There are two more weeks of extended registration time left! This year a registration fee of $1000 is in effect, to defray operating costs for the event. Connectathon is open to all ONC/NFS, X11 and NeWS developers. For more information, and registration materials, please send email to Linda Cwiak (lhatt@sun.com) as soon as possible. Or call at (415) 336 4717. If you are working on an NFS/ONC implementation and will be unable to attend Connectathon, we'd still like to hear from you. There are several events each year of interest to NFS/ONC developers (ONC Vendors Group Meeting, BOFs at USENIX and Interop conferences, and multivendor demonstrations) which we keep interested vendors posted on. If you know of someone who may not see this posting but may be interested, please pass this on. Looking forward to seeing you in February! Brian Pawlowski P.S. Attached to this message is a sample of ONC/NFS bugs that were found at Connectathon '88. ------------------------------------------------------------------------ The unique environment at Connectathon turns up different types of bugs: 1) Implementations do not always follow the protocol: Bug #11 Description: On Vendor_X's server, READDIR returns einval(22) when buffer size is 512. Buffer size = 1024 works. This server doesn't really allow clients to specify buffer size. 2) Some problems only occur when two particular vendor's machines try to communicate: Bug #25 Description: /bin/pwd returns error "directory un-readable" when current working directory is Vendor#1 filesystem over NFS. Coments: To recreate: Mount Vendors#1's filesystem on Vendor#2's filesysytem. cd into Vendor#1's filesystem. pwd Vendor#1's filesystem was using inode numbers > 65535 which did not fit into the 16 bit field used by Vendor#2. 3) Problems are found in the reference port: Bug #26 Description: Names of NFS temporary files are not random due to bug in newname() [sys/nfs/nfs_subr.c]. NFS doesn't use random names when renaming a file in nfs_remove(). The problem exists in 3.x and 4.0 implementations of NFS. 4) Problems are found in a single vendor's implementation: Bug # 47 Description: readdir doesn't work properly. EOF not set at end of directory reading. Comments: The problem was in the vendor's code. ------------------------------------------------------------------ (NFS, ONC, NeWS and Connectathon are trademarks of Sun Microsystems, Inc. UNIX is a registered trademark of AT&T) Brian Pawlowski Sun Microsystems, Portable Software Products From don@brillig.umd.edu Sat Nov 19 19:39:09 1988 Date: Sat, 19 Nov 88 19:39:09 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: munnari!otc!metro!basser!natmlab!marka@uunet.uu.net (Mark Andrews) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article (Skip Montanaro) writes: > >I've been trying to get around a bug in NeWS that makes starting programs >from user.ps unreliable. (It's bug #1004790. It's been around since NeWS 1.0 >and is still present in 1.1. I'll send the workaround to anyone interested.) >The symptom is that when starting programs from user.ps, such as: > > (psterm -ls -bg -li 16 -co 80 -sl 128 -C) forkunix > (emacs) forkunix > >sometimes the windows show up, but most times not. Sometimes it appears that >only the first command doesn't get run, so I reasoned, what's the simplest >command forkunix might accept so I could use it as a sacrificial command (as >it were)? The empty string! I tried executing > I would not call this a bug as such. Starting programs such as psterm, emacs which expect to be able to talk to the server before you actually start the server are bound to cause trouble. "user.ps" is designed to TAILOR the SERVER. NeWS does not provided as it comes any way to layout a desktop reliably. The way we got around this problem was to define another configuration file "desktop.ps" and cause it to be executed AFTER the server is started. We did this by adding one line to $NEWSHOME/lib/NeWS/init.ps right at the end. (desktop.ps) LoadFile pop From don@brillig.umd.edu Sat Nov 19 22:30:45 1988 Date: Sat, 19 Nov 88 22:30:45 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Grasshopper psterm From: ulysses!cjc@ucbvax.Berkeley.EDU (Chris Calabrese[rs]) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <1773@goanna.oz>, ajk@goanna.oz (Alan Kent) writes: | I have had problems with its screen redrawing. If I get a full page of | output before it starts to draw it, it seems to just not bother doing | any output. Quite often I do a ls -l but all I get out is the next | prompt, or a few lines of output if I am lucky. I only have 4megs on a | Sun 3/60 (and NeWS 1.1) so NeWS runs pretty slow (it pages to death). | When I rlogin to a faster machine its quite easy to get large backlogs | in output. vi on the remote machines also messes up quite frequently | (probably due to same reason). I have not tried toggling the | fast-redraw option yet, but it would be better if psterm worked properly | in the first place. The problem your're having is definitely with the fast-redraw algorithm. We've found that the fast-redraw works really well when you receive a very large ammount of input very quickly (like 'cat /etc/termcap'). In these instances it simply draws random gargabe until things have died down, then it correctly draws the last screen. When things come in slow enough to have it trip in and out of the fast repaint mode, you have problems such as not drawing all the input, leaving copies of the cursor around the screen, etc. -- Christopher J. Calabrese AT&T Bell Laboratories att!ulysses!cjc cjc@ulysses.att.com From don@brillig.umd.edu Tue Nov 22 01:13:14 1988 Date: Tue, 22 Nov 88 01:13:14 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: Don Dwiggins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's what works for me; put the following in user.ps: { % Wait for server to be started (this is a hack based on knowing % that init.ps defines ROOTPROC, then removes it as its last action) { systemdict /ROOTPROC known not {exit} if pause } loop pause pause (psterm -f -C -t sun -li 16 -co 80 -sl 128 -ic -il console -ixy 1050 20) forkunix (roundclock) RunDemoProgram } fork pop The arguments to psterm are understood by the Grasshopper version. There are a couple of minor annnoyances with this: I have to set the location of the clock by hand, as when invoking it from a menu. Does any expert out there know how to specify a location for it from the PS code? When invoking NeWS from suntools, defining a console window "breaks" any console association in an underlying suntools window. How can I get that association back without killing and restarting the suntools console window? Don Dwiggins dwiggins@ashtate.uucp From don@brillig.umd.edu Wed Nov 23 02:38:01 1988 Date: Wed, 23 Nov 88 02:38:01 EST To: NeWS-makers@brillig.umd.edu Subject: PostScript and printers From: rena%shemesh@LANL.GOV (Rena Whiteson) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am running NeWS 1.1 I have a program, written entirely in PostScript, that gets data from an input file and draws a (beautiful) picture of a chromosome into a window. I want to be able to send it to a printer to get a hardcopy of the picture. So I have another version of the program, without the window stuff and headed with %! The printer (westley) gives me this error message: banner: shemesh:rena Job: print20 Date: Fri Nov 4 10:24:25 1988 psif: shemesh:rena westley start - Fri Nov 4 10:24:26 1988 psif: initial status - %%[ status: busy; source: serial 25 ]%% %%[ Error: undefinedfilename; OffendingCommand: file ]%% %%[ Flushing: rest of job (to end-of-file) will be ignored ]%% psif: end - Fri Nov 4 10:24:39 1988 Though the necessary file does exist, and is called by its full path name. My workstation, the printer, and the PostScript interpreter run off the same server. When I change the program so that all the necessary data is in the the program itself, no need to read another file, it prints the picture perfectly. Am I trying to do the impossible? I'd appreciate any help. rena@shemesh.lanl.gov From don@brillig.umd.edu Wed Nov 23 02:38:21 1988 Date: Wed, 23 Nov 88 02:38:21 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: David Rosenthal Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > > When invoking NeWS from suntools, defining a console window "breaks" any > console association in an underlying suntools window. How can I get > that association back without killing and restarting the suntools console > window? > This is a problem with the definition of the TIOCCONS ioctl. There is no way to re-establish the association. Do not run a NeWS console if you are running on top of SunView. David. From don@brillig.umd.edu Wed Nov 23 02:38:47 1988 Date: Wed, 23 Nov 88 02:38:47 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <3168@natmlab.dms.oz>, marka@natmlab.dms.oz (Mark Andrews) writes: > I would not call this a bug as such. Starting programs such as > psterm, emacs which expect to be able to talk to the server > before you actually start the server are bound to cause trouble. > "user.ps" is designed to TAILOR the SERVER. > > NeWS does not provided as it comes any way to layout a desktop > reliably. The way we got around this problem was to define > another configuration file "desktop.ps" and cause it to be > executed AFTER the server is started. We did this by adding one > line to $NEWSHOME/lib/NeWS/init.ps right at the end. > > (desktop.ps) LoadFile pop We created an array of procs called RestartActions which your user.ps can fill with actions. Init.ps executes these procs after the server is running. -- 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 Nov 23 02:39:37 1988 Date: Wed, 23 Nov 88 02:39:37 EST To: NeWS-makers@brillig.umd.edu Subject: Rumors? From: neptune!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Has anyone heard any (even slightly) reliable rumors about NeWS being ported to the NeXT cube? ---------------------------------------------------------------------------- Jim Rudolf College of Oceanography rudolf@oce.orst.edu Oregon State University, Corvallis, Oregon ---------------------------------------------------------------------------- From don@brillig.umd.edu Thu Nov 24 01:56:00 1988 Date: Thu, 24 Nov 88 01:56:00 EST To: NeWS-makers@brillig.umd.edu Subject: vt100 emulator From: jfjr@mitre-bedford.arpa (Jerome Freedman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am new to NeWS so please excuse stupid questions I need a good vt100 emulator, the standard one is not adequate. I am trying to make the sybase data wrokbench and NeWs work together. Jerry Freedman, Jr jfjr@mitre-bedford.arpa Jerry Freedman, Jr "Why did jfjr@mitre-bedford.arpa Unix come from the east?" (617)271-3191 From don@brillig.umd.edu Thu Nov 24 23:06:48 1988 Date: Thu, 24 Nov 88 23:06:48 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Fun with forkunix From: david@sun.com (David DiGiacomo) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8811221635.AA10468@devnull.sun.com> dshr@SUN.COM (David Rosenthal) writes: >> >> When invoking NeWS from suntools, defining a console window "breaks" any >> console association in an underlying suntools window. How can I get >> that association back without killing and restarting the suntools console >> window? >> >This is a problem with the definition of the TIOCCONS ioctl. There is no >way to re-establish the association. Do not run a NeWS console if you >are running on top of SunView. ????? Simply run this program in the SunView (ex-)console window, and it will be the console once again: /* * setcons.c * * Makes the argument tty (default /dev/tty) the console. */ #include #include #include main(argc, argv) int argc; char *argv[]; { char *dev; int fd; dev = argc > 1 ? argv[1] : "/dev/tty"; if ((fd = open(dev, O_WRONLY)) < 0) perror(argv[0]); if (ioctl(fd, TIOCCONS, 0) < 0) { perror(argv[0]); exit(1); } exit(0); } From don@brillig.umd.edu Fri Nov 25 22:05:27 1988 Date: Fri, 25 Nov 88 22:05:27 EST To: NeWS-makers@brillig.umd.edu Subject: Status of NDE ?? From: voder!wlbr!mh@ucbvax.Berkeley.EDU (Mike Hoegeman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does anybody know the status of the NeWS Development Environment (NDE)? - is it available yet ? - what are some of it's capabilites ? - will it come with an OPEN LOOK implementation ? - how much does it cost ? - if it is available how dow i get it ? thanks, mike h. From don@brillig.umd.edu Sat Nov 26 20:21:46 1988 Date: Sat, 26 Nov 88 20:21:46 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Status of NDE ?? From: ulysses!cjc@ucbvax.Berkeley.EDU (Chris Calabrese[mav]) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <24620@wlbr.EATON.COM>, mh@wlbr.EATON.COM (Mike Hoegeman) writes: > > Does anybody know the status of the NeWS Development Environment (NDE)? > This is from info gathered at UNIX EXPO (last month) from Bill Joy and Craig Taylor (the guy in charge of NDE). > - is it available yet ? It's going beta inside Sun "real soon" > - what are some of it's capabilites ? Good question. Seems that it significantly cleans up the interface to the libraries, makes them easier to customize, etc. As for any details, I don't know. > - will it come with an OPEN LOOK implementation ? It will be _the_ OPEN LOOK toolkit running under NeWS. > - how much does it cost ? Don't know. > - if it is available how dow i get it ? Should be relased to the general public in 2Q '89 :-( -- Christopher J. Calabrese AT&T Bell Laboratories att!ulysses!cjc cjc@ulysses.att.com From don@brillig.umd.edu Tue Nov 29 09:24:54 1988 Date: Tue, 29 Nov 88 09:24:54 EST To: NeWS-makers@brillig.umd.edu Subject: anyone need a SUG favor? From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I will be attending the Sun User Group Conference and Exhibit next week in Miami, and I am willing to do small favors for those who cannot attend. The favor must be very specific, i.e. I will not pick up product information from all vendors which sell graphic boards. I am willing to obtain specific information from a vendor, ask a specific question at a workshop, etc. If you have such a favor which you would like me to do for you, send it to me before Friday. 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 ---------------------------------------------------------------------- Today's quote: Donal O'Shea (an OSF VP) on System V.4: "It's not of sufficient quality. People can't put commercial applications on it." From don@brillig.umd.edu Tue Nov 29 09:38:08 1988 Date: Tue, 29 Nov 88 09:38:08 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS software exchange at SUG From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm bringing a tape full of public domain NeWS software to the Sun Users Group meeting in Miami. It includes all of the programs posted to NeWS-makers (comp.windows.news), and everthing else I could find. There are well over 100 items. I'm still in the process of organizing the software and getting permission from the authors to redistribute it on the Sun Users Group tape, but I can certianly give out copies of the stuff I know to be redistributable at SUG in Miami. I'll be putting it all up on tumtum for anonymous ftp as soon as disk space is permitting. If you've got any NeWS software that you'd like to contribute to the cause, or new versions of anything that's already been posted, please send it in and I'll include it! To make things a lot easier, please put a notice on it saying that it can be freely redistributed. Otherwise you may have to fill out paperwork. (eeeugh! a fate worse than death!) -Don From don@brillig.umd.edu Tue Nov 29 10:23:55 1988 Date: Tue, 29 Nov 88 10:23:55 EST To: NeWS-makers@brillig.umd.edu Subject: X11R3 => NeWS font converter From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here are a couple of scripts I put together to convert the fonts from the X11R3 distribution into bitmap fonts for NeWS. If you have a copy of the X11R3 source code online, just follow the instructions in "makefonts" and you'll have more bitmap fonts than you'll know what to do with! Note that this message contains two files: makefonts and bfdtofb. You should chmod +x both of them. -Don makefonts: Cut here:==================================================== #!/bin/csh -f # # makefonts # # Shell script to convert the X11R3 fonts into NeWS fonts, using # the "bdftofb" shell script. # # Instructions: # # - Make a directory called "fonts", beneath the current directory. # - Point the XDIR variable in this shell script to your copy of the X11R3 # source code distribution. # - Run this shell script, "makefonts". # - Sit back and relax for a while. # - Before you run NeWS, set the environment variable "FONTPATH" to # "/usr/NeWS/fonts:/fonts". (Oh wtf, just merge the two # directories!) # # Note: The size of the FontDirectory dictionary in NeWS 1.1 is only 100. # (It's hard wired.) However, you can fix this in init.ps by inserting # the line "500 FontDirectory extend" right before the line # "FontDirectory begin". # # Copyright (C) 1988 by Don Hopkins. (don@brillig.umd.edu) # University of Maryland Human Computer Interaction Lab. # Feel free to redistribute this. Please send my your improvements! # # Point XDIR to the home of your X11R3 source distribution set XDIR = /usr/src/new/X11R3 # Where to find the bdf files. set XBDFDIR = $XDIR/fonts/bdf set XCONTRIBDIR = $XDIR/contrib/fonts/bdf # Include the new X11 fonts that work nicely with NeWS. # (Charter and NewCenturySchlbk) set X11FONTS = ($XBDFDIR/75dpi/{char,ncen}*.bdf) # Include all the Mac fonts -- they're a blast! set MACFONTS = ($XCONTRIBDIR/info-mac/*.bdf $XCONTRIBDIR/bmug/*.bdf) # You could also include the X10 and old X11 fonts but they're pretty icky. # Convert the mess: bdftofb $X11FONTS bdftofb $MACFONTS # Group the font files into families for NeWS (by making .ff files). bldfamily -dfonts bdftofb: Cut here:====================================================== #!/bin/csh -f # # bdftofb # # Convert X11 .bdf font files to NeWS .afb font files, # apply some heuristics to figure out their names, # and dump out NeWS .fb files. # # Copyright (C) 1988 by Don Hopkins. (don@brillig.umd.edu) # University of Maryland Human Computer Interaction Lab. # Feel free to redistribute this. Please send my your improvements! # # Bugs: You can't run multiple instances of this shell script at once in # the same directory (because of the file "font-name"). # The heuristics to figure out the font name seem to work OK with the # X11R3 fonts, but they may need to be frobbed for other fonts. # foreach file ($*) echo -n Converting $file ... rm -f font-name set out = `basename $file:r.afb` awk '\ /^FONT / { if ($2 == "Apple" && $3 == "Macintosh") \ name = $4 \ else name = $2 \ if (name ~ /\.bdf$/) \ name = substr(name, 1, length(name)-4) } \ /^FAMILY_NAME / { name = $2 } \ /^WEIGHT_NAME / { name = name "-" $2 } \ /^SLANT / { if ($2 == "\"I\"" && name !~ /.*Italic/) \ name = name "Italic" } \ /^DEVICE_FONT_NAME / { name = $2 } \ /^COPYRIGHT "public domain"/ { next } \ /^STARTPROPERTIES/ , /^ENDPROPERTIES/ { next } \ {print} \ END { while ((name ~ /\n$/) || (name ~ /-[0-9]*$/)) \ name = substr(name, 1, length(name)-1) \ print name > "font-name" } \ ' $file > $out set name = `sed 's/"//g' < font-name` echo Done. echo -n Dumping $name ... dumpfont -d fonts -n $name $out rm $out end rm -f font-name From don@brillig.umd.edu Wed Nov 30 16:07:40 1988 Date: Wed, 30 Nov 88 16:07:40 EST To: NeWS-makers@brillig.umd.edu Subject: Agenda for 1988 NeWS SIG at SUG From: mg@repo.unipress.com (required by law) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) X11/NeWS Special Interest Group Session Code T23 Time: Tuesday 6-Dec-88 2:30pm Moderator: Mark Krieger, UniPress Software Inc. This session will bring together X11/NeWS developers. We will review interesting NeWS projects being done on Suns, and we will discuss future Sun plans for X11/NeWS and NDE. Speaker: Mark Krieger Topic: C2PS -- a C to Postscript Compiler. Last year at this session a number of developers asked for a language like C, in addition to PostScript, as a way to write NeWS applications. C2PS compiles C into PostScript. While the user must understand the PostScript model, and the NeWS environment, the code itself can be written in C. Speaker: Maurice Balick, Architec Topic: OS/2 NeWS. NeWS has been ported to OS/2! Use your PC's as NeWS servers. Write OS/2 applications with a real window system. Speaker: Bruce Schwartz, Sun Microsystems Topics: An object oriented drawing program under NeWS. NeWS on a serial port. Question and Answer Session: Technical questions about X/NeWS or NeWS? Questions about Sun's future plans? This is the time to ask. Don Hopkins, who moderates newsmakers, Ralph Derricksen of the Sun NDE group, and various Sun NeWS and NDE people have told us they will attend. From don@brillig.umd.edu Wed Nov 30 18:32:06 1988 Date: Wed, 30 Nov 88 18:32:06 EST To: NeWS-makers@brillig.umd.edu Subject: keypad.ps From: don@tumtum.cs.umd.edu (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's a handy way to moving the cursor around on the screen without taking your hand off the keyboard. For a good time, try using keysee to press the function keys! -Don %! % Simulate mouse movement and clicks, with shifted keypad arrows % % Don Hopkins, University of Maryland Human Computer Interaction Lab % % Copyright (C) 1988 by Don Hopkins. 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. % % Fake mouse movement: % % Control: small step (1 point) % Shift: medium step (16 points) % Meta: big step (100 points) % % R7 R8 R9 % R10 R12 % R13 R14 R15 % % Fake mouse clicks: % % Control-R11: Left mouse click % Shift-R11: Middle mouse click % Meta-R11: Right mouse click % % Unshifted function keys are just send through. % systemdict begin % Later: % Express interest in function key UpTransitions some how, leave % the Action field alone, and just send one event... /fake-button { % event name => event 1 index createevent copy % event name event begin % event name /Name exch def % event currentdict end % event FakeDownEvent dup createevent copy % event FakeDownEvent FakeDownEvent sendevent % event FakeDownEvent begin % event /Action /UpTransition def currentdict end % event FakeUpEvent sendevent % event } def /push-button { true 1 index /KeyState get { { /Control { pop /LeftMouseButton fake-button false exit } /Shift { pop /MiddleMouseButton fake-button false exit } /Meta { pop /RightMouseButton fake-button false exit } } case } forall { redistributeevent } if } def /move-mouse { % event dx dy => event gsave framebuffer setcanvas 2 index begin /Name /MouseDragged def YLocation add /YLocation exch def XLocation add /XLocation exch def XLocation YLocation setcursorlocation currentdict end sendevent grestore } def /mouse-small-step 1 def /mouse-medium-step 16 def /mouse-big-step 100 def /push-mouse { % event x y => event true 3 index /KeyState get { { /Control { pop mouse-small-step mul exch mouse-small-step mul exch move-mouse false exit } /Shift { pop mouse-medium-step mul exch mouse-medium-step mul exch move-mouse false exit } /Meta { pop mouse-big-step mul exch mouse-big-step mul exch move-mouse false exit } } case } forall { pop pop redistributeevent } if } def /FunctionR7 { -1 1 push-mouse } bindkey /FunctionR8 { 0 1 push-mouse } bindkey /FunctionR9 { 1 1 push-mouse } bindkey /FunctionR10 { -1 0 push-mouse } bindkey /FunctionR12 { 1 0 push-mouse } bindkey /FunctionR13 { -1 -1 push-mouse } bindkey /FunctionR14 { 0 -1 push-mouse } bindkey /FunctionR15 { 1 -1 push-mouse } bindkey /FunctionR11 { push-button } bindkey end % systemdict From don@brillig.umd.edu Sat Dec 3 03:56:20 1988 Date: Sat, 3 Dec 88 03:56:20 EST To: NeWS-makers@brillig.umd.edu Subject: Auto-repeat in NeWS From: raster!peter!zong@decvax.dec.com (Zong Tzeng) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Can someone provide the answers to the following questions? It would be greatly appreciated. 1) Is it a fact that recallevent in NeWS will not work on a redistributed event? (NeWS 1.1 Manual says so) 2) If it is so to question 1), then what is the mechanism in NeWS to cancel those redistributed events? 3) Is there any 'simple' solution to the key-slipping problem in NeWS (SUNREF) due to auto-repeat ? Zong From don@brillig.umd.edu Sat Dec 3 04:01:10 1988 Date: Sat, 3 Dec 88 04:01:10 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Rumors? From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >Has anyone heard any (even slightly) reliable rumors about NeWS being >ported to the NeXT cube? Who would want it? When you can have the real thing (PostScript), an excellent toolkit, integrated printing, etc.. About the only I can think of, is some weird application which requires round windows. -greg. From don@brillig.umd.edu Thu Dec 8 12:59:01 1988 Date: Thu, 8 Dec 88 12:59:01 EST To: NeWS-makers@brillig.umd.edu Subject: Rumors? From: dwf%prudence@LANL.GOV (David W. Forslund) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >>Has anyone heard any (even slightly) reliable rumors about NeWS being >>ported to the NeXT cube? >Who would want it? When you can have the real thing (PostScript), an >excellent toolkit, integrated printing, etc.. > >About the only I can think of, is some weird application which requires >round windows. > > -greg. > That presumes that no-one has written any interesting applications in NeWS or perhaps equivalently that the only interesting ones are in Display PostScript. The sad fact now is that we have two parallel (incompatible) extensions to "PostScript" which is only going to make life hard on the programming community. It would appear that despite some bugs that NeWS is considerably more mature, powerful, and accepted than is Display PostScript at this time. So it seems to me that an implementation on the NeXT machine would interest a number of people who might like to integrate the machine into an existing environment of many other workstations. Dave Forslund From don@brillig.umd.edu Thu Dec 8 12:59:27 1988 Date: Thu, 8 Dec 88 12:59:27 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS running on VAX From: unmvax!pprg.unm.edu!cyrus@ucbvax.Berkeley.EDU (Tait Cyrus) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Has anyone taken the NeWS source and ported it to a VAX? I don't mean ported the client to run on a VAX, I mean ported the server to run AND display on a VAX. If not, know of anyone who has at least tried? Thanks in advance --- W. Tait Cyrus (505) 277-0806 e-mail: cyrus@pprg.unm.edu University of New Mexico Dept of ECE - Parallel Processing Research Group Albuquerque, New Mexico 87131 From don@brillig.umd.edu Thu Dec 8 12:59:57 1988 Date: Thu, 8 Dec 88 12:59:57 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS running on VAX From: voder!wlbr!mh@ucbvax.Berkeley.EDU (Mike Hoegeman) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <23677@pprg.unm.edu> cyrus@pprg.unm.edu (Tait Cyrus) writes: > >Has anyone taken the NeWS source and ported it to a VAX? I don't mean >ported the client to run on a VAX, I mean ported the server to run AND >display on a VAX. If not, know of anyone who has at least tried? > >Thanks in advance I've seen NeWS running on a b&w ultrix vaxstation (don't know what kind) in sun booths on occasion. I think sun themselves did it to demonstrate how portable NeWS was but take that with a grain of salt. From don@brillig.umd.edu Thu Dec 8 13:01:51 1988 Date: Thu, 8 Dec 88 13:01:51 EST To: NeWS-makers@brillig.umd.edu Subject: Support of outlinefonts in NeWS From: Knut Skog Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) To the concerned. Is there a committed date at which there will be a genuine outline-font support for NeWS for say the Laserwriter Plus fontset (or more)? If this crusial issue is covered by any official statement from Sun, could it be posted here, or could someone direct me to it. Much obliged, Knut Skog From don@brillig.umd.edu Thu Dec 8 13:02:02 1988 Date: Thu, 8 Dec 88 13:02:02 EST To: NeWS-makers@brillig.umd.edu Subject: Re: psview From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <5648@saturn.ucsc.edu>, conrad@jupiter.ucsc.edu (Al Conrad) writes: > Has anyone succesfully used psview to look at documents prepared with: > > 1. ditroff -> transcript/psdit -> PostScript Yes, almost every day. > 2. tex -> dvi2ps -> PostScript I have looked at three different TeX to PostScript translators and all of them meddle in different ways with the innards of the LaserWriter. One of them even exits the LaserWriter server loop relying on the password being unchanged from the factory setting! These things are extremely device dependent and should not be used by a filter like this. None of these TeX filters will work on anything but an Apple LaserWriter. They won't work on Display PostScript. They won't work on other Adobe licensed PostScript printers. They are the work of hackers (in the traditional sense) and need major work to turn them into products. > 3. MacWrite -> PostScript captured with the command-F trick? I captured some stuff from MacDraw but I couldn't even get this to print out on the LaserWriter hooked to my Unix system so I didn't bother trying it with psview. > > Thanks in advance, > > Al Conrad > conrad@saturn.ucsc.edu -- 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 Thu Dec 8 19:28:01 1988 Date: Thu, 8 Dec 88 19:28:01 EST To: NeWS-makers@brillig.umd.edu Subject: PostScript programming From: owen@Sun.COM (Owen Densmore) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) With DPS being made available as a product, PostScript programming will become far more wide spread. In particular, we've found in NeWS that use of classes and inheritance is the most natural way to manage large PostScript systems. Is there any DPS version of the NeWS class.ps file in existance today or being worked on? If so, I'd like to coordinate the NeWS version with it so we have a single OOP model shared between the two systems. In particular, we are looking at a very simple form of multiple inheritance derived from David Singer's work while he was at Schlumberger. The model is quite simple: the superclass specification may include an array of superclasses. Note that class Object simply uses an empty array, rather than the "null" it used to use. Amazingly enough, the code reduced in size in the conversion from single to multiple inheritance. If at all possible, I'd like the evolution of the classing mechanism in NeWS and DPS to be coordinated. Owen Densmore From don@brillig.umd.edu Thu Dec 8 21:17:07 1988 Date: Thu, 8 Dec 88 21:17:07 EST To: NeWS-makers@brillig.umd.edu Subject: problems with NeWS stuff on SUG tape From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Concerning the NeWS stuff on the SUG tape just made available, the two files: sex/news-tape/documents/NeWSCode.ps sex/news-tape/documents/NeWSProg.ps both get rangecheck errors while executing the getinterval operator. This occurs on both our Apple LaserWriter and Dataproducts LZR-2600 printers. Also, Bruce Schwartz's NewsDraw program fails to link on our SunOS 3.4 system. The unresolved reference is to sincos. Because sincos is no doubt in the SunOS 4.0 math library, can someone please send me a description of what it does. 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 ---------------------------------------------------------------------- Today's quote: Donal O'Shea (an OSF VP) on System V.4: "It's not of sufficient quality. People can't put commercial applications on it." From don@brillig.umd.edu Thu Dec 8 23:56:59 1988 Date: Thu, 8 Dec 88 23:56:59 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS running on VAX From: unmvax!pprg.unm.edu!cyrus@ucbvax.Berkeley.EDU (Tait Cyrus) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <24843@wlbr.EATON.COM> mh@wlbr.eaton.com.UUCP (Mike Hoegeman) writes: >In article <23677@pprg.unm.edu> cyrus@pprg.unm.edu (Tait Cyrus) writes: >>Has anyone taken the NeWS source and ported it to a VAX? I don't mean >>ported the client to run on a VAX, I mean ported the server to run AND >>display on a VAX. If not, know of anyone who has at least tried? > >I've seen NeWS running on a b&w ultrix vaxstation (don't know what >kind) in sun booths on occasion. I think sun themselves did it to >demonstrate how portable NeWS was but take that with a grain of salt. Hmm, well no one seems to know too much about NeWS running on a VAX, whether Ultrix or VMS. I guess Sun wants to keep it quiet, even from themselves because I received a reply from someone at Sun requesting information on any positive replies I received :^) Some folks say that there is a port in the NeWS source, but I have not seen any such animal in the source that is available for me to look at. If such an animal exists, I would have expected that someone would be running it, but as of yet I have not received anything saying that "yes we are running NeWS on our VAX". --- W. Tait Cyrus (505) 277-0806 e-mail: cyrus@pprg.unm.edu University of New Mexico Dept of ECE - Parallel Processing Research Group Albuquerque, New Mexico 87131 From don@brillig.umd.edu Fri Dec 9 10:27:33 1988 Date: Fri, 9 Dec 88 10:27:33 EST To: NeWS-makers@brillig.umd.edu Subject: color imaging in NeWS From: cogswell!alan@elroy.jpl.nasa.gov (Alan S. Mazer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Is it possible to do color imaging in NeWS? I've assumed it was, but now that I look at the manual, it doesn't say much about color, let alone color imaging. If it is possible, then does anyone know how easy it is to get 256 colors on a Sun console without losing the color map when the cursor leaves the window? I've got software that does this under SunView, but I have the feeling that the kludges that worked in SunView won't work in NeWS. Apologies if this has been discussed to death already; I'm new to this group. -- Alan ..!{ames,cit-vax}!elroy!alan * "But, seriously, what can alan@elroy.jpl.nasa.gov go wrong?" From don@brillig.umd.edu Fri Dec 9 10:29:01 1988 Date: Fri, 9 Dec 88 10:29:01 EST To: NeWS-makers@brillig.umd.edu Subject: Changing device characteristics in NeWS From: pyramid!prls!philabs!ppgbms!paul@decwrl.dec.com (Paul Matz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) We would like to use NeWS to generate printed output. Hard copy of display data could be generated in a number of ways. One way would be by shipping the postscript code and data parts of our NeWS programs directly to a postscript printer. Another would be by using screendump or writecanvas to create raster files that could be run through a raster-to-postscript filter on the way to a postscript printer. However, these solutions are too costly, considering the cost of a postscript laser printer. In addition, either method would most likely be very slow, because of the amount of data points that would need to be transmitted to the printer. What seems like the most promising approach, so far, is the new video HP laser printer interface technology. An AT bus card contains a bitmap of memory, and that data is transmitted via a video signal to another interface card in the laser printer. What this requires is the ability to format output data for devices with different characteristics than the main display device. It seems that NeWS has this ability intrinsicly; The fact that it works on displays of different resolutions shows this to be the case. The question is: Is there any way to specify the display device characteristics from outside NeWS, at the application level? As a example, visualize an application, which runs under NeWS that generates a formatted report that contains text and graphics. If it could open an "unmapped" canvas and re-define that canvas's color and resolution characteristics (color to monochrome, monitor resolution to 300 dpi), it could generate the report on that canvas, page by page, writing the resultant canvases, via the "writecanvas" command, to a file. That file could then be written to the output mechanism mentioned above, so long as the device characteristics match. During the process, other NeWS applications running on the display device would still need to operate normally. Anyone who has ported NeWS must have some idea whether any of this is feasible. As an aside, is there a filter available for converting image/raster files to HP LaserJet compatible output on a 386i? Please send any responses to: ppgbms!paul in addition to posting responses. Thanks (wishful thinking) Regards, Paul Matz PPG Biomedical Systems Pleasantville, NY. 914-741-4685 ppgbms!paul From don@brillig.umd.edu Fri Dec 9 12:22:09 1988 Date: Fri, 9 Dec 88 12:22:09 EST To: NeWS-makers@brillig.umd.edu Subject: Improving NeWS performance on SunOS 4.0 From: aramis.rutgers.edu!geneva.rutgers.edu!hedrick@rutgers.edu (Charles Hedrick) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) For some odd reason I like NeWS. Unfortunately, I am using a Sun 3/50, which has only 4MB of memory. NeWS (and probably also other window systems) are marginal with 4MB. I found that whenever I moved between windows, things paused for a few seconds while the program behind the new window got paged in. This was quite annoying. I'm managed to improve things markedly by rebuilding the NeWS software from source under 4.0. I assume this is because the sharable library saves memory. It may not save that much, but NeWS is right at a point where a relatively small saving matters a lot. That big change occured simply by rebuilding from source. (In the 1.1 source, you'll find you need to use -DFOURPOINT0 in order to get a few things to compile under 4.0.) In an attempt to save a bit more space, I also removed support for X10 (it never was very useful, and we're using X11). (Do this by redefining the symbols XSRC, XOBJ, and XHDRS, etc. to be null, and comment out the stuff about X in .../lib/NeWS/demomenu.ps.) Finally, I put "0 setretainthreshold" in my user.ps, on the theory that retained windows requires more memory, and I'm willing to use more CPU to save memory. Simplying recompiling under 4.0 made a difference. It's not clear that the other two things did. With my new version, it's possible to go back and forth between Emacs and psterm windows without swapping. The working set size seems to have gone from about 1.2M to 1M, but from its behavior with other programs, it appears that the RSS column under 4.0 includes the shared libraries, so the effective change is in fact slightly larger. Again, on an 8MB machine this change probably wouldn't be noticable, but on a 3/50 it is quite significant. (I also do various things to tune psterm, but I think I've mentioned that before. In particular, if you type quickly I strongly recommend that you turn off the "fast repaint" feature.) From don@brillig.umd.edu Fri Dec 9 17:56:20 1988 Date: Fri, 9 Dec 88 17:56:20 EST To: NeWS-makers@brillig.umd.edu Subject: Re: problems with NeWS stuff on SUG tape From: bvs@Sun.COM (Bruce Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Also, Bruce Schwartz's NewsDraw program fails to link on our SunOS 3.4 system. The unresolved reference is to sincos. Because sincos is no doubt in the SunOS 4.0 math library, can someone please send me a description of what it does. Sorry about that, sincos is as optimization. From the 4.0 man pages: #include double sin(x) double x; double cos(x) double x; void sincos(x, s, c) double x, *s, *c; Note that sincos(x,s,c) allows simultaneous computation of *s = sin(x) and *c = cos(x). I believe that a #define sincos(x,s,c) { *s = sin(x); *c = cos(x); } in one of the .h files will fix your problem. I'll be posting NewsDraw as well as a few of other programs: a new version of the class browser, an interactive lockscreen, a granite desktop, and NewsLine (a modified psview set up to view the Sun Porting Reference Guide). I could post the .ps files of the Guide (they're on the SUG tape too), but it's about 700k. Anyone have any ideas on how to post that? Bruce Schwartz From don@brillig.umd.edu Fri Dec 9 17:56:29 1988 Date: Fri, 9 Dec 88 17:56:29 EST To: NeWS-makers@brillig.umd.edu Subject: news From: knute@bink (Knute Christensen) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) How do I access the NeWS bulletin board? From don@brillig.umd.edu Fri Dec 9 17:56:43 1988 Date: Fri, 9 Dec 88 17:56:43 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Improving NeWS performance on SunOS 4.0 From: David Rosenthal Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Saving memory usage in NeWS will improve your performance, and especially on a 4M machine. The suggestions you make look sensible. However, it turns out that the most important way of saving memory on 4M Suns is configuring your kernel correctly. This is especially true with SunOS4.0, and the initial documentation that went out with 4.0 didn't give you a whole lot of help doing so. The first and most important thing is: NEVER RUN A GENERIC KERNEL The only thing generic kernels are good for is to configure other kernels. Beyond that, you should read Appendix E. of the current SunOS4.0 Read This First. The RTF has recently been updated - if you don't have an updated copy ask your salesperson or TSE. Appendix E gives a good deal of detail about how to configure your kernel to save the maximum amount of space. Depending on which of the hints you are able to use in your configuration, you can save up to half a megabyte of wired-down memory (that is what I was able to save on my 4M 3/75) as compared to running with the default (in my case SDST75) configuration. David. From don@brillig.umd.edu Fri Dec 9 20:14:41 1988 Date: Fri, 9 Dec 88 20:14:41 EST To: NeWS-makers@brillig.umd.edu Subject: SunOS4.0 4M performance (the real scoop) From: David Rosenthal Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here is the basic information that is in the RTF Appendix E. I have used most of these on my 3/75 for some time, adn I also ran a 3/50 for a while with them. I use NeWS1.1, X11R{2,3}, and X/NeWS, but not SunView. David. Routing Workstations with only one ethernet interface do not need to do dynamic routing with in.routed; instead, they can route statically by commenting out (# in column 1) these lines in /etc/rc.local: #if [ -f /usr/etc/in.routed ]; then # in.routed; (echo -n ' routed') >/dev/console #fi (Routing table entries can still be added or modified by the kernel as a result of ICMP redirect messages.) Diskless clients have a default route provided automatically by the server; on other workstations, a command of the form /usr/etc/route add default 1 can be added to rc.local, where "router" is the hostname of an IP router ("gateway") on your local network. This action frees up both the pages used by in.routed and most of the memory allocated for routing table entries. Here at Sun in Mountain View, static routing typically reduces the size of the routing table from over 150 entries to 3. Sendmail Receiving mail on a diskless workstation typically causes a significant amount of paging, not only due to the creation of sendmail and /bin/mail processes, but also due to alias resolution and access over the network to the mailbox on the server. Recommendation: have each client mount its spool directory via secure NFS, change the YP alias map to direct users' mail to their servers, and don't run sendmail on the clients. For example, add a line like the following to each client's /etc/fstab: server:/var/spool/mail /var/spool/mail nfs rw,bg,hard,intr,secure 0 0 Export /var/spool/mail on the server using the "secure" option. (Don't forget to run exportfs.) Change or create aliases in /etc/aliases on the YP master to provide aliases of the form user: user@server for all users who would otherwise receive mail on the clients, and re-make the YP alias map (cd /var/yp; make aliases). Comment out these lines in each client's /etc/rc.local and reboot the clients: #if [ -f /usr/lib/sendmail -a -f /etc/sendmail.cf ]; then # (cd /var/spool/mqueue; rm -f nf* lf*) # /usr/lib/sendmail -bd -q1h; (echo -n ' sendmail')>/dev/console #fi An interesting side effect of this change is that a user can receive mail even if the client workstation is down. This change is also useful in environments where users wish to be able to log in to any machine of a cluster and read their mail. Accounting Don't enable process accounting. If accounting is not configured into the kernel ("options SYSACCT"), or the file /var/adm/acct does not exist at boot time, accounting is not enabled (see /etc/rc). Other changes in /etc/rc.local Don't start unnecessary server processes. Typically only portmap, ypbind, biod (4 of them), syslogd, update, inetd, and lpd are required on client workstations. Add keyserv if you use secure NFS, and sendmail if you don't implement the sendmail strategy above. Miscellaneous Make sure that you have defined LOGHOST if required as specified on page 3 of the 4.0 Read This First document (part number 800-1737-16). Don't enable file system quotas. (By default, quotas are not enabled.) Replacing /usr/ucb/quota with /usr/bin/true will prevent possible delays at login time due to calls to rpc.rquotad on each NFS server from which you have a filesystem mounted. Use the default SunView background, and don't use retained windows. Don't enable in.rwhod. Minimizing kernel size (last but certainly not least) Kernel configuration file Remove all unnecessary entries from the kernel configuration file. For example, the following lines can be removed from DL50 in /usr/sys/sun3/conf: options CRYPT (unless you use secure NFS) pseudo-device clone pseudo-device snit pseudo-device pf pseudo-device nbuf device des0 at obio ? csr 0x1c0000 Streams NIT is used by etherfind; to run etherfind, boot another kernel or run it on the server. In many cases "maxusers" can be reduced to 3. Also, these lines can be changed as follows: pseudo-device dtop1 pseudo-device ms1 pseudo-device kb1 Streams buffers The default allocation of streams buffers is overly generous. Use the following procedure to make a kernel with smaller allocations. 1. Run config using your modified configuration file. 2. In /usr/share/sys/sun3//param.c, modify these lines as follows: #define NBLK2048 4 #define NBLK1024 4 #define NBLK512 4 #define NBLK256 16 #define NBLK128 64 #define NBLK64 64 #define NBLK16 64 #define NBLK4 64 #define NSTREAM 20 #define NMUXLINK 37 #define NSTREVENT 64 Larger allocations may be required in some environments; in some circumstances running out can deadlock the system. Check your usage with netstat -m. 3. Run "make". Ethernet buffers If you have an "le" Ethernet interface (Sun-3/50 or 3/60), reduce the number of Ethernet buffers: adb -w vmunix _le_nrmdp2?W 3 _le_nrbufs?W A (type ^D or $q to quit) If you have an "ie" Ethernet interface: adb -w vmunix _ie_tbufs?W 1 _ie_rbds?W 6 _ie_rfds?W 5 _ie_rbufs?W 9 (^D or $q to quit) UFS (Unix file system) buffers If you have a disk, you can reduce the number of buffers allocated to the UFS buffer cache: adb -w vmunix _nbuf?W 6 (^D or $q to quit) Those of you with access to the patch machine 'yabbadabba' can retrieve scripts to make the above kernel changes from /CSD/4.0perf. From don@brillig.umd.edu Fri Dec 9 20:16:38 1988 Date: Fri, 9 Dec 88 20:16:38 EST To: NeWS-makers@brillig.umd.edu Subject: news-tape available via anonymous ftp from tumtum From: don@tumtum.cs.umd.edu (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've put the news-tape directory (that was on the Sun Users Group SEx machine) in tumtum's anonymous ftp directory. (There was some junk in /usr/crash, so I was able to find enough disk space!) It's split up into 8 half meg files, "news-tape.tar.Z.a[a-h]". Total uncompressed size: 10114 kilos. This is an early release -- there's a bunch of unorganized stuff, and I still don't have the most recent versions of everything with appropriate copyright notices in place. Please tell me about things that don't work, and send improvements and stuff you'd like to include! Instructions: ftp to tumtum.cs.umd.edu (128.8.128.49), and log in as user anonymous, password anything. Set binary mode!! Change to the NeWS directory. The file news-tape.sum has checksums for everything (except itsself), and news-tape.list.Z is a list of all the files. Get the files "news-tape.tar.Z.a[a-h]", cat them together, uncompress them, and untar them. Stay up all night and play! -Don From don@brillig.umd.edu Sat Dec 10 09:24:02 1988 Date: Sat, 10 Dec 88 09:24:02 EST To: NeWS-makers@brillig.umd.edu Subject: More on the RTF From: David Rosenthal Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Customers can order the new RTF using part number 800-1737-17 (Rev. A, Nov. 8, 1988). The fixes are in appendix E and the kernel configuration instructions are appendix D. David. From don@brillig.umd.edu Sun Dec 11 11:24:55 1988 Date: Sun, 11 Dec 88 11:24:55 EST To: NeWS-makers@brillig.umd.edu Subject: reference card for NeWS From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The recent SUG tape contains a reference card for PostScript in PostScript. Is there a reference card for NeWS in PostScript? 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 ---------------------------------------------------------------------- Today's quote: Donal O'Shea (an OSF VP) on System V.4: "It's not of sufficient quality. People can't put commercial applications on it." From don@brillig.umd.edu Sun Dec 11 11:26:11 1988 Date: Sun, 11 Dec 88 11:26:11 EST To: NeWS-makers@brillig.umd.edu Subject: faces (visual mail/printer monitor). From: sunaus!sunchat!richb@Sun.COM (Rich Burridge) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The next three messages contain the latest version of faces, a visual mail/printer monitor.Could you please place them in your archives. This is the second general release of a face server for monitoring mail and print jobs. It is based on the Bell Labs v8 vismon program, and this version is vismon compatible, but is not derived from AT&T sources. This version contains drivers for SunView and NeWS graphics systems. Permission is given to distribute these sources, as long as the copyright messages are not removed, and no monies are exchanged. See the README and manual page for more details. Save the subsequent messages in a new directory, strip off the beginning down to and including the CUT HERE line, unpack with sh, then type "make sunview" for the SunView version or "make news" for the NeWS version. Then install with "make install". Note that you might need super-user permission to do this successfully. Create your face directory, hostname sub-directories username ikons/icons, machine and people tables, and you're set. Note that if you are compiling faces under v3.x of the SunOS, then there is a line in the Makefile starting with OSTYPE, that needs to be uncommented. If anybody can work out what needs to be done to fix the problem of the window/icon always moving back to the initial position (see the BUGS section of the man page), then I'll be very pleased to hear from them. If you already have your face scanned in and iconised and would like to add it to the library I'm building up, please feel free to email it to me. Bugs, flames and suggestions to me please. Acknowledgements. Thanks go to Guy Harris for the basis of the latest manual page, Dave Lemke for many excellent suggestions including the animated postscript faces, to Andrew Nicholson for help with some of the trickier NeWS code, to Dan Heller for writing the 'watch' program which was consulted in the early days, to Rob Pike for sending me a copy of the Pike/Presotto paper "Face the Nation", which I used to get vismon compatibility, and to everybody else who suggested enhancements, and fixed bugs in the previous version. Rich. Rich Burridge, DOMAIN: richb@sunaus.oz.au PHONE: +61 2 413 2666 UUCP: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb From don@brillig.umd.edu Sun Dec 11 11:31:00 1988 Date: Sun, 11 Dec 88 11:31:00 EST To: NeWS-makers@brillig.umd.edu Subject: faces (visual mail/printer monitor) - Part 1 of 3. From: sunaus!sunchat!richb@Sun.COM (Rich Burridge) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is the second general release of a face server for monitoring mail and print jobs. It is based on the Bell Labs v8 vismon program, and this version is vismon compatible, but is not derived from AT&T sources. This version contains drivers for SunView and NeWS graphics systems. Permission is given to distribute these sources, as long as the copyright messages are not removed, and no monies are exchanged. See the README and manual page for more details. Save this, and subsequent messages in a new directory, strip off the beginning down to and including the CUT HERE line, unpack with sh, then type "make sunview" for the SunView version or "make news" for the NeWS version. Then install with "make install". Note that you might need super-user permission to do this successfully. Create your face directory, hostname sub-directories username ikons/icons, machine and people tables, and you're set. Note that if you are compiling faces under v3.x of the SunOS, then there is a line in the Makefile starting with OSTYPE, that needs to be uncommented. If anybody can work out what needs to be done to fix the problem of the window/icon always moving back to the initial position (see the BUGS section of the man page), then I'll be very pleased to hear from them. If you already have your face scanned in and iconised and would like to add it to the library I'm building up, please feel free to email it to me. Bugs, flames and suggestions to me please. Acknowledgements. Thanks go to Guy Harris for the basis of the latest manual page, Dave Lemke for many excellent suggestions including the animated postscript faces, to Andrew Nicholson for help with some of the trickier NeWS code, to Dan Heller for writing the 'watch' program which was consulted in the early days, to Rob Pike for sending me a copy of the Pike/Presotto paper "Face the Nation", which I used to get vismon compatibility, and to everybody else who suggested enhancements, and fixed bugs in the previous version. Rich Burridge - December 1988. ------CUT HERE------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 to create the files: # README # faces.1 # faces.ps # machine.tab # people.tab # Makefile # extern.h # faces.h # patchlevel.h # noface.icon # nomail.icon # noprint.icon # nopaper.icon # This archive created: Sun Dec 11 15:16:23 EST 1988 # # export PATH; PATH=/bin:$PATH # if [ -f README ] then echo shar: will not over-write existing file README else echo shar: extracting 'README', 2703 characters cat > README <<'Funky_Stuff' README for faces, the visual mail and print monitor. Version 1.3 December 1988. Permission is given to distribute these sources, as long as the copyright messages are not removed, and no monies are exchanged. This is the second general release of a "faces" server for monitoring mail or print jobs. It contains graphical interfaces for SunView and NeWS. The X11 and blit versions are being worked on. Expect them in the near future. Faces has three different modes of operation: The default will monitor for new mail. Only the last ten messages are displayed. In its iconic form, it is also possible to display the timestamp of each message, and the open window format can give the username. The second choice is to monitor the whole of a mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. In the iconic form, a timestamp of the last message plus the number of mail messages from this person are optional display parameters. The final option allows this program to monitor a given print queue. This will generate a single face icon showing the job at the top of the print queue, and a text message will display the number of messages to be printed. Opening the window will show all the jobs in the queue with the owners' name and the size of the job in bytes. Faces is based on the AT&T v8 face server called vismon, but is not derived from vismon sources. With this version comes vismon compatibility. Note that this has resulted in a few changes from the way faces v1.1 worked. Please see the manual pages for details. There is a face directory, and under that are directories which are hostnames. Under that are username directories, and this is where the face images are placed. The face images are currently stored in one of three ways: 1. NeWS .ps format, called face.ps. 2. Sun icon format, called sun.icon. 3. Blit ikon format, called 48x48x1. The NeWS .ps allow for animation with the users' face. These files are drawn when the rest of the static faces have been displayed. They will be redrawn every time the mail or print queue is recheck or when the faces window or icon is damaged. See the manual page for details on the conditions imposed on these NeWS .ps files. By default, after every sixty seconds, faces will recheck the mail file or the print queue. If the mail spool file has changed size, it will produce a chain of records for which it has face icons. I welcome bug reports and suggestions for improvements. Rich. Rich Burridge, DOMAIN: richb@sunaus.oz.au PHONE: +61 2 413 2666 UUCP: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb Funky_Stuff len=`wc -c < README` if [ $len != 2703 ] ; then echo error: README was $len bytes long, should have been 2703 fi fi # end of overwriting check if [ -f faces.1 ] then echo shar: will not over-write existing file faces.1 else echo shar: extracting 'faces.1', 6804 characters cat > faces.1 <<'Funky_Stuff' .\" @(#)faces.1 1.2 88/12/11 .TH FACES 1L "2 December 1988" .SH NAME faces \- visual mail and print face server for the Sun workstation .SH SYNOPSIS .B "faces [ .B \-P .I printer ] [ .B \-a ] [ .B \-b .I background ] [ .B \-f .I facedir ] [ .B \-i ] [ .B \-n ] [ .B \-p .I period ] [ .B \-s .I spoolfile ] [ .B \-t ] [ .B \-u ] [ .B \-v ] [ .B \-Wi ] [ .B \-Wp .I x y ] [ .B \-WP .I x y ] .SH DESCRIPTION .B faces is a window based tool for monitoring mail or print queues. It contains graphical interfaces for SunView and NeWS. It has three different modes of operation: .LP The default will monitor for new mail. Only the last ten messages are displayed. In its iconic form, it is also possible to display the timestamp of each message, and the open window format can give the username. .LP The second choice is to monitor the whole of a mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. In the iconic form, a timestamp of the last message plus the number of mail messages from this person are optional display parameters. .LP The final option allows this program to monitor a given print queue. This will generate a single face icon showing the job at the top of the print queue, and a text message will display the number of messages to be printed. Opening the window will show all the jobs in the queue with the owners' name and the size of the job in bytes. .LP There are special displays for no mail, no faces found, no print jobs, and no paper in the printer. .LP .B faces is based on the AT&T v8 program .B vismon. This program is not derived from .B vismon source. .LP There is a special faces directory containing a fixed three-level hierarchy, which by default is .I /usr/local/faces. The first level is a machine name, the second level a user name, and the third level is the actual face image, which can be stored in three formats. If the file is named .I 48x48x1 then it is a Blit ikon, and if it is called .I sun.icon then the image is stored in Sun icon format, and if the file is named .I face.ps then it contains executable NeWS code. .LP To access the face for a mail name .I machine!uid take the result of the first successful open from the following list of files: .LP /usr/local/faces/machine/uid/face.ps .br /usr/local/faces/machine/uid/sun.icon .br /usr/local/faces/machine/uid/48x48x1 .br /usr/local/faces/misc./uid/face.ps .br /usr/local/faces/misc./uid/sun.icon .br /usr/local/faces/misc./uid/48x48x1 .br /usr/local/faces/machine/unknown/face.ps .br /usr/local/faces/machine/unknown/sun.icon .br /usr/local/faces/machine/unknown/48x48x1 .br /usr/local/faces/misc./unknown/face.ps .br /usr/local/faces/misc./unknown/sun.icon .br /usr/local/faces/misc./unknown/48x48x1 .LP The directory .I misc. hold faces for generic users such as .I root and .I uucp. .LP Faces information is administered by a pair of ASCII files that associate related machines and faces. The machine table .I machine.tab attaches machines to communities; the line .LP stard=sunaus .LP puts the machine .I stard in community .I sunaus. The people table associates a community/alias pair, with a real username. .LP sunaus/rburridge=richb .LP causes the alias .I rburridge to be translated into the real username .I richb for the community .I sunaus .LP Domain name structure would be handled in the same way. For example: .LP sunaus.sun.oz=sunaus .LP would map the full domain name in the community .I sunaus. .LP If the faces directory hierarchy is not found, then a blank face image will be used. .LP Note that you still need to use .I mailtool or some other mail reading utility to actually read the mail that this program monitors; .I faces simply displays who the mail is from. .LP When new mail arrives, .B faces will beep and flash appropriately, depending upon the set parameters in the users .I .mailrc file. .LP If you are using the NeWS version and creating face images of the .I face.ps form, then the following points should be noted: .LP All graphics operations should be performed on the unit square. .br The final image will be translated to a 64 x 64 square image at .br the appropriate position in the faces display. .br .SH OPTIONS .TP .BI \-P " printer" Printer name to monitor. If this and a mail spool file are given with the -s option, .B faces will monitor the print queue. .TP .B \-a Monitor the whole of the specified mail file. The icon and open window display the appropriate faces, and dynamically change size as a new check is made and if the mail file has altered size. .TP .BI \-b " background" Sun icon file containing an alternate background pattern. The default is root grey. .TP .BI \-f " facedir" Use an alternate name for the faces directory. The default is .BR /usr/local/faces . .TP .B \-i Invert the faces images before displaying them. For use by people who started SunView with the .B \-i option. .TP .B \-n Do not display the number of messages from this person. The default is to display, and a count is shown at the bottom right corner of the face for this person. .TP .BI \-p " period" The period in seconds before the mail spool file or the print queue is scanned again for new mail. The default is 60 seconds. .TP .BI \-s " spoolfile" Use an alternate mail spool file to monitor. The default is .BI /var/spool/mail/ username where .I username is the name of the user currently logged in. .TP .B \-t Do not display a timestamp of the last message from this person. The default is to display, and a timestamp is shown at the bottom left corner of the face for this person. .TP .B \-u Do not display the username on the face icon. The default is to display, and the username will appear over the face icon, when the window is opened. .TP .B \-v Print the version number of this release of the .B faces program. .TP .B \-Wi Start the .B faces program up in iconic form. SunView automatically uses this flag, but the NeWS version will also. .TP .BI \-Wp " x y" Start the open window position at .I x y .TP .BI \-WP " x y" Start the icon position at .I x y .SH FILES .TP .B /var/spool/mail directory for system mailboxes .TP .B /.mailrc mail startup file .TP .B /usr/local/faces main directory containing the face icons. .TP .B /usr/local/faces/people.tab people/file equivalences .TP .B /usr/local/faces/machine.tab machine/community equivalences .SH BUGS The machine and people table lookup is hopelessly inefficient and will need to be improved as the faces database gets larger. .br If the window/icon for the NeWS version is moved, then the window or icon is redrawn at the original position. .SH AUTHOR Rich Burridge, DOMAIN: richb@sunaus.oz.au .nf PHONE: +61 2 413 2666 UUCP: {uunet,mcvax,ukc}!munnari!sunaus.oz!richb .fi Funky_Stuff len=`wc -c < faces.1` if [ $len != 6804 ] ; then echo error: faces.1 was $len bytes long, should have been 6804 fi fi # end of overwriting check if [ -f faces.ps ] then echo shar: will not over-write existing file faces.ps else echo shar: extracting 'faces.ps', 3760 characters cat > faces.ps <<'Funky_Stuff' % These are NeWS dependent graphics routines used by faces. % % @(#)faces.ps 1.3 88/12/11 % % Copyright (c) Rich Burridge - Sun Microsystems Australia. % All rights reserved. % % Permission is given to distribute these sources, as long as the % copyright messages are not removed, and no monies are exchanged. % % No responsibility is taken for any errors or inaccuracies inherent % either to the comments or the code of this program, but if reported % to me, then an attempt will be made to fix them. /ClearBox % x y width height canvas => - { setcanvas rectpath 0 setgray fill } def /DoPixrects % width height canvas => - { dup setcanvas 3 1 roll 0 0 4 -2 roll rectpath reshapecanvas } def /ExecFile % psfile width height x y => - { Frame /Iconic? get { Frame /IconCanvas get } { Frame /ClientCanvas get } ifelse setcanvas translate scale (r) file cvx exec } def /InitFont % - => - { /Font /Courier findfont 7 scalefont def } def /MakeFrame % wx wy width height ix iy iconic => - { [ /IsIcon /IconY /IconX /FrameHeight /FrameWidth /FrameY /FrameX ] { exch def } forall /DIED 100 def /PAINTED 101 def /ClientHeight FrameHeight 10 sub def /ClientWidth FrameWidth 10 sub def /IconHeight FrameHeight def /IconWidth FrameWidth def /PR framebuffer newcanvas def PR /Transparent false put PR /Mapped false put PR /Retained true put /MPR framebuffer newcanvas def MPR /Transparent false put MPR /Mapped false put MPR /Retained true put /Frame framebuffer /new DefaultWindow send def { /IconX IconX def /IconY IconY def /BorderTop 5 def /BorderLeft 5 def /BorderBottom 5 def /BorderRight 5 def /ControlSize 0 def /ForkPaintClient? false def /destroy { DIED typedprint DestroyFrame DestroyClient } def /flipiconic { PAINTED typedprint /unmap self send /Iconic? Iconic? not def IconX null eq { FrameX FrameY FrameHeight add IconHeight sub /move self send } if ZoomProc /map self send } def /PaintClient { gsave 1 fillcanvas ClientWidth ClientHeight scale 0 setgray Invert PR imagemaskcanvas grestore } def /PaintIcon { gsave 1 fillcanvas IconWidth IconHeight scale 0 setgray Invert MPR imagemaskcanvas grestore } def } Frame send IsIcon 1 eq { /flipiconic Frame send } if } def /MakeText % string x y canvas => - { setcanvas Font setfont 1 setgray moveto show } def /MoveImage % srccanvas width height x y destcanvas => - { setcanvas gsave translate scale imagecanvas grestore } def /SetBackground % - => - { PR setcanvas 0.88 fillcanvas 5 setrasteropcode clippath fill MPR setcanvas 0.88 fillcanvas 5 setrasteropcode clippath fill } def /ShiftImage % dx dy width height canvas => - { setcanvas 0 0 4 -2 roll rectpath copyarea } def /ShowDisplay % framewidth frameheight iconwidth iconheight => - { [ /IconHeight /IconWidth /ClientHeight /ClientWidth ] { exch def } forall /FrameHeight ClientHeight 10 add def /FrameWidth ClientWidth 10 add def FrameX FrameY FrameWidth FrameHeight /reshape Frame send Frame /IconWidth IconWidth put Frame /IconHeight IconHeight put /ShapeIconCanvas Frame send /painticon Frame send Frame /ClientHeight ClientHeight put Frame /ClientWidth ClientWidth put /ShapeClientCanvas Frame send /paintclient Frame send /map Frame send } def Funky_Stuff len=`wc -c < faces.ps` if [ $len != 3760 ] ; then echo error: faces.ps was $len bytes long, should have been 3760 fi fi # end of overwriting check if [ -f machine.tab ] then echo shar: will not over-write existing file machine.tab else echo shar: extracting 'machine.tab', 383 characters cat > machine.tab <<'Funky_Stuff' stard=sunaus extra=sunaus sunchat=sunaus garfield=sunaus tom=sunaus felix=sunaus sunk=sunaus sunsa=sunaus misaus=sunaus maverick=sunaus misaus1=sunaus nimbin=sunaus redgum=sunaus palette=sunaus sunwa=sunaus sunact=sunaus basset=basser castor.cs.su.oz=basser cluster.cs.su.oz=basser orwell=basser sarad=basser sasha=basser sunrise=basser gris=softway softway.sw.oz=softway arakis=sun Funky_Stuff len=`wc -c < machine.tab` if [ $len != 383 ] ; then echo error: machine.tab was $len bytes long, should have been 383 fi fi # end of overwriting check if [ -f people.tab ] then echo shar: will not over-write existing file people.tab else echo shar: extracting 'people.tab', 1663 characters cat > people.tab <<'Funky_Stuff' sunaus/rallen=bob sunaus/ballen=bob sunaus/bbaker=bruceb sunaus/mbosch=mike sunaus/eddy=eddie sunaus/eevans=eddie sunaus/ggrell=grell sunaus/gene=grell sunaus/jingall=johni sunaus/ijeffery=ian sunaus/glynne=gjl sunaus/tmcentee=tim sunaus/jnoonan=johnn sunaus/apappas=arie sunaus/jennie=jenny sunaus/jrendell=jenny sunaus/gsearle=gjs sunaus/gsitters=greg sunaus/bscott=brad sunaus/rstewart=ruth sunaus/jteasdale=jim sunaus/loraine=lori sunaus/lorraine=lori sunaus/lunicomb=lori sunaus/pvrbancich=paula sunaus/swoodhead=simon sunaus/jy=yo sunaus/jyoung=yo sunaus/rboden=richard sunaus/rbodin=richard sunaus/rburridge=richb sunaus/rich=richb sunaus/mcunningham=mary sunaus/sduchesne=sue sunaus/mfredericks=max sunaus/mfredricks=max sunaus/bgeneralis=bill sunaus/shulbert=susanh sunaus/susan=susanh sunaus/gmason=gregm sunaus/vmickan=val sunaus/trogge=tony sunaus/andy=aspiers sunaus/bwiggins=bruce sunaus/ryeap=ron sunaus/cbreen=colinb sunaus/rdesalis=roger sunaus/mfort=markf sunaus/mark=markg sunaus/mgurvis=markg sunaus/mnegri=manuel sunaus/npettitt=noel sunaus/jraine=john sunaus/paul=paulr sunaus/prosham=paulr sunaus/gsweigert=geo sunaus/rbowman=robb sunaus/bbowman=robb sunaus/krees=kim sunaus/mikes=mslee sunaus/gshepherd=george sunaus/aweller=andrew sunaus/kbeavan=kevin sunaus/rbradford=rhonda sunaus/ckeith=colin sunaus/mmccann=mmc sunaus/ksterry=kaylene sunaus/rwilliams=rex sunaus/gdonin=gary sunaus/dshea=dennis sunaus/doshea=dennis sunaus/hprotoolis=harry sunaus/rschrader=robert sunaus/bschrader=robert sunaus/bobs=robert sunaus/jvermeulen=jeff sunaus/MAILER-DAEMON=mailer-daemon sunaus/Mailer-Daemon=mailer-daemon sunaus/mailer-daemon=mailer-daemon Funky_Stuff len=`wc -c < people.tab` if [ $len != 1663 ] ; then echo error: people.tab was $len bytes long, should have been 1663 fi fi # end of overwriting check if [ -f Makefile ] then echo shar: will not over-write existing file Makefile else echo shar: extracting 'Makefile', 4323 characters cat > Makefile <<'Funky_Stuff' # # Makefile for faces, an icon face server, plus associated software. # # @(#)Makefile 1.1 88/12/04 # # Copyright (c) Rich Burridge. # Sun Microsystems, Australia - All rights reserved. # # Permission is given to distribute these sources, as long as the # copyright messages are not removed, and no monies are exchanged. # # Version 1.3 - December 1988. # # No responsibility is taken for any errors inherent either # to the comments or the code of this program, but if reported # to me then an attempt will be made to fix them. # #------------------------------------------------------------------ # There are various command line options with the faces program. # They can also be defined at compile time. If they are not present # here, then sensible default values are used. The values given # below are the defaults, except for the spoolfile name where the # default is obtained from the users' passwd entry. # # # Monitor type (0 = monitor all, 1 = monitor new, 2 = monitor printer). # FMONTYPE = -DFMONTYPE=1 # # Alternate background pattern instead of root gray. # BACKGROUND = -DBACKGROUND=\"\" # # Different directory for face icons, # FACEDIR = /usr/local/faces FACEPARAM = -DFACEDIR=\"$(FACEDIR)\" # # If nonzero, then display face images in reverse video. # INVERT = -DINVERT=0 # # Period in seconds for checking for new mail or print jobs, # PERIOD = -DPERIOD=60 # # If nonzero, do not show number of messages on the face icon, # DONTSHOWNO = -DDONTSHOWNO=0 # # Alternative spoolfile to monitor, # eg: SPOOLFILE = -DSPOOLFILE=\"/usr/richb/Mail/pending\" # #SPOOLFILE = # # If nonzero, do not show timestamp on the face icon. # DONTSHOWTIME = -DDONTSHOWTIME=0 # # If nonzero, do not show username on the face icon. # DONTSHOWUSER = -DDONTSHOWUSER=0 #------------------------------------------------------------------- VARIABLES = $(FMONTYPE) $(BACKGROUND) $(FACEPARAM) \ $(INVERT) $(PERIOD) $(DONTSHOWNO) $(SPOOLFILE) \ $(DONTSHOWTIME) $(DONTSHOWUSER) BINARIES = ps_faces sv_faces BINDIR = /usr/local/bin FACES = facedir LIBDIR = /usr/local/lib NEWSFILE = -DNEWSGIVEN -DNEWSFILE=\"$(LIBDIR)/faces.ps\" MANDIR = /usr/man/man$(MANSECT) MANSECT = l # # If you are compiling faces under v3.x of SunOS, then uncomment this line. #OSTYPE = -DSUNOS3.x CFLAGS = -g $(NEWSFILE) $(OSTYPE) $(VARIABLES) HDRS = extern.h faces.h patchlevel.h IMAGES = noface.icon nomail.icon noprint.icon nopaper.icon PSLIBS = $$NEWSHOME/lib/libcps.a PSOBJS = get.o main.o mon.o news.o rec.o PSSRCS = get.c main.c mon.c news.c rec.c SVLIBS = -lsuntool -lsunwindow -lpixrect SVOBJS = get.o main.o mon.o rec.o sunview.o SVSRCS = get.c main.c mon.c rec.c sunview.c OTHERS = README faces.1 faces.ps machine.tab people.tab Makefile SRCS = get.c main.c mon.c news.c rec.c sunview.c all: sunview news news: ps_faces cp ps_faces faces sunview: sv_faces cp sv_faces faces ps_faces: $(PSOBJS) cc -o ps_faces $(CFLAGS) $(PSOBJS) $(PSLIBS) sv_faces: $(SVOBJS) cc -o sv_faces $(CFLAGS) $(SVOBJS) $(SVLIBS) install: $(BINARIES) install -s -m 751 faces $(BINDIR) install -c -m 644 faces.ps $(LIBDIR) install -c -m 644 machine.tab $(FACEDIR) install -c -m 644 people.tab $(FACEDIR) install -c -m 644 faces.1 $(MANDIR)/faces.$(MANSECT) backup:; cp -r $(SRCS) $(HDRS) $(IMAGES) $(OTHERS) $(FACES) backdir clean:; rm -f *.o $(BINARIES) faces core lint:; lint -DNEWSGIVEN -DNEWSFILE=\"$(LIBDIR)/faces.ps\" $(PSSRCS) lint $(SVSRCS) $(SVLIBS) shar:; shar.script $(OTHERS) $(HDRS) $(IMAGES) > archive.1 shar.script $(SRCS) > archive.2 shar.script $(FACES) > archive.3 create: SCCS -sccs create $(SRCS) $(HDRS) $(IMAGES) $(OTHERS) SCCS: mkdir SCCS chmod 755 SCCS get.o: get.c faces.h extern.h patchlevel.h main.o: main.c faces.h Makefile mon.o: mon.c faces.h extern.h news.o: news.c faces.h extern.h rec.o: rec.c faces.h extern.h sunview.o: sunview.c extern.h $(IMAGES) Funky_Stuff len=`wc -c < Makefile` if [ $len != 4323 ] ; then echo error: Makefile was $len bytes long, should have been 4323 fi fi # end of overwriting check if [ -f extern.h ] then echo shar: will not over-write existing file extern.h else echo shar: extracting 'extern.h', 3566 characters cat > extern.h <<'Funky_Stuff' /* @(#)extern.h 1.2 88/12/11 * * Contains the external variable definitions used by faces. * * Copyright (c) Rich Burridge. * Sun Microsystems, Australia - All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ extern char *get_field(), *getname() ; extern int do_check() ; struct recinfo *rec_exists() ; extern struct comminfo *communities ; /* Community alias/username chain. */ extern struct comminfo *clast ; /* End of chain of community records. */ extern struct machinfo *machines ; /* Known machine/communities. */ extern struct machinfo *mlast ; /* End of chain of machine records. */ extern struct psinfo *psrecs ; /* List of news.ps animation files. */ extern struct psinfo *plast ; /* End of chain of NeWS animation files. */ extern struct recinfo *recs ; /* Mail messages being monitored. */ extern struct recinfo *last ; /* End of the chain of mail records. */ extern struct stat buf ; /* Buffer for stat call for file existence. */ extern long lastsize ; /* Last known size of the mail folder. */ extern enum gr_type gtype ; /* Indicates what graphics system is being used. */ extern enum mon_type mtype ; /* What type of monitoring we should do. */ extern char bgicon[] ; /* Alternate background pattern. */ extern char community[] ; /* Community name ("real" host name). */ extern char facedir[] ; /* Directory containing face images. */ extern char iconname[] ; /* Name of the icon file for this person. */ extern char machfile[] ; /* Name of the machine/community file. */ extern char nextline[] ; /* Next line from users mail spool file. */ extern char peopfile[] ; /* Name of the people/username file. */ extern char printer[] ; /* Printer name to monitor. */ extern char progname[] ; /* Name of this program. */ extern char spoolfile[] ; /* Full pathname of users current mail. */ extern int beeps ; /* Number of beeps for arrival of new mail. */ extern int column ; /* Column number for next icon. */ extern int dontshowno ; /* Set if no. of messages shouldn't be shown. */ extern int dontshowtime ; /* Set if timestamp shouldn't be shown. */ extern int dontshowuser ; /* Set if username shouldn't be shown. */ extern int facetype ; /* Type of face file found. */ extern int firsttime ; /* Zeroised after first mail/printer check. */ extern int flashes ; /* Number of flashes for arrival of new mail. */ extern int height ; /* Height in pixels of faces display. */ extern int iconic ; /* Start as an icon if set. */ extern int invert ; /* Set if to use reverse video. */ extern int ix ; /* Initial X position of the icon. */ extern int iy ; /* Initial Y position of the icon. */ extern int newmail ; /* Set if there is new mail this time around. */ extern int noicons ; /* Number of faces this time around. */ extern int period ; /* Period in seconds for checking new mail. */ extern int row ; /* Row number for next icon. */ extern int width ; /* Width in pixels of faces display. */ extern int wx ; /* Initial X position of the window. */ extern int wy ; /* Initial Y position of the window. */ Funky_Stuff len=`wc -c < extern.h` if [ $len != 3566 ] ; then echo error: extern.h was $len bytes long, should have been 3566 fi fi # end of overwriting check if [ -f faces.h ] then echo shar: will not over-write existing file faces.h else echo shar: extracting 'faces.h', 4482 characters cat > faces.h <<'Funky_Stuff' /* @(#)faces.h 1.3 88/12/09 * * Contains all the global definitions used by faces. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ #include #include #include #include #include #include #include #include #define FCLOSE (void) fclose /* To make lint happy. */ #define FFLUSH (void) fflush #define FGETS (void) fgets #define FPRINTF (void) fprintf #define FSEEK (void) fseek #define GETHOSTNAME (void) gethostname #define GET_SUN_ICON (void) get_sun_icon #define IOCTL (void) ioctl #define PUTC (void) putc #define SELECT (void) select #define SSCANF (void) sscanf #define SPRINTF (void) sprintf #define STRCAT (void) strcat #define STRCPY (void) strcpy #define STRNCAT (void) strncat #define STRNCPY (void) strncpy #define UNLINK (void) unlink /* The types of display. */ enum disp_type { BOTH, ICON, WINDOW } ; /* Field extraction options. */ enum field_type { HOSTNAME, TIMESTAMP, USERNAME } ; /* Different types of possible face images. */ enum icon_type { NOMAIL, NOPAPER, NOPRINT, ORDINARY } ; /* Text justification within face display. */ enum just_type { LEFT, RIGHT } ; /* Different types of file monitoring performed by this program. */ enum mon_type { MONALL, MONNEW, MONPRINTER } ; /* Different graphics systems appropriate one set in gtype. */ enum gr_type { SUNVIEW, NEWS } ; /* Determine order for face type lookup. */ #define NEWSTYPE 0 #define SUNTYPE 1 #define BLITTYPE 2 /* NeWS return event values. */ #define DIED 100 /* Faces has been zapped. */ #define PAINTED 101 /* Canvas/Icon needs repainting. */ #define BLITHEIGHT 48 /* Maximum number of lines in a blit icon. */ #define EQUAL(str,val) !strncmp(str,val,strlen(val)) #define ICONHEIGHT 64 /* Height of individual face icons. */ #define ICONWIDTH 64 /* Width of individual face icons. */ #define INC argc-- ; argv++ ; #define MAXLINE 200 /* Maximum length for character strings. */ #define MAXTYPES 3 /* Maximum number of different face types. */ #define NO_PER_ROW 10 /* Number of faces per row. */ char *getenv(), *malloc(), *sprintf() ; struct machinfo /* Machine/community record. */ { char *machine ; /* Machine name. */ char *community ; /* Community it belongs to. */ struct machinfo *next ; /* Pointer to next record. */ } ; struct comminfo /* Community alias/username records. */ { char *community ; /* Community name. */ struct peopinfo *people ; /* Chain of alias/usernames. */ struct comminfo *next ; /* Pointer to next record. */ } ; struct peopinfo /* Username/alias record. */ { char *alias ; /* Alias for this user. */ char *username ; /* Real username. */ struct peopinfo *next ; /* Pointer to next record. */ } ; struct psinfo /* News.ps animation records. */ { char *name ; /* Full pathname of news.ps file. */ int row ; /* Row number where animation will occur. */ int column ; /* Column number where animation will occur. */ struct psinfo *next ; /* Pointer to next record. */ } ; struct recinfo /* Mail/print information record. */ { char *community ; /* Community name for this person. */ char *iconname ; /* Name of iconfile for this person. */ char *username ; /* User name for this person. */ int total ; /* Total number of messages/print jobs. */ int size ; /* Total size in bytes of print job. */ char ts[6] ; /* Latest timestamp for this user. */ struct recinfo *next ; /* Pointer to next record. */ } ; Funky_Stuff len=`wc -c < faces.h` if [ $len != 4482 ] ; then echo error: faces.h was $len bytes long, should have been 4482 fi fi # end of overwriting check if [ -f patchlevel.h ] then echo shar: will not over-write existing file patchlevel.h else echo shar: extracting 'patchlevel.h', 560 characters cat > patchlevel.h <<'Funky_Stuff' /* @(#)patchlevel.h 1.1 88/12/04 * * This is the current patch level for this version of faces. * * Copyright (c) Rich Burridge. * Sun Microsystems, Australia - All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if * reported to me then an attempt will be made to fix them. */ #define PATCHLEVEL 0 Funky_Stuff len=`wc -c < patchlevel.h` if [ $len != 560 ] ; then echo error: patchlevel.h was $len bytes long, should have been 560 fi fi # end of overwriting check if [ -f noface.icon ] then echo shar: will not over-write existing file noface.icon else echo shar: extracting 'noface.icon', 1933 characters cat > noface.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0000,0x1FA0,0x0000,0x0000,0x0000,0x7FFC,0x0000,0x0000, 0x0000,0xFEFF,0x0000,0x0000,0x0001,0xBFBF,0xC000,0x0000, 0x0001,0xEFFA,0xE000,0x0000,0x0002,0x00FF,0xF800,0x0000, 0x0002,0x007F,0xFF80,0x0000,0x0000,0x001F,0x7E00,0x0000, 0x000C,0x001F,0xFFC0,0x0000,0x0000,0x0015,0xFFC0,0x0000, 0x0030,0x001F,0xFFF0,0x0000,0x0070,0x000F,0xFEB0,0x0000, 0x00C0,0x0007,0xFFF8,0x0000,0x00E0,0x0007,0xFFE8,0x0000, 0x01E0,0x0003,0xFFF8,0x0000,0x03C0,0x0001,0xFFF8,0x0000, 0x03E0,0x0001,0xFFF8,0x0000,0x07C0,0x0000,0xFFF0,0x0000, 0x0FF8,0x0000,0xBFF8,0x0000,0x0FE0,0x0000,0xFFF8,0x0000, 0x1FF0,0x0000,0x7FF8,0x0000,0x1FF0,0x0000,0xFFF8,0x0000, 0x1FF0,0x0000,0xFFF8,0x0000,0x1FD0,0x0000,0xFFF0,0x0000, 0x0FE0,0x0001,0xFFF0,0x0000,0x1FA0,0x0000,0x3FF0,0x0000, 0x0320,0x0000,0x1FE0,0x0000,0x0B80,0x0000,0x1F80,0x0000, 0x0180,0x0000,0x1780,0x0000,0x0080,0x0000,0x1F00,0x0000, 0x0000,0x0000,0x1F00,0x0000,0x0180,0x0000,0x0E00,0x0000, 0x0380,0x0000,0x1E00,0x0000,0x0180,0x0000,0x0FC0,0x0000, 0x0080,0x0000,0x1F80,0x0000,0x01C0,0x0000,0x0F80,0x0000, 0x00C0,0x0000,0x7F80,0x0000,0x0040,0x0000,0x7F00,0x0000, 0x0060,0x0000,0xCE00,0x0000,0x0004,0x0001,0x6000,0x0000, 0x0000,0x0003,0xF800,0x0000,0x0002,0x0001,0xA000,0x0000, 0x0000,0x0007,0xC000,0x0000,0x0002,0x000F,0x4000,0x0000, 0x0000,0x804B,0xC000,0x0000,0x0002,0xBBFE,0x8000,0x0000, 0x0000,0x8FFB,0xC000,0x0000,0x0001,0x7ABF,0xC000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000 Funky_Stuff len=`wc -c < noface.icon` if [ $len != 1933 ] ; then echo error: noface.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f nomail.icon ] then echo shar: will not over-write existing file nomail.icon else echo shar: extracting 'nomail.icon', 1933 characters cat > nomail.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0001,0xFFFF,0xFFC0,0x0000,0x0002,0xB000,0x0030,0x0000, 0x0003,0x5800,0x0008,0x0000,0x0006,0xADFF,0xFFC8,0x0000, 0x0005,0x54FF,0xFFE4,0x0000,0x000A,0xAAFF,0xFFF2,0x0000, 0x000D,0x567F,0xFFF2,0x0000,0x000A,0xAA7F,0xFFFA,0x0000, 0x000D,0x557F,0xFFF9,0x0000,0x000A,0xAB7F,0xFFF9,0x0000, 0x000D,0x557F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF1,0x0000, 0x000D,0x5500,0x0001,0x0000,0x000A,0xAB00,0x0001,0x0000, 0x000D,0x5500,0xFE01,0x0000,0x000A,0xAB03,0xFF81,0x0000, 0x000D,0x5507,0xFFC1,0x0000,0x000A,0xAB0F,0xFFE1,0x0000, 0x000D,0x551F,0xFFF1,0x0000,0x000A,0xAB1F,0xFFF1,0x0000, 0x000D,0x553F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF9,0x0000, 0x000D,0x553F,0xFFF9,0x0000,0x000A,0xAB3F,0xFFF9,0x0000, 0x0FFD,0x553F,0xFFF9,0x0000,0x3FFA,0xAB3F,0xFFF9,0x0000, 0x7FFD,0x553F,0xFFF9,0x0000,0xFFFA,0xAB3F,0xFFF9,0x0000, 0xFFFD,0x551F,0xFFF1,0x0000,0xFFFA,0xAB1F,0xFFF1,0x0000, 0xFFFD,0x550F,0xFFE1,0x0000,0xFFFA,0xAB07,0xFFC1,0x0000, 0xFFFD,0xD503,0xFF81,0x0000,0xFFFB,0xEB00,0xFE01,0x0000, 0x3FFD,0xF500,0x0001,0x0000,0x3FFB,0xFB00,0x0001,0x0000, 0x0FFD,0xFD0F,0xFFE1,0x0000,0x0FFB,0xFB1F,0xFFD1,0x0000, 0x03FD,0xFD3F,0xF7C9,0x0000,0x00FF,0xFF7F,0xF8C5,0x0000, 0x003F,0xFD7F,0xFC45,0x0000,0x001F,0xFF7F,0xFE05,0x0000, 0x0007,0xF560,0x3F85,0x0000,0x0003,0xF760,0x0FE5,0x0000, 0x0000,0xFD40,0x01F5,0x0000,0x0000,0x3F40,0x00FD,0x0000, 0x0000,0x0760,0x003D,0x0000,0x0000,0x03E0,0x000F,0x0000, 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00BB,0xFFFF,0xFFFD,0xF180, 0x009B,0xFFFF,0xFFFF,0xFD80,0x009B,0x8FFC,0xBC71,0xFD80, 0x00AB,0x77FD,0x5BBD,0xFD80,0x00AB,0x77FD,0x5FBD,0xFD80, 0x00B3,0x77FD,0x5C3D,0xFD80,0x00B3,0x77FD,0x5BBD,0xFD80, 0x00BB,0x77FD,0x5BBD,0xFD80,0x00BB,0x8FFD,0x5C3D,0xFD80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x0000,0x0000,0x0000,0x0000 Funky_Stuff len=`wc -c < nomail.icon` if [ $len != 1933 ] ; then echo error: nomail.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f noprint.icon ] then echo shar: will not over-write existing file noprint.icon else echo shar: extracting 'noprint.icon', 1933 characters cat > noprint.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFFE0, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x0080,0x0000,0x0000,0x0010,0x0080,0x0000,0x0000,0x0010, 0x00FF,0xFFFF,0xFFFF,0xFFF0,0x0090,0x0400,0x0000,0x8010, 0x0091,0xE400,0x0000,0x8010,0x0092,0x1400,0x1FF8,0x8010, 0x0092,0x1400,0x1008,0x8010,0x0092,0x1400,0x1008,0x8010, 0x0093,0xF400,0x1FF8,0x8010,0x0092,0xD400,0x1008,0x8010, 0x0092,0x1400,0x1FF8,0x8010,0x0091,0xE400,0x0000,0x8020, 0x0090,0x0400,0x0000,0x8040,0x00FF,0xFFFF,0xFFFF,0xC080, 0x3FFF,0xFFFF,0xFFFF,0xE100,0x3880,0x0000,0x0000,0x7E00, 0x3880,0x0000,0x0000,0x1FFC,0x3880,0x0000,0x0000,0x1FFC, 0x3F80,0x0FEF,0xEFCF,0xE100,0x0080,0x0000,0x0000,0x01FC, 0x0080,0x0FEF,0xEFCF,0xE100,0x0F80,0x0000,0x0000,0x0100, 0x0880,0x0FEF,0xEFCF,0xE100,0x0F80,0x0000,0x0000,0x0100, 0x0080,0x0000,0x0000,0x0100,0x00FF,0xFFFF,0xFFFF,0xFF00, 0x0040,0x0000,0x0000,0x0200,0x0040,0x0000,0x0000,0x0200, 0x003F,0xFFFF,0xFFFF,0xFC00,0x001C,0x0000,0x0001,0xC000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,0x00FF,0xFFFF,0xFFFF,0xFF80, 0x00FF,0xFFFF,0xFFFF,0xFF80,0x00FF,0xFFFF,0xBFF7,0xFF80, 0x00FF,0xFFFF,0xFFF7,0xFF80,0x00A7,0x8FFE,0x3C74,0xF180, 0x009B,0x77FF,0xBBB3,0x6E80,0x00BB,0x77FF,0xBBB7,0x6F80, 0x00BB,0x77FF,0xBBB7,0x7180,0x00BB,0x77FF,0xBBB7,0x7E80, 0x00BB,0x77FF,0xBBB3,0x6E80,0x00BB,0x8FFF,0xBC74,0xF180, 0x00FF,0xFFFF,0xBFFF,0xFF80,0x00FF,0xFFFD,0xBFFF,0xFF80, 0x00FF,0xFFFE,0x7FFF,0xFF80,0x00FF,0xFFFF,0xFFFF,0xFF80 Funky_Stuff len=`wc -c < noprint.icon` if [ $len != 1933 ] ; then echo error: noprint.icon was $len bytes long, should have been 1933 fi fi # end of overwriting check if [ -f nopaper.icon ] then echo shar: will not over-write existing file nopaper.icon else echo shar: extracting 'nopaper.icon', 1973 characters cat > nopaper.icon <<'Funky_Stuff' /* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16 */ 0xC000,0x0000,0x0000,0x0003,0xE000,0x0000,0x0000,0x0007, 0x7000,0x0000,0x0000,0x000E,0x3800,0x0000,0x0000,0x001C, 0x1C00,0x0000,0x0000,0x0038,0x0E00,0x0000,0x0000,0x0070, 0x0700,0x0000,0x0000,0x00E0,0x0380,0x0000,0x0000,0x01C0, 0x01C0,0x0000,0x0000,0x0380,0x00E0,0x0000,0x0000,0x0700, 0x0070,0x0000,0x0000,0x0E00,0x0038,0x0000,0x0000,0x1C00, 0x001C,0x0000,0x0000,0x3800,0x000E,0x0000,0x0000,0x7000, 0x0007,0x0000,0x0000,0xE000,0x0003,0x8000,0x0001,0xC000, 0x0001,0xC000,0x0003,0x8000,0x0000,0xE000,0x0007,0x0000, 0x0000,0x7000,0x000E,0x0000,0x0000,0x7FFF,0xFFFF,0xC000, 0x0000,0xBC00,0x0038,0x2000,0x0001,0x1E00,0x0070,0x1000, 0x0002,0x0F00,0x00E0,0x0800,0x0004,0x0780,0x01C0,0x0400, 0x0004,0x05C0,0x0380,0x0400,0x0008,0x42E0,0x0700,0x0200, 0x0008,0xE270,0x0E00,0x0200,0x0009,0xF238,0x1C00,0x0200, 0x0009,0xF21C,0x3800,0x0200,0x0009,0xF20E,0x7000,0x0200, 0x0009,0xF207,0xE000,0x0200,0x0009,0xF203,0xC000,0x0200, 0x0008,0xE203,0xC000,0x0200,0x0008,0x4207,0xE000,0x0200, 0x0004,0x040E,0x7000,0x0400,0x0004,0x041C,0x3800,0x0400, 0x0006,0x0838,0x1C00,0x0800,0x0007,0x1070,0x0E00,0x1000, 0x0002,0xA0E0,0x0700,0x2000,0x0002,0x7FFF,0xFFFF,0xC000, 0x0002,0x0380,0x01C2,0x0000,0x0002,0x0700,0x00E1,0x0000, 0x0003,0x0E00,0x0071,0x0000,0x0001,0x1C00,0x0039,0x0000, 0x0001,0x3800,0x001C,0x8000,0x0000,0xF000,0x000E,0x8000, 0x0000,0xE000,0x0007,0x8000,0x0001,0xC000,0x0003,0x8000, 0x0003,0x8000,0x0001,0xC000,0x0007,0x8000,0x0000,0xE000, 0x000E,0x4030,0x0000,0x7000,0x001C,0x41FC,0x0000,0x7800, 0x0038,0x4F02,0x003C,0x5C00,0x0070,0x5401,0xC1C2,0x2E00, 0x00E0,0x6000,0x3F01,0xC700,0x01C0,0x0000,0x0000,0x0380, 0x0380,0x0000,0x0000,0x01C0,0x0700,0x0000,0x0000,0x00E0, 0x0E00,0x0000,0x0000,0x0070,0x1C00,0x0000,0x0000,0x0038, 0x3800,0x0000,0x0000,0x001C,0x7000,0x0000,0x0000,0x000E, 0xE000,0x0000,0x0000,0x0007,0xC000,0x0000,0x0000,0x0003 Funky_Stuff len=`wc -c < nopaper.icon` if [ $len != 1973 ] ; then echo error: nopaper.icon was $len bytes long, should have been 1973 fi fi # end of overwriting check From don@brillig.umd.edu Sun Dec 11 11:32:45 1988 Date: Sun, 11 Dec 88 11:32:45 EST To: NeWS-makers@brillig.umd.edu Subject: faces (visual mail/printer monitor) - Part 2 of 3. From: sunaus!sunchat!richb@Sun.COM (Rich Burridge) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) ------CUT HERE------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 to create the files: # get.c # main.c # mon.c # news.c # rec.c # sunview.c # This archive created: Sun Dec 11 15:16:29 EST 1988 # # export PATH; PATH=/bin:$PATH # if [ -f get.c ] then echo shar: will not over-write existing file get.c else echo shar: extracting 'get.c', 10551 characters cat > get.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)get.c 1.2 88/12/09" ; #endif /* Extraction routines used by faces. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include "patchlevel.h" get_blit_ikon(name, buf) /* Load blit ikon file. */ char *name ; unsigned short buf[256] ; { FILE *fin ; char *ptr ; int i, j, temp ; if ((fin = fopen(name, "r")) == NULL) return(-1) ; for (i = 0; i < BLITHEIGHT; i++) { FGETS(nextline, MAXLINE, fin) ; ptr = nextline ; for (j = 0; j < 3; j++) { while (*ptr == ' ' || *ptr == '\t') ptr++ ; SSCANF(ptr,"0x%X",&temp) ; buf[i*4+j] = (short) temp ; ptr = index(ptr,',') ; ptr++ ; } buf[i*4+3] = 0 ; } for (i = BLITHEIGHT; i < ICONHEIGHT; i++) for (j = 0; j < 4; j++) buf[i*4+j] = 0 ; FCLOSE(fin) ; return(0) ; } char * get_field(ftype,line) /* Get field option from given line. */ enum field_type ftype ; char *line ; { char *ptr1, *ptr2 ; char str1[5],str2[MAXLINE],str3[4],str4[4],str5[3],str6[9],str7[5] ; SSCANF(line,"%s %s %s %s %s %s %s", str1,str2,str3,str4,str5,str6,str7) ; switch ((int) ftype) { case HOSTNAME : if ((ptr2 = rindex(str2,'!')) != NULL) { ptr1 = str2 ; *ptr2 = '\0' ; while (ptr2 != ptr1) { *ptr2-- ; if (*ptr2 == '!') return(ptr2+1) ; } return(ptr2) ; } else if ((ptr2 = index(str2,'@')) != NULL) return(ptr2+1) ; else return(NULL) ; case TIMESTAMP : str6[5] = '\0' ; return(str6) ; case USERNAME : if ((ptr2 = rindex(str2,'!')) != NULL) return(ptr2+1) ; else if ((ptr2 = index(str2,'@')) != NULL) { ptr1 = str2 ; *ptr2 = '\0' ; while (ptr2 != ptr1) { *ptr2-- ; if (*ptr2 == '@') return(ptr2+1) ; } return(ptr2) ; } else return(str2) ; } /*NOTREACHED*/ } get_icon(dirname, buf) /* Read in ikon or .icon file. */ char *dirname ; unsigned short buf[256] ; { /* Attempts to open the correct face file. * If the face file is face.ps, then another record is added to the list * of NeWS .ps files to animate at a later time. * If this is 48x48x1 or sun.icon, and the open is successful, then the * face image is read into buf. * -1 is returned on failure. */ char *ptr ; ptr = rindex(dirname,'/') ; /* Find last slash in iconname. */ if (EQUAL(ptr+1,"face.ps")) if (get_news_icon(dirname) == 0) return NEWSTYPE ; if (EQUAL(ptr+1,"sun.icon")) if (get_sun_icon(dirname, buf) == 0) return SUNTYPE ; if (EQUAL(ptr+1,"48x48x1")) if (get_blit_ikon(dirname, buf) == 0) return BLITTYPE ; return -1 ; } get_news_icon(name) /* Create record for news.ps file. */ char *name ; { FILE *fin ; if (gtype != NEWS) return -1 ; if ((fin = fopen(name, "r")) == NULL) return -1 ; FCLOSE(fin) ; add_ps_rec(row, column, name) ; return 0 ; } get_options(argc,argv) /* Read and process command line options. */ int argc ; char *argv[] ; { char next[MAXLINE] ; /* The next command line parameter. */ INC ; while (argc > 0) { if (argv[0][0] == '-') switch (argv[0][1]) { case 'P' : mtype = MONPRINTER ; /* Monitor printer queue. */ INC ; getparam(printer, argv, "-P needs printer name") ; break ; case 'a' : mtype = MONALL ; /* Monitor all of the spoolfile. */ break ; case 'b' : INC ; /* Alternate background pattern. */ getparam(bgicon, argv, "-b needs background icon") ; break ; case 'f' : INC ; /* New directory for face icons. */ getparam(facedir, argv, "-f needs face directory") ; SPRINTF(machfile, "%s/machine.tab", facedir) ; SPRINTF(peopfile, "%s/people.tab", facedir) ; break ; case 'i' : invert = 1 ; /* Reverse video. */ break ; case 'n' : dontshowno = 1 ; /* Don't show number of messages. */ break ; case 'p' : INC ; /* No. of seconds between checks. */ getparam(next, argv, "-p needs period time") ; period = atoi(next) ; /* No. of seconds between checks. */ break ; case 's' : INC ; /* Alternative spoolfile. */ getparam(spoolfile, argv, "-s needs spool directory") ; break ; case 't' : dontshowtime = 1 ; /* Do not show timestamps. */ break ; case 'u' : dontshowuser = 1 ; /* Do not show usernames. */ break ; case 'v' : FPRINTF(stderr, "%s version 1.3.%1d\n", progname, PATCHLEVEL) ; exit(1) ; /* SunView windowing arguments. -Wp, -WP and -Wi are used in the NeWS * implementation to initially position the window and icon. */ case 'W' : switch (argv[0][2]) { case 'H' : break ; /* -WH, no sub-args follow */ case 'i' : iconic = 1 ; break ; /* -Wi, start as an icon. */ case 'g' : /* -Wg, set default color. */ case 'n' : break ; /* -Wn, no label at all */ case 'h' : /* -Wh, height */ case 'I' : /* -WI "icon filename" */ case 'l' : /* -Wl "some window label" */ case 'L' : /* -Wl "some icon label" */ case 't' : /* Font filename */ case 'T' : /* Icon font filename */ case 'w' : INC ; /* Width, in columns. */ break ; case 'p' : INC ; /* -Wp xnum ynum */ getparam(next, argv, "-Wp needs x coordinate") ; wx = atoi(next) ; ler-daemon else if [ ! -d mailer-daemon ] then echo shar: creating directory mailer-daemon mkdir mailer-daemon fi echo shar: entering directory mailer-daemon cd mailer-daemon if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0001,0xFFFF,0xFFC0, 0x0002,0xB000,0x0030, 0x0003,0x5800,0x0008, 0x0006,0xADFF,0xFFC8, 0x0005,0x54FF,0xFFE4, 0x000A,0xAAF7,0xFDF2, 0x020D,0x5673,0xF9F2, 0x060A,0xAA61,0xF0FA, 0x0E0D,0x5568,0xE8F9, 0x1E0A,0xAB71,0xF1F9, 0x0E0D,0x557F,0xFFF9, 0x0A0A,0xAB3F,0xFFF1, 0x080D,0x5500,0x0001, 0x080A,0xAB00,0x0001, 0x080D,0x5500,0x9E01, 0x0DEA,0xAB03,0x9F81, 0x073D,0x5507,0x83C1, 0x001A,0xAB0F,0x81E1, 0x001D,0x551F,0x80F1, 0x000A,0xAB1F,0x80F1, 0x000D,0x553F,0x80F9, 0x000A,0xAB3F,0x80F9, 0x000D,0x553F,0x80F9, 0x000A,0xAB3F,0x80F9, 0x0FFD,0x553F,0x81F9, 0x3FFA,0xAB3F,0x83F9, 0x7FFD,0x553F,0x9FF9, 0xFFFA,0xAB3F,0x9FF9, 0xFFFD,0x551F,0x9FF1, 0xFFFA,0xAB1F,0x9FF1, 0xFFFD,0x550F,0x9FE1, 0xFFFA,0xAB07,0x9FC1, 0xFFFD,0xD503,0x9F81, 0x7FFB,0xEB00,0x9E01, 0x3FFD,0xF500,0x0001, 0x1FFB,0xFB00,0x0001, 0x0FFD,0xFD0F,0xFFE1, 0x07FB,0xFB1F,0xFFD1, 0x01FD,0xFD3F,0xF7C9, 0x00FF,0xFF7F,0xF8C5, 0x003F,0xFD7F,0xFC45, 0x001F,0xFF7F,0xFE05, 0x0007,0xF540,0x3F85, 0x0003,0xF740,0x0FC5, 0x0000,0xFD40,0x01F5, 0x0000,0x3F40,0x007D, 0x0000,0x0740,0x003D, 0x0000,0x01C0,0x000F, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory mailer-daemon fi if [ -f net ] then echo shar: can not write a directory over file net else if [ ! -d net ] then echo shar: creating directory net mkdir net fi echo shar: entering directory net cd net if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0070,0x0100,0x0000, 0x00F8,0x0300,0x0000, 0x0020,0x7FFC,0x0000, 0x0010,0x8303,0xE200, 0x000F,0x0101,0x2600, 0x0009,0x0001,0x3F00, 0x0009,0x0001,0xE600, 0x000F,0x0002,0x0200, 0x0010,0x8014,0x0000, 0x00A0,0x5018,0x0000, 0x00C0,0x301C,0x0000, 0x00E0,0x7020,0x0000, 0x0000,0x0840,0x4000, 0x0000,0x05E0,0xC000, 0x0000,0x033F,0xFF00, 0x0000,0x1120,0xC000, 0x00E0,0x31E0,0x4000, 0x00C0,0xFF20,0x0000, 0x00A1,0x3010,0x0000, 0x001E,0x100E,0x0000, 0x0012,0x000C,0x0700, 0x0012,0x000A,0x0300, 0x001E,0x0001,0x0500, 0x00A1,0x0000,0x8800, 0x00C0,0x8000,0x9000, 0x00E0,0x4101,0xE000, 0x0000,0x2181,0x2000, 0x0000,0x1FFF,0x2000, 0x0000,0x0181,0xE000, 0x0000,0x0101,0x0000, 0x0000,0x0002,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory net fi if [ -f root ] then echo shar: can not write a directory over file root else if [ ! -d root ] then echo shar: creating directory root mkdir root fi echo shar: entering directory root cd root if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x1EE4,0x0000, 0x0000,0x1B04,0x0000, 0x0000,0x1F74,0x0000, 0x0000,0x1F64,0x0000, 0x0000,0x1FA4,0x0000, 0x0000,0x1704,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1EE4,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1EC4,0x0000, 0x0000,0x17F4,0x0000, 0x0000,0x37F6,0x0000, 0x0000,0x3FEB,0x0000, 0x0000,0xFF7F,0x0000, 0x0000,0xFF7F,0xE000, 0x0001,0xFFE7,0xF000, 0x000F,0xE7F1,0x9800, 0x001F,0x0631,0xC800, 0x0036,0x0C30,0x6400, 0x0024,0x1830,0x6600, 0x0064,0x3C10,0x2200, 0x0064,0x3410,0x2200, 0x004C,0x2438,0x7200, 0x004E,0x242C,0xDA00, 0x004A,0x6424,0x8A00, 0x0012,0x4426,0x8800, 0x0012,0x4460,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory root fi if [ -f sys ] then echo shar: can not write a directory over file sys else if [ ! -d sys ] then echo shar: creating directory sys mkdir sys fi echo shar: entering directory sys cd sys if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0200,0x0000, 0x0000,0x0004,0x0000, 0x0000,0x080A,0x0000, 0x0000,0x008A,0x2000, 0x0000,0x016A,0xD000, 0x0002,0x0091,0x2000, 0x0000,0x0080,0x2000, 0x0020,0x004E,0x4000, 0x0000,0x439F,0x3800, 0x0000,0xA41F,0x0400, 0x0088,0xA39F,0x3800, 0x0016,0xAD4E,0x4000, 0x0009,0x1280,0x2000, 0x0008,0x0291,0x2000, 0x0004,0xE56A,0xD100, 0x0039,0xF38A,0x2000, 0x0241,0xF04A,0x0000, 0x0039,0xF384,0x0400, 0x0004,0xE400,0x0000, 0x0008,0x0200,0x2000, 0x0009,0x1240,0x0000, 0x0016,0xADA0,0x0000, 0x0008,0xAAA2,0x0000, 0x0000,0xB6AD,0x0000, 0x0000,0x4912,0x1000, 0x0000,0x0802,0x0000, 0x0020,0x04E4,0x0000, 0x0200,0x39F3,0x8800, 0x0008,0x41F0,0x4000, 0x0814,0x39F3,0x8000, 0x0114,0x44E4,0x0000, 0x12D5,0xA802,0x0800, 0x0122,0x4912,0x0000, 0x0100,0x56AD,0x0000, 0x209C,0x88A2,0x0000, 0x073E,0x70A0,0x2000, 0x083E,0x0840,0x0000, 0x073E,0x7000,0x0000, 0x009C,0x8000,0x0000, 0x0100,0x4000,0x0000, 0x0122,0x4200,0x0000, 0x02D5,0xA000,0x0000, 0x0114,0x4000,0x0000, 0x0014,0x0800,0x0000, 0x0008,0x0000,0x0000, 0x0000,0x4000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory sys fi if [ -f unknown ] then echo shar: can not write a directory over file unknown else if [ ! -d unknown ] then echo shar: creating directory unknown mkdir unknown fi echo shar: entering directory unknown cd unknown if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x01FF,0xC000, 0x7C00,0x1FFF,0xE000, 0x8200,0xFFFF,0xE000, 0x8207,0xFFFF,0xF000, 0x620F,0xFFFF,0xFF80, 0x040F,0xFFFF,0xFFE0, 0x080F,0xFFFF,0xFFF0, 0x100F,0xFFFF,0xF7F0, 0x2007,0xFFFF,0xF7F0, 0x0007,0xFFFF,0x8FE0, 0x2007,0xFFFE,0x7F80, 0x2007,0xFFF9,0xFE00, 0x000D,0xFFE7,0xFE00, 0x103E,0x7F9F,0xFE00, 0x007F,0x807F,0xFE00, 0x20FF,0xFFFF,0xFE00, 0x81FF,0xFFFF,0xFE00, 0x01FF,0xFFFB,0x8E00, 0x81FF,0xFFE1,0xF600, 0x21FF,0xFFE7,0xF600, 0x09FF,0xFFFF,0x0600, 0x00FF,0xFFFC,0x7F80, 0x0877,0xF7F0,0x3FC0, 0x2007,0xF7E0,0x1FC0, 0x0003,0xE7E0,0x7FC0, 0x4001,0xC3C3,0xFFC0, 0x1000,0x800F,0xFF80, 0x0407,0x803F,0xFF80, 0x0007,0x83FF,0xFF80, 0x00BF,0xFBFF,0xFF80, 0x00A0,0x1FFF,0xFF80, 0x00BF,0xFFFF,0xFF80, 0x0001,0xFFFF,0xFF80, 0x0001,0xF7FF,0xF180, 0x001F,0xFFFF,0xCFC0, 0x007E,0xFFFC,0x3FE0, 0x01FF,0x3FC3,0xFFF8, 0x07FF,0xDF3F,0xFFFE, 0x0FFF,0xF0FF,0xFFFF, 0x1FFF,0xCFFF,0xFFFF, 0x3FFF,0xDFFF,0xFFFF, 0x3FFF,0xD9FF,0xFFFF, 0x7FFF,0xD9FF,0xFFFF, 0x7FFF,0xDFFF,0xFFFF, 0xFFFF,0xBFC0,0x07FF, 0xFFFF,0xBFDF,0xF7FF, 0xFFFF,0xBFDF,0xF7FF, 0xFFFF,0xBFDF,0xF7FF, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory unknown fi if [ -f uucp ] then echo shar: can not write a directory over file uucp else if [ ! -d uucp ] then echo shar: creating directory uucp mkdir uucp fi echo shar: entering directory uucp cd uucp if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x3FE0, 0x0000,0x0000,0xE000, 0x0000,0x0001,0x8000, 0x0000,0x0003,0x0000, 0x0200,0x0007,0xE000, 0x0008,0x001E,0x1800, 0x1000,0x0074,0x0800, 0x0040,0x00C4,0x0800, 0x0001,0x0184,0x0800, 0x4200,0x0106,0x1800, 0x0010,0x0201,0xE000, 0x0000,0x0000,0x0000, 0x4000,0x0000,0x0000, 0x0400,0x0000,0x0000, 0x0020,0x3F00,0x0000, 0x4400,0xF5C0,0x0000, 0x0023,0xAAF0,0x0000, 0x020F,0x5558,0x0000, 0x003A,0xAAAE,0x0000, 0x20F5,0x5557,0x8000, 0x03AA,0xAAAA,0xC000, 0x0F55,0x5555,0x7000, 0x3EAA,0xA0AA,0xBC00, 0x7755,0x1F15,0x5600, 0xEBAA,0x71CA,0xAB80, 0xD5D1,0xC071,0x55E0, 0xAAE7,0x001C,0xABB0, 0xD57C,0x0007,0x177C, 0x6070,0x0011,0xCEEE, 0x3FC0,0x0020,0x7DD7, 0x0000,0x1140,0x1DAB, 0x0000,0x0001,0x0795, 0x0000,0x0000,0x01C3, 0x0000,0x0004,0x007E, 0x0001,0x0020,0x0800, 0x0000,0x1100,0x0020, 0x0000,0x0000,0x1000, 0x0000,0x0000,0x4040, 0x0010,0x0000,0x0080, 0x0000,0x2004,0x0100, 0x0000,0x0110,0x0200, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x2000, 0x0020,0x0002,0x0000, 0x0000,0x0020,0x0000, 0x0001,0x0400,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory uucp fi cd .. echo shar: done with directory misc. fi if [ -f people.tab ] then echo shar: will not over-write existing file people.tab else echo shar: extracting 'people.tab', 1663 characters cat > people.tab <<'Funky_Stuff' sunaus/rallen=bob sunaus/ballen=bob sunaus/bbaker=bruceb sunaus/mbosch=mike sunaus/eddy=eddie sunaus/eevans=eddie sunaus/ggrell=grell sunaus/gene=grell sunaus/jingall=johni sunaus/ijeffery=ian sunaus/glynne=gjl sunaus/tmcentee=tim sunaus/jnoonan=johnn sunaus/apappas=arie sunaus/jennie=jenny sunaus/jrendell=jenny sunaus/gsearle=gjs sunaus/gsitters=greg sunaus/bscott=brad sunaus/rstewart=ruth sunaus/jteasdale=jim sunaus/loraine=lori sunaus/lorraine=lori sunaus/lunicomb=lori sunaus/pvrbancich=paula sunaus/swoodhead=simon sunaus/jy=yo sunaus/jyoung=yo sunaus/rboden=richard sunaus/rbodin=richard sunaus/rburridge=richb sunaus/rich=richb sunaus/mcunningham=mary sunaus/sduchesne=sue sunaus/mfredericks=max sunaus/mfredricks=max sunaus/bgeneralis=bill sunaus/shulbert=susanh sunaus/susan=susanh sunaus/gmason=gregm sunaus/vmickan=val sunaus/trogge=tony sunaus/andy=aspiers sunaus/bwiggins=bruce sunaus/ryeap=ron sunaus/cbreen=colinb sunaus/rdesalis=roger sunaus/mfort=markf sunaus/mark=markg sunaus/mgurvis=markg sunaus/mnegri=manuel sunaus/npettitt=noel sunaus/jraine=john sunaus/paul=paulr sunaus/prosham=paulr sunaus/gsweigert=geo sunaus/rbowman=robb sunaus/bbowman=robb sunaus/krees=kim sunaus/mikes=mslee sunaus/gshepherd=george sunaus/aweller=andrew sunaus/kbeavan=kevin sunaus/rbradford=rhonda sunaus/ckeith=colin sunaus/mmccann=mmc sunaus/ksterry=kaylene sunaus/rwilliams=rex sunaus/gdonin=gary sunaus/dshea=dennis sunaus/doshea=dennis sunaus/hprotoolis=harry sunaus/rschrader=robert sunaus/bschrader=robert sunaus/bobs=robert sunaus/jvermeulen=jeff sunaus/MAILER-DAEMON=mailer-daemon sunaus/Mailer-Daemon=mailer-daemon sunaus/mailer-daemon=mailer-daemon Funky_Stuff len=`wc -c < people.tab` if [ $len != 1663 ] ; then echo error: people.tab was $len bytes long, should have been 1663 fi fi # end of overwriting check if [ -f sunaus ] then echo shar: can not write a directory over file sunaus else if [ ! -d sunaus ] then echo shar: creating directory sunaus mkdir sunaus fi echo shar: entering directory sunaus cd sunaus if [ -f richb ] then echo shar: can not write a directory over file richb else if [ ! -d richb ] then echo shar: creating directory richb mkdir richb fi echo shar: entering directory richb cd richb if [ -f face.ps ] then echo shar: will not over-write existing file face.ps else echo shar: extracting 'face.ps', 782 characters cat > face.ps <<'Funky_Stuff' /Icon findfont 1 scalefont setfont .1 .25 .9 .75 rectpath 1 setgray fill 0 setgray .1 .25 moveto (\056) show .002 sleep 1 setgray .1 .25 moveto (\056) show 0 setgray .1 .25 moveto (\057) show .002 sleep 1 setgray .1 .25 moveto (\057) show 0 setgray .1 .25 moveto (\060) show .002 sleep 1 setgray .1 .25 moveto (\060) show 0 setgray .1 .25 moveto (\061) show .002 sleep 1 setgray .1 .25 moveto (\061) show 0 setgray .1 .25 moveto (\062) show .002 sleep 1 setgray .1 .25 moveto (\062) show 0 setgray .1 .25 moveto (\061) show .002 sleep 1 setgray .1 .25 moveto (\061) show 0 setgray .1 .25 moveto (\060) show .002 sleep 1 setgray .1 .25 moveto (\060) show 0 setgray .1 .25 moveto (\057) show .002 sleep 1 setgray .1 .25 moveto (\057) show 0 setgray .1 .25 moveto (\056) show Funky_Stuff len=`wc -c < face.ps` if [ $len != 782 ] ; then echo error: face.ps was $len bytes long, should have been 782 fi fi # end of overwriting check cd .. echo shar: done with directory richb fi cd .. echo shar: done with directory sunaus fi cd .. echo shar: done with directory facedir fi if (EQUAL(nextline, "set")) { ptr = index(nextline, ' ') ; if (EQUAL(ptr+1, "flash")) { ptr = index(nextline, '=') ; SSCANF(ptr+1, "%d", &flashes) ; } else if (EQUAL(ptr+1, "bell")) { ptr = index(nextline, '=') ; SSCANF(ptr+1, "%d", &beeps) ; } } } FCLOSE(fd) ; } Funky_Stuff len=`wc -c < main.c` if [ $len != 10551 ] ; then echo error: main.c was $len bytes long, should have been 10551 fi fi # end of overwriting check if [ -f mon.c ] then echo shar: will not over-write existing file mon.c else echo shar: extracting 'mon.c', 8937 characters cat > mon.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)mon.c 1.4 88/12/11" ; #endif /* Monitoring routines used by the faces program. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" adjust() /* Adjust the row and column position. */ { struct psinfo *this ; if (mtype != MONNEW) { if (++column == NO_PER_ROW) { column = 0 ; row++ ; } return ; } if (psrecs != NULL) /* Adjust animation positions for MONNEW */ { this = psrecs ; /* Point to beginning of chain. */ while (this != NULL) { this->column++ ; /* Adjust column position. */ if (facetype == NEWSTYPE && this->next == NULL) this->column-- ; /* Reset for brand new animate record. */ this = this->next ; } } } do_check() /* Perform another check of the appropriate type. */ { switch ((int) mtype) { case MONALL : do_mail(MONALL) ; /* Monitor all of the mail file. */ break ; case MONNEW : do_mail(MONNEW) ; /* Monitor new mail only. */ break ; case MONPRINTER : do_printer() ; /* Monitor the print queue. */ break ; } firsttime = 0 ; } do_mail(mtype) /* Monitor a mail file for new or all mail. */ enum mon_type mtype ; { char host[MAXLINE] ; /* Pointer to host name from the "From" line. */ char *ptr ; /* Pointer to extract field. */ char realname[MAXLINE] ; /* Real username for this user. */ char ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */ char user[MAXLINE] ; /* Pointer to user name from the "From" line. */ FILE *fp ; /* File descriptor for users mail spool file. */ struct recinfo *crec ; /* Pointer to current mail record for updating. */ column = row = 0 ; /* Start in top left corner of pixrect. */ newmail = 0 ; /* Assume no new mail. */ noicons = 0 ; if (mtype == MONNEW) make_pixrect(NO_PER_ROW) ; if (stat(spoolfile,&buf) == -1) { lastsize = 0 ; if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ return ; } if (buf.st_size > lastsize) newmail = 1 ; /* New mail found. */ if (mtype == MONNEW) if (buf.st_size <= lastsize) /* Is the size of mail folder bigger? */ { lastsize = buf.st_size ; /* No: save new size and exit. */ show_display() ; return ; } if ((fp = fopen(spoolfile,"r")) == NULL) /* Open spoolfile. */ { if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ return ; } if (mtype == MONNEW) FSEEK(fp, lastsize, 0) ; lastsize = buf.st_size ; while (fgets(nextline,MAXLINE,fp) != NULL) if (EQUAL(nextline,"From ")) { host[0] = user[0] = ts[0] = '\0' ; if ((ptr = get_field(HOSTNAME,nextline)) != NULL) STRCPY(host, ptr) ; if ((ptr = get_field(USERNAME,nextline)) != NULL) STRCPY(user, ptr) ; if ((ptr = get_field(TIMESTAMP,nextline)) != NULL) STRCPY(ts, ptr) ; h_to_c(host, community) ; /* Turn hostname into community name. */ a_to_u(community, user, realname) ; make_iconname(community, realname) ; if (mtype == MONNEW) { add_face(BOTH, ORDINARY, iconname) ; if (!dontshowtime) text(ICON, LEFT, ts) ; if (!dontshowuser) text(WINDOW, LEFT, realname) ; adjust() ; } else { if ((crec = rec_exists(community, realname)) != NULL) { STRCPY(crec->ts, ts) ; if (!crec->total) noicons++ ; crec->total++ ; } else add_record(community, realname, ts, 0) ; } } FCLOSE(fp) ; if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ } do_printer() /* Monitor printer queue. */ { struct recinfo *this, *next ; FILE *fp ; /* File descriptor for users mail spool file. */ char command[MAXLINE] ; /* Lpq system call for this printer. */ char owner[MAXLINE] ; /* Owner of job in the print queue. */ char tempname[MAXLINE] ; /* Temporary unique filename. */ int size ; /* Size of this print job in bytes. */ noicons = 0 ; SPRINTF(tempname,"/tmp/faces%04d",getpid()) ; SPRINTF(command,"lpq -P %s > %s",printer,tempname) ; if (system(command)) { FPRINTF(stderr,"%s: system call for printer %s stats failed.\n", progname,printer) ; return ; } if ((fp = fopen(tempname,"r")) == NULL) /* Open spoolfile. */ { FPRINTF(stderr,"%s: couldn't open printer stats in %s.\n", progname,tempname) ; return ; } column = row = 0 ; /* Start in top left corner of pixrect. */ FGETS(nextline,MAXLINE,fp) ; if (EQUAL(nextline,"no entries")) { make_pixrect(1) ; /* Just the "no print" icon. */ add_face(BOTH, NOPRINT, "") ; /* Set to "no print" icon. */ } else if (EQUAL(nextline,"Printer Error: may need attention!")) { make_pixrect(1) ; /* Just the "no paper" icon. */ add_face(BOTH, NOPAPER, "") ; /* Set to "no paper" icon. */ text(BOTH, LEFT, printer) ; /* Output printer name. */ } else { FGETS(nextline,MAXLINE,fp) ; /* Skip the next line. */ while (fgets(nextline,MAXLINE,fp) != NULL) { SSCANF(&nextline[7], "%s", owner) ; SSCANF(&nextline[60], "%d", &size) ; h_to_c("", community) ; make_iconname(community, owner) ; add_record("",owner,"",size) ; } make_pixrect(noicons) ; this = recs ; while (this != NULL) { next = this->next ; add_face(WINDOW, ORDINARY, this->iconname) ; SPRINTF(nextline, "%1d", this->size) ; if (!dontshowuser) text(WINDOW, LEFT, this->username) ; /* Owner. */ text(WINDOW, RIGHT, nextline) ; /* Size. */ if (this == recs) { add_face(ICON, ORDINARY, this->iconname) ; SPRINTF(nextline, "%1d %s", noicons, (noicons == 1 ? "job" : "jobs")) ; text(ICON, RIGHT, nextline) ; /* Number of jobs. */ } adjust() ; /* Adjust column and row. */ remove_record(this) ; this = next ; } recs = last = NULL ; } FCLOSE(fp) ; UNLINK(tempname) ; show_display() ; } make_pixrect(count) /* Make window pixrect the correct size. */ int count ; { int c, r ; /* Size in columns and rows of window display. */ r = ((count-1) / NO_PER_ROW) + 1 ; /* Number of rows of faces. */ c = NO_PER_ROW ; /* Full width display. */ if (count <= 10) { r = 1 ; /* One row. */ c = count ; /* Of 'count' columns. */ } height = r * ICONHEIGHT ; /* Height of the icon display. */ width = c * ICONWIDTH ; /* Width of the icon display. */ create_pixrects(width, height) ; } make_display() /* Output icons and tidyup chain of records. */ { int count ; /* Name of faces in icon display. */ struct recinfo *this, *next ; count = noicons ; /* Number of faces to display. */ if (!count) count = 1 ; /* Always one "no mail" icon. */ make_pixrect(count) ; if (!noicons) add_face(BOTH, NOMAIL, "") ; else { this = recs ; while (this != NULL) { next = this->next ; add_face(BOTH, ORDINARY, this->iconname) ; if (!dontshowno) { SPRINTF(nextline, "%1d", this->total) ; text(ICON, RIGHT, nextline) ; } if (!dontshowtime) text(ICON, LEFT, this->ts) ; if (!dontshowuser) text(WINDOW, LEFT, this->username) ; adjust() ; remove_record(this) ; this = next ; } recs = last = NULL ; } show_display() ; /* Display the latest set of faces. */ } Funky_Stuff len=`wc -c < mon.c` if [ $len != 8937 ] ; then echo error: mon.c was $len bytes long, should have been 8937 fi fi # end of overwriting check if [ -f news.c ] then echo shar: will not over-write existing file news.c else echo shar: extracting 'news.c', 10648 characters cat > news.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)news.c 1.3 88/12/11" ; #endif /* NeWS dependent graphics routines used by faces, * the visual mail and print job monitor. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include #include #ifdef SUNOS3.x int fullmask ; /* Full mask of file descriptors to check on. */ int readmask ; /* Readmask used in select call. */ #else fd_set fullmask ; /* Full mask of file descriptors to check on. */ fd_set readmask ; /* Readmask used in select call. */ #endif SUNOS3.x int kbdfd ; /* File descriptor for the keyboard. */ int psfd ; /* NeWS connection file descriptor. */ unsigned short ibuf[256] ; /* Ikon/icon image buffer. */ extern FILE *PostScript ; extern FILE *PostScriptInput ; add_face(display, itype, name) /* Add this icon to the display. */ enum disp_type display ; enum icon_type itype ; char *name ; { char face[MAXLINE] ; /* Canvas containing face (Source). */ switch ((int) itype) { case NOMAIL : STRCPY(face, "NomailIcon") ; break ; case NOPAPER : STRCPY(face, "NopaperIcon") ; break ; case NOPRINT : STRCPY(face, "NoprintIcon") ; break ; case ORDINARY : if ((facetype = get_icon(name, ibuf)) != -1) switch (facetype) { case BLITTYPE : case SUNTYPE : load_icon("Curface") ; STRCPY(face, "CurfaceIcon") ; case NEWSTYPE : break ; } else STRCPY(face, "NofaceIcon") ; break ; } if (display == ICON) if (mtype == MONPRINTER) adjust_image("MPR", face, 0, 0) ; else adjust_image("MPR", face, row, column) ; else if (display == WINDOW) adjust_image("PR", face, row, column) ; else { adjust_image("MPR", face, row, column) ; adjust_image("PR", face, row, column) ; } FFLUSH(PostScript) ; } adjust_image(dest, face, row, column) char *dest, *face ; int row, column ; { switch ((int) mtype) { case MONNEW : FPRINTF(PostScript, "%d 0 %d %d %s ShiftImage\n", ICONWIDTH, (NO_PER_ROW-1)*ICONWIDTH, ICONHEIGHT, dest) ; if (facetype == NEWSTYPE) { FPRINTF(PostScript, "%d %d %d %d %s ClearBox\n", column*ICONWIDTH, row*ICONHEIGHT, ICONWIDTH, ICONHEIGHT, dest) ; return ; } case MONALL : case MONPRINTER : FPRINTF(PostScript,"%s %d %d %d %d %s MoveImage\n", face, ICONWIDTH, ICONHEIGHT, column*ICONWIDTH, row*ICONHEIGHT, dest) ; } } beep_flash(beeps, flashes) /* Perform visual feedback. */ int beeps, flashes ; { int i, x ; if (beeps) for (i = 0; i < beeps; i++) { x = KBD_CMD_BELL ; IOCTL(kbdfd, KIOCCMD, &x) ; usleep(250000) ; x = KBD_CMD_NOBELL ; IOCTL(kbdfd, KIOCCMD, &x) ; usleep(250000) ; } } create_pixrects(width, height) /* Create pixrects for the face images. */ { int h, i, j, w ; if (mtype == MONNEW && !firsttime) return ; FPRINTF(PostScript,"%d %d PR DoPixrects\n", width, height) ; h = height ; w = width ; if (mtype == MONPRINTER) { h = ICONHEIGHT ; w = ICONWIDTH ; } FPRINTF(PostScript,"%d %d MPR DoPixrects\n", w, h) ; if (strlen(bgicon)) { for (i = 0; i < (height / 64); i++) for (j = 0; j < (width / 64); j++) { FPRINTF(PostScript,"BackgroundIcon %d %d %d %d PR MoveImage\n", ICONWIDTH, ICONHEIGHT, j, i) ; FPRINTF(PostScript,"BackgroundIcon %d %d %d %d MPR MoveImage\n", ICONWIDTH, ICONHEIGHT, j, i) ; } } else FPRINTF(PostScript,"SetBackground\n") ; } do_news_ps(psrecs) /* Display chain of NeWS animations. */ struct psinfo *psrecs ; { struct psinfo *next, *this ; this = psrecs ; /* Point to beginning of NeWS records. */ while (this != NULL) { next = this->next ; if ((mtype != MONNEW) || (this->column < NO_PER_ROW)) { FPRINTF(PostScript, "(%s) %d %d %d %d ExecFile\n", this->name, ICONWIDTH, ICONHEIGHT, this->column*ICONWIDTH, this->row*ICONHEIGHT) ; FFLUSH(PostScript) ; } this = next ; } } init_ws_type() { if (ps_open_PostScript() < 0) return -1 ; if (send_ps_file(NEWSFILE) == -1) { FPRINTF(stderr,"%s: cannot open %s\n", progname, NEWSFILE) ; FCLOSE(PostScript) ; return(-1) ; } FFLUSH(PostScript) ; if (ferror(PostScript)) { FCLOSE(PostScript) ; return(-1) ; } if (invert) FPRINTF(PostScript, "/Invert false def\n") ; else FPRINTF(PostScript, "/Invert true def\n") ; gtype = NEWS ; return(0) ; } load_icon(name) char *name ; { int i, j ; FPRINTF(PostScript,"/%sIcon 64 64 1 { } { <\n", name) ; for (i = 0; i < 32; i++) { for (j = 0; j < 8; j++) FPRINTF(PostScript,"%.4X ", ibuf[i*8+j]) ; FPRINTF(PostScript,"\n") ; } FPRINTF(PostScript,"> } buildimage def\n") ; } /*ARGSUSED*/ make_frame(argc,argv) int argc ; char *argv[] ; { if ((kbdfd = open("/dev/kbd", 0)) == -1) { FPRINTF(stderr,"%s: can't open keyboard.\n", progname) ; exit(1) ; } psfd = fileno(PostScriptInput) ; #ifdef SUNOS3.x fullmask = 1 << psfd ; #else FD_ZERO(&fullmask) ; FD_SET(psfd, &fullmask) ; #endif SUNOS3.x if (strlen(bgicon)) if (get_sun_icon(bgicon, ibuf) == 0) load_icon("Background") ; FPRINTF(PostScript,"%d %d %d %d %d %d %d MakeFrame\n", wx, wy, NO_PER_ROW*ICONWIDTH+10, ICONHEIGHT*10+10, ix, iy, iconic) ; FPRINTF(PostScript,"InitFont\n") ; width = NO_PER_ROW * ICONWIDTH ; height = ICONHEIGHT ; } make_icon() { if (get_sun_icon("noface.icon", ibuf) == 0) load_icon("Noface") ; if (get_sun_icon("nomail.icon", ibuf) == 0) load_icon("Nomail") ; if (get_sun_icon("nopaper.icon", ibuf) == 0) load_icon("Nopaper") ; if (get_sun_icon("noprint.icon", ibuf) == 0) load_icon("Noprint") ; } send_ps_file(fname) char *fname ; { FILE *stream ; int c ; if ((stream = fopen(fname,"r")) == NULL) return -1 ; while ((c = getc(stream)) != EOF) PUTC(c,PostScript) ; FCLOSE(stream) ; return 0 ; } show_display() /* Show the latest set of mail icon faces. */ { if (mtype != MONPRINTER) FPRINTF(PostScript,"%d %d %d %d ShowDisplay\n", width, height, width, height) ; else FPRINTF(PostScript,"%d %d %d %d ShowDisplay\n", width, height, ICONWIDTH, ICONHEIGHT) ; if (newmail) beep_flash(beeps, flashes) ; if (psrecs != NULL) do_news_ps(psrecs) ; FFLUSH(PostScript) ; } start_tool() { int type ; /* Value from NeWS server. */ struct psinfo *next, *this ; /* For removing current chain of records. */ struct timeval tval ; tval.tv_usec = 0 ; tval.tv_sec = period ; for (;;) { readmask = fullmask ; #ifdef SUNOS3.x SELECT(32, &readmask, 0, 0, &tval) ; if (readmask && (1 << psfd)) #else SELECT(FD_SETSIZE, &readmask, (fd_set *) 0, (fd_set *) 0, &tval) ; if (FD_ISSET(psfd, &readmask)) #endif SUNOS3.x { if (pscanf(PostScriptInput, "%d", &type) == EOF) exit(1) ; switch (type) { case DIED : exit(0) ; case PAINTED : if (psrecs != NULL) do_news_ps(psrecs) ; } } else { this = psrecs ; /* Point to beginning of NeWS records. */ if (mtype != MONNEW) { while (this != NULL) { next = this->next ; if (this->name != NULL) free(this->name) ; free((char *) this) ; /* Remove this record. */ this = next ; } psrecs = plast = NULL ; } do_check() ; /* Check the mail/printer again. */ } } } text(display,just,str) enum disp_type display ; enum just_type just ; char *str ; { int i, len ; int c, r ; /* Column and row position for this face. */ int x, y ; /* Position of start of this text string. */ char line[MAXLINE] ; /* PostScript text string to be builtup. */ char tpr ; /* Indicator for destination offscreen canvas. */ c = column ; r = row ; switch ((int) display) { case BOTH : text(ICON, just, str) ; text(WINDOW, just, str) ; return ; case ICON : tpr = 'M' ; /* MPR canvas. */ if (mtype != MONALL) c = r = 0 ; break ; case WINDOW : tpr = ' ' ; /* PR canvas. */ } len = strlen(str) ; /* Character length of text. */ if (len > 10) { len = 10 ; str[10] = '\0' ; /* Maximum of 10 characters. */ } line[0] = '\0' ; for (i = 0; i < len; i++) switch (str[i]) { case '\\' : STRCAT(line,"\\\\") ; break ; case '(' : STRCAT(line,"\\(") ; break ; case ')' : STRCAT(line,"\\)") ; break ; default : STRNCAT(line,&str[i],1) ; } switch ((int) just) { case LEFT : x = c*ICONWIDTH+2 ; y = r*ICONHEIGHT+2 ; break ; case RIGHT : x = (c+1)*ICONWIDTH-(len*6)-2 ; y = r*ICONHEIGHT+2 ; } FPRINTF(PostScript,"%d %d %d %d %cPR ClearBox\n", x, y, len*6+2, 10, tpr) ; FPRINTF(PostScript,"(%s) %d %d %cPR MakeText\n", line, x, y, tpr) ; } Funky_Stuff len=`wc -c < news.c` if [ $len != 10648 ] ; then echo error: news.c was $len bytes long, should have been 10648 fi fi # end of overwriting check if [ -f rec.c ] then echo shar: will not over-write existing file rec.c else echo shar: extracting 'rec.c', 6808 characters cat > rec.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)rec.c 1.2 88/12/09" ; #endif /* Record handling routines used by the faces program. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" char * Malloc(n) int n ; { char *val ; if ((val = malloc((unsigned) n)) == NULL) FPRINTF(stderr,"%s: Out of memory.\n",progname) ; return val ; } add_alias(crec, username, alias) /* Add new alias to hostnames' list. */ struct comminfo *crec ; char *username, *alias ; { struct peopinfo *cptemp, *ptemp ; ptemp = (struct peopinfo *) Malloc(sizeof(struct peopinfo)) ; ptemp->alias = (char *) Malloc(strlen(alias)) ; STRCPY(ptemp->alias, alias) ; ptemp->username = (char *) Malloc(strlen(username)) ; STRCPY(ptemp->username, username) ; ptemp->next = NULL ; if (crec->people == NULL) crec->people = ptemp ; else { cptemp = crec->people ; while (cptemp != NULL) if (cptemp->next == NULL) { cptemp->next = ptemp ; return ; } else cptemp = cptemp->next ; } } add_machine(machine, community) /* Add new machine to list. */ char *machine, *community ; { struct machinfo *temp ; temp = (struct machinfo *) Malloc(sizeof(struct machinfo)) ; temp->machine = (char *) Malloc(strlen(machine)) ; STRCPY(temp->machine, machine) ; temp->community = (char *) Malloc(strlen(community)) ; STRCPY(temp->community, community) ; temp->next = NULL ; if (machines == NULL) machines = mlast = temp ; /* Start chain. */ else if (mlast != NULL) { mlast->next = temp ; /* Add record to existing chain. */ mlast = temp ; /* Point to end of chain. */ } } add_ps_rec(row, column, name) /* Add record for later animation. */ int row, column ; char *name ; { struct psinfo *temp ; temp = (struct psinfo *) Malloc(sizeof(struct psinfo)) ; temp->name = (char *) Malloc(strlen(name)) ; STRCPY(temp->name, name) ; temp->row = row ; temp->column = column ; temp->next = NULL ; if (psrecs == NULL) psrecs = plast = temp ; /* Start chain. */ else if (plast != NULL) { plast->next = temp ; /* Add record to existing chain. */ plast = temp ; } } add_record(community, username, timestamp, size) char *community, *username, *timestamp ; int size ; { struct recinfo *temp ; temp = (struct recinfo *) Malloc(sizeof(struct recinfo)) ; temp->community = (char *) Malloc(strlen(community)) ; STRCPY(temp->community, community) ; temp->username = (char *) Malloc(strlen(username)) ; STRCPY(temp->username, username) ; temp->iconname = (char *) Malloc(strlen(iconname)) ; STRCPY(temp->iconname, iconname) ; STRCPY(temp->ts, timestamp) ; temp->size = size ; temp->total = 1 ; temp->next = NULL ; noicons++ ; if (recs == NULL) recs = last = temp ; /* Start chain. */ else { last->next = temp ; /* Add record to existing chain. */ last = temp ; /* Point to the end of the chain. */ } } check_comm(hostname, username, alias) /* Check community list. */ char *hostname, *username, *alias ; { struct comminfo *ctemp ; ctemp = communities ; /* Try and find machine record for hostname. */ while (ctemp != NULL) if (EQUAL(ctemp->community, hostname)) { add_alias(ctemp, username, alias) ; return ; } else ctemp = ctemp->next ; ctemp = (struct comminfo *) Malloc(sizeof(struct comminfo)) ; ctemp->community = (char *) Malloc(strlen(hostname)) ; STRCPY(ctemp->community, hostname) ; ctemp->people = NULL ; ctemp->next = NULL ; if (communities == NULL) communities = clast = ctemp ; /* Start chain. */ else { clast->next = ctemp ; /* Add record to existing chain. */ clast = ctemp ; /* Point to end of chain. */ } add_alias(ctemp, username, alias) ; } read_aliases() /* Setup the hostname aliases subchains. */ { char alias[MAXLINE] ; /* Alias for this community/username. */ char hostname[MAXLINE] ; /* This records' hostname. */ char username[MAXLINE] ; /* This records real username. */ char *ptr1, *ptr2 ; FILE *fd ; if ((fd = fopen(peopfile, "r")) == NULL) /* Open people file. */ { FPRINTF(stderr,"%s: cannot open %s\n", progname, peopfile) ; return ; } while (fgets(nextline, MAXLINE, fd) != NULL) { ptr1 = index(nextline, '/') ; STRNCPY(hostname, nextline, (int) (ptr1-nextline)) ; hostname[(int) (ptr1-nextline)] = '\0' ; ptr2 = index(nextline, '=') ; STRNCPY(alias, ptr1+1, (int) (ptr2-ptr1-1)) ; alias[(int) (ptr2-ptr1-1)] = '\0' ; STRNCPY(username, ptr2+1, strlen(ptr2)-2) ; username[strlen(ptr2)-2] = '\0' ; check_comm(hostname, username, alias) ; } FCLOSE(fd) ; } read_machines() /* Setup the chain of machine/community records. */ { char community[MAXLINE] ; /* This records' community. */ char machine[MAXLINE] ; /* This records' machine name. */ char *ptr ; FILE *fd ; if ((fd = fopen(machfile, "r")) == NULL) /* Open machine file. */ { FPRINTF(stderr,"%s: cannot open %s\n", progname, machfile) ; return ; } while (fgets(nextline, MAXLINE, fd) != NULL) { ptr = index(nextline, '=') ; STRNCPY(machine, nextline, (int) (ptr-nextline)) ; machine[(int) (ptr-nextline)] = '\0' ; STRNCPY(community, ptr+1, strlen(ptr)-2) ; community[strlen(ptr)-2] = '\0' ; add_machine(machine, community) ; } FCLOSE(fd) ; } struct recinfo * rec_exists(community,username) /* Check if record exists for mail item. */ char *community, *username ; { struct recinfo *temp ; /* Pointer to mail records used for chaining. */ temp = recs ; while (temp != NULL) { if (EQUAL(temp->username, username) && EQUAL(temp->community, community)) return(temp) ; /* Record found. */ temp = temp->next ; /* Point to next record. */ } return(NULL) ; } remove_record(thisrec) /* Remove this record from the chain. */ struct recinfo *thisrec ; { if (thisrec->community != NULL) free(thisrec->community) ; if (thisrec->username != NULL) free(thisrec->username) ; if (thisrec->iconname != NULL) free(thisrec->iconname) ; free((char *) thisrec) ; } Funky_Stuff len=`wc -c < rec.c` if [ $len != 6808 ] ; then echo error: rec.c was $len bytes long, should have been 6808 fi fi # end of overwriting check if [ -f sunview.c ] then echo shar: will not over-write existing file sunview.c else echo shar: extracting 'sunview.c', 9881 characters cat > sunview.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)sunview.c 1.1 88/12/04" ; #endif /* SunView dependent graphics routines used by faces, * the visual mail and print job monitor. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include #include #include #define ICON_SET (void) icon_set #define NOTIFY_SET_ITIMER_FUNC (void) notify_set_itimer_func #define PR_DESTROY (void) pr_destroy #define PR_REPLROP (void) pr_replrop #define PR_ROP (void) pr_rop #ifdef SUNOS3.x #define PR_TTEXT (void) pf_ttext #else #define PR_TTEXT (void) pr_ttext #endif SUNOS3.x #define PW_ROP (void) pw_rop #define WIN_BELL (void) win_bell #define WINDOW_SET (void) window_set #define SMALLFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.7" #define ITIMER_NULL ((struct itimerval *) 0) int repaint_proc() ; Canvas canvas ; Frame frame ; Icon faces_icon ; Pixfont *sfont ; /* Small font for timestamp and count. */ Pixrect *mpr, *pr ; /* Pointers to current pixrects. */ Pixrect *old_mpr, *old_pr ; /* Pointers to previous pixrects. */ Pixrect *background ; /* Pointer to background pattern or gray. */ Pixwin *fpw, *pw ; Rect *temprect ; int ffd ; /* File descriptor of faces frame. */ short gray_image[] = { 0x8000, 0x8000, 0x2000, 0x2000 } ; mpr_static(gray_pr, 4, 4, 1, gray_image) ; short noface_image[] = { #include "noface.icon" } ; mpr_static(noface_pr, 64, 64, 1, noface_image) ; short nomail_image[] = { #include "nomail.icon" } ; mpr_static(nomail_pr, 64, 64, 1, nomail_image) ; short nopaper_image[] = { #include "nopaper.icon" } ; mpr_static(nopaper_pr, 64, 64, 1, nopaper_image) ; short noprint_image[] = { #include "noprint.icon" } ; mpr_static(noprint_pr, 64, 64, 1, noprint_image) ; add_face(display, itype, name) enum disp_type display ; enum icon_type itype ; char *name ; { Pixrect *face_pr ; unsigned short buf[256] ; /* Ikon/icon image. */ unsigned short *ptr ; int freeit ; /* Set if we should destroy this pixrect. */ int i ; freeit = 0 ; switch ((int) itype) { case NOMAIL : face_pr = &nomail_pr ; break ; case NOPAPER : face_pr = &nopaper_pr ; break ; case NOPRINT : face_pr = &noprint_pr ; break ; case ORDINARY : if (get_icon(name, buf) == -1) face_pr = &noface_pr ; else { face_pr = mem_create(64, 64, 1) ; ptr = (unsigned short *) ((struct mpr_data *) face_pr->pr_data)->md_image ; for (i = 0; i < 256; i++) ptr[i] = buf[i] ; freeit = 1 ; } break ; } if (display == ICON) if (mtype == MONPRINTER) adjust_image(mpr, face_pr, 0, 0) ; else adjust_image(mpr, face_pr, row, column) ; else if (display == WINDOW) adjust_image(pr, face_pr, row, column) ; else { adjust_image(mpr, face_pr, row, column) ; adjust_image(pr, face_pr, row, column) ; } if (freeit) PR_DESTROY(face_pr) ; } adjust_image(fpr, face_pr, row, column) /* Place new face in memory pixrect. */ Pixrect *fpr, *face_pr ; int row, column ; { switch ((int) mtype) { case MONNEW : PR_ROP(fpr, 64, 0, 640-64, 64, PIX_SRC, fpr, 0, 0) ; case MONALL : case MONPRINTER : PR_ROP(fpr, column*ICONWIDTH, row*ICONHEIGHT, ICONWIDTH, ICONHEIGHT, PIX_SRC, face_pr, 0, 0) ; } } Notify_value check_mail() { do_check() ; } beep_flash(beeps, flashes) /* Perform visual feedback. */ int beeps, flashes ; { static struct timeval btime = { 0, 250000 } ; /* Beep timer. */ int bfd ; /* File descriptor for faces window, or -1. */ Pixwin *bpw ; /* Pixwin pointer for faces window, or 0. */ if (beeps || flashes) do { bfd = beeps > 0 ? ffd : -1 ; bpw = flashes > 0 ? fpw : (Pixwin *) 0 ; WIN_BELL(bfd, btime, bpw) ; SELECT(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &btime) ; beeps-- ; flashes-- ; } while (beeps > 0) ; } create_pixrects(width, height) /* Create pixrects for the face images. */ int width, height ; { old_pr = pr ; pr = mem_create(width, height, 1) ; PR_REPLROP(pr, 0, 0, width, height, PIX_SRC, background, 0, 0) ; faces_icon = (Icon) window_get(frame, FRAME_ICON) ; old_mpr = (Pixrect *) icon_get(faces_icon, ICON_IMAGE) ; if (mtype == MONPRINTER) mpr = mem_create(ICONWIDTH, ICONHEIGHT, 1) ; else { mpr = mem_create(width, height, 1) ; PR_REPLROP(mpr, 0, 0, width, height, PIX_SRC, background, 0, 0) ; } if (mtype == MONNEW && old_pr != NULL) PR_ROP(pr, 0, 0, width, height, PIX_SRC, old_pr, 0, 0) ; if (mtype == MONNEW && old_mpr != NULL) PR_ROP(mpr, 0, 0, width, height, PIX_SRC, old_mpr, 0, 0) ; } init_ws_type() { gtype = SUNVIEW ; return 0 ; } make_frame(argc,argv) int argc ; char *argv[] ; { unsigned short buf[256] ; /* For background pattern. */ unsigned short *ptr ; int i ; if (strlen(bgicon)) { if (get_sun_icon(bgicon, buf) == 0) background = &gray_pr ; background = mem_create(64, 64, 1) ; ptr = (unsigned short *) ((struct mpr_data *) background->pr_data)->md_image ; for (i = 0; i < 256; i++) ptr[i] = buf[i] ; } else background = &gray_pr ; frame = window_create((Window) 0, FRAME, FRAME_ICON, faces_icon, FRAME_SHOW_LABEL, FALSE, FRAME_SUBWINDOWS_ADJUSTABLE, FALSE, FRAME_NO_CONFIRM, TRUE, WIN_WIDTH, NO_PER_ROW * ICONWIDTH + 10, WIN_HEIGHT, ICONHEIGHT * 10 + 10, FRAME_ARGS, argc,argv, 0) ; fpw = (Pixwin *) window_get(frame, WIN_PIXWIN) ; ffd = (int) window_get(frame, WIN_FD) ; canvas = window_create(frame, CANVAS, CANVAS_REPAINT_PROC, repaint_proc, CANVAS_RETAINED, TRUE, 0) ; pw = canvas_pixwin(canvas) ; sfont = pf_open(SMALLFONT) ; width = NO_PER_ROW * ICONWIDTH ; height = ICONHEIGHT ; } make_icon() { if (mtype == MONPRINTER) faces_icon = icon_create(ICON_IMAGE, &noprint_pr, 0) ; else faces_icon = icon_create(ICON_IMAGE, &nomail_pr, 0) ; } /*ARGSUSED*/ repaint_proc(canvas, pw, repaint_area) Canvas canvas ; Pixwin *pw ; Rectlist *repaint_area ; { PW_ROP(pw, 0, 0, width, height, PIX_SRC, pr, 0, 0) ; } show_display() /* Show the latest set of mail icon faces. */ { if (invert) /* Invert the memory pixrects before displaying. */ { PR_ROP(pr, 0, 0, width, height, PIX_NOT(PIX_DST), pr, 0, 0) ; PR_ROP(mpr, 0, 0, width, height, PIX_NOT(PIX_DST), pr, 0, 0) ; } if (mtype != MONPRINTER) { temprect = (Rect *) icon_get(faces_icon, ICON_IMAGE_RECT) ; temprect->r_height = height ; temprect->r_width = width ; ICON_SET(faces_icon, ICON_HEIGHT, height, ICON_WIDTH, width, ICON_IMAGE_RECT, temprect, ICON_IMAGE, mpr, 0) ; } else ICON_SET(faces_icon, ICON_IMAGE, mpr, 0) ; WINDOW_SET(frame, FRAME_ICON, faces_icon, 0) ; temprect = (Rect *) window_get(frame, FRAME_OPEN_RECT) ; temprect->r_height = height+10 ; temprect->r_width = width+10 ; WINDOW_SET(frame, FRAME_OPEN_RECT, temprect, 0) ; PW_ROP(pw, 0, 0, width, height, PIX_SRC, pr, 0, 0) ; if (newmail) beep_flash(beeps, flashes) ; if (old_pr) PR_DESTROY(old_pr) ; if (old_mpr) PR_DESTROY(old_mpr) ; } start_tool() { struct itimerval tval ; tval.it_interval.tv_usec = 0 ; tval.it_interval.tv_sec = period ; tval.it_value.tv_usec = 0 ; tval.it_value.tv_sec = period ; NOTIFY_SET_ITIMER_FUNC(frame, check_mail, ITIMER_REAL, &tval, ITIMER_NULL) ; window_main_loop(frame) ; } text(display, just, str) enum disp_type display ; enum just_type just ; char *str ; { int len ; int c, r ; /* Column and row position for this face. */ int x, y ; /* Position of start of this text string. */ Pixrect *tpr ; c = column ; r = row ; switch ((int) display) { case BOTH : text(ICON, just, str) ; text(WINDOW, just, str) ; return ; case ICON : tpr = mpr ; if (mtype != MONALL) c = r = 0 ; break ; case WINDOW : tpr = pr ; } len = strlen(str) ; /* Character length of text. */ if (len > 10) { len = 10 ; str[10] = '\0' ; /* Maximum of 10 characters. */ } switch ((int) just) { case LEFT : x = c*ICONWIDTH+2 ; y = (r+1)*ICONHEIGHT-2 ; break ; case RIGHT : x = (c+1)*ICONWIDTH-(len*6)-2 ; y = (r+1)*ICONHEIGHT-2 ; } PR_ROP(tpr, x, y-9, len*6+2, 10, PIX_CLR, (Pixrect *) NULL, 0, 0) ; PR_TTEXT(tpr, x, y, PIX_SRC ^ PIX_NOT(PIX_DST), sfont, str) ; } Funky_Stuff len=`wc -c < sunview.c` if [ $len != 9881 ] ; then echo error: sunview.c was $len bytes long, should have been 9881 fi fi # end of overwriting check From don@brillig.umd.edu Sun Dec 11 11:35:05 1988 Date: Sun, 11 Dec 88 11:35:05 EST To: NeWS-makers@brillig.umd.edu Subject: faces (visual mail/printer monitor) - Part 3 of 3. From: sunaus!sunchat!richb@Sun.COM (Rich Burridge) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) ------CUT HERE------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 to create the files: # facedir (directory) # This archive created: Sun Dec 11 15:16:32 EST 1988 # # export PATH; PATH=/bin:$PATH # if [ -f facedir ] then echo shar: can not write a directory over file facedir else if [ ! -d facedir ] then echo shar: creating directory facedir mkdir facedir fi echo shar: entering directory facedir cd facedir if [ -f machine.tab ] then echo shar: will not over-write existing file machine.tab else echo shar: extracting 'machine.tab', 383 characters cat > machine.tab <<'Funky_Stuff' stard=sunaus extra=sunaus sunchat=sunaus garfield=sunaus tom=sunaus felix=sunaus sunk=sunaus sunsa=sunaus misaus=sunaus maverick=sunaus misaus1=sunaus nimbin=sunaus redgum=sunaus palette=sunaus sunwa=sunaus sunact=sunaus basset=basser castor.cs.su.oz=basser cluster.cs.su.oz=basser orwell=basser sarad=basser sasha=basser sunrise=basser gris=softway softway.sw.oz=softway arakis=sun Funky_Stuff len=`wc -c < machine.tab` if [ $len != 383 ] ; then echo error: machine.tab was $len bytes long, should have been 383 fi fi # end of overwriting check if [ -f misc. ] then echo shar: can not write a directory over file misc. else if [ ! -d misc. ] then echo shar: creating directory misc. mkdir misc. fi echo shar: entering directory misc. cd misc. if [ -f acsnet ] then echo shar: can not write a directory over file acsnet else if [ ! -d acsnet ] then echo shar: creating directory acsnet mkdir acsnet fi echo shar: entering directory acsnet cd acsnet if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0008,0x6000,0x0000, 0x000C,0x5000,0x0000, 0x000A,0x4800,0x0000, 0x000D,0x5400,0x0000, 0x000A,0xDA00,0x0000, 0x0005,0x5A00,0x0000, 0x0002,0xAA00,0x0000, 0x0001,0x7400,0x0000, 0x0003,0xE400,0x0000, 0x0006,0x2600,0x0000, 0x00FC,0x0A00,0x0000, 0x0301,0x0600,0x0000, 0x0700,0x0A00,0x0000, 0x06C0,0x1600,0x0000, 0x0300,0x0C00,0x0000, 0x01FF,0x9400,0x0000, 0x0001,0xA800,0x0000, 0x0003,0x1800,0x0000, 0x0002,0x3000,0x0000, 0x0006,0x6000,0x0000, 0x000C,0xA000,0x0000, 0x0008,0x6000,0x0000, 0x0018,0xA000,0x0000, 0x0010,0x6000,0x0000, 0x03F0,0x2000,0x0000, 0x0607,0x5000,0x0000, 0x043C,0x5000,0x0000, 0x0561,0xD800,0x0000, 0x076A,0x0800,0x0000, 0x03EA,0x1400,0x0000, 0x003E,0x0C00,0x0000, 0x0010,0x1600,0x0000, 0x0070,0x0B00,0x0000, 0x01F0,0x0580,0x0000, 0x01FF,0x02C0,0x0000, 0x01F8,0x7160,0x0000, 0x0080,0xFAB0,0x0000, 0x00C1,0x8158,0x0000, 0x0063,0x00AC,0x0000, 0x003B,0x0056,0x0000, 0x003E,0x002B,0x0000, 0x002B,0x0015,0x8000, 0x0035,0x0002,0xC007, 0x001B,0x8001,0x600D, 0x7FF5,0x80C0,0xBFF9, 0xAFFF,0x80E0,0x5543, 0xFA00,0x00F8,0x001E, 0x1FFF,0xFFCF,0xFFF0, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory acsnet fi if [ -f adm ] then echo shar: can not write a directory over file adm else if [ ! -d adm ] then echo shar: creating directory adm mkdir adm fi echo shar: entering directory adm cd adm if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x01FF,0xF801,0xFFF0, 0x0200,0x17E2,0x0020, 0x0400,0x2844,0x0050, 0x0800,0x50BF,0xFFA0, 0x1000,0xA940,0x0250, 0x2001,0x5280,0x05A0, 0x7FFE,0xAD00,0x0A50, 0x0001,0x5200,0x15F8, 0x7FFE,0xAC00,0x2A10, 0x0001,0x57FF,0xD528, 0x7FFE,0xA801,0x2A50, 0x0001,0x5002,0xD5A8, 0x7FFE,0xA805,0x2A50, 0x0001,0x500A,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A8, 0x7FFE,0xA815,0x2A50, 0x0001,0x57EA,0xD5A0, 0x7FFE,0xA815,0x2A40, 0x0001,0x57EA,0xD580, 0x7FFE,0xA815,0x2A00, 0x0001,0x57EA,0xD400, 0x7FFE,0xA815,0xFFF8, 0x0001,0x57EA,0x0010, 0x7FFE,0xA814,0x0028, 0x0001,0x57E8,0x0057, 0x7FFE,0xAB10,0x00AB, 0x0001,0x55E0,0x0155, 0x7FFE,0xA97F,0xFEA9, 0x0001,0x5180,0x0151, 0x7FFE,0xA17F,0xFEA1, 0x0001,0x4200,0x0142, 0xFFFF,0x84FF,0xFF84, 0x8000,0x8880,0x0088, 0x8520,0x9099,0x2E90, 0x85A0,0xA0A5,0x24A0, 0x8560,0xC0A5,0x24C0, 0x8520,0x8098,0xC480, 0x4001,0x0040,0x0100, 0x3FFE,0x003F,0xFE00, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory adm fi if [ -f bin ] then echo shar: can not write a directory over file bin else if [ ! -d bin ] then echo shar: creating directory bin mkdir bin fi echo shar: entering directory bin cd bin if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0046,0x230C,0x4600, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0046,0x230C,0x4600, 0x0000,0x0000,0x0000, 0x0031,0x1862,0x3100, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0031,0x1862,0x3100, 0x0000,0x0000,0x0000, 0x0048,0xC48C,0x3100, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0048,0xC48C,0x3100, 0x0000,0x0000,0x0000, 0x0031,0x230C,0x4600, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0031,0x230C,0x4600, 0x0000,0x0000,0x0000, 0x0046,0x2462,0x3100, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0049,0x2492,0x4900, 0x0046,0x2462,0x3100, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory bin fi if [ -f daemon ] then echo shar: can not write a directory over file daemon else if [ ! -d daemon ] then echo shar: creating directory daemon mkdir daemon fi echo shar: entering directory daemon cd daemon if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0440,0x0000, 0x0000,0x0820,0x0000, 0x0000,0x0820,0x0000, 0x0000,0x0C60,0x1000, 0x0000,0x0FE0,0x3800, 0x0000,0x07C0,0x3800, 0x0004,0x0540,0x7C00, 0x0014,0x07C0,0x1000, 0x0054,0x0380,0x1000, 0x0054,0x03C0,0x1000, 0x0058,0x07E0,0x1000, 0x0068,0x0FE1,0xA000, 0x0008,0x1FF2,0x6000, 0x000F,0xFFF2,0x2000, 0x000F,0xF7FA,0x6000, 0x0004,0x07D9,0xE000, 0x0002,0x07D8,0x2000, 0x0002,0x07D8,0x2000, 0x0002,0x07D8,0x4000, 0x0001,0x07F8,0x4000, 0x0001,0x07F0,0x8000, 0x0001,0x0FEF,0x0000, 0x0000,0x8FE0,0x0000, 0x0000,0x9EC0,0x0000, 0x0000,0x9CC0,0x0000, 0x0000,0x58E0,0x0000, 0x0000,0x4C60,0x0000, 0x0000,0x4420,0x0000, 0x0000,0x0C60,0x0000, 0x0000,0x1CE0,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory daemon fi if [ -f mailer-daemon ] then echo shar: can not write a directory over file mailer-daemon else if [ ! -d mailer-daemon ] then echo shar: creating directory mailer-daemon mkdir mailer-daemon fi echo shar: entering directory mailer-daemon cd mailer-daemon if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0001,0xFFFF,0xFFC0, 0x0002,0xB000,0x0030, 0x0003,0x5800,0x0008, 0x0006,0xADFF,0xFFC8, 0x0005,0x54FF,0xFFE4, 0x000A,0xAAF7,0xFDF2, 0x020D,0x5673,0xF9F2, 0x060A,0xAA61,0xF0FA, 0x0E0D,0x5568,0xE8F9, 0x1E0A,0xAB71,0xF1F9, 0x0E0D,0x557F,0xFFF9, 0x0A0A,0xAB3F,0xFFF1, 0x080D,0x5500,0x0001, 0x080A,0xAB00,0x0001, 0x080D,0x5500,0x9E01, 0x0DEA,0xAB03,0x9F81, 0x073D,0x5507,0x83C1, 0x001A,0xAB0F,0x81E1, 0x001D,0x551F,0x80F1, 0x000A,0xAB1F,0x80F1, 0x000D,0x553F,0x80F9, 0x000A,0xAB3F,0x80F9, 0x000D,0x553F,0x80F9, 0x000A,0xAB3F,0x80F9, 0x0FFD,0x553F,0x81F9, 0x3FFA,0xAB3F,0x83F9, 0x7FFD,0x553F,0x9FF9, 0xFFFA,0xAB3F,0x9FF9, 0xFFFD,0x551F,0x9FF1, 0xFFFA,0xAB1F,0x9FF1, 0xFFFD,0x550F,0x9FE1, 0xFFFA,0xAB07,0x9FC1, 0xFFFD,0xD503,0x9F81, 0x7FFB,0xEB00,0x9E01, 0x3FFD,0xF500,0x0001, 0x1FFB,0xFB00,0x0001, 0x0FFD,0xFD0F,0xFFE1, 0x07FB,0xFB1F,0xFFD1, 0x01FD,0xFD3F,0xF7C9, 0x00FF,0xFF7F,0xF8C5, 0x003F,0xFD7F,0xFC45, 0x001F,0xFF7F,0xFE05, 0x0007,0xF540,0x3F85, 0x0003,0xF740,0x0FC5, 0x0000,0xFD40,0x01F5, 0x0000,0x3F40,0x007D, 0x0000,0x0740,0x003D, 0x0000,0x01C0,0x000F, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory mailer-daemon fi if [ -f net ] then echo shar: can not write a directory over file net else if [ ! -d net ] then echo shar: creating directory net mkdir net fi echo shar: entering directory net cd net if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0020,0x0000,0x0000, 0x0070,0x0100,0x0000, 0x00F8,0x0300,0x0000, 0x0020,0x7FFC,0x0000, 0x0010,0x8303,0xE200, 0x000F,0x0101,0x2600, 0x0009,0x0001,0x3F00, 0x0009,0x0001,0xE600, 0x000F,0x0002,0x0200, 0x0010,0x8014,0x0000, 0x00A0,0x5018,0x0000, 0x00C0,0x301C,0x0000, 0x00E0,0x7020,0x0000, 0x0000,0x0840,0x4000, 0x0000,0x05E0,0xC000, 0x0000,0x033F,0xFF00, 0x0000,0x1120,0xC000, 0x00E0,0x31E0,0x4000, 0x00C0,0xFF20,0x0000, 0x00A1,0x3010,0x0000, 0x001E,0x100E,0x0000, 0x0012,0x000C,0x0700, 0x0012,0x000A,0x0300, 0x001E,0x0001,0x0500, 0x00A1,0x0000,0x8800, 0x00C0,0x8000,0x9000, 0x00E0,0x4101,0xE000, 0x0000,0x2181,0x2000, 0x0000,0x1FFF,0x2000, 0x0000,0x0181,0xE000, 0x0000,0x0101,0x0000, 0x0000,0x0002,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory net fi if [ -f root ] then echo shar: can not write a directory over file root else if [ ! -d root ] then echo shar: creating directory root mkdir root fi echo shar: entering directory root cd root if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x1EE4,0x0000, 0x0000,0x1B04,0x0000, 0x0000,0x1F74,0x0000, 0x0000,0x1F64,0x0000, 0x0000,0x1FA4,0x0000, 0x0000,0x1704,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1EE4,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1FE4,0x0000, 0x0000,0x1EC4,0x0000, 0x0000,0x17F4,0x0000, 0x0000,0x37F6,0x0000, 0x0000,0x3FEB,0x0000, 0x0000,0xFF7F,0x0000, 0x0000,0xFF7F,0xE000, 0x0001,0xFFE7,0xF000, 0x000F,0xE7F1,0x9800, 0x001F,0x0631,0xC800, 0x0036,0x0C30,0x6400, 0x0024,0x1830,0x6600, 0x0064,0x3C10,0x2200, 0x0064,0x3410,0x2200, 0x004C,0x2438,0x7200, 0x004E,0x242C,0xDA00, 0x004A,0x6424,0x8A00, 0x0012,0x4426,0x8800, 0x0012,0x4460,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory root fi if [ -f sys ] then echo shar: can not write a directory over file sys else if [ ! -d sys ] then echo shar: creating directory sys mkdir sys fi echo shar: entering directory sys cd sys if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0200,0x0000, 0x0000,0x0004,0x0000, 0x0000,0x080A,0x0000, 0x0000,0x008A,0x2000, 0x0000,0x016A,0xD000, 0x0002,0x0091,0x2000, 0x0000,0x0080,0x2000, 0x0020,0x004E,0x4000, 0x0000,0x439F,0x3800, 0x0000,0xA41F,0x0400, 0x0088,0xA39F,0x3800, 0x0016,0xAD4E,0x4000, 0x0009,0x1280,0x2000, 0x0008,0x0291,0x2000, 0x0004,0xE56A,0xD100, 0x0039,0xF38A,0x2000, 0x0241,0xF04A,0x0000, 0x0039,0xF384,0x0400, 0x0004,0xE400,0x0000, 0x0008,0x0200,0x2000, 0x0009,0x1240,0x0000, 0x0016,0xADA0,0x0000, 0x0008,0xAAA2,0x0000, 0x0000,0xB6AD,0x0000, 0x0000,0x4912,0x1000, 0x0000,0x0802,0x0000, 0x0020,0x04E4,0x0000, 0x0200,0x39F3,0x8800, 0x0008,0x41F0,0x4000, 0x0814,0x39F3,0x8000, 0x0114,0x44E4,0x0000, 0x12D5,0xA802,0x0800, 0x0122,0x4912,0x0000, 0x0100,0x56AD,0x0000, 0x209C,0x88A2,0x0000, 0x073E,0x70A0,0x2000, 0x083E,0x0840,0x0000, 0x073E,0x7000,0x0000, 0x009C,0x8000,0x0000, 0x0100,0x4000,0x0000, 0x0122,0x4200,0x0000, 0x02D5,0xA000,0x0000, 0x0114,0x4000,0x0000, 0x0014,0x0800,0x0000, 0x0008,0x0000,0x0000, 0x0000,0x4000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory sys fi if [ -f unknown ] then echo shar: can not write a directory over file unknown else if [ ! -d unknown ] then echo shar: creating directory unknown mkdir unknown fi echo shar: entering directory unknown cd unknown if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x01FF,0xC000, 0x7C00,0x1FFF,0xE000, 0x8200,0xFFFF,0xE000, 0x8207,0xFFFF,0xF000, 0x620F,0xFFFF,0xFF80, 0x040F,0xFFFF,0xFFE0, 0x080F,0xFFFF,0xFFF0, 0x100F,0xFFFF,0xF7F0, 0x2007,0xFFFF,0xF7F0, 0x0007,0xFFFF,0x8FE0, 0x2007,0xFFFE,0x7F80, 0x2007,0xFFF9,0xFE00, 0x000D,0xFFE7,0xFE00, 0x103E,0x7F9F,0xFE00, 0x007F,0x807F,0xFE00, 0x20FF,0xFFFF,0xFE00, 0x81FF,0xFFFF,0xFE00, 0x01FF,0xFFFB,0x8E00, 0x81FF,0xFFE1,0xF600, 0x21FF,0xFFE7,0xF600, 0x09FF,0xFFFF,0x0600, 0x00FF,0xFFFC,0x7F80, 0x0877,0xF7F0,0x3FC0, 0x2007,0xF7E0,0x1FC0, 0x0003,0xE7E0,0x7FC0, 0x4001,0xC3C3,0xFFC0, 0x1000,0x800F,0xFF80, 0x0407,0x803F,0xFF80, 0x0007,0x83FF,0xFF80, 0x00BF,0xFBFF,0xFF80, 0x00A0,0x1FFF,0xFF80, 0x00BF,0xFFFF,0xFF80, 0x0001,0xFFFF,0xFF80, 0x0001,0xF7FF,0xF180, 0x001F,0xFFFF,0xCFC0, 0x007E,0xFFFC,0x3FE0, 0x01FF,0x3FC3,0xFFF8, 0x07FF,0xDF3F,0xFFFE, 0x0FFF,0xF0FF,0xFFFF, 0x1FFF,0xCFFF,0xFFFF, 0x3FFF,0xDFFF,0xFFFF, 0x3FFF,0xD9FF,0xFFFF, 0x7FFF,0xD9FF,0xFFFF, 0x7FFF,0xDFFF,0xFFFF, 0xFFFF,0xBFC0,0x07FF, 0xFFFF,0xBFDF,0xF7FF, 0xFFFF,0xBFDF,0xF7FF, 0xFFFF,0xBFDF,0xF7FF, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory unknown fi if [ -f uucp ] then echo shar: can not write a directory over file uucp else if [ ! -d uucp ] then echo shar: creating directory uucp mkdir uucp fi echo shar: entering directory uucp cd uucp if [ -f 48x48x1 ] then echo shar: will not over-write existing file 48x48x1 else echo shar: extracting '48x48x1', 1056 characters cat > 48x48x1 <<'Funky_Stuff' 0x0000,0x0000,0x0000, 0x0000,0x0000,0x3FE0, 0x0000,0x0000,0xE000, 0x0000,0x0001,0x8000, 0x0000,0x0003,0x0000, 0x0200,0x0007,0xE000, 0x0008,0x001E,0x1800, 0x1000,0x0074,0x0800, 0x0040,0x00C4,0x0800, 0x0001,0x0184,0x0800, 0x4200,0x0106,0x1800, 0x0010,0x0201,0xE000, 0x0000,0x0000,0x0000, 0x4000,0x0000,0x0000, 0x0400,0x0000,0x0000, 0x0020,0x3F00,0x0000, 0x4400,0xF5C0,0x0000, 0x0023,0xAAF0,0x0000, 0x020F,0x5558,0x0000, 0x003A,0xAAAE,0x0000, 0x20F5,0x5557,0x8000, 0x03AA,0xAAAA,0xC000, 0x0F55,0x5555,0x7000, 0x3EAA,0xA0AA,0xBC00, 0x7755,0x1F15,0x5600, 0xEBAA,0x71CA,0xAB80, 0xD5D1,0xC071,0x55E0, 0xAAE7,0x001C,0xABB0, 0xD57C,0x0007,0x177C, 0x6070,0x0011,0xCEEE, 0x3FC0,0x0020,0x7DD7, 0x0000,0x1140,0x1DAB, 0x0000,0x0001,0x0795, 0x0000,0x0000,0x01C3, 0x0000,0x0004,0x007E, 0x0001,0x0020,0x0800, 0x0000,0x1100,0x0020, 0x0000,0x0000,0x1000, 0x0000,0x0000,0x4040, 0x0010,0x0000,0x0080, 0x0000,0x2004,0x0100, 0x0000,0x0110,0x0200, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x2000, 0x0020,0x0002,0x0000, 0x0000,0x0020,0x0000, 0x0001,0x0400,0x0000, 0x0000,0x0000,0x0000, Funky_Stuff len=`wc -c < 48x48x1` if [ $len != 1056 ] ; then echo error: 48x48x1 was $len bytes long, should have been 1056 fi fi # end of overwriting check cd .. echo shar: done with directory uucp fi cd .. echo shar: done with directory misc. fi if [ -f people.tab ] then echo shar: will not over-write existing file people.tab else echo shar: extracting 'people.tab', 1663 characters cat > people.tab <<'Funky_Stuff' sunaus/rallen=bob sunaus/ballen=bob sunaus/bbaker=bruceb sunaus/mbosch=mike sunaus/eddy=eddie sunaus/eevans=eddie sunaus/ggrell=grell sunaus/gene=grell sunaus/jingall=johni sunaus/ijeffery=ian sunaus/glynne=gjl sunaus/tmcentee=tim sunaus/jnoonan=johnn sunaus/apappas=arie sunaus/jennie=jenny sunaus/jrendell=jenny sunaus/gsearle=gjs sunaus/gsitters=greg sunaus/bscott=brad sunaus/rstewart=ruth sunaus/jteasdale=jim sunaus/loraine=lori sunaus/lorraine=lori sunaus/lunicomb=lori sunaus/pvrbancich=paula sunaus/swoodhead=simon sunaus/jy=yo sunaus/jyoung=yo sunaus/rboden=richard sunaus/rbodin=richard sunaus/rburridge=richb sunaus/rich=richb sunaus/mcunningham=mary sunaus/sduchesne=sue sunaus/mfredericks=max sunaus/mfredricks=max sunaus/bgeneralis=bill sunaus/shulbert=susanh sunaus/susan=susanh sunaus/gmason=gregm sunaus/vmickan=val sunaus/trogge=tony sunaus/andy=aspiers sunaus/bwiggins=bruce sunaus/ryeap=ron sunaus/cbreen=colinb sunaus/rdesalis=roger sunaus/mfort=markf sunaus/mark=markg sunaus/mgurvis=markg sunaus/mnegri=manuel sunaus/npettitt=noel sunaus/jraine=john sunaus/paul=paulr sunaus/prosham=paulr sunaus/gsweigert=geo sunaus/rbowman=robb sunaus/bbowman=robb sunaus/krees=kim sunaus/mikes=mslee sunaus/gshepherd=george sunaus/aweller=andrew sunaus/kbeavan=kevin sunaus/rbradford=rhonda sunaus/ckeith=colin sunaus/mmccann=mmc sunaus/ksterry=kaylene sunaus/rwilliams=rex sunaus/gdonin=gary sunaus/dshea=dennis sunaus/doshea=dennis sunaus/hprotoolis=harry sunaus/rschrader=robert sunaus/bschrader=robert sunaus/bobs=robert sunaus/jvermeulen=jeff sunaus/MAILER-DAEMON=mailer-daemon sunaus/Mailer-Daemon=mailer-daemon sunaus/mailer-daemon=mailer-daemon Funky_Stuff len=`wc -c < people.tab` if [ $len != 1663 ] ; then echo error: people.tab was $len bytes long, should have been 1663 fi fi # end of overwriting check if [ -f sunaus ] then echo shar: can not write a directory over file sunaus else if [ ! -d sunaus ] then echo shar: creating directory sunaus mkdir sunaus fi echo shar: entering directory sunaus cd sunaus if [ -f richb ] then echo shar: can not write a directory over file richb else if [ ! -d richb ] then echo shar: creating directory richb mkdir richb fi echo shar: entering directory richb cd richb if [ -f face.ps ] then echo shar: will not over-write existing file face.ps else echo shar: extracting 'face.ps', 782 characters cat > face.ps <<'Funky_Stuff' /Icon findfont 1 scalefont setfont .1 .25 .9 .75 rectpath 1 setgray fill 0 setgray .1 .25 moveto (\056) show .002 sleep 1 setgray .1 .25 moveto (\056) show 0 setgray .1 .25 moveto (\057) show .002 sleep 1 setgray .1 .25 moveto (\057) show 0 setgray .1 .25 moveto (\060) show .002 sleep 1 setgray .1 .25 moveto (\060) show 0 setgray .1 .25 moveto (\061) show .002 sleep 1 setgray .1 .25 moveto (\061) show 0 setgray .1 .25 moveto (\062) show .002 sleep 1 setgray .1 .25 moveto (\062) show 0 setgray .1 .25 moveto (\061) show .002 sleep 1 setgray .1 .25 moveto (\061) show 0 setgray .1 .25 moveto (\060) show .002 sleep 1 setgray .1 .25 moveto (\060) show 0 setgray .1 .25 moveto (\057) show .002 sleep 1 setgray .1 .25 moveto (\057) show 0 setgray .1 .25 moveto (\056) show Funky_Stuff len=`wc -c < face.ps` if [ $len != 782 ] ; then echo error: face.ps was $len bytes long, should have been 782 fi fi # end of overwriting check cd .. echo shar: done with directory richb fi cd .. echo shar: done with directory sunaus fi cd .. echo shar: done with directory facedir fi From don@brillig.umd.edu Mon Dec 12 12:04:36 1988 Date: Mon, 12 Dec 88 12:04:36 EST To: NeWS-makers@brillig.umd.edu Subject: Re: reference card for NeWS 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 <8812101801.AA07726@brillig.umd.edu> marshall@software.org (Eric Marshall) writes: > The recent SUG tape contains... Ummm, careful: the Software Exchange machine at SUG yielded software that will likely show up on the next SUG tape. Many folks happily got software on their tapes, at SUG, from that machine. However, SUG didn't distribute that tape (because they haven't had time yet to arrange for copyrights), so don't call it a SUG tape just yet. From don@brillig.umd.edu Mon Dec 12 12:19:16 1988 Date: Mon, 12 Dec 88 12:19:16 EST To: NeWS-makers@brillig.umd.edu Subject: Please get a new copy of news-tape.tar.Z.a[a-h] !! From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The split up compressed tar files that were on tumtum's anonymous ftp directory were messed up somehow (thanks to Steve Kappel for noticing this and pointing it out!). When unpacked, the tar exits without any error, without having extracted the entire directory. I make a new copy and tested it out this time. If you got a copy of the files news-tape.tar.Z.a[a-h] from tumtum, then please fetch another copy, since you're probably missing lots of stuff! -Don From don@brillig.umd.edu Mon Dec 12 16:42:03 1988 Date: Mon, 12 Dec 88 16:42:03 EST To: NeWS-makers@brillig.umd.edu Subject: looking for Clark Thomborson re SUG favor From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Sorry for posting this, but I can't seem to get my mail through to cthombor@cs-luke.d.umn.edu. ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- There were no vendors selling Sun compatible color monitors. There were a couple of vendors using Sony monitors, and the monitors did look good. Another vendor had a 24 plane Hitachi which had photograph quality images, but costs big bucks. From don@brillig.umd.edu Mon Dec 12 19:48:36 1988 Date: Mon, 12 Dec 88 19:48:36 EST To: NeWS-makers@brillig.umd.edu Subject: Call for Papers From: mitchell%community-chest.mitre.org@gateway.mitre.org Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) ***** CALL FOR PAPERS AND PARTICIPATION ***** 28th Annual Technical Symposium of the Washington, D.C. Chapter of the ACM INTERFACES: Systems and People Working Together National Institute of Standards and Technology Gaithersburg, Maryland - August 24, 1989 No computer is an island. Increasingly, systems are being tied together to improve their value to the organizations they serve. This symposium will explore the theoretical and practical issues in interfacing systems and in enabling people to use them effectively. *** SOME TOPICS OF INTEREST FOR SUBMITTED PAPERS *** * HUMAN FACTORS * User interfaces Meeting the needs of handicapped users Conquering complexity Designing systems for people Intelligent assistants The human dimension of information interchange * SYSTEMS INTEGRATION * Communications networks Distributed databases Data standardization System fault tolerance Communications standards (e.g. GOSIP) * STRATEGIC SYSTEMS * Decision support systems Embedding expert systems in information systems Strategic info systems Computer Aided Logistics Support (CALS) * SYSTEM DEVELOPMENT AND OPERATION * Quality control and testing Designing a system of systems System management Conversion and implementation strategies Software tools and CASE Identifying requirements thru prototyping * ENABLING TECHNOLOGIES FOR APPLICATIONS PORTABILITY * Ada Database management Open software Open protocol technology Operating systems (e.g., POSIX) ==> DON'T BE LIMITED BY OUR SUGGESTIONS - MAKE YOUR OWN! Both experienced and first-time authors are encouraged to present their work. Papers will be refereed. A length of 10 to 20 double-spaced pages is suggested. Those presenting a paper are entitled to register for the symposium at the early advance registration rate. To propose special sessions or noncommercial demonstrations, please send three copies of an extended abstract to the Program Chairman at the address below. Note: A paper must include the name, mailing address, and telephone number of each author or other presenter. Authors of accepted papers must transfer copyright to ACM for material published in the Proceedings (excepting papers that cannot be copyrighted under Government regulations). The ACM policy on prior publication was revised in 1987. A complete statement of the policy appears in the November 1987 issue of Communications of the ACM. In part it states that "republication of a paper, possibly revised, that has been disseminated via a proceedings or newsletter is permitted if the editor of the journal to which it has been submitted judges that there is significant additional benefit to be gained from republication." *** SCHEDULE *** March 2, 1989 Please send five copies of your paper to the Program Chairman: Dr. Milton S. Hess American Management Systems, Inc. 1525 Wilson Boulevard Arlington, VA 22209 April 13, 1989 Acceptance notification June 22, 1989 Final camera ready papers are due August 24, 1989 Presentation at the symposium If you have any questions or suggestions, please contact: Symposium General Chairman: Charles E. Youman, The MITRE Corporation, (703) 883-6349 (voice), (703) 883-6308 (FAX), or youman@mitre.org (internet). Program Chairman: Dr. Milton Hess, American Management Systems, Inc., (703) 841-5942 (voice) or (703) 841-7045 (FAX). NIST Liaison: Ms. Elizabeth Lennon, National Institute of Standards and Technology (formerly the National Bureau of Standards), (301) 975-2832 (voice) or (301) 948-1784 (FAX). From don@brillig.umd.edu Mon Dec 12 21:48:22 1988 Date: Mon, 12 Dec 88 21:48:22 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS on the Amiga From: c60a-2di%WEB.Berkeley.EDU@lilac.berkeley.edu Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) REALLY????? Where can I find it?!?!?!?!?! An aside: How do I subscribe to this mailing list? Please don't subscribe me automagically, as this is a temporary account - just tell me the procedure and I'll do the necessary when I get my named account. Thanks! --- Adrian Ho (c60a-2di@web.berkeley.edu) PS. Of course, you can send the subscription information to this account - it'll only be closed in early Feb (I think). Thanks again!! From don@brillig.umd.edu Tue Dec 13 09:47:23 1988 Date: Tue, 13 Dec 88 09:47:23 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Changing device characteristics in NeWS From: mcvax!ritd.co.uk!mr@uunet.UU.NET Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Sorry to be a spoiler (and I hope that I am wrong) but last time that I read the NeWS licence it specifically precluded using NeWS to drive a printer. A nice gotcha - does Sun own shares in any printer companies? From don@brillig.umd.edu Tue Dec 13 12:39:35 1988 Date: Tue, 13 Dec 88 12:39:35 EST To: NeWS-makers@brillig.umd.edu Subject: part 2 of Rich Burridge's faces program is scrambled From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Can the author please repost it? Thanks. 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 ---------------------------------------------------------------------- Today's quote: Donal O'Shea (an OSF VP) on System V.4: "It's not of sufficient quality. People can't put commercial applications on it." From don@brillig.umd.edu Tue Dec 13 15:55:49 1988 Date: Tue, 13 Dec 88 15:55:49 EST To: NeWS-makers@brillig.umd.edu Subject: Re: color imaging in NeWS From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) > >Is it possible to do color imaging in NeWS? I've assumed it was, but now that >I look at the manual, it doesn't say much about color, let alone color imaging. >If it is possible, then does anyone know how easy it is to get 256 colors on >a Sun console without losing the color map when the cursor leaves the window? >I've got software that does this under SunView, but I have the feeling that the >kludges that worked in SunView won't work in NeWS. Apologies if this has been NeWS 1.1 uses a static color map. You get a close fit to the colors you request. -greg. discussed to death already; I'm new to this group. From don@brillig.umd.edu Tue Dec 13 15:57:57 1988 Date: Tue, 13 Dec 88 15:57:57 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Rumors? From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >That presumes that no-one has written any interesting applications in >NeWS or perhaps equivalently that the only interesting ones are in >Display PostScript. I have seen very few NeWS applications in the commercial marketplace. NeWS and Display PostScript are not comparable. Without the NeXT extensions for event handling, window creation etc.., Display PostScript is not a window system. >The sad fact now is that we have two parallel >(incompatible) extensions to "PostScript" which is only going to make >life hard on the programming community. Yes this is unfortunate, but alot of code can be reused between applications. For instance *.cps files can be 90% converted to pswrap files with just a sed script. (Maybe a 100%, I'm not very good with sed) >It would appear that despite >some bugs that NeWS is considerably more mature, powerful, and >accepted than is Display PostScript at this time. I disagree with the more mature & powerfull statement. NeWS with all the bugs fixed would still not match DPS with NeXT Extensions. The fonts are not finished, thick line stroking is slow, and interfacing to C applications is alot of work. Most applications ported from SunView are used to an event data structure complete with shift & meta masks. Getting this information in NeWS is alot of work. You need to write alot of PostScript and alot of glue between C and PostScript. In DPSNE, you simply send a getnextevent message to your Application object, and you get back a C event data structure. One line of code. NeWS has been out a long time, and there still isn't a powerfull C library. DPSNE on the other hand not only has complete toolkit in Objective C, but it is totally integrated into the Gnu Debugger, and has a program to help build applications. Even if you are doing a big port, the application builder is great for dumping code examples into Objective C. Now that was only if the bugs were fixed. How can you recommend a product from a company which does not fix major bugs in a timely fashion. I have ported a very large application which makes extensive use of fonts to both NeWS and DPSNE and platforms. The NeWS port was absolute pain. Changing the encoding vector crashes the server, screen metrics don't work with a flipped y in the transformation matrix. These are the type of bugs which jeapordize serious applications. The prerelease DPSNE stuff also had alot of bugs, but every bug that I have reported, has been fixed. >So it seems to me >that an implementation on the NeXT machine would interest a number of >people who might like to integrate the machine into an existing >environment of many other workstations. Possibly, but things may just end up being the other way around. (All things being equal on source code availability) -greg. From don@brillig.umd.edu Tue Dec 13 20:38:03 1988 Date: Tue, 13 Dec 88 20:38:03 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Rumors? From: dwf%beta@LANL.GOV (Dave Forslund) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Does the availability of NeWS source code and lack thereof for DPS (except for a certain subset) affect your views on porting and availability on a variety of machines. NeWS is available on a number of other vendors hardware. Will DPS be as quickly ported because of the lack of availability of complete source? David Forslund Los Alamos National Laboratory (dwf@lanl.gov) From don@brillig.umd.edu Tue Dec 13 20:38:21 1988 Date: Tue, 13 Dec 88 20:38:21 EST To: NeWS-makers@brillig.umd.edu Subject: faces - part 2 - REPOST. From: sunaus!sunchat!richb@Sun.COM (Rich Burridge) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've had several requests for a report of part 2 of faces, the visual (mail/printer) monitor. So here it is. Rich. ------CUT HERE------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 to create the files: # get.c # main.c # mon.c # news.c # rec.c # sunview.c # This archive created: Wed Dec 14 07:48:34 EST 1988 # # export PATH; PATH=/bin:$PATH # if [ -f get.c ] then echo shar: will not over-write existing file get.c else echo shar: extracting 'get.c', 10551 characters cat > get.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)get.c 1.2 88/12/09" ; #endif /* Extraction routines used by faces. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include "patchlevel.h" get_blit_ikon(name, buf) /* Load blit ikon file. */ char *name ; unsigned short buf[256] ; { FILE *fin ; char *ptr ; int i, j, temp ; if ((fin = fopen(name, "r")) == NULL) return(-1) ; for (i = 0; i < BLITHEIGHT; i++) { FGETS(nextline, MAXLINE, fin) ; ptr = nextline ; for (j = 0; j < 3; j++) { while (*ptr == ' ' || *ptr == '\t') ptr++ ; SSCANF(ptr,"0x%X",&temp) ; buf[i*4+j] = (short) temp ; ptr = index(ptr,',') ; ptr++ ; } buf[i*4+3] = 0 ; } for (i = BLITHEIGHT; i < ICONHEIGHT; i++) for (j = 0; j < 4; j++) buf[i*4+j] = 0 ; FCLOSE(fin) ; return(0) ; } char * get_field(ftype,line) /* Get field option from given line. */ enum field_type ftype ; char *line ; { char *ptr1, *ptr2 ; char str1[5],str2[MAXLINE],str3[4],str4[4],str5[3],str6[9],str7[5] ; SSCANF(line,"%s %s %s %s %s %s %s", str1,str2,str3,str4,str5,str6,str7) ; switch ((int) ftype) { case HOSTNAME : if ((ptr2 = rindex(str2,'!')) != NULL) { ptr1 = str2 ; *ptr2 = '\0' ; while (ptr2 != ptr1) { *ptr2-- ; if (*ptr2 == '!') return(ptr2+1) ; } return(ptr2) ; } else if ((ptr2 = index(str2,'@')) != NULL) return(ptr2+1) ; else return(NULL) ; case TIMESTAMP : str6[5] = '\0' ; return(str6) ; case USERNAME : if ((ptr2 = rindex(str2,'!')) != NULL) return(ptr2+1) ; else if ((ptr2 = index(str2,'@')) != NULL) { ptr1 = str2 ; *ptr2 = '\0' ; while (ptr2 != ptr1) { *ptr2-- ; if (*ptr2 == '@') return(ptr2+1) ; } return(ptr2) ; } else return(str2) ; } /*NOTREACHED*/ } get_icon(dirname, buf) /* Read in ikon or .icon file. */ char *dirname ; unsigned short buf[256] ; { /* Attempts to open the correct face file. * If the face file is face.ps, then another record is added to the list * of NeWS .ps files to animate at a later time. * If this is 48x48x1 or sun.icon, and the open is successful, then the * face image is read into buf. * -1 is returned on failure. */ char *ptr ; ptr = rindex(dirname,'/') ; /* Find last slash in iconname. */ if (EQUAL(ptr+1,"face.ps")) if (get_news_icon(dirname) == 0) return NEWSTYPE ; if (EQUAL(ptr+1,"sun.icon")) if (get_sun_icon(dirname, buf) == 0) return SUNTYPE ; if (EQUAL(ptr+1,"48x48x1")) if (get_blit_ikon(dirname, buf) == 0) return BLITTYPE ; return -1 ; } get_news_icon(name) /* Create record for news.ps file. */ char *name ; { FILE *fin ; if (gtype != NEWS) return -1 ; if ((fin = fopen(name, "r")) == NULL) return -1 ; FCLOSE(fin) ; add_ps_rec(row, column, name) ; return 0 ; } get_options(argc,argv) /* Read and process command line options. */ int argc ; char *argv[] ; { char next[MAXLINE] ; /* The next command line parameter. */ INC ; while (argc > 0) { if (argv[0][0] == '-') switch (argv[0][1]) { case 'P' : mtype = MONPRINTER ; /* Monitor printer queue. */ INC ; getparam(printer, argv, "-P needs printer name") ; break ; case 'a' : mtype = MONALL ; /* Monitor all of the spoolfile. */ break ; case 'b' : INC ; /* Alternate background pattern. */ getparam(bgicon, argv, "-b needs background icon") ; break ; case 'f' : INC ; /* New directory for face icons. */ getparam(facedir, argv, "-f needs face directory") ; SPRINTF(machfile, "%s/machine.tab", facedir) ; SPRINTF(peopfile, "%s/people.tab", facedir) ; break ; case 'i' : invert = 1 ; /* Reverse video. */ break ; case 'n' : dontshowno = 1 ; /* Don't show number of messages. */ break ; case 'p' : INC ; /* No. of seconds between checks. */ getparam(next, argv, "-p needs period time") ; period = atoi(next) ; /* No. of seconds between checks. */ break ; case 's' : INC ; /* Alternative spoolfile. */ getparam(spoolfile, argv, "-s needs spool directory") ; break ; case 't' : dontshowtime = 1 ; /* Do not show timestamps. */ break ; case 'u' : dontshowuser = 1 ; /* Do not show usernames. */ break ; case 'v' : FPRINTF(stderr, "%s version 1.3.%1d\n", progname, PATCHLEVEL) ; exit(1) ; /* SunView windowing arguments. -Wp, -WP and -Wi are used in the NeWS * implementation to initially position the window and icon. */ case 'W' : switch (argv[0][2]) { case 'H' : break ; /* -WH, no sub-args follow */ case 'i' : iconic = 1 ; break ; /* -Wi, start as an icon. */ case 'g' : /* -Wg, set default color. */ case 'n' : break ; /* -Wn, no label at all */ case 'h' : /* -Wh, height */ case 'I' : /* -WI "icon filename" */ case 'l' : /* -Wl "some window label" */ case 'L' : /* -Wl "some icon label" */ case 't' : /* Font filename */ case 'T' : /* Icon font filename */ case 'w' : INC ; /* Width, in columns. */ break ; case 'p' : INC ; /* -Wp xnum ynum */ getparam(next, argv, "-Wp needs x coordinate") ; wx = atoi(next) ; INC ; getparam(next, argv, "-Wp needs y coordinate") ; wy = atoi(next) ; break ; case 'P' : INC ; /* -WP xnum ynum */ getparam(next, argv, "-WP needs x coordinate") ; ix = atoi(next) ; INC ; getparam(next, argv, "-WP needs y coordinate") ; iy = atoi(next) ; break ; case 's' : INC ; INC ; /* -Ws xnum ynum */ break ; case 'b' : /* -Wb r g b (bg color spec) */ case 'f' : INC ; INC ; INC ; /* Same, fg color */ break ; default : FPRINTF(stderr,"%s: -W%c unknown argument\n", progname, argv[0][2]) ; break ; } break ; default : FPRINTF(stderr, "Usage: %s [-P printer] ", progname) ; FPRINTF(stderr, "[-Wi] [-Wp x y] [-WP x y] ") ; FPRINTF(stderr, "[-b background] [-f facedir] [-i] [-n] ") ; FPRINTF(stderr, "[-p period] [-s spoolfile] [-u] [-t] [-v]\n") ; exit(1) ; } INC ; } } char * getname() /* Get users name from passwd entry. */ { char *getlogin(), *username ; struct passwd *getpwuid(), *pwent ; if (!(username = getlogin())) { pwent = getpwuid(getuid()) ; username = pwent->pw_name ; endpwent() ; /* Close the passwd file */ } return username ; } getparam(s, argv, errmes) char *s, *argv[], *errmes ; { if (*argv != NULL && argv[0][0] != '-') STRCPY(s, *argv) ; else { FPRINTF(stderr,"%s: %s as next argument.\n", progname, errmes) ; exit(1) ; } } get_sun_icon(name, buf) /* Load Sun icon file. */ char *name ; unsigned short buf[256] ; { FILE *fin ; char *ptr ; int i, j, temp ; if ((fin = fopen(name, "r")) == NULL) return -1 ; FGETS(nextline, MAXLINE, fin) ; /* Load Sun icon file. */ FGETS(nextline, MAXLINE, fin) ; for (i = 0; i < 32; i++) { FGETS(nextline, MAXLINE, fin) ; ptr = nextline ; for (j = 0; j < 8; j++) { while (*ptr == ' ' || *ptr == '\t') ptr++ ; SSCANF(ptr,"0x%X",&temp) ; buf[i*8+j] = (short) temp ; ptr = index(ptr, ',') ; ptr++ ; } } FCLOSE(fin) ; return(0) ; } Funky_Stuff len=`wc -c < get.c` if [ $len != 10551 ] ; then echo error: get.c was $len bytes long, should have been 10551 fi fi # end of overwriting check if [ -f main.c ] then echo shar: will not over-write existing file main.c else echo shar: extracting 'main.c', 10551 characters cat > main.c <<'Funky_Stuff' #ifndef lint static char sccsid[] = "@(#)main.c 1.2 88/12/11" ; #endif /* Icon face server for monitoring mail and print jobs. * This program is based on the AT&T v8 mail face server, * vismon, but is not derived from vismon source. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" char *get_field(), *getname() ; int do_check() ; struct recinfo *rec_exists() ; struct comminfo *communities = NULL ; /* Community alias/username chain. */ struct comminfo *clast = NULL ; /* End of chain of community records. */ struct machinfo *machines = NULL ; /* Known machine/communities. */ struct machinfo *mlast = NULL ; /* End of chain of machine records. */ struct psinfo *psrecs = NULL ; /* List of news.ps animation files. */ struct psinfo *plast = NULL ; /* End of chain of NeWS animation files. */ struct recinfo *recs = NULL ; /* Mail messages being monitored. */ struct recinfo *last = NULL ; /* End of the chain of mail records. */ struct stat buf ; /* Buffer for file existence stat call. */ long lastsize ; /* Last known size of the mail folder. */ enum gr_type gtype ; /* Indicates what graphics system is being used. */ enum mon_type mtype ; /* Type of monitoring operation to do. */ char bgicon[MAXLINE] ; /* Alternate background pattern. */ char community[MAXLINE] ; /* Community name ("real" host name). */ char facedir[MAXLINE] ; /* Directory containing face images. */ char fname[MAXTYPES][MAXLINE] ; /* Array of various face name types. */ char iconname[MAXLINE] ; /* Name of the icon file for this person. */ char machfile[MAXLINE] ; /* Name of the machine/community file. */ char nextline[MAXLINE] ; /* Next line from users mail spool file. */ char peopfile[MAXLINE] ; /* Name of the people/username file. */ char printer[MAXLINE] ; /* Printer name to monitor. */ char progname[MAXLINE] ; /* Name of this program. */ char spoolfile[MAXLINE] ; /* Full pathname of users current mail. */ char *username ; /* This users name. */ int beeps ; /* Number of beeps for arrival of new mail. */ int column ; /* Column number for next icon. */ int dontshowno ; /* Indicates if number of messages should be displayed. */ int dontshowtime ; /* Indicates if timestamp for new mail should be shown. */ int dontshowuser ; /* Indicates if username for new mail should be shown. */ int facetype ; /* Type of face file found. */ int firsttime ; /* Zeroised after first mail/printer check. */ int flashes ; /* Number of flashes for arrival of new mail. */ int height ; /* Height in pixels of faces display. */ int iconic ; /* Start as an icon if set. */ int invert ; /* Set if to use reverse video. */ int ix ; /* Initial X position of the icon. */ int iy ; /* Initial Y position of the icon. */ int newmail ; /* Set if there is new mail this time around. */ int noicons ; /* Number of faces this time around. */ int period ; /* Period in seconds for new mail check. */ int row ; /* Row number for next icon. */ int width ; /* Width in pixels of faces display. */ int wx ; /* Initial X position of the window. */ int wy ; /* Initial Y position of the window. */ main(argc,argv) int argc ; char *argv[] ; { STRCPY(progname,argv[0]) ; /* Save this programs name. */ initialise() ; /* Set default values for various options. */ get_options(argc,argv) ; /* Read and process command line options. */ read_mailrc() ; /* Get number of flashes and beeps. */ read_machines() ; /* Setup up the machine/community chain. */ read_aliases() ; /* Setup the hostname alias subchains. */ if (init_ws_type()) /* Determine window system type. */ { FPRINTF(stderr,"Error initialising window system.\n") ; exit(1) ; } make_icon() ; /* Create default faces icon. */ make_frame(argc,argv) ; /* Create faces window/icon. */ do_check() ; /* Generate initial faces display. */ start_tool() ; /* Start up and display the faces icon. */ } a_to_u(community, user, realname) /* Turn possible alias into username. */ char *community, *user, *realname ; { struct comminfo *ctemp ; struct peopinfo *ptemp ; STRCPY(realname, user) ; /* In case alias not found. */ ctemp = communities ; /* Point to chain of communities. */ while (ctemp != NULL) if (EQUAL(ctemp->community, community)) { ptemp = ctemp->people ; while (ptemp != NULL) if (EQUAL(ptemp->alias, user)) { STRCPY(realname, ptemp->username) ; return ; } else ptemp = ptemp->next ; return ; } else ctemp = ctemp->next ; } initialise() { lastsize = 0 ; /* Initial size of spoolfile. */ firsttime = 1 ; /* No checks made yet. */ iconic = 0 ; /* Initially an open window. */ STRCPY(fname[BLITTYPE], "48x48x1") ; STRCPY(fname[SUNTYPE], "sun.icon") ; STRCPY(fname[NEWSTYPE], "face.ps") ; wx = wy = ix = iy = 0 ; #ifdef FBMONTYPE mtype = FBMONTYPE ; /* Type of monitoring to do. */ #else mtype = MONNEW ; /* Just monitor new mail by default. */ #endif FBMONTYPE #ifdef BACKGROUND STRCPY(bgicon, BACKGROUND) ; /* Alternate background pattern. */ #else STRCPY(bgicon, "") ; /* Default is to use root gray. */ #endif BACKGROUND #ifdef FACEDIR STRCPY(facedir,FACEDIR) ; /* Different directory for face icons. */ #else STRCPY(facedir,"/usr/local/faces") ; /* Directory for face icons. */ #endif FACEDIR SPRINTF(machfile, "%s/machine.tab", facedir) ; SPRINTF(peopfile, "%s/people.tab", facedir) ; #ifdef INVERT invert = INVERT ; /* Set indicates reverse video. */ #else invert = 0 ; /* Default is normal video. */ #endif INVERT #ifdef PERIOD period = PERIOD ; /* Period for new mail/print check. */ #else period = 60 ; /* Default time in seconds for new check. */ #endif PERIOD #ifdef DONTSHOWNO dontshowno = DONTSHOWNO ; /* If nonzero, do not show number of messages. */ #else dontshowno = 0 ; /* Show number of messages for this face. */ #endif DONTSHOWNO #ifdef SPOOLFILE STRCPY(spoolfile,SPOOLFILE) ; /* Alternative spoolfile to monitor. */ #else username = getname() ; /* Get users name from passwd entry. */ SPRINTF(spoolfile,"/usr/spool/mail/%s",username) ; #endif SPOOLFILE #ifdef DONTSHOWTIME dontshowtime = DONTSHOWTIME ; /* If nonzero, do not show timestamp. */ #else dontshowtime = 0 ; /* Show time stamp for new mail for this face. */ #endif DONTSHOWTIME #ifdef DONTSHOWUSER dontshowuser = DONTSHOWUSER ; /* If nonzero, do not show username. */ #else dontshowuser = 0 ; /* Show username on the face icons. */ #endif DONTSHOWUSER } h_to_c(host, community) /* Turn hostname into community name. */ char *host, *community ; { struct machinfo *temp ; /* Pointer to next machine record. */ temp = machines ; /* Point to list of machine/communitys. */ if (host[0] == '\0') GETHOSTNAME(community, MAXLINE) ; else STRCPY(community, host) ; /* Copied in case machine name not found. */ while (temp != NULL) { if (EQUAL(temp->machine, community)) { STRCPY(community, temp->community) ; return ; } temp = temp->next ; /* Point to next record. */ } } make_iconname(community, user) /* Construct the icon name. */ char *community, *user ; { /* Sets up community and user based on the first successful * open from the following list of files: * * $(FACEDIR)/community/user/[face.ps, sun.icon, 48x48x1] * $(FACEDIR)/misc./user/[face.ps, sun.icon, 48x48x1] * $(FACEDIR)/community/unknown/[face.ps, sun.icon, 48x48x1] * $(FACEDIR)/misc./unknown/[face.ps, sun.icon, 48x48x1] * * If none of these are found, the "blank face" is returned. */ int i ; for (i = 0; i < MAXTYPES; i++) { SPRINTF(iconname, "%s/%s/%s/%s", facedir, community, user, fname[i]) ; if (stat(iconname, &buf) != -1) return ; } for (i = 0; i < MAXTYPES; i++) { SPRINTF(iconname, "%s/misc./%s/%s", facedir, user, fname[i]) ; if (stat(iconname, &buf) != -1) { STRCPY(community, "misc.") ; return ; } } for (i = 0; i < MAXTYPES; i++) { SPRINTF(iconname, "%s/%s/unknown/%s", facedir, community, fname[i]) ; if (stat(iconname, &buf) != -1) { STRCPY(user, "unknown") ; return ; } } for (i = 0; i < MAXTYPES; i++) { SPRINTF(iconname, "%s/misc./unknown/%s", facedir, fname[i]) ; if (stat(iconname, &buf) != -1) { STRCPY(community, "misc.") ; STRCPY(user, "unknown") ; return ; } } /* The "blank face" should be used, so community and user are nulled. */ community[0] = user[0] = '\0' ; } read_mailrc() /* Get number of flashes and beeps. */ { char mrcname[MAXLINE] ; /* Full pathname of the .mailrc file. */ char *ptr ; FILE *fd ; beeps = 0 ; /* Defaults if .mailrc file not found. */ flashes = 0 ; if (getenv("HOME")) { SPRINTF(mrcname, "%s/.mailrc", getenv("HOME")) ; if ((fd = fopen(mrcname, "r")) == NULL) return ; while (fgets(nextline, MAXLINE, fd) != NULL) if (EQUAL(nextline, "set")) { ptr = index(nextline, ' ') ; if (EQUAL(ptr+1, "flash")) { ptr = index(nextline, '=') ; SSCANF(ptr+1, "%d", &flashes) ; } else if (EQUAL(ptr+1, "bell")) { ptr = index(nextline, '=') ; SSCANF(ptr+1, "%d", &beeps) ; } } } FCLOSE(fd) ; } Funky_Stuff len=`wc -c < main.c` if [ $len != 10551 ] ; then echo error: main.c was $len bytes long, should have been 10551 fi fi # end of overwriting check if [ -f mon.c ] then echo shar: will not over-write existing file mon.c else echo shar: extracting 'mon.c', 8937 characters cat > mon.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)mon.c 1.4 88/12/11" ; #endif /* Monitoring routines used by the faces program. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" adjust() /* Adjust the row and column position. */ { struct psinfo *this ; if (mtype != MONNEW) { if (++column == NO_PER_ROW) { column = 0 ; row++ ; } return ; } if (psrecs != NULL) /* Adjust animation positions for MONNEW */ { this = psrecs ; /* Point to beginning of chain. */ while (this != NULL) { this->column++ ; /* Adjust column position. */ if (facetype == NEWSTYPE && this->next == NULL) this->column-- ; /* Reset for brand new animate record. */ this = this->next ; } } } do_check() /* Perform another check of the appropriate type. */ { switch ((int) mtype) { case MONALL : do_mail(MONALL) ; /* Monitor all of the mail file. */ break ; case MONNEW : do_mail(MONNEW) ; /* Monitor new mail only. */ break ; case MONPRINTER : do_printer() ; /* Monitor the print queue. */ break ; } firsttime = 0 ; } do_mail(mtype) /* Monitor a mail file for new or all mail. */ enum mon_type mtype ; { char host[MAXLINE] ; /* Pointer to host name from the "From" line. */ char *ptr ; /* Pointer to extract field. */ char realname[MAXLINE] ; /* Real username for this user. */ char ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */ char user[MAXLINE] ; /* Pointer to user name from the "From" line. */ FILE *fp ; /* File descriptor for users mail spool file. */ struct recinfo *crec ; /* Pointer to current mail record for updating. */ column = row = 0 ; /* Start in top left corner of pixrect. */ newmail = 0 ; /* Assume no new mail. */ noicons = 0 ; if (mtype == MONNEW) make_pixrect(NO_PER_ROW) ; if (stat(spoolfile,&buf) == -1) { lastsize = 0 ; if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ return ; } if (buf.st_size > lastsize) newmail = 1 ; /* New mail found. */ if (mtype == MONNEW) if (buf.st_size <= lastsize) /* Is the size of mail folder bigger? */ { lastsize = buf.st_size ; /* No: save new size and exit. */ show_display() ; return ; } if ((fp = fopen(spoolfile,"r")) == NULL) /* Open spoolfile. */ { if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ return ; } if (mtype == MONNEW) FSEEK(fp, lastsize, 0) ; lastsize = buf.st_size ; while (fgets(nextline,MAXLINE,fp) != NULL) if (EQUAL(nextline,"From ")) { host[0] = user[0] = ts[0] = '\0' ; if ((ptr = get_field(HOSTNAME,nextline)) != NULL) STRCPY(host, ptr) ; if ((ptr = get_field(USERNAME,nextline)) != NULL) STRCPY(user, ptr) ; if ((ptr = get_field(TIMESTAMP,nextline)) != NULL) STRCPY(ts, ptr) ; h_to_c(host, community) ; /* Turn hostname into community name. */ a_to_u(community, user, realname) ; make_iconname(community, realname) ; if (mtype == MONNEW) { add_face(BOTH, ORDINARY, iconname) ; if (!dontshowtime) text(ICON, LEFT, ts) ; if (!dontshowuser) text(WINDOW, LEFT, realname) ; adjust() ; } else { if ((crec = rec_exists(community, realname)) != NULL) { STRCPY(crec->ts, ts) ; if (!crec->total) noicons++ ; crec->total++ ; } else add_record(community, realname, ts, 0) ; } } FCLOSE(fp) ; if (mtype == MONNEW) show_display() ; /* Show new mail. */ else make_display() ; /* Output icons and tidyup chain of records. */ } do_printer() /* Monitor printer queue. */ { struct recinfo *this, *next ; FILE *fp ; /* File descriptor for users mail spool file. */ char command[MAXLINE] ; /* Lpq system call for this printer. */ char owner[MAXLINE] ; /* Owner of job in the print queue. */ char tempname[MAXLINE] ; /* Temporary unique filename. */ int size ; /* Size of this print job in bytes. */ noicons = 0 ; SPRINTF(tempname,"/tmp/faces%04d",getpid()) ; SPRINTF(command,"lpq -P %s > %s",printer,tempname) ; if (system(command)) { FPRINTF(stderr,"%s: system call for printer %s stats failed.\n", progname,printer) ; return ; } if ((fp = fopen(tempname,"r")) == NULL) /* Open spoolfile. */ { FPRINTF(stderr,"%s: couldn't open printer stats in %s.\n", progname,tempname) ; return ; } column = row = 0 ; /* Start in top left corner of pixrect. */ FGETS(nextline,MAXLINE,fp) ; if (EQUAL(nextline,"no entries")) { make_pixrect(1) ; /* Just the "no print" icon. */ add_face(BOTH, NOPRINT, "") ; /* Set to "no print" icon. */ } else if (EQUAL(nextline,"Printer Error: may need attention!")) { make_pixrect(1) ; /* Just the "no paper" icon. */ add_face(BOTH, NOPAPER, "") ; /* Set to "no paper" icon. */ text(BOTH, LEFT, printer) ; /* Output printer name. */ } else { FGETS(nextline,MAXLINE,fp) ; /* Skip the next line. */ while (fgets(nextline,MAXLINE,fp) != NULL) { SSCANF(&nextline[7], "%s", owner) ; SSCANF(&nextline[60], "%d", &size) ; h_to_c("", community) ; make_iconname(community, owner) ; add_record("",owner,"",size) ; } make_pixrect(noicons) ; this = recs ; while (this != NULL) { next = this->next ; add_face(WINDOW, ORDINARY, this->iconname) ; SPRINTF(nextline, "%1d", this->size) ; if (!dontshowuser) text(WINDOW, LEFT, this->username) ; /* Owner. */ text(WINDOW, RIGHT, nextline) ; /* Size. */ if (this == recs) { add_face(ICON, ORDINARY, this->iconname) ; SPRINTF(nextline, "%1d %s", noicons, (noicons == 1 ? "job" : "jobs")) ; text(ICON, RIGHT, nextline) ; /* Number of jobs. */ } adjust() ; /* Adjust column and row. */ remove_record(this) ; this = next ; } recs = last = NULL ; } FCLOSE(fp) ; UNLINK(tempname) ; show_display() ; } make_pixrect(count) /* Make window pixrect the correct size. */ int count ; { int c, r ; /* Size in columns and rows of window display. */ r = ((count-1) / NO_PER_ROW) + 1 ; /* Number of rows of faces. */ c = NO_PER_ROW ; /* Full width display. */ if (count <= 10) { r = 1 ; /* One row. */ c = count ; /* Of 'count' columns. */ } height = r * ICONHEIGHT ; /* Height of the icon display. */ width = c * ICONWIDTH ; /* Width of the icon display. */ create_pixrects(width, height) ; } make_display() /* Output icons and tidyup chain of records. */ { int count ; /* Name of faces in icon display. */ struct recinfo *this, *next ; count = noicons ; /* Number of faces to display. */ if (!count) count = 1 ; /* Always one "no mail" icon. */ make_pixrect(count) ; if (!noicons) add_face(BOTH, NOMAIL, "") ; else { this = recs ; while (this != NULL) { next = this->next ; add_face(BOTH, ORDINARY, this->iconname) ; if (!dontshowno) { SPRINTF(nextline, "%1d", this->total) ; text(ICON, RIGHT, nextline) ; } if (!dontshowtime) text(ICON, LEFT, this->ts) ; if (!dontshowuser) text(WINDOW, LEFT, this->username) ; adjust() ; remove_record(this) ; this = next ; } recs = last = NULL ; } show_display() ; /* Display the latest set of faces. */ } Funky_Stuff len=`wc -c < mon.c` if [ $len != 8937 ] ; then echo error: mon.c was $len bytes long, should have been 8937 fi fi # end of overwriting check if [ -f news.c ] then echo shar: will not over-write existing file news.c else echo shar: extracting 'news.c', 10648 characters cat > news.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)news.c 1.3 88/12/11" ; #endif /* NeWS dependent graphics routines used by faces, * the visual mail and print job monitor. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include #include #ifdef SUNOS3.x int fullmask ; /* Full mask of file descriptors to check on. */ int readmask ; /* Readmask used in select call. */ #else fd_set fullmask ; /* Full mask of file descriptors to check on. */ fd_set readmask ; /* Readmask used in select call. */ #endif SUNOS3.x int kbdfd ; /* File descriptor for the keyboard. */ int psfd ; /* NeWS connection file descriptor. */ unsigned short ibuf[256] ; /* Ikon/icon image buffer. */ extern FILE *PostScript ; extern FILE *PostScriptInput ; add_face(display, itype, name) /* Add this icon to the display. */ enum disp_type display ; enum icon_type itype ; char *name ; { char face[MAXLINE] ; /* Canvas containing face (Source). */ switch ((int) itype) { case NOMAIL : STRCPY(face, "NomailIcon") ; break ; case NOPAPER : STRCPY(face, "NopaperIcon") ; break ; case NOPRINT : STRCPY(face, "NoprintIcon") ; break ; case ORDINARY : if ((facetype = get_icon(name, ibuf)) != -1) switch (facetype) { case BLITTYPE : case SUNTYPE : load_icon("Curface") ; STRCPY(face, "CurfaceIcon") ; case NEWSTYPE : break ; } else STRCPY(face, "NofaceIcon") ; break ; } if (display == ICON) if (mtype == MONPRINTER) adjust_image("MPR", face, 0, 0) ; else adjust_image("MPR", face, row, column) ; else if (display == WINDOW) adjust_image("PR", face, row, column) ; else { adjust_image("MPR", face, row, column) ; adjust_image("PR", face, row, column) ; } FFLUSH(PostScript) ; } adjust_image(dest, face, row, column) char *dest, *face ; int row, column ; { switch ((int) mtype) { case MONNEW : FPRINTF(PostScript, "%d 0 %d %d %s ShiftImage\n", ICONWIDTH, (NO_PER_ROW-1)*ICONWIDTH, ICONHEIGHT, dest) ; if (facetype == NEWSTYPE) { FPRINTF(PostScript, "%d %d %d %d %s ClearBox\n", column*ICONWIDTH, row*ICONHEIGHT, ICONWIDTH, ICONHEIGHT, dest) ; return ; } case MONALL : case MONPRINTER : FPRINTF(PostScript,"%s %d %d %d %d %s MoveImage\n", face, ICONWIDTH, ICONHEIGHT, column*ICONWIDTH, row*ICONHEIGHT, dest) ; } } beep_flash(beeps, flashes) /* Perform visual feedback. */ int beeps, flashes ; { int i, x ; if (beeps) for (i = 0; i < beeps; i++) { x = KBD_CMD_BELL ; IOCTL(kbdfd, KIOCCMD, &x) ; usleep(250000) ; x = KBD_CMD_NOBELL ; IOCTL(kbdfd, KIOCCMD, &x) ; usleep(250000) ; } } create_pixrects(width, height) /* Create pixrects for the face images. */ { int h, i, j, w ; if (mtype == MONNEW && !firsttime) return ; FPRINTF(PostScript,"%d %d PR DoPixrects\n", width, height) ; h = height ; w = width ; if (mtype == MONPRINTER) { h = ICONHEIGHT ; w = ICONWIDTH ; } FPRINTF(PostScript,"%d %d MPR DoPixrects\n", w, h) ; if (strlen(bgicon)) { for (i = 0; i < (height / 64); i++) for (j = 0; j < (width / 64); j++) { FPRINTF(PostScript,"BackgroundIcon %d %d %d %d PR MoveImage\n", ICONWIDTH, ICONHEIGHT, j, i) ; FPRINTF(PostScript,"BackgroundIcon %d %d %d %d MPR MoveImage\n", ICONWIDTH, ICONHEIGHT, j, i) ; } } else FPRINTF(PostScript,"SetBackground\n") ; } do_news_ps(psrecs) /* Display chain of NeWS animations. */ struct psinfo *psrecs ; { struct psinfo *next, *this ; this = psrecs ; /* Point to beginning of NeWS records. */ while (this != NULL) { next = this->next ; if ((mtype != MONNEW) || (this->column < NO_PER_ROW)) { FPRINTF(PostScript, "(%s) %d %d %d %d ExecFile\n", this->name, ICONWIDTH, ICONHEIGHT, this->column*ICONWIDTH, this->row*ICONHEIGHT) ; FFLUSH(PostScript) ; } this = next ; } } init_ws_type() { if (ps_open_PostScript() < 0) return -1 ; if (send_ps_file(NEWSFILE) == -1) { FPRINTF(stderr,"%s: cannot open %s\n", progname, NEWSFILE) ; FCLOSE(PostScript) ; return(-1) ; } FFLUSH(PostScript) ; if (ferror(PostScript)) { FCLOSE(PostScript) ; return(-1) ; } if (invert) FPRINTF(PostScript, "/Invert false def\n") ; else FPRINTF(PostScript, "/Invert true def\n") ; gtype = NEWS ; return(0) ; } load_icon(name) char *name ; { int i, j ; FPRINTF(PostScript,"/%sIcon 64 64 1 { } { <\n", name) ; for (i = 0; i < 32; i++) { for (j = 0; j < 8; j++) FPRINTF(PostScript,"%.4X ", ibuf[i*8+j]) ; FPRINTF(PostScript,"\n") ; } FPRINTF(PostScript,"> } buildimage def\n") ; } /*ARGSUSED*/ make_frame(argc,argv) int argc ; char *argv[] ; { if ((kbdfd = open("/dev/kbd", 0)) == -1) { FPRINTF(stderr,"%s: can't open keyboard.\n", progname) ; exit(1) ; } psfd = fileno(PostScriptInput) ; #ifdef SUNOS3.x fullmask = 1 << psfd ; #else FD_ZERO(&fullmask) ; FD_SET(psfd, &fullmask) ; #endif SUNOS3.x if (strlen(bgicon)) if (get_sun_icon(bgicon, ibuf) == 0) load_icon("Background") ; FPRINTF(PostScript,"%d %d %d %d %d %d %d MakeFrame\n", wx, wy, NO_PER_ROW*ICONWIDTH+10, ICONHEIGHT*10+10, ix, iy, iconic) ; FPRINTF(PostScript,"InitFont\n") ; width = NO_PER_ROW * ICONWIDTH ; height = ICONHEIGHT ; } make_icon() { if (get_sun_icon("noface.icon", ibuf) == 0) load_icon("Noface") ; if (get_sun_icon("nomail.icon", ibuf) == 0) load_icon("Nomail") ; if (get_sun_icon("nopaper.icon", ibuf) == 0) load_icon("Nopaper") ; if (get_sun_icon("noprint.icon", ibuf) == 0) load_icon("Noprint") ; } send_ps_file(fname) char *fname ; { FILE *stream ; int c ; if ((stream = fopen(fname,"r")) == NULL) return -1 ; while ((c = getc(stream)) != EOF) PUTC(c,PostScript) ; FCLOSE(stream) ; return 0 ; } show_display() /* Show the latest set of mail icon faces. */ { if (mtype != MONPRINTER) FPRINTF(PostScript,"%d %d %d %d ShowDisplay\n", width, height, width, height) ; else FPRINTF(PostScript,"%d %d %d %d ShowDisplay\n", width, height, ICONWIDTH, ICONHEIGHT) ; if (newmail) beep_flash(beeps, flashes) ; if (psrecs != NULL) do_news_ps(psrecs) ; FFLUSH(PostScript) ; } start_tool() { int type ; /* Value from NeWS server. */ struct psinfo *next, *this ; /* For removing current chain of records. */ struct timeval tval ; tval.tv_usec = 0 ; tval.tv_sec = period ; for (;;) { readmask = fullmask ; #ifdef SUNOS3.x SELECT(32, &readmask, 0, 0, &tval) ; if (readmask && (1 << psfd)) #else SELECT(FD_SETSIZE, &readmask, (fd_set *) 0, (fd_set *) 0, &tval) ; if (FD_ISSET(psfd, &readmask)) #endif SUNOS3.x { if (pscanf(PostScriptInput, "%d", &type) == EOF) exit(1) ; switch (type) { case DIED : exit(0) ; case PAINTED : if (psrecs != NULL) do_news_ps(psrecs) ; } } else { this = psrecs ; /* Point to beginning of NeWS records. */ if (mtype != MONNEW) { while (this != NULL) { next = this->next ; if (this->name != NULL) free(this->name) ; free((char *) this) ; /* Remove this record. */ this = next ; } psrecs = plast = NULL ; } do_check() ; /* Check the mail/printer again. */ } } } text(display,just,str) enum disp_type display ; enum just_type just ; char *str ; { int i, len ; int c, r ; /* Column and row position for this face. */ int x, y ; /* Position of start of this text string. */ char line[MAXLINE] ; /* PostScript text string to be builtup. */ char tpr ; /* Indicator for destination offscreen canvas. */ c = column ; r = row ; switch ((int) display) { case BOTH : text(ICON, just, str) ; text(WINDOW, just, str) ; return ; case ICON : tpr = 'M' ; /* MPR canvas. */ if (mtype != MONALL) c = r = 0 ; break ; case WINDOW : tpr = ' ' ; /* PR canvas. */ } len = strlen(str) ; /* Character length of text. */ if (len > 10) { len = 10 ; str[10] = '\0' ; /* Maximum of 10 characters. */ } line[0] = '\0' ; for (i = 0; i < len; i++) switch (str[i]) { case '\\' : STRCAT(line,"\\\\") ; break ; case '(' : STRCAT(line,"\\(") ; break ; case ')' : STRCAT(line,"\\)") ; break ; default : STRNCAT(line,&str[i],1) ; } switch ((int) just) { case LEFT : x = c*ICONWIDTH+2 ; y = r*ICONHEIGHT+2 ; break ; case RIGHT : x = (c+1)*ICONWIDTH-(len*6)-2 ; y = r*ICONHEIGHT+2 ; } FPRINTF(PostScript,"%d %d %d %d %cPR ClearBox\n", x, y, len*6+2, 10, tpr) ; FPRINTF(PostScript,"(%s) %d %d %cPR MakeText\n", line, x, y, tpr) ; } Funky_Stuff len=`wc -c < news.c` if [ $len != 10648 ] ; then echo error: news.c was $len bytes long, should have been 10648 fi fi # end of overwriting check if [ -f rec.c ] then echo shar: will not over-write existing file rec.c else echo shar: extracting 'rec.c', 6808 characters cat > rec.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)rec.c 1.2 88/12/09" ; #endif /* Record handling routines used by the faces program. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors on inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" char * Malloc(n) int n ; { char *val ; if ((val = malloc((unsigned) n)) == NULL) FPRINTF(stderr,"%s: Out of memory.\n",progname) ; return val ; } add_alias(crec, username, alias) /* Add new alias to hostnames' list. */ struct comminfo *crec ; char *username, *alias ; { struct peopinfo *cptemp, *ptemp ; ptemp = (struct peopinfo *) Malloc(sizeof(struct peopinfo)) ; ptemp->alias = (char *) Malloc(strlen(alias)) ; STRCPY(ptemp->alias, alias) ; ptemp->username = (char *) Malloc(strlen(username)) ; STRCPY(ptemp->username, username) ; ptemp->next = NULL ; if (crec->people == NULL) crec->people = ptemp ; else { cptemp = crec->people ; while (cptemp != NULL) if (cptemp->next == NULL) { cptemp->next = ptemp ; return ; } else cptemp = cptemp->next ; } } add_machine(machine, community) /* Add new machine to list. */ char *machine, *community ; { struct machinfo *temp ; temp = (struct machinfo *) Malloc(sizeof(struct machinfo)) ; temp->machine = (char *) Malloc(strlen(machine)) ; STRCPY(temp->machine, machine) ; temp->community = (char *) Malloc(strlen(community)) ; STRCPY(temp->community, community) ; temp->next = NULL ; if (machines == NULL) machines = mlast = temp ; /* Start chain. */ else if (mlast != NULL) { mlast->next = temp ; /* Add record to existing chain. */ mlast = temp ; /* Point to end of chain. */ } } add_ps_rec(row, column, name) /* Add record for later animation. */ int row, column ; char *name ; { struct psinfo *temp ; temp = (struct psinfo *) Malloc(sizeof(struct psinfo)) ; temp->name = (char *) Malloc(strlen(name)) ; STRCPY(temp->name, name) ; temp->row = row ; temp->column = column ; temp->next = NULL ; if (psrecs == NULL) psrecs = plast = temp ; /* Start chain. */ else if (plast != NULL) { plast->next = temp ; /* Add record to existing chain. */ plast = temp ; } } add_record(community, username, timestamp, size) char *community, *username, *timestamp ; int size ; { struct recinfo *temp ; temp = (struct recinfo *) Malloc(sizeof(struct recinfo)) ; temp->community = (char *) Malloc(strlen(community)) ; STRCPY(temp->community, community) ; temp->username = (char *) Malloc(strlen(username)) ; STRCPY(temp->username, username) ; temp->iconname = (char *) Malloc(strlen(iconname)) ; STRCPY(temp->iconname, iconname) ; STRCPY(temp->ts, timestamp) ; temp->size = size ; temp->total = 1 ; temp->next = NULL ; noicons++ ; if (recs == NULL) recs = last = temp ; /* Start chain. */ else { last->next = temp ; /* Add record to existing chain. */ last = temp ; /* Point to the end of the chain. */ } } check_comm(hostname, username, alias) /* Check community list. */ char *hostname, *username, *alias ; { struct comminfo *ctemp ; ctemp = communities ; /* Try and find machine record for hostname. */ while (ctemp != NULL) if (EQUAL(ctemp->community, hostname)) { add_alias(ctemp, username, alias) ; return ; } else ctemp = ctemp->next ; ctemp = (struct comminfo *) Malloc(sizeof(struct comminfo)) ; ctemp->community = (char *) Malloc(strlen(hostname)) ; STRCPY(ctemp->community, hostname) ; ctemp->people = NULL ; ctemp->next = NULL ; if (communities == NULL) communities = clast = ctemp ; /* Start chain. */ else { clast->next = ctemp ; /* Add record to existing chain. */ clast = ctemp ; /* Point to end of chain. */ } add_alias(ctemp, username, alias) ; } read_aliases() /* Setup the hostname aliases subchains. */ { char alias[MAXLINE] ; /* Alias for this community/username. */ char hostname[MAXLINE] ; /* This records' hostname. */ char username[MAXLINE] ; /* This records real username. */ char *ptr1, *ptr2 ; FILE *fd ; if ((fd = fopen(peopfile, "r")) == NULL) /* Open people file. */ { FPRINTF(stderr,"%s: cannot open %s\n", progname, peopfile) ; return ; } while (fgets(nextline, MAXLINE, fd) != NULL) { ptr1 = index(nextline, '/') ; STRNCPY(hostname, nextline, (int) (ptr1-nextline)) ; hostname[(int) (ptr1-nextline)] = '\0' ; ptr2 = index(nextline, '=') ; STRNCPY(alias, ptr1+1, (int) (ptr2-ptr1-1)) ; alias[(int) (ptr2-ptr1-1)] = '\0' ; STRNCPY(username, ptr2+1, strlen(ptr2)-2) ; username[strlen(ptr2)-2] = '\0' ; check_comm(hostname, username, alias) ; } FCLOSE(fd) ; } read_machines() /* Setup the chain of machine/community records. */ { char community[MAXLINE] ; /* This records' community. */ char machine[MAXLINE] ; /* This records' machine name. */ char *ptr ; FILE *fd ; if ((fd = fopen(machfile, "r")) == NULL) /* Open machine file. */ { FPRINTF(stderr,"%s: cannot open %s\n", progname, machfile) ; return ; } while (fgets(nextline, MAXLINE, fd) != NULL) { ptr = index(nextline, '=') ; STRNCPY(machine, nextline, (int) (ptr-nextline)) ; machine[(int) (ptr-nextline)] = '\0' ; STRNCPY(community, ptr+1, strlen(ptr)-2) ; community[strlen(ptr)-2] = '\0' ; add_machine(machine, community) ; } FCLOSE(fd) ; } struct recinfo * rec_exists(community,username) /* Check if record exists for mail item. */ char *community, *username ; { struct recinfo *temp ; /* Pointer to mail records used for chaining. */ temp = recs ; while (temp != NULL) { if (EQUAL(temp->username, username) && EQUAL(temp->community, community)) return(temp) ; /* Record found. */ temp = temp->next ; /* Point to next record. */ } return(NULL) ; } remove_record(thisrec) /* Remove this record from the chain. */ struct recinfo *thisrec ; { if (thisrec->community != NULL) free(thisrec->community) ; if (thisrec->username != NULL) free(thisrec->username) ; if (thisrec->iconname != NULL) free(thisrec->iconname) ; free((char *) thisrec) ; } Funky_Stuff len=`wc -c < rec.c` if [ $len != 6808 ] ; then echo error: rec.c was $len bytes long, should have been 6808 fi fi # end of overwriting check if [ -f sunview.c ] then echo shar: will not over-write existing file sunview.c else echo shar: extracting 'sunview.c', 9881 characters cat > sunview.c <<'Funky_Stuff' /*LINTLIBRARY*/ #ifndef lint static char sccsid[] = "@(#)sunview.c 1.1 88/12/04" ; #endif /* SunView dependent graphics routines used by faces, * the visual mail and print job monitor. * * Copyright (c) Rich Burridge - Sun Microsystems Australia. * All rights reserved. * * Permission is given to distribute these sources, as long as the * copyright messages are not removed, and no monies are exchanged. * * No responsibility is taken for any errors or inaccuracies inherent * either to the comments or the code of this program, but if reported * to me, then an attempt will be made to fix them. */ #include "faces.h" #include "extern.h" #include #include #include #define ICON_SET (void) icon_set #define NOTIFY_SET_ITIMER_FUNC (void) notify_set_itimer_func #define PR_DESTROY (void) pr_destroy #define PR_REPLROP (void) pr_replrop #define PR_ROP (void) pr_rop #ifdef SUNOS3.x #define PR_TTEXT (void) pf_ttext #else #define PR_TTEXT (void) pr_ttext #endif SUNOS3.x #define PW_ROP (void) pw_rop #define WIN_BELL (void) win_bell #define WINDOW_SET (void) window_set #define SMALLFONT "/usr/lib/fonts/fixedwidthfonts/screen.r.7" #define ITIMER_NULL ((struct itimerval *) 0) int repaint_proc() ; Canvas canvas ; Frame frame ; Icon faces_icon ; Pixfont *sfont ; /* Small font for timestamp and count. */ Pixrect *mpr, *pr ; /* Pointers to current pixrects. */ Pixrect *old_mpr, *old_pr ; /* Pointers to previous pixrects. */ Pixrect *background ; /* Pointer to background pattern or gray. */ Pixwin *fpw, *pw ; Rect *temprect ; int ffd ; /* File descriptor of faces frame. */ short gray_image[] = { 0x8000, 0x8000, 0x2000, 0x2000 } ; mpr_static(gray_pr, 4, 4, 1, gray_image) ; short noface_image[] = { #include "noface.icon" } ; mpr_static(noface_pr, 64, 64, 1, noface_image) ; short nomail_image[] = { #include "nomail.icon" } ; mpr_static(nomail_pr, 64, 64, 1, nomail_image) ; short nopaper_image[] = { #include "nopaper.icon" } ; mpr_static(nopaper_pr, 64, 64, 1, nopaper_image) ; short noprint_image[] = { #include "noprint.icon" } ; mpr_static(noprint_pr, 64, 64, 1, noprint_image) ; add_face(display, itype, name) enum disp_type display ; enum icon_type itype ; char *name ; { Pixrect *face_pr ; unsigned short buf[256] ; /* Ikon/icon image. */ unsigned short *ptr ; int freeit ; /* Set if we should destroy this pixrect. */ int i ; freeit = 0 ; switch ((int) itype) { case NOMAIL : face_pr = &nomail_pr ; break ; case NOPAPER : face_pr = &nopaper_pr ; break ; case NOPRINT : face_pr = &noprint_pr ; break ; case ORDINARY : if (get_icon(name, buf) == -1) face_pr = &noface_pr ; else { face_pr = mem_create(64, 64, 1) ; ptr = (unsigned short *) ((struct mpr_data *) face_pr->pr_data)->md_image ; for (i = 0; i < 256; i++) ptr[i] = buf[i] ; freeit = 1 ; } break ; } if (display == ICON) if (mtype == MONPRINTER) adjust_image(mpr, face_pr, 0, 0) ; else adjust_image(mpr, face_pr, row, column) ; else if (display == WINDOW) adjust_image(pr, face_pr, row, column) ; else { adjust_image(mpr, face_pr, row, column) ; adjust_image(pr, face_pr, row, column) ; } if (freeit) PR_DESTROY(face_pr) ; } adjust_image(fpr, face_pr, row, column) /* Place new face in memory pixrect. */ Pixrect *fpr, *face_pr ; int row, column ; { switch ((int) mtype) { case MONNEW : PR_ROP(fpr, 64, 0, 640-64, 64, PIX_SRC, fpr, 0, 0) ; case MONALL : case MONPRINTER : PR_ROP(fpr, column*ICONWIDTH, row*ICONHEIGHT, ICONWIDTH, ICONHEIGHT, PIX_SRC, face_pr, 0, 0) ; } } Notify_value check_mail() { do_check() ; } beep_flash(beeps, flashes) /* Perform visual feedback. */ int beeps, flashes ; { static struct timeval btime = { 0, 250000 } ; /* Beep timer. */ int bfd ; /* File descriptor for faces window, or -1. */ Pixwin *bpw ; /* Pixwin pointer for faces window, or 0. */ if (beeps || flashes) do { bfd = beeps > 0 ? ffd : -1 ; bpw = flashes > 0 ? fpw : (Pixwin *) 0 ; WIN_BELL(bfd, btime, bpw) ; SELECT(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &btime) ; beeps-- ; flashes-- ; } while (beeps > 0) ; } create_pixrects(width, height) /* Create pixrects for the face images. */ int width, height ; { old_pr = pr ; pr = mem_create(width, height, 1) ; PR_REPLROP(pr, 0, 0, width, height, PIX_SRC, background, 0, 0) ; faces_icon = (Icon) window_get(frame, FRAME_ICON) ; old_mpr = (Pixrect *) icon_get(faces_icon, ICON_IMAGE) ; if (mtype == MONPRINTER) mpr = mem_create(ICONWIDTH, ICONHEIGHT, 1) ; else { mpr = mem_create(width, height, 1) ; PR_REPLROP(mpr, 0, 0, width, height, PIX_SRC, background, 0, 0) ; } if (mtype == MONNEW && old_pr != NULL) PR_ROP(pr, 0, 0, width, height, PIX_SRC, old_pr, 0, 0) ; if (mtype == MONNEW && old_mpr != NULL) PR_ROP(mpr, 0, 0, width, height, PIX_SRC, old_mpr, 0, 0) ; } init_ws_type() { gtype = SUNVIEW ; return 0 ; } make_frame(argc,argv) int argc ; char *argv[] ; { unsigned short buf[256] ; /* For background pattern. */ unsigned short *ptr ; int i ; if (strlen(bgicon)) { if (get_sun_icon(bgicon, buf) == 0) background = &gray_pr ; background = mem_create(64, 64, 1) ; ptr = (unsigned short *) ((struct mpr_data *) background->pr_data)->md_image ; for (i = 0; i < 256; i++) ptr[i] = buf[i] ; } else background = &gray_pr ; frame = window_create((Window) 0, FRAME, FRAME_ICON, faces_icon, FRAME_SHOW_LABEL, FALSE, FRAME_SUBWINDOWS_ADJUSTABLE, FALSE, FRAME_NO_CONFIRM, TRUE, WIN_WIDTH, NO_PER_ROW * ICONWIDTH + 10, WIN_HEIGHT, ICONHEIGHT * 10 + 10, FRAME_ARGS, argc,argv, 0) ; fpw = (Pixwin *) window_get(frame, WIN_PIXWIN) ; ffd = (int) window_get(frame, WIN_FD) ; canvas = window_create(frame, CANVAS, CANVAS_REPAINT_PROC, repaint_proc, CANVAS_RETAINED, TRUE, 0) ; pw = canvas_pixwin(canvas) ; sfont = pf_open(SMALLFONT) ; width = NO_PER_ROW * ICONWIDTH ; height = ICONHEIGHT ; } make_icon() { if (mtype == MONPRINTER) faces_icon = icon_create(ICON_IMAGE, &noprint_pr, 0) ; else faces_icon = icon_create(ICON_IMAGE, &nomail_pr, 0) ; } /*ARGSUSED*/ repaint_proc(canvas, pw, repaint_area) Canvas canvas ; Pixwin *pw ; Rectlist *repaint_area ; { PW_ROP(pw, 0, 0, width, height, PIX_SRC, pr, 0, 0) ; } show_display() /* Show the latest set of mail icon faces. */ { if (invert) /* Invert the memory pixrects before displaying. */ { PR_ROP(pr, 0, 0, width, height, PIX_NOT(PIX_DST), pr, 0, 0) ; PR_ROP(mpr, 0, 0, width, height, PIX_NOT(PIX_DST), pr, 0, 0) ; } if (mtype != MONPRINTER) { temprect = (Rect *) icon_get(faces_icon, ICON_IMAGE_RECT) ; temprect->r_height = height ; temprect->r_width = width ; ICON_SET(faces_icon, ICON_HEIGHT, height, ICON_WIDTH, width, ICON_IMAGE_RECT, temprect, ICON_IMAGE, mpr, 0) ; } else ICON_SET(faces_icon, ICON_IMAGE, mpr, 0) ; WINDOW_SET(frame, FRAME_ICON, faces_icon, 0) ; temprect = (Rect *) window_get(frame, FRAME_OPEN_RECT) ; temprect->r_height = height+10 ; temprect->r_width = width+10 ; WINDOW_SET(frame, FRAME_OPEN_RECT, temprect, 0) ; PW_ROP(pw, 0, 0, width, height, PIX_SRC, pr, 0, 0) ; if (newmail) beep_flash(beeps, flashes) ; if (old_pr) PR_DESTROY(old_pr) ; if (old_mpr) PR_DESTROY(old_mpr) ; } start_tool() { struct itimerval tval ; tval.it_interval.tv_usec = 0 ; tval.it_interval.tv_sec = period ; tval.it_value.tv_usec = 0 ; tval.it_value.tv_sec = period ; NOTIFY_SET_ITIMER_FUNC(frame, check_mail, ITIMER_REAL, &tval, ITIMER_NULL) ; window_main_loop(frame) ; } text(display, just, str) enum disp_type display ; enum just_type just ; char *str ; { int len ; int c, r ; /* Column and row position for this face. */ int x, y ; /* Position of start of this text string. */ Pixrect *tpr ; c = column ; r = row ; switch ((int) display) { case BOTH : text(ICON, just, str) ; text(WINDOW, just, str) ; return ; case ICON : tpr = mpr ; if (mtype != MONALL) c = r = 0 ; break ; case WINDOW : tpr = pr ; } len = strlen(str) ; /* Character length of text. */ if (len > 10) { len = 10 ; str[10] = '\0' ; /* Maximum of 10 characters. */ } switch ((int) just) { case LEFT : x = c*ICONWIDTH+2 ; y = (r+1)*ICONHEIGHT-2 ; break ; case RIGHT : x = (c+1)*ICONWIDTH-(len*6)-2 ; y = (r+1)*ICONHEIGHT-2 ; } PR_ROP(tpr, x, y-9, len*6+2, 10, PIX_CLR, (Pixrect *) NULL, 0, 0) ; PR_TTEXT(tpr, x, y, PIX_SRC ^ PIX_NOT(PIX_DST), sfont, str) ; } Funky_Stuff len=`wc -c < sunview.c` if [ $len != 9881 ] ; then echo error: sunview.c was $len bytes long, should have been 9881 fi fi # end of overwriting check From don@brillig.umd.edu Tue Dec 13 23:52:51 1988 Date: Tue, 13 Dec 88 23:52:51 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Rumors? From: "Joe Habermann" Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >Does the availability of NeWS source code... I didn't know NeWS source was available. From Sun, heh? How much do they charge? I suppose I _could_ just go ask my sales rep. +Joe Habermann haberman@umn-cs.cs.umn.edu ..!rutgers!umn-cs!haberman From don@brillig.umd.edu Wed Dec 14 14:58:33 1988 Date: Wed, 14 Dec 88 14:58:33 EST To: NeWS-makers@brillig.umd.edu Subject: good/bad news from the recent Sun User Group conference From: Eric Marshall Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Depending on who you are and what you believe in, here is some good/bad news from the recent Sun User Group conference held in Miami Beach concerning Sun's merged NeWS and X11 server and their NDE Open Look toolkit. The first custom shipping date of the merged server is July 1989. The NDE toolkit is to be released in the winter of 1989. Both the merged server and NDE-based applications were demonstrated at the conference. The speed of the server is currently about half that of the NeWS 1.1 server, and its static size is about twice that of the NeWS 1.1 server. Sun showed speed and size measurements of the merged server over its development, and the server is getting both faster and smaller. At least for the initial release of the server, Sun is recommending that the server is run on machines with at least 8 MB of main memory, though it can run on 4 MB systems, although more slowly. Within the past month, Sun has hired a NeWS marketing manager whose job it is to go out and spread the NeWS gospel. His name is Steve Messino, smessino@sun.com, and his phone number is (415) 336-2017. Hopefully Steve and the rest of us NeWS zealots can all work together to make this NeWS thing work! Just thought you'd like to know. 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 ---------------------------------------------------------------------- Today's quote: Donal O'Shea (an OSF VP) on System V.4: "It's not of sufficient quality. People can't put commercial applications on it." From don@brillig.umd.edu Wed Dec 14 15:02:53 1988 Date: Wed, 14 Dec 88 15:02:53 EST To: NeWS-makers@brillig.umd.edu Subject: Invoking NeWS from Sunview From: bware@Sun.COM (Bryan Ware) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am running NeWS 1.1 from Sunview using the overview command. When I click the NeWS icon, NeWS starts up normally. The question is : How do I get back to Sunview without killing the NeWS process ? How do I set up an equivalent to .sunview under NeWS ? Where can I get the manual for NeWS ? Is it obvious that I am new to NeWS and this alias ? Bryan From don@brillig.umd.edu Fri Dec 16 03:15:25 1988 Date: Fri, 16 Dec 88 03:15:25 EST To: NeWS-makers@brillig.umd.edu Subject: Simulating Users on Sun 3/60 running X Windows From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Date: 6 Dec 88 17:17:18 GMT From: ppgbms!paul@philabs.philips.com (Paul Matz) sun!athsys!jim@decwrl.dec.com (Jim Becker) writes: > I have the task of determining how to capture a user session on the Sun > (mouse & keyboard events) and then replay it automatically. The purpose > of this is to create test scripts that can be used for Q/A. NeWS has a feature that captures all mouse and keyboard input. It sounds like just what you are looking for. Version 1.1, and it is called journalling. The user interface controller works just like a tape recorder. Try it, you'll like it! Paul Matz PPG Biomedical Systems Pleasantville, NY. 914-741-4685 ppgbms!paul When X11/NeWS finally hits the streets, you will be able to use the NeWS journaling facility to play back events to X clients as well as to NeWS clients. (According to people working the merge.) That's because there is one unified event queue through which all X and NeWS events go. -Don From don@brillig.umd.edu Sat Dec 17 00:53:29 1988 Date: Sat, 17 Dec 88 00:53:29 EST To: NeWS-makers@brillig.umd.edu Subject: How to convert a NeWS image (.im1) to X bitmap format? From: "Michael_Powers.Henr801M"@Xerox.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I am looking for a way to snap a region from the NeWS screen and then convert the image to an X bitmap file. These would probably be done in separate steps. Perhaps there is already a utility for snapping part of the screen and dumping it as an .im8 or .im1 file. And if I'm lucky someone else has created a way to convert these file formats to the X bitmap format. I am on a monochrome X server if that helps at all. Mike powers.henr801m@xerox.com P.S. Why, you ask? Because the bitmap drawing tools in X stink and I would like to take some nice images I have created in NeWS (and the globe images) and use them in an X application. From don@brillig.umd.edu Sun Dec 18 22:35:58 1988 Date: Sun, 18 Dec 88 22:35:58 EST To: NeWS-makers@brillig.umd.edu Subject: Re: : Display PS vs NeWS From: ssc-vax!benoni@beaver.cs.washington.edu (Charles L Ditzel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) >From article <109@adobe.COM>, by greid@adobe.com (Glenn Reid): > In article <2391@ssc-vax.UUCP> benoni@ssc-vax.UUCP (Charles L Ditzel) writes: > > >> PostScript, on the other hand, is a de-facto standard, and to me, Display > >Again complete SHEER IGNORANCE. NeWS IS a Postscript *superset* - > > >I am sorry for the flame...but next time you post facts ... do a little > >research first. X/Display Postscript has alot of potential...but quite > >simply (because NeWS is a superset of DP) X/NeWS has alot more potential. To bad you didn't post the real reason for the flame. i.e. that only Sun was doing NeWS (which was wrong). > > Tsk, tsk. He who lives by the, er, sword, dies by it, I suppose. Do > you really know anything about Display PostScript? Have you ever > looked up the word "superset"? > Just what I have read and from talking to Adobe's reps at trade shows, and looking at some of the DP demos. > And also, Display PostScript has nothing to do with X windows, other > than the ability to ge integrated into it. Nowaday - many people see a necessary link between X and some form of display Postscript (DP). The most obvious choice is to integrate Display Postscript and X. > The NeXT machine does not > run X windows; it draws its windows with Display PostScript. I was aware that NeXT does not run X11 (that is one of the criticisms of the machine - not mine). I was not aware that Display Postscript had a rich set of window functions...(and maybe an extensible server...;-) as all the literature I've seen states that it operates in the native windows of the machine it resides on. Some of us would be interested in hearing about these new Adobe DP extensions ... care to inform us? > Sigh. sigh. > Glenn Reid > Adobe Systems -------------- My own opinions (again). From don@brillig.umd.edu Mon Dec 19 13:13:52 1988 Date: Mon, 19 Dec 88 13:13:52 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS available for HP workstations ? From: mcvax!ecn!wim@uunet.UU.NET (Wim Rijnsburger) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Hello, We are developping a NeWS class to build tools to display and manipulate structured information (text-documents, graphic's, etc) in an uniform way. At the moment we use SUN workstations, but we want to use these tools on HP workstations in the future. Does anyone know if NeWS is available on HP and how we can get it? Thanks in advance, Wim. --------------------------------------------------------------------- Wim Rijnsburger e-mail: mcvax!ecn!wim Netherlands Energy Research Foundation, ECN ecn!wim@mcvax.cwi.nl P.O. Box 1, 1755 ZG Petten(NH), Holland phone : +31 2246 4336 From don@brillig.umd.edu Mon Dec 19 13:14:00 1988 Date: Mon, 19 Dec 88 13:14:00 EST To: NeWS-makers@brillig.umd.edu Subject: Re: How to convert a NeWS image (.im1) to X bitmap format? From: frame!gergle!greg@Sun.COM Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Look in the manual for writecanvas & writescreen. If you want to end up with a mono-image, make the snapshot on a b&w NeWS screen. Someone has created alot of bitmap format conversion routines for X11. They may be on the R3 tape. Sun pixrect is one of the converted formats. If you can't find the stuff on the R3 tape, put a request on the xpert mailing list. -greg. From don@brillig.umd.edu Wed Dec 21 00:44:40 1988 Date: Wed, 21 Dec 88 00:44:40 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw From: carlisle!bvs@sun.com (Bruce Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I'm about to post NewsDraw, a graphical object editor that runs under NeWS. NewsDraw consists of about 500 lines of NeWS and about 2000 lines of C. NewsDraw is intended as a demonstration of the proper way to spit a NeWS application into client and server sections. NewsDraw also demonstrates how the PostScript imaging model allows text and graphics to be treated with equal ease. Enjoy! Bruce V. Schwartz Sun Microsystems Marketing Technical Support bvs@sun.com From don@brillig.umd.edu Wed Dec 21 00:45:48 1988 Date: Wed, 21 Dec 88 00:45:48 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw 1/5 From: carlisle!bvs@sun.com (Bruce Schwartz) 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: # README # Makefile # draw.h # go.h # gopvt.h # comm.h # This archive created: Fri Dec 16 15:05:51 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'README' then echo shar: "will not over-write existing file 'README'" else cat << \SHAR_EOF > 'README' % % This file is a product of Sun Microsystems, Inc. and is provided for % unrestricted use provided that this legend is included on all tape % media and as a part of the software program in whole or part. % Users may copy, modify or distribute this file at will. % % THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE % WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR % PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. % % This file is provided with no support and without any obligation on the % part of Sun Microsystems, Inc. to assist in its use, correction, % modification or enhancement. % % SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE % INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE % OR ANY PART THEREOF. % % In no event will Sun Microsystems, Inc. be liable for any lost revenue % or profits or other special, indirect and consequential damages, even % if Sun has been advised of the possibility of such damages. % % Sun Microsystems, Inc. % 2550 Garcia Avenue % Mountain View, California 94043 % % Copyright (C) 1988 by Sun Microsystems. All rights reserved. The files in this directory constitue NewsDraw. All files in this directory are subject to the above notice. The file SUG.ps contains a PostScript version of the talk I gave about this program at the Sun User's Group meeting in Miami in December of 1988. It may viewed using psview or NewsLine, the other program described in the talk. Bruce Schwartz Sun Microsystems December 1988 bvs@sun.com SHAR_EOF fi if test -f 'Makefile' then echo shar: "will not over-write existing file 'Makefile'" else cat << \SHAR_EOF > 'Makefile' # $Header: Makefile,v 1.9 88/12/02 10:50:43 bvs Exp $ # Copyright (C) 1988 by Sun Microsystems. All rights reserved. HS = draw.h go.h gopvt.h comm.h CPSS = psint.cps PSS = draw.ps menubar.ps GCS = circ.c line.c oval.c rect.c text.c poly.c OCS = draw.c item.c eh.c font.c go.c file.c prop.c stretch.c CS = $(GCS) $(OCS) SRCS = $(HS) $(CPSS) $(PSS) $(CS) CLEAN = *.o psint.h psint.c OFILES = draw.o psint.o eh.o go.o item.o file.o poly.o \ line.o rect.o circ.o oval.o text.o font.o stretch.o prop.o CFLAGS = -g -I/usr/NeWS/include all: $(PSS) draw wc: wc -l $(SRCS) print: enscript -2r $(SRCS) draw: $(OFILES) cc $(CFLAGS) -o draw -L/usr/NeWS/lib $(OFILES) -lcps -lm psint.o: psint.c circ.o: go.h draw.h psint.h gopvt.h draw.o: go.h draw.h psint.h eh.o: go.h draw.h psint.h go.o: go.h draw.h psint.h item.o: go.h draw.h psint.h gopvt.h line.o: go.h draw.h psint.h gopvt.h oval.o: go.h draw.h psint.h gopvt.h poly.o: go.h draw.h psint.h gopvt.h rect.o: go.h draw.h psint.h gopvt.h stretch.o: go.h draw.h psint.h gopvt.h comm.h text.o: go.h draw.h psint.h gopvt.h prop.o: psint.h comm.h $(SRCS): co $@ tar: tar cvf /dev/rst0 $(SRCS) SHARS = shar1 shar2 shar3 shar4 shar5 shar: rm -f $(SHARS) make $(SHARS) shar1: shar README Makefile $(HS) > $@ shar2: shar SUG.ps > $@ shar3: shar $(CPSS) $(PSS) > $@ shar4: shar $(GCS) > $@ shar5: shar $(OCS) > $@ clean: rm -f $(CLEAN) *.BAK rcsclean co Makefile README .SUFFIXES: .cps .cps.h: cps -i $< .cps.c: cps -i $< SHAR_EOF fi if test -f 'draw.h' then echo shar: "will not over-write existing file 'draw.h'" else cat << \SHAR_EOF > 'draw.h' /* $Header: draw.h,v 1.5 88/12/02 10:43:28 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ /* * $Header: draw.h,v 1.5 88/12/02 10:43:28 bvs Exp $ * * NewsDraw: A NeWS based Graphical Object Editor * By Bruce Schwartz * * Thanks to Charlie Burns for figuring out how to get crude * objects and inheiritance out of C. By putting most structure * definitions in the .c files, we have truely opaque objects. * In item.c/go.h/gopvt.h, we have simple inheritance. * Cheesy but effective! */ /* % % This file is a product of Sun Microsystems, Inc. and is provided for % unrestricted use provided that this legend is included on all tape % media and as a part of the software program in whole or part. % Users may copy, modify or distribute this file at will. % % THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE % WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR % PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. % % This file is provided with no support and without any obligation on the % part of Sun Microsystems, Inc. to assist in its use, correction, % modification or enhancement. % % SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE % INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE % OR ANY PART THEREOF. % % In no event will Sun Microsystems, Inc. be liable for any lost revenue % or profits or other special, indirect and consequential damages, even % if Sun has been advised of the possibility of such damages. % % Sun Microsystems, Inc. % 2550 Garcia Avenue % Mountain View, California 94043 % % Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #ifndef DRAW_H #define DRAW_H #define TRUE 1 #define FALSE 0 /* the modes -- some have graphical objects */ #define STRETCH 0 #define ROTATE 1 #define BRUSH 2 #define LINE 3 #define RECT 4 #define CIRC 5 #define OVAL 6 #define TEXT 7 #define POLY 8 #define MODEMAX 10 /* event handlers */ typedef struct { void *(*handleselect)(); /* select button */ void *(*handleadjust)(); /* adjust button */ void *(*handlekey)(); /* keystroke */ void *(*handleprop)(); /* property list change */ void *(*handlereply)(); /* server reply */ void *(*handledamage)(); /* damage event */ void *(*handlebegin)(); /* begin mode */ void *(*handleend)(); /* end mode */ } EHPROCS; EHPROCS ehprocs[MODEMAX]; #endif SHAR_EOF fi if test -f 'go.h' then echo shar: "will not over-write existing file 'go.h'" else cat << \SHAR_EOF > 'go.h' /* $Header: go.h,v 1.6 88/12/02 10:43:22 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #ifndef GO_H #define GO_H #include "draw.h" #include "psint.h" typedef struct { void *(*holder)(); /* item pointer */ void *(*new)(); /* new item */ void *(*move)(); /* move item */ void *(*rotate)(); /* rotate item */ void *(*scale)(); /* scale item */ void *(*setpath)(); /* set path for int draw */ void *(*draw)(); /* draw on screen */ void *(*print)(); /* write postscript file */ void *(*write)(); /* write draw file */ void *(*read)(); /* read draw file */ } GOPROCS; GOPROCS goprocs[MODEMAX]; typedef struct item ITEM; typedef struct font FONT; typedef struct prop PROP; #define GONewLine(x0, y0, x1, y1) (ITEM *)goprocs[LINE].new(x0, y0, x1, y1) #define GONewRect(x0, y0, x1, y1) (ITEM *)goprocs[RECT].new(x0, y0, x1, y1) #define GONewOval(x0, y0, x1, y1) (ITEM *)goprocs[OVAL].new(x0, y0, x1, y1) #define GONewCirc(x0, y0, x1, y1) (ITEM *)goprocs[CIRC].new(x0, y0, x1, y1) #define GONewText(x0, y0,pc, pfont) (ITEM *)goprocs[TEXT].new(x0, y0, pc, pfont) #define GONewPencil(x0, y0, apoint, length) \ (ITEM *)goprocs[PENCIL].new(apoint, length) #define MIN(x,y) (((x) < (y)) ? (x) : (y)) #define MAX(x,y) (((x) > (y)) ? (x) : (y)) #define ABS(x) (((x) > 0) ? (x) : (-(x))) #define POS(x) (((x) >= 0) ? 1 : 0) #define NEG(x) (((x) >= 0) ? 0 : 1) extern float GOItemGetRotation(); extern ITEM *GOAddItem(); extern ITEM *GODrawItem(); extern FONT *FontDefault(); float PropStrokeColor(); float PropFillColor(); float PropTextColor(); FONT *PropFont(); PROP *PropCopyOf(); PROP *PropCurrent(); PROP *PropRead(); #endif SHAR_EOF fi if test -f 'gopvt.h' then echo shar: "will not over-write existing file 'gopvt.h'" else cat << \SHAR_EOF > 'gopvt.h' /* $Header: gopvt.h,v 1.3 88/12/02 10:43:30 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #ifndef GOPVT_H #define GOPVT_H /* graphical objects */ #define ITEMHEADER \ int type; /* type of item */ \ int flags; /* bitwise flags */ \ int x0, y0; /* bottom/left corner */ \ int x1, y1; /* top/right corner */ \ float rotation; /* degrees of rotation from canonical form */ \ int xscale; /* scaling in x dimension */ \ int yscale; /* scaling in y dimension */ \ PROP* prop ; /* properties for item */ \ ITEM* pprev; \ ITEM* pnext struct item { ITEMHEADER; }; #define X0 (pitem->x0) #define Y0 (pitem->y0) #define X1 (pitem->x1) #define Y1 (pitem->y1) #define X ((pitem->x0 + pitem->x1) / 2) #define Y ((pitem->y0 + pitem->y1) / 2) #define W ((pitem->x1 - pitem->x0)) #define H ((pitem->y1 - pitem->y0)) #define W2 ((pitem->x1 - pitem->x0) / 2) #define H2 ((pitem->y1 - pitem->y0) / 2) #endif SHAR_EOF fi if test -f 'comm.h' then echo shar: "will not over-write existing file 'comm.h'" else cat << \SHAR_EOF > 'comm.h' /* $Header: comm.h,v 1.2 88/12/02 10:43:51 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #define STRETCH_MODE 0 #define ROTATE_MODE 1 #define BRUSH_MODE 2 #define LINE_MODE 3 #define RECT_MODE 4 #define CIRC_MODE 5 #define OVAL_MODE 6 #define TEXT_MODE 7 #define POLY_MODE 8 #define FILL_KEY 1 #define STROKE_KEY 2 #define WIDTH_KEY 3 #define PRINT_KEY 4 #define TOTOP_KEY 5 #define TOBOT_KEY 6 #define TEXT_KEY 7 #define REDRAW_KEY 8 #define WRITE_KEY 9 #define READ_KEY 10 SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Dec 21 00:47:12 1988 Date: Wed, 21 Dec 88 00:47:12 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw 2/5 From: carlisle!bvs@sun.com (Bruce Schwartz) 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: # SUG.ps # This archive created: Fri Dec 16 15:05:51 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'SUG.ps' then echo shar: "will not over-write existing file 'SUG.ps'" else cat << \SHAR_EOF > 'SUG.ps' %! %%Pages: (atend) %%DocumentFonts: (atend) %%EndComments % % Frame Maker PostScript Prolog 1.11, for use with Maker 1.11 % Copyright (c) 1986,87 by Frame Technology, Inc. All rights reserved. % % Known Problems: % Due to bugs in Transcript, the 'PS-Adobe-' is omitted from line 1 /FMversion (1.11) def /FrameDict 120 dict def % The readline in 23.0 doesn't recognize cr's as nl's on AppleTalk FrameDict /tmprangecheck errordict /rangecheck get put errordict /rangecheck {FrameDict /bug true put} put FrameDict /bug false put mark % Some PS machines read past the CR, so keep the following 3 lines together! currentfile 5 string readline 00 0000000000 cleartomark errordict /rangecheck FrameDict /tmprangecheck get put FrameDict /bug get { /readline { /gstring exch def /gfile exch def /gindex 0 def { gfile read pop dup 10 eq {exit} if dup 13 eq {exit} if gstring exch gindex exch put /gindex gindex 1 add def } loop pop gstring 0 gindex getinterval true } def } if /FMVERSION { FMversion ne { /Times-Roman findfont 18 scalefont setfont 100 100 moveto (Maker version does not match postscript_prolog!) dup = show showpage } if } def /FMLOCAL { FrameDict begin 0 def end } def /landscape FMLOCAL /docheight FMLOCAL /docwidth FMLOCAL /yscale FMLOCAL /xscale FMLOCAL /orgxfer FMLOCAL /orgproc FMLOCAL /organgle FMLOCAL /orgfreq FMLOCAL /FMDOCUMENT { /#copies exch def FrameDict begin 0 ne /landscape exch def /docheight exch def /docwidth exch def /yscale exch def /xscale exch def currenttransfer cvlit /orgxfer exch def currentscreen cvlit /orgproc exch def /organgle exch def /orgfreq exch def end } def /pagesave FMLOCAL /orgmatrix FMLOCAL /FMBEGINPAGE { FrameDict begin /pagesave save def 2 setlinecap xscale yscale scale landscape { 90 rotate 0 docheight neg translate } if /orgmatrix matrix def gsave } def /FMENDPAGE { grestore pagesave restore end showpage } def /fontname FMLOCAL /fontscale FMLOCAL /fontnum FMLOCAL /fontdict FMLOCAL /FMDEFINEFONT { FrameDict begin /fontname exch def /fontscale exch def /fontnum exch def /fontdict fontname findfont fontscale scalefont def fontdict /Encoding get StandardEncoding eq { fontdict DiacriticEncode /fontdict exch def } { fontdict NonDiacriticEncode /fontdict exch def } ifelse FMfonts fontnum fontnum fontdict definefont put end } def /FMLINEWIDTHS { FrameDict begin dup array /FMlinewidths exch def 1 sub -1 0 {exch FMlinewidths 3 1 roll lnormalize put} for end } def FrameDict begin /savematrix { orgmatrix currentmatrix pop } bind def /restorematrix { orgmatrix setmatrix } bind def /dmatrix matrix def /dpi 72 0 dmatrix defaultmatrix dtransform dup mul exch dup mul add sqrt def /max {2 copy lt {exch} if pop} bind def /min {2 copy gt {exch} if pop} bind def /DiacriticEncoding [ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quotesingle /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one /two /three /four /five /six /seven /eight /nine /colon /semicolon /less /equal /greater /question /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore /grave /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p /q /r /s /t /u /v /w /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /Adieresis /Aring /Ccedilla /Eacute /Ntilde /Odieresis /Udieresis /aacute /agrave /acircumflex /adieresis /atilde /aring /ccedilla /eacute /egrave /ecircumflex /edieresis /iacute /igrave /icircumflex /idieresis /ntilde /oacute /ograve /ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex /udieresis /dagger /.notdef /cent /sterling /section /bullet /paragraph /germandbls /registered /copyright /trademark /acute /dieresis /.notdef /AE /Oslash /.notdef /.notdef /.notdef /.notdef /yen /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /ordfeminine /ordmasculine /.notdef /ae /oslash /questiondown /exclamdown /logicalnot /.notdef /florin /.notdef /.notdef /guillemotleft /guillemotright /ellipsis /.notdef /Agrave /Atilde /Otilde /OE /oe /endash /emdash /quotedblleft /quotedblright /quoteleft /quoteright /.notdef /.notdef /ydieresis /Ydieresis /fraction /currency /guilsinglleft /guilsinglright /fi /fl /daggerdbl /periodcentered /quotesinglbase /quotedblbase /perthousand /Acircumflex /Ecircumflex /Aacute /Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute /Ocircumflex /.notdef /Ograve /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex /tilde /macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron ] def /FMfonts 255 array def /basefontdict FMLOCAL /newfontdict FMLOCAL /DiacriticEncode { /basefontdict exch def /newfontdict basefontdict maxlength dict def basefontdict {exch dup /FID ne {dup /Encoding eq {exch pop DiacriticEncoding} {exch} ifelse newfontdict 3 1 roll put } {pop pop} ifelse } forall newfontdict } bind def /NonDiacriticEncode { /basefontdict exch def /newfontdict basefontdict maxlength dict def basefontdict {exch dup /FID ne {exch newfontdict 3 1 roll put} {pop pop} ifelse } forall newfontdict } bind def /freq FMLOCAL /bwidth FMLOCAL /bpside FMLOCAL /bstring FMLOCAL /onbits FMLOCAL /offbits FMLOCAL /xindex FMLOCAL /yindex FMLOCAL /x FMLOCAL /y FMLOCAL /setpattern { /freq exch def /bwidth exch def /bpside exch def /bstring exch def /onbits 0 def /offbits 0 def freq 0 {/y exch def /x exch def /xindex x 1 add 2 div bpside mul cvi def /yindex y 1 add 2 div bpside mul cvi def bstring yindex bwidth mul xindex 8 idiv add get 1 7 xindex 8 mod sub bitshift and 0 ne {/onbits onbits 1 add def 1} {/offbits offbits 1 add def 0} ifelse } setscreen {} settransfer offbits offbits onbits add div setgray } bind def /grayness { setgray orgxfer cvx settransfer orgfreq organgle orgproc cvx setscreen } bind def /normalize { transform cvi exch cvi exch itransform } bind def /dnormalize { dtransform cvi exch cvi exch idtransform } bind def /lnormalize { 0 dtransform exch cvi 2 idiv 2 mul 1 add exch idtransform pop } bind def /fillprocs [{0.00 grayness} {0.10 grayness} {0.30 grayness} {0.50 grayness} {0.70 grayness} {0.90 grayness} {0.97 grayness} {1.00 grayness} {<0F1E3C78F0E1C387> 8 1 dpi 16 div setpattern} {<0F87C3E1F0783C1E> 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<8142241818244281> 8 1 dpi 16 div setpattern} {<03060C183060C081> 8 1 dpi 16 div setpattern} {<8040201008040201> 8 1 dpi 16 div setpattern} {} {1.00 grayness} {0.90 grayness} {0.70 grayness} {0.50 grayness} {0.30 grayness} {0.10 grayness} {0.03 grayness} {0.00 grayness} { 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<3333333333333333> 8 1 dpi 16 div setpattern} {<0000FFFF0000FFFF> 8 1 dpi 16 div setpattern} {<7EBDDBE7E7DBBD7E> 8 1 dpi 16 div setpattern} { 8 1 dpi 16 div setpattern} {<7FBFDFEFF7FBFDFE> 8 1 dpi 16 div setpattern} {} ] def /H { FMlinewidths exch get setlinewidth } bind def /X { fillprocs exch get exec } bind def /V { gsave eofill grestore } bind def /N { gsave stroke grestore } bind def /M {moveto} bind def /E {lineto} bind def /D {curveto} bind def /O {closepath} bind def /n FMLOCAL /L { /n exch def newpath normalize moveto 2 1 n {pop normalize lineto} for } bind def /Y { L closepath } bind def /K { /n exch def newpath moveto 3 1 n {pop curveto} for } bind def /J { /n exch def newpath moveto 1 1 n {pop curveto} for } bind def /x1 FMLOCAL /x2 FMLOCAL /y1 FMLOCAL /y2 FMLOCAL /R { /y2 exch def /x2 exch def /y1 exch def /x1 exch def x1 y1 x2 y1 x2 y2 x1 y2 4 Y } bind def /C { grestore gsave R clip } bind def /U { grestore gsave } bind def /F { FMfonts exch get setfont } bind def /T { moveto show } bind def /P { moveto 0 32 3 2 roll widthshow } bind def /S { moveto 0 exch ashow } bind def /B { moveto 0 32 4 2 roll 0 exch awidthshow } bind def /Q { moveto gsave show grestore } bind def /x FMLOCAL /y FMLOCAL /dx FMLOCAL /dy FMLOCAL /dl FMLOCAL /t FMLOCAL /t2 FMLOCAL /Cos FMLOCAL /Sin FMLOCAL /r FMLOCAL /W { dnormalize /dy exch def /dx exch def normalize /y exch def /x exch def /dl dx dx mul dy dy mul add sqrt def dl 0.0 gt { /t currentlinewidth def savematrix /Cos dx dl div def /Sin dy dl div def /r [Cos Sin Sin neg Cos 0.0 0.0] def /t2 t 2.5 mul 3.5 max def newpath x y translate r concat 0.0 0.0 moveto dl t 2.7 mul sub 0.0 rlineto stroke restorematrix x dx add y dy add translate r concat t 0.67 mul setlinewidth t 1.61 mul neg 0.0 translate 0.0 0.0 moveto t2 1.7 mul neg t2 2.0 div moveto 0.0 0.0 lineto t2 1.7 mul neg t2 2.0 div neg lineto stroke t setlinewidth restorematrix } if } bind def /G { gsave newpath normalize translate 0.0 0.0 moveto dnormalize scale 0.0 0.0 1.0 5 3 roll arc closepath eofill grestore } bind def /x FMLOCAL /y FMLOCAL /w FMLOCAL /h FMLOCAL /xx FMLOCAL /yy FMLOCAL /ww FMLOCAL /hh FMLOCAL /A { /y exch def /x exch def /h exch def /w exch def x y normalize /yy exch def /xx exch def w h dnormalize /hh exch def /ww exch def ww abs hh abs xx ww add yy hh sub gsave savematrix newpath translate scale 0.0 0.0 1.0 5 3 roll arc 0 setlinecap restorematrix stroke grestore } bind def /FMsaveobject FMLOCAL /FMoptop FMLOCAL /FMdicttop FMLOCAL /BEGINPRINTCODE { /FMdicttop countdictstack 1 add def /FMoptop count 6 sub def /FMsaveobject save def userdict begin /showpage {} def newpath translate 0.0 0.0 moveto } bind def /ENDPRINTCODE { count -1 FMoptop {pop pop} for countdictstack -1 FMdicttop {pop end} for FMsaveobject restore } bind def /gn { 0 { 46 mul cf read pop 32 sub dup 46 lt {exit} if 46 sub add } loop add } bind def /str FMLOCAL /cfs { /str sl string def 0 1 sl 1 sub {str exch val put} for str def } bind def /ic [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0223 0 {0 hx} {1 hx} {2 hx} {3 hx} {4 hx} {5 hx} {6 hx} {7 hx} {8 hx} {9 hx} {10 hx} {11 hx} {12 hx} {13 hx} {14 hx} {15 hx} {16 hx} {17 hx} {18 hx} {19 hx} {gn hx} {0} {1} {2} {3} {4} {5} {6} {7} {8} {9} {10} {11} {12} {13} {14} {15} {16} {17} {18} {19} {gn} {0 wh} {1 wh} {2 wh} {3 wh} {4 wh} {5 wh} {6 wh} {7 wh} {8 wh} {9 wh} {10 wh} {11 wh} {12 wh} {13 wh} {14 wh} {gn wh} {0 bl} {1 bl} {2 bl} {3 bl} {4 bl} {5 bl} {6 bl} {7 bl} {8 bl} {9 bl} {10 bl} {11 bl} {12 bl} {13 bl} {14 bl} {gn bl} {0 fl} {1 fl} {2 fl} {3 fl} {4 fl} {5 fl} {6 fl} {7 fl} {8 fl} {9 fl} {10 fl} {11 fl} {12 fl} {13 fl} {14 fl} {gn fl} ] def /sl FMLOCAL /val FMLOCAL /ws FMLOCAL /im FMLOCAL /bs FMLOCAL /cs FMLOCAL /len FMLOCAL /pos FMLOCAL /ms { /sl exch def /val 255 def /ws cfs /im cfs /val 0 def /bs cfs /cs cfs } bind def 400 ms /ip { is 0 cf cs readline pop { ic exch get exec add } forall pop } bind def /wh { /len exch def /pos exch def ws 0 len getinterval im pos len getinterval copy pop pos len } bind def /bl { /len exch def /pos exch def bs 0 len getinterval im pos len getinterval copy pop pos len } bind def /s1 1 string def /fl { /len exch def /pos exch def /val cf s1 readhexstring pop 0 get def pos 1 pos len add 1 sub {im exch val put} for pos len } bind def /hx { 3 copy getinterval cf exch readhexstring pop pop } bind def /h FMLOCAL /w FMLOCAL /lb FMLOCAL /bitmapsave FMLOCAL /is FMLOCAL /cf FMLOCAL /BEGINBITMAP { gsave translate scale /h exch def /w exch def /lb w 7 add 8 idiv def sl lb lt {lb ms} if /bitmapsave save def /is im 0 lb getinterval def ws 0 lb getinterval is copy pop /cf currentfile def w h 1 [w 0 0 h neg 0 h] {ip} image bitmapsave restore grestore } bind def /ENDBITMAP { } bind def end %%EndProlog %%BeginSetup (1.11) FMVERSION 1. 1. 612. 792. 0 1 FMDOCUMENT 0 18. /Times-Bold FMDEFINEFONT 1 24. /Helvetica-Bold FMDEFINEFONT 2 18. /Helvetica-Bold FMDEFINEFONT 3 24. /Times-Bold FMDEFINEFONT 0.5 1. 3. 4. 4 FMLINEWIDTHS %%EndSetup %%Page: "1" 1 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw) 245.32 572. T (News-on-a-Wire) 215.33 520. T (NewsLine) 249.98 468. T 2 F (Bruce Schwartz) 238.48 296. T (Sun Microsystems) 226.48 276. T (December 1988) 239.97 256. T (bvs@sun.com) 244.71 216. T FMENDPAGE %%Page: "2" 2 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw) 245.32 650. T (A NeWS based graphical object editor) 89.28 468. T FMENDPAGE %%Page: "3" 3 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Statistics) 188.63 702. T 188.63 697.71 423.37 699.46 R V (2000 lines of C) 221.96 650. T (500 lines of NeWS) 202.63 624. T (160 C procedures \05071 global calls\051) 111.92 572. T (CPS for client/server interaction) 123.28 520. T (NeWS Lite toolkit for User Interface) 104.63 494. T (PostScript imaging model) 157.97 468. T FMENDPAGE %%Page: "4" 4 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Goals) 208.63 702. T 208.63 697.71 403.37 699.46 R V (\245 Good use of client/server model) 72. 648. T (\245 Minimize client/server traffic) 72. 619. T (\245 Functionality: read/write/print/etc.) 72. 590. T (\245 Simple and easy to understand) 72. 561. T (\245 Portability through C and CPS) 72. 532. T (\245 Good object oriented coding style) 72. 503. T (\245 Use power of NeWS imaging model) 72. 474. T (\245 Low demands on server) 72. 445. T FMENDPAGE %%Page: "5" 5 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Non-Goals) 181.31 702. T 181.31 697.71 430.69 699.46 R V (\245 Not a clean example of NeWS code) 72. 650. T (\245 Not in C++) 72. 621. T FMENDPAGE %%Page: "6" 6 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 414. 243. 504. R 7 X V 2 F 0 X (Data Structures) 90.49 490. T (Data Manipulation) 79.99 470. T (Edits) 135.5 450. T (File I/O) 127.48 430. T 369. 414. 540. 504. R 7 X V 0 X (Drawing) 419. 490. T (User Interface) 394.48 470. T (Optimization) 400. 450. T 3 H 90. 90.1 -85.5 85.5 243. 558. A 90. 180.1 85.5 85.5 72. 558. A 180. 270.1 85.5 -85.5 72. 387. A 270. 0.1 -85.5 -85.5 243. 387. A 0. 90. -85.5 85.5 243. 558. A 90. 90.1 -85.5 85.5 540. 558. A 90. 180.1 85.5 85.5 369. 558. A 180. 270.1 85.5 -85.5 369. 387. A 270. 0.1 -85.5 -85.5 540. 387. A 0. 90. -85.5 85.5 540. 558. A 72. 333. 243. 378. R 7 X V 1 F 0 X (Client) 124.16 360. T 369. 333. 540. 378. R 7 X V 0 X (Server) 417.14 360. T 270. 468. 90. 0. W 333. 468. -80. 0. W 72. 684. 549. 720. R 7 X V 0 X (NewsDraw Client/Server Partition) 120.44 702. T 120.44 697.71 500.55 699.46 R V FMENDPAGE %%Page: "7" 7 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 404. 432. 720. R 7 X V 1 F 0 X (NewsDraw Modes) 149.98 702. T 149.98 697.71 354.03 699.46 R V (\245 Move) 72. 650. T (\245 Rotate) 72. 621. T (\245 Brush) 72. 592. T (\245 Line) 72. 563. T (\245 Rectangle) 72. 534. T (\245 Circle) 72. 505. T (\245 Oval) 72. 476. T (\245 Text) 72. 447. T (\245 Polygon) 72. 418. T 3 H 378. 621. 81. 0. W 423. 621. -81. 0. W 7 X 90. 450. 40.5 40.5 418.5 526.5 G 0 X 90. 90.1 -40.5 40.5 459. 567. A 90. 180.1 40.5 40.5 378. 567. A 180. 270.1 40.5 -40.5 378. 486. A 270. 0.1 -40.5 -40.5 459. 486. A 0. 90. -40.5 40.5 459. 567. A 342. 450. 414. 522. R 7 X V N 0 X 378. 531. 0. -18. W 315. 333. 477. 414. R 0 H 12 X N 90. 90.1 -58.5 58.5 252. 279. A 90. 180.1 58.5 58.5 135. 279. A 180. 270.1 58.5 -58.5 135. 162. A 270. 0.1 -58.5 -58.5 252. 162. A 0. 90. -58.5 58.5 252. 279. A 90. 90.1 -81. 40.5 504. 288. A 90. 180.1 81. 40.5 342. 288. A 180. 270.1 81. -40.5 342. 207. A 270. 0.1 -81. -40.5 504. 207. A 0. 90. -81. 40.5 504. 288. A 243. 621. 255. 619. 275. 615. 299. 609. 307. 601. 309. 591. 307. 577. 299. 563. 293. 545. 287. 533. 285. 521. 289. 511. 299. 509. 315. 505. 337. 501. 349. 493. 355. 487. 355. 473. 361. 463. 365. 453. 377. 449. 387. 449. 393. 447. 23 L 0 X N 180. 360. 198. 315. 261. 333. 234. 360. 261. 387. 5 L N 261. 387. 261. 432. 2 L 12 X N 3 F 0 X (Hello) 324. 153. T 1 F ( Wo) 378. 153. T 424. 172. 424. 144. 2 L N 418. 152. 431. 152. 2 L N 1 H 490. 404. -10. 10. W 232. 158. -10. 10. W 516. 241. -10. 10. W 490. 404. -10. 10. W 274. 419. -10. 10. W 404. 437. -10. 10. W FMENDPAGE %%Page: "8" 8 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Events) 202.63 702. T 202.63 697.71 409.37 699.46 R V (\245 Begin Mode) 72. 650. T (\245 End Mode) 72. 621. T (\245 Damage) 72. 592. T (\245 Menu Action) 72. 563. T (\245 Select Mouse Down) 72. 534. T (\245 Adjust Mouse Down) 72. 505. T (\245 Keystroke) 72. 476. T (\245 Reply Received) 72. 447. T FMENDPAGE %%Page: "9" 9 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 567. 540. 720. R 7 X V 1 F 0 X (NewsDraw Objects) 197.96 702. T 197.96 697.71 414.03 699.46 R V (\245 Stacked) 72. 650. T (\245 Rotated) 72. 621. T (\245 Properties) 72. 592. T 297. 633. 302. 636. 308. 640. 316. 644. 332. 648. 350. 648. 374. 646. 398. 640. 410. 630. 414. 618. 418. 604. 420. 588. 420. 578. 418. 564. 416. 550. 416. 538. 420. 526. 424. 516. 432. 508. 444. 504. 454. 500. 470. 496. 480. 490. 490. 482. 496. 468. 496. 452. 488. 434. 460. 414. 428. 402. 398. 396. 390. 396. 31 L 2 H N 333. 297. 468. 144. 2 L N 108. 441. 297. 531. R 3 X V 3 H 4 X N 6 X 90. 450. 90. 27. 414. 342. G 2 H 0 X 90. 90.1 -90. 27. 504. 369. A 90. 180.1 90. 27. 324. 369. A 180. 270.1 90. -27. 324. 315. A 270. 0.1 -90. -27. 504. 315. A 0. 90. -90. 27. 504. 369. A 90. 450. 63. 63. 279. 189. G 4 X 90. 90.1 -63. 63. 342. 252. A 90. 180.1 63. 63. 216. 252. A 180. 270.1 63. -63. 216. 126. A 270. 0.1 -63. -63. 342. 126. A 0. 90. -63. 63. 342. 252. A 0 X -1.1 ("Hello World") 151. 375. P 162. 207. 207. 243. 153. 288. 180. 315. 135. 342. 99. 234. 6 Y 4 X V 1 H 0 X N FMENDPAGE %%Page: "10" 10 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Object Methods) 151.97 702. T 151.97 697.71 460.03 699.46 R V (\245 Holder) 72. 650. T (\245 New) 72. 621. T (\245 Draw) 72. 592. T (\245 Print) 72. 563. T (\245 Read) 72. 534. T (\245 Write) 72. 505. T FMENDPAGE %%Page: "11" 11 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsDraw Futures) 197.98 702. T 197.98 697.71 414.03 699.46 R V (\245 Add features) 72. 650. T (\245 C++) 72. 621. T (\245 NDE) 72. 592. T FMENDPAGE %%Page: "12" 12 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NeWS-on-a-Wire) 212. 702. T (and) 284.66 650. T (NewsLine) 249.98 598. T FMENDPAGE %%Page: "13" 13 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NeWS-on-a-wire) 214. 702. T 214. 697.71 398.01 699.46 R V (\245 Use networking power of NeWS) 72. 650. T (\245 Browse remote databases) 72. 621. T (\245 Bring desktop home) 72. 592. T (\245 Develop programs remotely) 72. 563. T (Compare to X-on-a-wire) 170.65 482. T 170.65 477.71 441.35 479.46 R V (\245 More responsive User Interface) 72. 430. T (\245 Less network performance sensitive) 72. 401. T FMENDPAGE %%Page: "14" 14 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 113. 522. 139. 475. 86. 475. 3 Y 7 X V 3 H 0 X N 113. 441. 139. 394. 86. 394. 3 Y 7 X V 0 X N 113. 603. 139. 556. 86. 556. 3 Y 7 X V 0 X N 7 X 90. 450. 45. 103.5 495. 499.5 G 0 X 90. 90.1 -45. 103.5 540. 603. A 90. 180.1 45. 103.5 450. 603. A 180. 270.1 45. -103.5 450. 396. A 270. 0.1 -45. -103.5 540. 396. A 0. 90. -45. 103.5 540. 603. A 72. 333. 153. 369. R 7 X V 2 F 0 X (Clients) 82.49 355. T 459. 306. 540. 369. R 7 X V 0 X (NeWS ) 473.5 355. T (Server) 471.48 335. T 72. 621. 540. 720. R 7 X V 1 F 0 X (NeWS Client/Server Relationship) 115.28 702. T 115.28 697.71 496.71 699.46 R V 189. 576. 225. 0. W 378. 576. -198. 0. W 188. 496. 225. 0. W 377. 496. -198. 0. W 189. 415. 225. 0. W 378. 415. -198. 0. W FMENDPAGE %%Page: "15" 15 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 7 X 90. 450. 34. 77.5 234. 516.5 G 3 H 0 X 90. 90.1 -34. 77.5 268. 594. A 90. 180.1 34. 77.5 200. 594. A 180. 270.1 34. -77.5 200. 439. A 270. 0.1 -34. -77.5 268. 439. A 0. 90. -34. 77.5 268. 594. A 72. 360. 144. 414. R 7 X V 2 F 0 X (Clients) 77.99 400. T 103. 533. 122. 498. 83. 498. 3 Y 7 X V 0 X N 103. 472. 122. 437. 83. 437. 3 Y 7 X V 0 X N 103. 594. 122. 559. 83. 559. 3 Y 7 X V 0 X N 103. 533. 122. 498. 83. 498. 3 Y 7 X V 0 X N 103. 472. 122. 437. 83. 437. 3 Y 7 X V 0 X N 103. 594. 122. 559. 83. 559. 3 Y 7 X V 0 X N 180. 324. 277. 418. R 7 X V 0 X (NeWS ) 202.5 404. T (Server ) 200.48 384. T (Surrogate) 185.99 364. T 373. 234. 392. 199. 353. 199. 3 Y 7 X V 0 X N 7 X 90. 450. 34. 77.5 504. 217.5 G 0 X 90. 90.1 -34. 77.5 538. 295. A 90. 180.1 34. 77.5 470. 295. A 180. 270.1 34. -77.5 470. 140. A 270. 0.1 -34. -77.5 538. 140. A 0. 90. -34. 77.5 538. 295. A 470. 72. 538. 119. R 7 X V 0 X (NeWS ) 478. 105. T (Server ) 475.98 85. T 324. 72. 423. 119. R 7 X V 0 X (Clients ) 343.49 105. T (Surrogate) 330.99 85. T 2 H 324. 387. 36. -135. W 315. 360. -27. 117. W 315. 360. 324. 387. 2 L N (telephone) 342. 378. T 72. 621. 540. 720. R 7 X V 1 F 0 X (NeWS-on-a-wire) 214. 702. T 214. 697.71 398.01 699.46 R V ( Client/Server Relationship) 149.95 676. T 149.95 671.71 462.05 673.46 R V 162. 451. -27. 0. W 162. 451. 27. 0. W 162. 576. -27. 0. W 162. 576. 27. 0. W 162. 513. -27. 0. W 162. 513. 27. 0. W 432. 154. -27. 0. W 432. 154. 27. 0. W 432. 279. -27. 0. W 432. 279. 27. 0. W 432. 216. -27. 0. W 432. 216. 27. 0. W FMENDPAGE %%Page: "16" 16 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 558. 540. 720. R 7 X V 1 F 0 X (NewsLine) 249.98 702. T 249.98 697.71 362.01 699.46 R V (\245 Exploiting News-on-a-wire) 72. 624. T (\245 Browse PostScript files remotely) 72. 595. T (\245 Print items of interest locally) 72. 566. T 234. 441. 351. 477. R 7 X V 2 F 0 X (Prologue) 253.49 463. T 234. 297. 351. 333. R 7 X V 0 X (Page N) 261.99 319. T 234. 333. 351. 369. R 7 X V 0 X (...) 284.99 355. T 234. 369. 351. 405. R 7 X V 0 X (Page 2) 263.48 391. T 234. 405. 351. 441. R 7 X V 0 X (Page 1) 263.48 427. T 234. 261. 351. 297. R 7 X V 0 X (Trailer) 264.99 283. T 234. 450. 351. 486. R N 234. 414. 351. 450. R N 234. 378. 351. 414. R N 234. 342. 351. 378. R N 234. 306. 351. 342. R N 234. 270. 351. 306. R N 171. 171. 405. 243. R 7 X V 0 F 0 X (PostScript file format) 205.02 229. T FMENDPAGE %%Page: "17" 17 FMBEGINPAGE 63. 63. 549. 729. R 7 X V 1 H 0 X N 0 F (NeWS SIG) 72. 36. T (SUG Miami, December 1988) 320.04 36. T 72. 72. 540. 720. R 7 X V 1 F 0 X (NewsLine futures) 205.98 702. T 205.98 697.71 406.02 699.46 R V (\245 Porting Guide, Catalyst Catalog) 72. 624. T (\245 Database Browsing) 72. 595. T (\245 Information Navigation) 72. 566. T (\245 Bulletin Board) 72. 537. T FMENDPAGE %%Trailer %%Pages: 17 1 %%DocumentFonts: Times-Bold %%+ Helvetica-Bold SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Dec 21 00:48:57 1988 Date: Wed, 21 Dec 88 00:48:57 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw 3/5 From: carlisle!bvs@sun.com (Bruce Schwartz) 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: # psint.cps # draw.ps # menubar.ps # This archive created: Fri Dec 16 15:05:52 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'psint.cps' then echo shar: "will not over-write existing file 'psint.cps'" else cat << \SHAR_EOF > 'psint.cps' %! % % $Header: psint.cps,v 1.6 88/12/02 10:43:17 bvs Exp $ % cdef ps_init(string buf) /DEFSTR_TAG 0 def /TOOL_TAG 100 def /SELECT_TAG 200 def /ADJUST_TAG 300 def /POINT_TAG 400 def /ANGLE_TAG 401 def /KEY_TAG 500 def /DAMAGE_TAG 600 def /PROP_TAG 700 def /STRETCH_MODE 0 def /ROTATE_MODE 1 def /BRUSH_MODE 2 def /LINE_MODE 3 def /RECT_MODE 4 def /CIRC_MODE 5 def /OVAL_MODE 6 def /TEXT_MODE 7 def /POLY_MODE 8 def /FILL_KEY 1 def /STROKE_KEY 2 def /WIDTH_KEY 3 def /PRINT_KEY 4 def /TOTOP_KEY 5 def /TOBOT_KEY 6 def /TEXT_KEY 7 def /REDRAW_KEY 8 def /WRITE_KEY 9 def /READ_KEY 10 def buf (/menubar.ps) append LoadFile buf (/draw.ps) append LoadFile clear #define DEFSTR_TAG 0 #define TOOL_TAG 100 #define SELECT_TAG 200 #define ADJUST_TAG 300 #define POINT_TAG 400 #define ANGLE_TAG 401 #define KEY_TAG 500 #define DAMAGE_TAG 600 #define PROP_TAG 700 cdef ps_fontsetup(string name, size, index, length, bbheight, descent) => \ DEFSTR_TAG(bbheight, descent, length) name findfont size scalefont dup index fontsetup cdef ps_setcanvas() win begin ClientCanvas setcanvas end cdef ps_setgray(float gray) gray setgray cdef ps_rotate(float angle) angle rotate cdef ps_translate(x, y) x y translate cdef ps_dorotate(int x, int y, float angle) matrix currentmatrix x y translate angle rotate x neg y neg translate cdef ps_unrotate() setmatrix cdef ps_moveinteractive(xinit, yinit, float angle, x0, y0, x1, y1) xinit yinit angle x0 y0 x1 y1 /rectMoveInteractive win send cdef ps_pencilCreateinteractive(x, y) x y /pencilCreateInteractive win send cdef ps_linecreateinteractive(x, y) x y /lineCreateInteractive win send cdef ps_rectcreateinteractive(x, y) x y /rectCreateInteractive win send cdef ps_ovalcreateinteractive(x, y) x y /ovalCreateInteractive win send cdef ps_circcreateinteractive(x, y) x y /circCreateInteractive win send cdef ps_rotateInteractive(float angle, xinit, yinit, xcenter, ycenter, x0, y0, x1, y1) angle xinit yinit xcenter ycenter x0 y0 x1 y1 /rotateInteractive win send cdef ps_stdcursor() /ptr /ptr_m win begin ClientCanvas end setstandardcursor cdef ps_xcursor() /xhair /xhair_m win begin ClientCanvas end setstandardcursor cdef ps_stroke() stroke cdef ps_fill() fill cdef ps_setlinewidth(width) width setlinewidth cdef ps_pushclip(x0, y0, x1, y1) gsave x0 y0 moveto x0 y1 lineto x1 y1 lineto x1 y0 lineto closepath clip cdef ps_popclip() grestore cdef ps_savearea(x, y, w, h) x y w h /savearea win send cdef ps_restorearea() /restorearea win send cdef ps_drawline(x0, y0, x, y) x0 y0 moveto x y lineto cdef ps_drawrect(x0, y0, x, y) x0 y0 moveto x0 y lineto x y lineto x y0 lineto closepath cdef ps_drawcirc(x0, y0, r) x0 y0 r 0 360 arc cdef ps_drawoval(x0, y0, x, y) matrix currentmatrix x0 y0 translate x x0 sub y y0 sub scale .5 .5 .5 0 360 arc setmatrix %% ps_drawoval(x, y, r) %% x y r 0 360 arc cdef ps_getcreatepoint(x, y) => POINT_TAG(x, y) cdef ps_getcreateangle(float f) => ANGLE_TAG(f) cdef ps_getmode(int mode) => TOOL_TAG(mode) cdef ps_getselect(int x, int y) => SELECT_TAG(x, y) cdef ps_getadjust(int x, int y) => ADJUST_TAG(x, y) cdef ps_getkey(int key) => KEY_TAG(key) cdef ps_getprop(int key) => PROP_TAG(key) cdef ps_getdamage(int x0, int y0, int x1, int y1) => DAMAGE_TAG(x0, y0, x1, y1) cdef ps_getint(int i) => (i) cdef ps_getfloat(float f) => (f) cdef ps_polyline(int count) moveto count { lineto } repeat stroke cdef ps_sendpoint(int x, int y) x y cdef ps_doclick() currentcanvas createoverlay setcanvas getclick CLICK_TAG tagprint exch typedprint typedprint pstack SHAR_EOF fi if test -f 'draw.ps' then echo shar: "will not over-write existing file 'draw.ps'" else cat << \SHAR_EOF > 'draw.ps' %! % % $Header: draw.ps,v 1.7 88/12/02 10:43:15 bvs Exp $ % Copyright (C) 1988 by Sun Microsystems. All rights reserved. % /XNeWS? where { pop } { /XNeWS? false def } ifelse /pathscale { % x1 y1 x2 y2 => w h %% 4 copy (pathscale % % % % \n) [ 6 2 roll ] dbgprintf exch 4 1 roll sub neg 3 1 roll sub exch } def /ShowFillWindow { { newprocessgroup 10 dict begin /FillWindow framebuffer /new DrawWindow send def 100 400 400 200 /reshape FillWindow send /map FillWindow send /FillWindow null def end } fork AddProcess } def /DrawWindow DefaultWindow dictbegin /FrameKbdMgr null def /ScratchCanvas null def /X0 null def /Y0 null def /X1 null def /Y1 null def /XCenter null def /YCenter null def /Theta null def dictend classbegin /FrameLabel (NewsDraw) def /PaintClient { DAMAGE_TAG tagprint clippath pathbbox % 4 copy (send damage % % % %\n) [ 6 2 roll ] dbgprintf 4 -1 roll typedprint 3 -1 roll typedprint 2 -1 roll typedprint typedprint } def /DefaultRotateInteractive { % x0 y0 proc -> angle gsave ClientCanvas createoverlay setcanvas getanimated waitprocess aload pop ANGLE_TAG tagprint YCenter sub exch XCenter sub exch atan Theta exch sub typedprint grestore } def /rotateInteractive { % angle xinit yinit x0 y0 x1 y1 => angle /Y1 exch def /X1 exch def /Y0 exch def /X0 exch def /YCenter exch def /XCenter exch def % xinit yinit YCenter sub exch XCenter sub exch atan /Theta exch def % /Theta X1 X0 sub Y1 Y0 sub atan def % (theta is %\n) [ Theta ] dbgprintf Theta add /Theta exch def % (theta changed to %\n) [ Theta ] dbgprintf XCenter YCenter { matrix currentmatrix x0 y0 translate x x0 sub y y0 sub atan Theta exch sub rotate x0 neg y0 neg translate % avoid drawing 0 width rectangle! X0 X1 eq Y0 Y1 eq or { X0 Y0 moveto X1 Y1 lineto } { X0 Y0 moveto X0 Y1 lineto X1 Y1 lineto X1 Y0 lineto closepath} ifelse setmatrix } DefaultRotateInteractive } def /DefaultCreateInteractive { % x0 y0 proc -> x0 y0 x1 y1 gsave ClientCanvas createoverlay setcanvas getanimated waitprocess aload pop POINT_TAG tagprint exch typedprint typedprint grestore } def /lineCreateInteractive { % x y { x y lineto } DefaultCreateInteractive } def /rectCreateInteractive { % x y { x0 y lineto x y lineto x y0 lineto x0 y0 lineto } DefaultCreateInteractive } def /circCreateInteractive { % x y { newpath x0 x add 2 div y0 y add 2 div % x y x0 x sub dup mul y0 y sub dup mul add sqrt 2 div % r 0 360 arc } DefaultCreateInteractive } def /ovalCreateInteractive { % x y { newpath matrix currentmatrix x0 y0 translate x x0 sub y y0 sub scale .5 .5 .5 0 360 arc setmatrix } DefaultCreateInteractive } def /PencilDoitInteractive % x y -> points... length { 10 dict begin /y exch def /x exch def x y moveto /pointlist [ y x ] def /stopevt createevent def stopevt begin /Action UpTransition def end /evt createevent def evt begin /Name MouseDragged def end stopevt expressinterest evt expressinterest /pointlist [ pointlist aload pop %% add first 2 points { awaitevent begin Action UpTransition eq { exit } if XLocation YLocation lineto currentpoint stroke moveto YLocation XLocation % add another point end pause } loop ] def stopevt revokeinterest evt revokeinterest [ pointlist aload pop pointlist length ] end } def /pencilCreateInteractive { % x y gsave ClientCanvas setcanvas { PencilDoitInteractive } fork waitprocess aload pop POINT_TAG tagprint 0 0 typedprint typedprint dup 2 div typedprint { typedprint } repeat grestore } def /rectMoveInteractive { % xinit yinit angle x0 y0 x1 y1 /Y1 exch def /X1 exch def /Y0 exch def /X0 exch def /Theta exch def /XCenter X0 X1 add 2 div def /YCenter Y0 Y1 add 2 div def { matrix currentmatrix x x0 sub y y0 sub translate XCenter YCenter translate Theta rotate XCenter neg YCenter neg translate X0 X1 eq Y0 Y1 eq or { X0 Y0 moveto X1 Y1 lineto } { X0 Y0 moveto X0 Y1 lineto X1 Y1 lineto X1 Y0 lineto closepath } ifelse setmatrix } DefaultCreateInteractive } def /ClientMenu [ (Move) { TOOL_TAG tagprint STRETCH_MODE typedprint } (Rotate) { TOOL_TAG tagprint ROTATE_MODE typedprint } (Brush) { TOOL_TAG tagprint BRUSH_MODE typedprint } (Line) { TOOL_TAG tagprint LINE_MODE typedprint } (Box) { TOOL_TAG tagprint RECT_MODE typedprint } (Oval) { TOOL_TAG tagprint OVAL_MODE typedprint } (Circle){ TOOL_TAG tagprint CIRC_MODE typedprint } (Polygon) { TOOL_TAG tagprint POLY_MODE typedprint } (Text) { TOOL_TAG tagprint TEXT_MODE typedprint } ] /new DefaultMenu send def /new { /new super send begin /ScratchCanvas framebuffer newcanvas def ScratchCanvas /Retained true put % ScratchCanvas /Mapped true put gsave ScratchCanvas setcanvas 0 0 0 rgbcolor fillcanvas 0 0 movecanvas grestore currentdict end } def /destroy { /ScratchCanvas null def /destroy super send } def /savearea { % x y w h %% 4 copy (save area % % % %\n) [ 6 2 roll ] dbgprintf gsave newpath rectpath ScratchCanvas reshapecanvas % scale ScratchCanvas by w/h of ClientCanvas ClientCanvas setcanvas clippath pathbbox pathscale % w h ScratchCanvas setcanvas 0 0 movecanvas 0 0 0 rgbcolor fillcanvas % X11NEWS BUG!!! XNeWS? { pop pop } { scale } ifelse ClientCanvas imagecanvas grestore } def /restorearea { %% (restore area %\n) [ ScratchCanvas ] dbgprintf gsave ScratchCanvas setcanvas clippath pathbbox pathscale pathbbox pop pop % w h x y ClientCanvas setcanvas % X11NEWS BUG!!! XNeWS? { pop pop pop pop } { translate scale } ifelse ScratchCanvas imagecanvas grestore } def classend def /sendmouse { Action /DownTransition eq { tagprint XLocation typedprint YLocation typedprint } { pop } ifelse } def /AddProcess { } def /AcceptFocus { } def /RestoreFocus { } def /DeSelect { } def /LeftMouseButton { SELECT_TAG sendmouse } def /MiddleMouseButton { ADJUST_TAG sendmouse } def /KeyStroke { KEY_TAG tagprint typedprint } def /fontsetup { % font font index setfileinputtoken 0 tagprint dup setfont begin currentdict dup fontheight typedprint fontdescent typedprint WidthArray dup length typedprint aload length 2 div { pop typedprint } repeat end } def % % Main...such as it is % /Times-Roman findfont 36 scalefont setfont /win framebuffer /new DrawWindow send def % Create a window 100 100 8 72 mul 32 add dup /reshape win send /map win send /activate win send win begin ClientCanvas setcanvas end { win begin ClientCanvas addkbdinterests /MouseDict 5 dict begin /LeftMouseButton dup def /MiddleMouseButton dup def currentdict end def createevent begin /Canvas ClientCanvas def /Name MouseDict def currentdict end expressinterest { clear awaitevent begin ClientCanvas setcanvas { Name type /integertype eq { Name KeyStroke } { Name cvx exec } ifelse } exec%stopped end } loop } fork SHAR_EOF fi if test -f 'menubar.ps' then echo shar: "will not over-write existing file 'menubar.ps'" else cat << \SHAR_EOF > 'menubar.ps' %! % % $Header: menubar.ps,v 1.7 88/12/02 11:36:56 bvs Exp $ % Copyright (C) 1988 by Sun Microsystems. All rights reserved. % systemdict begin systemdict /Item known not { (NeWS/liteitem.ps) run } if systemdict /SimpleScrollbar known not { (NeWS/liteitem.ps) run } if end /BarMenu DefaultMenu [] classbegin /CenterItems? false def classend def /MenuBar Object dictbegin /X null def /Y null def /Gap null def /MenuBarCanvas null def /Items [] def /ItemMgr null def dictend classbegin /new { % x y gap canvas -> - /new super send begin /MenuBarCanvas exch def /Gap exch def /Y exch def /X exch def %% (new: % % % %\n) [ MenuBarCanvas Gap Y X ] dbgprintf currentdict end } def /addmenu { % menu name proc -> - %% (addmenu: % % % %\n) [ MenuBarCanvas Gap Y X ] dbgprintf MenuBarCanvas 0 0 /new MenuItem send % item dup Items 999 3 -1 roll arrayinsert /Items exch def dup X Y /move 4 -1 roll send % item dup /bbox exch send pop % x y width X add Gap add /X exch def pop pop } def /activate { /ItemMgr Items forkitems def } def /paint { Items paintitems } def classend def /MenuItem ButtonItem [ /Menu null def ] classbegin /new { /new super send begin /Menu exch def % disgusting hack!! not my fault! blame ButtonItem!! /ItemRadius 6 def /ItemFrame 1 def /ItemBorder 1 def /ItemGap 2 def currentdict end } def /ItemButton [ RightMouseButton ] def /ClientDown { %% (client down\n) [] dbgprintf true SetButtonValue framebuffer setcanvas ItemCanvas getcanvaslocation /showat Menu send } def /ClientUp { %% (client up\n) [] dbgprintf pause % let the menu die! false SetButtonValue /ItemValue null store StopItem } def /ClientEnter { %% (client enter\n) [] dbgprintf } def /ClientExit { %% (client exit\n) [] dbgprintf } def /setmenu { % menu => - /Menu exch def } def /getmenu { % menu => - Menu } def classend def /MenuBarWindow DefaultWindow dictbegin /MenuBarItem null def dictend classbegin /MenuBarSize 30 def /ShapeClientCanvas { % - => - ([Re]set client canvas' shape) ClientCanvas null ne { gsave FrameCanvas setcanvas BorderLeft BorderBottom translate 0 0 ClientWidth ClientHeight MenuBarSize sub ClientPath ClientCanvas reshapecanvas grestore } if } def /PaintFrameBorder { % - => - (Paint frame border areas) FrameFillColor fillcanvas FrameBorderColor strokecanvas BorderLeft .5 sub BorderBottom .5 sub FrameWidth BorderLeft BorderRight add sub 1 add FrameHeight BorderBottom BorderTop add sub 1 add FramePath stroke BorderLeft .5 sub BorderBottom .5 sub FrameWidth BorderLeft BorderRight add sub 1 add FrameHeight BorderBottom BorderTop add sub 1 add MenuBarSize sub FramePath stroke /paint MenuBarItem send } def /activate { /MenuBarItem BorderLeft 5 add FrameHeight BorderTop sub MenuBarSize sub 5 add 5 % gap! FrameCanvas /new MenuBar send def [ (About NewsDraw...) { currentcursorlocation [ ( NewsDraw consists of about 500 lines of NeWS and about 2000 lines of C. ) ( NewsDraw is intended as a demonstration of the proper way to spit a NeWS) ( application into client and server sections. NewsDraw also demonstrates) ( how the PostScript imaging model allows text and graphics to be treated) ( with equal ease.) () ( Bruce V. Schwartz) ( bvs@sun.com ) ( \(c\) 1988 Sun Microsystems) ] popmsg } ] /new BarMenu send (Info ) {} /addmenu MenuBarItem send [ (Open NewsDraw "file.nd") { PROP_TAG tagprint READ_KEY typedprint } (Save NewsDraw "file.nd") { PROP_TAG tagprint WRITE_KEY typedprint } (Save PostScript "newsdraw.ps") { PROP_TAG tagprint PRINT_KEY typedprint } ] /new BarMenu send (File) {} /addmenu MenuBarItem send [ (Move) { TOOL_TAG tagprint STRETCH_MODE typedprint } (Rotate) { TOOL_TAG tagprint ROTATE_MODE typedprint } (Brush) { TOOL_TAG tagprint BRUSH_MODE typedprint } (Line) { TOOL_TAG tagprint LINE_MODE typedprint } (Box) { TOOL_TAG tagprint RECT_MODE typedprint } (Oval) { TOOL_TAG tagprint OVAL_MODE typedprint } (Circle){ TOOL_TAG tagprint CIRC_MODE typedprint } (Polygon) { TOOL_TAG tagprint POLY_MODE typedprint } (Text) { TOOL_TAG tagprint TEXT_MODE typedprint } ] /new BarMenu send (Mode) {} /addmenu MenuBarItem send [ (To Top) { PROP_TAG tagprint TOTOP_KEY typedprint } (To Bottom) { PROP_TAG tagprint TOBOT_KEY typedprint } (Redraw) { PROP_TAG tagprint REDRAW_KEY typedprint } ] /new BarMenu send (Misc) {} /addmenu MenuBarItem send [ (1) { PROP_TAG tagprint WIDTH_KEY typedprint 1 typedprint } (2) { PROP_TAG tagprint WIDTH_KEY typedprint 2 typedprint } (3) { PROP_TAG tagprint WIDTH_KEY typedprint 3 typedprint } (4) { PROP_TAG tagprint WIDTH_KEY typedprint 4 typedprint } (5) { PROP_TAG tagprint WIDTH_KEY typedprint 5 typedprint } (6) { PROP_TAG tagprint WIDTH_KEY typedprint 6 typedprint } (7) { PROP_TAG tagprint WIDTH_KEY typedprint 7 typedprint } (8) { PROP_TAG tagprint WIDTH_KEY typedprint 8 typedprint } (9) { PROP_TAG tagprint WIDTH_KEY typedprint 9 typedprint } (10) { PROP_TAG tagprint WIDTH_KEY typedprint 10 typedprint } ] /new BarMenu send (Line Width) {} /addmenu MenuBarItem send [ (none) { PROP_TAG tagprint STROKE_KEY typedprint -1.0 typedprint } (white) { PROP_TAG tagprint STROKE_KEY typedprint 1.0 typedprint } (light gray) { PROP_TAG tagprint STROKE_KEY typedprint .75 typedprint } (medium gray) { PROP_TAG tagprint STROKE_KEY typedprint .50 typedprint } (dark gray) { PROP_TAG tagprint STROKE_KEY typedprint .25 typedprint } (black) { PROP_TAG tagprint STROKE_KEY typedprint 0.0 typedprint } ] /new BarMenu send (Outline) {} /addmenu MenuBarItem send [ (none) { PROP_TAG tagprint FILL_KEY typedprint -1.0 typedprint } (white) { PROP_TAG tagprint FILL_KEY typedprint 1.0 typedprint } (light gray) { PROP_TAG tagprint FILL_KEY typedprint .75 typedprint } (medium gray) { PROP_TAG tagprint FILL_KEY typedprint .50 typedprint } (dark gray) { PROP_TAG tagprint FILL_KEY typedprint .25 typedprint } (black) { PROP_TAG tagprint FILL_KEY typedprint 0.0 typedprint } ] /new BarMenu send (Fill) {} /addmenu MenuBarItem send [ (white) { PROP_TAG tagprint TEXT_KEY typedprint 1.0 typedprint } (light gray) { PROP_TAG tagprint TEXT_KEY typedprint .75 typedprint } (medium gray) { PROP_TAG tagprint TEXT_KEY typedprint .50 typedprint } (dark gray) { PROP_TAG tagprint TEXT_KEY typedprint .25 typedprint } (black) { PROP_TAG tagprint TEXT_KEY typedprint 0.0 typedprint } ] /new BarMenu send (Text) {} /addmenu MenuBarItem send /activate MenuBarItem send { createevent begin /Canvas ClientCanvas def /Name [ /LeftMouseButton /MiddleMouseButton ] def currentdict end expressinterest { clear awaitevent begin end } loop } fork pop } def classend def /DefaultWindow MenuBarWindow def %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Dec 21 00:50:10 1988 Date: Wed, 21 Dec 88 00:50:10 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw 4/5 From: carlisle!bvs@sun.com (Bruce Schwartz) 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: # circ.c # line.c # oval.c # rect.c # text.c # poly.c # This archive created: Fri Dec 16 15:05:53 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'circ.c' then echo shar: "will not over-write existing file 'circ.c'" else cat << \SHAR_EOF > 'circ.c' /* $Header: circ.c,v 1.3 88/12/02 10:43:36 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "go.h" #include "gopvt.h" /* circ section */ typedef struct { ITEMHEADER; } ICIRC; static void *CircHolder() { return((ICIRC *)malloc(sizeof(ICIRC))); } extern double sqrt(); static void *CircNew(x0, y0, x1, y1) int x0, y0, x1, y1; { ICIRC *pitem = (ICIRC *)malloc(sizeof(ICIRC)); double xlen = (double)((x0 - x1)/2); double ylen = (double)((y0 - y1)/2); double xcenter = (double)((x0 + x1)/2); double ycenter = (double)((y0 + y1)/2); double radius = (int)sqrt((double)(xlen*xlen + ylen*ylen)); pitem->type = CIRC; pitem->x0 = xcenter - radius; pitem->y0 = ycenter - radius; pitem->x1 = xcenter + radius; pitem->y1 = ycenter + radius; pitem->rotation = 0; pitem->xscale = 1; pitem->yscale = 1; pitem->prop = PropCopyOf(PropCurrent()); return(pitem); } static void *CircDraw(pitem) ICIRC *pitem; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); ps_gsave(); if(fill >= 0.0) { ps_setgray(fill); ps_drawcirc((X0 + X1)/2, (Y0 + Y1)/2, (X1 - X0)/2); ps_fill(); } if(stroke >= 0.0) { ps_setlinewidth(width); ps_setgray(stroke); ps_drawcirc((X0 + X1)/2, (Y0 + Y1)/2, (X1 - X0)/2); ps_stroke(); } ps_grestore(); return(pitem); } static void *CircPrint(pitem, pfile) ICIRC *pitem; FILE *pfile; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); fprintf(pfile, "%% circle\n"); if(fill >= 0.0) { fprintf(pfile, "%f setgray ", fill); fprintf(pfile, "%d %d %d circpath ", (X0 + X1)/2, (Y0 + Y1)/2, (X1 - X0)/2); fprintf(pfile, "fill\n"); } if(stroke >= 0.0) { fprintf(pfile, "%d setlinewidth ", width); fprintf(pfile, "%f setgray ", stroke); fprintf(pfile, "%d %d %d circpath ", (X0 + X1)/2, (Y0 + Y1)/2, (X1 - X0)/2); fprintf(pfile, "stroke\n"); } return(pitem); } GOCircInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= CircHolder; pgoprocs->new = CircNew; pgoprocs->draw = CircDraw; pgoprocs->print = CircPrint; } /************* event handlers *************/ static void *CircSelect(x, y) int x,y; { ps_circcreateinteractive(x, y); } static void *CircAdjust(x, y) int x,y; { fprintf(stderr, "CircAdjust not implemented\n"); } static void *CircReply(x0, y0, x1, y1) int x0, y0, x1, y1; { /* maybe we should just make this an oval! */ ITEM *pitem; if((x0 == x1) && (y0 == y1)) return; pitem = GONewCirc(x0, y0, x1, y1); GOItemAddToTop(pitem); GODrawItem(pitem); return(pitem); } static void *CircBegin() { ps_xcursor(); } EHCircInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = CircSelect; pprocs->handleadjust = CircAdjust; pprocs->handlereply = CircReply; pprocs->handlebegin = CircBegin; } SHAR_EOF fi if test -f 'line.c' then echo shar: "will not over-write existing file 'line.c'" else cat << \SHAR_EOF > 'line.c' /* $Header: line.c,v 1.3 88/12/02 10:43:37 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include #include "go.h" #include "gopvt.h" /* line section */ typedef struct { ITEMHEADER; } ILINE; static void *LineHolder() { return((ILINE *)malloc(sizeof(ILINE))); } #define SQUARE(x) ((x)*(x)) static void *LineNew(x0, y0, x1, y1) int x0, y0, x1, y1; { double length = sqrt((double)(SQUARE(x0 - x1) + SQUARE(y0 - y1))); ILINE *pitem = (ILINE *)malloc(sizeof(ILINE)); pitem->type = LINE; pitem->rotation = atan2((double)(y1 - y0), (double)(x1 - x0)) * 180.0 / M_PI; pitem->x0 = (int)(((double)x0 + (double)x1 - length) / 2.0); pitem->y0 = (y0 + y1) / 2; pitem->x1 = pitem->x0 + length; pitem->y1 = pitem->y0; pitem->xscale = 1; pitem->yscale = 1; pitem->prop = PropCopyOf(PropCurrent()); return(pitem); } static void *LineDraw(pitem) ILINE *pitem; { float stroke = PropStrokeColor(pitem->prop); int width = PropLineWidth(pitem->prop); ps_gsave(); if(stroke >= 0.0) { ps_setlinewidth(width); ps_setgray(stroke); ps_drawline(X0, Y0, X1, Y1); ps_stroke(); } ps_grestore(); return(pitem); } static void *LinePrint(pitem, pfile) ILINE *pitem; FILE *pfile; { float stroke = PropStrokeColor(pitem->prop); int width = PropLineWidth(pitem->prop); fprintf(pfile, "%% line\n"); if(stroke >= 0.0) { fprintf(pfile, "%d setlinewidth ", width); fprintf(pfile, "%f setgray ", stroke); fprintf(pfile, "%d %d %d %d linepath ", X0, Y0, X1, Y1); fprintf(pfile, "stroke\n"); } return(pitem); } GOLineInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= LineHolder; pgoprocs->new = LineNew; pgoprocs->draw = LineDraw; pgoprocs->print = LinePrint; } /************* event handlers *************/ static void *LineSelect(x, y) int x,y; { ps_linecreateinteractive(x, y); } static void *LineAdjust(x, y) int x,y; { fprintf(stderr, "LineAdjust not implemented\n"); } static void *LineReply(x0, y0, x1, y1) int x0, y0, x1, y1; { ITEM *pitem; if((x0 == x1) && (y0 == y1)) return; pitem = GONewLine(x0, y0, x1, y1); GOItemAddToTop(pitem); GODrawItem(pitem); return(pitem); } static void *LineBegin() { ps_xcursor(); } EHLineInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = LineSelect; pprocs->handleadjust = LineAdjust; pprocs->handlereply = LineReply; pprocs->handlebegin = LineBegin; } SHAR_EOF fi if test -f 'oval.c' then echo shar: "will not over-write existing file 'oval.c'" else cat << \SHAR_EOF > 'oval.c' /* $Header: oval.c,v 1.3 88/12/02 10:43:39 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "go.h" #include "gopvt.h" /* oval section */ typedef struct { ITEMHEADER; } IOVAL; static void *OvalHolder() { return((IOVAL *)malloc(sizeof(IOVAL))); } static void *OvalNew(x0, y0, x1, y1) int x0, y0, x1, y1; { IOVAL *pitem = (IOVAL *)malloc(sizeof(IOVAL)); pitem->type = OVAL; pitem->x0 = MIN(x0, x1); pitem->y0 = MIN(y0, y1); pitem->x1 = MAX(x0, x1); pitem->y1 = MAX(y0, y1); pitem->rotation = 0; pitem->xscale = 1; pitem->yscale = 1; pitem->prop = PropCopyOf(PropCurrent()); return(pitem); } static void *OvalDraw(pitem) IOVAL *pitem; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); ps_gsave(); if(fill >= 0.0) { ps_setgray(fill); ps_drawoval(X0, Y0, X1, Y1); ps_fill(); } if(stroke >= 0.0) { ps_setlinewidth(width); ps_setgray(stroke); ps_drawoval(X0, Y0, X1, Y1); ps_stroke(); } ps_grestore(); return(pitem); } static void *OvalPrint(pitem, pfile) IOVAL *pitem; FILE *pfile; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); fprintf(pfile, "%% oval\n"); if(fill >= 0.0) { fprintf(pfile, "%f setgray ", fill); fprintf(pfile, "%d %d %d %d ovalpath ", X0, Y0, W, H); fprintf(pfile, "fill\n"); } if(stroke >= 0.0) { fprintf(pfile, "%d setlinewidth ", width); fprintf(pfile, "%f setgray ", stroke); fprintf(pfile, "%d %d %d %d ovalpath ", X0, Y0, W, H); fprintf(pfile, "stroke\n"); } return(pitem); } GOOvalInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= OvalHolder; pgoprocs->new = OvalNew; pgoprocs->draw = OvalDraw; pgoprocs->print = OvalPrint; } /************* event handlers *************/ static void *OvalSelect(x, y) int x,y; { ps_ovalcreateinteractive(x, y); } static void *OvalAdjust(x, y) int x,y; { fprintf(stderr, "OvalAdjust not implemented\n"); } static void *OvalReply(x0, y0, x1, y1) int x0, y0, x1, y1; { ITEM *pitem; if((x0 == x1) && (y0 == y1)) return; pitem = GONewOval(x0, y0, x1, y1); GOItemAddToTop(pitem); GODrawItem(pitem); return(pitem); } static void *OvalBegin() { ps_xcursor(); } EHOvalInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = OvalSelect; pprocs->handleadjust = OvalAdjust; pprocs->handlereply = OvalReply; pprocs->handlebegin = OvalBegin; } SHAR_EOF fi if test -f 'rect.c' then echo shar: "will not over-write existing file 'rect.c'" else cat << \SHAR_EOF > 'rect.c' /* $Header: rect.c,v 1.4 88/12/02 10:43:24 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "go.h" #include "gopvt.h" /* rect section */ typedef struct { ITEMHEADER; } IRECT; static void *RectHolder() { return((IRECT *)malloc(sizeof(IRECT))); } static void *RectNew(x0, y0, x1, y1) int x0, y0, x1, y1; { IRECT *pitem = (IRECT *)RectHolder(); pitem->type = RECT; pitem->x0 = MIN(x0, x1); pitem->y0 = MIN(y0, y1); pitem->x1 = MAX(x0, x1); pitem->y1 = MAX(y0, y1); pitem->rotation = 0; pitem->xscale = 1; pitem->yscale = 1; pitem->prop = PropCopyOf(PropCurrent()); return(pitem); } static void *RectDraw(pitem) IRECT *pitem; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); ps_gsave(); if(fill >= 0.0) { ps_setgray(fill); ps_drawrect(X0, Y0, X1, Y1); ps_fill(); } if(stroke >= 0.0) { ps_setlinewidth(width); ps_setgray(stroke); ps_drawrect(X0, Y0, X1, Y1); ps_stroke(); } ps_grestore(); return(pitem); } static void *RectPrint(pitem, pfile) IRECT *pitem; FILE *pfile; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); fprintf(pfile, "%% rectangle\n"); if(fill >= 0.0) { fprintf(pfile, "%f setgray ", fill); fprintf(pfile, "%d %d %d %d rectpath ", X0, Y0, W, H); fprintf(pfile, "fill\n"); } if(stroke >= 0.0) { fprintf(pfile, "%d setlinewidth ", width); fprintf(pfile, "%f setgray ", stroke); fprintf(pfile, "%d %d %d %d rectpath ", X0, Y0, W, H); fprintf(pfile, "stroke\n"); } return(pitem); } GORectInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= RectHolder; pgoprocs->new = RectNew; pgoprocs->draw = RectDraw; pgoprocs->print = RectPrint; } /************* event handlers *************/ static void *RectSelect(x, y) int x,y; { ps_rectcreateinteractive(x, y); } static void *RectAdjust(x, y) int x,y; { fprintf(stderr, "RectAdjust not implemented\n"); } static void *RectReply(x0, y0, x1, y1) int x0, y0, x1, y1; { ITEM *pitem; if((x0 == x1) && (y0 == y1)) return; pitem = GONewRect(x0, y0, x1, y1); GOItemAddToTop(pitem); GODrawItem(pitem); return(pitem); } static void *RectBegin() { ps_xcursor(); } EHRectInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = RectSelect; pprocs->handleadjust = RectAdjust; pprocs->handlereply = RectReply; pprocs->handlebegin = RectBegin; } SHAR_EOF fi if test -f 'text.c' then echo shar: "will not over-write existing file 'text.c'" else cat << \SHAR_EOF > 'text.c' /* $Header: text.c,v 1.3 88/12/02 10:43:41 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "go.h" #include "gopvt.h" /* text section */ typedef struct { ITEMHEADER; char *ptext; } ITEXT; static void *TextHolder() { return((ITEXT *)malloc(sizeof(ITEXT))); } extern double sqrt(); static void *TextNew(x0, y0, ptext) int x0, y0; char *ptext; { ITEXT *pitem = (ITEXT *)malloc(sizeof(ITEXT)); pitem->prop = PropCopyOf(PropCurrent()); pitem->type = TEXT; pitem->rotation = 0; pitem->xscale = 1; pitem->yscale = 1; pitem->ptext = (char *)malloc(strlen(ptext)); strcpy(pitem->ptext, ptext); pitem->y0 = y0 - FontDescent(PropFont(pitem->prop)); pitem->y1 = y0 + FontAscent(PropFont(pitem->prop)); pitem->x0 = x0; pitem->x1 = x0 + FontTextWidth(PropFont(pitem->prop), ptext); return(pitem); } static void *TextDraw(pitem) ITEXT *pitem; { float text = PropTextColor(pitem->prop); FONT *pfont = PropFont(pitem->prop); ps_gsave(); if(text >= 0.0) { ps_setgray(text); ps_moveto(pitem->x0, pitem->y0 + FontDescent(pfont)); ps_show(pitem->ptext); } ps_grestore(); return(pitem); } static void *TextPrint(pitem, pfile) ITEXT *pitem; FILE *pfile; { float text = PropTextColor(pitem->prop); FONT *pfont = PropFont(pitem->prop); if(text >= 0.0) { fprintf(pfile, "%f setgray ", text); fprintf(pfile, "%d %d moveto ", pitem->x0, pitem->y0 + FontDescent(pfont)); fprintf(pfile, "(%s) show\n", pitem->ptext); } return(pitem); } static void *TextWrite(pitem, pfile) ITEXT *pitem; FILE *pfile; { char *pc; pc = pitem->ptext; while((*pc != 0) && (*pc != '\n') && (*pc != 10)) { fputc(*pc, pfile); pc++; } fputc('\n', pfile); /* fprintf(pfile, "%s\n", pitem->ptext); */ } static void *TextRead(pitem, pfile) ITEXT *pitem; FILE *pfile; { char buf[256]; fgets(buf, 256, pfile); pitem->ptext = (char *)malloc(strlen(buf)); strcpy(pitem->ptext, buf); } GOTextInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= TextHolder; pgoprocs->new = TextNew; pgoprocs->draw = TextDraw; pgoprocs->print = TextPrint; pgoprocs->write = TextWrite; pgoprocs->read = TextRead; } /************* event handlers *************/ static int iText = 0; static char aText[255]; static int textx, texty; static int bSaved = 0; static void *TextBegin() { ps_xcursor(); } static void *TextSelect(x, y) int x,y; { int ascent = FontAscent(FontDefault()); int descent = FontDescent(FontDefault()); if(iText != 0) { TextComplete(); } iText = 0; aText[0] = 0; textx = x; texty = y; if(bSaved) ps_restorearea(); ps_savearea(textx - 6, texty - descent - 1, 1000, texty + ascent + 1); /* ps_savearea(0, 0, 1000, 1000); */ bSaved = 1; ps_setgray(1.0); ps_drawrect(textx - 4, texty - descent - 1, textx + 4, texty + ascent + 1); ps_fill(); ps_setgray(0.0); ps_drawline(textx, texty - descent, textx, texty + ascent); ps_drawline(textx - 3, texty, textx + 3, texty); ps_stroke(); } static void *TextAdjust(x, y) int x,y; { fprintf(stderr, "TextAdjust not implemented\n"); } static void *TextKey(key) int key; { int ascent = FontAscent(FontDefault()); int descent = FontDescent(FontDefault()); /* fprintf(stderr, "TextKey %c (0x%x)\n", key, key); */ switch(key) { default: aText[iText] = key; iText++; aText[iText] = 0; break; case 0177: case '\b': if(iText) { iText--; aText[iText] = 0; } break; } ps_restorearea(); ps_setgray(PropTextColor(PropCurrent())); ps_moveto(textx, texty); ps_show(aText); ps_rlineto(0, ascent); ps_rlineto(0, -ascent - descent); ps_rmoveto(0, descent); ps_rmoveto(-3, 0); ps_rlineto(6, 0); ps_stroke(); } static TextComplete() { ITEM *pitem; ps_restorearea(); bSaved = 0; pitem = GONewText(textx, texty, aText, FontDefault()); GOItemAddToTop(pitem); GODrawItem(pitem); /* ps_moveto(textx, texty); ps_show(aText); */ iText = 0; aText[0] = 0; } static void *TextEnd() { if(iText) TextComplete(); else if(bSaved) ps_restorearea(); } static void *TextProp(c) int c; { PropHandle(c); if(iText != 0) { ps_setgray(PropTextColor(PropCurrent())); ps_moveto(textx, texty); ps_show(aText); } } EHTextInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = TextSelect; pprocs->handleadjust = TextAdjust; pprocs->handlekey = TextKey; pprocs->handlebegin = TextBegin; pprocs->handleend = TextEnd; pprocs->handleprop = TextProp; } SHAR_EOF fi if test -f 'poly.c' then echo shar: "will not over-write existing file 'poly.c'" else cat << \SHAR_EOF > 'poly.c' /* $Header: poly.c,v 1.2 88/12/02 10:43:49 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include #include "go.h" #include "gopvt.h" /* poly section */ typedef struct { int x; int y; } POINT; typedef struct { ITEMHEADER; POINT *apoint; int length; int closepath; } IPOLY; static void *PolyHolder() { return((IPOLY *)malloc(sizeof(IPOLY))); } static PolyMinMax(pitem, apoint, length) IPOLY *pitem; POINT apoint[]; int length; { int i; int x0 = apoint[0].x; int y0 = apoint[0].y; int x1 = x0; int y1 = y0; /* find bounds */ for(i = 1; i < length; i++) { x0 = MIN(x0, apoint[i].x); y0 = MIN(y0, apoint[i].y); x1 = MAX(x1, apoint[i].x); y1 = MAX(y1, apoint[i].y); } /* make relative */ for(i = length - 1; i > 0; i--) { apoint[i].x -= apoint[i - 1].x; apoint[i].y -= apoint[i - 1].y; } apoint[0].x -= x0; apoint[0].y -= y0; pitem->x0 = x0; pitem->y0 = y0; pitem->x1 = x1; pitem->y1 = y1; pitem->apoint = apoint; pitem->length = length; } static void *PolyNew(apoint, length, closepath) POINT apoint[]; /* apoint will not be copied by this proc! */ int length; int closepath; { IPOLY *pitem = (IPOLY *)PolyHolder(); pitem->type = POLY; pitem->rotation = 0; pitem->closepath= closepath; /* take care of x0,y0,x1,y1 */ PolyMinMax(pitem, apoint, length); pitem->xscale = 1; pitem->yscale = 1; pitem->prop = PropCopyOf(PropCurrent()); return(pitem); } static void *PolyDraw(pitem) IPOLY *pitem; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); int i; ps_gsave(); if(fill >= 0.0) { ps_setgray(fill); ps_moveto(pitem->x0, pitem->y0); ps_rmoveto(pitem->apoint[0].x, pitem->apoint[0].y); for(i = 1; i < pitem->length; i++) ps_rlineto(pitem->apoint[i].x, pitem->apoint[i].y); ps_closepath(); ps_fill(); } if(stroke >= 0.0) { ps_setlinewidth(width); ps_setgray(stroke); ps_moveto(pitem->x0, pitem->y0); ps_rmoveto(pitem->apoint[0].x, pitem->apoint[0].y); for(i = 1; i < pitem->length; i++) ps_rlineto(pitem->apoint[i].x, pitem->apoint[i].y); if(pitem->closepath) ps_closepath(); ps_stroke(); } ps_grestore(); return(pitem); } static void *PolyPrint(pitem, pfile) IPOLY *pitem; FILE *pfile; { float stroke = PropStrokeColor(pitem->prop); float fill = PropFillColor(pitem->prop); int width = PropLineWidth(pitem->prop); int i; fprintf(pfile, "%% poly\n"); if(fill >= 0.0) { fprintf(pfile, "%f setgray ", fill); fprintf(pfile, "%d %d moveto ", pitem->x0, pitem->y0); fprintf(pfile, "%d %d rmoveto ", pitem->apoint[0].x, pitem->apoint[0].y); fprintf(pfile, "\n"); for(i = 1; i < pitem->length; i++) { fprintf(pfile, "%d %d rlineto \n", pitem->apoint[i].x, pitem->apoint[i].y); } fprintf(pfile, "closepath fill\n"); } if(stroke >= 0.0) { fprintf(pfile, "%d setlinewidth ", width); fprintf(pfile, "%f setgray ", stroke); fprintf(pfile, "%d %d moveto ", pitem->x0, pitem->y0); fprintf(pfile, "%d %d rmoveto ", pitem->apoint[0].x, pitem->apoint[0].y); fprintf(pfile, "\n"); for(i = 1; i < pitem->length; i++) { fprintf(pfile, "%d %d rlineto ", pitem->apoint[i].x, pitem->apoint[i].y); } if(pitem->closepath) fprintf(pfile, "closepath "); fprintf(pfile, "stroke\n"); } return(pitem); } static void *PolyWrite(pitem, pfile) IPOLY *pitem; FILE *pfile; { int i; fprintf(pfile, "%d ", pitem->closepath); fprintf(pfile, "%d\n", pitem->length); for(i = 0; i < pitem->length; i++) fprintf(pfile, "%d %d\n", pitem->apoint[i].x, pitem->apoint[i].y); } static void *PolyRead(pitem, pfile) IPOLY *pitem; FILE *pfile; { int i; if(1 != fscanf(pfile, "%d", &pitem->closepath)) { fprintf(stderr, "Error reading poly...exiting"); exit(1); } if(1 != fscanf(pfile, "%d", &pitem->length)) { fprintf(stderr, "Error reading poly...exiting"); exit(1); } pitem->apoint = (POINT *)malloc(pitem->length * sizeof(POINT)); for(i = 0; i < pitem->length; i++) { if(2 != fscanf(pfile, "%d %d", &pitem->apoint[i].x, &pitem->apoint[i].y)) { fprintf(stderr, "Error reading poly...exiting"); exit(1); } } while(getc(pfile) != '\n') ; } GOPolyInit(pgoprocs) GOPROCS *pgoprocs; { pgoprocs->holder= PolyHolder; pgoprocs->new = PolyNew; pgoprocs->draw = PolyDraw; pgoprocs->print = PolyPrint; pgoprocs->read = PolyRead; pgoprocs->write = PolyWrite; } /* Brushes and polygons draw the same! */ GOBrushInit(pgoprocs) GOPROCS *pgoprocs; { GOPolyInit(pgoprocs); } /************* event handlers *************/ static POINT *pbuf = (POINT *)0; static POINT *pcurrent; static int lcurrent; #define MAXPOINTS 100 static polyBeginCurrent(x, y) int x, y; { lcurrent = 1; pbuf = pcurrent = (POINT *)malloc(MAXPOINTS * sizeof(POINT)); pcurrent->x = x; pcurrent->y = y; } static polyAddPoint(x, y) int x, y; { lcurrent++; if(lcurrent >= MAXPOINTS) { fprintf(stderr, "too many points in polygon\n"); return; } ps_drawline(pcurrent->x, pcurrent->y, x, y); ps_stroke(); pcurrent++; pcurrent->x = x; pcurrent->y = y; } static polyEndCurrent() { ITEM *pitem; POINT *ppoint; if(lcurrent == 1) { free(pbuf); return; } /* polyAddPoint(pbuf->x, pbuf->y); */ ppoint = (POINT *)malloc(lcurrent * sizeof(POINT)); bcopy(pbuf, ppoint, lcurrent * sizeof(POINT)); pitem = PolyNew(ppoint, lcurrent, 1); GOItemAddToTop(pitem); GODrawItem(pitem); free(pbuf); pbuf = 0; lcurrent = 1; } static void *PolySelect(x, y) int x,y; { if(pbuf) return; polyBeginCurrent(x, y); ps_linecreateinteractive(x, y); } static void *PolyAdjust(x, y) int x,y; { } static void *PolyReply(x0, y0, x1, y1) int x0, y0, x1, y1; { if((lcurrent != 1) && (pcurrent->x == x1) && (pcurrent->y == y1)) { polyAddPoint(x1, y1); polyEndCurrent(); return; } polyAddPoint(x1, y1); ps_linecreateinteractive(x1, y1); } static void *PolyEnd() { if(pbuf) { polyEndCurrent(); } } static void *PolyBegin() { ps_xcursor(); } EHPolyInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = PolySelect; pprocs->handleadjust = PolyAdjust; pprocs->handlereply = PolyReply; pprocs->handlebegin = PolyBegin; pprocs->handlebegin = PolyEnd; } /************* event handlers *************/ static void *BrushSelect(x, y) int x,y; { ps_pencilCreateinteractive(x, y); } static void *BrushAdjust(x, y) int x,y; { } static void *BrushReply(x0, y0, x1, y1) int x0, y0, x1, y1; { ITEM *pitem; int length; int i; POINT *ppoint; ps_getint(&length); ppoint = (POINT *)malloc(length * sizeof(POINT)); for(i = 0; i < length; i++) { ps_getint(&ppoint[i].x); ps_getint(&ppoint[i].y); } pitem = PolyNew(ppoint, length, 0); GOItemAddToTop(pitem); GODrawItem(pitem); return(pitem); } static void *BrushEnd() { } static void *BrushBegin() { ps_xcursor(); } EHBrushInit(pprocs) EHPROCS *pprocs; { pprocs->handleselect = BrushSelect; pprocs->handleadjust = BrushAdjust; pprocs->handlereply = BrushReply; pprocs->handlebegin = BrushBegin; pprocs->handlebegin = BrushEnd; } SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Dec 21 00:52:38 1988 Date: Wed, 21 Dec 88 00:52:38 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw 5/5 From: carlisle!bvs@sun.com (Bruce Schwartz) 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: # draw.c # item.c # eh.c # font.c # go.c # file.c # prop.c # stretch.c # This archive created: Fri Dec 16 15:05:54 1988 export PATH; PATH=/bin:/usr/bin:$PATH if test -f 'draw.c' then echo shar: "will not over-write existing file 'draw.c'" else cat << \SHAR_EOF > 'draw.c' /* $Header: draw.c,v 1.6 88/12/02 10:43:13 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ /* % % This file is a product of Sun Microsystems, Inc. and is provided for % unrestricted use provided that this legend is included on all tape % media and as a part of the software program in whole or part. % Users may copy, modify or distribute this file at will. % % THIS FILE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE % WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR % PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. % % This file is provided with no support and without any obligation on the % part of Sun Microsystems, Inc. to assist in its use, correction, % modification or enhancement. % % SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE % INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS FILE % OR ANY PART THEREOF. % % In no event will Sun Microsystems, Inc. be liable for any lost revenue % or profits or other special, indirect and consequential damages, even % if Sun has been advised of the possibility of such damages. % % Sun Microsystems, Inc. % 2550 Garcia Avenue % Mountain View, California 94043 % % Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "psio.h" #include "psint.h" #include "draw.h" main() { int mode, newmode; int key; int x0, y0, x1, y1; int dx0, dy0, dx1, dy1; /* damage events */ float angle; char buf[256]; if (ps_open_PostScript() == 0 ) { fprintf(stderr,"Cannot connect to NeWS server\n"); exit(1); } getwd(buf); ps_init(buf); EHInit(); GOInit(); FontInit(); PropInit(); mode = STRETCH; ps_setcanvas(); while (!psio_error(PostScriptInput)) { if(0) ; else if(ps_getmode(&newmode)) { if(mode != newmode) { ehprocs[mode].handleend(); mode = newmode; ehprocs[newmode].handlebegin(); } } else if(ps_getselect(&x0, &y0)) ehprocs[mode].handleselect(x0, y0); else if(ps_getadjust(&x0, &y0)) ehprocs[mode].handleadjust(x0, y0); else if(ps_getkey(&key)) ehprocs[mode].handlekey(key); else if(ps_getcreatepoint(&x1, &y1)) { ehprocs[mode].handlereply(x0, y0, x1, y1); } else if(ps_getcreateangle(&angle)) { ehprocs[mode].handlereply(angle); } else if(ps_getdamage(&dx0, &dy0, &dx1, &dy1)) { ps_setcanvas(); ehprocs[mode].handledamage(dx0, dy0, dx1, dy1); } else if(ps_getprop(&key)) { ehprocs[mode].handleprop(key); } else { fprintf(stderr, "End of program or illegal tag!\n"); break; } } ps_close_PostScript(); exit(0); } SHAR_EOF fi if test -f 'item.c' then echo shar: "will not over-write existing file 'item.c'" else cat << \SHAR_EOF > 'item.c' /* $Header: item.c,v 1.4 88/12/02 10:43:32 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include #include "go.h" #include "gopvt.h" extern PROP *GOItemProp(); extern ITEM *GOItemRotatedBounds(); static ITEM *plist; int GOItemType(pitem) ITEM *pitem; { return(pitem->type); } GOItemInit() { plist = (ITEM *)malloc(sizeof(ITEM)); plist->pnext = plist; plist->pprev = plist; } GOItemReInit() { GOItemInit(); } ITEM *GOItemAddToTop(pitem) ITEM *pitem; { pitem->pprev = plist; pitem->pnext = plist->pnext; plist->pnext->pprev = pitem; plist->pnext = pitem; return(pitem); } ITEM *GOItemAddToBottom(pitem) ITEM *pitem; { pitem->pprev = plist->pprev; pitem->pnext = plist; plist->pprev->pnext = pitem; plist->pprev = pitem; return(pitem); } ITEM *GOItemDelete(pitem) ITEM *pitem; { pitem->pprev->pnext = pitem->pnext; pitem->pnext->pprev = pitem->pprev; pitem->pnext = (ITEM *)0; pitem->pprev = (ITEM *)0; return(pitem); } ITEM *GODrawItem(pitem) ITEM *pitem; { int x = (X0 + X1)/2; int y = (Y0 + Y1)/2; ps_dorotate(x, y, pitem->rotation); goprocs[pitem->type].draw(pitem); ps_unrotate(); return(pitem); } int GOPointInItem(pitem, x, y) ITEM *pitem; int x; int y; { int x0 = X0; int x1 = X1; int y0 = Y0; int y1 = Y1; int xpt = x; int ypt = y; /* make sure we're at least 5 units wide! */ if((x1 - x0) < 5) { x0--; x1++; } if((x1 - x0) < 5) { x0--; x1++; } if((x1 - x0) < 5) { x0--; x1++; } if((y1 - y0) < 5) { y0--; y1++; } if((y1 - y0) < 5) { y0--; y1++; } if((y1 - y0) < 5) { y0--; y1++; } if(pitem->rotation != 0.0) { int xc = (x0 + x1)/2; int yc = (y0 + y1)/2; double fcos, fsin; sincos((double)(-pitem->rotation) / 180.0 * M_PI, &fsin, &fcos); xpt = ((x - xc) * fcos) - ((y - yc) * fsin) + xc; ypt = ((x - xc) * fsin) + ((y - yc) * fcos) + yc; } if((x0 <= xpt) && (x1 >= xpt) && (y0 <= ypt) && (y1 >= ypt)) { /* More detailed check... */ return(1); } else return(0); } int GOItemInRect(pitem, x0, y0, x1, y1) ITEM *pitem; int x0, y0, x1, y1; { int xmin = MIN(X0, X1); int xmax = MAX(X0, X1); int ymin = MIN(Y0, Y1); int ymax = MAX(Y0, Y1); if(pitem->rotation != 0.0) { GOItemRotatedBounds(pitem, &xmin, &ymin, &xmax, &ymax); } if( (x0 > xmax) || (x1 < xmin) || (y0 > ymax) || (y1 < ymin) ) { return(0); } else return(1); } ITEM *GOPrintItem(pitem, pfile) ITEM *pitem; FILE *pfile; { if(pitem->rotation != 0.0) { fprintf(pfile, "matrix currentmatrix "); fprintf(pfile, "%d %d translate ", X, Y); fprintf(pfile, "%f rotate ", pitem->rotation); fprintf(pfile, "%d %d translate\n", -X, -Y); goprocs[pitem->type].print(pitem, pfile); fprintf(pfile, "setmatrix\n"); } else goprocs[pitem->type].print(pitem, pfile); return(pitem); } ITEM *GOWriteItem(pitem, pfile) ITEM *pitem; FILE *pfile; { fprintf(pfile, "type %d\n", pitem->type); PropWrite(GOItemProp(pitem), pfile); fprintf(pfile, "%d %d %d %d %f %d %d\n", pitem->x0, pitem->y0, pitem->x1, pitem->y1, pitem->rotation, pitem->xscale, pitem->yscale ); goprocs[pitem->type].write(pitem, pfile); return(pitem); } ITEM *GOReadItem(pfile) FILE *pfile; { int ret; int type; ITEM *pitem; if(feof(pfile)) return((ITEM *)0); if(1 != fscanf(pfile, "type %d\n", &type)) { fprintf(stderr, "Bad read of item\n"); return((ITEM *)0); } if(type == -1) return((ITEM *)0); pitem = (ITEM *)goprocs[type].holder(); pitem->type = type; pitem->prop = PropRead(pfile); if(pitem->prop == 0) { return((ITEM *)0); } /* fprintf(stderr, "reading item type: %d\n", type); */ ret = fscanf(pfile, "%d %d %d %d %f %d %d\n", &pitem->x0, &pitem->y0, &pitem->x1, &pitem->y1, &pitem->rotation, &pitem->xscale, &pitem->yscale ); if(ret != 7) { fprintf(stderr, "Bad item type %d read...\n", type); return((ITEM *)0); } goprocs[type].read(pitem, pfile); return(pitem); } PROP * GOItemProp(pitem) ITEM *pitem; { return(pitem->prop); } ITEM * GOItemSetProp(pitem, prop) ITEM *pitem; PROP *prop; { pitem->prop = prop; return(pitem); } ITEM *GOItemMove(pitem, dx, dy) ITEM *pitem; int dx, dy; { pitem->x0 += dx; pitem->x1 += dx; pitem->y0 += dy; pitem->y1 += dy; return(pitem); } ITEM *GOItemSetRotation(pitem, angle) ITEM *pitem; float angle; { pitem->rotation = angle; return(pitem); } float GOItemGetRotation(pitem) ITEM *pitem; { return (float)pitem->rotation; } minmax4(pmin, pmax, in1, in2, in3, in4) int *pmin, *pmax; int in1, in2, in3, in4; { *pmin = MIN( MIN(in1, in2), MIN(in3, in4)); *pmax = MAX( MAX(in1, in2), MAX(in3, in4)); } ITEM *GOItemUnrotatedBounds(pitem, px0, py0, px1, py1) ITEM *pitem; int *px0, *py0, *px1, *py1; { int width = PropLineWidth(pitem->prop); *px0 = MIN(X0, X1) - width; *py0 = MIN(Y0, Y1) - width; *px1 = MAX(X0, X1) + width; *py1 = MAX(Y0, Y1) + width; return(pitem); } ITEM *GOItemRotatedBounds(pitem, px0, py0, px1, py1) ITEM *pitem; int *px0, *py0, *px1, *py1; { if(pitem->rotation != 0.0) { int width = PropLineWidth(pitem->prop); int xc = (X0 + X1 + 1)/2; int yc = (Y0 + Y1 + 1)/2; double fsin, fcos; int dx1, dy1, dx2, dy2; sincos((double)(pitem->rotation) / 180.0 * M_PI, &fsin, &fcos); dx1 = ((X1 - xc) * fcos) - ((Y0 - yc) * fsin); dx2 = ((X1 - xc) * fcos) - ((Y1 - yc) * fsin); dy1 = ((X1 - xc) * fsin) + ((Y0 - yc) * fcos); dy2 = ((X1 - xc) * fsin) + ((Y1 - yc) * fcos); *px0 = xc - MAX( ABS(dx1), ABS(dx2) ) - width; *py0 = yc - MAX( ABS(dy1), ABS(dy2) ) - width; *px1 = xc + MAX( ABS(dx1), ABS(dx2) ) + width; *py1 = yc + MAX( ABS(dy1), ABS(dy2) ) + width; } else GOItemUnrotatedBounds(pitem, px0, py0, px1, py1); return(pitem); } ITEM *GOItemMaxBounds(pitem, px0, py0, px1, py1) ITEM *pitem; int *px0, *py0, *px1, *py1; { /* just do a rough calculation */ int width = PropLineWidth(pitem->prop); int xc = (X0 + X1 + 1)/2; int yc = (Y0 + Y1 + 1)/2; int radius = (int)((MAX( ABS(X0 - X1), ABS(Y0 - Y1) ) + 1) * .75); radius += width; /* this should really be the linewidth */ *px0 = xc - radius; *px1 = xc + radius; *py0 = yc - radius; *py1 = yc + radius; return(pitem); } ITEM *GOFindItem(x, y) int x, y; { ITEM *pitem; for(pitem = plist->pnext; pitem != plist; pitem = pitem->pnext) { if(GOPointInItem(pitem, x, y)) return(pitem); } return((ITEM *)0); } GORepairItems(x0, y0, x1, y1) { ITEM *pitem; ps_pushclip(x0, y0, x1, y1); ps_setgray(1.0); ps_drawrect(x0, y0, x1, y1); ps_fill(); for(pitem = plist->pprev; pitem != plist; pitem = pitem->pprev) { if(GOItemInRect(pitem, x0, y0, x1, y1)) GODrawItem(pitem); } ps_popclip(); } GODrawItems() { ITEM *pitem; for(pitem = plist->pprev; pitem != plist; pitem = pitem->pprev) GODrawItem(pitem); } GOBoundsItems(px0, py0, px1, py1) int *px0, *py0, *px1, *py1; { ITEM *pitem = plist->pprev; int x0 = X0; int y0 = Y0; int x1 = X1; int y1 = Y1; for(pitem = plist->pprev; pitem != plist; pitem = pitem->pprev) { x0 = MIN(x0, X0); y0 = MIN(y0, Y0); x1 = MAX(x1, X1); y1 = MAX(y1, Y1); } *px0 = x0; *py0 = y0; *px1 = x1; *py1 = y1; } GOPrintItems(pfile) FILE *pfile; { ITEM *pitem; for(pitem = plist->pprev; pitem != plist; pitem = pitem->pprev) GOPrintItem(pitem, pfile); } GOWriteItems(pfile) FILE *pfile; { ITEM *pitem; for(pitem = plist->pprev; pitem != plist; pitem = pitem->pprev) { GOWriteItem(pitem, pfile); } fprintf(pfile, "type %d\n", -1); } GOReadItems(pfile) FILE *pfile; { ITEM *pitem; GOItemReInit(); while(pitem = GOReadItem(pfile)) { GOItemAddToTop(pitem); } GORepairItems(-1000, -1000, 1000, 1000); } SHAR_EOF fi if test -f 'eh.c' then echo shar: "will not over-write existing file 'eh.c'" else cat << \SHAR_EOF > 'eh.c' /* $Header: eh.c,v 1.5 88/12/02 10:43:19 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "draw.h" #include "go.h" #include "psio.h" #include "psint.h" static void *nullproc() { } static void *nullselect(x, y) int x, y; { fprintf(stderr, "Select not implemented for current mode\n"); } static void *nulladjust(x, y) int x, y; { fprintf(stderr, "Adjust not implemented for current mode\n"); } static void *nullkey(c) int c; { fprintf(stderr, "Keystroke not implemented for current mode\n"); } static void *nullreply(c) int c; { fprintf(stderr, "Reply not implemented for current mode\n"); } static void *handleprop(c) int c; { if(PropHandle(c) == FALSE) fprintf(stderr, "Unable to handle action/property %d\n", c); } static void *handledamage(x0, y0, x1, y1) int x0, y0, x1, y1; { GORepairItems(x0, y0, x1, y1); } static void *nullbegin() { } static void *nullend() { } EHInit() { int k; for(k=0; k < MODEMAX; k++) { ehprocs[k].handleselect = nullselect; ehprocs[k].handleadjust = nulladjust; ehprocs[k].handlekey = nullkey; ehprocs[k].handlereply = nullreply; ehprocs[k].handledamage = handledamage; ehprocs[k].handlebegin = nullbegin; ehprocs[k].handleend = nullend; ehprocs[k].handleprop = handleprop; } EHLineInit(&ehprocs[LINE]); EHPolyInit(&ehprocs[POLY]); EHBrushInit(&ehprocs[BRUSH]); EHRectInit(&ehprocs[RECT]); EHOvalInit(&ehprocs[OVAL]); EHCircInit(&ehprocs[CIRC]); EHTextInit(&ehprocs[TEXT]); EHStretchInit(&ehprocs[STRETCH]); EHRotateInit(&ehprocs[ROTATE]); } SHAR_EOF fi if test -f 'font.c' then echo shar: "will not over-write existing file 'font.c'" else cat << \SHAR_EOF > 'font.c' /* $Header: font.c,v 1.2 88/12/02 10:43:43 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "psint.h" typedef struct { char *name; /* family name */ int id; /* id token */ int size; /* point size */ int height; /* heighest ascender to lowest descender */ int descent; /* lowest descender to baseline */ int count; /* chars in font */ int *awidths; /* array of char width info */ } FONT; FONT *SetFont(); static FONT font; FontInit() { SetFont("Times-Roman", 48); } FONT *FontDefault() { return(&font); } FONT *SetFont(name, size) char *name; int size; { int count, height, descent; int index = ps_next_user_token++; int i; FONT *pf = &font; ps_fontsetup(name, size, index, &count, &height, &descent); pf->size = size; pf->id = index; pf->count = count >> 1; pf->height = height; pf->descent = descent < 0 ? -descent : descent; pf->name = (char *)malloc(strlen(name)); strcpy(pf->name, name); printf("font %s: id %d, count %d, height %d, descent %d\n", pf->name, pf->id, pf->count, pf->height, pf->descent); pf->awidths = (int *)malloc(pf->count * sizeof(int)); for(i = pf->count - 1; i >= 0; --i) { ps_getint(&pf->awidths[i]); /* printf("char %c (%x), width %d\n", i, i, pf->awidths[i]); */ } return pf; } FontDescent(pfont) FONT *pfont; { return(pfont->descent); } FontHeight(pfont) FONT *pfont; { return(pfont->height); } FontAscent(pfont) FONT *pfont; { return(pfont->height - pfont->descent); } int FontTextWidth(pfont, ptext) FONT *pfont; char *ptext; { int w = 0; char *pc; for(pc = ptext; *pc; pc++) { w += pfont->awidths[*pc]; } return(w); } SHAR_EOF fi if test -f 'go.c' then echo shar: "will not over-write existing file 'go.c'" else cat << \SHAR_EOF > 'go.c' /* $Header: go.c,v 1.3 88/12/02 10:43:21 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "draw.h" #include "go.h" #include "psio.h" #include "psint.h" static void *nullreadwrite(pitem, pfile) ITEM *pitem; FILE *pfile; { } static void *nullproc() { } static void *errorproc() { fprintf(stderr, "No object/method for current mode\n"); } GOInit() { int k; for(k=0; k < MODEMAX; k++) { goprocs[k].holder = errorproc; goprocs[k].new = errorproc; goprocs[k].move = errorproc; goprocs[k].rotate = errorproc; goprocs[k].scale = errorproc; goprocs[k].setpath = errorproc; goprocs[k].draw = errorproc; goprocs[k].print = errorproc; goprocs[k].write = nullreadwrite; goprocs[k].read = nullreadwrite; } GOItemInit(); GOLineInit(&goprocs[LINE]); GORectInit(&goprocs[RECT]); GOOvalInit(&goprocs[OVAL]); GOCircInit(&goprocs[CIRC]); GOTextInit(&goprocs[TEXT]); GOPolyInit(&goprocs[POLY]); GOBrushInit(&goprocs[BRUSH]); } SHAR_EOF fi if test -f 'file.c' then echo shar: "will not over-write existing file 'file.c'" else cat << \SHAR_EOF > 'file.c' /* $Header: file.c,v 1.4 88/12/02 10:43:11 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #define PRINTFILE "file.ps" Print() { FILE *pfile = fopen("newsdraw.ps", "w"); fprintf(pfile, "%%!\n"); fprintf(pfile, "%%%%!PS-Adobe-1.0\n"); fprintf(pfile, "%%%%Creator: NewsDraw\n"); fprintf(pfile, "%%%%Title: \n"); fprintf(pfile, "%%%%CreationDate: \n"); fprintf(pfile, "%%%%DocumentFonts: Times-Roman\n"); fprintf(pfile, "%%%%Pages: (atend)\n"); fprintf(pfile, "%%%%EndComments\n"); fprintf(pfile, "%%\n%%\n%%\n"); fprintf(pfile, "/Times-Roman findfont 36 scalefont setfont\n"); fprintf(pfile, "/rect {dup 0 exch rlineto exch 0 rlineto neg 0 exch rlineto closepath } def\n"); fprintf(pfile, "/rectpath { 4 2 roll moveto rect } def\n"); fprintf(pfile, "/linepath { moveto lineto } def\n"); fprintf(pfile, "/circpath { 0 360 arc } def\n"); fprintf(pfile, "/ovalpath { matrix currentmatrix 5 1 roll 4 2 roll translate scale .5 .5 translate 0 0 .5 0 360 arc closepath setmatrix } def\n"); fprintf(pfile, "%%%%EndProlog\n"); fprintf(pfile, "%%%%Page: ? 1\n"); GOPrintItems(pfile); fprintf(pfile, "showpage\n"); fprintf(pfile, "%%%%Pages: 1\n"); fclose(pfile); /* system("lpr .drawprint"); */ } #define WRITEFILE "file.nd" Write() { FILE *pfile = fopen(WRITEFILE, "w"); GOWriteItems(pfile); fclose(pfile); } Read() { FILE *pfile = fopen(WRITEFILE, "r"); GOReadItems(pfile); fclose(pfile); } SHAR_EOF fi if test -f 'prop.c' then echo shar: "will not over-write existing file 'prop.c'" else cat << \SHAR_EOF > 'prop.c' /* $Header: prop.c,v 1.4 88/12/02 10:43:45 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "psint.h" #include "go.h" #include "comm.h" typedef struct prop { int linewidth; float strokecolor; float fillcolor; float textcolor; FONT *pfont; }; static PROP *propcurrent; static PROP *proplast; PROP *PropNew(); PropInit() { proplast = (PROP *)0; propcurrent = PropNew(); propcurrent->linewidth = 1; propcurrent->strokecolor = 0.0; propcurrent->fillcolor = .75; propcurrent->textcolor = 0.0; propcurrent->pfont = FontDefault(); } PROP *PropCopyOf(prop) PROP *prop; { PROP *propNew = PropNew(); *propNew = *prop; return(propNew); } PROP *PropNew() { return((PROP *)malloc(sizeof(PROP))); } PROP *PropSetCurrent(prop) PROP *prop; { *propcurrent = *prop; return(prop); } PROP *PropCurrent() { return(propcurrent); } int PropHandle(id) /* actually returns boolean */ int id; { int handled = TRUE; switch(id) { default: handled = FALSE; break; /* properties */ case FILL_KEY: ps_getfloat(&propcurrent->fillcolor); break; case STROKE_KEY: ps_getfloat(&propcurrent->strokecolor); break; case TEXT_KEY: ps_getfloat(&propcurrent->textcolor); break; case WIDTH_KEY: ps_getint(&propcurrent->linewidth); break; case PRINT_KEY: Print(); break; case WRITE_KEY: Write(); break; case READ_KEY: Read(); break; case REDRAW_KEY: GODrawItems(); break; } return(handled); } float PropStrokeColor(prop) PROP *prop; { return(prop->strokecolor); } float PropFillColor(prop) PROP *prop; { return(prop->fillcolor); } float PropTextColor(prop) PROP *prop; { return(prop->textcolor); } int PropLineWidth(prop) PROP *prop; { return(prop->linewidth); } FONT *PropFont(prop) PROP *prop; { return(prop->pfont); } PropWrite(prop, pfile) PROP *prop; FILE *pfile; { fprintf(pfile, "PROPS %d %f %f %f\n", prop->linewidth, prop->strokecolor, prop->fillcolor, prop->textcolor); } PROP *PropRead(pfile) FILE *pfile; { PROP *prop = PropNew(); int ret = fscanf(pfile, "PROPS %d %f %f %f\n", &prop->linewidth, &prop->strokecolor, &prop->fillcolor, &prop->textcolor); prop->pfont = FontDefault(); if(ret != 4) { fprintf("bad prop read...\n"); } return(prop); } SHAR_EOF fi if test -f 'stretch.c' then echo shar: "will not over-write existing file 'stretch.c'" else cat << \SHAR_EOF > 'stretch.c' /* $Header: stretch.c,v 1.5 88/12/02 10:43:46 bvs Exp $ */ /* Copyright (C) 1988 by Sun Microsystems. All rights reserved. */ #include #include "draw.h" #include "go.h" #include "psio.h" #include "psint.h" #include "comm.h" static ITEM *pcurrent = (ITEM *)0; static ITEM *SRSelectItem(); static ITEM *SRDeselectItem(); static void *StretchMoveReply(); #define B 3 /* selection border */ #define B1 2 /* selection border inner */ /* shared stretch/rotate stuff */ static void *SRBegin() { ps_stdcursor(); } static void *SREnd() { if(pcurrent) SRDeselectItem(pcurrent); pcurrent = (ITEM *)0; } static void *SRProp(c) int c; { ITEM *pitem = pcurrent; if(pitem) SRDeselectItem(pitem); PropHandle(c); /* this should be in action handle! */ if(pitem) { if(c == TOTOP_KEY) { GOItemDelete(pitem); GOItemAddToTop(pitem); } if(c == TOBOT_KEY) { GOItemDelete(pitem); GOItemAddToBottom(pitem); } } /* set property on selected item */ if(pitem) { int x0, x1, y0, y1; GOItemSetProp(pitem, PropCopyOf(PropCurrent())); GOItemRotatedBounds(pitem, &x0, &y0, &x1, &y1); GORepairItems(x0 - 10, y0 - 10, x1 + 10, y1 + 10); /* 10 hack */ SRSelectItem(pitem); } } static void *SRAdjust(x, y) int x,y; { } static void *SRKey(key) int key; { int x0, x1, y0, y1; if(pcurrent) { if((key == 0177) || (key = 10)) /* delete or BS key */ { GOItemDelete(pcurrent); GOItemRotatedBounds(pcurrent, &x0, &y0, &x1, &y1); GORepairItems(x0 - B, y0 - B, x1 + B, y1 + B); /* GOFreeItem(pcurrent); */ pcurrent = (ITEM *)0; } } } /* stretch selection */ static void *StretchSelect(x, y) int x,y; { ITEM *pfound = (ITEM *)GOFindItem(x, y); if((pcurrent) && (pcurrent == pfound)) { /* move or stretch */ int x0, y0, x1, y1; int bL, bT, bB, bR; int type = GOItemType(pcurrent); GOItemUnrotatedBounds(pcurrent, &x0, &y0, &x1, &y1); bT = bB = bL = bR = 0; if(x < (x0 + B)) bL = 1; if(y < (y0 + B)) bB = 1; if(x > (x1 - B)) bR = 1; if(y > (y1 - B)) bT = 1; if (bL && bT) ehprocs[type].handleselect(x1, y0); else if(bL && bB) ehprocs[type].handleselect(x1, y1); else if(bR && bT) ehprocs[type].handleselect(x0, y0); else if(bR && bB) ehprocs[type].handleselect(x0, y1); else { ehprocs[STRETCH].handlereply = StretchMoveReply; ps_moveinteractive(x, y, GOItemGetRotation(pcurrent), x0, y0, x1, y1); } } else { if(pcurrent) SRDeselectItem(pcurrent); pcurrent = pfound; if(pcurrent) SRSelectItem(pcurrent); } } static void *StretchMoveReply(xstart, ystart, xend, yend) int xstart, ystart, xend, yend; { int x0, y0, x1, y1; int s0, t0, s1, t1; GOItemRotatedBounds(pcurrent, &x0, &y0, &x1, &y1); GOItemMove(pcurrent, xend - xstart, yend - ystart); GOItemRotatedBounds(pcurrent, &s0, &t0, &s1, &t1); if((x0 > s1) || (x1 < s0) || (y0 > t1) || (y1 < t0)) { /* no intersection */ /* printf("no intersect\n"); */ GORepairItems(x0 - B, y0 - B, x1 + B, y1 + B); GORepairItems(s0, t0, s1, t1); } else { /* the regions intersect */ /* printf("intersection\n"); */ GORepairItems( MIN(s0, x0 - B), MIN(t0, y0 - B), MAX(s1, x1 + B), MAX(t1, y1 + B) ); } saveareaunderitem(pcurrent); GOItemUnrotatedBounds(pcurrent, &x0, &y0, &x1, &y1); drawselection(GOItemGetRotation(pcurrent), x0, y0, x1, y1); } EHStretchInit(pprocs) EHPROCS *pprocs; { pprocs->handlebegin = SRBegin; pprocs->handleend = SREnd; pprocs->handleprop = SRProp; pprocs->handleselect = StretchSelect; pprocs->handleadjust = SRAdjust; pprocs->handlekey = SRKey; } /* rotate selection */ static void *RotateSelect(x, y) int x,y; { ITEM *pfound = (ITEM *)GOFindItem(x, y); if(pcurrent == pfound) { /* rotate */ int x0, y0, x1, y1; GOItemUnrotatedBounds(pcurrent, &x0, &y0, &x1, &y1); ps_rotateInteractive( GOItemGetRotation(pcurrent), x, y, (x0 + x1)/2, (y0 + y1)/2, x0, y0, x1, y1); } else { if(pcurrent) SRDeselectItem(pcurrent); pcurrent = pfound; if(pcurrent) SRSelectItem(pcurrent); } } static void *RotateReply(angle) float angle; { int x0, y0, x1, y1; int s0, t0, s1, t1; GOItemRotatedBounds(pcurrent, &x0, &y0, &x1, &y1); GOItemSetRotation(pcurrent, angle); GOItemRotatedBounds(pcurrent, &s0, &t0, &s1, &t1); GORepairItems( MIN(x0, s0) - B, MIN(y0, t0) - B, MAX(x1, s1) + B, MAX(y1, t1) + B); saveareaunderitem(pcurrent); GOItemUnrotatedBounds(pcurrent, &x0, &y0, &x1, &y1); drawselection(angle, x0, y0, x1, y1); } EHRotateInit(pprocs) EHPROCS *pprocs; { pprocs->handlebegin = SRBegin; pprocs->handleend = SREnd; pprocs->handleprop = SRProp; pprocs->handlekey = SRKey; pprocs->handleselect = RotateSelect; pprocs->handleadjust = SRAdjust; pprocs->handlereply = RotateReply; } /* private stuff */ static ITEM *SRSelectItem(pitem) ITEM *pitem; { if(pcurrent) { fprintf("GOSelectItem: Internal error\n"); } if(pitem) { int x0, y0, x1, y1; float angle; pcurrent = pitem; saveareaunderitem(pitem); angle = GOItemGetRotation(pitem); GOItemUnrotatedBounds(pitem, &x0, &y0, &x1, &y1); drawselection(angle, x0, y0, x1, y1); PropSetCurrent(GOItemProp(pitem)); } return(pitem); } static ITEM *SRDeselectItem(pitem) ITEM *pitem; { if(!pcurrent) { fprintf(stderr, "SRDeselectItem: Internal error\n"); return(pitem); } else { ps_restorearea(); } pcurrent = (ITEM *)0; return(pitem); } static drawselection(angle, x0, y0, x1, y1) float angle; int x0, y0, x1, y1; { int x2 = (x0 + x1)/2; int y2 = (y0 + y1)/2; ps_flush_PostScript(); ps_dorotate(x2, y2, angle); ps_setgray(1.0); ps_drawrect(x0 - B, y0 - B, x0 + B, y0 + B); ps_drawrect(x1 - B, y0 - B, x1 + B, y0 + B); ps_drawrect(x1 - B, y1 - B, x1 + B, y1 + B); ps_drawrect(x0 - B, y1 - B, x0 + B, y1 + B); ps_drawrect(x0 - B, y2 - B, x0 + B, y2 + B); ps_drawrect(x1 - B, y2 - B, x1 + B, y2 + B); ps_drawrect(x2 - B, y0 - B, x2 + B, y0 + B); ps_drawrect(x2 - B, y1 - B, x2 + B, y1 + B); ps_drawrect(x2 - B, y2 - B, x2 + B, y2 + B); ps_fill(); ps_setgray(0.0); ps_drawrect(x0 - B1, y0 - B1, x0 + B1, y0 + B1); ps_drawrect(x1 - B1, y0 - B1, x1 + B1, y0 + B1); ps_drawrect(x1 - B1, y1 - B1, x1 + B1, y1 + B1); ps_drawrect(x0 - B1, y1 - B1, x0 + B1, y1 + B1); ps_drawrect(x0 - B1, y2 - B1, x0 + B1, y2 + B1); ps_drawrect(x1 - B1, y2 - B1, x1 + B1, y2 + B1); ps_drawrect(x2 - B1, y0 - B1, x2 + B1, y0 + B1); ps_drawrect(x2 - B1, y1 - B1, x2 + B1, y1 + B1); ps_drawrect(x2 - B1, y2 - B1, x2 + B1, y2 + B1); ps_fill(); ps_unrotate(); ps_flush_PostScript(); } saveareaunderitem(pitem) ITEM *pitem; { int x0, y0, x1, y1; GOItemRotatedBounds(pitem, &x0, &y0, &x1, &y1); ps_savearea(x0 - B, y0 - B, x1 + B, y1 + B); /*printf("save area (%d,%d), (%d,%d)\n", x0 - B, y0 - B, x1 + B, y1 + B);*/ } SHAR_EOF fi exit 0 # End of shell archive From don@brillig.umd.edu Wed Dec 21 00:56:19 1988 Date: Wed, 21 Dec 88 00:56:19 EST To: NeWS-makers@brillig.umd.edu Subject: NewsDraw addendum From: carlisle!bvs@sun.com (Bruce Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) People running SunOS 3.x have been having trouble making NewsDraw. NewsDraw was written under SunOS 4.0. The major problem is that the sincos call is new in 4.0. You can solve the problem by putting the following line at the top of item.c: #define sincos(x,s,c) { *s = sin(x); *c = cos(x); } >From the 4.0 man pages: #include double sin(x) double x; double cos(x) double x; void sincos(x, s, c) double x, *s, *c; Note that sincos(x,s,c) allows simultaneous computation of *s = sin(x) and *c = cos(x). Happy hacking, Bruce Schwartz From don@brillig.umd.edu Wed Dec 21 00:59:32 1988 Date: Wed, 21 Dec 88 00:59:32 EST To: NeWS-makers@brillig.umd.edu Subject: Redefining strings sent by function keys From: mailrus!cwjcc!hal!nic.MR.NET!eta!skappel@rutgers.edu (Steve kappel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Maybe one of you NeWS gurus out there has already done this and would be kind enough to either post or email your code. I'm looking for an easy way (short of trying to learn a lot about NeWS) to reprogram the function keys (on Sun's) to send different sequences. I'm aware of the bindkey feature but I don't know how to send the string once my code gets control. I've seen Don Hopkins' simulated mouse movement and clicks (very nice!) but it still isn't quite what I'm looking for (although I WOULD like to send different strings depending on the state of the Control/Shift/Meta keys). I would like to be able to put a short line in for each key naming it (FunctionF1 for example) and the 4 different character sequences to send (plain, shifted, controlled, and meta). For now having this happen in all windows is ok. As always, any help would be greatly appreciated. Thanks, Steve From don@brillig.umd.edu Wed Dec 21 06:47:52 1988 Date: Wed, 21 Dec 88 06:47:52 EST To: NeWS-makers@brillig.umd.edu Subject: psview From: pasteur!agate!saturn!jupiter.ucsc.edu!conrad@ucbvax.Berkeley.EDU (Al Conrad) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Has anyone succesfully used psview to look at documents prepared with: 1. ditroff -> transcript/psdit -> PostScript 2. tex -> dvi2ps -> PostScript 3. MacWrite -> PostScript captured with the command-F trick? Thanks in advance, Al Conrad conrad@saturn.ucsc.edu From don@brillig.umd.edu Wed Dec 21 06:48:09 1988 Date: Wed, 21 Dec 88 06:48:09 EST To: NeWS-makers@brillig.umd.edu Subject: Re: PostScript programming From: sgi!msc%canth.SGI.COM@ucbvax.Berkeley.EDU (Mark Callow) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <8812081944.AA10206@bigmac.sun.com>, owen@SUN.COM (Owen Densmore) writes: > array of superclasses. Note that class Object simply uses an empty > array, rather than the "null" it used to use. Amazingly enough, the > code reduced in size in the conversion from single to multiple > inheritance. That's great news. Does xnews use that version of class.ps? > > If at all possible, I'd like the evolution of the classing mechanism > in NeWS and DPS to be coordinated. > > Owen Densmore Hear, hear. I hope someone at Adobe is listening. -- 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 Dec 21 06:49:38 1988 Date: Wed, 21 Dec 88 06:49:38 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS running on VAX From: mcvax!hp4nl!philmds!nlgvax!tom@uunet.uu.net (Tom van Peer) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) If you buy the sources from SUN you get something like VAX-station support. But I must admit I haven't looked into it, we don't use that type of machine around here. -- Tom van Peer. E-mail: mcvax!nlgvax!tom or tom@nlgvax.pcg.philips.nl or peer@vangogh.prl.philips.nl From don@brillig.umd.edu Wed Dec 21 06:50:54 1988 Date: Wed, 21 Dec 88 06:50:54 EST To: NeWS-makers@brillig.umd.edu Subject: Re: looking for Clark Thomborson re SUG favor From: elbereth.rutgers.edu!ron.rutgers.edu!ron@rutgers.edu (Ron Natalie) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I've used a Moniterm 19" monitor with the Sun 4 color system. Works great and is much larger than the one that came with the Sun. I have no idea what it costs. -Ron From don@brillig.umd.edu Wed Dec 21 06:59:48 1988 Date: Wed, 21 Dec 88 06:59:48 EST To: NeWS-makers@brillig.umd.edu Subject: advanced SunView menu features in NeWS ? From: zodiac!joyce!ehrhart@ames.arc.nasa.gov (Tim Ehrhart) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Okay, I admit it, I'm totally wired on NeWS. The thing I do miss from SunView were some of the menu accelerators that were tunable via defaultsedit. Specifically I am referring to stay-up menus, highlighting of the initial selection, and/or remembering the last selected item from that submenu and highlighting that one instead of the initial one. I don't see capabilities like this in the whole /usr/NeWS/lib/NeWS directory. Am I looking in the right place ? Can the current litemenu stuff handle this, or has anyone do this ? Thanx, Tim Ehrhart ehrhart@spam.istc.sri.com From don@brillig.umd.edu Wed Dec 21 07:00:47 1988 Date: Wed, 21 Dec 88 07:00:47 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Re : Display PS vs NeWS From: mcvax!unido!ecrcvax!andy@uunet.uu.net (Andrew Dwelly) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <109@adobe.COM> greid@adobe.COM (Glenn Reid) writes: >And also, Display PostScript has nothing to do with X windows, other >than the ability to ge integrated into it. The NeXT machine does not >run X windows; it draws its windows with Display PostScript. Ahh, this is interesting. I just received the "Display Postscript preliminary documentation" (thanks Glenn), which I have so far only had a chance to glance at. What I did notice, however, is that input does not seem to be well supported. I understand, from following various comments in this forum that the reason is that DPS is really only meant for output, and supposed to run -with- a windowing system. So now I'm confused. Users of NeXT and Glenn, would you say DPS is a suitable basis for creating window systems with the associated paraphernalia ? would you claim that it is one component from several, making up a WISIWYG sort of interface? More pointedly, how does DPS support interaction between the cursor and "interface objects" ? Andy 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.] From don@brillig.umd.edu Wed Dec 21 14:23:27 1988 Date: Wed, 21 Dec 88 14:23:27 EST To: NeWS-makers@brillig.umd.edu Subject: Re: color imaging in NeWS From: diamond.bbn.com!mlandau@bbn.com (Matt Landau) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In comp.windows.news (<8812131751.AA10626@frame.com>), greg@gergle.UUCP writes: >>Is it possible to do color imaging in NeWS? >NeWS 1.1 uses a static color map. You get a close fit to the colors you request. The merged server, on the other hand, will provide complete access to the colormap if you want it. It kind of has to, to provide X colormap semantics, so there might as well be an access path from the NeWS side of things, too. None of this has anything to do with the original question of "How do you get 256 colors in a window without losing the rest of the colors on the screen". In the general case, on a machine that doesn't provide more than 8-bits of color and also doesn't provide multiple hardware colormaps, you can't. If you're REALLY clever (and willing to do a lot of work), you can sometimes dig around in the hardware colormap and find out enough about the colors on the screen at any given instant to build your own 256-entry colormap that has all of those colors in the places where other programs expect them to be, then install this map. Of course, that requires that your window system give you writeable colormap entries. A side question: I read recently that the PEX implementation for X11 has been subcontracted to Sun (so much for Sun not supporting X!!). Does anyone at Sun want to comment on whether there'll be some vaguely compatible PHIGS+ interface in NeWS or the merged server, allowing PEX-style 3-D graphics for people using a REAL window system? -- Matt Landau Riding shotgun down the avalanche mlandau@bbn.com From don@brillig.umd.edu Wed Dec 21 14:24:03 1988 Date: Wed, 21 Dec 88 14:24:03 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS available for HP workstations ? From: diamond.bbn.com!mlandau@bbn.com (Matt Landau) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In comp.windows.news (<8812191027.AA19821@ecn.uucp>), wim@ecn.UUCP (Wim Rijnsburger) writes: >At the moment we use SUN workstations, but we want to use [NeWS] >on HP workstations in the future. Does anyone know if NeWS is available >on HP and how we can get it? I've not heard of anyone porting NeWS to HP's, but this does bring up the larger question of "How can the interested NeWS-using community get NeWS on non-Sun hardware?" Basically, there seem to be 3 possibilities: (1) Sun ports and sells NeWS for other machines. This doesn't seem very likely, for lots of reasons. (2) Independent companies port NeWS to other hardware. There are a couple of examples of this already, including NeWS for the Parallax display hardware, NeWS for the Mac II, and NeWS for OS/2, but it's not clear that such companies will ever be able to supplant vendor-supplied window systems on other machines. (3) Other vendors license and provide NeWS technology, probably via their own supported, optimized ports of the merged server (whenever it becomes available). The third of these is clearly the most desirable from the user community's point of view -- only when vendors start shipping and supporting NeWS technology will it ever have a chance of becoming universal. Unfortunately, the politics of the workstation, OS, and window system worlds seems to make it unlikely that competing vendors will license and distribute NeWS or the merge on their own. Economic incentives, however, might help to convince them :-) What this suggests to me is that if you're in the position of buying and using workstations, and you also want (or need) to use NeWS, *make sure your vendor knows it*. There was a certain initial resistance on the part of some vendors to adopting NFS, but when customers started to demand it [you know, like telling your local salesman "We're not interested in purchasing any more of your machines until they support NFS"], things started to happen. Now you can take almost any collection of bizarre machines, from PC's to IBM mainframes, plug them all in on the same network, and have them share files relatively well. Unfortunately, I tend to think it's going to take similar pressure to make NeWS window system technology as widespread as NFS is now. So the general answer to "How can we get NeWS on hardware X?" is DEMAND IT! From don@brillig.umd.edu Wed Dec 21 14:39:32 1988 Date: Wed, 21 Dec 88 14:39:32 EST To: NeWS-makers@brillig.umd.edu Subject: Re: problems with NeWS From: prove@tcgould.tn.cornell.edu (Roger Ove) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article , hedrick@geneva.rutgers.edu (Charles Hedrick) writes: > I have seen two of the problems that you reported for NeWS 1.1: > windows not going away and memory not being released. However it > turns out that the system I saw it on was using a prerelease of NeWS > 1.1. The official release does not have these problems. Is it > possible that your copy of 1.1 is not up to date? Try "what > /usr/NeWS/bin/news_server" As I recall, the prerelease was mostly > 1/19/88. The final release has a number of modules with dates in > February, typically 2/20/88. I did this and the most recent dates were 2/10/88, none from 2/20/88. Are you sure about that date? I got v1.1 in August so it seems unlikely that this could be the problem, but I hope so. Roger Ove ove@ncsa.uiuc.edu From don@brillig.umd.edu Wed Dec 21 15:06:27 1988 Date: Wed, 21 Dec 88 15:06:27 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Re : Display PS vs NeWS From: pacbell!well!ejf@ames.arc.nasa.gov (Erik James Freed) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I think that what was meant by News being a 'superset' of Display Postscript was that News includes higher level Window manager type abilities. This assumes that other than that they cover the same functionality. (Which I suspect is very debatable.) I hate it when these discussions get unpleasantly personal. Erik Freed ejf@well.uucp ...pacbell!well!ejf From don@brillig.umd.edu Wed Dec 21 15:12:59 1988 Date: Wed, 21 Dec 88 15:12:59 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS available for HP workstations ? From: diamond.bbn.com!mlandau@bbn.com (Matt Landau) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In comp.windows.news, Bob Sutterfield writes: >I don't know whether the rest of the industry is going to (from their >point of view) roll over and let Sun dictate yet another standard ... > >The big boys know that NeWS is technically superior in a lot of ways, >and that the only way to battle it is with "market popularity". > .... Don't look for DEC to support NeWS any >time soon. This is exactly my point -- don't look for DEC to support NeWS any time soon *voluntarily*. But if enough of the potential customer base were to demand it, and to back up that demand by not buying any more DEC workstations until DEC supplied a NeWS server, that customer base might be able to make things happen. Of course, I have no idea whether there are enough DEC customers willing and able to make such a demand, and to back it up with action, but every little bit helps, and if people want to see NeWS propogated to other machines, they're going to have to start using their economic influence to make it happen, as they did with NFS. -- Matt Landau "Don't make me angry. mlandau@bbn.com You wouldn't like me when I'm angry." From don@brillig.umd.edu Wed Dec 21 21:15:36 1988 Date: Wed, 21 Dec 88 21:15:36 EST To: NeWS-makers@brillig.umd.edu Subject: A NeWS Stocking Stuffer From: rberlin@sun.com (Rich Berlin) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Here's a little toy for Christmas. Enjoy. -- Rich %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % o % Happy Holidays from: / \ % %%%%%%% % Sun Microsystems' ( o o ) % Corporate Demo Group (% \ %) % 2550 Garcia Ave \%V%/ % Mountain View, CA 94043 % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Mistletoe, in its own window. Figuring out how to get MOTAS to stand % under it is up to you (but please see bugs list below). % % Bugs (innocuous, as far as I can tell): % % % o It sometimes gets confused about where to put the window when you % move it. If this is the case, change the position-offset % from 0 to 192. % % o The transparent parts of the window don't always update properly, so % depending or what's in your user.ps, it may not look so great. % (In mine, the framebuffer is retained, but the windows aren't. % Perhaps that will help.) % % o Can't shrink or grow (I know how to do it, but my green thumb is sore.) % % o The window outline clips too much of the picture. It looked better % as raw graphics than it does as a window. % % o The mouse interest should really be *under* the mistletoe, % not *on* it, but that just seemed too difficult to implement. % (For the curious, move the mouse so that it crosses the sprig.) % % o The /move message seems to work sporadically when sent to a member % of TheAppropriateSex; also, some members of that class moveto % beneath the mistletoe without being sent any message at all! % Maybe a problem with the method I'm using, but the instances % of the subclass I'm dealing with don't always exhibit % predictable behavior, so I can't be certain. I'm especially % confused because it appears that members respond differently % depending on who sends the message. I'm afraid you're on your own % with this one--sorry. % % Author: Richard Berlin 21 December 1988 % /position-offset 0 def %%%% Utilities %%%% % Concatenate two arrays. If either one is executable, the result % will be, too. /array-concat { % array1 array2 => concatenated array 2 copy xcheck exch xcheck or 3 1 roll cvlit exch cvlit exch 2 copy length exch length add array % exec? a1 a2 new dup dup 5 3 roll % new new new a1 a2 2 copy pop length exch % new new new a1 sizeof(a1) a2 4 -1 roll 3 1 roll putinterval 0 exch putinterval exch {cvx} if } def % Remove an item from a menu /remove-menu-item { % key menu => - dup 3 1 roll /searchkey exch send { /deleteitem 3 -1 roll send} { pop } ifelse } def /mistletoe-sprig-path { 83.6667 73 moveto 81.4444 71.7222 83.5556 72.8889 84.3333 74 curveto 85.1111 75.1111 87.4445 75.9444 88.3333 79.6667 curveto 89.2222 83.3889 88.6667 93.8889 89.6667 96.3333 curveto 90.6667 98.7778 93.9444 93.7222 94.3333 94.3333 curveto 94.7222 94.9444 91.5 97.7222 92 100 curveto 92.5 102.278 95.6111 109 97.3333 108 curveto 99.0556 107 102.278 98.3889 102.333 94 curveto 102.389 89.6111 100.778 85.1667 97.6667 81.6667 curveto 94.5555 78.1667 85.8889 74.2778 83.6667 73 curveto 75.6667 69.6667 moveto 77.3889 69.5556 77.8889 70.2222 75.6667 70 curveto 73.4444 69.7778 68.2222 66.6111 62.3333 68.3333 curveto 56.4444 70.0556 44.1111 76.1111 40.3333 80.3333 curveto 36.5556 84.5556 37.7222 93.9444 39.6667 93.6667 curveto 41.6111 93.3889 47.7222 82.5 52 78.6667 curveto 56.2778 74.8333 63.1111 72 65.3333 70.6667 curveto 67.5556 69.3333 63.6111 70.8333 65.3333 70.6667 curveto 67.0556 70.5 73.9444 69.7778 75.6667 69.6667 curveto 77.3333 115 moveto 76.1111 112.944 78.3889 114.167 77 115.333 curveto 75.6111 116.5 70.6667 118.556 69 122 curveto 67.3333 125.444 65.5556 132.056 67 136 curveto 68.4444 139.944 75.3333 144.167 77.6667 145.667 curveto 80 147.167 79.8889 148 81 145 curveto 82.1111 142 84.9444 132.667 84.3333 127.667 curveto 83.7222 122.667 78.5556 117.056 77.3333 115 curveto 82 142 moveto 81.7778 141.556 80 140.444 82 142 curveto 84 143.556 90.7222 146 94 151.333 curveto 97.2778 156.667 100.667 170.444 101.667 174 curveto 102.667 177.556 101.222 176.167 100 172.667 curveto 98.7778 169.167 97.1111 157.667 94.3333 153 curveto 91.5556 148.333 85.3889 146.5 83.3333 144.667 curveto 81.2778 142.833 82.2222 142.444 82 142 curveto 90.3333 167 moveto 91.0556 165 89.2222 165.833 90.3333 167 curveto 91.4444 168.167 95.5556 170.389 97 174 curveto 98.4444 177.611 99.7778 185.944 99 188.667 curveto 98.2222 191.389 94.5 191.944 92.3333 190.333 curveto 90.1667 188.722 86.3333 182.889 86 179 curveto 85.6667 175.111 89.6111 169 90.3333 167 curveto 77.3333 146.667 moveto 79.2222 145.778 78.0556 146.167 77 147 curveto 75.9444 147.833 72.3889 148.444 71 151.667 curveto 69.6111 154.889 69 162.167 68.6667 166.333 curveto 68.3333 170.5 69.7222 176.611 69 176.667 curveto 68.2778 176.722 64.8889 170.722 64.3333 166.667 curveto 63.7778 162.611 63.5 155.667 65.6667 152.333 curveto 67.8333 149 75.4444 147.556 77.3333 146.667 curveto 37.3333 128 moveto 36.7778 126.667 36 126.667 37.6667 128 curveto 39.3333 129.333 45.5 132.222 47.3333 136 curveto 49.1667 139.778 49.5556 147.278 48.6667 150.667 curveto 47.7778 154.056 43.3333 157.778 42 156.333 curveto 40.6667 154.889 40.8333 145.389 40.6667 142 curveto 40.5 138.611 41.5556 138.333 41 136 curveto 40.4444 133.667 37.8889 129.333 37.3333 128 curveto 42.6667 101 moveto 43.5556 100.333 41.3333 101.778 40 102.333 curveto 38.6667 102.889 36.3889 102.611 34.6667 104.333 curveto 32.9444 106.056 30 109.5 29.6667 112.667 curveto 29.3333 115.833 31.4444 121.611 32.6667 123.333 curveto 33.8889 125.056 36.9444 124.611 37 123 curveto 37.0556 121.389 33.3889 116.444 33 113.667 curveto 32.6111 110.889 33.0556 108.444 34.6667 106.333 curveto 36.2778 104.222 41.7778 101.667 42.6667 101 curveto 31.6667 130.667 moveto 31.0556 131.056 32.7222 129.5 31.3333 131 curveto 29.9444 132.5 24.3333 135.889 23.3333 139.667 curveto 22.3333 143.444 24 150.389 25.3333 153.667 curveto 26.6667 156.944 30.3333 159.222 31.3333 159.333 curveto 32.3333 159.444 31.6667 158.111 31.3333 154.333 curveto 31 150.556 28.7222 140.944 29.3333 136.667 curveto 29.9444 132.389 34.6111 129.667 35 128.667 curveto 35.3889 127.667 32.2778 130.278 31.6667 130.667 curveto 84.6667 180.333 moveto 84.9444 179.278 86.2778 179.611 84.6667 180.333 curveto 83.0556 181.056 76.6667 183.056 75 184.667 curveto 73.3333 186.278 73.8333 189.222 74.6667 190 curveto 75.5 190.778 78.6111 189.889 80 189.333 curveto 81.3889 188.778 82.2222 188.167 83 186.667 curveto 83.7778 185.167 84.3889 181.389 84.6667 180.333 curveto 100 177.333 moveto 99.8889 176.333 99.1667 176.333 100 177.333 curveto 100.833 178.333 104.167 182 105 183.333 curveto 105.833 184.667 105.722 185.333 105 185.333 curveto 104.278 185.333 101.389 183.667 100.667 183.333 curveto 99.9444 183 100.778 184.333 100.667 183.333 curveto 100.556 182.333 100.111 178.333 100 177.333 curveto 80.6667 115 moveto 81.6111 114.833 79.4444 112.222 80.6667 115.333 curveto 81.8889 118.444 87.5 129.5 88 133.667 curveto 88.5 137.833 85.5 139.444 83.6667 140.333 curveto 81.8333 141.222 78.4444 141.056 77 139 curveto 75.5556 136.944 75.3333 131.778 75 128 curveto 74.6667 124.222 74.0556 118.5 75 116.333 curveto 75.9444 114.167 79.7222 115.167 80.6667 115 curveto 77.3333 112 moveto 77.4444 111.722 78.0556 111.889 77 112 curveto 75.9444 112.111 71.1111 112.389 71 112.667 curveto 70.8889 112.944 75.2778 113.778 76.3333 113.667 curveto 77.3889 113.556 77.2222 112.278 77.3333 112 curveto 81.6667 112.333 moveto 81.6667 111.778 81.0555 111.833 81.6667 112.333 curveto 82.2778 112.833 85.3333 114.778 85.3333 115.333 curveto 85.3333 115.889 82.2778 116.167 81.6667 115.667 curveto 81.0555 115.167 81.6667 112.889 81.6667 112.333 curveto 34 141.333 moveto 34.1667 139.389 33.2222 139.778 34 141.333 curveto 34.7778 142.889 37.3889 147.611 38.6667 150.667 curveto 39.9444 153.722 41.8333 158.167 41.6667 159.667 curveto 41.5 161.167 39.1111 160.778 37.6667 159.667 curveto 36.2222 158.556 33.7778 154.111 33 153 curveto 32.2222 151.889 32.8333 154.944 33 153 curveto 33.1667 151.056 33.8333 143.278 34 141.333 curveto 45 104.333 moveto 45.6667 104.333 45.4444 104.056 44.6667 104.333 curveto 43.8889 104.611 41 106 40.3333 106 curveto 39.6667 106 39.8889 104.611 40.6667 104.333 curveto 41.4444 104.056 44.3333 104.333 45 104.333 curveto 46.6667 105.667 moveto 46.2778 105.278 46.2778 105.111 46.3333 105.667 curveto 46.3889 106.222 46.6111 108.611 47 109 curveto 47.3889 109.389 48.7222 108.556 48.6667 108 curveto 48.6111 107.444 47.0556 106.056 46.6667 105.667 curveto 88 167.667 moveto 87.9444 167.611 88.1667 167.444 87.6667 167.667 curveto 87.1667 167.889 85.1667 168.833 85 169 curveto 84.8333 169.167 86.4444 168.722 86.6667 168.667 curveto 86.8889 168.611 86.1111 168.778 86.3333 168.667 curveto 86.5556 168.556 87.7222 168.167 88 168 curveto 88.2778 167.833 88.0556 167.722 88 167.667 curveto 95.6667 1.66667 moveto 96.2778 -2.72222 95.5556 2.66667 96.3333 2.66667 curveto 97.1111 2.66667 100.889 -4.44444 100.333 1.66667 curveto 99.7778 7.77778 96.1111 27.1111 93 39.3333 curveto 89.8889 51.5556 83.9444 62.7222 81.6667 75 curveto 79.3889 87.2778 80.1111 113.944 79.3333 113 curveto 78.5556 112.056 74.7778 83.3333 77 69.3333 curveto 79.2222 55.3333 89.5556 40.2778 92.6667 29 curveto 95.7778 17.7222 95.0555 6.05556 95.6667 1.66667 curveto 80 70.3333 moveto 80.1667 69.5556 86.2222 66.7222 80 72 curveto 73.7778 77.2778 49.3889 96.5556 42.6667 102 curveto 35.9444 107.444 40.9444 98.2778 39.6667 104.667 curveto 38.3889 111.056 35.4444 136.389 35 140.333 curveto 34.5556 144.278 35.4444 134.333 37 128.333 curveto 38.5556 122.333 37.6111 113.111 44.3333 104.333 curveto 51.0556 95.5556 71.5556 80.2778 77.3333 75.6667 curveto 83.1111 71.0555 78.5556 77.5555 79 76.6667 curveto 79.4444 75.7778 79.8333 71.1111 80 70.3333 curveto 81.6667 144.333 moveto 81.3333 144.222 80.3333 140.444 81.6667 144.333 curveto 83 148.222 88.1111 164.111 89.6667 167.667 curveto 91.2222 171.222 92 169.444 91 165.667 curveto 90 161.889 84.8889 148.444 83.6667 145 curveto 82.4444 141.556 84 145.111 83.6667 145 curveto 83.3333 144.889 82 144.444 81.6667 144.333 curveto 43.3333 107 moveto 43.1111 105 42.5556 105.611 43.3333 107.333 curveto 44.1111 109.056 47.5 114.5 48 117.333 curveto 48.5 120.167 46.8889 124 46.3333 124.333 curveto 45.7778 124.667 45.1667 122.222 44.6667 119.333 curveto 44.1667 116.444 43.5556 109 43.3333 107 curveto 91.6667 27.3333 moveto 92.1111 26.8333 95.8889 27.3333 91.6667 27.3333 curveto 87.4444 27.3333 72.9444 25.8333 66.3333 27.3333 curveto 59.7222 28.8333 55 32.0556 52 36.3333 curveto 49 40.6111 47.3889 48.7778 48.3333 53 curveto 49.2778 57.2222 53.4444 62.1111 57.6667 61.6667 curveto 61.8889 61.2222 69.1111 55.0556 73.6667 50.3333 curveto 78.2222 45.6111 83.1111 36.1111 85 33.3333 curveto 86.8889 30.5556 84.3333 34.1667 85 33.6667 curveto 85.6667 33.1667 87.8889 31.3889 89 30.3333 curveto 90.1111 29.2778 91.2222 27.8333 91.6667 27.3333 curveto 95.3333 29.6667 moveto 95.4445 29.3889 94.2778 28.7778 95.3333 29.6667 curveto 96.3889 30.5556 98.4444 32.7222 101.667 35 curveto 104.889 37.2778 110.667 38.7222 114.667 43.3333 curveto 118.667 47.9444 124.611 57.6667 125.667 62.6667 curveto 126.722 67.6667 123.111 74.9445 121 73.3333 curveto 118.889 71.7222 115.667 58.7222 113 53 curveto 110.333 47.2778 108.056 42.6111 105 39 curveto 101.944 35.3889 96.2778 32.8889 94.6667 31.3333 curveto 93.0556 29.7778 95.2222 29.9444 95.3333 29.6667 curveto 80 79.6667 moveto 80.2222 79.3333 79.3333 78.6667 80 79.6667 curveto 80.6667 80.6667 83.7222 84.5555 84 85.6667 curveto 84.2778 86.7778 82.5556 87 81.6667 86.3333 curveto 80.7778 85.6667 78.9444 82.7778 78.6667 81.6667 curveto 78.3889 80.5555 79.7778 80 80 79.6667 curveto 37 130.667 moveto 37 130.944 36.9444 130.222 37 130.667 curveto 37.0556 131.111 37.0556 133.278 37.3333 133.333 curveto 37.6111 133.389 38.6667 131.611 38.6667 131 curveto 38.6667 130.389 37.6111 130 37.3333 129.667 curveto 37.0556 129.333 37.0556 128.833 37 129 curveto 36.9444 129.167 37 130.389 37 130.667 curveto 35 131.333 moveto 35.0556 131.5 35.2778 131.222 35 131.333 curveto 34.7222 131.444 34 132.333 33.3333 132 curveto 32.6667 131.667 30.7222 130 31 129.333 curveto 31.2778 128.667 34.3889 127.833 35 128 curveto 35.6111 128.167 34.6667 129.778 34.6667 130.333 curveto 34.6667 130.889 34.9444 131.167 35 131.333 curveto 33.6667 132 moveto 33.3333 132.056 33.9444 131.611 33.6667 132 curveto 33.3889 132.389 32 133.889 32 134.333 curveto 32 134.778 33.0556 135.111 33.6667 134.667 curveto 34.2778 134.222 35.6667 132.111 35.6667 131.667 curveto 35.6667 131.222 34 131.944 33.6667 132 curveto 77 70 moveto 76.8889 69.7778 77.6111 69.6111 77 70 curveto 76.3889 70.3889 73.7778 71.6667 73.3333 72.3333 curveto 72.8889 73 73.6111 74.1667 74.3333 74 curveto 75.0556 73.8333 77.2222 72 77.6667 71.3333 curveto 78.1111 70.6667 77.1111 70.2222 77 70 curveto 92.3333 29 moveto 92.2778 28.5556 92.7778 28.6111 92.3333 29 curveto 91.8889 29.3889 90.3333 30.6111 89.6667 31.3333 curveto 89 32.0556 87.8333 33.2778 88.3333 33.3333 curveto 88.8333 33.3889 92 32.3889 92.6667 31.6667 curveto 93.3333 30.9444 92.3889 29.4444 92.3333 29 curveto 93.6667 31.6667 moveto 93.3333 31.5556 93.1111 31.1667 93 32 curveto 92.8889 32.8333 92.6111 35.6667 93 36.6667 curveto 93.3889 37.6667 95 38.6667 95.3333 38 curveto 95.6667 37.3333 95.2778 33.7222 95 32.6667 curveto 94.7222 31.6111 94 31.7778 93.6667 31.6667 curveto } def /bow-path { 0 -7 translate 57 24 moveto 57.4444 23.8889 50.3333 25.9444 57 24 curveto 63.6667 22.0556 97.6667 12.8889 97 12.3333 curveto 96.3333 11.7778 60.1111 18.6111 53 20.6667 curveto 45.8889 22.7222 53.6667 24.1111 54.3333 24.6667 curveto 55 25.2222 56.5556 24.1111 57 24 curveto 96.6667 13.4335 moveto 106.778 12.8068 103.111 9.67298 96.3333 13.4335 curveto 89.5556 17.194 67.8333 35.7181 56 35.9967 curveto 44.1667 36.2752 18.7778 19.0047 25.3333 15.1048 curveto 31.8889 11.205 90.3889 10.1605 95.3333 12.5978 curveto 100.278 15.0352 64.9444 28.9631 55 29.7291 curveto 45.0556 30.4952 28.7222 19.91 35.6667 17.194 curveto 42.6111 14.4781 86.5555 14.0603 96.6667 13.4335 curveto 94.6667 16 moveto 90.9444 16 89.7778 10.9444 94.6667 16 curveto 99.5556 21.0556 114.889 43.8333 124 46.3333 curveto 133.111 48.8333 149.111 36.1667 149.333 31 curveto 149.556 25.8333 133.889 18.3333 125.333 15.3333 curveto 116.778 12.3333 98.3333 8.66667 98 13 curveto 97.6667 17.3333 116.056 38.6667 123.333 41.3333 curveto 130.611 44 142.722 33.2222 141.667 29 curveto 140.611 24.7778 124.833 18.1667 117 16 curveto 109.167 13.8333 98.3889 16 94.6667 16 curveto 98.6667 13.6667 moveto 96.2222 11.8333 95.0555 9.94444 98.6667 13.6667 curveto 102.278 17.3889 116.167 33.3333 120.333 36 curveto 124.5 38.6667 124.833 31.5556 123.667 29.6667 curveto 122.5 27.7778 117.5 27.3333 113.333 24.6667 curveto 109.167 22 101.111 15.5 98.6667 13.6667 curveto 0 7 translate } def /berries-path { 82 78 moveto 82 78 3 0 360 arc 84 73 3 0 360 arc 79 73 3 0 360 arc 37 133 moveto 37 133 2.5 0 360 arc 38 130 2.5 0 360 arc 35 130 2.5 0 360 arc 86 149 moveto 86 149 2.5 0 360 arc 85 152 2.5 0 360 arc 82 150 2.5 0 360 arc } def /lips-color {.8 0 0} def /TmR18 /Times-Roman findfont 18 scalefont def /lips-path { % x y => - 56.2914 81.7585 moveto 53.6305 84.0504 54.6825 81.8324 56.2914 81.7585 curveto 57.9004 81.6845 62.3559 82.276 65.945 81.3149 curveto 69.5341 80.3538 73.9896 75.7699 77.8263 75.9917 curveto 81.6629 76.2135 85.5615 81.3888 88.965 82.6457 curveto 92.3685 83.9025 99.1754 85.9727 98.2472 83.5329 curveto 97.319 81.0931 86.861 69.8553 83.3956 68.0069 curveto 79.9302 66.1586 79.3114 72.4429 77.455 72.4429 curveto 75.5985 72.4429 75.7842 66.4544 72.2569 68.0069 curveto 68.7297 69.5595 58.9524 79.4666 56.2914 81.7585 curveto 60.8129 81.5476 moveto 60.7159 80.9637 59.6004 81.5476 60.8129 81.5476 curveto 62.0254 81.5476 66.1962 81.9723 68.0877 81.5476 curveto 69.9791 81.1229 70.8521 78.8404 72.1616 78.9996 curveto 73.471 79.1589 74.441 82.0784 75.9445 82.5031 curveto 77.4479 82.9278 79.8729 82.0254 81.1823 81.5476 curveto 82.4918 81.0699 81.9583 79.1589 83.8013 79.6366 curveto 85.6442 80.1144 93.2585 82.1315 92.24 84.4141 curveto 91.2216 86.6967 82.8313 93.2259 77.6904 93.332 curveto 72.5496 93.4382 64.2078 87.0152 61.3949 85.0511 curveto 58.5819 83.087 60.9099 82.1315 60.8129 81.5476 curveto } def /balloon-path { -10 -110 translate 106 145 moveto 106.167 145.444 108.833 138.167 106 145 curveto 103.167 151.833 88.2222 185.722 89 186 curveto 89.7778 186.278 105.889 153.444 110.667 146.667 curveto 115.444 139.889 110.889 146.056 117.667 145.333 curveto 124.444 144.611 142.667 145.389 151.333 142.333 curveto 160 139.278 166.722 134.167 169.667 127 curveto 172.611 119.833 173.444 106.444 169 99.3333 curveto 164.556 92.2222 152.611 86.7222 143 84.3333 curveto 133.389 81.9444 120.222 82.8333 111.333 85 curveto 102.444 87.1667 94.5 91.3889 89.6667 97.3333 curveto 84.8333 103.278 82.2778 114.833 82.3333 120.667 curveto 82.3889 126.5 86.2222 128.722 90 132.333 curveto 93.7778 135.944 102.333 140.222 105 142.333 curveto 107.667 144.444 105.833 144.556 106 145 curveto 10 110 translate } def /lip-window null def /lips { % x y => - translate /lip-window framebuffer /new LiteWindow send def { /paintframe { } def /paintclient { } def map % unmap FrameCanvas unmapcanvas ClientCanvas unmapcanvas FrameCanvas /transparent true put FrameCanvas /retained true put ClientCanvas /transparent true put 1 -1 scale newpath lips-path balloon-path closepath 1 -1 scale FrameCanvas reshapecanvas FrameCanvas mapcanvas ClientCanvas mapcanvas /PaintFrameBorder { % - => - (Paint frame border areas) } def /PaintClient { FrameCanvas setcanvas 1 -1 scale 0 setlinecap 10 setmiterlimit 2 setlinejoin 0.1 setlinewidth 0 setgray newpath lips-path closepath gsave lips-color setrgbcolor fill grestore stroke newpath balloon-path closepath gsave .5 .7 .7 setrgbcolor fill grestore stroke TmR18 setfont 85 15 moveto gsave 1 -1 scale (Kiss Me!) 0 setgray show grestore 1 -1 scale } def /Pucker { map paint totop .025 sleep unmap } def (Resize) FrameMenu remove-menu-item (Stretch Corner) FrameMenu remove-menu-item (Stretch Edge) FrameMenu remove-menu-item (Close) FrameMenu remove-menu-item } lip-window send /unmap lip-window send } def /mistletoe { % x y => - % First create the pop-up window for the kiss 2 copy 130 sub exch 30 add exch gsave lips grestore % Now make the mistletoe window. translate /mwin framebuffer /new LiteWindow send def { /paintframe { } def /paintclient { } def map FrameCanvas unmapcanvas ClientCanvas unmapcanvas FrameCanvas /transparent true put ClientCanvas /transparent true put 1 -1 scale newpath mistletoe-sprig-path bow-path berries-path closepath 1 -1 scale FrameCanvas reshapecanvas FrameCanvas mapcanvas ClientCanvas mapcanvas /PaintFrameBorder { % - => - (Paint frame border areas) } def /PaintClient { FrameCanvas setcanvas 1 -1 scale 0 setlinecap 10 setmiterlimit 2 setlinejoin 0.1 setlinewidth .25 .4 .25 setrgbcolor newpath mistletoe-sprig-path closepath gsave .5 .6 .5 setrgbcolor fill grestore stroke % The bow newpath bow-path closepath gsave .8 0 0 setrgbcolor eofill grestore .5 0 0 setrgbcolor stroke newpath berries-path closepath gsave .9 setgray fill grestore 0 setgray stroke 1 -1 scale } def % Set up so that when we touch the mistletoe, it demands a kiss. { /Pucker lip-window send } /EnterFrame where pop /EnterFrame get array-concat /EnterFrame exch def % Add code to the move method so the lips move with us. { 2 copy 130 sub exch 30 add exch /move lip-window send systemdict /sunview known not {position-offset sub} if } /move where pop /move get array-concat /move exch def % Don't allow resizing or close (Resize) FrameMenu remove-menu-item (Stretch Corner) FrameMenu remove-menu-item (Stretch Edge) FrameMenu remove-menu-item (Close) FrameMenu remove-menu-item } mwin send /paint mwin send } def 180 880 mistletoe From don@brillig.umd.edu Wed Dec 21 21:23:14 1988 Date: Wed, 21 Dec 88 21:23:14 EST To: NeWS-makers@brillig.umd.edu Subject: Re: problems with NeWS From: aramis.rutgers.edu!geneva.rutgers.edu!hedrick@rutgers.edu (Charles Hedrick) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have seen two of the problems that you reported for NeWS 1.1: windows not going away and memory not being released. However it turns out that the system I saw it on was using a prerelease of NeWS 1.1. The official release does not have these problems. Is it possible that your copy of 1.1 is not up to date? Try "what /usr/NeWS/bin/news_server" As I recall, the prerelease was mostly 1/19/88. The final release has a number of modules with dates in February, typically 2/20/88. From don@brillig.umd.edu Wed Dec 21 21:23:59 1988 Date: Wed, 21 Dec 88 21:23:59 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Display PS vs NeWS From: don@brillig.umd.edu (Don Hopkins) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Glenn, Is there any effort at Adobe to make your extension to Red Book PostScript compatible with the NeWS extension? Display PostScript and NeWS each have a different set of extensions to Red Book PostScript, but where they overlap, are the names the same? And in those cases, are the arguments the same? Some examples of the types of NeWS extension I mean: currentpath % - => path setpath % path => - currentstate % - => graphics_state setstate % graphics_state => - copyarea % dx dy => - undef % dict key => - dictbegin % - => - (new dict pushed on dict stack) dictend % - => dict (popped from dict stack) case % value {key {proc} key key {proc} ... /Default {proc}} => - append % obj1 obj2 => obj3 printf % formatstring arrayarg => - sprintf % formatstring arrayarg => sting stringbbox % string => x y w h I don't have the Display PostScript documentation yet, but I'm ordering it soon. I'm looking forward to reading about it, and even further forward to using it! I think it would be a great idea to make NeWS and Display PostScript compatible. What do you people at Adobe think of Display PostScript "clones"? I hope you don't find the inevitable alarming. I certianly think people would be encouraged to write Display PostScript applications, if they knew they would run on top of X11/NeWS as well. Is there any reason that NeWS couldn't be programmed to emulate Display PostScript? Is there anything about Display PostScript's model of processes, drawing surfaces, interprocess and network communication, that couldn't be simulated in NeWS by a simple compatibility package, and maybe a few gratuitious server extensions? NeWS could easily be taught to understand the pswrap byte encoding, and communicate with Display PostScript clients. Adobe hasn't gone to any effort to make Display PostScript incompatible with NeWS, have they? (Like giving the function that closes a network connection the two character name "^C". ;-) Does Adobe have any plans about adopting a classing mechanism? Have you considered Owen Densmore's public domain object oriented PostScript programming package, class.ps? It's some really elegant code, written in Red Book PostScript, and it's very well matched with the PostScript language and imaging model. It makes PostScript into a Smalltalk-like programming environment! Now there's a version supporting multiple inheritance. I really enjoy programming in object oriented PostScript, and I want to see the PostScript language evolve to its full potential. Standard Common object oriented PostScript would be a good thing! -Don From don@brillig.umd.edu Wed Dec 21 21:24:08 1988 Date: Wed, 21 Dec 88 21:24:08 EST To: NeWS-makers@brillig.umd.edu Subject: Is there a NeWS product available for Apollo? From: tank!nic.MR.NET!eta!skappel@handies.ucar.edu (Steve kappel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I believe I read somewhere that a 3rd party is selling a NeWS ported to the Apollo. Can anybody tell me who that may be? Please email to me and I will post the results. Thanks, Steve _______________________________________________________________________________ Steve Kappel internet: skappel@eta.com Software Engineer uucp : {rutgers,amdahl,ihnp4}!meccts!eta!skappel ETA Systems, Inc. 1450 Energy Park Drive St. Paul, MN 55108 The New Force In Supercomputing From don@brillig.umd.edu Wed Dec 21 23:24:39 1988 Date: Wed, 21 Dec 88 23:24:39 EST To: NeWS-makers@brillig.umd.edu Subject: Recommended Reading From: pdn!reggie@uunet.uu.net (George W. Leach) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I would recommend reading "Window Systems Should Be Transparent", by Rob Pike. It appears in the Controversy Section of the recently published Computing Systems (vol. 1, no. 3, Summer 1988). Computing Systems is the quarterly publication of the USENIX Association. This paper addresses numerous issues concerning the user interface provided by windowing systems, including some discussed in comp.cog-eng lately. Having used mux (the windowing system for the Blit under Research UNIX) for several years and now having to deal with other windowing systems, I tend to agree with much of what Pike has to say. -- George W. Leach Paradyne Corporation ..!uunet!pdn!reggie Mail stop LG-129 Phone: (813) 530-2376 P.O. Box 2826 Largo, FL USA 34649-2826 From don@brillig.umd.edu Wed Dec 21 23:27:16 1988 Date: Wed, 21 Dec 88 23:27:16 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Recommended Reading From: sgi!daisy!klee@ucbvax.Berkeley.EDU (Ken Lee) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <5149@pdn.UUCP> reggie@pdn.UUCP (George W. Leach) writes: >I would recommend reading "Window Systems Should Be Transparent", >by Rob Pike. It appears in the Controversy Section of the recently >published Computing Systems (vol. 1, no. 3, Summer 1988). A similar, but perhaps more comprehensive, paper is "A Taxonomy of Window Manager User Interfaces" by Brad Myers, *IEEE Computer Graphics and Applications* magazine, September, 1988. Myers is well known in the user interface world, while Pike is famous for his Blit work, so the emphases of the 2 papers are slightly different. Both are good reading. Ken Lee Daisy Systems Corp., Interactive Graphics Tools Dept. -- uucp: uunet!daisy!klee arpanet: daisy!klee@uunet.uu.net "DC6 which is being used for [Contra weapons supply] runs out of New Orleans is probably being used for drug runs into U.S." - Oliver North, August, 1985 From don@brillig.umd.edu Wed Dec 21 23:27:58 1988 Date: Wed, 21 Dec 88 23:27:58 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Simulating Users on Sun 3/60 running X Windows From: vsi1!daver!athsys!jim@ames.arc.nasa.gov (Jim Becker) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I have coded this and it is fully functional. I will be releasing the source code to the net after a brief beta period of about two weeks. Thanks for all the suggestions from everyone, too bad I can't wait for the merged News/X server in July!! -Jim Becker ...sun!athsys!jim From don@brillig.umd.edu Thu Dec 22 03:44:29 1988 Date: Thu, 22 Dec 88 03:44:29 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS and DPS, who wins? From: nyser!cmx!krempel@itsgw.rpi.edu (Henry BJ Krempel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) This is another perfect example of the inherent contradiction that exists when a "standard" is created and maintained by a commercial organisation. The "standard" PostScript is missing a few key features to make it useful to drive a display. Sun has put time and effort into the product that first made screen PostScript possible: NeWS. After Sun was through with the "feasibility study," Adobe decided that screen PostScript was interesting and solved these problems again, in a new and incompatible manner. Adobe feels that it is in its' best interest to create an incompatible system, and this may unfortunately seem to be true, with possible license fees coming in for systems running under both X and NeWS. (This can never happen: I'm sure some NeWS hacker will put something together) If Sun creates a Display PostScript compatibility mode, Adobe will continually create new incompatible undocumented features, with Sun development continually in Catch-Up mode. This is the old dilemma between open and proprietary systems, and this is the way it was in the bad old days. "Doesn't your emulator support extended REV 2 gobbledy-gook? Oh well, I guess you made a mistake" I can here those doors slamming now "the right choice." Who will win "the fight"? I don't know, but I know that with things the way they are, we all lose. I'm afraid there just aren't enough PostScript programmers on this planet to support two standards, and two window systems (NeWS and NeXTstep) whose useage and availability pales in comparison with X. We don't get fooled again! or do we?-- Henry B. J. Krempel Computing and Network Services (CNS) Syracuse University 250 Machinery Hall, Syracuse, N.Y. 13244 From don@brillig.umd.edu Thu Dec 22 17:12:38 1988 Date: Thu, 22 Dec 88 17:12:38 EST To: NeWS-makers@brillig.umd.edu Subject: Re: Display PS vs NeWS From: mcvax!ukc!harrier.ukc.ac.uk!eagle.ukc.ac.uk!iau@uunet.uu.net (I.A.Utting) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <15066@mimsy.UUCP> don@brillig.umd.edu.UUCP (Don Hopkins) writes: ->Is there any effort at Adobe to make your extension to Red Book ->PostScript compatible with the NeWS extension? [ ... eg. ] ->currentpath % - => path ->setpath % path => - ->currentstate % - => graphics_state ->setstate % graphics_state => - ->copyarea % dx dy => - ->undef % dict key => - ->dictbegin % - => - (new dict pushed on dict stack) ->dictend % - => dict (popped from dict stack) ->case % value {key {proc} key key {proc} ... /Default {proc}} => - ->append % obj1 obj2 => obj3 ->printf % formatstring arrayarg => - ->sprintf % formatstring arrayarg => sting ->stringbbox % string => x y w h While agreeing entirely with your general point, at least the last 5 (7?) of these are implementable directly in Red Book PostScript, although it would be nice if they were "officially sanctioned" by Adobe. ->Does Adobe have any plans about adopting a classing mechanism? Have ->you considered Owen Densmore's public domain object oriented ->PostScript programming package, class.ps? Is this generally available? How can I get hold of details, or even a copy? Ian. From don@brillig.umd.edu Thu Dec 22 23:41:27 1988 Date: Thu, 22 Dec 88 23:41:27 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS and DPS, who wins? From: ico!rcd@handies.ucar.edu (Dick Dunn) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <926@cmx.npac.syr.edu>, krempel@cmx.npac.syr.edu (Henry BJ Krempel) writes: > This is another perfect example of the inherent contradiction that > exists when a "standard" is created and maintained by a commercial > organisation. Why is there an inherent contradiction? Is it really worse to have standards administered by an organization which really cares about the standard (as the basis for its raison d'etre) than to hand them off to some organization whose primary purpose is simply the cranking out of standards? Standards organizations often draw the membership of a group for technical development of a particular standard from organizations which want to control an evolving standard to capture market--whatever the cost to the standard itself. Some members of standards committees are sent because it gets them out of the office and out of the way! I've sat in on fortunately few real standards meetings, but enough to disgust me with the bureaucratic non-commercial standards process. A commercially-maintained standard may have different problems, but I hardly think it will turn out any worse. > The "standard" PostScript is missing a few key features to make it > useful to drive a display... I'm sure Adobe was aware of this...but at the point they released PostScript, they weren't aiming at displays, and the hardware horsepower for PostScript on displays wasn't widely enough available back then. >...Sun has put time and effort into the > product that first made screen PostScript possible: NeWS. After Sun > was through with the "feasibility study," Adobe decided that screen > PostScript was interesting and solved these problems again, in a new > and incompatible manner... Is there any reason to think that Adobe wasn't working on PostScript for displays? Remember that SunDEW (the precursor to NeWS) first really popped to the surface in early '86, and it was nowhere near to being a product at that point (at least by its author's claims). NeWS really happened in '87, and Display PostScript in '88. The results (NeWS and DPS) are different at a very fundamental, conceptual level. If you try to look at Sun's work as any sort of precursor to Adobe's, you have to wonder why they're so different! They sure look like two independent developments. > Adobe feels that it is in its' best interest to create an incompatible > system,... Did you get this from talking to Adobe? I'd be surprised. I'm not naive; I know that companies DO introduce incompatibilities for the sake of profit and market share, but I see no evidence that it's going on here. I think it's reckless to attribute that sort of motive without good reason. >...and this may unfortunately seem to be true, with possible > license fees coming in for systems running under both X and NeWS. But now you're getting closer to the point that makes all your carping about Adobe seem questionable: Sun apparently wanted something with PostScript-like capabilities wired in to a particular window system, and they built it. Adobe has decided (wisely for them, from a marketing standpoint) that they don't want to choose sides in the window-system war, so they're building something intended to work with more than one window system. Why don't you criticize Sun for building their own window system instead of working with X? After all, isn't NeWS a way for Sun to create gratuitous incompatibilities to try to lock people into their products? In fact, in a sense it is, although it's nothing so malicious, and I think that Sun has good, sound reasons for pushing NeWS instead of giving in to X. (I'm just trying to point out that you could be criticizing Sun as well as Adobe.) An even better question is why Sun and Adobe didn't try to get together and work things out... > If Sun creates a Display PostScript compatibility mode, Adobe will > continually create new incompatible undocumented features, with Sun > development continually in Catch-Up mode... Adobe has been pretty good about documenting just what PostScript is and sticking to it (with the obvious exception of the internal mechanisms which they use to protect their software and fonts). But of course they're going to keep developing it...Are you saying that Adobe should stop doing development on PostScript? Are they the "bad guys" for **enhancing their own product**?? Come on now. >...This is the old dilemma > between open and proprietary systems, and this is the way it was in > the bad old days... Open systems are a myth. Regarding your reference to AT&T (the "right choice" reference), just because AT&T has fumbled repeatedly doesn't mean that OSF will do it all right. Your enemy's enemy is *not* necessarily your friend (in the healthy-paranoia view of the world:-). Just because you (obviously) favor NeWS doesn't mean that Adobe is evil. There are problems with proprietary standards. There are also problems with "open" standards. > Who will win "the fight"?... What fight? Are you saying that an evolving product in a new market should simply spring, full-grown and uncontested, from one organization? It's not a fight so much as it is a development. There must be conflicting views! If it were obvious how it should be done, it would have been done long ago. >...I don't know, but I know that with things > the way they are, we all lose... Wrong-o. Welcome to the world of development. We get to choose. With Sun and Adobe both being formidable companies, and both having put out credible products, we get to try them. If either NeWS *or* DPS had taken hold completely right away, we'd be a lot more likely to be stuck with mistakes. Competitive pressures can get things fixed. Yes, there will be problems and more work than may seem necessary, until the dust settles. -- Dick Dunn UUCP: {ncar,nbires}!ico!rcd (303)449-2870 ...Worst-case analysis must never begin with "No one would ever want..." From don@brillig.umd.edu Fri Dec 23 15:40:24 1988 Date: Fri, 23 Dec 88 15:40:24 EST To: NeWS-makers@brillig.umd.edu Subject: Multi-line MessageItems From: neptune!rudolf@cs.orst.edu (Jim Rudolf) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I want to have something similar to a Mac alert box to send messages to the user, consisting of a MessageItem and a ButtonItem. I'd also like to keep the surrounding canvas the same size regardless of the length of the message. Is there any way to have a MessageItem that is more than one line? I'll take care of breaking the string into small enough pieces to fit in the MessageItem, but I can't seem to figure out how to put up multiple lines. *Please* tell me that I don't have to create a MessageItem for each line of the string! Many thanks, Jim Rudolf ---------------------------------------------------------------------------- Internet: rudolf@oce.orst.edu #include UUCP: {tektronix,hp-pcd}!orstcs!oce.orst.edu!rudolf ---------------------------------------------------------------------------- From don@brillig.umd.edu Fri Dec 23 15:40:39 1988 Date: Fri, 23 Dec 88 15:40:39 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS HyperTIES From: marantz@aramis.rutgers.edu Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I was looking through the SEX tape (great stuff in general) and noticed sex/news-tape/db. Is is a database that uses HyperTIES, but the HyperTIES doesn't seem to be on the tape. Can anyone tell me more about this and/or where to get it. (It would be nice if it is free :-) Thanks. Roy P.S. sorry if this gets to some mail/news list via to paths, I don't know what is really connected to what. -- uucp: {ames, cbosgd, harvard, moss}!aramis.rutgers.edu!marantz arpa: marantz@aramis.rutgers.edu From don@brillig.umd.edu Fri Dec 23 15:44:06 1988 Date: Fri, 23 Dec 88 15:44:06 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS and DPS, who wins? From: encore!bzs@bu-cs.bu.edu (Barry Shein) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) The only computer software standards are de-facto standards, it doesn't matter where the original software comes from. Standardization is an ex post facto activity, not something you make up one night in a smoke-filled room out of whole cloth. The fallacy we are all having shoved at us is that someone can sit down and write a piece of software and declare it a standard before it has significant following and practice. This does happen on rare occasion when the proferred solution fills a huge vacuum, NFS came close to this, but it's rare. Customers are now rushing about willy-nilly looking for the "standard", and vendors are of course selling it to them at every turn. A standard is something which happens after accepted usage develops. Fortran can be standardized because there is a great deal of overlap between the many versions. Unix has a chance of becoming standardized (remember, you'll rarely achieve a platonic standardization with no variation, just some large set of features generally considered essential) again as a result of broad use and practice to base a standard on. As a particularly bad example, ADA and ISO protocols are both "standards" which depend on bureaucratic muscle from government agencies for acceptance. As such they sort of mock the notion of a standard although they are at least defined. There is a slight difference between, for example, ISO protocols claiming to be standard ISO protocols (all fine and dandy, I agree) and ISO protocols claiming to be the standard networking protocol (but, as with ADA, it's amazing how a few billion dollars in DOD contracts focuses the mind!) After a decade I'm still awaiting my ISO protocol suite written in ADA... I remember finding out years ago that a DEC-20 used a "standard" power plug (there it was, right in the standards!) which unfortunately required a "standard" receptacle only manufactured by one company in the world, and they wouldn't have any for months. Not much call for that "standard", tho it certainly was standard. I think the analogy with current standards fever should be evident. Let's face it, "standards" have become the buzzword of the industry and, like most buzzwords, means whatever they want it to mean (which isn't much.) In most cases replacing the word "standard" with "popular" separates the wheat from the chaff: NFS is a popular remote file system protocol. Fortran is a popular programming language. DOD will require ADA to be popular. Adobe announces popular windowing system. Sun declares NeWS is already popular. Mumble denies X-windows popularity! ISO to be required as the popular networking protocol. TCP/IP to cease to be popular. OSF and Unix Int'l fight over which Unix will be mandated as popular. It's really gotten very silly. -Barry Shein, ||Encore|| From don@brillig.umd.edu Fri Dec 23 15:54:12 1988 Date: Fri, 23 Dec 88 15:54:12 EST To: NeWS-makers@brillig.umd.edu Subject: NeWS HyperTIES From: Don Hopkins Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) HyperTIES is a hypertext system that we're developing here at the UMD Human Computer Interaction Lab, under Ben Shneiderman's direction. There is a version for the PC, distributed by Cognetics. (The PC version of the "HyperText on HyperText" database distritibed by ACM uses HyperTIES.) The NeWS version, cties, is not finished yet. I put together the news-tape database to keep track of all the software and authors, to flush out bugs by using it, and to try out a few ideas. We're still in the process of documenting and implementing it, and hope to be able to distribute it when it's done. The database is human readable, and useful enough that I put it on the tape. -Don From don@brillig.umd.edu Fri Dec 23 21:24:46 1988 Date: Fri, 23 Dec 88 21:24:46 EST To: NeWS-makers@brillig.umd.edu Subject: re: NeWS and DPS again From: nyser!cmx!krempel@cunyvm.cuny.edu (Henry BJ Krempel) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I agree with the criticism of my original article as being biased, I have not had any relations with Adobe, except in reading the materials distributed with their products, which I find to be of high quality, and very well documented. All of the article is mere conjecture. You point out: >An even better question is why Sun and Adobe didn't try to get together >and work things out... That is exactly what I was trying to encourage the two parties to do. My article was meant to guess at some of the motivations behind the current situation where both companies are not agreeing on a single standard. As far as your statements about the lack of a single standard encouraging innovation, this is also true. But I don't have to point out that window systems survive solely on the richness of the applications available in them, and small companies will not be too enthusiastic about porting products to a PostScript window system, unless they can write applications in a single portable syntax. -- Henry B. J. Krempel Computing and Network Services (CNS) Syracuse University 250 Machinery Hall, Syracuse, N.Y. 13244 #! rnews From don@brillig.umd.edu Sun Dec 25 14:16:28 1988 Date: Sun, 25 Dec 88 14:16:28 EST To: NeWS-makers@brillig.umd.edu Subject: Re: NeWS and DPS, who wins? From: vu-vlsi!swatsun!schwartz@psuvax1.cs.psu.edu (Scott Schwartz) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13061@ico.ISC.COM> rcd@ico.ISC.COM (Dick Dunn) writes: >An even better question is why Sun and Adobe didn't try to get together >and work things out... As I recall, when NeWS was announced, Sun announced that it was "taking over" PostScript Development. (After all, Sun is THE standards setter for the world, right?) Adobe, of course, said "no, you won't be doing that, either..." -- Scott Schwartz From don@brillig.umd.edu Thu Dec 29 00:22:08 1988 Date: Thu, 29 Dec 88 00:22:08 EST To: NeWS-makers@brillig.umd.edu Subject: wanted: text subwindow substitute From: mcvax!enea!kth!draken!tut!etana!jh@uunet.uu.net (Juha Hein{nen) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) Has anyone implemented an editable NeWS window that would resemble SunView's text subwindow? I guess one could do it, for example, as an extension of ScrollingWindow. -- Juha Heinanen, Tampere University of Technology, Finland jh@tut.fi (Internet), tut!jh (UUCP), jh@tut (Bitnet) From don@brillig.umd.edu Thu Dec 29 00:23:00 1988 Date: Thu, 29 Dec 88 00:23:00 EST To: NeWS-makers@brillig.umd.edu Subject: RE: NeWS and DPS, who wins? From: killer!pollux!ti-csl!Stenger%tilde@eddie.mit.edu (Dan Stenger) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article <13061@ico.ISC.COM> you write: > In article <926@cmx.npac.syr.edu>, krempel@cmx.npac.syr.edu (Henry BJ Krempel) writes: > >...Sun has put time and effort into the > > product that first made screen PostScript possible: NeWS. After Sun > > was through with the "feasibility study," Adobe decided that screen > > PostScript was interesting and solved these problems again, in a new > > and incompatible manner... > > Is there any reason to think that Adobe wasn't working on PostScript for > displays? Remember that SunDEW (the precursor to NeWS) first really popped > to the surface in early '86, and it was nowhere near to being a product at > that point (at least by its author's claims). NeWS really happened in '87, > and Display PostScript in '88. At the "Screen PostScript" panel at SIGGRAPH '88 this issue was discussed by Charles Geschke from Adobe. To quote him: "The technology of Display PostScript is something that we have actively been working on as a graphics technology ever since the inception of our company back in December of 1982. ... It is a misconception that we did not want to do Display PostScript, even though I'm certain that's the impression James had [referring to an earlier comment about Adobe attempting to hire James Gosling before he went to Sun]. Actually, from the very beginning, and our very first licensees, many of them actively pursued the feasibility of PostScript for displays." For more details check out the SIGGRAPH '88 Panel Proceedings. > An even better question is why Sun and Adobe didn't try to get together > and work things out... I have never heard a definitive answer about this from anyone from Sun or Adobe but I have my own personal opinion. Adobe's main source of revenue is (or at lease used to be) from per copy royalties for PostScript. Because of this they don't license all of their source. Also Adobe is generally a conservative, slow moving company. Sun had some thoughts on how a window system should be wrapped around PostScript, some of which were in conflict with Adobe's own ideas in this area. They are also a quick acting company. I believe the lack of influence over the implementation, the lack of source availability, the Adobe royalty fees, and the slowness of Adobe in getting to the market caused Sun to decide to go do their own version. Dan Stenger Texas Instruments Computer Science Center stenger@csc.ti.com The opinions expressed are my own and not representative of Texas Instruments. From don@brillig.umd.edu Thu Dec 29 00:24:48 1988 Date: Thu, 29 Dec 88 00:24:48 EST To: NeWS-makers@brillig.umd.edu Subject: re: NeWS and DPS again From: Henry BJ Krempel Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) I agree with the criticism of my original article as being biased, I have not had any relations with Adobe, except in reading the materials ... From don@brillig.umd.edu Thu Dec 29 17:54:00 1988 Date: Thu, 29 Dec 88 17:54:00 EST To: NeWS-makers@brillig.umd.edu Subject: Re: wanted: text subwindow substitute From: mcvax!enea!naggum!isncr!m2cs!frode@uunet.uu.net (Frode Odegard) Sender: NeWS-makers-request@brillig.umd.edu (Don Hopkins) In article , jh@etana.tut.fi (Juha Hein{nen) writes: > Has anyone implemented an editable NeWS window that would resemble > SunView's text subwindow? I guess one could do it, for example, as an > extension of ScrollingWindow. > > -- Juha Heinanen, Tampere University of Technology, Finland > jh@tut.fi (Internet), tut!jh (UUCP), jh@tut (Bitnet) What about the PS code for nterm? I haven't looked too closely, but doesn't the PS portion of nterm contain a class that will at least do some of the things you want? [I know nterm is slow, but..] - Frode