(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "ROOMS") (IL:FILECREATED " 5-Dec-2020 16:26:58"  IL:|{DSK}arunwelch>SKYDRIVE>DOCUMENTS>UNIX>LISP>LDE>ROOMS>MEDLEY-35>ROOMS-GEOMETRY.;2| 7129 IL:|previous| IL:|date:| "17-Aug-90 12:45:39" IL:|{DSK}arunwelch>SKYDRIVE>DOCUMENTS>UNIX>LISP>LDE>ROOMS>MEDLEY-35>ROOMS-GEOMETRY.;1|) ; Copyright (c) 1987, 1988, 1990, 2020 by Venue & Xerox Corporation. All rights reserved. (IL:PRETTYCOMPRINT IL:ROOMS-GEOMETRYCOMS) (IL:RPAQQ IL:ROOMS-GEOMETRYCOMS ((FILE-ENVIRONMENTS IL:ROOMS-GEOMETRY) (IL:P (EXPORT '(EXTERNALIZE-REGION INTERNALIZE-REGION EXTERNALIZE-POSITION INTERNALIZE-POSITION)) (REQUIRE "ROOMS")) (IL:COMS (IL:* IL:|;;| "externalizing for suites & background text") (IL:FUNCTIONS EXTERNALIZE-REGION INTERNALIZE-REGION EXTERNALIZE-POSITION INTERNALIZE-POSITION EXTERNALIZE-COORDINATE INTERNALIZE-COORDINATE) (IL:GLOBALVARS IL:SCREENWIDTH IL:SCREENHEIGHT)) (IL:COMS (IL:* IL:|;;| "scaling used by placement editor & backgrounds") (IL:STRUCTURES SCALE) (IL:VARIABLES *ONE-TO-ONE*) (IL:FUNCTIONS MAKE-SCALE EQUAL-SCALES) (IL:FUNCTIONS SCALE-WIDTH SCALE-HEIGHT SCALE-X SCALE-Y SCALE-REGION SCALE-POSITION) (IL:FUNCTIONS UN-SCALE-REGION UN-SCALE-POSITION UN-SCALE-HEIGHT UN-SCALE-WIDTH UN-SCALE-X UN-SCALE-Y)))) (DEFINE-FILE-ENVIRONMENT IL:ROOMS-GEOMETRY :COMPILER :COMPILE-FILE :PACKAGE "ROOMS" :READTABLE "XCL") (EXPORT '(EXTERNALIZE-REGION INTERNALIZE-REGION EXTERNALIZE-POSITION INTERNALIZE-POSITION)) (REQUIRE "ROOMS") (IL:* IL:|;;| "externalizing for suites & background text") (DEFUN EXTERNALIZE-REGION (REGION) (MAKE-REGION :LEFT (EXTERNALIZE-COORDINATE (REGION-LEFT REGION) IL:SCREENWIDTH) :BOTTOM (EXTERNALIZE-COORDINATE (REGION-BOTTOM REGION) IL:SCREENHEIGHT) :WIDTH (EXTERNALIZE-COORDINATE (REGION-WIDTH REGION) IL:SCREENWIDTH) :HEIGHT (EXTERNALIZE-COORDINATE (REGION-HEIGHT REGION) IL:SCREENHEIGHT))) (DEFUN INTERNALIZE-REGION (REGION) (MAKE-REGION :LEFT (INTERNALIZE-COORDINATE (REGION-LEFT REGION) IL:SCREENWIDTH) :BOTTOM (INTERNALIZE-COORDINATE (REGION-BOTTOM REGION) IL:SCREENHEIGHT) :WIDTH (INTERNALIZE-COORDINATE (REGION-WIDTH REGION) IL:SCREENWIDTH) :HEIGHT (INTERNALIZE-COORDINATE (REGION-HEIGHT REGION) IL:SCREENHEIGHT))) (DEFUN EXTERNALIZE-POSITION (POS) (MAKE-POSITION (EXTERNALIZE-COORDINATE (POSITION-X POS) IL:SCREENWIDTH) (EXTERNALIZE-COORDINATE (POSITION-Y POS) IL:SCREENHEIGHT))) (DEFUN INTERNALIZE-POSITION (POS) (MAKE-POSITION (INTERNALIZE-COORDINATE (POSITION-X POS) IL:SCREENWIDTH) (INTERNALIZE-COORDINATE (POSITION-Y POS) IL:SCREENHEIGHT))) (DEFUN EXTERNALIZE-COORDINATE (N RANGE) (LET ((EXTERNAL (/ N RANGE))) (TYPECASE EXTERNAL (INTEGER (FLOAT EXTERNAL)) (OTHERWISE EXTERNAL)))) (DEFUN INTERNALIZE-COORDINATE (N RANGE) (ETYPECASE N (INTEGER N) ((OR FLOAT RATIONAL) (ROUND (* N RANGE))))) (IL:DECLARE\: IL:DOEVAL@COMPILE IL:DONTCOPY (IL:GLOBALVARS IL:SCREENWIDTH IL:SCREENHEIGHT) ) (IL:* IL:|;;| "scaling used by placement editor & backgrounds") (DEFSTRUCT (SCALE (:CONSTRUCTOR MAKE-SCALE-INTERNAL)) (IL:* IL:|;;;| "used to scale coordinates. X-FACTOR & Y-FACTOR are the scale factor, and X-OFFSET & Y-OFFSET are added after scaling.") (X-OFFSET 0 :TYPE INTEGER) (X-FACTOR 1 :TYPE (OR INTEGER FLOAT RATIONAL)) (Y-OFFSET 0 :TYPE INTEGER) (Y-FACTOR 1 :TYPE (OR INTEGER FLOAT RATIONAL))) (DEFGLOBALVAR *ONE-TO-ONE* (MAKE-SCALE-INTERNAL)) (DEFUN MAKE-SCALE (REGION) (IL:* IL:|;;;| "return a scale which scales the screen into REGION ") (MAKE-SCALE-INTERNAL :X-FACTOR (FLOAT (/ (REGION-WIDTH REGION) IL:SCREENWIDTH)) :X-OFFSET (REGION-LEFT REGION) :Y-FACTOR (FLOAT (/ (REGION-HEIGHT REGION) IL:SCREENHEIGHT)) :Y-OFFSET (REGION-BOTTOM REGION))) (DEFUN EQUAL-SCALES (SCALE-1 SCALE-2) (AND (= (SCALE-X-FACTOR SCALE-1) (SCALE-X-FACTOR SCALE-2)) (= (SCALE-Y-FACTOR SCALE-1) (SCALE-Y-FACTOR SCALE-2)))) (DEFMACRO SCALE-WIDTH (WIDTH SCALE) `(ROUND (* ,WIDTH (SCALE-X-FACTOR ,SCALE)))) (DEFMACRO SCALE-HEIGHT (HEIGHT SCALE) `(ROUND (* ,HEIGHT (SCALE-Y-FACTOR ,SCALE)))) (DEFINLINE SCALE-X (X SCALE) (+ (SCALE-WIDTH X SCALE) (SCALE-X-OFFSET SCALE))) (DEFINLINE SCALE-Y (Y SCALE) (+ (SCALE-HEIGHT Y SCALE) (SCALE-Y-OFFSET SCALE))) (DEFUN SCALE-REGION (REGION SCALE) (IF (EQ SCALE *ONE-TO-ONE*) REGION (MAKE-REGION :LEFT (SCALE-X (REGION-LEFT REGION) SCALE) :BOTTOM (SCALE-Y (REGION-BOTTOM REGION) SCALE) :WIDTH (SCALE-WIDTH (REGION-WIDTH REGION) SCALE) :HEIGHT (SCALE-HEIGHT (REGION-HEIGHT REGION) SCALE)))) (DEFUN SCALE-POSITION (POS SCALE) (IF (EQ SCALE *ONE-TO-ONE*) POS (MAKE-POSITION (SCALE-X (POSITION-X POS) SCALE) (SCALE-Y (POSITION-Y POS) SCALE)))) (DEFUN UN-SCALE-REGION (REGION SCALE) (MAKE-REGION :LEFT (UN-SCALE-X (REGION-LEFT REGION) SCALE) :BOTTOM (UN-SCALE-Y (REGION-BOTTOM REGION) SCALE) :WIDTH (UN-SCALE-WIDTH (REGION-WIDTH REGION) SCALE) :HEIGHT (UN-SCALE-HEIGHT (REGION-HEIGHT REGION) SCALE))) (DEFUN UN-SCALE-POSITION (POS SCALE) (MAKE-POSITION (UN-SCALE-X (POSITION-X POS) SCALE) (UN-SCALE-Y (POSITION-Y POS) SCALE))) (DEFMACRO UN-SCALE-HEIGHT (HEIGHT SCALE) `(ROUND ,HEIGHT (SCALE-Y-FACTOR ,SCALE))) (DEFMACRO UN-SCALE-WIDTH (WIDTH SCALE) `(ROUND ,WIDTH (SCALE-X-FACTOR ,SCALE))) (DEFUN UN-SCALE-X (X SCALE) (UN-SCALE-WIDTH (- X (SCALE-X-OFFSET SCALE)) SCALE)) (DEFUN UN-SCALE-Y (Y SCALE) (UN-SCALE-HEIGHT (- Y (SCALE-Y-OFFSET SCALE)) SCALE)) (IL:PUTPROPS IL:ROOMS-GEOMETRY IL:COPYRIGHT ("Venue & Xerox Corporation" 1987 1988 1990 2020)) (IL:DECLARE\: IL:DONTCOPY (IL:FILEMAP (NIL (1908 2400 (EXTERNALIZE-REGION 1908 . 2400)) (2402 2894 (INTERNALIZE-REGION 2402 . 2894)) (2896 3128 (EXTERNALIZE-POSITION 2896 . 3128)) (3130 3362 (INTERNALIZE-POSITION 3130 . 3362)) ( 3364 3542 (EXTERNALIZE-COORDINATE 3364 . 3542)) (3544 3673 (INTERNALIZE-COORDINATE 3544 . 3673)) (4259 4699 (MAKE-SCALE 4259 . 4699)) (4701 4890 (EQUAL-SCALES 4701 . 4890)) (5268 5761 (SCALE-REGION 5268 . 5761)) (5763 6005 (SCALE-POSITION 5763 . 6005)) (6007 6425 (UN-SCALE-REGION 6007 . 6425)) (6427 6619 (UN-SCALE-POSITION 6427 . 6619)) (6800 6901 (UN-SCALE-X 6800 . 6901)) (6903 7005 (UN-SCALE-Y 6903 . 7005))))) IL:STOP