home *** CD-ROM | disk | FTP | other *** search
- ;;; Copyrigth (c) Gold Hill Computers, Inc. 1984
-
- ;; This function is used for making windows. It takes
- ;; the following keyword arguments:
- ;; :CURSORPOS-X x - initial x coordinate of cursor
- ;; :CURSORPOS-Y y - initial y coordinate of cursor
- ;; :ATTRIBUTE a - The window's attribute (see IBM technical reference
- ;; manual). This is used whenever a character is written to a window.
- ;; In graphics mode the high byte of is the attribute used during
- ;; clearing and scrolling operations.
- ;; :LEFT l - character position of left side of window (inclusive).
- ;; :TOP t - character position of top side of window (inclusive).
- ;; :WIDTH w - width of window in characters.
- ;; :HEIGHT h - height of window in characters.
- ;; :STATUS b - These bits control certain things about windows:
- ;; bit 0 - 1 => hardware cursor belongs in this window,
- ;; this is maintained by the system, the hardware
- ;; cursor is in the window that last asked for input.
- ;; bit 1 - 1 => window is in wrap mode, otherwise it will scroll.
- ;; bit 2 - 1 => perform auto newline at end of line
- ;; :PAGE p - the hardware page this window resides on. When input
- ;; is requested from this window the page is displayed
- ;; automatically. Output to the window can proceed whether
- ;; its page is displayed or not. However if scrolling is
- ;; necessary or any clear window operations are requested
- ;; then the window's page is automatically displayed before
- ;; the operation is performed. The function of 1 argument
- ;; DISPLAY-PAGE can be used to select the current page. The
- ;; variable *DISPLAY-PAGE* has the current page number.
- ;;
- (DEFUN MAKE-WINDOW-STREAM (&REST OPTIONS)
- (LET ((OBJ (MAKE-ARRAY 12 :ELEMENT-TYPE '(UNSIGNED-BYTE 8)
- :INITIAL-CONTENTS '(0 0 7 0 0 0 0 0 80 24 4 0))))
- (DO ((X OPTIONS (CDDR X)))
- ((NULL X))
- (CASE (CAR X)
- (:CURSORPOS-X (SETF (AREF OBJ 0) (SECOND X)))
- (:CURSORPOS-Y (SETF (AREF OBJ 1) (SECOND X)))
- (:ATTRIBUTE
- (SETF (AREF OBJ 2) (LOGAND (SECOND X) #X0FF)
- (AREF OBJ 3) (LSH (SECOND X) -8)))
- (:LEFT (SETF (AREF OBJ 6) (SECOND X)))
- (:TOP (SETF (AREF OBJ 7) (SECOND X)))
- (:WIDTH (SETF (AREF OBJ 8) (SECOND X)))
- (:HEIGHT (SETF (AREF OBJ 9) (SECOND X)))
- (:STATUS (SETF (AREF OBJ 10) (SECOND X)))
- (:PAGE (SETF (AREF OBJ 11) (SECOND X)))
- (OTHERWISE
- (ERROR "MAKE-WINDOW-STREAM: bad option ~S." (CAR X)))))
- (UNLESS (AND (> (AREF OBJ 8) 2)(> (AREF OBJ 9) 0))
- (ERROR "MAKE-WINDOW-STREAM: inconsistent arguments."))
- (LET ((WINDOW-STREAM OBJ))
- (CLOSURE '(WINDOW-STREAM) #'WINDOW-STREAM))))