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