%% xyps-pro.tex from $Id: xyps-pro.doc,v 3.3 1996/12/18 10:00:34 ross Exp $
%%
%% Xy-pic ``PostScript Prolog'' for PostScript support.
%% Copyright (c) 1993-1996 Ross Moore <ross@mpce.mq.edu.au>
%%
%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
%% See the companion README and INSTALL files for further information.
%% Copyright (c) 1991-1996 Kristoffer H. Rose <krisrose@brics.dk>
%%
%% The Xy-pic package is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by the
%% Free Software Foundation; either version 2 of the License, or (at your
%% option) any later version.
%%
%% The Xy-pic package is distributed in the hope that it will be useful, but
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
%% for more details.
%%
%% You should have received a copy of the GNU General Public License along
%% with this package; if not, write to the Free Software Foundation, Inc.,
%% 675 Mass Ave, Cambridge, MA 02139, USA.
%%
\begingroup \xycatcodes%
 \count@=\xydashl@\relax \count@@=\xydashw@\relax%
 \let\firstPS@@=\relax%
 \xyPSobeylines@@%
\PSspecialdict@@{%
/XYdict where not{250 dict /XYdict exch def 
 /xy{mark exch XYdict begin countdictstack /xylevel exch def
 xyopen xycolor mark xypatt xypattern stopped xyclose end
 cleartomark}def /xyg{gsave xy}def 
 /xyf{currentfont exch xy grestore setfont}def
 /xycc{{xychgcol}xy}def /xyc{XYdict begin xycolstore end}def
 /xyx{/xyYpos exch def /xyXpos exch def}def 
 /xyp{currentpoint xyx}def
 /xyd{setupDirection XYdirection 2 mul}def 
 /xyct{currentpoint xyt 2 copy 6 2 roll}def
 /xyt{xyXpos xyYpos 2 copy translate}def /xyr{neg rotate xynt}def
 /xyrs{neg rotate 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
 /xynt{neg exch neg exch translate}def /xys{scale xynt}def
 /xyss{scale 3 -1 roll sub neg 3 1 roll sub exch moveto xynt}def
 /xyi{0 0 transform grestore gsave itransform}def
 }if}%
\tmp@false\def\do#1{\DN@{#1}\ifx\next@\nextii@\tmp@true\fi}%
\DNii@{17oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
 /@boxy{prespecialVM restore grestore}def
 /@eoxy{gsave /prespecialVM save def}def
 }%
\else \DNii@{oztex}\xydriversselected@@\iftmp@\PSspecialdict@@{%
 /@oxy{prespecialVM restore grestore}def
 /@oxy{gsave /prespecialVM save def}def
 }\fi\fi% 
\PSdict@@{/XYdict where pop begin XYdict begin}%
\PSdict@@{%
 /xyopen{currentdict /XYddict known{XYddict null eq{}
 {XYddict begin xyopen}ifelse}if}def
 /xyclose{countdictstack -1 xylevel 1 add{pop end}for}def
 /xychgcol{/xycolor exch def}def /xysetcol{xypush xychgcol}def 
}%
\PSdict@@{%
 /xypush{16 dict /XYddict exch def XYddict begin}def
 /undef where
 {pop /xypop{countdictstack xylevel eq{}{end}ifelse
 currentdict /XYddict undef}def}
 {/xypop{countdictstack xylevel eq{}{end}ifelse
 /XYddict null def}def}ifelse
 /pu /xypush load def /pp /xypop load def}%
\PSdict@@{%
 /xypspt{72 72.27 div dup scale}bind def /pscorrect{.85 mul}bind def 
 /gstartxy{gsave xypspt xywidth xycap xyjoin xymiter newpath 0 0 moveto}def 
 /xypath{gstartxy rmoveto counttomark 2 idiv -1 1{pop lineto}for}def 
 /xystroke{stroke grestore}bind def 
 /xyfill{closepath fill grestore}bind def
 /xystfil{closepath gsave fill grestore 0 setgray 
 0 setlinewidth xystroke}bind def
 /xyeofill{closepath eofill grestore}bind def
}%
\PSdict@@{%
 /xypolyline{xypath xystroke}def /xypolyfill{xypath xyfill}def
 /xydotsep{/@ currentlinewidth 2 mul def}def
 /xypolydot{xypath xydotsep [0 @] 0 setdash xystroke}def
 /xypolydash{xypath xydotsep [@ @] 0 setdash xystroke}def
 /xypolyeofill{xypath xyeofill}def /pe /xypolyeofill load def 
 /pl /xypolyline load def /pf /xypolyfill load def 
 /pt /xypolydot load def /pd /xypolydash load def }%
\PSdict@@{%
 /arc4pop{arcto 4{pop}repeat}bind def 
 /xyoval{gstartxy oval closepath xystroke}def
 /xycircle{gstartxy circle xystroke}def
 /circle{dup 0 moveto 0 0 3 -1 roll 0 360 arc}def
 /oval{newpath 2 copy exch 6 index add exch 3 copy 10 3 roll 
 moveto 1 index dup 5 1 roll 0 7 index arc4pop
 dup dup 4 1 roll 0 exch 6 index arc4pop
 1 index dup 8 1 roll 0 4 index arc4pop
 arc4pop closepath}def
 /xyellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
 circle xystroke}def
 /ov /xyoval load def /ox /xyellipse load def }%
\PSdict@@{%
 /dotit{dup currentlinewidth 6 mul div round div
 /@ exch def [0 @] 0 setdash}def
 /elldash{dup 4 -1 roll 10 exch div dashit}def
 /ovdash{dup 10 dashit}def
 /dashit{div round 2 mul div /@ exch def [@ @] 0 setdash}def
 /dotcirc{gstartxy cirlen dotit circle xystroke}def
 /dashcirc{gstartxy cirlen dashit circle xystroke}def
 /dotoval{gstartxy 5 copy ovlen dotit oval xystroke}def
 /dashoval{gstartxy 5 copy ovlen ovdash oval xystroke}def
 /cirlen{dup 6.283185 mul}bind def
 /ovlen{3 -1 roll sub 3 1 roll sub add exch 1.716815 mul sub}def
 /dotellipse{gstartxy counttomark 1 gt{squarify pop pop 1}if
 cirlen dotit circle closepath xystroke}def
 /dashellipse{gstartxy counttomark 1 gt{squarify add 2 div 1}
 {1 exch 1 exch}ifelse cirlen elldash circle xystroke}def
 /ot /dotellipse load def /od /dashellipse load def 
 /vt /dotoval load def /vd /dashoval load def }%
\PSdict@@{%
 /filloval{gstartxy oval xyfill}def
 /stfiloval{gstartxy oval xystfil}def
 /fillcircle{gstartxy circle xyfill}def 
 /stfilcircle{gstartxy circle xystfil}def 
 /fillellipse{gstartxy squarify pop pop 1 circle xyfill}def
 /stfilellipse{gstartxy squarify pop pop 1 circle xystfil}def
 /squarify{4 copy sub 2 div 3 1 roll sub 2 div translate
 add 2 div 3 1 roll add 2 div 2 copy scale
 2 copy add 2 div currentlinewidth exch div setlinewidth
 newpath}def
 /fe /fillellipse load def /sfe /stfilellipse load def 
 /fo /filloval load def /sfo /stfiloval load def
 /fc /fillcircle load def /sfc /stfilcircle load def }%
\PSdict@@{%
 /xywidth{.4 pscorrect setlinewidth}bind def
 /xydash{[] 0 setdash}bind def /xycap{1 setlinecap}bind def
 /xyjoin{1 setlinejoin}bind def /xymiter{10 setmiterlimit}bind def
}%
\PSdict@@{%
 /cc{dup exec xychgcol}def
 /lw{dup setlinewidth /@l exch def
 /xywidth{@l setlinewidth}bind def}def
 /lc{dup setlinecap /@c exch def
 /xycap{@c setlinecap}bind def}def
 /lj{dup setlinejoin /@j exch def
 /xyjoin{@j setlinejoin}bind def}def
 /ml{dup setmitrelimit /@m exch def
 /xymiter{@m setmitrelimit}bind def}def
}%
\PSdict@@{%
 /setupDirection{dup -2048 lt{3072 add neg 1024 exch}
 {dup 0 lt{1024 add neg -1024}{dup 2048 lt{1024 sub -1024 exch}
 {3072 sub 1024}ifelse}ifelse}ifelse atan 
 dup 180 gt{360 sub}if dup /XYdirection exch def rotate}def
 }%
\PSdict@@{%
 userdict begin 
 /gray{setgray}bind def /gray@{setgray}bind def
 /rgb{setrgbcolor}bind def /rgb@{setrgbcolor}bind def
 /hsb{sethsbcolor}bind def /hsb@{sethsbcolor}bind def
 /setcmykcolor where{pop}{/setcmykcolor{dup 3 1 roll dup 5 1 roll
 exch sub 1 add 5 1 roll exch sub 1 add 4 1 roll 
 exch sub 1 add 3 1 roll setrgbcolor}bind def}ifelse
 /cmyk{setcmykcolor}bind def /cmyk@{setcmykcolor}bind def
 /sethalftone where{/sethalftone load /tone exch def}if
 /xycolarray 3 array def /xycolstore{currentrgbcolor 2 -1 0
 {exch xycolarray 3 1 roll put}for}def xycolstore
 /xycolor{0 1 2{xycolarray exch get}for setrgbcolor}def
 /xypatt{}def /xypattern{cleartomark}bind def
 end}%
\PSdict@@{end end}%
\endgroup%
\endinput
