(FILECREATED "28-Jun-84 10:32:30" {DSK}NOTECARDS.;49 305211 changes to: (VARS NOTECARDSCOMS) previous date: "28-Jun-84 01:37:35" {DSK}NOTECARDS.;48) (PRETTYCOMPRINT NOTECARDSCOMS) (RPAQQ NOTECARDSCOMS ((GLOBALVARS PSA.Database NC.SelectionInProgress NC.SelectedCards NC.MainMenu NC.SelectingSourcesMenu NC.SelectingContentsMenu NC.SelectingSingleCardMenu NC.SelectingMultipleCardsMenu NC.DeleteSelectingMenu (NC.TEditMenus NIL) NC.NoDeleteImageFns NC.GraphTitleBarMenu NC.BrowserTitleBarMenu NC.SketchTitleBarMenu NC.NoteCardTypeMenu NC.DatabaseOperationsMenu NC.LinkDisplayModesMenu NC.LinkLabelMenu NC.TopLevelCards NC.LinkLabelsID NC.LinkLabelsIdentifier NC.LinksIdentifier NC.ItemIdentifier NC.SystemLinkLabels NC.InitialLinkLabels NC.MainMenuInProgress NC.NoteCardBorderWidths NC.BrowseOrSearchMenu NC.SelectingBrowserSourceMenu NC.DummyAnno NC.SubBoxMarkerLabel NC.FiledCardMarkerLabel NC.PlaceMarkerDisplayFont NC.SubBoxLinkLabel NC.FiledCardLinkLabel NC.BrowserContentsLinkLabel NC.ListContentsLinkLabel NC.SourceLinkLabel NC.FixItFlg NC.UnspecifiedLinkLabel NC.InternalReleaseFlg NC.SpecialBrowserSpecsFlg NC.UCASESystemLinkLabels NC.SpecialBrowserMiddleButtonFn NC.WindowRightButtonMenu NC.MainMenuWIndow) (* New Fns) (VARS (World5File (QUOTE {DSK}WORLD5.MAPDATA)) (NC.InternalReleaseFlg NIL) (PSA.Database NIL) (NC.LinkLabelMenu NIL) (NC.LinkDisplayModesMenu NIL) (NC.OrphanID (QUOTE NC00002)) (NC.RootID (QUOTE NC00001)) (NC.TopLevelTopicsMenu NIL) (NC.UnclassifiedID (QUOTE NC00003)) (NC.LinkLabelsID (QUOTE NC00004)) (NC.TopLevelCards (QUOTE (NC00001 NC00002 NC00003))) (NC.LinkLabelsIdentifier (QUOTE ###LABELS###)) (NC.LinksIdentifier (QUOTE ###LINKS###)) (NC.ItemIdentifier (QUOTE ###ITEM###)) (NC.SubBoxLinkLabel (QUOTE SubBox)) (NC.FiledCardLinkLabel (QUOTE FiledCard)) (NC.BrowserContentsLinkLabel (QUOTE BrowserContents)) (NC.ListContentsLinkLabel (QUOTE ListContents)) (NC.SourceLinkLabel (QUOTE Source)) (NC.UnspecifiedLinkLabel (QUOTE Unspecified)) (NC.SystemLinkLabels (LIST NC.SourceLinkLabel NC.ListContentsLinkLabel NC.BrowserContentsLinkLabel NC.FiledCardLinkLabel NC.SubBoxLinkLabel)) (NC.UCASESystemLinkLabels (FOR Label in NC.SystemLinkLabels collect (U-CASE Label))) (NC.InitialLinkLabels (APPEND (QUOTE (Comment Remark Question Rebuttal Argument Unspecified)) NC.SystemLinkLabels)) (NC.MainMenuInProgress NIL) (NC.NoteCardBorderWidths (QUOTE ((TEXT 4) (CONTENTS 5) (SKETCH 4) (MAP 4) (BROWSER 4) (GRAPH 4)))) (NC.BrowseOrSearchMenu NIL) (NC.SubBoxMarkerLabel "File Boxes") (NC.FiledCardMarkerLabel "Note Cards") (NC.PlaceMarkerDisplayFont (FONTCREATE (QUOTE HELVETICA) 12 (QUOTE ITALIC))) (NC.FixItFlg NIL) (NC.SpecialBrowserSpecsFlg NIL) (NC.SpecialBrowserMiddleButtonFn NIL)) (* Stuff needed for compiling various functions) (* FIX UP VARIOUS UNWANTED FEATURES OF LISP and TEDIT) (ADVISE CLOSEF CREATE.SKETCHW.COMMANDMENU LOGOUT REMOVE.ELEMENT.FROM.SKETCH TEDIT.GET TEDIT.HARDCOPY TEDIT.INCLUDE TEDIT.PUT) (P (TEDIT.REMOVE.MENUITEM TEDIT.DEFAULT.MENU (QUOTE Annotate))) (* Newly defined Functions) (FNS INSTALL NC.AskBrowserSpecs NC.DatabaseFileName NC.DeleteDatabaseFile NC.FetchNewCardFlg NC.ForceDatabaseClose NC.ListDatabaseFiles NC.MakeFloppies NC.MakeSysout NC.MakeTEditLeftMenu NC.MakeTEditMiddleMenu NC.ResetTEdit NC.ResetTEditProcess NC.SetNewCardFlg NC.ShrinkFn NC.TEditMenuFn) (* Kill ANNO network stuff for efficiency) (FNS CREATE.ANNO.NODE CREATE.PARENTNODE ADD.ANNO.LINK.NAME ANNO.SETUPFN ANNO.NEXTID) (* Setup and top level interaction) (FNS NC.Setup NC.MakeMainMenu NC.MainMenuWhenSelectedFn NC.CacheTitles NC.CloseDatabaseFile NC.CompactDatabase NC.DatabaseOperations NC.LogoutAdvice) (* The Notecard Database) (FNS NC.CoerceDatabaseStream NC.CreateDatabaseFile NC.FetchMonitor NC.GetCachedMap NC.GetGraphSubstance NC.GetIdentifier NC.GetLinks NC.GetLinkLabels NC.GetNewID NC.GetNoteCard NC.GetPropList NC.GetRegion NC.GetSketchSubstance NC.GetTextSubstance NC.GetTitle NC.GetType NC.IndexFromID NC.InitializeSpecialCards NC.MarkCardDeleted NC.MarkIndexEntryFree NC.OpenDatabaseFile NC.PutCachedMap NC.PutDeletedIdentifier NC.PutGraphSubstance NC.PutIdentifier NC.PutLinks NC.PutLinkLabels NC.PutNoteCard NC.PutRegion NC.PutSketchSubstance NC.PutTextSubstance NC.SetMonitor NC.UpdateRegionData) (MACROS NC.PutPtr NC.PutStatus NC.GetPtr NC.GetStatus) (* Manipulate Note Card Representations) (FNS NC.ActivateCard NC.ActiveCardP NC.DeactivateCard NC.DirtySketchP NC.FetchFromLinks NC.FetchGlobalLinks NC.FetchLinksDirtyFlg NC.FetchPropList NC.FetchRegion NC.FetchRegionViewed NC.FetchScale NC.FetchSubstance NC.FetchTitle NC.FetchToLinks NC.FetchType NC.FetchWindow NC.IDP NC.MarkCardDirty NC.SetFromLinks NC.SetGlobalLinks NC.SetInitialPropList NC.SetLinksDirtyFlg NC.SetPropList NC.SetRegion NC.SetRegionViewed NC.SetScale NC.SetSubstance NC.SetTitle NC.SetToLinks NC.SetType) (* Retrieve Note Card Info) (FNS NC.RetrieveFromLinks NC.RetrieveLinkLabels NC.RetrievePropList NC.RetrieveTitle NC.RetrieveToLinks NC.RetrieveType) (* General note card manipulations) (FNS NC.AddParents NC.AssignSources NC.AssignTitle NC.DeleteNoteCards NC.EditNoteCard NC.MakeNoteCard NC.FileNoteCard NC.QuitCard NC.CheckContentsHooks NC.CheckSources NC.CheckTitle NC.DeleteSource NC.DetermineContentsCards NC.DetermineSources NC.InsureProperFiling NC.QuitWithoutSaving NC.UnfileNoteCard NC.UpdateUpdateList) (* Note card types) (FNS NC.BringUpGraphCard NC.BringUpSketchCard NC.BringUpTEditCard NC.ContentsCardP NC.MakeBrowserCard NC.MakeGraphCard NC.MakeSketchCard NC.MakeTEditCard NC.TEditQuitFn NC.GraphCardCloseFn NC.GraphCardLeftButtonFn NC.GraphCardMiddleButtonFn NC.GraphCardSaveFn NC.AnnotatedWindowCloseFn NC.SketchCardCloseFn NC.SketchCardSaveFn NC.TEditCloseFn NC.TEditSaveFn NC.\TEDIT.LOOKS NC.\TEDIT.QUIT NC.MakeContentsCard) (* Links mechanism) (RECORDS BrowserSpecs NOTECARDLINK) (FNS NC.AddFromLink NC.AddLinkToGraphCard NC.AddLinkToSketchCard NC.AddLinkToTextCard NC.AddSourceLink NC.AddToLink NC.DelFromLink NC.DelToLink NC.DelReferencesToCard NC.DelReferencesToCardFromGlobalList NC.DelReferencesToCardFromGraph NC.DelReferencesToCardFromSketch NC.DelReferencesToCardFromText NC.DeletedLinkDisplayFn NC.DeletedLinkGetFn NC.DeletedLinkImageBoxFn NC.DeletedLinkPutFn NC.CheckForOrphanDelete NC.FetchAnnoDisplayFn NC.FetchAnnoImageBoxFn NC.FetchSubstanceFromAnno NC.HookToOrphanCard NC.InsertLinkAndTitleBeforeMarker NC.LinkLabelP NC.MakeAContentsHook NC.MakeAnnotationLink NC.MakeContentsHooks NC.RelabelLink NC.SystemLinkLabelP NC.ValidLinkP) (* Link display icons) (FNS NC.ChangeLinkDisplayMode NC.DefaultLinkDisplayMode NC.UpdateLinkImages NC.UpdateLinkImagesInGraph NC.UpdateLinkImagesInSketch NC.UpdateLinkImagesInText) (* Interface to ANNO for the Link mechanism) (RECORDS ANNONOTECARDSUBSTANCE) (FNS NOTECARD.ANNO.BUTTONEVENTINFN NOTECARD.ANNO.CREATEFN NOTECARD.ANNO.DISPLAYFN NOTECARD.ANNO.EDITFN NOTECARD.ANNO.GETFN NOTECARD.ANNO.IMAGEBOXFN NOTECARD.ANNO.IMAGEOBJP NOTECARD.ANNO.LOCATIONMETRIC NOTECARD.ANNO.MIDDLEBUTTONFN NOTECARD.ANNO.PUTFN NOTECARD.ANNO.SUMM.DISPLAYFN NOTECARD.ANNO.WHENCOPIEDFN NOTECARD.ANNO.WHENDELETEDFN NOTECARD.ANNO.WHENINSERTEDFN NOTECARD.ANNO.WHENMOVEDFN NOTECARD.ANNOWINDOWDIRTYP) (* BROWSER And Search mechanisms) (FNS NC.ChooseBrowseOrSearch NC.GrowLinkLattice NC.UpdateBrowserCard NC.SubContentsLinkP NC.ContentsLinkP NC.NotBrowserHookP NC.FetchIDFromAnno NC.FetchSubstanceTypeFromAnno NC.SearchForCards) (* Prop List Editor) (RECORDS PropListItem) (FNS NC.AddPropToPropList NC.CloseAllPropListEditors NC.ClosePropListEditor NC.DelPropFromList NC.EditPropButtonFN NC.EditProperties NC.EditPropList NC.ExtractPropList NC.OpenPropListEditor NC.ProcessEditedPropList NC.PropListEditorOpenP NC.SelectProperty NC.ShowPointers NC.StringIsListP) (* Selection Mechanism) (VARS NC.SelectionInProgress) (FNS NC.SelectNoteCards) (* Menus of all sorts) (FNS NC.AskLinkLabel NC.AskNoteCardType NC.ChooseTopLevelCard NC.DisplayMainMenu NC.RemoveSketchMenuItems NC.SelectionMenusWhenSelectedFn NC.SetupTitleBarMenu NC.TitleBarButtonEventFn) (* UTILITIES) (FNS FILDIR-EARLIEST FILDIR-VERSION GETMOUSEX GETMOUSEY LOWERLEFT MBUTTON.NEXT.FIELD.AS.TEXT.OR.IMAGEOBJ NC.AskUser NC.AskUser2 NC.BitMapFromImageObject NC.ClearMsg NC.DetermineBorderWidth NC.FloppyArchive NC.GreyCard NC.IDFromNumber NC.IDFromWindow NC.MoveWindowOntoScreen NC.NotDaughterP NC.PlaceMarkerP NC.ReportError NC.PrintMsg NC.PrintMsg2 NC.MoveTTYWindow WW) (* Place marker ImageObjects) (FNS NC.PlaceMarkerCopyFn NC.PlaceMarkerDisplayFn NC.PlaceMarkerGetFn NC.PlaceMarkerImageBoxFn NC.PlaceMarkerPutFn NC.MakePlaceMarker) (* Unknown ?????????) (FNS NC.FetchBeingDeletedFlg NC.SetBeingDeletedFlg) (* Scavenger mechanisms) (FNS NC.CollectAndCheckLinks NC.FixIt NC.GetOldData NC.FindOldData NC.FindOldLinks NC.ReinstateNthInstance NC.ScavengeDatabaseFile) (ADVISE TEDIT) (* Database compactor) (FNS NC.ComputeNewDatabaseIndexSize NC.CopyAndCompactDatabase NC.CopyNoteCard) (* Image Object for Deleted Links in TEdit) (P (SETQ NC.DeletedLinkImageObject (IMAGEOBJCREATE "DeletedLink" (IMAGEFNSCREATE (FUNCTION NC.DeletedLinkDisplayFn) (FUNCTION NC.DeletedLinkImageBoxFn) (FUNCTION NC.DeletedLinkPutFn) (FUNCTION NC.DeletedLinkGetFn) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL))))) (P (SETQ ANNO.SUBSTANCE.TYPES (CONS (create ANNOSUBSTANCETYPE TYPENAME ← (QUOTE NOTECARD) CREATESUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.CREATEFN) EDITSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.EDITFN) GETSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.GETFN) PUTSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.PUTFN) WHENANNODELETEDFN ← (FUNCTION NOTECARD.ANNO.WHENDELETEDFN) WHENANNOCOPIEDFN ← (FUNCTION NOTECARD.ANNO.WHENCOPIEDFN) WHENANNOMOVEDFN ← (FUNCTION NOTECARD.ANNO.WHENMOVEDFN) WHENANNOINSERTEDFN ← (FUNCTION NOTECARD.ANNO.WHENINSERTEDFN) SUMMARYDISPLAYFN ← (FUNCTION NOTECARD.ANNO.SUMM.DISPLAYFN) LOCATIONMETRIC ← (FUNCTION NOTECARD.LOCATION.METRIC) ANNOWINDOWDIRTYP ← (FUNCTION NOTECARD.ANNOWINDOWDIRTYP) DEFAULTWINDOWSIZE ← (CONS 300 75) BUTTONEVENTINFN ← (FUNCTION NOTECARD.ANNO.BUTTONEVENTINFN) IMAGEBOXFN ← (FUNCTION NOTECARD.ANNO.IMAGEBOXFN) DISPLAYFN ← (FUNCTION NOTECARD.ANNO.DISPLAYFN)) (AND (BOUNDP (QUOTE ANNO.SUBSTANCE.TYPES)) ANNO.SUBSTANCE.TYPES)))) (* Set up Lafite Bug Report Forms) (E (SETQ NC.SystemDate (DATE))) (VARS NC.SystemDate) (FNS NC.MakeLafiteForm) (ADDVARS (LAFITESPECIALFORMS ("NoteCards Report" (FUNCTION NC.MakeLafiteForm) "Report bug or request new feature for NoteCards."))) (P (SETQ LAFITEFORMSMENU NIL)) (* Set up NoteCards) (P (NC.Setup)) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA) (NLAML) (LAMA NC.PrintMsg2 NC.PrintMsg))))) (DECLARE: DOEVAL@COMPILE DONTCOPY (ADDTOVAR GLOBALVARS PSA.Database NC.SelectionInProgress NC.SelectedCards NC.MainMenu NC.SelectingSourcesMenu NC.SelectingContentsMenu NC.SelectingSingleCardMenu NC.SelectingMultipleCardsMenu NC.DeleteSelectingMenu (NC.TEditMenus NIL) NC.NoDeleteImageFns NC.GraphTitleBarMenu NC.BrowserTitleBarMenu NC.SketchTitleBarMenu NC.NoteCardTypeMenu NC.DatabaseOperationsMenu NC.LinkDisplayModesMenu NC.LinkLabelMenu NC.TopLevelCards NC.LinkLabelsID NC.LinkLabelsIdentifier NC.LinksIdentifier NC.ItemIdentifier NC.SystemLinkLabels NC.InitialLinkLabels NC.MainMenuInProgress NC.NoteCardBorderWidths NC.BrowseOrSearchMenu NC.SelectingBrowserSourceMenu NC.DummyAnno NC.SubBoxMarkerLabel NC.FiledCardMarkerLabel NC.PlaceMarkerDisplayFont NC.SubBoxLinkLabel NC.FiledCardLinkLabel NC.BrowserContentsLinkLabel NC.ListContentsLinkLabel NC.SourceLinkLabel NC.FixItFlg NC.UnspecifiedLinkLabel NC.InternalReleaseFlg NC.SpecialBrowserSpecsFlg NC.UCASESystemLinkLabels NC.SpecialBrowserMiddleButtonFn NC.WindowRightButtonMenu NC.MainMenuWIndow) ) (* New Fns) (RPAQQ World5File {DSK}WORLD5.MAPDATA) (RPAQQ NC.InternalReleaseFlg NIL) (RPAQQ PSA.Database NIL) (RPAQQ NC.LinkLabelMenu NIL) (RPAQQ NC.LinkDisplayModesMenu NIL) (RPAQQ NC.OrphanID NC00002) (RPAQQ NC.RootID NC00001) (RPAQQ NC.TopLevelTopicsMenu NIL) (RPAQQ NC.UnclassifiedID NC00003) (RPAQQ NC.LinkLabelsID NC00004) (RPAQQ NC.TopLevelCards (NC00001 NC00002 NC00003)) (RPAQQ NC.LinkLabelsIdentifier ###LABELS###) (RPAQQ NC.LinksIdentifier ###LINKS###) (RPAQQ NC.ItemIdentifier ###ITEM###) (RPAQQ NC.SubBoxLinkLabel SubBox) (RPAQQ NC.FiledCardLinkLabel FiledCard) (RPAQQ NC.BrowserContentsLinkLabel BrowserContents) (RPAQQ NC.ListContentsLinkLabel ListContents) (RPAQQ NC.SourceLinkLabel Source) (RPAQQ NC.UnspecifiedLinkLabel Unspecified) (RPAQ NC.SystemLinkLabels (LIST NC.SourceLinkLabel NC.ListContentsLinkLabel NC.BrowserContentsLinkLabel NC.FiledCardLinkLabel NC.SubBoxLinkLabel)) (RPAQ NC.UCASESystemLinkLabels (FOR Label in NC.SystemLinkLabels collect (U-CASE Label))) (RPAQ NC.InitialLinkLabels (APPEND (QUOTE (Comment Remark Question Rebuttal Argument Unspecified)) NC.SystemLinkLabels)) (RPAQQ NC.MainMenuInProgress NIL) (RPAQQ NC.NoteCardBorderWidths ((TEXT 4) (CONTENTS 5) (SKETCH 4) (MAP 4) (BROWSER 4) (GRAPH 4))) (RPAQQ NC.BrowseOrSearchMenu NIL) (RPAQ NC.SubBoxMarkerLabel "File Boxes") (RPAQ NC.FiledCardMarkerLabel "Note Cards") (RPAQ NC.PlaceMarkerDisplayFont (FONTCREATE (QUOTE HELVETICA) 12 (QUOTE ITALIC))) (RPAQQ NC.FixItFlg NIL) (RPAQQ NC.SpecialBrowserSpecsFlg NIL) (RPAQQ NC.SpecialBrowserMiddleButtonFn NIL) (* Stuff needed for compiling various functions) (* FIX UP VARIOUS UNWANTED FEATURES OF LISP and TEDIT) (PUTPROPS CLOSEF READVICE (NIL (BEFORE NIL (COND ((OR (EQ FILE PSA.Database) (AND (FULLNAME FILE) (EQ (FULLNAME FILE) (FULLNAME PSA.Database)))) (RETURN NIL)))))) (PUTPROPS CREATE.SKETCHW.COMMANDMENU READVICE (NIL (AFTER NIL (NC.RemoveSketchMenuItems !VALUE)))) (PUTPROPS LOGOUT READVICE (NIL (BEFORE NIL (NC.LogoutAdvice)))) (PUTPROPS REMOVE.ELEMENT.FROM.SKETCH READVICE (NIL (AFTER NIL (COND ((AND !VALUE (EQ (fetch (GLOBALPART GTYPE) of GELT) (QUOTE SKIMAGEOBJ))) (NOTECARD.ANNO.WHENDELETEDFN (fetch (IMAGEOBJ OBJECTDATUM) of (fetch (SKIMAGEOBJ SKIMAGEOBJ) of (fetch (GLOBALPART INDIVIDUALGLOBALPART) of GELT))) SKETCHW)))))) (PUTPROPS TEDIT.GET READVICE (NIL (BEFORE NIL (COND ((PROG (Window) (SETQ Window (WINDOW.FROM.TEDIT.THING TEXTOBJ)) (COND ((AND (NC.IDP (NC.IDFromWindow Window)) (NC.ActiveCardP ( NC.IDFromWindow Window))) (TEDIT.PROMPTPRINT TEXTOBJ "Get not available in NoteCards." T) (RETURN T)))) (RETURN NIL)))))) (PUTPROPS TEDIT.HARDCOPY READVICE (NIL (BEFORE NIL (COND ((AND (NULL SERVER) (NULL DEFAULTPRINTINGHOST)) (TEDIT.PROMPTPRINT (TEXTOBJ STREAM) "No printing server specified." T) (RETURN NIL)))))) (PUTPROPS TEDIT.INCLUDE READVICE (NIL (BEFORE NIL (COND ((PROG (Window (TEXTOBJ (TEXTOBJ STREAM))) (SETQ Window (WINDOW.FROM.TEDIT.THING TEXTOBJ)) (COND ((AND (NC.IDP (NC.IDFromWindow Window)) (NC.ActiveCardP (NC.IDFromWindow Window)) ) (TEDIT.PROMPTPRINT TEXTOBJ "Include not available in NoteCards." T) (RETURN T)))) (RETURN NIL)))))) (PUTPROPS TEDIT.PUT READVICE (NIL (BEFORE NIL (COND ((PROG (Window (TEXTOBJ (TEXTOBJ STREAM))) (SETQ Window (WINDOW.FROM.TEDIT.THING TEXTOBJ)) (COND ((AND (NC.IDP (NC.IDFromWindow Window)) (NC.ActiveCardP ( NC.IDFromWindow Window))) (TEDIT.PROMPTPRINT TEXTOBJ "Put not available in NoteCards." T) (RETURN T)))) (RETURN NIL)))))) (READVISE CLOSEF CREATE.SKETCHW.COMMANDMENU LOGOUT REMOVE.ELEMENT.FROM.SKETCH TEDIT.GET TEDIT.HARDCOPY TEDIT.INCLUDE TEDIT.PUT) (TEDIT.REMOVE.MENUITEM TEDIT.DEFAULT.MENU (QUOTE Annotate)) (* Newly defined Functions) (DEFINEQ (INSTALL (LAMBDA NIL (* NoteCards% User "12-Jun-84 23:51") (* NoteCards system installatiuon routine. For DLions only. Basically to a MKDIR on DLION disk and copy the font files from floppy to local disk. To be run only after the DLion local disk has been repartitioned.) (COND ((EQ (MACHINETYPE) (QUOTE DANDELION)) (RESETLST (RESETSAVE NIL (LIST (QUOTE WINDOWPROP) ExecWindow (QUOTE PAGEFULLFN) (WINDOWPROP ExecWindow (QUOTE PAGEFULLFN) (FUNCTION NILL)))) (COND ((NOT (DFSLISPVOLUMEP (QUOTE DSK))) (MKDIR (QUOTE DSK)))) (PROG (Files FloppyName) (NC.ClearMsg NIL NIL) Loop(NC.PrintMsg2 NIL NIL "Please insert the Lisp Library #2" " diskette in the floppy disk drive." (CHARACTER 13)) (FLOPPY.WAIT.FOR.FLOPPY) (NC.PrintMsg2 NIL T "NoteCards Initialization." (CHARACTER 13) "Examining files on the Lisp Library #2" " diskette." (CHARACTER 13) "Please wait ... " (CHARACTER 13)) (COND ((AND (NEQ (SETQ FloppyName (FLOPPY.NAME)) (QUOTE LispLibrary2)) (NEQ FloppyName (QUOTE LispPackages))) (NC.PrintMsg2 NIL T "The floppy currently in the drive is named: " FloppyName (CHARACTER 13) "Please insert the correct diskette." (CHARACTER 13)) (GO Loop)) (T (SETQ Files (FILDIR (QUOTE {FLOPPY}*.STRIKE))) (COND ((NULL Files) (NC.PrintMsg2 NIL T "There are no font files on this diskette." (CHARACTER 13) "Please insert the correct diskette." (CHARACTER 13)) (GO Loop)) (T (NC.PrintMsg2 NIL T "NoteCards Initialization." (CHARACTER 13) "Copying files from the Lisp Library #2" " diskette to hard disk." (CHARACTER 13) "Please wait ... " (CHARACTER 13)) (for File in Files do (COPYFILE File (PACKFILENAME (QUOTE HOST) (QUOTE DSK) (QUOTE VERSION) NIL (QUOTE BODY) File))) (COPYFILE (QUOTE {FLOPPY}FONTS.WIDTHS) (QUOTE {DSK}FONTS.WIDTHS)))))))))) (NC.PrintMsg2 NIL T "NoteCards System Installation Completed." (CHARACTER 13)) (QUOTE Done))) (NC.AskBrowserSpecs (LAMBDA (BrowserWindow) (* NoteCards% User "18-Jun-84 23:26") (* * Get the specification for laying out a browser graph from the user and return them in a BrowserSpecs record.) (PROG (BrowserSpecs) (OR (WINDOWP BrowserWindow) (SETQ BrowserWindow)) (SETQ BrowserSpecs (create BrowserSpecs Format ←(LIST (COND ((MEMBER (NC.AskUser2 "Should this be a compact browser?" " -- " "No" T BrowserWindow T) (QUOTE ("Yes" "yes" "Y" "y" "Ye" "ye"))) (QUOTE COMPACT)) (T (QUOTE LATTICE))) (COND ((MEMBER (NC.AskUser2 "Should this be a vertical browser?" " -- " "No" T BrowserWindow T) (QUOTE ("Yes" "yes" "Y" "y" "Ye" "ye"))) (QUOTE VERTICAL)) (T (QUOTE HORIZONTAL)))) Font ← NIL MotherD ←(FIXP (MKATOM (NC.AskUser2 "What is the MotherD for this browser?" " -- " NIL T BrowserWindow T) )) PersonalD ←(FIXP (MKATOM (OR (NC.AskUser2 "What is the PersoalD for this browser?" " -- " NIL T BrowserWindow T) 10))) FamilyD ←(FIXP (MKATOM (NC.AskUser2 "What is the FamilyD for this browser?" " -- " NIL T BrowserWindow T) )))) (RETURN BrowserSpecs)))) (NC.DatabaseFileName (LAMBDA (Msg Prompt ClearFirstFlg) (* NoteCards% User "12-Jun-84 17:06") (* Make a NoteCards database file name on the base specified by the user. Basically, add the NOTEFILE extension) (PROG (Name UnpackedName) (SETQ Name (MKATOM (NC.AskUser2 Msg Prompt NIL ClearFirstFlg NIL T))) (AND (NULL Name) (RETURN NIL)) (SETQ UnpackedName (UNPACKFILENAME Name)) (COND ((NULL (LISTGET UnpackedName (QUOTE EXTENSION))) (LISTPUT UnpackedName (QUOTE EXTENSION) (QUOTE NoteFile)) (SETQ Name (PACKFILENAME UnpackedName)))) (RETURN Name)))) (NC.DeleteDatabaseFile (LAMBDA (FileName) (* NoteCards% User "12-Jun-84 17:24") (* Delete file FileName) (PROG (FullFileName) (* Make sure no open databases) (COND ((AND PSA.Database (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is an open NoteFile." (CHARACTER 13) "The NoteFile must be closed" " before any NoteFile can be " "deleted." (CHARACTER 13)) (RETURN))) (* Get file name) (AND (NULL FileName) (NULL (SETQ FileName (NC.DatabaseFileName "Please enter name of NoteFile to be deleted" " -- " T))) (RETURN NIL)) (* make sure to be deleted file exists) (SETQ FullFileName (CAR (FILDIR-EARLIEST FileName))) (COND ((NULL FullFileName) (NC.PrintMsg2 NIL T FileName " does not exist." (CHARACTER 13) "Delete cancelled." (CHARACTER 13)) (RETURN))) (* Ask user to confirm twice.) (COND ((NOT (FMEMB (MKATOM (NC.AskUser2 (CONCAT "Are you sure you want to delete " FullFileName "?") " -- " "No" T NIL T)) (QUOTE (Y y Yes YES)))) (NC.ClearMsg NIL NIL) (RETURN))) (NC.PrintMsg2 NIL T "Deleteing " FullFileName (CHARACTER 13)) (DISMISS 2500) (COND ((NOT (FMEMB (MKATOM (NC.AskUser2 (CONCAT "Are you STILL sure you want to delete " FullFileName "?") " -- " "No" T NIL T)) (QUOTE (Y y Yes YES)))) (NC.ClearMsg NIL NIL) (RETURN))) (* Delete the file) (SETQ FullFileName (DELFILE FullFileName)) (NC.PrintMsg2 NIL T FullFileName " deleted." (CHARACTER 13))))) (NC.FetchNewCardFlg (LAMBDA (ID) (* NoteCards% User " 6-Jun-84 17:30") (* Return the value of the new card flg of ID) (GETPROP ID (QUOTE NoteCardNewCard)))) (NC.ForceDatabaseClose (LAMBDA (DatabaseStream) (* NoteCards% User "17-Jun-84 19:38") (* * Really close the database, i.e.. bypass the ADVISE on CLOSEF that prevents closing of the database.) (SETQ PSA.Database NIL) (CLOSEF DatabaseStream))) (NC.ListDatabaseFiles (LAMBDA NIL (* NoteCards% User " 8-Jun-84 18:38") (* Do a DIR on all of the NoteFiles on the current connected directory.) (PROG (Files) (RESETLST (RESETSAVE (TTYDISPLAYSTREAM PROMPTWINDOW)) (RESETSAVE NIL (LIST (QUOTE WINDOWPROP) PROMPTWINDOW (QUOTE PAGEFULLFN) (WINDOWPROP PROMPTWINDOW (QUOTE PAGEFULLFN) NIL))) (GIVE.TTY.PROCESS PROMPTWINDOW) (CLEARBUF T) (SETQ Files (FILDIR (QUOTE *.NoteFile))) (COND (Files (CLRPROMPT) (for File in Files do (printout PROMPTWINDOW "NoteFile: " File T))) (T (NC.PrintMsg2 NIL T "There are no NoteFiles" " (files ending in .NoteFile)" " on the local disk."))))))) (NC.MakeFloppies (LAMBDA NIL (* NoteCards% User "12-Jun-84 23:09") (* Make sysout on floppies for loading by NoteCards installation Prometheus script) (RESETLST (RESETSAVE (FLOPPY.MODE (QUOTE SYSOUT))) (RESETSAVE (ADVISE (QUOTE \PFLOPPY.FORMAT) (QUOTE BEFORE) (QUOTE (SETQ NAME (CONCAT "NoteCards Sysout #" (SUBSTRING NAME -1 -1))))) (QUOTE (UNADVISE \PFLOPPY.FORMAT))) (COPYFILE (QUOTE {PHYLUM}<PSA>NOTECARDS>NOTECARDS.SYSOUT) (QUOTE {FLOPPY}))))) (NC.MakeSysout (LAMBDA NIL (* NoteCards% User "13-Jun-84 00:03") (* Make the NoteCards sysout - making sure that the correct logion, etc is done on coming back from the sysout) (PROG (OldPageFullFn) (AND (BOUNDP (QUOTE LOGOW)) (WINDOWP LOGOW) (CLOSEW LOGOW)) (COND ((OR (NOT (BOUNDP (QUOTE QUADTREE.HIGHRES))) (NLISTP (QUOTE QUADTREE.HIGHRES))) (SETQ QUADTREE.HIGHRES (GET.QUAD.TREE (QUOTE WORLD5))))) (SETQ World5File (QUOTE {DSK}WORLD5.MAPDATA)) (SETQ FONTDIRECTORIES (LIST (QUOTE {DSK}))) (NC.MakeLogoWindow) (MOVEW NC.LogoWindow 5 605) (TTY.PROCESS T) (SETQ ExecWindow (WFROMDS (TTYDISPLAYSTREAM))) (SETQ OldPageFullFn (WINDOWPROP ExecWindow (QUOTE PAGEFULLFN) (FUNCTION NILL))) (WINDOWPROP ExecWindow (QUOTE TITLE) NIL) (SHAPEW ExecWindow (CREATEREGION 608 650 267 66)) (WINDOWPROP PROMPTWINDOW (QUOTE TITLE) NIL) (SHAPEW PROMPTWINDOW (CREATEREGION 350 721 526 78)) (CROCK (CREATEREGION 882 650 127 147)) (CLEARW PROMPTWINDOW) (CLEARW ExecWindow) (SYSOUT (QUOTE {DSK4}NOTECARDS.SYSOUT;1)) (CLEARW ExecWindow) (WINDOWPROP ExecWindow (QUOTE PAGEFULLFN) OldPageFullFn) (LOGIN) (USERNAME) (RETURN (QUOTE NoteCards))))) (NC.MakeTEditLeftMenu (LAMBDA (NoteCardType) (* NoteCards% User "17-Jun-84 01:02") (* * Make the LeftButton TEdit menu appropriate for this type of text card. If menu doesn't exist, then make it.) (\TEDIT.CREATEMENU (OR (AND (BOUNDP (QUOTE NC.TEditMenus)) (LISTP NC.TEditMenus) (LISTGET NC.TEditMenus NoteCardType)) (LISTGET (SETQ NC.TEditMenus (QUOTE (TEXT ((Show/Edit% Properties (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card." (SUBITEMS (Edit% Property% List (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card.") (Show% Pointers (FUNCTION NC.ShowPointers) "Brings up a list of the pointers to and from this card."))) (Title/Sources/FileBoxes (FUNCTION (LAMBDA (TextStream) (NC.AssignTitle TextStream) (NC.AssignSources TextStream) (NC.FileNoteCard TextStream))) "Do all of the operations necessary to file this note card in a file box." (SUBITEMS (Assign% Title (FUNCTION NC.AssignTitle) "Assigns a (new) title to this note card.") (Designate% Sources (FUNCTION NC.AssignSources) "Designate the source(s) of the information in this card.") (File% in% FileBoxes (FUNCTION NC.FileNoteCard) "File this note card in one or more file boxes.") (Unfile% from% FileBoxes (FUNCTION NC.UnfileNoteCard) "Remove tyhis card from one or more of its file boxes.") (Delete% Source (FUNCTION NC.DeleteSource) "Delete one of the sources of this card."))) (Insert% Pointer (FUNCTION NC.AddLinkToTextCard) "Insert a pointer to another card at the currently selected point in the text.") (Close% and% Save (FUNCTION NC.TEditCloseFn) "Close this note card after saving it in the NoteFile." (SUBITEMS (Close% and% Save (FUNCTION NC.TEditCloseFn) "Close this note card after saving it in the NoteFile.") (Close% w/o% Saving (FUNCTION NC.QuitWithoutSaving) "Close this note card without saving any changes made since the last Save.") (Save% in% NoteFile (FUNCTION NC.TEditSaveFn) "Save this card in the NoteFile but don't close the card.") (Delete% Card (FUNCTION NC.DeleteNoteCards) "Permenantly delete this card from the NoteFile.")))) CONTENTS ((Show/Edit% Properties (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card." (SUBITEMS (Edit% Property% List (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card.") (Show% Pointers (FUNCTION NC.ShowPointers) "Brings up a list of the pointers to and from this card."))) (Put% in% FileBox (FUNCTION NC.AddParents) "Put this FileBox in new parent FileBox(es).") (Assign% Title (FUNCTION NC.AssignTitle) "Assign a new title to this FileBox.") (Close% and% Save (FUNCTION NC.TEditCloseFn) "Close this note card after saving it in the NoteFile." (SUBITEMS (Close% and% Save (FUNCTION NC.TEditCloseFn) "Close this note card after saving it in the NoteFile.") (Save% in% NoteFile (FUNCTION NC.TEditSaveFn) "Save this card in the NoteFile but don't close the card.") (Delete% FileBox (FUNCTION NC.DeleteNoteCards) "Permenantly delete this FileBox from the NoteFile."))))) )) NoteCardType))))) (NC.MakeTEditMiddleMenu (LAMBDA NIL (* NoteCards% User "17-Jun-84 01:05") (* * Make the Middle Button Menu fort a Tedit card.) (\TEDIT.CREATEMENU (QUOTE ((Restart% Editor (FUNCTION NC.ResetTEdit) "Resets and restarts the editor for this Card/Box.") (Advanced% Editing% Menu (FUNCTION \TEDIT.EXPANDED.MENU) "Brings up the menu for the advanced editing commands.") (Change% Font (FUNCTION NC.\TEDIT.LOOKS) "Changes the font of the selected text.")))))) (NC.ResetTEdit (LAMBDA (TextStream) (* NoteCards% User "17-Jun-84 01:58") (* * Kill the Tedit process running on TextStream and the restart a new one. Goal is to clean up display if TEdit goea awary.) (ADD.PROCESS (LIST (FUNCTION NC.ResetTEditProcess) TextStream) (QUOTE NAME) (QUOTE ResetTEdit)))) (NC.ResetTEditProcess (LAMBDA (TextStream) (* NoteCards% User "17-Jun-84 02:02") (* * Added-process that actually does the works for NC.ResetTEdit. Kill the Tedit process running on TextStream and the restart a new one. Goal is to clean up display if TEdit goea awary.) (PROG ((Window (WINDOW.FROM.TEDIT.THING TextStream)) (TextObj (TEXTOBJ TextStream)) DirtyFlg ID) (SETQ ID (NC.IDFromWindow Window)) (COND ((OR (NOT (WINDOWP Window)) (NULL ID)) (RETURN))) (SETQ DirtyFlg (fetch (TEXTOBJ \DIRTY) of TextObj)) (TEDIT.KILL TextStream) (TEDIT TextStream Window) (replace (TEXTOBJ \DIRTY) of (TEXTOBJ TextStream) with DirtyFlg) (WINDOWPROP Window (QUOTE TITLE) (NC.RetrieveTitle ID PSA.Database)) (RETURN)))) (NC.SetNewCardFlg (LAMBDA (ID Value) (* NoteCards% User " 6-Jun-84 17:29") (* Set the new card flg of ID to Value) (PUTPROP ID (QUOTE NoteCardNewCard) Value))) (NC.ShrinkFn (LAMBDA NIL (* NoteCards% User " 8-Jun-84 17:53") (* SHRINKFN for all NoteCards and FileBoxes. For now just the default title icon.) NIL)) (NC.TEditMenuFn (LAMBDA (Window) (* NoteCards% User "17-Jun-84 00:23") (* * Gets called from LEFT or MIDDLE button press in title bar of TEdit window. If LEFT press bring up the Notecards Manipulation Window. IF MIDDLE press bring up the TEdit specific NoteCard operations menu. Bring up menus using TEDIT.DEFAULT.MENUFN) (PROGN (COND ((LASTMOUSESTATE LEFT) (WINDOWPROP Window (QUOTE TEDIT.MENU) (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu)))) (T (WINDOWPROP Window (QUOTE TEDIT.MENU) (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu))))) (TEDIT.DEFAULT.MENUFN Window)))) ) (* Kill ANNO network stuff for efficiency) (DEFINEQ (CREATE.ANNO.NODE (LAMBDA NIL (* fgh: "25-May-84 17:59") (* Bypass ANNO network creation for NoteCards efficiency) NIL)) (CREATE.PARENTNODE (LAMBDA NIL (* fgh: "25-May-84 17:59") (* Bypass ANNO network creation for NoteCards efficiency) NIL)) (ADD.ANNO.LINK.NAME (LAMBDA NIL (* fgh: "28-May-84 20:42") (* Bypass ANNO network mechanism for NoteCards efficiency.) NIL)) (ANNO.SETUPFN (LAMBDA NIL (* fgh: "25-May-84 17:58") (* Bypass ANNO network creation for NoteCards efficiency) NC.DummyAnno)) (ANNO.NEXTID (LAMBDA NIL (* fgh: "25-May-84 19:03") (* Bypass ANNO network code for NoteCards efficiency) (QUOTE Note1))) ) (* Setup and top level interaction) (DEFINEQ (NC.Setup (LAMBDA (DatabaseFileName) (* NoteCards% User "25-Jun-84 20:00") (AND (NULL NC.InternalReleaseFlg) (GCGAG)) (COND ((NULL NC.InternalReleaseFlg) (SETQ NC.WindowRightButtonMenu (create MENU ITEMS ←(for Item in WindowMenuCommands when (NOT (FMEMB (CAR Item) (QUOTE (Snap Paint Clear)))) collect Item) MENUCOLUMNS ← 1 CENTERFLG ← T MENUFONT ←(QUOTE (HELVETICA 10)))) (* replace (MENU MENUOFFSET) of NC.WindowRightButtonMenu with (create POSITION XCOORD ← -1 YCOORD ← (ADD1 (ITIMES (FONTPROP (fetch (MENU MENUFONT) NC.WindowRightButtonMenu) (QUOTE HEIGHT)) (SUB1 (LENGTH (fetch (MENU ITEMS) of NC.WindowRightButtonMenu))))))) (ADVISE (QUOTE DOWINDOWCOM) (QUOTE AROUND) (QUOTE (AND (NEQ WINDOW NC.MainMenuWindow) (COND ((NC.IDP (NC.IDFromWindow WINDOW)) (RESETLST (RESETSAVE WindowMenu NC.WindowRightButtonMenu)*)) (T *))))))) (SETQ UseMapWithPoliticalBoundaries T) (SETQ TEDIT.INPUT.FORMATS NIL) (SETQ PSA.NoteCards (QUOTE (NC00002 NC00001))) (SETQ PSA.MenuOfNoteCards) (SETQ PSA.NoteCardDefaultWidth 400) (SETQ PSA.NoteCardDefaultHeight 200) (SETQ PSA.ContentsCardDefaultWidth 335) (SETQ PSA.ContentsCardDefaultHeight 200) (SETQ PSA.GraphCardDefaultWidth 300) (SETQ PSA.GraphCardDefaultHeight 200) (SETQ PSA.TEditCardDefaultWidth 300) (SETQ PSA.TEditCardDefaultHeight 200) (SETQ PSA.SketchCardDefaultWidth 400) (SETQ PSA.SketchCardDefaultHeight 350) (SETQ NC.BrowserCardDefaultWidth 500) (SETQ NC.BrowserCardDefaultHeight 350) (SETQ PSA.MapSketchType (for SketchType in SKETCH.ELEMENT.TYPES thereis (EQ (fetch (SKETCHTYPE LABEL) of SketchType) (QUOTE Map)))) (SETQ PSA.TimesRoman10 (FONTCREATE (QUOTE HELVETICA) 12)) (DSPFONT (FONTCREATE (QUOTE HELVETICA) 12) PROMPTWINDOW) (LINELENGTH 500 PROMPTWINDOW) (NC.MakeMainMenu) (SETQ NC.NoDeleteImageFns (PROG ((ImageObj (IMAGEOBJFROMANNO (create ANNO)))) (replace (IMAGEOBJ IMAGEOBJFNS) of ImageObj with (create IMAGEFNS using (fetch (IMAGEOBJ IMAGEOBJFNS) of ImageObj))) (IMAGEOBJPROP ImageObj (QUOTE WHENDELETEDFN) (FUNCTION NILL)) (RETURN (fetch (IMAGEOBJ IMAGEOBJFNS) of ImageObj)))) (SETQ NC.DummyAnno (create ANNO)))) (NC.MakeMainMenu (LAMBDA (DatabaseTitle) (* NoteCards% User "21-Jun-84 23:24") (* Create the Main NoteCards menu) (PROG (X (Font (FONTCREATE (QUOTE HELVETICA) 12 (QUOTE BOLD))) (TitleFont (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))) (Position (create POSITION XCOORD ← 350 YCOORD ← 650))) (* Main Menu) (SETQ NC.MainMenuWindow (WFROMMENU (SETQ NC.MainMenu (create MENU ITEMS ←(QUOTE ((Browse/Search NIL "Make a Browser or Search card by looking through the NoteFile.") (NoteFile% Ops NIL "Brings up menu of NoteFile operations.") (Create NIL "Create a new NoteCard or FileBox.") (Show% Box NIL "Bring up one of the standard FileBoxes."))) WHENSELECTEDFN ←(FUNCTION NC.MainMenuWhenSelectedFn) CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 2 MENUCOLUMNS ← 2 MENUFONT ← Font TITLE ←(OR (AND (BOUNDP (QUOTE PSA.Database)) PSA.Database (OPENP PSA.Database) (CONCAT "NoteFile: " (LISTGET (UNPACKFILENAME (FULLNAME PSA.Database)) (QUOTE NAME)))) "No Open NoteFile") MENUPOSITION ← Position ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← Font)))) (NC.DisplayMainMenu) (SETQ X (create MENU ITEMS ←(QUOTE ((NoSource NIL "Indicates that this note card has no source.") (Done NIL "Indicates that selection is completed."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting Source(s)" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingSourcesMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((NoBox NIL "File in ToBeFiled box.") (Done NIL "Indicates that selection is completed."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting File Box(es)" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingContentsMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((New% Card NIL "Make a new note card.") (Cancel NIL "Cancel this selection."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting Note Card" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingSingleCardMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((New% Card NIL "Make a new note card.") (Done NIL "Indicates that selection is completed."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting Note Cards" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingMultipleCardsMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.") (Done NIL "Indicates that selection is completed."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting Deletions" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.DeleteSelectingMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection.") (Done NIL "Indicates that selection is completed."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting FileBox" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUCOLUMNS ← 2 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position ITEMWIDTH ←(IPLUS (STRINGWIDTH (QUOTE Close% Database) Font) 20) MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingParentsMenu X) (SETQ X (create MENU ITEMS ←(QUOTE ((Cancel NIL "Cancel this selection."))) WHENSELECTEDFN ←(FUNCTION NC.SelectionMenusWhenSelectedFn) TITLE ← "Selecting Browser Source" CENTERFLG ← T MENUBORDERSIZE ← 1 MENUOUTLINESIZE ← 1 MENUFONT ← Font ITEMHEIGHT ←(IPLUS 10 (FONTPROP Font (QUOTE HEIGHT))) MENUPOSITION ← Position MENUTITLEFONT ← TitleFont)) (SETQ NC.SelectingBrowserSourceMenu X)))) (NC.MainMenuWhenSelectedFn (LAMBDA (Item Menu Button) (* fgh: "30-May-84 14:31") (* Function called when one of the items in the top level menu is chosen.) (COND ((NULL NC.MainMenuInProgress) (RESETLST (RESETSAVE NC.MainMenuInProgress T) (RESETSAVE (SHADEITEM Item Menu GRAYSHADE) (LIST (QUOTE SHADEITEM) Item Menu WHITESHADE)) (COND ((AND (NEQ (CAR Item) (QUOTE NoteFile% Ops)) (OR (NULL PSA.Database) (NOT (OPENP PSA.Database)))) (NC.PrintMsg2 NIL T "There is no open NoteFile." (CHARACTER 13) "A NoteFile must be opened before any operations can be carried out." (CHARACTER 13) "Press NoteFile Ops to initiate the process of opening a database." (CHARACTER 13))) (T (SETQ NC.MainMenuInProgress (CAR Item)) (SELECTQ (CAR Item) (Create (COND ((EQ Button (QUOTE LEFT)) (NC.MakeNoteCard (QUOTE TEXT))) (T (NC.MakeNoteCard)))) (Show% Box (COND ((EQ Button (QUOTE LEFT)) (NC.EditNoteCard NC.RootID)) (T (NC.ChooseTopLevelCard)))) (Browse/Search (NC.ChooseBrowseOrSearch)) (NoteFile% Ops (NC.DatabaseOperations PSA.Database)) NIL))))) (T (NC.PrintMsg NIL (CHARACTER 13) NC.MainMenuInProgress " in progress. Please wait."))))) (NC.CacheTitles (LAMBDA (DatabaseStream UncacheFlg QuietFlg OperationMsg) (* NoteCards% User "12-Jun-84 01:35") (* Cache or uncache all of the titles on DatabaseSteam onto the prop lists of the NoteCard IDs) (PROG (CardTotal Title) (for CardNumber from 1 to (SETQ CardTotal (SUB1 (SUBATOM (NC.GetNewID DatabaseStream T) 3))) do (COND ((AND (NULL QuietFlg) (ZEROP (IREMAINDER CardNumber 10))) (NC.PrintMsg2 NIL T (COND (OperationMsg (CONCAT OperationMsg (CHARACTER 13))) (T "")) "Processing item number " CardNumber " out of " CardTotal "." (CHARACTER 13)))) (SETQ ID (NC.IDFromNumber CardNumber)) (COND (UncacheFlg (REMPROP ID (QUOTE NoteCardTitle))) (T (SETQ Title (NC.GetTitle ID DatabaseStream T)) (AND (NOT (FMEMB Title (QUOTE (FREE DELETED SPECIAL)))) (NC.SetTitle ID Title)))))))) (NC.CloseDatabaseFile (LAMBDA NIL (* NoteCards% User "21-Jun-84 21:59") (* Close the currently open database file.) (PROG (ID File CardTotal) (COND ((OR (NULL PSA.Database) (NOT (OPENP PSA.Database))) (NC.PrintMsg2 NIL T "There is no open NoteFile!!!" (CHARACTER 13))) ((for Window in (OPENWINDOWS) thereis (AND (SETQ ID (NC.IDFromWindow Window)) (NC.ActiveCardP ID))) (NC.PrintMsg2 NIL T "There are cards still active on the screen." (CHARACTER 13) "You must close all cards before closing the NoteFile" (CHARACTER 13))) (T (NC.PrintMsg2 NIL T "Closing ... " (CHARACTER 13)) (NC.CacheTitles PSA.Database T NIL "Closing NoteFile.") (SETQ File (FULLNAME PSA.Database)) (* * Set PSA.Database GlobalVar to NIL so that the advise to CLOSEF will not refuse to close this file.) (NC.ForceDatabaseClose PSA.Database) (replace (MENU TITLE) of NC.MainMenu with "No Open NoteFile") (replace (MENU IMAGE) of NC.MainMenu with NIL) (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE CLOSEFN) NIL) (NC.DisplayMainMenu) (SETQ PSA.Database) (NC.PrintMsg2 NIL T File " closed.")))))) (NC.CompactDatabase (LAMBDA NIL (* NoteCards% User "12-Jun-84 17:24") (* Top-level call to the database compactor.) (COND ((AND PSA.Database (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is an open NoteFile." (CHARACTER 13) "The NoteFile must be closed before any other NoteFile can be compacted." (CHARACTER 13))) (T (SETQ File (NC.DatabaseFileName "Please enter name of NoteFile to be compacted." " -- " T)) (NC.ClearMsg) (AND File (SETQ File (NC.CopyAndCompactDatabase File File NIL))) (AND File (NC.PrintMsg2 NIL T (CADR File) " compacted." (CHARACTER 13))))))) (NC.DatabaseOperations (LAMBDA NIL (* NoteCards% User " 8-Jun-84 16:50") (* Ask usere to choose which database operation. Called from main menu whenselected fn.) (PROG (Menu W Z (Font (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD)))) (SPAWN.MOUSE) (SETQ Menu (OR (AND (BOUNDP (QUOTE NC.DatabaseOperationsMenu)) (type? MENU NC.DatabaseOperationsMenu) NC.DatabaseOperationsMenu) (SETQ NC.DatabaseOperationsMenu (create MENU ITEMS ←(QUOTE ((Open% NoteFile ( NC.OpenDatabaseFile) "Opens a NoteFile.") (Close% NoteFile ( NC.CloseDatabaseFile) "Closes the currently open NoteFile.") (List% NoteFiles ( NC.ListDatabaseFiles) "Lists all of the NoteFiles stored on the local disk.") ( Create% New% NoteFile (NC.CreateDatabaseFile) "Creates a new (empty) NoteFile.") (Compact% NoteFile (NC.CompactDatabase ) "Compacts a NoteFile.") (Repair% NoteFile ( NC.ScavengeDatabaseFile NIL T) "Repairs an inconsistent NoteFile.") (Delete% NoteFile ( NC.DeleteDatabaseFile NIL) "Deletes the oldest version of a NoteFile.") ( Restore% From% Floppy (NC.FloppyArchive NIL T) "Retrieves a NoteFile that has been backed up on a floppy.") (Backup% To% Floppy (NC.FloppyArchive NIL NIL) "Makes a backup of a NoteFile on a floppy."))) CENTERFLG ← T TITLE ← "Operation?" MENUFONT ← Font ITEMHEIGHT ←(IPLUS (FONTPROP Font (QUOTE HEIGHT)) 1))))) (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of NC.MainMenu) 2)) NC.MainMenu)) (SETQ Z (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE REGION))) (replace MENUPOSITION of NC.DatabaseOperationsMenu with (CONS (IPLUS (fetch (REGION LEFT) of W) (fetch (REGION LEFT) of Z)) (IPLUS (fetch (REGION TOP) of W) (fetch (REGION BOTTOM) of Z) (IMINUS (fetch (MENU IMAGEHEIGHT) of NC.DatabaseOperationsMenu))))) (MENU NC.DatabaseOperationsMenu)))) (NC.LogoutAdvice (LAMBDA NIL (* fgh: " 7-May-84 23:57") (* Advice attached to logout to prevent logging out with an open database.) (COND ((AND (BOUNDP (QUOTE PSA.Database)) (STREAMP PSA.Database) (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is an open NoteFile: " (FULLNAME PSA.Database) (CHARACTER 13) "It must be closed before you can logout!!!" (CHARACTER 13)) (RPTQ 1 (PROGN (VIDEOCOLOR T) (DISMISS 100) (VIDEOCOLOR NIL) (DISMISS 100))) (RPTQ 3 (FLASHW PROMPTWINDOW)) (RETFROM (QUOTE LOGOUT)))))) ) (* The Notecard Database) (DEFINEQ (NC.CoerceDatabaseStream (LAMBDA (DatabaseStream FromFunction) (* NoteCards% User "15-Jun-84 20:26") (* Coerce argument from name of open file to a stream if necessary.) (COND ((STREAMP DatabaseStream) DatabaseStream) ((OPENP DatabaseStream (QUOTE BOTH)) (GETSTREAM DatabaseStream)) (T (NC.ReportError FromFunction (CONCAT DatabaseStream " not a stream or file.")))))) (NC.CreateDatabaseFile (LAMBDA (FileName NC.IndexSizeInEntries CallingOperationMsg) (* NoteCards% User "17-Jun-84 19:29") (* Create a NoteCards database on file FileName. Just creates an index NC.IndexSizeInEntries entries long, then writes out the Root and Orphan cards) (PROG (Stream) (SETQ CallingOperationMsg (COND (CallingOperationMsg (CONCAT CallingOperationMsg (CHARACTER 13))) (T ""))) (COND ((AND PSA.Database (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is already an open NoteFile -- " (FULLNAME PSA.Database) (CHARACTER 13) "It must be closed before an new one" " can be created." (CHARACTER 13)) (RETURN NIL))) (AND (NULL FileName) (NULL (SETQ FileName (NC.DatabaseFileName "What is the name of the NoteFile to be created?" " -- " T))) (RETURN NIL)) (SETQ NC.IndexSizeInEntries (OR (FIXP NC.IndexSizeInEntries) 20000)) (SETQ Stream (GETSTREAM (OPENFILE FileName (QUOTE OUTPUT)))) (NC.PrintMsg2 NIL T CallingOperationMsg "Creating NoteFile " (FULLNAME Stream) ". Please wait... ") (SETFILEPTR Stream 0) (NC.PutPtr Stream 1 2) (NC.PutPtr Stream NC.IndexSizeInEntries 2) (NC.PutPtr Stream -1 4) (for CTR from 1 to NC.IndexSizeInEntries do (AND (ZEROP (IREMAINDER CTR 1000)) (NC.PrintMsg2 NIL T CallingOperationMsg "Creating NoteFile." (CHARACTER 13) "Processing item " CTR " out of " NC.IndexSizeInEntries "." (CHARACTER 13))) (NC.PutPtr Stream -1) (NC.PutPtr Stream -1) (NC.PutStatus Stream FREE) (NC.PutStatus Stream FREE)) (NC.ForceDatabaseClose Stream) (NC.PrintMsg2 NIL T CallingOperationMsg "Creating NoteFile " (FULLNAME Stream) ". Please wait... ") (NC.InitializeSpecialCards (SETQ PSA.Database (NC.OpenDatabaseFile FileName NIL T T))) (* Reserve the first 20 index entries for special cards & future expansion) (SETFILEPTR PSA.Database 0) (NC.PutPtr PSA.Database 21 2) (NC.ForceDatabaseClose PSA.Database) (NC.SetMonitor Stream NIL) (NC.PrintMsg2 NIL NIL " Done!" (CHARACTER 13) "Note that the NoteFile must still be opened before it is used." (CHARACTER 13))))) (NC.FetchMonitor (LAMBDA (DatabaseStream FromFunction) (* fgh: "15-Feb-84 22:46") (PROG (MonitorLock) (SETQ MonitorLock (GETPROP (MKATOM DatabaseStream) (QUOTE NCDatabaseLock))) (COND ((type? MONITORLOCK MonitorLock) (RETURN MonitorLock)) (T (NC.ReportError "NC.FetchMonitor" (CONCAT "Called from " FromFunction ". No monitorlock property on database stream -- " DatabaseStream))))))) (NC.GetCachedMap (LAMBDA (DatabaseStream) (* fgh: " 2-Apr-84 16:23") (* Read a bit map from the file and then put it onto the cached maps list) (PROG (CacheSpecs BitMap) (SETQ CacheSpecs (READ DatabaseStream)) (SETQ BitMap (HREAD DatabaseStream)) (AND CacheSpecs BitMap (APPLY (FUNCTION SetCachedBitMap) (CONS BitMap CacheSpecs)))))) (NC.GetGraphSubstance (LAMBDA (DatabaseStream) (* fgh: " 9-Apr-84 22:31") (PROG (Graph Anno) (* Read the Graph) (SETQ Graph (HREAD DatabaseStream)) (* Then read the annotations) (for GraphNode in (fetch (GRAPH GRAPHNODES) of Graph) do (AND (LITATOM (fetch (GRAPHNODE NODEID) of GraphNode)) (PUTPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation) (HREAD DatabaseStream)))) (for GraphNode in (fetch (GRAPH GRAPHNODES) of Graph) do (AND (LITATOM (fetch (GRAPHNODE NODEID) of GraphNode)) (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation))) (replace (GRAPHNODE NODELABEL) of GraphNode with (NC.BitMapFromImageObject (IMAGEOBJCREATE Anno (IMAGEFNSCREATE (NC.FetchAnnoDisplayFn Anno) (NC.FetchAnnoImageBoxFn Anno))))))) (RETURN Graph)))) (NC.GetIdentifier (LAMBDA (DatabaseStream Identifier) (* fgh: "20-Apr-84 15:18") (* Return T if next item on databaseStream is the identifier specified by Identifier) (COND ((EQ (READ DatabaseStream) Identifier) T) (T NIL)))) (NC.GetLinks (LAMBDA (ID DatabaseStream) (* fgh: "31-May-84 23:53") (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetNoteCard") (PROG (Index Ptr LinksPtr Status ActualID FromLinks ToLinks GlobalLinks Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetLinks")) (SETQ Index (NC.IndexFromID ID "NC.GetLinks")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (SETQ LinksPtr (NC.GetPtr Stream)) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (RETURN Status)) (T (* Get Links) (SETFILEPTR Stream LinksPtr) (COND ((NOT (NC.GetIdentifier Stream NC.LinksIdentifier)) (NC.ReportError "NC.GetLinks" (CONCAT ID " Error in Database file -- incorrect links identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetLinks" (CONCAT "ID mismatch while reading links. Expected ID: " ID " Found ID: " ActualID)))) (SETQ ToLinks (READ Stream)) (SETQ FromLinks (READ Stream)) (SETQ GlobalLinks (LISTP (READ Stream))) (* Setup ID with appropriate properties for retrieved card) (NC.SetToLinks ID ToLinks) (NC.SetFromLinks ID FromLinks) (NC.SetGlobalLinks ID GlobalLinks) (RETURN ID))))))) (NC.GetLinkLabels (LAMBDA (DatabaseStream) (* fgh: "20-Apr-84 16:19") (* Get the set of link labels from DatabaseStream. Link label list is stored in normal way indexed by ID NC.LinkLabelsID) (PROG (Index) (RETURN (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (SETQ Index (NC.IndexFromID NC.LinkLabelsID "NC.GetLinkLabels")) (SETFILEPTR DatabaseStream Index) (SETQ Index (NC.GetPtr DatabaseStream)) (SETFILEPTR DatabaseStream Index) (COND ((NOT (NC.GetIdentifier DatabaseStream NC.LinkLabelsIdentifier)) (NC.ReportError "NC.GetLinkLabels" (CONCAT ID " Error in Database file -- incorrect identifier.")))) (SETQ ActualID (READ DatabaseStream)) (COND ((NEQ ActualID NC.LinkLabelsID) (NC.ReportError "NC.GetLinkLabels" (CONCAT "ID mismatch while reading links. Expected ID: " NC.LinkLabelsID " Found ID: " ActualID)))) (READ DatabaseStream)))))) (NC.GetNewID (LAMBDA (DatabaseStream DontUpdateFlg) (* fgh: "15-Feb-84 20:31") (WITH.MONITOR (GETPROP (MKATOM DatabaseStream) (QUOTE NCDatabaseLock)) (PROG (NextID (Stream (COND ((STREAMP DatabaseStream) DatabaseStream) ((AND DatabaseStream (OPENP DatabaseStream (QUOTE BOTH))) (GETSTREAM DatabaseStream)) (T (NC.ReportError "NC.GetNextID" (CONCAT DatabaseStream " not a stream or file."))))) ) (SETFILEPTR Stream 0) (SETQ NextID (NC.GetPtr Stream 2)) (COND ((NULL DontUpdateFlg) (SETFILEPTR Stream 0) (NC.PutPtr Stream (ADD1 NextID) 2))) (RETURN (MKATOM (CONCAT "NC" (RPLSTRING (CONCAT "00000") (IMINUS (NCHARS NextID)) NextID)))))))) (NC.GetNoteCard (LAMBDA (ID DatabaseStream IncludeDeletedCardsFlg) (* fgh: " 1-May-84 22:57") (* Get a note card from the database. If IncludeDeletedCardsFlg is NIL, then return immediately if card is deleted or free. Otherwise, get dekleted but not free cards.) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetNoteCard") (PROG (Index Ptr LinksPtr Status ActualID NoteCardType Title Substance Scale RegionViewed PropList FromLinks ToLinks Region GlobalLinks Stream) (* IncludeDeletedCardsFlg -- Include delete not yet implemented) (SETQ IncludeDeletedCardsFlg) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetNoteCard")) (SETQ Index (NC.IndexFromID ID "NC.GetNoteCard")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (SETQ LinksPtr (NC.GetPtr Stream)) (SETQ Status (NC.GetStatus Stream)) (COND ((AND (NEQ Status (QUOTE ACTIVE)) (OR (NOT IncludeDeletedCardsFlg) (NEQ Status (QUOTE DELETED)))) (RETURN Status)) ((OR (IGREATERP Ptr (GETEOFPTR DatabaseStream)) (IGREATERP LinksPtr (GETEOFPTR DatabaseStream)) (MINUSP Ptr) (MINUSP LinksPtr)) (RETURN (QUOTE IndexEntry))) (T (* Get Substance) (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.GetNoteCard" (CONCAT ID " Error in Database file -- incorrect item identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetNoteCard" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID) ))) (SETQ NoteCardType (READ Stream)) (SETQ Title (READ Stream)) (SETQ PropList (READ Stream)) (READC Stream) (SETQ Region (NC.GetRegion ID Stream)) (SETQ Substance (SELECTQ NoteCardType ((TEXT CONTENTS CONTEXT) (NC.GetTextSubstance Stream ID Region)) ((SKETCH MAP) (PROG ((Value (NC.GetSketchSubstance Stream))) (SETQ Scale (CADR Value)) (SETQ RegionViewed (CADDR Value)) (RETURN (CAR Value)))) ((GRAPH BROWSER) (NC.GetGraphSubstance Stream)) (NC.ReportError "NC.GetNoteCard" (CONCAT NoteCardType " Unknown Note Card Type")))) (* Get Links) (SETFILEPTR Stream LinksPtr) (COND ((NOT (NC.GetIdentifier Stream NC.LinksIdentifier)) (NC.ReportError "NC.GetNoteCard" (CONCAT ID " Error in Database file -- incorrect links identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetNoteCard" (CONCAT "ID mismatch while reading links. Expected ID: " ID " Found ID: " ActualID) ))) (SETQ ToLinks (READ Stream)) (SETQ FromLinks (READ Stream)) (SETQ GlobalLinks (LISTP (READ Stream))) (* Setup ID with appropriate properties for retrieved card) (NC.SetType ID NoteCardType) (NC.SetRegion ID Region) (NC.SetTitle ID Title) (NC.SetSubstance ID Substance) (COND ((FMEMB NoteCardType (QUOTE (SKETCH MAP))) (NC.SetScale ID Scale) (NC.SetRegionViewed ID RegionViewed))) (NC.SetGlobalLinks ID GlobalLinks) (NC.SetPropList ID PropList) (NC.SetToLinks ID ToLinks) (NC.SetLinksDirtyFlg ID) (NC.SetFromLinks ID FromLinks) (NC.SetLinksDirtyFlg ID) (NC.ActivateCard ID) (RETURN ID))))))) (NC.GetPropList (LAMBDA (ID DatabaseStream) (* fgh: "20-Apr-84 15:23") (* Retrieve the prop list for card specified by ID from the database specified by DatabaseStream) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetTitle") (PROG (Index Ptr Status ActualID NoteCardType Title PropList Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetTitle")) (SETQ Index (NC.IndexFromID ID "NC.GetTitle")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (NC.GetPtr Stream) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (RETURN Status)) (T (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.GetTitle" (CONCAT ID " Error in Database file -- incorrect item identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetTitle" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID)))) (SETQ NoteCardType (READ Stream)) (SETQ Title (READ Stream)) (SETQ PropList (READ Stream)) (RETURN PropList))))))) (NC.GetRegion (LAMBDA (ID DatabaseStream) (* fgh: "15-Feb-84 18:16") (CREATEREGION (NC.GetPtr DatabaseStream 2) (NC.GetPtr DatabaseStream 2) (NC.GetPtr DatabaseStream 2) (NC.GetPtr DatabaseStream 2)))) (NC.GetSketchSubstance (LAMBDA (DatabaseStream) (* fgh: "30-Apr-84 16:48") (* Get sketch substance from Database stream. Database stream is positioned. READ the global sketch description, the locasl sketch scale and region viewed. Also read in any cached bit maps for the MAPS system.) (PROG (Sketch Scale RegionViewed) (SETQ Sketch (HREAD DatabaseStream)) (SETQ Scale (READ DatabaseStream)) (SETQ RegionViewed (READ DatabaseStream)) (while (EQ (READ DatabaseStream) (QUOTE ###CACHEDMAP###)) do (NC.GetCachedMap DatabaseStream)) (RETURN (LIST Sketch Scale RegionViewed))))) (NC.GetTextSubstance (LAMBDA (DatabaseStream ID Region) (* fgh: " 9-Apr-84 23:08") (* Get a text stream from the database file) (PROG (StartPtr EndPtr) (SETQ StartPtr (NC.GetPtr DatabaseStream)) (SETQ EndPtr (NC.GetPtr DatabaseStream)) (RETURN (OPENTEXTSTREAM DatabaseStream NIL StartPtr EndPtr (LIST (QUOTE FONT) PSA.TimesRoman10)))))) (NC.GetTitle (LAMBDA (ID DatabaseStream NoReportFlg) (* fgh: "23-Apr-84 23:33") (* Retrieve the title for card specified by ID from the database specified by DatabaseStream) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetTitle") (PROG (Index Ptr Status ActualID NoteCardType Title Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetTitle")) (SETQ Index (NC.IndexFromID ID "NC.GetTitle")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (NC.GetPtr Stream) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (RETURN Status)) (T (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (COND (NoReportFlg (RETURN)) (T (NC.ReportError "NC.GetTitle" (CONCAT ID " Error in Database file -- incorrect item identifier."))))) ) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (COND (NoReportFlg (RETURN)) (T (NC.ReportError "NC.GetTitle" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID)))))) (SETQ NoteCardType (READ Stream)) (SETQ Title (READ Stream)) (RETURN Title))))))) (NC.GetType (LAMBDA (ID DatabaseStream) (* fgh: "20-Apr-84 15:22") (* Retrieve the NoteCardType of card specified by ID from the database specified by DatabaseStream) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetType") (PROG (Index Ptr Status ActualID NoteCardType Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetType")) (SETQ Index (NC.IndexFromID ID "NC.GetType")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (NC.GetPtr Stream) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (RETURN Status)) (T (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.GetType" (CONCAT ID " Error in Database file -- incorrect item identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetType" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID)))) (SETQ NoteCardType (READ Stream)) (RETURN NoteCardType))))))) (NC.IndexFromID (LAMBDA (ID FromFunction) (* fgh: "15-Feb-84 23:31") (LSH (COND ((NC.IDP ID) (SUBATOM ID 3)) (T (NC.ReportError FromFunction (CONCAT ID ": Invalid ID")))) 3))) (NC.InitializeSpecialCards (LAMBDA (DatabaseStream) (* NoteCards% User " 6-Jun-84 14:19") (* Create and put the initial versions of Root, Orphan, and Unclassified cards onto database specified by DatabaseStream. Also initialize the List of link labels) (PROG ((Root (NC.GetNewID DatabaseStream)) (Orphan (NC.GetNewID DatabaseStream)) (Unclassified (NC.GetNewID DatabaseStream)) (LinkLabels (NC.GetNewID DatabaseStream))) (* Root card) (SET Root (NC.MakeContentsCard Root "Table of Contents" T)) (NC.SetType Root (QUOTE CONTENTS)) (NC.SetTitle Root "Table of Contents") (NC.SetPropList Root NIL) (NC.PutNoteCard Root DatabaseStream) (NC.PutLinks Root DatabaseStream) (NC.DeactivateCard Root) (* Orphan card) (SET Orphan (NC.MakeContentsCard Orphan "Orphans" T T)) (NC.SetType Orphan (QUOTE CONTENTS)) (NC.SetTitle Orphan "Orphans") (NC.SetPropList Orphan NIL) (NC.PutNoteCard Orphan DatabaseStream) (NC.PutLinks Orphan DatabaseStream) (NC.DeactivateCard Orphan) (* Unclassified Card) (SET Unclassified (NC.MakeContentsCard Unclassified "To Be Filed" T T)) (NC.SetType Unclassified (QUOTE CONTENTS)) (NC.SetTitle Unclassified "To Be Filed") (NC.SetPropList Unclassified NIL) (NC.PutNoteCard Unclassified DatabaseStream) (NC.PutLinks Unclassified DatabaseStream) (NC.DeactivateCard Unclassified) (* Link Labels) (NC.PutLinkLabels DatabaseStream NC.InitialLinkLabels) (RETURN DatabaseStream)))) (NC.MarkCardDeleted (LAMBDA (ID DatabaseStream) (* fgh: "20-Apr-84 15:24") (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetNoteCard") (PROG (Index Ptr LinksPtr Status ActualID Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetNoteCard")) (SETQ Index (NC.IndexFromID ID "NC.GetNoteCard")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (SETQ LinksPtr (NC.GetPtr Stream)) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (RETURN Status)) (T (* Get Substance) (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.GetNoteCard" (CONCAT ID " Error in Database file -- incorrect item identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetNoteCard" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID) ))) (SETFILEPTR Stream Ptr) (NC.PutDeletedIdentifier Stream) (SETFILEPTR Stream Index) (NC.GetPtr Stream) (NC.GetPtr Stream) (NC.PutStatus Stream DELETED) (RETURN ID))))))) (NC.MarkIndexEntryFree (LAMBDA (ID DatabaseStream) (* fgh: "28-Mar-84 22:09") (PROG (Index) (SETQ Index (NC.IndexFromID ID)) (SETFILEPTR DatabaseStream Index) (NC.PutPtr DatabaseStream -1) (NC.PutPtr DatabaseStream -1) (NC.PutStatus DatabaseStream FREE) (NC.PutStatus DatabaseStream FREE)))) (NC.OpenDatabaseFile (LAMBDA (FileName Access NoSetFlg QuietFlg) (* NoteCards% User "12-Jun-84 17:21") (* Open an already existing database file.) (PROG (Name Stream ID CardTotal) (COND ((AND PSA.Database (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is already an open NoteFile -- " (FULLNAME PSA.Database) (CHARACTER 13) "It must be closed before an new one" " can be opened." (CHARACTER 13)) (RETURN NIL))) (AND (NULL FileName) (NULL (SETQ FileName (NC.DatabaseFileName "What is the name of the NoteFile to open?" " -- " T))) (RETURN NIL)) (COND ((OPENP FileName) (NC.PrintMsg2 NIL T FileName " is an already open file." (CHARACTER 13)) (RETURN))) (COND ((SETQ Name (INFILEP FileName)) (AND (NULL QuietFlg) (NC.PrintMsg2 NIL T "Opening ... " (CHARACTER 13))) (SETQ Stream (GETSTREAM (OPENFILE Name (OR Access (QUOTE BOTH)) (QUOTE OLD)))) (NC.SetMonitor Stream (CREATE.MONITORLOCK (MKATOM (CONCAT Name ":LOCK")))) (SETFILEPTR Stream 0) (NC.GetPtr Stream 2) (SETTOPVAL (QUOTE NC.IndexSizeInEntries) (NC.GetPtr Stream 2)) Stream) (T (NC.PrintMsg2 NIL T "Unable to find NoteFile " FileName "." (CHARACTER 13) "The NoteFile must be created before opening.") (RETURN NIL))) (COND ((NULL NoSetFlg) (SETQ PSA.Database Stream) (* Cache all of the titles in this database) (NC.CacheTitles PSA.Database NIL QuietFlg "Opening NoteFile.") (replace (MENU TITLE) of NC.MainMenu with (CONCAT "NoteFile: " (LISTGET (UNPACKFILENAME (FULLNAME Stream)) (QUOTE NAME)))) (replace (MENU IMAGE) of NC.MainMenu with NIL) (NC.DisplayMainMenu))) (AND (NULL QuietFlg) (NC.PrintMsg2 NIL T "Opened " (FULLNAME Stream) (CHARACTER 13))) (RETURN Stream)))) (NC.PutCachedMap (LAMBDA (MapScreenElt DatabaseStream) (* fgh: " 2-Apr-84 12:52") (* Put a cached bit map corresponding to MapScreenElt onto database file) (PROG (CacheSpecs BitMap) (AND (LISTP (SETQ CacheSpecs (fetch (LOCALMAP MAPLOCALCACHESPECS) of (fetch (SCREENELT LOCALPART) of MapScreenElt)))) (FOR CacheSpec in CacheSpecs do (BITMAPP (SETQ BitMap (APPLY (FUNCTION FetchCachedBitMap) CacheSpec))) (PRINT (QUOTE ###CACHEDMAP###) DatabaseStream) (PRINT CacheSpec DatabaseStream) (HPRINT BitMap DatabaseStream T T)))))) (NC.PutDeletedIdentifier (LAMBDA (DatabaseStream) (* fgh: "26-Feb-84 01:44") (PRINT (QUOTE ##DELETE##) DatabaseStream))) (NC.PutGraphSubstance (LAMBDA (Graph DatabaseStream) (* NoteCards% User " 6-Jun-84 18:58") (* Put Graph) (PROG (Anno) (* Clean up BITMAPS in Graph data structure) (for GraphNode in (fetch GRAPHNODES of Graph) do (replace (GRAPHNODE NODELABELBITMAP) of GraphNode with NIL) (AND (LITATOM (fetch (GRAPHNODE NODEID) of GraphNode)) (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation))) (replace (GRAPHNODE NODELABEL) of GraphNode with (LIST (QUOTE NOTECARDLINK) (fetch (NOTECARDLINK DESTINATIONID) of Anno))))) (* Write data stucture) (HPRINT Graph DatabaseStream) (* Write Annotations) (for GraphNode in (fetch GRAPHNODES of Graph) when (LITATOM (fetch (GRAPHNODE NODEID) of GraphNode)) do (HPRINT (GETPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation)) DatabaseStream T T))))) (NC.PutIdentifier (LAMBDA (DatabaseStream Identifier) (* fgh: "20-Apr-84 16:11") (* Put Identifier on DatabaseStream) (PRINT Identifier DatabaseStream))) (NC.PutLinks (LAMBDA (ID DatabaseStream) (* NoteCards% User "15-Jun-84 20:34") (* * Put the link data for ID onto the database file.) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.PutLinks") (PROG (DataPtr Index (Stream (NC.CoerceDatabaseStream DatabaseStream "NC.PutLinks")) ) (SETQ Index (NC.IndexFromID ID "NC.PutLinks")) (* * Check to make sure this is an active note card.) (SETFILEPTR Stream Index) (NC.GetPtr Stream) (NC.GetPtr Stream) (COND ((NOT (EQ (NC.GetStatus Stream) (QUOTE ACTIVE))) (NC.ReportError "NC.PutLinks" (CONCAT ID " is not an active note card."))) ) (* * Write the links data at the end of the database file.) (SETFILEPTR Stream (SETQ DataPtr (GETEOFPTR Stream))) (NC.PutIdentifier Stream NC.LinksIdentifier) (PRINT ID Stream) (PRINT (NC.FetchToLinks ID) Stream) (PRINT (NC.FetchFromLinks ID) Stream) (PRINT (NC.FetchGlobalLinks ID) Stream) (NC.SetLinksDirtyFlg ID) (* * Now update the index to point to the link data just written. Done last in case writing of links doesn't complete okay.) (SETFILEPTR Stream Index) (NC.GetPtr Stream) (NC.PutPtr Stream DataPtr) (RETURN ID))))) (NC.PutLinkLabels (LAMBDA (DatabaseStream LinkLabels) (* fgh: " 1-May-84 22:59") (* Put onto DatabaseStream the list of LinkLabel. Do so by writing at eof and then updating the index entry for ID NC.LinkLabelID) (PROG (Ptr) (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (SETQ Ptr (GETEOFPTR DatabaseStream)) (SETFILEPTR DatabaseStream Ptr) (NC.PutIdentifier DatabaseStream NC.LinkLabelsIdentifier) (PRINT NC.LinkLabelsID DatabaseStream) (PRINT LinkLabels DatabaseStream) (SETFILEPTR DatabaseStream (NC.IndexFromID NC.LinkLabelsID)) (NC.PutPtr DatabaseStream Ptr) (NC.PutPtr DatabaseStream -1) (NC.PutStatus DatabaseStream SPECIAL))))) (NC.PutNoteCard (LAMBDA (ID DatabaseStream UpdateUpdateListFlg) (* NoteCards% User "15-Jun-84 20:25") (* Write note card specified by ID to the database specified by Database stream) (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.PutNoteCard") (PROG (DataPtr Index Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.PutNoteCard")) (AND UpdateUpdateListFlg (NC.UpdateUpdateList ID)) (* * First write out the attached stuff of the card i.e., title, prop list, etc.) (SETFILEPTR Stream (SETQ DataPtr (GETEOFPTR Stream))) (NC.PutIdentifier Stream NC.ItemIdentifier) (PRINT ID Stream) (PRINT (NC.FetchType ID) Stream) (PRINT (NC.FetchTitle ID) Stream) (PRINT (NC.FetchPropList ID) Stream) (NC.PutRegion ID Stream) (* * Write out the substance of the card.) (SELECTQ (NC.FetchType ID) ((TEXT CONTENTS CONTEXT) (NC.PutTextSubstance (NC.FetchSubstance ID) Stream)) ((SKETCH MAP) (NC.PutSketchSubstance ID Stream)) ((GRAPH BROWSER) (NC.PutGraphSubstance (NC.FetchSubstance ID) Stream)) (NC.ReportError "NC.PutNoteCard" (CONCAT (NC.FetchType ID) " Unknown Note Card Type")) ) (* * Now update the Index to reflect the new data just written. Done last in case the substance putting bombed for some reason.) (SETQ Index (NC.IndexFromID ID "NC.PutNoteCard")) (SETFILEPTR Stream Index) (NC.PutPtr Stream DataPtr) (NC.GetPtr Stream) (NC.PutStatus Stream ACTIVE) (RETURN ID))))) (NC.PutRegion (LAMBDA (ID DatabaseStream) (* fgh: "26-Feb-84 19:22") (PROG (Region) (COND ((AND (SETQ Region (NC.FetchWindow ID)) (SETQ Region (WINDOWPROP Region (QUOTE REGION))))) ((SETQ Region (NC.FetchRegion ID))) (T (SETQ Region (CREATEREGION 0 0 100 100)))) (NC.PutPtr DatabaseStream (fetch LEFT of Region) 2) (NC.PutPtr DatabaseStream (fetch BOTTOM of Region) 2) (NC.PutPtr DatabaseStream (fetch WIDTH of Region) 2) (NC.PutPtr DatabaseStream (fetch HEIGHT of Region) 2)))) (NC.PutSketchSubstance (LAMBDA (ID DatabaseStream) (* fgh: "30-Apr-84 16:49") (* Put the sketch substance for card ID to the database. Store the global sketch descriptor, the scale and region viewed for ID and any cached bit maps.) (PROG ((Substance (NC.FetchSubstance ID)) (Window (NC.FetchWindow ID)) SketchSpecs) (HPRINT Substance DatabaseStream T T) (PRINT (AND Window (SCALE.FROM.SKW Window)) DatabaseStream) (PRINT (AND Window (SK.REGION.VIEWED Window)) DatabaseStream) (COND ((AND Window (SETQ SketchSpecs (LOCALSPECS.FROM.VIEWER Window))) (MAPSKETCHSPECS SketchSpecs (FUNCTION NC.PutCachedMap) DatabaseStream))) (PRINT "###ENDSKETCH###" DatabaseStream)))) (NC.PutTextSubstance (LAMBDA (Substance DatabaseStream) (* fgh: " 3-May-84 18:17") (* Put text substance on the database file) (PROG (EndPtrLoc EndPtr StartPtr TempStream TempFile) (SETQ StartPtr (IPLUS (GETFILEPTR DatabaseStream) 6)) (NC.PutPtr DatabaseStream StartPtr) (SETQ EndPtrLoc (GETFILEPTR DatabaseStream)) (NC.PutPtr DatabaseStream 0) (* Put textstream to temp file) (SETQ TempStream (GETSTREAM (SETQ TempFile (OPENFILE (PACK* (QUOTE {CORE}NC) (GENSYM)) (QUOTE OUTPUT))))) (AND (ZEROP (fetch (TEXTOBJ TEXTLEN) of (TEXTOBJ Substance))) (TEDIT.INSERT Substance " " 1)) (TEDIT.PUT.PCTB (TEXTOBJ Substance) TempStream) (SETFILEPTR DatabaseStream StartPtr) (* Copy temp file to database file fixing up pointers on the way) (SETQ TempStream (GETSTREAM (OPENFILE (CLOSEF TempFile) (QUOTE INPUT)))) (COND ((IGREATERP (GETEOFPTR TempStream) 2) (SETFILEPTR TempStream (IDIFFERENCE (GETEOFPTR TempStream) 2)) (COND ((FMEMB (\WIN TempStream) (QUOTE (31415 31416))) (COPYBYTES TempStream DatabaseStream 0 (IDIFFERENCE (GETEOFPTR TempStream) 8)) (\DWOUT DatabaseStream (IPLUS (\DWIN TempStream) StartPtr)) (RPTQ 2 (\WOUT DatabaseStream (\WIN TempStream)))) (T (SETFILEPTR TempStream 0) (COPYBYTES TempStream DatabaseStream)))) (T (SETFILEPTR TempStream 0) (COPYBYTES TempStream DatabaseStream))) (SETQ EndPtr (GETFILEPTR DatabaseStream)) (SETFILEPTR DatabaseStream EndPtrLoc) (NC.PutPtr DatabaseStream EndPtr) (DELFILE (CLOSEF TempFile)) (* Fix up PCTB of Substance in case want to go on editing.) (TEDIT.MAPPIECES (TEXTOBJ Substance) (FUNCTION (LAMBDA (CH# PC PC# OBL) (COND ((EQ (FULLNAME (fetch (PIECE PFILE) of PC)) (FULLNAME TempStream)) (replace (PIECE PFILE) of PC with DatabaseStream) (replace (PIECE PFPOS) of PC with (IPLUS StartPtr (fetch (PIECE PFPOS) of PC))))))))))) (NC.SetMonitor (LAMBDA (DatabaseStream MonitorLock) (* fgh: "15-Feb-84 22:48") (PUTPROP (MKATOM DatabaseStream) (QUOTE NCDatabaseLock) MonitorLock))) (NC.UpdateRegionData (LAMBDA (ID DatabaseStream) (* fgh: "20-Apr-84 15:25") (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.UpdateRegionData") (PROG (Index Ptr Status ActualID NoteCardType Title PropList Region Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.UpdateRegionData")) (SETQ Index (NC.IndexFromID ID "NC.UpdateRegionData")) (SETFILEPTR Stream Index) (SETQ Ptr (NC.GetPtr Stream)) (NC.GetPtr Stream) (SETQ Status (NC.GetStatus Stream)) (COND ((NEQ Status (QUOTE ACTIVE)) (NC.ReportError "NC.UpdateRegionData" (CONCAT ID " not an active note card on " (FULLNAME DatabaseStream)))) (T (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.UpdateRegionData" (CONCAT ID "Error in database file -- incorrect item identifier")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.UpdateRegionData" (CONCAT "ID mismatch: Expected ID: " ID " Found ID: " ActualID)))) (SETQ NoteCardType (READ Stream)) (SETQ Title (READ Stream)) (SETQ PropList (READ Stream)) (READC Stream) (NC.PutRegion ID Stream) (RETURN ID))))))) ) (DECLARE: EVAL@COMPILE (PUTPROPS NC.PutPtr MACRO (X (CONS (QUOTE PROGN) (for I from (COND ((CADDR X) (SUB1 (CADDR X))) (T 2)) to 0 by -1 collect (LIST (QUOTE BOUT) (CAR X) (LIST (QUOTE LOGAND) 255 (COND ((ZEROP I) (CADR X)) (T (LIST (QUOTE RSH) (CADR X) (ITIMES 8 I)))))))))) (PUTPROPS NC.PutStatus MACRO (X (LIST (QUOTE BOUT) (CAR X) (SELECTQ (CADR X) ((A ACTIVE) (CONSTANT (CHARCODE A))) ((D DELETED) (CONSTANT (CHARCODE D))) ((F FREE) (CONSTANT (CHARCODE F))) ((S SPECIAL) (CONSTANT (CHARCODE S))) (NILL))))) (PUTPROPS NC.GetPtr MACRO (X (CONS (QUOTE IPLUS) (for I from (COND ((CADR X) (SUB1 (CADR X))) (T 2)) to 0 by -1 collect (COND ((ZEROP I) (LIST (QUOTE BIN) (CAR X))) (T (LIST (QUOTE LLSH) (LIST (QUOTE BIN) (CAR X)) (ITIMES 8 I)))))))) (PUTPROPS NC.GetStatus MACRO (X (LIST (QUOTE SELCHARQ) (LIST (QUOTE BIN) (CAR X)) (QUOTE (A (QUOTE ACTIVE))) (QUOTE (F (QUOTE FREE))) (QUOTE (D (QUOTE DELETED))) (QUOTE (S (QUOTE SPECIAL))) (QUOTE NIL)))) ) (* Manipulate Note Card Representations) (DEFINEQ (NC.ActivateCard (LAMBDA (ID) (* fgh: "15-Feb-84 00:33") (PUTPROP ID (QUOTE NoteCardActive) T))) (NC.ActiveCardP (LAMBDA (ID) (* fgh: "15-Feb-84 00:35") (AND (GETPROP ID (QUOTE NoteCardActive)) (GETPROP ID (QUOTE NoteCardType))))) (NC.DeactivateCard (LAMBDA (ID DeleteTitleFlg) (* NoteCards% User " 6-Jun-84 15:52") (PROG (Window TextStream) (COND ((FMEMB (NC.FetchType ID) (QUOTE (CONTENTS TEXT))) (AND (TEXTSTREAMP (SETQ TextStream (NC.FetchSubstance ID))) (SETQ Window (WINDOW.FROM.TEDIT.THING TextStream)) (NC.AnnotatedWindowCloseFn Window)))) (REMPROP ID (QUOTE NoteCardType)) (REMPROP ID (QUOTE NoteCardRegion)) (REMPROP ID (QUOTE NoteCardActive)) (REMPROP ID (QUOTE NoteCardFromLinks)) (REMPROP ID (QUOTE NoteCardToLinks)) (REMPROP ID (QUOTE NoteCardPropList)) (REMPROP ID (QUOTE NoteCardGlobalLinks)) (REMPROP ID (QUOTE NoteCardLinksDirty)) (REMPROP ID (QUOTE SKETCH)) (REMPROP ID (QUOTE NoteCardSketchScale)) (REMPROP ID (QUOTE NoteCardRegionViewed)) (REMPROP ID (QUOTE NoteCardNewCard)) (AND DeleteTitleFlg (REMPROP ID (QUOTE NoteCardTitle))) (SET ID)))) (NC.DirtySketchP (LAMBDA (ID) (* fgh: "15-Feb-84 01:23") (PROG (Temp) (RETURN (AND (SETQ Temp (FASSOC (QUOTE PROPS) (FILEPKGCHANGES))) (EQ (CADR (FASSOC ID Temp)) (QUOTE SKETCH))))))) (NC.FetchFromLinks (LAMBDA (ID) (* fgh: "16-Feb-84 00:14") (GETPROP ID (QUOTE NoteCardFromLinks)))) (NC.FetchGlobalLinks (LAMBDA (ID) (* fgh: "23-Apr-84 19:45") (GETPROP ID (QUOTE NoteCardGlobalLinks)))) (NC.FetchLinksDirtyFlg (LAMBDA (ID) (* fgh: "23-Apr-84 19:59") (GETPROP ID (QUOTE NoteCardLinksDirty)))) (NC.FetchPropList (LAMBDA (ID) (* fgh: "15-Feb-84 23:57") (GETPROP ID (QUOTE NoteCardPropList)))) (NC.FetchRegion (LAMBDA (ID) (* fgh: "15-Feb-84 18:19") (GETPROP ID (QUOTE NoteCardRegion)))) (NC.FetchRegionViewed (LAMBDA (ID) (* fgh: "28-Apr-84 19:45") (GETPROP ID (QUOTE NoteCardRegionViewed)))) (NC.FetchScale (LAMBDA (ID) (* fgh: "28-Apr-84 19:46") (GETPROP ID (QUOTE NoteCardSketchScale)))) (NC.FetchSubstance (LAMBDA (ID) (* fgh: "28-Apr-84 19:15") (PROG (NoteCardType) (SETQ NoteCardType (NC.FetchType ID)) (RETURN (SELECTQ NoteCardType ((TEXT CONTENTS CONTEXT) (EVAL ID)) ((SKETCH MAP) (GETPROP ID (QUOTE SKETCH))) ((GRAPH BROWSER) (EVAL ID)) NIL))))) (NC.FetchTitle (LAMBDA (ID) (* fgh: "14-Feb-84 21:55") (GETPROP ID (QUOTE NoteCardTitle)))) (NC.FetchToLinks (LAMBDA (ID) (* fgh: "16-Feb-84 00:14") (GETPROP ID (QUOTE NoteCardToLinks)))) (NC.FetchType (LAMBDA (ID) (* fgh: "13-Feb-84 21:13") (GETPROP ID (QUOTE NoteCardType)))) (NC.FetchWindow (LAMBDA (ID) (* NoteCards% User "26-Jun-84 02:16") (* * Given an ID of a card, return the open window containing that card.) (PROG ((NoteCardType (NC.FetchType ID))) (RETURN (COND ((NC.ActiveCardP ID) (SELECTQ NoteCardType ((TEXT CONTENTS) (fetch \WINDOW of (TEXTOBJ (NC.FetchSubstance ID)))) ((SKETCH MAP) (for W in (OPENWINDOWS) thereis (COND ((OR (EQ ID (WINDOWPROP W (QUOTE SKETCH))) (EQ ID (WINDOWPROP (WINDOWPROP W (QUOTE ICONFOR)) (QUOTE SKETCH)))) W) (T NIL)))) ((GRAPH BROWSER) (for W in (OPENWINDOWS) thereis (COND ((OR (EQ (NC.FetchSubstance ID) (WINDOWPROP W (QUOTE GRAPH))) (EQ (NC.FetchSubstance ID) (WINDOWPROP (WINDOWPROP W (QUOTE ICONFOR)) (QUOTE GRAPH)))) W) (T NIL)))) NIL)) (T NIL)))))) (NC.IDP (LAMBDA (ID) (* fgh: "13-Feb-84 21:11") (AND (EQ (NCHARS ID) 7) (EQ (SUBATOM ID 1 2) (QUOTE NC)) (FIXP (SUBATOM ID 3)) (ILESSP (SUBATOM ID 3) NC.IndexSizeInEntries)))) (NC.MarkCardDirty (LAMBDA (ID) (* fgh: "29-Mar-84 22:48") (* Mark card specified by ID as being DIRTY and needing to be writtent to the database) (COND ((FMEMB (NC.FetchType ID) (QUOTE (TEXT CONTENTS))) (replace (TEXTOBJ \DIRTY) of (TEXTOBJ (NC.FetchSubstance ID)) with T)) ((FMEMB (NC.FetchType ID) (QUOTE (SKETCH MAP))) (MARKASCHANGED (LIST ID (QUOTE SKETCH)) (QUOTE PROPS)))))) (NC.SetFromLinks (LAMBDA (ID Links) (* fgh: "16-Feb-84 00:13") (PUTPROP ID (QUOTE NoteCardFromLinks) Links))) (NC.SetGlobalLinks (LAMBDA (ID GlobalLinks) (* fgh: "23-Apr-84 19:44") (PUTPROP ID (QUOTE NoteCardGlobalLinks) GlobalLinks))) (NC.SetInitialPropList (LAMBDA (ID DatabaseStream) (* fgh: "27-Mar-84 00:45") (NC.SetPropList ID (NCONC (LIST (QUOTE Sources) NIL) (NC.FetchPropList ID))))) (NC.SetLinksDirtyFlg (LAMBDA (ID Value) (* fgh: "23-Apr-84 19:52") (PUTPROP ID (QUOTE NoteCardLinksDirty) Value))) (NC.SetPropList (LAMBDA (ID PropList) (* fgh: "16-Feb-84 00:02") (PUTPROP ID (QUOTE NoteCardPropList) PropList))) (NC.SetRegion (LAMBDA (ID Region) (* fgh: "15-Feb-84 18:19") (PUTPROP ID (QUOTE NoteCardRegion) Region))) (NC.SetRegionViewed (LAMBDA (ID RegionValue) (* fgh: "28-Apr-84 19:44") (PUTPROP ID (QUOTE NoteCardRegionViewed) RegionValue))) (NC.SetScale (LAMBDA (ID ScaleValue) (* fgh: "28-Apr-84 19:46") (PUTPROP ID (QUOTE NoteCardSketchScale) ScaleValue))) (NC.SetSubstance (LAMBDA (ID Substance) (* fgh: "28-Apr-84 19:15") (PROG (NoteCardType) (SETQ NoteCardType (NC.FetchType ID)) (RETURN (SELECTQ NoteCardType ((TEXT CONTENTS CONTEXT) (SET ID Substance)) ((SKETCH MAP) (PUTPROP ID (QUOTE SKETCH) Substance)) ((GRAPH BROWSER) (SET ID Substance)) NIL))))) (NC.SetTitle (LAMBDA (ID Title) (* fgh: "14-Feb-84 21:54") (PUTPROP ID (QUOTE NoteCardTitle) Title))) (NC.SetToLinks (LAMBDA (ID Links) (* fgh: "16-Feb-84 00:14") (PUTPROP ID (QUOTE NoteCardToLinks) Links))) (NC.SetType (LAMBDA (ID NoteCardType) (* fgh: " 2-Mar-84 23:05") (PUTPROP ID (QUOTE NoteCardType) NoteCardType))) ) (* Retrieve Note Card Info) (DEFINEQ (NC.RetrieveFromLinks (LAMBDA (ID DatabaseStream) (* fgh: "11-Apr-84 22:16") (* Get or Fetch the from links for the card ID) (COND ((NC.ActiveCardP ID) (NC.FetchFromLinks ID)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (NC.GetLinks ID DatabaseStream) (PROG1 (NC.FetchFromLinks ID) (NC.DeactivateCard ID))))))) (NC.RetrieveLinkLabels (LAMBDA (DatabaseStream SystemLinksFlg) (* NoteCards% User "21-Jun-84 19:57") (* Retrieve the list of link labels used in database specified by DatabaseStream. Include system maintained links only when specified by SystemLinksFlg) (UNION (AND SystemLinksFlg NC.SystemLinkLabels) (for Label in (NC.GetLinkLabels DatabaseStream) when (OR SystemLinksFlg (NULL (NC.SystemLinkLabelP Label)) ) collect Label)))) (NC.RetrievePropList (LAMBDA (ID DatabaseStream) (* fgh: "22-Mar-84 12:48") (* Fetch or get the prop list for the note card specified by ID) (COND ((NC.ActiveCardP ID) (NC.FetchPropList ID)) (T (NC.GetPropList ID DatabaseStream))))) (NC.RetrieveTitle (LAMBDA (ID DatabaseStream) (* fgh: " 9-Apr-84 19:37") (* If note card specified by ID is active then fetch its title. Otherwise activate the card, fetch title and then deactivate the card.) (OR (NC.FetchTitle ID) (NC.SetTitle ID (NC.GetTitle ID DatabaseStream))))) (NC.RetrieveToLinks (LAMBDA (ID DatabaseStream) (* fgh: "11-Apr-84 22:26") (* Get or Fetch the from links for the card ID) (COND ((NC.ActiveCardP ID) (NC.FetchToLinks ID)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (NC.GetLinks ID DatabaseStream) (PROG1 (NC.FetchToLinks ID) (NC.DeactivateCard ID))))))) (NC.RetrieveType (LAMBDA (ID DatabaseStream) (* fgh: "11-Apr-84 22:59") (* Get or Fetch NoteCardType of ID) (COND ((NC.ActiveCardP ID) (NC.FetchType ID)) (T (NC.GetType ID DatabaseStream))))) ) (* General note card manipulations) (DEFINEQ (NC.AddParents (LAMBDA (WindowOrTextStream) (* NoteCards% User " 5-Jun-84 17:24") (* Add a subtopic link from a contents card specified by the user to the contents card specified by WindowOrTextStream. But first check to make sure that this would not introduce any circularities in the contents lattice.) (PROG (ID NewParents OneHook (Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))) (SETQ ID (NC.IDFromWindow Window)) (NC.PrintMsg2 Window T " Please select the new parent FileBox(es)." (CHARACTER 13)) (SETQ NewParents (NC.SelectNoteCards NIL (FUNCTION NC.ContentsCardP) NC.SelectingParentsMenu ID)) (AND NewParents ID (for NewParentID in NewParents do (COND ((for Link in (NC.FetchFromLinks ID) thereis (AND (EQ NC.SubBoxLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) (EQ NewParentID (fetch (NOTECARDLINK DESTINATIONID) of Link)))) (NC.PrintMsg2 Window NIL (NC.RetrieveTitle NewParentID) " is already a parent of " (NC.RetrieveTitle ID) (CHARACTER 13))) ((AND (NEQ ID NewParentID) (NC.NotDaughterP ID NewParentID (FUNCTION NC.SubContentsLinkP))) (NC.MakeAContentsHook NewParentID ID (QUOTE Sub) PSA.Database) (SETQ OneHook T)) (T (NC.PrintMsg2 Window T (NC.RetrieveTitle ID) " is already a parent of " (NC.RetrieveTitle NewParentID) (CHARACTER 13)))))) (AND (NULL OneHook) (NC.PrintMsg2 Window NIL "No appropriate FileBoxes chosen." (CHARACTER 13) "Hence no parents added." (CHARACTER 13))) (AND (GETPROMPTWINDOW Window NIL NIL T) (PROG1 (DISMISS 5000) (NC.ClearMsg Window T)))))) (NC.AssignSources (LAMBDA (WindowOrTextStream) (* fgh: "25-May-84 19:41") (* Called from title bar menus. Assign a new source link to this card. Destination to be specified by the user.) (PROG (ID (Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))) (SETQ ID (NC.IDFromWindow Window)) (SETQ Sources (NC.DetermineSources PSA.Database NIL ID)) (for Source in Sources do (NC.AddSourceLink ID Source PSA.Database)) (NC.SetLinksDirtyFlg ID T) (NC.ClearMsg Window T)))) (NC.AssignTitle (LAMBDA (WindowOrTextStream NoClearMsgFlg) (* fgh: " 1-May-84 20:05") (* Change the title of the card specified by the window/textstream. Called from title bar menus) (PROG (ID NewTitle (Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))) (SETQ NewTitle (NC.AskUser2 (CONCAT "Enter the title for this card" (CHARACTER 13)) "--> " NIL (NULL NoClearMsgFlg) Window)) (AND (NULL NewTitle) (RETURN)) (SETQ ID (NC.IDFromWindow Window)) (NC.SetTitle ID NewTitle) (WINDOWPROP Window (QUOTE TITLE) NewTitle) (NC.MarkCardDirty ID) (for FromLink in (NC.FetchFromLinks ID) do (AND (NC.ActiveCardP (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of FromLink))) (NC.UpdateLinkImages DestinationID ID)))))) (NC.DeleteNoteCards (LAMBDA (CardTextStreamWindowOrID NoCheckFlg DontClearFlg) (* NoteCards% User " 6-Jun-84 15:20") (* Delete note cards. If no card specified then get a list of note cards to be deleted. Then delete these cards.) (PROG (Cards) (SETQ Cards (COND ((WINDOWP CardTextStreamWindowOrID) (LIST (NC.IDFromWindow CardTextStreamWindowOrID))) ((NC.IDP CardTextStreamWindowOrID) (LIST CardTextStreamWindowOrID)) ((TEXTSTREAMP CardTextStreamWindowOrID) (LIST (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING CardTextStreamWindowOrID)))) (T (NC.PrintMsg2 NIL T "Please select the Note Cards to be deleted." (CHARACTER 13)) (NC.SelectNoteCards NIL NIL NC.DeleteSelectingMenu)))) (for ID in Cards do (COND ((FMEMB ID NC.TopLevelCards) (NC.PrintMsg2 (NC.FetchWindow ID) T "You cannot delete this FileBox." (CHARACTER 13)) (DISMISS 1000) (NC.ClearMsg (NC.FetchWindow ID) T)) (T (AND (OR NoCheckFlg (PROG1 (FMEMB (MKATOM (NC.AskUser2 "Are you sure you want to delete this?" " -- " "Yes" (NULL DontClearFlg) (NC.FetchWindow ID))) (QUOTE (Y y Yes YES))) (NC.ClearMsg))) (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) (WITH.MONITOR (NC.FetchMonitor PSA.Database) (NC.SetBeingDeletedFlg ID T) (COND ((NC.ActiveCardP ID) (NC.GreyCard ID) (NC.CloseAllPropListEditors ID) (NC.QuitCard ID))) (PROG (ToLinks FromLinks) (NC.GetLinks ID PSA.Database) (SETQ ToLinks (NC.FetchToLinks ID)) (SETQ FromLinks (NC.FetchFromLinks ID)) (NC.SetToLinks ID NIL) (NC.SetFromLinks ID NIL) (for ToLink in ToLinks do (NC.DelFromLink (fetch (NOTECARDLINK DESTINATIONID) of ToLink) PSA.Database (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of ToLink)))) (for FromLink in FromLinks do (NC.DelToLink (fetch (NOTECARDLINK DESTINATIONID) of FromLink) PSA.Database (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of FromLink))) (NC.DelReferencesToCard (fetch (NOTECARDLINK DESTINATIONID) of FromLink) ID PSA.Database))) (NC.MarkCardDeleted ID PSA.Database) (NC.DeactivateCard ID T) (NC.SetBeingDeletedFlg ID NIL)))))))))) (NC.EditNoteCard (LAMBDA (ID Region/Position) (* NoteCards% User "26-Jun-84 02:22") (* * Bring the already created NoteCard specified by ID onto the screen at Region or Position specified by Region/Position) (PROG (Substance NoteCardType Window) (COND ((NC.ActiveCardP ID) (SETQ Substance (NC.FetchSubstance ID))) (T (SETQ Substance (NC.FetchSubstance (NC.GetNoteCard ID PSA.Database))))) (SETQ NoteCardType (NC.FetchType ID)) (SETQ Window (SELECTQ NoteCardType ((TEXT CONTENTS CONTEXT) (NC.BringUpTEditCard ID Substance Region/Position)) ((SKETCH MAP) (NC.BringUpSketchCard ID Substance Region/Position)) ((GRAPH BROWSER) (NC.BringUpGraphCard ID Substance Region/Position)) NIL)) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.AnnotatedWindowCloseFn)) (RETURN Window)))) (NC.MakeNoteCard (LAMBDA (NoteCardType Title) (* NoteCards% User " 6-Jun-84 15:52") (* Make a new note card of type NoteCardType. If type note specified, ask the user.) (PROG (Window ID CopyID) (SETQ ID (NC.GetNewID PSA.Database)) (SETQ NoteCardType (OR NoteCardType (NC.AskNoteCardType))) (COND ((NULL NoteCardType) (RETURN NIL))) (NC.SetType ID NoteCardType) (NC.SetTitle ID (SETQ Title (COND ((STRINGP Title) Title) ((EQ NoteCardType (QUOTE CONTENTS)) (CONCAT "FileBox# " (GENSYM))) (T "Untitled")))) (SETQ Window (SELECTQ NoteCardType (CONTENTS (NC.MakeContentsCard ID Title)) ((TEXT SPECIAL) (NC.MakeTEditCard ID Title)) (SKETCH (NC.MakeSketchCard ID)) (MAP (SETQ Window (NC.MakeSketchCard ID)) (SKETCHW.ADD.INSTANCE PSA.MapSketchType Window) Window) ((GRAPH) (NC.MakeGraphCard ID)) (BROWSER (NC.MakeBrowserCard ID)) (RETURN NIL))) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.AnnotatedWindowCloseFn)) (NC.ActivateCard ID) (* Insure that a link ptr is set up during the first save) (NC.SetLinksDirtyFlg ID T) (NC.SetLinksDirtyFlg ID T) (NC.SetNewCardFlg ID T) (RETURN Window)))) (NC.FileNoteCard (LAMBDA (WindowOrTextStream) (* fgh: "26-Mar-84 23:43") (* Called from title bar menus - adds card containing TextStream to a Contents Card or Cards) (PROG ((ID (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING WindowOrTextStream)))) (NC.CheckTitle ID PSA.Database) (NC.MakeContentsHooks ID PSA.Database T)))) (NC.QuitCard (LAMBDA (ID) (* fgh: "16-Apr-84 23:23") (* Force note card specified by ID to quit or stop) (PROG ((NoteCardType (NC.FetchType ID))) (SELECTQ NoteCardType ((TEXT CONTENTS) (NC.TEditCloseFn (NC.FetchSubstance ID))) ((GRAPH BROWSER) (CLOSEW (NC.FetchWindow ID))) ((SKETCH MAP) (CLOSEW (NC.FetchWindow ID))) (SHOULDNT "Unknown Note Card Type"))))) (NC.CheckContentsHooks (LAMBDA (ID DatabaseStream) (* fgh: "25-May-84 19:42") (* Check to make sure this card has a contents hook of some sort. If not, hook it up to a contents card.) (COND ((AND (NOT (FMEMB (NC.FetchType ID) (QUOTE (CONTENTS)))) (for Link in (NC.FetchFromLinks ID) never (EQ NC.FiledCardLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)))) (NC.PrintMsg2 (NC.FetchWindow ID) T "This card has not been filed in a FileBox." (CHARACTER 13)) (NC.MakeContentsHooks ID DatabaseStream))))) (NC.CheckSources (LAMBDA (ID DatabaseStream) (* fgh: "25-May-84 19:35") (* Called when quitting a note card. Check to make sure that the sources are appropriately set for this note card. If not, get the source information from the default setting or from the user.) (PROG (Sources) (SETQ Sources (for Link in (NC.FetchGlobalLinks ID) when (EQ NC.SourceLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) collect Link)) (COND ((AND (NEQ (NC.FetchType ID) (QUOTE CONTENTS)) (NULL Sources)) (NC.PrintMsg2 (NC.FetchWindow ID) T "This card has no designated sources." (CHARACTER 13)) (SETQ Sources (NC.DetermineSources DatabaseStream T ID)) (for Source in Sources do (NC.AddSourceLink ID Source DatabaseStream)) (NC.SetLinksDirtyFlg ID T)))))) (NC.CheckTitle (LAMBDA (ID DatabaseStream) (* fgh: " 1-May-84 20:06") (* If card specified by ID has no title, ask the user for a title.) (PROG (Title (Window (NC.FetchWindow ID))) (COND ((OR (NULL (NC.FetchTitle ID)) (EQUAL "Untitled" (NC.FetchTitle ID))) (NC.PrintMsg2 Window T "This note card has no title." (CHARACTER 13)) (NC.AssignTitle Window T)))))) (NC.DeleteSource (LAMBDA (WindowOrTextStream) (* NoteCards% User "25-Jun-84 19:20") (* Called from title bar menus. Deletes source/s/ for the card specified by WindowOrTextStream) (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream)) ID Sources EditWindow) (SETQ ID (NC.IDFromWindow Window)) (SETQ Sources (for Link in (NC.FetchGlobalLinks ID) when (AND (EQ NC.SourceLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) (NEQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (QUOTE NC00000))) collect Link)) (COND ((NULL Sources) (NC.PrintMsg2 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)) (NC.PrintMsg2 Window T "Select source(s) to be deleted." (CHARACTER 13)) (SETQ Sources (NC.SelectNoteCards NIL NIL NC.DeleteSelectingMenu ID)) (NC.ClearMsg Window T) (NC.ClosePropListEditor EditWindow (QUOTE NoSave)) (for Source in Sources do (NC.DelToLink ID PSA.Database (create NOTECARDLINK DESTINATIONID ← Source LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ← NIL)) (NC.DelFromLink Source PSA.Database (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ← NIL))) (NC.SetGlobalLinks ID (for Link in (NC.FetchGlobalLinks ID) when (NOT (FMEMB (fetch (NOTECARDLINK DESTINATIONID) of Link) Sources)) collect Link))))))) (NC.DetermineContentsCards (LAMBDA (DatabaseStream OptionalFilingFlg ID) (* NoteCards% User " 6-Jun-84 14:51") (* Returns a list of contents cards for filing a card. The rule used for the choice is: First ask the user. If the user returns NIL, then use the Orphan Note Card) (PROG ((CardAlreadyFiledFlg (for Link in (NC.FetchFromLinks ID) thereis (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) NC.FiledCardLinkLabel)))) (RETURN (COND ((PROGN (NC.PrintMsg2 (NC.FetchWindow ID) NIL "Please select the Box to file this card in." (CHARACTER 13) (COND (CardAlreadyFiledFlg "") (T (CONCAT "NoBox files it in the ToBeFiled box." (CHARACTER 13))))) (PROG1 (NC.SelectNoteCards NIL NIL (COND (CardAlreadyFiledFlg NC.SelectingParentsMenu) (T NC.SelectingContentsMenu)) ID) (NC.ClearMsg (NC.FetchWindow ID) T)))) ((AND (NOT OptionalFilingFlg) (NOT CardAlreadyFiledFlg)) (NC.PrintMsg2 (NC.FetchWindow ID) T "No Box has been specified." (CHARACTER 13) "Filing this card in the ToBeFiled Box." (CHARACTER 13)) (LIST NC.UnclassifiedID))))))) (NC.DetermineSources (LAMBDA (DatabaseStream NoSourceOptionFlg ID) (* fgh: "22-May-84 19:10") (* Returns a list of source cards according to the following rule: Ask the user. If the user returns no source cards, use all open source cards on the screen. Otherwise, return NIL) (PROG (Selections (Window (NC.FetchWindow ID))) (NC.PrintMsg2 Window NIL "Select source(s) for this card." (CHARACTER 13) "NoSource" " to indicate no source." (CHARACTER 13)) (SETQ Selections (NC.SelectNoteCards NIL NIL NC.SelectingSourcesMenu ID)) (NC.ClearMsg Window) (AND (IGREATERP (LENGTH Selections) 1) (DREMOVE (QUOTE NC00000) Selections)) (RETURN Selections)))) (NC.InsureProperFiling (LAMBDA (ID DatabaseStream) (* fgh: "26-Mar-84 22:47") (* Called when any type of note card is being quitted from, i.e., closed) (COND ((NULL (NC.FetchBeingDeletedFlg ID)) (NC.CheckTitle ID DatabaseStream) (NC.CheckSources ID DatabaseStream) (NC.CheckContentsHooks ID DatabaseStream))))) (NC.QuitWithoutSaving (LAMBDA (WindowOrTextStream DatabaseStream) (* NoteCards% User "17-Jun-84 22:18") (* Quit from a note card without saving its contents on the database. But must make sure that any updates that would have been done to this card even if it had been on the database are carried out on the old image currently on the database) (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream)) ID FromLinks ToLinks DeletedLinks Process TextObj) (OR (STREAMP DatabaseStream) (SETQ DatabaseStream PSA.Database)) (SETQ ID (NC.IDFromWindow Window)) (SETQ FromLinks (NC.FetchFromLinks ID)) (SETQ ToLinks (NC.FetchToLinks ID)) (COND ((FMEMB (MKATOM (NC.AskUser2 "Are you sure you want to flush your changes?" " -- " "Yes" T Window)) (QUOTE (Y y Yes YES))) (COND ((NC.IDP (NC.GetNoteCard ID DatabaseStream)) (* Want to keep current from links in case they were updated while this card was up) (NC.SetFromLinks ID FromLinks) (* Delete the back links from all links that are not in the old to link set.) (bind (OldLinks ←(NC.FetchToLinks ID)) for Link in ToLinks when (NOT (FMEMB Link OldLinks)) do (NC.DelFromLink (fetch (NOTECARDLINK DESTINATIONID) of Link) DatabaseStream (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Link) DISPLAYMODE ← NIL) T)) (* Check to make sure none of the old To links point to a deleted card. If so, replace with a deleted marker.) (SETQ ToLinks (NC.FetchToLinks ID)) (SETQ DeletedLinks (bind DestinationID for Link in ToLinks when (PROGN (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (AND (NOT (NC.ActiveCardP DestinationID)) (EQ (QUOTE DELETED) (NC.GetType DestinationID DatabaseStream) ))) collect (NC.DelReferencesToCard ID DestinationID DatabaseStream) DestinationID)) (NC.SetToLinks ID (LDIFFERENCE ToLinks DeletedLinks)) (* Put away the links) (NC.PutLinks ID DatabaseStream) (* If body changed, Put it away) (AND DeletedLinks (NC.PutNoteCard ID DatabaseStream)) (* KILL the process behind the editing window) (SETQ Process (WINDOWPROP Window (QUOTE PROCESS))) (* Remove all the NoteCards close fns) (for CloseFn in (MKLIST (WINDOWPROP Window (QUOTE CLOSEFN))) when (EQ (SUBATOM CloseFn 1 3) (QUOTE NC.)) do (WINDOWDELPROP Window (QUOTE CLOSEFN) CloseFn)) (* If this is a Tedit Window, prevent TEdit from closing the database file) (COND ((SETQ TextObj (WINDOWPROP Window (QUOTE TEXTOBJ))) (replace (TEXTOBJ TXTFILE) of TextObj with NIL) (replace (TEXTOBJ \DIRTY) of TextObj with NIL))) (* Close the window) (CLOSEW Window) (AND Process (DEL.PROCESS Process))) (T (* If the card has never beenm written to the database quit w/o saving is equivalent to delteing the card.) (NC.PrintMsg2 Window T "This card has never been saved." (CHARACTER 13) "It will be deleted from the database." (CHARACTER 13)) (NC.DeleteNoteCards ID NIL T)))))))) (NC.UnfileNoteCard (LAMBDA (WindowOrTextStream) (* NoteCards% User " 6-Jun-84 14:34") (* Take a notecard out of a file box. Called fom title bar menu.) (PROG (Links ID Window EditWindow) (SETQ Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream)) (SETQ ID (NC.IDFromWindow Window)) (SETQ Links (for Link in (NC.FetchFromLinks ID) when (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) NC.FiledCardLinkLabel) collect (PROGN (replace (NOTECARDLINK DISPLAYMODE) of Link with (QUOTE Title)) Link))) (NC.PrintMsg2 Window T "Please select the file box(es) from which to remove this card. " (CHARACTER 13)) (SETQ EditWindow (NC.OpenPropListEditor WindowOrTextStream (LIST (QUOTE FileBoxes) Links) "List of File Boxes" T T)) (BLOCK) (SETQ FileBoxes (NC.SelectNoteCards NIL (FUNCTION NC.ContentsCardP) NC.SelectingParentsMenu ID)) (NC.ClosePropListEditor EditWindow (QUOTE NoSave)) (NC.ClearMsg Window T) (for Box in FileBoxes do (NC.DelReferencesToCard Box ID PSA.Database) (NC.DelToLink Box PSA.Database (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ← NC.FiledCardLinkLabel DISPLAYMODE ← NIL)) (NC.DelFromLink ID PSA.Database (create NOTECARDLINK DESTINATIONID ← Box LINKLABEL ← NC.FiledCardLinkLabel DISPLAYMODE ← NIL)))))) (NC.UpdateUpdateList (LAMBDA (ID) (* fgh: "23-Apr-84 20:33") (* Update the list of update authors and times for the note card specified by ID) (COND ((NC.ActiveCardP ID) (COND ((NULL (NC.FetchPropList ID)) (NC.SetPropList ID (LIST (QUOTE Updates) (LIST (LIST USERNAME (DATE)))))) (T (LISTPUT (NC.FetchPropList ID) (QUOTE Updates) (CONS (LIST USERNAME (DATE)) (LISTGET (NC.FetchPropList ID) (QUOTE Updates))))))) (T (NC.ReportError "NC.UpdateUpdateList" (CONCAT ID ": Card not active on screen")))))) ) (* Note card types) (DEFINEQ (NC.BringUpGraphCard (LAMBDA (ID Substance Region/Position) (* NoteCards% User "26-Jun-84 02:30") (* * Given a graph (or browser) Substance, open a grapher (browser) window and set it up to be a NoteCard with ID.) (PROG (Region Title GraphWindow IconWindow) (COND ((SETQ GraphWindow (NC.FetchWindow ID)) (AND (WINDOWP (WINDOWPROP GraphWindow (QUOTE ICONFOR))) (SETQ GraphWindow (EXPANDW GraphWindow))) (TOTOPW GraphWindow) (RPTQ 2 (FLASHW GraphWindow)) (RETURN GraphWindow))) (SETQ GraphWindow (SHOW.ANNOTATED.GRAPH Substance (CREATEW (COND ((type? REGION Region/Position) Region/Position) ((POSITIONP Region/Position) (CREATEREGION (fetch XCOORD of Region/Position) (fetch YCOORD of Region/Position) PSA.SketchCardDefaultWidth PSA.SketchCardDefaultHeight)) (T (COND ((SETQ Region (NC.FetchRegion ID)) (GETBOXREGION (fetch WIDTH of Region) (fetch HEIGHT of Region) (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) (fetch HEIGHT of Region)) NIL (CONCAT "Please specify location for edit of Note Card " ID))) (T (GETBOXREGION PSA.GraphCardDefaultWidth PSA.GraphCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.GraphCardDefaultHeight) NIL (CONCAT "Please specify location for edit of Note Card " ID)))))) (GETPROP ID (QUOTE NoteCardTitle))) (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) NIL T)) (WINDOWADDPROP GraphWindow (QUOTE CLOSEFN) (FUNCTION NC.GraphCardCloseFn)) (WINDOWPROP GraphWindow (QUOTE NoteCardID) ID) (NC.SetupTitleBarMenu GraphWindow ID) (RETURN GraphWindow)))) (NC.BringUpSketchCard (LAMBDA (ID Substance Region/Position) (* fgh: "30-Apr-84 15:50") (* Bring up a sketch card containing substance in specified region) (PROG (Region Title SketchViewer) (COND ((SETQ SketchViewer (CAR (ALL.SKETCH.VIEWERS ID))) (RPTQ 2 (FLASHW SketchViewer)) (TOTOPW SketchViewer) (TTY.PROCESS (WINDOWPROP SketchViewer (QUOTE PROCESS))) (RETURN SketchViewer))) (SETQ SketchViewer (SKETCHW.CREATE Substance (NC.FetchRegionViewed ID) (COND ((type? REGION Region/Position) Region/Position) ((POSITIONP Region/Position) (CREATEREGION (fetch XCOORD of Region/Position) (fetch YCOORD of Region/Position) PSA.SketchCardDefaultWidth PSA.SketchCardDefaultHeight)) (T (COND ((SETQ Region (NC.FetchRegion ID)) (GETBOXREGION (fetch WIDTH of Region) (fetch HEIGHT of Region) (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) (fetch HEIGHT of Region)) NIL (CONCAT "Please specify location for edit of Note Card " ID))) (T (GETBOXREGION PSA.SketchCardDefaultWidth PSA.SketchCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.SketchCardDefaultHeight) NIL (CONCAT "Please specify location for edit of Note Card " ID)))))) (GETPROP ID (QUOTE NoteCardTitle)) NIL)) (WINDOWPROP SketchViewer (QUOTE NoteCardID) ID) (WINDOWADDPROP SketchViewer (QUOTE CLOSEFN) (FUNCTION NC.SketchCardCloseFn)) (NC.SetupTitleBarMenu SketchViewer ID) (RETURN SketchViewer)))) (NC.BringUpTEditCard (LAMBDA (ID TextStream Region/Position) (* NoteCards% User "17-Jun-84 00:27") (* Bring up a TEdit window for Card ID whose text stream is TextStream in Region specified by Region/Position or by the user.) (PROG (Region TEditWindow TEditProcess Title) (COND ((AND (SETQ TEditWindow (fetch \WINDOW of (TEXTOBJ TextStream))) (SETQ TEditProcess (WINDOWPROP TEditWindow (QUOTE PROCESS)))) (TOTOPW TEditWindow) (RPTQ 2 (FLASHW TEditWindow)) (TTY.PROCESS TEditProcess) (RETURN TEditWindow))) (SETQ Region (COND ((type? REGION Region/Position) Region/Position) ((POSITIONP Region/Position) (CREATEREGION (fetch XCOORD of Region/Position) (fetch YCOORD of Region/Position) PSA.TEditCardDefaultWidth PSA.TEditCardDefaultHeight)) (T (COND ((SETQ Region (NC.FetchRegion ID)) (GETBOXREGION (fetch WIDTH of Region) (fetch HEIGHT of Region) (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) (fetch HEIGHT of Region)) NIL (CONCAT "Please specify location for edit of Note Card " ID))) (T (GETBOXREGION PSA.TEditCardDefaultWidth PSA.TEditCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.TEditCardDefaultHeight) NIL (CONCAT "Please specify location for edit of Note Card " ID))))))) (SETQ Title (NC.FetchTitle ID)) (SETQ TEditWindow (CREATEW Region Title (NC.DetermineBorderWidth (NC.FetchType ID)) T)) (WINDOWPROP TEditWindow (QUOTE SHRINKFN) (FUNCTION NC.ShrinkFn)) (WINDOWPROP TEditWindow (QUOTE NoteCardID) ID) (WINDOWPROP TEditWindow (QUOTE NoteCardsLeftButtonMenu) (NC.MakeTEditLeftMenu (NC.FetchType ID))) (WINDOWPROP TEditWindow (QUOTE NoteCardsMiddleButtonMenu) (NC.MakeTEditMiddleMenu)) (WINDOWADDPROP TEditWindow (QUOTE CLOSEFN) (FUNCTION NC.TEditCloseFn)) (TEDIT TextStream TEditWindow NIL (LIST (QUOTE FONT) PSA.TimesRoman10 (QUOTE TITLEMENUFN) (FUNCTION NC.TEditMenuFn))) (RETURN TEditWindow)))) (NC.ContentsCardP (LAMBDA (ID DatabaseStream) (* fgh: " 1-May-84 00:40") (* Return T if ID is a CONTENTS card.) (OR (EQ (QUOTE CONTENTS) (NC.RetrieveType ID (OR DatabaseStream PSA.Database))) (PROGN (NC.PrintMsg2 NIL T ID " is not a Topic card. Please choose again." (CHARACTER 13)) NIL)))) (NC.MakeBrowserCard (LAMBDA (ID RootID ListOfLinkLabels) (* NoteCards% User "17-Jun-84 15:05") (* Make a browser card with id ID using root at RootID and the link following predictae specified by Predicate. IF Root and/or ListOfLinkLabels not specified, ask the user.) (PROG (Lattice Window Anno Graph AnnoImageObj DisplayStream ImageBox NodeLabel PropList BrowserSpecs) (NC.ActivateCard ID) (SETQ Window (CREATEW (GETBOXREGION NC.BrowserCardDefaultWidth NC.BrowserCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) NC.BrowserCardDefaultHeight) NIL "Please indicate where to place the new browser card.") (NC.FetchTitle ID) NIL)) (SETQ RootID (OR RootID (PROGN (NC.PrintMsg2 Window T "Please select the Note Card or File Box the browser should start from." (CHARACTER 13)) (NC.SelectNoteCards T NIL NC.SelectingBrowserSourceMenu Window)))) (COND ((NULL RootID) (NC.DeactivateCard ID) (CLOSEW Window) (RETURN))) (OR ListOfLinkLabels (SETQ ListOfLinkLabels (NC.AskLinkLabel Window T T)) (PROGN (NC.PrintMsg2 Window T "Defaulting to SubBox pointers." (CHARACTER 13)) (SETQ ListOfLinkLabels NC.SubBoxLinkLabel))) (SETQ BrowserSpecs (COND (NC.SpecialBrowserSpecsFlg (NC.AskBrowserSpecs Window)) (T (create BrowserSpecs)))) (NC.PrintMsg2 Window NIL (CHARACTER 13) "Computing browser graph. Please wait. ...") (SETQ Lattice (CDR (NC.GrowLinkLattice RootID (LIST NIL) ListOfLinkLabels ID PSA.Database))) (WINDOWPROP Window (QUOTE NoteCardID) ID) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.GraphCardCloseFn)) (for Node in Lattice do (SETQ Anno (ANNO.CREATE.AND.DISPLAY (LIST (LIST NC.BrowserContentsLinkLabel (fetch (GRAPHNODE NODELABEL) of Node)) (QUOTE NOTECARD)) Window)) (PUTPROP (fetch (GRAPHNODE NODEID) of Node) (QUOTE Annotation) Anno) (SETQ AnnoImageObj (IMAGEOBJCREATE Anno (IMAGEFNSCREATE))) (SETQ DisplayStream (DSPCREATE)) (SETQ ImageBox (NOTECARD.ANNO.IMAGEBOXFN AnnoImageObj DisplayStream NIL NIL T)) (SETQ NodeLabel (BITMAPCREATE (fetch (IMAGEBOX XSIZE) of ImageBox) (IPLUS (fetch (IMAGEBOX YSIZE) of ImageBox) (fetch (IMAGEBOX YDESC) of ImageBox)))) (DSPDESTINATION NodeLabel DisplayStream) (DSPYPOSITION (fetch (IMAGEBOX YDESC) of ImageBox) DisplayStream) (NOTECARD.ANNO.DISPLAYFN AnnoImageObj DisplayStream T) (replace (GRAPHNODE NODELABEL) of Node with NodeLabel)) (SETQ Graph (LAYOUTGRAPH Lattice (LIST (CAAR Lattice)) (fetch (BrowserSpecs Format) of BrowserSpecs) (fetch (BrowserSpecs Font) of BrowserSpecs) (fetch (BrowserSpecs MotherD) of BrowserSpecs) (fetch (BrowserSpecs PersonalD) of BrowserSpecs) (fetch (BrowserSpecs FamilyD) of BrowserSpecs))) (NC.PrintMsg2 Window NIL "Done!") (SHOW.ANNOTATED.GRAPH Graph Window (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) NIL T) (NC.SetSubstance (NC.IDFromWindow Window) (WINDOWPROP Window (QUOTE GRAPH))) (SETQ PropList (NC.FetchPropList (NC.IDFromWindow Window))) (COND (PropList (LISTPUT PropList (QUOTE BrowserLinkLabels) (LIST (OR ListOfLinkLabels NC.SubBoxLinkLabel)))) (T (NC.SetPropList ID (SETQ PropList (LIST (QUOTE BrowserLinkLabels) (LIST (OR ListOfLinkLabels NC.SubBoxLinkLabel)) ))))) (LISTPUT PropList (QUOTE BrowserRoot) RootID) (AND NC.SpecialBrowserSpecsFlg (LISTPUT PropList (QUOTE BrowserSpecs) (LIST BrowserSpecs))) (NC.SetupTitleBarMenu Window ID) (NC.ClearMsg Window T) (RETURN Window)))) (NC.MakeGraphCard (LAMBDA (ID) (* fgh: "20-Apr-84 00:11") (PROG (Window) (SETQ Window (CREATEW (GETBOXREGION PSA.GraphCardDefaultWidth PSA.GraphCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.GraphCardDefaultHeight)) (GETPROP ID (QUOTE NoteCardTitle)))) (WINDOWPROP Window (QUOTE NoteCardID) ID) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.GraphCardCloseFn)) (SHOW.ANNOTATED.GRAPH NIL Window (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) T T) (NC.SetSubstance ID (WINDOWPROP Window (QUOTE GRAPH))) (NC.SetupTitleBarMenu Window ID) (RETURN Window)))) (NC.MakeSketchCard (LAMBDA (ID) (* fgh: "28-Apr-84 19:20") (PROG (Window) (SETQ Window (SKETCHW.CREATE ID NIL (GETBOXREGION PSA.SketchCardDefaultWidth PSA.SketchCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.SketchCardDefaultHeight)) (NC.FetchTitle ID))) (NC.MarkCardDirty ID) (WINDOWPROP Window (QUOTE NoteCardID) ID) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.SketchCardCloseFn)) (NC.SetupTitleBarMenu Window ID) (RETURN Window)))) (NC.MakeTEditCard (LAMBDA (ID Title) (* NoteCards% User "17-Jun-84 00:28") (* Make up a blank text card and display it.) (PROG (Window) (SETQ Window (CREATEW (GETBOXREGION PSA.TEditCardDefaultWidth PSA.TEditCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.TEditCardDefaultHeight) NIL "Please specify location for Note Card") Title)) (WINDOWPROP Window (QUOTE NoteCardID) ID) (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu) (NC.MakeTEditLeftMenu (NC.FetchType ID))) (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu) (NC.MakeTEditMiddleMenu)) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.TEditCloseFn)) (WINDOWPROP Window (QUOTE SHRINKFN) (FUNCTION NC.ShrinkFn)) (TEDIT NIL Window NIL (LIST (QUOTE FONT) PSA.TimesRoman10 (QUOTE TITLEMENUFN) (FUNCTION NC.TEditMenuFn))) (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK)) (NC.SetSubstance ID (WINDOWPROP Window (QUOTE TEXTSTREAM))) (replace (TEXTOBJ \DIRTY) of (WINDOWPROP Window (QUOTE TEXTOBJ)) with T) (RETURN Window)))) (NC.TEditQuitFn (LAMBDA (Window) (* fgh: "10-May-84 16:28") (* Called by TEdit when quitting out of a TEdit-based note card. Close up attached windows, then store note card on database if it has been changed) (PROG (TextStream (ID (WINDOWPROP Window (QUOTE NoteCardID))) (PromptWindow (CAR (WINDOWPROP Window (QUOTE PROMPTWINDOW))))) (for AttachedWindow in (ALLATTACHEDWINDOWS Window) unless (EQ AttachedWindow PromptWindow) do (DETACHWINDOW AttachedWindow) (CLOSEW AttachedWindow) (until (NULL (OPENWP AttachedWindow)) do (BLOCK))) (SETQ TextStream (NC.FetchSubstance ID)) (NC.TEditSaveFn TextStream PSA.Database) (NC.DeactivateCard ID) (* MAke sure TEdit won't close the database file) (replace (TEXTOBJ TXTFILE) of (TEXTOBJ TextStream) with NIL) (TEDIT.MAPPIECES (TEXTOBJ TextStream) (FUNCTION (LAMBDA (CH# PC PC# OBL) (replace (PIECE PFILE) of PC with NIL)))) (REMOVEPROMPTWINDOW Window) (RETURN T)))) (NC.GraphCardCloseFn (LAMBDA (Window) (* fgh: " 1-May-84 12:02") (* Called when a grapher-based note card is being closed. Writes graph to database and does other clean up functions) (PROG ((ID (NC.IDFromWindow Window))) (for AttachedWindow in (ALLATTACHEDWINDOWS Window) do (DETACHWINDOW AttachedWindow) (CLOSEW AttachedWindow)) (NC.GraphCardSaveFn Window PSA.Database) (for Node in (fetch (GRAPH GRAPHNODES) of (WINDOWPROP Window (QUOTE GRAPH))) when (LITATOM (fetch (GRAPHNODE NODEID) of Node)) do (REMPROP (fetch (GRAPHNODE NODEID) of Node) (QUOTE Annotation))) (REMOVEPROMPTWINDOW Window) (NC.DeactivateCard ID)))) (NC.GraphCardLeftButtonFn (LAMBDA (GraphNode GraphWindow) (* NoteCards% User " 6-Jun-84 19:17") (* IF Selection in progress, then pressing a node gets its destination ID if its actually a note card node. Otherwise, jump to normal button processing for an annotated grpah.) (PROG (Anno ID NodeID) (SETQ NodeID (fetch (GRAPHNODE NODEID) of GraphNode)) (SETQ Anno (COND ((LISTP NodeID) (GETPROP (CAR NodeID) (QUOTE Annotation))) (T (GETPROP NodeID (QUOTE Annotation))))) (COND (NC.SelectionInProgress (AND Anno (EQ (QUOTE NOTECARD) (NC.FetchSubstanceTypeFromAnno Anno)) (SETQ ID (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno Anno))) (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) (T (GR.SHOW.ANNOTE GraphNode GraphWindow)))))) (NC.GraphCardMiddleButtonFn (LAMBDA (GraphNode GraphWindow) (* NoteCards% User "17-Jun-84 16:00") (* IF Selection in progress, then pressing a node gets its destination ID if its actually a note card node. Otherwise, jump to normal button processing for an annotated grpah.) (PROG (NodeID Anno ID) (SETQ NodeID (fetch (GRAPHNODE NODEID) of GraphNode)) (SETQ Anno (COND ((LISTP NodeID) (GETPROP (CAR NodeID) (QUOTE Annotation))) (T (GETPROP NodeID (QUOTE Annotation))))) (AND Anno (COND (NC.SelectionInProgress (AND Anno (EQ (QUOTE NOTECARD) (NC.FetchSubstanceTypeFromAnno Anno)) (SETQ ID (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno Anno))) (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) ((AND NC.SpecialBrowserMiddleButtonFn (EQ (NC.FetchType (NC.IDFromWindow GraphWindow) ) (QUOTE BROWSER))) (APPLY* NC.SpecialBrowserMiddleButtonFn GraphNode GraphWindow)) (T (NOTECARD.ANNO.MIDDLEBUTTONFN Anno GraphWindow))))))) (NC.GraphCardSaveFn (LAMBDA (Window DatabaseStream) (* fgh: "10-May-84 15:27") (* Save the graph card specified by Window on DatabaseStream) (PROG ((ID (NC.IDFromWindow Window))) (OR (STREAMP DatabaseStream) (SETQ DatabaseStream PSA.Database)) (NC.InsureProperFiling ID DatabaseStream) (NC.PrintMsg2 Window T "Updating NoteFile ... ") (NC.PutNoteCard ID DatabaseStream T) (COND ((OR (NC.FetchLinksDirtyFlg ID) (NC.FetchLinksDirtyFlg ID)) (NC.PutLinks ID DatabaseStream))) (NC.PrintMsg2 Window NIL "Done!!" (CHARACTER 13)) (DISMISS 500) (NC.ClearMsg Window T)))) (NC.AnnotatedWindowCloseFn (LAMBDA (Window) (* fgh: "23-Mar-84 01:53") (* Clean up annotation network from Window so that the ANNO datatypes will be garbage collected properly) (PROG (Anno AnnoNode Network) (AND (SETQ Anno (WINDOWPROP Window (QUOTE WINDOWANNO) NIL)) (SETQ AnnoNode (fetch (ANNO ANNO\NODE) of Anno)) (SETQ Network (GET.PROP AnnoNode (QUOTE NETWORK))) (for Node in (GET.PROP Network (QUOTE NODE.OF.NETWORK)) do (REMPROP Node (QUOTE MY-ANNO))))) )) (NC.SketchCardCloseFn (LAMBDA (Window) (* fgh: "11-May-84 19:56") (* Quit from a sketch card, saving information on the database) (PROG (ID OldRegion NewRegion) (SKED.CLEAR.SELECTION Window) (SETQ ID (WINDOWPROP Window (QUOTE NoteCardID))) (for AttachedWindow in (ATTACHEDWINDOWS Window) do (DETACHWINDOW AttachedWindow) (CLOSEW AttachedWindow)) (WINDOWPROP Window (QUOTE ATTACHEDWINDOWS) NIL) (NC.SketchCardSaveFn Window PSA.Database) (REMOVEPROMPTWINDOW Window) (WINDOWPROP Window (QUOTE SKETCHOPMENU) NIL) (TTY.PROCESS T) (NC.DeactivateCard ID)))) (NC.SketchCardSaveFn (LAMBDA (Window DatabaseStream) (* fgh: "10-May-84 15:27") (* Save sketch in sketch card specified by Window onto DatabaseStream) (PROG (ID OldRegion NewRegion (EPSILON (CONSTANT (FQUOTIENT 1 1024)))) (OR (STREAMP DatabaseStream) (SETQ DatabaseStream PSA.Database)) (SETQ ID (WINDOWPROP Window (QUOTE NoteCardID))) (NC.InsureProperFiling ID DatabaseStream) (NC.PrintMsg2 Window T "Updating NoteFile ... ") (COND ((OR (NC.DirtySketchP ID) (NULL (NC.FetchScale ID)) (NULL (NC.FetchRegionViewed ID)) (GREATERP (ABS (DIFFERENCE (NC.FetchScale ID) (SCALE.FROM.SKW Window))) EPSILON) (for OldNumber in (NC.FetchRegionViewed ID) as NewNumber in (SK.REGION.VIEWED Window) thereis (GREATERP (ABS (DIFFERENCE OldNumber NewNumber)) EPSILON))) (NC.PutNoteCard ID DatabaseStream T) (UNMARKASCHANGED (LIST ID (QUOTE SKETCH)) (QUOTE PROPS))) ((OR (NOT (EQUAL (fetch (REGION WIDTH) of (SETQ OldRegion (NC.FetchRegion ID))) (fetch (REGION WIDTH) of (SETQ NewRegion (WINDOWPROP Window (QUOTE REGION)))))) (NOT (EQUAL (fetch (REGION HEIGHT) of OldRegion) (fetch (REGION HEIGHT) of NewRegion)))) (NC.UpdateRegionData ID DatabaseStream))) (COND ((OR (NC.FetchLinksDirtyFlg ID) (NC.FetchLinksDirtyFlg ID)) (NC.PutLinks ID DatabaseStream))) (NC.PrintMsg2 Window NIL "Done!!" (CHARACTER 13)) (DISMISS 500) (NC.ClearMsg Window T)))) (NC.TEditCloseFn (LAMBDA (WindowOrTextStream) (* fgh: "16-Apr-84 23:32") (* Close this TEdit window by Quitting from TEdit) (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream))) (WINDOWDELPROP Window (QUOTE CLOSEFN) (FUNCTION NC.TEditCloseFn)) (NC.\TEDIT.QUIT Window)))) (NC.TEditSaveFn (LAMBDA (TextStream DatabaseStream) (* fgh: "11-May-84 21:33") (* Save Text Card specified by TextStream onto DatabaseStream) (PROG (Window ID TextObj NewRegion OldRegion) (OR DatabaseStream (SETQ DatabaseStream PSA.Database)) (SETQ Window (WINDOW.FROM.TEDIT.THING TextStream)) (SETQ ID (NC.IDFromWindow Window)) (SETQ TextObj (TEXTOBJ TextStream)) (NC.InsureProperFiling ID PSA.Database) (NC.PrintMsg2 Window T "Updating NoteFile ... ") (COND ((fetch \DIRTY of TextObj) (NC.PutNoteCard ID DatabaseStream T)) ((AND (OR (NOT (EQUAL (fetch WIDTH of (SETQ OldRegion (NC.FetchRegion ID))) (fetch WIDTH of (SETQ NewRegion (WINDOWPROP Window (QUOTE REGION)))) )) (NOT (EQUAL (fetch HEIGHT of OldRegion) (fetch HEIGHT of NewRegion)))) (REGIONSINTERSECTP NewRegion WHOLEDISPLAY)) (NC.UpdateRegionData ID DatabaseStream))) (AND (NC.FetchLinksDirtyFlg ID) (NC.PutLinks ID DatabaseStream)) (replace (TEXTOBJ \DIRTY) of TextObj with NIL) (NC.PrintMsg2 Window NIL "Done!!" (CHARACTER 13)) (DISMISS 500) (NC.ClearMsg Window T)))) (NC.\TEDIT.LOOKS (LAMBDA (TextStream) (* fgh: "31-Mar-84 16:02") (\TEDIT.LOOKS (TEXTOBJ TextStream)))) (NC.\TEDIT.QUIT (LAMBDA (TextStream) (* fgh: "10-May-84 16:27") (PROG ((Window (WINDOW.FROM.TEDIT.THING TextStream))) (NC.TEditQuitFn Window) (\TEDIT.QUIT Window)))) (NC.MakeContentsCard (LAMBDA (ID Title DontDisplay NoPlaceMarkersFlg DatabaseStream) (* NoteCards% User "17-Jun-84 00:30") (* Make up a blank contents card, hook it to the user specified parent contents cards, and display it.) (PROG (Window TextStream ParentIDs (Spacer (CONCAT (CHARACTER 13) (CHARACTER 13)))) (SETQ TextStream (OPENTEXTSTREAM "")) (COND ((NULL NoPlaceMarkersFlg) (TEDIT.INSERT.OBJECT (NC.MakePlaceMarker NC.SubBoxMarkerLabel) TextStream 1) (TEDIT.INSERT TextStream Spacer 2) (TEDIT.INSERT.OBJECT (NC.MakePlaceMarker NC.FiledCardMarkerLabel) TextStream 4) (TEDIT.INSERT TextStream Spacer 5)) (T (TEDIT.INSERT TextStream Spacer 1))) (NC.SetSubstance ID TextStream) (NC.SetRegion ID (CREATEREGION 0 0 PSA.ContentsCardDefaultWidth PSA.ContentsCardDefaultHeight)) (COND (DontDisplay (RETURN TextStream))) (SETQ Window (CREATEW (GETBOXREGION PSA.ContentsCardDefaultWidth PSA.ContentsCardDefaultHeight (GETMOUSEX) (IDIFFERENCE (GETMOUSEY) PSA.ContentsCardDefaultHeight) NIL "Please specify location for the new FileBox") Title (NC.DetermineBorderWidth (QUOTE CONTENTS)))) (WINDOWPROP Window (QUOTE NoteCardID) ID) (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu) (NC.MakeTEditLeftMenu (NC.FetchType ID))) (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu) (NC.MakeTEditMiddleMenu)) (* Hook up this card to the parents as specified by the user.) (OR DatabaseStream (SETQ DatabaseStream PSA.Database)) (NC.PrintMsg2 Window T "Please select parent Box(es)." (CHARACTER 13)) (SETQ ParentIDs (NC.SelectNoteCards NIL NIL NC.SelectingParentsMenu Window)) (* Check to make sure that cards specified are in fact contents cards.) (NC.ClearMsg Window T) (COND ((NULL (SETQ ParentIDs (for ParentID in ParentIDs when (AND (COND ((EQ ParentID ID) (NC.PrintMsg2 Window NIL "A Box cannot be its own parent." (CHARACTER 13) (NC.RetrieveTitle ID) " ignored." (CHARACTER 13)) NIL) (T T)) (OR (COND ((NC.ActiveCardP ParentID) (EQ (NC.FetchType ParentID) (QUOTE CONTENTS))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (NC.GetNoteCard ParentID DatabaseStream) (PROG1 (EQ (NC.FetchType ParentID) (QUOTE CONTENTS)) (NC.DeactivateCard ParentID))))) (PROG1 NIL (NC.PrintMsg2 Window NIL ParentID " is not a FileBox." (CHARACTER 13) "It will not be used as a parent.")))) collect ParentID))) (NC.PrintMsg2 Window T "None of the parents specified are FileBoxes." (CHARACTER 13) "Creating of new FileBox cancelled.") (CLOSEW Window) (RETURN NIL))) (* Display the card) (WINDOWADDPROP Window (QUOTE CLOSEFN) (FUNCTION NC.TEditCloseFn)) (WINDOWPROP Window (QUOTE SHRINKFN) (FUNCTION NC.ShrinkFn)) (TEDIT TextStream Window NIL (LIST (QUOTE FONT) PSA.TimesRoman10 (QUOTE TITLEMENUFN) (FUNCTION NC.TEditMenuFn))) (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK)) (* hook it up. Must be done after the TEdit window is open) (NC.ActivateCard ID) (for ParentID in ParentIDs do (NC.MakeAContentsHook ParentID ID (QUOTE Sub) DatabaseStream)) (replace (TEXTOBJ \DIRTY) of (TEXTOBJ TextStream) with T) (AND (GETPROMPTWINDOW Window NIL NIL T) (PROG1 (DISMISS 1000) (NC.ClearMsg Window T))) (RETURN Window)))) ) (* Links mechanism) [DECLARE: EVAL@COMPILE (RECORD BrowserSpecs (Format Font MotherD PersonalD FamilyD) Format ←(LIST (QUOTE LATTICE)) PersonalD ← 10) (RECORD NOTECARDLINK (DESTINATIONID LINKLABEL DISPLAYMODE) (TYPE? (AND (LISTP DATUM) (EQ (LENGTH DATUM) 3) (NC.IDP (CAR DATUM))))) ] (DEFINEQ (NC.AddFromLink (LAMBDA (ID DatabaseStream Link) (* fgh: "23-Apr-84 19:57") (COND ((NC.ActiveCardP ID) (NC.SetFromLinks ID (CONS Link (NC.FetchFromLinks ID))) (NC.SetLinksDirtyFlg ID T)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.AddFromLink") (NC.GetLinks ID DatabaseStream) (NC.SetFromLinks ID (CONS Link (NC.FetchFromLinks ID))) (NC.SetLinksDirtyFlg ID T) (NC.PutLinks ID DatabaseStream)) (NC.SetFromLinks ID NIL) (NC.SetToLinks ID NIL))))) (NC.AddLinkToGraphCard (LAMBDA (Window) (* NoteCards% User "21-Jun-84 21:41") (* Add a NOTECARD link to a graph card. Pass the Annotation type information down to GRAPHER.ANNO.ADDNODEFN via a window property) (PROG ((Label (NC.AskLinkLabel Window NIL NIL T T))) (OR Label (RETURN)) (WINDOWPROP Window (QUOTE AnnotationTypeToBeAdded) (LIST Label (QUOTE NOTECARD))) (EDITADDNODE Window) (WINDOWPROP Window (QUOTE AnnotationTypeToBeAdded) NIL)))) (NC.AddLinkToSketchCard (LAMBDA (SketchWindow) (* NoteCards% User "21-Jun-84 21:41") (* Called from a SKETCH window to add a new NoteCard to the sketch) (PROG ((Label (NC.AskLinkLabel SketchWindow NIL NIL T T))) (RETURN (SK.ADD.ANNOTATION SketchWindow NIL (LIST Label (QUOTE NOTECARD))))))) (NC.AddLinkToTextCard (LAMBDA (TextStream) (* NoteCards% User "21-Jun-84 21:40") (* Called from a TEXT TEdit window to add a new lionk to the text.) (PROG ((Label (NC.AskLinkLabel (WINDOW.FROM.TEDIT.THING TextStream) NIL NIL T T))) (AND Label (RETURN (ADD.ANNO.TO.TEXT TextStream (LIST Label (QUOTE NOTECARD)) NIL NIL T)))))) (NC.AddSourceLink (LAMBDA (ID DestinationID DatabaseStream) (* fgh: "25-May-84 19:41") (* Add a source link from card ID to card DestinationID in DatabaseStream) (COND ((NEQ DestinationID (QUOTE NC00000)) (NC.AddToLink ID DatabaseStream (create NOTECARDLINK DESTINATIONID ← DestinationID LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ←(QUOTE Title))) (NC.AddFromLink DestinationID DatabaseStream (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ←(QUOTE Title))))) (NC.SetGlobalLinks ID (CONS (create NOTECARDLINK DESTINATIONID ← DestinationID LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ←(QUOTE Title)) (REMOVE (create NOTECARDLINK DESTINATIONID ←(QUOTE NC00000) LINKLABEL ← NC.SourceLinkLabel DISPLAYMODE ←(QUOTE Title)) (NC.FetchGlobalLinks ID)))) NIL)) (NC.AddToLink (LAMBDA (ID DatabaseStream Link) (* fgh: "23-Apr-84 19:56") (COND ((NC.ActiveCardP ID) (NC.SetToLinks ID (CONS Link (NC.FetchToLinks ID))) (NC.SetLinksDirtyFlg ID T)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.AddFromLink") (NC.GetLinks ID DatabaseStream) (NC.SetToLinks ID (CONS Link (NC.FetchToLinks ID))) (NC.SetLinksDirtyFlg ID T) (NC.PutLinks ID DatabaseStream)) (NC.SetFromLinks ID NIL) (NC.SetToLinks ID NIL))))) (NC.DelFromLink (LAMBDA (ID DatabaseStream Link NoOrphanHookFlg) (* NoteCards% User "26-Jun-84 18:21") (* Delete a FromLink from card specified by ID on DatabaseStream. Hook card to orphan if this is the last link.) (PROG ((FilingLinks (LIST NC.FiledCardLinkLabel NC.SubBoxLinkLabel))) (RETURN (COND ((NC.ActiveCardP ID) (NC.SetFromLinks ID (DREMOVE (for OldLink in (NC.FetchFromLinks ID) thereis (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (fetch (NOTECARDLINK DESTINATIONID) of OldLink)) (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) (fetch (NOTECARDLINK LINKLABEL) of OldLink)) OldLink)) (NC.FetchFromLinks ID))) (NC.SetLinksDirtyFlg ID T) (AND (NULL NoOrphanHookFlg) (NOT (FMEMB ID NC.TopLevelCards)) (OR (NULL (NC.FetchNewCardFlg ID)) (EQ (NC.FetchType ID) (QUOTE CONTENTS))) (for Link in (NC.FetchFromLinks ID) never (FMEMB (fetch (NOTECARDLINK LINKLABEL) of Link) FilingLinks)) (NOT (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) NC.OrphanID)) (PROGN (NC.PrintMsg2 NIL T "You have just unfiled " (NC.RetrieveTitle ID) " from its last FileBox." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard ID NC.OrphanID DatabaseStream)))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.AddFromLink") (NC.GetLinks ID DatabaseStream) (NC.SetFromLinks ID (DREMOVE (for OldLink in (NC.FetchFromLinks ID) thereis (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (fetch (NOTECARDLINK DESTINATIONID) of OldLink)) (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) (fetch (NOTECARDLINK LINKLABEL) of OldLink)) OldLink)) (NC.FetchFromLinks ID))) (NC.SetLinksDirtyFlg ID T) (NC.PutLinks ID DatabaseStream) (AND (NULL NoOrphanHookFlg) (NOT (FMEMB ID NC.TopLevelCards)) (for Link in (NC.FetchFromLinks ID) never (FMEMB (fetch (NOTECARDLINK LINKLABEL) of Link) FilingLinks)) (NOT (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) NC.OrphanID)) (PROGN (NC.PrintMsg2 NIL T "You have just unfiled " (NC.RetrieveTitle ID) " from its last FileBox." (CHARACTER 13) "It is being filed in the Orphan FileBox.") (NC.HookToOrphanCard ID NC.OrphanID DatabaseStream))) ) (NC.SetFromLinks ID NIL) (NC.SetToLinks ID NIL))))))) (NC.DelToLink (LAMBDA (ID DatabaseStream Link) (* fgh: "23-Apr-84 19:56") (COND ((NC.ActiveCardP ID) (NC.SetToLinks ID (DREMOVE (for OldLink in (NC.FetchToLinks ID) thereis (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (fetch (NOTECARDLINK DESTINATIONID) of OldLink)) (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) (fetch (NOTECARDLINK LINKLABEL) of OldLink)) OldLink)) (NC.FetchToLinks ID))) (NC.SetLinksDirtyFlg ID T)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.AddFromLink") (NC.GetLinks ID DatabaseStream) (NC.SetToLinks ID (DREMOVE (for OldLink in (NC.FetchToLinks ID) thereis (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (fetch (NOTECARDLINK DESTINATIONID) of OldLink)) (EQ (fetch (NOTECARDLINK LINKLABEL) of Link) (fetch (NOTECARDLINK LINKLABEL) of OldLink)) OldLink)) (NC.FetchToLinks ID))) (NC.SetLinksDirtyFlg ID T) (NC.PutLinks ID DatabaseStream)) (NC.SetFromLinks ID NIL) (NC.SetToLinks ID NIL))))) (NC.DelReferencesToCard (LAMBDA (SourceID DestinationID DatabaseStream) (* fgh: "23-Apr-84 21:00") (* The card specified by DestinationID is being deleted. Remove all references to it from the card specified by SourceID) (PROG (NoteCardType Substance) (COND ((NC.ActiveCardP SourceID) (SETQ NoteCardType (NC.FetchType SourceID)) (SETQ Substance (NC.FetchSubstance SourceID)) (SELECTQ NoteCardType ((TEXT CONTENTS) (NC.DelReferencesToCardFromText Substance DestinationID)) ((SKETCH MAP) (NC.DelReferencesToCardFromSketch Substance DestinationID)) ((GRAPH BROWSER) (NC.DelReferencesToCardFromGraph Substance DestinationID) (REDISPLAYGRAPH (NC.FetchWindow SourceID))) (SHOULDNT "Unknown Substance type"))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.DeleteReferencesToCard") (NC.GetNoteCard SourceID DatabaseStream) (SETQ NoteCardType (NC.FetchType SourceID)) (SETQ Substance (NC.FetchSubstance SourceID)) (SELECTQ NoteCardType ((TEXT CONTENTS) (NC.DelReferencesToCardFromText Substance DestinationID)) ((SKETCH MAP) (NC.DelReferencesToCardFromSketch Substance DestinationID)) ((GRAPH BROWSER) (NC.DelReferencesToCardFromGraph Substance DestinationID)) (SHOULDNT "Unknown Substance type")) (NC.PutNoteCard SourceID DatabaseStream) (NC.DeactivateCard SourceID)))) (NC.DelReferencesToCardFromGlobalList SourceID DestinationID DatabaseStream)))) (NC.DelReferencesToCardFromGlobalList (LAMBDA (SourceID DestinationID DatabaseStream) (* fgh: "23-Apr-84 21:00") (* The card specified by DestinationID is being deleted. Remove all references to it from the global links list of the card specified by SourceID) (COND ((NC.ActiveCardP SourceID) (NC.SetGlobalLinks ID (for Link in (NC.FetchGlobalLinks ID) when (NEQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) collect Link))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (NC.GetLinks ID DatabaseStream) (NC.SetGlobalLinks ID (for Link in (NC.FetchGlobalLinks ID) when (NEQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) collect Link)) (NC.PutLinks ID DatabaseStream)))))) (NC.DelReferencesToCardFromGraph (LAMBDA (Graph DestinationID) (* fgh: "26-Mar-84 19:55") (* Delete from the graph specified by Graph all NOTECARD annotation nodes whose DESTINATIONID is eq to DestinationID) (PROG (Anno) (for GraphNode in (fetch (GRAPH GRAPHNODES) of Graph) do (AND (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation))) (EQ (NC.FetchSubstanceTypeFromAnno Anno) (QUOTE NOTECARD)) (EQ (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno Anno)) DestinationID) (PROGN (PUTPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation) NIL) (replace (GRAPHNODE NODELABEL) of GraphNode with (NC.BitMapFromImageObject NC.DeletedLinkImageObject)) (replace (GRAPHNODE NODELABELBITMAP) of GraphNode with (fetch (GRAPHNODE NODELABEL) of GraphNode)))))))) (NC.DelReferencesToCardFromSketch (LAMBDA (Substance DestinationID) (* fgh: "26-Feb-84 19:09") (for AnnotatedItem in (SUBSET (fetch (SKETCH SKETCHELTS) of Substance) (FUNCTION (LAMBDA (SketchElt) (fetch (GLOBALPART SKANNOTATION) of SketchElt)))) do (for Anno in (fetch (GLOBALPART SKANNOTATION) of AnnotatedItem) when (AND (EQ (fetch (ANNOSUBSTANCE SUBSTANCETYPE) of (fetch (ANNO ANNO\SUBSTANCE) of Anno)) (QUOTE NOTECARD)) (EQ (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of Anno)) DestinationID)) do (replace (GLOBALPART SKANNOTATION) of AnnotatedItem with (REMOVE Anno (fetch (GLOBALPART SKANNOTATION) of AnnotatedItem))))))) (NC.DelReferencesToCardFromText (LAMBDA (Substance DestinationID) (* fgh: "20-Apr-84 00:56") (* Delete all IMAGEOBJECTS in textstream specified by Substance that are NOTECARD ANNOs whose DESTINATIONID is eq to Destination ID) (PROG (NoteCardLinks) (SETQ NoteCardLinks (TEDIT.LIST.OF.OBJECTS (TEXTOBJ Substance) (FUNCTION NOTECARD.ANNO.IMAGEOBJP))) (RETURN (for Link in NoteCardLinks when (EQ (fetch (NOTECARDLINK DESTINATIONID) of (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of (fetch (IMAGEOBJ OBJECTDATUM) of (CAR Link))))) DestinationID) do (replace (IMAGEOBJ IMAGEOBJFNS) of (CAR Link) with NC.NoDeleteImageFns) (* WHENDELETEDFN taken care of earlier in delete cycle) (TEDIT.DELETE Substance (CADR Link) 1) (TEDIT.INSERT.OBJECT NC.DeletedLinkImageObject Substance (CADR Link))))))) (NC.DeletedLinkDisplayFn (LAMBDA (ImageObj Stream) (* NoteCards% User " 7-Jun-84 18:31") (SELECTQ (IMAGESTREAMTYPE Stream) (DISPLAY (* This is being displayed on the screen) (PROG ((ImageBox (NC.DeletedLinkImageBoxFn ImageObj Stream)) Bottom XSize YSize Left) (DSPXPOSITION (IPLUS 3 (SETQ Left (DSPXPOSITION NIL Stream))) Stream) (SETQ XSize (fetch (IMAGEBOX XSIZE) of ImageBox)) (SETQ YSize (fetch (IMAGEBOX YSIZE) of ImageBox)) (SETQ Bottom (IDIFFERENCE (DSPYPOSITION NIL Stream) (fetch (IMAGEBOX YDESC) of ImageBox))) (* don't bother to errorset this) (DSPFONT (PROG1 (DSPFONT TEDIT.DEFAULT.FONT Stream) (PRIN1 "Deleted" Stream)) Stream) (BITBLT NIL NIL NIL Stream (ADD1 Left) (IPLUS Bottom 2) (IDIFFERENCE XSize 2) (IDIFFERENCE YSize 4) (QUOTE TEXTURE) (QUOTE INVERT) BLACKSHADE))) ((PRESS INTERPRESS) (* It's being displayed on a press file) NIL) NIL))) (NC.DeletedLinkGetFn (LAMBDA (InputStream TextStream) (* fgh: "26-Feb-84 01:17") (BIN InputStream) NC.DeletedLinkImageObject)) (NC.DeletedLinkImageBoxFn (LAMBDA (ImageObj Stream) (* NoteCards% User " 7-Jun-84 18:29") (PROG ((Font TEDIT.DEFAULT.FONT)) (RETURN (create IMAGEBOX XSIZE ←(IPLUS 6 (STRINGWIDTH "Deleted" Font)) YSIZE ←(IPLUS 4 (FONTPROP Font (QUOTE HEIGHT))) YDESC ←(IPLUS 2 (FONTPROP Font (QUOTE DESCENT))) XKERN ← 0))))) (NC.DeletedLinkPutFn (LAMBDA (ImageObj OutputStream) (* fgh: "26-Feb-84 01:04") (BOUT OutputStream 1))) (NC.CheckForOrphanDelete (LAMBDA (SourceID DestinationID SourceWindow) (* NoteCards% User " 6-Jun-84 15:46") (* Check to make sure we are not deleteing the last reference to a note card from the orphan card. Last references are okay to delete it since they will be put in the orphan card. But deleting last reference from the orphan card is very, very bad. Warn the user.) (PROG ((FilingLinks (LIST NC.SubBoxLinkLabel NC.FiledCardLinkLabel))) (RETURN (AND (EQ SourceID NC.OrphanID) (NOT (for Link in (COND ((NC.ActiveCardP DestinationID) (NC.FetchFromLinks DestinationID)) (T (NC.GetLinks DestinationID PSA.Database) (NC.FetchFromLinks DestinationID))) thereis (AND (FMEMB (fetch (NOTECARDLINK LINKLABEL) of Link) FilingLinks) (NEQ (fetch (NOTECARDLINK DESTINATIONID) of Link) NC.OrphanID)))) (NC.PrintMsg2 (NC.FetchWindow SourceID) T (NC.RetrieveTitle DestinationID) (CHARACTER 13) "You have just deleted the last pointer to this Card/Box from the Orphan Box." (CHARACTER 13) "The Search operation can be used to create a new pointer.")))))) (NC.FetchAnnoDisplayFn (LAMBDA (Anno) (* fgh: " 9-Apr-84 22:34") (fetch (ANNOSUBSTANCETYPE DISPLAYFN) of (ANNOSUBSTANCETYPE (NC.FetchSubstanceTypeFromAnno Anno)))) ) (NC.FetchAnnoImageBoxFn (LAMBDA (Anno) (* fgh: " 9-Apr-84 22:34") (fetch (ANNOSUBSTANCETYPE IMAGEBOXFN) of (ANNOSUBSTANCETYPE (NC.FetchSubstanceTypeFromAnno Anno))) )) (NC.FetchSubstanceFromAnno (LAMBDA (NoteCardAnno) (* fgh: "27-Feb-84 20:21") (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of NoteCardAnno))) ) (NC.HookToOrphanCard (LAMBDA (ID OrphanCardID DatabaseStream FromID) (* NoteCards% User "26-Jun-84 18:24") (* The last reference to the card has just been deleted. Hook this card to the orphan card so it doesn't get lost forever) (COND ((NC.ActiveCardP OrphanCardID) (NC.MakeAContentsHook OrphanCardID ID (COND ((EQ (NC.RetrieveType ID DatabaseStream) (QUOTE CONTENTS)) (QUOTE Sub)) (T NIL)) DatabaseStream)) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (NC.GetNoteCard OrphanCardID DatabaseStream) (NC.MakeAContentsHook OrphanCardID ID (COND ((EQ (NC.RetrieveType ID DatabaseStream) (QUOTE CONTENTS)) (QUOTE Sub)) (T NIL)) DatabaseStream) (NC.PutNoteCard OrphanCardID DatabaseStream) (NC.PutLinks OrphanCardID DatabaseStream) (NC.DeactivateCard OrphanCardID)))))) (NC.InsertLinkAndTitleBeforeMarker (LAMBDA (SourceID DestinationID LinkLabel DisplayMode Marker# DatabaseStream) (* NoteCards% User "13-Jun-84 01:01") (* Insert a link to DestinationID in SourceID just before the Marker#'th place marker object) (PROG (Objects TextStream TextObject SEL (Spacer (CONCAT (CHARACTER 13)))) (COND ((NC.ActiveCardP SourceID) (SETQ TextStream (NC.FetchSubstance SourceID)) (SETQ TextObject (TEXTOBJ TextStream)) (SETQ Objects (TEDIT.LIST.OF.OBJECTS TextObject (FUNCTION NC.PlaceMarkerP))) (COND ((AND Objects (FIXP Marker#)) (COND ((EQ Marker# 0) (TEDIT.SETSEL TextStream 1 0 (QUOTE LEFT))) ((IGREATERP Marker# (FLENGTH Objects)) (TEDIT.SETSEL TextStream (GETEOFPTR TextStream) 0 (QUOTE RIGHT))) (T (TEDIT.SETSEL TextStream (CADAR (FNTH Objects Marker#)) 0 (QUOTE LEFT))))) (T (TEDIT.SETSEL TextStream (GETEOFPTR TextStream) 0 (QUOTE RIGHT)))) (SETQ SEL (fetch (TEXTOBJ SEL) of TextObject)) (TEDIT.INSERT.OBJECT (IMAGEOBJFROMANNO (ANNO.CREATE NIL "Note1" NIL NIL NIL NIL NIL (QUOTE NOTECARD) NIL (QUOTE DUMMYNODE) (create ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC ←( NC.MakeAnnotationLink NIL LinkLabel DestinationID SourceID DisplayMode)))) TextStream (SELECTQ (fetch (SELECTION POINT) of SEL) (LEFT (fetch (SELECTION CH#) of SEL)) (RIGHT (IMIN (ADD1 (fetch (TEXTOBJ TEXTLEN) of TextObject) ) (ADD1 (fetch (SELECTION CHLIM) of SEL)))) NIL)) (* Check if there is a window because it appears that TEDIT \FIXSEL messes up the selection at least under TEDIT.INSERT.OBJECT) (TEDIT.SETSEL TextStream (COND ((fetch (TEXTOBJ \WINDOW) of TextObject) (IDIFFERENCE (fetch (SELECTION CHLIM) of (TEDIT.GETSEL TextStream)) 2)) (T (SUB1 (fetch (SELECTION CHLIM) of (TEDIT.GETSEL TextStream))))) 0 (QUOTE RIGHT)) (TEDIT.INSERT TextStream Spacer) (COND ((WINDOWP (fetch (TEXTOBJ \WINDOW) of TextObject)) (\TEDIT.REPAINTFN (fetch (TEXTOBJ \WINDOW) of TextObject))))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream) (COND ((NC.IDP (NC.GetNoteCard SourceID DatabaseStream)) (SETQ TextStream (NC.FetchSubstance SourceID)) (SETQ TextObject (TEXTOBJ TextStream)) (SETQ Objects (TEDIT.LIST.OF.OBJECTS TextObject (FUNCTION NC.PlaceMarkerP))) (COND ((AND Objects (FIXP Marker#)) (COND ((EQ Marker# 0) (TEDIT.SETSEL TextStream 1 0 (QUOTE LEFT))) ((IGREATERP Marker# (FLENGTH Objects)) (TEDIT.SETSEL TextStream (GETEOFPTR TextStream) 0 (QUOTE RIGHT))) (T (TEDIT.SETSEL TextStream (CADAR (FNTH Objects Marker#)) 0 (QUOTE LEFT))))) (T (TEDIT.SETSEL TextStream (GETEOFPTR TextStream) 0 (QUOTE RIGHT)))) (SETQ SEL (fetch (TEXTOBJ SEL) of TextObject)) (TEDIT.INSERT.OBJECT (IMAGEOBJFROMANNO (ANNO.CREATE NIL "Note1" NIL NIL NIL NIL NIL (QUOTE NOTECARD) NIL (QUOTE DUMMYNODE) (create ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC ←( NC.MakeAnnotationLink NIL LinkLabel DestinationID SourceID DisplayMode)))) TextStream (SELECTQ (fetch (SELECTION POINT) of SEL) (LEFT (fetch (SELECTION CH#) of SEL)) (RIGHT (IMIN (ADD1 (fetch (TEXTOBJ TEXTLEN) of TextObject) ) (ADD1 (fetch (SELECTION CHLIM) of SEL)))) NIL)) (TEDIT.SETSEL TextStream (SUB1 (fetch (SELECTION CHLIM) of (TEDIT.GETSEL TextStream))) 0 (QUOTE RIGHT)) (TEDIT.INSERT TextStream Spacer) (NC.PutNoteCard SourceID DatabaseStream) (NC.PutLinks SourceID DatabaseStream) (NC.DeactivateCard SourceID))))))))) (NC.LinkLabelP (LAMBDA (Link ListOfLabels) (* fgh: "20-Apr-84 01:29") (COND ((FMEMB (fetch (NOTECARDLINK LINKLABEL) of Link) (OR (LISTP ListOfLabels) (LIST ListOfLabels))) T) (T NIL)))) (NC.MakeAContentsHook (LAMBDA (ContentsID DestinationID SubOrSuperFlg DatabaseStream) (* fgh: "25-May-84 19:24") (* Make a link from a contents card to another card as specified by DestinationID. If card is a regular card, insert link at end of contents card. If card is a supercontents of contents card then insert just before the subcontents marker (i.e., at end of super contents list). If card is a subcontents card then insert just before note cards marker (i.e., at end of subcontents list)) (COND ((EQ SubOrSuperFlg (QUOTE Sub)) (NC.InsertLinkAndTitleBeforeMarker ContentsID DestinationID NC.SubBoxLinkLabel NIL 2 DatabaseStream)) (T (NC.InsertLinkAndTitleBeforeMarker ContentsID DestinationID NC.FiledCardLinkLabel NIL NIL DatabaseStream))))) (NC.MakeAnnotationLink (LAMBDA (AnnoWindow LinkLabel DestinationID SourceID DisplayMode) (* NoteCards% User " 4-Jun-84 21:16") (* Make a ANNO NOTECARD SUBSTANCE for a link from (OR AnnoWindow SourceID) to DestinationID with linklabel of LinkLabel) (PROG NIL (OR SourceID (SETQ SourceID (NC.IDFromWindow AnnoWindow))) (OR DestinationID (PROGN (NC.PrintMsg2 (NC.FetchWindow SourceID) T "Please select the Card or Box to be pointed to." (CHARACTER 13)) (SETQ DestinationID (NC.SelectNoteCards T (FUNCTION (LAMBDA (CardID) (COND ((NEQ CardID SourceID) T) (T (NC.PrintMsg2 (NC.FetchWindow SourceID) T "A Card/Box cannot point to itself. " (CHARACTER 13) "Selection ignored." (CHARACTER 13)) NIL)))) NC.SelectingSingleCardMenu SourceID)) (NC.ClearMsg (NC.FetchWindow SourceID) T))) (AND (NULL DestinationID) (COND ((RELSTK (STKPOS (QUOTE ANNO.CREATE.AND.DISPLAY))) (RETFROM (QUOTE ANNO.CREATE.AND.DISPLAY))) (T (NC.ReportError "NC.MakeAnnotationLink" "NULL DestinationID when not called under ANNO.CREATE.AND.DISPLAY.")))) (COND ((EQ DestinationID (QUOTE *New% Card*)) (SETQ DestinationID (WINDOWPROP (NC.MakeNoteCard) (QUOTE NoteCardID))))) (NC.AddToLink SourceID PSA.Database (create NOTECARDLINK DESTINATIONID ← DestinationID LINKLABEL ← LinkLabel DISPLAYMODE ← NIL)) (NC.AddFromLink DestinationID PSA.Database (create NOTECARDLINK DESTINATIONID ← SourceID LINKLABEL ← LinkLabel DISPLAYMODE ← NIL)) (RETURN (create NOTECARDLINK DESTINATIONID ← DestinationID LINKLABEL ← LinkLabel DISPLAYMODE ←(OR DisplayMode (NC.DefaultLinkDisplayMode SourceID))))))) (NC.MakeContentsHooks (LAMBDA (ID DatabaseStream OptionalFilingFlg) (* NoteCards% User " 6-Jun-84 14:56") (* Hooks card specified by ID to all of the current contents cards by a Contents link) (PROG (OneHook (Window (NC.FetchWindow ID))) (for ContentsCard in (NC.DetermineContentsCards DatabaseStream OptionalFilingFlg ID) do (COND ((NC.ActiveCardP ContentsCard) (COND ((EQ (NC.FetchType ContentsCard) (QUOTE CONTENTS)) (SETQ OneHook T) (NC.MakeAContentsHook ContentsCard ID NIL DatabaseStream)) (T (NC.PrintMsg2 Window NIL (NC.RetrieveTitle ContentsCard) " is not a FileBox - ignored." (CHARACTER 13))))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.MakeContentsHooks") (NC.GetNoteCard ContentsCard DatabaseStream) (COND ((EQ (NC.FetchType ContentsCard) (QUOTE CONTENTS)) (SETQ OneHook T) (NC.MakeAContentsHook ContentsCard ID NIL DatabaseStream)) (T (NC.PrintMsg2 Window NIL (NC.RetrieveTitle ContentsCard) " is not a FileBox - ignored." (CHARACTER 13)))) (NC.PutNoteCard ContentsCard DatabaseStream) (NC.PutLinks ContentsCard DatabaseStream) (NC.DeactivateCard ContentsCard))))) (COND ((NULL OneHook) (NC.PrintMsg2 Window T "No FileBox has been specified." (CHARACTER 13)) (COND ((NOT OptionalFilingFlg) (NC.PrintMsg2 Window NIL "This card will be filed in the ToBeFiled Box." (CHARACTER 13)) (NC.HookToOrphanCard ID NC.UnclassifiedID DatabaseStream NIL)) (T (NC.PrintMsg2 Window NIL "Filing request cancelled." (CHARACTER 13)))))) (COND ((GETPROMPTWINDOW Window NIL NIL T) (SPAWN.MOUSE) (DISMISS 2000) (NC.ClearMsg Window T)))))) (NC.RelabelLink (LAMBDA (AnnoOrImageObject Window) (* NoteCards% User "25-Jun-84 19:05" pp pp) (* Relabel a NoteCard link. Ask user for new label. Update all the proper references to this link.) (PROG (Link ToLinks FromLinks ID NewLabel DestinationID OldLabel (Anno (COND ((IMAGEOBJP AnnoOrImageObject) (IMAGEOBJPROP AnnoOrImageObject (QUOTE OBJECTDATUM))) (T AnnoOrImageObject)))) (SETQ Link (NC.FetchSubstanceFromAnno Anno)) (COND ((NC.SystemLinkLabelP (fetch (NOTECARDLINK LINKLABEL) of Link)) (NC.PrintMsg2 Window T "This is a system maintained pointer." (CHARACTER 13) "You cannot change its label." (CHARACTER 13)) (SPAWN.MOUSE) (DISMISS 1500) (NC.ClearMsg Window T)) (T (SETQ OldLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) (COND ((SETQ NewLabel (NC.AskLinkLabel Window NIL NIL T T)) (replace (NOTECARDLINK LINKLABEL) of Link with NewLabel) (SETQ ID (NC.IDFromWindow Window)) (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (* Update link list attached to this card.) (SETQ ToLinks (NC.FetchToLinks ID)) (for ToLink in ToLinks when (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of ToLink) DestinationID) (EQ (fetch (NOTECARDLINK LINKLABEL) of ToLink) OldLabel)) do (replace (NOTECARDLINK LINKLABEL) of ToLink with NewLabel) (NC.SetLinksDirtyFlg ID T) (RETURN)) (* Update the inverse of this link) (COND ((NC.ActiveCardP DestinationID) (SETQ FromLinks (NC.FetchFromLinks DestinationID)) (for FromLink in FromLinks when (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of FromLink) ID) (EQ (fetch (NOTECARDLINK LINKLABEL) of FromLink) OldLabel)) do (replace (NOTECARDLINK LINKLABEL) of FromLink with NewLabel) (NC.SetLinksDirtyFlg DestinationID T) (RETURN))) (T (WITH.MONITOR (NC.FetchMonitor PSA.Database) (NC.GetLinks DestinationID PSA.Database) (SETQ FromLinks (NC.FetchFromLinks DestinationID)) (for FromLink in FromLinks when (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of FromLink) ID) (EQ (fetch (NOTECARDLINK LINKLABEL) of FromLink) OldLabel)) do (replace (NOTECARDLINK LINKLABEL) of FromLink with NewLabel) (NC.SetLinksDirtyFlg DestinationID T) (RETURN)) (NC.PutLinks DestinationID PSA.Database) (NC.DeactivateCard DestinationID)))) (* Update images in this window) (NC.UpdateLinkImages Window (fetch (NOTECARDLINK DESTINATIONID) of Link))))))))) (NC.SystemLinkLabelP (LAMBDA (LinkLabel) (* fgh: "23-Apr-84 23:07") (* Return T in LinkLabel is a label for a system maintained link. NIL otherwise. System maintained links determined by hardwire list for now.) (FMEMB LinkLabel NC.SystemLinkLabels))) (NC.ValidLinkP (LAMBDA (Link DatabaseStream ZeroLinkOkayFlg) (* fgh: "29-May-84 16:07") (* Check Link to see if it is a valid NOTECARDLINK, incvluding check that the NoteCard specified by DESTINATIONID is an active card.) (PROG (DestinationID) (* If old format Link, just add on extra field) (AND (EQ (LENGTH Link) 2) (NCONC1 Link NIL)) (RETURN (AND (type? NOTECARDLINK Link) (OR (NC.IDP (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link))) (AND ZeroLinkOkayFlg (EQ DestinationID (QUOTE NC00000)))) (PROG1 (OR (AND ZeroLinkOkayFlg (EQ DestinationID (QUOTE NC00000))) (EQ (NC.GetNoteCard DestinationID DatabaseStream) DestinationID)) (NC.DeactivateCard DestinationID))))))) ) (* Link display icons) (DEFINEQ (NC.ChangeLinkDisplayMode (LAMBDA (AnnoOrImageObject Window) (* NoteCards% User " 4-Jun-84 21:14") (* Change the display mode of the NOTECARDLINK contained in ImageObject in Window. Have the user choose the new display mode.) (PROG (Link (Anno (COND ((IMAGEOBJP AnnoOrImageObject) (IMAGEOBJPROP AnnoOrImageObject (QUOTE OBJECTDATUM))) (T AnnoOrImageObject))) (ID (NC.IDFromWindow Window))) (COND ((FMEMB (NC.FetchType ID) (QUOTE (SKETCH MAP))) (NC.PrintMsg2 Window T "Cannot change display mode of pointers in Sketch or Map Cards." (CHARACTER 13)) (RETURN))) (SETQ Link (NC.FetchSubstanceFromAnno Anno)) (AND (EQP (LENGTH Link) 2) (NCONC Link (LIST NIL))) (replace (NOTECARDLINK DISPLAYMODE) of Link with (OR (MENU (OR NC.LinkDisplayModesMenu (SETQ NC.LinkDisplayModesMenu (create MENU ITEMS ←(QUOTE ((NoteCard% Symbol (QUOTE Icon)) (Title% of% Destination (QUOTE Title)) (Pointer% Label (QUOTE Label)) (Both% Title% and% Label (QUOTE Both)))) TITLE ←(QUOTE Display% Mode?))))) (fetch (NOTECARDLINK DISPLAYMODE) of Link))) (NC.UpdateLinkImages Window (fetch (NOTECARDLINK DESTINATIONID) of Link)) (NC.MarkCardDirty ID)))) (NC.DefaultLinkDisplayMode (LAMBDA (ID DatabaseStream) (* fgh: "19-Apr-84 18:16") (* RETURN the default NoteCard link display mode for the card - SourceID. Default display mode is determined by the card type of SourceID.) (PROG (NoteCardType) (SETQ NoteCardType (NC.RetrieveType ID DatabaseStream)) (RETURN (SELECTQ NoteCardType ((TEXT SKETCH MAP) (QUOTE Icon)) ((GRAPH BROWSER CONTENTS) (QUOTE Title)) (QUOTE Icon)))))) (NC.UpdateLinkImages (LAMBDA (SourceWindowOrID DestinationID) (* fgh: "30-May-84 19:11") (* Update the Link Image Objects in SourceCard that point to DestinationID) (PROG (SourceWindow SourceCardID NoteCardType) (COND ((WINDOWP SourceWindowOrID) (SETQ SourceWindow SourceWindowOrID) (SETQ SourceCardID (NC.IDFromWindow SourceWindowOrID))) (T (SETQ SourceWindow (NC.FetchWindow SourceWindowOrID)) (SETQ SourceCardID SourceWindowOrID))) (SETQ NoteCardType (NC.FetchType SourceCardID)) (SELECTQ NoteCardType ((TEXT CONTENTS) (NC.UpdateLinkImagesInText (OR SourceCardID SourceWindow) DestinationID)) ((SKETCH MAP) (NC.UpdateLinkImagesInSketch SourceCardID DestinationID)) ((BROWSER GRAPH) (NC.UpdateLinkImagesInGraph SourceCardID DestinationID)) (NC.ReportError "NC.UpdateLinkImages" (CONCAT "Unknown card type: " NoteCardType)) )))) (NC.UpdateLinkImagesInGraph (LAMBDA (SourceCardID DestinationID) (* NoteCards% User " 6-Jun-84 19:41") (* Update all the NoteCard links that point to DestinationID from the graph card specified by SourceCardID) (PROG (Window Graph Anno NodeID) (SETQ Window (NC.FetchWindow SourceCardID)) (SETQ Graph (NC.FetchSubstance SourceCardID)) (SETQ ListOfNoteCardLinks (for GraphNode in (fetch (GRAPH GRAPHNODES) of Graph) when (AND (SETQ NodeID (fetch (GRAPHNODE NODEID) of GraphNode)) (LITATOM (COND ((LISTP NodeID) (SETQ NodeID (CAR NodeID))) (T NodeID))) (SETQ Anno (GETPROP NodeID (QUOTE Annotation))) (EQ (QUOTE NOTECARD) (NC.FetchSubstanceTypeFromAnno Anno)) (EQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno Anno)))) collect GraphNode)) (for GraphNode in ListOfNoteCardLinks do (SETQ Anno (PROGN (SETQ NodeID (fetch (GRAPHNODE NODEID) of GraphNode)) (COND ((LISTP NodeID) (SETQ NodeID (CAR NodeID))) (T NodeID)) (GETPROP NodeID (QUOTE Annotation)))) (replace (GRAPHNODE NODELABEL) of GraphNode with (NC.BitMapFromImageObject (IMAGEOBJCREATE Anno (IMAGEFNSCREATE ( NC.FetchAnnoDisplayFn Anno) ( NC.FetchAnnoImageBoxFn Anno))))) (CREATE/LABEL/BITMAP GraphNode T)) (REDISPLAYW Window)))) (NC.UpdateLinkImagesInSketch (LAMBDA (SourceCardID DestinationID) (* fgh: "11-Apr-84 16:53") (* For now do nothing since Link Images in Sketch have no titles.) NIL)) (NC.UpdateLinkImagesInText (LAMBDA (SourceCardIDOrWindow DestinationID) (* NoteCards% User "19-Jun-84 03:18") (* Update the notecard link image objects that point to DestinationID fromn text card SourceCardIDOrWindow) (* For now ignore cards of type TEXT because their link image objects are icons without titles) (PROG (Window TextObject ListOfNoteCardLinks) (SETQ Window (COND ((WINDOWP SourceCardIDOrWindow) SourceCardIDOrWindow) (T (NC.FetchWindow SourceCardIDOrWindow)))) (SETQ TextObject (WINDOWPROP Window (QUOTE TEXTOBJ))) (SETQ ListOfNoteCardLinks (TEDIT.LIST.OF.OBJECTS TextObject (FUNCTION NOTECARD.ANNO.IMAGEOBJP))) (for Link in ListOfNoteCardLinks do (AND (EQ (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno (fetch (IMAGEOBJ OBJECTDATUM) of (CAR Link)))) DestinationID) (TEDIT.OBJECT.CHANGED TextObject (CAR Link)))) (* replace (TEXTOBJ SEL) of TextObject with (create SELECTION using (TEDIT.GETSEL (fetch (TEXTOBJ STREAMHINT) of TextObject)))) (ADD.PROCESS (LIST (QUOTE REDISPLAYW) Window))))) ) (* Interface to ANNO for the Link mechanism) [DECLARE: EVAL@COMPILE (RECORD ANNONOTECARDSUBSTANCE (SUBSTANCETYPE ANNONOTECARDSPEC) SUBSTANCETYPE ←(QUOTE NOTECARD)) ] (DEFINEQ (NOTECARD.ANNO.BUTTONEVENTINFN (LAMBDA (ImageObject WINDOW) (* fgh: "20-Apr-84 17:21") (* If the guy buttons inside the anno...) (PROG (ID ClippingRegion HotRegion LeftButtonFlg (ANNO (IMAGEOBJPROP ImageObject (QUOTE OBJECTDATUM)))) (SETQ WINDOW (COND ((WINDOWP WINDOW) WINDOW) ((DISPLAYSTREAMP WINDOW) (WFROMDS WINDOW)) ((TEXTSTREAMP WINDOW) (WINDOW.FROM.TEDIT.THING WINDOW)) (T NIL))) (SETQ LeftButtonFlg (MOUSESTATE LEFT)) (SETQ ClippingRegion (DSPCLIPPINGREGION NIL WINDOW)) (SETQ HotRegion (CREATEREGION (IPLUS (fetch (REGION LEFT) of ClippingRegion) (FTIMES .25 (fetch (REGION WIDTH) of ClippingRegion))) (fetch (REGION BOTTOM) of ClippingRegion) (FTIMES .5 (fetch (REGION WIDTH) of ClippingRegion)) (fetch (REGION HEIGHT) of ClippingRegion))) (until (OR (MOUSESTATE UP) (INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)))) (AND (MOUSESTATE UP) (RETURN NIL)) (RESETLST (RESETSAVE (INVERTW WINDOW)) (until (OR (MOUSESTATE UP) (NOT (INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)))))) (COND ((INSIDEP HotRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)) (RETURN (COND (NC.SelectionInProgress (* A selection is in progress. Don't really want to edit this object, want to select it. Just add to the selection collection list.) (AND (SETQ ID (fetch (NOTECARDLINK DESTINATIONID) of (NC.FetchSubstanceFromAnno ANNO))) (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards) ))) (LeftButtonFlg (ANNO.EDIT ANNO (ANNO.DEFAULT.REGION ANNO WINDOW (LASTMOUSEY WINDOW)))) (T (NOTECARD.ANNO.MIDDLEBUTTONFN ImageObject WINDOW))))) ((INSIDEP ClippingRegion (LASTMOUSEX WINDOW) (LASTMOUSEY WINDOW)) (RETURN NIL)) (T (RETURN NIL)))))) (NOTECARD.ANNO.CREATEFN (LAMBDA (AnnoWindow LinkLabel) (* fgh: "28-Apr-84 15:05") (create ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC ←(NC.MakeAnnotationLink AnnoWindow (COND ((NLISTP LinkLabel) LinkLabel) (T (CAR LinkLabel))) (COND ((LISTP LinkLabel) (CADR LinkLabel))) NIL (COND ((LISTP LinkLabel) (CADDR LinkLabel))))))) (NOTECARD.ANNO.DISPLAYFN (LAMBDA (ImageObj ImageStream STREAMTYPE TEXTSTREAM SCALE TitleFlg) (* NoteCards% User " 4-Jun-84 20:48") (SELECTQ (IMAGESTREAMTYPE ImageStream) (DISPLAY (* This is being displayed on the screen) (PROG (YSize XSize Left Bottom DisplayType Window ID NoteCardType Title Label ImageBox (Anno (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM)))) (* Determine what type of Display to do) (SETQ DisplayType (COND (TitleFlg (QUOTE Title)) ((fetch (NOTECARDLINK DISPLAYMODE) of (NC.FetchSubstanceFromAnno Anno PSA.Database))) (T (QUOTE Icon)))) (AND (FMEMB DisplayType (QUOTE (Title Both))) (SETQ Title (NC.RetrieveTitle (NC.FetchIDFromAnno Anno) PSA.Database))) (AND (FMEMB DisplayType (QUOTE (Label Both))) (SETQ Label (fetch (NOTECARDLINK LINKLABEL) of ( NC.FetchSubstanceFromAnno Anno PSA.Database)))) (SETQ ImageBox (NOTECARD.ANNO.IMAGEBOXFN ImageObj ImageStream NIL NIL DisplayType Title Label)) (* leave a 6 point border around the id. This has been allowed for by the size fn. The outer 4 points are white, the inner two points are black.) (DSPXPOSITION (IPLUS 6 (SETQ Left (DSPXPOSITION NIL ImageStream))) ImageStream) (SETQ XSize (fetch (IMAGEBOX XSIZE) of ImageBox)) (SETQ YSize (fetch (IMAGEBOX YSIZE) of ImageBox)) (SETQ Bottom (IDIFFERENCE (DSPYPOSITION NIL ImageStream) (fetch (IMAGEBOX YDESC) of ImageBox))) (* don't bother to errorset this) (DSPFONT (PROG1 (DSPFONT (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD)) ImageStream) (PRIN1 (SELECTQ DisplayType (Title Title) (Label (CONCAT "<" Label ">")) (Both (CONCAT "<" Label ">" " " Title)) " ") ImageStream)) ImageStream) (BITBLT NIL NIL NIL ImageStream (IPLUS Left 1) (IPLUS Bottom 1) (IDIFFERENCE XSize 2) (IDIFFERENCE YSize 2) (QUOTE TEXTURE) (QUOTE INVERT) BLACKSHADE) (COND ((EQ DisplayType (QUOTE Icon)) (BITBLT NIL NIL NIL ImageStream (IPLUS Left 3) (IPLUS Bottom 3) (IDIFFERENCE XSize 6) (IDIFFERENCE YSize 8) (QUOTE TEXTURE) (QUOTE INVERT) BLACKSHADE)) (T (BITBLT NIL NIL NIL ImageStream (IPLUS Left 2) (IPLUS Bottom 2) (IDIFFERENCE XSize 4) (IDIFFERENCE YSize 4) (QUOTE TEXTURE) (QUOTE INVERT) BLACKSHADE))))) ((PRESS INTERPRESS) (* It's being displayed on a press file) ???) NIL))) (NOTECARD.ANNO.EDITFN (LAMBDA (ANNO INREGION DURINGCREATIONFLG) (* fgh: "31-Mar-84 02:08") (PROG ((ID (fetch (NOTECARDLINK DESTINATIONID) of (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of ANNO)))) (AnnoType (fetch (ANNO ANNO\TYPE) of ANNO))) (COND ((LISTP AnnoType) (* This is the first entry to edit during the creation of a context hook as indicated by a listp AnnoType field. Make AnnoType a LITATOM and exit without really editing.) (replace (ANNO ANNO\TYPE) of ANNO with (CAR AnnoType))) (DURINGCREATIONFLG (* If DURINGCREATIONFLG is set it means that this is a call under ANNO.CREATE.AND.DISPLAY For NOTECARD links don't display anything during creation) NIL) (T (* Just edit the NoteCard pointed to by the Anno Link) (NC.EditNoteCard ID))) (RETURN ID)))) (NOTECARD.ANNO.GETFN (LAMBDA (INPUTANNO INFILE) (* edited: " 3-Feb-84 10:22") (* Reads a notecard annotation as written by NOTECARD.ANNO.PUTFN) (create ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC ←(READ INFILE)))) (NOTECARD.ANNO.IMAGEBOXFN (LAMBDA (ImageObj ImageStream CurrentX RightMargin DisplayType Title Label) (* NoteCards% User " 7-Jun-84 18:25") (PROG (FONT Window ID NoteCardType (Anno (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM)))) (SETQ DisplayType (COND ((EQ DisplayType T) (QUOTE Title)) (DisplayType DisplayType) ((fetch (NOTECARDLINK DISPLAYMODE) of (NC.FetchSubstanceFromAnno Anno PSA.Database))) (T (QUOTE Icon)))) (AND (FMEMB DisplayType (QUOTE (Title Both))) (OR Title (SETQ Title (NC.RetrieveTitle (NC.FetchIDFromAnno Anno) PSA.Database)))) (AND (FMEMB DisplayType (QUOTE (Label Both))) (OR Label (SETQ Label (fetch (NOTECARDLINK LINKLABEL) of (NC.FetchSubstanceFromAnno Anno PSA.Database))))) (RETURN (SELECTQ (IMAGESTREAMTYPE ImageStream) ((PRESS INTERPRESS) (printout PROMPTWINDOW T "hardcopy not implemented yet") NIL) (PROGN (* default to DISPLAY) (create IMAGEBOX XSIZE ←(IPLUS 12 (STRINGWIDTH (SELECTQ DisplayType (Title Title) (Label (CONCAT "<" Label ">") ) (Both (CONCAT "<" Label ">" " " Title) ) " ") (SETQ FONT (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))))) YSIZE ←(IPLUS (FONTPROP FONT (QUOTE HEIGHT)) 6) YDESC ←(IPLUS 3 (FONTPROP FONT (QUOTE DESCENT))) XKERN ← 0))))))) (NOTECARD.ANNO.IMAGEOBJP (LAMBDA (IMAGEOBJ) (* fgh: "25-Feb-84 16:24") (AND (ANNOIMAGEOBJP IMAGEOBJ) (EQ (fetch (ANNOSUBSTANCE SUBSTANCETYPE) of (fetch (ANNO ANNO\SUBSTANCE) of (fetch (IMAGEOBJ OBJECTDATUM) of IMAGEOBJ))) (QUOTE NOTECARD))))) (NOTECARD.ANNO.LOCATIONMETRIC (LAMBDA NIL (* fgh: "22-Feb-84 22:21") (SHOULDNT "NO locationMetric for NOTECARDS"))) (NOTECARD.ANNO.MIDDLEBUTTONFN (LAMBDA (AnnoOrImageObject Window) (* NoteCards% User "21-Jun-84 22:31") (* Middle button has been pressed in the Notecard pointer. Bring up menu of choices for manipulating this pointer.) (PROG ((Anno (COND ((IMAGEOBJP AnnoOrImageObject) (IMAGEOBJPROP AnnoOrImageObject (QUOTE OBJECTDATUM))) (T Anno)))) (COND ((NC.IDP (NC.IDFromWindow Window)) (SELECTQ (MENU (COND ((type? MENU ANNO.INSPECT.MENU) ANNO.INSPECT.MENU) (T (SETQ ANNO.INSPECT.MENU (create MENU ITEMS ←(QUOTE ((Bring% Up% Card/Box (QUOTE Edit) "Bring up the note card pointed to by this pointer.") (Re-label% Pointer (QUOTE Relabel) "Change the label of this pointer.") (Change% Display (QUOTE Display) "Change the type of information displayed in this pointer."))) CENTERFLG ← T TITLE ← "Pointer Ops"))))) (Edit (ANNO.EDIT Anno (ANNO.DEFAULT.REGION Anno Window (LASTMOUSEY Window)))) (Display (NC.ChangeLinkDisplayMode AnnoOrImageObject Window)) (Relabel (NC.RelabelLink AnnoOrImageObject Window)) NIL)) (T (ANNO.EDIT Anno (ANNO.DEFAULT.REGION Anno Window (LASTMOUSEY Window)))))))) (NOTECARD.ANNO.PUTFN (LAMBDA (ANNONOTECARDSUBSTANCE OUTSTREAM) (* Feuerman " 7-Feb-84 09:20") (* Writes out the Notecard annotation to OUTSTREAM. This annotation is printed simply as the ID of the ANNONOTECARDSUBSTANCE {the ANNONOTECARDSPEC field}) (PRIN1 (CONCAT (MKSTRING (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of ANNONOTECARDSUBSTANCE) ) " ") OUTSTREAM))) (NOTECARD.ANNO.SUMM.DISPLAYFN (LAMBDA (NOTECARDSUBSTANCE SUMMW) (* edited: " 3-Feb-84 09:48") (PRIN3 (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of NOTECARDSUBSTANCE) SUMMW))) (NOTECARD.ANNO.WHENCOPIEDFN (LAMBDA (Anno ToWindowStream FromTextStream ToTextStream) (* fgh: "27-Feb-84 20:41") (PROG (CopyToID DestinationID) (SETQ CopyToID (NC.IDFromWindow (WINDOW.OF.TEXTSTREAM ToTextStream))) (SETQ Link (NC.FetchSubstanceFromAnno Anno)) (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (NC.AddToLink CopyToID PSA.Database Link) (NC.AddFromLink DestinationID PSA.Database (create NOTECARDLINK DESTINATIONID ← CopyToID LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Link)))))) (NOTECARD.ANNO.WHENDELETEDFN (LAMBDA (Anno Stream) (* NoteCards% User "22-Jun-84 19:36") (PROG (Substance SourceID DestinationID LinkType Window) (SETQ SourceID (NC.IDFromWindow (SETQ Window (WFROMDS Stream)))) (COND ((NC.IDP SourceID) (SETQ Substance (fetch (ANNO ANNO\SUBSTANCE) of Anno)) (SETQ Substance (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of Substance)) (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Substance)) (NC.CheckForOrphanDelete SourceID DestinationID (WFROMDS Stream)) (NC.DelFromLink DestinationID PSA.Database (create NOTECARDLINK DESTINATIONID ← SourceID LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Substance))) (NC.DelToLink SourceID PSA.Database Substance)) ((WINDOWPROP Window (QUOTE PropListEditor)) (NC.PrintMsg2 Window T "Note:" (CHARACTER 13) "Deleting a pointer from this list does NOT" (CHARACTER 13) "delete the pointer from the card." (CHARACTER 13)) (ADD.PROCESS (LIST (QUOTE PROGN) (QUOTE (DISMISS 5000)) (LIST (QUOTE AND) (LIST (QUOTE OPENWP) Window) (LIST (QUOTE GETPROMPTWINDOW) Window NIL NIL T) (LIST (QUOTE NC.ClearMsg) Window T))))))))) (NOTECARD.ANNO.WHENINSERTEDFN (LAMBDA (ImageObj WindowStream) (* NoteCards% User "22-Jun-84 19:22") (* An Notecard link is being inserted. If this is a deleteundo, then have to re-establish the link information) (PROG ((StackPointer (STKPOS (QUOTE TEDIT.UNDO.DELETION))) SourceID Link DestinationID LinkLabel) (COND ((NULL StackPointer) (RELSTK StackPointer) (RETURN)) (T (RELSTK StackPointer) (SETQ SourceID (NC.IDFromWindow WindowStream)) (COND ((NC.IDP SourceID) (SETQ Link (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of (fetch (IMAGEOBJ OBJECTDATUM) of ImageObj)))) (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) (SETQ LinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) (NC.AddFromLink DestinationID PSA.Database (create NOTECARDLINK DESTINATIONID ← SourceID LINKLABEL ← LinkLabel)) (NC.AddToLink SourceID PSA.Database (create NOTECARDLINK DESTINATIONID ← DestinationID LINKLABEL ← LinkLabel))))))))) (NOTECARD.ANNO.WHENMOVEDFN (LAMBDA (Anno ToWindowStream FromTextStream ToTextStream) (* fgh: "27-Feb-84 20:42") (NOTECARD.ANNO.WHENCOPIEDFN Anno ToWindowStream FromTextStream ToTextStream))) (NOTECARD.ANNOWINDOWDIRTYP (LAMBDA NIL (* fgh: "22-Feb-84 22:22") NIL)) ) (* BROWSER And Search mechanisms) (DEFINEQ (NC.ChooseBrowseOrSearch (LAMBDA NIL (* fgh: "10-May-84 00:41") (* Asks the user whether a browser or search is desired an calls the appropriate function to do the work.) (PROG (Menu W Z (Font (FONTCREATE (QUOTE HELVETICA) 12 (QUOTE BOLD)))) (SETQ Menu (OR (AND (BOUNDP (QUOTE NC.BrowseOrSearchMenu)) (type? MENU NC.BrowseOrSearchMenu) NC.BrowseOrSearchMenu) (SETQ NC.BrowseOrSearchMenu (create MENU ITEMS ←(QUOTE (Browse Search)) MENUFONT ← Font ITEMHEIGHT ←(IPLUS 2 (FONTPROP Font (QUOTE HEIGHT))) TITLE ← "Which?")))) (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of NC.MainMenu) 1)) NC.MainMenu)) (SETQ Z (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE REGION))) (replace MENUPOSITION of Menu with (CONS (IPLUS (fetch (REGION LEFT) of W) (fetch (REGION LEFT) of Z)) (IPLUS (fetch (REGION TOP) of W) (fetch (REGION BOTTOM) of Z) (IMINUS (fetch (MENU IMAGEHEIGHT) of Menu))))) (RETURN (SELECTQ (MENU Menu) (Browse (NC.MakeNoteCard (QUOTE BROWSER))) (Search (NC.SearchForCards)) NIL))))) (NC.GrowLinkLattice (LAMBDA (RootID CurrentGraph ListOfLinkLabels UniqueNodeLabel DatabaseStream) (* NoteCards% User "17-Jun-84 15:28") (* Grow a lattice by following the links from RootID card that match LinkPredicate. Lattice will be fed to LAYOUTGRAPH, so for each note card encountered by following the links just fill in the ID, LABEL and daughter IDs) (PROG (ToLinks LinkList) (OR UniqueNodeLabel (SETQ UniqueNodeLabel (GENSYM))) (COND ((NC.ActiveCardP RootID) (SETQ ToLinks (NC.FetchToLinks RootID))) (T (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GrowLinkLattice") (NC.GetLinks RootID DatabaseStream) (SETQ ToLinks (NC.FetchToLinks RootID))))) (SETQ ToLinks (for Link in ToLinks when (OR (NULL ListOfLinkLabels) (NC.LinkLabelP Link ListOfLinkLabels)) collect Link)) (AND (NOT (FASSOC (PACK* UniqueNodeLabel RootID) CurrentGraph)) (NCONC1 CurrentGraph (create GRAPHNODE NODEID ←(PACK* UniqueNodeLabel RootID) TONODES ←(PROGN (SETQ LinkList (for Link in ToLinks collect (PACK* UniqueNodeLabel (fetch (NOTECARDLINK DESTINATIONID) of Link)))) (INTERSECTION LinkList LinkList)) NODELABEL ← RootID))) (for Link in ToLinks when (NOT (FASSOC (PACK* UniqueNodeLabel (fetch (NOTECARDLINK DESTINATIONID) of Link)) CurrentGraph)) do (NC.GrowLinkLattice (fetch (NOTECARDLINK DESTINATIONID) of Link) CurrentGraph ListOfLinkLabels UniqueNodeLabel DatabaseStream)) (RETURN CurrentGraph)))) (NC.UpdateBrowserCard (LAMBDA (Window) (* NoteCards% User "17-Jun-84 18:18") (PROG (ID LinkLabels RootID Lattice Anno Graph AnnoImageObj DisplayStream ImageBox NodeLabel OldNode Link PropList BrowserSpecs) (NC.PrintMsg2 Window T (CHARACTER 13) "Computing browser graph. Please wait. ...") (SETQ ID (NC.IDFromWindow Window)) (SETQ PropList (NC.FetchPropList ID)) (SETQ LinkLabels (CAR (LISTGET PropList (QUOTE BrowserLinkLabels)))) (SETQ RootID (LISTGET PropList (QUOTE BrowserRoot))) (SETQ BrowserSpecs (OR (CAR (LISTGET PropList (QUOTE BrowserSpecs))) (create BrowserSpecs))) (SETQ Graph (fetch (GRAPH GRAPHNODES) of (WINDOWPROP Window (QUOTE GRAPH)))) (SETQ Lattice (CDR (NC.GrowLinkLattice RootID (LIST NIL) LinkLabels ID PSA.Database))) (* Remove all links that are in the old browser graph but not in the new one) (for Node in Graph when (AND (NOT (FASSOC (fetch (GRAPHNODE NODEID) of Node) Lattice)) (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of OldNode) (QUOTE Annotation)))) do (WITH.MONITOR (NC.FetchMonitor PSA.Database) (SETQ Link (NC.FetchSubstanceFromAnno Anno)) (NC.DelToLink ID PSA.Database (create NOTECARDLINK DESTINATIONID ←(fetch (NOTECARDLINK DESTINATIONID) of Link) LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Link))) (NC.DelFromLink (fetch (NOTECARDLINK DESTINATIONID) of Link) PSA.Database (create NOTECARDLINK DESTINATIONID ← ID LINKLABEL ←(fetch (NOTECARDLINK DESTINATIONID) of Link)) T))) (* Create Links for all nodes in the new browser graph but not in the old one.) (for Node in Lattice do (COND ((AND (SETQ OldNode (FASSOC (fetch (GRAPHNODE NODEID) of Node) Graph)) (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of OldNode) (QUOTE Annotation))))) (T (SETQ Anno (ANNO.CREATE.AND.DISPLAY (LIST (LIST NC.BrowserContentsLinkLabel (fetch (GRAPHNODE NODELABEL) of Node)) (QUOTE NOTECARD)) Window)) (PUTPROP (fetch (GRAPHNODE NODEID) of Node) (QUOTE Annotation) Anno))) (SETQ AnnoImageObj (IMAGEOBJCREATE Anno (IMAGEFNSCREATE))) (SETQ DisplayStream (DSPCREATE)) (SETQ ImageBox (NOTECARD.ANNO.IMAGEBOXFN AnnoImageObj DisplayStream NIL NIL T)) (SETQ NodeLabel (BITMAPCREATE (fetch (IMAGEBOX XSIZE) of ImageBox) (IPLUS (fetch (IMAGEBOX YSIZE) of ImageBox) (fetch (IMAGEBOX YDESC) of ImageBox)))) (DSPDESTINATION NodeLabel DisplayStream) (DSPYPOSITION (fetch (IMAGEBOX YDESC) of ImageBox) DisplayStream) (NOTECARD.ANNO.DISPLAYFN AnnoImageObj DisplayStream T) (replace (GRAPHNODE NODELABEL) of Node with NodeLabel)) (SETQ Graph (LAYOUTGRAPH Lattice (LIST (CAAR Lattice)) (fetch (BrowserSpecs Format) of BrowserSpecs) (fetch (BrowserSpecs Font) of BrowserSpecs) (fetch (BrowserSpecs MotherD) of BrowserSpecs) (fetch (BrowserSpecs PersonalD) of BrowserSpecs) (fetch (BrowserSpecs FamilyD) of BrowserSpecs))) (SHOW.ANNOTATED.GRAPH Graph Window (FUNCTION NC.GraphCardLeftButtonFn) (FUNCTION NC.GraphCardMiddleButtonFn) NIL T) (NC.SetSubstance (NC.IDFromWindow Window) (WINDOWPROP Window (QUOTE GRAPH))) (WINDOWPROP Window (QUOTE OLDBUTTONEVENTFN) (WINDOWPROP Window (QUOTE BUTTONEVENTFN) (FUNCTION NC.TitleBarButtonEventFn))) (NC.ClearMsg Window T)))) (NC.SubContentsLinkP (LAMBDA (Link) (* NoteCards% User " 5-Jun-84 17:28") (COND ((EQ NC.SubBoxLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) T) (T NIL)))) (NC.ContentsLinkP (LAMBDA (Link) (* NoteCards% User " 5-Jun-84 17:28") (COND ((EQ NC.FiledCardLinkLabel (fetch (NOTECARDLINK LINKLABEL) of Link)) T) (T NIL)))) (NC.NotBrowserHookP (LAMBDA (Link) (* NoteCards% User " 5-Jun-84 17:29") (COND ((EQ (fetch (NOTECARDLINK LINKLABEL) of Link) NC.BrowserContentsLinkLabel) NIL) (T T)))) (NC.FetchIDFromAnno (LAMBDA (NoteCardAnno) (* fgh: "20-Mar-84 22:15") (fetch (NOTECARDLINK DESTINATIONID) of (fetch (ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC) of (fetch (ANNO ANNO\SUBSTANCE) of NoteCardAnno))))) (NC.FetchSubstanceTypeFromAnno (LAMBDA (NoteCardAnno) (* fgh: "22-Mar-84 12:27") (fetch (ANNOSUBSTANCE SUBSTANCETYPE) of (fetch (ANNO ANNO\SUBSTANCE) of NoteCardAnno)))) (NC.SearchForCards (LAMBDA NIL (* fgh: "25-May-84 19:34") (* Search for cards with specified characteristics and create a list card containing pointers to these cards. For now search is limited to cards whose title contains a specified string.) (PROG (SearchString ListCardID IDs Window) (SPAWN.MOUSE) (SETQ SearchString (NC.AskUser2 "Please enter the search string" " -- " NIL T)) (COND ((OR (EQUAL SearchString "") (NOT SearchString)) (RETURN))) (SETQ Window (NC.MakeNoteCard (QUOTE TEXT) (CONCAT "Cards with %"" SearchString "%" in title"))) (SETQ ListCardID (NC.IDFromWindow Window)) (RESETLST (RESETSAVE (CURSOR WAITINGCURSOR)) (NC.PrintMsg2 Window T "Searching for cards ...") (SETQ IDs (bind Title ID for ID# from 1 to (SUB1 (SUBATOM (NC.GetNewID PSA.Database T) 4)) when (AND (SETQ Title (NC.FetchTitle (SETQ ID (NC.IDFromNumber ID#)))) (STRPOS SearchString Title)) collect ID)) (TEDIT.INSERT (NC.FetchSubstance ListCardID) (CONCAT " List compiled on: " (DATE) (CHARACTER 13)) 1) (for ID in IDs unless (EQ ListCardID ID) do (NC.InsertLinkAndTitleBeforeMarker ListCardID ID NC.ListContentsLinkLabel (QUOTE Title) NIL PSA.Database)) (NC.PrintMsg2 Window NIL "Done!" (CHARACTER 13))) (BLOCK 250) (NC.ClearMsg Window T) (RETURN)))) ) (* Prop List Editor) [DECLARE: EVAL@COMPILE (RECORD PropListItem (PropertyName Value OriginalListFlg AllowEditFlg AllowSelectFlg ButtonFn)) ] (DEFINEQ (NC.AddPropToPropList (LAMBDA (editW) (* fgh: "31-May-84 17:26") (* Add a new prop to the propList being edited in editW) (PROG (selectedObject propName propValue insertPtr insertChars beginPtr (stream (WINDOWPROP editW (QUOTE TEXTSTREAM))) (tobj (WINDOWPROP editW (QUOTE TEXTOBJ)))) (SETQ propName (MKATOM (NC.AskUser2 "New Property Name is = " NIL NIL T editW))) (NC.PrintMsg2 editW NIL (CHARACTER 13)) (SETQ propValue (NC.AskUser2 "This property's value is = " NIL NIL NIL editW)) (* Insert these values into the editW) (* Position just before selected button) (NC.PrintMsg2 editW T "Please select a property before which to insert this new property." (CHARACTER 13)) (SETQ selectedObject (NC.SelectProperty editW)) (NC.ClearMsg editW T) (AND (NULL selectedObject) (RETURN NIL)) (SETQ insertPtr (TEDIT.FIND.OBJECT tobj selectedObject)) (SETQ beginPtr insertPtr) (* Insert a button with this property name) (TEDIT.INSERT.OBJECT (MBUTTON.CREATE propName (FUNCTION NC.EditPropButtonFN) (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))) stream insertPtr) (* Spacer between Prop and Value) (add insertPtr 1) (TEDIT.INSERT stream (CHARACTER 9) insertPtr) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON)) insertPtr 1) (add insertPtr 1) (* Create a new field (Copied from JBS's \TEXTMENU.DOC.CREATE)) (TEDIT.INSERT stream (CONCAT " {}" (CHARACTER 13)) insertPtr) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON)) insertPtr 5) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED ON SELECTPOINT ON)) (IPLUS insertPtr 2) 1) (TEDIT.INSERT stream (MKSTRING propValue) (IPLUS insertPtr 3)) (TEDIT.LOOKS (TEXTOBJ stream) (QUOTE (PROTECTED OFF SELECTPOINT OFF)) (IPLUS insertPtr 3) (NCHARS (MKSTRING propValue))) (add insertPtr (NCHARS (MKSTRING propValue))) (add insertPtr 5)))) (NC.CloseAllPropListEditors (LAMBDA (ID) (* fgh: " 7-May-84 18:30") (* Force all prop list editors open on card ID to close without saving changes.) (for AttachedWindow in (ALLATTACHEDWINDOWS (NC.FetchWindow ID)) when (WINDOWPROP AttachedWindow (QUOTE PropListEditor)) do (NC.ClosePropListEditor AttachedWindow (QUOTE NoSave)) (BLOCK)))) (NC.ClosePropListEditor (LAMBDA (Window SaveFlg) (* NoteCards% User " 7-Jun-84 15:25") (* Close the prop list editor, saving or not saving the edited prop list as specified by the SaveFlg or by the user if SaveFlg is NIL) (PROG (TextObj Answered OldPropList NewPropList) (DETACHWINDOW Window) (SETQ TextObj (WINDOWPROP Window (QUOTE TEXTOBJ))) (SETQ OldPropList (WINDOWPROP Window (QUOTE PROPERTYLIST.BEING.EDITED))) (AND TextObj (COND ((EQ SaveFlg (QUOTE Save)) (SETQ NewPropList (NC.ExtractPropList Window)) (NC.ProcessEditedPropList NewPropList OldPropList)) ((EQ SaveFlg (QUOTE NoSave))) ((EQ (WINDOWPROP Window (QUOTE PropListEditor)) (QUOTE ShowOnly))) (T (until Answered do (SELECTQ (MENU (OR (AND (BOUNDP (QUOTE NC.SavePropEditMenu)) (type? MENU NC.SavePropEditMenu) NC.SavePropEditMenu) (SETQ NC.SavePropEditMenu (create MENU ITEMS ←(QUOTE (Save% Changes Cancel% Changes)) TITLE ← "Property Edits?" CENTERFLG ← T)))) (Save% Changes (SETQ NewPropList (NC.ExtractPropList Window)) (NC.ProcessEditedPropList NewPropList OldPropList) (SETQ Answered T)) (Cancel% Changes (SETQ Answered T)) NIL))))) (WINDOWPROP Window (QUOTE TEDIT.MENU) NIL) (WINDOWPROP Window (QUOTE TEDIT.PROPS) NIL) (WINDOWPROP Window (QUOTE PropListEditor) NIL) (WINDOWDELPROP Window (QUOTE CLOSEFN) (FUNCTION NC.ClosePropListEditor)) (COND (TextObj (replace (TEXTOBJ \DIRTY) of TextObj with NIL) (\TEDIT.QUIT (fetch (TEXTOBJ \WINDOW) of TextObj)) (until (fetch (TEXTOBJ EDITFINISHEDFLG) of TextObj) do (BLOCK))))))) (NC.DelPropFromList (LAMBDA (editW) (* fgh: " 1-May-84 01:07") (PROG ((tobj (WINDOWPROP editW (QUOTE TEXTOBJ))) (stream (WINDOWPROP editW (QUOTE TEXTSTREAM))) selectedObject) (NC.PrintMsg2 editW T "Please select property to be deleted.") (SETQ selectedObject (NC.SelectProperty editW)) (NC.ClearMsg editW T) (COND ((COND ((NOT (IMAGEOBJPROP selectedObject (QUOTE EditPropListNoDelete))) (SETQ CH# (TEDIT.FIND.OBJECT tobj selectedObject)) (MBUTTON.FIND.NEXT.FIELD tobj CH#) (* Delete everything between the imageobj and the end-of-line.) (TEDIT.LOOKS tobj (QUOTE (PROTECTED OFF)) CH# (IPLUS 3 (IDIFFERENCE (fetch CHLIM of (fetch SCRATCHSEL of tobj)) CH#))) (TEDIT.DELETE stream CH# (IPLUS 3 (IDIFFERENCE (fetch CHLIM of (fetch SCRATCHSEL of tobj)) CH#))) (TEDIT.SETSEL stream (GETEOFPTR stream) 0 (QUOTE RIGHT))) (T (NC.PrintMsg2 editW T "Selected property:value pair cannot be deleted." (CHARACTER 13))))))))) (NC.EditPropButtonFN (LAMBDA (imageObject sel window) (* fgh: "20-Apr-84 21:17") (* This is the default function called whenever the user selects a button in the NC.EditPropList window.) (WINDOWPROP window (QUOTE SelectedObject) imageObject))) (NC.EditProperties (LAMBDA (TextStream) (* fgh: "23-Apr-84 20:48") (* Open a property list editor for the card corresponding to TextStream. Called from Title bar menus.) (PROG ((ID (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING TextStream)))) (NC.OpenPropListEditor TextStream (APPEND (NC.FetchPropList ID) (LIST (QUOTE ID) ID)) "Edit Property List")))) (NC.EditPropList (LAMBDA (propList window showOnlyFlg) (* fgh: "31-May-84 22:46") (* propList is a list of RECORDS of type PropListItem) (* Edit a property list using the TEDIT menu-based editor. The var window is the window to use. If none supplied, get one from user.) (PROG (menuStream textObj editW button (font (FONTCREATE (QUOTE HELVETICA) 8)) (CH# 1) (ENDCH# 1)) (* Init the editList and the propFnsList) (* Create a TEDITMenu that reflects the structure of the proplist) (SETQ menuStream (\TEXTMENU.DOC.CREATE (for X in propList join (NCONC (LIST (LIST (QUOTE BUTTON) (MKSTRING (fetch (PropListItem PropertyName) of X)) (OR (fetch (PropListItem ButtonFn) of X) (FUNCTION NC.EditPropButtonFN)))) (COND ((NOT (IMAGEOBJP (fetch (PropListItem Value) of X))) (COND ((fetch (PropListItem AllowEditFlg) of X) (LIST (LIST (QUOTE TEXT) (CONCAT (CHARACTER 9) " [" (MKSTRING (fetch (PropListItem Value) of X)) "]" (CHARACTER 13)) font))) (T (LIST (LIST (QUOTE TEXT) (CHARACTER 9) font) (LIST (QUOTE INSERT) (MKSTRING (fetch (PropListItem Value) of X))) (LIST (QUOTE TEXT) (CHARACTER 13) font))))) (T (LIST (LIST (QUOTE TEXT) (CHARACTER 9) font) (LIST (QUOTE INSERT)) (LIST (QUOTE TEXT) (CHARACTER 13) font)))))))) (SETQ textObj (TEXTOBJ menuStream)) (* Go back and insert the ImageObjects into their value fields.) (SETQ CH# 0) (for prop in propList when (OR (IMAGEOBJP (fetch (PropListItem Value) of prop)) (NULL (fetch (PropListItem AllowEditFlg) of prop))) do (MBUTTON.FIND.NEXT.FIELD textObj (SETQ CH# (ADD1 CH#))) (SETQ CH# (fetch CH# of (fetch SCRATCHSEL of textObj))) (COND ((IMAGEOBJP (CADR prop)) (TEDIT.INSERT.OBJECT (fetch (PropListItem Value) of prop) menuStream CH#)))) (SETQ CH# 0) (for prop in propList do (SETQ button (MBUTTON.FIND.NEXT.BUTTON textObj (ADD1 CH#))) (SETQ CH# (CDR button)) (* If the buttonProtect flag is on, protect the button) (AND (fetch (PropListItem AllowSelectFlg) of prop) (IMAGEOBJPROP (CAR button) (QUOTE EditPropListNoDelete) T))) (* Set up window and window title) (SETQ editW (COND (window window) (T (CREATEW (GETREGION) "Edit Property List")))) (* Point to the proplist being edited so we can update it when this menu is closed. (See NC.CloseEditPropListWindow)) (WINDOWPROP editW (QUOTE PROPERTYLIST.BEING.EDITED) propList) (* Set the right margin to very-far-away. Prevents stuff from wrapping around) (TEDIT.PARALOOKS textObj (QUOTE (RIGHTMARGIN 1000 TABS (50 (80 . LEFT)))) 1 (GETFILEINFO menuStream (QUOTE LENGTH))) (* Set the first tab so the fields will line up correctly) (* Set selection to the top -- make it look pretty) (replace (SELECTION SET) of (fetch (TEXTOBJ SEL) of textObj) with NIL) (TEDIT menuStream editW NIL (LIST (QUOTE MENU) (create MENU ITEMS ←(COND (showOnlyFlg (QUOTE (("Quit" (NC.ClosePropListEditor W (QUOTE NoSave)) "Quit from pointer list display.")))) (T (QUOTE (("Add New Property" ( NC.AddPropToPropList W) "Add a new property to this card's property list.") ("Delete Selected Property" (NC.DelPropFromList W) "Delete selected property from this card's property list.") ("Quit w/o Saving Changes" (NC.ClosePropListEditor W (QUOTE NoSave)) "Quit from property list edit. Changes are not saved.") ("Quit - Saving Changes" (NC.ClosePropListEditor W (QUOTE Save)) "Quit from property list editor. Save changes."))))) )))))) (NC.ExtractPropList (LAMBDA (editW) (* fgh: "31-May-84 19:19") (* Exctract the prop list from the TextStream in prop list editor window editW) (PROG ((tobj (WINDOWPROP editW (QUOTE TEXTOBJ))) menuStream button propName (propValue T) EOL (CH# 1) (propList (WINDOWPROP editW (QUOTE PROPERTYLIST.BEING.EDITED)))) (* Move through each field/value pair in menu. Update each PROP in the list.) (* For each property in the list, move to the next field, and drop its value into the field slot.) (SETQ menuStream (fetch STREAMHINT of tobj)) (* for each button in the menu do) (RETURN (while (SETQ button (MBUTTON.FIND.NEXT.BUTTON tobj CH#)) collect (* Convert the name of the button into the property name) (* Set up the looks of the fields so that MBUTTON.NEXT.FIELD will work correctly -- Real kludge to get around limitations in TEditMenu stuff) (TEDIT.LOOKS tobj (QUOTE (PROTECTED ON SELECTPOINT ON)) (IPLUS 4 (CDR button)) 1) (COND ((SETQ EOL (MBUTTON.FIND.NEXT.BUTTON tobj (IPLUS 4 (CDR button)))) (SETQ EOL (IDIFFERENCE (CDR EOL) 2))) (T (SETQ EOL (SUB1 (TEDIT.FIND tobj (CHARACTER 13) (CDR button)))))) (TEDIT.LOOKS tobj (QUOTE (PROTECTED OFF)) (IPLUS 4 (CDR button)) (IDIFFERENCE EOL (IPLUS 4 (CDR button)))) (* Get the name of the property from the butrton) (SETQ propName (IMAGEOBJPROP (CAR button) (QUOTE MBTEXT))) (* Now get its value by reading the next field) (SETQ propValue (MBUTTON.NEXT.FIELD.AS.TEXT.OR.IMAGEOBJ tobj (CDR button))) (COND ((NULL propValue) (SETQ propValue (fetch (PropListItem Value) of (FASSOC propName propList)))) ((IMAGEOBJP propValue)) ((NC.StringIsListP propValue 0) (* This string should really be interpreted as a LIST) (SETQ propValue (READ propValue))) (T (* This really is a string) (SETQ propValue (MKATOM propValue)))) (* Keep track of where that property was in the menu stream) (SETQ CH# (ADD1 (CDR button))) (LIST propName propValue)))))) (NC.OpenPropListEditor (LAMBDA (WindowOrTextStream PropList Title ShowOnlyFlg MakeImageObjFlg) (* fgh: "31-May-84 11:48") (* Open a property list editor above the card specified by TextStream , which is either a TextStream or a Window) (PROG ((Window (WINDOW.FROM.TEDIT.THING WindowOrTextStream)) EditWindow ID) (* Make sure there is no prop list editor already there) (AND (NC.PropListEditorOpenP Window) (RETURN)) (SETQ ID (NC.IDFromWindow Window)) (* FOR each prop/value pair with LISTP value. Make a series of individual prop/value pairs corresponding to the elements of the LISTP) (SETQ PropList (for Item on PropList by (CDDR Item) join (COND ((NLISTP (CADR Item)) (LIST (create PropListItem PropertyName ←(CAR Item) Value ←(CADR Item) OriginalListFlg ← NIL AllowEditFlg ← NIL AllowSelectFlg ← NIL ButtonFn ← NIL))) (T (for Element in (CADR Item) collect (create PropListItem PropertyName ←(CAR Item) Value ← Element OriginalListFlg ← T AllowEditFlg ← NIL AllowSelectFlg ← NIL ButtonFn ← NIL)))))) (* If specified, translate all NOTECARDLINK values into Image Objects for display.) (AND MakeImageObjFlg (for Item in PropList when (type? NOTECARDLINK (fetch (PropListItem Value) of Item)) do (replace (PropListItem Value) of Item with (IMAGEOBJFROMANNO (create ANNO ANNO\SUBSTANCE ←(create ANNONOTECARDSUBSTANCE ANNONOTECARDSPEC ←(CADR Item))))))) (* Indicate which properties can be edited by user.) (for Item in PropList do (COND ((FMEMB (fetch (PropListItem PropertyName) of Item) (QUOTE (ID Updates))) (replace (PropListItem AllowEditFlg) of Item with T) (replace (PropListItem AllowSelectFlg) of Item with T)) (ShowOnlyFlg (replace (PropListItem AllowEditFlg) of Item with NIL) (replace (PropListItem AllowSelectFlg) of Item with T)) (T (replace (PropListItem AllowEditFlg) of Item with NIL) (replace (PropListItem AllowSelectFlg) of Item with NIL)))) (* Call the prop list editor) (ATTACHWINDOW (SETQ EditWindow (CREATEW (CREATEREGION 1000 2000 100 100) (OR Title "Edit Property List") NIL T)) Window (QUOTE TOP) (QUOTE JUSTIFY)) (WINDOWADDPROP EditWindow (QUOTE CLOSEFN) (FUNCTION NC.ClosePropListEditor)) (WINDOWPROP EditWindow (QUOTE PropListEditor) (COND (ShowOnlyFlg (QUOTE ShowOnly)) (T T))) (NC.EditPropList PropList EditWindow ShowOnlyFlg) (RETURN EditWindow)))) (NC.ProcessEditedPropList (LAMBDA (EditedPropList OldPropList) (* fgh: "23-Apr-84 16:50") (* Take an edited prop list and set the prop list of the card as required.) (PROG (ID NewPropList Prop ListItem) (SETQ ID (fetch (PropListItem Value) of (FASSOC (QUOTE ID) OldPropList))) (for Item in EditedPropList do (SETQ Prop (fetch (PropListItem PropertyName) of Item)) (SETQ oldItem (FASSOC Prop OldPropList)) (COND ((EQ Prop (QUOTE ID))) ((NULL NewPropList) (SETQ NewPropList (LIST Prop (COND ((fetch (PropListItem OriginalListFlg) of oldItem) (LIST (CADR Item))) (T (CADR Item)))))) ((SETQ Value (LISTGET NewPropList Prop)) (LISTPUT NewPropList Prop (COND ((LISTP Value) (NCONC1 Value (CADR Item))) (T (LIST (CADR Item) Value))))) (T (LISTPUT NewPropList Prop (COND ((fetch (PropListItem OriginalListFlg) of oldItem) (LIST (CADR Item))) (T (CADR Item))))))) (NC.SetPropList ID NewPropList) (NC.MarkCardDirty ID)))) (NC.PropListEditorOpenP (LAMBDA (Window) (* NoteCards% User "17-Jun-84 15:13") (* Is there a prop list editor opened on this window?) (for AttachedWindow in (ALLATTACHEDWINDOWS Window) thereis (WINDOWPROP AttachedWindow (QUOTE PropListEditor))))) (NC.SelectProperty (LAMBDA (Window) (* fgh: "20-Apr-84 21:44") (* Select one of the properties in prop list editor window Window) (PROG ((ClippingRegion (DSPCLIPPINGREGION NIL Window))) (WINDOWPROP Window (QUOTE SelectedObject) NIL) (until (WINDOWPROP Window (QUOTE SelectedObject)) do (until (AND (MOUSESTATE LEFT) (EQ (WHICHW LASTMOUSEX LASTMOUSEY) Window))) (COND ((INSIDEP ClippingRegion (LASTMOUSEX Window) (LASTMOUSEY Window)) (APPLY* (WINDOWPROP Window (QUOTE BUTTONEVENTFN)) Window)))) (AND (EQ TEDIT.SELPENDING (WINDOWPROP Window (QUOTE TEXTOBJ))) (SETQ TEDIT.SELPENDING)) (RETURN (WINDOWPROP Window (QUOTE SelectedObject) NIL))))) (NC.ShowPointers (LAMBDA (TextStream) (* fgh: " 2-May-84 17:33") (* Open an inspector for the links for note card specified by TextStream above the window for the note card.) (PROG (Links (ID (NC.IDFromWindow (WINDOW.FROM.TEDIT.THING TextStream)))) (SETQ Links (NCONC (for Link in (NC.FetchToLinks ID) join (LIST (CONCAT (fetch (NOTECARDLINK LINKLABEL) of Link) " TO ") (PROGN (AND (EQP (LENGTH Link) 2) (NCONC Link (LIST NIL))) (replace (NOTECARDLINK DISPLAYMODE) of Link with (QUOTE Title)) (LIST Link)))) (for Link in (NC.FetchFromLinks ID) join (LIST (CONCAT (fetch (NOTECARDLINK LINKLABEL) of Link) " FROM ") (PROGN (AND (EQP (LENGTH Link) 2) (NCONC Link (LIST NIL))) (replace (NOTECARDLINK DISPLAYMODE) of Link with (QUOTE Title)) (LIST Link)))))) (NC.OpenPropListEditor TextStream Links "List of Pointers" T T)))) (NC.StringIsListP (LAMBDA (string parenCount) (* dmr: "20-Mar-84 23:46") (* T if string has a balanced number of (and). Var "parenCount" counts open parens.) (PROG (nextParen) (COND ((NULL string) (COND ((ZEROP parenCount) (RETURN T)) (T (RETURN NIL))))) (SETQ nextParen (STRPOSL (QUOTE (%( %))) string)) (COND ((NULL nextParen) (RETURN NIL))) (COND ((EQ (CHARCODE "(") (EVAL (BQUOTE (CHARCODE , (SUBSTRING string nextParen nextParen))))) (RETURN (NC.StringIsListP (SUBSTRING string (ADD1 nextParen)) (ADD1 parenCount))))) (COND ((EQ (CHARCODE ")") (EVAL (BQUOTE (CHARCODE , (SUBSTRING string nextParen nextParen))))) (RETURN (NC.StringIsListP (SUBSTRING string (ADD1 nextParen)) (SUB1 parenCount))))) (BREAK)))) ) (* Selection Mechanism) (RPAQQ NC.SelectionInProgress NIL) (DEFINEQ (NC.SelectNoteCards (LAMBDA (SingleCardFlg SelectionPredicate Menu InstigatingIDorWindow) (* fgh: "25-May-84 16:23") (* Select a set of note cards or a single note card, depending on SingleCardFlg. Works by interpreting all mouse presses until a card has been chosen (if SingleCardFlg is T) or until the Done button has been pressed (if SingleCardFlg is NIL). If the mouse press occus within a Title bar of a notecard, add that note card to the selected list. Otherwise, if you are pointing into a note card, call the BUTTONEVENTFN for that note card. The Selection in Progress flag has been set, so all note card BUTTONEVENTFNs should know to ignore all presses except those that occur on link icons. Link icon presses should simply add the desination of that link to the selected note cards list.) (PROG (Window ID ButtonEventFn (OldLength 0) InstigatingWindow MenuWindow SelectedCard) (OR SelectionPredicate (SETQ SelectionPredicate (FUNCTION TRUE))) (SETQ NC.SelectedCards) (COND ((NC.IDP InstigatingIDorWindow) (SETQ InstigatingWindow (NC.FetchWindow InstigatingIDorWindow))) ((WINDOWP InstigatingIDorWindow) (SETQ InstigatingWindow InstigatingIDorWindow)) (T (SETQ InstigatingWindow NIL))) (RESETLST (RESETSAVE TEDIT.SELPENDING T) (RESETSAVE NIL (QUOTE (NC.ClearMsg))) (RESETSAVE NC.SelectionInProgress T) (RESETSAVE (ADDMENU Menu NIL (AND InstigatingWindow (create POSITION XCOORD ←(fetch (REGION LEFT) of ( WINDOWREGION InstigatingWindow)) YCOORD ←(fetch (REGION TOP) of ( WINDOWREGION InstigatingWindow))))) (LIST (QUOTE PROGN) (LIST (QUOTE DETACHWINDOW) (LIST (QUOTE WFROMMENU) Menu)) (LIST (QUOTE DELETEMENU) Menu T))) (* If there is an instigating window, make sure it and all its attachments are visible on the screen.) (COND (InstigatingWindow (ATTACHWINDOW (WFROMMENU Menu) InstigatingWindow (QUOTE TOP) (QUOTE LEFT)) (NC.MoveWindowOntoScreen InstigatingWindow))) (NC.PrintMsg2 InstigatingWindow NIL "Items selected: ") (until (COND (SingleCardFlg (OR NC.SelectedCards (NULL NC.SelectionInProgress))) (T (NULL NC.SelectionInProgress))) do (until (MOUSESTATE LEFT)) (SETQ Window (WHICHW LASTMOUSEX LASTMOUSEY)) (AND Window (SETQ ID (NC.IDFromWindow Window))) (COND (Window (SETQ ButtonEventFn (WINDOWPROP Window (QUOTE BUTTONEVENTFN))) (COND ((AND (NOT (INSIDEP (DSPCLIPPINGREGION NIL (WINDOWPROP Window (QUOTE DSP))) (LASTMOUSEX Window) (LASTMOUSEY Window)))) (AND ID (NOT (FMEMB ID NC.SelectedCards)) (SETQ NC.SelectedCards (CONS ID NC.SelectedCards)))) (T (AND ButtonEventFn (APPLY* ButtonEventFn Window)))))) (COND ((IGREATERP (LENGTH NC.SelectedCards) OldLength) (COND ((NULL (APPLY* SelectionPredicate (CAR NC.SelectedCards))) (SETQ NC.SelectedCards (CDR NC.SelectedCards))) (T (SETQ OldLength (LENGTH NC.SelectedCards)) (NC.PrintMsg2 InstigatingWindow NIL (NC.FetchTitle (CAR NC.SelectedCards)) ", "))))) (UNTILMOUSESTATE UP) (TOTOPW (WFROMMENU Menu))) (* Allow TEdit to finish any outstanding Selections caused by buttoning off of the Notecard link objects) (BLOCK)) (UNTILMOUSESTATE UP) (RETURN (PROG1 (COND (SingleCardFlg (CAR NC.SelectedCards)) (T NC.SelectedCards)) (SETQ NC.SelectedCards)))))) ) (* Menus of all sorts) (DEFINEQ (NC.AskLinkLabel (LAMBDA (MainWindow MultipleFlg SystemLinksFlg NewLinkFlg CancelOkayFlg) (* NoteCards% User "21-Jun-84 21:54") (* Asks for label on notecard links) (PROG (Menu Choice LabelsList (LinkLabels (NC.RetrieveLinkLabels PSA.Database SystemLinksFlg))) (GETPROMPTWINDOW MainWindow 3 (FONTCREATE (QUOTE HELVETICA) 10)) (NC.PrintMsg2 MainWindow T (COND (MultipleFlg "Please choose pointer label(s).") (T "Please choose pointer label.")) (CHARACTER 13) "Labels chosen: ") (SETQ Menu (create MENU TITLE ← "Pointer Label?" ITEMS ←(NCONC (COPY LinkLabels) (AND MultipleFlg (LIST (QUOTE --ALL--))) (AND MultipleFlg (LIST (QUOTE --DONE--))) (AND NewLinkFlg (LIST (QUOTE --New% Label--))) (AND CancelOkayFlg (LIST (QUOTE **CANCEL**)))) MENUPOSITION ←(AND (WINDOWP MainWindow) (create POSITION XCOORD ←(fetch (REGION LEFT) of (WINDOWPROP MainWindow (QUOTE REGION))) YCOORD ←(fetch (REGION TOP) of (WINDOWREGION MainWindow)))))) (RETURN (PROG1 (until NIL do (SETQ Choice (OR (MENU Menu) NC.UnspecifiedLinkLabel)) (COND ((EQ Choice (QUOTE **CANCEL**)) (SETQ Choice)) ((EQ Choice (QUOTE --New% Label--)) (NC.ClearMsg MainWindow NIL) (until (COND ((NOT (FMEMB (U-CASE (SETQ Choice (MKATOM (NC.AskUser2 "Enter new pointer label" " -- " NIL NIL MainWindow T))) ) NC.UCASESystemLinkLabels)) T) (T (NC.PrintMsg2 MainWindow T Choice " is a system reserved pointer label." (CHARACTER 13) "Please choose another label." (CHARACTER 13)) NIL))) (OR Choice (SETQ Choice NC.UnspecifiedLinkLabel)) (AND (NOT (FMEMB Choice LinkLabels)) (NC.PutLinkLabels PSA.Database (CONS Choice LinkLabels))))) (COND ((NULL Choice) (RETURN)) ((NULL MultipleFlg) (RETURN Choice)) ((EQ Choice (QUOTE --ALL--)) (RETURN LinkLabels)) ((EQ Choice (QUOTE --DONE--)) (RETURN LabelsList)) (Choice (NC.PrintMsg2 MainWindow NIL Choice ", ") (SETQ LabelsList (CONS Choice LabelsList))))) (NC.ClearMsg MainWindow T)))))) (NC.AskNoteCardType (LAMBDA NIL (* fgh: "10-May-84 00:18") (* Ask user to choose a note card type) (PROG (W Z (Font (FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD)))) (OR (AND (BOUNDP (QUOTE NC.NoteCardTypeMenu)) (type? MENU NC.NoteCardTypeMenu)) (SETQ NC.NoteCardTypeMenu (create MENU ITEMS ←(QUOTE ((Text (QUOTE TEXT)) (Graph (QUOTE GRAPH)) (Sketch/Map (QUOTE SKETCH)) (FileBox (QUOTE CONTENTS)))) CENTERFLG ← T TITLE ← "Type?" MENUFONT ← Font ITEMHEIGHT ←(IPLUS (FONTPROP Font (QUOTE HEIGHT)) 1)))) (SETQ Z (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE REGION))) (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of NC.MainMenu) 3)) NC.MainMenu)) (replace MENUPOSITION of NC.NoteCardTypeMenu with (CONS (IPLUS (fetch (REGION LEFT) of Z) (fetch (REGION LEFT) of W)) (IPLUS (fetch (REGION BOTTOM) of Z) (fetch (REGION TOP) of W) (IMINUS (fetch (MENU IMAGEHEIGHT) of NC.NoteCardTypeMenu))))) (RETURN (MENU NC.NoteCardTypeMenu))))) (NC.ChooseTopLevelCard (LAMBDA NIL (* fgh: "10-May-84 00:25") (* Let the user choose one of the top level cards. Top level cards are specified by globalvar NC.TopLevelCards which is a list of IDs) (PROG (ID Menu W Z) (SETQ Menu (create MENU ITEMS ←(for CardID in NC.TopLevelCards collect (LIST (NC.RetrieveTitle CardID) CardID)) CENTERFLG ← T MENUFONT ←(FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD)) WHENSELECTEDFN ←(FUNCTION (LAMBDA (Item Button Menu) (NC.EditNoteCard (CADR Item)))) TITLE ← "FileBox?")) (SETQ W (MENUITEMREGION (CAR (NTH (fetch (MENU ITEMS) of NC.MainMenu) 4)) NC.MainMenu)) (SETQ Z (WINDOWPROP (WFROMMENU NC.MainMenu) (QUOTE REGION))) (replace (MENU MENUPOSITION) of Menu with (create POSITION XCOORD ←(IPLUS (fetch (REGION LEFT) of W) (fetch (REGION LEFT) of Z)) YCOORD ←(IPLUS (fetch (REGION TOP) of W) (fetch (REGION BOTTOM) of Z) (IMINUS (fetch (MENU IMAGEHEIGHT) of Menu))))) (SETQ ID (MENU Menu))))) (NC.DisplayMainMenu (LAMBDA NIL (* NoteCards% User "21-Jun-84 23:23") (* Displays the main NoteCards menu) (PROG (W) (COND ((SETQ W (WFROMMENU NC.MainMenu)) (WINDOWPROP W (QUOTE CLOSEFN) NIL) (DELETEMENU NC.MainMenu T))) (SETQ NC.MainMenuWindow (SETQ W (ADDMENU NC.MainMenu))) (WINDOWPROP W (QUOTE CLOSEFN) (QUOTE DON'T)) (WINDOWPROP W (QUOTE MOVEFN) (QUOTE DON'T)) (WINDOWPROP W (QUOTE RESHAPEFN) (QUOTE DON'T)) (WINDOWPROP W (QUOTE SHRINKFN) (QUOTE DON'T)) (WINDOWPROP W (QUOTE RIGHTBUTTONFN) (FUNCTION NILL))))) (NC.RemoveSketchMenuItems (LAMBDA (SketchMenu) (* fgh: "10-May-84 14:30") (* Remove unwanted items from Sketch Card SKetch Menu. Called from ADVISE on CREATE.SKETCHW.COMMANDMENU. NOTE: SKETCHW refers to SK.INSURE.MENU) (PROG ((ItemsToBeRemoved (QUOTE (Annotate LINK New% View locator inspect)))) (AND (NC.IDFromWindow SKETCHW) (RETURN (replace (MENU ITEMS) of SketchMenu with (for Item in (fetch (MENU ITEMS) of SketchMenu) when (NOT (FMEMB (CAR Item) ItemsToBeRemoved)) collect Item))))))) (NC.SelectionMenusWhenSelectedFn (LAMBDA (Item Menu Button) (* fgh: " 7-May-84 19:16") (SELECTQ (CAR Item) ((Done) (SETQ NC.SelectionInProgress)) ((Abort Cancel) (SETQ NC.SelectionInProgress) (SETQ NC.SelectedCards)) (New% Card (SETQ NC.SelectedCards (CONS (QUOTE *New% Card*) NC.SelectedCards))) (NoSource (SETQ NC.SelectedCards (LIST (QUOTE NC00000))) (SETQ NC.SelectionInProgress)) (NoBox (SETQ NC.SelectedCards (LIST NC.UnclassifiedID)) (SETQ NC.SelectionInProgress)) NIL))) (NC.SetupTitleBarMenu (LAMBDA (Window ID) (* NoteCards% User "28-Jun-84 01:37") (* Setup the title bar menu for the window Window pertaining to Card specified by ID) (PROG ((NoteCardType (NC.FetchType ID))) (WINDOWPROP Window (QUOTE OLDBUTTONEVENTFN) (WINDOWPROP Window (QUOTE BUTTONEVENTFN) (FUNCTION NC.TitleBarButtonEventFn))) (WINDOWPROP Window (QUOTE TitleBarLeftButtonMenu) (SELECTQ NoteCardType ((BROWSER GRAPH) (OR (AND (BOUNDP (QUOTE NC.GraphTitleBarMenu)) (type? MENU NC.GraphTitleBarMenu)) (SETQ NC.GraphTitleBarMenu (create MENU ITEMS ←(QUOTE ((Show/Edit% Properties (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card." (SUBITEMS (Edit% Property% List (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card.") (Show% Pointers (FUNCTION NC.ShowPointers) "Brings up a list of the pointers to and from this card."))) (Title/Sources/FileBoxes (FUNCTION (LAMBDA (TextStream) (NC.AssignTitle TextStream) (NC.AssignSources TextStream) (NC.FileNoteCard TextStream))) "Do all of the operations necessary to file this note card in a file box." (SUBITEMS (Assign% Title (FUNCTION NC.AssignTitle) "Assigns a (new) title to this note card.") (Designate% Sources (FUNCTION NC.AssignSources) "Designate the source(s) of the information in this card.") (File% in% FileBoxes (FUNCTION NC.FileNoteCard) "File this note card in one or more file boxes.") (Unfile% from% FileBoxes (FUNCTION NC.UnfileNoteCard) "Remove this card from one or more of its file boxes.") (Delete% Source (FUNCTION NC.DeleteSource) "Delete one of the sources of this card."))) (Insert% Pointer (FUNCTION NC.AddLinkToGraphCard) "Add a node that points to another note card.") (Close% and% Save (FUNCTION CLOSEW) "Close this note card after saving it in the NoteFile." (SUBITEMS (Close% and% Save (FUNCTION CLOSEW) "Close this note card after saving it in the NoteFile.") (Close% w/o% Saving (FUNCTION NC.QuitWithoutSaving) "Close this note card without saving any changes made since the last Save.") (Save% in% NoteFile (FUNCTION NC.GraphCardSaveFn) "Save this card in the NoteFile but don't close the card.") (Delete% Card (FUNCTION NC.DeleteNoteCards) "Permenantly delete this card from the NoteFile."))))) CENTERFLG ← T MENUFONT ←(FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))))) NC.GraphTitleBarMenu) ((SKETCH MAP) (OR (AND (BOUNDP (QUOTE NC.SketchTitleBarMenu)) (type? MENU NC.SketchTitleBarMenu)) (SETQ NC.SketchTitleBarMenu (create MENU ITEMS ←(QUOTE ((Show/Edit% Properties (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card." (SUBITEMS (Edit% Property% List (FUNCTION NC.EditProperties) "Brings up an editor for the property list of this card.") (Show% Pointers (FUNCTION NC.ShowPointers) "Brings up a list of the pointers to and from this card."))) (Title/Sources/FileBoxes (FUNCTION (LAMBDA (TextStream) (NC.AssignTitle TextStream) (NC.AssignSources TextStream) (NC.FileNoteCard TextStream))) "Do all of the operations necessary to file this note card in a file box." (SUBITEMS (Assign% Title (FUNCTION NC.AssignTitle) "Assigns a (new) title to this note card.") (Designate% Sources (FUNCTION NC.AssignSources) "Designate the source(s) of the information in this card.") (File% in% FileBoxes (FUNCTION NC.FileNoteCard) "File this note card in one or more file boxes.") (Unfile% from% FileBoxes (FUNCTION NC.UnfileNoteCard) "Remove this card from one or more of its file boxes.") (Delete% Source (FUNCTION NC.DeleteSource) "Delete one of the sources of this card."))) (Insert% Pointer (FUNCTION NC.AddLinkToSketchCard) "Add a pointer to another card to this sketch/map.") (Close% and% Save (FUNCTION CLOSEW) "Close this note card after saving it in the NoteFile." (SUBITEMS (Close% and% Save (FUNCTION CLOSEW) "Close this note card after saving it in the NoteFile.") (Close% w/o% Saving (FUNCTION NC.QuitWithoutSaving) "Close this note card without saving any changes made since the last Save.") (Save% in% NoteFile (FUNCTION NC.SketchCardSaveFn) "Save this card in the NoteFile but don't close the card.") (Delete% Card (FUNCTION NC.DeleteNoteCards) "Permenantly delete this card from the NoteFile."))))) CENTERFLG ← T MENUFONT ←(FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))))) NC.SketchTitleBarMenu) NIL)) (COND ((EQ NoteCardType (QUOTE BROWSER)) (WINDOWPROP Window (QUOTE TitleBarMiddleButtonMenu) (OR (AND (BOUNDP (QUOTE NC.BrowserTitleBarMenu)) (type? MENU NC.BrowserTitleBarMenu)) (SETQ NC.BrowserTitleBarMenu (create MENU ITEMS ←(QUOTE ((Recompute% Browser (FUNCTION NC.UpdateBrowserCard) "Recomputes this browser to show the current state of the NoteFile."))) CENTERFLG ← T MENUFONT ←(FONTCREATE (QUOTE HELVETICA) 10 (QUOTE BOLD))))))))))) (NC.TitleBarButtonEventFn (LAMBDA (Window) (* NoteCards% User "28-Jun-84 01:12") (* if inside title region, bringup title menu, otherwise just call the oldbuttoneventfn) (PROG ((MiddleButtonMenu (WINDOWPROP Window (QUOTE TitleBarMiddleButtonMenu))) LeftButtonMenu) (COND ((OR (INSIDEP (DSPCLIPPINGREGION NIL Window) (LASTMOUSEX Window) (LASTMOUSEY Window)) (AND (NULL MiddleButtonMenu) (LASTMOUSESTATE MIDDLE))) (APPLY* (WINDOWPROP Window (QUOTE OLDBUTTONEVENTFN)) Window)) ((LASTMOUSESTATE MIDDLE) (APPLY* (OR (MENU MiddleButtonMenu) (FUNCTION NILL)) Window)) (T (COND ((SETQ LeftButtonMenu (WINDOWPROP Window (QUOTE TitleBarLeftButtonMenu))) (APPLY* (OR (MENU LeftButtonMenu) (FUNCTION NILL)) Window)))))))) ) (* UTILITIES) (DEFINEQ (FILDIR-EARLIEST (LAMBDA (FileSpec) (FILDIR-VERSION FileSpec (QUOTE EARLIEST)))) (FILDIR-VERSION (LAMBDA (FileSpec Version) (* edited: "30-SEP-83 15:38") (PROG (FileName FileVersion Entry ResultsList (LatestFlag (COND ((EQ Version (QUOTE LATEST)) T) (T NIL)))) (for File in (FILDIR FileSpec) do (SETQ FileName (UNPACKFILENAME File)) (SETQ FileVersion (LISTGET FileName (QUOTE VERSION))) (LISTPUT FileName (QUOTE VERSION) NIL) (SETQ FileName (PACKFILENAME FileName)) (SETQ Entry (FASSOC FileName ResultsList)) (COND ((NULL Entry) (SETQ ResultsList (CONS (CONS FileName FileVersion) ResultsList))) ((AND LatestFlag (IGREATERP FileVersion (CDR Entry))) (RPLACD Entry FileVersion)) ((ILESSP FileVersion (CDR Entry)) (RPLACD Entry FileVersion)))) (RETURN (for File in (DREVERSE ResultsList) collect (PACK* (CAR File) (QUOTE ;) (CDR File))))))) (GETMOUSEX (LAMBDA NIL (* fgh: " 1-Apr-84 13:18") (GETMOUSESTATE) LASTMOUSEX)) (GETMOUSEY (LAMBDA NIL (* fgh: " 1-Apr-84 13:18") (GETMOUSESTATE) LASTMOUSEY)) (LOWERLEFT (LAMBDA (Region) (* fgh: "30-Mar-84 20:01") (create POSITION XCOORD ←(fetch LEFT of Region) YCOORD ←(fetch BOTTOM of Region)))) (MBUTTON.NEXT.FIELD.AS.TEXT.OR.IMAGEOBJ (LAMBDA (TEXTOBJ CH#) (* fgh: "31-May-84 18:06") (* Returns the first IMAGEOBJ in the next field. IF no such beast, returns the next field as text) (COND ((MBUTTON.FIND.NEXT.FIELD TEXTOBJ CH#) (\SETUPGETCH (fetch (SELECTION CH#) of (fetch (TEXTOBJ SCRATCHSEL) of TEXTOBJ)) TEXTOBJ) (COND ((CAR (bind ImageObj for CHNO from 1 to (fetch (SELECTION DCH) of (fetch (TEXTOBJ SCRATCHSEL) of TEXTOBJ)) when (SETQ ImageObj (IMAGEOBJP (BIN (fetch (TEXTOBJ STREAMHINT) of TEXTOBJ)))) collect ImageObj))) (T (replace (SELECTION SET) of (fetch (TEXTOBJ SCRATCHSEL) of TEXTOBJ) with T) (TEDIT.SEL.AS.STRING (fetch (TEXTOBJ STREAMHINT) of TEXTOBJ) (fetch (TEXTOBJ SCRATCHSEL) of TEXTOBJ)))))))) (NC.AskUser (LAMBDA (Msg Prompt FirstTry ClearFirstFlg) (* fgh: " 1-Apr-84 11:50") (* Get a response from the user) (RESETLST (RESETSAVE (NC.MoveTTYWindow (QUOTE OFF))) (NC.PrintMsg ClearFirstFlg Msg) (PROMPTFORWORD Prompt FirstTry NIL PROMPTWINDOW NIL NIL (CHARCODE (EOL)))))) (NC.AskUser2 (LAMBDA (Msg Prompt FirstTry ClearFirstFlg MainWindow DontCloseAtEndFlg) (* NoteCards% User "22-Jun-84 19:49") (* Get a response from the user - using the promptwindow attached to MainWindow) (RESETLST (RESETSAVE (NC.MoveTTYWindow (QUOTE OFF))) (COND (T (PROG (AskWindow) (SETQ AskWindow (NC.PrintMsg2 MainWindow ClearFirstFlg Msg)) (RETURN (PROG1 (PROMPTFORWORD Prompt FirstTry "To type a ?, type CTRL-V followed by a ?." AskWindow NIL NIL (CHARCODE (EOL))) (NC.ClearMsg MainWindow (NULL DontCloseAtEndFlg)))))))))) (NC.BitMapFromImageObject (LAMBDA (ImageObject) (* fgh: " 9-Apr-84 22:40") (PROG (DisplayStream ImageBox BitMap) (SETQ DisplayStream (DSPCREATE (BITMAPCREATE 1 1 1))) (SETQ ImageBox (APPLY* (IMAGEOBJPROP ImageObject (QUOTE IMAGEBOXFN)) ImageObject DisplayStream)) (SETQ BitMap (BITMAPCREATE (fetch (IMAGEBOX XSIZE) of ImageBox) (IPLUS (fetch (IMAGEBOX YSIZE) of ImageBox) (fetch (IMAGEBOX YDESC) of ImageBox)))) (DSPDESTINATION BitMap DisplayStream) (DSPYPOSITION (fetch (IMAGEBOX YDESC) of ImageBox) DisplayStream) (APPLY* (IMAGEOBJPROP ImageObject (QUOTE DISPLAYFN)) ImageObject DisplayStream) (RETURN BitMap)))) (NC.ClearMsg (LAMBDA (MainWindow ClosePromptWindowFlg) (* fgh: " 1-May-84 14:01") (* Clear and optionally close the promnpt window for MainWindow) (PROG (PromptWindow) (COND ((AND (WINDOWP MainWindow) (SETQ PromptWindow (GETPROMPTWINDOW MainWindow))) (COND (ClosePromptWindowFlg (REMOVEPROMPTWINDOW MainWindow)) (T (CLEARW PromptWindow)))) (T (CLRPROMPT)))))) (NC.DetermineBorderWidth (LAMBDA (NoteCardType) (* fgh: " 9-May-84 17:49") (* Determine the border width for a card of type NoteCardType) (CADR (FASSOC NoteCardType NC.NoteCardBorderWidths)))) (NC.FloppyArchive (LAMBDA (FileName FromFloppyFlg) (* NoteCards% User "13-Jun-84 00:05") (* Copy a database from a file to or from a floppy file for backup.) (PROG (FromFile ToFile) (COND ((AND PSA.Database (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is an open NoteFile." (CHARACTER 13) "The NoteFile must be closed before any other NoteFile can be " (COND (FromFloppyFlg "restored.") (T "backed-up.")) (CHARACTER 13)) (RETURN))) (AND (NULL FileName) (NULL (SETQ FileName (NC.DatabaseFileName (CONCAT "Please enter name of NoteFile to be copied " (COND (FromFloppyFlg "from") (T "to")) " floppy") " -- " T))) (RETURN NIL)) (COND (FromFloppyFlg (SETQ FromFile (INFILEP (PACKFILENAME (QUOTE HOST) (QUOTE {FLOPPY}) (QUOTE BODY) FileName))) (COND ((NULL FromFile) (NC.PrintMsg2 NIL T FileName " is not on the floppy." (CHARACTER 13) "Restore cancelled." (CHARACTER 13)) (RETURN))) (SETQ ToFile (PACKFILENAME (QUOTE HOST) (OR (FILENAMEFIELD FileName (QUOTE HOST)) (FILENAMEFIELD (DIRECTORYNAME T) (QUOTE HOST))) (QUOTE DIRECTORY) (OR (FILENAMEFIELD FileName (QUOTE DIRECTORY)) (FILENAMEFIELD (DIRECTORYNAME T) (QUOTE DIRECTORY))) (QUOTE VERSION) NIL (QUOTE BODY) FromFile))) (T (SETQ FromFile (INFILEP FileName)) (COND ((NULL FromFile) (NC.PrintMsg2 NIL T FileName " does not exist." (CHARACTER 13) "Backup cancelled." (CHARACTER 13)) (RETURN))) (SETQ ToFile (PACKFILENAME (QUOTE HOST) (QUOTE {FLOPPY}) (QUOTE VERSION) NIL (QUOTE BODY) FromFile)))) (FLOPPY.MODE (QUOTE PILOT)) (NC.PrintMsg2 NIL T "Copying NoteFile " (COND (FromFloppyFlg "from") (T "to")) " floppy. Please wait ... " (CHARACTER 13)) (SETQ ToFile (COPYFILE FromFile ToFile)) (COND (FromFloppyFlg (NC.PrintMsg2 NIL T "Restore of " FromFile " completed." (CHARACTER 13) "NoteFile is now on " ToFile "." (CHARACTER 13))) (T (NC.PrintMsg2 NIL T "Backup of " FromFile " completed." (CHARACTER 13) "Copy of NoteFile is now on " ToFile "." (CHARACTER 13))))))) (NC.GreyCard (LAMBDA (ID) (* fgh: " 1-May-84 23:50") (* Grey over the interior of a card to mark it as obsolete.) (PROG ((Window (NC.FetchWindow ID))) (AND (WINDOWP Window) (BITBLT NIL NIL NIL Window NIL NIL NIL NIL (QUOTE TEXTURE) (QUOTE PAINT) GRAYSHADE)) (RETURN T)))) (NC.IDFromNumber (LAMBDA (Number) (* fgh: " 9-Apr-84 19:24") (PACK* (SUBATOM (QUOTE NC00000) 1 (IDIFFERENCE 7 (NCHARS Number))) Number))) (NC.IDFromWindow (LAMBDA (Window) (* fgh: "24-Feb-84 19:00") (WINDOWPROP Window (QUOTE NoteCardID)))) (NC.MoveWindowOntoScreen (LAMBDA (Window) (* fgh: "22-May-84 23:54") (* Make sure a window and all its attachments are on the screen.) (PROG ((WindowRegion (WINDOWREGION Window))) (COND ((WINDOWP Window) (COND ((NOT (SUBREGIONP WHOLEDISPLAY WindowRegion)) (COND ((MINUSP (fetch (REGION LEFT) of WindowRegion)) (replace (REGION LEFT) of WindowREgion with 0)) ((IGREATERP (fetch (REGION RIGHT) of WindowRegion) (fetch (REGION RIGHT) of WHOLEDISPLAY)) (replace (REGION LEFT) of WindowRegion with (IDIFFERENCE (fetch (REGION RIGHT) of WHOLEDISPLAY) (fetch (REGION WIDTH) of WindowRegion))))) (COND ((IGREATERP (fetch (REGION TOP) of WindowRegion) (fetch (REGION TOP) of WHOLEDISPLAY)) (replace (REGION BOTTOM) of WindowRegion with (IDIFFERENCE (fetch (REGION TOP) of WHOLEDISPLAY) (fetch (REGION HEIGHT) of WindowRegion))) ) ((MINUSP (fetch (REGION BOTTOM) of WindowRegion)) (replace (REGION BOTTOM) of WindowRegion with 0))) (MOVEW Window (LOWERLEFT WindowRegion))))))))) (NC.NotDaughterP (LAMBDA (StartID CandidateID LinkPredicate CheckedCardList) (* fgh: "11-Apr-84 22:27") (* Returns T if CandidateID is not on any path emenating from StartID. Only links for which LinkPredicate is true are checked. LinkPredicate defaults to all links.) (PROG (ToLinks) (OR LinkPredicate (SETQ LinkPredicate (FUNCTION TRUE))) (SETQ ToLinks (NC.RetrieveToLinks StartID PSA.Database)) (SETQ CheckedCardList (CONS StartID CheckedCardList)) (RETURN (for Link in ToLinks when (AND (NOT (FMEMB (SETQ DestinationID (fetch (NOTECARDLINK DESTINATIONID) of Link)) CheckedCardList)) (APPLY* LinkPredicate Link)) always (AND (NEQ CandidateID DestinationID) (NC.NotDaughterP DestinationID CandidateID LinkPredicate CheckedCardList))))))) (NC.PlaceMarkerP (LAMBDA (ImageObject) (* fgh: " 5-Mar-84 01:37") (AND ImageObject (EQ (IMAGEOBJPROP ImageObject (QUOTE PUTFN)) (FUNCTION NC.PlaceMarkerPutFn))))) (NC.ReportError (LAMBDA (FromFunction Msg) (* fgh: " 2-Mar-84 19:29") (APPLY* (FUNCTION BREAK1) T T FromFunction NIL NIL (LIST Msg)))) (NC.PrintMsg (LAMBDA Msgs (* fgh: "10-Apr-84 11:34") (* Print the msgs in the prompt window. First argument is a ClearMsgWindowFlg, rest of arguments are simply prin1'ed to the msg window) (AND (NOT (ZEROP Msgs)) (ARG Msgs 1) (CLRPROMPT)) (AND (IGREATERP Msgs 1) (LINELENGTH 500 PROMPTWINDOW) (for Msg from 2 to Msgs do (PRIN1 (ARG Msgs Msg) PROMPTWINDOW))) T)) (NC.PrintMsg2 (LAMBDA Msgs (* fgh: "11-May-84 22:43") (* Print the msgs in the specified window. Last argument is a window to print msg in, rest of arguments are simply prin1'ed to the msg window) (PROG (Window) (AND (IGREATERP Msgs 2) (COND ((WINDOWP (SETQ Window (ARG Msgs 1))) (SETQ Window (GETPROMPTWINDOW Window 5 (FONTCREATE (QUOTE HELVETICA) 10)))) (T (SETQ Window PROMPTWINDOW))) (OR (NULL (ARG Msgs 2)) (CLEARW Window) T) (LINELENGTH 500 Window) (for Msg from 3 to Msgs do (PRIN1 (ARG Msgs Msg) Window))) (RETURN Window)))) (NC.MoveTTYWindow (LAMBDA (OnOrOff) (* fgh: " 9-Apr-84 19:11") (AND (NEQ (TTYDISPLAYSTREAM) PROMPTWINDOW) (COND ((EQ OnOrOff (QUOTE ON)) (MOVEW (WFROMDS (TTYDISPLAYSTREAM)) 100 100) (QUOTE OFF)) (T (MOVEW (WFROMDS (TTYDISPLAYSTREAM)) 1000 2000) (QUOTE ON)))))) (WW (LAMBDA (X Y) (* fgh: " 2-Apr-84 15:15") (WHICHW X Y))) ) (* Place marker ImageObjects) (DEFINEQ (NC.PlaceMarkerCopyFn (LAMBDA (ImageObj) (* fgh: " 5-Mar-84 23:22") (NC.MakePlaceMarker (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM))))) (NC.PlaceMarkerDisplayFn (LAMBDA (ImageObj Stream) (* fgh: "25-May-84 19:18") (SELECTQ (IMAGESTREAMTYPE Stream) (DISPLAY (* This is being displayed on the screen) (PROG ((Label (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM)))) (DSPFONT NC.PlaceMarkerDisplayFont Stream) (RELMOVETO 3 0 Stream) (PRIN1 (U-CASE Label) Stream))) ((PRESS INTERPRESS) (* It's being displayed on a press file) NIL) NIL))) (NC.PlaceMarkerGetFn (LAMBDA (FileStream TextStream) (* fgh: " 5-Mar-84 23:25") (NC.MakePlaceMarker (READ FileStream)))) (NC.PlaceMarkerImageBoxFn (LAMBDA (ImageObj Stream) (* NoteCards% User " 7-Jun-84 19:29") (PROG ((Font NC.PlaceMarkerDisplayFont) (Label (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM)))) (RETURN (SELECTQ (IMAGESTREAMTYPE Stream) ((PRESS INTERPRESS) (printout PROMPTWINDOW T "hardcopy not implemented yet") NIL) (PROGN (* default to DISPLAY) (create IMAGEBOX XSIZE ←(IPLUS 6 (STRINGWIDTH (U-CASE Label) Font)) YSIZE ←(IPLUS 18 (FONTPROP Font (QUOTE HEIGHT))) YDESC ←(IPLUS 3 (FONTPROP Font (QUOTE DESCENT))) XKERN ← 0))))))) (NC.PlaceMarkerPutFn (LAMBDA (ImageObj FileStream) (* fgh: "29-Feb-84 19:15") (PROG ((Label (IMAGEOBJPROP ImageObj (QUOTE OBJECTDATUM)))) (PRIN2 (MKSTRING Label) FileStream)))) (NC.MakePlaceMarker (LAMBDA (Label) (* fgh: " 5-Mar-84 01:43") (IMAGEOBJCREATE Label (IMAGEFNSCREATE (FUNCTION NC.PlaceMarkerDisplayFn) (FUNCTION NC.PlaceMarkerImageBoxFn) (FUNCTION NC.PlaceMarkerPutFn) (FUNCTION NC.PlaceMarkerGetFn) (FUNCTION NC.PlaceMarkerCopyFn) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL))))) ) (* Unknown ?????????) (DEFINEQ (NC.FetchBeingDeletedFlg (LAMBDA (ID) (* fgh: "26-Mar-84 20:47") (GETPROP ID (QUOTE BeingDeleted)))) (NC.SetBeingDeletedFlg (LAMBDA (ID Value) (* fgh: "26-Mar-84 20:46") (PUTPROP ID (QUOTE BeingDeleted) Value))) ) (* Scavenger mechanisms) (DEFINEQ (NC.CollectAndCheckLinks (LAMBDA (ID DatabaseStream UpdateLinkLabelsFlg) (* NoteCards% User " 4-Jun-84 21:08") (* Return the list of all of the NoteCardLinks in the substance of NoteCard ID. Check each link to make sure it is legal. If not legal delete it from the substance.) (* Assumes that the ID is already an active NoteCard) (PROG (NoteCardType Links Anno Substance DirtyFlg ActualLink GlobalLinks) (SETQ NoteCardType (NC.FetchType ID)) (SETQ Substance (NC.FetchSubstance ID)) (* Collect the links. Check the validity of each link and delete it if it is not a valid link.) (SELECTQ NoteCardType ((TEXT CONTENTS) (SETQ Links (for ImageObjectDecriptor in (TEDIT.LIST.OF.OBJECTS (TEXTOBJ Substance) (FUNCTION NOTECARD.ANNO.IMAGEOBJP)) when (PROG NIL (SETQ ActualLink (NC.FetchSubstanceFromAnno (IMAGEOBJPROP (CAR ImageObjectDecriptor) (QUOTE OBJECTDATUM)))) (COND ((NC.ValidLinkP ActualLink DatabaseStream) (RETURN T)) (T (create IMAGEOBJ smashing (CAR ImageObjectDecriptor) OBJECTDATUM ←(fetch (IMAGEOBJ OBJECTDATUM) of NC.DeletedLinkImageObject) IMAGEOBJPLIST ←(fetch (IMAGEOBJ IMAGEOBJPLIST) of NC.DeletedLinkImageObject) IMAGEOBJFNS ←(fetch (IMAGEOBJ IMAGEOBJFNS) of NC.DeletedLinkImageObject)) (SETQ DirtyFlg T) (RETURN NIL)))) collect ActualLink))) ((SKETCH MAP) (SETQ Links (for SketchElt in (SUBSET (fetch (SKETCH SKETCHELTS) of Substance) (FUNCTION (LAMBDA (SketchElt) (AND (EQ (fetch (INDIVIDUALGLOBALPART GTYPE) of (fetch (GLOBALPART INDIVIDUALGLOBALPART) of SketchElt)) (QUOTE SKIMAGEOBJ)) (EQ (NC.FetchSubstanceTypeFromAnno (fetch (SKIMAGEOBJ SKIMAGEOBJ) of (fetch (GLOBALPART INDIVIDUALGLOBALPART) of SketchElt))) (QUOTE NOTECARD)))))) when (PROG NIL (SETQ ActualLink (NC.FetchSubstanceFromAnno (IMAGEOBJPROP (fetch (SKIMAGEOBJ SKIMAGEOBJ) of (fetch (GLOBALPART INDIVIDUALGLOBALPART) of SketchElt)) (QUOTE OBJECTDATUM)))) (COND ((NC.ValidLinkP ActualLink DatabaseStream) (RETURN T)) (T (replace (SKIMAGEOBJ SKIMAGEOBJ) of (fetch (GLOBALPART INDIVIDUALGLOBALPART) of SketchElt) with NC.DeletedImageObject) (SETQ DirtyFlg T) (RETURN NIL)))) collect ActualLink))) ((BROWSER GRAPH) (SETQ Links (for GraphNode in (fetch (GRAPH GRAPHNODES) of (NC.FetchSubstance ID)) when (COND ((AND (LITATOM (fetch (GRAPHNODE NODEID) of GraphNode)) (SETQ Anno (GETPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation))) (EQ (QUOTE NOTECARD) (NC.FetchSubstanceTypeFromAnno Anno))) (COND ((NC.ValidLinkP (SETQ ActualLink ( NC.FetchSubstanceFromAnno Anno)) DatabaseStream)) (T (PUTPROP (fetch (GRAPHNODE NODEID) of GraphNode) (QUOTE Annotation) NIL) (replace (GRAPHNODE NODELABEL) of GraphNode with (NC.BitMapFromImageObject NC.DeletedLinkImageObject)) (replace (GRAPHNODE NODELABELBITMAP) of GraphNode with (fetch (GRAPHNODE NODELABEL) of GraphNode)) (SETQ DirtyFlg T) NIL))) (T NIL)) collect ActualLink))) (NC.ReportError "NC.CollectAndCheckLinks" (CONCAT "Unknown NoteCard Type: " NoteCardType " ID: " ID))) (* Process the GlobalLinks as well - same for all substance types) (SETQ Links (NCONC Links (for Link in (SETQ GlobalLinks (for GlobalLink in (NC.FetchGlobalLinks ID) when (COND ((NC.ValidLinkP GlobalLink DatabaseStream T)) (T (SETQ DirtyFlg T) NIL)) collect GlobalLink)) when (NEQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (QUOTE NC00000)) collect Link))) (NC.SetGlobalLinks ID GlobalLinks) (* Convert the link labels from the initial to the current naming conventions.) (COND (UpdateLinkLabelsFlg (for Link in Links do (replace (NOTECARDLINK LINKLABEL) of Link with (SELECTQ (fetch (NOTECARDLINK LINKLABEL) of Link) (Contents (SETQ DirtyFlg T) NC.FiledCardLinkLabel) (SubContents (SETQ DirtyFlg T) NC.SubBoxLinkLabel) (BrowserHook (SETQ DirtyFlg T) NC.BrowserContentsLinkLabel) (ListContents (SETQ DirtyFlg T) NC.ListContentsLinkLabel) ((Who% Knows Who NIL) (SETQ DirtyFlg T) (QUOTE Unspecified)) (fetch (NOTECARDLINK LINKLABEL) of Link)))))) (* Write out the card if it has been modified) (COND (DirtyFlg (NC.PutNoteCard ID DatabaseStream) (NC.PutLinks ID DatabaseStream))) (RETURN Links)))) (NC.FixIt (LAMBDA (ID DatabaseStream) (* fgh: "31-May-84 00:12") (* Fix up Updates and Sources in Ken's database) (PROG (Substance NoteCardType PropList UpdateTrail Updates Sources Objects) (SETQ Substance (NC.FetchSubstance ID)) (SETQ NoteCardType (NC.FetchType ID)) (SETQ PropList (NC.FetchPropList ID)) (SETQ UpdateTrail (LISTGET PropList (QUOTE UpdateTrail))) (SETQ Updates (LISTGET PropList (QUOTE Updates))) (SETQ Sources (for Link in (NC.FetchGlobalLinks ID) when (EQ (fetch (NOTECARDLINK DESTINATIONID) of Link) (QUOTE Source)) collect Link)) (SETQ Updates (NCONC Updates UpdateTrail)) (LISTPUT PropList (QUOTE UpdateTrail) NIL) (LISTPUT PropList (QUOTE Updates) Updates) (NC.SetPropList ID (for Item on PropList by (CDDR Item) when (NEQ (CAR Item) (QUOTE UpdateTrail)) join (LIST (CAR Item) (CADR Item)))) (COND ((EQ NoteCardType (QUOTE CONTENTS)) (SETQ Objects (TEDIT.LIST.OF.OBJECTS (TEXTOBJ Substance) (FUNCTION NC.PlaceMarkerP))) (COND ((EQP (LENGTH Objects) 2) (replace (IMAGEOBJ OBJECTDATUM) of (CAAR Objects) with "File Boxes") (replace (IMAGEOBJ OBJECTDATUM) of (CAADR Objects) with "Note Cards")))) (T (COND ((NULL Sources) (NC.AddSourceLink ID (QUOTE NC00000) DatabaseStream)))))))) (NC.GetOldData (LAMBDA (ID Ptr LinksPtr DatabaseStream) (* fgh: "23-Apr-84 19:57") (WITH.MONITOR (NC.FetchMonitor DatabaseStream "NC.GetOldData") (PROG (Index Status ActualID NoteCardType Title Substance PropList FromLinks ToLinks Region Stream) (SETQ Stream (NC.CoerceDatabaseStream DatabaseStream "NC.GetOldData")) (* Get Substance) (SETFILEPTR Stream Ptr) (COND ((NOT (NC.GetIdentifier Stream NC.ItemIdentifier)) (NC.ReportError "NC.GetOldData" (CONCAT ID " Error in Database file -- incorrect item identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetOldData" (CONCAT "ID mismatch while reading item. Expected ID: " ID " Found ID: " ActualID)))) (SETQ NoteCardType (READ Stream)) (SETQ Title (READ Stream)) (SETQ PropList (READ Stream)) (READC Stream) (SETQ Region (NC.GetRegion ID Stream)) (SETQ Substance (SELECTQ NoteCardType ((TEXT CONTENTS CONTEXT) (NC.GetTextSubstance Stream ID Region)) ((SKETCH MAP) (NC.GetSketchSubstance Stream)) ((BROWSER GRAPH) (NC.GetGraphSubstance Stream)) (NC.ReportError "NC.GetOldData" (CONCAT NoteCardType " Unknown Note Card Type")))) (* Get Links) (SETFILEPTR Stream LinksPtr) (COND ((NOT (NC.GetIdentifier Stream NC.LinksIdentifier)) (NC.ReportError "NC.GetOldData" (CONCAT ID " Error in Database file -- incorrect links identifier.")))) (SETQ ActualID (READ Stream)) (COND ((NEQ ActualID ID) (NC.ReportError "NC.GetOldData" (CONCAT "ID mismatch while reading links. Expected ID: " ID " Found ID: " ActualID)))) (SETQ ToLinks (READ Stream)) (SETQ FromLinks (READ Stream)) (* Setup ID with appropriate properties for retrieved card) (NC.SetType ID NoteCardType) (NC.SetRegion ID Region) (NC.SetTitle ID Title) (NC.SetSubstance ID Substance) (NC.SetPropList ID PropList) (NC.SetToLinks ID ToLinks) (NC.SetLinksDirtyFlg ID) (NC.SetFromLinks ID FromLinks) (NC.SetLinksDirtyFlg ID) (NC.ActivateCard ID) (RETURN ID))))) (NC.FindOldData (LAMBDA (ID DatabaseStream) (* fgh: "21-Mar-84 12:17") (SETFILEPTR DatabaseStream 0) (while (SETQ Pos (FILEPOS "###ITEM###" DatabaseStream NIL NIL NIL NIL)) when (PROGN (READ DatabaseStream) (EQ (READ DatabaseStream) ID)) collect Pos))) (NC.FindOldLinks (LAMBDA (ID DatabaseStream) (* fgh: "21-Mar-84 13:56") (SETFILEPTR DatabaseStream 0) (while (SETQ Pos (FILEPOS "###LINKS###" DatabaseStream NIL NIL NIL NIL)) when (PROGN (READ DatabaseStream) (EQ (READ DatabaseStream) ID)) collect Pos))) (NC.ReinstateNthInstance (LAMBDA (ID NData NLinks DatabaseStream) (* fgh: " 3-May-84 18:15") (PROG (Ptr LinksPtr) (COND ((MINUSP NData) (SETQ Ptr (CAR (NLEFT (NC.FindOldData ID DatabaseStream) (ABS NData))))) (T (SETQ Ptr (CAR (NTH (NC.FindOldData ID DatabaseStream) NData))))) (COND ((MINUSP NLinks) (SETQ LinksPtr (CAR (NLEFT (NC.FindOldLinks ID DatabaseStream) (ABS NLinks))))) (T (SETQ LinksPtr (CAR (NTH (NC.FindOldLinks ID DatabaseStream) NLinks))))) (* (NC.GetOldData ID Ptr LinksPtr DatabaseStream) (NC.PutNoteCard ID DatabaseStream) (NC.PutLinks ID DatabaseStream) (NC.DeactivateCard ID)) (RETURN (COND ((AND (NC.IDP ID) Ptr LinksPtr) (SETFILEPTR DatabaseStream (NC.IndexFromID ID)) (NC.PutPtr DatabaseStream Ptr) (NC.PutPtr DatabaseStream LinksPtr) (NC.PutStatus DatabaseStream ACTIVE) (QUOTE DONE)) (T (QUOTE ERROR))))))) (NC.ScavengeDatabaseFile (LAMBDA (FileName UpdateLinkLabelsFlg) (* NoteCards% User "17-Jun-84 19:30") (* Scavanege the database FileName. Essentially throw away all of the information about From and ToLionks and recreate them by retrieveing the link information from the substance of each card and from the list of global links from the card.) (PROG (FromLinks ToLinks DatabaseStream Status ID Links Entry FullName CardTotal) (* Get File NAme and open the file if conditions are okay.) (COND ((AND (STREAMP PSA.Database) (OPENP PSA.Database)) (NC.PrintMsg2 NIL T "There is an open NoteFile -- " (FULLNAME PSA.Database) (CHARACTER 13) "It must be closed before the repair procedure can be done." (CHARACTER 13)) (RETURN))) (AND (NULL FileName) (NULL (SETQ FileName (NC.DatabaseFileName "What is the name of the NoteFile to repair?" " -- " T))) (RETURN NIL)) (COND ((OPENP FileName) (NC.PrintMsg2 NIL T FileName " is an already open file." (CHARACTER 13)) (RETURN))) (COND ((NOT (SETQ FullName (INFILEP FileName))) (NC.PrintMsg2 NIL T FileName " is not the name of a NoteFile." (CHARACTER 13) "Repair aborted." (CHARACTER 13)) (RETURN))) (SETQ DatabaseStream (GETSTREAM (OPENFILE FullName (QUOTE BOTH)))) (SETQ PSA.Database DatabaseStream) (NC.SetMonitor DatabaseStream (CREATE.MONITORLOCK)) (* Read through all NoteCard substances to find actual pointers. Use this to create the To Links list. The list collection function checks to make sure each link is valid.) (NC.PrintMsg2 NIL T "Collecting Links ... ") (for NoteCardNumber from 1 to (SETQ CardTotal (SUB1 (SUBATOM (NC.GetNewID DatabaseStream T) 3))) do (SETQ ID (NC.IDFromNumber NoteCardNumber)) (NC.PrintMsg2 NIL T "Repairing NoteFile." (CHARACTER 13) "Collecting Links for item " NoteCardNumber " out of " CardTotal "." (CHARACTER 13)) (SETQ Status (NC.GetNoteCard ID DatabaseStream)) (COND ((NC.IDP Status) (SETQ Links (NC.CollectAndCheckLinks ID DatabaseStream UpdateLinkLabelsFlg)) (SETQ ToLinks (CONS (CONS ID Links) ToLinks)))) (NC.DeactivateCard ID T)) (* Compute the From Links list by "inverting" the To Links list) (NC.PrintMsg2 NIL T "Processing Links ... ") (for Item in ToLinks do (for Link in (CDR Item) do (SETQ Entry (FASSOC (fetch (NOTECARDLINK DESTINATIONID) of Link) FromLinks)) (COND (Entry (NCONC1 Entry (create NOTECARDLINK DESTINATIONID ←(CAR Item) LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Link) DISPLAYMODE ←(fetch (NOTECARDLINK DISPLAYMODE) of Link)))) (T (SETQ FromLinks (CONS (LIST (fetch (NOTECARDLINK DESTINATIONID) of Link) (create NOTECARDLINK DESTINATIONID ←(CAR Item) LINKLABEL ←(fetch (NOTECARDLINK LINKLABEL) of Link) DISPLAYMODE ←(fetch (NOTECARDLINK DISPLAYMODE) of Link))) FromLinks)))))) (* Reset all of the To and From Links lists in the database) (NC.PrintMsg2 NIL T "Rewriting Links ... ") (for NoteCardNumber from 1 to (SETQ CardTotal (SUB1 (SUBATOM (NC.GetNewID DatabaseStream T) 3))) do (SETQ ID (NC.IDFromNumber NoteCardNumber)) (NC.PrintMsg2 NIL T "Repairing NoteFile." (CHARACTER 13) "Rewriting links for item " NoteCardNumber " out of " CardTotal "." (CHARACTER 13)) (SETQ Status (NC.GetNoteCard ID DatabaseStream)) (COND ((NC.IDP Status) (NC.SetToLinks ID (CDR (FASSOC ID ToLinks))) (NC.SetFromLinks ID (CDR (FASSOC ID FromLinks))) (NC.PutLinks ID DatabaseStream))) (NC.DeactivateCard ID T)) (NC.ForceDatabaseClose DatabaseStream) (NC.PrintMsg2 NIL T "Repair Completed for " (FULLNAME DatabaseStream) "." (CHARACTER 13))))) ) (PUTPROPS TEDIT READVICE (NIL (BEFORE NIL (SETQ TEDIT.DEFAULT.WINDOW)))) (READVISE TEDIT) (* Database compactor) (DEFINEQ (NC.ComputeNewDatabaseIndexSize (LAMBDA (FromStream) (* Feuerman "29-Feb-84 09:44") (* If the number of notecards we have is more than 3/4 the size of the index, double the index size; otherwise just keep the same size) (PROG (NumberOfCurrentIndices CurrentIndexSize) (SETFILEPTR FromStream 0) (SETQ NumberOfCurrentIndices (NC.GetPtr FromStream 2)) (SETQ CurrentIndexSize (NC.GetPtr FromStream 2)) (COND ((GREATERP NumberOfCurrentIndices (FIX (TIMES .75 CurrentIndexSize))) (RETURN (ITIMES 2 CurrentIndexSize))) (T (RETURN CurrentIndexSize)))))) (NC.CopyAndCompactDatabase (LAMBDA (FromDatabaseName ToDatabaseName IncludeDeleteCardsFlg) (* NoteCards% User "17-Jun-84 19:31") (* Copy a database file from FromDatabaseName to ToDatabaseName compacting it along the way by simpluy not copying obsolete or deleted information.) (PROG (FromStream ToStream NextFreeIndex ID TotalCount) (SETQ FromStream (NC.OpenDatabaseFile FromDatabaseName (QUOTE INPUT) T T)) (AND (NULL FromStream) (RETURN)) (NC.CacheTitles FromStream NIL T) (NC.CreateDatabaseFile ToDatabaseName (NC.ComputeNewDatabaseIndexSize FromStream) "Compacting NoteFile.") (SETQ ToStream (NC.OpenDatabaseFile ToDatabaseName NIL T)) (AND (NULL ToStream) (RETURN)) (SETFILEPTR FromStream 0) (SETQ NextFreeIndex (NC.GetPtr FromStream 2)) (NC.GetPtr FromStream 2) (NC.GetPtr FromStream 4) (SETFILEPTR ToStream 0) (NC.PutPtr ToStream NextFreeIndex 2) (COND ((NEQ NextFreeIndex 1) (for CTR from 1 to (SETQ TotalCount (SUB1 NextFreeIndex)) do (SETQ ID (NC.IDFromNumber CTR)) (NC.PrintMsg2 NIL T "Compacting NoteFile." (CHARACTER 13) "Copying item " CTR " of " TotalCount "." (CHARACTER 13)) (NC.CopyNoteCard ID FromStream ToStream IncludeDeleteCardsFlg)))) (NC.CacheTitles FromStream T T) (CLOSEW (WFROMDS (TTYDISPLAYSTREAM))) (SETQ PSA.Database) (RETURN (LIST (NC.ForceDatabaseClose FromStream) (NC.ForceDatabaseClose ToStream)))))) (NC.CopyNoteCard (LAMBDA (ID FromStream ToStream IncludeDeleteCardsFlg) (* fgh: " 4-Jun-84 18:39") (PROG (Status Window DebugFlg) (* Activate ID so that when we do a put, all of the notecard information is available to us) (SETQ Status (NC.GetNoteCard ID FromStream IncludeDeleteCardsFlg)) (* Check status here. Note that NC.GetNoteCard won't activate notecard if its status isn't ACTIVE) (COND ((EQ Status (QUOTE SPECIAL)) (* Process Special "card" containing the list of link labels.) (NC.PutLinkLabels ToStream (NC.GetLinkLabels FromStream))) ((EQ Status ID) (COND ((FMEMB (NC.FetchType ID) (QUOTE (SKETCH MAP))) (SKETCHW.CREATE (NC.FetchSubstance ID) (NC.FetchRegionViewed ID) (CREATEREGION 1000 2000 (fetch (REGION WIDTH) of (NC.FetchRegion ID)) (fetch (REGION HEIGHT) of (NC.FetchRegion ID)))))) (AND NC.FixItFlg (NC.FixIt ID ToStream)) (NC.PutNoteCard ID ToStream) (NC.PutLinks ID ToStream) (SETQ Window (NC.FetchWindow ID)) (NC.DeactivateCard ID) (AND (OPENWP Window) (CLOSEW Window))) (T (NC.MarkIndexEntryFree ID ToStream) (AND DebugFlg (PRINT (CONCAT "Not Copied: " ID " Status: " Status)))))))) ) (* Image Object for Deleted Links in TEdit) (SETQ NC.DeletedLinkImageObject (IMAGEOBJCREATE "DeletedLink" (IMAGEFNSCREATE (FUNCTION NC.DeletedLinkDisplayFn) (FUNCTION NC.DeletedLinkImageBoxFn) (FUNCTION NC.DeletedLinkPutFn) (FUNCTION NC.DeletedLinkGetFn) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL) (FUNCTION NILL)))) (SETQ ANNO.SUBSTANCE.TYPES (CONS (create ANNOSUBSTANCETYPE TYPENAME ← (QUOTE NOTECARD) CREATESUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.CREATEFN) EDITSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.EDITFN) GETSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.GETFN) PUTSUBSTANCEFN ← (FUNCTION NOTECARD.ANNO.PUTFN) WHENANNODELETEDFN ← (FUNCTION NOTECARD.ANNO.WHENDELETEDFN) WHENANNOCOPIEDFN ← (FUNCTION NOTECARD.ANNO.WHENCOPIEDFN) WHENANNOMOVEDFN ← (FUNCTION NOTECARD.ANNO.WHENMOVEDFN) WHENANNOINSERTEDFN ← (FUNCTION NOTECARD.ANNO.WHENINSERTEDFN) SUMMARYDISPLAYFN ← (FUNCTION NOTECARD.ANNO.SUMM.DISPLAYFN) LOCATIONMETRIC ← (FUNCTION NOTECARD.LOCATION.METRIC) ANNOWINDOWDIRTYP ← (FUNCTION NOTECARD.ANNOWINDOWDIRTYP) DEFAULTWINDOWSIZE ← (CONS 300 75) BUTTONEVENTINFN ← (FUNCTION NOTECARD.ANNO.BUTTONEVENTINFN) IMAGEBOXFN ← (FUNCTION NOTECARD.ANNO.IMAGEBOXFN) DISPLAYFN ← (FUNCTION NOTECARD.ANNO.DISPLAYFN)) (AND (BOUNDP (QUOTE ANNO.SUBSTANCE.TYPES)) ANNO.SUBSTANCE.TYPES))) (* Set up Lafite Bug Report Forms) (RPAQQ NC.SystemDate "28-Jun-84 10:33:21") (DEFINEQ (NC.MakeLafiteForm (LAMBDA NIL (* NoteCards% User "22-Jun-84 16:58") (MAKEXXXSUPPORTFORM "NoteCards" "NoteCardsSupport.pa" NC.SystemDate))) ) (ADDTOVAR LAFITESPECIALFORMS ("NoteCards Report" (FUNCTION NC.MakeLafiteForm) "Report bug or request new feature for NoteCards.")) (SETQ LAFITEFORMSMENU NIL) (* Set up NoteCards) (NC.Setup) (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDTOVAR NLAMA ) (ADDTOVAR NLAML ) (ADDTOVAR LAMA NC.PrintMsg2 NC.PrintMsg) ) (DECLARE: DONTCOPY (FILEMAP (NIL (17806 35496 (INSTALL 17816 . 20217) (NC.AskBrowserSpecs 20219 . 21737) ( NC.DatabaseFileName 21739 . 22513) (NC.DeleteDatabaseFile 22515 . 24516) (NC.FetchNewCardFlg 24518 . 24799) (NC.ForceDatabaseClose 24801 . 25111) (NC.ListDatabaseFiles 25113 . 26004) (NC.MakeFloppies 26006 . 26638) (NC.MakeSysout 26640 . 28200) (NC.MakeTEditLeftMenu 28202 . 32320) ( NC.MakeTEditMiddleMenu 32322 . 32891) (NC.ResetTEdit 32893 . 33283) (NC.ResetTEditProcess 33285 . 34206) (NC.SetNewCardFlg 34208 . 34492) (NC.ShrinkFn 34494 . 34787) (NC.TEditMenuFn 34789 . 35494)) ( 35548 36877 (CREATE.ANNO.NODE 35558 . 35821) (CREATE.PARENTNODE 35823 . 36087) (ADD.ANNO.LINK.NAME 36089 . 36356) (ANNO.SETUPFN 36358 . 36626) (ANNO.NEXTID 36628 . 36875)) (36922 53389 (NC.Setup 36932 . 39491) (NC.MakeMainMenu 39493 . 45258) (NC.MainMenuWhenSelectedFn 45260 . 46764) (NC.CacheTitles 46766 . 47837) (NC.CloseDatabaseFile 47839 . 49265) (NC.CompactDatabase 49267 . 50026) ( NC.DatabaseOperations 50028 . 52663) (NC.LogoutAdvice 52665 . 53387)) (53424 90679 ( NC.CoerceDatabaseStream 53434 . 53942) (NC.CreateDatabaseFile 53944 . 56572) (NC.FetchMonitor 56574 . 57068) (NC.GetCachedMap 57070 . 57567) (NC.GetGraphSubstance 57569 . 58689) (NC.GetIdentifier 58691 . 59052) (NC.GetLinks 59054 . 60650) (NC.GetLinkLabels 60652 . 61803) (NC.GetNewID 61805 . 62628) ( NC.GetNoteCard 62630 . 66716) (NC.GetPropList 66718 . 68128) (NC.GetRegion 68130 . 68388) ( NC.GetSketchSubstance 68390 . 69111) (NC.GetTextSubstance 69113 . 69594) (NC.GetTitle 69596 . 71068) ( NC.GetType 71070 . 72388) (NC.IndexFromID 72390 . 72636) (NC.InitializeSpecialCards 72638 . 74538) ( NC.MarkCardDeleted 74540 . 75934) (NC.MarkIndexEntryFree 75936 . 76336) (NC.OpenDatabaseFile 76338 . 78476) (NC.PutCachedMap 78478 . 79210) (NC.PutDeletedIdentifier 79212 . 79384) (NC.PutGraphSubstance 79386 . 80678) (NC.PutIdentifier 80680 . 80935) (NC.PutLinks 80937 . 82425) (NC.PutLinkLabels 82427 . 83246) (NC.PutNoteCard 83248 . 85126) (NC.PutRegion 85128 . 85788) (NC.PutSketchSubstance 85790 . 86616) (NC.PutTextSubstance 86618 . 89017) (NC.SetMonitor 89019 . 89216) (NC.UpdateRegionData 89218 . 90677)) (92187 100199 (NC.ActivateCard 92197 . 92359) (NC.ActiveCardP 92361 . 92556) ( NC.DeactivateCard 92558 . 93626) (NC.DirtySketchP 93628 . 93903) (NC.FetchFromLinks 93905 . 94064) ( NC.FetchGlobalLinks 94066 . 94229) (NC.FetchLinksDirtyFlg 94231 . 94395) (NC.FetchPropList 94397 . 94554) (NC.FetchRegion 94556 . 94709) (NC.FetchRegionViewed 94711 . 94876) (NC.FetchScale 94878 . 95035) (NC.FetchSubstance 95037 . 95432) (NC.FetchTitle 95434 . 95585) (NC.FetchToLinks 95587 . 95742) (NC.FetchType 95744 . 95893) (NC.FetchWindow 95895 . 96972) (NC.IDP 96974 . 97230) (NC.MarkCardDirty 97232 . 97815) (NC.SetFromLinks 97817 . 97986) (NC.SetGlobalLinks 97988 . 98167) ( NC.SetInitialPropList 98169 . 98395) (NC.SetLinksDirtyFlg 98397 . 98571) (NC.SetPropList 98573 . 98743 ) (NC.SetRegion 98745 . 98909) (NC.SetRegionViewed 98911 . 99092) (NC.SetScale 99094 . 99266) ( NC.SetSubstance 99268 . 99699) (NC.SetTitle 99701 . 99862) (NC.SetToLinks 99864 . 100029) (NC.SetType 100031 . 100197)) (100236 102999 (NC.RetrieveFromLinks 100246 . 100736) (NC.RetrieveLinkLabels 100738 . 101357) (NC.RetrievePropList 101359 . 101743) (NC.RetrieveTitle 101745 . 102183) ( NC.RetrieveToLinks 102185 . 102669) (NC.RetrieveType 102671 . 102997)) (103044 126619 (NC.AddParents 103054 . 105067) (NC.AssignSources 105069 . 105757) (NC.AssignTitle 105759 . 106796) ( NC.DeleteNoteCards 106798 . 109814) (NC.EditNoteCard 109816 . 110797) (NC.MakeNoteCard 110799 . 112344 ) (NC.FileNoteCard 112346 . 112838) (NC.QuitCard 112840 . 113393) (NC.CheckContentsHooks 113395 . 114111) (NC.CheckSources 114113 . 115089) (NC.CheckTitle 115091 . 115627) (NC.DeleteSource 115629 . 117669) (NC.DetermineContentsCards 117671 . 118984) (NC.DetermineSources 118986 . 119768) ( NC.InsureProperFiling 119770 . 120232) (NC.QuitWithoutSaving 120234 . 124203) (NC.UnfileNoteCard 124205 . 125885) (NC.UpdateUpdateList 125887 . 126617)) (126648 155898 (NC.BringUpGraphCard 126658 . 128908) (NC.BringUpSketchCard 128910 . 130931) (NC.BringUpTEditCard 130933 . 133317) (NC.ContentsCardP 133319 . 133742) (NC.MakeBrowserCard 133744 . 137926) (NC.MakeGraphCard 137928 . 138725) ( NC.MakeSketchCard 138727 . 139376) (NC.MakeTEditCard 139378 . 140762) (NC.TEditQuitFn 140764 . 141956) (NC.GraphCardCloseFn 141958 . 142886) (NC.GraphCardLeftButtonFn 142888 . 143857) ( NC.GraphCardMiddleButtonFn 143859 . 145074) (NC.GraphCardSaveFn 145076 . 145898) ( NC.AnnotatedWindowCloseFn 145900 . 146582) (NC.SketchCardCloseFn 146584 . 147406) (NC.SketchCardSaveFn 147408 . 149198) (NC.TEditCloseFn 149200 . 149615) (NC.TEditSaveFn 149617 . 151041) (NC.\TEDIT.LOOKS 151043 . 151197) (NC.\TEDIT.QUIT 151199 . 151440) (NC.MakeContentsCard 151442 . 155896)) (156246 190108 (NC.AddFromLink 156256 . 156851) (NC.AddLinkToGraphCard 156853 . 157510) ( NC.AddLinkToSketchCard 157512 . 157948) (NC.AddLinkToTextCard 157950 . 158441) (NC.AddSourceLink 158443 . 159464) (NC.AddToLink 159466 . 160051) (NC.DelFromLink 160053 . 163264) (NC.DelToLink 163266 . 164655) (NC.DelReferencesToCard 164657 . 166402) (NC.DelReferencesToCardFromGlobalList 166404 . 167335) (NC.DelReferencesToCardFromGraph 167337 . 168487) (NC.DelReferencesToCardFromSketch 168489 . 169379) (NC.DelReferencesToCardFromText 169381 . 170590) (NC.DeletedLinkDisplayFn 170592 . 171834) ( NC.DeletedLinkGetFn 171836 . 172006) (NC.DeletedLinkImageBoxFn 172008 . 172395) (NC.DeletedLinkPutFn 172397 . 172541) (NC.CheckForOrphanDelete 172543 . 173860) (NC.FetchAnnoDisplayFn 173862 . 174097) ( NC.FetchAnnoImageBoxFn 174099 . 174340) (NC.FetchSubstanceFromAnno 174342 . 174585) ( NC.HookToOrphanCard 174587 . 175659) (NC.InsertLinkAndTitleBeforeMarker 175661 . 180115) ( NC.LinkLabelP 180117 . 180379) (NC.MakeAContentsHook 180381 . 181287) (NC.MakeAnnotationLink 181289 . 183414) (NC.MakeContentsHooks 183416 . 185429) (NC.RelabelLink 185431 . 188718) (NC.SystemLinkLabelP 188720 . 189138) (NC.ValidLinkP 189140 . 190106)) (190140 196878 (NC.ChangeLinkDisplayMode 190150 . 191643) (NC.DefaultLinkDisplayMode 191645 . 192281) (NC.UpdateLinkImages 192283 . 193369) ( NC.UpdateLinkImagesInGraph 193371 . 195095) (NC.UpdateLinkImagesInSketch 195097 . 195380) ( NC.UpdateLinkImagesInText 195382 . 196876)) (197068 212591 (NOTECARD.ANNO.BUTTONEVENTINFN 197078 . 199295) (NOTECARD.ANNO.CREATEFN 199297 . 199779) (NOTECARD.ANNO.DISPLAYFN 199781 . 202749) ( NOTECARD.ANNO.EDITFN 202751 . 203855) (NOTECARD.ANNO.GETFN 203857 . 204202) (NOTECARD.ANNO.IMAGEBOXFN 204204 . 205909) (NOTECARD.ANNO.IMAGEOBJP 205911 . 206259) (NOTECARD.ANNO.LOCATIONMETRIC 206261 . 206437) (NOTECARD.ANNO.MIDDLEBUTTONFN 206439 . 207940) (NOTECARD.ANNO.PUTFN 207942 . 208463) ( NOTECARD.ANNO.SUMM.DISPLAYFN 208465 . 208695) (NOTECARD.ANNO.WHENCOPIEDFN 208697 . 209418) ( NOTECARD.ANNO.WHENDELETEDFN 209420 . 210866) (NOTECARD.ANNO.WHENINSERTEDFN 210868 . 212184) ( NOTECARD.ANNO.WHENMOVEDFN 212186 . 212455) (NOTECARD.ANNOWINDOWDIRTYP 212457 . 212589)) (212634 223029 (NC.ChooseBrowseOrSearch 212644 . 214119) (NC.GrowLinkLattice 214121 . 215992) (NC.UpdateBrowserCard 215994 . 220096) (NC.SubContentsLinkP 220098 . 220336) (NC.ContentsLinkP 220338 . 220576) ( NC.NotBrowserHookP 220578 . 220828) (NC.FetchIDFromAnno 220830 . 221124) ( NC.FetchSubstanceTypeFromAnno 221126 . 221361) (NC.SearchForCards 221363 . 223027)) (223186 246397 ( NC.AddPropToPropList 223196 . 225727) (NC.CloseAllPropListEditors 225729 . 226271) ( NC.ClosePropListEditor 226273 . 228244) (NC.DelPropFromList 228246 . 229442) (NC.EditPropButtonFN 229444 . 229810) (NC.EditProperties 229812 . 230357) (NC.EditPropList 230359 . 235224) ( NC.ExtractPropList 235226 . 238181) (NC.OpenPropListEditor 238183 . 241648) (NC.ProcessEditedPropList 241650 . 242889) (NC.PropListEditorOpenP 242891 . 243282) (NC.SelectProperty 243284 . 244182) ( NC.ShowPointers 244184 . 245407) (NC.StringIsListP 245409 . 246395)) (246470 250438 ( NC.SelectNoteCards 246480 . 250436)) (250470 265496 (NC.AskLinkLabel 250480 . 253050) ( NC.AskNoteCardType 253052 . 254375) (NC.ChooseTopLevelCard 254377 . 255752) (NC.DisplayMainMenu 255754 . 256544) (NC.RemoveSketchMenuItems 256546 . 257289) (NC.SelectionMenusWhenSelectedFn 257291 . 257901 ) (NC.SetupTitleBarMenu 257903 . 264537) (NC.TitleBarButtonEventFn 264539 . 265494)) (265519 279005 ( FILDIR-EARLIEST 265529 . 265623) (FILDIR-VERSION 265625 . 266583) (GETMOUSEX 266585 . 266728) ( GETMOUSEY 266730 . 266873) (LOWERLEFT 266875 . 267099) (MBUTTON.NEXT.FIELD.AS.TEXT.OR.IMAGEOBJ 267101 . 268130) (NC.AskUser 268132 . 268525) (NC.AskUser2 268527 . 269286) (NC.BitMapFromImageObject 269288 . 270085) (NC.ClearMsg 270087 . 270594) (NC.DetermineBorderWidth 270596 . 270920) (NC.FloppyArchive 270922 . 273541) (NC.GreyCard 273543 . 274006) (NC.IDFromNumber 274008 . 274217) (NC.IDFromWindow 274219 . 274376) (NC.MoveWindowOntoScreen 274378 . 275828) (NC.NotDaughterP 275830 . 276823) ( NC.PlaceMarkerP 276825 . 277042) (NC.ReportError 277044 . 277229) (NC.PrintMsg 277231 . 277789) ( NC.PrintMsg2 277791 . 278517) (NC.MoveTTYWindow 278519 . 278883) (WW 278885 . 279003)) (279044 281397 (NC.PlaceMarkerCopyFn 279054 . 279246) (NC.PlaceMarkerDisplayFn 279248 . 279825) (NC.PlaceMarkerGetFn 279827 . 279992) (NC.PlaceMarkerImageBoxFn 279994 . 280690) (NC.PlaceMarkerPutFn 280692 . 280924) ( NC.MakePlaceMarker 280926 . 281395)) (281428 281772 (NC.FetchBeingDeletedFlg 281438 . 281598) ( NC.SetBeingDeletedFlg 281600 . 281770)) (281806 298695 (NC.CollectAndCheckLinks 281816 . 287935) ( NC.FixIt 287937 . 289600) (NC.GetOldData 289602 . 292255) (NC.FindOldData 292257 . 292598) ( NC.FindOldLinks 292600 . 292943) (NC.ReinstateNthInstance 292945 . 294044) (NC.ScavengeDatabaseFile 294046 . 298693)) (298822 302825 (NC.ComputeNewDatabaseIndexSize 298832 . 299510) ( NC.CopyAndCompactDatabase 299512 . 301306) (NC.CopyNoteCard 301308 . 302823)) (304611 304823 ( NC.MakeLafiteForm 304621 . 304821))))) STOP