STDWIN 0.9.6 patches, part 1/5

Guido van Rossum guido at cwi.nl
Fri Jun 7 23:31:50 AEST 1991


These patches produce STDWIN version 0.9.6 from version 0.9.5, which
was posted here in March.  See comp.windows.misc for more info about
STDWIN and ftp availability.

--Guido van Rossum, CWI, Amsterdam <guido at cwi.nl>

INSTRUCTIONS: Parts 1-4 should be piped into "patch -p" with the
current directory just *above* the stdwin source directory.  Part 5 is
a shar file containing a new version of a file that was changed so
much that posting diffs would be a waste of bandwidth.  You should
also junk the following files/directories: Ports/vtrm/DIST,
Ports/vtrm/uxtty.c, Ports/vtrm/vtrm.h (especially the latter matters,
it has moved and changed!!)

Prereq: 5
*** 0.9.5/H/patchlevel.h	Thu Feb 28 10:42:39 1991
--- stdwin/H/patchlevel.h	Fri Jun  7 13:36:25 1991
***************
*** 1 ****
! #define PATCHLEVEL 5
--- 1 ----
! #define PATCHLEVEL 6
*** 0.9.5/README	Mon Mar  4 12:31:35 1991
--- stdwin/README	Fri Jun  7 13:55:56 1991
***************
*** 1,40 ****
! STDWIN INSTALLATION GUIDE
! -------------------------
  
! [last edit: 4 March 1991]
  
  
  What Is STDWIN
  ==============
  
! STDWIN (STanDard Window INterface) is a simple windowing interface for
! which multiple implementations exist; currently, programs using STDWIN
! can be made to run on Unix (using either alphanumeric terminals or the
! X11 Window System), on the Apple Macintosh (using THINK C or MPW), or
! on MS-DOS with a dumb display (using Microsoft C).  If you insist, I
! also have two versions for the Atari ST that need some dusting off.
  
! For a longer introduction, read the (slightly outdated) file Doc/ABOUT.
! For more information on the Macintosh version, read Ports/mac/README,
! for MS-DOS, read Ports/msdos/README.
  
- This is version 0.9.5.  It is still a beta test version.
  
  
  Where To Get STDWIN
  ===================
  
! I regularly put the latest STDWIN distribution on two anonymous ftp
! sites.  As the filename shows, to unpack this you need the programs
! uncompress and tar.
  
! 	site		hp4nl.nluug.nl (IP address 192.16.202.2)
! 	directory	pub/windows
! 	file		stdwin*.tar.Z (the * is the version, e.g. 0.9.5)
  
! 	site		wuarchive.wustl.edu (IP address 128.252.135.4)
! 	directory	pub
! 	file		stdwin*.tar.Z (the * is the version, e.g. 0.9.5)
  
  Don't forget to specify binary file transfer mode!  ("type binary")
  
--- 1,115 ----
! STDWIN ESSENTIAL INFORMATION
! ****************************
  
! [last edit: 7 June 1991]
  
  
  What Is STDWIN
  ==============
  
! STDWIN (STanDard Window INterface -- similar to STDIO) is a simple
! windowing interface for C programs, that is implemented on various
! platforms.  The "flagship" implementations support the Macintosh and
! X11 windowing environments.  The emphasis is on portability between
! platforms and a simple interface to the application, not on getting
! the maximum performance or functionality of one particular platform.
  
! For a longer introduction, read the (still outdated) file Doc/ABOUT.
! For more information on the Macintosh version, read Ports/mac/README.
! For MS-DOS, read Ports/msdos/README.
  
  
+ Supported Platforms
+ ===================
  
+ Currently, programs using STDWIN can be made to run on Unix under X11,
+ on alphanumeric terminals (using termcap -- obviously with some loss
+ of functionality), on the Apple Macintosh (using THINK C 4.0), or on
+ MS-DOS with a dumb display (using Microsoft C).  I am working on
+ patches to get the Mac port running under MPW 3.x (which is quite
+ different in some respects from MPW 2.x); contact me if you need this
+ urgently.  If you insist, I also have two versions for the Atari ST
+ (one for MWC and one for TurboC) that need a lot of dusting off, and
+ haven't been upgraded to all the lovely new features.
+ 
+ 
+ Copyright
+ =========
+ 
+ Copyright 1988, 1989, 1991 by Stichting Mathematisch Centrum,
+ Amsterdam, The Netherlands.
+ 
+                         All Rights Reserved
+ 
+ Permission to use, copy, modify, and distribute this software and its 
+ documentation for any purpose and without fee is hereby granted, 
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in 
+ supporting documentation, and that the names of Stichting Mathematisch
+ Centrum or CWI not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+ 
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ 
+ 
+ This is Version 0.9.6
+ =====================
+ 
+ I believe it is a mature product, except for the lack of complete
+ documentation.  When I have finished the manual I'll release version
+ 1.0, and post it to an appropriate comp.sources group.
+ 
+ 
  Where To Get STDWIN
  ===================
  
! STDWIN 0.9.5 was posted to alt.sources in march 1991.  I am posting
! diffs to get it up to STDWIN 0.9.6 in june 1991.  The postings should
! still be available from sites that archive this newsgroup, such as
! wuarchive.wustl.edu (see below).
  
! STDWIN is also available from a number of ftp sites.  The * in file
! names is the version number, e.g., 0.9.6 (the last digit is the patch
! level).
  
! 
! Sites		hp4nl.nluug.nl (IP address 192.16.202.2)
! 		mcsun.eu.net (IP address 192.16.202.1)
! For whom	users in the Netherlands and the rest of Europe
! Directory	pub/windows
! 	File	stdwin*.tar.Z
! Directory	pub/programming/languages
! 	Files	python*.tar.Z
! 		pythondoc[12].ps.Z
! Directory	pub/comp/mac/compiler
! 	File	Python.hqx
! 
! 
! Site		wuarchive.wustl.edu (IP address 128.252.135.4)
! For whom	users in North America
! Directory	usenet/alt.sources
! Note		Raw alt.sources archive, see README there.  Grep -i the
! 		Index file for "stdwin" or "python".
! 
! 		
! Site		gatekeeper.dec.com (IP address 16.1.0.2)
! For whom	users in North America
! Directory	pub/misc
! 	File	stdwin*.tar.Z
! Directory	pub/misc/python
! 	Files	python*.tar.Z
! 		pythondoc[12].ps.Z
! 		Python.hqx.Z
! 
! 
! I'll also try to put compressed tar images on wuarchive in /pub and on
! uunet in /tmp.
  
  Don't forget to specify binary file transfer mode!  ("type binary")
  
*** 0.9.5/Appls/dpv/Make.proto	Thu Sep  6 10:33:36 1990
--- stdwin/Appls/dpv/Make.proto	Tue May 14 13:33:03 1991
***************
*** 15,21 ****
  		$(DPV)/dpvparse.c \
  		$(DPV)/dpvrestart.c
  
! SRCLIBS=	-lm
  
  all:		dpv choose
  
--- 15,21 ----
  		$(DPV)/dpvparse.c \
  		$(DPV)/dpvrestart.c
  
! SRCLIBS=	-$(LIBMATH)
  
  all:		dpv choose
  
*** 0.9.5/Appls/dpv/dpv.c	Thu Oct 18 18:18:12 1990
--- stdwin/Appls/dpv/dpv.c	Tue May 14 13:33:38 1991
***************
*** 16,21 ****
--- 16,22 ----
  	int firstpage;
  	
  	winitargs(&argc, &argv);
+ 	wsetdefscrollbars(1, 1);
  	
  	if (argc > 0 && *argv != NULL && **argv != EOS) {
  		progname= rindex(argv[0], '/');
*** 0.9.5/Appls/dpv/dpvoutput.c	Thu Oct 18 18:20:02 1990
--- stdwin/Appls/dpv/dpvoutput.c	Tue May 14 13:35:03 1991
***************
*** 211,217 ****
  			y += dv;
  		}
  	drawline(dh / 4, dv / 4);
! 	if (index(buf, EOL) == NULL) {
  		int c;
  		/* HIRO: don't know how to do handle this */
  		error(WARNING, "rest of very long wiggly line ignored");
--- 211,217 ----
  			y += dv;
  		}
  	drawline(dh / 4, dv / 4);
! 	if (strchr(buf, EOL) == NULL) {
  		int c;
  		/* HIRO: don't know how to do handle this */
  		error(WARNING, "rest of very long wiggly line ignored");
*** 0.9.5/Appls/klok/Make.proto	Thu Sep  6 10:03:25 1990
--- stdwin/Appls/klok/Make.proto	Wed Apr  3 22:45:47 1991
***************
*** 9,15 ****
  		$(KLOK)/klok.c \
  		$(KLOK)/bsdsetdate.c
  
! SRCLIBS=	-lm
  
  all:		klok
  
--- 9,15 ----
  		$(KLOK)/klok.c \
  		$(KLOK)/bsdsetdate.c
  
! SRCLIBS=	$(LIBMATH)
  
  all:		klok
  
*** 0.9.5/Appls/klok/bsdsetdate.c	Thu Feb 28 10:42:41 1991
--- stdwin/Appls/klok/bsdsetdate.c	Wed Apr  3 22:46:13 1991
***************
*** 1,9 ****
  /* Set the date and time -- 4.3 BSD Unix version */
  
- #ifndef sun
- /* This is not needed on SunOS 4.03 (what about higher SunOS'es?). */
- #include <time.h>
- #endif
  #include <sys/time.h>
  
  #define isleap(y) ((y)%4 == 0 && ((y)%100 != 0 || (y)%400 == 0))
--- 1,5 ----
*** 0.9.5/Appls/klok/klok.c	Thu Feb 28 10:42:41 1991
--- stdwin/Appls/klok/klok.c	Tue Apr 23 15:41:29 1991
***************
*** 290,306 ****
  	WINDOW *win;
  {
  	int i;
! 	
  	/* Draw the fixed elements of the clock */
  #ifdef UGLY
  	drawborder();
  	drawoutline();
  #else
- #ifdef macintosh
  	wdrawcircle(centh+1, centv+1, radius+1);
- #else
- 	wdrawcircle(centh, centv, radius);
- #endif
  	for (i = 0; i < 12; ++i)
  		drawmark(i*5);			/* Hour marks */
  #endif
--- 290,302 ----
  	WINDOW *win;
  {
  	int i;
! 
  	/* Draw the fixed elements of the clock */
  #ifdef UGLY
  	drawborder();
  	drawoutline();
  #else
  	wdrawcircle(centh+1, centv+1, radius+1);
  	for (i = 0; i < 12; ++i)
  		drawmark(i*5);			/* Hour marks */
  #endif
***************
*** 318,324 ****
  	drawampm(ampm(&curtime));
  	if (alarm >= 0)
  		drawalarm();
! 		
  	/* Invert if the alarm is going */
  	if (excited)
  		winvert(0, 0, 10000, 10000);
--- 314,320 ----
  	drawampm(ampm(&curtime));
  	if (alarm >= 0)
  		drawalarm();
! 
  	/* Invert if the alarm is going */
  	if (excited)
  		winvert(0, 0, 10000, 10000);
***************
*** 643,649 ****
  	centh = width/2;
  	centv = height/2;
  	radius = centv - wlineheight();
! 	CLIPMAX(radius, centh);
  	newtime(TRUE);
  }
  
--- 639,645 ----
  	centh = width/2;
  	centv = height/2;
  	radius = centv - wlineheight();
! 	CLIPMAX(radius, centh-2);
  	newtime(TRUE);
  }
  
***************
*** 761,766 ****
--- 757,763 ----
  {
  	/* Initialize */
  	winitargs(&argc, &argv);
+ 	wsetdefscrollbars(0, 0);
  	buildmenu(); /* Must be done before setalarm is called */
  	
  	/* Find out program name */
*** 0.9.5/Appls/test/hello.c	Thu Feb 28 10:34:56 1991
--- stdwin/Appls/test/hello.c	Tue Jun  4 14:31:57 1991
***************
*** 10,15 ****
--- 10,16 ----
  
  int text_h, text_v;
  
+ void
  placetext(win)
  	WINDOW *win;
  {
***************
*** 19,24 ****
--- 20,26 ----
  	text_h= (width - wtextwidth(string, -1)) / 2;
  }
  
+ void
  drawproc(win, left, top, right, bottom)
  	WINDOW *win;
  {
***************
*** 38,47 ****
  		for (;;) {
  			EVENT e;
  			wgetevent(&e);
! 			if (e.type == WE_CLOSE ||
! 					e.type == WE_COMMAND &&
! 					(e.u.command == WC_CLOSE ||
! 					 e.u.command == WC_CANCEL))
  				break;
  			if (e.type == WE_SIZE)
  				placetext(win);
--- 40,46 ----
  		for (;;) {
  			EVENT e;
  			wgetevent(&e);
! 			if (e.type == WE_CLOSE)
  				break;
  			if (e.type == WE_SIZE)
  				placetext(win);
*** 0.9.5/Appls/tetris/tetris.c	Thu Feb 28 10:34:51 1991
--- stdwin/Appls/tetris/tetris.c	Thu Mar 28 16:33:18 1991
***************
*** 727,732 ****
--- 727,733 ----
  	time(&t);
  	srand((short)t ^ (short)(t>>16));
  	winitargs(&argc, &argv);
+ 	wsetdefscrollbars(0, 0);
  	if (wlineheight() == 1) {
  		alfa = 1;
  		sqwidth = 2;
*** 0.9.5/Conf/mkmf	Wed Aug  8 15:29:50 1990
--- stdwin/Conf/mkmf	Mon May 13 18:58:35 1991
***************
*** 7,12 ****
--- 7,18 ----
      else an application makefile is created."
  
  TOP=`(cd ..; pwd)`
+ case $TOP in
+ /tmp_mnt/*)	TOP=`
+ 			echo "$TOP" | sed 's,^/tmp_mnt/,/hosts/,'
+ 		    `
+ 		;;
+ esac
  
  PORT=x11
  
***************
*** 22,27 ****
--- 28,37 ----
  	vax|mips)	OS=ultrix;;
  	tahoe)		OS=bsd;;
  	esac
+ elif (hp-pa) 2>/dev/null
+ then
+ 	ARCH=hppa
+ 	OS=hpux
  fi
  
  while :
***************
*** 44,54 ****
  '')	echo "Sorry, can't guess architecture, use -a" 1>&2; exit 2;;
  esac
  
  # Create top level in the Build tree if necessary
  
  if test ! -d $TOP/Build
  then
! 	echo "Create $TOP/Build? [ny]"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build || exit;;
--- 54,71 ----
  '')	echo "Sorry, can't guess architecture, use -a" 1>&2; exit 2;;
  esac
  
+ # Check out how to suppress trailing newline with echo
+ 
+ case `echo -n` in
+ -n)	n=; c='\c';;
+ '')	n=-n; c=;;
+ esac
+ 
  # Create top level in the Build tree if necessary
  
  if test ! -d $TOP/Build
  then
! 	echo $n "Create $TOP/Build? [ny] $c"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build || exit;;
***************
*** 58,64 ****
  
  if test ! -d $TOP/Build/$ARCH
  then
! 	echo "Create $TOP/Build/$ARCH? [ny]"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build/$ARCH || exit;;
--- 75,81 ----
  
  if test ! -d $TOP/Build/$ARCH
  then
! 	echo $n "Create $TOP/Build/$ARCH? [ny] $c"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build/$ARCH || exit;;
***************
*** 68,74 ****
  
  if test ! -d $TOP/Build/$ARCH/$PORT
  then
! 	echo "Create $TOP/Build/$ARCH/$PORT? [ny]"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build/$ARCH/$PORT || exit;;
--- 85,91 ----
  
  if test ! -d $TOP/Build/$ARCH/$PORT
  then
! 	echo $n "Create $TOP/Build/$ARCH/$PORT? [ny] $c"
  	read reply
  	case $reply in
  	[yY]*)	mkdir $TOP/Build/$ARCH/$PORT || exit;;
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Conf/proto.arch.hppa	Tue Apr 16 16:58:16 1991
***************
*** 0 ****
--- 1,29 ----
+ 
+ #
+ # Definitions pertaining to HP Precision architecture
+ #
+ 
+ # Define the name of this architecture here.
+ # This is used as a subdirectory name where all the objects for this
+ # architecture live: $(TOP)/Build/$(ARCH)
+ #
+ # Note that there is the silent assumption that there is only one O.S.
+ # per architecture.  We'll have to invent composite architecture names,
+ # or insert an extra level in the build tree, if this becomes false...
+ #
+ ARCH=		hppa
+ 
+ # Define the name of the script used to update the dependencies in
+ # the Makefile.
+ # Choices are:
+ #	slowmkdep -- always works (as far as I know)
+ #	fastmkdep -- used cc -M, which isn't always available
+ #	makedepend -- Todd Brunhoff's superfast tool (comes with X11)
+ #	              (This needs -Dunix because of configure.h)
+ # You may also place this definition in the proto.os.* file if you
+ # know a method works for every architecture supported by that OS.
+ #
+ #MKDEP=		$(CONF)/slowmkdep
+ #MKDEP=		$(CONF)/fastmkdep
+ #MKDEP=		makedepend -Dunix
+ 
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Conf/proto.arch.ibmr2	Tue Apr 16 16:58:27 1991
***************
*** 0 ****
--- 1,14 ----
+ 
+ #
+ # Definitions pertaining to IBM R2 architecture
+ #
+ 
+ # Define the name of this architecture here.
+ # This is used as a subdirectory name where all the objects for this
+ # architecture live: $(TOP)/Build/$(ARCH)
+ #
+ # Note that there is the silent assumption that there is only one O.S.
+ # per architecture.  We'll have to invent composite architecture names,
+ # or insert an extra level in the build tree, if this becomes false...
+ #
+ ARCH=		ibmr2
*** 0.9.5/Conf/proto.conf	Thu Oct 18 15:24:30 1990
--- stdwin/Conf/proto.conf	Tue Apr 16 17:00:45 1991
***************
*** 17,23 ****
  X11=		$(PORTS)/x11
  GEN=		$(TOP)/Gen
  VTRM=		$(PORTS)/vtrm
! VTRM_ALL=	$(PORTS)/vtrm/uxtty.c $(PORTS)/vtrm/vtrm.c
  
  # Names for subdirectories of $(PACKS)
  TEXTEDIT=	$(TOP)/Packs/textedit
--- 17,23 ----
  X11=		$(PORTS)/x11
  GEN=		$(TOP)/Gen
  VTRM=		$(PORTS)/vtrm
! VTRM_ALL=	$(PORTS)/vtrm/vtrm.c
  
  # Names for subdirectories of $(PACKS)
  TEXTEDIT=	$(TOP)/Packs/textedit
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Conf/proto.os.aix	Tue Apr 16 16:58:40 1991
***************
*** 0 ****
--- 1,38 ----
+ 
+ #
+ # Definitions pertaining to operating system AIX (IBM)
+ #
+ 
+ # Define the name of this O.S. here.
+ #
+ OS=		aix
+ 
+ # Define the name of the script used to update the dependencies in
+ # the Makefile.
+ # Choices are:
+ #	slowmkdep -- always works (as far as I know)
+ #	fastmkdep -- uses cc -M, which isn't always available
+ #	makedepend -- Todd Brunhoff's superfast tool (comes with X11)
+ #	              (This needs -Dunix because of configure.h)
+ # You may also place this definition in the proto.arch.* file if no
+ # method works for every architecture supported by this OS.
+ #
+ MKDEP=		$(CONF)/slowmkdep
+ #MKDEP=		$(CONF)/fastmkdep
+ #MKDEP=		makedepend -Dunix
+ 
+ # Define the system libraries to link with programs that use termcap and X11
+ # (In some cases these are architecture-dependent)
+ #
+ LIBTERMCAP=	-lcurses
+ LIBX11=		-lX11
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
+ 
+ # Other OS-specific choices (-I flags, -D flags, compiler options)
+ #
+ OSINCLS=	
+ OSDEFS=		
+ OSOPTS=		
*** 0.9.5/Conf/proto.os.amoeba	Fri Oct 12 16:14:54 1990
--- stdwin/Conf/proto.os.amoeba	Tue Apr 16 17:00:48 1991
***************
*** 7,20 ****
  #
  OS=		amoeba
  
- # Choose ONE of the following definitions of RANLIB.
- # BSD-based systems will need ranlib to be called after a library is
- # changed.
- # SYSV-based systems don't have ranlib; the value 'true' makes Make happy.
- #
- RANLIB=		ranlib			# for BSD
- #RANLIB=	true			# for SYSV
- 
  # Define the name of the script used to update the dependencies in
  # the Makefile.
  # Choices are:
--- 7,12 ----
*** 0.9.5/Conf/proto.os.bsd	Thu Feb 21 10:52:05 1991
--- stdwin/Conf/proto.os.bsd	Tue Apr 16 17:00:50 1991
***************
*** 4,12 ****
  #
  
  OS=		bsd
- RANLIB=		ranlib
  
  # MKDEP is defined in proto.arch.*
  
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
--- 4,13 ----
  #
  
  OS=		bsd
  
  # MKDEP is defined in proto.arch.*
  
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
+ LIBMATH=	-lm
+ 
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Conf/proto.os.hpux	Tue Apr 16 17:00:52 1991
***************
*** 0 ****
--- 1,38 ----
+ 
+ #
+ # Definitions pertaining to operating system HP-UX
+ #
+ 
+ # Define the name of this O.S. here.
+ #
+ OS=		hpux
+ 
+ # Define the name of the script used to update the dependencies in
+ # the Makefile.
+ # Choices are:
+ #	slowmkdep -- always works (as far as I know)
+ #	fastmkdep -- uses cc -M, which isn't always available
+ #	makedepend -- Todd Brunhoff's superfast tool (comes with X11)
+ #	              (This needs -Dunix because of configure.h)
+ # You may also place this definition in the proto.arch.* file if no
+ # method works for every architecture supported by this OS.
+ #
+ MKDEP=		$(CONF)/slowmkdep
+ #MKDEP=		$(CONF)/fastmkdep
+ #MKDEP=		makedepend -Dunix
+ 
+ # Define the system libraries to link with programs that use termcap and X11
+ # (In some cases these are architecture-dependent)
+ #
+ LIBTERMCAP=	-ltermcap
+ LIBX11=		-lX11
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
+ 
+ # Other OS-specific choices (-I flags, -D flags, compiler options)
+ #
+ OSINCLS=	-I/usr/include/X11R4
+ OSDEFS=		-DSYSV
+ OSOPTS=		
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Conf/proto.os.minix	Tue Apr 16 17:00:54 1991
***************
*** 0 ****
--- 1,38 ----
+ 
+ #
+ # Definitions pertaining to operating system XXX
+ #
+ 
+ # Define the name of this O.S. here.
+ #
+ OS=		minix
+ 
+ # Define the name of the script used to update the dependencies in
+ # the Makefile.
+ # Choices are:
+ #	slowmkdep -- always works (as far as I know)
+ #	fastmkdep -- uses cc -M, which isn't always available
+ #	makedepend -- Todd Brunhoff's superfast tool (comes with X11)
+ #	              (This needs -Dunix because of configure.h)
+ # You may also place this definition in the proto.arch.* file if no
+ # method works for every architecture supported by this OS.
+ #
+ MKDEP=		$(CONF)/slowmkdep
+ #MKDEP=		$(CONF)/fastmkdep
+ #MKDEP=		makedepend -Dunix
+ 
+ # Define the system libraries to link with programs that use termcap and X11
+ # (In some cases these are architecture-dependent)
+ #
+ #LIBTERMCAP=	-ltermcap
+ #LIBX11=		-lX11
+ 
+ # Minix' math library is part of libc
+ #
+ LIBMATH=	
+ 
+ # Other OS-specific choices (-I flags, -D flags, compiler options)
+ #
+ OSINCLS=	-I/usr/cstu10/meulenbr/minix/ack/include
+ OSDEFS=		-D_MINIX
+ OSOPTS=		-f  -wo -O
*** 0.9.5/Conf/proto.os.sony	Fri Nov 16 12:58:49 1990
--- stdwin/Conf/proto.os.sony	Tue Apr 16 17:00:55 1991
***************
*** 7,18 ****
  #
  OS=		sony
  
- # Choose ONE of the following definitions of RANLIB.
- # BSD-based systems will need ranlib to be called after a library is
- # changed.
- #
- RANLIB=		ranlib			# for BSD
- 
  # Define the name of the script used to update the dependencies in
  # the Makefile.
  # Choices are:
--- 7,12 ----
***************
*** 32,37 ****
--- 26,35 ----
  #
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
  
  # Other OS-specific choices (-I flags, -D flags, compiler options)
  #
*** 0.9.5/Conf/proto.os.sunos	Wed Aug  8 15:27:56 1990
--- stdwin/Conf/proto.os.sunos	Tue Apr 16 17:00:56 1991
***************
*** 7,17 ****
  #
  OS=		sunos
  
- # BSD-based systems will need ranlib to be called after a library is
- # changed.
- #
- RANLIB=		ranlib			# for BSD-based systems
- 
  # The mkdep using cc -M will work for any architecture (I hope)
  #
  MKDEP=		$(CONF)/fastmkdep
--- 7,12 ----
***************
*** 20,23 ****
--- 15,22 ----
  #
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
  
*** 0.9.5/Conf/proto.os.sysv	Wed Aug  8 15:27:56 1990
--- stdwin/Conf/proto.os.sysv	Tue Apr 16 17:00:57 1991
***************
*** 1,6 ****
  
  #
! # Definitions pertaining to (modern versions of) System V
  #
  # Disclaimer: this was only tested on a Silicon Graphics under IRIX 3.2
  #
--- 1,6 ----
  
  #
! # Definitions pertaining to generic System V
  #
  # Disclaimer: this was only tested on a Silicon Graphics under IRIX 3.2
  #
***************
*** 9,29 ****
  #
  OS=		sysv
  
- # SYSV-based systems don't have ranlib; the value 'true' makes Make happy.
- #
- RANLIB=		true			# for SYSV
- 
  # Defines to make various bits of code happy:
  #	-DSYSV is the general test for System V.
  #	-Datt is used at least by some X internal headers (and what else?)
- #	And, of course, index and rindex are called strchr and strrchr.
  #
! OSDEFS=		-DSYSV -Datt -Dindex=strchr -Drindex=strrchr
  
! # The mkdep using cc -M will work for any architecture (I hope)
  #
! MKDEP=		$(CONF)/fastmkdep
  
  # The system libraries to link with programs that use termcap and X11
  # are in proto.arch.* instead.
  
--- 9,28 ----
  #
  OS=		sysv
  
  # Defines to make various bits of code happy:
  #	-DSYSV is the general test for System V.
  #	-Datt is used at least by some X internal headers (and what else?)
  #
! OSDEFS=		-DSYSV -Datt
  
! # The mkdep using /lib/cpp | sed ... is the safest to try...
  #
! MKDEP=		$(CONF)/slowmkdep
  
  # The system libraries to link with programs that use termcap and X11
  # are in proto.arch.* instead.
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
  
*** 0.9.5/Conf/proto.os.ultrix	Wed Aug  8 13:53:10 1990
--- stdwin/Conf/proto.os.ultrix	Tue Apr 16 17:00:59 1991
***************
*** 4,13 ****
  #
  
  OS=		ultrix
- RANLIB=		ranlib
  
  # MKDEP is defined in proto.arch.{vax,mips}
  
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
! 
--- 4,12 ----
  #
  
  OS=		ultrix
  
  # MKDEP is defined in proto.arch.{vax,mips}
  
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
! LIBMATH=	-lm
*** 0.9.5/Conf/proto.os.xxx	Thu Oct 11 15:15:17 1990
--- stdwin/Conf/proto.os.xxx	Tue Apr 16 17:01:00 1991
***************
*** 7,20 ****
  #
  OS=		XXX
  
- # Choose ONE of the following definitions of RANLIB.
- # BSD-based systems will need ranlib to be called after a library is
- # changed.
- # SYSV-based systems don't have ranlib; the value 'true' makes Make happy.
- #
- RANLIB=		ranlib			# for BSD
- RANLIB=		true			# for SYSV
- 
  # Define the name of the script used to update the dependencies in
  # the Makefile.
  # Choices are:
--- 7,12 ----
***************
*** 29,39 ****
  MKDEP=		$(CONF)/fastmkdep
  MKDEP=		makedepend -Dunix
  
! # Define the system libraries to link with programs that use termcap and X11
  # (In some cases these are architecture-dependent)
  #
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
  
  # Other OS-specific choices (-I flags, -D flags, compiler options)
  #
--- 21,36 ----
  MKDEP=		$(CONF)/fastmkdep
  MKDEP=		makedepend -Dunix
  
! # Define the system libraries to link with programs that use termcap and X11.
! # (On SYSV it is often safer to link with -lcurses instead of -ltermcap.)
  # (In some cases these are architecture-dependent)
  #
  LIBTERMCAP=	-ltermcap
  LIBX11=		-lX11
+ 
+ # Similar for the math library
+ #
+ LIBMATH=	-lm
  
  # Other OS-specific choices (-I flags, -D flags, compiler options)
  #
*** 0.9.5/Conf/putlibmf	Mon Aug 13 13:00:28 1990
--- stdwin/Conf/putlibmf	Tue Apr 16 17:02:45 1991
***************
*** 23,29 ****
  echo
  echo "$TARGET: \$(OBJS)"
  echo "	ar cr @$TARGET \$(OBJS)"
! echo "	\$(RANLIB) @$TARGET"
  echo "	mv @$TARGET $TARGET"
  #     ^^these are tabs!
  echo
--- 23,30 ----
  echo
  echo "$TARGET: \$(OBJS)"
  echo "	ar cr @$TARGET \$(OBJS)"
! echo "	@echo never mind if ranlib does not exist -- probably SYSV"
! echo "	-ranlib @$TARGET"
  echo "	mv @$TARGET $TARGET"
  #     ^^these are tabs!
  echo
*** 0.9.5/Doc/ABOUT	Fri Nov 16 13:36:07 1990
--- stdwin/Doc/ABOUT	Fri Jun  7 13:56:07 1991
***************
*** 1,14 ****
! [Last modified on Sat Apr 15 20:19:00 MET DST 1989 by guido]
  
  
  0. Copyright Notice
  
! STDWIN is copyrighted: Copyright (c) 1988, 1989 by Stichting Mathematisch
! Centrum, Amsterdam, The Netherlands.  STDWIN is available for
! noncommercial use only, free of charge, and with no guarantees.  It can
! be freely used and distributed provided these restrictions are honoured.
  
  
  1. Target systems
  
  STDWIN is aimed at C programs.  It consists of a few header files (of
--- 1,33 ----
! [Last modified on Wed Apr 17 10:37:36 MET DST 1991 by frank (Chapters 0, 1, 2)]
! [     modified on Sat Apr 15 20:19:00 MET DST 1989 by guido]
  
  
  0. Copyright Notice
  
! /***********************************************************
! Copyright 1988, 1989, 1991 by Stichting Mathematisch Centrum,
! Amsterdam, The Netherlands.
  
+                         All Rights Reserved
  
+ Permission to use, copy, modify, and distribute this software and its 
+ documentation for any purpose and without fee is hereby granted, 
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in 
+ supporting documentation, and that the names of Stichting Mathematisch
+ Centrum or CWI not be used in advertising or publicity pertaining to
+ distribution of the software without specific, written prior permission.
+ 
+ STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+ THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+ FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ 
+ ******************************************************************/
+ 
  1. Target systems
  
  STDWIN is aimed at C programs.  It consists of a few header files (of
***************
*** 22,37 ****
  functionality may be added, but the basic framework isn't going to
  change much.)
  
! *       X version 11, release 3 (should still work with release 2)
! *       Apple Macintosh, using either THINK C (3.01) or MPW C (2.02)
! *       Atari ST, using Mark Williams C (2.1)
  
  You may volunteer to create a version for your favourite system, or to
! port it to your favourite C compiler for one of the mentioned micros.
! (The micro versions are rather compiler-dependent, due to the many
! differences between compilers and especially libraries.  Expect
! difficulties if you have another compiler or version than the ones
! mentioned.  Especially the Atari version is flakey.)
  
  A subset, emulating most of STDWIN's functionality on an alphanumeric
  display (excluding line drawing, but including multiple (non-overlapping)
--- 41,51 ----
  functionality may be added, but the basic framework isn't going to
  change much.)
  
! *       X version 11, release 4 (should still work with release 2 and 3)
! *       Apple Macintosh, using either THINK C (4.02) or MPW C (2.02)
  
  You may volunteer to create a version for your favourite system, or to
! port it to your favourite C compiler for the mentioned micro.
  
  A subset, emulating most of STDWIN's functionality on an alphanumeric
  display (excluding line drawing, but including multiple (non-overlapping)
***************
*** 41,50 ****
  *       MS-DOS, using the Microsoft C compiler (4.0)
  
  Sorry, there are no versions yet for SunTools, SunView, NeWS, X10,
! MS-Windows, Presentation Manager or the Amiga.  A hacker might be able
! to turn the Atari ST version into a general GEM version.  The code is
! remarkably portable to different processor types and various Unix
! flavors, as long as they are derived from 4.xBSD.
  
  
  2. Getting the full scoop
--- 55,63 ----
  *       MS-DOS, using the Microsoft C compiler (4.0)
  
  Sorry, there are no versions yet for SunTools, SunView, NeWS, X10,
! MS-Windows, Presentation Manager, Atari ST or the Amiga.
! The code is remarkably portable to different processor types and
! various Unix flavors, as long as they are derived from 4.xBSD.
  
  
  2. Getting the full scoop
***************
*** 54,67 ****
  Interface.  Centre for Mathematics and Computer Science, report
  CS-R8817.  Amsterdam, 1988).
  
! You can also get a source version for any or all of the above-mentioned
! systems.  This is essentially a directory dump of my working version,
! until I have the time or get some help to prepare a real distribution.
! It is available through anonymous ftp access from uunet.uu.net.
! The directory is amiga-sources/stdwin (thanks to the moderator, Peter
! da Silva) get the file README.txt for further instructions.  A version
! of this file is in ABOUT.txt.  (The version on gatekeeper no longer
! exists, although it may be revived in the near future).
  
  Distribution to to non-ftp-users is solely by electronic mail.  Be
  prepared to receive up to half a megabyte (in 32K pieces in "shar"
--- 67,95 ----
  Interface.  Centre for Mathematics and Computer Science, report
  CS-R8817.  Amsterdam, 1988).
  
! STDWIN was posted to alt.sources around february 1991.
! It should be available from sites that archive this newsgroup, but I
! have no information on that.  I also post patches to this group.  (I
! will post the entire source to comp.sources.misc when I think the
! product is a little bit more finished.)
! 
! STDWIN is available from a number of ftp sites.
! The * in file names is the version number, e.g., 0.9.5 (the last digit
! is the patch level).
! 
! Current version number is 0.9.6 .
! 
! site		hp4nl.nluug.nl (IP address 192.16.202.2)
! for whom	users in the Netherlands and the rest of Europe
! file		pub/windows/stdwin*.tar.Z
! 
! site		wuarchive.wustl.edu (IP address 128.252.135.4)
! for whom	users in North America
! file		pub/stdwin*.tar.Z
! 		
! site		gatekeeper.dec.com (IP address 16.1.0.2)
! for whom	users in North America
! file		pub/misc/stdwin*.tar.Z
  
  Distribution to to non-ftp-users is solely by electronic mail.  Be
  prepared to receive up to half a megabyte (in 32K pieces in "shar"
*** 0.9.5/Doc/README	Thu Feb 28 12:56:16 1991
--- stdwin/Doc/README	Fri Jun  7 12:58:18 1991
***************
*** 2,7 ****
--- 2,8 ----
  There is nothing here that even remotely resembles a user manual;
  "paper.ms" comes closest to a full description.
  
+ WHATSNEW	summary of changes in version 0.9.6 since 0.9.5
  ABOUT		the old STDWIN blurb that I used to mail out
  paper.ms	the original STDWIN report
  seldoc.ms	describes using X11 Selections and Cut Buffers in STDWIN
*** /dev/null	Fri Jun  7 14:31:40 1991
--- stdwin/Doc/WHATSNEW	Fri Jun  7 13:24:12 1991
***************
*** 0 ****
--- 1,284 ----
+ What's New in STDWIN 0.9.6
+ ==========================
+ 
+ This release is a temporary measure, needed primarily to support the
+ upcoming release 0.9.2 of the Python programming language.  It is
+ still lacking complete and up-to-date documentation.
+ 
+ For those who are familiar with STDWIN 0.9.5, here is a summary of the
+ main changes in version 0.9.6 (of course, a number of bugs were also
+ fixed).
+ 
+ 
+ Overview of the changes
+ -----------------------
+ 
+ - Initialization is now separated in argument processing and actual
+   initialization.
+ - Scroll bars can be turned off with an option at window creation time.
+ - More inquiry functions, e.g., document size, window position.
+ - Filled and XOR mode drawing of circles and elliptical arcs.
+ - Polygon drawing (filled, outline and XOR).
+ - Color drawing.
+ - Modifier keys (control, shift, meta etc.) are passed in mouse events.
+ - Closing a window is now indicated by a separate event, WE_CLOSE.
+ - New event type WE_KEY reports non-ASCII keys and keys with modifiers.
+ 
+ The new calls are documented the following sections.
+ 
+ 
+ New Initialization Calls
+ ------------------------
+ 
+ Some window systems (like X11) have a standard set of command line
+ options that support overriding defaults by the end user.  The new
+ function wargs() parses the command line options and saves them for
+ later use by winit() and wopen().
+ 
+ void wargs(int *p_argc, char ***p_argv);
+ 
+ This function should be called before winit(), as early as possible
+ during the execution of main(), passing it the addresses of main's
+ arguments argc and argv.  It may modify argc and argv to reflect the
+ extraction of recognized options.
+ 
+ The application's argument parser does not have to worry about
+ conflicting options, as long as it uses the getopt() interface to
+ parse its own options.  On the Mac, this function initializes argc and
+ argv from the program arguments passed by the Finder; if the
+ application is called from the Finder's Print menu entry, the first
+ argument will be the string "-p".
+ 
+ If the application decides not to call winit() after it has called
+ wargs(), it need not call wdone() before exiting.  If wargs() has not
+ been called when winit() is called, system-defined defaults are
+ assumed.  On X11, resources can still be specified for such
+ applications; the program name is assumed to be "stdwin" and its class
+ "Stdwin", unless the RESOURCE_NAME environment variable is set.
+ 
+ void winitargs(int *p_argc, char ***p_argv);
+ 
+ This is equivalent to a call to wargs(p_argc, p_argv) followed by a
+ call to winit().
+ 
+ 
+ Scroll Bars Made Optional
+ -------------------------
+ 
+ It is now possible to specify whether a window should have scroll
+ bars.  This must be specified before the window is created and cannot
+ be changed once it is created.  By default, windows will have a
+ vertical scroll bar but no horizontal scroll bar.
+ 
+ void wsetdefscrollbars(int need_hbar, int need_vbar);
+ 
+ Specifies which scroll bars will be present on subsequently created
+ windows.  If need_hbar is nonzero, new windows will be created with
+ horizontal scroll bars; if need_vbar is nonzero, new windows will be
+ created with vertical scroll bars.
+ 
+ void wgetdefscrollbars(int *need_hbar_return, *need_vbar_return);
+ 
+ Returns the current status of the scroll bar creation flags set by
+ wsetdefscrollbars() through its arguments.
+ 
+ Note that even if they are present, scroll bars are only activated
+ when the document size in their direction is set to a value larger
+ than the window size.
+ 
+ 
+ More Inquiry Functions
+ ----------------------
+ 
+ void wgetdefwinsize(int *width_return, int *height_return);
+ 
+ Return the default initial size for new windows, as set by
+ wsetdefwinsize().  Zero or negative values mean that a
+ system-dependent default method is used to find an initial size for
+ the window, e.g., interactive sizing.
+ 
+ void wgetdefwinpos(int *h_return, int *v_return);
+ 
+ Return the default initial position for new windows, as set by
+ wsetdefwinpos().  Zero or negative values mean that a system-dependent
+ default method is used to find an initial position for the window,
+ e.g., interactive placement.
+ 
+ void wgetwinpos(WINDOW *win, int *h_return, int *v_return);
+ 
+ Return the current window position on the screen.  Together with
+ wgetwinsize() this can be used to save a window's geometry and
+ recreate it in the same state at a later time.
+ 
+ 
+ Color Drawing
+ -------------
+ 
+ It is now possible to draw images in multiple colors, if the display
+ hardware allows this.  The model uses the notion of current foreground
+ and background colors.  Because different color hardware operates very
+ differently, the number of different colors and the way they are
+ selected is left unspecified by STDWIN.
+ 
+ A type COLOR is defined, which is some kind of (long) integer
+ representing a color value; suitable values can be extracted by name
+ from an external color database.  Applications that know on which
+ hardware they run may cheat, as the values of type COLOR will be
+ indexes into the color table or directly encode RGB value, but this
+ obviously restricts the application's portability.
+ 
+ Applications can only assume the presence of colors named white and
+ black; on monochrome displays, these are all there is.  Otherwise,
+ some standard colors are supposed to be available everywhere: gray25
+ (dark grey), gray50 (middle gray), gray75 (light gray), red, green,
+ blue, yellow, magenta, cyan.  There are also some pseudo color names
+ that may be assigned defaults by the end user: foreground, background,
+ primary, secondary, selection, hilight.  Some monochrome
+ implementations (especially the Mac) attempt to simulate a few gray
+ levels with fill patterns, but only as foreground color.  On X11,
+ color names are looked up in the server's color database; the notation
+ #RGB, #RRGGBB (etc.) is also recognized.
+ 
+ Each window has default foreground and background colors, which are in
+ effect immediately after wbegindrawing() and initially in draw
+ procedures.  These default colors are specified by calling
+ wsetfgcolor() and wsetbgcolor() outside drawing mode before creating a
+ window.  These colors may also be used to draw a window's
+ ornamentation such as scroll bars and menus; before a draw procedure
+ is called, the update area is cleared to the window's default
+ background color.
+ 
+ Two drawing functions are unsafe when color is used: winvert() and
+ wxorline().  For all affected pixels, these are guaranteed to
+ correctly swap the current foreground and background colors, but other
+ colors are swapped with arbitrary colors, giving an undefined effect.
+ Inverting the pixels once more (with the same foreground and
+ background colors in effect!) will return them to their original
+ colors, however.
+ 
+ Swapping the foreground and background colors has the effect of
+ drawing in inverse video; HOWEVER, this is not supported by the
+ termcap (alphanumeric) version of STDWIN, which bluntly ignores all
+ color requests.
+ 
+ typedef ... COLOR;
+ 
+ This type represents a color value.  It is one of C's integral types,
+ so it is possible (and useful!) to declare variables of type COLOR.
+ 
+ COLOR wfetchcolor(char *colorname);
+ 
+ Look the color name up in the external database of color definitions
+ and return a color value for it, if possible.  If the color is not
+ found in the database or no more color values are available (this
+ happens easily on systems with small color tables), the color value
+ for the default foreground is returned.
+ 
+ void wsetfgcolor(COLOR color);
+ 
+ Set the current foreground color.  In drawing mode, set the foreground
+ color used for drawing; outside drawing mode, set the default
+ foreground color for windows created subsequently.
+ 
+ void wsetbgcolor(COLOR color);
+ 
+ Set the current background color.  Similar to wsetfgcolor().
+ 
+ COLOR wgetfgcolor();
+ 
+ Return the current foreground color, as set by wsetfgcolor() or from a
+ system-defined default.
+ 
+ COLOR wgetbgcolor().
+ 
+ Return the current background color.  Similar to wgetfgcolor().
+ 
+ 
+ Filled and Xor'ed Circles and Arcs
+ ----------------------------------
+ 
+ void wfillcircle(int h, int v, int radius);
+ 
+ Fills a circle with given center and radius.
+ 
+ void wxorcircle(int h, int v, int radius);
+ 
+ Inverts a circle with given center and radius.
+ 
+ void wfillelarc(int h, int v, int hrad, int vrad, int angle1, int angle2);
+ 
+ Fills a segment of an elliptical arc defined by the parameters as for
+ wdrawelarc.
+ 
+ void wxorelarc(int h, int v, int hrad, int vrad, int angle1, int  angle2);
+ 
+ Inverts an elliptical arc defined by the parameters as for wdrawelarc.
+ 
+ 
+ Polygons
+ --------
+ 
+ There is a way to draw arbitrary polygon shapes.
+ 
+ typedef struct { short h, v; } POINT;
+ 
+ This type is used to pass an array of points to the polygon routines.  
+ Coordinates are specified as shorts so certain STDWIN versions 
+ (especially the X11 version) can pass arrays of coordinates to routines 
+ of the underlying window system without copying them.
+ 
+ void wdrawpoly(int n, POINT points[]);
+ 
+ Draws n-1 line segments given by n points: from points[0] to points[1], 
+ from points[1] to points[2], etc., and finally from points[n-2] to 
+ points[n-1].
+ 
+ void wfillpoly(int n, POINT points[]);
+ 
+ Fills polygon defined by n points.  If points[n-1] does not equal 
+ points[0], an additional line segment closing the polygon shape from 
+ points[n-1] to points[0] is implied.  The polygon may intersect itself.
+ 
+ void wxorpoly(int n, POINT points[]);
+ 
+ Inverts a filled polygon.  The polygon is defined as for wfillpoly().
+ 
+ 
+ Modifier Keys in Mouse Events
+ -----------------------------
+ 
+ The u.where.mask member of the EVENT structure now has a different
+ meaning.  It reports the modifier keys that were pressed at the time
+ the event was generated.  The following constants define bit masks for
+ various modifier keys:
+ 
+ #define WM_SHIFT	(1 << 0)
+ #define WM_LOCK		(1 << 1)
+ #define WM_CONTROL	(1 << 2)
+ #define WM_META		(1 << 3)
+ #define WM_OPTION	(1 << 4)
+ #define WM_NUM		(1 << 5)
+ 
+ On the Mac, WM_META corresponds to the Command modifier.  In X11,
+ WM_META is really "Modifier 3", commonly bound to the Meta or Alt key;
+ WM_OPTION and WM_NUM are not normally reported in X11 so their use is
+ not portable.
+ 
+ 
+ The WE_CLOSE Event
+ ------------------
+ 
+ To simplify event decoding somewhat, a user's close request is now
+ reported as an event (WE_CLOSE) rather than a subcode (WC_CLOSE) of
+ the WE_COMMAND event.  All WE_COMMAND subcodes now report special
+ keys.
+ 
+ 
+ The WE_KEY Event
+ ----------------
+ 
+ If a key is pressed together with the Meta key that is not a menu
+ shortcut, it is reported as a WE_KEY event.  This event uses the union
+ member u.key which has members code and mask.  The member u.key.code
+ specifies the ASCII code of the key; u.key.mask specifies the
+ modifiers that were pressed with the key.
*** 0.9.5/Gen/waskfile.c	Mon Oct 22 10:31:09 1990
--- stdwin/Gen/waskfile.c	Tue May 14 13:02:26 1991
***************
*** 10,15 ****
--- 10,17 ----
     and if it already exists confirmation is asked;
     if 'new' is FALSE, it should exist. */
  
+ /* XXX This should also refuse to open directories */
+ 
  bool
  waskfile(prompt, buf, len, new)
  	char *prompt;
***************
*** 23,36 ****
  		if (new) {
  			if (access(buf, NOMODE) >= 0) {	/* Existing file */
  				if (access(buf, WMODE) >= 0) {
! 					switch (waskync("Overwrite? [ny]", 0)) {
  					case -1:	return FALSE;
  					case 1:		return TRUE;
  					}
- 					wmessage("Try again.");
  				}
  				else
! 					wmessage("No write permission.");
  			}
  			else {
  				char *p= strrchr(buf, SEP);
--- 25,38 ----
  		if (new) {
  			if (access(buf, NOMODE) >= 0) {	/* Existing file */
  				if (access(buf, WMODE) >= 0) {
! 					switch (waskync(
! 					    "Overwrite existing file?", 0)) {
  					case -1:	return FALSE;
  					case 1:		return TRUE;
  					}
  				}
  				else
! 					wmessage("No write permission");
  			}
  			else {
  				char *p= strrchr(buf, SEP);
***************
*** 45,59 ****
  						return TRUE;
  					}
  				}
! 				wmessage("Can't create file.");
  			}
  		}
  		else {
  			if (access(buf, RMODE) >= 0)
  				return TRUE;
! 			wmessage("File not found.");
  		}
- 		wfleep();
  		break;
  	}
  	return FALSE;
--- 47,60 ----
  						return TRUE;
  					}
  				}
! 				wmessage("Can't create file");
  			}
  		}
  		else {
  			if (access(buf, RMODE) >= 0)
  				return TRUE;
! 			wmessage("File not found");
  		}
  		break;
  	}
  	return FALSE;
*** 0.9.5/H/stdwin.h	Tue Feb 19 10:45:40 1991
--- stdwin/H/stdwin.h	Tue May 28 22:52:30 1991
***************
*** 52,57 ****
--- 52,59 ----
  		} where;
  	/* case WE_LOST_SEL: */
  		int sel;
+ 	/* case WE_KEY: */
+ 		struct { int code; int mask; } key;
  	} u;
  };
  
***************
*** 75,81 ****
  #define WE_TIMER	11	/* Window's timer went off */
  #define WE_DEACTIVATE	12	/* Window became inactive */
  #define WE_EXTERN	13	/* Externally generated event (Amoeba) */
! #define WE_KEY		14	/* Low-level key event (reserved) */
  #define WE_LOST_SEL	15	/* Lost selection */
  #define WE_CLOSE	16	/* User wants to close window */
  
--- 77,83 ----
  #define WE_TIMER	11	/* Window's timer went off */
  #define WE_DEACTIVATE	12	/* Window became inactive */
  #define WE_EXTERN	13	/* Externally generated event (Amoeba) */
! #define WE_KEY		14	/* Non-ASCII key event */
  #define WE_LOST_SEL	15	/* Lost selection */
  #define WE_CLOSE	16	/* User wants to close window */
  
***************
*** 83,89 ****
  /* Special keys reported by WE_COMMAND */
  /* XXX Should become key events */
  
! #define WC_CLOSE	1	/* Now a separate event! */
  /* The following four are arrow keys */
  #define WC_LEFT		2
  #define WC_RIGHT	3
--- 85,91 ----
  /* Special keys reported by WE_COMMAND */
  /* XXX Should become key events */
  
! #define WC_CLOSE	1	/* Obsolete */
  /* The following four are arrow keys */
  #define WC_LEFT		2
  #define WC_RIGHT	3
***************
*** 119,124 ****
--- 121,146 ----
  #define WS_SECONDARY	2
  
  
+ /* Masks for EVENT->u.where.mask and EVENT->u.key.mask.
+    Some of these happen to be the same as the X11 masks (which are cast
+    in stone for eternity); the implementation relies on that.
+    (It is merely a convention that Meta is bit 3, and Option/Num aren't
+    normally used in X11.) */
+ 
+ #define WM_SHIFT	(1 << 0)
+ #define WM_LOCK		(1 << 1)
+ #define WM_CONTROL	(1 << 2)
+ #define WM_META		(1 << 3)
+ #define WM_OPTION	(1 << 4)
+ #define WM_NUM		(1 << 5)
+ 
+ #define WM_BUTTON1	(1 << 8)
+ #define WM_BUTTON2	(1 << 9)
+ #define WM_BUTTON3	(1 << 10)
+ #define WM_BUTTON4	(1 << 11)
+ #define WM_BUTTON5	(1 << 12)
+ 
+ 
  /* TEXTATTR struct */
  
  /* The contents of a text attributes struct are disclosed here because
***************
*** 134,139 ****
--- 156,174 ----
  #define TEXTATTR struct _textattr
  
  
+ /* Color */
+ 
+ #define COLOR long
+ 
+ 
+ /* Point type for wdrawpoly and wfillpoly -- compatible with X */
+ 
+ struct _point {
+ 	short h, v;
+ };
+ #define POINT struct _point
+ 
+ 
  /*************************************/
  /* Section 2.  Function declarations */
  /*************************************/
***************
*** 146,157 ****
  
  void wgetscrsize _ARGS((int *pwidth, int *pheight));
  void wgetscrmm _ARGS((int *pmmwidth, int *pmmheight));
  
  void wsetmaxwinsize _ARGS((int width, int height));
  void wsetdefwinsize _ARGS((int width, int height));
- void wsetdefwinpos _ARGS((int h, int v));
  void wgetdefwinsize _ARGS((int *pwidth, int *pheight));
  void wgetdefwinpos _ARGS((int *ph, int *pv));
  
  WINDOW *wopen _ARGS((char *title,
  		void (*drawproc)(/*WINDOW *win,
--- 181,195 ----
  
  void wgetscrsize _ARGS((int *pwidth, int *pheight));
  void wgetscrmm _ARGS((int *pmmwidth, int *pmmheight));
+ int wgetmouseconfig _ARGS((void));
  
  void wsetmaxwinsize _ARGS((int width, int height));
  void wsetdefwinsize _ARGS((int width, int height));
  void wgetdefwinsize _ARGS((int *pwidth, int *pheight));
+ void wsetdefwinpos _ARGS((int h, int v));
  void wgetdefwinpos _ARGS((int *ph, int *pv));
+ void wsetdefscrollbars _ARGS((/*bool*/int hbar, /*bool*/int vbar));
+ void wgetdefscrollbars _ARGS((/*bool*/int *phbar, /*bool*/int *pvbar));
  
  WINDOW *wopen _ARGS((char *title,
  		void (*drawproc)(/*WINDOW *win,
***************
*** 162,167 ****
--- 200,206 ----
  void wsetactive _ARGS((WINDOW *win));
  WINDOW *wgetactive _ARGS((void));
  void wgetwinsize _ARGS((WINDOW *win, int *width, int *height));
+ void wgetwinpos _ARGS((WINDOW *win, int *h, int *v));
  void wsetdocsize _ARGS((WINDOW *win, int width, int height));
  void wgetdocsize _ARGS((WINDOW *win, int *width, int *height));
  void wsettitle _ARGS((WINDOW *win, char *title));
***************
*** 210,223 ****
  
  void wdrawline _ARGS((int h1, int v1, int h2, int v2));
  void wxorline _ARGS((int h1, int v1, int h2, int v2));
! void wdrawcircle _ARGS((int h, int v, int radius));
! void wdrawelarc _ARGS((int h, int v, int hrad, int vrad, int ang1, int ang2));
  void wdrawbox _ARGS((int left, int top, int right, int bottom));
- void werase _ARGS((int left, int top, int right, int bottom));
  void wpaint _ARGS((int left, int top, int right, int bottom));
  void winvert _ARGS((int left, int top, int right, int bottom));
  void wshade _ARGS((int left, int top, int right, int bottom, int percent));
  
  void wcliprect _ARGS((int left, int top, int right, int bottom));
  void wnoclip _ARGS((void));
  
--- 249,273 ----
  
  void wdrawline _ARGS((int h1, int v1, int h2, int v2));
  void wxorline _ARGS((int h1, int v1, int h2, int v2));
! 
  void wdrawbox _ARGS((int left, int top, int right, int bottom));
  void wpaint _ARGS((int left, int top, int right, int bottom));
  void winvert _ARGS((int left, int top, int right, int bottom));
+ void werase _ARGS((int left, int top, int right, int bottom));
  void wshade _ARGS((int left, int top, int right, int bottom, int percent));
  
+ void wdrawcircle _ARGS((int h, int v, int radius));
+ void wfillcircle _ARGS((int h, int v, int radius));
+ void wxorcircle _ARGS((int h, int v, int radius));
+ 
+ void wdrawelarc _ARGS((int h, int v, int hrad, int vrad, int ang1, int ang2));
+ void wfillelarc _ARGS((int h, int v, int hrad, int vrad, int ang1, int ang2));
+ void wxorelarc _ARGS((int h, int v, int hrad, int vrad, int ang1, int ang2));
+ 
+ void wdrawpoly _ARGS((int n, POINT points[]));
+ void wfillpoly _ARGS((int n, POINT points[]));
+ void wxorpoly _ARGS((int n, POINT points[]));
+ 
  void wcliprect _ARGS((int left, int top, int right, int bottom));
  void wnoclip _ARGS((void));
  
***************
*** 244,249 ****
--- 294,306 ----
  
  void wsetfont _ARGS((char *fontname));
  void wsetsize _ARGS((int pointsize));
+ 
+ /* Colors */
+ COLOR wfetchcolor _ARGS((char *colorname));
+ void wsetfgcolor _ARGS((COLOR color));
+ COLOR wgetfgcolor _ARGS((void));
+ void wsetbgcolor _ARGS((COLOR color));
+ COLOR wgetbgcolor _ARGS((void));
  
  /* Setting the mouse cursor for a window */
  CURSOR *wfetchcursor _ARGS((char *name));
*** 0.9.5/H/stdwtext.h	Tue Feb 19 10:45:44 1991
--- stdwin/H/stdwtext.h	Tue May 28 22:53:37 1991
***************
*** 18,23 ****
--- 18,26 ----
  void temovenew _ARGS((TEXTEDIT *tp,
  	int left, int top, int right, int bottom));
  
+ void tesetview _ARGS((TEXTEDIT *tp, int left, int top, int right, int bottom));
+ void tenoview _ARGS((TEXTEDIT *tp));
+ 
  void tesetfocus _ARGS((TEXTEDIT *tp, int foc1, int foc2));
  void tereplace _ARGS((TEXTEDIT *tp, char *str));
  void tesetbuf _ARGS((TEXTEDIT *tp, char *buf, int buflen));
*** 0.9.5/H/tools.h	Tue Feb 19 10:45:51 1991
--- stdwin/H/tools.h	Sun Apr  7 16:59:13 1991
***************
*** 29,35 ****
--- 29,42 ----
  #define VOID_PTR
  #endif
  
+ #ifdef AMOEBA
+ /* Amoeba has its own way of telling which one we want: */
+ #ifndef VOIDSTAR
+ #define VOID_PTR
+ #endif
+ #endif
  
+ 
  /*********************/
  /* Universal pointer */
  /*********************/
***************
*** 80,85 ****
--- 87,94 ----
  #include <stdlib.h>
  
  #else
+ 
+ #include <sys/types.h> /* For size_t -- hope it doesn't break other things */
  
  UNIVPTR malloc _ARGS((size_t));
  UNIVPTR calloc _ARGS((size_t, size_t));
*** 0.9.5/H/vtrm.h	Thu Oct 18 13:55:08 1990
--- stdwin/H/vtrm.h	Tue Apr 23 15:59:43 1991
***************
*** 1,3 ****
--- 1,5 ----
+ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1991. */
+ 
  /*
   * Terminal capabilities.  These correspond to bits set by trmstart in its
   * parameter flags parameter.
***************
*** 6,12 ****
  #define HAS_STANDOUT	1	/* Terminal has inverse video or underline */
  #define CAN_SCROLL	2	/* Terminal can insert/delete lines */
  #define CAN_OPTIMISE	4	/* Terminal can insert/delete characters */
- #define CAN_SENSE	8	/* Terminal can send cursor position */
  
  /*
   * Error codes returned by trmstart.
--- 8,13 ----
***************
*** 17,22 ****
  #define TE_NOTERM	2	/* $TERM not set or empty */
  #define TE_BADTERM	3	/* $TERM not found in termcap database */
  #define TE_DUMB		4	/* Terminal too dumb */
! #define TE_NOTTY	5	/* Stdout not a tty device */
  #define TE_NOMEM	6	/* Can't get enough memory */
! #define TE_OTHER	7	/* This and higher are reserved errors */
--- 18,32 ----
  #define TE_NOTERM	2	/* $TERM not set or empty */
  #define TE_BADTERM	3	/* $TERM not found in termcap database */
  #define TE_DUMB		4	/* Terminal too dumb */
! #define TE_NOTTY	5	/* Stdin not a tty or cannot open "/dev/tty" */
  #define TE_NOMEM	6	/* Can't get enough memory */
! #define TE_BADSCREEN	7	/* Bad $SCREEN */
! #define TE_OTHER	8	/* This and higher are reserved errors */
! 
! /*
!  * Possible modes; only standout is currently implemented.
!  */
! 
! #define PLAIN           0       /* normal characters */
! #define STANDOUT        1       /* in inverse video */
! #define UNDERLINE       2       /* underlined */



More information about the Alt.sources mailing list