home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e070 / 4.ddi / LISPLIB / WSTREAM.LSP < prev   
Encoding:
Text File  |  1984-11-06  |  2.6 KB  |  54 lines

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