Debian Codegraph @

texmf-dist/tex/generic/xypic/xydvitops.tex

raw
1 %% xydvitops.tex from $Id: xydvitops.doc,v 3.7 2011/03/14 20:14:00 krisrose Exp $
2 %%
3 %% Xy-pic ``DVITOPS-driver'' 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{dvitops}{DVITOPS driver}{\stripRCS$Revision: 3.7 $}%
25 {Ross Moore}{[email protected]}%
26 {Mathematics Department, Macquarie University, NSW~2109, Australia}
27 \xydef@\dvitops@@#1{\dvimessage@{DVITOPS}{#1}}
28 \newdriver{%
29 \xyaddsupport{color}\dvitopsColor@@
30 \xyaddsupport{crayon}\dvitopsCrayon@@
31 \xyaddsupport{ps}\dvitopsPS@@
32 \xyaddsupport{rotate}\dvitopsRotate@@
33 \xyaddsupport{line}\dvitopsLine@@
34 \xyaddsupport{frame}\dvitopsFrames@@
35 \xyaddsupport{tile}\dvitopsTiles@@
36 \xyaddsupport{cmtip}\relax
37 }
38 \xydef@\dvitopsColor@@{\dvitops@Color@}
39 \xydef@\dvitops@Color@{\dvitopsPStypes@
40 \let\xylocalColor@=\xyDVITOPScolor@
41 \let\xycolor@push\xycolor@push@@
42 \def\xycolor@{\xycolor@@}\let\xycolorwarning@=\relax
43 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
44 \xyinputorelse@{xyps-c}{\xydrivernoload@{ps-c}}\xycatcodes
45 \installPScolor@ }\else\DN@{}\fi \next@
46 \ifx\xycolor@@\xyNoColor@ \let\xycolor@@=\xycolor@raw@@\fi
47 \ifx\xycrayolaloaded\empty \DN@{\xystandardcolors@\dvitopsCrayon@{}}%
48 \else\let\next@=\xystandardcolors@
49 \fi \next@
50 \let\dvitops@Color@@=\relax
51 \let\UnloadColor@@=\NoDVITOPScolor@
52 }%
53 \xydef@\NoDVITOPScolor@{%
54 \def\xycolor@{\xycolor@@}%
55 \let\xycolor@@=\xyNoColor@
56 \let\xylocalColor@=\xyNoColor@@
57 \let\xycolorwarning@=\xycolorwarning@@
58 \let\dvitops@Color@@=\dvitops@Color@
59 }
60 \xydef@\xyDVITOPScolor@{\bgroup \DN@##1##2{\egroup}%
61 \ifInvisible@\else\ifHidden@\else\DNii@{\no@@}\ifx\nextii@\Connect@@
62 \else\DN@{\xyDVITOPScolor@i}\fi\fi\fi \next@ }
63 \xydef@\xyDVITOPScolor@i#1#2{\checkXyStyle@
64 \DN@{#2}\ifx\next@\empty
65 \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{#1}}}%
66 \else\DNii@{gray}\ifx\next@\nextii@
67 \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{gray}{#1}}}%
68 \else\DNii@{rgb}\ifx\next@\nextii@
69 \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{rgbcolor}{#1}}}%
70 \else\DNii@{hsb}\ifx\next@\nextii@
71 \def\tmp@##1{\DN@{\xycolor@begin##1\xycolor@end{hsbcolor}{#1}}}%
72 \else \DN@{\xywarning@{DVITOPS cannot support color: #2 #1}}%
73 \fi\fi\fi\fi
74 \toks@={\egroup \let\xy@style@=\relax \def\Drop@@}%
75 \expandafter\tmp@\expandafter{\Drop@@}%
76 \expandafter\addtotoks@\expandafter{\expandafter{\next@}\def\Connect@@}%
77 \expandafter\tmp@\expandafter{\Connect@@}%
78 \expandafter\addtotoks@\expandafter{\expandafter{\next@}}%
79 \the\toks@ }%
80 \xydef@\xycolor@begin{\dvitopsBegin@{color}}
81 \xydef@\xycolor@end{\dvitopsEnd@{color}\dvitopsColor@x}
82 \xydef@\dvitopsCrayon@@{\dvitopsColor@@\dvitopsCrayon@}
83 \xydef@\dvitopsCrayon@{\installCrayolaColors@}%
84 \xydef@\dvitopsPS@@{\dvipsPS@}
85 \xydef@\dvitopsPS@unload{\UnloadPS@
86 \let\UnloadPS@@=\UnloadPS@
87 \let\dvitopsPS@@=\dvitopsPS@ }
88 \xydef@\dvitopsPStypes@{%
89 \xyinputorelse@{xyps-ps}{\xydrivernoload@{ps-ps}}%
90 \ifx\PSspecial@@\dvitopsSpecial@\else
91 \let\PSspecial@@=\dvitopsSpecial@
92 \let\PSmacro@@=\dvitopsMacro@
93 \let\PSdict@@=\dvitopsDict@
94 \let\PSspecialdict@@=\dvitopsDict@
95 \let\PSraw@@=\dvitopsRaw@
96 \let\PSinclude@@=\dvitopsInclude@
97 \let\xyPSobeylines@@=\obeyDVIPSlines@
98 \let\xyPScurrpt@@=\dvitopsCurrpt@@
99 \dvitops@@{PostScript}%
100 \fi
101 \XYpredict@ }
102 \xywarnifdefined\dvitopsSpecial@
103 \xywarnifdefined\dvitopsMacro@
104 \xywarnifdefined\dvitopsDict@
105 \xywarnifdefined\dvitopsInclude@
106 \xywarnifdefined\dvitopsRaw@
107 \xywarnifdefined\dvitopsOrigin@
108 \xywarnifdefined\dvitopsBegin@
109 \xywarnifdefined\dvitopsEnd@
110 \xywarnifdefined\dvitopsRotate@x
111 \xywarnifdefined\dvitopsTransform@x
112 \xywarnifdefined\dvitopsColor@x
113 {\catcode`\:=11
114 \gdef\dvitopsSpecial@#1{\special{dvitops: inline #1}}
115 \gdef\dvitopsMacro@#1{\special{dvitops: inline {#1}xy}}
116 \gdef\dvitopsDict@#1{\special{dvitops: inline #1}}
117 \gdef\dvitopsInclude@#1{\special{dvitops: prolog #1}}
118 \gdef\dvitopsRaw@#1{\special{dvitops: inline #1}}
119 \gdef\dvitopsOrigin@#1{\special{dvitops: origin #1}}
120 \gdef\dvitopsBegin@#1{\special{dvitops: begin #1}}
121 \gdef\dvitopsEnd@#1{\special{dvitops: end #1}}
122 \gdef\dvitopsRotate@x#1{\special{dvitops: rotate #1}}
123 \gdef\dvitopsTransform@x#1{\special{dvitops: transform #1}}
124 \gdef\dvitopsColor@x#1#2{\special{dvitops: #1 color #2}}
125 }
126 \catcode`\^^M=\active
127 \gdef\next{\catcode`\^^M=\active \let^^M=\space }}%
128 \xylet@\obeyDVIPSlines@=\next
129 \xydef@\dvitopsCurrpt@{\global\let\xyPScurrpt@@=\relax}%
130 \xydef@\dvitopsPS@{\dvitopsPStypes@
131 \let\installxyps@@=\relax \installxyps@ }
132 \xydef@\dvitopsRotate@@{\dvitopsRotate@}
133 \xydef@\dvitopsRotate@{\dvitopsPStypes@
134 \expandafter\ifx\csname xyps-psloaded\endcsname\empty
135 \DN@{\xyinputorelse@{xyps-r}{\xydrivernoload@{ps-r}}%
136 \installDVITOPSrotate@ }%
137 \else\DN@{\xydriverfail@{rotations are}\UnloadRotate@\relax}\fi
138 \next@ }
139 \xydef@\dvitopsRotScale@{%
140 \def\xyrot@start{\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
141 \def\xyrot@end(##1){\dvitopsEnd@{rot}\dvitopsRotate@x{##1}}%
142 \def\xyscale@start{\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
143 \def\xyscale@end(##1,##2){%
144 \dvitopsEnd@{scal}\dvitopsTransform@x{##1 0 ##2 0}}%
145 }
146 \xydef@\installDVITOPSrotate@{\installPSstyle@
147 \let\xyRotate@@=\dvitopsRotate@
148 \let\doSpecialRotate@@=\dvitopsSpecialRotate@
149 \let\xyscale@@=\dvitopsScale@
150 \dvitopsCurrpt@
151 \dvitopsRotScale@ \xyPSshapes@true }
152 \xydef@\UnloadDVITOPSrotate@{\UnloadRotate@\relax}
153 \xydef@\dvitopsRotate@#1{\xyPSsplitPS@
154 {\dvitopsBegin@{rot}\dvitopsOrigin@{rot}}%
155 {\dvitopsEnd@{rot}\dvitopsRotate@x{#1}}}%
156 \xydef@\dvitopsScale@#1#2{\xyPSsplitPS@
157 {\dvitopsBegin@{scal}\dvitopsOrigin@{scal}}%
158 {\dvitopsEnd@{scal}\dvitopsTransform@x{#1 0 #2 0}}}
159 \xydef@\dvitopsSpecialRotate@#1@@{\dvitopsRotate@{#1}}
160 \xydef@\dvitopsLine@@{\dvitopsLine@}
161 \xydef@\dvitopsLine@{\dvitopsPStypes@
162 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
163 \xyinputorelse@{xyps-l}{\xydrivernoload@{ps-l}}\installPSline@ }%
164 \else\DN@{\xydriverfail@{line-widths are}\UnloadLine@\relax}\fi
165 \next@ }
166 \xydef@\dvitopsFrames@@{\dvitopsFrames@}
167 \xydef@\dvitopsFrames@{\dvitopsPStypes@
168 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
169 \xyinputorelse@{xyps-f}{\xydrivernoload@{ps-f}}\installPSframes@ }%
170 \else\DN@{\xydriverfail@{frames are}\UnloadFrames@\relax}\fi
171 \next@ }
172 \xydef@\dvitopsTiles@{\dvitopsPStypes@
173 \expandafter\ifx\csname xyps-psloaded\endcsname\empty\DN@{%
174 \xyinputorelse@{xyps-t}{\xydrivernoload@{ps-t}}\installPSpatterns@ }%
175 \else\DN@{\xydriverfail@{Patterns are}\UnloadPSpatterns@\relax}\fi
176 \next@ }
177 \xydef@\dvitopsTPIC@@{\dvitopsTPIC@}
178 \xydef@\dvitopsTPIC@{\setupxyTPIC@}
179 \xyendinput