diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex | 197 |
1 files changed, 16 insertions, 181 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex index d74d3d1f84f..59a3699f70d 100644 --- a/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex +++ b/Master/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex @@ -7,7 +7,7 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.1 2008/01/15 10:27:34 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/basiclayer/pgfcoreimage.code.tex,v 1.16 2010/03/25 20:57:13 ludewich Exp $ @@ -47,10 +47,10 @@ \PackageWarning{pgf}% {File "#3" not found when defining image "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% - \pgf@declaredraftimage{#2}% + \pgf@declaredraftimage{#2}{#3}% \else% \ifpgf@draftmode% - \pgf@declaredraftimage{#2}% + \pgf@declaredraftimage{#2}{#3}% \else% \pgfsys@defineimage% \fi% @@ -58,10 +58,14 @@ \expandafter\global\expandafter\let\csname pgf@image@#2!\endcsname=\pgf@image% } + +\pgfkeys{ + /pgf/images/draft/.is if=pgf@draftmode, + /pgf/images/draft/.default=true} \pgfkeys{/pgf/images/width/.estore in=\pgf@imagewidth} \pgfkeys{/pgf/images/height/.estore in=\pgf@imageheight} \pgfkeys{/pgf/images/page/.estore in=\pgf@imagepage} -\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{/Interpolate #1},.default=true} +\pgfkeys{/pgf/images/interpolate/.cd,.code=\edef\pgf@imageinterpolate{#1},.default=true} \pgfkeys{/pgf/images/mask/.code=% {% \edef\pgf@imagemask{#1}% @@ -71,10 +75,6 @@ {\PackageError{pgf}{Undefined mask "#1".}{}% \edef\pgf@imagemask{}}% {\edef\pgf@imagemask{\csname pgf@mask@#1\endcsname}% - \ifx\pgf@imagemask\pgfutil@empty% - \else - \edef\pgf@imagemask{/SMask \pgf@imagemask\space 0 R}% - \fi% }% \fi% }} @@ -88,13 +88,15 @@ \pgf@findfile#2+{#3}% \fi}} -\def\pgf@declaredraftimage#1{% +% #1: image name +% #2: file name +\def\pgf@declaredraftimage#1#2{% \ifx\pgf@imagewidth\pgfutil@empty% - \PackageWarning{pgf}{Missing width for image "#1" in draft mode.\MessageBreak Using 1cm instead}% + \PackageWarning{pgf}{Missing width for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imagewidth{1cm}% \fi% \ifx\pgf@imageheight\pgfutil@empty% - \PackageWarning{pgf}{Missing height for image "#1" in draft mode.\MessageBreak Using 1cm instead}% + \PackageWarning{pgf}{Missing height for image "#1" ("#2") in draft mode.\MessageBreak Using 1cm instead}% \edef\pgf@imageheight{1cm}% \fi% \ifx\pgf@imagepage\pgfutil@empty\else\edef\pgf@imagepagetext{ page \pgf@imagepage}\fi% @@ -103,7 +105,7 @@ \vrule\kern-0.4pt% \vbox to \pgf@imageheight{% \hrule\vfil% - \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\tiny#1\pgf@imagepage\hfil\hskip-10cm}% + \hbox to \pgf@imagewidth{\hskip-10cm\hfil\noexpand\tiny#2\pgf@imagepage\hfil\hskip-10cm}% \vfil\hrule}% \kern-0.4pt\vrule}% }% @@ -143,7 +145,7 @@ {File "#3" not found when defining mask "#2".\MessageBreak Tried all extensions in "\pgfsys@imagesuffixlist"}% \else% - \pgfsys@definemask% + \pgfsys@definemask{#2}% \fi% \expandafter\global\expandafter\let\csname pgf@mask@#2\endcsname=\pgf@mask% } @@ -236,173 +238,6 @@ \pgfuseimage{pgflastimage}} - - - - - - -% The external read/write mechanism is used as follows: -% -% In your document, you put a number or all of your pgfpicture (or -% tikzpicture) environments inside a pair of \beginpgfexternal and -% \endpgfexternal. The \beginpgfexternal gets one parameter called the -% graphics name. -% -% Once this is done, the next step is to declare the names of your -% graphics in the document at the beginning using the -% \pgfdeclaregraphicname command. -% -% Now, when you typeset your document, each time a \beginpgfexternal -% command is encountered, it will be checked whether the corresponding -% graphics file exists. If this is the case, it will be included and -% the code between \beginpgfexternal and \endpgfexternal is -% ignored. Otherwise, the code is executed normally. -% -% Things change when you run tex on your file with the \jobname set to -% the name of a decalred graphics name. In this case, only your -% graphic will be typeset, the rest of the document will be "thrown away". -% To be more precise, everything is gobbled up to the beginning -% of the first \beginpgfexternal with the given graphics name. Then, -% the content of the "environment" is put in a box (this "environment" -% need not contain a graphics, it may contain anything that can be put -% in a box). Then a single page is output whose size is exactly the -% size of the picture. -% -% So, once you have run tex repeatedly, each time with the jobname set -% to each of the graphics, you can then run tex on the whole document -% and this will cause all graphics to be included rather than begin -% typeset. -% -% Finally, once all the graphics have been created, you can also say -% \input pgfexternal.tex instead of including pgf/TikZ. - - - -% Tells pgf which jobname is the name of the real file -% -% #1 = name -% -% Description: -% -% This command is used to tell pgf that the file named #1 should be -% typeset normally. If \jobname is not equal to #1, only -% the graphic called \jobname will be typeset. -% -% Example: -% -% \pgfrealjobname{survey} - -\def\pgfrealjobname#1{% - \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}% - \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% - \ifx\pgf@tempa\pgf@tempb% - \else% - \pgf@external@grabshipouttrue% - \fi% -} - - -\newif\ifpgf@external@grabshipout -\newbox\pgfexternal@startupbox - -\AtBeginDocument{% - \ifpgf@external@grabshipout% - \global\let\pgfexternal@originalshipout=\shipout% - \global\def\shipout{\setbox\pgfpic=}% - \maxdeadcycles=10000% - % Ok, gather everything we have seen up to now in a box. This box - % will contain any specials that have been used. - {% - \output{\global\setbox\pgfexternal@startupbox=\vbox{\csname @begindvi\endcsname\unvbox255}}% - \hbox{}\eject% - }% - \fi% -} - - -% "Environment" for an external graphic. -% -% #1 = graphic name -% -% Example: -% -% \beginpgfgraphicnamed{main-graphic2} -% \begin{tikzpicture} -% ... -% \end{tikzpicture} -% \endpgfgraphicnamed - -\def\pgf@externalbegin#1{% - % First, check whether we wish to grab this graphic: - \let\pgf@next=\pgf@external@normal% - \ifpgf@external@grabshipout% - \edef\pgf@tempa{\expandafter\string\csname #1\endcsname}% - \edef\pgf@tempb{\expandafter\string\csname\jobname\endcsname}% - \ifx\pgf@tempa\pgf@tempb% - \let\pgf@next=\pgf@external@grab% - \fi% - \fi% - \pgf@next{#1}% -} - - -\AtBeginDocument{ - \let\beginpgfgraphicnamed=\pgf@externalbegin% overwrite definition of pgfexternal.tex if necessary - \let\endpgfgraphicnamed=\unskip -} - - -% Normal operation: Include an external graphic instead of the -% picture, if such an external picture exists. -\def\pgf@external@normal#1{% - \let\pgf@filename=\pgfutil@empty% - \expandafter\pgf@findfile\pgfsys@imagesuffixlist:+{#1}% - \ifx\pgf@filename\pgfutil@empty% - % Ok, no such image... Just typeset the picture normally. - \let\pgf@next=\relax% - \else% - \let\pgf@next=\pgf@replacepicturebygraphic% - \fi% - \pgf@next% -} - -\long\def\pgf@replacepicturebygraphic#1\endpgfgraphicnamed{\includegraphics{\pgf@filename}\unskip} - - -% Grab operation: If jobname matches the graphic name, typeset this -% picture normall. - -\def\pgf@external@grab#1{% - \setbox\pgfpic=\hbox\bgroup\bgroup% - \let\endpgfgraphicnamed=\pgf@externalend% -} - -\def\pgf@externalend{% - \unskip\egroup\egroup% - {% - \parindent0pt% - \leftmargin0pt% - \rightmargin0pt% - \dimen0\ht\pgfpic% - \advance\dimen0\dp\pgfpic% - \pgfsys@papersize{\the\wd\pgfpic}{\the\dimen0}% - \setbox0=\vbox{% - \kern -1truein% - \hbox{% - \kern -1truein% - \hbox to0pt{% - \wd\pgfexternal@startupbox=0pt% - \ht\pgfexternal@startupbox=0pt% - \dp\pgfexternal@startupbox=0pt% - \box\pgfexternal@startupbox% - \pgfsys@atbegindocument\hss}% - \box\pgfpic% - \kern 1truein}% - \kern1truein}% - \pgfexternal@originalshipout\box0% - }% -} - +\input pgfcoreexternal.code.tex \endinput |