Subject: Graphics in DOS

From: William Echard <[email-masked]>
Date: Wed, 26 Jan 94 13:37:28 EST

I'm a musicology grad student, and I'm experimenting with representing
and manipulating phrase-structres as trees in Lisp.  I want to write a
program to display the trees on the screen, and I would prefer to do it in
graphics mode.  Right now I'm limited to using Clisp under DOS, in text mode
only.  Are there extensions that I can get that will make it fairly easy to
switch into graphics mode and draw on the screen?  I could write something in
another language, but I'd like to try and do it all in Lisp if possible.
     Also, if anyone has code for parsing, analyzing, comparing, displaying,
or doing anything else to trees that will work under Clisp, I'd like to know
about it.  Thanks in advance----William

---

From: [email-masked]
Date: Thu, 27 Jan 1994 12:29:10 +0300 (EET)

Apropos Williams question,

>about it.

I quote from lisp-ftp.faq:

   Peter Norvig's book "Paradigms of AI Programming" includes Common Lisp
   implementations of a prolog interpreter and compiler. The software is
   available by anonymous ftp from unix.sri.com:pub/norvig and on disk in
   Macintosh or DOS format from the publisher, Morgan Kaufmann.  For more
   information, contact: Morgan Kaufmann, Dept. P1, 2929 Campus Drive, Suite
   260, San Mateo CA 94403, (800) 745-7323; FAX: (415) 578-0672

Norvig will introduce you to the basics, and more can be found in:

   A catalog of free and commercial natural language software is
   available from the Natural Language Software Registry, by anonymous
   ftp from ftp.dfki.uni-sb.de in the directory /registry, or by email to
   [email-masked].

Musicologists may get ideas from:

   Common Music is a music composition language written in Common Lisp
   and CLOS that outputs music (directly or through scorefiles) to a
   variety of synthesis packages, such as the Music Kit, Common Lisp
   Music, MIDI, and CSound.  Common Music runs under MCL 2.0, Allegro CL
   3.1.2 (NeXT), AKCL 1.615 (NeXT), Allegro CL 4.1 beta (SGI Iris), and
   AKCL 6.15 (Sun4). It is available by anonymous ftp from
   ccrma-ftp.stanford.edu [36.49.0.93] and ftp.zkm.de [192.101.28.17] in
   the files pub/cm.tar.Z.  To be added to the mailing list, send mail to
   [email-masked]. For further information, contact
   Rick Taube, <[email-masked]> or <[email-masked]>.
   [Note: In the Common Music sources, there is a generic portable Lisp
   Listener style interpreter that supports command dispatching in
   addition to Lisp evaluation. It is the file ./utils/tl.lisp.]

Enjoy!

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Arne Larsson			Nokia Telecommunications
Translator			Transmission Systems, Customer Services
[email-masked]	P.O. Box 12, SF-02611 Espoo, Finland
[email-masked]	Phone +358 0 5117476, Fax +358 0 51044287
[email-masked]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

---

From: haible (Bruno Haible)
Date: Sat, 19 Feb 94 21:24:04 +0100

William Echard <[email-masked]> asked:

> Right now I'm limited to using Clisp under DOS, in text mode
> switch into graphics mode and draw on the screen?

Yes, there are.

Graphics primitives in CLISP
============================

In CLISP 1994-01-07 or newer,
* DOS version,
* Linux version, installed setuid root,
there are some pixel graphics primitives in the SYSTEM package.
They operate on a VGA card.

Similar pixel graphics primitives can be used in the
* Unix version running under X11
by use of the small XTERM package available on
ma2s2.mathematik.uni-karlsruhe.de.

This is the description of the PC/VGA graphics primitives:

(SYSTEM::GRAPH-INIT [width [height [colors]]])
initializes the graphics system. The width, height parameters are hints for
the size of the desired graphics screen (positive integers). The colors
parameter is a hint for the number of colors. The actual width, height
is implementation dependent, currently up to 640x480 on VGA cards and up to
1024x768 on ET4000 SVGA cards.
Returns an alist ((color-value color-keyword) ...) which lists the available
colours and their numerical equivalents.

(SYSTEM::GRAPH-SHOW)
switches the graphics hardware so that the graphics screen is visible. The
text screen is activated on any text output.

(SYSTEM::GRAPH-CLEAR [color])
fills the entire graphics screen with a single color.

(SYSTEM::GRAPH-DIMS)
returns two values: the actual width and the actual height of the graphics
screen (in pixels).

If (SYSTEM::GRAPH-DIMS) returns the values w and h, then valid screen
coordinates are pairs (x,y) with 0 <= x < w and 0 <= y < h. x=0 denotes the
left edge, y=0 the top edge.

(SYSTEM::GRAPH-DOT x y)
returns the colour of the pixel (x,y).
(SYSTEM::GRAPH-DOT x y color)
sets the colour of the pixel (x,y) to color.

(SYSTEM::GRAPH-BOX x1 y1 x2 y2 color)
draws a box (= filled rectangle) in colour color, the vertices being the pixels
        (x1,y1)   (x2,y1)
        (x1,y2)   (x2,y2)

(SYSTEM::GRAPH-LINE x1 y1 x2 y2 color)
Draws a line in colour color from pixel (x1,y1) to pixel (x2,y2).

This specification is subject to change.

Bruno Haible                                                 January 1994