(FILECREATED "22-Oct-85 15:54:34" {QV}<NOTECARDS>RELEASE1.2I>NCDOCUMENTCARD.;16 30813 changes to: (FNS NC.MakeDocInspectorSelectionFn) previous date: "11-Oct-85 16:39:50" {QV}<NOTECARDS>RELEASE1.2I>NCDOCUMENTCARD.;15) (* Copyright (c) 1985 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT NCDOCUMENTCARDCOMS) (RPAQQ NCDOCUMENTCARDCOMS ((E (SETQ NC.SystemDate (DATE)) (PUTPROP (QUOTE NC.SystemDate) (QUOTE NewestFile) (ROOTFILENAME (FULLNAME (OUTPUT))))) (* * Stuff for the Document compiler facility.) (FILES NCTEXTSUBSTANCE NCTEXTCARD) (GLOBALVARS NC.MakeDocParameters NC.DocBackPtrLinkLabel NC.SubBoxLinkLabel NC.FiledCardLinkLabel PSA.Database NC.SelectingCardMenu NC.CRString NC.DocTitleParaLeading) (VARS (NC.MakeDocParameters (QUOTE ((HeadingsFromFileboxes NumberedBold UnnumberedBold NONE) (TitlesFromNoteCards Bold NotBold NONE) (BuildBackLinks ToCardsBoxes ToCards ToBoxes NONE) (CopyEmbeddedLinks ALL NONE Select) (ExpandEmbeddedLinks ALL NONE Select) (--DONE--)))) (NC.CRString (CONCAT (CHARACTER 13))) (NC.DocTitleParaLeading 20)) (* * MakeDocument stuff) (FNS NC.MakeDocument NC.DumpFileBoxToDoc NC.DumpNoteCardToDoc NC.DumpGraphOrSketchCardToDoc NC.FetchToLinksInOrder NC.BuildMakeDocInspector NC.MakeDocInspectorSelectionFn NC.AppendStringToStream NC.AddCRIfNeeded NC.ChangeParaLeading) (P (SETPROPLIST (QUOTE NC.MakeDocParameters) (QUOTE (HeadingsFromFileboxes NumberedBold TitlesFromNoteCards Bold BuildBackLinks NONE CopyEmbeddedLinks ALL ExpandEmbeddedLinks NONE --DONE-- --CANCEL-- VALUE ((HeadingsFromFileboxes NumberedBold UnnumberedBold NONE) (TitlesFromNoteCards Bold NotBold NONE) (BuildBackpointers ToCardsBoxes ToCards ToBoxes NONE) (CopyEmbeddedLinks ALL NONE Select) (ExpandEmbeddedLinks ALL NONE Select) (--DONE--)))))) (FNS NC.AddDocumentCard) (P (NC.AddDocumentCard)))) (* * Stuff for the Document compiler facility.) (FILESLOAD NCTEXTSUBSTANCE NCTEXTCARD) (DECLARE: DOEVAL@COMPILE DONTCOPY (GLOBALVARS NC.MakeDocParameters NC.DocBackPtrLinkLabel NC.SubBoxLinkLabel NC.FiledCardLinkLabel PSA.Database NC.SelectingCardMenu NC.CRString NC.DocTitleParaLeading) ) (RPAQQ NC.MakeDocParameters ((HeadingsFromFileboxes NumberedBold UnnumberedBold NONE) (TitlesFromNoteCards Bold NotBold NONE) (BuildBackLinks ToCardsBoxes ToCards ToBoxes NONE) (CopyEmbeddedLinks ALL NONE Select) (ExpandEmbeddedLinks ALL NONE Select) (--DONE--))) (RPAQ NC.CRString (CONCAT (CHARACTER 13))) (RPAQQ NC.DocTitleParaLeading 20) (* * MakeDocument stuff) (DEFINEQ (NC.MakeDocument (LAMBDA (ID Title NoDisplayFlg WindowOrTextStreamOrID) (* rht: " 2-Oct-85 17:07") (* * Called from a filebox's title bar. Makes a document by smashing all the descendant cards's text together. Ask user if wants numbered section headings and titles. The former are made from FileBox titles, the latter from notecard titles. Delete embedded links at the end if the user desires.) (* * rht 10/22/84: Hacked to be callable from Programmer's interface.) (* * rht 11/17/84: Checks for cancel when choosing rootID and also when setting parameters.) (* * rht 8/25/85: Now dumps sketch and graph cards as well as text cards.) (* * rht 9/16/85: Now handles cr's around titles using para leading.) (PROG (RootID RootTitle DocWindow DocCardID DocWindowOrID DocStream HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks InspectWin WasActive RootType RootSubstanceType) (OR NoDisplayFlg (SPAWN.MOUSE)) (SETQ DocWindowOrID (NC.MakeNoteCard (QUOTE Text) "Document" NoDisplayFlg NIL ID)) (COND (NoDisplayFlg (SETQ DocWindow NIL) (SETQ DocCardID DocWindowOrID)) (T (SETQ DocWindow DocWindowOrID) (SETQ DocCardID (NC.IDFromWindow DocWindow)))) (* NC.MakeNoteCard either returned an ID or a window depending on NoDisplayFlg.) (SETQ RootTitle (NC.FetchTitle (SETQ RootID (COND ((NC.IDP WindowOrTextStreamOrID) WindowOrTextStreamOrID) ((TEXTSTREAMP WindowOrTextStreamOrID) (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING WindowOrTextStreamOrID))) ((WINDOWP WindowOrTextStreamOrID) (NC.IDFromWindow WindowOrTextStreamOrID)) (T (PROGN (NC.SelectNoteCards T NIL NC.SelectingCardMenu DocWindow NIL "Please select the Note Card or File Box the document should start from."))))) )) (COND ((NOT RootID) (NC.DeleteNoteCards ID T) (RETURN NIL))) (NC.SetTitle DocCardID (CONCAT "Document from %"" RootTitle "%"")) (AND DocWindow (WINDOWPROP DocWindow (QUOTE TITLE) (NC.FetchTitle DocCardID))) (SETQ DocStream (NC.FetchSubstance DocCardID)) (* * Get MakeDocument parameters from user via inspector window.) (COND ((NOT NoDisplayFlg) (SETQ InspectWin (NC.BuildMakeDocInspector DocWindow)) (TOTOPW InspectWin) (for while (OPENWP InspectWin) do (BLOCK)))) (COND ((EQ (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE --DONE--)) (QUOTE QUIT)) (PUTPROP (QUOTE NC.MakeDocParameters) (QUOTE --DONE--) (QUOTE --CANCEL--)) (NC.DeleteNoteCards ID T) (RETURN NIL))) (SETQ HeadingsFromFileboxes (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE HeadingsFromFileboxes))) (SETQ TitlesFromNoteCards (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE TitlesFromNoteCards))) (SETQ BuildBackLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE BuildBackLinks))) (SETQ CopyEmbeddedLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE CopyEmbeddedLinks))) (SETQ ExpandEmbeddedLinks (GETPROP (QUOTE NC.MakeDocParameters) (QUOTE ExpandEmbeddedLinks))) (* * Call recursive routine to dump filebox.) (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) (NC.PrintMsg DocWindow NIL "Collecting text from descendant cards ... ") (* * Clean up the SeenBefore markers placed on the cards and boxes just copied.) (RESETSAVE NIL (QUOTE (PROGN (for ID in (GETPROP DocCardID (QUOTE SeenCards)) do (REMPROP ID (QUOTE SeenBefore))) (REMPROP DocCardID (QUOTE SeenCards))))) (* * Unbelievably kludgy hack to get around Intermezzo TEdit bug. Just insert and delete a CR.) (TEDIT.INSERT DocStream NC.CRString 1) (TEDIT.DELETE DocStream 1 1) (OR (SETQ WasActive (NC.ActiveCardP RootID)) (NC.GetNoteCard RootID PSA.Database)) (SETQ RootType (NC.RetrieveType RootID PSA.Database)) (COND ((EQ RootType (QUOTE FileBox)) (NC.DumpFileBoxToDoc RootID DocCardID DocStream "" HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks)) (T (SELECTQ (SETQ RootSubstanceType (NCP.CardTypeSubstance RootType)) (TEXT (NC.DumpNoteCardToDoc RootID DocCardID DocStream "" 1 HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks)) ((SKETCH GRAPH) (NC.DumpGraphOrSketchCardToDoc RootID DocCardID DocStream "" 1 HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks RootSubstanceType)) (NC.PrintMsg NIL NIL "Can't make document from non-text/sketch/graph card " RootID (CHARACTER 13))))) (OR WasActive (NC.DeactivateCard RootID)) (NC.PrintMsg DocWindow NIL "Done!")) (COND ((NOT NoDisplayFlg) (BLOCK 250) (NC.ClearMsg DocWindow T))) (RETURN DocWindowOrID)))) (NC.DumpFileBoxToDoc (LAMBDA (FileBoxID DocID DocStream CurSection HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) (* rht: "10-Oct-85 19:23") (* * Dump the contents of FileboxID to DocStream by recursively dumping all of its children. Keep track of the section numbers in case HeadingsFromFileboxes = Numbered. Insert back pointers to the source cards and/or boxes depending on value of BuildBackpointers. Embedded links (or some subset of them) may be copied or expanded depending on the values of CopyEmbeddedLinks and ExpandEmbeddedLinks.) (* * rht 8/25/85: Fixed to handle sketch and graph cards.) (* * rht 9/16/85: Now handles cr's around titles using para leading.) (PROG ((DocObject (TEXTOBJ DocStream)) OldLoc) (NC.AddCRIfNeeded DocStream) (SETQ OldLoc (fetch (TEXTOBJ TEXTLEN) of DocObject)) (if (AND (EQ HeadingsFromFileboxes (QUOTE NumberedBold)) (NOT (ZEROP (NCHARS CurSection)))) then (NC.AppendStringToStream DocStream (CONCAT CurSection " ") T)) (AND (NEQ HeadingsFromFileboxes (QUOTE NONE)) (NC.AppendStringToStream DocStream (CONCAT (NC.FetchTitle FileBoxID)) T)) (AND (FMEMB BuildBackLinks (QUOTE (ToBoxes ToCardsBoxes))) (NCP.LocalGlobalLink NC.DocBackPtrLinkLabel DocID FileBoxID (QUOTE END) (QUOTE Icon))) (if (GREATERP (fetch (TEXTOBJ TEXTLEN) of DocObject) OldLoc) then (NC.AddCRIfNeeded DocStream) (NC.ChangeParaLeading DocStream)) (COND ((GETPROP FileBoxID (QUOTE SeenBefore)) (NC.PrintMsg NIL NIL FileBoxID " only expanded once in this cycle.") (RETURN))) (ADDPROP DocID (QUOTE SeenCards) FileBoxID T) (PUTPROP FileBoxID (QUOTE SeenBefore) T) (for Link in (NC.FetchToLinksInOrder FileBoxID) bind ChildID ActiveP Type (SubSectionNum ← 1) SubstanceType eachtime (BLOCK) when (FMEMB (fetch (NOTECARDLINK LINKLABEL) of Link) (BQUOTE (, NC.FiledCardLinkLabel , NC.SubBoxLinkLabel))) do (SETQ ChildID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (SETQ ActiveP (NC.ActiveCardP ChildID)) (COND ((EQ (SETQ Type (NC.RetrieveType ChildID PSA.Database)) (QUOTE FileBox)) (OR ActiveP (NC.GetNoteCard ChildID PSA.Database)) (NC.DumpFileBoxToDoc ChildID DocID DocStream (COND ((EQUAL "" CurSection) (CONCAT SubSectionNum)) (T (CONCAT CurSection "." SubSectionNum))) HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) (SETQ SubSectionNum (ADD1 SubSectionNum)) (OR ActiveP (NC.DeactivateCard ChildID))) (T (SELECTQ (SETQ SubstanceType (NCP.CardTypeSubstance Type)) (TEXT (OR ActiveP (NC.GetNoteCard ChildID PSA.Database)) (SETQ SubSectionNum (NC.DumpNoteCardToDoc ChildID DocID DocStream CurSection SubSectionNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks)) (OR ActiveP (NC.DeactivateCard ChildID))) ((SKETCH GRAPH) (OR ActiveP (NC.GetNoteCard ChildID PSA.Database)) (SETQ SubSectionNum (NC.DumpGraphOrSketchCardToDoc ChildID DocID DocStream CurSection SubSectionNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks SubstanceType)) (OR ActiveP (NC.DeactivateCard ChildID))) (NC.PrintMsg NIL NIL "Ignoring non-text/sketch/graph card " ChildID (CHARACTER 13)))))) (REMPROP FileBoxID (QUOTE SeenBefore))))) (NC.DumpNoteCardToDoc (LAMBDA (CardID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) (* rht: "10-Oct-85 19:59") (* * Dump the CardID notecard to the document card DocStream.) (* * rht 8/25/85: Fixed to handle sketch and graph cards.) (* * rht 9/16/85: Now handles cr's around titles using para leading.) (PROG ((CardStream (NC.FetchSubstance CardID)) (DocObj (TEXTOBJ DocStream)) CardObj OldLoc) (SETQ CardObj (TEXTOBJ CardStream)) (NC.AddCRIfNeeded DocStream) (SETQ OldLoc (fetch (TEXTOBJ TEXTLEN) of DocObj)) (AND (NEQ TitlesFromNoteCards (QUOTE NONE)) (NC.AppendStringToStream DocStream (CONCAT (NC.FetchTitle CardID)) (EQ TitlesFromNoteCards (QUOTE Bold)))) (AND (FMEMB BuildBackLinks (QUOTE (ToCards ToCardsBoxes))) (NCP.LocalGlobalLink NC.DocBackPtrLinkLabel DocID CardID (QUOTE END) (QUOTE Icon))) (if (GREATERP (fetch (TEXTOBJ TEXTLEN) of DocObj) OldLoc) then (NC.AddCRIfNeeded DocStream) (NC.ChangeParaLeading DocStream)) (if (GETPROP CardID (QUOTE SeenBefore)) then (NC.PrintMsg NIL NIL CardID " only expanded once in this cycle." (CHARACTER 13)) (RETURN)) (ADDPROP DocID (QUOTE SeenCards) CardID T) (PUTPROP CardID (QUOTE SeenBefore) T) (* * Step through list of notecard imageobjs in the card we're working on and either expand or copy or ignore each according to values of ExpandEmbeddedLinks and CopyEmbeddedLinks.) (for Object in (TEDIT.LIST.OF.OBJECTS CardObj (FUNCTION NC.LinkIconImageObjP)) bind LinkSpec LinkLabel ToID ToIDType (LastLoc ← 1) (CurLoc ← 0) ActiveP ExpandP CopyP AlreadyExpanded ToIDSubstanceType eachtime (BLOCK) do (SETQ LinkSpec (NC.FetchLinkFromLinkIcon (CAR Object))) (SETQ LinkLabel (fetch (NOTECARDLINK LINKLABEL) of LinkSpec)) (SETQ CurLoc (CADR Object)) (* Copy over any text between this obj and the last.) (COND ((ILESSP LastLoc CurLoc) (TEDIT.COPY (TEDIT.SETSEL CardStream LastLoc (IDIFFERENCE CurLoc LastLoc)) (TEDIT.SETSEL DocStream (fetch TEXTLEN of DocObj) 1 (QUOTE RIGHT))))) (SETQ LastLoc (ADD1 CurLoc)) (SETQ CopyP (OR (EQ CopyEmbeddedLinks (QUOTE ALL)) (AND (LISTP CopyEmbeddedLinks) (FMEMB LinkLabel CopyEmbeddedLinks)))) (SETQ ExpandP (OR (EQ ExpandEmbeddedLinks (QUOTE ALL)) (AND (LISTP ExpandEmbeddedLinks) (FMEMB LinkLabel ExpandEmbeddedLinks)))) (COND ((AND (SETQ AlreadyExpanded (GETPROP (SETQ ToID (fetch (NOTECARDLINK DESTINATIONID) of LinkSpec)) (QUOTE SeenBefore))) ExpandP) (NC.PrintMsg NIL NIL ToID " only expanded once in this cycle." (CHARACTER 13)))) (COND ((OR CopyP (AND ExpandP AlreadyExpanded)) (* Copy this link.) (TEDIT.COPY (TEDIT.SETSEL CardStream CurLoc 1) (TEDIT.SETSEL DocStream (ADD1 (fetch TEXTLEN of DocObj)) 0 (QUOTE RIGHT))))) (COND ((AND ExpandP (NOT AlreadyExpanded)) (* Expand this link. Check type and make recursive call.) (SETQ ActiveP (NC.ActiveCardP ToID)) (SETQ ToIDType (NC.RetrieveType ToID PSA.Database)) (COND ((EQ ToIDType (QUOTE FileBox)) (OR ActiveP (NC.GetNoteCard ToID PSA.Database)) (NC.DumpFileBoxToDoc ToID DocID DocStream (COND ((EQUAL SectionNum "") (CONCAT BoxNum)) (T (CONCAT SectionNum "." BoxNum))) HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) (SETQ BoxNum (ADD1 BoxNum)) (OR ActiveP (NC.DeactivateCard ToID))) (T (SELECTQ (SETQ ToIDSubstanceType (NCP.CardTypeSubstance ToIDType)) (TEXT (OR ActiveP (NC.GetNoteCard ToID PSA.Database)) (SETQ BoxNum (NC.DumpNoteCardToDoc ToID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) ) (OR ActiveP (NC.DeactivateCard ToID))) ((SKETCH GRAPH) (OR ActiveP (NC.GetNoteCard ToID PSA.Database)) (SETQ BoxNum (NC.DumpGraphOrSketchCardToDoc ToID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks ToIDSubstanceType)) (OR ActiveP (NC.DeactivateCard ToID))) (NC.PrintMsg NIL NIL "Ignoring non-text/sketch/graph card " ToID (CHARACTER 13))))))) finally (COND ((ILESSP CurLoc (fetch TEXTLEN of CardObj)) (TEDIT.COPY (TEDIT.SETSEL CardStream LastLoc (IDIFFERENCE (fetch TEXTLEN of CardObj) CurLoc)) (TEDIT.SETSEL DocStream (ADD1 (fetch TEXTLEN of DocObj)) 0 (QUOTE RIGHT))))) (TEDIT.SETSEL DocStream (ADD1 (fetch TEXTLEN of DocObj)) 0 (QUOTE RIGHT))) (REMPROP CardID (QUOTE SeenBefore)) (RETURN BoxNum)))) (NC.DumpGraphOrSketchCardToDoc (LAMBDA (CardID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks SubstanceType) (* rht: "10-Oct-85 19:47") (* * Dump the CardID sketch or graph card to the document card DocStream.) (* * rht 9/16/85: Now handles cr's around titles using para leading.) (PROG ((CardStream (NC.FetchSubstance CardID)) (DocObj (TEXTOBJ DocStream)) OldLoc) (NC.AddCRIfNeeded DocStream) (SETQ OldLoc (fetch (TEXTOBJ TEXTLEN) of DocObj)) (AND (NEQ TitlesFromNoteCards (QUOTE NONE)) (NC.AppendStringToStream DocStream (CONCAT (NC.FetchTitle CardID)) (EQ TitlesFromNoteCards (QUOTE Bold)))) (AND (FMEMB BuildBackLinks (QUOTE (ToCards ToCardsBoxes))) (NCP.LocalGlobalLink NC.DocBackPtrLinkLabel DocID CardID (QUOTE END) (QUOTE Icon))) (if (GREATERP (fetch (TEXTOBJ TEXTLEN) of DocObj) OldLoc) then (NC.AddCRIfNeeded DocStream) (NC.ChangeParaLeading DocStream)) (COND ((GETPROP CardID (QUOTE SeenBefore)) (NC.PrintMsg NIL NIL CardID " only expanded once in this cycle." (CHARACTER 13)) (RETURN))) (ADDPROP DocID (QUOTE SeenCards) CardID T) (PUTPROP CardID (QUOTE SeenBefore) T) (* * Stick an imageobj made from the graph or sketch into the document.) (AND CardStream (TEDIT.INSERT.OBJECT (SELECTQ SubstanceType (GRAPH (GRAPHEROBJ CardStream)) (SKETCH (MAKE.IMAGE.OBJECT.OF.SKETCH CardStream (NC.FetchRegionViewed CardID) (NC.FetchScale CardID))) NIL) DocStream)) (* * Step through list of notecard imageobjs in the card we're working on and either expand or copy or ignore each according to values of ExpandEmbeddedLinks and CopyEmbeddedLinks.) (for Link in (CAR (NC.CollectReferences CardID NIL PSA.Database NIL NIL)) bind LinkLabel ToID ToIDType ActiveFlg ExpandFlg CopyFlg AlreadyExpanded ToIDSubstanceType eachtime (BLOCK) do (SETQ LinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) (SETQ CopyFlg (OR (EQ CopyEmbeddedLinks (QUOTE ALL)) (AND (LISTP CopyEmbeddedLinks) (FMEMB LinkLabel CopyEmbeddedLinks)))) (SETQ ExpandFlg (OR (EQ ExpandEmbeddedLinks (QUOTE ALL)) (AND (LISTP ExpandEmbeddedLinks) (FMEMB LinkLabel ExpandEmbeddedLinks)))) (COND ((AND (SETQ AlreadyExpanded (GETPROP (SETQ ToID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (QUOTE SeenBefore))) ExpandFlg) (NC.PrintMsg NIL NIL ToID " only expanded once in this cycle." (CHARACTER 13)))) (COND ((OR CopyFlg (AND ExpandFlg AlreadyExpanded)) (* Copy this link.) (NCP.LocalGlobalLink LinkLabel DocID ToID (QUOTE END)))) (COND ((AND ExpandFlg (NOT AlreadyExpanded)) (* Expand this link. Check type and make recursive call.) (SETQ ActiveFlg (NC.ActiveCardP ToID)) (SETQ ToIDType (NC.RetrieveType ToID PSA.Database)) (COND ((EQ ToIDType (QUOTE FileBox)) (OR ActiveFlg (NC.GetNoteCard ToID PSA.Database)) (NC.DumpFileBoxToDoc ToID DocID DocStream (COND ((EQUAL SectionNum "") (CONCAT BoxNum)) (T (CONCAT SectionNum "." BoxNum))) HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) (SETQ BoxNum (ADD1 BoxNum)) (OR ActiveFlg (NC.DeactivateCard ToID))) (T (SELECTQ (SETQ ToIDSubstanceType (NCP.CardTypeSubstance ToIDType)) (TEXT (OR ActiveFlg (NC.GetNoteCard ToID PSA.Database)) (SETQ BoxNum (NC.DumpNoteCardToDoc ToID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks) ) (OR ActiveFlg (NC.DeactivateCard ToID))) ((SKETCH GRAPH) (OR ActiveFlg (NC.GetNoteCard ToID PSA.Database)) (SETQ BoxNum (NC.DumpGraphOrSketchCardToDoc ToID DocID DocStream SectionNum BoxNum HeadingsFromFileboxes TitlesFromNoteCards BuildBackLinks CopyEmbeddedLinks ExpandEmbeddedLinks ToIDSubstanceType)) (OR ActiveFlg (NC.DeactivateCard ToID))) (NC.PrintMsg NIL NIL "Ignoring non-text/sketch/graph card " ToID (CHARACTER 13))))))) finally (TEDIT.SETSEL DocStream (ADD1 (fetch TEXTLEN of DocObj)) 0 (QUOTE RIGHT))) (REMPROP CardID (QUOTE SeenBefore)) (RETURN BoxNum)))) (NC.FetchToLinksInOrder (LAMBDA (ID) (* fgh: " 1-Oct-84 21:08") (* * Return the list of To links appearing in the text of ID in the order in which they appear.) (for ObjectPair in (TEDIT.LIST.OF.OBJECTS (TEXTOBJ (NC.FetchSubstance ID)) (FUNCTION NC.LinkIconImageObjP)) collect (NC.FetchLinkFromLinkIcon (CAR ObjectPair))))) (NC.BuildMakeDocInspector (LAMBDA (MainWin) (* rht: "11-Oct-85 10:49") (* * Build and dislay an inspector window on the parameters for making documents.) (* * rht 10/3/85: No longer brings up prompt window.) (LET (InspectWindow (Region (WINDOWREGION MainWin))) (SETQ InspectWindow (INSPECTW.CREATE (QUOTE NC.MakeDocParameters) (for Item in NC.MakeDocParameters collect (CAR Item)) (FUNCTION GETPROP) NIL "Use left button to change values." NIL (FUNCTION NC.InspectorTitleCommandFn) "MakeDocument Parameters" (FUNCTION NC.MakeDocInspectorSelectionFn) NC.OffScreenPosition NIL)) (ATTACHWINDOW InspectWindow MainWin (QUOTE TOP) (QUOTE LEFT) (QUOTE LOCALCLOSE)) (WINDOWPROP InspectWindow (QUOTE NoteCardsMakeDocInspector) T) InspectWindow))) (NC.MakeDocInspectorSelectionFn (LAMBDA (Property ValueFlg InspectWin) (* rht: "22-Oct-85 15:35") (* * Called when user buttons in the make document inspector menu on the Property parameter. Put up a menu of choices for new values for this parameter.) (* * rht 11/17/84: Now can select --CANCEL--. Notice strange way of checking for --DONE-- versus --CANCEL--. This is because the Inspector package doesn't send the property name in Property arg if ValueFlg is on. That bug has been reported.) (* * rht 10/11/85: Fixed to have a more correct interface to NC.AskLinkLabel when need to Select.) (* * rht 10/22/85: Now uses ChangedFlg to prevent NIL from showing up as value in inspector.) (if (FMEMB Property (QUOTE (--DONE-- --CANCEL--))) then (DETACHWINDOW InspectWin) (CLOSEW InspectWin) (if ValueFlg then (PUTPROP (QUOTE NC.MakeDocParameters) (QUOTE --DONE--) (QUOTE QUIT))) NIL elseif ValueFlg then (INSPECTW.SELECTITEM InspectWin) else (LET ((OldVal (GETPROP (QUOTE NC.MakeDocParameters) Property)) (Answer (MENU (create MENU ITEMS ←(CDR (FASSOC Property NC.MakeDocParameters)) TITLE ← "Choose New Value"))) Links ChangedFlg) (SETQ ChangedFlg (if (EQ Answer (QUOTE Select)) then (SETQ Links (NC.AskLinkLabel (MAINWINDOW InspectWin) T T NIL NIL NIL (COND ((LISTP OldVal)) ((EQ OldVal (QUOTE ALL)) (NCP.GetLinkLabels)) (T NIL)) T)) (if Links then (SETQ Answer (if (CAR Links) else (QUOTE NONE))) (NOT (EQUAL Answer OldVal))) else (AND Answer (NOT (EQUAL Answer OldVal))))) (if ChangedFlg then (PUTPROP (QUOTE NC.MakeDocParameters) Property Answer) (INSPECTW.REDISPLAY InspectWin Property)) (INSPECTW.SELECTITEM InspectWin) NIL)))) (NC.AppendStringToStream (LAMBDA (Stream String BoldFlg) (* rht: "26-Jun-85 12:17") (* * Add the String to the end of the tedit Stream.) (* * rht 11/16/84: Now calls TEDIT.LOOKS in any case, bold or no.) (* * rht 6/26/85: Took out call to TEDIT.LOOKS and just stuck boldifying into call to TEDIT.INSERT.) (TEDIT.INSERT Stream String (ADD1 (fetch (TEXTOBJ TEXTLEN) of (TEXTOBJ Stream))) (FONTCOPY (TEXTPROP Stream (QUOTE FONT)) (QUOTE FACE) (COND (BoldFlg (QUOTE BRR)) (T (QUOTE MRR)))) T))) (NC.AddCRIfNeeded (LAMBDA (Stream) (* rht: " 2-Oct-85 17:15") (* * Check last character of Stream. If not a CR, then add one.) (LET ((Len (fetch (TEXTOBJ TEXTLEN) of (TEXTOBJ Stream)))) (if (NOT (ZEROP Len)) then (SETFILEPTR Stream (SUB1 Len)) (if (NEQ 13 (BIN Stream)) then (NC.AppendStringToStream Stream NC.CRString)))))) (NC.ChangeParaLeading (LAMBDA (Stream) (* rht: "16-Sep-85 19:34") (* * Change the para leading on the text stream Stream using default value.) (LET ((TextObj (TEXTOBJ Stream))) (TEDIT.PARALOOKS TextObj (LIST (QUOTE PARALEADING) NC.DocTitleParaLeading) (fetch (TEXTOBJ TEXTLEN) of TextObj) 1)))) ) (SETPROPLIST (QUOTE NC.MakeDocParameters) (QUOTE (HeadingsFromFileboxes NumberedBold TitlesFromNoteCards Bold BuildBackLinks NONE CopyEmbeddedLinks ALL ExpandEmbeddedLinks NONE --DONE-- --CANCEL-- VALUE ((HeadingsFromFileboxes NumberedBold UnnumberedBold NONE) (TitlesFromNoteCards Bold NotBold NONE) (BuildBackpointers ToCardsBoxes ToCards ToBoxes NONE) (CopyEmbeddedLinks ALL NONE Select) (ExpandEmbeddedLinks ALL NONE Select) (--DONE--))))) (DEFINEQ (NC.AddDocumentCard (LAMBDA NIL (* rht: "25-Aug-85 14:37") (NC.AddCardType (QUOTE Document) (QUOTE Text) (QUOTE TEXT) (BQUOTE ((MakeCardFn , (FUNCTION NC.MakeDocument)))) (BQUOTE ((LinkDisplayMode Icon) (DefaultHeight 350) (DefaultWidth 350) (CardDisplayedInMenuFlg , T)))))) ) (NC.AddDocumentCard) (PUTPROPS NCDOCUMENTCARD COPYRIGHT ("Xerox Corporation" 1985)) (DECLARE: DONTCOPY (FILEMAP (NIL (2849 29740 (NC.MakeDocument 2859 . 8812) (NC.DumpFileBoxToDoc 8814 . 13055) ( NC.DumpNoteCardToDoc 13057 . 19085) (NC.DumpGraphOrSketchCardToDoc 19087 . 24458) ( NC.FetchToLinksInOrder 24460 . 24914) (NC.BuildMakeDocInspector 24916 . 25906) ( NC.MakeDocInspectorSelectionFn 25908 . 28151) (NC.AppendStringToStream 28153 . 28827) ( NC.AddCRIfNeeded 28829 . 29308) (NC.ChangeParaLeading 29310 . 29738)) (30283 30707 (NC.AddDocumentCard 30293 . 30705))))) STOP