1 %% xypdf-c.tex from $Id: xypdf-c.doc,v $ |
|
2 %% |
|
3 %% Xy-pic ``Colour extension'' PDF backend support. |
|
4 %% Copyright (c) 1999-1999 Ross Moore <ross@mpce.mq.edu.au> |
|
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-1999 Kristoffer H. Rose <krisrose@brics.dk> |
|
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, write to the Free Software Foundation, Inc., |
|
22 %% 675 Mass Ave, Cambridge, MA 02139, USA. |
|
23 %% |
|
24 %% As a special exception, you may use this file and all files derived |
|
25 %% from it without restrictions. This special exception was added with |
|
26 %% version 3.7 of Xy-pic. |
|
27 %% |
|
28 \expandafter\ifx\csname xypdf-cloaded\endcsname\empty |
|
29 \message{not reloaded}\endinput \fi |
|
30 \expandafter\let\csname xypdf-cloaded\endcsname=\empty \xycatcodes |
|
31 \expandafter\ifx \csname xypdf-sloaded\endcsname\empty\else |
|
32 \xyinputorelse@{xypdf-s}{\xyerror@{Could not load xypdf-s}{}}% |
|
33 \xycatcodes\fi |
|
34 \xydef@\UsePDFcolor{\installPDFcolor@} |
|
35 \xydef@\NoPDFcolor{\UnloadColor@} |
|
36 \xydef@\installPDFcolor@{\installPDFstyle@ |
|
37 \let\xymath@=\xyPDFmath@ \let\xynomath@=\xyPDFnomath@ |
|
38 \let\checkxyPDFcolor@=\checkxyPDFcolor@@ |
|
39 \let\xycolor@@=\xyPDFcolor@@ |
|
40 \xystandardcolors@ |
|
41 \xyuncatcodes } |
|
42 \xydef@\xyPDFmath@{\hbox\bgroup\dimen@=.55ex \checkxyPDFcolor@ \xyinside@} |
|
43 \xydef@\xyPDFnomath@{\hbox\bgroup\dimen@=\z@ \checkxyPDFcolor@ \xyinside@} |
|
44 \xydef@\checkxyPDFcolor@@{\edef\pdfsaved@color{\pdfcurrent@color}% |
|
45 \let\checkxyPDFcolor@=\relax} |
|
46 \xylet@\checkxyPDFcolor@=\relax |
|
47 \xydef@\xyPDFnewcolor@#1#2#3#4#5{% |
|
48 \expandafter\DN@\expandafter{\csname shape [#1]\endcsname}% |
|
49 \DNii@{\relax}\ifx\next@\nextii@\newxycolor{#1}{}\relax\fi |
|
50 \DNii@{#4}\ifx\nextii@\empty |
|
51 \expandafter\DNii@\expandafter{\csname xyPDFshape@#1@\endcsname}% |
|
52 \expandafter\def\nextii@{\xyPDFcolor@{#2//#3}}\else |
|
53 \expandafter\DNii@\expandafter{\csname xyPDFshape@#1@\endcsname}% |
|
54 \expandafter\def\nextii@{\xyPDFcolor@{#4}}\fi |
|
55 \ifx\nextii@\empty\expandafter\def\next@{\xyPDFnotimplemented@@`#1'@@}% |
|
56 \else |
|
57 \edef\tmp@{\noexpand\let\expandafter\noexpand\next@ |
|
58 \expandafter\noexpand\nextii@}\expandafter\tmp@\fi } |
|
59 \xylet@\newxycolor@=\xyPDFnewcolor@ |
|
60 \xydef@\xyPDFcolor@{\ifPDFspecials@\expandafter\xyPDFcolor@@ |
|
61 \else\expandafter\eat@\fi} |
|
62 \xydef@\xyPDFcolor@@#1{\bgroup \checkXyStyle@ |
|
63 \def\preStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPDFpre@}}% |
|
64 \def\postStyle@@{\expandafter\addtostyletoks@\expandafter{\xyPDFpost@}}% |
|
65 \let\modPDFboxz@=\modXYstyle@ \xyPDF@color@@{#1}% |
|
66 \toks@={\egroup\let\xy@style@=\relax \def\Drop@@}% |
|
67 \expandafter\addtotoks@\expandafter{\expandafter{\Drop@@}\def\Connect@@}% |
|
68 \expandafter\addtotoks@\expandafter{\expandafter{\Connect@@}}% |
|
69 \the\toks@ } |
|
70 |
|
71 \xydef@\pdfcurrent@color{1 1 1 1 k 1 1 1 1 K} |
|
72 \xydef@\pdfsaved@color{1 1 1 1 k 1 1 1 1 K} |
|
73 \xydef@\xyPDF@color@@#1{% |
|
74 \edef\pdfsaved@color{\pdfcurrent@color}% |
|
75 \pdf@convertcolor#1////!% |
|
76 \edef\next@{\noexpand\xyPDFsplitPDF@{\pdfcurrent@color}{\pdfsaved@color}}% |
|
77 \next@} |
|
78 \xydef@\pdf@convertcolor#1//#2//#3!{\DN@{#2}% |
|
79 \DNii@{cmyk}\ifx\next@\nextii@\DN@{#1 k #1 K}% |
|
80 \else \DNii@{rgb}\ifx\next@\nextii@\DN@{#1 rg #1 RG}% |
|
81 \else \DNii@{gray}\ifx\next@\nextii@\DN@{#1 #1 #1 rg #1 #1 #1 RG}% |
|
82 \else \DN@{1 1 1 1 k 1 1 1 1 K}% |
|
83 \fi \fi \fi |
|
84 \expandafter\def\expandafter\pdfcurrent@color\expandafter{\next@}} |
|
85 \xydef@\xycolor@raw@@#1{}% |
|
86 \endinput |
|