%% xyps-dvi.tex from $Id: xyps-dvi.doc,v 2.10 1994/06/15 12:46:03 ross Exp $
%%
%% XY-pic ``dvips driver'' PostScript backend support.
%% Copyright (c) 1993-1994 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-1994 Kristoffer H. Rose <kris@diku.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.
%%
\ifx\xypsdviloaded\relax \message{not reloaded}\endinput \fi
\let\xypsdviloaded=\relax \xycatcodes
\xydef@\dvips@@{\gdef\dvitype@{dvips }\dvimessage@
 \global\let\PSspecial@=\dvipsSpecial@
 \global\let\PSmacro@=\dvipsMacro@
 \global\let\PSdict@=\dvipsDict@
 \global\let\PSraw@=\dvipsRaw@
 \global\let\PSinclude@=\dvipsInclude@
 \global\let\xyPSobeylines@=\obeyDVIPSlines@
 \ifUsePSdict@@
 \gdef\firstPS@@{\firstPS@ \includePSmessage@ \includeXYPSdict@ \message{>}}%
 \gdef\endXYdict@{\firstPS@}%
 \else
 \dvipsDict@{200 dict /XYdict exch def
 /xy{XYdict begin countdictstack /xylevel exch def
 xyopen xycolor stopped xyclose cleartomark end}def
 /xyc{{xysetcol}xy}def /xycc{{xychgcol}xy}def
 XYdict begin}%
 \gdef\firstPS@@{\firstPS@ \XYdict@}%
 \gdef\endXYdict@{\firstPS@\dvipsDict@{end}}\fi
 \xyPSshapes@true
 \firstPS@@
}
\xywarnifdefined\obeyDVIPSlines@
{\catcode`\^^M=\active
 \gdef\obeyDVIPSlines@{\catcode`\^^M=\active \let^^M=\space }}
\xywarnifdefined\dvipsSpecial@
\xywarnifdefined\dvipsMacro@
\xywarnifdefined\dvipsDict@
\xywarnifdefined\dvipsInclude@
\xywarnifdefined\dvipsRaw@
{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11
 \gdef\dvipsSpecial@#1{\firstPS@@\special{ps:: SDict begin #1 end}}%
 \gdef\dvipsMacro@#1{\firstPS@@\special{" mark{#1}xy}}%
 \gdef\dvipsDict@#1{\firstPS@@\special{! mark{#1}stopped cleartomark}}%
 \gdef\dvipsInclude@#1{\firstPS@@\special{header=#1}}%
 \gdef\dvipsRaw@#1{\firstPS@@\special{ps: SDict begin #1 end}}%
}
 \dvips@@
\xydef@\dvipsCurrpt@{%
 \def\xyPScurrpt@@{\xyPSraw@{currentpoint /xyYpos exch def /xyXpos exch def}}}
\xywithoption{line}{%
 \xyinputorelse@{xyps-l.tex}{\xyerror@{Could not load xyps-l.tex}{}}}
\xycatcodes
\xydef@\dvipsRotScale@{%
 \def\xyrot@start(##1){currentpoint xyXpos xyYpos 
 2 copy translate 2 copy 6 2 roll 
 ##1\space neg rotate 
 3 -1 roll sub neg 3 1 roll sub exch moveto 
 neg exch neg exch translate }%
 \def\xyrot@end{}%
 \def\xyscale@start(##1,##2){currentpoint xyXpos xyYpos 
 2 copy translate 2 copy 6 2 roll 
 ##1\space##2\space scale 
 3 -1 roll sub neg 3 1 roll sub exch moveto 
 neg exch neg exch translate }%
 \def\xyscale@end{}}
\xywithoption{rotate}{%
 \xyinputorelse@{xyps-r.tex}{\xyerror@{Could not load xyps-r.tex}{}}%
 \dvipsCurrpt@ \dvipsRotScale@ }
\xycatcodes
\xywithoption{color}{%
 \xyinputorelse@{xyps-c.tex}{\xyerror@{Could not load xyps-c.tex}{}}}
\xycatcodes
\xyendinput
