diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def | 139 |
1 files changed, 121 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def index 79697fbb9f6..ce86689204c 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def @@ -1,11 +1,13 @@ -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.4 2005/10/06 13:16:09 tantau Exp $ - -% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>. +% Copyright 2006 by Till Tantau % -% This program can be redistributed and/or modified under the terms -% of the GNU Public License, version 2. - +% This file may be distributed and/or modified +% +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +% +% See the file doc/generic/pgf/licenses/LICENSE for more details. +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.12 2006/10/11 15:22:26 tantau Exp $ % Driver commands for pdf @@ -40,23 +42,46 @@ }% } -\let\pgf@sys@pgf@resource@list=\@empty% -\def\pgf@sys@pdf@addtopageresources#1{% - \xdef\pgf@sys@pgf@resource@list{\pgf@sys@pgf@resource@list\space#1}% - \edef\pgf@temp{{<<\pgf@sys@pgf@resource@list>>}}% - \expandafter\immediate\expandafter\pdfobj\pgf@temp% - \edef\pgf@temp{{/ExtGState \the\pdflastobj\space 0 R}} - \expandafter\global\expandafter\pdfpageresources\pgf@temp% +\let\pgf@sys@pgf@resource@list@extgs=\pgf@empty% +\let\pgf@sys@pgf@resource@list@patterns=\pgf@empty% + +\def\pgf@sys@pdf@addtopageresources@extgs#1{% + \xdef\pgf@sys@pgf@resource@list@extgs{\pgf@sys@pgf@resource@list@extgs\space#1}% + \pgf@sys@pdf@updateresources% +} + +\def\pgf@sys@pdf@addtopageresources@patterns#1{% + \xdef\pgf@sys@pgf@resource@list@patterns{\pgf@sys@pgf@resource@list@patterns\space#1}% + \pgf@sys@pdf@updateresources% +} + +\def\pgf@sys@pdf@updateresources{% + \let\pgf@temp=\pgf@empty% + \ifx\pgf@sys@pgf@resource@list@extgs\pgf@empty% + \else% + \immediate\pdfobj{<<\pgf@sys@pgf@resource@list@extgs>>}% + \edef\pgf@temp{/ExtGState \the\pdflastobj\space 0 R\space}% + \fi% + \ifx\pgf@sys@pgf@resource@list@patterns=\pgf@empty% + \else% + \immediate\pdfobj{<<\pgf@sys@pgf@resource@list@patterns>>}% + \edef\pgf@temp{% + \pgf@temp% + /ColorSpace << /pgfprgb [/Pattern /DeviceRGB] >> + /Pattern \the\pdflastobj\space 0 R\space% + }% + \fi% + \expandafter\global\expandafter\pdfpageresources\expandafter{\pgf@temp}% } \def\pgfsys@imagesuffixlist{pdf:jpg:jpeg:png} \def\pgfsys@defineimage{% width, height, page number - \ifx\pgf@imagewidth\@empty\else\edef\pgf@imagewidth{ width \pgf@imagewidth }\fi% - \ifx\pgf@imageheight\@empty\else\edef\pgf@imageheight{ height \pgf@imageheight }\fi% - \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepage{ page \pgf@imagepage }\fi% + \ifx\pgf@imagewidth\pgf@empty\else\edef\pgf@imagewidth{ width \pgf@imagewidth }\fi% + \ifx\pgf@imageheight\pgf@empty\else\edef\pgf@imageheight{ height \pgf@imageheight }\fi% + \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepage{ page \pgf@imagepage }\fi% \ifx\pdfximage\@undefined% old version of pdflatex - \ifx\pgf@imagepage\@empty\else% + \ifx\pgf@imagepage\pgf@empty\else% \PackageWarning{pgf}{Page selection not supported. Ignoring page selection}% \fi% @@ -72,7 +97,7 @@ \fi }% \def\pgfsys@definemask{% - \ifx\pgf@maskmatte\@empty% + \ifx\pgf@maskmatte\pgf@empty% \else% \edef\pgf@maskmatte{/Matte [\pgf@maskmatte]}% \fi% @@ -120,6 +145,10 @@ \pgf@process{\pgfpoint{\pgf@max}{\pgf@max}}% \advance\pgf@xa by \pgf@x% \advance\pgf@ya by \pgf@y% + \pgf@sys@bp@correct{\pgf@x}% + \pgf@sys@bp@correct{\pgf@y}% + \pgf@sys@bp@correct{\pgf@xa}% + \pgf@sys@bp@correct{\pgf@ya}% \pdfxform resources {% /Shading << /Sh << /ShadingType 3 /ColorSpace /DeviceRGB @@ -131,6 +160,55 @@ }% }% + + +% Patterns + +\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{% + % Start building the pattern dictionary: + \pgf@xa=#2\relax% + \pgf@ya=#3\relax% + \pgf@xb=#4\relax% + \pgf@yb=#5\relax% + \pgf@xc=#6\relax% + \pgf@yc=#7\relax% + \pgf@sys@bp@correct\pgf@xa% + \pgf@sys@bp@correct\pgf@ya% + \pgf@sys@bp@correct\pgf@xb% + \pgf@sys@bp@correct\pgf@yb% + \pgf@sys@bp@correct\pgf@xc% + \pgf@sys@bp@correct\pgf@yc% + % Now create the pattern object: + \immediate\pdfobj stream + attr + { + /Type /Pattern + /PatternType 1 + /PaintType \ifnum#9=0 2 \else 1 \fi + /TilingType 1 + /BBox [\pgf@sys@tonumber\pgf@xa\space\pgf@sys@tonumber\pgf@ya\space\pgf@sys@tonumber\pgf@xb\space\pgf@sys@tonumber\pgf@yb] + /XStep \pgf@sys@tonumber\pgf@xc\space + /YStep \pgf@sys@tonumber\pgf@yc\space + /Resources << >> + } + {#8}% + \pgf@sys@pdf@addtopageresources@patterns{/pgfpat#1\space \the\pdflastobj\space 0 R}% +} + +\def\pgfsys@setpatternuncolored#1#2#3#4{% + \pgfsysprotocol@literal{/pgfprgb cs #2 #3 #4 /pgfpat#1\space scn}% +} + +\def\pgfsys@setpatterncolored#1{% + \pgfsysprotocol@literal{/Pattern cs /pgfpat#1\space scn}% +} + + +\def\pgfsys@papersize#1#2{% + \pdfpageheight#2% + \pdfpagewidth#1} + + % XForm version, crashes ghostview. %\def\pgfsys@defobject#1#2#3#4{% % \pgf@process{#2} @@ -161,6 +239,31 @@ % \box\pgfobjectbox% % \pgfsys@endscope} + + +% +% Position tracking +% +\def\pgfsys@markposition#1{% + \pdfsavepos% + \edef\pgf@temp{#1}% + \expandafter\write\expandafter\@auxout\expandafter{% + \expandafter\noexpand\expandafter\pgf@sys@pdf@mark\expandafter{\pgf@temp}{\the\pdflastxpos}{\the\pdflastypos}}% +} + +\def\pgf@sys@pdf@mark#1#2#3{% + \expandafter\gdef\csname pgf@sys@pdf@mark@pos@#1\endcsname{\pgfqpoint{#2sp}{#3sp}}% +} + +\def\pgfsys@getposition#1#2{% + \edef\pgf@marshal{\let\noexpand#2=\expandafter\noexpand\csname pgf@sys@pdf@mark@pos@#1\endcsname}% + \pgf@marshal% +} + +\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin} + + + \endinput |