Make graphics work for OS/2 and WIN32 as well as X.
authorStephen Adams <edu/mit/csail/zurich/adams>
Thu, 11 Dec 1997 02:51:50 +0000 (02:51 +0000)
committerStephen Adams <edu/mit/csail/zurich/adams>
Thu, 11 Dec 1997 02:51:50 +0000 (02:51 +0000)
Update copyright.

v7/src/sicp/compat.scm
v7/src/sicp/graphics.scm

index 7bf0262a52d120202bcebd08161b1695f8236f5c..c766877e7fb06e7f3d6128edc1b958010e4ca2bd 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sicp/compat.scm,v 1.6 1991/09/12 21:34:35 arthur Exp $
+$Id: compat.scm,v 1.7 1997/12/11 02:51:50 adams Exp $
 
-Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-1996 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
index bc9c54b102ad7fd914dd812235d8d3fccbf3ce17..23666bda80a40f2ca2cf88b1c70508823ba3243b 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/sicp/graphics.scm,v 1.3 1991/04/12 00:12:11 arthur Exp $
+$Id: graphics.scm,v 1.4 1997/12/11 02:51:42 adams Exp $
 
-Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-1997 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -33,7 +33,7 @@ promotional, or sales literature without prior written consent from
 MIT in each case. |#
 
 ;;;; Student graphics Interface
-;;;; implemented for X Windows
+;;;; implemented for X Windows/ Win32 / OS2
 
 (declare (usual-integrations))
 \f
@@ -78,7 +78,9 @@ MIT in each case. |#
 
     (set! graphics-available?
          (lambda ()
-           (graphics-type-available? x-graphics-device-type)))
+           (or (graphics-type-available? 'X)
+               (graphics-type-available? 'WIN32)
+               (graphics-type-available? 'OS/2))))
 
     (set! graphics-text
          (lambda (text x y)
@@ -88,10 +90,15 @@ MIT in each case. |#
 
     (set! init-graphics
          (lambda ()
-           (let ((display (x-open-display #f)))
-             (set! graphics-device
-                   (make-graphics-device x-graphics-device-type
-                                         display "512x388" #f)))
+           (set! graphics-device
+                 (cond ((graphics-type-available? 'X)
+                        (make-graphics-device 'X #F "512x388"))
+                       ((graphics-type-available? 'WIN32)
+                        (make-graphics-device 'WIN32 512 388))
+                       ((graphics-type-available? 'OS/2)
+                        (make-graphics-device 'OS/2 512 388))
+                       (else
+                        (error "Graphics is not available"))))
            (graphics-set-coordinate-limits graphics-device -256 -195 255 194)
            (graphics-move-cursor graphics-device 0 0)))