%% xyoztex.tex from $Id: xyoztex.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $
%%
%% Xy-pic ``OzTeX'' driver interface 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{oztex}{OzTeX driver}{\stripRCS$Revision: 3.7 $}%
 {Ross Moore}{ross.moore@mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydef@\OzTeX@@#1{\dvimessage@{OzTeX}{#1}}
\newdriver{%
 \xyaddsupport{color}\oztexColor@@
 \xyaddsupport{crayon}\oztexCrayon@@
 \xyaddsupport{ps}\oztexPS@@
 \xyaddsupport{rotate}\oztexRotate@@
 \xyaddsupport{line}\oztexLine@@
 \xyaddsupport{frame}\oztexFrames@@
 \xyaddsupport{tile}\oztexTiles@@
 \xyaddsupport{cmtip}\relax
}
\xydef@\oztexColor@@{\OzTeXColours@}
\xydef@\OzTeXColours@{\OzTeXPStypes@
 \let\xylocalColor@=\xyNoColor@@ \def\xycolor@{\xycolor@@}%
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}%
 \installPScolor@ }\else\DN@{}\fi \next@
 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\OzTeXCrayon@@{}}%
 \else\let\next@=\xystandardcolors@\fi \next@
 \let\xycolorwarning@=\relax 
 \let\oztexColor@@=\relax
 \let\UnloadColor@@=\NoOzTeXColor@
}
\xydef@\NoOzTeXColor@{%
 \let\xylocalColor@=\xyNoColor@@
 \let\xycolor@=\xyNoColor@
 \let\xycolorwarning@=\xycolorwarning@@
 \let\oztexColor@@=\OzTeXColours@
 \let\UnloadColor@@=\UnloadColor@
 }
\xydef@\OzTeXCrayon@@{\installCrayolaColors@}
\xydef@\oztexPS@@{\oztexPS@}
\xydef@\oztexPSunload@{\UnloadPS@
 \def\xyPSdictname{}\UsePSdict@@false
 \let\installxyps@@=\relax
 \let\UnloadPS@@=\UnloadPS@
 \xyPSshapes@true 
 \let\oztexPS@@=\oztexPS@ }
\xydef@\OzTeXSpecial@#1{\special{empty.ps {#1}xy}}
\xydef@\OzTeXMacro@#1{\special{empty.ps {#1}xy}}
\xydef@\OzTeXDict@#1{\special{empty.ps @bxy{#1}stopped pop @exy}}
\xydef@\OzTeXinclude@#1{\special{#1}}
\xydef@\OzTeXraw@#1{\special{empty.ps @bxy #1 @exy}}%
\xydef@\OzTeXPStypes@{%
 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
 \ifx\PSspecial@@\OzTeXSpecial@\else
 \let\PSspecial@@=\OzTeXSpecial@
 \let\PSmacro@@=\OzTeXMacro@
 \let\PSdict@@=\OzTeXDict@
 \let\PSraw@@=\OzTeXraw@
 \let\PSinclude@@=\OzTeXinclude@
 \let\xyPSobeylines@@=\obeyOzTeXlines@
 \let\PSspecialdict@@=\OzTeXDict@
 \OzTeX@@{PostScript}%
 \fi
 \OzTeXCurrpt@ }
{\catcode`\^^M=\active
 \gdef\next{\catcode`\^^M=\active \let^^M=\space \obeyspaces}}
\xylet@\obeyOzTeXlines@=\next
\xydef@\OzTeXCurrpt@{\let\xyPScurrpt@@=\OzTeXCurrpt@@}%
\xydef@\OzTeXCurrpt@@{\PSraw@@{xyp}}
\xydef@\oztexPS@{\OzTeXPStypes@ 
 \let\oztexPS@@=\relax
 \let\UnloadPS@@=\oztexPSunload@
 \let\installxyps@@=\@OzTeX@PS@
 \installxyps@ }
\xydef@\@OzTeX@PS@{\UsePSdict@@true
 \let\includePSmessage@=\xyOzTeXheader 
 \ifx\undefined\xyPSdictname\def\xyPSdictname{global.ps}\fi}
\xydef@\xyOzTeXheader#1#2#3{\UsePSdict@@true}
\xydef@\oztexLine@@{\oztexLine@}
\xydef@\oztexLine@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
 \else\DN@{\xydriverfail@{line-styles are}\UnloadLine@\relax}\fi
 \next@ }
\xydef@\oztexFrames@@{\OzTeXFrames@}
\xydef@\OzTeXFrames@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
 \else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi
 \next@ }
\xydef@\oztexTiles@@{\OzTeXTiles@}
\xydef@\OzTeXTiles@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@
 \xystandardpatterns@ }%
 \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
 \next@ }
\xydef@\oztexRotate@@{\OzTeXRotate@}
\xydef@\OzTeXRotate@{\OzTeXPStypes@
 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
 \xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
 \OzTeXRotScale@ \installPSrotscale@ \xyPSshapes@false }%
 \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
 \next@ }
\xydef@\OzTeXRotScale@{%
 \def\xyrot@start(##1){%
 {xyp xyt ##1\space xyr}{OzXy begin gsave}}%
 \def\xyscale@start(##1,##2){%
 {xyp xyt ##1\space##2\space xys}{OzXy begin gsave}}%
 \def\xyrot@end{grestore end}\def\xyscale@end{grestore end}}
\let\OzTeXRotScale@=\xyRotScale@@
\xyendinput
