%% xyxdvi.tex from $Id: xyxdvi.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $
%%
%% Xy-pic ``xdvi-driver'' option.
%% Copyright (c) 1995-1996 Ross Moore <ross.moore@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-2011 Kristoffer H. Rose <krisrose@tug.org>
%%
%% 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, see http://www.gnu.org/licenses/.
%%
\ifx\xyloaded\undefined \input xy \fi
\xyprovide{xdvi}{XDVI driver}{\stripRCS$Revision: 3.7 $}%
 {Ross Moore}{ross.moore@mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydef@\xdvi@@#1{\dvimessage@{xdvi}{#1}}
\newdriver{%
 \xyaddsupport{color}\xdviColor@@
 \xyaddsupport{crayon}\xdviCrayola@@
 \xyaddsupport{ps}\xdviPS@@
 \xyaddsupport{rotate}\xdviRotate@@
 \xyaddsupport{line}\xdviLine@@
 \xyaddsupport{frame}\xdviFrames@@
 \xyaddsupport{tile}\xdviTiles@@
 \xyaddsupport{tpic}\xdviTPIC@ 
}
\xydef@\xdvi@Color@{\xdviPStypes@ 
 \let\xylocalColor@=\xyNoColor@@
 \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@\xdviCrayola@{}}%
 \else \DN@{\xystandardcolors@}\fi \next@
 \let\xdviColor@@=\relax
 \let\UnloadColor@@=\NoXDVIcolor@
 }%
\xydef@\xdviColor@@{\xdvi@Color@}
\xydef@\NoXDVIcolor@{%
 \def\xycolor@{\xycolor@@}%
 \let\xycolor@@=\xyNoColor@
 \let\xylocalColor@=\xyNoColor@@
 \let\xycolorwarning@=\xycolorwarning@@
 \let\xdviColor@@=\xdvi@Color@
 \let\UnloadColor@@=\UnloadColor@
 }
\xydef@\NoXDVIcolordvi@{\xywarning@{%
 Neither colordvi.tex nor colordvi.sty could be found.}%
 \xyBEcolorcheck@}%
\xydef@\xdviCrayola@@{\xdviColor@@\xdviCrayola@}
\xydef@\xdviCrayola@{%
 \let\prevxycolor@=\newxycolor@
 \def\newxyXDVIcolor@##1##2##3{\prevxycolor@{##1}{}{##1}}%
 \let\newxycolor@=\newxyXDVIcolor@
 \installCrayolaColors@
 \let\newxycolor@=\prevxycolor@ }%
\xydef@\xdviPS@@{\xdviPS@}
\xydef@\xdviPS@unload{\UnloadPS@
 \let\UnloadPS@@=\UnloadPS@
 \let\xdviPS@@=\xdviPS@ }
\xydef@\xdviPStypes@{%
 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \ifx\PSspecial@@\xdviSpecial@\else
 \let\PSspecial@@=\xdviSpecial@
 \let\PSmacro@@=\xdviMacro@
 \let\PSdict@@=\xdviDict@
 \let\PSspecialdict@@=\xdviDict@
 \let\PSraw@@=\xdviRaw@
 \let\PSinclude@@=\xdviInclude@
 \let\xyPSobeylines@@=\obeyXDVIlines@
 \let\xyPScurrpt@@=\xdviCurrpt@@
 \xdvi@@{PostScript}%
 \fi \XYpredict@ }
\xywarnifdefined\xdviSpecial@
\xywarnifdefined\xdviMacro@
\xywarnifdefined\xdviDict@
\xywarnifdefined\xdviInclude@
\xywarnifdefined\xdviRaw@
{\catcode`\"=11 \catcode`\!=11 \catcode`\:=11
 \gdef\xdviSpecial@#1{\special{ps:: SDict begin #1 end}}
 \gdef\xdviMacro@#1{\firstPS@@\special{" {#1}xy}}
 \gdef\xdviDict@#1{\special{! #1}}
 \gdef\xdviInclude@#1{\special{header=#1}}
 \gdef\xdviRaw@#1{\special{ps: SDict begin #1 end}}
\catcode`\^^M=\active
 \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
\xylet@\obeyXDVIlines@=\next
\xydef@\xdviCurrpt@{\let\xyPScurrpt@@=\xdviCurrpt@@}%
\xydef@\xdviCurrpt@@{\PSraw@@{xyp}}
\xydef@\xdviPS@{\xdviPStypes@ 
 \let\xdviPS@@=\PSspecials@true
 \let\UnloadPS@@=\xdviPS@unload 
 \let\installxyps@@=\relax \installxyps@ }
\xydef@\xdviRotate@@{\xdviRotate@}
\xydef@\xdviRotate@{\xdviPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
 \xdviCurrpt@ \xdviRotScale@ \installPSrotscale@ }%
 \else\DN@{\xydriverfail@{rotations are}UnloadRotate@\relax}\fi
 \next@ }
\xydef@\xdviRotScale@{%
 \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@\xdviLine@@{\xdviLine@}
\xydef@\xdviLine@{\xdviPStypes@ 
 \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@\xdviFrames@@{\xdviFrames@}
\xydef@\xdviFrames@{\xdviPStypes@
 \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@\xdviTiles@@{\xdviTiles@}
\xydef@\xdviTiles@{\xdviPStypes@ 
 \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@\xdviTPIC@@{\xdviTPIC@}
\xydef@\xdviTPIC@{\setupxyTPIC@}
\xyendinput
