v04i067: xpic -- pic previewer for X11, Part02/15

Dan Heller argv at island.uu.net
Fri Jul 21 05:12:02 AEST 1989


Submitted-by: Mark Moraes <moraes at ai.toronto.edu>
Posting-number: Volume 4, Issue 67
Archive-name: xpic/part02



#! /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
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 2 (of 15)."
# Contents:  xpic/MinibufP.h xpic/bitmaps/xpic.icon xpic/doc/test.latex
#   xpic/doc/test.psfig xpic/doc/tex/funstuff.tex xpic/gels.c
#   xpic/globals.h xpic/grid.c xpic/input.c xpic/obj_xxx.c
#   xpic/spline.c xpic/test/test.x.land xpic/test/test2.x
#   xpic/test/testtext.pic xpic/text.c xpic/x2pic.manX xpic/x2ps.manX
#   xpic/x2tpic.manX xpic/xpic.manX xpic/xtp.c
# Wrapped by moraes at neat.ai on Thu Jul 13 22:36:05 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xpic/MinibufP.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/MinibufP.h'\"
else
echo shar: Extracting \"'xpic/MinibufP.h'\" \(2123 characters\)
sed "s/^X//" >'xpic/MinibufP.h' <<'END_OF_FILE'
X/* 
X * MinibufP.h - Private definitions for Minibuf widget
X * 
X */
X
X#ifndef _XtMinibufP_h
X#define _XtMinibufP_h
X
X/***********************************************************************
X *
X * Minibuf Widget Private Data
X *
X ***********************************************************************/
X
X#include "Minibuf.h"
X
X/* New fields for the Minibuf widget class record */
X
Xtypedef struct {int foo;} MinibufClassPart;
X
X/* Full class record declaration */
Xtypedef struct _MinibufClassRec {
X	CoreClassPart		core_class;
X	MinibufClassPart	minibuf_class;
X} MinibufClassRec;
X
Xextern MinibufClassRec minibufClassRec;
X
X/* New fields for the Minibuf widget record */
Xtypedef struct {
X	/* resources */
X	Pixel		foreground;
X	XFontStruct	*finfo;
X	Cursor		cursor;
X	Widget		typeout;
X
X	/* Callback stuff */
X	XtCallbackList finishedCallback;/* 
X									 *  Invoked on "newline" event
X									 *  (usually ^M) or "abort" event
X									 *  (usually ^G)
X									 */
X
X	/* private state */
X	GC			normal_gc;
X	GC          invert_gc;
X	int cursorX;			/* Physical position of cursor in window */
X
X	/* Logical info */
X	char *string;			/* Actual buffer */
X	int startPos;			/* First character of string displayed in window */
X	int cursorPos;			/* Position of the cursor in the buffer */
X	int mark;
X	char *killBuffer;
X	int killBufferLen;
X	int killBufferSize;
X	int size;				/* Size of the string buffer */
X	int len;				/* Actual length of the string */
X	int cols;				/* Width of buffer in columns */
X	int promptLen;			/* First promptLen chars of string are 
X							   non-editable prompt */
X	int arg;				/* Universal argument */
X	int typeoutColumns;		/* Number of columns in the typeout window */
X	int inputMode;			/* True, if we are in input mode */
X	int cursorOn;			/* Records the state of the cursor */
X	int completion;			/* Are we doing completion */
X} MinibufPart;
X
X
X/****************************************************************
X *
X * Full instance record declaration
X *
X ****************************************************************/
X
Xtypedef struct _MinibufRec {
X	CorePart	core;
X	MinibufPart	minibuf;
X} MinibufRec;
X
X#endif _XtMinibufP_h
END_OF_FILE
if test 2123 -ne `wc -c <'xpic/MinibufP.h'`; then
    echo shar: \"'xpic/MinibufP.h'\" unpacked with wrong size!
fi
# end of 'xpic/MinibufP.h'
fi
if test -f 'xpic/bitmaps/xpic.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/bitmaps/xpic.icon'\"
else
echo shar: Extracting \"'xpic/bitmaps/xpic.icon'\" \(3275 characters\)
sed "s/^X//" >'xpic/bitmaps/xpic.icon' <<'END_OF_FILE'
X#define xpic_width 64
X#define xpic_height 64
Xstatic char xpic_bits[] = {
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0x57, 0x55, 0x55, 0x0c, 0xe0, 0x4f, 0x55, 0xd5,
X   0xab, 0xaa, 0x2a, 0x0f, 0x10, 0x90, 0xaa, 0xea, 0x57, 0x55, 0x95, 0x31,
X   0x08, 0x22, 0x55, 0xd5, 0xab, 0xaa, 0x8a, 0xc1, 0x84, 0x41, 0xaa, 0xea,
X   0x57, 0x55, 0x85, 0x40, 0x85, 0x40, 0x54, 0xd5, 0xab, 0xaa, 0x86, 0x40,
X   0xc7, 0x40, 0xa8, 0xea, 0x57, 0x55, 0x81, 0x20, 0x46, 0x41, 0x50, 0xd5,
X   0xab, 0xaa, 0xc0, 0x20, 0x36, 0x42, 0xa0, 0xea, 0x57, 0x55, 0x40, 0x10,
X   0x06, 0x44, 0x40, 0xd5, 0xab, 0x2a, 0x42, 0x08, 0x06, 0x40, 0x80, 0xea,
X   0x57, 0x15, 0x46, 0x00, 0x0a, 0x20, 0x00, 0xd5, 0xab, 0x0a, 0x6a, 0x00,
X   0x11, 0x10, 0x03, 0xea, 0x57, 0xcd, 0x33, 0x80, 0xe1, 0x0f, 0x05, 0xd4,
X   0xab, 0x86, 0x20, 0x60, 0x01, 0x00, 0x09, 0xe8, 0x57, 0x11, 0x21, 0x18,
X   0x01, 0x00, 0x11, 0xd0, 0xab, 0x30, 0x22, 0x00, 0x01, 0x00, 0x21, 0xe0,
X   0x57, 0x50, 0x10, 0x00, 0x01, 0x00, 0x42, 0xc0, 0x2b, 0x9e, 0x10, 0x80,
X   0x00, 0x00, 0x82, 0xc0, 0x77, 0x04, 0x10, 0x80, 0x01, 0x00, 0x02, 0xc1,
X   0x8b, 0x09, 0x18, 0x40, 0x00, 0x00, 0x02, 0xc2, 0x87, 0x12, 0x08, 0x60,
X   0x40, 0x00, 0x02, 0xc4, 0x47, 0x06, 0x08, 0x1f, 0xa0, 0x00, 0x02, 0xc2,
X   0x27, 0x05, 0x08, 0x10, 0x10, 0x01, 0x02, 0xc1, 0xc7, 0x1a, 0x0c, 0x08,
X   0x08, 0x02, 0x82, 0xc0, 0x47, 0x35, 0x04, 0x08, 0x04, 0x04, 0x84, 0xc0,
X   0xbb, 0x6a, 0x04, 0x04, 0x12, 0x08, 0x44, 0xc0, 0x57, 0xd5, 0x04, 0x02,
X   0x19, 0x08, 0x24, 0xc0, 0xab, 0xaa, 0xc5, 0x81, 0x88, 0x04, 0x14, 0xc0,
X   0x57, 0x55, 0x07, 0x41, 0x7e, 0x02, 0x0c, 0xc0, 0xab, 0xaa, 0x82, 0x20,
X   0x09, 0x01, 0x00, 0xc0, 0x57, 0x55, 0x43, 0x10, 0x89, 0x00, 0x00, 0xc0,
X   0xab, 0xaa, 0x42, 0x08, 0x49, 0x00, 0x00, 0xc0, 0x57, 0x55, 0x3b, 0x08,
X   0x26, 0x10, 0x00, 0xc0, 0xab, 0xaa, 0x63, 0x10, 0x10, 0x10, 0x00, 0xc0,
X   0x57, 0x55, 0xd1, 0x20, 0x08, 0x18, 0x00, 0xc0, 0xab, 0xaa, 0xb1, 0x41,
X   0x04, 0x0c, 0x00, 0xc0, 0x57, 0xd5, 0x59, 0x83, 0x02, 0x04, 0x00, 0xc0,
X   0xab, 0xaa, 0xad, 0x06, 0x01, 0x06, 0x1e, 0xc0, 0x57, 0xd5, 0x54, 0x0d,
X   0x00, 0x02, 0x33, 0xc0, 0xab, 0xaa, 0xaa, 0x3a, 0x00, 0x02, 0x61, 0xc0,
X   0x57, 0xd5, 0x56, 0x55, 0x00, 0x02, 0x41, 0xc0, 0xab, 0xea, 0xab, 0xaa,
X   0x00, 0x02, 0xc1, 0xe0, 0x57, 0xfd, 0x57, 0xd5, 0x00, 0x02, 0x01, 0xd0,
X   0xab, 0xc2, 0xad, 0xaa, 0x01, 0x04, 0x01, 0xe8, 0x57, 0xfd, 0x57, 0x55,
X   0x03, 0x18, 0x01, 0xd4, 0xab, 0xe6, 0xaa, 0xaa, 0x06, 0xf0, 0x00, 0xea,
X   0x57, 0xe5, 0x56, 0x55, 0x0d, 0x00, 0x00, 0xd5, 0xab, 0xe6, 0xaa, 0xaa,
X   0x1a, 0x00, 0x80, 0xea, 0x57, 0x73, 0x54, 0x55, 0x35, 0x00, 0x40, 0xd5,
X   0xab, 0x31, 0xa8, 0xaa, 0x6a, 0x00, 0xa0, 0xea, 0xd7, 0x30, 0x50, 0x55,
X   0xd5, 0x00, 0x50, 0xd5, 0xeb, 0xff, 0xbf, 0xaa, 0xaa, 0x01, 0xa8, 0xea,
X   0xf7, 0xff, 0x7f, 0x55, 0x55, 0x03, 0x54, 0xd5, 0xeb, 0xff, 0xbf, 0xaa,
X   0xaa, 0x06, 0xaa, 0xea, 0xf7, 0xff, 0x7f, 0x55, 0x55, 0x09, 0x55, 0xd5,
X   0xeb, 0xff, 0xbf, 0xaa, 0xaa, 0x8c, 0xaa, 0xea, 0xd7, 0xff, 0x5f, 0x55,
X   0xd5, 0x52, 0x55, 0xd5, 0xab, 0xfe, 0xab, 0xaa, 0x2a, 0xb1, 0xaa, 0xea,
X   0x57, 0x55, 0x55, 0x55, 0x35, 0x50, 0x55, 0xd5, 0xab, 0xaa, 0xaa, 0xab,
X   0x2a, 0xa8, 0xaa, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
X   0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
END_OF_FILE
if test 3275 -ne `wc -c <'xpic/bitmaps/xpic.icon'`; then
    echo shar: \"'xpic/bitmaps/xpic.icon'\" unpacked with wrong size!
fi
# end of 'xpic/bitmaps/xpic.icon'
fi
if test -f 'xpic/doc/test.latex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/doc/test.latex'\"
else
echo shar: Extracting \"'xpic/doc/test.latex'\" \(2287 characters\)
sed "s/^X//" >'xpic/doc/test.latex' <<'END_OF_FILE'
X\documentstyle[11pt,titlepage]{article}
X\setlength{\parskip}{\medskipamount}
X\setlength{\parindent}{0pt}
X\title{Test}
X
X\author{Victor Greenberg}
X
X\begin{document}
X
X\maketitle
X
X\maketitle
X
X\section {Operations}
X
X\subsection{{\em Show\/} operation}
X
X\begin{figure}
X\vspace{3.8in}
X\special{psfile=show.ps} 
X\caption{Show $A$}
X\label{show_a}
X\end{figure}
X
X\begin{tabbing}
X
XPROCEDURE \= INDENT \= INDENT \= INDENT \= \kill
XShow ($A$)
X\\
X\>	$A.R \Rightarrow\ A.S$ \\
X\>	For each $X$ above $A$, from top to bottom \\
X\>\>		if $X.R \cap\ A.R$ \\
X\>\>\>			$X.R \Rightarrow\ A.S$ \\
X\>	{\em the save buffers of the objects above $A$ contain portions} \\
X\>	{\em of the image that should be under $A$ after it is shown} \\
X\\
X\>	Draw($A$) \\
X\>	UpdateAbove ($A$,$A.R$) \\
X\>	{\em the images in objects above $A$ may be affected by this change,}\\
X\>      {\em so may have to be re-generated}
X\end{tabbing}
X
X\subsection{{\em UpdateAbove\/} operation}
X
XThe UpdateAbove operation is used to propagate the changes made to an portion
Xof an image up to any of its ``dependants'', i.e. objects that are above it.
XThis operation may be optimized by taking into consideration the extent of the
Xsource of each mapping. 
X
X\begin{tabbing}
XPROCEDURE \= INDENT \= INDENT \= INDENT \= \kill
XUpdateAbove ($A$, $R$)
X\\
X\>	For each $X$ above $A$, from bottom to top \\
X\>\>		if $A.R \cap\ X.R$ \\
X\>\>\>		$A.R \cap\ X.R \Rightarrow\ X.S$ \\
X\>\>\>		$X.$changed $ = $ {\em true} \\
X\>	{\em Any object covering a portion of $A$ should have that}\\
X\>	{\em portion in its save buffer, and also has to be redrawn.}\\
X\\
X\>	$B$ = Above($A$) \\
X\>	if $B.$changed \\
X\>\>		Draw($B$) \\
X\>\>		$B.$changed $ = $ {\em false} \\
X\>\>		UpdateAbove ($B$, $B.R$)
X\>\>		{\em Recursively apply the operation to $B$}
X\end{tabbing}
X
XNote that the tail recursion in UpdateAbove can be easlily eliminated.
X
X\subsection{{\em Hide\/} operation}
X
XThe {\em Hide\/} operation is considerably simpler now that we have
XUpdateAbove defined:
X
X\begin{tabbing}
XPROCEDURE \= INDENT \= INDENT \= INDENT \= \kill
XHide ($A$)
X\\
X\>	$A.S \Rightarrow\ A.R$
X\>	UpdateAbove ($A$, $A.R$)
X\end{tabbing}
X
X\section{{\em Move\/} operation}
X
X\begin{figure}
X\vspace{3.3in}
X\special{psfile=move.ps} 
X\caption{Move $A$}
X\label{move_a}
X\end{figure}
X
X\end{document}
X
END_OF_FILE
if test 2287 -ne `wc -c <'xpic/doc/test.latex'`; then
    echo shar: \"'xpic/doc/test.latex'\" unpacked with wrong size!
fi
# end of 'xpic/doc/test.latex'
fi
if test -f 'xpic/doc/test.psfig' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/doc/test.psfig'\"
else
echo shar: Extracting \"'xpic/doc/test.psfig'\" \(1910 characters\)
sed "s/^X//" >'xpic/doc/test.psfig' <<'END_OF_FILE'
X.so header.new
X.de (e
X.(l
X.in +1i
X.ft C
X..
X.de )e
X.ft
X.in -1i
X.)l
X..
X.pp
XThis is a sample document, formatted with the \fI-me\fP macros, and is
Xmeant to demonstrate the inclusion of \fIxpic\fP figures in
X\fItroff\fP. For the record, this document was printed using the commands
X.(e
Xpsfig test.psfig.me | psroff -me
X.)e
X.pp
XWithout further ado, a simple, somewhat abstract figure, drawn
Xwith \fIxpic\fP,\**
X.(f
X\** by Victor Greenberg (\fIvg at dgp\fP)
X.)f
Xthen converted to PostScript\(rg\**
X.(f
X\** PostScript is a registered trade-mark of Adobe, Inc.
X.)f
Xusing \fIx2ps\fP 
X.(e
Xx2ps victor.x > victor.ps
X.)e
Xand included by the simple \fIpsfig\fP
Xcommands
X.(e
X\&.F+
Xfigure victor.ps
X\&.F-
X.)e
X.F+
Xfigure victor.ps
X.F-
X.pp
XAs we can see, there's nothing to it, really!
XSome might argue that the previous picture was hardly a test of the
Xcapabilities of \fIxpic, x2ps, psfig,\fP and PostScript\(rg. True, but
Xit is the thought that counts, wouldn't you say. Still, to quell any
Xdoubts, let's move on to a somewhat more intricate picture.
X.pp
XThis picture was drawn using a larger than life drawing area\**, 
X.(f
X\** by Marcel Leblanc (\fIleblanc at godzilla.ele\fP)
X.)f
Xand was
Xscaled down for conversion using the command 
X.(e
Xx2ps -s 0.5 marcel.x > marcel.ps
X.)e
Xand included in this document by
X.bp
X.(e
X\&.F+
Xfigure marcel.ps
X\&.F-
X.)e
Xto give:
X.F+
Xfigure marcel.ps
X.F-
X.pp
XActually, the scale of 0.5 is a little cramped - this figure was
Xactually meant to be seen in landscape mode, at a slightly larger 0.6! 
XThat can be achieved by:
X.(e
Xx2ps -s 0.6 -r marcel.x > marcel.ps.land
X.)e
Xand included in the document by
X.(e
X\&.F+
Xfigure marcel.ps.land
X\&.F-
X.)e
XAs can be seen, \fIx2ps\fP provides all the information that
X\fIpsfig\fP needs to correctly position the figure on the page, and
Xleave enough space for it. Alas, not wise wnough to handle page breaks
Xcorrectly, it seems!
X.bp
X.F+
Xfigure marcel.ps.land
X.F-
END_OF_FILE
if test 1910 -ne `wc -c <'xpic/doc/test.psfig'`; then
    echo shar: \"'xpic/doc/test.psfig'\" unpacked with wrong size!
fi
# end of 'xpic/doc/test.psfig'
fi
if test -f 'xpic/doc/tex/funstuff.tex' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/doc/tex/funstuff.tex'\"
else
echo shar: Extracting \"'xpic/doc/tex/funstuff.tex'\" \(1899 characters\)
sed "s/^X//" >'xpic/doc/tex/funstuff.tex' <<'END_OF_FILE'
X\font\Xtenrm = cmr10
X\catcode`@=11
X\expandafter\ifx\csname graph\endcsname\relax \alloc at 4\box\chardef\insc at unt\graph\fi
X\catcode`@=12
X\setbox\graph=\vtop{%
X  \baselineskip=0pt \lineskip=0pt \lineskiplimit=0pt
X  \vbox to0pt{\hbox{%
X    \special{pn 8}%
X    \rlap{\kern  2.462in\lower 1.078in\hbox to 0pt{\hss {\Xtenrm A }\hss}}%
X    \rlap{\kern  2.374in\lower 0.316in\hbox to 0pt{\hss {\Xtenrm B }\hss}}%
X    \rlap{\kern  1.762in\lower 0.716in\hbox to 0pt{\hss {\Xtenrm c }\hss}}%
X    \rlap{\kern  1.262in\lower 0.716in\hbox to 0pt{\hss {\Xtenrm c }\hss}}%
X    \rlap{\kern  0.700in\lower 0.366in\hbox to 0pt{\hss {\Xtenrm B }\hss}}%
X    \rlap{\kern  0.600in\lower 1.078in\hbox to 0pt{\hss {\Xtenrm A }\hss}}%
X    \special{pa 37 12}%
X    \special{pa 1549 12}%
X    \special{pa 1549 2999}%
X    \special{pa 3024 3011}%
X    \special{pa 3036 1487}%
X    \special{pa 25 1499}%
X    \special{pa 14 13}%
X    \special{pa 1563 13}%
X    \special{pa 1552 3012}%
X    \special{pa 16 3024}%
X    \special{pa 5 1513}%
X    \special{pa 3054 1489}%
X    \special{pa 3043 3}%
X    \special{pa 1582 15}%
X    \special{pa 1533 1502}%
X    \special{pa 1533 1502}%
X    \special{sp}%
X    \special{ar 575 1512 550 799  0.000  6.283}%
X    \special{ar 2474 1512 550 799  0.000  6.283}%
X    \special{pn 40}%
X    \special{ar 1512 2374 612 612  0.000  6.283}%
X    \special{ar 1525 625 612 612  0.000  6.283}%
X    \special{pn 10}%
X    \special{pa 25 12}%
X    \special{pa 3024 3012}%
X    \special{da  0.150}%
X    \special{pa 25 3012}%
X    \special{pa 3024 12}%
X    \special{da  0.150}%
X    \special{pa 25 3012}%
X    \special{pa 3024 3012}%
X    \special{da  0.001}%
X    \special{pa 3024 3012}%
X    \special{pa 3024 12}%
X    \special{da  0.001}%
X    \special{pa 3024 12}%
X    \special{pa 25 12}%
X    \special{da  0.001}%
X    \special{pa 25 12}%
X    \special{pa 25 3012}%
X    \special{da  0.001}%
X    \kern  3.055in
X  }\vss}%
X  \kern  3.025in
X}
END_OF_FILE
if test 1899 -ne `wc -c <'xpic/doc/tex/funstuff.tex'`; then
    echo shar: \"'xpic/doc/tex/funstuff.tex'\" unpacked with wrong size!
fi
# end of 'xpic/doc/tex/funstuff.tex'
fi
if test -f 'xpic/gels.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/gels.c'\"
else
echo shar: Extracting \"'xpic/gels.c'\" \(2708 characters\)
sed "s/^X//" >'xpic/gels.c' <<'END_OF_FILE'
X/* $Header: gels.c,v 1.3 88/08/31 23:41:55 moraes Exp $ */
X#include "xpic.h"
X#include "gels.h"
X
X/*
X *  These routines create new gels of the appropriate types, and push them
X *  on a gelList.
X */
X
X/*
X *  Circles, and Ellipses
X */
Xvoid AddConicGel(g, type, xc, yc, xr, yr, attr, xmin, ymin, xmax, ymax, thickness)
XGel **g;
Xint type;
Xint xc, yc, xr, yr, attr, thickness;
Xint xmin, ymin, xmax, ymax;
X{
X	Conic *data;
X	Gel *gel;
X	
X	if ((gel = NewGel()) != NULL) {
X		if ((data = (Conic *) malloc(sizeof(Conic))) == NULL) {
X		 	message("Not enough memory for Ellipse element");
X			FreeGel(gel);
X			return;
X		}
X		data->centre.x = xc;
X		data->centre.y = yc;
X		data->xrad = xr;
X		data->yrad = yr;
X		gel->data = (caddr_t) data;
X		gel->type = type;;
X		gel->b_box.ll.x = xmin;
X		gel->b_box.ll.y = ymin;
X		gel->b_box.ur.x = xmax;
X		gel->b_box.ur.y = ymax;
X		gel->attributes = attr;
X		gel->linewidth = thickness;
X		gel->next = NULL;
X		(void) PushGel(g, gel);
X	}
X}
X
X
X/*
X *  Text
X */
Xvoid AddTextGel(g, s, len, font, size, fontname, fontsize, attr, x, y, 
X x1, y1, x2, y2)
XGel **g;
Xchar *s;
XFontFamily *font;
Xchar *fontname;
Xint len, size, attr, x, y, x1, y1, x2, y2;
X{
X	TextString *data;
X	Gel *gel;
X	
X	if ((gel = NewGel()) != NULL) {
X		if ((data = (TextString *) malloc(sizeof(TextString))) == NULL) {
X		 	message("Not enough memory for Text element");
X			FreeGel(gel);
X			return;
X		}
X		data->str = s;
X		data->length = len;
X		data->font = font;
X		data->sizeindex = size;
X		data->fontname = fontname;
X		data->fontsize = fontsize;
X		data->x = x;
X		data->y = y;
X		gel->data = (caddr_t) data;
X		gel->type = TEXT;
X		gel->b_box.ll.x = x1;
X		gel->b_box.ll.y = y1;
X		gel->b_box.ur.x = x2;
X		gel->b_box.ur.y = y2;
X		gel->attributes = attr;
X		gel->next = NULL;
X		(void) PushGel(g, gel);
X	}
X}
X
X
X/*
X *  A box is represented by its bounding box
X */
Xvoid AddBoxGel(g, x1, y1, x2, y2, attr, thickness)
XGel **g;
Xint x1, y1, x2, y2, attr, thickness;
X{
X	Gel *gel;
X	
X	if ((gel = NewGel()) != NULL) {
X		gel->data = (caddr_t) NULL;
X		gel->type = BOX;
X		gel->b_box.ll.x = x1;
X		gel->b_box.ll.y = y1;
X		gel->b_box.ur.x = x2;
X		gel->b_box.ur.y = y2;
X		gel->attributes = attr;
X		gel->linewidth = thickness;
X		gel->next = NULL;
X		(void) PushGel(g, gel);
X	}
X}
X
X/*
X *  For lines, and splines
X */
Xvoid AddLineGel(g, type, pt, attr, xmin, ymin, xmax, ymax, thickness)
XGel **g;
XPointList *pt;
Xint type;
Xint attr, xmin, ymin, xmax, ymax, thickness;
X{
X	Gel *gel;
X	
X	if ((gel = NewGel()) != NULL) {
X		gel->data = (caddr_t) pt;
X		gel->type = type;
X		gel->b_box.ll.x = xmin;
X		gel->b_box.ll.y = ymin;
X		gel->b_box.ur.x = xmax;
X		gel->b_box.ur.y = ymax;
X		gel->attributes = attr;
X		gel->linewidth = thickness;
X		gel->next = NULL;
X		(void) PushGel(g, gel);
X	}
X}
END_OF_FILE
if test 2708 -ne `wc -c <'xpic/gels.c'`; then
    echo shar: \"'xpic/gels.c'\" unpacked with wrong size!
fi
# end of 'xpic/gels.c'
fi
if test -f 'xpic/globals.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/globals.h'\"
else
echo shar: Extracting \"'xpic/globals.h'\" \(3293 characters\)
sed "s/^X//" >'xpic/globals.h' <<'END_OF_FILE'
X#ifndef __XPIC_GLOBALS_H__
X#define __XPIC_GLOBALS_H__
X/*
X * This program has far too much global state for its own good. Oh well!
X */
Xint drawingMode;			/* Stores the current drawing mode:START_MODE etc*/
Xint objectType;				/* stores the current object type - LINE, etc. */
Xint editType;				/*
X							 *  stores the current editing operation -
X							 *  Copy, delete, move, etc.
X							 */
Xint editMode;				/*
X							 *  Stores the current editing mode - BLOCK,
X							 *  ELEMENT
X							 */
X
Xint line_type;
Xint line_arrow;
X
Xstruct {
X	char *pattern;
X	int len;
X} LineTypes[NSTYLES];
X
Xint fill_type;
XPixmap FillTypes[NFILLSTYLES];
X
X/* Stuff to store text parameters */
Xint textVertAlign, textHorizAlign;
X
X/*  The next few globals contain info about the current font */
XXFontStruct *textFont;			/* Pointer to the current font XFontStruct */
Xint textSize;					/* The point size of the current font */
Xint spacePad;					/* The space pad required for the font */
XFontFamily *fontType;			/* The name of a font */
XCell *CurrentCell;				/* The current cell being viewed */
XCell *LastCell;
XCell *MainCell;					/* head of the linked list of cells */
XGel *KillBuffer;				/* gel list of cut objects, saved for paste */
Xint KillX, KillY;				/* mouse position when objects were cut */
XBox picBox;
Xchar *nullfile;
Xchar *argfile;
Xchar errstring[128];
Xchar *homeDir;
XFILE *inFile, *outFile;
XBOOL backupOnWrite;
Xint mouseResolution;
Xint GelCounter;
Xint lineThickness;
Xchar *progname;
X
X/*
X * X Windows globals. The clean thing to do would be to put these in a struct
X * and make the thing a pic widget. One day...
X */
X
X/* The page width and height, in tenths of an inch */
Xint pageWidth, pageHeight;
X
XWidget outerFrame;		/* The main window frame */
XWidget picWidget;
XWindow picWin;			/* The actual drawing window */
X/* We shouldn't need these in X11 */
Xint picWinWidth;
Xint picWinHeight;
Xint minPicWidth, minPicHeight;
XWidget inputWidget;
XWindow inputWin;
XDisplay *picDpy;
X
X/*
X *  These are the 'current' GC values - the current element will use
X *  these values
X */
XGC gcNormal, gcInvert, gcErase, gcGray;
X/* Used for boxes, outlines, drags etc */
XGC gcBlock;
X/* 
X *  The contents of tmpGcNormal and Invert can be changed at any time by
X *  any routine. They're meant to be fast change GCs. Note that all the
X *  xxx_adj() routines use it, and make the HORRIBLE assumptions that
X *  no-one will change these during an ADJUST (START_MODE to END_MODE
X *  back to START_MODE) operation. Otherwise, we either need lots of GCs
X *  or we need lots of changes to the GCs when rubber banding.
X */
XGC tmpGcNormal, tmpGcInvert, tmpGcErase;
XXGCValues gcVal;
X
XPixmap gridTile;
XPixmap blankTile;
Xint gridSpacing;
XBOOL gridOn;
X
XPixel cursorColor, gridColor, highlight;
X/*
X *  verts is the XPoint buffer for the points input by the user for lines
X *  and splines
X */
XXPoint *verts;			/* Used to store lines and splnes temporarily */
Xint nVerts;
Xint maxVerts;
X
X/*
X *  Stores the 'flattened' output of the BSpline routines. Flattening is
X *  the process by which the polygon defining the spline is converted into
X *  the lots of little line segments forming the curve. 
X */
XXPoint *flatVerts;
Xint flatSize;
Xint nFlat;
XXPoint *flatVerts2;
Xint flatSize2;
X
X#endif /* __XPIC_GLOBALS_H__ */ /* Do not add anything after this line */
END_OF_FILE
if test 3293 -ne `wc -c <'xpic/globals.h'`; then
    echo shar: \"'xpic/globals.h'\" unpacked with wrong size!
fi
# end of 'xpic/globals.h'
fi
if test -f 'xpic/grid.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/grid.c'\"
else
echo shar: Extracting \"'xpic/grid.c'\" \(2627 characters\)
sed "s/^X//" >'xpic/grid.c' <<'END_OF_FILE'
X/* $Header: grid.c,v 1.3 88/08/19 00:00:27 moraes Exp $ */
X#include <stdio.h>
X#include <sys/types.h>
X#include <X11/Xos.h>
X
X/* size in bytes of a bitmap */
X#define BitmapSize(width, height) ((((width) + 7) * (height))/8)
X
X/*
X *  Makes a bitmap of the right size for the given grid-point spacing, 5
X *  grid points to a cross
X */
Xchar *makegrid(sep, size, width, height)
Xint sep;
Xint *size;
Xint *width;
Xint *height;
X{
X	char *data;
X	register int i, j;
X	extern char *calloc();
X	
X	if (sep < 4) {
X		message("makegrid: Separation too small");
X		return( (char *) NULL);
X	}
X
X	(*width) = (*height) = sep * 5;
X	(*size) = BitmapSize(*width, *height);
X	if ((data = (char *) calloc((unsigned) *size, (unsigned) 1)) == NULL) {
X		message("makegrid: Not enough memory for grid");
X		return( (char *) NULL);
X	}
X
X	/* For each vertical grid point */
X	for(j = 0; j < (*height); j += sep) {
X		/* For each horizontal grid point */
X		for (i = 0; i < (*width); i += sep) {
X			/* Generate the grid point */
X			setbit(data, *width, i, j);
X		}
X	}
X
X	/* Do the special stuff at the cross */
X	*data |= 0x0007;				/* first 3 bits in the top line */
X
X	setbit(data, *width, (*width) - 2, 0);	/* last 2 bits in the top line */
X	setbit(data, *width, (*width) - 1, 0);
X
X	setbit(data, *width, 0, 1);				/* first bit in second and third */
X	setbit(data, *width, 0, 2);				/* lines */
X
X	setbit(data, *width, 0, (*height) - 2);	/* first bit in the last but one */
X	setbit(data, *width, 0, (*height) - 1);	/* and last lines */
X
X	return(data);
X}
X
Xsetbit (raster, width, x, y)
Xchar *raster;
Xregister int x;
Xint y;
X{
X	register char *byte = raster + x/8 + y*((width+7)/8);
X	x %= 8;
X	*byte |= (1 << x);
X}
X
X
X
X#ifdef TEST
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X	FILE *file = stdout;
X	char *fname;
X	register int i;
X	int spacing = 8;
X	char *bitmap;
X	int bitmap_size, bitmap_wide, bitmap_high;
X	
X
X	if (argc > 1) {
X		fname = argv[1];
X		if ((file = fopen(fname, "w")) == NULL) {
X			error("Can't open file");
X			/*NOTREACHED*/
X		}
X	}
X	if (argc > 2)
X		spacing = atoi(argv[2]);
X
X	bitmap = makegrid(spacing, &bitmap_size, &bitmap_wide, &bitmap_high);
X
X	(void) fprintf (file, "#define grid%d_width %d\n", spacing, bitmap_wide);
X	(void) fprintf (file, "#define grid%d_height %d\n", spacing, bitmap_high);
X	(void) fprintf (file, "static char grid%d_bits[] = {\n   0x%02x",
X		spacing, (u_char) bitmap[0]);
X
X	for (i=1;i<bitmap_size;i++) {
X		(void) fprintf (file, ",");
X		(void) fprintf (file, (i % 12) ? " " : "\n   ");
X		(void) fprintf (file, "0x%02x", (u_char) bitmap[i]);
X	}
X	(void) fprintf (file, "};\n");
X}
X
Xerror(s)
Xchar *s;
X{
X	(void) fprintf(stderr, "%s\n", s);
X	exit(1);
X}
X#endif
END_OF_FILE
if test 2627 -ne `wc -c <'xpic/grid.c'`; then
    echo shar: \"'xpic/grid.c'\" unpacked with wrong size!
fi
# end of 'xpic/grid.c'
fi
if test -f 'xpic/input.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/input.c'\"
else
echo shar: Extracting \"'xpic/input.c'\" \(2908 characters\)
sed "s/^X//" >'xpic/input.c' <<'END_OF_FILE'
X/* $Header: input.c,v 1.4 89/04/21 03:30:49 xwindows Exp $ */
X#include <ctype.h>
X
X#include "xpic.h"
X#include "windows.h"
X#include "Minibuf.h"
X
Xstatic char *input;
Xstatic BOOL done;
X
X/*
X *  This routine focuses all input on the inputWindow, and starts up a
X *  loop which forms a secondary dispatcher, ignoring all events except
X *  ExposeWindow events on windows other than the inputWindow. This
X *  effectively forces the user to use the inputWindow. The loop
X *  terminates when input is completed, either by inputting a string, in
X *  which case finished_input will be invoked, or by aborting.  Both set
X *  the completion flag and the loop quits, focussing input back to the
X *  previous holder. No harm is done to this application if focus is not
X *  given to the minibuffer, or removed from it - it's just more
X *  convenient for the user who doesn't have to move a mouse around too
X *  much.  The routine returns the input string, or a NULL if the input
X *  was aborted.
X */
Xchar *get_input(prompt, default_string, complete)
Xchar *prompt, *default_string;
X{
X	XEvent ev;
X	extern void SetWorkingCursor(), SetTextCursor();
X	
X	MinibufGetInput(inputWidget, prompt, default_string, complete);
X	AcquireFocus(inputWidget);
X	XtAddGrab(inputWidget, False, False);
X	done = FALSE;
X	SetTextCursor();
X	while (!done) {
X		XtNextEvent(&ev);
X		(void) XtDispatchEvent(&ev);
X	}
X	SetWorkingCursor();
X	ReleaseFocus(inputWidget);
X	XtRemoveGrab(inputWidget);
X	return(input);
X}
X
X
X/*
X *  Callback, invoked when user hits RETURN in the inputWidget (or whatever
X *  the user has bound 'newline' to) in which case inp_string points to
X *  an alloc'ed string. If the user aborts input (^G, ^C) then
X *  inp_string is NULL
X */
X/*ARGSUSED*/
Xvoid finished_input(w, tag, inp_string)
XWindow w;
Xcaddr_t tag;
Xchar *inp_string;
X{
X	input = inp_string;
X	done = TRUE;
X}
X
X
X/* 
X *  Asks to confirm something - If they reply "y", returns YES, if they
X *  reply "n", returns NO, if they abort, returns ABORT. You are given
X *  IMPATIENCE tries to answer
X */
Xconfirm(query, default_answer)
Xchar *default_answer;
Xchar *query;
X{
X	char *answer;
X	char c;
X	char *mesg = "Answer yes or no, please (y/n)";
X	int count = 0;
X#define IMPATIENCE	5
X
X	do {
X		if ((answer = get_input(query, default_answer, FALSE)) == NULL)
X			return (ABORT);
X		c = (isupper(answer[0])) ? tolower(answer[0]) : answer[0];
X		if (c == 'y')
X			return(YES);
X		else if (c == 'n')
X			return(NO);
X		message(mesg);
X		/* Let's get really explicit next time */
X		mesg = "Type 'y' and RETURN if you want to answer YES, 'n' for NO, CTRL-G to abort";
X	} while (count++ < IMPATIENCE);
X	message("Forget it - Aborting");
X	return(ABORT);
X}
X
X
X/*
X *  Message is printed on the communication line if the windows are
X *  mapped, otherwise fprintf'ed to stderr
X */
Xmessage(s)
Xchar *s;
X{
X	if (inputWidget != 0)
X		MinibufDisplayMessage(inputWidget, s, TRUE);
X	else
X		(void) fprintf(stderr, "%s\n", s);
X}
END_OF_FILE
if test 2908 -ne `wc -c <'xpic/input.c'`; then
    echo shar: \"'xpic/input.c'\" unpacked with wrong size!
fi
# end of 'xpic/input.c'
fi
if test -f 'xpic/obj_xxx.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/obj_xxx.c'\"
else
echo shar: Extracting \"'xpic/obj_xxx.c'\" \(1919 characters\)
sed "s/^X//" >'xpic/obj_xxx.c' <<'END_OF_FILE'
X/* $Header: obj_xxx.c,v 1.4 89/02/23 02:48:19 xwindows Exp $ */
X/*
X *  The xxx object routines 
X */
X#include "xpic.h"
X#include "windows.h"
X#include "spline.h"
X#include "gels.h"
X#include "draw.h"
X#include "input.h"
X#include "newfonts.h"
X#include "assert.h"
X
X
Xxxx_event(evtype, mx, my)
X{
X	switch(evtype) {
X	case MOTION | START_MODE:
X	case RIGHT  | START_MODE:
X	case MIDDLE | START_MODE:
X	case REDRAW | START_MODE:
X		break;
X	case MOTION | END_MODE:
X	case LEFT | START_MODE:
X	case LEFT | END_MODE:
X	case RIGHT | END_MODE:
X	case MIDDLE | END_MODE:
X	case REDRAW | END_MODE:
X	default:
X#ifdef DEBUG
X		(void) sprintf(errstring, "Hey! Unknown XXX mode %d", drawingMode);
X		message(errstring);
X#endif
X		break;
X	}
X	ASSERT(allock(), "xxx_event");
X}
X
X
Xxxx_abort()
X{
X	/*
X	 *  We need to simulate a button press event that will terminate
X	 *  or abort gracefully, and sicen we don't know our mouse
X	 *  position, and pass 0, 0, the action taken must be
X	 *  independent of mouse location. For some objects, that's the
X	 *  MIDDLE button. For others, its the RIGHT button.
X	 */
X	xxx_event((APPROPRIATE_BUTTON | drawingMode), 0, 0);
X}
X	
X
Xxxx_adj(evtype, gel, mx, my)
Xint evtype;
XGel *gel;
Xint mx, my;
X{
X	/*
X	 *  Will not need to process MOTION|START_MODE, RIGHT|START_MODE,
X	 *  REDRAW|START_MODE - these are taken care of in
X	 *  the adj_element routine.
X	 */
X	switch(evtype) {
X	case MOTION | END_MODE:
X		break;
X	case LEFT | START_MODE:
X		break;
X	case LEFT | END_MODE:
X		break;
X	case RIGHT | END_MODE:
X		break;
X	case MIDDLE | START_MODE:
X		break;
X	case MIDDLE | END_MODE:
X		break;
X	case REDRAW | END_MODE:
X		break;
X	default:
X#ifdef DEBUG
X		(void) sprintf(errstring, "Hey! Unknown mode %d in text_adj", 
X		 evtype);
X		message(errstring);
X#endif
X		break;
X	}
X	ASSERT(allock(), "xxx_adj");
X}
X
X/*
X * Finds distance of point from the gel. This is computed using a gel
X * dependent rule
X */
Xxxx_distance(gel, mx, my)
XGel *gel;
Xint mx, my;
X{
X}
END_OF_FILE
if test 1919 -ne `wc -c <'xpic/obj_xxx.c'`; then
    echo shar: \"'xpic/obj_xxx.c'\" unpacked with wrong size!
fi
# end of 'xpic/obj_xxx.c'
fi
if test -f 'xpic/spline.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/spline.c'\"
else
echo shar: Extracting \"'xpic/spline.c'\" \(2830 characters\)
sed "s/^X//" >'xpic/spline.c' <<'END_OF_FILE'
X/* $Header: spline.c,v 1.2 88/08/19 00:01:09 moraes Exp $ */
X/* 
X *  Computes a quadratic B-spline (third-order) - this is derived from
X *  the equations given in Rogers and Adams (Sec 5-8) , but for the
X *  specific 3rd order case. The inner loop has been tuned a lot,
X *  particularly the calculation of the three constants. The routine
X *  takes the vertex array v, and the number of vertices nverts, and
X *  returns the spline points in the vertex array flattened and the
X *  number of flattened vertices in nFlat. flatsize is the size of the
X *  buffer which is passed in - th ebuffer 'flattened' must be obtained
X *  by malloc() since the routine will expand it with realloc if there
X *  isn't enough space. That's what InitSpline is for
X */
X/* NOTE: Splines are to be drawn CoordModeRelative */
X#include <stdio.h>
X#include <X11/Xlib.h>
X
Xextern void error();
Xextern char errstring[];
X
X#define VERTEXBLOCK	512				/* 
X									 *  The array of flattened vertices is
X									 *  allocated space in chunks of
X									 *  VERTEXBLOCK
X			 						 */
X
X#define DELTA (long) 100
X/*
X *  rather than take t from 0 to in steps of DELTA where DELTA < 1, we
X *  take t from 0 to SCALE in steps of DELTA where DELTA is an integer
X */
X#define SCALE (long) (10 * DELTA)
X
Xvoid FlattenSpline (v, nVerts, flattened, nFlat, flatSize) 
Xregister XPoint *v; 
Xint nVerts;
XXPoint *flattened[];
Xint *nFlat;
Xint *flatSize;
X{
X	register long t, k1, k2, k3, t_old; 
X	register int i; 
X	XPoint new;
X	XPoint current;		/* Current point */
X	register XPoint *tmp;
X	extern char *realloc();
X
X	*nFlat = (nVerts - 1) * SCALE / DELTA;
X	while (*nFlat >= *flatSize) {
X		*flatSize += VERTEXBLOCK;
X		if ((*flattened = (XPoint *) realloc((char *) *flattened, 
X		 (unsigned) ((*flatSize) * sizeof(XPoint)))) == 0) {
X		 	(void) sprintf(errstring,
X			 "No more memory for spline buffer - Need %d\n", *flatSize);
X			message(errstring);
X			return;
X		}
X	}
X	v[0] = v[1];
X	v[nVerts] = v[nVerts-1];
X	current = v[0];
X	tmp = *flattened;
X	for (i = 0; i < nVerts-1; i++) {
X		for (k3 = 0, t_old = -DELTA, t = 0; t < SCALE; t += DELTA) {
X			k1 = k3 - t_old - DELTA + SCALE / 2;
X			k2 = SCALE - k3 - k1;
X			new.x = (k1*v[i].x + k2*v[i+1].x + k3*v[i+2].x + SCALE/2) / SCALE;
X			new.y = (k1*v[i].y + k2*v[i+1].y + k3*v[i+2].y + SCALE/2) / SCALE;
X			tmp->x = new.x - current.x;
X			tmp->y = new.y - current.y;
X			tmp++;
X			k3 += DELTA * (DELTA / 2 + t) / SCALE;
X			t_old = t;
X			current = new;
X		}
X	}
X	(*flattened)->x = v[0].x;
X	(*flattened)->y = v[0].y;
X}
X
X
X/* 
X *  InitSpline justs malloc's the initial chunk of memory for flattened
X */
XXPoint *InitSpline(flatSize)
Xint *flatSize;
X{
X	XPoint *flattened;
X	extern char *calloc();
X	
X	*flatSize = VERTEXBLOCK;
X	if ((flattened = (XPoint *) calloc((unsigned) *flatSize, sizeof(XPoint)))
X	 == 0)
X		return((XPoint *) 0);
X
X	return(flattened);
X}
X	
X
END_OF_FILE
if test 2830 -ne `wc -c <'xpic/spline.c'`; then
    echo shar: \"'xpic/spline.c'\" unpacked with wrong size!
fi
# end of 'xpic/spline.c'
fi
if test -f 'xpic/test/test.x.land' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/test/test.x.land'\"
else
echo shar: Extracting \"'xpic/test/test.x.land'\" \(3329 characters\)
sed "s/^X//" >'xpic/test/test.x.land' <<'END_OF_FILE'
X10 40 1090 730 10
X3 45 180 640 260 660 4 1
X6 48 95 690 170 708 6000 0
X170 690 11 0 3
Xhello world
X2 54 770 480 880 610 32 1
X13
X 770 490 810 480 810 520 820 520
X 850 510 870 480 880 560 870 580
X 840 580 840 560 800 590 800 610
X 850 610
X6 42 171 670 270 690 0 0
X220 680 11 3 3
Xhello world
X3 46 170 670 270 690 4 1
X5 36 500 580 480 520 0 1
X540 500 40 20
X5 37 500 620 550 590 2 1
X560 570 60 20
X6 1 580 633 655 660 9000 0
X580 660 11 0 6
Xhello world
X5 49 600 750 500 520 1 1
X675 510 75 10
X6 3 398 630 463 648 4000 0
X430 630 10 0 3
Xtop center
X5 2 630 740 550 620 3 1
X685 585 55 35
X3 47 340 630 530 680 4 1
X6 4 384 663 476 680 8000 0
X430 680 13 0 3
Xbottom center
X6 0 530 680 595 698 5000 0
X530 680 14 0 3
Xlj top (moved)
X2 56 890 560 1050 730 34 1
X13
X 910 580 1000 560 970 650 930 640
X 930 620 1040 650 1050 690 940 730
X 890 690 890 680 910 680 960 700
X 1010 620
X2 55 890 470 1090 580 33 1
X10
X 900 490 960 470 960 570 890 550
X 890 540 960 540 1090 510 1060 480
X 1010 510 1050 580
X2 57 920 280 1080 430 31 1
X8
X 970 290 1050 280 1000 370 1000 320
X 1060 320 1080 340 1000 430 920 430
X2 53 790 330 920 450 30 1
X7
X 790 330 870 330 830 380 860 390
X 920 390 840 450 810 450
X2 52 820 170 990 290 10 1
X12
X 820 170 910 170 930 230 860 250
X 860 220 930 240 980 260 990 200
X 970 180 910 260 900 290 860 290
X2 51 790 40 1050 150 20 1
X11
X 850 40 790 80 890 70 970 50
X 980 100 870 150 830 110 790 100
X 890 100 1050 90 1010 50
X6 50 95 653 170 670 a000 0
X170 670 11 0 3
Xhello world
X3 44 180 610 260 630 4 1
X3 43 180 570 260 590 4 1
X6 41 180 641 260 659 0 0
X220 650 11 1 3
Xhello world
X6 40 183 611 258 629 0 0
X220 620 11 2 3
Xhello world
X6 39 183 571 258 589 0 0
X220 580 11 0 3
Xhello world
X5 38 20 150 570 650 4 1
X85 610 65 40
X4 35 360 460 480 580 4 1
X420 520 60
X4 34 280 470 360 550 3 1
X320 510 40
X4 33 180 470 260 550 2 1
X220 510 40
X4 32 100 470 180 550 1 1
X140 510 40
X4 31 10 460 90 540 0 1
X50 500 40
X1 30 700 350 750 460 24 1
X5
X 700 450 700 350 750 450 750 350
X 710 460
X1 29 630 350 670 450 14 1
X4
X 630 450 630 350 670 450 670 350
X1 28 500 350 600 450 34 1
X5
X 500 350 550 450 550 350 600 450
X 600 400
X1 27 350 350 500 450 33 1
X8
X 400 350 350 400 400 400 400 450
X 450 400 440 450 500 450 440 350
X1 26 250 350 350 450 23 1
X4
X 250 350 350 350 250 450 350 450
X1 25 150 350 250 450 13 1
X5
X 150 350 150 450 200 350 200 450
X 250 400
X1 24 40 350 110 450 32 1
X5
X 50 350 110 350 50 400 110 400
X 40 450
X1 23 730 200 770 320 22 1
X5
X 730 200 730 300 770 200 770 300
X 730 320
X1 22 680 180 710 300 12 1
X5
X 680 300 680 200 710 300 710 200
X 680 180
X1 21 620 200 650 300 31 1
X4
X 620 300 620 200 650 300 650 200
X1 20 570 200 600 300 21 1
X4
X 570 300 570 200 600 300 600 200
X1 19 470 200 550 300 11 1
X5
X 470 300 470 210 500 300 500 200
X 550 300
X1 18 400 200 450 300 30 1
X5
X 400 200 450 300 400 300 450 200
X 450 250
X1 17 350 200 380 300 20 1
X4
X 350 200 360 280 370 210 380 300
X1 16 280 200 330 300 10 1
X5
X 280 200 280 300 310 200 310 300
X 330 200
X1 15 200 200 250 300 4 1
X4
X 200 300 200 200 250 300 250 200
X1 14 120 200 170 300 3 1
X4
X 120 300 120 200 170 300 170 200
X1 13 50 200 100 300 2 1
X4
X 50 200 50 300 100 200 100 300
X1 12 730 50 780 150 1 1
X4
X 730 50 730 150 780 150 780 50
X1 11 650 50 700 150 0 1
X4
X 650 50 650 150 700 150 700 50
X3 10 480 90 570 120 4 1
X3 9 460 80 590 130 3 1
X3 8 440 60 610 150 2 1
X3 7 260 40 380 80 1 1
X3 6 210 110 410 150 0 1
X3 5 50 50 170 140 0 1
END_OF_FILE
if test 3329 -ne `wc -c <'xpic/test/test.x.land'`; then
    echo shar: \"'xpic/test/test.x.land'\" unpacked with wrong size!
fi
# end of 'xpic/test/test.x.land'
fi
if test -f 'xpic/test/test2.x' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/test/test2.x'\"
else
echo shar: Extracting \"'xpic/test/test2.x'\" \(3289 characters\)
sed "s/^X//" >'xpic/test/test2.x' <<'END_OF_FILE'
X8 32 624 832 8
X5 65 400 496 440 472 2 1
X448 456 48 16
X5 64 400 464 384 416 0 1
X432 400 32 16
X6 3 344 504 344 518 4000 0
X344 504 10 0 3
Xtop center
X6 59 344 544 344 558 4000 0
X344 544 13 0 3
Xbottom center
X1 69 376 160 440 240 11 1
X5
X 376 240 376 168 400 240 400 160
X 440 240
X1 70 320 160 360 240 30 1
X5
X 320 160 360 240 320 240 360 160
X 360 200
X1 71 280 160 304 240 20 1
X4
X 280 160 288 224 296 168 304 240
X1 72 224 160 264 240 10 1
X5
X 224 160 224 240 248 160 248 240
X 264 160
X5 63 504 592 440 496 4 1
X548 468 44 28
X2 57 400 592 528 712 31 1
X8
X 440 600 504 592 464 664 464 624
X 512 624 528 640 464 712 400 712
X2 56 200 696 328 832 34 1
X13
X 216 712 288 696 264 768 232 760
X 232 744 320 768 328 800 240 832
X 200 800 200 792 216 792 256 808
X 296 744
X2 55 32 712 192 800 33 1
X10
X 40 728 88 712 88 792 32 776
X 32 768 88 768 192 744 168 720
X 128 744 160 800
X2 54 520 568 608 672 32 1
X13
X 520 576 552 568 552 600 560 600
X 584 592 600 568 608 632 600 648
X 576 648 576 632 544 656 544 672
X 584 672
X2 53 336 576 440 672 30 1
X7
X 336 576 400 576 368 616 392 624
X 440 624 376 672 352 672
X2 52 208 576 344 672 10 1
X12
X 208 576 280 576 296 624 240 640
X 240 616 296 632 336 648 344 600
X 328 584 280 648 272 672 240 672
X2 51 16 592 224 680 20 1
X11
X 64 592 16 624 96 616 160 600
X 168 640 80 680 48 648 16 640
X 96 640 224 632 192 600
X6 50 136 536 136 550 a000 0
X136 536 11 0 3
Xhello world
X5 49 480 600 400 416 1 1
X540 408 60 8
X6 48 136 552 136 566 6000 0
X136 552 11 0 3
Xhello world
X3 47 272 504 424 544 4 1
X3 46 136 536 216 552 4 1
X3 45 144 512 208 528 4 1
X3 44 144 488 208 504 4 1
X3 43 144 456 208 472 4 1
X6 42 176 544 176 560 0 0
X176 544 11 3 3
Xhello world
X6 41 176 520 176 534 0 0
X176 520 11 1 3
Xhello world
X6 40 176 496 176 510 0 0
X176 496 11 2 3
Xhello world
X6 39 176 464 176 478 0 0
X176 464 11 0 3
Xhello world
X5 38 16 120 456 520 4 1
X68 488 52 32
X4 35 288 368 384 464 4 1
X336 416 48
X4 31 8 368 72 432 0 1
X40 400 32
X1 30 560 280 600 368 24 1
X5
X 560 360 560 280 600 360 600 280
X 568 368
X1 29 504 280 536 360 14 1
X4
X 504 360 504 280 536 360 536 280
X1 28 400 280 480 360 34 1
X5
X 400 280 440 360 440 280 480 360
X 480 320
X1 27 280 280 400 360 33 1
X8
X 320 280 280 320 320 320 320 360
X 360 320 352 360 400 360 352 280
X1 26 200 280 280 360 23 1
X4
X 200 280 280 280 200 360 280 360
X1 25 120 280 200 360 13 1
X5
X 120 280 120 360 160 280 160 360
X 200 320
X1 24 32 280 88 360 32 1
X5
X 40 280 88 280 40 320 88 320
X 32 360
X1 23 584 160 616 256 22 1
X5
X 584 160 584 240 616 160 616 240
X 584 256
X1 22 544 144 568 240 12 1
X5
X 544 240 544 160 568 240 568 160
X 544 144
X1 21 496 160 520 240 31 1
X4
X 496 240 496 160 520 240 520 160
X1 20 456 160 480 240 21 1
X4
X 456 240 456 160 480 240 480 160
X1 15 160 160 200 240 4 1
X4
X 160 240 160 160 200 240 200 160
X1 14 96 160 136 240 3 1
X4
X 96 240 96 160 136 240 136 160
X1 13 40 160 80 240 2 1
X4
X 40 160 40 240 80 160 80 240
X1 12 584 40 624 120 1 1
X4
X 584 40 584 120 624 120 624 40
X1 11 520 40 560 120 0 1
X4
X 520 40 520 120 560 120 560 40
X3 7 208 32 304 64 1 1
X3 6 168 88 328 120 0 1
X3 5 40 40 136 112 0 1
X3 8 352 48 488 120 2 1
X3 9 368 64 472 104 3 1
X3 10 384 72 456 96 4 1
X4 75 224 376 288 440 3 1
X256 408 32
X4 74 144 376 208 440 2 1
X176 408 32
X4 73 80 376 144 440 1 1
X112 408 32
X6 60 424 544 424 558 5000 0
X424 544 14 0 3
Xlj top (moved)
X6 1 464 528 464 550 9000 0
X464 528 11 0 6
Xhello world
END_OF_FILE
if test 3289 -ne `wc -c <'xpic/test/test2.x'`; then
    echo shar: \"'xpic/test/test2.x'\" unpacked with wrong size!
fi
# end of 'xpic/test/test2.x'
fi
if test -f 'xpic/test/testtext.pic' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/test/testtext.pic'\"
else
echo shar: Extracting \"'xpic/test/testtext.pic'\" \(1847 characters\)
sed "s/^X//" >'xpic/test/testtext.pic' <<'END_OF_FILE'
X.PS
Xscale = 80
X"\fR\s12hello world\s0\fP" rjust at 270.000000, 21.000000
X"\fR\s12hello world\s0\fP" rjust at 190.000000, 7.000000
X"\fR\s12hello world\s0\fP" rjust at 110.000000, 14.000000
Xline   from 262.000000, 14.000000 \
X	to 278.000000, 14.000000 \
X	to 270.000000, 14.000000 \
X	to 270.000000, 22.000000 \
X	to 270.000000, 6.000000 
Xline   from 182.000000, 14.000000 \
X	to 198.000000, 14.000000 \
X	to 190.000000, 14.000000 \
X	to 190.000000, 22.000000 \
X	to 190.000000, 6.000000 
Xline   from 102.000000, 14.000000 \
X	to 118.000000, 14.000000 \
X	to 110.000000, 14.000000 \
X	to 110.000000, 22.000000 \
X	to 110.000000, 6.000000 
X"\fR\s12hello world\s0\fP" ljust at 430.000000, 101.000000
X"\fR\s12hello world\s0\fP" ljust at 350.000000, 87.000000
Xline   from 342.000000, 94.000000 \
X	to 358.000000, 94.000000 \
X	to 350.000000, 94.000000 \
X	to 350.000000, 102.000000 \
X	to 350.000000, 86.000000 
X"\fR\s12hello world\s0\fP" ljust at 270.000000, 94.000000
X"\fR\s12hello world\s0\fP"  at 190.000000, 101.000000
X"\fR\s12hello world\s0\fP"  at 110.000000, 87.000000
X"\fR\s12hello world\s0\fP"  at 30.000000, 94.000000
Xline   from 422.000000, 94.000000 \
X	to 438.000000, 94.000000 \
X	to 430.000000, 94.000000 \
X	to 430.000000, 102.000000 \
X	to 430.000000, 86.000000 
Xline   from 262.000000, 94.000000 \
X	to 278.000000, 94.000000 \
X	to 270.000000, 94.000000 \
X	to 270.000000, 102.000000 \
X	to 270.000000, 86.000000 
Xline   from 182.000000, 94.000000 \
X	to 198.000000, 94.000000 \
X	to 190.000000, 94.000000 \
X	to 190.000000, 102.000000 \
X	to 190.000000, 86.000000 
Xline   from 102.000000, 94.000000 \
X	to 118.000000, 94.000000 \
X	to 110.000000, 94.000000 \
X	to 110.000000, 102.000000 \
X	to 110.000000, 86.000000 
Xline   from 22.000000, 94.000000 \
X	to 38.000000, 94.000000 \
X	to 30.000000, 94.000000 \
X	to 30.000000, 102.000000 \
X	to 30.000000, 86.000000 
X.PE
END_OF_FILE
if test 1847 -ne `wc -c <'xpic/test/testtext.pic'`; then
    echo shar: \"'xpic/test/testtext.pic'\" unpacked with wrong size!
fi
# end of 'xpic/test/testtext.pic'
fi
if test -f 'xpic/text.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/text.c'\"
else
echo shar: Extracting \"'xpic/text.c'\" \(1679 characters\)
sed "s/^X//" >'xpic/text.c' <<'END_OF_FILE'
X#include "xpic.h"
X#include "windows.h"
X
X#include "assert.h"
X
Xstatic Buf textbuf = {
X	NULL, 0
X};
Xstatic XTextItem *textitems = NULL;
Xstatic int maxitems = 0;
X
X#define ITEM_CHUNK 64
X
X/*
X *  Draws a string 'str' in the window, putting 'space' pixels of
X *  padding for every space in the string.
X */
Xdrawtext(w, x, y, str, len, gc, space)
XWindow w;
Xint x, y;
Xchar *str;
Xint len;
XGC gc;
Xint space;
X{
X	register char *s;
X	register char *s1;
X	register int nitems;
X	int pad;
X	
X	if (index(str, ' ') == NULL) {
X		XDrawString(picDpy, w, gc, x, y, str, len);
X		return;
X	}
X	while (textbuf.size <= len + 1) {
X		if (textbuf.size == 0) {
X			textbuf.size = BUF_CHUNK;
X			textbuf.buf = XtMalloc((unsigned) BUF_CHUNK);
X		} else {
X			textbuf.size += BUF_CHUNK;
X			textbuf.buf = XtRealloc((char *) textbuf.buf,
X			 (unsigned) textbuf.size);
X		}
X	}
X	bcopy(str, textbuf.buf, len);
X	/* sentinel blank at the end to simplify the following loop */
X	textbuf.buf[len] = ' ';
X	textbuf.buf[len+1] = '\0';
X	s = textbuf.buf;
X	nitems = 0;
X	pad = 0;
X	s1 = index(s, ' ');
X	do {
X		if (nitems >= maxitems) {
X			if (maxitems == 0) {
X				maxitems = ITEM_CHUNK;
X				textitems = (XTextItem *) 
X				 XtMalloc(ITEM_CHUNK * sizeof(XTextItem));
X			} else {
X				maxitems += ITEM_CHUNK;
X				textitems = (XTextItem *) XtRealloc((char *) textitems, 
X				 (unsigned) (maxitems * sizeof(XTextItem)));
X			}
X		}
X		textitems[nitems].chars = s;
X		textitems[nitems].nchars = s1 - s;
X		textitems[nitems].delta = pad;
X		textitems[nitems].font = None;
X		*s1++ = '\0';
X		for(pad = space; *s1 == ' '; s1++)
X			pad += space;
X		nitems++;
X		s = s1;
X	} while((s1 = index(s, ' ')) != NULL);
X	XDrawText(picDpy, w, gc, x, y, textitems, nitems);
X}
END_OF_FILE
if test 1679 -ne `wc -c <'xpic/text.c'`; then
    echo shar: \"'xpic/text.c'\" unpacked with wrong size!
fi
# end of 'xpic/text.c'
fi
if test -f 'xpic/x2pic.manX' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/x2pic.manX'\"
else
echo shar: Extracting \"'xpic/x2pic.manX'\" \(1943 characters\)
sed "s/^X//" >'xpic/x2pic.manX' <<'END_OF_FILE'
X.TH X2PIC L
X.SH NAME
Xx2pic - 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
Xtakes the given 
X.I xpic 
Xfile (default is the standard input) and
Xproduces corresponding pic on the standard output. This can
Xthen be printed by passing it through 
Xthe 
X.I pic
Xpreprocessor
Xand then through 
X.I ditroff
X(or other variants of
X.I troff)
Xto output devices like laser printers.
X.SH OPTIONS
X.IR -s " scale"
Xscales the picture by 
X.I scale, 
Xwhich is a floating point number. Text doesn't scale very well. (eg) 
X.I -s 0.5
Xwill scale the picture to half its size.
X.PP
X.IR -f " numfonts"
Xsets the maximum number of fonts that can be stored. The default is enough
Xunless the users 
X.I ~/.x2pic 
Xhas a lot of font mappings.
X.IR 
X.SH "SEE ALSO"
X.IR xpic (L)
Xis what generates the files for 
X.I x2pic
Xto convert.
X.br
X.IR x2ps (L)
Xis another filter for converting 
X.I xpic 
Xoutput to
X.I PostScript(tm)
Xformat.
X.br
X.IR x2tpic (L)
Xgenerates pic for the
X.IR tpic (L)
Xpreprocessor for 
X.I TeX
Xto permit inclusion of pic in 
X.I TeX
Xdocuments. 
X.SH SEE ALSO
XB. W. Kernighan,
X.I "PIC \(em A Graphics Language for Typesetting"
X.SH TRADEMARKS
XPostScript is a registered trademark of Adobe Systems, Inc.
X.SH FILES
X.I x2pic
Xlooks at 
X.I XPICLIBDIR/fontdesc/x2pic
Xand at 
X.I ~/.x2pic 
Xto find font mappings.
X.SH CAVEATS
XMany versions of pic have a nasty bug in which the 
X.I scale
Xvariable is not reset between consecutive pictures. Since xpic uses
X.I scale 
Xin its pictures, (eg)
X.I scale = 80,
Xthe next picture will start off at this scale, and will therefore be
Xfurther shrunk if it is an xpic picture, or just shrunk if it is any
Xother picture, like a graph. Get someone to fix pic, or x2pic (which
Xhas a BROKENPIC ifdef to deal with this).
X.PP
XPic does NOT do patterned splines, ellipses or circles - xpic does.
XThis is a pic 'feature', not an xpic bug.
END_OF_FILE
if test 1943 -ne `wc -c <'xpic/x2pic.manX'`; then
    echo shar: \"'xpic/x2pic.manX'\" unpacked with wrong size!
fi
# end of 'xpic/x2pic.manX'
fi
if test -f 'xpic/x2ps.manX' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/x2ps.manX'\"
else
echo shar: Extracting \"'xpic/x2ps.manX'\" \(2787 characters\)
sed "s/^X//" >'xpic/x2ps.manX' <<'END_OF_FILE'
X.TH X2PS L
X.SH NAME
Xx2ps - convert figures stored in \fIxpic\fP format to PostScript(tm).
X.SH SYNOPSIS
X.B x2ps
X[-w] [-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
Xtakes the given 
X.I xpic 
Xfile (default is the standard input) and
Xproduces corresponding PostScript on the standard output. This can
Xthen be printed on PostScript-supporting graphic output devices, like
Xlaser printers.
X.PP
XIt usually moves the picture so that the lower left corner of the picture is
Xat the lower left corner of the PostScript page, which makes it easy to
Xinclude in documents.
X.SH OPTIONS
X.TP 8
X.I -w
XWYSIWYG mode, prints the figure as it was in the screen without moving the
Xpicture so the picture's lower left corner is at the page lower left corner.
XUseful for sending the picture straight to the printer.
X.TP 8
X.I -r
Xprints the figure in landscape mode, rotated by 90 degrees. It
Xgoes together with the -r option on xpic.
X.TP 8
X.I -x 
Xsuppresses the 
X.I showpage 
Xemitted by 
X.I x2ps - 
X.I LaTeX 
Xused to need this.
X(Locally, we've fixed 
X.I LaTeX 
Xby defining 
X.I /showpage 
Xto be null in the 
X.I \\special 
Xheader).
X.TP  8
X.IR -s "  scale"
Xscales the picture by 
X.I scale, 
Xwhich is a floating point number. (eg) 
X.I -s 0.5
Xwill scale the picture to half its size.
X.TP 8
X.IR -p "  prologuefile"
X.TP 8
X.IR -t "  trailerfile"
Xspecify the prologue and trailer to be used.
XThe defaults are
X.I XPICLIBDIR/x2ps.pro 
Xand
X.I x2ps.tra. 
XUse these only if you know
Xwhat you're doing. Typically, you'd take the default 
X.I x2ps.{pro,tra} 
Xand modify
Xthem to change something you don't like - or you think is buggy. On
Xyour own head be it.
X.TP 8
X.IR -h "  hoffset"
X.TP 8
X.IR -v "  voffset"
Xspecify the horizontal and vertical offset to add to the figure, in
Xinches. hoffset and voffset may be floats.
X.TP 8
X.IR -f " numfonts"
Xsets the maximum number of fonts that can be stored. The default is enough
Xunless the users 
X.I ~/.x2ps 
Xhas a lot of font mappings.
X.SH "SEE ALSO"
X.IR xpic (L)
Xis what generates the files for 
X.I x2ps
Xto convert.
X.br
X.IR x2pic (L)
Xis another filter for converting 
X.I xpic 
Xoutput to
X.I pic
Xformat.
X.br
X.IR psfig (L)
Xis a preprocessor for 
X.I ditroff
Xto permit inclusion of PostScript in 
X.I ditroff 
Xdocuments. There is also
Xa version for 
X.I TeX 
X.br
XThe other method I know of for including PostScript in TeX
Xdocuments is
X.I \\special
Xdirective supported by some versions of 
X.I LaTeX/dvi2ps.
XSee the local guide for 
X.I LaTeX
Xand the examples in DOCDIR and DOCDIR/tex.
X.SH TRADEMARKS
XPostScript is a registered trademark of Adobe Systems, Inc.
X.SH FILES
X.I x2ps
Xlooks at 
X.I XPICLIBDIR/fontdesc/x2ps
Xand at 
X.I ~/.x2ps 
Xto find font mappings.
END_OF_FILE
if test 2787 -ne `wc -c <'xpic/x2ps.manX'`; then
    echo shar: \"'xpic/x2ps.manX'\" unpacked with wrong size!
fi
# end of 'xpic/x2ps.manX'
fi
if test -f 'xpic/x2tpic.manX' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/x2tpic.manX'\"
else
echo shar: Extracting \"'xpic/x2tpic.manX'\" \(2049 characters\)
sed "s/^X//" >'xpic/x2tpic.manX' <<'END_OF_FILE'
X.TH X2TPIC L
X.SH NAME
Xx2tpic - convert figures stored in \fIxpic\fP format to tpic (pic for TeX).
X.SH SYNOPSIS
X.B x2tpic
X[-s \fIscale\fP] [-f \fImaximum fonts\fP] [\fIfilename\fP] ....
X.SH DESCRIPTION
X.I X2tpic
Xtakes the given 
X.I xpic 
Xfile (default is the standard input) and
Xproduces corresponding tpic on the standard output. This can
Xthen be printed by passing it through 
Xthe 
X.I tpic
Xpreprocessor
Xand then through 
X.I TeX
Xand its postprocessing filters
Xto output devices like laser printers.
X.SH OPTIONS
X.IR -s " scale"
Xscales the picture by 
X.I scale, 
Xwhich is a floating point number. Text doesn't scale very well. (eg) 
X.I -s 0.5
Xwill scale the picture to half its size.
X.PP
X.IR -f " numfonts"
Xsets the maximum number of fonts that can be stored. The default is enough
Xunless the users 
X.I ~/.x2tpic 
Xhas a lot of font mappings.
X.SH "SEE ALSO"
X.IR xpic (L)
Xis what generates the files for 
X.I x2tpic
Xto convert.
X.br
X.IR x2ps (L)
Xis another filter for converting 
X.I xpic 
Xoutput to
X.I PostScript(tm)
Xformat.
X.br
X.IR tpic (L)
Xis a preprocessor for 
X.I TeX
Xto permit inclusion of pic in 
X.I TeX
Xdocuments. 
X.br
XThe 
X.I pic
Xlanguage is described in
X.I "PIC \(em A Graphics Language for Typesetting"
Xby B. W. Kernighan.
X.br
XSee the local guide for 
X.I LaTeX
Xand the examples in DOCDIR and DOCDIR/tex.
X.SH TRADEMARKS
XPostScript is a registered trademark of Adobe Systems, Inc.
X.SH FILES
X.I x2tpic
Xlooks at 
X.I XPICLIBDIR/fontdesc/x2tpic
Xand at 
X.I ~/.x2tpic 
Xto find font mappings.
X.SH CAVEATS
XMany versions of pic/tpic have a nasty bug in which the 
X.I scale
Xvariable is not reset between consecutive pictures. Since xpic uses
X.I scale 
Xin its pictures, (eg)
X.I scale = 80,
Xthe next picture will start off at this scale, and will therefore be
Xfurther shrunk if it is an xpic picture, or just shrunk if it is any
Xother picture, like a graph. Get someone to fix pic/tpic, or x2pic (which
Xhas a BROKENPIC ifdef to deal with this).
X.PP
XPic does NOT do patterned splines, ellipses or circles - xpic does.
XThis is a pic 'feature', not an xpic bug.
END_OF_FILE
if test 2049 -ne `wc -c <'xpic/x2tpic.manX'`; then
    echo shar: \"'xpic/x2tpic.manX'\" unpacked with wrong size!
fi
# end of 'xpic/x2tpic.manX'
fi
if test -f 'xpic/xpic.manX' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/xpic.manX'\"
else
echo shar: Extracting \"'xpic/xpic.manX'\" \(1796 characters\)
sed "s/^X//" >'xpic/xpic.manX' <<'END_OF_FILE'
X.TH XPIC L
X.SH NAME
Xxpic - draw and edit diagrams, figures, pictures in X Windows
X.SH SYNOPSIS
X.B xpic
X[X Toolkit options] ... [xpic options] ...  file
X.SH DESCRIPTION
X.I Xpic
Xis a program for drawing figures in X Windows. It has facilities for creating
Xvarious graphic elements like lines, splines, circles, ellipses, and 
Xtext with a number of different attributes (line thickness, line
Xstyle, text font, text point size). It also has various facilities for
Xediting the diagrams, either on an individual 
X.I element 
Xbasis, or by grouping elements into 
X.I blocks.
XThese editing facilities include copy, move, delete, paste, adjust,
Xchange attributes, get from disk, and put to disk. It also permits the
Xsaving and loading of pictures, and the adjustment of the grid to
Xwhich picture elements are aligned.
X.PP
XThe program is meant to be easy enough to use without a manual. (This
Xis called a weak cop-out!)
X.SH "SEE ALSO"
XFor a more complete description of the functions, and some advanced features,
Xsee 
X.br
X	DOCDIR/xpic.doc. 
X.br
XFor examples, see 
X.br
X	DOCDIR/*.x.
X.PP
X.IR x2ps (L),
Xand 
X.IR x2pic (L)
Xare supporting programs that convert from xpic's internal saved format
Xto PostScript(tm) and pic format respectively.
X.SH AUTHOR
XMark Moraes, CSRI, University of Toronto. 
X.br
X<moraes at csri.toronto.edu>
X.SH BUGS
X(Bugs! In my program?!)
XSplines leave debris after rubberbanding or adjusting. This may be
Xconsidered a feature since I'm not sure how to fix it. 
X.br
XSplines/lines leave old arrows around after an adjust of end segments.
X.br
XThe Xsun server from the MIT X distribution lies blatantly about its screen
Xresolution. xpic believes it, and this results in fonts with silly sizes
Xlike 11, 13, and 15 points.
X.SH TRADEMARKS
XPostScript is a registered trademark of Adobe Systems, Inc.
END_OF_FILE
if test 1796 -ne `wc -c <'xpic/xpic.manX'`; then
    echo shar: \"'xpic/xpic.manX'\" unpacked with wrong size!
fi
# end of 'xpic/xpic.manX'
fi
if test -f 'xpic/xtp.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xpic/xtp.c'\"
else
echo shar: Extracting \"'xpic/xtp.c'\" \(2140 characters\)
sed "s/^X//" >'xpic/xtp.c' <<'END_OF_FILE'
X#ifndef lint
Xstatic char *rcsid = "$Header: xtp.c,v 1.3 89/04/30 16:28:37 xwindows Exp $";
X#endif
X
X#include <X11/Xos.h>
X#include <stdio.h>
X#include "defs.h"
X#include "xtp.h"
X
Xchar *def_font = "Roman";
X
Xchar *
XChangeFont(style, size)
Xchar *style;
Xint size;
X{
X	extern char *HashSearch();
X	extern char *strsave();
X	struct fontinfo *fp;
X	struct fontinfo *FindClosestFont();
X	char buf[64];
X
X	(void) sprintf(buf, "%s.%d", style, size);
X	fp = (struct fontinfo *) HashSearch(buf);
X
X	if (fp != NULL) {
X		/* We used it before, so it is cached in the hash table */
X#ifdef DEBUG
X		(void) fprintf(stderr, "%s cached as %s\n", buf, fp->texname);
X#endif
X		return(fp->texname);
X	}
X		
X	/* 
X	 *  We haven't cached the font, so we search for it in the list,
X	 *  cache the nearest font we find under it's name. Also increase
X	 *  the reference count so we know that it's been used
X	 */
X	fp = FindClosestFont(style, size);
X	HashInsert(strsave(buf), (char *) fp);
X	fp->refcnt++;
X#ifdef DEBUG
X	(void) fprintf(stderr, "%s maps to %s\n", buf, fp->texname);
X#endif
X	return(fp->texname);
X}
X
X
Xstruct fontinfo *
XFindClosestFont(style, size)
Xchar *style;
Xint size;
X{
X	register struct fontinfo *fp = availfonts;
X	struct fontinfo *closest = NULL;
X	register int n = navailfonts;
X	register int bestdelta = 99999;
X	register int delta;
X
X	while(n-- > 0) {
X		delta = ABS(fp->size - size);
X		if (delta <= bestdelta) {
X			if (STREQ(style, fp->style) || 
X			 (delta < bestdelta && STREQ(def_font, fp->style))) {
X			 	closest = fp;
X				bestdelta = delta;
X			 }
X		}
X		fp++;
X	}
X	if (bestdelta == 0 && STREQ(closest->style, style)) {
X		return(closest);
X	} else if (closest != NULL) {
X		(void) fprintf(stderr,
X		 "Couldn't find font \"%s\" in size %d - using \"%s\" in %d instead\n",
X		 style, size, closest->style, closest->size);
X	} else {
X		(void) fprintf(stderr, "Help - couldn't find any fonts.\n");
X		exit(-1);
X	}
X	return(closest);
X}
X
Xvoid
XPutTexFontPostScript( fd)
XFILE *fd;
X{
X	register struct fontinfo *fp = availfonts;
X	register int n = navailfonts;
X	
X	while(n-- > 0) {
X		if (fp->refcnt > 0)
X			(void)fprintf(fd, "\\font%s = %s\n", fp->texname, fp->texfontinit);
X		fp++;
X	}
X}
END_OF_FILE
if test 2140 -ne `wc -c <'xpic/xtp.c'`; then
    echo shar: \"'xpic/xtp.c'\" unpacked with wrong size!
fi
# end of 'xpic/xtp.c'
fi
echo shar: End of archive 2 \(of 15\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 15 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0



More information about the Comp.sources.x mailing list