summaryrefslogtreecommitdiff
path: root/macros/generic/diagrams/xypic/texinputs/xytile.tex
blob: fb411fca66d6270a48c580b0dfb52c2f184cb29b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%% xytile.tex from $Id: xytile.doc,v 3.8 2011/03/14 20:14:00 krisrose Exp $
%%
%% Xy-pic ``Pattern and Tile extension'' option.
%% Copyright (c) 1993-1997 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{tile}{Pattern and Tile extension}{\stripRCS$Revision: 3.8 $}%
 {Ross Moore}{ross.moore@mq.edu.au}%
 {Mathematics Department, Macquarie University, NSW~2109, Australia}
\xydef@\xypatternwarning@@{\xypatternmessage@
 \gdef\xypatternwarning@{\xypatternmessage@
 \xywarning@{...no further pattern warnings will be given.}%
 \global\let\xypatternwarning@=\relax }}
\xylet@\xypatternwarning@=\xypatternwarning@@
\xydef@\xypatternmessage@{%
 \xywarning@{Current driver does not support patterns.}}%
\xydef@\newxypattern{\begingroup\xycatcodes\newxypattern@i}
\xydef@\newxypattern@i#1#2{\edef\next@{\endgroup
 \noexpand\newxyPattern{#1}{}{#2}{}}\next@}
\xydef@\newxyPattern#1#2#3#4{\newxypattern@{#1}{#2}{#3}{#4}{}}
\xydef@\newxypattern@#1#2#3#4#5{%
 \expandafter\let\expandafter\next@\csname shape [#1]\endcsname
 \ifx\next@\relax
 \DN@{#4}\ifx\next@\empty
 \DN@{#2}\ifx\next@\empty
 \DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}%
 \else
 \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}%
 \fi
 \else\DN@{#2#3}\ifx\next@\empty
 \DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}%
 \else
 \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}%
 \fi\fi 
 \else \def\tmp@{\relax}\DNii@{#5}%
 \ifx\nextii@\tmp@
 \DN@{#4}\ifx\next@\empty
 \DN@{#2}\ifx\next@\empty
 \DN@{\newxystyle{#1}{\xylocalpattern@{}{#3}\xypattern@{#3}}}%
 \else
 \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#2 #3}}}%
 \fi
 \else
 \DN@{#2#3}\ifx\next@\empty
 \DN@{\newxystyle{#1}{\xylocalpattern@{#4}{}\xypattern@{#4}}}%
 \else
 \DN@{\newxystyle{#1}{\xylocalpattern@{#2}{#3}\xypattern@{#4}}}%
 \fi\fi 
 \else\DN@{}\fi\fi \next@\relax }
\xydef@\xyNopattern@#1{}
\xylet@\xypattern@@=\xyNopattern@
\xydef@\xyNopattern@@#1#2{\xypatternwarning@}
\xylet@\xypattern@=\xypattern@@
\xylet@\xylocalpattern@=\xyNopattern@@
\xydef@\Unloadpattern@{%
 \let\xylocalpattern@=\xyNopattern@@
 \let\xypattern@=\xyNopattern@
 \let\xypatternwarning@=\xypatternwarning@@ }
\Unloadpattern@
\xydef@\xystandardpatterns@{}%
\xynew@{read}{\xypatread@}
\xydef@\defaultpattfile@{}
\xydef@\xygetfilepatterns@#1{\DN@{#1}%
 \ifx\next@\empty
 \ifx\defaultpattfile@\empty \xywarning@{No pattern file specified.}%
 \else \DN@{\expandafter\openpattfile@\expandafter{\defaultpattfile@}}\fi
 \else \DN@{\openpattfile@{#1}}\fi \next@ }
\xydef@\openpattfile@#1{\openin\xypatread@=#1.xyp
 \ifeof\xypatread@\xywarning@{No patterns in file: #1.xyp}%
 \closein\xypatread@
 \else \expandafter \xyreadpatfile@ \fi }%
\xydef@\UsePatternFile#1{\def\defaultpattfile@{#1}}
\xydef@\LoadAllPatterns{\let\parsepattern@=\parsepattern@@
 \xygetfilepatterns@ }
\xydef@\LoadPattern#1{\let\parsepattern@=\filepattern@@
 \def\pattname@{#1}\xygetfilepatterns@}
\xydef@\AliasPattern#1#2{\let\parsepattern@=\aliaspattern@@
 \def\aliasname@{#1}\def\pattname@{#2}\xygetfilepatterns@}
\xydef@\xyreadpatfile@{%
 \loop@ \bgroup\xycatcodes
 \global\read\xypatread@ to\xypatline@
 \ifeof\xypatread@ \aftergroup\endpatread@
 \else\aftergroup\morepatread@\fi \edef\next@{%
 \egroup\noexpand\getxypattern@{\xypatline@!!!}\relax}\next@
 \repeat@ }
\xydef@\endpatread@{\closein\xypatread@\iffalse}
\xydef@\morepatread@{\iftrue}
\xydef@\getxypattern@#1{\def\next{#1}\getxypattern@@}
\xydef@\getxypattern@@{\DN@{!!!}\ifx\next\next@\DN@{}%
 \else\DN@{\expandafter\parsepattern@\next}\fi \next@ }
\xydef@\parsepattern@@#1 #2!#3\relax{\newxypattern{#1}{#2}}
\xydef@\filepattern@@#1 #2!#3\relax{\DN@{#1}%
 \ifx\next@\pattname@
 \DN@{\expandafter\foundpattern@\expandafter{\pattname@}{#2}}%
 \else\DN@{}\fi \next@ }
\xydef@\foundpattern@#1#2{\newxypattern{#1}{#2}\endpatread@\fi
 \expandafter\eat@}
\xydef@\aliaspattern@@#1 #2!#3\relax{\DN@{#1}%
 \ifx\next@\pattname@
 \DN@{\expandafter\foundpattern@\expandafter{\aliasname@}{#2}}%
 \else\DN@{}\fi \next@ }
\DN@{\xyaddunsupport{tile}\Unloadpattern@}%
\ifx\xyeverywithoption@tile@\undefined
\else\ifx\xyeverywithoption@tile@\empty
\else
 \DN@{\xysetup@@{\xywithoption{tile}{\xyeverywithoption@tile@\xydriversloaded@@}}}%
\fi\fi \next@
\xyendinput