| 1 |
%% xytextures.tex from $Id: xytextures.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $ |
| 2 |
%% |
| 3 |
%% Xy-pic ``Textures'' driver interface option. |
| 4 |
%% Copyright (c) 1995-1996 Ross Moore <[email protected]> |
| 5 |
%% |
| 6 |
%% This file is part of the Xy-pic package for graphs and diagrams in TeX. |
| 7 |
%% See the companion README and INSTALL files for further information. |
| 8 |
%% Copyright (c) 1991-2011 Kristoffer H. Rose <[email protected]> |
| 9 |
%% |
| 10 |
%% The Xy-pic package is free software; you can redistribute it and/or modify |
| 11 |
%% it under the terms of the GNU General Public License as published by the |
| 12 |
%% Free Software Foundation; either version 2 of the License, or (at your |
| 13 |
%% option) any later version. |
| 14 |
%% |
| 15 |
%% The Xy-pic package is distributed in the hope that it will be useful, but |
| 16 |
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 17 |
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 18 |
%% for more details. |
| 19 |
%% |
| 20 |
%% You should have received a copy of the GNU General Public License along |
| 21 |
%% with this package; if not, see http://www.gnu.org/licenses/. |
| 22 |
%% |
| 23 |
\ifx\xyloaded\undefined \input xy \fi |
| 24 |
\xyprovide{textures}{Textures driver}{\stripRCS$Revision: 3.7 $}% |
| 25 |
{Ross Moore}{[email protected]}% |
| 26 |
{Mathematics Department, Macquarie University, NSW~2109, Australia} |
| 27 |
\xydef@\Textures@@#1{\dvimessage@{Textures}{#1}} |
| 28 |
\newdriver{% |
| 29 |
\xyaddsupport{color}\texturesColor@@ |
| 30 |
\xyaddsupport{crayon}\texturesCrayon@@ |
| 31 |
\xyaddsupport{ps}\texturesPS@@ |
| 32 |
\xyaddsupport{rotate}\texturesRotate@@ |
| 33 |
\xyaddsupport{line}\texturesLine@@ |
| 34 |
\xyaddsupport{frame}\texturesFrames@@ |
| 35 |
\xyaddsupport{tile}\texturesTiles@@ |
| 36 |
\xyaddsupport{cmtip}\relax |
| 37 |
} |
| 38 |
\xydef@\TexturesColor@push#1{\special{color push}\special{color #1}} |
| 39 |
\xydef@\TexturesColours@{\texturesPStypes@ |
| 40 |
\let\xylocalColor@=\xystackcolor@ |
| 41 |
\let\xycolor@push=\TexturesColor@push |
| 42 |
\def\xycolor@{\xycolor@@}% |
| 43 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 44 |
\xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}% |
| 45 |
\installPScolor@ }\else\DN@{}\fi \next@ |
| 46 |
\ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi |
| 47 |
\ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\texturesCrayon@@{}}% |
| 48 |
\else\let\next@=\xystandardcolors@ \fi \next@ |
| 49 |
\let\xycolorwarning@=\relax \Textures@@{color}% |
| 50 |
\let\texturesColor@@=\relax |
| 51 |
\let\UnloadColor@@=\NoTexturesColor@ |
| 52 |
} |
| 53 |
\xydef@\texturesColor@@{\TexturesColours@} |
| 54 |
\xydef@\NoTexturesColor@{% |
| 55 |
\let\xylocalColor@=\xyNoColor@@ |
| 56 |
\let\xycolor@=\xyNoColor@ |
| 57 |
\let\xycolorwarning@=\xycolorwarning@@ |
| 58 |
\let\texturesColor@@=\TexturesColours@ |
| 59 |
\let\UnloadColor@@=\UnloadColor@ |
| 60 |
} |
| 61 |
\xydef@\texturesCrayon@@{\texturesColor@@\texturesCrayon@} |
| 62 |
\xydef@\texturesCrayon@{\installCrayolaColors@}% |
| 63 |
\xydef@\texturesPS@@{\texturesPS@} |
| 64 |
\xydef@\texturesPSunload@{\UnloadPS@ |
| 65 |
\let\UnloadPS@@=\UnloadPS@ |
| 66 |
\let\texturesPS@@=\texturesPS@ } |
| 67 |
\xydef@\texturesPStypes@{% |
| 68 |
\xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}% |
| 69 |
\ifx\PSspecial@@\TexturesSpecial@\else |
| 70 |
\let\PSspecial@@=\TexturesSpecial@ |
| 71 |
\let\PSmacro@@=\TexturesMacro@ |
| 72 |
\let\PSdict@@=\TexturesDict@ |
| 73 |
\let\PSraw@@=\TexturesRaw@ |
| 74 |
\let\PSinclude@@=\TexturesInclude@ |
| 75 |
\let\PSspecialdict@@=\TexturesSpecialDict@ |
| 76 |
\let\xyPSobeylines@@=\obeyTextureslines@ |
| 77 |
\Textures@@{PostScript}% |
| 78 |
\fi \texturesCurrpt@ \XYpredict@ } |
| 79 |
\xydef@\TexturesSpecial@#1{\firstPS@@\special{postscript #1}} |
| 80 |
\xydef@\TexturesMacro@#1{\special{postscript {#1}xy}} |
| 81 |
\xydef@\TexturesDict@#1{\special{prePostScript #1}} |
| 82 |
\xydef@\TexturesSpecialDict@#1{\special{prePostScript #1}} |
| 83 |
\xydef@\TexturesInclude@#1{\firstPS@@\special{prePostScriptfile #1}} |
| 84 |
\xydef@\TexturesRaw@#1{\firstPS@@\special{rawpostscript #1}}% |
| 85 |
{\catcode`\^^M=\active% |
| 86 |
\gdef\next{\catcode`\^^M=\active \let^^M=\par% |
| 87 |
\let\PSspecial@@=\TexturesDict@ \obeyspaces}} |
| 88 |
\xylet@\obeyTextureslines@=\next |
| 89 |
\xydef@\texturesCurrpt@{\let\xyPScurrpt@@=\texturesCurrpt@@}% |
| 90 |
\xydef@\texturesCurrpt@@{\PSspecial@@{xyi}\PSraw@@{userdict begin xyx end}} |
| 91 |
\xydef@\texturesPS@{\texturesPStypes@ |
| 92 |
\let\texturesPS@@=\relax |
| 93 |
\let\UnloadPS@@=\texturesPSunload@ |
| 94 |
\let\installxyps@@=\relax \installxyps@ } |
| 95 |
\xydef@\texturesRotate@@{\texturesRotate@} |
| 96 |
\xydef@\texturesRotate@{\texturesPStypes@ |
| 97 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 98 |
\xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}% |
| 99 |
\xyRotScale@@ \installPSrotscale@ }% |
| 100 |
\else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi |
| 101 |
\next@} |
| 102 |
\xydef@\texturesLine@@{\texturesLine@} |
| 103 |
\xydef@\texturesLine@{\texturesPStypes@ |
| 104 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 105 |
\xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}% |
| 106 |
\installPSline@ }% |
| 107 |
\else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi |
| 108 |
\next@ } |
| 109 |
\xydef@\texturesFrames@@{\texturesFrames@} |
| 110 |
\xydef@\texturesFrames@{\texturesPStypes@ |
| 111 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 112 |
\xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}% |
| 113 |
\installPSframes@ }% |
| 114 |
\else\DN@{\xydriverfail@{frames are}\UnloadPSFrames@\relax}\fi |
| 115 |
\next@ } |
| 116 |
\xydef@\texturesTiles@@{\texturesTiles@} |
| 117 |
\xydef@\texturesTiles@{\texturesPStypes@ |
| 118 |
\expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{% |
| 119 |
\xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}% |
| 120 |
\installPSpatterns@ \xystandardpatterns@}% |
| 121 |
\else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi |
| 122 |
\next@ } |
| 123 |
\xyendinput |