(FILECREATED " 5-Dec-85 19:41:06" {ERIS}<LANE>REMOTEGRAPHER.;10 6400   

      changes to:  (COURIERPROGRAMS GRAPH)
		   (FNS GRAPHNODES.TO.GRAPHRECORDS REMOTELAYOUTGRAPH GRAPH.REMOTELAYOUT 
			GRAPHRECORDS.TO.GRAPHNODES)
		   (VARS REMOTEGRAPHERCOMS)

      previous date: "21-Nov-85 19:14:38" {ERIS}<LANE>REMOTEGRAPHER.;7)


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

(PRETTYCOMPRINT REMOTEGRAPHERCOMS)

(RPAQQ REMOTEGRAPHERCOMS ((FNS REMOTELAYOUTGRAPH GRAPH.REMOTELAYOUT GRAPHNODES.TO.GRAPHRECORDS 
				 GRAPHRECORDS.TO.GRAPHNODES)
			    (COURIERPROGRAMS GRAPH)
			    (DECLARE: DONTCOPY (RECORDS GRAPHRECORD))
			    (FILES COURIERDEFS)))
(DEFINEQ

(REMOTELAYOUTGRAPH
  [LAMBDA (STREAM NODELST ROOTIDS FORMAT FONT MOTHERD PERSONALD FAMILYD)
                                                             (* cdl " 5-Dec-85 19:09")
                                                             (* DECLARATIONS: (RECORD RESULT 
							     (GRAPHRECORDS SIDES? DIRECTED?)))
    (if (NULL FONT)
	then (SETQ FONT DEFAULTFONT))
    (with RESULT (COURIER.CALL STREAM (QUOTE GRAPH)
				   (QUOTE LAYOUT)
				   (GRAPHNODES.TO.GRAPHRECORDS NODELST FONT)
				   ROOTIDS
				   (OR FORMAT (QUOTE (COMPACT)))
				   FONT MOTHERD PERSONALD FAMILYD)
	    (create GRAPH
		      GRAPHNODES ←(GRAPHRECORDS.TO.GRAPHNODES GRAPHRECORDS)
		      SIDESFLG ← SIDES?
		      DIRECTEDFLG ← DIRECTED?])

(GRAPH.REMOTELAYOUT
  [LAMBDA (STREAM PROGRAM PROCEEDURE GRAPHRECORDS ROOTIDS FORMAT FONT MOTHERD PERSONALD FAMILYD)
                                                             (* cdl " 5-Dec-85 19:07")
    (with GRAPH (LAYOUTGRAPH (GRAPHRECORDS.TO.GRAPHNODES GRAPHRECORDS)
				 ROOTIDS FORMAT FONT MOTHERD PERSONALD FAMILYD)
	    (BQUOTE (RETURN (, (GRAPHNODES.TO.GRAPHRECORDS GRAPHNODES)
				   , SIDESFLG , DIRECTEDFLG])

(GRAPHNODES.TO.GRAPHRECORDS
  [LAMBDA (GRAPHNODES FONT)                                  (* cdl " 5-Dec-85 19:30")
    (bind COPYLST (COPYCOUNT ← 0) for NODE in GRAPHNODES
       collect (with GRAPHNODE NODE
			 (create GRAPHRECORD
				   GR.ID ←(if (LISTP NODEID)
					      then [LIST
						       (CAR NODEID)
						       (LET (N)
							    (if (SETQ N (FASSOC NODEID COPYLST))
								then (CDR N)
							      else (push COPYLST
									     (CONS NODEID
										     (ADD1VAR
										       COPYCOUNT)))
								     (CDR (CAR COPYLST]
					    else (LIST NODEID 0))
				   GR.POSITION ← NODEPOSITION
				   GR.LABEL ←(MKSTRING NODELABEL)
				   GR.WIDTH ← NODEWIDTH
				   GR.HEIGHT ← NODEHEIGHT
				   GR.TONODES ←(for TONODE in TONODES
						  collect
						   (if (LISTP TONODE)
						       then
							[LIST
							  (CAR TONODE)
							  (LET (N)
							       (if (SETQ N (FASSOC TONODE 
											 COPYLST))
								   then (CDR N)
								 else (push COPYLST
										(CONS TONODE
											(ADD1VAR
											  COPYCOUNT)))
									(CDR (CAR COPYLST]
						     else (LIST TONODE 0)))
				   GR.FROMNODES ← FROMNODES
				   GR.FONT ←(OR NODEFONT FONT)
				   GR.BORDER ←[if (NUMBERP NODEBORDER)
						  then (LIST (QUOTE NUMBER)
								 NODEBORDER)
						else (LIST (QUOTE FLAG)
							       (NOT (NULL NODEBORDER]
				   GR.LABELSHADE ← NODELABELSHADE])

(GRAPHRECORDS.TO.GRAPHNODES
  [LAMBDA (GRAPHRECORDS)                                     (* cdl " 5-Dec-85 19:09")
    (bind COPYLST for GRAPHRECORD in GRAPHRECORDS
       collect (with GRAPHRECORD GRAPHRECORD
			 (create GRAPHNODE
				   NODEID ←[if (ZEROP (CADR GR.ID))
					       then (CAR GR.ID)
					     else (LET ((N (FASSOC (CADR GR.ID)
								       COPYLST)))
						         (if N
							     then (CDR N)
							   else (push COPYLST
									  (LIST (CADR GR.ID)
										  (CAR GR.ID)))
								  (CDR (CAR COPYLST]
				   NODEPOSITION ← GR.POSITION
				   NODEWIDTH ← GR.WIDTH
				   NODEHEIGHT ← GR.HEIGHT
				   NODELABEL ← GR.LABEL
				   FROMNODES ← GR.FROMNODES
				   TONODES ←[for TONODE in GR.TONODES
					       collect
						(if (ZEROP (CADR TONODE))
						    then (CAR TONODE)
						  else
						   (LET ((N (FASSOC (CADR TONODE)
								      COPYLST)))
						        (if N
							    then (CDR N)
							  else [push COPYLST
									 (LIST (CADR TONODE)
										 (MKATOM
										   (CAR TONODE]
								 (CDR (CAR COPYLST]
				   NODEFONT ← GR.FONT
				   NODEBORDER ←(CADR GR.BORDER)
				   NODELABELSHADE ← GR.LABELSHADE])
)

(COURIERPROGRAM GRAPH (1113 0)
    TYPES
      ((GRAPH (RECORD (NODES GRAPHNODES)
		      (SIDESFLG BOOLEAN)
		      (DIRECTEDFLG BOOLEAN)))
       (GRAPHNODE (RECORD (ID NODE)
			  (POSITION POSITION)
			  (LABEL STRING)
			  (WIDTH NUMBER)
			  (HEIGHT NUMBER)
			  (TONODES (SEQUENCE NODE))
			  (FROMNODES (SEQUENCE ATOM))
			  (FONT FONT)
			  (BORDER (CHOICE (FLAG 0 BOOLEAN)
					  (NUMBER 1 CARDINAL)))
			  (LABELSHADE TEXTURE)))
       (NODE (RECORD (NODEID ATOM)
		     (COPYOF CARDINAL)))
       (GRAPHNODES (SEQUENCE GRAPHNODE))
       (ROOTIDS (SEQUENCE ATOM))
       (FORMAT (SEQUENCE FORMAT.TYPE))
       (FORMAT.TYPE (ENUMERATION (COMPACT 0)
				 (FAST 1)
				 (LATTICE 2)
				 (HORIZONTAL 3)
				 (VERTICAL 4)
				 (REVERSE 5)
				 (COPIES/ONLY 6)
				 (NOT/LEAVES 7)
				 (REVERSE/DAUGHTERS 8)))
       (MOTHERD NUMBER)
       (PERSONALD NUMBER)
       (FAMILYD NUMBER))
    INHERITS
      (INTERLISP)
    PROCEDURES
      ((LAYOUT 0 (GRAPHNODES ROOTIDS FORMAT FONT MOTHERD PERSONALD FAMILYD)
	       RETURNS
	       (GRAPH)
	       REPORTS
	       (LAYOUT.ERROR)
	       IMPLEMENTEDBY GRAPH.REMOTELAYOUT))
    ERRORS
      ((LAYOUT.ERROR 0)))
(DECLARE: DONTCOPY 
[DECLARE: EVAL@COMPILE 

(RECORD GRAPHRECORD (GR.ID GR.POSITION GR.LABEL GR.WIDTH GR.HEIGHT GR.TONODES GR.FROMNODES GR.FONT 
			     GR.BORDER GR.LABELSHADE))
]
)
(FILESLOAD COURIERDEFS)
(PUTPROPS REMOTEGRAPHER COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (678 4921 (REMOTELAYOUTGRAPH 688 . 1480) (GRAPH.REMOTELAYOUT 1482 . 1938) (
GRAPHNODES.TO.GRAPHRECORDS 1940 . 3561) (GRAPHRECORDS.TO.GRAPHNODES 3563 . 4919)))))
STOP