(FILECREATED " 4-Feb-85 23:33:51" {PHYLUM}<NOTECARDS>RELEASE1.1>FGHPATCH2.;3 27000  

      changes to:  (FNS NC.DetermineDisplayRegion NC.DefaultCardWidth NC.DefaultCardHeight 
			NC.AddCardType NC.AddSubstanceType)
		   (VARS FGHPATCH2COMS)

      previous date: " 4-Feb-85 23:22:53" {PHYLUM}<NOTECARDS>RELEASE1.1>FGHPATCH2.;1)


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT FGHPATCH2COMS)

(RPAQQ FGHPATCH2COMS ((FNS NC.MakeBrowserCard NC.MakeGraphCard NC.MakeContentsCard NC.MakeSketchCard 
			   NC.MakeTEditCard)
		      (FNS NC.DetermineDisplayRegion)
		      (FNS NC.BringUpTEditCard NC.BringUpSketchCard NC.BringUpGraphCard)
		      (FNS NC.DefaultCardWidth NC.DefaultCardHeight)
		      (FNS NC.DefaultHeightFromType NC.DefaultWidthFromType)
		      (RECORDS NoteCardType SubstanceType)
		      (FNS NC.AddCardType NC.AddSubstanceType NC.MakeSubstanceTypesList 
			   NC.MakeCardTypesList)
		      (P (PROGN (NC.MakeSubstanceTypesList)
				(NC.MakeCardTypesList)))))
(DEFINEQ

(NC.MakeBrowserCard
  (LAMBDA (ID Title NoDisplayFlg ListOfRootIDAndListOfLinkLabels)
                                                             (* fgh: " 4-Feb-85 23:00")

          (* 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.)



          (* * rht 8/3/84: Changed to call NC.AskLinkLabel with its ReverseLinkLabel parameter set to T.)



          (* * fgh 10/2/84 Changed Link Icons to be image objects in NodeLabel of Graph Npodes rather than annotations on 
	  graph nodes.)



          (* * rht 10/19/84: Fixed setting up of browser card's prop list in case NoDisplayFlg is T so we have no Window.
	  Now NC.MakeLinksLegend returns the label pairs.)



          (* * rht 11/27/84: Removed the WINDOWADDPROP call to put NC.GraphCardCloseFn on the CLOSEFN of the window.
	  This causes trouble. NC.QuitCard will get put on by NC.MakeNoteCard and that's enough.)



          (* * rht 1/3/85: Now puts a dummy region of the right size if the NoDisplayFlg is on.)


    (PROG (Lattice Window Graph PropList BrowserSpecs (RootID (CAR ListOfRootIDAndListOfLinkLabels))
		   (ListOfLinkLabels (CADR ListOfRootIDAndListOfLinkLabels))
		   LabelPairs)
          (NC.ActivateCard ID)
          (if NoDisplayFlg
	      then (NC.SetRegion ID (NC.MakeDummyRegion (QUOTE Browser)))
	    else (SETQ Window (CREATEW (NC.DetermineDisplayRegion ID NIL)
				       (NC.FetchTitle ID)
				       NIL)))
          (SETQ RootID (OR RootID (PROGN (NC.PrintMsg 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 NIL NIL T))
	      (PROGN (NC.PrintMsg Window T "Defaulting to SubBox pointers." (CHARACTER 13))
		     (SETQ ListOfLinkLabels NC.SubBoxLinkLabel)))
          (SETQ BrowserSpecs (COND
	      (NC.SpecialBrowserSpecsFlg (NC.AskBrowserSpecs Window))
	      (T (create BrowserSpecs))))
          (OR NoDisplayFlg (NC.PrintMsg Window NIL (CHARACTER 13)
					"Computing browser graph. Please wait. ..."))
          (SETQ Lattice (CDR (NC.GrowLinkLattice RootID (LIST NIL)
						 ListOfLinkLabels ID PSA.Database)))
          (SETQ LabelPairs (NC.MakeLinksLegend Lattice Window))
          (OR NoDisplayFlg (WINDOWPROP Window (QUOTE NoteCardID)
				       ID))

          (* * Link destination id information stored in NodeLabel field into a LinkIcon for display)


          (for Node in Lattice do (replace (GRAPHNODE NODELABEL) of Node
				     with (NC.MakeLinkIcon (NC.MakeLink Window 
								      NC.BrowserContentsLinkLabel
									(fetch (GRAPHNODE NODELABEL)
									   of Node)
									ID NIL))))
          (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)))
          (OR NoDisplayFlg (NC.PrintMsg Window NIL "Done!"))
          (NC.SetSubstance ID Graph)
          (SETQ PropList (NC.FetchPropList ID))
          (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)
          (LISTPUT PropList (QUOTE BrowserLinksLegend)
		   LabelPairs)
          (AND NC.SpecialBrowserSpecsFlg (LISTPUT PropList (QUOTE BrowserSpecs)
						  (LIST BrowserSpecs)))
          (NC.SetPropListDirtyFlg ID T)
          (COND
	    (NoDisplayFlg (RETURN ID)))
          (replace (GRAPH GRAPH.ADDNODEFN) of Graph with (FUNCTION NC.GraphAddNodeFn))
          (SHOWGRAPH Graph Window (FUNCTION NC.GraphCardLeftButtonFn)
		     (FUNCTION NC.GraphCardMiddleButtonFn)
		     NIL T)
          (NC.SetupTitleBarMenu Window ID (QUOTE Browser))
          (NC.ClearMsg Window T)
          (RETURN Window))))

(NC.MakeGraphCard
  (LAMBDA (ID Title NoDisplayFlg)                            (* fgh: " 4-Feb-85 23:01")
    (COND
      (NoDisplayFlg (NC.SetSubstance ID NIL)
		    ID)
      (T (PROG (Window)
	       (SETQ Window (CREATEW (NC.DetermineDisplayRegion ID NIL)
				     (OR Title "Untitled")))
	       (SHOWGRAPH (create GRAPH
				  GRAPH.ADDNODEFN ←(FUNCTION NC.GraphAddNodeFn))
			  Window
			  (FUNCTION NC.GraphCardLeftButtonFn)
			  (FUNCTION NC.GraphCardMiddleButtonFn)
			  T T)
	       (NC.SetSubstance ID (WINDOWPROP Window (QUOTE GRAPH)))
	       (NC.SetupTitleBarMenu Window ID)
	       (RETURN Window))))))

(NC.MakeContentsCard
  (LAMBDA (ID Title DontDisplay)                             (* fgh: " 4-Feb-85 23:03")
                                                             (* Make up a blank contents card, hook it to the user 
							     specified parent contents cards, and display it.)

          (* * rht 12/2/84: In DontDisplay case, changed to return ID rather than TextStream.)



          (* * rht 12/8/84: Massive shaving. Took out code to force filing now (at creation time))


    (PROG (Window TextStream (Spacer (CONCAT (CHARACTER 13)
					     (CHARACTER 13))))
          (SETQ TextStream (OPENTEXTSTREAM ""))
          (COND
	    (NC.MarkersInFileBoxesFlg (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 ID)))
          (SETQ Window (CREATEW (NC.DetermineDisplayRegion ID NIL)
				(NC.SetTitle ID (OR Title "Untitled"))
				(NC.DetermineBorderWidth (QUOTE CONTENTS))))
          (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu)
		      (NC.MakeTEditLeftMenu (NC.FetchType ID)))
          (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu)
		      (NC.MakeTEditMiddleMenu))              (* Display the card)
          (WINDOWPROP Window (QUOTE SHRINKFN)
		      (FUNCTION NC.ShrinkFn))
          (TEDIT TextStream Window NIL (LIST (QUOTE FONT)
					     NC.DefaultFont
					     (QUOTE TITLEMENUFN)
					     (FUNCTION NC.TEditMenuFn)))
          (until (WINDOWPROP Window (QUOTE TEXTSTREAM)) do (BLOCK))
          (NC.ActivateCard ID)
          (replace (TEXTOBJ \DIRTY) of (TEXTOBJ TextStream) with T)
          (AND (GETPROMPTWINDOW Window NIL NIL T)
	       (PROG1 (DISMISS 1000)
		      (NC.ClearMsg Window T)))
          (RETURN Window))))

(NC.MakeSketchCard
  (LAMBDA (ID Title NoDisplayFlg)                            (* fgh: " 4-Feb-85 23:07")
    (COND
      (NoDisplayFlg (NC.SetSubstance ID NIL)
		    ID)
      (T (PROG (Window)
	       (SETQ Window (SKETCHW.CREATE ID NIL (NC.DetermineDisplayRegion ID NIL)
					    (OR Title "Untitled")))
	       (NC.SetupTitleBarMenu Window ID (QUOTE Sketch))
	       (NC.SetSubstance ID (GETPROP ID (QUOTE SKETCH)))
	       (NC.MarkCardDirty ID)
	       (RETURN Window))))))

(NC.MakeTEditCard
  (LAMBDA (ID Title NoDisplayFlg)                            (* fgh: " 4-Feb-85 23:07")
                                                             (* Make up a blank text card and display it.)
    (COND
      (NoDisplayFlg (PROG (TextStream)
		          (SETQ TextStream (OPENTEXTSTREAM "" NIL NIL NIL
							   (LIST (QUOTE FONT)
								 PSA.TimesRoman10
								 (QUOTE TITLEMENUFN)
								 (FUNCTION NC.TEditMenuFn))))
		          (NC.SetSubstance ID TextStream)
		          (replace (TEXTOBJ \DIRTY) of (TEXTOBJ TextStream) with T)
		          (RETURN ID)))
      (T (PROG (Window)
	       (SETQ Window (CREATEW (NC.DetermineDisplayRegion ID NIL)
				     (OR Title "Untitled")))
	       (WINDOWPROP Window (QUOTE NoteCardsLeftButtonMenu)
			   (NC.MakeTEditLeftMenu (NC.FetchType ID)))
	       (WINDOWPROP Window (QUOTE NoteCardsMiddleButtonMenu)
			   (NC.MakeTEditMiddleMenu))
	       (WINDOWPROP Window (QUOTE SHRINKFN)
			   (FUNCTION NC.ShrinkFn))
	       (TEDIT NIL Window NIL (LIST (QUOTE FONT)
					   NC.DefaultFont
					   (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))))))
)
(DEFINEQ

(NC.DetermineDisplayRegion
  (LAMBDA (ID Region/Position)                               (* fgh: " 4-Feb-85 23:33")
    (PROG (DefaultHeight Region)
          (RETURN (COND
		    ((type? REGION Region/Position)
		      Region/Position)
		    ((POSITIONP Region/Position)
		      (COND
			((SETQ Region (NC.FetchRegion ID))
			  (CREATEREGION (fetch (POSITION XCOORD) of Region/Position)
					(fetch (POSITION YCOORD) of Region/Position)
					(fetch (REGION WIDTH) of Region)
					(fetch (REGION HEIGHT) of Region)))
			(T (CREATEREGION (fetch XCOORD of Region/Position)
					 (fetch YCOORD of Region/Position)
					 (NC.DefaultCardWidth ID)
					 (NC.DefaultCardHeight ID)))))
		    (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 Note Card " ID)))
			 (T (GETBOXREGION (NC.DefaultCardWidth ID)
					  (SETQ DefaultHeight (NC.DefaultCardHeight ID))
					  (GETMOUSEX)
					  (IDIFFERENCE (GETMOUSEY)
						       DefaultHeight)
					  NIL
					  (CONCAT "Please specify location for Note Card " ID)))))))))
)
)
(DEFINEQ

(NC.BringUpTEditCard
  (LAMBDA (ID TextStream Region/Position)                    (* fgh: " 4-Feb-85 22:37")
                                                             (* 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 (TEXTOBJ \WINDOW) of (TEXTOBJ TextStream)))
		  (SETQ TEditProcess (WINDOWPROP TEditWindow (QUOTE PROCESS))))
	      (TOTOPW TEditWindow)
	      (RPTQ 2 (FLASHW TEditWindow))
	      (TTY.PROCESS TEditProcess)
	      (RETURN TEditWindow)))
          (SETQ Region (NC.DetermineDisplayRegion ID Region/Position))
          (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 NoteCardsLeftButtonMenu)
		      (NC.MakeTEditLeftMenu (NC.FetchType ID)))
          (WINDOWPROP TEditWindow (QUOTE NoteCardsMiddleButtonMenu)
		      (NC.MakeTEditMiddleMenu))
          (SETQ TextStreamDirtyFlg (TEDIT.STREAMCHANGEDP TextStream))
          (TEDIT TextStream TEditWindow NIL (LIST (QUOTE FONT)
						  NC.DefaultFont
						  (QUOTE TITLEMENUFN)
						  (FUNCTION NC.TEditMenuFn)))
          (AND TextStreamDirtyFlg (NC.MarkCardDirty ID))
          (RETURN TEditWindow))))

(NC.BringUpSketchCard
  (LAMBDA (ID Substance Region/Position)                     (* fgh: " 4-Feb-85 22:39")
                                                             (* Bring up a sketch card containing substance in 
							     specified region)
    (PROG (Region Title SketchViewer)
          (COND
	    ((SETQ SketchViewer (NC.FetchWindow ID))
	      (RPTQ 2 (FLASHW SketchViewer))
	      (TOTOPW SketchViewer)
	      (TTY.PROCESS (WINDOWPROP SketchViewer (QUOTE PROCESS)))
	      (RETURN SketchViewer)))
          (SETQ SketchViewer (SKETCHW.CREATE (OR Substance ID)
					     (NC.FetchRegionViewed ID)
					     (NC.DetermineDisplayRegion ID Region/Position)
					     (NC.FetchTitle ID)
					     (NC.FetchScale ID)))
          (NC.SetupTitleBarMenu SketchViewer ID (QUOTE Sketch))
          (RETURN SketchViewer))))

(NC.BringUpGraphCard
  (LAMBDA (ID Substance Region/Position)                     (* fgh: " 4-Feb-85 22:40")

          (* * 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 (SHOWGRAPH Substance (CREATEW (NC.DetermineDisplayRegion ID 
										  Region/Position)
							  (GETPROP ID (QUOTE NoteCardTitle)))
				       (FUNCTION NC.GraphCardLeftButtonFn)
				       (FUNCTION NC.GraphCardMiddleButtonFn)
				       NIL T))
          (NC.SetupTitleBarMenu GraphWindow ID)
          (RETURN GraphWindow))))
)
(DEFINEQ

(NC.DefaultCardWidth
  (LAMBDA (ID)                                               (* fgh: " 4-Feb-85 23:27")

          (* * Determine the default width for card ID from its CardType)


    (PROG ((Type (NC.FetchType ID)))
          (RETURN (NC.DefaultWidthFromType Type)))))

(NC.DefaultCardHeight
  (LAMBDA (ID)                                               (* fgh: " 4-Feb-85 23:28")

          (* * Determine the default height for card ID from its CardType)


    (PROG ((Type (NC.FetchType ID)))
          (RETURN (NC.DefaultHeightFromType Type)))))
)
(DEFINEQ

(NC.DefaultHeightFromType
  (LAMBDA (NoteCardType)                                     (* fgh: " 4-Feb-85 22:48")
    (NC.Inherit NC.DefaultHeightFromType CardDefaultHeight SubstanceDefaultHeight NoteCardType)))

(NC.DefaultWidthFromType
  (LAMBDA (NoteCardType)                                     (* fgh: " 4-Feb-85 22:49")
    (NC.Inherit NC.DefaultWidthFromType CardDefaultWidth SubstanceDefaultWidth NoteCardType)))
)
[DECLARE: EVAL@COMPILE 

(RECORD NoteCardType (TypeName SuperType SubstanceType MakeCardFn EditCardFn QuitCardFn GetCardFn 
			       PutCardFn CopyCardFn MarkCardDirtyFn CardDirtyPFn CollectLinksInCardFn 
			       DeleteLinksInCardFn UpdateLinkIconsInCardFn LinkDisplayMode 
			       CardDefaultWidth CardDefaultHeight))

(RECORD SubstanceType (SubstanceName CreateSubstanceFn EditSubstanceFn QuitSubstanceFn GetSubstanceFn 
				     PutSubstanceFn CopySubstanceFn MarkSubstanceDirtyFn 
				     SubstanceDirtyPFn CollectLinksInSubstanceFn 
				     DeleteLinksInSubstanceFn UpdateLinkIconsInSubstanceFn 
				     SubstanceDefaultWidth SubstanceDefaultHeight))
]
(DEFINEQ

(NC.AddCardType
  (LAMBDA (TypeName SuperType SubstanceType MakeCardFn EditCardFn QuitCardFn GetCardFn PutCardFn 
		    CopyCardFn MarkCardDirtyFn CardDirtyPFn CollectLinksInCardFn DeleteLinksInCardFn 
		    UpdateLinkIconsInCardFn LinkDisplayMode DefaultWidth DefaultHeight)
                                                             (* fgh: " 4-Feb-85 23:14")

          (* * Create a new note acrd type and link it into the card type heirarchy.)


    (PROG (NewType)
          (COND
	    ((NULL TypeName)
	      (NC.ReportError "NC.AddCardType" "Illegal type name: NIL"))
	    ((for Type in NC.CardTypes never (EQ (fetch (NoteCardType TypeName) of Type)
						 SuperType))
	      (NC.ReportError "NC.AddCardType" (CONCAT "Unknown type in super type field:  " 
						       SuperType)))
	    ((for Substance in NC.SubstanceTypes never (EQ SubstanceType (fetch (SubstanceType 
										    SubstanceName)
									    of Substance)))
	      (NC.ReportError "NC.AddCardType" (CONCAT "Unknown substance type field:  " 
						       SubstanceType))))

          (* * Remove old instance of this NoteCardType)


          (for CardType in NC.CardTypes when (EQ (fetch (NoteCardType TypeName) of CardType)
						 TypeName)
	     do (SETQ NC.CardTypes (REMOVE CardType NC.CardTypes)))

          (* * Create new NoteCardType)


          (SETQ NC.CardTypes
	    (NCONC1 NC.CardTypes
		    (SETQ NewType
		      (create NoteCardType
			      TypeName ← TypeName
			      SuperType ← SuperType
			      SubstanceType ← SubstanceType
			      MakeCardFn ← MakeCardFn
			      EditCardFn ← EditCardFn
			      QuitCardFn ← QuitCardFn
			      GetCardFn ← GetCardFn
			      PutCardFn ← PutCardFn
			      CopyCardFn ← CopyCardFn
			      MarkCardDirtyFn ← MarkCardDirtyFn
			      CardDirtyPFn ← CardDirtyPFn
			      CollectLinksInCardFn ← CollectLinksInCardFn
			      DeleteLinksInCardFn ← DeleteLinksInCardFn
			      UpdateLinkIconsInCardFn ← UpdateLinkIconsInCardFn
			      LinkDisplayMode ← LinkDisplayMode
			      CardDefaultHeight ← DefaultHeight
			      CardDefaultWidth ← DefaultWidth))))
          (SETQ NC.NoteCardTypeMenu)
          (RETURN NewType))))

(NC.AddSubstanceType
  (LAMBDA (SubstanceName CreateSubstanceFn EditSubstanceFn QuitSubstanceFn GetSubstanceFn 
			 PutSubstanceFn CopySubstanceFn MarkSubstanceDirtyFn SubstanceDirtyPFn 
			 CollectLinksInSubstanceFn DeleteLinksInSubstanceFn 
			 UpdateLinkIconsInSubstanceFn DefaultWidth DefaultHeight)
                                                             (* fgh: " 4-Feb-85 23:15")

          (* * Add a substance ttype to the lists of substance types.)


    (PROG (NewType)
          (COND
	    ((NULL SubstanceName)
	      (NC.ReportError "NC.AddSubstanceType" "Illegal substance type name: NIL")))

          (* * Remove old instance of SubstanceType)


          (for SubstanceType in NC.SubstanceTypes when (EQ (fetch (SubstanceType SubstanceName)
							      of SubstanceType)
							   SubstanceName)
	     do (SETQ NC.SubstanceTypes (REMOVE SubstanceType NC.SubstanceTypes)))

          (* * Add new SubstanceType to NC.SubstanceTypes list)


          (SETQ NC.SubstanceTypes
	    (CONS (SETQ NewType
		    (create SubstanceType
			    SubstanceName ← SubstanceName
			    CreateSubstanceFn ← CreateSubstanceFn
			    EditSubstanceFn ← EditSubstanceFn
			    QuitSubstanceFn ← QuitSubstanceFn
			    GetSubstanceFn ← GetSubstanceFn
			    PutSubstanceFn ← PutSubstanceFn
			    CopySubstanceFn ← CopySubstanceFn
			    MarkSubstanceDirtyFn ← MarkSubstanceDirtyFn
			    SubstanceDirtyPFn ← SubstanceDirtyPFn
			    CollectLinksInSubstanceFn ← CollectLinksInSubstanceFn
			    DeleteLinksInSubstanceFn ← DeleteLinksInSubstanceFn
			    UpdateLinkIconsInSubstanceFn ← UpdateLinkIconsInSubstanceFn
			    SubstanceDefaultWidth ← DefaultWidth
			    SubstanceDefaultHeight ← DefaultHeight))
		  NC.SubstanceTypes))
          (RETURN NewType))))

(NC.MakeSubstanceTypesList
  (LAMBDA NIL                                                (* fgh: " 4-Feb-85 23:19")

          (* * Make the initial list of substance types.)


    (SETQ NC.SubstanceTypes NIL)
    (NC.AddSubstanceType (QUOTE TEXT)
			 (FUNCTION OPENTEXTSTREAM)
			 (FUNCTION NC.BringUpTEditCard)
			 (FUNCTION NC.TEditCloseFn)
			 (FUNCTION NC.GetTextSubstance)
			 (FUNCTION NC.PutTextSubstance)
			 (FUNCTION NC.TextCopySubstance)
			 (FUNCTION NC.MarkTextDirty)
			 (FUNCTION NC.TextDirtyP)
			 (FUNCTION NC.CollectReferencesInText)
			 (FUNCTION NC.DelReferencesToCardFromText)
			 (FUNCTION NC.UpdateLinkImagesInText)
			 300 200)
    (NC.AddSubstanceType (QUOTE GRAPH)
			 (FUNCTION (LAMBDA NIL
			     (create GRAPH)))
			 (FUNCTION NC.BringUpGraphCard)
			 (FUNCTION NC.GraphCardCloseFn)
			 (FUNCTION NC.GetGraphSubstance)
			 (FUNCTION NC.PutGraphSubstance)
			 (FUNCTION NC.GraphCopySubstance)
			 (FUNCTION NC.MarkGraphDirty)
			 (FUNCTION NC.GraphDirtyP)
			 (FUNCTION NC.CollectReferencesInGraph)
			 (FUNCTION NC.DelReferencesToCardFromGraph)
			 (FUNCTION NC.UpdateLinkImagesInGraph)
			 300 200)
    (NC.AddSubstanceType (QUOTE SKETCH)
			 (FUNCTION (LAMBDA NIL
			     (create SKETCH)))
			 (FUNCTION NC.BringUpSketchCard)
			 (FUNCTION NC.SketchCardCloseFn)
			 (FUNCTION (LAMBDA (Stream ID Region)
			     (PROG ((Value (NC.GetSketchSubstance Stream)))
			           (NC.SetScale ID (CADR Value))
			           (NC.SetRegionViewed ID (CADDR Value))
			           (RETURN (CAR Value)))))
			 (FUNCTION NC.PutSketchSubstance)
			 (FUNCTION NC.SketchCopySubstance)
			 (FUNCTION NC.MarkSketchDirty)
			 (FUNCTION NC.SketchDirtyP)
			 (FUNCTION NC.CollectReferencesInSketch)
			 (FUNCTION NC.DelReferencesToCardFromSketch)
			 (FUNCTION NC.UpdateLinkImagesInSketch)
			 400 350)))

(NC.MakeCardTypesList
  (LAMBDA NIL                                                (* fgh: " 4-Feb-85 23:20")

          (* * Make initial set of card types.)


    (SETQ NC.CardTypes (LIST (create NoteCardType
				     TypeName ←(QUOTE NoteCard)
				     SuperType ← NIL
				     SubstanceType ← NIL
				     MakeCardFn ← NIL
				     EditCardFn ← NIL
				     QuitCardFn ← NIL
				     GetCardFn ← NIL
				     PutCardFn ← NIL
				     CopyCardFn ← NIL
				     MarkCardDirtyFn ← NIL
				     CardDirtyPFn ← NIL
				     CollectLinksInCardFn ← NIL
				     DeleteLinksInCardFn ← NIL
				     UpdateLinkIconsInCardFn ← NIL
				     LinkDisplayMode ←(QUOTE Icon)
				     CardDefaultWidth ← NIL
				     CardDefaultHeight ← NIL)))
    (NC.AddCardType (QUOTE Text)
		    (QUOTE NoteCard)
		    (QUOTE TEXT)
		    (FUNCTION NC.MakeTEditCard)
		    NIL
		    (FUNCTION NC.TEditCloseFn)
		    NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)
		    NIL NIL)
    (NC.AddCardType (QUOTE Graph)
		    (QUOTE NoteCard)
		    (QUOTE GRAPH)
		    (FUNCTION NC.MakeGraphCard)
		    NIL
		    (FUNCTION NC.GraphCardCloseFn)
		    NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)
		    NIL NIL)
    (NC.AddCardType (QUOTE Sketch)
		    (QUOTE NoteCard)
		    (QUOTE SKETCH)
		    (FUNCTION NC.MakeSketchCard)
		    NIL
		    (FUNCTION NC.SketchCardCloseFn)
		    NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)
		    NIL NIL)
    (NC.AddCardType (QUOTE FileBox)
		    (QUOTE Text)
		    (QUOTE TEXT)
		    (FUNCTION NC.MakeContentsCard)
		    NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)
		    335 200)
    (NC.AddCardType (QUOTE Browser)
		    (QUOTE Graph)
		    (QUOTE GRAPH)
		    (FUNCTION NC.MakeBrowserCard)
		    (FUNCTION NC.BringUpBrowserCard)
		    NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)
		    500 350)
    (NC.AddCardType (QUOTE Search)
		    (QUOTE Text)
		    (QUOTE TEXT)
		    (FUNCTION NC.MakeSearchCard)
		    NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)
		    NIL NIL)
    (NC.AddCardType (QUOTE LinkIndex)
		    (QUOTE Text)
		    (QUOTE TEXT)
		    (FUNCTION NC.MakeLinkIndex)
		    NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Title)
		    NIL NIL)
    (NC.AddCardType (QUOTE Document)
		    (QUOTE Text)
		    (QUOTE TEXT)
		    (FUNCTION NC.MakeDocument)
		    NIL NIL NIL NIL NIL NIL NIL NIL NIL NIL (QUOTE Icon)
		    NIL NIL)
    (SETQ NC.NoteCardTypeMenu)))
)
(PROGN (NC.MakeSubstanceTypesList)
       (NC.MakeCardTypesList))
(PUTPROPS FGHPATCH2 COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (1025 11162 (NC.MakeBrowserCard 1035 . 5939) (NC.MakeGraphCard 5941 . 6634) (
NC.MakeContentsCard 6636 . 9042) (NC.MakeSketchCard 9044 . 9587) (NC.MakeTEditCard 9589 . 11160)) (
11163 12597 (NC.DetermineDisplayRegion 11173 . 12595)) (12598 16251 (NC.BringUpTEditCard 12608 . 14299
) (NC.BringUpSketchCard 14301 . 15228) (NC.BringUpGraphCard 15230 . 16249)) (16252 16875 (
NC.DefaultCardWidth 16262 . 16565) (NC.DefaultCardHeight 16567 . 16873)) (16876 17324 (
NC.DefaultHeightFromType 16886 . 17105) (NC.DefaultWidthFromType 17107 . 17322)) (17999 26854 (
NC.AddCardType 18009 . 20333) (NC.AddSubstanceType 20335 . 22188) (NC.MakeSubstanceTypesList 22190 . 
24214) (NC.MakeCardTypesList 24216 . 26852)))))
STOP