home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!island!argv
- From: argv@island.uu.net (Dan Heller)
- Newsgroups: comp.sources.x
- Subject: v04i068: xpic -- pic previewer for X11, Part03/15
- Message-ID: <909@island.uu.net>
- Date: 20 Jul 89 19:12:20 GMT
- Organization: Island Graphics, Marin County, California
- Lines: 2130
- Approved: island!argv@sun.com
-
- Submitted-by: Mark Moraes <moraes@ai.toronto.edu>
- Posting-number: Volume 4, Issue 68
- Archive-name: xpic/part03
-
-
-
- #! /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 3 (of 15)."
- # Contents: xpic/CHANGES.Patch8 xpic/README xpic/Window.c
- # xpic/doc/header.new xpic/doc/move.ps xpic/doc/show.ps
- # xpic/doc/test.x xpic/doc/victor.ps xpic/mytypes.h
- # xpic/test/marcel1.x xpic/test/test.x xpic/util.c xpic/x2ps.pro
- # Wrapped by moraes@neat.ai on Thu Jul 13 22:36:06 1989
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'xpic/CHANGES.Patch8' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/CHANGES.Patch8'\"
- else
- echo shar: Extracting \"'xpic/CHANGES.Patch8'\" \(3573 characters\)
- sed "s/^X//" >'xpic/CHANGES.Patch8' <<'END_OF_FILE'
- XThis patch moves from patchlevel 6 to patchlevel 8. (patch 7 was an internal
- Xpatch, only for beta-testers) (The version on the R3 tape was at patchlevel
- X5, a fix posted to comp.sources.x, and available from archive sites as
- Xxpic.r3fix.sh.Z)
- X
- XThis patch fixes the following things:
- X
- X 1. Xpic now works under R3, with the fixes to the HP widgets posted
- X by Martin Friedmann <martin@citi.umich.edu>. (Thanks Marty!) (This
- X is available as Xhp.patch.works.tar.Z from various archive sites -
- X try expo.lcs.mit.edu in contrib/ and ai.toronto.edu in pub/X by
- X anonymous ftp)
- X
- X 2. Xpic selection is much improved - instead of the silly (but easy
- X to code:-) "bounding box with the closest centre", it now selects
- X the object with the closest drawn edge (some caveats for splines and
- X ellipses) More intuitive, much faster.
- X
- X 3. Dave Cahlander <dac@earth.cray.com> contributed code to draw
- X ellipses fast, using an approximate polygon, so that people with
- X Suns/Vaxen/anything-that-uses-R3-miarc.c can rubber-band
- X circles/ellipses without having to go for coffee in between each
- X iteration. I've generalized it into a substitute XDrawArc and
- X XFillArc - these run considerably faster than the R3 server arc
- X drawing code, which is unbearably slow on the measly little Sun3s
- X which some of us use. If you run your server on anything less than a
- X MIPS based workstation, you probably need these routines.
- X
- X 4. Dave also contributed a fix and fonts.aliases file which allows
- X xpic to use the spiffy R3 Adobe fonts. (If you apply the xtroff
- X fixes which install devpsc fonts derived from the 75dpi fonts, then
- X you don't need the fonts.aliases file.
- X
- X 5. TYPEOUT now works with the Minibuf, but there are still a couple
- X of minor glitches.
- X
- X 6. Xpic uses R3 XtSetKeyboardFocus inset of XSetInputFocus, so it is
- X much less anti-social when entering text, also much more reliable.
- X
- X 7. Rubber banding boxes don't leave droppings on the screen. Neither
- X do lines when aborted.
- X
- X 8. x2ps now has an option to make direct dumps to PostScript
- X printers, as well as being included in TeX/troff. This option is
- X used by a Print button in xpic. You can set the lprcommand and
- X printer you want to use.
- X
- X 9. Both xpic and xtroff now have font names that use
- X 'devfoo.name.size.resolution' instead of the old 'devfoo.name.size',
- X so the resolution is no longer required in the fontdesc files.
- X
- X 10. Xpic now won't blithely ignore errors when writing to a full
- X filesystem. (CAN'THAPPEN, eh?)
- X
- X 11. Small splines and lines with multiple consecutive points on the
- X same coordinates work correctly again. (why the X server refuses to
- X draw a line beyond two consecutive identical points is beyond me)
- X
- X 12. x2ps does splines more accurately.
- X
- X 13. Block highlighting does less drawing, and is therefore
- X much faster.
- X
- X 14. The Cursor changes to indicate text input or a long operation in
- X progress.
- X
- XHave fun.
- X
- X Mark Moraes
- X Computer Systems Research Institute,
- X University of Toronto,
- X Toronto, Canada M5S 1A4
- X
- X {your favourite backbone}!utcsri!moraes
- X moraes@utcsri.UUCP (new style)
- X moraes@csri.toronto.edu
- X moraes@csri.utoronto.ca
- X moraes@csri.utoronto (bitnet)
- X
- END_OF_FILE
- if test 3573 -ne `wc -c <'xpic/CHANGES.Patch8'`; then
- echo shar: \"'xpic/CHANGES.Patch8'\" unpacked with wrong size!
- fi
- # end of 'xpic/CHANGES.Patch8'
- fi
- if test -f 'xpic/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/README'\"
- else
- echo shar: Extracting \"'xpic/README'\" \(3902 characters\)
- sed "s/^X//" >'xpic/README' <<'END_OF_FILE'
- XTo install,
- X
- X1. Edit the Imakefile to change XWSRC, DOCDIR, CC, DUMPDIR, DEFINES,
- XCDEBUGFLAGS, INCLUDES, XWLIB, MALLOC, USLEEP to your taste. There are brief
- Xcomments about each in the Imakefile.
- X
- X3. Edit windows.h if need be, changing DEFAULTSPACING, DEFAULTPAGEHEIGHT,
- Xand DEFAULTPAGEWIDTH. These are set to fill the entire screen on a Sun 3/50
- Xordinary resolution or uvax3200.
- X
- X4. make.
- X
- X5. To test it, copy the file fontdesc/xpic to ~/.xpic, run it with the
- Xcommand
- X xpic test/test.xpic
- X
- XYou should have already installed the fonts.
- X
- XThere are two ways to do this - the better way is to install xtroff fonts.
- XEven if you don't want xtroff, cd there (../xtroff, hopefully) and do a
- X'make xfonts'.xpic's font description file maps them to their names and
- Xscales them to the right size. If you haven't installed the fonts, it will
- Xstill work, but with the occasional complaint.
- X
- XYou can use the fonts.alias file supplied instead, putting that in the
- XLIBDIR/fonts/75dpi directory. (Remember to 'xset fp rehash' to get it to
- Xtake effect) DO NOT use the fonts.alias file if you have installed xtroff
- Xfonts - xtroff will look wrong.
- X
- X6. make install.
- X
- XNotes: You need to have the HP Widgets. The ones on the R3 tape in
- Xcontrib/widgets are really for R2 and won't work with xpic. You need to get
- XMartin Friedmann's fixed widgets. (These are available as
- XXhp.patch.works.tar.Z from various archive sites - try expo.lcs.mit.edu in
- Xcontrib/ and ai.toronto.edu in pub/X by anonymous ftp)
- X
- Xxpic has been tested very extensively under X11R2 and R3 on monochrome
- Xand color Suns and reasonably thoroughly under X11R2 on uVaxen as well.
- XIt has been known to compile and work on SGI's Personal Iris.
- X
- XBugs
- X====
- XKnown problems:
- X Splines leave a residue caused by a lousy rubber banding
- X method. If you think you can do better, please do.
- X
- X Strange things happen on undo of block operations if you
- X happen to have selected elements that were created by the
- X operation you want to undo. This is a result of the undo
- X philosophy, and seems hard to fix - if you want to undo
- X something, undo it immediately after doing it!
- X
- X Rubberbanding thick objects is SLOOOOW, especially on machines
- X without hardware floating point support. Yell at your server vendor.
- X
- XIf you do run into a bug, please tell me exactly what happened so I can try
- Xto track it down - ideally, if you could narrow it down to a reproducible
- Xset of actions, "when I edit this file, draw a spline, undo that, draw a
- Xline, and then click the adjust buttons, the line vanishes" would make it
- Xpossible to fix the bug without divination!
- X
- XPlease do send in bug reports - chances are that I'll be able to find the
- Xbug a bit faster, unless it depends on specific peculiarities of your system
- X- and then I might be able to offer pointers and narrow down the
- Xpossibilities. With a bug report, please send me the output of an 'xrdb
- X-query'.
- X
- XFinally the disclaimer:
- XThis program was developed as an independent project to satisfy a need
- Xof the author. This program may contain bugs and the user is cautioned
- Xto independently verify that the program is suitable for the user's
- Xintended purpose. The program is made available on an ``as is'' basis
- Xwith all faults and without any implied or expressed warranties or support
- Xfrom either the author, Mark Moraes, or the University of Toronto.
- X
- XYou are free to use xpic as you wish. You may redistribute the program
- Xfreely, with the source. In return I ask two things. First, that you
- Xdo not remove the name of the author from this work. Secondly, if
- Xyou make changes or improvements to this program that you pass these
- Xchanges back to the author so that everybody can benefit from the
- Ximprovements.
- X
- X
- X Mark Moraes.
- X Computer Systems Research Institute,
- X Univerity of Toronto.
- X moraes@csri.toronto.{edu,cdn}
- X moraes@csri.utoronto.ca
- X moraes@utcsri.uucp
- X {your favourite backbone}!uunet!utcsri!moraes
- END_OF_FILE
- if test 3902 -ne `wc -c <'xpic/README'`; then
- echo shar: \"'xpic/README'\" unpacked with wrong size!
- fi
- # end of 'xpic/README'
- fi
- if test -f 'xpic/Window.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/Window.c'\"
- else
- echo shar: Extracting \"'xpic/Window.c'\" \(3443 characters\)
- sed "s/^X//" >'xpic/Window.c' <<'END_OF_FILE'
- X#ifndef lint
- Xstatic char rcsid[] = "$Header: Window.c,v 1.2 89/04/21 03:30:12 xwindows Exp $";
- X#endif lint
- X
- X/*
- X * Window.c - Window widget
- X *
- X * Author: Chris Peterson
- X * M.I.T.
- X * Bldg. E40 - Project Athena
- X * 77 Massachussets Ave.
- X * Cambridge, MA 02139
- X *
- X * Date: Tue Oct 27 1987
- X *
- X * Based upon the label widget by Charles Haynes.
- X */
- X
- X/*
- X * This is the window widget, its purpose is to allow windows to be
- X * used with the toolkit. I has a foreground color, as core does not
- X * and it is best if this resource is owned by the widget.
- X * It will also add a pixmap to the background of your window.
- X *
- X * Chris Peterson - 2/9/88
- X */
- X
- X#include <X11/IntrinsicP.h>
- X#include "Window.h"
- X#include "WindowP.h"
- X#include <X11/StringDefs.h>
- X
- X/****************************************************************
- X *
- X * Full class record constant
- X *
- X ****************************************************************/
- X
- X/* Private Data */
- X
- Xstatic XtResource resources[] = {
- X {XtNpixmap, XtCpixmap, XtRString, sizeof(caddr_t),
- X XtOffset(WindowWidget, window.pixmap), XtRString, (caddr_t) NULL},
- X {XtNforeground, XtCForeground, XtRPixel, sizeof(Pixel),
- X XtOffset(WindowWidget, window.foreground), XtRString, "Black"},
- X};
- X
- Xstatic void Realize();
- X
- XWindowClassRec windowClassRec = {
- X {
- X/* core_class fields */
- X /* superclass */ (WidgetClass) &widgetClassRec,
- X /* class_name */ "Window",
- X /* widget_size */ sizeof(WindowRec),
- X /* class_initialize */ NULL,
- X /* class_part_init */ NULL,
- X /* class_inited */ FALSE,
- X /* initialize */ NULL,
- X /* initialize_hook */ NULL,
- X /* realize */ Realize,
- X /* actions */ NULL,
- X /* num_actions */ 0,
- X /* resources */ resources,
- X /* num_resources */ XtNumber(resources),
- X /* xrm_class */ NULLQUARK,
- X /* compress_motion */ TRUE,
- X /* compress_exposure */ TRUE,
- X /* compress_enterleave*/ TRUE,
- X /* visible_interest */ FALSE,
- X /* destroy */ NULL,
- X /* resize */ NULL,
- X /* expose */ NULL,
- X /* set_values */ NULL,
- X /* set_values_hook */ NULL,
- X /* set_values_almost */ XtInheritSetValuesAlmost,
- X /* get_values_hook */ NULL,
- X /* accept_focus */ NULL,
- X /* version */ XtVersion,
- X /* callback_private */ NULL,
- X /* tm_table */ NULL,
- X /* query_geometry */ NULL,
- X#ifdef XtCAccelerators
- X /* display_accelerator*/ XtInheritDisplayAccelerator,
- X /* extension */ NULL
- X#endif /* XtCAccelerators */
- X }
- X};
- X
- XWidgetClass windowWidgetClass = (WidgetClass)&windowClassRec;
- X
- X/****************************************************************
- X *
- X * Private Procedures
- X *
- X ****************************************************************/
- X
- Xstatic void Realize(w, valueMask, attributes)
- X register Widget w;
- X Mask *valueMask;
- X XSetWindowAttributes *attributes;
- X{
- X WindowWidget lw = (WindowWidget)w;
- X if (lw->window.pixmap != NULL) {
- X *valueMask |= CWBackPixmap;
- X *valueMask &= ~CWBackPixel;
- X attributes->background_pixmap = lw->window.pixmap;
- X }
- X
- X XtCreateWindow(w, (Cardinal) InputOutput, (Visual *)CopyFromParent,
- X *valueMask, attributes);
- X} /* Realize */
- END_OF_FILE
- if test 3443 -ne `wc -c <'xpic/Window.c'`; then
- echo shar: \"'xpic/Window.c'\" unpacked with wrong size!
- fi
- # end of 'xpic/Window.c'
- fi
- if test -f 'xpic/doc/header.new' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/doc/header.new'\"
- else
- echo shar: Extracting \"'xpic/doc/header.new'\" \(3805 characters\)
- sed "s/^X//" >'xpic/doc/header.new' <<'END_OF_FILE'
- X\" Header for ME macros - Sets up stuff for nice thesis look
- X\" but SINGLE SPACED. Use '.ls 2' to get DOUBLE SPACE
- X\" It also defines the macros
- X\" needed for entering the section headings and chapter
- X\" headings in an index called 't' which you can print out
- X\" if you want to at the end of the document by giving
- X\" .TC
- X\" Giving .TC at any other place might have weird effects on
- X\" the chapter numbering, and will result in an incomplete
- X\" table of contents.
- X\" The .sh, .uh commands both generate index entries, with
- X\" .uh using the current depth for formatting.
- X\" The macros .TL and .DE have been swiped from the -me
- X\" macros ref. manual for preparing terminology sections.
- X\" The .BU macro starts an indented paragraph, with a bullet.
- X\" (Allegedly, 4.3BSD -me macros have a .bu macro which does
- X\" the same thing.)
- X\" The .RF macro is essentially .+c "References" except that
- X\" it makes an index entry as well.
- X\" The .PS and .PE simply invoke .(c and .)c to automatically
- X\" center the picture. (Removed since drb fixed the me macros)
- X\" The .(r and .)r macros enclose a block of right justified
- X\" text - handy for letters
- X\" The .*s macro sets paragraph size to the given size.
- X\"
- X\" Mark Moraes, May 22, 1987
- X\"
- X.rm @m
- X.nr ss 2v \" Space before section title
- X.nr pp 12 \" Point size for .pp , .ip , etc.
- X.nr cp 14 \" Point size for .~+~c
- X.nr sp 13 \" Point size for .sh
- X.nr tp 12 \" Point size for headers & footers
- X.nr fg 0 1 \" Register with figure numbers
- X.nr TC 2 \" Register with Table of content indent in ems
- X.nr CH 16 \" Point size for chapter titles
- X.nr DI 1.5i. \" Pinched from memacros/ref.nr for the .DE/.TL macros
- X.sz 12 \" Reset point size
- X.sc \" Read in special characters
- X.nr _0 \n(c. \" Lifted from the .th macro
- X.nr tf 1
- X.he '''%'
- X.fo ''''
- X.po 1.25i
- X.ll 6.25i
- X.m1 1i
- X.nr ?t 1
- X.nr c. \n(_0
- X.rm $c
- X.de $c \" $$$ print chapter title. Modified from tmac.e
- X.sz \\n(CH
- X.ft B
- X.ce 1000
- X.if \\n(_M<3 \
- X. nr ch +1
- X.ie \\n(_M=1 CHAPTER\ \ \\n(ch
- X.el .if \\n(_M=2 APPENDIX\ \ \\n(ch
- X.if \w"\\$1" .sp 3-\\n(.L
- X.if \w"\\$1" \\$1
- X.if (\\n(_M<3):(\w"\\$1") \
- X. sp 4-\\n(.L
- X.ce 0
- X.ft
- X.sz
- X.ie \\n(_M=1 \
- X. $C Chapter \\n(ch "\\$1"
- X.el .if \\n(_M=2 \
- X. $C Appendix \\n(ch "\\$1"
- X..
- X.de $0 \" Called by .sh to put entry in index t
- X.if !"\\$1"" \{\
- X.nr XT 0.3i*\\n($0-0.3i+\\n(TCm
- X\".tm Called \\$1 \\$2 \\$3 \\n(XT
- X.(x t
- X.in 0
- X.in +\\n(XTu
- X\\$2 \\$1
- X.)x
- X.in -\\n(XTu \}
- X..
- X.de $C \" Called by $c to put an entry in index t.
- X.nr $0 2 \" Also sets up default section depth to 2
- X.nr $1 \\$2 \" and resets all other section registers.
- X.nr $2 0 \" My own.
- X.nr $3 0
- X.nr $4 0
- X.nr $5 0
- X.nr $6 0
- X\".tm \\$1 \\$2 \\$3
- X.(x t
- X.sp 1
- X.in 0
- X.in +\\n(TC
- X.ie "\\$1"Chapter" \\$2 \\$3
- X.el \\$1 \\$2 \\$3
- X.)x
- X.in -\\n(TC
- X..
- X.de RF \" Sets up a section for references since +c
- X.ep \" has no provision for that. Enters in index t
- X.if \\n(?o:\\n(?a \
- X\{\
- X. bp
- X. rs
- X. ep
- X.\}
- X.nr ?C 1
- X.nr $f 1 1
- X.ds * \\*[1\\*]\k*
- X.if \\n(?R \
- X. pn 1
- X.bp
- X.in \\n($iu
- X.rs
- X.sz \\n(CH
- X.ft B
- X.ce 1000
- XReferences
- X.sp 3
- X.ce 0
- X.ft
- X.sz
- X.(x t
- X.in 0
- X.in +\\n(TC
- XReferences
- X.)x
- X.in -\\n(TC
- X..
- X.de TL \" *** title line. Pinched from memacros/ref.nr
- X.lp
- X.di XX
- X..
- X.de DE \" *** description. Pinched from memacros/ref.nr
- X\\\\h'|\\n(DIu'\\\\c
- X.br
- X.di
- X.in +\\n(DIu
- X.ti 0
- X.cu 1000
- X.XX
- X.rm XX
- X.cu 0
- X..
- X.de TC \" *** description. Prints table of contents at end
- X.++ P
- X.+c "Table of Contents"
- X.xp t
- X..
- X.de BU \" *** description. Bulletted paragraph.
- X.ip \(bu
- X..
- X.de (r \" An attempt at right justified text.
- X.br
- X.nf
- X.if "\\n(.z"|r" .tm Line \\n(c. -- Nested .(r requests
- X.di |r
- X..
- X.de )r
- X.if !"\\n(.z"|r" .tm Line \\n(c. -- Unmatched .)r
- X.br
- X.di
- X.nr RJ \\n(.iu
- X.in (\\n(.lu-\\n(.iu-\\n(dlu)
- X.nf
- X.|r
- X.ec
- X.in \\n(RJu
- X.rm |r
- X.fi
- X..
- X.de *s \" Point size setting
- X.nr pp \\$1 \" Point size for .pp , .ip , etc.
- X.sz \\$1
- X..
- END_OF_FILE
- if test 3805 -ne `wc -c <'xpic/doc/header.new'`; then
- echo shar: \"'xpic/doc/header.new'\" unpacked with wrong size!
- fi
- chmod +x 'xpic/doc/header.new'
- # end of 'xpic/doc/header.new'
- fi
- if test -f 'xpic/doc/move.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/doc/move.ps'\"
- else
- echo shar: Extracting \"'xpic/doc/move.ps'\" \(4126 characters\)
- sed "s/^X//" >'xpic/doc/move.ps' <<'END_OF_FILE'
- X%!
- X%%Creator: root@church.csri (Operator)
- X%%Title: move.x (xpic)
- X%%CreationDate: Tue Oct 4 04:25:04 1988
- X%%Pages: 1
- X%%BoundingBox: 0 0 288 230.4
- X% (in inches) at 0 0, width 4, height 3.2
- X%%EndComments
- X% Prolog for xpic to PostScript converter
- X% Author: Mark Moraes
- X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp
- X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
- X% %s F - change font to fontname
- X% %d S - change size (font size in points)
- X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
- X% %d %d l - lineto
- X% %d %d m - moveto
- X% %d %d s - spline segment
- X% x - flush line, spline
- X% <wid> <ht> <x> <y> b - box
- X% <wid> <ht> <x> <y> e - ellipse
- X% %d ss - setscale
- X% %d W - change linewidth
- Xsave 50 dict begin /xpic exch def
- X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
- X% Set defaults
- X/fontname /Times-Roman def
- X/ptsize 12 def
- X% halign has the values for MIDLINE, TOPLINE, BOTLINE
- X/halign 3 array def
- X/s {rcurveto} def
- X/x {stroke} def
- X/l {lineto} def
- X/m {moveto} def
- X/b {
- X /ury exch def /urx exch def /lly exch def /llx exch def
- X llx lly moveto urx lly lineto urx ury lineto
- X llx ury lineto llx lly lineto stroke
- X} def
- X/mtrx matrix def
- X/e {
- X /yc exch def /xc exch def /yrad exch def /xrad exch def
- X xc xrad add yc moveto
- X /savematrix mtrx currentmatrix def
- X xc yc translate
- X xrad yrad scale
- X 0 0 1 0 360 arc
- X savematrix setmatrix stroke
- X} def
- X% The next three take the text string, and moveto the right horiz. position
- X% leaving the string on the stack.
- X/lj {} def
- X/rj {dup stringwidth pop neg 0 rmoveto} def
- X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
- X% And this is invoked after one of the three above, and
- X% computes the vert. pos, and then displays the string.
- X/t {halign exch get 0 exch rmoveto show newpath} def
- X% Store an array of patterns in /styles - a pattern is an array consisting
- X% of an array and an offset. Corresp to xpic patterns
- X% solid, dotted, short-dashed, long-dashed, dot-dashed
- X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
- X 5 array astore def
- X% change style to arg.
- X/D {stroke styles exch get aload pop setdash newpath} def
- X/W {stroke 0.5 mul setlinewidth newpath} def
- X% fontbox takes a fontname off the stack, and returns an array
- X% containing the values of the bottom line of the bounding box, the
- X% mid line of the bounding box, and the top line of the bounding box
- X% of that font, taken from the baseline, scaled to a font of size 1
- X/fontbox {
- X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
- X /ytop exch def pop /ybot exch def pop
- X /ymid ytop ybot sub 2 div def
- X 0 ybot fm dtransform exch pop % botline
- X dup neg exch % midline - this works better than (ytop-ybot)/2!
- X 0 ytop fm dtransform exch pop exch %topline
- X % now in the order midline, topline, botline.
- X 3 array astore
- X} def
- X% select font
- X/F {
- X dup /fontname exch def fontbox
- X /thisfontbox exch def SF
- X} def
- X% set point size
- X/S {/ptsize exch def SF} def
- X% actually set font
- X/SF {
- X fontname findfont ptsize curscale div scalefont setfont
- X thisfontbox aload pop
- X 1 1 3 {
- X pop ptsize mul curscale div neg 3 1 roll
- X } for
- X halign astore pop
- X} def
- X% sets the scale to 72 / n, where n is on the stack, and stores the value
- X% in curscale for font scaling
- X/curscale 1 def
- X/ss {/curscale exch 72 exch div dup dup scale def} def
- X/land {90 rotate} def
- XStartXpic
- X%%EndProlog
- X1 1 scale
- X80 ss
- X1 W
- X0 D
- X232 32 m
- X0 0 4 0 12 2 s
- X8 1 16 7 24 18 s
- X0 D
- X260 48 m
- X268 52 l
- X267 43 l
- X0 D
- X268 52 m
- Xx
- X144 216 m
- X144 232 l
- X268 232 l
- X268 56 l
- X232 56 l
- Xx
- X0.5 W
- X/Times-Roman F
- X12 S
- X156 64 m
- X(A') ce 0 t
- X1 W
- X1 D
- X144 216 m
- X144 56 l
- X232 56 l
- Xx
- X0.5 W
- X120 48 m
- X(A) ce 0 t
- X1 W
- X0 D
- X80 152 m
- X80 176 l
- X200 176 l
- X200 96 l
- X160 96 l
- Xx
- X0.5 W
- X192 104 m
- X(B) ce 0 t
- X48 80 m
- X(C) ce 0 t
- X192 104 m
- X(B) ce 0 t
- X1 W
- X112 176 m
- X112 216 l
- X232 216 l
- X232 40 l
- X112 40 l
- X112 72 l
- Xx
- X40 152 160 72 b
- X0 256 320 0 b
- X%%Trailer
- Xshowpage
- X% Trailer for xpic to PostScript converter
- X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
- Xxpic end restore
- END_OF_FILE
- if test 4126 -ne `wc -c <'xpic/doc/move.ps'`; then
- echo shar: \"'xpic/doc/move.ps'\" unpacked with wrong size!
- fi
- # end of 'xpic/doc/move.ps'
- fi
- if test -f 'xpic/doc/show.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/doc/show.ps'\"
- else
- echo shar: Extracting \"'xpic/doc/show.ps'\" \(3962 characters\)
- sed "s/^X//" >'xpic/doc/show.ps' <<'END_OF_FILE'
- X%!
- X%%Creator: root@church.csri (Operator)
- X%%Title: show.x (xpic)
- X%%CreationDate: Tue Oct 4 04:25:14 1988
- X%%Pages: 1
- X%%BoundingBox: 0 0 309.6 266.4
- X% (in inches) at 0 0, width 4.3, height 3.7
- X%%EndComments
- X% Prolog for xpic to PostScript converter
- X% Author: Mark Moraes
- X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp
- X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
- X% %s F - change font to fontname
- X% %d S - change size (font size in points)
- X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
- X% %d %d l - lineto
- X% %d %d m - moveto
- X% %d %d s - spline segment
- X% x - flush line, spline
- X% <wid> <ht> <x> <y> b - box
- X% <wid> <ht> <x> <y> e - ellipse
- X% %d ss - setscale
- X% %d W - change linewidth
- Xsave 50 dict begin /xpic exch def
- X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
- X% Set defaults
- X/fontname /Times-Roman def
- X/ptsize 12 def
- X% halign has the values for MIDLINE, TOPLINE, BOTLINE
- X/halign 3 array def
- X/s {rcurveto} def
- X/x {stroke} def
- X/l {lineto} def
- X/m {moveto} def
- X/b {
- X /ury exch def /urx exch def /lly exch def /llx exch def
- X llx lly moveto urx lly lineto urx ury lineto
- X llx ury lineto llx lly lineto stroke
- X} def
- X/mtrx matrix def
- X/e {
- X /yc exch def /xc exch def /yrad exch def /xrad exch def
- X xc xrad add yc moveto
- X /savematrix mtrx currentmatrix def
- X xc yc translate
- X xrad yrad scale
- X 0 0 1 0 360 arc
- X savematrix setmatrix stroke
- X} def
- X% The next three take the text string, and moveto the right horiz. position
- X% leaving the string on the stack.
- X/lj {} def
- X/rj {dup stringwidth pop neg 0 rmoveto} def
- X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
- X% And this is invoked after one of the three above, and
- X% computes the vert. pos, and then displays the string.
- X/t {halign exch get 0 exch rmoveto show newpath} def
- X% Store an array of patterns in /styles - a pattern is an array consisting
- X% of an array and an offset. Corresp to xpic patterns
- X% solid, dotted, short-dashed, long-dashed, dot-dashed
- X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
- X 5 array astore def
- X% change style to arg.
- X/D {stroke styles exch get aload pop setdash newpath} def
- X/W {stroke 0.5 mul setlinewidth newpath} def
- X% fontbox takes a fontname off the stack, and returns an array
- X% containing the values of the bottom line of the bounding box, the
- X% mid line of the bounding box, and the top line of the bounding box
- X% of that font, taken from the baseline, scaled to a font of size 1
- X/fontbox {
- X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
- X /ytop exch def pop /ybot exch def pop
- X /ymid ytop ybot sub 2 div def
- X 0 ybot fm dtransform exch pop % botline
- X dup neg exch % midline - this works better than (ytop-ybot)/2!
- X 0 ytop fm dtransform exch pop exch %topline
- X % now in the order midline, topline, botline.
- X 3 array astore
- X} def
- X% select font
- X/F {
- X dup /fontname exch def fontbox
- X /thisfontbox exch def SF
- X} def
- X% set point size
- X/S {/ptsize exch def SF} def
- X% actually set font
- X/SF {
- X fontname findfont ptsize curscale div scalefont setfont
- X thisfontbox aload pop
- X 1 1 3 {
- X pop ptsize mul curscale div neg 3 1 roll
- X } for
- X halign astore pop
- X} def
- X% sets the scale to 72 / n, where n is on the stack, and stores the value
- X% in curscale for font scaling
- X/curscale 1 def
- X/ss {/curscale exch 72 exch div dup dup scale def} def
- X/land {90 rotate} def
- XStartXpic
- X%%EndProlog
- X1 1 scale
- X80 ss
- X1 W
- X0 D
- X0 296 m
- X104 296 l
- Xx
- X24 256 344 0 b
- X104 152 m
- X104 176 l
- X224 176 l
- X224 96 l
- X184 96 l
- Xx
- X64 152 184 72 b
- X104 152 m
- X104 176 l
- X224 176 l
- X224 96 l
- X184 96 l
- Xx
- X136 176 m
- X136 216 l
- X256 216 l
- X256 40 l
- X136 40 l
- X136 72 l
- Xx
- X0.5 W
- X/Times-Roman F
- X12 S
- X144 48 m
- X(A) ce 0 t
- X216 104 m
- X(B) ce 0 t
- X72 80 m
- X(C) ce 0 t
- X%%Trailer
- Xshowpage
- X% Trailer for xpic to PostScript converter
- X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
- Xxpic end restore
- END_OF_FILE
- if test 3962 -ne `wc -c <'xpic/doc/show.ps'`; then
- echo shar: \"'xpic/doc/show.ps'\" unpacked with wrong size!
- fi
- # end of 'xpic/doc/show.ps'
- fi
- if test -f 'xpic/doc/test.x' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/doc/test.x'\"
- else
- echo shar: Extracting \"'xpic/doc/test.x'\" \(3352 characters\)
- sed "s/^X//" >'xpic/doc/test.x' <<'END_OF_FILE'
- X#! /usr/local/xpic
- X8 32 624 832 8
- X6 9 137 536 216 552 0 0
- X176 544 11 3 3
- Xhello world
- X3 10 136 536 216 552 4 1
- X6 8 144 513 208 527 0 0
- X176 520 11 1 3
- Xhello world
- X3 11 144 512 208 528 4 1
- X3 12 144 488 208 504 4 1
- X3 29 144 456 208 472 4 1
- X6 30 146 489 206 503 0 0
- X176 496 11 2 3
- Xhello world
- X6 31 146 457 206 471 0 0
- X176 464 11 0 3
- Xhello world
- X1 16 400 280 480 360 34 1
- X5
- X 400 280 440 360 440 280 480 360
- X 480 320
- X2 24 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
- X6 0 472 503 572 528 9000 0
- X472 528 11 0 7
- Xhello world
- X1 37 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
- X2 23 336 576 440 672 30 1
- X7
- X 336 576 400 576 368 616 392 624
- X 440 624 376 672 352 672
- X5 7 408 376 504 416 0 1
- X456 396 48 20
- X4 33 224 376 288 440 3 1
- X256 408 32
- X6 3 424 544 497 558 5000 0
- X424 544 14 0 3
- Xlj top (moved)
- X6 1 232 469 310 496 9000 0
- X232 496 6 1 9
- Xxxxxxx
- X4 32 288 368 384 464 4 1
- X336 416 48
- X5 2 408 440 440 496 2 1
- X424 468 16 28
- X6 13 307 530 381 544 8000 0
- X344 544 13 0 3
- Xbottom center
- X3 28 272 504 424 544 4 1
- X6 14 318 504 370 518 4000 0
- X344 504 10 0 3
- Xtop center
- X3 58 40 40 136 112 0 1
- X3 57 168 88 328 120 0 1
- X3 56 208 32 304 64 1 1
- X3 55 352 48 488 120 2 1
- X3 54 368 64 472 104 3 1
- X3 53 384 72 456 96 4 1
- X1 52 520 40 560 120 0 1
- X4
- X 520 40 520 120 560 120 560 40
- X1 51 584 40 624 120 1 1
- X4
- X 584 40 584 120 624 120 624 40
- X1 50 40 160 80 240 2 1
- X4
- X 40 160 40 240 80 160 80 240
- X1 49 96 160 136 240 3 1
- X4
- X 96 240 96 160 136 240 136 160
- X1 48 160 160 200 240 4 1
- X4
- X 160 240 160 160 200 240 200 160
- X1 47 224 160 264 240 10 1
- X5
- X 224 160 224 240 248 160 248 240
- X 264 160
- X1 46 280 160 304 240 20 1
- X4
- X 280 160 288 224 296 168 304 240
- X1 45 320 160 360 240 30 1
- X5
- X 320 160 360 240 320 240 360 160
- X 360 200
- X1 44 376 160 440 240 11 1
- X5
- X 376 240 376 168 400 240 400 160
- X 440 240
- X1 43 456 160 480 240 21 1
- X4
- X 456 240 456 160 480 240 480 160
- X1 42 496 160 520 240 31 1
- X4
- X 496 240 496 160 520 240 520 160
- X1 41 544 144 568 240 12 1
- X5
- X 544 240 544 160 568 240 568 160
- X 544 144
- X1 40 584 160 616 256 22 1
- X5
- X 584 160 584 240 616 160 616 240
- X 584 256
- X1 39 32 280 88 360 32 1
- X5
- X 40 280 88 280 40 320 88 320
- X 32 360
- X1 38 120 280 200 360 13 1
- X5
- X 120 280 120 360 160 280 160 360
- X 200 320
- X4 36 8 368 72 432 0 1
- X40 400 32
- X4 35 80 376 144 440 1 1
- X112 408 32
- X4 34 144 376 208 440 2 1
- X176 408 32
- X6 27 76 552 136 566 6000 0
- X136 552 11 0 3
- Xhello world
- X6 26 76 522 136 536 a000 0
- X136 536 11 0 3
- Xhello world
- X2 25 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
- X2 22 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 21 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 20 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 19 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
- X1 18 560 280 600 368 24 1
- X5
- X 560 360 560 280 600 360 600 280
- X 568 368
- X1 17 504 280 536 360 14 1
- X4
- X 504 360 504 280 536 360 536 280
- X1 15 200 280 280 360 23 1
- X4
- X 200 280 280 280 200 360 280 360
- X5 6 512 376 600 408 1 1
- X556 392 44 16
- X5 5 24 472 136 512 4 1
- X80 492 56 20
- X5 4 480 432 616 448 3 1
- X548 440 68 8
- END_OF_FILE
- if test 3352 -ne `wc -c <'xpic/doc/test.x'`; then
- echo shar: \"'xpic/doc/test.x'\" unpacked with wrong size!
- fi
- chmod +x 'xpic/doc/test.x'
- # end of 'xpic/doc/test.x'
- fi
- if test -f 'xpic/doc/victor.ps' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/doc/victor.ps'\"
- else
- echo shar: Extracting \"'xpic/doc/victor.ps'\" \(3964 characters\)
- sed "s/^X//" >'xpic/doc/victor.ps' <<'END_OF_FILE'
- X%!
- X%%Creator: root@church.csri (Operator)
- X%%Title: victor.x (xpic)
- X%%CreationDate: Tue Oct 4 04:22:55 1988
- X%%Pages: 1
- X%%BoundingBox: 0 0 309.6 266.4
- X% (in inches) at 0 0, width 4.3, height 3.7
- X%%EndComments
- X% Prolog for xpic to PostScript converter
- X% Author: Mark Moraes
- X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp
- X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
- X% %s F - change font to fontname
- X% %d S - change size (font size in points)
- X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
- X% %d %d l - lineto
- X% %d %d m - moveto
- X% %d %d s - spline segment
- X% x - flush line, spline
- X% <wid> <ht> <x> <y> b - box
- X% <wid> <ht> <x> <y> e - ellipse
- X% %d ss - setscale
- X% %d W - change linewidth
- Xsave 50 dict begin /xpic exch def
- X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
- X% Set defaults
- X/fontname /Times-Roman def
- X/ptsize 12 def
- X% halign has the values for MIDLINE, TOPLINE, BOTLINE
- X/halign 3 array def
- X/s {rcurveto} def
- X/x {stroke} def
- X/l {lineto} def
- X/m {moveto} def
- X/b {
- X /ury exch def /urx exch def /lly exch def /llx exch def
- X llx lly moveto urx lly lineto urx ury lineto
- X llx ury lineto llx lly lineto stroke
- X} def
- X/mtrx matrix def
- X/e {
- X /yc exch def /xc exch def /yrad exch def /xrad exch def
- X xc xrad add yc moveto
- X /savematrix mtrx currentmatrix def
- X xc yc translate
- X xrad yrad scale
- X 0 0 1 0 360 arc
- X savematrix setmatrix stroke
- X} def
- X% The next three take the text string, and moveto the right horiz. position
- X% leaving the string on the stack.
- X/lj {} def
- X/rj {dup stringwidth pop neg 0 rmoveto} def
- X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
- X% And this is invoked after one of the three above, and
- X% computes the vert. pos, and then displays the string.
- X/t {halign exch get 0 exch rmoveto show newpath} def
- X% Store an array of patterns in /styles - a pattern is an array consisting
- X% of an array and an offset. Corresp to xpic patterns
- X% solid, dotted, short-dashed, long-dashed, dot-dashed
- X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
- X 5 array astore def
- X% change style to arg.
- X/D {stroke styles exch get aload pop setdash newpath} def
- X/W {stroke 0.5 mul setlinewidth newpath} def
- X% fontbox takes a fontname off the stack, and returns an array
- X% containing the values of the bottom line of the bounding box, the
- X% mid line of the bounding box, and the top line of the bounding box
- X% of that font, taken from the baseline, scaled to a font of size 1
- X/fontbox {
- X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
- X /ytop exch def pop /ybot exch def pop
- X /ymid ytop ybot sub 2 div def
- X 0 ybot fm dtransform exch pop % botline
- X dup neg exch % midline - this works better than (ytop-ybot)/2!
- X 0 ytop fm dtransform exch pop exch %topline
- X % now in the order midline, topline, botline.
- X 3 array astore
- X} def
- X% select font
- X/F {
- X dup /fontname exch def fontbox
- X /thisfontbox exch def SF
- X} def
- X% set point size
- X/S {/ptsize exch def SF} def
- X% actually set font
- X/SF {
- X fontname findfont ptsize curscale div scalefont setfont
- X thisfontbox aload pop
- X 1 1 3 {
- X pop ptsize mul curscale div neg 3 1 roll
- X } for
- X halign astore pop
- X} def
- X% sets the scale to 72 / n, where n is on the stack, and stores the value
- X% in curscale for font scaling
- X/curscale 1 def
- X/ss {/curscale exch 72 exch div dup dup scale def} def
- X/land {90 rotate} def
- XStartXpic
- X%%EndProlog
- X1 1 scale
- X80 ss
- X1 W
- X0 D
- X0 296 m
- X104 296 l
- Xx
- X24 256 344 0 b
- X104 152 m
- X104 176 l
- X224 176 l
- X224 96 l
- X184 96 l
- Xx
- X64 152 184 72 b
- X104 152 m
- X104 176 l
- X224 176 l
- X224 96 l
- X184 96 l
- Xx
- X136 176 m
- X136 216 l
- X256 216 l
- X256 40 l
- X136 40 l
- X136 72 l
- Xx
- X0.5 W
- X/Times-Roman F
- X12 S
- X144 48 m
- X(A) ce 0 t
- X216 104 m
- X(B) ce 0 t
- X72 80 m
- X(C) ce 0 t
- X%%Trailer
- Xshowpage
- X% Trailer for xpic to PostScript converter
- X% $Header: x2ps.tra,v 1.1 88/08/31 23:48:01 moraes Exp $
- Xxpic end restore
- END_OF_FILE
- if test 3964 -ne `wc -c <'xpic/doc/victor.ps'`; then
- echo shar: \"'xpic/doc/victor.ps'\" unpacked with wrong size!
- fi
- # end of 'xpic/doc/victor.ps'
- fi
- if test -f 'xpic/mytypes.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/mytypes.h'\"
- else
- echo shar: Extracting \"'xpic/mytypes.h'\" \(3648 characters\)
- sed "s/^X//" >'xpic/mytypes.h' <<'END_OF_FILE'
- X#ifndef __XPIC_TYPES_H__
- X#define __XPIC_TYPES_H__
- X/*
- X * Stores the graphic elements as a struct which contains a bounding box,
- X * an element type (tokens), a pointer to the data for the element, and
- X * an attribute word. For such things as boxes the data pointer will be
- X * null. For polylines and splines, it will consist of a linked list of
- X * points. For a conic (circle, ellipse), it will consist of centre, and
- X * the x and y radii. For text, it consists of a length, and a string.
- X * For cells, it consists of a name, and a pointer to a graphic struct.
- X * The attributes fit into a long int. They are things like linestyle
- X * (solid, dotted, short dashed, long dashed, dot dashed), arrowtype
- X * (noarrow, arrow at the start, arrow at the end, arrow at both ends),
- X * and whether the box/conic is filled or not. Text fonts, text sizes are
- X * stored in the text struct itself
- X */
- X
- X
- Xtypedef struct {
- X int x, y;
- X} Point;
- X
- Xtypedef struct {
- X Point ll, ur;
- X} Box;
- X
- Xtypedef struct _gel {
- X Box b_box;
- X int type; /* The type of gel - see below */
- X int attributes; /*
- X * The attributes for the gel -
- X * linestyle, arrowstyle, fillstyle,
- X * text alignment
- X */
- X int number; /*
- X * The id number of the gel - so they
- X * can be kept in sorted order - this
- X * will be necessary when doing filled
- X * shapes - making sure different
- X * shapes get drawn in the right order
- X */
- X int linewidth; /* Line thickness */
- X int int_flags; /*
- X * For internal use only - (eg) marking
- X * during select
- X */
- X caddr_t data; /*
- X * A gel dependent item - it points to
- X * nothing for a box, which is
- X * represented by the bounding box, to
- X * a struct of type PointList for lines
- X * and splines, to a TextString for
- X * text, to a Conic for circles and
- X * ellipses
- X */
- X struct _gel *next;
- X} Gel;
- X
- Xtypedef struct {
- X int nVerts;
- X XPoint *v;
- X} PointList;
- X
- X
- Xtypedef struct {
- X Point centre;
- X int xrad, yrad;
- X} Conic;
- X
- Xtypedef struct {
- X int pointsize; /* At the current screen resolution */
- X char *xfontname; /* to use for XLoadQueryFont() */
- X XFontStruct *font; /* Actual font */
- X} FontSizes;
- X
- Xtypedef struct {
- X char *name;
- X FontSizes *sizes;
- X int nsizes;
- X int maxsizes;
- X int cursize;
- X} FontFamily;
- X
- Xtypedef struct {
- X char *name;
- X void (* handler)();
- X} ButtonInfo;
- X
- Xtypedef struct _text {
- X int x, y;
- X int length;
- X char *str;
- X FontFamily *font;
- X int sizeindex;
- X char *fontname;
- X int fontsize;
- X} TextString;
- X
- X/* A string buffer that reallocates itself - size is the actual alloced size */
- Xtypedef struct {
- X char *buf;
- X int size;
- X} Buf;
- X
- X/*
- X * Cells are the actual pictures - they are essentially one Gel linked
- X * list, a corresponding View, and a bit of info about the cell status.
- X * They form a linked list too, because one xpic may have multiple cells.
- X */
- Xtypedef struct _cell {
- X Gel *gelList; /* All the cell's graphic elements */
- X int undo; /*
- X * For an undo operation, the top 'undo'
- X * elements must be removed from gelList
- X * and...
- X */
- X Gel *undoList; /*
- X * .. the elements in 'undoList' must be
- X * added to gelList
- X */
- X char *name; /* cell name */
- X char *filename; /* File associated with this cell */
- X time_t mtime; /* The last modified time of the cell file */
- X int saved; /* Is this thing saved? */
- X int changes; /* Number of changes since last checkpoint */
- X struct _cell *next;
- X} Cell;
- X
- X#endif /* __XPIC_TYPES_H__ */ /* Do not add anything after this line */
- END_OF_FILE
- if test 3648 -ne `wc -c <'xpic/mytypes.h'`; then
- echo shar: \"'xpic/mytypes.h'\" unpacked with wrong size!
- fi
- # end of 'xpic/mytypes.h'
- fi
- if test -f 'xpic/test/marcel1.x' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/test/marcel1.x'\"
- else
- echo shar: Extracting \"'xpic/test/marcel1.x'\" \(4539 characters\)
- sed "s/^X//" >'xpic/test/marcel1.x' <<'END_OF_FILE'
- X24 53 616 792 8
- X6 104 182 337 218 351 0 0
- X200 344 5 0 3
- XuCode
- X6 103 24 161 47 175 1000 0
- X24 168 3 1 3
- XIFU
- X6 102 187 313 213 327 0 0
- X200 320 3 0 3
- XIDU
- X6 101 108 329 164 343 0 0
- X136 336 8 0 3
- XEU uCode
- X6 100 136 329 136 343 0 0
- X136 336 0 0 3
- X
- X6 99 141 297 180 311 0 0
- X160 304 4 0 3
- XuROM
- X1 98 176 312 176 368 0 1
- X2
- X 176 368 176 312
- X6 97 322 537 366 551 0 0
- X344 544 8 0 3
- X(2-port)
- X6 96 310 513 378 527 0 0
- X344 520 13 0 3
- XRegister File
- X6 95 326 497 362 511 0 0
- X344 504 4 0 3
- XBASE
- X6 94 192 514 240 527 0 0
- X216 520 9 0 2
- XIncrement
- X6 93 424 514 472 527 0 0
- X448 520 9 0 2
- XIncrement
- X6 92 442 498 454 511 0 0
- X448 504 2 0 2
- XSP
- X6 91 209 498 223 511 0 0
- X216 504 2 0 2
- XPC
- X6 90 185 410 215 423 0 0
- X200 416 5 0 2
- XCheck
- X6 89 190 394 211 407 0 0
- X200 400 5 0 2
- XStall
- X3 88 176 392 224 424 0 1
- X6 87 109 739 164 750 0 0
- X136 744 15 0 1
- XDecoded Instr 3
- X6 86 109 619 164 630 0 0
- X136 624 15 0 1
- XDecoded Instr 2
- X3 85 88 736 184 752 0 1
- X1 84 136 592 216 592 20 1
- X2
- X 136 592 216 592
- X1 83 136 664 216 664 20 1
- X2
- X 136 664 216 664
- X3 82 88 616 184 632 0 1
- X3 81 88 448 184 464 0 1
- X6 80 448 450 464 463 0 0
- X456 456 3 0 2
- Xsop
- X6 79 99 451 174 462 0 0
- X136 456 19 0 1
- XDecoded Instruction
- X6 78 355 450 382 463 0 0
- X368 456 7 0 2
- Xfield 2
- X6 77 267 450 294 463 0 0
- X280 456 7 0 2
- Xfield 1
- X6 76 264 250 329 263 0 0
- X296 256 13 0 2
- XDecode Buffer
- X6 75 295 186 426 199 0 0
- X360 192 30 0 2
- XInstruction Queue (7x18 bits)
- X3 74 256 176 472 208 0 1
- X6 73 273 130 367 143 0 0
- X320 136 22 0 2
- XPC Stack (16x30 bits)
- X3 72 256 120 384 152 0 1
- X6 71 136 141 171 163 1000 0
- X136 152 3 0 6
- XIFU
- X6 70 112 173 198 195 1000 0
- X112 184 10 0 6
- XController
- X6 69 392 373 452 395 1000 0
- X392 384 5 0 6
- X(ODL)
- X6 68 312 373 359 395 1000 0
- X312 384 5 0 6
- XLogic
- X6 67 312 341 374 363 1000 0
- X312 352 6 0 6
- XDecode
- X6 66 312 309 387 331 1000 0
- X312 320 7 0 6
- XOperand
- X6 65 272 685 319 707 1000 0
- X272 696 5 0 6
- XLogic
- X1 64 312 264 312 288 20 1
- X2
- X 312 264 312 288
- X6 63 272 653 311 675 1000 0
- X272 664 4 0 6
- XUnit
- X6 62 272 621 357 643 1000 0
- X272 632 9 0 6
- XExecution
- X6 61 538 761 582 775 0 0
- X560 768 8 0 3
- X(2-port)
- X6 60 543 729 577 743 0 0
- X560 736 5 0 3
- XCache
- X6 59 545 705 575 719 0 0
- X560 712 5 0 3
- XStack
- X6 58 571 497 598 511 0 0
- X584 504 3 0 3
- XBUS
- X6 57 560 529 609 543 0 0
- X584 536 9 0 3
- XInterface
- X1 56 232 80 432 80 0 1
- X2
- X 232 80 432 80
- X6 55 231 53 425 75 0 0
- X328 64 19 1 7
- XSLIME Architecture
- X6 54 24 321 49 335 1000 0
- X24 328 3 1 3
- XIDU
- X6 53 24 753 50 767 1000 0
- X24 760 4 1 3
- XEU 3
- X6 52 24 657 50 671 1000 0
- X24 664 4 1 3
- XEU 2
- X6 51 24 513 50 527 1000 0
- X24 520 4 1 3
- XEU 1
- X1 50 392 528 408 528 20 1
- X2
- X 408 528 392 528
- X1 49 280 528 296 528 20 1
- X2
- X 280 528 296 528
- X1 48 224 408 240 408 20 1
- X2
- X 240 408 224 408
- X1 47 312 208 312 248 20 1
- X2
- X 312 208 312 248
- X1 46 280 208 280 248 20 1
- X2
- X 280 208 280 248
- X1 45 192 368 256 376 20 1
- X3
- X 192 368 192 376 256 376
- X1 44 280 464 280 576 20 1
- X2
- X 280 464 280 576
- X1 43 456 408 456 448 20 1
- X2
- X 456 408 456 448
- X1 42 376 408 376 448 20 1
- X2
- X 376 408 376 448
- X1 41 280 408 280 448 20 1
- X2
- X 280 408 280 448
- X1 40 216 272 280 328 20 1
- X4
- X 280 272 248 272 248 328 216 328
- X1 39 280 264 280 288 20 1
- X2
- X 280 264 280 288
- X1 38 456 728 512 728 30 1
- X2
- X 456 728 512 728
- X1 37 456 712 512 712 30 1
- X2
- X 456 712 512 712
- X1 36 248 512 296 512 30 1
- X2
- X 248 512 296 512
- X1 35 136 512 192 512 20 1
- X2
- X 136 512 192 512
- X1 34 176 208 240 496 20 1
- X4
- X 240 496 240 232 176 232 176 208
- X1 33 168 208 232 400 20 1
- X5
- X 224 400 232 400 232 240 168 240
- X 168 208
- X3 32 192 496 248 536 0 1
- X1 31 136 368 136 448 20 1
- X2
- X 136 368 136 448
- X1 30 136 752 216 760 20 1
- X3
- X 136 752 136 760 216 760
- X1 29 136 632 136 736 20 1
- X2
- X 136 632 136 736
- X1 28 136 464 136 616 20 1
- X2
- X 136 464 136 616
- X1 27 456 464 456 496 20 1
- X2
- X 456 464 456 496
- X1 26 408 464 408 576 20 1
- X2
- X 408 464 408 576
- X1 25 472 192 528 568 20 1
- X3
- X 472 192 528 192 528 568
- X1 24 528 568 552 568 30 1
- X2
- X 528 568 552 568
- X1 23 528 568 528 688 30 1
- X2
- X 528 688 528 568
- X1 22 456 632 528 632 30 1
- X2
- X 456 632 528 632
- X1 21 392 512 424 512 30 1
- X2
- X 392 512 424 512
- X1 20 368 552 368 576 30 1
- X2
- X 368 552 368 576
- X1 19 320 552 320 576 30 1
- X2
- X 320 552 320 576
- X1 18 216 184 256 184 30 1
- X2
- X 216 184 256 184
- X1 17 216 136 256 136 30 1
- X2
- X 216 136 256 136
- X3 16 552 472 616 640 0 1
- X3 15 512 688 608 792 0 1
- X3 14 96 128 216 208 0 1
- X3 13 256 248 336 264 0 1
- X3 12 256 288 472 408 0 1
- X3 11 96 288 216 368 0 1
- X3 10 256 448 304 464 0 1
- X3 9 328 448 416 464 0 1
- X3 8 440 448 472 464 0 1
- X3 7 296 488 392 552 0 1
- X3 6 424 496 480 536 0 1
- X3 5 216 576 456 768 0 1
- X3 4 72 104 496 792 1 1
- X1 3 72 232 496 232 1 1
- X2
- X 72 232 496 232
- X1 2 72 432 496 432 1 1
- X2
- X 72 432 496 432
- X1 1 72 600 496 600 2 1
- X2
- X 72 600 496 600
- X1 0 72 720 496 720 2 1
- X2
- X 72 720 496 720
- END_OF_FILE
- if test 4539 -ne `wc -c <'xpic/test/marcel1.x'`; then
- echo shar: \"'xpic/test/marcel1.x'\" unpacked with wrong size!
- fi
- # end of 'xpic/test/marcel1.x'
- fi
- if test -f 'xpic/test/test.x' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/test/test.x'\"
- else
- echo shar: Extracting \"'xpic/test/test.x'\" \(3352 characters\)
- sed "s/^X//" >'xpic/test/test.x' <<'END_OF_FILE'
- X#! /usr/local/xpic
- X8 32 624 832 8
- X6 9 137 536 216 552 0 0
- X176 544 11 3 3
- Xhello world
- X3 10 136 536 216 552 4 1
- X6 8 144 513 208 527 0 0
- X176 520 11 1 3
- Xhello world
- X3 11 144 512 208 528 4 1
- X3 12 144 488 208 504 4 1
- X3 29 144 456 208 472 4 1
- X6 30 146 489 206 503 0 0
- X176 496 11 2 3
- Xhello world
- X6 31 146 457 206 471 0 0
- X176 464 11 0 3
- Xhello world
- X1 16 400 280 480 360 34 1
- X5
- X 400 280 440 360 440 280 480 360
- X 480 320
- X2 24 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
- X6 0 472 503 572 528 9000 0
- X472 528 11 0 7
- Xhello world
- X1 37 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
- X2 23 336 576 440 672 30 1
- X7
- X 336 576 400 576 368 616 392 624
- X 440 624 376 672 352 672
- X5 7 408 376 504 416 0 1
- X456 396 48 20
- X4 33 224 376 288 440 3 1
- X256 408 32
- X6 3 424 544 497 558 5000 0
- X424 544 14 0 3
- Xlj top (moved)
- X6 1 232 469 310 496 9000 0
- X232 496 6 1 9
- Xxxxxxx
- X4 32 288 368 384 464 4 1
- X336 416 48
- X5 2 408 440 440 496 2 1
- X424 468 16 28
- X6 13 307 530 381 544 8000 0
- X344 544 13 0 3
- Xbottom center
- X3 28 272 504 424 544 4 1
- X6 14 318 504 370 518 4000 0
- X344 504 10 0 3
- Xtop center
- X3 58 40 40 136 112 0 1
- X3 57 168 88 328 120 0 1
- X3 56 208 32 304 64 1 1
- X3 55 352 48 488 120 2 1
- X3 54 368 64 472 104 3 1
- X3 53 384 72 456 96 4 1
- X1 52 520 40 560 120 0 1
- X4
- X 520 40 520 120 560 120 560 40
- X1 51 584 40 624 120 1 1
- X4
- X 584 40 584 120 624 120 624 40
- X1 50 40 160 80 240 2 1
- X4
- X 40 160 40 240 80 160 80 240
- X1 49 96 160 136 240 3 1
- X4
- X 96 240 96 160 136 240 136 160
- X1 48 160 160 200 240 4 1
- X4
- X 160 240 160 160 200 240 200 160
- X1 47 224 160 264 240 10 1
- X5
- X 224 160 224 240 248 160 248 240
- X 264 160
- X1 46 280 160 304 240 20 1
- X4
- X 280 160 288 224 296 168 304 240
- X1 45 320 160 360 240 30 1
- X5
- X 320 160 360 240 320 240 360 160
- X 360 200
- X1 44 376 160 440 240 11 1
- X5
- X 376 240 376 168 400 240 400 160
- X 440 240
- X1 43 456 160 480 240 21 1
- X4
- X 456 240 456 160 480 240 480 160
- X1 42 496 160 520 240 31 1
- X4
- X 496 240 496 160 520 240 520 160
- X1 41 544 144 568 240 12 1
- X5
- X 544 240 544 160 568 240 568 160
- X 544 144
- X1 40 584 160 616 256 22 1
- X5
- X 584 160 584 240 616 160 616 240
- X 584 256
- X1 39 32 280 88 360 32 1
- X5
- X 40 280 88 280 40 320 88 320
- X 32 360
- X1 38 120 280 200 360 13 1
- X5
- X 120 280 120 360 160 280 160 360
- X 200 320
- X4 36 8 368 72 432 0 1
- X40 400 32
- X4 35 80 376 144 440 1 1
- X112 408 32
- X4 34 144 376 208 440 2 1
- X176 408 32
- X6 27 76 552 136 566 6000 0
- X136 552 11 0 3
- Xhello world
- X6 26 76 522 136 536 a000 0
- X136 536 11 0 3
- Xhello world
- X2 25 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
- X2 22 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 21 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 20 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 19 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
- X1 18 560 280 600 368 24 1
- X5
- X 560 360 560 280 600 360 600 280
- X 568 368
- X1 17 504 280 536 360 14 1
- X4
- X 504 360 504 280 536 360 536 280
- X1 15 200 280 280 360 23 1
- X4
- X 200 280 280 280 200 360 280 360
- X5 6 512 376 600 408 1 1
- X556 392 44 16
- X5 5 24 472 136 512 4 1
- X80 492 56 20
- X5 4 480 432 616 448 3 1
- X548 440 68 8
- END_OF_FILE
- if test 3352 -ne `wc -c <'xpic/test/test.x'`; then
- echo shar: \"'xpic/test/test.x'\" unpacked with wrong size!
- fi
- chmod +x 'xpic/test/test.x'
- # end of 'xpic/test/test.x'
- fi
- if test -f 'xpic/util.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/util.c'\"
- else
- echo shar: Extracting \"'xpic/util.c'\" \(3734 characters\)
- sed "s/^X//" >'xpic/util.c' <<'END_OF_FILE'
- X/* $Header: util.c,v 1.4 89/04/21 03:31:41 xwindows Exp $ */
- X/*
- X * Generally useful procedures
- X */
- X/* This file contains code from the JOVE screen editor. */
- X
- X/************************************************************************
- X * JOVE is Copyright (C) 1986 by Jonathan Payne. JOVE is *
- X * provided to you without charge, and with no warranty. You may give *
- X * away copies of JOVE, including sources, provided that this notice is *
- X * included in all the files. *
- X ************************************************************************/
- X
- X/*
- X * Modified by Mark Moraes for use in a widget for the X Windows System
- X * Version 11. This file is still independent of the X Windows System unless
- X * XWINDOWS is defined.
- X */
- X
- X#include <stdio.h>
- X#include <sys/types.h>
- X#include <sys/stat.h>
- X#include <sys/param.h>
- X#include <errno.h>
- X#include <pwd.h>
- X#ifdef XWINDOWS
- X#include <X11/Xos.h>
- X#else
- X#include <strings.h>
- X#endif
- X
- X
- Xchar *
- XStripName(name)
- Xchar *name;
- X{
- X char *begin = rindex (name, '/');
- X char *end, *result;
- X int length;
- X extern char *malloc();
- X
- X begin = (begin ? begin+1 : name);
- X end = index (begin, '.');
- X length = (end ? (end - begin) : strlen (begin));
- X if ((result = malloc ((unsigned) (length + 1))) == 0)
- X return(0);
- X (void) strncpy (result, begin, length);
- X result [length] = '\0';
- X return (result);
- X}
- X
- X/* Get a user's home directory */
- Xget_hdir(user, buf)
- Xregister char *user,
- X *buf;
- X{
- X struct passwd *pw;
- X
- X /* Rewind the passwd file - we may have searched once already */
- X (void) setpwent();
- X if (((pw = getpwnam(user)) != NULL) && (pw->pw_dir != NULL)) {
- X (void) strcpy(buf, pw->pw_dir);
- X return;
- X }
- X}
- X
- X/*
- X * gets the users home directory and stores it in a static area, so that
- X * subsequent calls get it cheaply. Uses the HOME environment variable, if
- X * that fails, uses the password file entry, else returns "/" if even that
- X * fails.
- X */
- Xchar *
- Xgetmyhomedir()
- X{
- X static char *cp = NULL;
- X extern char *getenv();
- X extern char *malloc();
- X struct passwd *pw;
- X
- X if (cp)
- X return cp;
- X
- X if ((cp = getenv("HOME")) == NULL) {
- X (void) setpwent();
- X pw = getpwuid(getuid());
- X if (pw != NULL && pw->pw_dir != NULL) {
- X cp = malloc((unsigned) (strlen(pw->pw_dir) + 1));
- X if (cp != NULL)
- X (void) strcpy(cp, pw->pw_dir);
- X }
- X }
- X if (cp == NULL)
- X cp = "/";
- X return(cp);
- X}
- X
- X/* Replace ~/ with $HOME/ and ~user/ with get_hdir/ */
- XPathParse(name, intobuf)
- Xchar *name,
- X *intobuf;
- X{
- X intobuf[0] = '\0';
- X if (*name == '\0')
- X return;
- X
- X if (*name == '~') {
- X if (name[1] == '/' || name[1] == '\0') {
- X (void) strcpy(intobuf, getmyhomedir());
- X name++;
- X } else {
- X char *uendp = index(name, '/'),
- X unamebuf[32];
- X
- X if (uendp == 0)
- X uendp = name + strlen(name);
- X name = name + 1;
- X null_ncpy(unamebuf, name, uendp - name);
- X get_hdir(unamebuf, intobuf);
- X name = uendp;
- X }
- X } else if (*name == '\\')
- X name++;
- X (void) strcat(intobuf, name);
- X}
- X
- Xint
- Xfile_backup(fname, defaultmode)
- Xchar *fname;
- Xu_short defaultmode;
- X{
- X char *s;
- X register int i;
- X int fd1,
- X fd2;
- X char tmp1[BUFSIZ],
- X tmp2[BUFSIZ];
- X int mode;
- X
- X (void) strcpy(tmp1, fname);
- X
- X if ((s = rindex(tmp1, '/')) == NULL)
- X (void) sprintf(tmp2, "#%s~", fname);
- X else {
- X *s++ = '\0';
- X (void) sprintf(tmp2, "%s/#%s~", tmp1, s);
- X }
- X
- X if ((fd1 = open(fname, 0)) < 0)
- X return -1;
- X
- X if (defaultmode == 0)
- X mode = 0666;
- X else
- X mode = defaultmode;
- X
- X if ((fd2 = creat(tmp2, mode)) < 0) {
- X (void) close(fd1);
- X return -1;
- X }
- X
- X while ((i = read(fd1, tmp1, sizeof(tmp1))) > 0)
- X (void) write(fd2, tmp1, i);
- X
- X (void) close(fd1);
- X
- X if (close(fd2) == -1)
- X return -1;
- X
- X return 0;
- X
- X}
- X
- X
- Xnull_ncpy(to, from, n)
- Xchar *to,
- X *from;
- X{
- X (void) strncpy(to, from, n);
- X to[n] = '\0';
- X}
- X
- END_OF_FILE
- if test 3734 -ne `wc -c <'xpic/util.c'`; then
- echo shar: \"'xpic/util.c'\" unpacked with wrong size!
- fi
- # end of 'xpic/util.c'
- fi
- if test -f 'xpic/x2ps.pro' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xpic/x2ps.pro'\"
- else
- echo shar: Extracting \"'xpic/x2ps.pro'\" \(3587 characters\)
- sed "s/^X//" >'xpic/x2ps.pro' <<'END_OF_FILE'
- X% Prolog for xpic to PostScript converter
- X% Author: Mark Moraes
- X% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp
- X% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
- X% %s F - change font to fontname
- X% %d S - change size (font size in points)
- X% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
- X% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
- X% %d %d l - lineto
- X% %d %d m - moveto
- X% %d %d s - spline segment
- X% x - flush line, spline
- X% <wid> <ht> <x> <y> b - box
- X% <wid> <ht> <x> <y> e - ellipse
- X% %d ss - setscale
- X% %d W - change linewidth
- X% getpagesize - gets the values of PAGEHEIGHT and PAGEWIDTH
- X% %d %d flip - translate by %d, PAGEHEIGHT - %d (this
- X% transforms to X windows coordinates)
- Xsave 50 dict begin /xpic exch def
- X/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
- X% Set defaults
- X/fontname /Times-Roman def
- X/ptsize 12 def
- X% halign has the values for MIDLINE, TOPLINE, BOTLINE
- X/halign 3 array def
- X/s {rcurveto} def
- X/x {stroke} def
- X/l {lineto} def
- X/m {moveto} def
- X/b {
- X /ury exch def /urx exch def /lly exch def /llx exch def
- X llx lly moveto urx lly lineto urx ury lineto
- X llx ury lineto llx lly lineto stroke
- X} def
- X/mtrx matrix def
- X/e {
- X /yc exch def /xc exch def /yrad exch def /xrad exch def
- X xc xrad add yc moveto
- X /savematrix mtrx currentmatrix def
- X xc yc translate
- X xrad yrad scale
- X 0 0 1 0 360 arc
- X savematrix setmatrix stroke
- X} def
- X% The next three take the text string, and moveto the right horiz. position
- X% leaving the string on the stack.
- X/lj {} def
- X/rj {dup stringwidth pop neg 0 rmoveto} def
- X/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
- X% And this is invoked after one of the three above, and
- X% computes the vert. pos, and then displays the string.
- X/t {halign exch get 0 exch rmoveto show newpath} def
- X% Store an array of patterns in /styles - a pattern is an array consisting
- X% of an array and an offset. Corresp to xpic patterns
- X% solid, dotted, short-dashed, long-dashed, dot-dashed
- X/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
- X 5 array astore def
- X% change style to arg.
- X/D {stroke styles exch get aload pop setdash newpath} def
- X/W {stroke 0.5 mul setlinewidth newpath} def
- X% fontbox takes a fontname off the stack, and returns an array
- X% containing the values of the bottom line of the bounding box, the
- X% mid line of the bounding box, and the top line of the bounding box
- X% of that font, taken from the baseline, scaled to a font of size 1
- X/fontbox {
- X findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
- X /ytop exch def pop /ybot exch def pop
- X /ymid ytop ybot sub 2 div def
- X 0 ybot fm dtransform exch pop % botline
- X dup neg exch % midline - this works better than (ytop-ybot)/2!
- X 0 ytop fm dtransform exch pop exch %topline
- X % now in the order midline, topline, botline.
- X 3 array astore
- X} def
- X% select font
- X/F {
- X dup /fontname exch def fontbox
- X /thisfontbox exch def SF
- X} def
- X% set point size
- X/S {/ptsize exch def SF} def
- X% actually set font
- X/SF {
- X fontname findfont ptsize curscale div scalefont setfont
- X thisfontbox aload pop
- X 1 1 3 {
- X pop ptsize mul curscale div neg 3 1 roll
- X } for
- X halign astore pop
- X} def
- X% sets the scale to 72 / n, where n is on the stack, and stores the value
- X% in curscale for font scaling
- X/curscale 1 def
- X/getpagesize{newpath clippath pathbbox /pageheight exch def
- X /pagewidth exch def pop pop newpath} def
- X/flip{pageheight exch sub translate} def
- X/ss {/curscale exch 72 exch div dup dup scale def} def
- X/land {90 rotate} def
- XStartXpic
- END_OF_FILE
- if test 3587 -ne `wc -c <'xpic/x2ps.pro'`; then
- echo shar: \"'xpic/x2ps.pro'\" unpacked with wrong size!
- fi
- # end of 'xpic/x2ps.pro'
- fi
- echo shar: End of archive 3 \(of 15\).
- cp /dev/null ark3isdone
- 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
-