[comp.sources.x] v02i019: draw and edit diagrams, figures, and pictures, Patch1

mikew@wyse.wyse.com (Mike Wexler) (11/24/88)

Submitted-by: Mark Moraes <moraes%csri.toronto.edu@RELAY.CS.NET>
Posting-number: Volume 2, Issue 19
Archive-name: xpic/patch2

[I couldn't get this to work, but I am posting it anyway.  I ran into
two problems.  One is that the X11 includes need to be in the default
search path of the preprocessor, if they aren't you need to modify the
Imakefile.  Second, it blows up with a "BadFont, invalid Font parameter."]


#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# If this archive is complete, you will see the following message at the end:
#		"End of shell archive."
#
# Contents:
#   CHANGES update.sh
#
# Wrapped by moraes@csri.toronto.edu on Thu Nov 17 04:24:11 1988
#
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f CHANGES -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"CHANGES\"
else
echo shar: Extracting \"CHANGES\" \(1019 characters\)
sed "s/^X//" >CHANGES <<'END_OF_CHANGES'
XFirst, make sure you have the HP widgets working. (See the related Xhp
Xupdate which I've posted to comp.sources.x and which should be in the
Xcontrib directory on expo.lcs.mit.edu)
X
XThe changes have two components - 
X
X- Small changes to the Imakefile, Minibuf.c and windows.c to get them
Xworking under R3. (actually, with the R2 Xt and Xw distributed with
XR3. A couple more changes will be needed to this when the R3 HP
Xwidgets make an appearance)
X
X- A set of changes/improvements/newfiles which make it possible to
Xconvert from xpic to tpic (the pic preprocessor for TeX). See doc/tex
Xfor more info.
X
Xupdate.sh makes the necessary changes after you fix the TOPDIR
Xvariable to reflect the top level directory of X11R3 core source. Note
Xthat the Form* and PButton.c files which were cannibalized from the
Xbeta HP widgets are no longer needed, so update.sh removes them.
X
XR3 xpic has only been seen working on Suns, which are the only
Xplatform I have running R3. Shouldn't be a problem on other
Xplatforms... (Ha!)
X
XEnjoy.
END_OF_CHANGES
if test 1019 -ne `wc -c <CHANGES`; then
    echo shar: \"CHANGES\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f update.sh -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"update.sh\"
else
echo shar: Extracting \"update.sh\" \(35331 characters\)
sed "s/^X//" >update.sh <<'END_OF_update.sh'
X#! /bin/sh -x
X# Edit this to change this to the top directory where your X11R3 source is
X# something like /usr/src/local/X.V11R3
XTOPDIR=please/change/this/to/the/real/X/top/level/directory
Xif test ! \( -d $TOPDIR -a -d $TOPDIR/util -a -d $TOPDIR/util/scripts \) ; then
X	echo 'Please fix TOPDIR and run this script again'
X	exit 1
Xelif test ! -x $TOPDIR/util/scripts/ximake.sh ; then
X	echo Something wrong - $TOPDIR/util/scripts/ximake.sh isn\'t executable
X	exit 1
Xfi
Xif test ! \( -f xpic.c -a -f xpic.manX -a -d fontdesc \) ; then
X	echo 'Please run this script in the xpic directory'
X	exit 1
Xfi
X# If you're nervous, you may want to keep these around. They're
X# not needed - the HP widgets are now ever so much nicer...
Xrm -f Form.c Form.fix Form.h FormP.h PButton.c
Xpatch -p1 << \WhAt_A_mArOoN
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/Imakefile xpic/Imakefile
X*** /h/xwindows/X/contrib/clients/xpic/Imakefile	Thu Sep  1 00:43:46 1988
X--- xpic/Imakefile	Tue Nov 15 03:49:48 1988
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ XWSRC=$(CONTRIBSRC)/widgets/Xhp
X  XPICLIBDIR=$(LIBDIR)/xpic
X  # The documents go in $(DOCDIR)/xpic - see the install target. 
X  # At CSRI, we use a logical link to the source, so we don't 
X***************
X*** 4,10 ****
X  # install this. You must still keep this accurate, because 
X  # it's put into the man page. Change the install target appropriately.
X  #DOCDIR=/nfs/church/csri5/doc/local
X! DOCDIR=/ai/doc/X11
X  # the directory in which xpic saves the current buffer 
X  # in case it dies on a signal
X  DUMPDIR=/tmp
X--- 5,11 ----
X  # install this. You must still keep this accurate, because 
X  # it's put into the man page. Change the install target appropriately.
X  #DOCDIR=/nfs/church/csri5/doc/local
X! DOCDIR=/local/doc/X11
X  # the directory in which xpic saves the current buffer 
X  # in case it dies on a signal
X  DUMPDIR=/tmp
X***************
X*** 27,33 ****
X  #############################################################
X  CDEBUGFLAGS = -g
X  #CDEBUGFLAGS = -O
X! INCLUDES =  -I$(TOOLKITSRC) -I$(TOP) -Ibitmaps
X  CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X  LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X  #############################################################
X--- 28,34 ----
X  #############################################################
X  CDEBUGFLAGS = -g
X  #CDEBUGFLAGS = -O
X! INCLUDES =  -I$(XWSRC) -Ibitmaps
X  CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X  LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X  #############################################################
X***************
X*** 37,45 ****
X  # These should be defined in an Imake.tmpl - except that the 
X  # normal Imake.tmpl insists on these being compiled in the 
X  # X directory tree.
X! XWLIB=$(USRLIBDIR)/libXw.a
X! XTOOLLIB=$(USRLIBDIR)/libXt.a
X! XLIB=$(USRLIBDIR)/libX11.a
X  # Sigh - we use sin(), cos(), atan2() for arrow. 
X  MATHLIB=-lm
X  #############################################################
X--- 38,48 ----
X  # These should be defined in an Imake.tmpl - except that the 
X  # normal Imake.tmpl insists on these being compiled in the 
X  # X directory tree.
X! # For X11R3, the HP widgets use the R2 Intrinsics, which are
X! # provided in with the HP src.
X! XWLIB=$(XWSRC)/lib/libXw.a
X! XTOOLLIB=$(XWSRC)/lib/libXt.a
X! #XLIB=$(USRLIBDIR)/libX11.a
X  # Sigh - we use sin(), cos(), atan2() for arrow. 
X  MATHLIB=-lm
X  #############################################################
X***************
X*** 51,57 ****
X  #MALLOC = malloc.o
X  MALLOC = 
X  #############################################################
X! MYXTSTUFF = Form.o PButton.o
X  #############################################################
X  OBJS1 = main.o windows.o xpic.o handlers.o input.o  \
X  		event.o grid.o error.o spline.o arrow.o newfonts.o \
X--- 54,60 ----
X  #MALLOC = malloc.o
X  MALLOC = 
X  #############################################################
X! MYXTSTUFF = # Form.o PButton.o
X  #############################################################
X  OBJS1 = main.o windows.o xpic.o handlers.o input.o  \
X  		event.o grid.o error.o spline.o arrow.o newfonts.o \
X***************
X*** 71,77 ****
X  OBJS3 = x2ps.o hash.o
X  SRCS3 = x2ps.c hash.c
X  #############################################################
X! PROGRAMS = xpic x2ps x2pic
X  
X  .SUFFIXES: .manX .man
X  
X--- 74,83 ----
X  OBJS3 = x2ps.o hash.o
X  SRCS3 = x2ps.c hash.c
X  #############################################################
X! OBJS4 = x2tpic.o xtp.o hash.o
X! SRCS4 = x2tpic.c xtp.c hash.c
X! #############################################################
X! PROGRAMS = xpic x2ps x2pic x2tpic
X  
X  .SUFFIXES: .manX .man
X  
X***************
X*** 80,85 ****
X--- 86,93 ----
X  	    -e 's?XPICLIBDIR?$(XPICLIBDIR)?g' $*.manX > $*.man
X  
X  ComplexProgramTarget_1(xpic,$(MYXTSTUFF) $(MALLOC) $(XWLIB) $(XTOOLLIB) $(XLIB),$(MATHLIB))
X+ /* Imake rules allow for only 3 SRCS */
X+ SRCS = $(SRCS1) $(SRCS2) $(SRCS3) $(SRCS4)
X  
X  SingleProgramTarget(x2pic,$(OBJS2) $(MALLOC),,)
X  InstallProgram(x2ps, $(BINDIR))
X***************
X*** 89,102 ****
X  InstallProgram(x2pic, $(BINDIR))
X  InstallManPage(x2pic, $(MANDIR))
X  
X  lint:
X  	lint -abz $(SRCS1) $(LDFLAGS) -lXw -lXt -lX11 -lm $(LINTFLAGS)
X  	lint -abz $(SRCS2) $(LDFLAGS) $(LINTFLAGS)
X  	lint -abz $(SRCS3) $(LDFLAGS) -lm $(LINTFLAGS)
X  
X  
X  clean::
X! 	$(RM) tune.h.new xpic.man x2ps.man x2pic.man
X  #	cd fontstuff/vfontscale; make clean
X  
X  id: tags
X--- 97,118 ----
X  InstallProgram(x2pic, $(BINDIR))
X  InstallManPage(x2pic, $(MANDIR))
X  
X+ SingleProgramTarget(x2tpic,$(OBJS4) $(MALLOC),,)
X+ InstallProgram(x2tpic, $(BINDIR))
X+ InstallManPage(x2tpic, $(MANDIR))
X+ 
X+ InstallScript(x2tex, $(BINDIR))
X+ InstallManPage(x2tex, $(MANDIR))
X+ 
X  lint:
X  	lint -abz $(SRCS1) $(LDFLAGS) -lXw -lXt -lX11 -lm $(LINTFLAGS)
X  	lint -abz $(SRCS2) $(LDFLAGS) $(LINTFLAGS)
X  	lint -abz $(SRCS3) $(LDFLAGS) -lm $(LINTFLAGS)
X+ 	lint -abz $(SRCS4) $(LDFLAGS) $(LINTFLAGS)
X  
X  
X  clean::
X! 	$(RM) tune.h.new xpic.man x2ps.man x2pic.man x2tpic.man x2tex.man
X  #	cd fontstuff/vfontscale; make clean
X  
X  id: tags
X***************
X*** 109,114 ****
X--- 125,131 ----
X  	-mkdir $(XPICLIBDIR)/fontdesc
X  	$(INSTALL) $(INSTAPPFLAGS) fontdesc/xpic $(XPICLIBDIR)/fontdesc
X  	$(INSTALL) $(INSTAPPFLAGS) fontdesc/x2pic $(XPICLIBDIR)/fontdesc
X+ 	$(INSTALL) $(INSTAPPFLAGS) fontdesc/x2tpic $(XPICLIBDIR)/fontdesc
X  	$(INSTALL) $(INSTAPPFLAGS) fontdesc/x2ps $(XPICLIBDIR)/fontdesc
X  
X  install::
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/Minibuf.c xpic/Minibuf.c
X*** /h/xwindows/X/contrib/clients/xpic/Minibuf.c	Wed Aug 31 23:39:29 1988
X--- xpic/Minibuf.c	Sat Nov 12 21:39:58 1988
X***************
X*** 1,4 ****
X! /* $Header: Minibuf.c,v 1.2 88/08/31 23:38:37 moraes Exp $ */
X  /*
X   *  This file should be edited with 4-column tabs!  (:set ts=4 sw=4 in
X   *  vi, set internal-tabstop 4 in Jove, and use edit-tab-stops in Emacs
X--- 1,4 ----
X! /* $Header: Minibuf.c,v 1.1 88/08/18 23:53:53 moraes Exp $ */
X  /*
X   *  This file should be edited with 4-column tabs!  (:set ts=4 sw=4 in
X   *  vi, set internal-tabstop 4 in Jove, and use edit-tab-stops in Emacs
X***************
X*** 79,85 ****
X  #define BUF_BLOCK 		128
X  
X  #define MIN_COLS 		5
X! #define DEFAULTFONT		"Fixed"
X  #define ABORT_MSG		"[Aborted]"
X  #define DELAY			300000		/*
X  									 *  Microseconds of delay for cursor
X--- 79,85 ----
X  #define BUF_BLOCK 		128
X  
X  #define MIN_COLS 		5
X! #define DEFAULTFONT		"8x13"
X  #define ABORT_MSG		"[Aborted]"
X  #define DELAY			300000		/*
X  									 *  Microseconds of delay for cursor
X***************
X*** 170,176 ****
X  	{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
X  	 offset(minibuf.foreground), XtRString, "Black"},
X  	{XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X! 	 offset(minibuf.finfo),XtRString, "Fixed"},
X  	{XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
X  	 offset(minibuf.cursor), XtRString, "xterm"},
X  	{XtNfinishedCallback, XtCCallback, XtRCallback, sizeof(XtProc),
X--- 170,176 ----
X  	{XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
X  	 offset(minibuf.foreground), XtRString, "Black"},
X  	{XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
X! 	 offset(minibuf.finfo),XtRString, DEFAULTFONT},
X  	{XtNcursor, XtCCursor, XtRCursor, sizeof(Cursor),
X  	 offset(minibuf.cursor), XtRString, "xterm"},
X  	{XtNfinishedCallback, XtCCallback, XtRCallback, sizeof(XtProc),
X***************
X*** 257,264 ****
X  		mcore(height) = fontheight(mbuf(finfo));
X  
X  	if (mbuf(finfo)->per_char != NULL) {
X  		/* default font since we must have a fixed width font */
X! 		XtConvert(new, XtRString, (XrmValuePtr) DEFAULTFONT,
X  		 XtRFontStruct, (XrmValuePtr) mbuf(finfo));
X  #ifdef DEBUG
X  		fprintf(stderr, "Need fixed font - falling back on default \"%s\"\n",
X--- 257,267 ----
X  		mcore(height) = fontheight(mbuf(finfo));
X  
X  	if (mbuf(finfo)->per_char != NULL) {
X+ 		XrmValue value;
X+ 		value.size = sizeof(DEFAULTFONT);
X+ 		value.addr = DEFAULTFONT;
X  		/* default font since we must have a fixed width font */
X! 		XtConvert(new, XtRString, &value,
X  		 XtRFontStruct, (XrmValuePtr) mbuf(finfo));
X  #ifdef DEBUG
X  		fprintf(stderr, "Need fixed font - falling back on default \"%s\"\n",
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/README xpic/README
X*** /h/xwindows/X/contrib/clients/xpic/README	Mon Sep 19 10:14:52 1988
X--- xpic/README	Tue Nov 15 01:37:05 1988
X***************
X*** 10,30 ****
X  
X  4. make.
X  
X! 5. To test it, copy the file xpic.fontdesc to ~/.xpic.fontdesc, 
X! run it with the command 
X  	xpic test/test.xpic 
X  
X! You should have already installed the fonts. Font installation right
X! now depends on xtroff fonts - but a font description files maps them
X! to their names scales them to the right size.
X  
X  6. make install.
X  
X! Notes:
X! You need to have the HP Widgets. 
X  
X! xpic has been tested very extensively under X10 on monochrome
X! and color Suns and reasonably thoroughly under X11 on uVaxen as well. 
X  
X  Bugs
X  ====
X--- 10,32 ----
X  
X  4. make.
X  
X! 5. To test it, copy the file fontdesc/xpic to ~/.xpic, run it with the
X! command 
X  	xpic test/test.xpic 
X  
X! You should have already installed the fonts. Font installation right now
X! depends on xtroff fonts - but a font description files maps them to their
X! names scales them to the right size. If you haven't installed the fonts, it
X! will still work, but with the occasional complaint. Even if you don't want
X! xtroff, cd there (../xtroff, hopefully) and do a 'make xfonts'.
X  
X  6. make install.
X  
X! Notes:  You need to have the HP Widgets. (At present, even for R3, these are
X! stil the R2 widgets, and can be compiled if careful. See the HP.NOTE.)
X  
X! xpic has been tested very extensively under X10 and X11R2 on monochrome
X! and color Suns and reasonably thoroughly under X11R2 on uVaxen as well. 
X  
X  Bugs
X  ====
X***************
X*** 45,55 ****
X  	Adjusting dashed lines/splines leaves the old segments around.
X  	They'll vanish on redisplay.
X  
X! If you do run into a bug, please tell me exactly what happened so I
X! can try to track it down - ideally, if you could narrow it down to a
X! reproducible set of actions, "when I edit this file, draw a spline,
X! undo that, draw a line, and then click the adjust buttons, the line
X! vanishes" would make it possible to fix the bug without divination!
X  
X  Please do send in bug reports - chances are that I'll be able to find
X  the bug a bit faster, unless it depends on specific peculiarities of
X--- 47,60 ----
X  	Adjusting dashed lines/splines leaves the old segments around.
X  	They'll vanish on redisplay.
X  
X! 	Rubberbanding thick objects is SLOOOOW, especially on Sun4/110s.
X! 	(which are slower in this operation than 3/50s!
X! 
X! If you do run into a bug, please tell me exactly what happened so I can try
X! to track it down - ideally, if you could narrow it down to a reproducible
X! set of actions, "when I edit this file, draw a spline, undo that, draw a
X! line, and then click the adjust buttons, the line vanishes" would make it
X! possible to fix the bug without divination!
X  
X  Please do send in bug reports - chances are that I'll be able to find
X  the bug a bit faster, unless it depends on specific peculiarities of
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/main.c xpic/main.c
X*** /h/xwindows/X/contrib/clients/xpic/main.c	Mon Sep 19 10:14:53 1988
X--- xpic/main.c	Tue Nov 15 02:47:26 1988
X***************
X*** 1,4 ****
X! /* $Header: main.c,v 1.2 88/08/19 00:00:38 moraes Exp $ */
X  #include <signal.h>
X  
X  #include "xpic.h"
X--- 1,4 ----
X! /* $Header: main.c,v 1.4 88/09/22 21:09:29 root Exp $ */
X  #include <signal.h>
X  
X  #include "xpic.h"
X***************
X*** 16,22 ****
X  #include "xpic.icon"
X  
X  #ifndef lint
X! static char rcsid[] = "$Header: main.c,v 1.2 88/08/19 00:00:38 moraes Exp $";
X  #endif
X  
X  static char dumpfile[64];
X--- 16,22 ----
X  #include "xpic.icon"
X  
X  #ifndef lint
X! static char rcsid[] = "$Header: main.c,v 1.4 88/09/22 21:09:29 root Exp $";
X  #endif
X  
X  static char dumpfile[64];
X***************
X*** 105,111 ****
X  	char buf[BUFSIZ];
X  
X  	if (swansong)	/* we're here again. better quit fast */
X! 		exit(-1);
X  	swansong++;
X  	sprintf(buf, "xpic received signal %d, code %d\n", sig, code);
X  	write(2, buf, strlen(buf));
X--- 105,111 ----
X  	char buf[BUFSIZ];
X  
X  	if (swansong)	/* we're here again. better quit fast */
X! 		_exit(-1);
X  	swansong++;
X  	sprintf(buf, "xpic received signal %d, code %d\n", sig, code);
X  	write(2, buf, strlen(buf));
XOnly in /h/xwindows/X/contrib/clients/xpic: make.out
XOnly in xpic: malloc.c
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/obj_circ.c xpic/obj_circ.c
X*** /h/xwindows/X/contrib/clients/xpic/obj_circ.c	Sat Aug 27 21:13:14 1988
X--- xpic/obj_circ.c	Mon Sep  5 01:30:04 1988
X***************
X*** 1,4 ****
X! /* $Header: obj_circ.c,v 1.2 88/08/19 00:00:52 moraes Exp $ */
X  /*
X   *  The circle object routines
X   */
X--- 1,4 ----
X! /* $Header: obj_circ.c,v 1.3 88/09/05 01:29:58 moraes Exp $ */
X  /*
X   *  The circle object routines
X   */
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/patchlevel.h xpic/patchlevel.h
X*** /h/xwindows/X/contrib/clients/xpic/patchlevel.h	Fri Oct  7 09:27:35 1988
X--- xpic/patchlevel.h	Tue Nov 15 02:47:00 1988
X***************
X*** 1,2 ****
X! #define PATCHLEVEL 5
X  
X--- 1,2 ----
X! #define PATCHLEVEL 6
X  
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/to_do xpic/to_do
X*** /h/xwindows/X/contrib/clients/xpic/to_do	Sun Aug 28 02:19:05 1988
X--- xpic/to_do	Tue Nov 15 02:52:26 1988
X***************
X*** 1,14 ****
X  Fix it so that it checks return status of fprintf() and friends when 
X  saving files. Probably need a setjmp() to deal with this.
X  
X  Clean up obj_line and obj_spline - too much code duplication there.
X  
X  Checkpointing using changes
X  
X! Scale, Rotate, Mirror
X  
X- Multiple buffer handling
X- 
X  Enhancements:
X  	ordering of gels so that we can use filled regions, Raise, Lower
X  	initially fill regions with setgray
X--- 1,24 ----
X+ This varies from things that probably should be fixed, to things that
X+ would be sort of nice, but which i doubt if I'll ever get around to.
X+ Not to be interpreted as things that may get fixed - just things that
X+ I would like to fix.
X+ 
X+ ---------------------------------------------------------------------
X+ 
X  Fix it so that it checks return status of fprintf() and friends when 
X  saving files. Probably need a setjmp() to deal with this.
X  
X+ A better selection strategy - the centre of the bounding box isn't
X+ very nice for lines/splines.
X+ 
X+ Scale, Rotate, Mirror
X+ 
X  Clean up obj_line and obj_spline - too much code duplication there.
X  
X  Checkpointing using changes
X  
X! Multiple buffer handling.
X  
X  Enhancements:
X  	ordering of gels so that we can use filled regions, Raise, Lower
X  	initially fill regions with setgray
X***************
X*** 15,21 ****
X  	later fill regions with general bitmaps - load and save bitmaps
X  	grab bitmaps from the screen
X  	macros, groups
X! 	
X  Generalize so that all global variables are in a struct to which a
X  pointer is passed for all routines - eg. picWin becomes pic->win,
X  picDpy becomes pic->dpy, gcInvert becomes pic->gcInvert, etc. This is
X--- 25,36 ----
X  	later fill regions with general bitmaps - load and save bitmaps
X  	grab bitmaps from the screen
X  	macros, groups
X! 
X! Text display routines that interpret TeX/Troff codes like \bullet or
X! \(bu so that we get a better WYSIWYG effect. means taking stuff from
X! dvix/xtroff and using that for char code mapping. Get really amibtious
X! and add some level of equation support.
X! 
X  Generalize so that all global variables are in a struct to which a
X  pointer is passed for all routines - eg. picWin becomes pic->win,
X  picDpy becomes pic->dpy, gcInvert becomes pic->gcInvert, etc. This is
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/tune.h xpic/tune.h
X*** /h/xwindows/X/contrib/clients/xpic/tune.h	Tue Aug 30 16:10:11 1988
X--- xpic/tune.h	Tue Nov 15 04:44:44 1988
X***************
X*** 1,3 ****
X! #define LIBDIR "/ai/share/X11/xpic"
X! #define PROGRAMNAME "/ai/bin/X11/xpic"
X  #define DUMPDIR "/tmp"
X--- 1,3 ----
X! #define LIBDIR "/local/share/X11/xpic"
X! #define PROGRAMNAME "/local/bin/X11/xpic"
X  #define DUMPDIR "/tmp"
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/usleep.c xpic/usleep.c
X*** /h/xwindows/X/contrib/clients/xpic/usleep.c	Mon Sep 19 10:14:54 1988
X--- xpic/usleep.c	Thu Sep 22 21:12:07 1988
X***************
X*** 1,5 ****
X  #ifndef lint
X! static char *rcsid="$Header: usleep.c,v 1.1 88/08/31 23:45:37 moraes Exp $";
X  #endif
X  
X  /* A sleazy usleep() call for stupid Un*xs that don't have one. Among
X--- 1,5 ----
X  #ifndef lint
X! static char *rcsid="$Header: usleep.c,v 1.2 88/09/22 21:11:58 root Exp $";
X  #endif
X  
X  /* A sleazy usleep() call for stupid Un*xs that don't have one. Among
X***************
X*** 42,45 ****
X  	setitimer(ITIMER_REAL, &ovalue, &value);
X  }
X  
X- #endif
X--- 42,44 ----
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/windows.c xpic/windows.c
X*** /h/xwindows/X/contrib/clients/xpic/windows.c	Mon Sep 19 10:14:53 1988
X--- xpic/windows.c	Tue Nov 15 02:36:05 1988
X***************
X*** 38,43 ****
X--- 38,44 ----
X  #define FORM_NAME		"form"
X  #define PIC_NAME		"picture"
X  #define MINIBUF_NAME	"minibuf"
X+ #define DUMMYBUF_NAME	"dummybuf"
X  #define BUTTON_CURSOR	"opendot"
X  #define PIC_CURSOR		"tcross"
X  
X***************
X*** 275,313 ****
X  	minPicHeight = MINPAGEHEIGHT * gridSpacing;
X  	minPicWidth = MINPAGEWIDTH * gridSpacing;
X  
X! 	/* 
X! 	 *  This incredible kludge gets around a cyclic reference that
X! 	 *  kills the Form widget any other way - what i want is the
X! 	 *  picWidget anchored at the top left, and the minibuf anchored at
X! 	 *  the bottom left. But I want the top edge and the bottom edge
X! 	 *  of the picWidget glued together. Apparently, the only way I can
X! 	 *  do it is to tell the picWidget that it is attached to teh
X! 	 *  Bottom as well, offset by the height of the minibuf, (which
X! 	 *  thankfully doesnt change) and tell the minibuf that it's ref
X! 	 *  widget is the picWidget. To get around this cycle, i first
X! 	 *  create a dummy minibuf, to get it's height, then destroy it,
X! 	 *  use the height to create the picwin, and then create the
X! 	 *  genuine minibuf. XtSetValues would get around this nicely,
X! 	 *  but the Form dumps core instantly. Even now, I can't get the
X! 	 *  picWidget to grow larger, but the doc says I can't.....
X  	 */
X- 	/* Create the dummy minibuf */
X  	argcount = 0;
X  	setarg(XtNwidth, picWinWidth);
X- 	setarg(XtNfinishedCallback, callbacks);
X- 	inputWidget = XtCreateWidget(MINIBUF_NAME, minibufWidgetClass,
X- 		outerFrame, args, argcount);
X- 
X- 	/* get the height and border width, then destroy the dummy widget */
X- 	argcount = 0;
X- 	setarg(XtNheight, &height);
X- 	setarg(XtNborderWidth, &border);
X- 	XtGetValues(inputWidget, args, argcount);
X- 	XtDestroyWidget(inputWidget);
X- 
X- 	/* Now create the picwin using the info from the dummy minibuf */
X- 	argcount = 0;
X- 	setarg(XtNwidth, picWinWidth);
X  	setarg(XtNheight, picWinHeight);
X  	setarg(XtNxRefName, FORM_NAME);
X  	setarg(XtNyRefName, FORM_NAME);
X--- 276,288 ----
X  	minPicHeight = MINPAGEHEIGHT * gridSpacing;
X  	minPicWidth = MINPAGEWIDTH * gridSpacing;
X  
X! 	/*
X! 	 *  First create the picwin - the XtNyAttachOffset is a lie; we'll
X! 	 *  deal with it later when we get the correct height from the
X! 	 *  minibuf widget. One day, I'll understand how to do this right
X  	 */
X  	argcount = 0;
X  	setarg(XtNwidth, picWinWidth);
X  	setarg(XtNheight, picWinHeight);
X  	setarg(XtNxRefName, FORM_NAME);
X  	setarg(XtNyRefName, FORM_NAME);
X***************
X*** 314,320 ****
X  	setarg(XtNxResizable, True);
X  	setarg(XtNyResizable, True);
X  	setarg(XtNyAttachBottom, True);
X! 	setarg(XtNyAttachOffset, height + 2 * border);
X  	picWidget = XtCreateWidget(PIC_NAME, windowWidgetClass,
X  		outerFrame, args, argcount);
X  	addthingy(picWidget);
X--- 289,295 ----
X  	setarg(XtNxResizable, True);
X  	setarg(XtNyResizable, True);
X  	setarg(XtNyAttachBottom, True);
X! 	setarg(XtNyAttachOffset, 0);
X  	picWidget = XtCreateWidget(PIC_NAME, windowWidgetClass,
X  		outerFrame, args, argcount);
X  	addthingy(picWidget);
X***************
X*** 329,335 ****
X  	XtAddEventHandler(picWidget, 
X  	 (Cardinal) ExposureMask | ButtonPressMask | PointerMotionMask |
X  	 StructureNotifyMask, NULL, picEventHandle, NULL);
X! 	/* Finally, create the real minibuf */
X  	argcount = 0;
X  	setarg(XtNwidth, picWinWidth);
X  	setarg(XtNxRefName, FORM_NAME);
X--- 304,310 ----
X  	XtAddEventHandler(picWidget, 
X  	 (Cardinal) ExposureMask | ButtonPressMask | PointerMotionMask |
X  	 StructureNotifyMask, NULL, picEventHandle, NULL);
X! 	/* create the minibuf */
X  	argcount = 0;
X  	setarg(XtNwidth, picWinWidth);
X  	setarg(XtNxRefName, FORM_NAME);
X***************
X*** 343,348 ****
X--- 318,334 ----
X  		outerFrame, args, argcount);
X  	addthingy(inputWidget);
X  
X+ 	/* get the height and border width of the minibuf */
X+ 	argcount = 0;
X+ 	setarg(XtNheight, &height);
X+ 	setarg(XtNborderWidth, &border);
X+ 	XtGetValues(inputWidget, args, argcount);
X+ 
X+ 	/* Shorten the picWidget to let the two coexist happily. */
X+ 	argcount = 0;
X+ 	setarg(XtNyAttachOffset, height + 2 * border);
X+ 	XtSetValues(picWidget, args, argcount);
X+ 	
X  	/*
X  	 *  Wanted to use RefWidget, but that causes Xt to dump core in a
X  	 *  strcpy deep in an XtCreate - so we use Refname which works well,
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/x2pic.c xpic/x2pic.c
X*** /h/xwindows/X/contrib/clients/xpic/x2pic.c	Wed Aug 31 23:46:40 1988
X--- xpic/x2pic.c	Tue Nov 15 22:07:00 1988
X***************
X*** 1,4 ****
X! /* $Header: x2pic.c,v 1.3 88/08/31 23:46:36 moraes Exp $ */
X  #include <stdio.h>
X  #include <ctype.h>
X  #include "xpic.h"
X--- 1,4 ----
X! /* $Header: x2pic.c,v 1.4 88/11/04 23:30:34 moraes Exp $ */
X  #include <stdio.h>
X  #include <ctype.h>
X  #include "xpic.h"
X***************
X*** 47,53 ****
X  static char *name;
X  static double picScale = 1.0;
X  
X- static char *progname;
X  extern int optind;
X  extern char *optarg;
X  
X--- 47,52 ----
X***************
X*** 197,203 ****
X  	name = "line";
X  	if (type != LINE) {
X  		name = "spline";
X! 		style = 0;
X  	}
X  	fprintf(outFile, "%s %s %s from %g, %g ",
X  	 name, arrows[arrow_type], style_words[style], x, y);
X--- 196,205 ----
X  	name = "line";
X  	if (type != LINE) {
X  		name = "spline";
X! 		if (style != 0) {
X! 			fprintf(stderr, "warning: splines have no attributes in pic\n");
X! 			style = 0;
X! 		}
X  	}
X  	fprintf(outFile, "%s %s %s from %g, %g ",
X  	 name, arrows[arrow_type], style_words[style], x, y);
X***************
X*** 431,437 ****
X  	progname = argv[0];
X  	inFile = stdin;
X  	outFile = stdout;
X! 	while((c = getopt(argc, argv, "s:")) != EOF) {
X  		switch (c) {
X  		case 's':
X  			picScale = atof(optarg);
X--- 433,439 ----
X  	progname = argv[0];
X  	inFile = stdin;
X  	outFile = stdout;
X! 	while((c = getopt(argc, argv, "s:f:")) != EOF) {
X  		switch (c) {
X  		case 's':
X  			picScale = atof(optarg);
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/x2pic.manX xpic/x2pic.manX
X*** /h/xwindows/X/contrib/clients/xpic/x2pic.manX	Tue Aug 30 18:18:30 1988
X--- xpic/x2pic.manX	Fri Nov  4 23:28:05 1988
X***************
X*** 3,9 ****
X  x2pic - convert figures stored in \fIxpic\fP format to pic.
X  .SH SYNOPSIS
X  .B x2pic
X! [-s \fIscale\fP] [\fIfilename\fP] ....
X  .SH DESCRIPTION
X  .I X2pic
X  takes the given 
X--- 3,9 ----
X  x2pic - convert figures stored in \fIxpic\fP format to pic.
X  .SH SYNOPSIS
X  .B x2pic
X! [-s \fIscale\fP] [-f \fImaximum fonts\fP] [\fIfilename\fP] ....
X  .SH DESCRIPTION
X  .I X2pic
X  takes the given 
X***************
X*** 20,31 ****
X  .I troff)
X  to output devices like laser printers.
X  .SH OPTIONS
X! .IR -s scale 
X  scales the picture by 
X  .I scale, 
X  which is a floating point number. Text doesn't scale very well. (eg) 
X  .I -s 0.5
X  will scale the picture to half its size.
X  .SH "SEE ALSO"
X  .IR xpic (L)
X  is what generates the files for 
X--- 20,38 ----
X  .I troff)
X  to output devices like laser printers.
X  .SH OPTIONS
X! .IR -s " scale"
X  scales the picture by 
X  .I scale, 
X  which is a floating point number. Text doesn't scale very well. (eg) 
X  .I -s 0.5
X  will scale the picture to half its size.
X+ .PP
X+ .IR -f " numfonts"
X+ sets the maximum number of fonts that can be stored. The default is enough
X+ unless the users 
X+ .I ~/.x2pic 
X+ has a lot of font mappings.
X+ .IR 
X  .SH "SEE ALSO"
X  .IR xpic (L)
X  is what generates the files for 
X***************
X*** 39,52 ****
X  .I PostScript(tm)
X  format.
X  .br
X  .IR tpic (L)
X! is a preprocessor for 
X  .I TeX
X  to permit inclusion of pic in 
X  .I TeX
X  documents. 
X  .SH TRADEMARKS
X  PostScript is a registered trademark of Adobe Systems, Inc.
X  .SH CAVEATS
X  Many versions of pic have a nasty bug in which the 
X  .I scale
X--- 46,71 ----
X  .I PostScript(tm)
X  format.
X  .br
X+ .IR x2tpic (L)
X+ generates pic for the
X  .IR tpic (L)
X! preprocessor for 
X  .I TeX
X  to permit inclusion of pic in 
X  .I TeX
X  documents. 
X+ .SH SEE ALSO
X+ B. W. Kernighan,
X+ .I "PIC \(em A Graphics Language for Typesetting"
X  .SH TRADEMARKS
X  PostScript is a registered trademark of Adobe Systems, Inc.
X+ .SH FILES
X+ .I x2pic
X+ looks at 
X+ .I XPICLIBDIR/fontdesc/x2pic
X+ and at 
X+ .I ~/.x2pic 
X+ to find font mappings.
X  .SH CAVEATS
X  Many versions of pic have a nasty bug in which the 
X  .I scale
X***************
X*** 56,62 ****
X  .I scale = 80,
X  the next picture will start off at this scale, and will therefore be
X  further shrunk if it is an xpic picture, or just shrunk if it is any
X! other pciture, like a graph. Get someone to fix pic, or x2pic (which
X  has a BROKENPIC ifdef to deal with this).
X  .PP
X  Pic does NOT do patterned splines, ellipses or circles - xpic does.
X--- 75,81 ----
X  .I scale = 80,
X  the next picture will start off at this scale, and will therefore be
X  further shrunk if it is an xpic picture, or just shrunk if it is any
X! other picture, like a graph. Get someone to fix pic, or x2pic (which
X  has a BROKENPIC ifdef to deal with this).
X  .PP
X  Pic does NOT do patterned splines, ellipses or circles - xpic does.
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/x2ps.c xpic/x2ps.c
X*** /h/xwindows/X/contrib/clients/xpic/x2ps.c	Fri Oct  7 16:01:26 1988
X--- xpic/x2ps.c	Tue Nov 15 22:05:31 1988
X***************
X*** 1,4 ****
X! /* $Header: x2ps.c,v 1.3 88/08/31 23:46:44 moraes Exp $ */
X  #include <stdio.h>
X  #include <pwd.h>
X  #include <ctype.h>
X--- 1,4 ----
X! /* $Header: x2ps.c,v 1.4 88/10/06 18:20:53 moraes Exp $ */
X  #include <stdio.h>
X  #include <pwd.h>
X  #include <ctype.h>
X***************
X*** 61,67 ****
X  static char *trailerFile = NULL;
X  #endif DEBUG
X  
X- static char *progname;
X  extern int optind;
X  extern char *optarg;
X  
X--- 61,66 ----
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/x2ps.manX xpic/x2ps.manX
X*** /h/xwindows/X/contrib/clients/xpic/x2ps.manX	Fri Oct  7 16:01:27 1988
X--- xpic/x2ps.manX	Fri Nov  4 23:30:58 1988
X***************
X*** 4,10 ****
X  .SH SYNOPSIS
X  .B x2ps
X  [-r] [-x] [-s \fIscale\fP] [-p \fIprologuefile\fP] [-t \fItrailerfile\fP] 
X! [-h \fIhoffset\fP] [-v \fIvoffset\fP] [\fIfilename\fP] ....
X  .SH DESCRIPTION
X  .I X2ps
X  takes the given 
X--- 4,11 ----
X  .SH SYNOPSIS
X  .B x2ps
X  [-r] [-x] [-s \fIscale\fP] [-p \fIprologuefile\fP] [-t \fItrailerfile\fP] 
X! [-f \fImaximum fonts\fP] [-h \fIhoffset\fP] [-v \fIvoffset\fP] 
X! [\fIfilename\fP] ....
X  .SH DESCRIPTION
X  .I X2ps
X  takes the given 
X***************
X*** 46,52 ****
X  .IR -t "  trailerfile"
X  specify the prologue and trailer to be used.
X  The defaults are
X! .I LIBDIR/x2ps.pro 
X  and
X  .I x2ps.tra. 
X  Use these only if you know
X--- 47,53 ----
X  .IR -t "  trailerfile"
X  specify the prologue and trailer to be used.
X  The defaults are
X! .I XPICLIBDIR/x2ps.pro 
X  and
X  .I x2ps.tra. 
X  Use these only if you know
X***************
X*** 61,67 ****
X  .IR -v "  voffset"
X  specify the horizontal and vertical offset to add to the figure, in
X  inches. hoffset and voffset may be floats.
X! 
X  .SH "SEE ALSO"
X  .IR xpic (L)
X  is what generates the files for 
X--- 62,73 ----
X  .IR -v "  voffset"
X  specify the horizontal and vertical offset to add to the figure, in
X  inches. hoffset and voffset may be floats.
X! .TP 8
X! .IR -f " numfonts"
X! sets the maximum number of fonts that can be stored. The default is enough
X! unless the users 
X! .I ~/.x2ps 
X! has a lot of font mappings.
X  .SH "SEE ALSO"
X  .IR xpic (L)
X  is what generates the files for 
X***************
X*** 83,97 ****
X  documents. There is also
X  a version for 
X  .I TeX 
X- apparently, which I haven't tried.
X  .br
X  The other method I know of for including PostScript in TeX
X  documents is
X  .I \\special
X! directive in some version of 
X! .I LaTeX.
X  See the local guide for 
X  .I LaTeX
X! and the examples in DOCDIR.
X  .SH TRADEMARKS
X  PostScript is a registered trademark of Adobe Systems, Inc.
X--- 89,109 ----
X  documents. There is also
X  a version for 
X  .I TeX 
X  .br
X  The other method I know of for including PostScript in TeX
X  documents is
X  .I \\special
X! directive supported by some versions of 
X! .I LaTeX/dvi2ps.
X  See the local guide for 
X  .I LaTeX
X! and the examples in DOCDIR and DOCDIR/tex.
X  .SH TRADEMARKS
X  PostScript is a registered trademark of Adobe Systems, Inc.
X+ .SH FILES
X+ .I x2ps
X+ looks at 
X+ .I XPICLIBDIR/fontdesc/x2ps
X+ and at 
X+ .I ~/.x2ps 
X+ to find font mappings.
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/doc/README xpic/doc/README
X*** /h/xwindows/X/contrib/clients/xpic/doc/README	Tue Oct  4 18:23:10 1988
X--- xpic/doc/README	Fri Nov  4 23:25:08 1988
X***************
X*** 1,4 ****
X! xpic.doc is an unformatted document on xpic - as yet incomplete.
X  
X  test.psfig is troff document using the -me macros, including
X  PostScript from x2ps using psfig.
X--- 1,4 ----
X! xpic.doc is an unformatted document on xpic. Use lpr.
X  
X  test.psfig is troff document using the -me macros, including
X  PostScript from x2ps using psfig.
X***************
X*** 7,9 ****
X--- 7,11 ----
X  PostScript from x2ps. Note that unlike psfig, you need to explicitly
X  specify, vspace.
X  
X+ tex contains a LaTeX document on using xpic figures in LaTeX using 
X+ psfig and tpic.
Xdiff -c -r /h/xwindows/X/contrib/clients/xpic/doc/xpic.doc xpic/doc/xpic.doc
X*** /h/xwindows/X/contrib/clients/xpic/doc/xpic.doc	Tue Oct  4 18:23:11 1988
X--- xpic/doc/xpic.doc	Fri Nov  4 23:24:57 1988
X***************
X*** 1,4 ****
X! $Header: xpic.doc,v 1.8 88/10/04 04:27:56 moraes Exp $
X                                Using xpic.
X                                -----------
X  
X--- 1,4 ----
X! $Header: xpic.doc,v 1.10 88/11/04 23:24:46 moraes Exp $
X                                Using xpic.
X                                -----------
X  
X***************
X*** 495,501 ****
X  
X  pic:
X      Use the program x2pic - no options etc. Just
X!         x2pic [-s scale] [filename] ...
X  
X  -s scale 
X  scales the picture by 'scale', where scale can be a float. It tries to
X--- 495,501 ----
X  
X  pic:
X      Use the program x2pic - no options etc. Just
X!         x2pic [-s scale] [-f numfonts] [filename] ...
X  
X  -s scale 
X  scales the picture by 'scale', where scale can be a float. It tries to
X***************
X*** 502,507 ****
X--- 502,512 ----
X  scale the fonts too, unlike pic's scale command, but don't expect
X  miracles.
X  
X+ -f numfonts
X+ sets the maximum number of fonts in the font mapping table. See the
X+ section on fonts below. The default is usually adequate unless the
X+ user has lots of fonts in the ~/.x2pic or ~/.x2tpic file.
X+ 
X  Each file becomes a separate .PS/.PE and the pic output is written to
X  stdout. If no filename is given, it is read from stdin.
X  
X***************
X*** 515,523 ****
X  has a silent limit of 50 points per spline which it enforces by core
X  dump.
X  
X  PostScript:
X  	x2ps [-r] [-x] [-s scale] [-p prologuefile] [-t trailerfile] 
X! 		[-h hoffset] [-v voffset] [filename] ....
X  
X  -r prints the figure in landscape mode, rotated by 90 degrees. It
X  goes together with the -r option on xpic.
X--- 520,532 ----
X  has a silent limit of 50 points per spline which it enforces by core
X  dump.
X  
X+ There is a similar program called x2tpic which generates almost
X+ exactly the same output, but with font style/size selection commands
X+ in TeX. It can be used with tpic.
X+ 
X  PostScript:
X  	x2ps [-r] [-x] [-s scale] [-p prologuefile] [-t trailerfile] 
X! 		[-f numfonts] [-h hoffset] [-v voffset] [filename] ....
X  
X  -r prints the figure in landscape mode, rotated by 90 degrees. It
X  goes together with the -r option on xpic.
X***************
X*** 542,547 ****
X--- 551,561 ----
X  specify the horizontal and vertical offset to add to the figure, in
X  inches. hoffset and voffset may be floats.
X  
X+ -f numfonts
X+ sets the maximum number of fonts in the font mapping table. See the
X+ section on fonts below. The default is usually adequate unless the
X+ user has lots of fonts in the ~/.x2ps file.
X+ 
X   FONTS
X   -----
X  	xpic reads a font description file to decide what fonts it can use
X***************
X*** 604,609 ****
X--- 618,658 ----
X  The default x2ps fontdesc is in XPICLIBDIR/fontdesc/x2ps, and it also
X  reads ~/.x2ps.
X  
X+ 
X+ 	x2tpic has a slightly more complex font description file,
X+ which has the following fields:
X+ 	<Full xpic name> <pointsize> <tex name> <tex font> <optional tex scale>
X+ 
X+ (eg)
X+ Roman 	9		\Xninerm	cmr9
X+ 
X+ -- maps xpic Roman, 9 pt, to the name \Xninerm, corresponding to cmr9.
X+ 
X+ Roman 	11		\Xelevenrm	cmr10  \magstephalf
X+ 
X+ -- maps xpic Roman, 11 pt, to the name \Xelevenrm, corresponding to
X+ cmr10, scaled by magstephalf. (See the TeXbook for more in this)
X+ 
X+ Italic 	6		\Xsixit		cmti7  857
X+ 
X+ -- maps xpic Italic, 6 pt, to the name \Xsixit, corresponding to cmti7
X+ scaled 857.
X+ 
X+ Special 6		\Xsixsp		PS-Symbol pointsize6
X+ 
X+ -- We store the .tfm file for PostScript(tm) fonts under the names
X+ PS-postscriptname. (eg) PS-Symbol. Other sites may use different names
X+ (eg) pssymbol. The above line generates the appropriate scaled at
X+ command to get 6 point Symbol.
X+ 
X+ x2tpic will search this table to find the closest font to the one
X+ requested. It will find the closest size in either the same font style
X+ or Roman.
X+ 
X+ If you want to add to the table, keep the entries in ~/.x2tpic.
X+ Usually, your system will have the right map of fonts in the default.
X+ If not, ask the person who installed xpic to talk to the person who
X+ looks after TeX.
X  
X   BUGS
X   ----
XWhAt_A_mArOoN
X$TOPDIR/util/scripts/ximake.sh $TOPDIR; make depend
Xecho 'Unpack newfiles.shar and go ahead and make the stuff'
X
END_OF_update.sh
if test 35331 -ne `wc -c <update.sh`; then
    echo shar: \"update.sh\" unpacked with wrong size!
fi
chmod +x update.sh
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0
-- 
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
Moderator of comp.sources.x