(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "21-Jun-90 13:01:45" {DSK}<home>oze>yabu>DSKDISPLAY.;1 11124  

      changes to%:  (VARS DSKDISPLAYCOMS)

      previous date%: "16-May-90 16:16:07" |{PELE:MV:ENVOS}<LISPCORE>SOURCES>DSKDISPLAY.;2|)


(* ; "
Copyright (c) 1985, 1987, 1990 by Venue & Xerox Corporation.  All rights reserved.
")

(PRETTYCOMPRINT DSKDISPLAYCOMS)

(RPAQQ DSKDISPLAYCOMS ((DECLARE%: EVAL@COMPILE DONTCOPY (FILES (LOADCOMP)
                                                                   LOCALFILE))
                           (DECLARE%: (LOCALVARS . T))
                           (FNS DSKDISPLAY \DSKDISPLAY.BUTTONEVENTFN \DSKDISPLAY.UPDATE 
                                \DSKDISPLAY.CREATE.WINDOW \DSKDISPLAY.DESTROY.WINDOW 
                                \DSKDISPLAY.REPAINTFN \DSKDISPLAY.RESHAPEFN)
                           (GLOBALVARS \DSKDISPLAY.FONT \DSKDISPLAY.BOLD \DSKDISPLAY.STATE 
                                  \DSKDISPLAY.WINDOW DSKDISPLAY.POSITION)
                           (INITVARS (\DSKDISPLAY.FONT (FONTCREATE 'GACHA 10 'MRR))
                                  (\DSKDISPLAY.BOLD (FONTCREATE 'GACHA 10 'BRR))
                                  (DSKDISPLAY.POSITION (CONS 100 50))
                                                             (* ; 
                                        " Original was (CREATE POSITION XCOORD _ 100 YCOORD _ 50).")
                                                             (* ; 
                                                  "Changed by yabu.fx, for SUNLOADUP without DWIM.")
                                  (\DSKDISPLAY.STATE 'CLOSED)
                                  (\DSKDISPLAY.WINDOW NIL))))
(DECLARE%: EVAL@COMPILE DONTCOPY 

(FILESLOAD (LOADCOMP)
       LOCALFILE)
)
(DECLARE%: 
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(LOCALVARS . T)
)
)
(DEFINEQ

(DSKDISPLAY
  [LAMBDA (newState)                                         (* ; "Edited 12-Jan-87 12:19 by amd")
          
          (* ;; "Returns the old state of the file system display window.  If newState is one of {ON, OFF, CLOSED}, sets this to be the new state: ON means updates continuously, OFF means updates only when buttoned, CLOSED means the display window is indeed closed.")

    (SELECTQ (MACHINETYPE)
        ((DANDELION DOVE) 
             (if (\PFEnsureInitialized)
                 then (LET ((oldState \DSKDISPLAY.STATE))
                           (SELECTQ newState
                               ((ON OFF) 
                                    (SETQ \DSKDISPLAY.STATE newState)
                                    (\DSKDISPLAY.CREATE.WINDOW)
                                    (WINDOWPROP \DSKDISPLAY.WINDOW 'TITLE (CONCAT 
                                                                        "Local File System Display: " 
                                                                                 \DSKDISPLAY.STATE))
                                    (REDISPLAYW \DSKDISPLAY.WINDOW))
                               (CLOSED (SETQ \DSKDISPLAY.STATE newState)
                                       (\DSKDISPLAY.DESTROY.WINDOW))
                               NIL)
                           oldState)))
        NIL])

(\DSKDISPLAY.BUTTONEVENTFN
  [LAMBDA (W)                                                (* ; "Edited 12-Jan-87 12:19 by amd")
          
          (* ;; 
          "Button event function to allow user to change file system display state with the mouse.")

    (if (MOUSESTATE LEFT)
        then (\DSKDISPLAY.REPAINTFN W)
      elseif (MOUSESTATE MIDDLE)
        then (DSKDISPLAY (MENU (create MENU
                                      ITEMS _ '(ON OFF CLOSED])

(\DSKDISPLAY.UPDATE
  [LAMBDA NIL                                                (* ; "Edited 12-Jan-87 12:19 by amd")
          
          (* ;; "IF the local file system window stuff is set for continuous update, and there is a valid display window, update the display window.")

    (if (AND (EQ \DSKDISPLAY.STATE 'ON)
             (WINDOWP \DSKDISPLAY.WINDOW))
        then (REDISPLAYW \DSKDISPLAY.WINDOW])

(\DSKDISPLAY.CREATE.WINDOW
  [LAMBDA NIL                                                (* ; "Edited 12-Jan-87 15:35 by amd")
          
          (* ;; "Creates the local file system display window.")

    (if (NOT (WINDOWP \DSKDISPLAY.WINDOW))
        then (SETQ \DSKDISPLAY.WINDOW (CREATEW (create REGION
                                                      WIDTH _ 300
                                                      HEIGHT _ (IPLUS (ITIMES (FONTPROP 
                                                                                     \DSKDISPLAY.FONT
                                                                                     'HEIGHT)
                                                                             (IPLUS (LENGTH (
                                                                                           \PFGetVols
                                                                                             ))
                                                                                    2))
                                                                      (ITIMES WBorder 2)
                                                                      (FONTPROP 
                                                                             WindowTitleDisplayStream
                                                                             'HEIGHT))
                                                      LEFT _ (fetch (POSITION XCOORD) of 
                                                                                  DSKDISPLAY.POSITION
                                                                    )
                                                      BOTTOM _ (fetch (POSITION YCOORD) of 
                                                                                  DSKDISPLAY.POSITION
                                                                      ))
                                             "1108 Local File System"))
             (WINDOWPROP \DSKDISPLAY.WINDOW 'REPAINTFN (FUNCTION \DSKDISPLAY.REPAINTFN))
             [WINDOWPROP \DSKDISPLAY.WINDOW 'RESHAPEFN (FUNCTION (LAMBDA (W)
                                                                   (\DSKDISPLAY.REPAINTFN W)
                                                                   (LET [(REG (WINDOWPROP
                                                                               W
                                                                               'REGION]
                                                                        (SETQ DSKDISPLAY.POSITION
                                                                         (create POSITION
                                                                                XCOORD _
                                                                                (fetch (REGION LEFT)
                                                                                   of REG)
                                                                                YCOORD _
                                                                                (fetch (REGION BOTTOM
                                                                                              )
                                                                                   of REG]
             [WINDOWPROP \DSKDISPLAY.WINDOW 'MOVEFN (FUNCTION (LAMBDA (W POS)
                                                                (SETQ DSKDISPLAY.POSITION POS]
             (WINDOWPROP \DSKDISPLAY.WINDOW 'BUTTONEVENTFN (FUNCTION \DSKDISPLAY.BUTTONEVENTFN))
             (WINDOWPROP \DSKDISPLAY.WINDOW 'CLOSEFN (FUNCTION (LAMBDA NIL
                                                                 (DSKDISPLAY 'CLOSED])

(\DSKDISPLAY.DESTROY.WINDOW
  [LAMBDA NIL                                                (* edited%: " 4-Jul-85 02:35")
          
          (* * Purges the local file system display window)

    (if [AND (WINDOWP \DSKDISPLAY.WINDOW)
             (NULL (WINDOWPROP \DSKDISPLAY.WINDOW 'CLOSING]
        then (WINDOWPROP \DSKDISPLAY.WINDOW 'CLOSING T)
             (CLOSEW \DSKDISPLAY.WINDOW)
             (SETQ \DSKDISPLAY.WINDOW NIL])

(\DSKDISPLAY.REPAINTFN
  [LAMBDA (W)                                                (* edited%: " 4-Jul-85 03:08")
    (CLEARW W)
    (printout W .FONT \DSKDISPLAY.FONT "Default directory: " .FONT \DSKDISPLAY.BOLD
           (DIRECTORYNAME '{DSK})
           .FONT \DSKDISPLAY.FONT T "Logical Volumes:" T)
    (for vol in (\PFGetVols) do (printout W .FONT \DSKDISPLAY.FONT (if (\LFDirectoryP vol)
                                                                       then "* "
                                                                     else "  ")
                                       (\PFVolumeNumber vol)
                                       " " .FONT \DSKDISPLAY.BOLD (fetch (LogicalVolumeDescriptor
                                                                          LVlabel) of vol)
                                       "  " .FONT \DSKDISPLAY.FONT .FR 22 (fetch (
                                                                              LogicalVolumeDescriptor
                                                                                  volumeSize)
                                                                             of vol)
                                       " Pages" .FR 35 (fetch (LogicalVolumeDescriptor freePageCount)
                                                          of vol)
                                       " Free" T])

(\DSKDISPLAY.RESHAPEFN
  [LAMBDA (W)                                                (* hts%: " 6-Aug-85 14:11")
          
          (* * Takes care of the necessary glop after reshaping the display window%: 
          redisplays it and remembers the new position.)

    (\DSKDISPLAY.REPAINTFN W)
    [LET [(REG (WINDOWPROP W 'REGION]
         (SETQ DSKDISPLAY.POSITION (create POSITION
                                          XCOORD _ (fetch (REGION LEFT) of REG)
                                          YCOORD _ (fetch (REGION BOTTOM) of REG]
    NIL])
)
(DECLARE%: DOEVAL@COMPILE DONTCOPY

(GLOBALVARS \DSKDISPLAY.FONT \DSKDISPLAY.BOLD \DSKDISPLAY.STATE \DSKDISPLAY.WINDOW 
       DSKDISPLAY.POSITION)
)

(RPAQ? \DSKDISPLAY.FONT (FONTCREATE 'GACHA 10 'MRR))

(RPAQ? \DSKDISPLAY.BOLD (FONTCREATE 'GACHA 10 'BRR))

(RPAQ? DSKDISPLAY.POSITION (CONS 100 50))

(RPAQ? \DSKDISPLAY.STATE 'CLOSED)

(RPAQ? \DSKDISPLAY.WINDOW NIL)
(PUTPROPS DSKDISPLAY COPYRIGHT ("Venue & Xerox Corporation" 1985 1987 1990))
(DECLARE%: DONTCOPY
  (FILEMAP (NIL (1906 10636 (DSKDISPLAY 1916 . 3298) (\DSKDISPLAY.BUTTONEVENTFN 3300 . 3813) (
\DSKDISPLAY.UPDATE 3815 . 4249) (\DSKDISPLAY.CREATE.WINDOW 4251 . 8118) (\DSKDISPLAY.DESTROY.WINDOW 
8120 . 8578) (\DSKDISPLAY.REPAINTFN 8580 . 10030) (\DSKDISPLAY.RESHAPEFN 10032 . 10634)))))
STOP
