diff options
author | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-10-29 00:31:31 +0000 |
commit | 6bc1f5497cfb2f56d65c80a4c36ea3bad6dc046c (patch) | |
tree | f7751da75030fb1e06653eeb44e579fcee09c65f /Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def | |
parent | ed0c7c756e441b2d2ba3633da233fc24361ac0d3 (diff) |
pgf 2.10 (28oct10)
git-svn-id: svn://tug.org/texlive/trunk@20236 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def | 152 |
1 files changed, 102 insertions, 50 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def index 03c1821639f..5cbf2fd66ca 100644 --- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def +++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def @@ -7,63 +7,81 @@ % % See the file doc/generic/pgf/licenses/LICENSE for more details. -\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def,v 1.4 2008/02/05 10:25:36 tantau Exp $ +\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def,v 1.7 2008/05/19 12:52:49 tantau Exp $ % Common driver commands for all drivers that produce pdf via the % detour of a dvi file -\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}} + + +% Hboxes \def\pgfsys@hbox#1{% - \special{pdf: content Q q -1 0 0 -1 0 0 cm q}% + \pgfsys@invoke{q -1 0 0 -1 0 0 cm}% \special{pdf: content -1 0 0 -1 0 0 cm 3 Tr q}% translate to % original coordinate system and do % not show anything {\hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}}% enforce font change - \special{pdf: content Q 0 Tr q}% end of font change enforcement. + \pgfsys@invoke{0 Tr}% \wd#1=0pt% \ht#1=0pt% \dp#1=0pt% \box#1 - \special{pdf: content Q n Q}% + \pgfsys@invoke{n Q Q}% } +\def\pgfsys@hboxsynced#1{% + {% + \pgfsys@beginscope% + \setbox\pgf@hbox=\hbox{% + \hskip\pgf@pt@x% + \raise\pgf@pt@y\hbox{% + \pgf@pt@x=0pt% + \pgf@pt@y=0pt% + \special{pdf: content q}% + \pgflowlevelsynccm% + \pgfsys@invoke{q -1 0 0 -1 0 0 cm}% + \special{pdf: content -1 0 0 -1 0 0 cm q}% translate to original coordinate system + \wd#1=0pt% + \ht#1=0pt% + \dp#1=0pt% + \box#1% + \pgfsys@invoke{n Q Q Q}% + }% + \hss% + }% + \wd\pgf@hbox=0pt% + \ht\pgf@hbox=0pt% + \dp\pgf@hbox=0pt% + \pgfsys@hbox\pgf@hbox% + \pgfsys@endscope% + }% +} + \def\pgfsys@beginpicture{% - \special{pdf: content Q 3 Tr q}% do not show anything + \pgfsys@invoke{3 Tr}% \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change - \special{pdf: content Q 0 Tr q}% end of font change enforcement. + \pgfsys@invoke{0 Tr}% \special{pdf: content q}} \def\pgfsys@endpicture{% - \special{pdf: content n Q}% + \pgfsys@invoke{n Q}% } \def\pgfsys@beginpurepicture{\special{pdf: content q}} -\def\pgf@sys@pdf@addtopageresources@extgs#1{% - \ifx\pgf@sys@pdf@obj\@undefined% - \global\let\pgf@sys@pdf@obj=\relax% - \special{pdf: obj @pgfopacities << >>}% << - \fi% - \special{pdf: put @pgfopacities << #1 >>}% << - \special{pdf: put @resources << /ExtGState @pgfopacities >>}% << -} -\def\pgf@sys@pdf@readdtopageresources@extgs#1{% - \special{pdf: put @resources << /ExtGState @pgfopacities >>}% << -} - \def\pgfsys@imagesuffixlist{.pdf:.jpg:.jpeg:.png:} \def\pgfsys@horishading#1#2#3{% {% \pgf@parsefunc{#3}% \pgf@process{\pgfpoint{\pgf@max}{#2}}% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@max\space height \the\pgf@y}}}\@temp% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources << + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@max\space height \the\pgf@y}}}\@temp% + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources << /Shading << /Sh << /ShadingType 2 /ColorSpace /DeviceRGB /Domain [\pgf@pdfparseddomain] /Coords [\pgf@doma\space0 \pgf@domb\space0] /Function \pgf@pdfparsedfunction /Extend [false false] >> >> >>}}}\@temp% << - \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}% + \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}% \special{pdf: endxobj}}% \expandafter\xdef\csname @pgfshading#1!\endcsname{% \hbox to\the\pgf@max{\vbox to#2{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}% @@ -73,15 +91,15 @@ {% \pgf@parsefunc{#3}% \pgf@process{\pgfpoint{\pgf@max}{#2}}% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@y\space height \the\pgf@max\space}}}\@temp% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources << + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgf@y\space height \the\pgf@max\space}}}\@temp% + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources << /Shading << /Sh << /ShadingType 2 /ColorSpace /DeviceRGB /Domain [\pgf@pdfparseddomain] /Coords [0 \pgf@doma\space0 \pgf@domb] /Function \pgf@pdfparsedfunction /Extend [false false] >> >> >>}}}\@temp% << - \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}% + \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}% \special{pdf: endxobj}}% \expandafter\xdef\csname @pgfshading#1!\endcsname{% \hbox to#2{\vbox to\the\pgf@max{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}% @@ -101,42 +119,21 @@ \pgf@sys@bp@correct{\pgf@xa}% \pgf@sys@bp@correct{\pgf@ya}% \pgfutil@tempdima=2\pgf@max\relax% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp% - \edef\@temp{\noexpand\pgf@sys@atbeginpage{\special{pdf: put @resources << + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: beginxobj @pgfshade#1 width \the\pgfutil@tempdima\space height \the\pgfutil@tempdima}}}\@temp% + \edef\@temp{\noexpand\pgfutil@insertatbegincurrentpage{\special{pdf: put @resources << /Shading << /Sh << /ShadingType 3 /ColorSpace /DeviceRGB /Domain [\pgf@pdfparseddomain] /Coords [\pgf@sys@tonumber{\pgf@xa} \pgf@sys@tonumber{\pgf@ya} \pgf@doma\space \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@y} \pgf@domb] /Function \pgf@pdfparsedfunction /Extend [true false] >> >> >>}}}\@temp% << - \pgf@sys@atbeginpage{\special{pdf: content /Sh sh}% + \pgfutil@insertatbegincurrentpage{\special{pdf: content /Sh sh}% \special{pdf: endxobj}}% \expandafter\xdef\csname @pgfshading#1!\endcsname{% \hbox to\the\pgfutil@tempdima{\vbox to\the\pgfutil@tempdima{\vfil\special{pdf: usexobj @pgfshade#1}}\hfil}}% }% }% -% The following is an ugly hack. We need something like -% "everyshipout". -% But it should be ultra-portable... -\def\pgf@sys@atbeginpage#1{\AtBeginDvi{#1}} -\AtBeginDocument{% hack for old hyperref - \ifx\Hy@begindvi\@undefined% - \let\pgf@sys@continue@hyper=\pgfutil@empty% - \else% - \pgf@sys@test@hyper% - \fi% - \def\@begindvi{\unvbox\@begindvibox\pgf@sys@continue@hyper} -} - -\def\pgf@sys@test@hyper{% - \ifHy@implicit% - \let\pgf@sys@continue@hyper=\Hy@begindvi% - \else% - \let\pgf@sys@continue@hyper=\HyPL@EveryPage% - \fi% -} - \def\pgf@sys@pdf@dvi@tracker{ \def\pgfsys@markposition##1{% \pdfsavepos% @@ -154,6 +151,61 @@ \def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin} } + + +% +% Resource management +% + +\newif\ifpgf@sys@pdf@colorspaces@exists +\newif\ifpgf@sys@pdf@patterns@exists +\newif\ifpgf@sys@pdf@extgs@exists +\newif\ifpgf@sys@pdf@colorspaces@created +\newif\ifpgf@sys@pdf@patterns@created +\newif\ifpgf@sys@pdf@extgs@created +\newif\ifpgf@sys@pdf@any@resources + +\def\pgf@sys@setuppdfresources@plain{% + % This command will setup pdf resource in plain and in latex + % mode. ConTeXt has its own handler + \pgfutil@insertatbegineverypage{% + \pgf@sys@pdf@any@resourcesfalse% + \ifpgf@sys@pdf@extgs@exists% + \pgf@sys@pdf@any@resourcestrue% + \ifpgf@sys@pdf@extgs@created \else \special{pdf: obj @pgfextgs <<>>} \global\pgf@sys@pdf@extgs@createdtrue \fi% << + \fi% + \ifpgf@sys@pdf@colorspaces@exists% + \pgf@sys@pdf@any@resourcestrue% + \ifpgf@sys@pdf@colorspaces@created \else \special{pdf: obj @pgfcolorspaces <<>>} \global\pgf@sys@pdf@colorspaces@createdtrue \fi% << + \fi% + \ifpgf@sys@pdf@patterns@exists% + \pgf@sys@pdf@any@resourcestrue% + \ifpgf@sys@pdf@patterns@created \else \special{pdf: obj @pgfpatterns <<>>} \global\pgf@sys@pdf@patterns@createdtrue \fi% << + \fi% + \ifpgf@sys@pdf@any@resources% + \special{pdf: put @resources << + \ifpgf@sys@pdf@extgs@exists /ExtGState @pgfextgs \fi + \ifpgf@sys@pdf@patterns@exists /Pattern @pgfpattern \fi + \ifpgf@sys@pdf@colorspaces@exists /ColorSpace @pgfcolorspaces \fi + >>}% << + \fi% + } + \def\pgf@sys@addpdfresource@extgs@plain##1{% + \global\pgf@sys@pdf@extgs@existstrue% + \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfextgs << ##1 >>}}% << + } + \def\pgf@sys@addpdfresource@colorspaces@plain##1{% + \global\pgf@sys@pdf@colorspaces@existstrue% + \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfcolorspaces << ##1 >>}}% << + } + \def\pgf@sys@addpdfresource@patterns@plain##1{% + \global\pgf@sys@pdf@patterns@existstrue% + \pgfutil@insertatbegincurrentpage{\special{pdf: put @pgfpatterns << ##1 >>}}% << + } +} +\pgfutil@setuppdfresources % possibly call the above + + \endinput %%% Local Variables: |