%% xydvips.tex from $Id: xydvips.doc,v 3.3 1996/12/18 09:13:14 ross Exp $
%%
%% Xy-pic ``dvips-driver'' option.
%% Copyright (c) 1995-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.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{dvips}{DVIPS driver}{\stripRCS$Revision: 3.3 $}%
 {Ross Moore}{ross@mpce.mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydef@\dvips@@#1{\dvimessage@{dvips}{#1}}
\newdriver{%
 \xyaddsupport{color}\dvipsColor@@
 \xyaddsupport{crayon}\dvipsCrayola@@
 \xyaddsupport{ps}\dvipsPS@@
 \xyaddsupport{rotate}\dvipsRotate@@
 \xyaddsupport{line}\dvipsLine@@
 \xyaddsupport{frame}\dvipsFrames@@
 \xyaddsupport{tile}\dvipsTiles@@
 \xyaddsupport{tpic}\dvipsTPIC@ 
 \xyaddsupport{emtex}\dvipsEM@
 \xyaddsupport{cmtip}\relax
}
\xydef@\dvips@Color@{\dvipsPStypes@ 
 \let\xylocalColor@=\xystackcolor@ 
 \let\xycolor@push\xycolor@push@@
 \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\installPScolor@ }%
 \else\DN@{}\fi \next@ 
 \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvipsCrayola@{}}%
 \else \DN@{\xystandardcolors@}\fi \next@
 \let\dvipsColor@@=\relax
 \let\UnloadColor@@=\NoDVIPScolor@
 }%
\xydef@\dvipsColor@@{\dvips@Color@}
\xydef@\NoDVIPScolor@{%
 \def\xycolor@{\xycolor@@}%
 \let\xycolor@@=\xyNoColor@
 \let\xylocalColor@=\xyNoColor@@
 \let\xycolorwarning@=\xycolorwarning@@
 \let\dvipsColor@@=\dvips@Color@
 \let\UnloadColor@@=\UnloadColor@
 }
\xydef@\NoDVIPScolordvi@{\xywarning@{%
 Neither colordvi.tex nor colordvi.sty could be found.}%
 \xyBEcolorcheck@}%
\xydef@\dvipsCrayola@@{\dvipsColor@@\dvipsCrayola@}
\xydef@\dvipsCrayola@{%
 \let\prevxycolor@=\newxycolor@
 \def\newxyDVIPScolor@##1##2##3{\prevxycolor@{##1}{}{##1}}%
 \let\newxycolor@=\newxyDVIPScolor@ \dvipsInclude@{color.pro}%
 \installCrayolaColors@
 \let\newxycolor@=\prevxycolor@ }%
\xydef@\dvipsPS@@{\dvipsPS@}
\xydef@\dvipsPS@unload{\UnloadPS@
 \let\UnloadPS@@=\UnloadPS@
 \let\dvipsPS@@=\dvipsPS@ }
\xydef@\dvipsPStypes@{%
 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \ifx\PSspecial@@\dvipsSpecial@\else
 \let\PSspecial@@=\dvipsSpecial@
 \let\PSmacro@@=\dvipsMacro@
 \let\PSdict@@=\dvipsDict@
 \let\PSspecialdict@@=\dvipsDict@
 \let\PSraw@@=\dvipsRaw@
 \let\PSinclude@@=\dvipsInclude@
 \let\xyPSobeylines@@=\obeyDVIPSlines@
 \let\xyPScurrpt@@=\dvipsCurrpt@@
 \dvips@@{PostScript}%
 \fi
 \XYpredict@ }
\xywarnifdefined\dvipsSpecial@
\xywarnifdefined\dvipsMacro@
\xywarnifdefined\dvipsDict@
\xywarnifdefined\dvipsInclude@
\xywarnifdefined\dvipsRaw@
{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11
 \gdef\dvipsSpecial@#1{\special{ps:: SDict begin #1 end}}
 \gdef\dvipsMacro@#1{\firstPS@@\special{" {#1}xy}}
 \gdef\dvipsDict@#1{\special{! #1}}
 \gdef\dvipsInclude@#1{\special{header=#1}}
 \gdef\dvipsRaw@#1{\special{ps: SDict begin #1 end}}
\catcode`\^^M=\active
 \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
\xylet@\obeyDVIPSlines@=\next
\xydef@\dvipsCurrpt@{\let\xyPScurrpt@@=\dvipsCurrpt@@}%
\xydef@\dvipsCurrpt@@{\PSraw@@{xyp}}
\xydef@\dvipsPS@{\dvipsPStypes@ 
 \let\dvipsPS@@=\PSspecials@true
 \let\UnloadPS@@=\dvipsPS@unload 
 \let\installxyps@@=\relax \installxyps@ }
\xydef@\dvipsRotate@@{\dvipsRotate@}
\xydef@\dvipsRotate@{\dvipsPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
 \dvipsCurrpt@ \dvipsRotScale@ \installPSrotscale@ }%
 \else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi
 \next@ }
\xydef@\dvipsRotScale@{%
 \def\xyrot@start(##1){{xyct ##1\space xyrs }}%
 \def\xyrot@end{}%
 \def\xyscale@start(##1,##2){{xyct ##1\space##2\space xyss }}%
 \def\xyscale@end{}}
\xydef@\dvipsLine@@{\dvipsLine@}
\xydef@\dvipsLine@{\dvipsPStypes@ 
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
 \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
 \next@ }
\xydef@\dvipsFrames@@{\dvipsFrames@}
\xydef@\dvipsFrames@{\dvipsPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
 \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
 \next@ }
\xydef@\dvipsTiles@@{\dvipsTiles@}
\xydef@\dvipsTiles@{\dvipsPStypes@ 
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
 \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
 \next@ }
\xydef@\dvipsTPIC@@{\dvipsTPIC@}
\xydef@\dvipsTPIC@{\setupxyTPIC@}
\xydef@\dvipsEM@@{\dvipsEM@}
\xydef@\dvipsEM@{\setupxyEMTeX@}
\xyendinput
