153
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
1 |
%% xypdf-c.tex from $Id: xypdf-c.doc,v $
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
2 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
3 |
%% Xy-pic ``Colour extension'' PDF backend support.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
4 |
%% Copyright (c) 1999-1999 Ross Moore <ross@mpce.mq.edu.au>
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
5 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
6 |
%% This file is part of the Xy-pic package for graphs and diagrams in TeX.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
7 |
%% See the companion README and INSTALL files for further information.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
8 |
%% Copyright (c) 1991-1999 Kristoffer H. Rose <krisrose@brics.dk>
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
9 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
10 |
%% The Xy-pic package is free software; you can redistribute it and/or modify
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
11 |
%% it under the terms of the GNU General Public License as published by the
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
12 |
%% Free Software Foundation; either version 2 of the License, or (at your
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
13 |
%% option) any later version.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
14 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
15 |
%% The Xy-pic package is distributed in the hope that it will be useful, but
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
16 |
%% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
17 |
%% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
18 |
%% for more details.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
19 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
20 |
%% You should have received a copy of the GNU General Public License along
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
21 |
%% with this package; if not, write to the Free Software Foundation, Inc.,
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
22 |
%% 675 Mass Ave, Cambridge, MA 02139, USA.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
23 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
24 |
%% As a special exception, you may use this file and all files derived
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
25 |
%% from it without restrictions. This special exception was added with
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
26 |
%% version 3.7 of Xy-pic.
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
27 |
%%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
28 |
\expandafter\ifx\csname xypdf-cloaded\endcsname\empty
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
29 |
\message{not reloaded}\endinput \fi
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
30 |
\expandafter\let\csname xypdf-cloaded\endcsname=\empty \xycatcodes
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
31 |
\expandafter\ifx \csname xypdf-sloaded\endcsname\empty\else
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
32 |
\xyinputorelse@{xypdf-s}{\xyerror@{Could not load xypdf-s}{}}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
33 |
\xycatcodes\fi
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
34 |
\xydef@\UsePDFcolor{\installPDFcolor@}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
35 |
\xydef@\NoPDFcolor{\UnloadColor@}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
36 |
\xydef@\installPDFcolor@{\installPDFstyle@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
37 |
\let\xymath@=\xyPDFmath@ \let\xynomath@=\xyPDFnomath@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
38 |
\let\checkxyPDFcolor@=\checkxyPDFcolor@@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
39 |
\let\xycolor@@=\xyPDFcolor@@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
40 |
\xystandardcolors@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
41 |
\xyuncatcodes }
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
42 |
\xydef@\xyPDFmath@{\hbox\bgroup\dimen@=.55ex \checkxyPDFcolor@ \xyinside@}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
43 |
\xydef@\xyPDFnomath@{\hbox\bgroup\dimen@=\z@ \checkxyPDFcolor@ \xyinside@}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
44 |
\xydef@\checkxyPDFcolor@@{\edef\pdfsaved@color{\pdfcurrent@color}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
45 |
\let\checkxyPDFcolor@=\relax}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
46 |
\xylet@\checkxyPDFcolor@=\relax
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
47 |
\xydef@\xyPDFnewcolor@#1#2#3#4#5{%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
48 |
\expandafter\DN@\expandafter{\csname shape [#1]\endcsname}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
49 |
\DNii@{\relax}\ifx\next@\nextii@\newxycolor{#1}{}\relax\fi
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
50 |
\DNii@{#4}\ifx\nextii@\empty
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
51 |
\expandafter\DNii@\expandafter{\csname xyPDFshape@#1@\endcsname}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
52 |
\expandafter\def\nextii@{\xyPDFcolor@{#2//#3}}\else
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
53 |
\expandafter\DNii@\expandafter{\csname xyPDFshape@#1@\endcsname}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
54 |
\expandafter\def\nextii@{\xyPDFcolor@{#4}}\fi
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
55 |
\ifx\nextii@\empty\expandafter\def\next@{\xyPDFnotimplemented@@`#1'@@}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
56 |
\else
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
57 |
\edef\tmp@{\noexpand\let\expandafter\noexpand\next@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
58 |
\expandafter\noexpand\nextii@}\expandafter\tmp@\fi }
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
59 |
\xylet@\newxycolor@=\xyPDFnewcolor@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
60 |
\xydef@\xyPDFcolor@{\ifPDFspecials@\expandafter\xyPDFcolor@@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
61 |
\else\expandafter\eat@\fi}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
62 |
\xydef@\xyPDFcolor@@#1{\bgroup \checkXyStyle@
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
63 |
\def\preStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPDFpre@}}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
64 |
\def\postStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPDFpost@}}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
65 |
\let\modPDFboxz@=\modXYstyle@ \xyPDF@color@@{#1}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
66 |
\toks@={\egroup\let\xy@style@=\relax \def\Drop@@}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
67 |
\expandafter\addtotoks@\expandafter{\expandafter{\Drop@@}\def\Connect@@}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
68 |
\expandafter\addtotoks@\expandafter{\expandafter{\Connect@@}}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
69 |
\the\toks@ }
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
70 |
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
71 |
\xydef@\pdfcurrent@color{1 1 1 1 k 1 1 1 1 K}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
72 |
\xydef@\pdfsaved@color{1 1 1 1 k 1 1 1 1 K}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
73 |
\xydef@\xyPDF@color@@#1{%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
74 |
\edef\pdfsaved@color{\pdfcurrent@color}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
75 |
\pdf@convertcolor#1////!%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
76 |
\edef\next@{\noexpand\xyPDFsplitPDF@{\pdfcurrent@color}{\pdfsaved@color}}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
77 |
\next@}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
78 |
\xydef@\pdf@convertcolor#1//#2//#3!{\DN@{#2}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
79 |
\DNii@{cmyk}\ifx\next@\nextii@\DN@{#1 k #1 K}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
80 |
\else \DNii@{rgb}\ifx\next@\nextii@\DN@{#1 rg #1 RG}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
81 |
\else \DNii@{gray}\ifx\next@\nextii@\DN@{#1 #1 #1 rg #1 #1 #1 RG}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
82 |
\else \DN@{1 1 1 1 k 1 1 1 1 K}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
83 |
\fi \fi \fi
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
84 |
\expandafter\def\expandafter\pdfcurrent@color\expandafter{\next@}}
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
85 |
\xydef@\xycolor@raw@@#1{}%
|
scott@6e1638ff-ae45-0410-89bd-df963105f760
parents:
diff
changeset
|
86 |
\endinput
|