(FILECREATED "18-Mar-85 15:09:48" 
{PHYLUM}<TRILLIUM>BIRTHDAY84>ENHANCEMENTS>RECORDS-NHB>TRI-RECORD-ANALYZE.;8 5240   

      changes to:  (FNS ANALYZE.FRAME.IF.NECESSARY)

      previous date: " 6-Mar-85 13:54:04" 
{PHYLUM}<TRILLIUM>BIRTHDAY84>ENHANCEMENTS>RECORDS-NHB>TRI-RECORD-ANALYZE.;7)


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

(PRETTYCOMPRINT TRI-RECORD-ANALYZECOMS)

(RPAQQ TRI-RECORD-ANALYZECOMS ((FNS ANALYZE.INTERFACE ANALYZE.FRAME.IF.NECESSARY ANALYZE.FRAME 
				    ANALYZE.FRAME.IF.NECESSARY* UPDATE&DISPLAY.FRAME 
				    MARK.6LISTS.OBSOLETE)))
(DEFINEQ

(ANALYZE.INTERFACE
  [LAMBDA (INTERFACE ONLY.IF.NECESSARY)                      (* N.H.Briggs " 5-Mar-85 17:03")
                                                             (* DAHJr "31-Mar-84 17:39")
    (DECLARE (GLOBALVARS CURRENT.FRAME))
    [RESETLST (RESETSAVE CURRENT.FRAME)
	      (for FRAME in (fetch.interface.fieldq INTERFACE FRAMES)
		 do (SETQ CURRENT.FRAME FRAME)
		    (COND
		      (ONLY.IF.NECESSARY (ANALYZE.FRAME.IF.NECESSARY FRAME))
		      (T (ANALYZE.FRAME FRAME]
    (MARK.FRAME.CONTEXT.OBSOLETE])

(ANALYZE.FRAME.IF.NECESSARY
  [LAMBDA (FRAME)                                            (* N.H.Briggs "18-Mar-85 15:02")
    (if (NOT (fetch.frame.fieldq FRAME ANALYZED?))
	then (ANALYZE.FRAME FRAME))
    (if (NOT (fetch.frame.fieldq FRAME PRIMITIVES.CACHED?))
	then (BUILD.6LISTS FRAME])

(ANALYZE.FRAME
  [LAMBDA (FRAME)                                            (* N.H.Briggs " 6-Mar-85 13:23")
    (DECLARE (GLOBALVARS REPORT.FRAMES))
    (THINKING (AND REPORT.FRAMES (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE "Analyzing frame: "
						    (fetch.frame.fieldq FRAME NAME)
						    ". . ."))
	      (RESET.FRAME FRAME)
	      (for SUBITEM in (fetch.frame.fieldq FRAME ITEMS) do (ANALYZE.AND.ADD SUBITEM))
	      (replace.frame.fieldq FRAME ANALYZED? T)
	      (MARK.6LISTS.OBSOLETE FRAME)
	      (AND REPORT.FRAMES (TRILLIUM.PRINTOUT ON TRILLIUM.TRACE SAME.LINE " done."])

(ANALYZE.FRAME.IF.NECESSARY*
  [LAMBDA (FRAME)                                            (* N.H.Briggs " 1-Mar-85 14:20")
    (DECLARE (GLOBALVARS CURRENT.INTERFACE))
    [for SUPERFRAME.NAME bind SUPERFRAME in (fetch.frame.fieldq FRAME SUPERFRAMES)
       do (COND
	    ((SETQ SUPERFRAME (FIND.FRAME CURRENT.INTERFACE SUPERFRAME.NAME))
	      (ANALYZE.FRAME.IF.NECESSARY* SUPERFRAME))
	    (T (TRILLIUM.PRINTOUT ON TRILLIUM.WARNINGS "Frame " (fetch.frame.fieldq FRAME NAME)
				  " has superframe " SUPERFRAME.NAME " which doesn't exist" 
				  " (analysis)"]
    (ANALYZE.FRAME.IF.NECESSARY FRAME])

(UPDATE&DISPLAY.FRAME
  [LAMBDA (FRAME ITEM/S OLD.POSITION A.BUNCH)                (* N.H.Briggs "22-Feb-85 09:37")
    (DECLARE (GLOBALVARS CURRENT.DSP CURRENT.INTERFACE DISPLAY.CHANGED.ITEM.ONLY))
    (PROG (NEW.ITEMS BACKGROUND.COLOR REPRESENTATIVE.GRAY)
          (MARK.6LISTS.OBSOLETE FRAME)
          (MARK.FRAME.CONTEXT.OBSOLETE FRAME)
          (MARK.INTERFACE CURRENT.INTERFACE)
          (COND
	    ((AND ITEM/S DISPLAY.CHANGED.ITEM.ONLY)

          (* * THE IDEA HERE IS TO DO THE MINIMAL WORK TO ALLOW THE DESIGNER TO CONTINUE DESIGNING. IT NEEDN'T BE RIGHT, AS 
	  ANALYZE.FRAME CAN BE EMPLOYED TO CLEAN IT UP.)


	      (COND
		(OLD.POSITION (SETQ BACKGROUND.COLOR (fetch.interface.fieldq CURRENT.INTERFACE 
									     BACKGROUND.COLOR))
			      (SETQ REPRESENTATIVE.GRAY (FIND.REPRESENTATIVE.GRAY BACKGROUND.COLOR))
			      (BITBLT NIL NIL NIL CURRENT.DSP (fetch (REGION LEFT) of OLD.POSITION)
				      (fetch (REGION BOTTOM) of OLD.POSITION)
				      (fetch (REGION WIDTH) of OLD.POSITION)
				      (fetch (REGION HEIGHT) of OLD.POSITION)
				      (QUOTE TEXTURE)
				      (QUOTE REPLACE)
				      REPRESENTATIVE.GRAY)))
	      [SETQ NEW.ITEMS (COND
		  (A.BUNCH ITEM/S)
		  ((EQ ITEM/S (QUOTE IGNORE))
		    NIL)
		  (T (LIST ITEM/S]
	      (for ITEM in NEW.ITEMS do (SELECTQ (ITEM.KIND ITEM)
						 (COMPOSITE (for SUBITEM in (GET.FIELDQ ITEM SUBITEMS)
							       when (MEMB (ITEM.KIND SUBITEM)
									  (QUOTE (ARTWORK DISPLAYER)))
							       do (SHOW.ITEM SUBITEM)))
						 ((ARTWORK DISPLAYER)
						   (SHOW.ITEM ITEM))
						 NIL))
	      (for ITEM in NEW.ITEMS do (SELECTQ (ITEM.KIND ITEM)
						 (COMPOSITE (for SUBITEM in (GET.FIELDQ ITEM SUBITEMS)
							       when (EQ (ITEM.KIND SUBITEM)
									(QUOTE DISPLAYER))
							       do (DISPLAY.ITEM SUBITEM FRAME)))
						 (DISPLAYER (DISPLAY.ITEM ITEM FRAME))
						 NIL)))
	    (T (DISPLAY.FRAME FRAME])

(MARK.6LISTS.OBSOLETE
  [LAMBDA (FRAME)                                            (* N.H.Briggs " 6-Mar-85 13:19")
    (replace.frame.fieldq FRAME PRIMITIVES.CACHED? NIL])
)
(PUTPROPS TRI-RECORD-ANALYZE COPYRIGHT ("Xerox Corporation" 1984 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (605 5146 (ANALYZE.INTERFACE 615 . 1196) (ANALYZE.FRAME.IF.NECESSARY 1198 . 1527) (
ANALYZE.FRAME 1529 . 2159) (ANALYZE.FRAME.IF.NECESSARY* 2161 . 2814) (UPDATE&DISPLAY.FRAME 2816 . 4962
) (MARK.6LISTS.OBSOLETE 4964 . 5144)))))
STOP