(DEFINE-FILE-INFO READTABLE "INTERLISP" PACKAGE "INTERLISP") (FILECREATED "12-Jul-88 09:06:28" |{MCS:MCS:STANFORD}EDITBG.;6| 16468 changes to%: (FNS EDITBACKGROUND EDITBG.BUTTONFN) (VARS EDITBGCOMS) previous date%: " 9-Sep-87 09:18:10" |{MCS:MCS:STANFORD}EDITBG.;4|) (* " Copyright (c) 1984, 1985, 1986, 1987, 1988 by Stanford University. All rights reserved. ") (PRETTYCOMPRINT EDITBGCOMS) (RPAQQ EDITBGCOMS ((FNS EDITBACKGROUND EDITBG.BUTTONFN) (RECORDS EDITBG.RECORD EDITBG.DATA) (CONSTANTS (EDITBG.PIXELSIZE 16)) (ALISTS (BackgroundMenuCommands EditBG)) (VARS (BackgroundMenu)) [INITVARS [EDITBG.SHADEREC (create EDITBG.RECORD REGION _ (CREATEREGION 2 2 (LLSH EDITBG.PIXELSIZE 2) (LLSH EDITBG.PIXELSIZE 2)) GRIDSPEC _ (CREATEREGION 2 2 EDITBG.PIXELSIZE EDITBG.PIXELSIZE) BITWIDTH _ 4 BITHEIGHT _ 4 DSPREGION _ (CREATEREGION EDITBG.PIXELSIZE (TIMES EDITBG.PIXELSIZE 6) (TIMES EDITBG.PIXELSIZE 11) (LLSH EDITBG.PIXELSIZE 1)) NUMBEREGION _ (CREATEREGION WBorder (PLUS (LLSH EDITBG.PIXELSIZE 2) WBorder) (DIFFERENCE (LLSH EDITBG.PIXELSIZE 2) WBorder) (FONTPROP DEFAULTFONT 'HEIGHT] [EDITBG.BORDERREC (create EDITBG.RECORD REGION _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5) 2) 2 (LLSH EDITBG.PIXELSIZE 3) (LLSH EDITBG.PIXELSIZE 2)) GRIDSPEC _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5) 2) 2 EDITBG.PIXELSIZE (LLSH EDITBG.PIXELSIZE 1)) BITWIDTH _ 8 BITHEIGHT _ 2 DSPREGION _ (CREATEREGION 1 (ADD1 (TIMES EDITBG.PIXELSIZE 5)) (PLUS (TIMES EDITBG.PIXELSIZE 13) 2) (SUB1 (LLSH EDITBG.PIXELSIZE 2))) NUMBEREGION _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5 ) WBorder) (PLUS (LLSH EDITBG.PIXELSIZE 2) WBorder) (DIFFERENCE (LLSH EDITBG.PIXELSIZE 3) WBorder) (FONTPROP DEFAULTFONT 'HEIGHT] (EDITBG.BUTTONREGION (CREATEREGION (PLUS 2 (LLSH EDITBG.PIXELSIZE 2)) (PLUS 2 (LLSH EDITBG.PIXELSIZE 2)) (SUB1 EDITBG.PIXELSIZE) (SUB1 EDITBG.PIXELSIZE] (GLOBALVARS EDITBG.BUTTONREGION EDITBG.BORDERREC EDITBG.SHADEREC EDITBG.PIXELSIZE))) (DEFINEQ (EDITBACKGROUND [LAMBDA NIL (* ; "Edited 12-Jul-88 09:05 by cdl") (DECLARE (GLOBALVARS WBorder)) (LET ((WINDOW (CREATEW (GETBOXREGION (WIDTHIFWINDOW (CONSTANT (PLUS (TIMES EDITBG.PIXELSIZE 13) WBorder))) (HEIGHTIFWINDOW (CONSTANT (TIMES EDITBG.PIXELSIZE 9)) T)) "Background Texture Edit Tool"))) (for RECORD in (LIST EDITBG.SHADEREC EDITBG.BORDERREC) do (with EDITBG.RECORD RECORD (with REGION REGION (WBOX (CREATEREGION (DIFFERENCE LEFT (QUOTIENT WBorder 2)) (DIFFERENCE BOTTOM (QUOTIENT WBorder 2)) (PLUS WIDTH WBorder) (PLUS HEIGHT WBorder)) NIL NIL WINDOW)) (GRID GRIDSPEC BITWIDTH BITHEIGHT 'POINT WINDOW) (CENTERPRINTINREGION 0 NUMBEREGION WINDOW))) (WBOX EDITBG.BUTTONREGION NIL NIL WINDOW) (WINDOWPROP WINDOW 'BUTTONEVENTFN (FUNCTION EDITBG.BUTTONFN)) (WINDOWPROP WINDOW 'EDITBG.DATA (create EDITBG.DATA)) WINDOW]) (EDITBG.BUTTONFN [LAMBDA (WINDOW) (* ; "Edited 12-Jul-88 08:38 by cdl") (PROG ((DATA (WINDOWPROP WINDOW 'EDITBG.DATA)) POSITION SHADE LEFTFLG PIXEL BIT GRIDX GRIDY RECORD NEWSHADE) (until (MOUSESTATE UP) do (SETQ POSITION (CURSORPOSITION NIL WINDOW POSITION)) (if (INSIDEP EDITBG.BUTTONREGION POSITION) then (DSPFILL EDITBG.BUTTONREGION BLACKSHADE 'INVERT WINDOW) (with EDITBG.DATA DATA (CHANGEBACKGROUND INTERIOR) (CHANGEBACKGROUNDBORDER EXTERIOR)) (DSPFILL EDITBG.BUTTONREGION BLACKSHADE 'INVERT WINDOW) (RETURN)) (if (INSIDEP (fetch (EDITBG.RECORD REGION) of EDITBG.SHADEREC) POSITION) then (SETQ RECORD EDITBG.SHADEREC) (SETQ SHADE (with EDITBG.DATA DATA INTERIOR)) elseif (INSIDEP (fetch (EDITBG.RECORD REGION) of EDITBG.BORDERREC) POSITION) then (SETQ RECORD EDITBG.BORDERREC) (SETQ SHADE (with EDITBG.DATA DATA EXTERIOR)) else (SETQ RECORD NIL)) (if RECORD then (SETQ LEFTFLG (LASTMOUSESTATE LEFT)) [with EDITBG.RECORD RECORD (with POSITION POSITION (SETQ GRIDX (GRIDXCOORD XCOORD GRIDSPEC)) (SETQ GRIDY (GRIDYCOORD YCOORD GRIDSPEC))) (SHADEGRIDBOX GRIDX GRIDY (if LEFTFLG then GRAYSHADE else WHITESHADE) NIL GRIDSPEC 'POINT WINDOW) [SETQ PIXEL (LLSH 1 (PLUS (TIMES GRIDY BITWIDTH) (SUB1 BITWIDTH) (MINUS GRIDX] [SETQ NEWSHADE (if LEFTFLG then (LOGOR SHADE PIXEL) else (LOGAND SHADE (LOGNOT PIXEL] (if (NEQ SHADE NEWSHADE) then (SETQ SHADE NEWSHADE) (DSPFILL NUMBEREGION WHITESHADE 'REPLACE WINDOW) (CENTERPRINTINREGION SHADE NUMBEREGION WINDOW) (with EDITBG.DATA DATA (if (EQ RECORD EDITBG.BORDERREC) then (SETQ BIT (if LEFTFLG then 1 else 0)) (SETQ GRIDY (LLSH GRIDY 1)) (for X from GRIDX to (PLUS GRIDX 8) by 8 do (for Y from GRIDY to (ADD1 GRIDY) do (BITMAPBIT BITMAP X Y BIT))) (DSPFILL DSPREGION BITMAP NIL WINDOW) (SETQ EXTERIOR SHADE) else (SETQ INTERIOR SHADE] (DSPFILL (fetch (EDITBG.RECORD DSPREGION) of EDITBG.SHADEREC) (with EDITBG.DATA DATA INTERIOR) NIL WINDOW)) (BLOCK]) ) (DECLARE%: EVAL@COMPILE (RECORD EDITBG.RECORD (REGION GRIDSPEC BITWIDTH DSPREGION NUMBEREGION BITHEIGHT)) (RECORD EDITBG.DATA (BITMAP INTERIOR EXTERIOR) BITMAP _ (BITMAPCREATE 16 4) INTERIOR _ 0 EXTERIOR _ 0) ) (DECLARE%: EVAL@COMPILE (RPAQQ EDITBG.PIXELSIZE 16) (CONSTANTS (EDITBG.PIXELSIZE 16)) ) (ADDTOVAR BackgroundMenuCommands (EditBG '(EDITBACKGROUND) "Opens a Background Texture Edit Tool")) (RPAQQ BackgroundMenu NIL) (RPAQ? EDITBG.SHADEREC [create EDITBG.RECORD REGION _ (CREATEREGION 2 2 (LLSH EDITBG.PIXELSIZE 2) (LLSH EDITBG.PIXELSIZE 2)) GRIDSPEC _ (CREATEREGION 2 2 EDITBG.PIXELSIZE EDITBG.PIXELSIZE) BITWIDTH _ 4 BITHEIGHT _ 4 DSPREGION _ (CREATEREGION EDITBG.PIXELSIZE (TIMES EDITBG.PIXELSIZE 6) (TIMES EDITBG.PIXELSIZE 11) (LLSH EDITBG.PIXELSIZE 1)) NUMBEREGION _ (CREATEREGION WBorder (PLUS (LLSH EDITBG.PIXELSIZE 2) WBorder) (DIFFERENCE (LLSH EDITBG.PIXELSIZE 2) WBorder) (FONTPROP DEFAULTFONT 'HEIGHT]) (RPAQ? EDITBG.BORDERREC [create EDITBG.RECORD REGION _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5) 2) 2 (LLSH EDITBG.PIXELSIZE 3) (LLSH EDITBG.PIXELSIZE 2)) GRIDSPEC _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5) 2) 2 EDITBG.PIXELSIZE (LLSH EDITBG.PIXELSIZE 1)) BITWIDTH _ 8 BITHEIGHT _ 2 DSPREGION _ (CREATEREGION 1 (ADD1 (TIMES EDITBG.PIXELSIZE 5)) (PLUS (TIMES EDITBG.PIXELSIZE 13) 2) (SUB1 (LLSH EDITBG.PIXELSIZE 2))) NUMBEREGION _ (CREATEREGION (PLUS (TIMES EDITBG.PIXELSIZE 5) WBorder) (PLUS (LLSH EDITBG.PIXELSIZE 2) WBorder) (DIFFERENCE (LLSH EDITBG.PIXELSIZE 3) WBorder) (FONTPROP DEFAULTFONT 'HEIGHT]) (RPAQ? EDITBG.BUTTONREGION (CREATEREGION (PLUS 2 (LLSH EDITBG.PIXELSIZE 2)) (PLUS 2 (LLSH EDITBG.PIXELSIZE 2)) (SUB1 EDITBG.PIXELSIZE) (SUB1 EDITBG.PIXELSIZE))) (DECLARE%: DOEVAL@COMPILE DONTCOPY (GLOBALVARS EDITBG.BUTTONREGION EDITBG.BORDERREC EDITBG.SHADEREC EDITBG.PIXELSIZE) ) (PUTPROPS EDITBG COPYRIGHT ("Stanford University" 1984 1985 1986 1987 1988)) (DECLARE%: DONTCOPY (FILEMAP (NIL (5943 11841 (EDITBACKGROUND 5953 . 7731) (EDITBG.BUTTONFN 7733 . 11839))))) STOP