1
0
mirror of synced 2026-02-27 01:19:42 +00:00

Merge branch 'master' into fgh_loadup-vnc

Signed-off-by: Frank Halasz <frank@halasz.org>
This commit is contained in:
Frank Halasz
2025-06-16 22:18:13 -07:00
committed by GitHub
32 changed files with 310 additions and 1449 deletions

View File

@@ -1,18 +1,18 @@
(DEFINE-FILE-INFO PACKAGE (PROGN (DEFPACKAGE "CLOS-BROWSER" (USE "CLOS") (EXPORT "CLOS-ICON"
"CLOS-BROWSER" "ADD-BROWSER-METHOD" "BROWSE-CLASS")) (CLFIND-PACKAGE "USER")) READTABLE "XCL" BASE
10)
(DEFINE-FILE-INFO PACKAGE (PROGN (DEFPACKAGE "CLOS-BROWSER" (USE "CLOS" "LISP") (EXPORT "CLOS-ICON"
"CLOS-BROWSER" "ADD-BROWSER-METHOD" "BROWSE-CLASS")) (CLFIND-PACKAGE "USER")) READTABLE "XCL" BASE
10)
(IL:FILECREATED " 5-Dec-2023 12:07:41" IL:{CLOS}NEW-CLOS-BROWSER.\;3 91622
(IL:FILECREATED "28-Apr-2025 18:32:38" 
IL:|{DSK}<Users>arunwelch>DOCUMENTS>MEDLEY-WORKSPACE>RELEASE>NEW-CLOS-BROWSER.;4| 91934
:EDIT-BY "mth"
:EDIT-BY "akw"
:CHANGES-TO (IL:PROPS (IL:NEW-CLOS-BROWSER IL:MAKEFILE-ENVIRONMENT))
:PREVIOUS-DATE " 5-Dec-2023 00:58:05" IL:{CLOS}NEW-CLOS-BROWSER.\;2)
:PREVIOUS-DATE "26-Apr-2025 17:16:46"
IL:|{DSK}<Users>arunwelch>DOCUMENTS>MEDLEY-WORKSPACE>RELEASE>NEW-CLOS-BROWSER.;3|)
; Copyright (c) 1991, 2020, 2023 by Venue.
(IL:PRETTYCOMPRINT IL:NEW-CLOS-BROWSERCOMS)
(IL:RPAQQ IL:NEW-CLOS-BROWSERCOMS
@@ -275,7 +275,7 @@
(IL:PUTPROPS IL:NEW-CLOS-BROWSER IL:MAKEFILE-ENVIRONMENT (:PACKAGE (PROGN (XCL:DEFPACKAGE
"CLOS-BROWSER"
(:USE "CLOS")
(:USE "CLOS" "LISP")
(:EXPORT "CLOS-ICON"
"CLOS-BROWSER"
"ADD-BROWSER-METHOD"
@@ -1159,9 +1159,14 @@ Below this line operates on individual slots and methods."
(DOCUMENTATION (SLOT-VALUE CLOS-BROWSER::SELF 'CLOS-BROWSER::CLASS)))
(DEFMETHOD CLOS-BROWSER::PRINT-CLASS ((CLOS-BROWSER::SELF CLOS-BROWSER::CLOS-BROWSER-NODE))
(PPRINT (IL:GETDEF (SLOT-VALUE (SLOT-VALUE CLOS-BROWSER::SELF `CLOS-BROWSER::CLASS)
'CLOS::NAME)
'CLOS-BROWSER::CLASSES)))
(IF (IL:HASDEF (SLOT-VALUE (SLOT-VALUE CLOS-BROWSER::SELF 'CLOS-BROWSER::CLASS)
'CLOS::NAME)
'CLOS-BROWSER::CLASSES)
(PPRINT (IL:GETDEF (SLOT-VALUE (SLOT-VALUE CLOS-BROWSER::SELF `CLOS-BROWSER::CLASS)
'CLOS::NAME)
'CLOS-BROWSER::CLASSES))
(IL:PROMPTPRINT "No Printable Definition for the class " (SLOT-VALUE CLOS-BROWSER::SELF
'WEB::NAME))))
(DEFMETHOD CLOS-BROWSER::SPECIALIZE-CLASS ((CLOS-BROWSER::NODE CLOS-BROWSER::CLOS-BROWSER-NODE)
&OPTIONAL CLOS-BROWSER::FORM CLOS-BROWSER::NEW-CLASS-NAME)
@@ -1211,7 +1216,8 @@ Below this line operates on individual slots and methods."
(RETURN))))))
(IL:SETCURSOR CLOS-BROWSER::ORIGINALCURSOR))))))
(DEFUN CLOS-BROWSER::LYRIC-COMPLETE-SPECIALIZE (IGNORE STRUCTURE)
(DEFUN CLOS-BROWSER::LYRIC-COMPLETE-SPECIALIZE (IGNORE STRUCTURE)
(IL:* IL:\; "Edited 26-Apr-2025 14:31 by arunwelch")
(LET ((CLOS-BROWSER::ORIGINALCURSOR (IL:CURSOR)))
(UNWIND-PROTECT
(PROGN (IL:SETCURSOR IL:WAITINGCURSOR)
@@ -1224,8 +1230,7 @@ Below this line operates on individual slots and methods."
(IL:* IL:|;;| "check for bug")
(WHEN (SYMBOLP CLOS-BROWSER::SUB-CLASS)
(SETQ CLOS-BROWSER::SUB-CLASS (CLOS::SYMBOL-CLASS CLOS-BROWSER::SUB-CLASS
)))
(SETQ CLOS-BROWSER::SUB-CLASS (FIND-CLASS CLOS-BROWSER::SUB-CLASS)))
(DOLIST (CLOS-BROWSER::BROWSER (SLOT-VALUE CLOS-BROWSER:CLOS-ICON
'CLOS-BROWSER::CLASS-BROWSERS))
(DOLIST (CLOS-BROWSER::SUPER-CLASS (SLOT-VALUE CLOS-BROWSER::SUB-CLASS
@@ -1387,14 +1392,12 @@ Below this line operates on individual slots and methods."
(0 (FORMAT T "Unspecialized methods cannot be copied. ~A" (CLOS::FULL-METHOD-NAME
CLOS-BROWSER::METHOD NIL)))
(1 (SETQ CLOS-BROWSER::FROM-CLASS (CAR CLOS-BROWSER::NON-T-CLASSES)))
(OTHERWISE (SETQ CLOS-BROWSER::FROM-CLASS (CLOS::SYMBOL-CLASS
(IL:PROMPTFORWORD (FORMAT NIL
(OTHERWISE (SETQ CLOS-BROWSER::FROM-CLASS (FIND-CLASS (IL:PROMPTFORWORD
(FORMAT NIL
"Which class in ~A do you wish to move from?"
(
CLOS::FULL-METHOD-NAME
CLOS-BROWSER::METHOD
NIL))))))))
(CLOS::FULL-METHOD-NAME
CLOS-BROWSER::METHOD
NIL))))))))
(IL:* IL:|;;| "should contain from-class. If it is not the same, abort.")
@@ -1465,7 +1468,7 @@ Below this line operates on individual slots and methods."
 "fix bug in the inconsistent way CLOS objects store T class specializers and do method lookup.")
(WHEN (EQ CLOS-BROWSER::CLASS T)
(SETQ CLOS-BROWSER::CLASS (CLOS::SYMBOL-CLASS T)))
(SETQ CLOS-BROWSER::CLASS (FIND-CLASS T)))
(LET ((CLOS-BROWSER::NODE (CLOS-BROWSER::BROWSER-CONTAINS-P
CLOS-BROWSER::CLASS CLOS-BROWSER::BROWSER)))
(WHEN CLOS-BROWSER::NODE
@@ -1582,7 +1585,8 @@ Below this line operates on individual slots and methods."
(IL:|if| PACKAGE
IL:|then| (IN-PACKAGE PACKAGE))))
(DEFUN CLOS-BROWSER::CLASSES-IN-PACKAGE (PACKAGE &OPTIONAL CLOS-BROWSER::MAP-ON-PACKAGE)
(DEFUN CLOS-BROWSER::CLASSES-IN-PACKAGE (PACKAGE &OPTIONAL CLOS-BROWSER::MAP-ON-PACKAGE)
(IL:* IL:\; "Edited 26-Apr-2025 14:25 by arunwelch")
"Retrieves a list of all the classes for a given package. When map-on-package is t this can be very slow."
(IL:* IL:|;;| "The maphash is always fast, whereas for some strange reason map-on-package varys among packages greatly.")
@@ -1594,7 +1598,7 @@ Below this line operates on individual slots and methods."
(DO-SYMBOLS (CLOS-BROWSER::SYM PACKAGE)
(IF (AND (EQ (SYMBOL-PACKAGE CLOS-BROWSER::SYM)
PACKAGE)
(CLOS::SYMBOL-CLASS CLOS-BROWSER::SYM T))
(FIND-CLASS CLOS-BROWSER::SYM T))
(PUSH CLOS-BROWSER::SYM CLOS-BROWSER::CLASSES)))
(MAPHASH #'(LAMBDA (CLOS-BROWSER::KEY CLOS-BROWSER::VAL)
(IF (EQ (SYMBOL-PACKAGE CLOS-BROWSER::KEY)
@@ -1623,17 +1627,16 @@ Below this line operates on individual slots and methods."
IL:|BackgroundMenuCommands|)
(SETQ IL:|BackgroundMenu| NIL)
(IL:PUTPROPS IL:NEW-CLOS-BROWSER IL:COPYRIGHT ("Venue" 1991 2020 2023))
(IL:DECLARE\: IL:DONTCOPY
(IL:FILEMAP (NIL (11770 13440 (CLOS-BROWSER:BROWSE-CLASS 11770 . 13440)) (13442 14785 (
CLOS-BROWSER::COLLECT-FAMILY 13442 . 14785)) (14787 16819 (CLOS-BROWSER::MAKE-NODES 14787 . 16819)) (
16821 17496 (CLOS-BROWSER::CLOS-BROWSER-CLOSE-FN 16821 . 17496)) (17498 18430 (CLOS-BROWSER::BROWSER-CONTAINS-P
17498 . 18430)) (42263 42587 (CLOS-BROWSER::EDIT 42263 . 42587)) (42589 48183 (
CLOS-BROWSER::MAKE-METHOD-MENU-ITEMS 42589 . 48183)) (48185 49663 (CLOS-BROWSER::MAKE-TOP-LEVEL-METHOD-MENU-ITEMS
48185 . 49663)) (49665 50955 (CLOS-BROWSER::MAKE-MULTI-METHOD-SUB-MENU 49665 . 50955)) (64981 65598 (
CLOS-BROWSER::COMPLETE-ADD-METHOD 64981 . 65598)) (65600 67812 (CLOS-BROWSER::COMPLETE-SPECIALIZE
65600 . 67812)) (67814 69482 (CLOS-BROWSER::LYRIC-COMPLETE-SPECIALIZE 67814 . 69482)) (69484 69649 (
CLOS-BROWSER::THIS-CLASS-NODE-P 69484 . 69649)) (69651 69753 (CLOS::CLASS-DIRECT-METHODS 69651 . 69753
)) (86457 87472 (CLOS-BROWSER::REPLACE-SPECIALIZERS 86457 . 87472)) (87783 89367 (CLOS-BROWSER::IN-SELECT-PACKAGE
87783 . 89367)) (89369 90516 (CLOS-BROWSER::CLASSES-IN-PACKAGE 89369 . 90516)))))
(IL:FILEMAP (NIL (11846 13516 (CLOS-BROWSER:BROWSE-CLASS 11846 . 13516)) (13518 14861 (
CLOS-BROWSER::COLLECT-FAMILY 13518 . 14861)) (14863 16895 (CLOS-BROWSER::MAKE-NODES 14863 . 16895)) (
16897 17572 (CLOS-BROWSER::CLOS-BROWSER-CLOSE-FN 16897 . 17572)) (17574 18506 (CLOS-BROWSER::BROWSER-CONTAINS-P
17574 . 18506)) (42339 42663 (CLOS-BROWSER::EDIT 42339 . 42663)) (42665 48259 (
CLOS-BROWSER::MAKE-METHOD-MENU-ITEMS 42665 . 48259)) (48261 49739 (CLOS-BROWSER::MAKE-TOP-LEVEL-METHOD-MENU-ITEMS
48261 . 49739)) (49741 51031 (CLOS-BROWSER::MAKE-MULTI-METHOD-SUB-MENU 49741 . 51031)) (65408 66025 (
CLOS-BROWSER::COMPLETE-ADD-METHOD 65408 . 66025)) (66027 68239 (CLOS-BROWSER::COMPLETE-SPECIALIZE
66027 . 68239)) (68241 69946 (CLOS-BROWSER::LYRIC-COMPLETE-SPECIALIZE 68241 . 69946)) (69948 70113 (
CLOS-BROWSER::THIS-CLASS-NODE-P 69948 . 70113)) (70115 70217 (CLOS::CLASS-DIRECT-METHODS 70115 . 70217
)) (86738 87753 (CLOS-BROWSER::REPLACE-SPECIALIZERS 86738 . 87753)) (88064 89648 (CLOS-BROWSER::IN-SELECT-PACKAGE
88064 . 89648)) (89650 90900 (CLOS-BROWSER::CLASSES-IN-PACKAGE 89650 . 90900)))))
IL:STOP

Binary file not shown.

View File

@@ -284,6 +284,15 @@ environment variable LDEREPEATCM.</p>
<p>On Windows/Cygwin installations, <em>FILE</em> is specified in the
Medley file system, not the host Windows file system.</p>
</dd>
<dt>-am, automation</dt>
<dd>
<p>Useful only when using vnc (and always on WSL1). When calling medley
as part of an automation script, often Medley will run for a very short
time (&lt; a couple of seconds). This can cause issues with medley code
that detects Xvnc server failures. Setting this flag notifies Medley
that very short Medley sessions are possible and the Xvnc error
detection needs to be adjusted accordingly.</p>
</dd>
</dl>
<h2>Other Options</h2>
<dl>

View File

@@ -386,6 +386,15 @@ environment variable LDEREPEATCM.
On Windows/Cygwin installations, \f[I]FILE\f[R] is specified in the
Medley file system, not the host Windows file system.
.RE
.TP
-am, \[en]automation
Useful only when using \[en]vnc (and always on WSL1).
When calling medley as part of an automation script, often Medley will
run for a very short time (< a couple of seconds).
This can cause issues with medley code that detects Xvnc server
failures.
Setting this flag notifies Medley that very short Medley sessions are
possible and the Xvnc error detection needs to be adjusted accordingly.
.SS Other Options
.PP
\

Binary file not shown.

View File

@@ -216,7 +216,7 @@ specified in the Medley file system, not the host Windows file system.
If the given value is "-", Medley will start up without using REM&#46;CM file.
There is no default Medley REM&#46;CM file.
On Windows/Cygwin installations, *FILE* is
specified in the Medley file system, not the host Windows file system.
@@ -254,10 +254,15 @@ for the parameter will be reset to the default value - which in the case of *Hos
-cc \[*FILE* | -], \-\-repeat \[*FILE* | -]
: Run Medley once. And then as long as *FILE* exists and is greater then zero length, repeatedly run Medley using *FILE* as the REM&#46;CM file that Medley reads and executes at startup. Each run of Medley can change the contents of *FILE* to effect the subsequent run of Medley. To end the cycle, Medley needs to delete *FILE*. WIthin Medley, *FILE* can be found as the value of the environment variable LDEREPEATCM.
On Windows/Cygwin installations, *FILE* is
specified in the Medley file system, not the host Windows file system.
-am, --automation
: Useful only when using --vnc (and always on WSL1). When calling medley as part of an automation script, often Medley
will run for a very short time (< a couple of seconds). This can cause issues with medley code that detects Xvnc server failures.
Setting this flag notifies Medley that very short Medley sessions are possible and the Xvnc error detection needs to be adjusted accordingly.
Other Options
-------------

View File

@@ -1,12 +1,12 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "23-Feb-2025 12:18:57" {WMEDLEY}<library>PDFSTREAM.;62 14729
(FILECREATED " 5-Jun-2025 08:42:11" {WMEDLEY}<library>PDFSTREAM.;64 14885
:EDIT-BY rmk
:CHANGES-TO (FNS OPEN-PDF-STREAM)
:PREVIOUS-DATE "25-Dec-2024 14:26:23" {WMEDLEY}<library>PDFSTREAM.;60)
:PREVIOUS-DATE "23-Feb-2025 12:18:57" {WMEDLEY}<library>PDFSTREAM.;62)
(PRETTYCOMPRINT PDFSTREAMCOMS)
@@ -153,7 +153,8 @@
(DEFINEQ
(OPEN-PDF-STREAM
[LAMBDA (FILE OPTIONS) (* ; "Edited 23-Feb-2025 12:18 by rmk")
[LAMBDA (FILE OPTIONS) (* ; "Edited 5-Jun-2025 08:41 by rmk")
(* ; "Edited 23-Feb-2025 12:18 by rmk")
(* ; "Edited 23-Sep-2023 15:38 by rmk")
(* ; "Edited 22-Sep-2023 11:04 by rmk")
(* ; "Edited 24-Jun-2023 14:49 by rmk")
@@ -165,8 +166,6 @@
(* ;;
 "Simplest thing for now is to just add an extra field at the end of the \POSTSCRIPTDATA record.")
(* ;; "")
(if [AND NIL (EQ 'LPT (FILENAMEFIELD FILE 'HOST]
then
(* ;; "If FILE is on the LPT device, we could just ssume that it can be printed directly, no point in converting. But then we would alo have to lie and give it a PDF extension so it thinks that we are heading to a PDF printer.")
@@ -178,8 +177,9 @@
(* ;; "Device NULL used by TMAX, maybe others, to get page number for table of contents, index. Nothing to convert")
(OPENPOSTSCRIPTSTREAM FILE OPTIONS)
elseif (SETQ FILE (OR (AND (NEQ FILE T)
(OUTFILEP FILE))
elseif (SETQ FILE (OR [AND (NEQ FILE T)
(OR (OUTFILEP FILE)
(OPENSTREAM FILE 'OUTPUT]
(ERROR "PDF target file not found" FILE)))
then (CL:UNLESS (ASSOC (PDFCONVERTER)
PDF-CONVERTER-TEMPLATES)
@@ -293,7 +293,7 @@
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (3263 5877 (PDFFILEP 3273 . 4187) (PDF.HARDCOPYW 4189 . 4787) (PDF.TEXT 4789 . 5506) (
PDF.TEDIT 5508 . 5875)) (6317 13806 (OPEN-PDF-STREAM 6327 . 8892) (CLOSE-PDF-STREAM 8894 . 10181) (
PS-TO-PDF 10183 . 13804)) (13807 14371 (SEE-PDF 13817 . 14369)) (14422 14706 (PDFCONVERTER 14432 .
14704)))))
PDF.TEDIT 5508 . 5875)) (6317 13962 (OPEN-PDF-STREAM 6327 . 9048) (CLOSE-PDF-STREAM 9050 . 10337) (
PS-TO-PDF 10339 . 13960)) (13963 14527 (SEE-PDF 13973 . 14525)) (14578 14862 (PDFCONVERTER 14588 .
14860)))))
STOP

Binary file not shown.

View File

@@ -1,29 +1,15 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "28-Apr-2025 00:17:24" {DSK}<home>matt>Interlisp>medley>library>POSTSCRIPTSTREAM.;14 257549
(FILECREATED " 5-Jun-2025 16:12:21" {DSK}<home>matt>Interlisp>medley>library>POSTSCRIPTSTREAM.;5 258146
:EDIT-BY "mth"
:CHANGES-TO (FNS \DRAWLINE.PSC POSTSCRIPT.PUTRGBCOLOR \PSC.COLOR.TO.RGB \BLTSHADE.PSC
\DRAWARC.PSC \DRAWCIRCLE.PSC \DRAWCURVE.PSC \DRAWELLIPSE.PSC \DRAWPOLYGON.PSC
\FILLCIRCLE.PSC \FILLPOLYGON.PSC POSTSCRIPT.COLORSTRING POSTSCRIPT.OUTSTR
\DSPCOLOR.PSC POSTSCRIPT.PUTCOLOR \DRAWPOINT.PSC \POSTSCRIPT.CHANGECHARSET
POSTSCRIPT.HARDCOPYW POSTSCRIPT.CLOSESTRING POSTSCRIPT.ENDPAGE
POSTSCRIPT.PUTCOMMAND POSTSCRIPT.SET-FAKE-LANDSCAPE POSTSCRIPT.SHOWACCUM
POSTSCRIPT.STARTPAGE \POSTSCRIPTTAB \PS.BOUTFIXP \PS.SCALEHACK
\SCALEDBITBLT.PSC \SETPOS.PSC \SETXFORM.PSC \STRINGWIDTH.PSC \SWITCHFONTS.PSC
\TERPRI.PSC \CHARWIDTH.PSC \DSPBOTTOMMARGIN.PSC \DSPCLIPPINGREGION.PSC
\DSPFONT.PSC \DSPLEFTMARGIN.PSC \DSPLINEFEED.PSC \DSPPUSHSTATE.PSC
\DSPPOPSTATE.PSC \DSPRESET.PSC \DSPRIGHTMARGIN.PSC \DSPROTATE.PSC
\DSPSCALE.PSC \DSPSCALE2.PSC \DSPSPACEFACTOR.PSC \DSPTOPMARGIN.PSC
\DSPTRANSLATE.PSC \DSPXPOSITION.PSC \DSPYPOSITION.PSC \FIXLINELENGTH.PSC
\MOVETO.PSC \POSTSCRIPT.OUTCHARFN \POSTSCRIPT.PRINTSLUG
\POSTSCRIPT.SPECIALOUTCHARFN \UPDATE.PSC \POSTSCRIPT.ACCENTFN
\POSTSCRIPT.ACCENTPAIR OPENPOSTSCRIPTSTREAM)
(VARS POSTSCRIPTSTREAMCOMS)
(RECORDS \POSTSCRIPTDATA)
:CHANGES-TO (FNS \BLTSHADE.PSC \PSC.COLOR.TO.RGB \DRAWLINE.PSC \DRAWARC.PSC POSTSCRIPTSEND
\TERPRI.PSC POSTSCRIPT.PUTCOMMAND POSTSCRIPT.PUTRGBCOLOR \DSPCOLOR.PSC
\DRAWCIRCLE.PSC \DRAWELLIPSE.PSC \DRAWPOINT.PSC \DRAWPOLYGON.PSC
\FILLCIRCLE.PSC \FILLPOLYGON.PSC POSTSCRIPT.TEDIT \BITBLT.PSC)
:PREVIOUS-DATE "10-Dec-2024 15:16:36"
:PREVIOUS-DATE "28-Apr-2025 00:17:24"
{DSK}<home>matt>Interlisp>medley>library>POSTSCRIPTSTREAM.;1)
@@ -502,47 +488,71 @@
(\POSTSCRIPT.NSHASH *POSTSCRIPT-NS-TRANSLATIONS*])
(POSTSCRIPT.PUTRGBCOLOR
[LAMBDA (STREAM COLOR EOL?) (* ; "Edited 28-Apr-2025 00:02 by mth")
[LAMBDA (STREAM COLOR EOL?) (* ; "Edited 5-Jun-2025 14:06 by mth")
(* ; "Edited 28-Apr-2025 00:02 by mth")
(* ; "Edited 26-Apr-2025 17:16 by mth")
(AND COLOR (CL:MULTIPLE-VALUE-BIND (RGB GRAY COLORSTR)
(\PSC.COLOR.TO.RGB COLOR)
(POSTSCRIPT.PUTCOMMAND STREAM COLORSTR (OR (AND GRAY " setgray ")
" setrgbcolor ")
(AND EOL? :EOL])
(\PSC.COLOR.TO.RGB COLOR (fetch (\POSTSCRIPTDATA POSTSCRIPTCOLOR)
of (fetch IMAGEDATA of STREAM)))
(CL:WHEN RGB (* ; "A valid color designation")
(POSTSCRIPT.PUTCOMMAND STREAM COLORSTR (OR (AND GRAY " setgray ")
" setrgbcolor ")
(AND EOL? :EOL)))
(* ;; "Return the RGB color")
RGB])
(\PSC.COLOR.TO.RGB
[LAMBDA (COLOR NOERRORFLG?) (* ; "Edited 28-Apr-2025 00:10 by mth")
(* ; "Edited 26-Apr-2025 17:06 by mth")
[LAMBDA (COLOR DEFAULTRGB NOERRORFLG?) (* ; "Edited 5-Jun-2025 16:03 by mth")
(* ; "Edited 31-May-2025 17:20 by mth")
(* ; "Edited 28-Apr-2025 00:10 by mth")
(LET (RGB STR)
(COND
[(AND (FLOATP COLOR)
(<= 0.0 COLOR 1.0)
(SETQ RGB (FIX (FTIMES COLOR 255)))
(SETQ RGB (LIST RGB RGB RGB))
(SETQ STR (CL:FORMAT NIL "~F "]
[(SETQ RGB (ENSURE.RGB COLOR NOERRORFLG?))
(SETQ STR (IF (AND (EQ (CAR RGB)
(CADR RGB))
(EQ (CAR RGB)
(CADDR RGB)))
THEN
(* ;; "They're all equal, this is gray.")
((OR (EQ COLOR 0)
(EQ COLOR 1)
(AND (FLOATP COLOR)
(<= 0.0 COLOR 1.0)))
(CL:FORMAT NIL "~F " (SETQ COLOR (FQUOTIENT (CAR RGB)
255.0)))
ELSE (SETQ COLOR NIL) (* ; "Means NOT gray")
(CL:FORMAT NIL "~D ~D ~D " (CAR RGB)
(CADR RGB)
(CADDR RGB]
(* ;; "The SMALLP values 0 and 1 can be checked with EQ")
(SETQ RGB (FIX (FTIMES COLOR 255)))
(SETQ STR (CL:FORMAT NIL "~F " RGB))
(SETQ RGB (LIST RGB RGB RGB)))
([OR (NULL COLOR)
(AND (FIXP COLOR)
(<= 2 COLOR (CONSTANT (MAXIMUMCOLOR 24]
(* ;; "Ignore any other FIXP that could be a COLORNUMBER")
(* ;;
 "or an RGB encoded as a single FIXP. Just use the DEFAULTRGB which MUST be a valid RGB!")
(SETQ RGB DEFAULTRGB))
((SETQ RGB (ENSURE.RGB COLOR NOERRORFLG?)))
(T
(* ;; " Shouldn't ever get here.")
(* ;; " ENSURE.RGB above handled the color name or number, RGB, and HLS cases.")
(* ;; " ENSURE.RGB above handled the color name, RGB, and HLS cases.")
(* ;; "Depending on NOERRORFLG?, it will give the error for anything else invalid")
NIL))
(CL:VALUES RGB COLOR STR])
(CL:WHEN RGB
[SETQ STR (OR STR (IF (AND (EQ (CAR RGB)
(CADR RGB))
(EQ (CAR RGB)
(CADDR RGB)))
THEN
(* ;; "They're all equal, this is gray.")
(CL:FORMAT NIL "~F " (SETQ COLOR (FQUOTIENT (CAR RGB)
255.0)))
ELSE (SETQ COLOR NIL) (* ; "Means NOT gray")
(CL:FORMAT NIL "~D ~D ~D " (CAR RGB)
(CADR RGB)
(CADDR RGB])
(CL:VALUES RGB COLOR STR (NOT (EQUAL RGB DEFAULTRGB])
)
(ADDTOVAR DEFAULTFILETYPELIST (PS . BINARY)
@@ -1380,7 +1390,7 @@
(FULLNAME STREAM])
(POSTSCRIPT.TEDIT
[LAMBDA (FILE PFILE) (* ; "Edited 18-Sep-91 18:16 by jds")
[LAMBDA (FILE PFILE) (* ; "Edited 18-Sep-91 18:16 by jds")
(* ;; "Make a PS file from a TEdit document. If FILE is a string, make it into a symbol for the file-name. If it's a STREAM, use that stream.")
@@ -2193,12 +2203,13 @@
[LAMBDA (SOURCEBITMAP SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT
SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM)
(* ; "Edited 7-Apr-89 19:53 by TAL")
(\SCALEDBITBLT.PSC SOURCEBITMAP SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT
DESTINATIONBOTTOM WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION
CLIPPEDSOURCELEFT CLIPPEDSOURCEBOTTOM 1])
(\SCALEDBITBLT.PSC SOURCEBITMAP SOURCELEFT SOURCEBOTTOM STREAM DESTINATIONLEFT DESTINATIONBOTTOM
WIDTH HEIGHT SOURCETYPE OPERATION TEXTURE CLIPPINGREGION CLIPPEDSOURCELEFT
CLIPPEDSOURCEBOTTOM 1])
(\BLTSHADE.PSC
[LAMBDA (TEXTURE STREAM DESTINATIONLEFT DESTINATIONBOTTOM WIDTH HEIGHT OPERATION CLIPPINGREGION)
(* ; "Edited 5-Jun-2025 16:11 by mth")
(* ; "Edited 28-Apr-2025 00:05 by mth")
(* ;
 "Edited 20-Nov-92 15:12 by sybalsky:mv:envos")
@@ -2237,7 +2248,8 @@
(SETQ TEXTUREBM (BITMAPCREATE TEXTUREWIDTH TEXTUREWIDTH 1))
(BITBLT TEXTURE 0 0 TEXTUREBM 0 0 TEXTUREWIDTH TEXTUREWIDTH 'INPUT 'REPLACE))
(T (CL:MULTIPLE-VALUE-BIND (COLOR GRAY COLORSTR)
(\PSC.COLOR.TO.RGB (OR TEXTURE (\DSPCOLOR.PSC STREAM NIL)))
(\PSC.COLOR.TO.RGB TEXTURE (fetch (\POSTSCRIPTDATA POSTSCRIPTCOLOR)
of IMAGEDATA))
(* ;; "Default to the current stream color")
@@ -2506,46 +2518,50 @@
(\MOVETO.PSC STREAM CENTERX CENTERY])
(\DRAWLINE.PSC
[LAMBDA (STREAM X1 Y1 X2 Y2 WIDTH OPERATION COLOR DASHING) (* ; "Edited 28-Apr-2025 00:11 by mth")
[LAMBDA (STREAM X1 Y1 X2 Y2 WIDTH OPERATION COLOR DASHING) (* ; "Edited 5-Jun-2025 14:19 by mth")
(* ; "Edited 28-Apr-2025 00:11 by mth")
(* ;
 "Edited 20-Nov-92 15:12 by sybalsky:mv:envos")
(* ;; "DRAWLINE method for postscript streams.")
(LET ((IMAGEDATA (fetch (STREAM IMAGEDATA) of STREAM)))
[COND
((NOT (NUMBERP WIDTH))
(CL:WHEN (LESSP X2 X1)
(* ;; "The WIDTH = NIL should have been handled before here, but just in case!")
(* ;; "For Syntelligence, make all lines move from left to right, to defeat a bug in SPARCPrinter PS decoder.")
(SETQ WIDTH (fetch (\POSTSCRIPTDATA POSTSCRIPTSCALE) of IMAGEDATA]
[COND
((NOT (ZEROP WIDTH))
(CL:MULTIPLE-VALUE-BIND (RGB GRAY COLORSTR)
(\PSC.COLOR.TO.RGB COLOR T)
(COND
((LESSP X2 X1)
(CL:PSETQ X1 X2 X2 X1 Y1 Y2 Y2 Y1))
(LET* ((IMAGEDATA (fetch (STREAM IMAGEDATA) of STREAM))
(CURRENTCOLOR (fetch (\POSTSCRIPTDATA POSTSCRIPTCOLOR) of IMAGEDATA)))
[COND
((NOT (NUMBERP WIDTH))
(* ;; "For Syntelligence, make all lines move from left to right, to defeat a bug in SPARCPrinter PS decoder.")
(* ;; "The WIDTH = NIL should have been handled before here, but just in case!")
(\DRAWLINE.PSC STREAM X2 Y2 X1 Y1 WIDTH OPERATION COLOR DASHING))
((NOT (OR COLOR (LISTP DASHING))) (* ; "Simple case, no dash or color")
(POSTSCRIPT.PUTCOMMAND STREAM X2 " " Y2 " " X1 " " Y1 " " WIDTH " L" :EOL))
(T (POSTSCRIPT.PUTCOMMAND STREAM X2 " " Y2 " " X1 " " Y1 " " WIDTH " ")
(POSTSCRIPT.PUTCOMMAND STREAM COLORSTR " [")
(POSTSCRIPT.PUTCOMMAND STREAM)
(for D in (LISTP DASHING) do
(* ;;
(SETQ WIDTH (fetch (\POSTSCRIPTDATA POSTSCRIPTSCALE) of IMAGEDATA]
[COND
((NOT (ZEROP WIDTH))
(CL:MULTIPLE-VALUE-BIND (RGB GRAY COLORSTR DIFFERENT)
(\PSC.COLOR.TO.RGB COLOR CURRENTCOLOR T)
(COND
((NOT (OR DIFFERENT (LISTP DASHING)))(* ;
 "Simple case, no dash or color change")
(POSTSCRIPT.PUTCOMMAND STREAM X2 " " Y2 " " X1 " " Y1 " " WIDTH " L" :EOL))
(T (POSTSCRIPT.PUTCOMMAND STREAM X2 " " Y2 " " X1 " " Y1 " " WIDTH " ")
(POSTSCRIPT.PUTCOMMAND STREAM COLORSTR " [")
(POSTSCRIPT.PUTCOMMAND STREAM)
(for D in (LISTP DASHING) do
(* ;;
 "Interlisp DASHING is in terms of BRUSH units, so multiply by the brush size.")
(POSTSCRIPT.PUTCOMMAND STREAM (TIMES D WIDTH)
" "))
(POSTSCRIPT.PUTCOMMAND STREAM "]" (OR (AND GRAY " L1G")
" L1")
:EOL]
(replace (\POSTSCRIPTDATA POSTSCRIPTX) of IMAGEDATA with X2)
(freplace (\POSTSCRIPTDATA POSTSCRIPTY) of IMAGEDATA with Y2)
(freplace (\POSTSCRIPTDATA POSTSCRIPTMOVEFLG) of IMAGEDATA with NIL])
(POSTSCRIPT.PUTCOMMAND STREAM
(TIMES D WIDTH)
" "))
(POSTSCRIPT.PUTCOMMAND STREAM "]" (OR (AND GRAY " L1G")
" L1")
:EOL]
(replace (\POSTSCRIPTDATA POSTSCRIPTX) of IMAGEDATA with X2)
(freplace (\POSTSCRIPTDATA POSTSCRIPTY) of IMAGEDATA with Y2)
(freplace (\POSTSCRIPTDATA POSTSCRIPTMOVEFLG) of IMAGEDATA with NIL])
(\DRAWPOINT.PSC
[LAMBDA (STREAM X Y BRUSH OPERATION) (* ; "Edited 30-Mar-90 17:53 by Matt Heffron")
@@ -2648,7 +2664,8 @@
OLDCLIP])
(\DSPCOLOR.PSC
[LAMBDA (STREAM COLOR) (* ; "Edited 26-Apr-2025 17:03 by mth")
[LAMBDA (STREAM COLOR) (* ; "Edited 4-Jun-2025 23:51 by mth")
(* ; "Edited 26-Apr-2025 17:03 by mth")
(* ; "Edited 14-Jan-93 17:14 by jds")
(* ;; " Code below adapted from 7-Oct-1989 version by DJVB")
@@ -2657,12 +2674,10 @@
 " All postscript printers accept color RGB info, though most just pick a gray based on values")
(LET* ((PSDATA (fetch IMAGEDATA of STREAM))
(CURRENT (fetch (\POSTSCRIPTDATA POSTSCRIPTCOLOR) of PSDATA))
RGB)
(CURRENT (fetch (\POSTSCRIPTDATA POSTSCRIPTCOLOR) of PSDATA)))
(if COLOR
then (SETQ RGB (\PSC.COLOR.TO.RGB COLOR))
(replace (\POSTSCRIPTDATA POSTSCRIPTCOLOR) of PSDATA with RGB)
(POSTSCRIPT.PUTRGBCOLOR STREAM RGB))
then (replace (\POSTSCRIPTDATA POSTSCRIPTCOLOR) of PSDATA with (POSTSCRIPT.PUTRGBCOLOR
STREAM COLOR)))
CURRENT])
(\DSPFONT.PSC
@@ -4302,21 +4317,13 @@
(DEFINEQ
(POSTSCRIPTSEND
[LAMBDA (HOST FILE PRINTOPTIONS) (* ; "Edited 20-Nov-95 11:29 by ")
(* ; "Edited 20-Nov-95 11:26 by ")
[LAMBDA (HOST FILE PRINTOPTIONS) (* ; "Edited 20-Nov-95 11:29 by ")
(* ; "Edited 20-Nov-95 11:26 by ")
(* ;; "This is the send function for generic POSTSCRIPT printers. It branches on the architecture-specific function. The theory is that the send method is really a property of the operating system, not a property of specific postscript printers. These functions are contained in separate library files (or defined by user).")
(* ;; "This is the send function for generic POSTSCRIPT printers. It branches on the architecture-specific function. The theory is that the send method is really a property of the operating system, not a property of specific postscript printers. These functions are contained in separate library files (or defined by user).")
(SELECTQ (MKATOM (UNIX-GETPARM "ARCH"))
(dos (DOSPRINT HOST FILE PRINTOPTIONS))
(UnixPrint HOST FILE PRINTOPTIONS])
)
@@ -4394,38 +4401,38 @@
(ADDTOVAR LAMA POSTSCRIPT.PUTCOMMAND)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (23920 33221 (POSTSCRIPT.INIT 23930 . 31022) (POSTSCRIPT.PUTRGBCOLOR 31024 . 31600) (
\PSC.COLOR.TO.RGB 31602 . 33219)) (34207 68991 (PSCFONT.READFONT 34217 . 36125) (PSCFONT.SPELLFILE
36127 . 36705) (PSCFONT.COERCEFILE 36707 . 38279) (PSCFONTFROMCACHE.SPELLFILE 38281 . 39266) (
PSCFONTFROMCACHE.COERCEFILE 39268 . 40920) (PSCFONT.WRITEFONT 40922 . 41937) (READ-AFM-FILE 41939 .
47810) (CONVERT-AFM-FILES 47812 . 49024) (POSTSCRIPT.GETFONTID 49026 . 50421) (POSTSCRIPT.FONTCREATE
50423 . 62822) (\POSTSCRIPT.SPECIALFONT.SCALEDWIDTHS 62824 . 65221) (POSTSCRIPT.FONTSAVAILABLE 65223
. 68989)) (69546 78831 (OPENPOSTSCRIPTSTREAM 69556 . 78497) (CLOSEPOSTSCRIPTSTREAM 78499 . 78829)) (
78876 84926 (POSTSCRIPT.HARDCOPYW 78886 . 81993) (POSTSCRIPT.TEDIT 81995 . 82475) (POSTSCRIPT.TEXT
82477 . 82768) (POSTSCRIPTFILEP 82770 . 83877) (MAKEEPSFILE 83879 . 84924)) (84927 128501 (
POSTSCRIPT.BITMAPSCALE 84937 . 87393) (POSTSCRIPT.CLOSESTRING 87395 . 87948) (POSTSCRIPT.ENDPAGE 87950
. 88841) (POSTSCRIPT.OUTSTR 88843 . 90060) (POSTSCRIPT.PUTBITMAPBYTES 90062 . 98533) (
POSTSCRIPT.PUTCOMMAND 98535 . 99524) (POSTSCRIPT.SET-FAKE-LANDSCAPE 99526 . 104046) (
POSTSCRIPT.SHOWACCUM 104048 . 106203) (POSTSCRIPT.STARTPAGE 106205 . 108737) (\POSTSCRIPTTAB 108739 .
109536) (\PS.BOUTFIXP 109538 . 110818) (\PS.SCALEHACK 110820 . 113463) (\PS.SCALEREGION 113465 .
114025) (\SCALEDBITBLT.PSC 114027 . 118337) (\SETPOS.PSC 118339 . 118820) (\SETXFORM.PSC 118822 .
121406) (\STRINGWIDTH.PSC 121408 . 121881) (\SWITCHFONTS.PSC 121883 . 127375) (\TERPRI.PSC 127377 .
128499)) (128536 182026 (\BITBLT.PSC 128546 . 129099) (\BLTSHADE.PSC 129101 . 133566) (\CHARWIDTH.PSC
133568 . 134075) (\CREATECHARSET.PSC 134077 . 135775) (\DRAWARC.PSC 135777 . 138155) (\DRAWCIRCLE.PSC
138157 . 140408) (\DRAWCURVE.PSC 140410 . 144254) (\DRAWELLIPSE.PSC 144256 . 146620) (\DRAWLINE.PSC
146622 . 149058) (\DRAWPOINT.PSC 149060 . 149636) (\DRAWPOLYGON.PSC 149638 . 152767) (
\DSPBOTTOMMARGIN.PSC 152769 . 153456) (\DSPCLIPPINGREGION.PSC 153458 . 154833) (\DSPCOLOR.PSC 154835
. 155675) (\DSPFONT.PSC 155677 . 159196) (\DSPLEFTMARGIN.PSC 159198 . 159884) (\DSPLINEFEED.PSC
159886 . 160476) (\DSPPUSHSTATE.PSC 160478 . 161938) (\DSPPOPSTATE.PSC 161940 . 165425) (\DSPRESET.PSC
165427 . 166092) (\DSPRIGHTMARGIN.PSC 166094 . 166783) (\DSPROTATE.PSC 166785 . 167784) (
\DSPSCALE.PSC 167786 . 168738) (\DSPSCALE2.PSC 168740 . 169580) (\DSPSPACEFACTOR.PSC 169582 . 170503)
(\DSPTOPMARGIN.PSC 170505 . 171076) (\DSPTRANSLATE.PSC 171078 . 173109) (\DSPXPOSITION.PSC 173111 .
173675) (\DSPYPOSITION.PSC 173677 . 174268) (\FILLCIRCLE.PSC 174270 . 176495) (\FILLPOLYGON.PSC 176497
. 179734) (\FIXLINELENGTH.PSC 179736 . 181055) (\MOVETO.PSC 181057 . 181827) (\NEWPAGE.PSC 181829 .
182024)) (182082 204105 (\POSTSCRIPT.CHANGECHARSET 182092 . 182829) (\POSTSCRIPT.OUTCHARFN 182831 .
194959) (\POSTSCRIPT.PRINTSLUG 194961 . 196685) (\POSTSCRIPT.SPECIALOUTCHARFN 196687 . 199038) (
\UPDATE.PSC 199040 . 200286) (\POSTSCRIPT.ACCENTFN 200288 . 201230) (\POSTSCRIPT.ACCENTPAIR 201232 .
204103)) (204203 205848 (\PSC.SPACEDISP 204213 . 204492) (\PSC.SPACEWID 204494 . 205113) (\PSC.SYMBOLS
205115 . 205846)) (205957 208948 (\POSTSCRIPT.NSHASH 205967 . 208946)) (253722 254436 (POSTSCRIPTSEND
253732 . 254434)))))
(FILEMAP (NIL (22736 33232 (POSTSCRIPT.INIT 22746 . 29838) (POSTSCRIPT.PUTRGBCOLOR 29840 . 30862) (
\PSC.COLOR.TO.RGB 30864 . 33230)) (34218 69002 (PSCFONT.READFONT 34228 . 36136) (PSCFONT.SPELLFILE
36138 . 36716) (PSCFONT.COERCEFILE 36718 . 38290) (PSCFONTFROMCACHE.SPELLFILE 38292 . 39277) (
PSCFONTFROMCACHE.COERCEFILE 39279 . 40931) (PSCFONT.WRITEFONT 40933 . 41948) (READ-AFM-FILE 41950 .
47821) (CONVERT-AFM-FILES 47823 . 49035) (POSTSCRIPT.GETFONTID 49037 . 50432) (POSTSCRIPT.FONTCREATE
50434 . 62833) (\POSTSCRIPT.SPECIALFONT.SCALEDWIDTHS 62835 . 65232) (POSTSCRIPT.FONTSAVAILABLE 65234
. 69000)) (69557 78842 (OPENPOSTSCRIPTSTREAM 69567 . 78508) (CLOSEPOSTSCRIPTSTREAM 78510 . 78840)) (
78887 84941 (POSTSCRIPT.HARDCOPYW 78897 . 82004) (POSTSCRIPT.TEDIT 82006 . 82490) (POSTSCRIPT.TEXT
82492 . 82783) (POSTSCRIPTFILEP 82785 . 83892) (MAKEEPSFILE 83894 . 84939)) (84942 128516 (
POSTSCRIPT.BITMAPSCALE 84952 . 87408) (POSTSCRIPT.CLOSESTRING 87410 . 87963) (POSTSCRIPT.ENDPAGE 87965
. 88856) (POSTSCRIPT.OUTSTR 88858 . 90075) (POSTSCRIPT.PUTBITMAPBYTES 90077 . 98548) (
POSTSCRIPT.PUTCOMMAND 98550 . 99539) (POSTSCRIPT.SET-FAKE-LANDSCAPE 99541 . 104061) (
POSTSCRIPT.SHOWACCUM 104063 . 106218) (POSTSCRIPT.STARTPAGE 106220 . 108752) (\POSTSCRIPTTAB 108754 .
109551) (\PS.BOUTFIXP 109553 . 110833) (\PS.SCALEHACK 110835 . 113478) (\PS.SCALEREGION 113480 .
114040) (\SCALEDBITBLT.PSC 114042 . 118352) (\SETPOS.PSC 118354 . 118835) (\SETXFORM.PSC 118837 .
121421) (\STRINGWIDTH.PSC 121423 . 121896) (\SWITCHFONTS.PSC 121898 . 127390) (\TERPRI.PSC 127392 .
128514)) (128551 182631 (\BITBLT.PSC 128561 . 129113) (\BLTSHADE.PSC 129115 . 133776) (\CHARWIDTH.PSC
133778 . 134285) (\CREATECHARSET.PSC 134287 . 135985) (\DRAWARC.PSC 135987 . 138365) (\DRAWCIRCLE.PSC
138367 . 140618) (\DRAWCURVE.PSC 140620 . 144464) (\DRAWELLIPSE.PSC 144466 . 146830) (\DRAWLINE.PSC
146832 . 149572) (\DRAWPOINT.PSC 149574 . 150150) (\DRAWPOLYGON.PSC 150152 . 153281) (
\DSPBOTTOMMARGIN.PSC 153283 . 153970) (\DSPCLIPPINGREGION.PSC 153972 . 155347) (\DSPCOLOR.PSC 155349
. 156280) (\DSPFONT.PSC 156282 . 159801) (\DSPLEFTMARGIN.PSC 159803 . 160489) (\DSPLINEFEED.PSC
160491 . 161081) (\DSPPUSHSTATE.PSC 161083 . 162543) (\DSPPOPSTATE.PSC 162545 . 166030) (\DSPRESET.PSC
166032 . 166697) (\DSPRIGHTMARGIN.PSC 166699 . 167388) (\DSPROTATE.PSC 167390 . 168389) (
\DSPSCALE.PSC 168391 . 169343) (\DSPSCALE2.PSC 169345 . 170185) (\DSPSPACEFACTOR.PSC 170187 . 171108)
(\DSPTOPMARGIN.PSC 171110 . 171681) (\DSPTRANSLATE.PSC 171683 . 173714) (\DSPXPOSITION.PSC 173716 .
174280) (\DSPYPOSITION.PSC 174282 . 174873) (\FILLCIRCLE.PSC 174875 . 177100) (\FILLPOLYGON.PSC 177102
. 180339) (\FIXLINELENGTH.PSC 180341 . 181660) (\MOVETO.PSC 181662 . 182432) (\NEWPAGE.PSC 182434 .
182629)) (182687 204710 (\POSTSCRIPT.CHANGECHARSET 182697 . 183434) (\POSTSCRIPT.OUTCHARFN 183436 .
195564) (\POSTSCRIPT.PRINTSLUG 195566 . 197290) (\POSTSCRIPT.SPECIALOUTCHARFN 197292 . 199643) (
\UPDATE.PSC 199645 . 200891) (\POSTSCRIPT.ACCENTFN 200893 . 201835) (\POSTSCRIPT.ACCENTPAIR 201837 .
204708)) (204808 206453 (\PSC.SPACEDISP 204818 . 205097) (\PSC.SPACEWID 205099 . 205718) (\PSC.SYMBOLS
205720 . 206451)) (206562 209553 (\POSTSCRIPT.NSHASH 206572 . 209551)) (254327 255033 (POSTSCRIPTSEND
254337 . 255031)))))
STOP

Binary file not shown.

View File

@@ -12,7 +12,7 @@ POSTSCRIPTSTREAM
By: Matt Heffron (then: mheffron@orion.cf.uci.edu, now: heffron@alumni.caltech.edu)
INTRODUCTION
The PostScript package defines a set of imageops for printers which understand the PostScript page description language by Adobe. At Beckman we have successfully used TEdit, Sketch, LISTFILES, and HARDCOPYW to an Apple LaserWriter and an AST TurboLaser PS. The PostScript imagestream driver installs itself when it is loaded. All symbols in the PostScript driver are located in the INTERLISP: package.
The PostScriptStream package defines a set of imageops for printers which understand the PostScriptÔ page description language by Adobe. At Beckman we have successfully used TEdit, Sketch, LISTFILES, and HARDCOPYW to an Apple LaserWriter and an AST TurboLaser PS. The PostScriptStream imagestream driver installs itself when it is loaded. All symbols in the PostScriptStream driver are located in the INTERLISP: package.
VARIABLES
POSTSCRIPT.FONT.ALIST [InitVariable]
POSTSCRIPT.FONT.ALIST is an ALIST mapping Xerox Lisp font names into the root names of PostScript font files. It is also used for font family coercions. The default value should be acceptable for any of the fonts which are built into the Apple Laserwriter.
@@ -36,40 +36,39 @@ HINT
Setting POSTSCRIPT.BITMAP.SCALE to 0.96, instead of 1, will give cleaner BITMAP images on a 300 dpi printer. (This corrects for the 72 ppi imagestream vs. the 75 dpi printer, using 4x4 device dots per bitmap pixel.) Also, values of 0.24, 0.48 and 0.72, instead of 0.25, 0.5 and 0.75, will also give cleaner images for reduced size output. In general, use integer multiples of 0.24 for a 300 dpi printer.
POSTSCRIPT.TEXTURE.SCALE [InitVariable]
POSTSCRIPT.TEXTURE.SCALE specifies an independent scale for the display of bitmap textures. The value represents the number of device space units per texture unit (bitmap bit). The default value is 4, which represents each bit of the texture as a 4x4 block, so that textures are approximately the same resolution as on the screen (for 300 dpi output devices, such as the Apple Laserwriter).
The PostScript package extends the allowed representations of a texture, beyond 16-bit FIXP and 16x16 bitmap, to ANY square bitmap. (If the bitmap is not square, its longer edge is truncated from the top or right to make it square.) Use this feature with caution, as large bitmap textures, or sizes other than multiples of 16 bits square, require large amounts of storage in the PostScript interpreter (in the printer controller), and can cause limitcheck errors when actually printing.
Anywhere that a texture or color can be used on an imagestream or in the specification of a BRUSH, you can instead give either: a COLOR name, an RGB triple, an HLS triple, or a FLOATP between 0.0 and 1.0 (inclusive) to represent a PostScript halftone gray shade. (For the name, RGB or HLS values, see the file COLOR.TEDIT in the library directory.) (For the single FLOATP value, it will be converted to the corresponding RGB form. 0.0 is black and 1.0 is white. Specifically, the value sets the brightness of the shade.) All forms of the value you specify will be checked for validity. E.g. you can pass 0.33 as the color to DRAWLINE to get a dark gray line. This will be converted to the RGB triple (84 84 84).
The PostScriptStream package extends the allowed representations of a texture, beyond 16-bit FIXP and 16x16 bitmap, to ANY square bitmap. (If the bitmap is not square, its longer edge is truncated from the top or right to make it square.) Use this feature with caution, as large bitmap textures, or sizes other than multiples of 16 bits square, require large amounts of storage in the PostScript interpreter (in the printer controller), and can cause limitcheck errors when actually printing.
Anywhere that a texture or color can be used on an imagestream or in the specification of a BRUSH, you can instead give either: NIL, a COLOR name, an RGB triple, an HLS triple, a SMALLP 0 or 1, or a FLOATP between 0.0 and 1.0 (inclusive). The value NIL means to use the current DSPCOLOR. For the COLOR name, RGB or HLS values, see the file COLOR.TEDIT in the library directory for descriptions of those. Any integer value other than 0 or 1 will be ignored and the current DSPCOLOR will be used. The single SMALLP or FLOATP value cases represent a PostScript gray shade. 0.0 is black and 1.0 is white. Specifically, the value sets the brightness of the shade. E.g. you can pass 0.33 as the color to DRAWLINE to get a dark gray line. This will be converted to the RGB triple (84 84 84). All forms of the value you specify will be checked for validity.
POSTSCRIPT.IMAGESIZEFACTOR [InitVariable]
POSTSCRIPT.IMAGESIZEFACTOR specifies an independent factor to change the overall size of the printed image. This re-sizing affects the entire printed output (specifically, it superimposes its effects upon those of POSTSCRIPT.BITMAP.SCALE and POSTSCRIPT.TEXTURE.SCALE). Values greater than 1 enlarge the printed image, and values less than 1 reduce it. An invalid POSTSCRIPT.IMAGESIZEFACTOR (i.e. not a positive, non-zero number) will use a value of 1. The BITMAPSCALE function for the POSTSCRIPT printer type does NOT consider the POSTSCRIPT.IMAGESIZEFACTOR when determining the scale factor for a bitmap.
MISCELLANEOUS
The SCALE of a PostScript imagestream is 100. This is to allow enough resolution in the width information for fonts to enable TEdit to correctly fill and justify text.
The first time any PostScript imagestream is created (even if only to hardcopy a bitmap or window) the DEFAULTFONT is instantiated (unless a FONTS option was given to the OPENIMAGESTREAM, in which case the initial font for the imagestream will be set to that font, or to the CAR if a list).
The PostScript imagestream method for FILLPOLYGON uses the global variable FILL.WRULE as the default value for the WINDINGNUMBER argument. (This is the same variable which is used by the DISPLAY imagestream method for FILLPOLYGON.)
The PostScript imagestream method for OPENIMAGESTREAM (and, therefore, SEND.FILE.TO.PRINTER), supports an IMAGESIZEFACTOR option to change the size of the printed image. The IMAGESIZEFACTOR re-sizing is combined with the POSTSCRIPT.IMAGESIZEFACTOR to produce an overall re-sizing of the printed image. A HEADING option is also supported to give a running header on each page of output. The value of the HEADING option is printed at the top left of the page, followed by "Page " and the appropriate page number. They are printed in the DEFAULTFONT (unless a FONTS option was given to the OPENIMAGESTREAM, in which case it will be that font, or to the CAR if a list).
The PostScript package is contained in the files: POSTSCRIPTSTREAM.LCOM & PS-SEND.LCOM, with the source in the files: POSTSCRIPTSTREAM & PS-SEND. The module PS-SEND.LCOM is required and will be loaded automatically when POSTSCRIPTSTREAM.LCOM is loaded. It contains the function which is called by SEND.FILE.TO.PRINTER to actually transmit the file to the printer. It is, by its nature, quite site specific, so it is in a separate file to make modifying it for any site relatively simple. System record declarations required to compile POSTSCRIPTSTREAM can be found in EXPORTS.ALL.
The SCALE of a PostScriptStream imagestream is 100. This is to allow enough resolution in the width information for fonts to enable TEdit to correctly fill and justify text.
The first time any PostScriptStream imagestream is created (even if only to hardcopy a bitmap or window) the DEFAULTFONT is instantiated (unless a FONTS option was given to the OPENIMAGESTREAM, in which case the initial font for the imagestream will be set to that font, or to the CAR if a list).
The PostScriptStream imagestream method for FILLPOLYGON uses the global variable FILL.WRULE as the default value for the WINDINGNUMBER argument. (This is the same variable which is used by the DISPLAY imagestream method for FILLPOLYGON.)
The PostScriptStream imagestream method for OPENIMAGESTREAM (and, therefore, SEND.FILE.TO.PRINTER), supports an IMAGESIZEFACTOR option to change the size of the printed image. The IMAGESIZEFACTOR re-sizing is combined with the POSTSCRIPT.IMAGESIZEFACTOR to produce an overall re-sizing of the printed image. A HEADING option is also supported to give a running header on each page of output. The value of the HEADING option is printed at the top left of the page, followed by "Page " and the appropriate page number. They are printed in the DEFAULTFONT (unless a FONTS option was given to the OPENIMAGESTREAM, in which case it will be that font, or to the CAR if a list).
I'm pretty sure that the output generated by the PostScript imageops fully conforms to the Adobe Systems Document Structuring Conventions, Version 2.0, January 31, 1987.
Including Other PostScript Operations
If you wish to insert your own specific PostScript operations into a PostScript imagestream, you can do so with the following functions:
If you wish to insert your own specific PostScript operations into a PostScriptStream imagestream, you can do so with the following functions:
(POSTSCRIPT.OUTSTR STREAM STRING) [Function]
POSTSCRIPT.OUTSTR outputs a string or value to the imagestream. STREAM must be an open PostScript imagestream. STRING is the value to output (STRINGP and LITATOM are most efficient, but any value can be output (its PRIN1 pname is used)).
POSTSCRIPT.OUTSTR outputs a string or value to the imagestream. STREAM must be an open PostScriptStream imagestream. STRING is the value to output (STRINGP and LITATOM are most efficient, but any value can be output (its PRIN1 pname is used)).
(POSTSCRIPT.PUTCOMMAND STREAM STRING1 ... STRINGn) [NoSpread Function]
POSTSCRIPT.PUTCOMMAND is more general for sequences of commands and values. It calls POSTSCRIPT.OUTSTR repeatedly to output each of the STRINGi arguments to STREAM.
(\POSTSCRIPT.OUTCHARFN STREAM CHAR) [Function]
\POSTSCRIPT.OUTCHARFN is used to output the characters forming the text of a PostScript string (e.g. the argument to a show or charpath operator). STREAM is the open PostScript imagestream to output to, and CHAR is the CHARCODE of the character to output. The / (slash), ( and ) (parenthesis) characters will be quoted with /, and characters with ASCII values less than 32 (space) or greater than 126 (tilde) will be output as /nnn (in octal). \POSTSCRIPT.OUTCHARFN will output the ( character to open the string, if necessary. Use POSTSCRIPT.CLOSESTRING (below) to close the string.
\POSTSCRIPT.OUTCHARFN is used to output the characters forming the text of a PostScript string (e.g. the argument to a show or charpath operator). STREAM is the open PostScriptStream imagestream destination for output, and CHAR is the CHARCODE of the character to output. The / (slash), ( and ) (parenthesis) characters will be quoted with /, and characters with ASCII values less than 32 (space) or greater than 126 (tilde) will be output as /nnn (in octal). \POSTSCRIPT.OUTCHARFN will output the ( character to open the string, if necessary. Use POSTSCRIPT.CLOSESTRING (below) to close the string.
(POSTSCRIPT.CLOSESTRING STREAM) [Function]
POSTSCRIPT.CLOSESTRING closes a PostScript string (e.g. the argument to a show or charpath operator). STREAM is the open PostScript imagestream. It is important to use POSTSCRIPT.CLOSESTRING to output the ) character to close the string, because it also clears the stream state flag that indicates that a string is in progress (otherwise, the next POSTSCRIPT.PUTCOMMAND would output the commands to close the string and show it).
POSTSCRIPT.CLOSESTRING closes a PostScript string (e.g. the argument to a show or charpath operator). STREAM is the open PostScriptStream imagestream. It is important to use POSTSCRIPT.CLOSESTRING to output the ) character to close the string, because it also clears the stream state flag that indicates that a string is in progress (otherwise, the next POSTSCRIPT.PUTCOMMAND would output the commands to close the string and show it).
Warning
Do not attempt to create a PostScript font larger than about 600 points, as much of Interlisp's font information is stored in SMALLP integers, and too large a font would overflow the font's height, or the width for any of the wider characters. (I know that 600 points is a ridiculously large limit (about 8.3 inches), but I thought I'd better mention it, or someone might try it!)
Changes from the Initial Medley Release
This second Medley release of the PostScript imagestream driver includes some performance enhancements when writing bitmaps to the output, some SUN-specific code (from Will Snow of envos), implementation of the SCALEDBITBLT, DSPROTATE, and DSPTRANSLATE operations, and a lot of performance enhancements (many thanks to Tom Lipkis of Savoir).
This second Medley release of the PostScriptStream imagestream driver includes some performance enhancements when writing bitmaps to the output, some SUN-specific code (from Will Snow of envos), implementation of the SCALEDBITBLT, DSPROTATE, and DSPTRANSLATE operations, and a lot of performance enhancements (many thanks to Tom Lipkis of Savoir).
Changes from the Lyric Release
The Medley release of this PostScript imagestream driver changed the default value of POSTSCRIPT.TEXTFILE.LANDSCAPE from T to NIL. It also added the support for the HEADING option.
The Medley release of this PostScriptStream imagestream driver changed the default value of POSTSCRIPT.TEXTFILE.LANDSCAPE from T to NIL. It also added the support for the HEADING option.
Known Problems/Limitations
The output generated for a PostScript imagestream is rather brute force. It isn't particularly careful to generate the smallest output file for a given sequence of operations. Specifically, it often generates extra end-of-lines between PostScript operator sequences (this has no effect on the printed output, only on the file size).
The output generated for a PostScriptStream imagestream is rather brute force. It isn't particularly careful to generate the smallest output file for a given sequence of operations. Specifically, it often generates extra end-of-lines between PostScript operator sequences (this has no effect on the printed output, only on the file size).
Using BITMAPs or Functions as BRUSH arguments to the curve drawing functions is not supported, nor is using a non-ROUND BRUSH with DRAWCIRCLE or DRAWELLIPSE.
The implementation of DSPROTATE accepts ROTATION argument values of 0 and 90 (any non-NIL, non-zero value is converted to 90). A value of 0 converts the page orientation to Portrait, and 90 converts the page orientation to Landscape. These conversions perform the translations necessary to keep the clipping region on the page. (This may or may not be the right thing to do, but since DSPROTATE is undocumented in what it should do, this is what the PostScript driver does).
There is no support for NS character sets other than 0, and there is no translation of the character code values from NS encoding to PostScript encoding.
The implementation of DSPROTATE accepts ROTATION argument values of 0 and 90 (any non-NIL, non-zero value is converted to 90). A value of 0 converts the page orientation to Portrait, and 90 converts the page orientation to Landscape. These conversions perform the translations necessary to keep the clipping region on the page. (This may or may not be the right thing to do, but since DSPROTATE is undocumented in what it should do, this is what the PostScriptStream driver does).
There is spotty support for NS character sets other than 0, and there is no additional translation of the character code values from NS encoding to PostScript encoding.
There is minimal support for color.
\POSTSCRIPT.OUTCHARFN is pretty wimpy in its handling of TAB characters. It just moves to the next multiple of (eight times the average character width of the current font) from the current left margin.
\POSTSCRIPT.OUTCHARFN is pretty wimpy in its handling of TAB characters. It just moves to the next multiple of (eight times the average character width of the current font) from the current left margin. (TEdit does the right thing when generating hardcopy using PostScriptStream.)
I haven't yet documented how to build the .PSCFONT files from .AFM files for new fonts that become available.(SEQUENCE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((HEADING NIL (HEADINGTYPE RUNNINGHEAD) (72 732 540 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL))) (ALTERNATE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (162 48 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (72 732 540 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL))) (PAGE NIL (PAPERSIZE Letter FOLIOINFO (ARABIC "" "")) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD CENTERED) CHARLOOKS (SUPERSCRIPT 0 INVISIBLE OFF SELECTPOINT OFF PROTECTED OFF SIZE 10 FAMILY MODERN OVERLINE OFF STRIKEOUT OFF UNDERLINE OFF EXPANSION REGULAR SLOPE REGULAR WEIGHT MEDIUM INVERTED OFF USERINFO NIL STYLE NIL) FORMATINFO (ARABIC "" "")) (162 48 288 36) NIL) (HEADING NIL (HEADINGTYPE RUNNINGHEAD) (72 732 540 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL)))))))
1$1È $7È $È7È $È166$1È$1È$1ŠŠ8$1ŠŠ8$JÈ$È PAGEHEADING RUNNINGHEAD
MODERN
@@ -81,6 +80,6 @@ I haven't yet documented how to build the .PSCFONT files from .AFM files for new
ÿþMODERN MODERNCLASSICCLASSIC
 
 
 HRULE.GETFN HRULE.GETFN HRULE.GETFN   HRULE.GETFN HRULE.GETFN 
ÿ-Lc<01>˜ýŠéÏe©#é¢K©&  A*y    62
-f4f gbá~(VOžÞš$ÌmDATE:iÖ³33(ázº
 HRULE.GETFN HRULE.GETFN HRULE.GETFN   HRULE.GETFN HRULE.GETFN ¨
ÿ-Lc<01>˜ýŠïÁ<01>e¯)﨩&<EFBFBD>  A0y    F2
-f4f ghá~(\¼Užä©$mDATE:jº32-ázº

View File

@@ -1,12 +1,13 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "25-May-2024 13:19:49" {WMEDLEY}<lispusers>DINFO.;14 65819
(FILECREATED " 9-May-2025 21:15:54" {WMEDLEY}<lispusers>DINFO.;19 67369
:EDIT-BY rmk
:CHANGES-TO (FNS DINFO.OPENTEXTSTREAM DINFO.UPDATE.TEXT.DISPLAY)
:CHANGES-TO (FNS DINFO.CLOSEFN DINFO.UPDATE.FROM.GRAPH DINFO.GET.GRAPH.WINDOW
DINFO.OPENTEXTSTREAM)
:PREVIOUS-DATE "11-Apr-2024 08:27:34" {WMEDLEY}<lispusers>DINFO.;13)
:PREVIOUS-DATE " 7-May-2025 10:13:33" {WMEDLEY}<lispusers>DINFO.;17)
(PRETTYCOMPRINT DINFOCOMS)
@@ -482,12 +483,19 @@
(WINDOWADDPROP WINDOW 'EXPANDFN 'DINFO.EXPANDFN])
(DINFO.CLOSEFN
[LAMBDA (W) (* drc%: "25-Jan-86 18:26")
[LAMBDA (W) (* ; "Edited 9-May-2025 21:15 by rmk")
(* drc%: "25-Jan-86 18:26")
(* ;;
 "This closes the DINFO text window. When the text window closes, the graph window closes too.")
(* ;; "There is a potential cycle from the graph to the the text window and then back to the graph. To clean this up, every window should have a pointer to this window, and this window would point to the DINFOGRAPH. If we ever wanted to collect (why would we?), we would have a single place to break the link.")
(LET [(GRAPH (WINDOWPROP W 'DINFOGRAPH]
(if (type? DINFOGRAPH GRAPH)
then (CLOSEW (fetch (DINFOGRAPH GRAPH.WINDOW) of GRAPH))
(* remove circularity...)
(WINDOWPROP W 'DINFOGRAPH NIL])
(CL:WHEN (type? DINFOGRAPH GRAPH)
(CLOSEW (fetch (DINFOGRAPH GRAPH.WINDOW) of GRAPH))
(* ; "remove circularity...")
(AND NIL (WINDOWPROP W 'DINFOGRAPH NIL)))])
(DINFO.SHRINKFN
[LAMBDA (W) (* drc%: "25-Jan-86 18:26")
@@ -856,20 +864,28 @@
(fetch (DINFONODE LABEL) of (fetch (DINFOGRAPH CURRENTNODE) of DINFO.GRAPH])
(DINFO.UPDATE.FROM.GRAPH
[LAMBDA (GRAPHER.NODE GRAPH.WINDOW) (* ; "Edited 9-Mar-2024 14:21 by rmk")
[LAMBDA (GRAPHER.NODE GRAPH.WINDOW) (* ; "Edited 9-May-2025 16:16 by rmk")
(* ; "Edited 9-Mar-2024 14:21 by rmk")
(* drc%: "12-Dec-85 18:34")
(AND GRAPHER.NODE (ADD.PROCESS `[DINFO.UPDATE ',(WINDOWPROP GRAPH.WINDOW 'DINFOGRAPH)
',(fetch (GRAPHNODE NODEID) of GRAPHER.NODE]
'NAME "DInfo From Graph"])
(CL:WHEN GRAPHER.NODE
(ADD.PROCESS `[DINFO.UPDATE ',(WINDOWPROP GRAPH.WINDOW 'DINFOGRAPH)
',(fetch (GRAPHNODE NODEID) of GRAPHER.NODE]
'NAME "DInfo From Graph"))])
(DINFO.GET.GRAPH.WINDOW
[LAMBDA (GRAPH REGION) (* drc%: "25-Jan-86 18:05")
[LAMBDA (GRAPH REGION) (* ; "Edited 9-May-2025 16:21 by rmk")
(* drc%: "25-Jan-86 18:05")
(* ;; "Given a graph, this creates the window with the nodes to click on. The graph points to the graph window, and the graph window points to the graph. On closing the cycle is broken by removing the window's pointer to the graph.")
(* ;; "Note that the DINFO text window is not part of this.")
(LET ((W (fetch (DINFOGRAPH GRAPH.WINDOW) of GRAPH)))
(COND
((WINDOWP W))
(T (SETQ W (DINFO.CREATE.GRAPH.WINDOW GRAPH REGION))
[WINDOWPROP W 'CLOSEFN (FUNCTION (LAMBDA (W)
(WINDOWPROP W 'DINFOGRAPH NIL]
[AND NIL (WINDOWPROP W 'CLOSEFN (FUNCTION (LAMBDA (W)
(WINDOWPROP W 'DINFOGRAPH NIL]
(replace (DINFOGRAPH GRAPH.WINDOW) of GRAPH with W)))
(WINDOWPROP W 'DINFOGRAPH GRAPH)
W])
@@ -988,7 +1004,8 @@
(DEFINEQ
(DINFO.UPDATE.TEXT.DISPLAY
[LAMBDA (GRAPH NODE SEL OFF?) (* ; "Edited 25-May-2024 13:16 by rmk")
[LAMBDA (GRAPH NODE SEL OFF?) (* ; "Edited 6-May-2025 23:45 by rmk")
(* ; "Edited 25-May-2024 13:16 by rmk")
(* drc%: "25-Jan-86 18:18")
(* drc%: "25-Jan-86 18:18")
(LET ((WINDOW (fetch (DINFOGRAPH WINDOW) of GRAPH))
@@ -1005,7 +1022,7 @@
WINDOW NIL NIL PROPS)
(replace (DINFOGRAPH LAST.TEXT) of GRAPH with NIL)
elseif (SETQ FULLFILENAME (MKATOM (INFILEP FILENAME)))
then (SETQ TEXTSTREAM (DINFO.OPENTEXTSTREAM FULLFILENAME WINDOW FROM TO PROPS))
then (SETQ TEXTSTREAM (DINFO.OPENTEXTSTREAM FULLFILENAME GRAPH WINDOW FROM TO PROPS))
(DINFO.SHOWSEL TEXTSTREAM SEL)
else (OPENTEXTSTREAM (OPENSTRINGSTREAM (CONCAT "Sorry, can't find the text for this node."
(MKSTRING (CHARACTER (CHARCODE CR)))
@@ -1037,7 +1054,9 @@
(PROMPTPRINT "DInfo is busy"])
(DINFO.OPENTEXTSTREAM
[LAMBDA (FILE WINDOW FROM TO PROPS) (* ; "Edited 25-May-2024 13:17 by rmk")
[LAMBDA (FILE GRAPH WINDOW FROM TO PROPS) (* ; "Edited 9-May-2025 12:37 by rmk")
(* ; "Edited 7-May-2025 00:24 by rmk")
(* ; "Edited 25-May-2024 13:17 by rmk")
(* ; "Edited 10-Apr-2024 23:46 by rmk")
(* ; "Edited 10-Mar-2024 15:37 by rmk")
(* drc%: "25-Jan-86 18:24")
@@ -1054,9 +1073,10 @@
else (CL:WHEN TEXTSTREAM (TEDIT.KILL TEXTSTREAM))
(CLEARW T)
(CLEARW WINDOW)
(WINDOWPROP WINDOW 'DINFOGRAPH GRAPH)
[RESETSAVE NIL `(AND RESETSTATE (WINDOWPROP ,WINDOW 'LAST.TEXT NIL]
(PROG1 (TEDIT (OPENTEXTSTREAM FILE NIL FROM TO PROPS)
WINDOW)
(OR WINDOW 'DINFO))
(replace (DINFOGRAPH LAST.TEXT) of (DINFOGRAPH WINDOW) with THIS.TEXT))])
(DINFO.SHOWSEL
@@ -1113,21 +1133,21 @@
(SETTEMPLATE 'DINFOGRAPHPROP 'MACRO)
)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (4582 6041 (DINFOGRAPHPROP 4582 . 6041)) (7295 24433 (DINFO 7305 . 8919) (DINFO.UPDATE
8921 . 11785) (DINFOGRAPH 11787 . 12205) (DINFO.SPECIAL.UPDATE 12207 . 13905) (DINFO.READ.GRAPH 13907
. 15762) (DINFO.WRITE.GRAPH 15764 . 16854) (DINFO.SELECT.GRAPH 16856 . 17763) (DINFO.DEFAULT.MENU
17765 . 20289) (DINFO.FIND 20291 . 22877) (DINFO.LOOKUP 22879 . 24431)) (24434 27128 (
DINFO.READ.KOTO.GRAPH 24444 . 27126)) (27129 29443 (DINFO.SETUP.WINDOW 27139 . 27820) (DINFO.CLOSEFN
27822 . 28255) (DINFO.SHRINKFN 28257 . 28453) (DINFO.EXPANDFN 28455 . 29012) (DINFO.ICONFN 29014 .
29441)) (29444 40766 (DINFO.ADD.FMENU 29454 . 30549) (DINFO.CREATE.FMENU 30551 . 34578) (
DINFO.FMW.CLOSEFN 34580 . 35425) (DINFO.FMENU.HANDLER 35427 . 36066) (DINFO.UPDATE.FMENU 36068 . 38257
) (DINFO.TOGGLE.MENU 38259 . 38849) (DINFO.TOGGLE.GRAPH 38851 . 39350) (DINFO.TOGGLE.HISTORY 39352 .
39896) (DINFO.TOGGLE.TEXT 39898 . 40764)) (40767 48562 (DINFO.UPDATE.MENU.DISPLAY 40777 . 44898) (
DINFO.UPDATE.FROM.MENU 44900 . 45199) (DINFO.UPDATE.HISTORY 45201 . 47731) (DINFO.HISTORIC.UPDATE
47733 . 48560)) (48563 58892 (DINFO.UPDATE.GRAPH.DISPLAY 48573 . 50025) (DINFO.UPDATE.FROM.GRAPH 50027
. 50503) (DINFO.GET.GRAPH.WINDOW 50505 . 51090) (DINFO.CREATE.GRAPH.WINDOW 51092 . 52209) (
DINFO.SHOWGRAPH 52211 . 53936) (DINFO.INVERT.NODE 53938 . 55326) (DINFO.LAYOUTGRAPH 55328 . 58890)) (
58893 65232 (DINFO.UPDATE.TEXT.DISPLAY 58903 . 60963) (DINFO.TITLEMENUFN 60965 . 62090) (
DINFO.OPENTEXTSTREAM 62092 . 63592) (DINFO.SHOWSEL 63594 . 64327) (DINFO.GET.FILENAME 64329 . 65230)))
(FILEMAP (NIL (4641 6100 (DINFOGRAPHPROP 4641 . 6100)) (7354 24492 (DINFO 7364 . 8978) (DINFO.UPDATE
8980 . 11844) (DINFOGRAPH 11846 . 12264) (DINFO.SPECIAL.UPDATE 12266 . 13964) (DINFO.READ.GRAPH 13966
. 15821) (DINFO.WRITE.GRAPH 15823 . 16913) (DINFO.SELECT.GRAPH 16915 . 17822) (DINFO.DEFAULT.MENU
17824 . 20348) (DINFO.FIND 20350 . 22936) (DINFO.LOOKUP 22938 . 24490)) (24493 27187 (
DINFO.READ.KOTO.GRAPH 24503 . 27185)) (27188 30053 (DINFO.SETUP.WINDOW 27198 . 27879) (DINFO.CLOSEFN
27881 . 28865) (DINFO.SHRINKFN 28867 . 29063) (DINFO.EXPANDFN 29065 . 29622) (DINFO.ICONFN 29624 .
30051)) (30054 41376 (DINFO.ADD.FMENU 30064 . 31159) (DINFO.CREATE.FMENU 31161 . 35188) (
DINFO.FMW.CLOSEFN 35190 . 36035) (DINFO.FMENU.HANDLER 36037 . 36676) (DINFO.UPDATE.FMENU 36678 . 38867
) (DINFO.TOGGLE.MENU 38869 . 39459) (DINFO.TOGGLE.GRAPH 39461 . 39960) (DINFO.TOGGLE.HISTORY 39962 .
40506) (DINFO.TOGGLE.TEXT 40508 . 41374)) (41377 49172 (DINFO.UPDATE.MENU.DISPLAY 41387 . 45508) (
DINFO.UPDATE.FROM.MENU 45510 . 45809) (DINFO.UPDATE.HISTORY 45811 . 48341) (DINFO.HISTORIC.UPDATE
48343 . 49170)) (49173 60036 (DINFO.UPDATE.GRAPH.DISPLAY 49183 . 50635) (DINFO.UPDATE.FROM.GRAPH 50637
. 51208) (DINFO.GET.GRAPH.WINDOW 51210 . 52234) (DINFO.CREATE.GRAPH.WINDOW 52236 . 53353) (
DINFO.SHOWGRAPH 53355 . 55080) (DINFO.INVERT.NODE 55082 . 56470) (DINFO.LAYOUTGRAPH 56472 . 60034)) (
60037 66782 (DINFO.UPDATE.TEXT.DISPLAY 60047 . 62222) (DINFO.TITLEMENUFN 62224 . 63349) (
DINFO.OPENTEXTSTREAM 63351 . 65142) (DINFO.SHOWSEL 65144 . 65877) (DINFO.GET.FILENAME 65879 . 66780)))
))
STOP

Binary file not shown.

View File

@@ -1,616 +0,0 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "22-Jul-88 15:43:07" |{MCS:MCS:STANFORD}<LANE>TALK.;10| 38505
previous date%: "16-Jun-88 09:25:17" |{MCS:MCS:STANFORD}<LANE>TALK.;9|)
(* "
Copyright (c) 1987, 1988 by Stanford University. All rights reserved.
")
(PRETTYCOMPRINT TALKCOMS)
(RPAQQ TALKCOMS ((* TALK client/server code)
(LOCALVARS . T)
(FNS TALK)
(FNS TALK.RECONNECT TALK.PROCESS TALK.DISPLAY TALK.LISTEN TALK.CLOSEFN
TALK.ANSWER TALK.ANSWER.WINDOW TALK.ANSWER.USERNAME TALK.GET.NAME
TALK.ADD.NAME TALK.FLASH.CARET TALK.WHENSELECTEDFN TALK.RINGBELLS
TALK.START.SERVER)
(FNS TALK.ICON.BUTTONEVENTFN TALK.ICON.CLOSEFN)
(* TALK data)
(DECLARE%: DONTCOPY (RECORDS TALK.SERVICETYPE TALK.PROTOCOLTYPE))
(VARS TALK.MENU.ITEMS TALK.USER.MESSAGES)
(INITVARS TALK.SERVICETYPES TALK.PROTOCOLTYPES TALK.GAG TALK.HOSTNAMES
TALK.ICON.WINDOWS (TALK.ANSWER.WAIT 15)
(TALK.READTABLE (COPYREADTABLE 'ORIG))
(TALK.DEFAULT.REGION (CREATEREGION 0 0 500 500))
(TALK.CLOSED.STRING " -- Connection Closed")
(TALK.ICON.FONT LITTLEFONT))
(GLOBALVARS TALK.MENU.ITEMS TALK.USER.MESSAGES TALK.SERVICETYPES
TALK.PROTOCOLTYPES TALK.GAG TALK.HOSTNAMES TALK.ICON.WINDOWS
TALK.ANSWER.WAIT TALK.READTABLE TALK.DEFAULT.REGION TALK.CLOSED.STRING
TALK.ICON.FONT)
(ALISTS (BackgroundMenuCommands Talk))
(VARS (BackgroundMenu))
(APPENDVARS (BACKGROUNDFNS TALK.START.SERVER)
(AFTERMAKESYSFORMS (TALK.START.SERVER NIL T)))
(BITMAPS TALK.ICON.BITMAP)
(GLOBALVARS TALK.ICON.BITMAP)
(P (SETSYNTAX (CHARCODE SPACE)
(CHARCODE A)
TALK.READTABLE))))
(* TALK client/server code)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(LOCALVARS . T)
)
(DEFINEQ
(TALK
[LAMBDA (USER.OR.HOSTNAME SERVICE PROTOCOL) (* ; "Edited 9-Jun-88 12:32 by cdl")
(* DECLARATIONS%: (RECORD RESULT
 (SERVICETYPE INPUTSTREAM
  . OUTPUTSTREAM)))
(PROG (USER PROTOCOLTYPE PROTOCOLTYPES SERVICETYPE SERVICETYPES RESULT ADDRESSABLE?)
(if (NULL USER.OR.HOSTNAME)
then (if (SETQ USER.OR.HOSTNAME (TALK.GET.NAME))
then (if (LISTP USER.OR.HOSTNAME)
then (RETURN (TALK.RECONNECT USER.OR.HOSTNAME)))
else (RETURN)))
(if SERVICE
then (if [SETQ SERVICETYPE (for SERVICETYPE in TALK.SERVICETYPES
thereis (with TALK.SERVICETYPE
SERVICETYPE (STRING-EQUAL
SERVICE
TALK.SERVICENAME]
then (SETQ SERVICETYPES (LIST SERVICETYPE))
else (RETURN (LIST "Unknown service type!" SERVICE)))
else (if (NULL (SETQ SERVICETYPES TALK.SERVICETYPES))
then (RETURN "No services available!")))
(if PROTOCOL
then (if (SETQ PROTOCOLTYPE (ASSOC PROTOCOL TALK.PROTOCOLTYPES))
then (SETQ PROTOCOLTYPES (LIST PROTOCOLTYPE))
else (RETURN (LIST "Unknown protocol!" PROTOCOL)))
else (if (NULL (SETQ PROTOCOLTYPES TALK.PROTOCOLTYPES))
then (RETURN "No protocols available!")))
(if [SETQ PROTOCOLTYPE (bind ADDRESS for PROTOCOLTYPE in PROTOCOLTYPES
when (with TALK.PROTOCOLTYPE PROTOCOLTYPE
(SETQ ADDRESS (APPLY* TALK.HOSTNAMEFN
USER.OR.HOSTNAME)))
thereis (PROGN (TALK.ADD.NAME USER.OR.HOSTNAME
ADDRESS (with TALK.PROTOCOLTYPE
PROTOCOLTYPE
TALK.PROTOCOLNAME))
(SETQ ADDRESSABLE? T)
(SELECTQ (SETQ RESULT
(with TALK.PROTOCOLTYPE
PROTOCOLTYPE
(APPLY* TALK.CONNECTFN
ADDRESS
SERVICETYPES)))
(ANSWER (RETURN))
(LISTP RESULT]
then (with RESULT RESULT (RETURN (TALK.PROCESS INPUTSTREAM OUTPUTSTREAM
SERVICETYPE PROTOCOLTYPE 'CLIENT
USER.OR.HOSTNAME T)))
else (RETURN (if ADDRESSABLE?
then (SELECTQ RESULT
(ANSWER "No answer from TALK service!")
(LIST "Can't connect to host!" USER.OR.HOSTNAME))
else (LIST "Host not found!" USER.OR.HOSTNAME])
)
(DEFINEQ
(TALK.RECONNECT
[LAMBDA (DESTINATION) (* ; "Edited 10-Jun-88 14:59 by cdl")
(* DECLARATIONS%: (RECORD RESULT
 (SERVICETYPE INPUTSTREAM
  . OUTPUTSTREAM))
 (RECORD DESTINATION
 (NAME . ENTRIES)) (RECORD ENTRY
 (PROTOCOL . ADDRESS)))
(DECLARE (SPECVARS DESTINATION))
(if TALK.SERVICETYPES
then
[LET (PROTOCOLTYPE RESULT ENTRY ADDRESS) (* try all the protocols but prefer
 those that have already succeeded)
(if [SETQ PROTOCOLTYPE
(for PROTOCOLTYPE in [SORT (APPEND TALK.PROTOCOLTYPES)
(FUNCTION (LAMBDA (PROTOCOLTYPE)
(* DECLARATIONS%: (RECORD
 DESTINATION (NAME . ENTRIES)))
(with TALK.PROTOCOLTYPE
PROTOCOLTYPE
(with DESTINATION
DESTINATION
(ASSOC
TALK.PROTOCOLNAME
ENTRIES]
when [with TALK.PROTOCOLTYPE PROTOCOLTYPE
(AND [SETQ ADDRESS (with DESTINATION DESTINATION
(if (SETQ ENTRY
(ASSOC TALK.PROTOCOLNAME
ENTRIES))
then (with ENTRY ENTRY
ADDRESS)
else (APPLY* TALK.HOSTNAMEFN
NAME]
(SETQ RESULT (APPLY* TALK.CONNECTFN ADDRESS
TALK.SERVICETYPES]
thereis (SELECTQ RESULT
(ANSWER (RETURN))
(LISTP RESULT]
then (with RESULT RESULT (TALK.PROCESS INPUTSTREAM OUTPUTSTREAM
SERVICETYPE PROTOCOLTYPE 'CLIENT
(with DESTINATION DESTINATION NAME)
T))
else (SELECTQ RESULT
(ANSWER "No answer from TALK service!")
(LIST "Can't connect to host!" (with DESTINATION DESTINATION NAME]
else "No services available!"])
(TALK.PROCESS
[LAMBDA (INPUTSTREAM OUTPUTSTREAM SERVICETYPE PROTOCOLTYPE MODE USER SPAWN?)
(* ; "Edited 9-Jun-88 12:35 by cdl")
(if (LITATOM SERVICETYPE)
then (SETQ SERVICETYPE (ASSOC SERVICETYPE TALK.SERVICETYPES)))
(if (LITATOM PROTOCOLTYPE)
then (SETQ PROTOCOLTYPE (ASSOC PROTOCOLTYPE TALK.PROTOCOLTYPES)))
(LET ((DISPLAYSTREAM (TALK.DISPLAY INPUTSTREAM OUTPUTSTREAM SERVICETYPE PROTOCOLTYPE MODE
USER)))
(if SPAWN?
then [ADD.PROCESS `(TALK.LISTEN ,INPUTSTREAM ,OUTPUTSTREAM ,(KWOTE SERVICETYPE)
,(KWOTE PROTOCOLTYPE)
,DISPLAYSTREAM]
else (TALK.LISTEN INPUTSTREAM OUTPUTSTREAM SERVICETYPE PROTOCOLTYPE DISPLAYSTREAM])
(TALK.DISPLAY
[LAMBDA (INPUTSTREAM OUTPUTSTREAM SERVICETYPE PROTOCOLTYPE MODE USER)
(* ; "Edited 9-Jun-88 14:46 by cdl")
(* DECLARATIONS%: (ASSOCRECORD
 MESSAGES (GREETING)))
(LET (MAINWINDOW WINDOW REGION GREETING)
(DECLARE (SPECVARS GREETING))
(SETQ USER (with TALK.PROTOCOLTYPE PROTOCOLTYPE (APPLY* TALK.USERNAMEFN INPUTSTREAM
OUTPUTSTREAM SERVICETYPE MODE
USER)))
(with REGION (SETQ REGION (if (REGIONP TALK.DEFAULT.REGION)
then (with REGION TALK.DEFAULT.REGION
(GETBOXREGION WIDTH HEIGHT))
else (GETREGION)))
(SETQ HEIGHT (QUOTIENT HEIGHT 2)))
(SETQ MAINWINDOW (CREATEW (with REGION REGION (create REGION
BOTTOM _ (PLUS BOTTOM HEIGHT)
using REGION))
(PACK* "TALK (" (with TALK.SERVICETYPE SERVICETYPE
TALK.SERVICENAME)
")")))
(SETQ WINDOW (CREATEW REGION (CONCAT "(" (with TALK.PROTOCOLTYPE PROTOCOLTYPE
TALK.PROTOCOLNAME)
") Talk from " USER)))
(WINDOWPROP MAINWINDOW 'STREAMS (CONS INPUTSTREAM OUTPUTSTREAM))
(WINDOWADDPROP MAINWINDOW 'CLOSEFN (FUNCTION TALK.CLOSEFN))
(ATTACHWINDOW WINDOW MAINWINDOW 'BOTTOM)
(ATTACHMENU (create MENU
ITEMS _ TALK.MENU.ITEMS
CENTERFLG _ T
MENUBORDERSIZE _ 1
WHENSELECTEDFN _ (FUNCTION TALK.WHENSELECTEDFN))
WINDOW
'BOTTOM)
(with TALK.SERVICETYPE SERVICETYPE (APPLY* TALK.DISPLAYFN MAINWINDOW WINDOW INPUTSTREAM
OUTPUTSTREAM PROTOCOLTYPE USER))
(if (AND (SETQ GREETING (CAR (with MESSAGES TALK.USER.MESSAGES GREETING)))
(SETQ GREETING (ERRORSET GREETING)))
then (BKSYSBUF (CAR GREETING)))
WINDOW])
(TALK.LISTEN
[LAMBDA (INPUTSTREAM OUTPUTSTREAM SERVICETYPE PROTOCOLTYPE WINDOW)
(* ; "Edited 7-Jun-88 08:42 by cdl")
(PROG (ICON? (MAINWINDOW (MAINWINDOW WINDOW)))
(with TALK.SERVICETYPE SERVICETYPE (APPLY* TALK.LISTENFN MAINWINDOW WINDOW INPUTSTREAM
OUTPUTSTREAM PROTOCOLTYPE))
(TTY.PROCESS T)
(CLOSEF? INPUTSTREAM)
(if [OR (OPENWP WINDOW)
(for PROP in '(ICON ICONWINDOW) thereis (SETQ ICON?
(OPENWP (WINDOWPROP
MAINWINDOW
PROP]
then (WINDOWPROP WINDOW 'TITLE (CONCAT (WINDOWPROP WINDOW 'TITLE)
TALK.CLOSED.STRING))
(for WINDOW in (ATTACHEDWINDOWS WINDOW) when (WINDOWPROP WINDOW
'MENU)
do (if (DETACHWINDOW WINDOW)
then (CLOSEW WINDOW)))
(if ICON?
then (SHRINKW MAINWINDOW)
else (FLASHWINDOW WINDOW])
(TALK.CLOSEFN
[LAMBDA (WINDOW) (* ; "Edited 9-Jun-88 14:45 by cdl")
(* DECLARATIONS%: (RECORD STREAMS
 (INPUTSTREAM . OUTPUTSTREAM)))
(LET ((STREAMS (WINDOWPROP WINDOW 'STREAMS NIL)))
(if STREAMS
then (with STREAMS STREAMS (CLOSEF? INPUTSTREAM)
(CLOSEF? OUTPUTSTREAM])
(TALK.ANSWER
[LAMBDA (USER SERVICE PROTOCOL ADDRESS) (* ; "Edited 9-Jun-88 09:20 by cdl")
(LET [WINDOW REGION (EVENT (CREATE.EVENT))
(TIME (DATE '(DATEFORMAT NO.SECONDS]
(DECLARE (GLOBALVARS \IDLING))
(PROGN (* Only really necessary if you're
 talking to yourself)
(SPAWN.MOUSE))
(WINDOWPROP (SETQ WINDOW (TALK.ANSWER.WINDOW USER))
'EVENT EVENT)
(BITBLT TALK.ICON.BITMAP NIL NIL WINDOW)
[SETQ REGION (with REGION (DSPCLIPPINGREGION NIL WINDOW)
(CREATEREGION LEFT BOTTOM WIDTH (QUOTIENT HEIGHT 3]
(CENTERPRINTINREGION (CONCAT SERVICE "(" PROTOCOL ")")
(with REGION REGION (CREATEREGION LEFT BOTTOM WIDTH (DIFFERENCE HEIGHT 7)))
WINDOW)
(DSPFONT (PROG1 (DSPFONT TALK.ICON.FONT WINDOW)
(CENTERPRINTINREGION (CONCAT (SUBSTRING TIME 1 6)
(SUBSTRING TIME 10 -1))
(with REGION REGION (add BOTTOM HEIGHT)
(CREATEREGION LEFT BOTTOM WIDTH (DIFFERENCE HEIGHT 7)))
WINDOW))
WINDOW)
(if USER
then (TALK.ADD.NAME USER ADDRESS PROTOCOL)
(with REGION REGION (add BOTTOM HEIGHT)
(TALK.ANSWER.USERNAME USER (CREATEREGION LEFT BOTTOM WIDTH
(DIFFERENCE HEIGHT 7))
WINDOW)))
(TALK.RINGBELLS WINDOW)
(if (AND [STRINGP (AWAIT.EVENT EVENT (TIMES TALK.ANSWER.WAIT 1000 (if \IDLING
then
(* Provide extra time to login)
2
else 1]
USER)
then (* We timed out, leave the icon up
 but change its functionality)
(WINDOWPROP WINDOW 'TALK (LIST USER (CONS PROTOCOL ADDRESS)))
(WINDOWPROP WINDOW 'EVENT NIL)
(INVERTW WINDOW)
else (WINDOWPROP WINDOW 'EVENT NIL)
(CLOSEW WINDOW))
(WINDOWPROP WINDOW 'RESULT])
(TALK.ANSWER.WINDOW
[LAMBDA (USER) (* ; "Edited 9-Jun-88 10:27 by cdl")
(PROG (WINDOW REGION)
[if TALK.ICON.WINDOWS
then
[if [AND USER (SETQ WINDOW (for WINDOW in TALK.ICON.WINDOWS
thereis (EQUAL USER (CAR (WINDOWPROP WINDOW
'TALK]
then (RETURN WINDOW)
else (SETQ REGION
(with REGION (WINDOWPROP (CAR TALK.ICON.WINDOWS)
'REGION)
(if (LESSP (PLUS PRIGHT WIDTH)
SCREENWIDTH)
then (CREATEREGION PRIGHT BOTTOM WIDTH HEIGHT)
else (CREATEREGION (OR (fetch (REGION LEFT)
of (REGIONP TALK.DEFAULT.REGION)
)
0)
(if (LESSP (PLUS PTOP HEIGHT)
SCREENHEIGHT)
then PTOP
else (OR (fetch (REGION BOTTOM)
of (REGIONP
TALK.DEFAULT.REGION
))
0))
WIDTH HEIGHT]
else (SETQ REGION (with BITMAP TALK.ICON.BITMAP
(if (REGIONP TALK.DEFAULT.REGION)
then (with REGION TALK.DEFAULT.REGION
(CREATEREGION LEFT BOTTOM BITMAPWIDTH
BITMAPHEIGHT))
else (CREATEREGION 0 0 BITMAPWIDTH BITMAPHEIGHT]
(push TALK.ICON.WINDOWS (SETQ WINDOW (CREATEW REGION NIL 0 T)))
(WINDOWPROP WINDOW 'BUTTONEVENTFN (FUNCTION TALK.ICON.BUTTONEVENTFN))
(WINDOWPROP WINDOW 'CLOSEFN (FUNCTION TALK.ICON.CLOSEFN))
(RETURN WINDOW])
(TALK.ANSWER.USERNAME
[LAMBDA (USER REGION WINDOW) (* cdl "10-Jun-87 08:38")
(LET (PTR FONTHEIGHT (FONT (DSPFONT NIL WINDOW)))
(if (AND (GREATERP (NCHARS USER)
(QUOTIENT (BITMAPWIDTH TALK.ICON.BITMAP)
(CHARWIDTH (CHARCODE A)
FONT)))
(SETQ PTR (STRPOS (CONSTANT (CHARACTER (CHARCODE SPACE)))
USER)))
then (DSPFONT TALK.ICON.FONT WINDOW)
(SETQ FONTHEIGHT (QUOTIENT (FONTPROP TALK.ICON.FONT 'HEIGHT)
2))
(CENTERPRINTINREGION (SUBSTRING USER 1 (SUB1 PTR))
(with REGION REGION (CREATEREGION LEFT (PLUS BOTTOM FONTHEIGHT)
WIDTH HEIGHT))
WINDOW)
(CENTERPRINTINREGION (SUBSTRING USER (ADD1 PTR)
-1)
(with REGION REGION (CREATEREGION LEFT (DIFFERENCE BOTTOM FONTHEIGHT)
WIDTH HEIGHT))
WINDOW)
(DSPFONT FONT WINDOW)
else (CENTERPRINTINREGION USER REGION WINDOW])
(TALK.GET.NAME
[LAMBDA NIL (* ; "Edited 16-Jun-88 09:24 by cdl")
(* DECLARATIONS%: (RECORD ENTRY
 (NAME . PAIRS)) (RECORD PAIR
 (PROTOCOL . ADDRESS)))
(LET
[HOSTNAME HOSTNAMES MENU (ITEM '("" NIL ""]
(if
(SETQ HOSTNAMES
(for ENTRY in TALK.HOSTNAMES
collect
(if (LISTP ENTRY)
then
[with
ENTRY ENTRY
`(,NAME ,(KWOTE ENTRY)
NIL
(SUBITEMS ,@(for PAIR in PAIRS
collect (with PAIR PAIR
`(,(CONCAT PROTOCOL " " ADDRESS)
,(KWOTE (LIST NAME PAIR]
else ENTRY)))
then (push HOSTNAMES ITEM))
[SETQ MENU (create MENU
TITLE _ "TALK"
ITEMS _ `(("Prompt for User/Host" 'PROMPT "Prompt for a new user or hostname."
)
(,(if TALK.GAG
then "Turn TALK On"
else "Turn TALK Off")
(PROGN (SETQ TALK.GAG (NOT TALK.GAG))
NIL)
"Toggle TALK connection accept/refuse switch.")
,@HOSTNAMES]
[if HOSTNAMES
then (SHADEITEM ITEM MENU BLACKSHADE) (* Kludge to make entire line of
 menu inverted, not just up to
 subitem arrows)
(with REGION (MENUITEMREGION ITEM MENU)
(with MENU MENU (BLTSHADE BLACKSHADE (with WINDOW IMAGE SAVE)
(PLUS LEFT MENUOUTLINESIZE)
(PLUS BOTTOM MENUOUTLINESIZE)
WIDTH HEIGHT]
(SELECTQ (SETQ HOSTNAME (MENU MENU))
(PROMPT (SETQ HOSTNAME (MKATOM (PROMPTFORWORD "User or host?" NIL NIL PROMPTWINDOW)))
(TERPRI PROMPTWINDOW))
NIL)
HOSTNAME])
(TALK.ADD.NAME
[LAMBDA (NAME ADDRESS PROTOCOL) (* ; "Edited 9-Jun-88 12:39 by cdl")
(* DECLARATIONS%: (RECORD ENTRY
 (NAME . PAIRS)))
(LET (ENTRY)
(if (NOT (EQUAL NAME ADDRESS))
then (if (SETQ ENTRY (bind HOSTNAME (NCHARS _ (NCHARS NAME)) for ENTRY
in TALK.HOSTNAMES
eachtime (SETQ HOSTNAME
(if (LISTP ENTRY)
then (with ENTRY ENTRY NAME)
else ENTRY))
thereis (STRING-EQUAL HOSTNAME NAME)))
then (if (NLISTP ENTRY)
then (SETQ TALK.HOSTNAMES (DREMOVE ENTRY TALK.HOSTNAMES))
(push TALK.HOSTNAMES (LIST NAME (CONS PROTOCOL
ADDRESS)))
else (PUTASSOC PROTOCOL ADDRESS (with ENTRY ENTRY PAIRS)
))
else (push TALK.HOSTNAMES (LIST NAME (CONS PROTOCOL ADDRESS])
(TALK.FLASH.CARET
[LAMBDA (WINDOW POSITION FLG) (* ; "Edited 2-Jun-88 15:17 by cdl")
(DECLARE (GLOBALVARS DEFAULTCARET))
(if (OPENWP WINDOW)
then (SELECTQ FLG
(OFF [with POSITION POSITION
(if XCOORD
then (with CURSOR DEFAULTCARET
(BITBLT CUIMAGE NIL NIL WINDOW XCOORD YCOORD NIL
NIL NIL 'INVERT])
(ON [with POSITION POSITION (with CURSOR DEFAULTCARET
(BITBLT CUIMAGE NIL NIL WINDOW
(SETQ XCOORD
(DIFFERENCE (DSPXPOSITION NIL
WINDOW)
CUHOTSPOTX))
(SETQ YCOORD
(DIFFERENCE (DSPYPOSITION NIL
WINDOW)
CUHOTSPOTY))
NIL NIL NIL 'INVERT])
NIL])
(TALK.WHENSELECTEDFN
[LAMBDA (ITEM FROMMENU BUTTON) (* ; "Edited 9-Jun-88 14:50 by cdl")
(* DECLARATIONS%: (RECORD STREAMS
 (INPUTSTREAM . OUTPUTSTREAM)))
(LET [MAINWINDOW TEXTSTREAM STREAMS (WINDOW (MAINWINDOW (WFROMMENU FROMMENU]
(DECLARE (SPECVARS WINDOW MAINWINDOW TEXTSTREAM STREAMS))
(SETQ TEXTSTREAM (WINDOWPROP (SETQ MAINWINDOW (MAINWINDOW WINDOW))
'TEXTSTREAM))
(if (AND (SETQ STREAMS (WINDOWPROP MAINWINDOW 'STREAMS))
(OPENP (with STREAMS STREAMS OUTPUTSTREAM)))
then (ERRORSET (CADR ITEM])
(TALK.RINGBELLS
[LAMBDA (WINDOW) (* cdl "16-Mar-87 08:01")
(DECLARE (GLOBALVARS RINGBELLS.L1 RINGBELLS.L2))
(PLAYTUNE RINGBELLS.L1) (* Dorados and Dolphins can't do
 PLAYTUNE but let BEEPON/BEEPOFF
 handle that)
(FLASHWINDOW WINDOW)
(PLAYTUNE RINGBELLS.L2])
(TALK.START.SERVER
[LAMBDA (PROTOCOL RESTART) (* ; "Edited 8-Jun-88 15:06 by cdl")
(DECLARE (SPECVARS RESTART))
(if PROTOCOL
then (LET ((PROTOCOLTYPE (ASSOC PROTOCOL TALK.PROTOCOLTYPES)))
(DECLARE (SPECVARS PROTOCOLTYPE))
(if PROTOCOLTYPE
then [with TALK.PROTOCOLTYPE PROTOCOLTYPE
(if TALK.STARTSERVERFN
then (CAR (NLSETQ (APPLY* TALK.STARTSERVERFN
RESTART]
else (ERROR PROTOCOL "Unknown protocol!")))
else (for PROTOCOLTYPE declare%: (SPECVARS PROTOCOLTYPE) in TALK.PROTOCOLTYPES
do (with TALK.PROTOCOLTYPE PROTOCOLTYPE
(if TALK.STARTSERVERFN
then (NLSETQ (APPLY* TALK.STARTSERVERFN RESTART])
)
(DEFINEQ
(TALK.ICON.BUTTONEVENTFN
[LAMBDA (WINDOW) (* ; "Edited 9-Jun-88 10:02 by cdl")
(* DECLARATIONS%: (RECORD
 DESTINATION (NAME (PROTOCOL . ADDRESS))))
(RESETFORM (INVERTW WINDOW)
(until (MOUSESTATE UP) do))
(ALLOW.BUTTON.EVENTS)
(if (WINDOWPROP WINDOW 'EVENT)
then (WINDOWPROP WINDOW 'RESULT T)
(NOTIFY.EVENT (WINDOWPROP WINDOW 'EVENT NIL)
T)
else (LET ((DESTINATION (WINDOWPROP WINDOW 'TALK))
RESULT)
(if (MOUSECONFIRM (CONCAT "(Re)Connect to " (with DESTINATION DESTINATION
NAME)
"?"))
then (if (PROCESSP (SETQ RESULT (TALK.RECONNECT DESTINATION)))
then (CLOSEW WINDOW)
else (FLASHWINDOW WINDOW)
(PROMPTPRINT RESULT])
(TALK.ICON.CLOSEFN
[LAMBDA (WINDOW) (* cdl "10-May-87 10:07")
(LET ((EVENT (WINDOWPROP WINDOW 'EVENT NIL)))
(if EVENT
then (NOTIFY.EVENT EVENT T)))
(SETQ TALK.ICON.WINDOWS (DREMOVE WINDOW TALK.ICON.WINDOWS])
)
(* TALK data)
(DECLARE%: DONTCOPY
(DECLARE%: EVAL@COMPILE
(RECORD TALK.SERVICETYPE (TALK.SERVICENAME TALK.DISPLAYFN TALK.LISTENFN))
(RECORD TALK.PROTOCOLTYPE (TALK.PROTOCOLNAME TALK.HOSTNAMEFN TALK.USERNAMEFN TALK.CONNECTFN
TALK.EVENTFN TALK.STARTSERVERFN TALK.CASEARRAY))
)
)
(RPAQQ TALK.MENU.ITEMS ((Disconnect (TALK.CLOSEFN MAINWINDOW)
"Close TALK connection and keep window open.")
(RingBells (PROGN (PRINTCCODE (CHARCODE ^G)
(CDR STREAMS))
(FORCEOUTPUT (CDR STREAMS))
(FLASHWINDOW MAINWINDOW))
"Execute a (RINGBELLS) on the remote machine.")
(Message (LET [(MESSAGE (MENU (create MENU ITEMS _ TALK.USER.MESSAGES]
(if [AND MESSAGE (TTY.PROCESSP (WINDOWPROP MAINWINDOW
'PROCESS]
then
(BKSYSBUF MESSAGE)))
"Insert a generic message.")))
(RPAQQ TALK.USER.MESSAGES (("One moment please" "One moment please..." NIL (SUBITEMS (
"the phone's ringing"
"One moment please, the phone's ringing..."
)
(
"there's someone at the door"
"One moment please, there's someone at the door..."
)
(
"someone is trying to TALK to me"
"One moment please, someone is trying to TALK to me..."
)))
(DATE (DATE)
"The current date and time.")
"Bye."))
(RPAQ? TALK.SERVICETYPES NIL)
(RPAQ? TALK.PROTOCOLTYPES NIL)
(RPAQ? TALK.GAG NIL)
(RPAQ? TALK.HOSTNAMES NIL)
(RPAQ? TALK.ICON.WINDOWS NIL)
(RPAQ? TALK.ANSWER.WAIT 15)
(RPAQ? TALK.READTABLE (COPYREADTABLE 'ORIG))
(RPAQ? TALK.DEFAULT.REGION (CREATEREGION 0 0 500 500))
(RPAQ? TALK.CLOSED.STRING " -- Connection Closed")
(RPAQ? TALK.ICON.FONT LITTLEFONT)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(GLOBALVARS TALK.MENU.ITEMS TALK.USER.MESSAGES TALK.SERVICETYPES TALK.PROTOCOLTYPES TALK.GAG
TALK.HOSTNAMES TALK.ICON.WINDOWS TALK.ANSWER.WAIT TALK.READTABLE TALK.DEFAULT.REGION
TALK.CLOSED.STRING TALK.ICON.FONT)
)
(ADDTOVAR BackgroundMenuCommands (Talk '(PRINTOUT PROMPTWINDOW T (TALK)
T)
"Start a TALK session with another user/host."))
(RPAQQ BackgroundMenu NIL)
(APPENDTOVAR BACKGROUNDFNS TALK.START.SERVER)
(APPENDTOVAR AFTERMAKESYSFORMS (TALK.START.SERVER NIL T))
(RPAQQ TALK.ICON.BITMAP #*(80 78)OOOOOOOOOOOOOOOOOOOOLAIKKGHHDBNOOOOOOOOOOGFKJOKKEJDMOOOOOOOOOG@KHOHHEJJOOOOOOOOOOGFKJOKJMJNMOOOOOOOOOGFHKGKKDBNOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AOOOOOOOOOOOOOOOOOOOOLAKGDGOOOOOOOOOOOOOOOGKBENOOOOOOOOOOOOOOOGKEDGOOOOOOOOOOOOOOOGKGENOOOOOOOOOOOOOOOGKGDGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AOOOOOOOOOOOOOOOOOOOOMM@HLGOOOOOOOOOOOOOOLIFKENOOOOOOOOOOOOOOMEFKDGOOOOOOOOOOOOOOMMFKENOOOOOOOOOOOOOOMM@HLGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AH@@@@@@@@@@@@@@@@@@AOOOOOOOOOOOOOOOOOOOO
)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(GLOBALVARS TALK.ICON.BITMAP)
)
(SETSYNTAX (CHARCODE SPACE)
(CHARCODE A)
TALK.READTABLE)
(PUTPROPS TALK COPYRIGHT ("Stanford University" 1987 1988))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (2377 6659 (TALK 2387 . 6657)) (6660 31221 (TALK.RECONNECT 6670 . 10485) (TALK.PROCESS
10487 . 11403) (TALK.DISPLAY 11405 . 14118) (TALK.LISTEN 14120 . 15633) (TALK.CLOSEFN 15635 . 16150) (
TALK.ANSWER 16152 . 18935) (TALK.ANSWER.WINDOW 18937 . 21688) (TALK.ANSWER.USERNAME 21690 . 23092) (
TALK.GET.NAME 23094 . 25712) (TALK.ADD.NAME 25714 . 27266) (TALK.FLASH.CARET 27268 . 28866) (
TALK.WHENSELECTEDFN 28868 . 29649) (TALK.RINGBELLS 29651 . 30143) (TALK.START.SERVER 30145 . 31219)) (
31222 32752 (TALK.ICON.BUTTONEVENTFN 31232 . 32451) (TALK.ICON.CLOSEFN 32453 . 32750)))))
STOP

BIN
lispusers/talk/TALK Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-GAP Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-IP Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-NS Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-NSGAP Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-SKETCH Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-TEDIT Normal file

Binary file not shown.

BIN
lispusers/talk/TALK-TTY Normal file

Binary file not shown.

BIN
lispusers/talk/TALK.TEDIT Normal file

Binary file not shown.

View File

@@ -1,240 +0,0 @@
(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "22-Jul-88 14:16:28" |{MCS:MCS:STANFORD}<LANE>IPTALK.;1| 12755 )
(PRETTYCOMPRINT IPTALKCOMS)
(RPAQQ IPTALKCOMS ((* TALK (Interim)
IP Interface)
(LOCALVARS . T)
(FNS TALK.IP.SERVER)
(FNS TALK.IP.USERNAME TALK.IP.CONNECT TALK.IP.EVENT TALK.START.IP.SERVER)
(INITVARS (TALK.UDP.PORT 517))
(GLOBALVARS TALK.UDP.PORT TALK.IP.CONSTANTS)
(DECLARE%: DONTCOPY (RECORDS TALK.IP.PACKET)
(CONSTANTS * TALK.IP.CONSTANTS))
(* etc)
(FILES TALK TCP TCPUDP)
(APPENDVARS (TALK.PROTOCOLTYPES (IP DODIP.HOSTP TALK.IP.USERNAME
TALK.IP.CONNECT TALK.IP.EVENT
TALK.START.IP.SERVER)))
(DECLARE%: DONTCOPY DONTEVAL@LOAD EVAL@COMPILE (FILES ETHERRECORDS TCPEXPORTS)
)
(P (TALK.START.IP.SERVER))))
(* TALK (Interim) IP Interface)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(LOCALVARS . T)
)
(DEFINEQ
(TALK.IP.SERVER
[LAMBDA NIL (* ; "Edited 17-Jun-88 13:45 by cdl")
(DECLARE (GLOBALVARS \IP.READY))
(LET (SOCKET)
(DECLARE (SPECVARS SOCKET))
(RESETLST
[RESETSAVE NIL `(UDP.CLOSE.SOCKET ,(SETQ SOCKET (UDP.OPEN.SOCKET TALK.UDP.PORT]
[bind PACKET RESPONSE SERVICE GAP.SERVICETYPE TALK.SERVICETYPE INPUTSTREAM
OUTPUTSTREAM PORT USER while \IP.READY
do (SETQ PACKET (UDP.GET SOCKET T))
(UDP.SETUP (SETQ RESPONSE (\ALLOCATE.ETHERPACKET))
(with IP PACKET IPSOURCEADDRESS)
(with UDP PACKET UDPSOURCEPORT)
0 SOCKET 'FREE)
(UDP.APPEND.BYTE RESPONSE (with TALK.IP.PACKET PACKET TALK.SERVICE.BYTE))
(if [OR [NULL (if (SETQ GAP.SERVICETYPE (ASSOC (with TALK.IP.PACKET
PACKET
TALK.SERVICE.BYTE
)
GAP.SERVICETYPES))
then (SETQ SERVICE (with GAP.SERVICETYPE
GAP.SERVICETYPE
GAP.SERVICENAME]
(NULL (SETQ TALK.SERVICETYPE (ASSOC SERVICE TALK.SERVICETYPES]
then (UDP.APPEND.BYTE RESPONSE \IPTALK.NOSERVICE)
(UDP.SEND SOCKET RESPONSE)
elseif [OR TALK.GAG (NOT (TALK.ANSWER (SETQ USER (with TALK.IP.PACKET
PACKET
TALK.IP.USERNAME)
)
SERVICE
'IP
(with IP PACKET IPSOURCEADDRESS]
then (UDP.APPEND.BYTE RESPONSE \IPTALK.NOANSWER)
(UDP.SEND SOCKET RESPONSE)
else (UDP.APPEND.BYTE RESPONSE \IPTALK.SUCCESS)
(UDP.APPEND.WORD RESPONSE (SETQ PORT (\TCP.SELECT.PORT)))
(UDP.SEND SOCKET RESPONSE)
(if (SETQ INPUTSTREAM (TCP.OPEN (with IP PACKET IPSOURCEADDRESS
)
NIL PORT 'PASSIVE 'INPUT))
then (TALK.PROCESS INPUTSTREAM (TCP.OTHER.STREAM INPUTSTREAM)
TALK.SERVICETYPE
'IP
'SERVER USER T])])
)
(DEFINEQ
(TALK.IP.USERNAME
[LAMBDA (INPUTSTREAM OUTPUTSTREAM SERVICETYPE MODE USER)
(* ; "Edited 8-Jun-88 15:45 by cdl")
(SELECTQ (with TALK.SERVICETYPE SERVICETYPE TALK.SERVICENAME)
((TTY Sketch) (* For (backward) compatibility)
USER)
(LET ((NAME (USERNAME)))
(PRINTOUT OUTPUTSTREAM (if (NOT (STREQUAL NAME (CONSTANT null)))
then NAME)
T)
(FORCEOUTPUT OUTPUTSTREAM)
(SETQ NAME (RATOM INPUTSTREAM TALK.READTABLE)) (* Eat EOL)
(BIN INPUTSTREAM)
(OR NAME USER])
(TALK.IP.CONNECT
[LAMBDA (HOST SERVICETYPES) (* ; "Edited 13-Jun-88 17:54 by cdl")
(DECLARE (SPECVARS HOST SERVICETYPES))
(LET
(SOCKET)
(DECLARE (SPECVARS SOCKET))
(RESETLST
[RESETSAVE NIL `(UDP.CLOSE.SOCKET ,(SETQ SOCKET (UDP.OPEN.SOCKET]
[PROG (NAME REQUEST RESPONSE INPUTSTREAM RESULT)
(while (STREQUAL (SETQ NAME (USERNAME))
(CONSTANT null)) do (LOGIN))
(if
[LITATOM
(SETQ RESULT
(for SERVICETYPE in SERVICETYPES
thereis (PROGN (UDP.SETUP (SETQ REQUEST (\ALLOCATE.ETHERPACKET))
HOST TALK.UDP.PORT 0 SOCKET 'FREE)
(UDP.APPEND.BYTE
REQUEST
(with GAP.SERVICETYPE
[for GAP.SERVICETYPE in GAP.SERVICETYPES
thereis (with GAP.SERVICETYPE
GAP.SERVICETYPE
(with TALK.SERVICETYPE
SERVICETYPE
(EQ GAP.SERVICENAME
TALK.SERVICENAME]
GAP.UNSPECIFIED))
(UDP.APPEND.BYTE REQUEST 0)
(UDP.APPEND.WORD REQUEST 0)
(UDP.APPEND.WORD REQUEST (NCHARS NAME))
(UDP.APPEND.STRING REQUEST NAME)
(if [SETQ RESPONSE
(UDP.EXCHANGE SOCKET REQUEST
(TIMES TALK.ANSWER.WAIT
(CONSTANT (PROGN
(* Convert to milliseconds and
 double in case they are idle)
(TIMES 2 1000]
then (SELECT (with TALK.IP.PACKET RESPONSE
TALK.STATUS)
(\IPTALK.SUCCESS T)
(\IPTALK.NOSERVICE NIL)
(\IPTALK.NOANSWER (RETURN 'ANSWER))
(RETURN 'CONNECT))
else (* Can't connect)
(RETURN 'CONNECT]
then (RETURN RESULT)
else (if (STREAMP (SETQ INPUTSTREAM (TCP.OPEN HOST (with TALK.IP.PACKET
RESPONSE
TALK.TEDIT.PORT)
NIL
'ACTIVE
'INPUT T)))
then [RETURN (CONS RESULT (CONS INPUTSTREAM (TCP.OTHER.STREAM
INPUTSTREAM]
else (RETURN 'CONNECT])])
(TALK.IP.EVENT
[LAMBDA (INPUTSTREAM OUTPUTSTREAM) (* cdl "18-May-87 16:29")
(while (AND (OPENP INPUTSTREAM)
(OPENP OUTPUTSTREAM)
(NOT (READP INPUTSTREAM))) do (if (EOFP INPUTSTREAM)
then (CLOSEF? INPUTSTREAM))
(BLOCK])
(TALK.START.IP.SERVER
[LAMBDA (RESTART) (* ; "Edited 17-Jun-88 12:20 by cdl")
[LET [(DEVICE (\GETDEVICEFROMNAME 'TCP 'NOERROR 'DONTCREATE]
(if DEVICE
then (* (Temporary) patch to make TCP
 streams handle NS character codes)
(with FDEV DEVICE (if (NULL READCHARCODE)
then (SETQ READCHARCODE (FUNCTION \GENERIC.READCCODE
]
(bind PROCESS while (AND (SETQ PROCESS (FIND.PROCESS 'TALK.IP.SERVER))
RESTART) do (DEL.PROCESS PROCESS)
(BLOCK)
yield (if PROCESS
then PROCESS
elseif \IP.READY
then (ADD.PROCESS '(TALK.IP.SERVER)
'RESTARTABLE
'SYSTEM])
)
(RPAQ? TALK.UDP.PORT 517)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(GLOBALVARS TALK.UDP.PORT TALK.IP.CONSTANTS)
)
(DECLARE%: DONTCOPY
(DECLARE%: EVAL@COMPILE
(ACCESSFNS TALK.IP.PACKET [(TALK.PACKET.BASE (with UDP DATUM UDPCONTENTS))
(TALK.IP.USERNAME (\GETBASESTRING (with UDP DATUM UDPCONTENTS)
6
(with TALK.IP.PACKET DATUM
TALK.USERNAME.LENGTH]
(BLOCKRECORD TALK.PACKET.BASE ((TALK.SERVICE.BYTE BYTE)
(TALK.STATUS BYTE)
(TALK.TEDIT.PORT WORD)
(TALK.USERNAME.LENGTH WORD))))
)
(RPAQQ TALK.IP.CONSTANTS ((\IPTALK.SUCCESS 0)
(\IPTALK.NOSERVICE 1)
(\IPTALK.NOANSWER 2)))
(DECLARE%: EVAL@COMPILE
(RPAQQ \IPTALK.SUCCESS 0)
(RPAQQ \IPTALK.NOSERVICE 1)
(RPAQQ \IPTALK.NOANSWER 2)
(CONSTANTS (\IPTALK.SUCCESS 0)
(\IPTALK.NOSERVICE 1)
(\IPTALK.NOANSWER 2))
)
)
(* etc)
(FILESLOAD TALK TCP TCPUDP)
(APPENDTOVAR TALK.PROTOCOLTYPES (IP DODIP.HOSTP TALK.IP.USERNAME TALK.IP.CONNECT TALK.IP.EVENT
TALK.START.IP.SERVER))
(DECLARE%: DONTCOPY DONTEVAL@LOAD EVAL@COMPILE
(FILESLOAD ETHERRECORDS TCPEXPORTS)
)
(TALK.START.IP.SERVER)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1313 4720 (TALK.IP.SERVER 1323 . 4718)) (4721 11119 (TALK.IP.USERNAME 4731 . 5475) (
TALK.IP.CONNECT 5477 . 9538) (TALK.IP.EVENT 9540 . 9963) (TALK.START.IP.SERVER 9965 . 11117)))))
STOP

View File

@@ -1,319 +0,0 @@
(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP")
(FILECREATED "27-Jul-88 09:09:52" |{MCS:MCS:STANFORD}<LANE>NSTALK.;3| 16112
changes to%: (FNS DEFINE.GAP.SERVER)
previous date%: "16-Jun-88 17:33:04" |{MCS:MCS:STANFORD}<LANE>NSTALK.;1|)
(PRETTYCOMPRINT NSTALKCOMS)
(RPAQQ NSTALKCOMS ((* TALK NS (GAP)
Interface)
(LOCALVARS . T)
(FNS CH.USER.WORKSTATION TALK.NS.SERVER)
(FNS TALK.NS.USERNAME TALK.NS.CONNECT TALK.NS.EVENT TALK.NS.CREDENTIALS)
(* GAP Server)
(FNS GAP.SERVER DEFINE.GAP.SERVER)
(INITVARS GAP.SERVICETYPES [TALK.GAP.HANDLE '((0 0]
(TALK.GAP.UNKNOWN "(Viewpoint or XDE User)"))
(VARS TALK.GAP.PARAMETERS TALK.GAP.TRANSPORT)
(GLOBALVARS GAP.SERVICETYPES TALK.GAP.HANDLE TALK.GAP.UNKNOWN
TALK.GAP.PARAMETERS TALK.GAP.TRANSPORT)
(DECLARE%: DONTCOPY (RECORDS GAP.SERVICETYPE))
(* etc)
(FILES TALK COURIERSERVE)
(APPENDVARS (TALK.PROTOCOLTYPES (NS COERCE-TO-NSADDRESS TALK.NS.USERNAME
TALK.NS.CONNECT TALK.NS.EVENT
COURIER.START.SERVER)))
[DECLARE%: DOCOPY (COMS (DECLARE%: EVAL@LOADWHEN (NOT (HASDEF 'GAP
'COURIERPROGRAM))
(FILES NSTALKGAP]
(* DECLARE%: DONTCOPY DONTEVAL@LOAD EVAL@COMPILE (FILES ETHERRECORDS SPPDECLS)
(* Also need to load EXPORTS.ALL))
(* COURIER.RESET.SOCKET used to be defined by TALK, now defined in
COURIERSERVE module)
(APPENDVARS (BEFORELOGOUTFORMS (COURIER.RESET.SOCKET)))
(P (DEFINE.GAP.SERVER)
(COURIER.START.SERVER))))
(* TALK NS (GAP) Interface)
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(LOCALVARS . T)
)
(DEFINEQ
(CH.USER.WORKSTATION
[LAMBDA (USER WORKSTATION) (* ; "Edited 3-Jun-88 09:18 by cdl")
(if WORKSTATION
then (LET (NSADDRESS)
(if (SETQ NSADDRESS (COERCE-TO-NSADDRESS WORKSTATION (ZERO)))
then (CH.DELETE.PROPERTY USER 'ADDRESS.LIST)
(CH.ADD.ITEM.PROPERTY USER 'ADDRESS.LIST (SETQ NSADDRESS (CONS
NSADDRESS
))
'(SEQUENCE NSADDRESS))
(CONS USER NSADDRESS)
else (ERROR WORKSTATION "Address for host not found!")))
else (CH.DELETE.PROPERTY USER 'ADDRESS.LIST])
(TALK.NS.SERVER
[LAMBDA (INPUTSTREAM PROGRAM PROCEDURE PARAMETERS TRANSPORT WAITTIME CREDENTIALS VERIFIER)
(* ; "Edited 15-Jun-88 11:10 by cdl")
(* DECLARATIONS%: (ASSOCRECORD ALST
 (service)))
(LET ((USER (TALK.NS.CREDENTIALS CREDENTIALS))
(ADDRESS (create NSADDRESS
NSSOCKET _ (ZERO) using (SPP.DESTADDRESS INPUTSTREAM)))
SERVICETYPE)
(with GAP.SERVICETYPE [for SERVICETYPE in GAP.SERVICETYPES
thereis (for NUMBER
in (CAR (with ALST TRANSPORT service))
thereis (with GAP.SERVICETYPE
SERVICETYPE (EQP NUMBER
GAP.UNSPECIFIED
]
(if (OR TALK.GAG (NOT (TALK.ANSWER (OR USER TALK.GAP.UNKNOWN)
GAP.SERVICENAME
'NS ADDRESS)))
then (if (AND (EQ GAP.SERVICENAME 'TTY)
(NULL VERIFIER))
then
(* Should be noAnswerOrBusy, but that 915's XDE/Viewpoint so use VERIFIER to
 determine if called by Lisp, can't count on this for future)
'(ABORT serviceNotFound)
else '(ABORT noAnswerOrBusy))
else (COURIER.RETURN INPUTSTREAM PROGRAM PROCEDURE TALK.GAP.HANDLE)
(TALK.PROCESS INPUTSTREAM (SPPOUTPUTSTREAM INPUTSTREAM)
GAP.SERVICENAME
'NS
'SERVER USER])
)
(DEFINEQ
(TALK.NS.USERNAME
[LAMBDA (INPUTSTREAM OUTPUTSTREAM SERVICETYPE MODE USER)
(* ; "Edited 9-Jun-88 12:42 by cdl")
(LET (OBJECT NAME (SERVICE (with TALK.SERVICETYPE SERVICETYPE TALK.SERVICENAME)))
(DECLARE (GLOBALVARS LOCAL.CLEARINGHOUSE CH.NET.HINT))
(if (OR (EQ SERVICE 'TEdit)
(EQ MODE 'CLIENT))
then (if (STREQUAL (SETQ NAME (USERNAME))
(CONSTANT null))
then (SETQ NAME NIL)
elseif (OR LOCAL.CLEARINGHOUSE CH.NET.HINT)
then (if (SETQ OBJECT (CH.LOOKUP.OBJECT NAME))
then (SETQ NAME OBJECT)))
(PRINTOUT OUTPUTSTREAM NAME T)
(FORCEOUTPUT OUTPUTSTREAM))
(if (OR (EQ SERVICE 'TEdit)
(EQ MODE 'SERVER))
then (if (SETQ OBJECT (RATOM INPUTSTREAM TALK.READTABLE))
then (SETQ USER OBJECT)) (* Eat EOL)
(BIN INPUTSTREAM))
(SELECTQ SERVICE
(TTY (with SPPCON (with SPPSTREAM OUTPUTSTREAM SPP.CONNECTION)
(SETQ SPPEOMONFORCEOUT T)))
NIL)
USER])
(TALK.NS.CONNECT
[LAMBDA (HOST SERVICETYPES) (* ; "Edited 15-Jun-88 10:40 by cdl")
(* DECLARATIONS%: (RECORD
 AUTHENTICATOR (CREDENTIALS VERIFIER)))
(PROG (USER STREAM SERVICETYPE RESULT (CREDENTIALS (with AUTHENTICATOR (CH.GETAUTHENTICATOR
T)
CREDENTIALS))
(VERIFIER (with AUTHENTICATOR (CH.GETAUTHENTICATOR)
VERIFIER)))
(DECLARE (GLOBALVARS SPP.USER.TIMEOUT))
(if (SETQ STREAM (COURIER.OPEN HOST NIL T (PACK* 'TALK# HOST)))
then
(if
(SETQ SERVICETYPE
(for SERVICETYPE in SERVICETYPES
thereis
(SELECTQ [CAR
(SETQ RESULT
(COURIER.CALL
STREAM
'GAP
'Create TALK.GAP.PARAMETERS
`([service (,(with GAP.SERVICETYPE
[for TYPE in GAP.SERVICETYPES
thereis (with GAP.SERVICETYPE TYPE
(with TALK.SERVICETYPE
SERVICETYPE
(EQ GAP.SERVICENAME
TALK.SERVICENAME]
GAP.UNSPECIFIED]
,@TALK.GAP.TRANSPORT)
SPP.USER.TIMEOUT CREDENTIALS VERIFIER 'RETURNERRORS]
(ERROR (SELECTQ (CADR RESULT)
(noAnswerOrBusy (* User hung up or didn't answer,
 don't try another service)
(RETURN))
(serviceNotFound
(* Old Lisp TTY service returns this when it really means noAnswerOrBusy for
 compatibility with Tajo/Viewpoint.)
(if (with TALK.SERVICETYPE SERVICETYPE
(EQ TALK.SERVICENAME 'TTY))
then
(* Don't try services following TTY service for NS we don't know if remote
 service wasn't there or remote user refused connection so we may annoy the
 remote user, of course we may miss a possible connection)
(RETURN)))
NIL))
RESULT)))
then [RETURN (CONS SERVICETYPE (CONS STREAM (SPPOUTPUTSTREAM STREAM]
else (CLOSEF? STREAM)
(RETURN 'ANSWER))
else (RETURN 'CONNECT])
(TALK.NS.EVENT
[LAMBDA (INPUTSTREAM OUTPUTSTREAM) (* cdl "10-Jun-87 07:55")
(if (AND (OPENP INPUTSTREAM)
(OPENP OUTPUTSTREAM)
(NOT (READP INPUTSTREAM)))
then (AWAIT.EVENT (with SPPCON (with SPPSTREAM INPUTSTREAM SPP.CONNECTION)
SPPINPUTEVENT)))
(if (OPENP INPUTSTREAM)
then (SELECTQ (EOFP INPUTSTREAM)
(ATTENTION (SPP.CLEARATTENTION INPUTSTREAM)
(BIN INPUTSTREAM))
(EOM (SPP.CLEAREOM INPUTSTREAM))
(T (CLOSEF INPUTSTREAM))
NIL])
(TALK.NS.CREDENTIALS
[LAMBDA (CREDENTIALS) (* cdl " 6-May-87 15:58")
(if (AND CREDENTIALS (SETQ CREDENTIALS (CADR CREDENTIALS)))
then (SUBATOM (COURIER.READ.REP CREDENTIALS 'CLEARINGHOUSE 'NAME)
1 -2])
)
(* GAP Server)
(DEFINEQ
(GAP.SERVER
[LAMBDA (STREAM PROGRAM PROCEDURE PARAMETERS TRANSPORT WAITTIME CREDENTIALS VERIFIER)
(* ; "Edited 9-Jun-88 12:06 by cdl")
(* DECLARATIONS%: (ASSOCRECORD ALST
 (service)))
(LET (SERVICETYPE)
(if [OR [for NUMBER in (CAR (with ALST TRANSPORT service))
thereis (SETQ SERVICETYPE (for SERVICETYPE in GAP.SERVICETYPES
thereis (with GAP.SERVICETYPE
SERVICETYPE
(AND (EQP NUMBER
GAP.UNSPECIFIED
)
GAP.SERVERFN]
(AND (SETQ SERVICETYPE (ASSOC T GAP.SERVICETYPES))
(with GAP.SERVICETYPE SERVICETYPE
(* There was a server in place
 before TALK was loaded)
(FGETD GAP.SERVERFN]
then (APPLY* (with GAP.SERVICETYPE SERVICETYPE GAP.SERVERFN)
STREAM PROGRAM PROCEDURE PARAMETERS TRANSPORT WAITTIME CREDENTIALS
VERIFIER)
else '(ABORT serviceNotFound])
(DEFINE.GAP.SERVER
[LAMBDA NIL (* ; "Edited 27-Jul-88 09:08 by cdl")
(* DECLARATIONS%: (ASSOCRECORD
 PROCEDURES (Create))
 (PROPRECORD PROCEDURE
 (IMPLEMENTEDBY)))
(if (HASDEF 'GAP 'COURIERPROGRAM)
then (PROG [SERVERFN PROCEDURE (COURIERDEF (GETDEF 'GAP 'COURIERPROGRAM]
[with COURIERPGM COURIERDEF (SETQ PROCEDURE (with PROCEDURES
PROCEDURES Create))
[if (SETQ SERVERFN (with PROCEDURE PROCEDURE IMPLEMENTEDBY))
then (if (EQ SERVERFN 'GAP.SERVER)
then (RETURN))
(* Make the existing GAP server the
 default)
(if GAP.SERVICETYPES
then (PUTASSOC T `(DEFAULT ,SERVERFN)
GAP.SERVICETYPES)
else (push GAP.SERVICETYPES
`(T DEFAULT ,SERVERFN]
(with PROCEDURE PROCEDURE (SETQ IMPLEMENTEDBY 'GAP.SERVER]
(PUTDEF 'GAP 'COURIERPROGRAM COURIERDEF)
(UNMARKASCHANGED 'GAP 'COURIERPROGRAM))
else (ERROR "Courier program GAP not defined!"])
)
(RPAQ? GAP.SERVICETYPES NIL)
(RPAQ? TALK.GAP.HANDLE '((0 0)))
(RPAQ? TALK.GAP.UNKNOWN "(Viewpoint or XDE User)")
(RPAQQ TALK.GAP.PARAMETERS (ttyHost (seven even two 100 (none 0 0))))
(RPAQQ TALK.GAP.TRANSPORT ((teletype)))
(DECLARE%: DOEVAL@COMPILE DONTCOPY
(GLOBALVARS GAP.SERVICETYPES TALK.GAP.HANDLE TALK.GAP.UNKNOWN TALK.GAP.PARAMETERS TALK.GAP.TRANSPORT)
)
(DECLARE%: DONTCOPY
(DECLARE%: EVAL@COMPILE
(RECORD GAP.SERVICETYPE (GAP.UNSPECIFIED GAP.SERVICENAME GAP.SERVERFN))
)
)
(* etc)
(FILESLOAD TALK COURIERSERVE)
(APPENDTOVAR TALK.PROTOCOLTYPES (NS COERCE-TO-NSADDRESS TALK.NS.USERNAME TALK.NS.CONNECT
TALK.NS.EVENT COURIER.START.SERVER))
(DECLARE%: DOCOPY
(DECLARE%: EVAL@LOADWHEN
(NOT (HASDEF 'GAP 'COURIERPROGRAM))
(FILESLOAD NSTALKGAP)
)
)
(* DECLARE%: DONTCOPY DONTEVAL@LOAD EVAL@COMPILE (FILES ETHERRECORDS SPPDECLS) (* Also need to load
EXPORTS.ALL))
(* COURIER.RESET.SOCKET used to be defined by TALK, now defined in COURIERSERVE module)
(APPENDTOVAR BEFORELOGOUTFORMS (COURIER.RESET.SOCKET))
(DEFINE.GAP.SERVER)
(COURIER.START.SERVER)
(DECLARE%: DONTCOPY
(FILEMAP (NIL (2304 5420 (CH.USER.WORKSTATION 2314 . 3215) (TALK.NS.SERVER 3217 . 5418)) (5421 11213 (
TALK.NS.USERNAME 5431 . 6816) (TALK.NS.CONNECT 6818 . 10218) (TALK.NS.EVENT 10220 . 10917) (
TALK.NS.CREDENTIALS 10919 . 11211)) (11237 14919 (GAP.SERVER 11247 . 13041) (DEFINE.GAP.SERVER 13043
. 14917)))))
STOP

File diff suppressed because one or more lines are too long

View File

@@ -162,6 +162,11 @@ main() {
# internal
noendmsg=true
;;
--forcevnc)
# internal - for testing
# WSL only -otherwise warning msg from medley
force_vnc="+"
;;
-z | -man | --man )
if [ "$(uname)" = "Darwin" ]
then

View File

@@ -161,6 +161,7 @@ loadup_finish () {
exit ${exit_code}
}
force_vnc="-"
run_medley () {
/bin/sh "${MEDLEYDIR}/scripts/medley/medley.command" \
--config - \
@@ -172,6 +173,7 @@ run_medley () {
--greet "${initfile}" \
--sysout "$1" \
--vnc "${LOADUP_USE_VNC}" \
--automation \
"$2" "$3" "$4" "$5" "$6" "$7" ;
exit_code=$?
}

View File

@@ -586,6 +586,8 @@ flags:
-x - | --logindir - : use MEDLEYDIR/logindir as LOGINDIR in Medley
-am | --automation : this call to medley is being used in automation, adjust timings. Relevant in -vnc case only.
-cm FILE | --rem.cm FILE : use FILE as the REM.CM when starting up Medley. FILE must be absolute pathname.
-cm - | --rem.cm - : do not use an REM.CM. Negate any prior setting, e.g., from config file.
@@ -638,6 +640,7 @@ pixelscale_arg=""
borderwidth_arg=""
remcm_arg="${LDEREMCM}"
repeat_cm=""
automation=false
# Add marker at end of args so we can accumulate pass-on args in args array
set -- "$@" "--start_of_pass_args"
@@ -915,6 +918,9 @@ do
fi
exit 0
;;
-am | --automation)
automation=true
;;
-nf | -NF | --nofork)
# for use in loadups
case $2 in
@@ -1002,12 +1008,6 @@ do
shift
done
# if running on WSL1, force use_vnc
if [ "${wsl}" = true ] && [ "${wsl_ver}" -eq 1 ]
then
use_vnc=true
fi
# Process run_id
# if it doesn't end in #, make sure that there is not another instance currently running with this same id
@@ -1702,7 +1702,7 @@ do
"$(ip_addr)":"${VNC_PORT}" \
>>"${LOG}" 2>&1 &
wait $!
if [ $(( $(date +%s) - start_time )) -lt 5 ]
if [ "${automation}" = false ] && [ $(( $(date +%s) - start_time )) -lt 5 ]
then
if [ -z "$(pgrep -f "Xvnc ${DISPLAY}")" ]
then

View File

@@ -48,6 +48,7 @@ pixelscale_arg=""
borderwidth_arg=""
remcm_arg="${LDEREMCM}"
repeat_cm=""
automation=false
# Add marker at end of args so we can accumulate pass-on args in args array
set -- "$@" "--start_of_pass_args"
@@ -325,6 +326,9 @@ do
fi
exit 0
;;
-am | --automation)
automation=true
;;
-nf | -NF | --nofork)
# for use in loadups
case $2 in
@@ -412,9 +416,3 @@ do
shift
done
# if running on WSL1, force use_vnc
if [ "${wsl}" = true ] && [ "${wsl_ver}" -eq 1 ]
then
use_vnc=true
fi

View File

@@ -115,6 +115,8 @@ flags:
-x - | --logindir - : use MEDLEYDIR/logindir as LOGINDIR in Medley
-am | --automation : this call to medley is being used in automation, adjust timings. Relevant in -vnc case only.
-cm FILE | --rem.cm FILE : use FILE as the REM.CM when starting up Medley. FILE must be absolute pathname.
-cm - | --rem.cm - : do not use an REM.CM. Negate any prior setting, e.g., from config file.

View File

@@ -215,7 +215,7 @@
"$(ip_addr)":"${VNC_PORT}" \
>>"${LOG}" 2>&1 &
wait $!
if [ $(( $(date +%s) - start_time )) -lt 5 ]
if [ "${automation}" = false ] && [ $(( $(date +%s) - start_time )) -lt 5 ]
then
if [ -z "$(pgrep -f "Xvnc ${DISPLAY}")" ]
then