(FILECREATED "19-Nov-86 15:09:16" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH001.;4 22399 changes to: (FNS NC.DeleteSource NC.LinkIconImageBoxFn NC.TextCardShrinkFn NC.GraphCardShrinkFn NC.ShrinkGraphToWindow NC.FileInOrphanBox NC.AskMoveOrCopyNoteCards NCP.CheckOutNoteFile NC.InsideGrapherNodeP) (VARS RGPATCH001COMS) previous date: "19-Nov-86 15:00:00" {QV}<NOTECARDS>1.3K>NEXT>RGPATCH001.;2) (* Copyright (c) 1986 by Xerox Corporation. All rights reserved.) (PRETTYCOMPRINT RGPATCH001COMS) (RPAQQ RGPATCH001COMS [(* * Mostly fixes missing variable declarations) (* * changes to NCCARDS) (FNS NC.DeleteSource) (* * changes to NCLINKS) (P (ADDTOFILE (QUOTE NC.OrphanID) (QUOTE GLOBALVARS) (QUOTE NCLINKS) (QUOTE NC.LinkIconSpaceInnerX))) (FNS NC.FileInOrphanBox NC.LinkIconImageBoxFn) (* * changes to NCUTILITIES) (FNS NC.AskMoveOrCopyNoteCards) (* * changes to NCPROGINT) (FNS NCP.CheckOutNoteFile) (* * changes to NCTEXTCARD) (P (ADDTOFILE (QUOTE TEDIT.ICON.FONT) (QUOTE GLOBALVARS) (QUOTE NCTEXTCARD) (QUOTE TEDIT.DEFAULT.MENU))) (P (ADDTOFILE (QUOTE TEDIT.TITLED.ICON.TEMPLATE) (QUOTE GLOBALVARS) (QUOTE NCTEXTCARD) (QUOTE TEDIT.DEFAULT.MENU))) (FNS NC.TextCardShrinkFn) (* * changes to NCGRAPHCARD) (FILES (FROM {QV}<NOTECARDS>1.3K>NEXT>) NCGRAPHCARD) (P (ADDTOFILE (QUOTE TEDIT.ICON.FONT) (QUOTE GLOBALVARS) (QUOTE NCGRAPHCARD) (QUOTE NC.UseDeletedLinkIconIndicatorsFlg))) (FNS NC.InsideGrapherNodeP NC.GraphCardShrinkFn) (* * changes to NCBROWSERCARD) (FILES (FROM {QV}<NOTECARDS>1.3K>NEXT>) NCBROWSERCARD) (FNS NC.ShrinkGraphToWindow) (* * changes to KOTOSYSTEMPATCHES) (P (EDITV KOTOSYSTEMPATCHESCOMS 1 (A (DECLARE: DOEVAL@COMPILE DONTCOPY (FILES EXPORTS.ALL]) (* * Mostly fixes missing variable declarations) (* * changes to NCCARDS) (DEFINEQ (NC.DeleteSource [LAMBDA (WindowOrTextStream) (* Randy.Gobbel "19-Nov-86 15:06") (* Called from title bar menus. Deletes source/s/ for the card specified by WindowOrTextStream) (* * fgh 11/12/85: Updated to handle Card objects.) (DECLARE (GLOBALVARS NC.DeleteSelectingMenu)) (LET ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream)) Card Sources EditWindow) (SETQ Card (NC.CoerceToCard Window)) (SETQ Sources (for Link in (NC.FetchGlobalLinks Card) when (EQUAL NC.SourceLinkLabel (fetch (Link Label) of Link)) collect Link)) (COND ((NULL Sources) (NC.PrintMsg Window T "This card has no sources." (CHARACTER 13)) (SPAWN.MOUSE) (DISMISS 2000) (NC.ClearMsg Window T)) (T (SETQ EditWindow (NC.OpenPropListEditor Window (LIST (QUOTE Source% TO) Sources) "Sources" T T)) (until (WINDOWPROP EditWindow (QUOTE TEXTOBJ)) do (BLOCK)) (SETQ Sources (NC.SelectNoteCards NIL NIL NC.DeleteSelectingMenu Card NIL "Select source(s) to be deleted.")) (NC.ClearMsg Window T) (NC.ClosePropListEditor EditWindow (QUOTE NoSave)) (for ToBeDeletedLink in (NC.FetchGlobalLinks Card) when (AND (EQ NC.SourceLinkLabel (fetch (Link Label) of ToBeDeletedLink)) (for SourceCard in Sources thereis (NC.SameCardP (fetch (Link DestinationCard) of ToBeDeletedLink) SourceCard))) do (NC.DelToLink ToBeDeletedLink) (NC.DelFromLink ToBeDeletedLink) (NC.SetGlobalLinks Card (for Link in (NC.FetchGlobalLinks Card) when (for SourceCard in Sources never (NC.SameCardP (fetch (Link DestinationCard) of ToBeDeletedLink) SourceCard)) collect Link]) ) (* * changes to NCLINKS) (ADDTOFILE (QUOTE NC.OrphanID) (QUOTE GLOBALVARS) (QUOTE NCLINKS) (QUOTE NC.LinkIconSpaceInnerX)) (DEFINEQ (NC.FileInOrphanBox [LAMBDA (Link DestinationCard) (* Randy.Gobbel "18-Nov-86 15:15") (* * Hook card to orphan if this is the last link.) (* * rht 7/4/86: Changed to call NC.FetchSpecialCards so that RegistryCard, etc. won't have to be filed somewhere.) (* * rg 11/18/86 Added globalvars declaration) (DECLARE (GLOBALVARS NC.OrphanID)) [AND [NOT (FMEMB DestinationCard (NC.FetchSpecialCards (fetch (Card NoteFile) of DestinationCard] (NOT (NC.SameCardP (fetch (Link SourceCard) of Link) DestinationCard)) (NULL (NC.FetchNewCardFlg DestinationCard)) (NOT (NC.SameCardP (fetch (Link SourceCard) of Link) NC.OrphanID)) (COND ((OR (NULL (NC.FetchFromLinks DestinationCard)) (for Link in (NC.FetchFromLinks DestinationCard) always (NC.SameCardP (fetch (Link SourceCard) of Link) DestinationCard))) (NC.PrintMsg NIL T "You have just removed the last link to " (NC.RetrieveTitle DestinationCard) "." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard DestinationCard)) ([for Link in (NC.FetchFromLinks DestinationCard) never (FMEMB (fetch (Link Label) of Link) (QUOTE (SubBox FiledCard] (NC.PrintMsg NIL T "You have just unfiled " (NC.RetrieveTitle DestinationCard) " from its last filebox." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard DestinationCard] Link]) (NC.LinkIconImageBoxFn [LAMBDA (ImageObj ImageStream CurrentX RightMargin DummyArg DisplayType Title Label) (* Randy.Gobbel "19-Nov-86 15:07") (* * rht 9/20/84: Now scales result before returning by proper amount depending on stream type. e.g. for PRESS and INTERPRESS.) (* * rht 11/13/84: In computation of XSIZE, extra width is figured using characters in the font, "nn", rather than absolute pixel count.) (* * rht 2/9/85: Now uses new displaymode format.) (* * rht 5/9/86: Note that RightMargin non-nil signals a TEdit stream.) (* * rht & fgh 5/9/86: Massive hacking to display coords, etc.) (* * rht 5/10/86: Rearranged order of expressions a bit and added arg to call to NC.FetchLinkIconAttachedBitMap in order to get a bitmap with correct height for the box we're drawing.) (* * rht 8/7/86: Now passes Scale argument to NC.FetchLinkIconAttachedBitMap. Also uses the Title and Label args if non-nil. If not, then recomputes them more sensibly.) (* * rht 8/25/85: Fixed improperly placed comment.) (* * rg 11/18/86: Added TotalEdgeSpaceY to local vars declaration) (DECLARE (GLOBALVARS NC.LinkIconSpaceInnerX NC.LinkIconSpaceOuterX NC.LinkIconAttachBitmapFlg NC.LinkIconSpaceInnerY NC.LinkIconSpaceOuterY NC.LinkIconBorderWidth NC.LinkIconShowLinkTypeFlg NC.LinkIconShowTitleFlg)) (LET ((Link (NC.FetchLinkFromLinkIcon ImageObj)) (Scale (DSPSCALE NIL ImageStream)) Card FONT TypeIcon Label Title ShowTitleFlg AttachBitmapFlg LinkDisplayMode StringWidth YSize TotalEdgeSpaceY) (RESETLST (RESETSAVE NIL (BQUOTE (DSPFONT , (DSPFONT NC.LinkIconFont ImageStream) , ImageStream))) (SETQ FONT (DSPFONT NIL ImageStream))) (OR DisplayType (SETQ DisplayType (fetch (Link DisplayMode) of Link))) (SETQ Card (if (EQ (SETQ ShowTitleFlg (fetch (LINKDISPLAYMODE SHOWTITLEFLG) of DisplayType)) (QUOTE SOURCE)) then (fetch (Link SourceCard) of Link) else (fetch (Link DestinationCard) of Link))) (SETQ LinkDisplayMode (fetch (LINKDISPLAYMODE SHOWLINKTYPEFLG) of DisplayType)) (SETQ AttachBitmapFlg (fetch (LINKDISPLAYMODE ATTACHBITMAPFLG) of DisplayType)) (OR Title (SETQ Title (if (AND ShowTitleFlg (OR (NEQ ShowTitleFlg (QUOTE FLOAT)) NC.LinkIconShowTitleFlg)) then (NC.RetrieveTitle Card) else NIL))) [OR Label (SETQ Label (AND (COND ((EQ LinkDisplayMode (QUOTE FLOAT)) NC.LinkIconShowLinkTypeFlg) (T LinkDisplayMode)) (fetch (Link Label) of Link] (SETQ TotalEdgeSpaceY (TIMES Scale (PLUS NC.LinkIconBorderWidth NC.LinkIconSpaceOuterY NC.LinkIconSpaceInnerY))) (SETQ YSize (PLUS TotalEdgeSpaceY TotalEdgeSpaceY (FONTHEIGHT FONT))) (* * The adding of Scale to BoxHeight in the call to NC.FetchLinkIconAttachedBitMap is a kludge that works. Just BoxHeight would make alot more sense.) (SETQ TypeIcon (AND (COND ((EQ AttachBitmapFlg (QUOTE FLOAT)) NC.LinkIconAttachBitmapFlg) (T AttachBitmapFlg)) (NC.FetchLinkIconAttachedBitMap Card (PLUS Scale (DIFFERENCE YSize (PLUS NC.LinkIconSpaceOuterY NC.LinkIconSpaceOuterY))) Scale))) (SETQ StringWidth (COND ((OR Label Title) (STRINGWIDTH (CONCAT " " (COND (Label (CONCAT "<" Label ">")) (T "")) (COND ((AND Label Title) " ") (T "")) (OR Title "")) FONT)) ((NOT TypeIcon) (STRINGWIDTH " " FONT)) (T 0))) (create IMAGEBOX XSIZE ← [PLUS StringWidth (TIMES Scale 2 (PLUS NC.LinkIconSpaceOuterX NC.LinkIconSpaceInnerX)) (TIMES Scale (if TypeIcon then (PLUS NC.LinkIconBorderWidth (BITMAPWIDTH TypeIcon)) else (PLUS NC.LinkIconBorderWidth NC.LinkIconBorderWidth] YSIZE ← YSize YDESC ← (COND (RightMargin (* This is in a TEdittextstream) (PLUS (FONTDESCENT FONT) TotalEdgeSpaceY)) (T 0)) XKERN ← 0]) ) (* * changes to NCUTILITIES) (DEFINEQ (NC.AskMoveOrCopyNoteCards [LAMBDA (Msg Prompt FirstTry ClearFirstFlg MainWindow DontCloseAtEndFlg DontClearAtEndFlg) (* Randy.Gobbel "18-Nov-86 15:32") (* * Get a Copy Move or Cancel response from the user via keyboard or mouse. Return NIL for Cancel) (* * rg 11/18/86: Added declaration for Answer) (LET (Menu MenuWindow PromptWin Answer) (* * Determine and open the prompt window if necessary) (COND ((NOT (WINDOWP MainWindow)) (SETQ PromptWin PROMPTWINDOW)) ((NC.CoerceToCard MainWindow) (SETQ PromptWin (GETPROMPTWINDOW MainWindow 5 (FONTCREATE (QUOTE HELVETICA) 10))) (NC.MoveWindowOntoScreen MainWindow)) (T (SETQ PromptWin MainWindow))) (* * Attach a move/copy/cancel menu to the prompt window) (SETQ MenuWindow (ATTACHMENU (SETQ Menu (create MENU ITEMS ← (QUOTE (Cancel Move Copy)) WHENSELECTEDFN ← [FUNCTION (LAMBDA (Item Menu Button) (TTY.PROCESS (WINDOWPROP (MAINWINDOW (WFROMMENU Menu)) (QUOTE PROCESS))) (BKSYSBUF (CONCAT Item (CHARACTER 13] MENUFONT ← (FONTCREATE (QUOTE HELVETICA) 14 (QUOTE BOLD)) MENUBORDERSIZE ← 1 ITEMHEIGHT ← 20 ITEMWIDTH ← 65)) PromptWin (COND ((EQ PromptWin PROMPTWINDOW) (QUOTE BOTTOM)) (T (QUOTE TOP))) (QUOTE LEFT))) (* * print msg in prompt window and wait for user repsonse) (SETQ Answer (MKATOM (NC.AskUser Msg Prompt FirstTry ClearFirstFlg MainWindow T DontClearAtEndFlg T))) (DELETEMENU Menu T) (DETACHWINDOW MenuWindow) (if (OR DontCloseAtEndFlg (EQ PromptWin PROMPTWINDOW)) else (CLOSEW PromptWin)) (COND ((FMEMB Answer (QUOTE (c C Copy copy COPY))) (QUOTE Copy)) ((FMEMB Answer (QUOTE (m M Move move MOVE))) (QUOTE Move)) (T NIL]) ) (* * changes to NCPROGINT) (DEFINEQ (NCP.CheckOutNoteFile [LAMBDA (FromFile ToFile) (* Randy.Gobbel "18-Nov-86 15:42") (* * Copy FromFile to ToFile unless FromFile is locked. Create a lock file in FromFile's directory.) (* * rg 11/18/86: Replaced call to obsolete VERSIONNUMBER fn with FILENAMEFIELD) (PROG (LockFile User) (SETQ FromFile (NC.DatabaseFileName "Name of file to check out: " "--" T T FromFile)) LP (SETQ LockFile (NCP.LockFileName FromFile)) (COND [(INFILEP LockFile) (* lock file already exists.) (COND ((EQ (GETFILEINFO LockFile (QUOTE LENGTH)) 0) (* Lock file is empty. Delete and start over.) (DELFILE LockFile) (GO LP)) (T (* someone else already is playing with it.) [SETQ LockFile (OR (OPENP LockFile (QUOTE INPUT)) (OPENFILE LockFile (QUOTE INPUT) (QUOTE OLD] (SETQ User (READ LockFile)) (PRIN1 (CONCAT "File is locked by: " User (CHARACTER 13))) (CLOSEF LockFile) (RETURN NIL] [(SETQ LockFile (OPENFILE LockFile (QUOTE OUTPUT))) (COND ((EQ (FILENAMEFIELD LockFile (QUOTE VERSION)) 1) (PRINT (USERNAME NIL T) LockFile) (CLOSEF LockFile)) (T (* someone else created one before us. Delete this one and try again.) (DELFILE (CLOSEF LockFile)) (GO LP] (T (* something when wrong) (PRIN1 (CONCAT "Trouble in NC.CheckOutNoteFile." (CHARACTER 13))) (RETURN NIL))) (SETQ ToFile (NC.DatabaseFileName "Name of file to check out to: " "--" T T ToFile)) (PRIN1 (CONCAT "Copying " FromFile " to " ToFile " ... ")) (COPYFILE FromFile ToFile) (PRIN1 (CONCAT "Done." (CHARACTER 13))) (RETURN (FULLNAME ToFile]) ) (* * changes to NCTEXTCARD) (ADDTOFILE (QUOTE TEDIT.ICON.FONT) (QUOTE GLOBALVARS) (QUOTE NCTEXTCARD) (QUOTE TEDIT.DEFAULT.MENU)) (ADDTOFILE (QUOTE TEDIT.TITLED.ICON.TEMPLATE) (QUOTE GLOBALVARS) (QUOTE NCTEXTCARD) (QUOTE TEDIT.DEFAULT.MENU)) (DEFINEQ (NC.TextCardShrinkFn [LAMBDA (W) (* Randy.Gobbel "19-Nov-86 15:02") (* * This is in order to get the right title on the TEdit icon. This is a kludgy finesse around TEdit's shrunken icon title facility.) (* * rht 4/30/86: Now optionally kills TEdit process at shrink time.) (* * fgh 6/5/86 Fixed to KLUDGE around problem that TEdit will call GETBOXPOSITION even when SHRINKW is called with a position argument. Kludge involves looking up the stack for the position being specified in SHRINKW since its not passed down to here.) (* * rg 11/18/86 Added GLOBALVARS) (DECLARE (GLOBALVARS TEDIT.ICON.FONT TEDIT.TITLED.ICON.TEMPLATE NC.DelTEditProcessAtShrinkFlg) ) (LET ((OldIconTitle (WINDOWPROP W (QUOTE NoteCardsIconTitle))) (Icon (WINDOWPROP W (QUOTE ICON))) (Card (NC.CoerceToCard W)) IconTitle) [if (NULL Icon) then (WINDOWPROP W (QUOTE TEDIT.ICON.TITLE) "") (WINDOWPROP W (QUOTE ICON) (TITLEDICONW TEDIT.TITLED.ICON.TEMPLATE "" TEDIT.ICON.FONT (LET [(StkPos (STKPOS (QUOTE SHRINKW] (if StkPos then (PROG1 (STKARG (QUOTE ICONPOSITION) StkPos) (RELSTK StkPos)) else NIL)) T T NIL)) (APPLY* (WINDOWPROP W (QUOTE ICONFN)) W) (SETQ Icon (WINDOWPROP W (QUOTE ICON] (if [NOT (EQUAL OldIconTitle (SETQ IconTitle (CONCAT "NC: " (NC.RetrieveTitle Card] then (ICONTITLE IconTitle NIL NIL Icon) (WINDOWPROP W (QUOTE NoteCardsIconTitle) IconTitle)) (if NC.DelTEditProcessAtShrinkFlg then (NC.DelTEditProcesses W]) ) (* * changes to NCGRAPHCARD) (FILESLOAD (FROM {QV}<NOTECARDS>1.3K>NEXT>) NCGRAPHCARD) (ADDTOFILE (QUOTE TEDIT.ICON.FONT) (QUOTE GLOBALVARS) (QUOTE NCGRAPHCARD) (QUOTE NC.UseDeletedLinkIconIndicatorsFlg)) (DEFINEQ (NC.InsideGrapherNodeP [LAMBDA (Position Node) (* Randy.Gobbel "19-Nov-86 14:31") (* * Is position inside of graphernode Node) (* * fgh 6/30/86 First created.) (* * rg 11/19/86 Bug fix: Node was being referred to as GraphNode) (LET ((Left (GN/LEFT Node)) (Bottom (GN/BOTTOM Node))) (AND (GEQ (fetch (POSITION XCOORD) of Position) Left) (LEQ (fetch (POSITION XCOORD) of Position) (PLUS Left (fetch (GRAPHNODE NODEWIDTH) of Node))) (GEQ (fetch (POSITION YCOORD) of Position) Bottom) (LEQ (fetch (POSITION YCOORD) of Position) (PLUS Bottom (fetch (GRAPHNODE NODEHEIGHT) of Node))) Node]) (NC.GraphCardShrinkFn [LAMBDA (W) (* Randy.Gobbel "19-Nov-86 15:02") (* * Check to make sure that icon's title agrees with card title. If not, retitle the icon. If this is first shrink then create a new icon and fill in title.) (* * rg 11/19/86 Added GLOBALVARS declaration) (DECLARE (GLOBALVARS TEDIT.ICON.FONT NC.ShrunkenGraphIconTemplate)) (LET ((OldIconTitle (WINDOWPROP W (QUOTE GRAPH.ICON.TITLE))) (Icon (WINDOWPROP W (QUOTE ICON))) (Card (NC.CoerceToCard W)) IconTitle BM IconTemplate BMHeight BMHalfHeight TitleRegion) (SETQ IconTitle (CONCAT "NC: " (NC.RetrieveTitle Card))) [COND ((NOT Icon) (WINDOWPROP W (QUOTE ICON) (SETQ Icon (TITLEDICONW NC.ShrunkenGraphIconTemplate IconTitle TEDIT.ICON.FONT NIL T] (COND ((NOT (EQUAL OldIconTitle IconTitle)) (WINDOWPROP W (QUOTE GRAPH.ICON.TITLE) IconTitle) (ICONTITLE IconTitle TitleRegion NIL Icon]) ) (* * changes to NCBROWSERCARD) (FILESLOAD (FROM {QV}<NOTECARDS>1.3K>NEXT>) NCBROWSERCARD) (DEFINEQ (NC.ShrinkGraphToWindow [LAMBDA (Graph Window) (* Randy.Gobbel "19-Nov-86 15:04") (* * Bitblt's into Window a shrunken bitmap of the graph just big enough to fit.) (* * rht 3/18/86: Now does more intelligent copy of Graph structure, preserving virtual node eq-ness.) (* * rht 3/21/86: Now handles XScale and YScale.) (* * rg 11/19/86 Ref. to undef var BrowserWin --> GraphWindow , added GLOBALVARS) (DECLARE (GLOBALVARS NC.OverviewWinMode.Expand)) (LET ((GraphWindow (MAINWINDOW Window)) (Scales (NC.ComputeOverviewScale Graph Window)) (ShrunkenGraph (create GRAPH using Graph)) Scale XScale YScale) [if (EQ (WINDOWPROP GraphWindow (QUOTE OVERVIEWWINMODE)) NC.OverviewWinMode.Expand) then (SETQ XScale (CAR Scales)) (SETQ YScale (CDR Scales)) (SETQ Scale (FMIN XScale YScale)) else (SETQ Scale (SETQ XScale (SETQ YScale (FMIN (CAR Scales) (CDR Scales] (* Shrink the graphnodes.) (replace (GRAPH GRAPHNODES) of ShrunkenGraph with (for GraphNode in (fetch (GRAPH GRAPHNODES) of ShrunkenGraph) eachtime (BLOCK) collect (NC.ScaleGraphNode (create GRAPHNODE using GraphNode) Scale XScale YScale GraphWindow))) (* Display the graph, but temporarily scale the arrowhead global vars. Will this work compiled?) (SHOWGRAPH ShrunkenGraph Window) (WINDOWPROP Window (QUOTE Scale) Scale) (WINDOWPROP Window (QUOTE XScale) XScale) (WINDOWPROP Window (QUOTE YScale) YScale) (WINDOWPROP Window (QUOTE GRAPH) ShrunkenGraph]) ) (* * changes to KOTOSYSTEMPATCHES) [EDITV KOTOSYSTEMPATCHESCOMS 1 (A (DECLARE: DOEVAL@COMPILE DONTCOPY (FILES EXPORTS.ALL] (PUTPROPS RGPATCH001 COPYRIGHT ("Xerox Corporation" 1986)) (DECLARE: DONTCOPY (FILEMAP (NIL (2028 4261 (NC.DeleteSource 2038 . 4259)) (4403 10986 (NC.FileInOrphanBox 4413 . 6185) ( NC.LinkIconImageBoxFn 6187 . 10984)) (11022 13316 (NC.AskMoveOrCopyNoteCards 11032 . 13314)) (13350 15546 (NCP.CheckOutNoteFile 13360 . 15544)) (15818 17765 (NC.TextCardShrinkFn 15828 . 17763)) (17992 19980 (NC.InsideGrapherNodeP 18002 . 18842) (NC.GraphCardShrinkFn 18844 . 19978)) (20081 22189 ( NC.ShrinkGraphToWindow 20091 . 22187))))) STOP