summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg3
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf-via-dvi.def53
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def1325
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def58
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def12
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def32
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def149
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def14
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def7
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def4
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def8
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex823
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex2009
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex2
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex2
20 files changed, 4296 insertions, 230 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
index 38b32e39b57..01ae33272e7 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgf.cfg,v 1.7 2008/05/14 22:01:48 tantau Exp $
+\ProvidesFileRCS{pgf.cfg}
% Copy this file to somewhere local and uncomment one of the following
% if you do not trust/use/like the automatic driver selection
@@ -18,6 +18,7 @@
% \def\pgfsysdriver{pgfsys-dvipdfmx.def}
% \def\pgfsysdriver{pgfsys-dvips.def}
% \def\pgfsysdriver{pgfsys-pdftex.def}
+% \def\pgfsysdriver{pgfsys-luatex.def}
% \def\pgfsysdriver{pgfsys-tex4ht.def}
% \def\pgfsysdriver{pgfsys-textures.def}
% \def\pgfsysdriver{pgfsys-vtex.def}
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 1605a956260..1ba7515684b 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,7 +7,7 @@
%
% 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.8 2013/07/12 13:52:50 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-pdf-via-dvi.def}
% Common driver commands for all drivers that produce pdf via the
% detour of a dvi file
@@ -16,57 +16,6 @@
% Hboxes
-\def\pgfsys@hbox#1{%
- \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
- \pgfsys@invoke{0 Tr}%
- \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
- \wd#1=0pt%
- \ht#1=0pt%
- \dp#1=0pt%
- \box#1
- \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
- \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
- \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{%
- \pgfsys@invoke{3 Tr}%
- \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
- \pgfsys@invoke{0 Tr}%
- \special{pdf: content q}}
-\def\pgfsys@endpicture{%
- \pgfsys@invoke{n Q}%
-}
\def\pgfsys@beginpurepicture{\special{pdf: content q}}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
index 32906ad3b64..ccac27335a3 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-pdf.def,v 1.13 2013/10/10 12:00:15 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-pdf.def}
% Common driver commands for all drivers that produce pdf
@@ -60,6 +60,10 @@
\def\pgfsys@color@gray@stroke#1{\pgfsysprotocol@literal{#1 G}}
\def\pgfsys@color@gray@fill#1{\pgfsysprotocol@literal{#1 g}}
+% Visibility
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope{\pgfsys@discardpath\pgfsys@clipnext\pgfsys@moveto{0pt}{0pt}\pgfsys@discardpath}}
+\def\pgfsys@endinvisiblescope{\pgfsys@endscope}
+
% Opacity
\def\pgfsys@stroke@opacity#1{%
\expandafter\ifx\csname pgf@sys@pdf@so@#1\endcsname\relax%
@@ -75,6 +79,8 @@
\fi%
\pgfsysprotocol@literal{\csname pgf@sys@pdf@fo@#1\endcsname\space gs}%
}
+
+% Blending
\def\pgfsys@blend@mode#1{%
\expandafter\ifx\csname pgf@sys@pdf@bm@#1\endcsname\relax%
\expandafter\let\expandafter\pgf@temp\csname pgf@sys@pdf@blend@mode@map@#1\endcsname%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
index 52e0ef9b224..0f8ce5d0157 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.22 2008/10/01 14:19:33 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-postscript.def}
% Driver commands for postscript
@@ -100,6 +100,11 @@
\def\pgfsys@beginscope{\pgfsysprotocol@literal{save}}
\def\pgfsys@endscope{\pgfsysprotocol@literal{restore}}
+\newif\ifpgfsys@ps@boxmode
+\def\pgfsys@begin@text{\pgfsys@ps@boxmodetrue}
+\def\pgfsys@end@text{}
+
+
% Graphics state
\def\pgfsys@setdash#1#2{%
\pgfsysprotocol@literalbuffered{[}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
index f2edbedf3c9..4986feaa46e 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-svg.def
@@ -7,13 +7,16 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-svg.def,v 1.24 2013/08/28 11:00:54 tantau Exp $
+\ProvidesFileRCS{pgfsys-common-svg.def}
% Driver commands for svg
+
% Helping functions:
+\def\pgf@sys@svg@make@defs#1{\pgf@sys@fail{svg defs}}
+\def\pgf@sys@svg@ref@defs#1{\pgf@sys@fail{svg defs}}
\let\pgf@sys@svgpath=\pgfutil@empty
\def\pgf@sys@svgnum#1{%
{%
@@ -26,7 +29,10 @@
\def\pgf@sys@addtosvgpath#1{\pgfutil@g@addto@macro\pgf@sys@svgpath{#1\space}}
\def\pgf@sys@flushsvgpath{\pgfsysprotocol@literal{\pgf@sys@svgpath}\global\let\pgf@sys@svgpath=\pgfutil@empty}
\def\pgf@sys@svg@gs#1{%
- {\pgfsysprotocol@literal{<g #1>\pgfsys@svg@newline }}\global\advance\pgf@sys@svg@scopecount by1\relax%
+ {%
+ \pgfsysprotocol@literal{<g #1>\pgfsys@svg@newline}%
+ }%
+ \global\advance\pgf@sys@svg@scopecount by1\relax%
}
\newcount\pgf@sys@svg@objectcount
@@ -38,61 +44,92 @@
}
% Path construction:
-\def\pgfsys@lineto#1#2{\pgf@sys@addtosvgpath{L }\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
-\def\pgfsys@moveto#1#2{\pgf@sys@addtosvgpath{M }\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
+\def\pgfsys@lineto#1#2{\pgf@sys@addtosvgpath{L}\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
+\def\pgfsys@moveto#1#2{\pgf@sys@addtosvgpath{M}\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}}
\def\pgfsys@curveto#1#2#3#4#5#6{%
- \pgf@sys@addtosvgpath{C }%
+ \pgf@sys@addtosvgpath{C}%
\pgf@sys@svgnum{#1}\pgf@sys@svgnum{#2}%
\pgf@sys@svgnum{#3}\pgf@sys@svgnum{#4}%
\pgf@sys@svgnum{#5}\pgf@sys@svgnum{#6}}
\def\pgfsys@rect#1#2#3#4{%
\pgfsys@moveto{#1}{#2}%
- \pgf@sys@addtosvgpath{h }\pgf@sys@svgnum{#3}%
- \pgf@sys@addtosvgpath{v }\pgf@sys@svgnum{#4}%
- \pgf@sys@addtosvgpath{h }{\pgf@x=#3\pgf@x=-\pgf@x\pgf@sys@svgnum{\pgf@x}}%
+ \pgf@sys@addtosvgpath{h}\pgf@sys@svgnum{#3}%
+ \pgf@sys@addtosvgpath{v}\pgf@sys@svgnum{#4}%
+ \pgf@sys@addtosvgpath{h}{\pgf@x=#3\pgf@x=-\pgf@x\pgf@sys@svgnum{\pgf@x}}%
\pgfsys@closepath}
\def\pgfsys@closepath{\pgf@sys@addtosvgpath{Z}}
% Path usage:
\newif\ifpgf@sys@svg@clipnext
\def\pgf@sys@svg@possiblyclippedpath#1{%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \pgfsys@if@fresh@currentid{\csname pgf@sys@svg@path@\pgf@sys@cacheref\endcsname}{}%
+ \let\pgfsys@anim@ba@d\pgfutil@empty
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
\ifpgf@sys@svg@clipnext%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgfsysprotocol@literal{<clipPath id="pgfcp\the\pgf@sys@svg@objectcount">
- <path id="pgfpath\the\pgf@sys@svg@objectcount" d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{"/>\pgfsys@svg@newline </clipPath>\pgfsys@svg@newline }
- \pgfsysprotocol@literal{<use xlink:href="\#pgfpath\the\pgf@sys@svg@objectcount" #1/>\pgfsys@svg@newline }%
- \pgf@sys@svg@gs{clip-path="url(\#pgfcp\the\pgf@sys@svg@objectcount)"}
+ \pgfsysprotocol@literal{%
+ <clipPath id="\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}clip">
+ <path id="\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}" d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{"/> </clipPath>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{<use xlink:href="\#\pgfsys@if@fresh@currentid{\pgf@sys@cacheref}{pgfcp\the\pgf@sys@svg@objectcount}" %
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\else%
+ \ifx\pgfsys@anim@ba@markerstart\pgfutil@empty\else%
+ marker-start="url(\#\pgfsys@anim@ba@markerstart)" %
+ \fi%
+ \ifx\pgfsys@anim@ba@markerend\pgfutil@empty\else%
+ marker-end="url(\#\pgfsys@anim@ba@markerend)" %
+ \fi%
+ \fi%
+ #1/>\pgfsys@svg@newline }%
+ \pgf@sys@svg@gs{clip-path="url(\#\pgfsys@if@fresh@currentid{\pgfsys@id@refcurrent}{pgfcp\the\pgf@sys@svg@objectcount}clip)"}
\pgf@sys@svg@clipnextfalse%
\else%
- \pgfsysprotocol@literal{<path d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{" #1/>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{<path\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{} d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{" %
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\else%
+ \ifx\pgfsys@anim@ba@markerstart\pgfutil@empty\else%
+ marker-start="url(\#\pgfsys@anim@ba@markerstart)" %
+ \fi%
+ \ifx\pgfsys@anim@ba@markerend\pgfutil@empty\else%
+ marker-end="url(\#\pgfsys@anim@ba@markerend)" %
+ \fi%
+ \fi%
+ #1/>\pgfsys@svg@newline }%
\fi%
+ \pgfsys@invalidate@currentid%
}
-\def\pgfsys@stroke{\pgf@sys@svg@possiblyclippedpath{style="fill:none"}}
-\def\pgfsys@fill{\pgf@sys@svg@possiblyclippedpath{style="stroke:none"}}
+\def\pgfsys@stroke{\pgf@sys@svg@possiblyclippedpath{fill="none"}}
+\def\pgfsys@fill{\pgf@sys@svg@possiblyclippedpath{stroke="none"}}
\def\pgfsys@fillstroke{\pgf@sys@svg@possiblyclippedpath{}}
\def\pgfsys@clipnext{\pgf@sys@svg@clipnexttrue}
\def\pgfsys@discardpath{%
\ifpgf@sys@svg@clipnext%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \let\pgfsys@anim@ba@d\pgfutil@empty
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgfsysprotocol@literal{<clipPath id="pgfcp\the\pgf@sys@svg@objectcount">
- <path d="}%
- \pgf@sys@flushsvgpath%
- \pgfsysprotocol@literal{"/>\pgfsys@svg@newline </clipPath>\pgfsys@svg@newline }
+ \pgfsysprotocol@literal{%
+ <clipPath id="pgfcp\the\pgf@sys@svg@objectcount">%
+ <path\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{} d="}%
+ \ifx\pgfsys@anim@ba@d\pgfutil@empty\pgf@sys@flushsvgpath\else\pgfsysprotocol@literal{\pgfsys@anim@ba@d}\fi%
+ \pgfsysprotocol@literal{"/> </clipPath>\pgfsys@svg@newline }
\pgf@sys@svg@gs{clip-path="url(\#pgfcp\the\pgf@sys@svg@objectcount)"}
\pgf@sys@svg@clipnextfalse%
\else%
\global\let\pgf@sys@svgpath=\pgfutil@empty
- \fi}
+ \fi%
+ \pgfsys@invalidate@currentid%
+}
% Fill rules:
\def\pgfsys@eoruletrue{\pgf@sys@svg@gs{fill-rule="evenodd"}}
\def\pgfsys@eorulefalse{\pgf@sys@svg@gs{fill-rule="nonzero"}}
% Transparency:
+\def\pgfsys@opacity#1{\pgf@sys@svg@gs{opacity="#1"}}
\def\pgfsys@stroke@opacity#1{\pgf@sys@svg@gs{stroke-opacity="#1"}}
\def\pgfsys@fill@opacity#1{\pgf@sys@svg@gs{fill-opacity="#1"}\def\pgf@sys@svg@opacity{#1}}
\def\pgf@sys@svg@opacity{1}
@@ -107,35 +144,174 @@
% Transformation:
\def\pgfsys@transformcm#1#2#3#4#5#6{%
{\pgf@x=#5\pgf@y=#6%
- \pgf@sys@svg@gs{transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}}}
+ \edef\pgf@temp{#1,#2,#3,#4}%
+ \ifx\pgf@temp\pgf@sys@svg@idtrans@text%
+ \ifdim\pgf@x=0pt\relax%
+ \ifdim\pgf@y=0pt%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi}}
+\def\pgfsys@transformshift#1#2{%
+ {\pgf@x=#1\pgf@y=#2%
+ \ifdim\pgf@x=0pt\relax%
+ \ifdim\pgf@y=0pt%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi%
+ \else%
+ \pgf@sys@svg@gs{transform="translate(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \fi}}
+\def\pgfsys@transformxyscale#1#2{%
+ {\pgf@x=#1pt\pgf@y=#2pt%
+ \pgf@sys@svg@gs{transform="scale(\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}}}
+\def\pgfsys@viewboxmeet{\pgf@sys@svg@viewbox{meet}}
+\def\pgfsys@viewboxslice{\pgf@sys@svg@viewbox{slice}}
+\def\pgf@sys@svg@viewbox#1#2#3#4#5#6#7#8#9{%
+ {%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
+ \pgf@x#2%
+ \pgf@y#3%
+ \pgf@xa#4%
+ \pgf@ya#5%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgf@xb#6%
+ \pgf@yb#7%
+ \pgf@xc#8%
+ \pgf@yc#9%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \pgfsysprotocol@literal{<svg
+ overflow="visible"
+ preserveAspectRatio="xMidYMid #1"
+ \pgfsys@if@fresh@currentid{ id="\pgf@sys@cacheref"}{}
+ x="\pgf@sys@tonumber{\pgf@x}"
+ y="\pgf@sys@tonumber{\pgf@y}"
+ width="\pgf@sys@tonumber{\pgf@xa}"
+ height="\pgf@sys@tonumber{\pgf@ya}"
+ viewBox="%
+ \ifx\pgfsys@anim@ba@viewBox\pgfutil@empty%
+ \pgf@sys@tonumber{\pgf@xb} \pgf@sys@tonumber{\pgf@yb} \pgf@sys@tonumber{\pgf@xc} \pgf@sys@tonumber{\pgf@yc}%
+ \else%
+ \pgfsys@anim@ba@viewBox%
+ \fi%
+ ">}%
+ \pgfsys@invalidate@currentid%
+ }%
+}
+\def\pgfsys@endviewbox{\pgfsysprotocol@literal{</svg>}}
+
% Scopes
\newcount\pgf@sys@svg@scopecount
+
+\newif\ifpgfsys@svg@boxmode
+\def\pgfsys@begin@text{\pgfsys@beginscope\pgfsys@svg@boxmodetrue}
+\def\pgfsys@end@text{\pgfsys@endscope}
+
\def\pgfsys@beginscope{%
\edef\pgf@sys@svg@thescopecount{\the\pgf@sys@svg@scopecount}%
\begingroup%
+ \pgf@sys@svg@scopecount=0\relax%
+}
+\def\pgfsys@beginscope@#1{%
+ \edef\pgf@sys@svg@thescopecount{\the\pgf@sys@svg@scopecount}%
+ \begingroup%
\pgf@sys@svg@scopecount=1\relax%
- \pgfsysprotocol@literal{<g>\pgfsys@svg@newline }%
- }
+ \pgfsysprotocol@literal{<g#1>\pgfsys@svg@newline }%
+}
\def\pgfsys@endscope{%
\loop%
+ \ifnum\pgf@sys@svg@scopecount>0\relax%
\pgfsysprotocol@literal{</g>\pgfsys@svg@newline }%
\advance\pgf@sys@svg@scopecount by-1\relax%
- \ifnum\pgf@sys@svg@scopecount>0\relax%
\repeat%
\endgroup%
\global\pgf@sys@svg@scopecount=\pgf@sys@svg@thescopecount\relax%
}
+\newif\ifpgfsys@svg@close@strokenone
+\def\pgfsys@begin@idscope{%
+ \begingroup%
+ \pgfsys@if@fresh@currentid{%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \let\pgf@sys@svg@ba@gs\pgfutil@empty%
+ \csname pgfsys@anim@ba@\pgf@sys@cacheref\endcsname%
+ \pgfsys@beginscope@{ id="\pgf@sys@cacheref" \pgf@sys@svg@ba@gs\pgfsys@svg@rdf}%
+ \expandafter\let\expandafter\pgf@sys@svg@end@id@scope@code\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname%
+ \let\pgf@sys@svg@end@id@scope\pgfsys@endscope%
+ \csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname%
+ }{%
+ \ifx\pgfsys@svg@rdf\pgfutil@empty%
+ \let\pgf@sys@svg@end@id@scope@code\relax%
+ \let\pgf@sys@svg@end@id@scope\relax%
+ \else%
+ \pgfsys@beginscope@{\pgfsys@svg@rdf}%
+ \let\pgf@sys@svg@end@id@scope@code\relax%
+ \let\pgf@sys@svg@end@id@scope\pgfsys@endscope%
+ \fi%
+ }%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname\relax%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname\relax%
+ \ifpgfsys@svg@boxmode\pgfsysprotocol@literal{<g stroke="none">}\pgfsys@svg@close@strokenonetrue\fi%
+ \pgfsys@invalidate@currentid%
+ \begingroup%
+ \global\let\pgfsys@svg@rdf\pgfutil@empty%
+}
+\def\pgfsys@end@idscope{%
+ \endgroup%
+ \ifpgfsys@svg@close@strokenone\pgfsysprotocol@literal{</g>}\fi%
+ \pgf@sys@svg@end@id@scope@code%
+ \pgf@sys@svg@end@id@scope%
+ \endgroup%
+}
+\let\pgfsys@svg@rdf\pgfutil@empty%
+
+% IDs
+
+\newcount\pgf@sys@svg@type@count
+
+\def\pgfsys@clean@type#1#2{%
+ \expandafter\let\expandafter#1\csname pgf@sys@svg@lookup@#2\endcsname%
+ \if#1\relax%
+ \global\advance\pgf@sys@svg@type@count by1\relax%
+ \expandafter\xdef\csname pgf@sys@svg@lookup@#2\endcsname{t\the\pgf@sys@svg@type@count}%
+ \expandafter\let\expandafter#1\csname pgf@sys@svg@lookup@#2\endcsname%
+ \fi%
+}
+
+
% Graphics state
\def\pgfsys@setdash#1#2{%
- \edef\pgf@test@dashpattern{#1}%
- \ifx\pgf@test@dashpattern\pgfutil@empty%
- \pgf@sys@svg@gs{stroke-dasharray="none" stroke-dashoffset="#2"}%
- \else%
- \pgf@sys@svg@gs{stroke-dasharray="#1" stroke-dashoffset="#2"}%
- \fi}
-\def\pgfsys@setlinewidth#1{\pgf@sys@svg@gs{stroke-width="#1"}}
+ {%
+ \pgf@xa#2\relax%
+ \edef\pgf@test@dashpattern{#1}%
+ \ifx\pgf@test@dashpattern\pgfutil@empty%
+ \pgf@sys@svg@gs{stroke-dasharray="none" stroke-dashoffset="\pgf@sys@tonumber\pgf@xa"}%
+ \else%
+ \let\pgf@sys@svg@parsed@dash\pgfutil@empty%
+ \expandafter\pgf@sys@svg@parse@dash\pgf@test@dashpattern,\relax%
+ \pgf@sys@svg@gs{stroke-dasharray="\pgf@sys@svg@parsed@dash" stroke-dashoffset="\pgf@sys@tonumber\pgf@xa"}%
+ \fi%
+ }%
+}
+\def\pgf@sys@svg@parse@dash#1,{%
+ \pgf@x#1\relax%
+ \pgfutil@ifnextchar\relax{%
+ \edef\pgf@sys@svg@parsed@dash{\pgf@sys@svg@parsed@dash\pgf@sys@tonumber\pgf@x}%
+ }{%
+ \edef\pgf@sys@svg@parsed@dash{\pgf@sys@svg@parsed@dash\pgf@sys@tonumber\pgf@x,}%
+ \pgf@sys@svg@parse@dash%
+ }%
+}
+\def\pgfsys@setlinewidth#1{{\pgf@x=#1\pgf@sys@svg@gs{stroke-width="\pgf@sys@tonumber{\pgf@x}"}}}
\def\pgfsys@setmiterlimit#1{\pgf@sys@svg@gs{stroke-miterlimit="#1"}}
\def\pgfsys@buttcap{\pgf@sys@svg@gs{stroke-linecap="butt"}}
\def\pgfsys@roundcap{\pgf@sys@svg@gs{stroke-linecap="round"}}
@@ -144,34 +320,88 @@
\def\pgfsys@roundjoin{\pgf@sys@svg@gs{stroke-linejoin="round"}}
\def\pgfsys@beveljoin{\pgf@sys@svg@gs{stroke-linejoin="bevel"}}
+% Invisibility
+\def\pgfsys@begininvisible{\pgfsysprotocol@literal{<g visibility="hidden">\pgfsys@svg@newline }}
+\def\pgfsys@endinvisible{\pgfsysprotocol@literal{</g>}}
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope@{ visibility="hidden"}}
+\def\pgfsys@endinvisiblescope{\pgfsys@endscope}
+
%
% Color management
%
+\def\pgf@sys@svg@rgb@to@hash#1#2#3{%
+ {%
+ \pgf@sys@svg@do@color{#1}%
+ \let\pgf@sys@svg@ra\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@rb\pgf@sys@svg@hex@second%
+ \pgf@sys@svg@do@color{#2}%
+ \let\pgf@sys@svg@ga\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@gb\pgf@sys@svg@hex@second%
+ \pgf@sys@svg@do@color{#3}%
+ \let\pgf@sys@svg@ba\pgf@sys@svg@hex@first%
+ \let\pgf@sys@svg@bb\pgf@sys@svg@hex@second%
+ \xdef\pgf@sys@svg@prepared{\pgf@sys@svg@hash\pgf@sys@svg@ra\pgf@sys@svg@rb\pgf@sys@svg@ga\pgf@sys@svg@gb\pgf@sys@svg@ba\pgf@sys@svg@bb}%
+ \ifx\pgf@sys@svg@ra\pgf@sys@svg@rb%
+ \ifx\pgf@sys@svg@ga\pgf@sys@svg@gb%
+ \ifx\pgf@sys@svg@ba\pgf@sys@svg@bb%
+ \xdef\pgf@sys@svg@prepared{\pgf@sys@svg@hash\pgf@sys@svg@ra\pgf@sys@svg@ga\pgf@sys@svg@ba}%
+ \fi%
+ \fi%
+ \fi%
+ }%
+}
+
+\expandafter\def\csname pgf@svg@0\endcsname{0}
+\expandafter\def\csname pgf@svg@1\endcsname{1}
+\expandafter\def\csname pgf@svg@2\endcsname{2}
+\expandafter\def\csname pgf@svg@3\endcsname{3}
+\expandafter\def\csname pgf@svg@4\endcsname{4}
+\expandafter\def\csname pgf@svg@5\endcsname{5}
+\expandafter\def\csname pgf@svg@6\endcsname{6}
+\expandafter\def\csname pgf@svg@7\endcsname{7}
+\expandafter\def\csname pgf@svg@8\endcsname{8}
+\expandafter\def\csname pgf@svg@9\endcsname{9}
+\expandafter\def\csname pgf@svg@10\endcsname{a}
+\expandafter\def\csname pgf@svg@11\endcsname{b}
+\expandafter\def\csname pgf@svg@12\endcsname{c}
+\expandafter\def\csname pgf@svg@13\endcsname{d}
+\expandafter\def\csname pgf@svg@14\endcsname{e}
+\expandafter\def\csname pgf@svg@15\endcsname{f}
+
+\def\pgf@sys@svg@do@color#1{%
+ \pgf@x#1\relax%
+ \c@pgf@counta\pgf@x%
+ \divide\c@pgf@counta by256\relax%
+ \ifnum\c@pgf@counta>255\relax%
+ \c@pgf@counta=255\relax%
+ \fi%
+ \ifnum\c@pgf@counta<0\relax%
+ \c@pgf@counta=0\relax%
+ \fi%
+ \c@pgf@countb\c@pgf@counta\relax%
+ \divide\c@pgf@countb by16\relax%
+ \expandafter\let\expandafter\pgf@sys@svg@hex@first\csname pgf@svg@\the\c@pgf@countb\endcsname%
+ \multiply\c@pgf@countb by16\relax%
+ \advance\c@pgf@counta by-\c@pgf@countb\relax%
+ \expandafter\let\expandafter\pgf@sys@svg@hex@second\csname pgf@svg@\the\c@pgf@counta\endcsname%
+}
+
\def\pgf@sys@svg@color@rgb#1,#2,#3\relax{%
{%
- \pgf@xa=#1pt%
- \pgf@xa=100\pgf@xa%
- \pgf@xb=#2pt%
- \pgf@xb=100\pgf@xb%
- \pgf@xc=#3pt%
- \pgf@xc=100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
- }%
+ \pgf@sys@svg@rgb@to@hash{#1pt}{#2pt}{#3pt}%
+ }%
}
\def\pgf@sys@svg@color@cmy#1,#2,#3\relax{%
{%
\pgf@xa=1pt%
\advance\pgf@xa by-#1pt%
- \pgf@xa=100\pgf@xa%
\pgf@xb=1pt%
\advance\pgf@xb by-#2pt%
- \pgf@xb=100\pgf@xb%
\pgf@xc=1pt%
\advance\pgf@xc by-#3pt%
- \pgf@xc=100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xb}{\pgf@xc}%
}%
}
\def\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax{%
@@ -181,27 +411,26 @@
\pgf@xa=#1\pgf@xa%
\advance\pgf@xa by#4pt%
\advance\pgf@xa by-1pt%
- \pgf@xa=-100\pgf@xa%
+ \pgf@xa=-\pgf@xa%
\pgf@xb=1pt%
\advance\pgf@xb by-#4pt%
\pgf@xb=#2\pgf@xb%
\advance\pgf@xb by#4pt%
\advance\pgf@xb by-1pt%
- \pgf@xb=-100\pgf@xb%
+ \pgf@xb=-\pgf@xb%
\pgf@xc=1pt%
\advance\pgf@xc by-#4pt%
\pgf@xc=#3\pgf@xc%
\advance\pgf@xc by#4pt%
\advance\pgf@xc by-1pt%
- \pgf@xc=-100\pgf@xc%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xb\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xc\pgf@sys@svg@percentchar)}%
+ \pgf@xc=-\pgf@xc%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xb}{\pgf@xc}%
}%
}
\def\pgf@sys@svg@color@gray#1\relax{%
- {%
+ {%
\pgf@xa=#1pt%
- \pgf@xa=100\pgf@xa%
- \xdef\pgf@sys@svg@prepared{rgb(\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar,\pgf@sys@tonumber\pgf@xa\pgf@sys@svg@percentchar)}%
+ \pgf@sys@svg@rgb@to@hash{\pgf@xa}{\pgf@xa}{\pgf@xa}%
}%
}
@@ -209,30 +438,100 @@
\ifpgfpicture\pgf@sys@svg@gs{#1}\fi%
}
+\def\pgf@sys@svg@colorpop{\special{color pop}}
+
+
+% RGB
\def\pgfsys@color@rgb@stroke#1#2#3{%
\pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@rgb@fill#1#2#3{%
- \pgf@sys@svg@color@rgb#1,#2,#3\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push rgb #1 #2 #3}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@rgb#1#2#3{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@rgb#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push rgb #1 #2 #3}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+%CMYK
\def\pgfsys@color@cmyk@stroke#1#2#3#4{%
\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@cmyk@fill#1#2#3#4{%
- \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 #4}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@cmyk#1#2#3#4{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 #4}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+% CMY
\def\pgfsys@color@cmy@stroke#1#2#3{%
\pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@cmy@fill#1#2#3{%
- \pgf@sys@svg@color@cmy#1,#2,#3\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}
+ \else%
+ \special{color push cmyk #1 #2 #3 0}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@cmy#1#2#3{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@cmy#1,#2,#3\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push cmyk #1 #2 #3 0}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+
+% gray
\def\pgfsys@color@gray@stroke#1{%
\pgf@sys@svg@color@gray#1\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
\pgf@sys@svg@gs@color{stroke="\pgf@sys@svg@prepared"}}
\def\pgfsys@color@gray@fill#1{%
- \pgf@sys@svg@color@gray#1\relax%
- \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}}
+ \ifpgfpicture%
+ \pgf@sys@svg@color@gray#1\relax%
+ \pgf@sys@svg@gs@color{fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push gray #1}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
+\def\pgfsys@color@gray#1{%
+ \ifpgfpicture%
+ \pgf@sys@svg@color@gray#1\relax%
+ \let\pgf@sys@svg@last@stroke\pgf@sys@svg@prepared%
+ \pgf@sys@svg@gs@color{\ifpgfsys@svg@boxmode\else stroke="\pgf@sys@svg@prepared" \fi fill="\pgf@sys@svg@prepared"}%
+ \else%
+ \special{color push gray #1}%
+ \aftergroup\pgf@sys@svg@colorpop%
+ \fi}
% Shadings:
@@ -286,7 +585,7 @@
{%
\pgf@parsefunc{#3}%
\global\advance\pgf@sys@svg@objectcount by1\relax%
- \pgf@sys@svg@addtostops{<linearGradient id="pgfsh\the\pgf@sys@svg@objectcount">\noexpand\pgfsys@svg@newline}
+ \pgf@sys@svg@addtostops{<linearGradient id="pgfsh\the\pgf@sys@svg@objectcount">\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</linearGradient>\noexpand\pgfsys@svg@newline}%
\pgf@process{\pgfpoint{\pgf@sys@shading@end@pos}{#2}}%
@@ -317,7 +616,7 @@
\global\advance\pgf@sys@svg@objectcount by1\relax%
\pgf@sys@svg@addtostops{<linearGradient
id="pgfsh\the\pgf@sys@svg@objectcount"
- gradientTransform="rotate(90)">\noexpand\pgfsys@svg@newline}
+ gradientTransform="rotate(90)">\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</linearGradient>\noexpand\pgfsys@svg@newline}%
\pgf@process{\pgfpoint{\pgf@sys@shading@end@pos}{#2}}%
@@ -352,7 +651,7 @@
id="pgfsh\the\pgf@sys@svg@objectcount"
fx="\pgf@sys@tonumber\pgf@x"
fy="\pgf@sys@tonumber\pgf@y"
- >\noexpand\pgfsys@svg@newline}
+ >\noexpand\pgfsys@svg@newline}%
\pgf@sys@svg@shading@stops%
\pgf@sys@svg@addtostops{</radialGradient>\noexpand\pgfsys@svg@newline}%
\pgf@xa=\pgf@sys@shading@end@pos%
@@ -373,8 +672,6 @@
% Patterns
-\iffalse % comment until interpage support is available
-
\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{%
% Start building the pattern dictionary:
\pgf@xa=#2\relax%
@@ -385,22 +682,22 @@
\pgf@yc=#7\relax%
\ifnum#9=1\relax%
% Colored. That's easy:
- \pgfsysprotocol@literal{
+ \pgf@sys@svg@make@defs{#1}{
<pattern
id="pgfpat#1"
patternUnits="userSpaceOnUse"
- width="\the\pgf@xc"
- height="\the\pgf@yc">
+ width="\pgf@sys@tonumber\pgf@xc"
+ height="\pgf@sys@tonumber\pgf@yc">
#8
</pattern>}%
\else%
% Uncolored. Yikes!
- \pgfsysprotocol@literal{
+ \pgf@sys@svg@make@defs{#1}{
<pattern
id="pgfpat#1"
patternUnits="userSpaceOnUse"
- width="\the\pgf@xc"
- height="\the\pgf@yc"/>
+ width="\pgf@sys@tonumber\pgf@xc"
+ height="\pgf@sys@tonumber\pgf@yc"/>
<symbol id="pgfsym#1">
#8
</symbol>}%
@@ -413,38 +710,884 @@
\pgfsysprotocol@literal{
<pattern id="pgfupat\the\pgf@sys@svg@objectcount" xlink:href="\#pgfpat#1">
<g stroke="\pgf@sys@svg@prepared" fill="\pgf@sys@svg@prepared"> <use xlink:href="\#pgfsym#1"/> </g>
- </pattern>}
+ </pattern>}%
+ \pgf@sys@svg@ref@defs{#1}%
\pgf@sys@svg@gs@color{fill="url(\#pgfupat\the\pgf@sys@svg@objectcount)"}%
}
\def\pgfsys@setpatterncolored#1{%
+ \pgf@sys@svg@ref@defs{#1}%
\pgf@sys@svg@gs@color{fill="url(\#pgfpat#1)"}%
}
-\fi
-% Fadings
+
+% Animation
+
+\pgfsysanimationsupportedtrue
+
+\let\pgfsys@anim@val@dur\pgfutil@empty
+\let\pgfsys@anim@val@restart\pgfutil@empty
+\let\pgfsys@anim@val@repeatCount\pgfutil@empty
+\let\pgfsys@anim@val@repeatDur\pgfutil@empty
+\let\pgfsys@anim@val@fill\pgfutil@empty
+\let\pgfsys@anim@val@keyTimes\pgfutil@empty
+\let\pgfsys@anim@val@keyPoints\pgfutil@empty
+\let\pgfsys@anim@val@keySplines\pgfutil@empty
+\let\pgfsys@anim@val@begin\pgfutil@empty
+\let\pgfsys@anim@val@end\pgfutil@empty
+\let\pgfsys@anim@val@additive\pgfutil@empty
+\let\pgfsys@anim@val@accumulate\pgfutil@empty
+\def\pgfsys@anim@val@calcMode{spline}
+\let\pgfsys@anim@val@from\pgfutil@empty
+\let\pgfsys@anim@val@to\pgfutil@empty
+\let\pgfsys@anim@val@path\pgfutil@empty
+\let\pgfsys@anim@val@rotate\pgfutil@empty
+\let\pgfsys@anim@val@values\pgfutil@empty
+\def\pgfsys@anim@val@canvas@trans{{}{}}
+\let\pgfsys@anim@val@@id\pgfutil@empty
+\let\pgfsys@anim@val@@type\pgfutil@empty
+\let\pgfsys@anim@val@base\pgfutil@empty
+\let\pgfsys@anim@val@idref\pgfutil@empty
+\expandafter\let\csname pgfsys@anim@val@xlink:href\endcsname\pgfutil@empty
+
+\def\pgf@sys@svg@key#1{%
+ \expandafter\ifx\csname pgfsys@anim@val@#1\endcsname\pgfutil@empty\else%
+ \space#1="\csname pgfsys@anim@val@#1\endcsname"%
+ \fi%
+}
+
+\def\pgf@svg@anim@keys{
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{keyTimes}%
+ \pgf@sys@svg@key{keyPoints}%
+ \pgf@sys@svg@key{keySplines}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{additive}%
+ \pgf@sys@svg@key{accumulate}%
+ \pgf@sys@svg@key{calcMode}%
+ \pgf@sys@svg@key{values}%
+ \pgf@sys@svg@key{from}%
+ \pgf@sys@svg@key{to}%
+ \pgf@sys@svg@key{path}%
+ \pgf@sys@svg@key{rotate}%
+ \pgf@sys@svg@key{xlink:href}%
+}
+
+\newif\ifpgf@sys@at@least@one@event
+\def\pgf@sys@svg@do@events#1{%
+ \pgf@sys@at@least@one@eventfalse%
+ \def\pgf@sys@event@target{#1}%
+ \expandafter\expandafter\expandafter\pgf@sys@svg@do@events@now\csname pgf@sys@event@list@#1\endcsname\relax%
+}
+\def\pgf@sys@svg@do@events@now{%
+ \pgfutil@ifnextchar\relax{}{\pgf@sys@svg@do@event}%
+}
+\def\pgf@sys@svg@do@event#1#2#3#4{%
+ \pgf@sys@at@least@one@eventtrue%
+ %
+ {%
+ \edef\pgf@temp{#1}%
+ \ifx\pgf@temp\pgfutil@empty%
+ \else%
+ \pgfsys@register@type{#2}%
+ \def\pgf@temp{\pgfsys@id@ref{#1}{#2}.}%
+ \fi%
+ \edef\pgf@@temp{#4}%
+ \ifx\pgf@@temp\pgfutil@empty%
+ \pgf@x0pt%
+ \else%
+ \pgf@x#4pt%
+ \fi%
+ \ifx\pgf@sys@event@target\pgf@sys@begin@text%
+ \advance\pgf@x by\pgf@xa\relax%
+ \fi\relax%
+ \ifdim\pgf@x<0pt%
+ \edef\pgf@@temp{ \pgf@sys@tonumber\pgf@x s}%
+ \else
+ \edef\pgf@@temp{ +\pgf@sys@tonumber\pgf@x s}%
+ \fi%
+ \xdef\pgf@svg@anim@temp{\pgf@temp#3\pgf@@temp}%
+ }%
+ \pgf@sys@svg@append{\pgf@sys@event@target}{\pgf@svg@anim@temp}%
+ \global\let\pgf@svg@anim@temp\relax%
+ \pgf@sys@svg@do@events@now%
+}
+
+
+\newif\ifpgf@sys@svg@is@sync@base
+\def\pgf@sys@svg@anim#1#2#3{%
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \else%
+ % Hook into id:
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ \edef\pgf@sys@temp{\global\let\expandafter\noexpand\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\relax\noexpand\pgfsys@anim@ba@setup}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter#3\expandafter{\pgfsys@anim@val@base}}%
+ \expandafter\global\expandafter\let\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\pgf@sys@temp%
+ \fi%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ #2%
+ % Suppress empty, superfluous animations:
+ \pgfutil@tempswatrue%
+ \pgfsys@if@fresh@currentid{}{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \ifx\pgfsys@anim@val@dur\pgfutil@empty%
+ \pgfutil@tempswafalse%
+ \fi%
+ \fi%
+ \fi}
+ \ifpgfutil@tempswa%
+ \edef\pgf@temp{{<animate #1\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline}}%
+ \expandafter\pgfsysprotocol@literal\pgf@temp%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ }%
+ \fi%
+}
+
+\def\pgf@sys@svg@anim@path{%
+ % animate a path...
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ \let\pgf@sys@svg@add@code\pgfutil@empty%
+ %
+ % Setup markers:
+ %
+ % Setup start
+ \ifx\pgf@svg@anim@marker@start\pgfutil@empty%
+ \let\pgf@sys@svg@marker@id@start\pgfutil@empty%
+ \else%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@add@code{%
+ \noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@start}%
+ \noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs\pgf@svg@anim@marker@start" transform="scale(-1,-1)"/> </marker>\pgfsys@svg@newline}%
+ }%
+ \let\pgf@sys@svg@marker@id@start\pgf@sys@svg@marker@id%
+ \fi%
+ % Setup end
+ \ifx\pgf@svg@anim@marker@end\pgfutil@empty%
+ \let\pgf@sys@svg@marker@id@end\pgfutil@empty%
+ \else%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \edef\pgf@sys@svg@add@code@{%
+ \noexpand\pgf@sys@svg@ref@defs{pgfs\pgf@svg@anim@marker@end}%
+ \noexpand\pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs\pgf@svg@anim@marker@end"/> </marker>\pgfsys@svg@newline}%
+ }%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\pgf@sys@svg@add@code@}%
+ \let\pgf@sys@svg@marker@id@end\pgf@sys@svg@marker@id%
+ \fi%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \else%
+ % Hook into id of path:
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ \edef\pgf@sys@temp{\global\let\expandafter\noexpand\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\relax\noexpand\pgfsys@anim@ba@setup}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@d\expandafter{\pgfsys@anim@val@base}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@markerstart\expandafter{\pgf@sys@svg@marker@id@start}}%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@temp\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\expandafter\def\expandafter\pgfsys@anim@ba@markerend\expandafter{\pgf@sys@svg@marker@id@end}}%
+ \expandafter\global\expandafter\let\csname pgfsys@anim@ba@\pgfsys@anim@val@idref\endcsname\pgf@sys@temp%
+ \fi%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ % Suppress empty, superfluous animations:
+ \pgfutil@tempswatrue%
+ \pgfsys@if@fresh@currentid{}{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \ifx\pgfsys@anim@val@dur\pgfutil@empty%
+ \pgfutil@tempswafalse%
+ \fi%
+ \fi%
+ \fi}
+ \ifpgfutil@tempswa%
+ % Ok, first, animate the path:
+ \edef\pgf@temp{%
+ {%
+ <animate attributeName="d"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline
+ <animate attributeName="marker-start"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent-ms"}{}%
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{xlink:href}
+ from="\ifx\pgf@svg@anim@marker@start\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@start)\fi"
+ to="\ifx\pgf@svg@anim@marker@start\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@start)\fi"
+ />\pgfsys@svg@newline%
+ <animate attributeName="marker-end"\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent-me"}{}%
+ \pgf@sys@svg@key{dur}%
+ \pgf@sys@svg@key{restart}%
+ \pgf@sys@svg@key{repeatCount}%
+ \pgf@sys@svg@key{repeatDur}%
+ \pgf@sys@svg@key{fill}%
+ \pgf@sys@svg@key{begin}%
+ \pgf@sys@svg@key{end}%
+ \pgf@sys@svg@key{xlink:href}
+ from="\ifx\pgf@svg@anim@marker@end\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@end)\fi"
+ to="\ifx\pgf@svg@anim@marker@end\pgfutil@empty none\else url(\#\pgf@sys@svg@marker@id@end)\fi"
+ />\pgfsys@svg@newline%
+ }}%
+ \expandafter\pgfsysprotocol@literal\pgf@temp%
+ \fi%
+ \ifx\pgf@sys@svg@add@code\pgfutil@empty%
+ \else%
+ \expandafter\let\expandafter\pgf@sys@svg@add@code@\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname%
+ \ifx\pgf@sys@svg@add@code@\relax%
+ \else%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code\expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\pgf@sys@svg@add@code@}%
+ \fi%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@svg@add@code%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@add@code\expandafter\global\expandafter\let\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname\relax}%
+ \expandafter\global\expandafter\let\csname pgf@sys@svg@path@\pgfsys@id@ref{\pgfsys@anim@val@@id}{\pgfsys@anim@val@@type}\endcsname\pgf@sys@svg@add@code%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ }%
+ \fi%
+}
+
+\def\pgfsys@anim@ba@setup{%
+ \let\pgfsys@anim@ba@opacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@fillopacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokeopacity\pgfutil@empty%
+ \let\pgfsys@anim@ba@visibility\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokewidth\pgfutil@empty%
+ \let\pgfsys@anim@ba@fill\pgfutil@empty%
+ \let\pgfsys@anim@ba@stroke\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokedasharray\pgfutil@empty%
+ \let\pgfsys@anim@ba@strokedashoffset\pgfutil@empty%
+ \let\pgf@sys@svg@ba@gs\pgf@sys@svg@ba@gs@do@now%
+}
+\let\pgfsys@anim@ba@opacity\pgfutil@empty%
+\let\pgfsys@anim@ba@fillopacity\pgfutil@empty%
+\let\pgfsys@anim@ba@strokeopacity\pgfutil@empty%
+\let\pgfsys@anim@ba@visibility\pgfutil@empty%
+\let\pgfsys@anim@ba@strokewidth\pgfutil@empty%
+\let\pgfsys@anim@ba@fill\pgfutil@empty%
+\let\pgfsys@anim@ba@stroke\pgfutil@empty%
+\let\pgfsys@anim@ba@viewBox\pgfutil@empty%
+\let\pgfsys@anim@ba@d\pgfutil@empty%
+\let\pgfsys@anim@ba@strokedasharray\pgfutil@empty%
+\let\pgfsys@anim@ba@strokedashoffset\pgfutil@empty%
+\let\pgfsys@anim@ba@markerstart\pgfutil@empty%
+\let\pgfsys@anim@ba@markerendd\pgfutil@empty%
+
+\def\pgf@sys@svg@ba@gs@do@now{%
+ \ifx\pgfsys@anim@ba@fill\pgfutil@empty\else fill="\pgfsys@anim@ba@fill" \fi%
+ \ifx\pgfsys@anim@ba@stroke\pgfutil@empty\else stroke="\pgfsys@anim@ba@stroke" \fi%
+ \ifx\pgfsys@anim@ba@opacity\pgfutil@empty\else opacity="\pgfsys@anim@ba@opacity" \fi%
+ \ifx\pgfsys@anim@ba@fillopacity\pgfutil@empty\else fill-opacity="\pgfsys@anim@ba@fillopacity" \fi%
+ \ifx\pgfsys@anim@ba@strokeopacity\pgfutil@empty\else stroke-opacity="\pgfsys@anim@ba@strokeopacity" \fi%
+ \ifx\pgfsys@anim@ba@visibility\pgfutil@empty\else visibility="\pgfsys@anim@ba@visibility" \fi%
+ \ifx\pgfsys@anim@ba@strokewidth\pgfutil@empty\else stroke-width="\pgfsys@anim@ba@strokewidth" \fi%
+ \ifx\pgfsys@anim@ba@strokedasharray\pgfutil@empty\else stroke-dasharray="\pgfsys@anim@ba@strokedasharray" \fi%
+ \ifx\pgfsys@anim@ba@strokedashoffset\pgfutil@empty\else stroke-dashoffset="\pgfsys@anim@ba@strokedashoffset" \fi%
+}
+
+
+
+\newcount\pgf@sys@svg@canvascount
+\def\pgf@sys@svg@anim@trans#1#2#3{%
+ \ifx\pgfsys@anim@val@@id\pgfutil@empty%
+ \pgferror{Animation misses ``whom''}%
+ \else%
+ {%
+ %
+ \global\advance\pgf@sys@svg@canvascount by1\relax%
+ \pgf@sys@svg@tl@eval%
+ \pgf@sys@svg@do@events{begin}%
+ \ifpgf@sys@at@least@one@event%
+ \else%
+ \pgf@sys@svg@append{begin}{\ifdim\pgf@xa>0pt+\fi\pgf@sys@tonumber\pgf@xa s}%
+ \fi%
+ \pgf@sys@svg@do@events{end}%
+ #2%
+ \pgfsys@register@type{\pgfsys@anim@val@@type}%
+ \pgf@sys@svg@replace{xlink:href}{\#\pgfsys@id@ref{\pgfsys@anim@val@@id canvas\the\pgf@sys@svg@canvascount}{\pgfsys@anim@val@@type}}%
+ \ifx\pgfsys@anim@val@base\pgfutil@empty%
+ \let\pgf@sys@svg@base@trans\pgfutil@empty%
+ \else%
+ \edef\pgf@sys@svg@base@trans{ transform="#3(\pgfsys@anim@val@base)"}%
+ \fi%
+ \pgfsysprotocol@literal{<#1\pgfsys@if@fresh@currentid{ id="\pgfsys@id@refcurrent"}{}\pgf@svg@anim@keys/>\pgfsys@svg@newline}%
+ \pgfsys@invalidate@currentid%
+ \edef\pgf@temp{{\pgfsys@id@ref{\pgfsys@anim@val@@id
+ canvas\the\pgf@sys@svg@canvascount}{\pgfsys@anim@val@@type}}}%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgf@sys@svg@attacher%
+ \expandafter\expandafter\expandafter\pgf@temp\expandafter\pgfsys@anim@val@canvas@trans\expandafter{\pgf@sys@svg@base@trans}%
+ }%
+ \fi%
+}
+
+\newif\ifpgf@sys@svg@called
+\def\pgf@sys@svg@attacher#1#2#3#4{%
+ \toks0{%
+ {%
+ \let\pgfsys@transformcm\pgfsys@anim@transformcm%
+ \global\pgf@sys@svg@calledfalse%
+ #2%
+ \ifpgf@sys@svg@called\else\pgfsysprotocol@literal{<g>}\fi%
+ \pgfsysprotocol@literal{<g id="#1"#4>}
+ {%
+ \global\pgf@sys@svg@calledfalse%
+ #3%
+ \ifpgf@sys@svg@called\else\pgfsysprotocol@literal{<g>}\fi%
+ }%
+ }%
+ }%
+ \edef\pgf@sys@svg@beg{\the\toks0}%
+ \def\pgf@sys@svg@end{\pgfsysprotocol@literal{</g></g></g>\noexpand\pgfsys@svg@newline}}%
+ \expandafter\expandafter\expandafter\pgfsys@attach@to@id%
+ \expandafter\expandafter\expandafter\pgfsys@anim@val@@id%
+ \expandafter\expandafter\expandafter\pgfsys@anim@val@@type%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@beg\expandafter}\expandafter{\pgf@sys@svg@end}%
+}
+
+
+\def\pgfsys@anim@transformcm#1#2#3#4#5#6{%
+ \ifpgf@sys@svg@called%
+ \pgferror{Double transformation calls in animation}%
+ \else%
+ {%
+ \pgf@x=#5\pgf@y=#6%
+ \edef\pgf@temp{ transform="matrix(#1,#2,#3,#4,\pgf@sys@tonumber{\pgf@x},\pgf@sys@tonumber{\pgf@y})"}%
+ \ifx\pgf@temp\pgf@sys@svg@idmat@stext%
+ \let\pgf@temp\pgfutil@empty%
+ \fi%
+ \pgfsysprotocol@literal{<g\pgf@temp>}%
+ }%
+ \global\pgf@sys@svg@calledtrue%
+ \fi%
+}
+\def\pgf@sys@svg@idtrans@text{1.0,0.0,0.0,1.0}
+\def\pgf@sys@svg@idmat@text{transform="matrix(1.0,0.0,0.0,1.0,0.0,0.0)"}
+\def\pgf@sys@svg@idmat@stext{ transform="matrix(1.0,0.0,0.0,1.0,0.0,0.0)"}
+
+\def\pgf@sys@svg@replace#1#2{%
+ \expandafter\edef\csname pgfsys@anim@val@#1\endcsname{#2}%
+}
+
+\def\pgf@sys@svg@append#1#2{%
+ \expandafter\let\expandafter\pgf@svg@anim@temp@\csname pgfsys@anim@val@#1\endcsname%
+ \ifx\pgf@svg@anim@temp@\pgfutil@empty%
+ \expandafter\edef\csname pgfsys@anim@val@#1\endcsname{#2}%
+ \else\ifx\pgf@svg@anim@temp@\relax%
+ \pgfutil@packageerror{pgfsys}{Unknown animation key '#1'}{}
+ \else%
+ \edef\pgf@svg@anim@temp@{\pgf@svg@anim@temp@;#2}%
+ \expandafter\let\csname pgfsys@anim@val@#1\endcsname\pgf@svg@anim@temp@%
+ \fi\fi%
+}
+
+% The actual animate command
+\def\pgfsys@animate#1{%
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgfsys@svg@animate#1\endcsname\relax%
+ \ifx\pgf@sys@temp\relax%
+ \pgf@sys@fail{animation attribute #1}%
+ \else%
+ \pgf@sys@temp%
+ \fi%
+}
+
+
+% The non-transforming animations
+\def\pgfsys@svg@animatenone{}
+\def\pgfsys@svg@animateopacity{\pgf@sys@svg@anim{attributeName="opacity"}{}{\pgfsys@anim@ba@opacity}}
+\def\pgfsys@svg@animatefillopacity{\pgf@sys@svg@anim{attributeName="fill-opacity"}{}{\pgfsys@anim@ba@fillopacity}}
+\def\pgfsys@svg@animatestrokeopacity{\pgf@sys@svg@anim{attributeName="stroke-opacity"}{}{\pgfsys@anim@ba@strokeopacity}}
+\def\pgfsys@svg@animatevisibility{\pgf@sys@svg@anim{attributeName="visibility"}{}{\pgfsys@anim@ba@visibility}}
+\def\pgfsys@svg@animatelinewidth{\pgf@sys@svg@anim{attributeName="stroke-width"}{}{\pgfsys@anim@ba@strokewidth}}
+\def\pgfsys@svg@animatecolor{\pgf@sys@svg@anim{attributeName="fill"}{}{\pgfsys@anim@ba@fill}\pgf@sys@svg@anim{attributeName="stroke"}{}{\pgfsys@anim@ba@stroke}}
+\def\pgfsys@svg@animatefillcolor{\pgf@sys@svg@anim{attributeName="fill"}{}{\pgfsys@anim@ba@fill}}
+\def\pgfsys@svg@animatestrokecolor{\pgf@sys@svg@anim{attributeName="stroke"}{}{\pgfsys@anim@ba@stroke}}
+\def\pgfsys@svg@animateviewbox{\pgf@sys@svg@anim{attributeName="viewBox"}{}{\pgfsys@anim@ba@viewBox}}
+\def\pgfsys@svg@animatepath{\pgf@sys@svg@anim@path}
+\def\pgfsys@svg@animatesyncbase{{\pgf@sys@svg@is@sync@basetrue\pgf@sys@svg@anim{}{}{}}}
+\def\pgfsys@svg@animatedash{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@base}{\pgfsys@anim@val@base@array}{\pgfsys@anim@val@base@offset}%
+ \let\pgfsys@anim@val@base\pgfsys@anim@val@base@array%
+ \pgf@sys@svg@anim{attributeName="stroke-dasharray"}{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@from}{\pgfsys@anim@val@from@array}{\pgfsys@anim@val@from@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@to}{\pgfsys@anim@val@to@array}{\pgfsys@anim@val@to@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@values}{\pgfsys@anim@val@values@array}{\pgfsys@anim@val@values@offset}%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@from@array%
+ \let\pgfsys@anim@val@to\pgfsys@anim@val@to@array%
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@values@array%
+ }{\pgfsys@anim@ba@strokedasharray}%
+ \let\pgfsys@anim@val@base\pgfsys@anim@val@base@offset%
+ \pgf@sys@svg@anim{attributeName="stroke-dashoffset"}{%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@from}{\pgfsys@anim@val@from@array}{\pgfsys@anim@val@from@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@to}{\pgfsys@anim@val@to@array}{\pgfsys@anim@val@to@offset}%
+ \pgf@svg@anim@prep@dash{\pgfsys@anim@val@values}{\pgfsys@anim@val@values@array}{\pgfsys@anim@val@values@offset}%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@from@offset%
+ \let\pgfsys@anim@val@to\pgfsys@anim@val@to@offset%
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@values@offset%
+ }{\pgfsys@anim@ba@strokedashoffset}%
+}
+
+% The transforming animations
+\def\pgfsys@svg@animatetranslate{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="translate"}{}{translate}}
+\def\pgfsys@svg@animatescale{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="scale"}{}{scale}}
+\def\pgfsys@svg@animaterotate{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="rotate"}{}{rotate}}
+\def\pgfsys@svg@animateskewx{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="skewX"}{}{skewX}}
+\def\pgfsys@svg@animateskewy{\pgf@sys@svg@anim@trans{animateTransform attributeName="transform" type="skewY"}{}{skewY}}
+\def\pgfsys@svg@animatemotion{\pgf@sys@svg@anim@trans{animateMotion}{%
+ \let\pgfsys@anim@val@base\pgfutil@empty%
+ \let\pgfsys@anim@val@keyPoints\pgfsys@anim@val@values%
+ \let\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@keyTimes\pgfutil@empty%
+ \let\pgfsys@anim@val@keyPoints\pgfutil@empty%
+ \fi%
+ }{}}
+
+% The keys
+\def\pgfsys@animation@whom#1#2{%
+ % Animations must "look forward"...
+ \pgfsys@if@fresh@id{#1}{#2}{}{\pgferror{Animations must precede the to-be-animated objects (``whom'')}}%
+ \pgf@sys@svg@replace{@id}{#1}%
+ \pgf@sys@svg@replace{@type}{#2}%
+ \pgf@sys@svg@replace{xlink:href}{\#\pgfsys@id@ref{#1}{#2}}%
+ \pgf@sys@svg@replace{idref}{\pgfsys@id@ref{#1}{#2}}%
+}
+\def\pgfsys@animation@restart@always{\pgf@sys@svg@replace{restart}{always}}
+\def\pgfsys@animation@restart@never{\pgf@sys@svg@replace{restart}{never}}
+\def\pgfsys@animation@restart@whennotactive{\pgf@sys@svg@replace{restart}{whenNotActive}}
+\def\pgfsys@animation@repeat@indefinite{\pgf@sys@svg@replace{repeatCount}{indefinite}}
+\def\pgfsys@animation@repeat#1{\pgf@sys@svg@replace{repeatCount}{#1}}
+\def\pgfsys@animation@repeat@dur#1{\pgf@sys@svg@replace{repeatDur}{#1}}
+\def\pgfsys@animation@freezeatend{\pgf@sys@svg@replace{fill}{freeze}}
+\def\pgfsys@animation@removeatend{\pgf@sys@svg@replace{fill}{remove}}
+\def\pgfsys@animation@canvas@transform#1#2{\def\pgfsys@anim@val@canvas@trans{{#1}{#2}}}
+\def\pgfsys@animation@offset#1#2{\pgfsys@animation@event{}{}{}{#1}{#2}}
+\def\pgfsys@animation@event#1#2#3#4#5{%
+ \expandafter\edef\csname pgf@sys@event@list@#5\endcsname{\csname pgf@sys@event@list@#5\endcsname{#1}{#2}{#3}{#4}}%
+}%
+\def\pgf@sys@event@list@begin{}
+\def\pgf@sys@event@list@end{}
+\def\pgfsys@animation@syncbegin#1#2#3#4{\pgfsys@animation@event{#1}{#2}{begin}{#3}{#4}}
+\def\pgfsys@animation@syncend#1#2#3#4{\pgfsys@animation@event{#1}{#2}{end}{#3}{#4}}
+\def\pgfsys@animation@repeat@event#1#2#3#4#5{\pgfsys@animation@event{#1}{#2}{repeat(#3)}{#4}{#5}}
+\def\pgfsys@animation@accesskey#1#2#3{\pgfsys@animation@event{}{}{accessKey(#1)}{#2}{#3}}
+%\def\pgfsys@animation@sum{\pgf@sys@svg@replace{additive}{sum}}
+%\def\pgfsys@animation@replace{\pgf@sys@svg@replace{additive}{replace}}
+\def\pgfsys@animation@accumulate{\pgf@sys@svg@replace{accumulate}{sum}}
+\def\pgfsys@animation@noaccumulate{\pgf@sys@svg@replace{accumulate}{}}
+\def\pgfsys@animation@rotatealong{\pgf@sys@svg@replace{rotate}{auto}}
+\def\pgfsys@animation@norotatealong{\pgf@sys@svg@replace{rotate}{}}
+\def\pgfsys@animation@movealong#1{%
+ {%
+ \let\pgf@sys@save@svgpath=\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath=\pgfutil@empty%
+ \pgfsyssoftpath@getcurrentpath\pgf@sys@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@setcurrentpath\pgf@sys@save@path%
+ \global\let\pgf@svg@anim@temp\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath\pgf@sys@save@svgpath%
+ }%
+ \pgf@sys@svg@replace{path}{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@tip@markers#1#2{%
+ \edef\pgf@svg@anim@marker@start{#1}%
+ \edef\pgf@svg@anim@marker@end{#2}%
+}
+\let\pgf@svg@anim@marker@start\pgfutil@empty
+\let\pgf@svg@anim@marker@end\pgfutil@empty
+
+
+
+% Timelines
+\let\pgf@sys@svg@tl@entries\pgfutil@empty
+\let\pgf@sys@svg@tl@start\pgfutil@empty
+\let\pgf@sys@svg@tl@end\pgfutil@empty
+
+
+\def\pgfsys@animation@time#1#2#3#4#5{%
+ \def\pgf@sys@svg@t{#1}%
+ \let\pgf@sys@last@out@spline\pgf@sys@svg@out@spline%
+ \def\pgf@sys@svg@in@spline{{#2}{#3}}%
+ \def\pgf@sys@svg@out@spline{{#4}{#5}}%
+}
+\def\pgfsys@animation@base{%
+ \let\pgf@sys@svg@t\pgf@sys@svg@base@text%
+}
+\def\pgf@sys@svg@base@text{base}
+
+\def\pgf@sys@svg@entry#1{%
+ \ifx\pgf@sys@svg@t\pgf@sys@svg@base@text%
+ % Ah, base. Save!
+ \edef\pgfsys@anim@val@base{#1}%
+ \else%
+ \ifx\pgf@sys@svg@tl@start\pgfutil@empty%
+ % Ah, first.
+ \let\pgf@sys@svg@tl@start\pgf@sys@svg@t%
+ \edef\pgf@sys@svg@tl@entries{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else%
+ \ifx\pgf@sys@last@out@spline\pgfsys@stay@text%
+ \ifx\pgf@sys@svg@in@spline\pgfsys@jump@text%
+ {%
+ \pgf@x\pgf@sys@svg@t pt
+ \pgf@xa\pgf@sys@svg@tl@end pt%
+ \advance\pgf@x by\pgf@xa%
+ \pgf@x.5\pgf@x%
+ \edef\pgf@sys@temp{\pgf@sys@tonumber\pgf@x}
+ \expandafter}\expandafter\def\expandafter\pgf@sys@temp\expandafter{\pgf@sys@temp}%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@temp}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{\pgf@sys@svg@last@value}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@temp}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{\pgf@sys@svg@last@value}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \fi%
+ \else%
+ \ifx\pgf@sys@svg@in@spline\pgfsys@jump@text%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@tl@end}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline{0}{0}{1}{1}%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \else%
+ \edef\pgf@sys@svg@temp{%
+ \noexpand\pgf@sys@svg@add@time{\pgf@sys@svg@t}%
+ \noexpand\pgf@sys@svg@add@spline\pgf@sys@last@out@spline\pgf@sys@svg@in@spline%
+ \noexpand\pgf@sys@svg@add@value{#1}%
+ }%
+ \fi%
+ \fi%
+ \expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\pgf@sys@svg@tl@entries%
+ \expandafter\expandafter\expandafter{\expandafter\pgf@sys@svg@tl@entries\pgf@sys@svg@temp}%
+ \fi%
+ \let\pgf@sys@svg@tl@end\pgf@sys@svg@t%
+ \edef\pgf@sys@svg@last@value{#1}%
+ \fi%
+}
+\newif\ifpgf@sys@svg@do@times
+\def\pgf@sys@svg@tl@eval{%
+ \pgf@xa=0pt%
+ % Overrulings
+ \pgf@sys@svg@do@timestrue%
+ % Ok, we need to compute the time interval
+ \ifx\pgf@sys@svg@tl@end\pgfutil@empty%
+ \else%
+ \ifx\pgf@sys@svg@tl@start\pgfutil@empty\else\pgf@xa=\pgf@sys@svg@tl@start pt\fi%
+ \pgf@xb=\pgf@sys@svg@tl@end pt%
+ \advance\pgf@xb by -\pgf@xa%
+ % Ok, \pgf@xb is now the duration.
+ \ifdim\pgf@xb>0pt\relax%
+ \pgf@sys@svg@replace{dur}{\pgf@sys@tonumber\pgf@xb}%
+ \else%
+ \pgf@sys@svg@replace{dur}{\pgf@sys@svg@indefinitetext}%
+ \fi%
+ % Now, prepare factors
+ \pgf@xc=8192pt%
+ \ifdim\pgf@xb<0.0001pt\relax
+ \pgf@xc=1pt%
+ \pgf@xb=1sp%
+ \else%
+ \divide\pgf@xc by\pgf@xb%
+ \multiply\pgf@xb by\pgf@xc%
+ \divide\pgf@xb by65536%
+ \fi%
+ % Now, run!
+ \pgf@sys@svg@tl@entries%
+ \ifx\pgfsys@anim@val@dur\pgf@sys@svg@indefinitetext%
+ \let\pgfsys@anim@val@from\pgfsys@anim@val@to%
+ \let\pgfsys@anim@val@keyTimes\pgfutil@empty%
+ \let\pgfsys@anim@val@calcMode\pgfutil@empty%
+ \fi%
+ \fi%
+}
+\def\pgf@sys@svg@indefinitetext{indefinite}
+\def\pgf@sys@svg@add@time#1{%
+ \ifpgf@sys@svg@do@times%
+ % Compute fraction:
+ \pgf@yb=#1pt%
+ \advance\pgf@yb by-\pgf@xa%
+ \multiply\pgf@yb by\pgf@xc%
+ \divide\pgf@yb by\pgf@xb%
+ \ifdim\pgf@yb<0pt\pgf@yb=0pt\fi%
+ \ifdim\pgf@yb>1pt\pgf@yb=1pt\fi%
+ \pgf@sys@svg@append{keyTimes}{\pgf@sys@tonumber\pgf@yb}%
+ \fi%
+}
+\def\pgf@sys@svg@add@spline#1#2#3#4{\ifpgf@sys@svg@do@times\pgf@sys@svg@append{keySplines}{#1 #2 #3 #4}\fi}
+\def\pgf@sys@svg@add@value#1{%
+ \ifx\pgfsys@anim@val@values\pgfutil@empty%
+ \ifx\pgfsys@anim@val@to\pgfutil@empty%
+ \pgf@sys@svg@replace{to}{#1}%
+ \else% move
+ \let\pgfsys@anim@val@values\pgfsys@anim@val@to%
+ \let\pgfsys@anim@val@to\pgfutil@empty%
+ \pgf@sys@svg@append{values}{#1}%
+ \fi%
+ \else%
+ \pgf@sys@svg@append{values}{#1}%
+ \fi%
+}
+\def\pgfsys@animation@val@current{\pgf@sys@svg@entry{}}
+\def\pgfsys@animation@val{\pgf@sys@svg@entry{nil}} % will be ignored anyway
+\def\pgfsys@animation@val@text#1{\pgf@sys@svg@entry{#1}}
+\def\pgfsys@animation@val@scalar#1{\pgf@sys@svg@entry{#1}}
+\def\pgfsys@animation@val@dimension#1{%
+ {%
+ \pgf@x=#1\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@color@rgb#1#2#3{\pgf@sys@svg@color@rgb#1,#2,#3\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@cmyk#1#2#3#4{\pgf@sys@svg@color@cmyk#1,#2,#3,#4\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@cmy#1#2#3{\pgf@sys@svg@color@cmy#1,#2,#3\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@color@gray#1{\pgf@sys@svg@color@gray#1\relax\pgf@sys@svg@entry{\pgf@sys@svg@prepared}}
+\def\pgfsys@animation@val@path#1{%
+ {%
+ \let\pgf@sys@save@svgpath=\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath=\pgfutil@empty%
+ \pgfsyssoftpath@getcurrentpath\pgf@sys@save@path%
+ \pgfsyssoftpath@setcurrentpath\pgfutil@empty%
+ #1%
+ \pgfsyssoftpath@invokecurrentpath%
+ \pgfsyssoftpath@setcurrentpath\pgf@sys@save@path%
+ \global\let\pgf@svg@anim@temp\pgf@sys@svgpath%
+ \global\let\pgf@sys@svgpath\pgf@sys@save@svgpath%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@translate#1#2{%
+ {%
+ \pgf@x=#1\relax%
+ \pgf@y=#2\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x,\expandafter\Pgf@geT\the\pgf@y}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@scale#1#2{\pgf@sys@svg@entry{#1,#2}}
+\def\pgfsys@animation@val@viewbox#1#2#3#4{%
+ {%
+ \pgf@x=#1\relax%
+ \pgf@y=#2\relax%
+ \pgf@xa=#3\relax%
+ \pgf@ya=#4\relax%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x\space\expandafter\Pgf@geT\the\pgf@y\space\expandafter\Pgf@geT\the\pgf@xa\space\expandafter\Pgf@geT\the\pgf@ya}%
+ }%
+ \pgf@sys@svg@entry{\pgf@svg@anim@temp}%
+}
+\def\pgfsys@animation@val@dash#1#2{%
+ \edef\pgf@test@dashpattern{#1}%
+ \let\pgf@sys@svg@parsed@dash\pgfutil@empty%
+ \ifx\pgf@test@dashpattern\pgfutil@empty%
+ \else%
+ \expandafter\pgf@sys@svg@parse@dash\pgf@test@dashpattern,\relax%
+ \fi%
+ {%
+ \pgf@x=#2\relax%
+ \xdef\pgf@svg@anim@temp{\expandafter\Pgf@geT\the\pgf@x}%
+ }%
+ \pgf@sys@svg@entry{{\pgf@sys@svg@parsed@dash}{\pgf@svg@anim@temp}}%
+}
+
+
+
+\def\pgf@svg@anim@prep@dash#1#2#3{%
+ \let\pgf@svg@anim@dash@array\pgfutil@empty%
+ \let\pgf@svg@anim@dash@offset\pgfutil@empty%
+ % #1 = \pgfsys@anim@val@from or \pgfsys@anim@val@to or \pgfsys@anim@val@values
+ \ifx#1\pgfutil@empty%
+ \else%
+ \expandafter\pgf@svg@anim@prep@dash@parse#1\pgf@stop%
+ \fi%
+ \let#2\pgf@svg@anim@dash@array%
+ \let#3\pgf@svg@anim@dash@offset%
+}
+
+\def\pgf@svg@anim@prep@dash@parse#1#2{%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@array\expandafter{\pgf@svg@anim@dash@array#1}%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@offset\expandafter{\pgf@svg@anim@dash@offset#2}%
+ \pgfutil@ifnextchar;{%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@array\expandafter{\pgf@svg@anim@dash@array;}%
+ \expandafter\def\expandafter\pgf@svg@anim@dash@offset\expandafter{\pgf@svg@anim@dash@offset;}%
+ \expandafter\pgf@svg@anim@prep@dash@parse\pgfutil@gobble%
+ }{%
+ \pgfutil@gobble% done, gobble \pgf@stop
+ }%
+}
+
%
-% Opacity masks
+% Markers
%
-% \def\pgfsys@fadingfrombox#1#2{%
-% \setbox#2=\hbox{%
-% \pgfsys@invoke{<mask id="pgfmask#1">}%
-% \box#2%
-% \pgfsys@invoke{</mask>}%
-% }%
-% \wd#2=0pt%
-% \ht#2=0pt%
-% \dp#2=0pt%
-% \unskip\box#2%
-% }
-% \def\pgfsys@usefading#1#2#3#4#5#6#7{%
-% \pgf@sys@svg@gs@color{mask="url(\#pgfmask#1)"}%
-% }
+
+\def\pgfsys@marker@declare@{%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+ \pgfsys@beginscope@{ id="pgfs\the\pgf@sys@id@count"}%
+ \pgfsysprotocol@literal{\csname pgf@sys@marker@prot@\the\pgf@sys@id@count\endcsname}%
+ \pgfsys@endscope%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
+ \pgf@sys@svg@make@defs{pgfs\the\pgf@sys@id@count}{\pgfsys@temp}%
+}
+
+\def\pgfsys@marker@use#1{%
+ \pgf@sys@svg@ref@defs{pgfs#1}%
+ \pgfsysprotocol@literal{<use xlink:href="\#pgfs#1"/>}%
+}
+
+\def\pgfsys@marker@at@begin@usedpath#1{\def\pgf@sys@svg@marker@begin{#1}\let\pgf@sys@svg@marker@begin@use\pgfutil@empty}
+\def\pgfsys@marker@at@end@usedpath#1{\def\pgf@sys@svg@marker@end{#1}\let\pgf@sys@svg@marker@begin@use\pgfutil@empty}
+
+\let\pgf@sys@svg@marker@begin\relax
+\let\pgf@sys@svg@marker@end\relax
+
+\let\pgf@sys@svg@marker@begin@use\pgfutil@empty
+\let\pgf@sys@svg@marker@end@use\pgfutil@empty
+
+\def\pgf@sys@svg@prep@marker#1#2#3#4#5{%
+ \pgf@sys@svg@ref@defs{pgfs#1}%
+ \global\advance\pgf@sys@svg@objectcount by1\relax%
+ \edef\pgf@sys@svg@marker@id{pgf\the\pgf@sys@svg@objectcount}%
+ \pgfsysprotocol@literal{<marker id="\pgf@sys@svg@marker@id" markerUnits="userSpaceOnUse" orient="auto" overflow="visible">
+ <use xlink:href="\#pgfs#1"#2/> </marker>\pgfsys@svg@newline}%
+ \edef#3{marker-#4="url(\#\pgf@sys@svg@marker@id)" }%
+}
+
+
+%
+% RDF
+%
+
+\def\pgf@svg@rdf@init{%
+ \ifx\pgfsys@svg@rdf\pgfutil@empty%
+ % Ok, first, so init
+ \global\let\pgf@svg@rdf@vocab\relax%
+ \global\let\pgf@svg@rdf@about\relax%
+ \global\let\pgf@svg@rdf@content\relax%
+ \global\let\pgf@svg@rdf@datatype\relax%
+ \global\let\pgf@svg@rdf@href\relax%
+ \global\let\pgf@svg@rdf@inlist\relax%
+ \global\let\pgf@svg@rdf@prefix\relax%
+ \global\let\pgf@svg@rdf@property\relax%
+ \global\let\pgf@svg@rdf@rel\relax%
+ \global\let\pgf@svg@rdf@resource\relax%
+ \global\let\pgf@svg@rdf@rev\relax%
+ \global\let\pgf@svg@rdf@src\relax%
+ \global\let\pgf@svg@rdf@typeof\relax%
+ \global\let\pgfsys@svg@rdf\pgfsys@svg@rdf@initial%
+ \fi%
+}
+\def\pgfsys@svg@rdf@initial{%
+ \ifx\pgf@svg@rdf@vocab\relax\else\space vocab="\pgf@svg@rdf@vocab"\fi%
+ \ifx\pgf@svg@rdf@about\relax\else\space about="\pgf@svg@rdf@about"\fi%
+ \ifx\pgf@svg@rdf@datatype\relax\else\space datatype="\pgf@svg@rdf@datatype"\fi%
+ \ifx\pgf@svg@rdf@href\relax\else\space href="\pgf@svg@rdf@href"\fi%
+ \ifx\pgf@svg@rdf@inlist\relax\else\space inlist="\pgf@svg@rdf@inlist"\fi%
+ \ifx\pgf@svg@rdf@prefix\relax\else\space prefix="\pgf@svg@rdf@prefix"\fi%
+ \ifx\pgf@svg@rdf@property\relax\else\space property="\pgf@svg@rdf@property"\fi%
+ \ifx\pgf@svg@rdf@rel\relax\else\space rel="\pgf@svg@rdf@rel"\fi%
+ \ifx\pgf@svg@rdf@resource\relax\else\space resource="\pgf@svg@rdf@resource"\fi%
+ \ifx\pgf@svg@rdf@rev\relax\else\space rev="\pgf@svg@rdf@rev"\fi%
+ \ifx\pgf@svg@rdf@src\relax\else\space src="\pgf@svg@rdf@src"\fi%
+ \ifx\pgf@svg@rdf@typeof\relax\else\space typeof="\pgf@svg@rdf@typeof"\fi%
+ \ifx\pgf@svg@rdf@content\relax\else\space content="\pgf@svg@rdf@content"\fi%
+}
+
+\def\pgfsys@rdf@about#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@about{#1}}
+\def\pgfsys@rdf@content#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@content{#1}}
+\def\pgfsys@rdf@datatype#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@datatype{#1}}
+\def\pgfsys@rdf@href#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@href{#1}}
+\def\pgfsys@rdf@inlist{\pgf@svg@rdf@init\let\pgf@svg@rdf@inlist\pgfutil@empty}
+\def\pgfsys@rdf@prefix#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@prefix\relax%
+ \gdef\pgf@svg@rdf@prefix{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@prefix\expandafter{\pgf@svg@rdf@prefix\space#1}%
+ \fi}
+\def\pgfsys@rdf@property#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@property\relax%
+ \gdef\pgf@svg@rdf@property{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@property\expandafter{\pgf@svg@rdf@property\space#1}%
+ \fi}
+\def\pgfsys@rdf@rel#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@rel\relax%
+ \gdef\pgf@svg@rdf@rel{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@rel\expandafter{\pgf@svg@rdf@rel\space#1}%
+ \fi}
+\def\pgfsys@rdf@rev#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@rev\relax%
+ \gdef\pgf@svg@rdf@rev{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@rev\expandafter{\pgf@svg@rdf@rev\space#1}%
+ \fi}
+\def\pgfsys@rdf@typeof#1{\pgf@svg@rdf@init%
+ \ifx\pgf@svg@rdf@typeof\relax%
+ \gdef\pgf@svg@rdf@typeof{#1}
+ \else%
+ \expandafter\gdef\expandafter\pgf@svg@rdf@typeof\expandafter{\pgf@svg@rdf@typeof\space#1}%
+ \fi}
+\def\pgfsys@rdf@resource#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@resource{#1}}
+\def\pgfsys@rdf@src#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@src{#1}}
+\def\pgfsys@rdf@vocab#1{\pgf@svg@rdf@init\gdef\pgf@svg@rdf@vocab{#1}}
+
+
+
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def
index 05f647fc796..20ba5f0fdc7 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvi.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvi.def,v 1.5 2007/06/07 07:41:11 tantau Exp $
+\ProvidesFileRCS{pgfsys-dvi.def}
% Driver commands for pure, ultra-portable dvi, in the tradition of
% old-style LaTeX pictures.
@@ -164,10 +164,12 @@
% Text:
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\pgf@sys@dvi@put{\pgf@sys@dvi@pt@x}{\pgf@sys@dvi@pt@y}{\box#1}%
+ \pgfsys@end@idscope%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
index 54cd937a591..cb545f2b66f 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfm.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfm.def,v 1.22 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvipdfm.def}
% Driver commands for dvipdfm
@@ -21,6 +21,62 @@
% dvipdfm-specific stuff:
%
+\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
+ \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
+ \pgfsys@invoke{0 Tr}%
+ \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \box#1
+ \pgfsys@invoke{n Q Q}%
+ \pgfsys@end@idscope%
+}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \pgfsys@begin@idscope%
+ \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
+ \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
+ \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%
+ \pgfsys@end@idscope%
+ }%
+}
+
+\def\pgfsys@beginpicture{%
+ \pgfsys@invoke{3 Tr}%
+ \hbox to 0pt{\pgfutil@font@normalfont\pgfutil@selectfont.\hss}% enforce font change
+ \pgfsys@invoke{0 Tr}%
+ \special{pdf: content q}}
+\def\pgfsys@endpicture{%
+ \pgfsys@invoke{n Q}%
+}
+
\def\pgfsys@invoke#1{\special{pdf: content Q #1 q}} % ugly, but necessary...
\def\pgfsys@papersize#1#2{%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
index cf1d5b9fe1e..beadfff3bf1 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvipdfmx.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvipdfmx.def,v 1.14 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvipdfmx.def}
% Driver commands for dvipdfmx
%
@@ -64,6 +64,7 @@
}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -76,11 +77,13 @@
\pgfsys@dvipdfmx@stop@force@reset@color%
\pgfsys@dvipdfmx@unsuspendcontent%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% We cannot use many codes in pgfsys-common-pdf-via-dvi.def.
% So it is rewritten here (with some bugs fixed).
\def\pgfsys@hboxsynced#1{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -98,6 +101,7 @@
\pgfsys@dvipdfmx@stop@force@reset@color%
\pgfsys@dvipdfmx@unsuspendcontent%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% All text materials between `pdf:bcontent' and `pdf:econtent' are
@@ -469,11 +473,9 @@
%
% Position tracking (needs pdftex >= 1.40.0-alpha-20051205 in dvi mode)
%
-\ifx\pdftexversion\@undefined
+\ifx\pdfsavepos\@undefined
\else
- \ifnum\pdftexversion>139
- \pgf@sys@pdf@dvi@tracker
- \fi
+ \pgf@sys@pdf@dvi@tracker
\fi
\def\pgfsys@papersize#1#2{%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
index c3a2b6200f8..b349b07e2f3 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvips.def
@@ -7,11 +7,11 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvips.def,v 1.25 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-dvips.def}
% Driver commands for dvips
-\def\pgfsys@invoke#1{\special{ps:: #1}}
+\def\pgfsys@invoke#1{\special{ps\ifpgfsys@ps@boxmode\else:\fi: #1}}
\def\pgfsys@outerinvoke#1{\special{ps: #1}}
\def\pgf@sys@postscript@header#1{\pgfutil@insertatbegincurrentpage{\special{! #1}}}
\def\pgf@sys@postscript@object#1{\special{! #1}}
@@ -27,9 +27,10 @@
% dvips-specific stuff:
%
-\def\pgfsys@beginpicture{\special{ps: }\special{ps::[begin]}\pgfsys@invoke{pgfo}}
+\def\pgfsys@beginpicture{\pgfsys@ps@boxmodefalse\special{ps: }\special{ps::[begin]}\pgfsys@invoke{pgfo}}
\def\pgfsys@endpicture{\pgfsys@invoke{pgfc}\special{ps::[end]}}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@invoke{pgfs}%
\special{ps::[end]}%
\wd#1=0pt%
@@ -38,6 +39,7 @@
\box#1
\special{ps::[begin]}%
\pgfsys@invoke{pgfr}%
+ \pgfsys@end@idscope%
}
\def\pgfsys@begininvisible{%
\special{ps::[begin]}%
@@ -96,17 +98,30 @@
%
-% Position tracking (needs pdftex >= 1.40 in dvi mode)
+% Position tracking (needs pdftex or luatex in dvi mode)
%
-\ifx\pdftexversion\@undefined
+\ifx\savepos\@undefined
+ \ifx\pdfsavepos\@undefined
+ \else
+ \let\pgf@savepos\pdfsavepos
+ \let\pgf@lastxpos\pdflastxpos
+ \let\pgf@lastypos\pdflastypos
+ \fi
+\else
+ \let\pgf@savepos\savepos
+ \let\pgf@lastxpos\lastxpos
+ \let\pgf@lastypos\lastypos
+\fi
+
+
+\ifx\pgf@savepos\@undefined
\else
- \ifnum\pdftexversion>139
\def\pgfsys@markposition#1{%
- \pdfsavepos%
+ \pgf@savepos%
\edef\pgf@temp{#1}%
\expandafter\pgfutil@writetoaux\expandafter{%
- \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pdflastxpos}{\the\pdflastypos}}%
+ \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pgf@lastxpos}{\the\pgf@lastypos}}%
}
\def\pgfsyspdfmark#1#2#3{%
@@ -121,7 +136,6 @@
\def\pgf@sys@pdf@mark@pos@pgfpageorigin{\pgfpointorigin}
- \fi
\fi
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
index 6225c5abc21..3acef85b177 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-dvisvgm.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-dvisvgm.def,v 1.3 2013/08/23 09:50:22 tantau Exp $
+\ProvidesFileRCS{pgfsys-dvisvgm.def}
% Driver commands for dvisvgm
@@ -17,12 +17,23 @@
%
\input pgfsys-common-svg.def
+\newif\ifpgf@sys@svg@inpicture
+
+\def\pgf@sys@svg@make@defs#1#2{{\let\#\pgf@sys@svg@hash\special{dvisvgm:rawset #1}\special{dvisvgm:rawdef #2}\special{dvisvgm:endrawset}}}
+\def\pgf@sys@svg@ref@defs#1{\special{dvisvgm:rawput #1}}
\def\pgfsys@invoke#1{{\let\#\pgf@sys@svg@hash\special{dvisvgm:raw #1}}}
-\def\pgfsys@beginpicture{\pgfsys@invoke{<g transform="translate({?x},{?y}) scale(1,-1)">}}
-\def\pgfsys@endpicture{\pgfsys@invoke{</g>}}
+\def\pgfsys@beginpicture{%
+ \special{color push gray 0}% make dvisvgm *not* add anything to text
+ \pgf@sys@svg@inpicturetrue% in a picture
+ \pgfsys@svg@boxmodefalse%
+ \pgfsys@invoke{<g \ifx\pgf@sys@svg@last@stroke\relax\else
+ stroke="\pgf@sys@svg@last@stroke" \fi stroke-miterlimit="10" transform="translate({?x},{?y})scale(0.996264,-0.996264)">}}
+\def\pgfsys@endpicture{\pgfsys@invoke{</g>}\special{color pop}}
\def\pgfsys@svg@newline{{?nl}}
+\let\pgf@sys@svg@last@stroke\relax%
+
\def\pgfsys@hbox#1{%
{%
@@ -30,11 +41,28 @@
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
- \pgfsetcolor{.}%
- \pgfsys@invoke{<g stroke="none" transform="scale(-1,1) translate({?x},{?y}) scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@begin@idscope%
+ \pgfsys@invoke{<g stroke="none" transform="scale(-1.00375,1.00375)translate({?x},{?y})scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@end@idscope%
}%
}
+\def\pgfsys@hboxsynced#1{%
+ {%
+ \setbox#1=\hbox{\box#1}%
+ \wd#1=0pt%
+ \ht#1=0pt%
+ \dp#1=0pt%
+ \pgfsys@begin@idscope%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@invoke{<g stroke="none" transform="scale(-1.00375,1.00375)translate({?x},{?y})scale(-1,-1)">}\box#1\pgfsys@invoke{</g>}%
+ \pgfsys@endscope%
+ \pgfsys@end@idscope%
+ }%
+}
+
+
\def\pgfsys@shadingoutsidepgfpicture#1{%
\begingroup%
#1%
@@ -70,6 +98,117 @@
\pgfsysprotocol@literal{</g>}%
}
+
+
+\def\pgfsys@papersize#1#2{%
+ {%
+ \pgf@x#1\relax%
+ \pgf@y#2\relax%
+ \pgf@xa-1in\relax%
+ \special{dvisvgm:bbox fix \pgf@sys@tonumber\pgf@xa\space \pgf@sys@tonumber\pgf@xa\space \pgf@sys@tonumber\pgf@x\space \pgf@sys@tonumber\pgf@y}%
+ }%
+}
+\def\pgfsys@prepare@papersize#1#2{%
+ \expandafter\gdef\expandafter\pgfsys@atbegindocument\expandafter{\pgfsys@atbegindocument\pgfsys@papersize{#1}{#2}}%
+}
+
+
+
+\def\pgfsys@typesetpicturebox#1{%
+ \pgf@ya=\pgf@shift@baseline\relax%
+ \advance\pgf@ya by-\pgf@picminy\relax%
+ %
+ %
+ \advance\pgf@picmaxy by-\pgf@picminy\relax% maxy is now the height
+ \advance\pgf@picmaxx by-\pgf@picminx\relax% maxx is now the width
+ \setbox#1=\hbox{\hskip-\pgf@picminx\lower\pgf@picminy\box#1}%
+ \ht#1=\pgf@picmaxy%
+ \wd#1=\pgf@picmaxx%
+ \dp#1=0pt%
+ \leavevmode%
+ \pgf@xa=\pgf@trimleft@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
+ \raise-\pgf@ya\hbox{\ifpgf@sys@svg@inpicture\else\special{dvisvgm:bbox \pgf@sys@tonumber\pgf@picmaxx\space\pgf@sys@tonumber\pgf@picmaxy}\fi\box#1}%
+ \pgf@xa=\pgf@trimright@final\relax \ifdim\pgf@xa=0pt \else\kern\pgf@xa\fi%
+}
+
+
+
+\def\pgfsys@text@to@black@hook{%
+ \let\pgfsys@svg@set@color@orig\set@color%
+ \let\pgfsys@svg@reset@color@orig\reset@color%
+ \def\set@color{\special{dvisvgm:raw <g fill="black">}\pgfsys@svg@set@color@orig}%
+ \def\reset@color{\special{dvisvgm:raw </g>}\pgfsys@svg@reset@color@orig}%
+}
+
+
+
+% Fadings
+
+% FIXME: Correct sizes!
+
+%
+% Opacity masks
+%
+% \def\pgfsys@fadingfrombox#1#2{%
+% \setbox#2=\hbox{%
+% \pgfsys@invoke{<mask id="pgfmask#1">}%
+% \box#2%
+% \pgfsys@invoke{</mask>}%
+% }%
+% \wd#2=0pt%
+% \ht#2=0pt%
+% \dp#2=0pt%
+% \unskip\box#2%
+% }
+% \def\pgfsys@usefading#1#2#3#4#5#6#7{%
+% \pgf@sys@svg@gs@color{mask="url(\#pgfmask#1)"}%
+% }
+
+
+
+
+%
+% Position tracking (needs pdftex or luatex in dvi mode)
+%
+\ifx\savepos\@undefined
+ \ifx\pdfsavepos\@undefined
+ \else
+ \let\pgf@savepos\pdfsavepos
+ \let\pgf@lastxpos\pdflastxpos
+ \let\pgf@lastypos\pdflastypos
+ \fi
+\else
+ \let\pgf@savepos\savepos
+ \let\pgf@lastxpos\lastxpos
+ \let\pgf@lastypos\lastypos
+\fi
+
+
+\ifx\pgf@savepos\@undefined
+\else
+
+\def\pgfsys@markposition#1{%
+ \pgf@savepos%
+ \edef\pgf@temp{#1}%
+ \expandafter\pgfutil@writetoaux\expandafter{%
+ \expandafter\noexpand\expandafter\pgfsyspdfmark\expandafter{\pgf@temp}{\the\pgf@lastxpos}{\the\pgf@lastypos}}%
+}
+
+\def\pgfsyspdfmark#1#2#3{%
+ \expandafter\gdef\csname pgf@sys@pdf@mark@pos@#1\endcsname{\pgfqpoint{#2sp}{#3sp}}%
+ \pgfutil@check@rerun{#1}{{#2}{#3}}%
+}
+
+\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}
+
+\fi
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
index e01c0007da8..24fad51a342 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-luatex.def
@@ -1,12 +1,5 @@
% Copyright 2006 by Till Tantau
%
-% pgfsys-luatex.def
-% converted from pgfsys-pdftex.def by replacing disappeared primitives/vars
-% with their respective replacements, as laid out in the luatex manual.
-% Conversion by Norbert Preining
-%
-% Included into the TeX Live pgf package with agreement of Till Tantau.
-%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
@@ -14,8 +7,13 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-luatex.def,v 1.35 2014/10/11 09:23:31 vibrovski Exp $
+\ProvidesFileRCS{pgfsys-luatex.def}
+\ifnum\luatexversion<95
+ \immediate\write-1{luatex driver of PGF: detected lua version \the\luatexversion; falling back to old pdftex driver^^J}%
+ \input pgfsys-pdftex.def
+ \expandafter\endinput
+\fi
% Driver commands for pdf
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 0cc939675f6..f6498264735 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-pdftex.def,v 1.35 2014/10/11 09:23:31 vibrovski Exp $
+\ProvidesFileRCS{pgfsys-pdftex.def}
% Driver commands for pdf
@@ -25,6 +25,7 @@
% Synced hboxes
\def\pgfsys@hboxsynced#1{%
{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox\pgf@hbox=\hbox{%
\hskip\pgf@pt@x%
@@ -40,6 +41,7 @@
\dp\pgf@hbox=0pt%
\box\pgf@hbox%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}%
}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
index cc5dadb1173..751ab7e6fa7 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-tex4ht.def,v 1.25 2013/08/06 17:46:08 tantau Exp $
+\ProvidesFileRCS{pgfsys-tex4ht.def}
@@ -86,12 +86,13 @@
% class="}{\%s}{-\%s}{x-x-\%d}{}{">}{</span>}
%}
-\def\pgfsys@svg@newline{\Hnewline}
+\def\pgfsys@svg@newline{^^J}
% we don't want tex4ht putting <p> and </p> tags automatically in our svg code and causing invalid xhtml in our svg pictures
\newif\ifpgfsys@CssIncluded@\pgfsys@CssIncluded@false
\def\pgfsys@beginpicture{%
- \EndP\HtmlParOff
+ \pgfsys@svg@boxmodefalse%
+ \EndP\HtmlParOff%
\pgfkeys{/pgf/tex4ht node/escape=false}%
% text only nodes are the default. Advantage : pure svg pictures are
% the default, nicer for text only nodes.
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def
index 0645fb8c51f..033d949baac 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-textures.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-textures.def,v 1.6 2011/05/13 10:16:37 tantau Exp $
+\ProvidesFileRCS{pgfsys-textures.def}
% Driver commands for textures driver
@@ -36,12 +36,14 @@
\special{rawpostscript pgfbeginpicture}}
\def\pgfsys@endpicture{\special{rawpostscript restore}}
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@invoke{save pgfbeginhbox}%
\wd#1=0pt%
\ht#1=0pt%
\dp#1=0pt%
\box#1%
\pgfsys@invoke{restore}%
+ \pgfsys@end@idscope%
}
\def\pgfsys@begininvisible{%
\special{rawpostscript gsave nulldevice}%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
index 5014f48beba..e5e9b1d5df9 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-vtex.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-vtex.def,v 1.10 2013/07/15 12:05:34 tantau Exp $
+\ProvidesFileRCS{pgfsys-vtex.def}
% Driver commands for vtex
@@ -15,8 +15,8 @@
% Invoking things:
\def\pgfsys@invoke#1{\special{pS: grestore #1 gsave}} % to protect against things happeing in between
\def\pgfsys@outerinvoke#1{\special{pS: #1}}
-\def\pgf@sys@postscript@header#1{\special{pS: #1}}
-\def\pgf@sys@postscript@object#1{\special{pS: #1}}
+\def\pgf@sys@postscript@header#1{\immediate\special{pS: #1}}
+\def\pgf@sys@postscript@object#1{\immediate\special{pS: #1}}
%
@@ -81,7 +81,7 @@
\AtBeginDocument{
% Always present specials.
- \special{pS:
+ \immediate\special{pS:
/pgfsc{} bind def% stroke color is empty by default
/pgffc{} bind def% fill color is empty by default
/pgfstr{stroke} bind def%
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
index e23e48c2f57..a4a49c1faab 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-xetex.def
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-xetex.def,v 1.11 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesFileRCS{pgfsys-xetex.def}
\input pgfsys-dvipdfmx.def
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
index e33a132c29b..393a7860608 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.48 2014/07/09 14:01:22 cfeuersaenger Exp $
+\ProvidesPackageRCS{pgfsys.code.tex}
% Load key mechanism
@@ -17,7 +17,7 @@
\pgfkeys{/pgf/.is family}
\def\pgfset{\pgfqkeys{/pgf}}
-% This is if is needed *very* early
+% This if is needed *very* early
\newif\ifpgfpicture
@@ -93,12 +93,6 @@
-% The following \if decides, whether even-odd filling and clipping is
-% to be used or normal the non-zero winding number rule. See the
-% pdf-documentation for details on what these rules are.
-
-\newif\ifpgfsys@eorule
-
% In the following dummy definitions of the pgf system commands are
@@ -128,6 +122,10 @@
+%
+% Invocation commands
+%
+
\def\pgfsys@invoke{\pgf@sys@fail{invoking specials}}
% This command is used whenever some literal text needs to be inserted
% into the resulting .pdf, .ps, or .dvi file. Note that most
@@ -141,7 +139,6 @@
% been called previously and when the picture has not been suspended
% using \pgfsys@beginhbox.
-
\def\pgfsys@outerinvoke{\pgfsys@invoke}
% This command can be used to insert protocolled graphic commands
% outside any picture. This is extremely dangerous, but sometimes
@@ -319,6 +316,14 @@
% should subsequently be used for clipping. See \pgfsys@clipnext for
% details.
+\def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke}
+% This command should have the same effect as first closing the path
+% and then stroking it.
+
+\newif\ifpgfsys@eorule
+% Decides, whether even-odd filling and clipping is
+% to be used or normal the non-zero winding number rule. See the
+% pdf-documentation for details on what these rules are.
@@ -329,7 +334,8 @@
%
%
\def\pgfsys@setlinewidth#1{\pgf@sys@fail{setting the line width}}
-% Sets the width of lines, when stroked, to #1.
+% Sets the width of lines, when stroked, to #1, which must be a TeX
+% dimension (as text).
\def\pgfsys@buttcap{\pgf@sys@fail{setting the line cap}}
% Sets the cap to a butt cap. See \pgfsys@stroke.
@@ -355,19 +361,19 @@
\def\pgfsys@setdash#1#2{\pgf@sys@fail{setting the dashing pattern}}
% Sets the dashing patter. #1 should be a list of lengths separated by
-% spaces. #2 should be a single dimension.
+% commas. #2 should be a single dimension.
%
% The list of values in #1 is used to determine the lengths of the
% `on' phases of the dashing and of the `off' phases. For example, if
-% #1 is `3pt 4pt', then the dashing pattern is `3pt on followed by 4pt
+% #1 is `3pt,4pt', then the dashing pattern is `3pt on followed by 4pt
% off, followed by 3pt on, followed by 4pt off, and so on'. A pattern
-% of `.5pt 4pt 3pt 1.5pt' means `.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on,
+% of `.5pt,4pt,3pt,1.5pt' means `.5pt on, 4pt off, 3pt on, 1.5pt off, .5pt on,
% ...'. If the number of entries is odd, the last one is used twice,
% so `3pt' means `3pt on, 3pt off, 3pt on, 3pt off,...'. An empty list
% means `always on'.
%
% The second argument determines the `phase' of the pattern. For
-% example, for a pattern of `3pt 4pt' and a phase of `1pt', the pattern
+% example, for a pattern of `3pt,4pt' and a phase of `1pt', the pattern
% would start: `2pt on, 4pt off, 3pt on, 4pt off, 3pt on, 4pt off...'.
@@ -456,6 +462,11 @@
% tricked. When called, this command should set the current color to
% #1 without causing any change in the color stack.
+\def\pgfsys@text@to@black@hook{}
+% Another slightly obscure command that allows tikz to hack into
+% dvisvgm's color management inside text nodes. The problem is that
+% the color "black" is special for dvisvgm.
+
%
@@ -470,6 +481,66 @@
% transformation matrix is a transformation on a homogeneous
% 2D-coordinate system. See the pdf or postscript manual for details.
+\def\pgfsys@transformshift#1#2{\pgfsys@transformcm{1}{0}{0}{1}{#1}{#2}}
+% This command will change the origin of the low-level coordinate
+% system to (#1,#2).
+
+\def\pgfsys@transformxyscale#1#2{\pgfsys@transformcm{#1}{0}{0}{#2}{0bp}{0bp}}
+% This command will scale the low-level coordinate system (and
+% everything that is drawn) by a factor of #1 in x-directed and #2 in
+% y-direction. Note that this applies to everything, including
+% lines. So a scaled line will have a different width and may even
+% have a different width when going along the x-axis and when going
+% along the y-axis, if the scaling is different in these directions.
+
+\def\pgfsys@viewboxmeet#1#2#3#4#5#6#7#8{\pgfsys@beginscope\pgf@sys@default@viewbox@impl{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{<}}
+% Consider the two rectangles R with lower left corner
+% (#5,#6) and upper right (#7,#8) and S with lower left corner
+% (#1,#2) and upper right (#3,#4). Now, consider the transformation
+% that scales and translates R so that the result T has the same
+% center as S and has maximal size while still being inside S. This
+% transformation gets installed in a new graphics group, which must be
+% ended with a corresponding \pgfsys@endviewbox.
+
+\def\pgfsys@viewboxslice#1#2#3#4#5#6#7#8{\pgfsys@beginscope\pgf@sys@default@viewbox@impl{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}{>}}
+% Works like \pgfsys@viewboxmeet, but R3 will have minimal size so
+% that in contains all of R2.
+
+\def\pgfsys@endviewbox{\pgfsys@endscope}
+% Ends a viewbox scope started by either of the previous two commands.
+
+
+\def\pgf@sys@default@viewbox@impl#1#2#3#4#5#6#7#8#9{{%
+ \pgf@x#1%
+ \pgf@y#2%
+ \pgf@xa#3%
+ \pgf@ya#4%
+ \advance\pgf@xa by-\pgf@x%
+ \advance\pgf@ya by-\pgf@y%
+ \pgfmathdivide@\pgf@xa\pgf@ya%
+ \let\aspectr\pgfmathresult%
+ \pgf@xb#5%
+ \pgf@yb#6%
+ \pgf@xc#7%
+ \pgf@yc#8%
+ \advance\pgf@xc by-\pgf@xb%
+ \advance\pgf@yc by-\pgf@yb%
+ \pgfmathdivide@\pgf@xc\pgf@yc%
+ \let\aspects\pgfmathresult%
+ \ifdim\aspectr pt#9\aspects pt%
+ \pgfmathdivide@\pgf@xa\pgf@xc%
+ \else%
+ \pgfmathdivide@\pgf@ya\pgf@yc%
+ \fi%
+ \advance\pgf@x by.5\pgf@xa%
+ \advance\pgf@xb by.5\pgf@xc%
+ \advance\pgf@y by.5\pgf@ya%
+ \advance\pgf@yb by.5\pgf@yc%
+ \pgfsys@transformcm{\pgfmathresult}{0}{0}{\pgfmathresult}{\pgf@x}{\pgf@y}%
+ \pgfsys@transformcm{1}{0}{0}{1}{-\pgf@xb}{-\pgf@yb}%
+ }%
+}
+
@@ -494,6 +565,218 @@
\def\pgfsys@endscope{\pgf@sys@fail{scoping}}
% Restores the last saved graphic state.
+\def\pgfsys@begin@idscope{%
+ \begingroup%
+ \edef\pgf@sys@cacheref{\pgfsys@id@refcurrent}%
+ \expandafter\let\expandafter\pgfsys@beg@save\csname pgf@sys@att@beg@\pgf@sys@cacheref\endcsname%
+ \expandafter\let\expandafter\pgfsys@end@save\csname pgf@sys@att@end@\pgf@sys@cacheref\endcsname%
+ \ifx\pgfsys@beg@save\relax%
+ \ifx\pgfsys@end@save\relax%
+ \else%
+ \pgfsys@call@save%
+ \fi%
+ \else%
+ \pgfsys@call@save%
+ \fi%
+ \pgfsys@invalidate@currentid%
+ \begingroup%
+}
+% Starts an "id scope" where the current value of \pgfsys@use@id and
+% \pgfsys@use@type is used. If the combination has been used before,
+% nothing happens. Otherwise, depending of the driver, a graphic
+% scope may or may not be created. To ensure that a graphic scope is
+% created, use \pgfsys@beginscope additionally.
+
+\def\pgfsys@call@save{%
+ \pgfsys@beginscope%
+ \pgfsys@beg@save%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@beg@\pgfsys@id@refcurrent\endcsname\relax%
+ \expandafter\global\expandafter\let\csname pgf@sys@att@end@\pgfsys@id@refcurrent\endcsname\relax%
+}
+
+\def\pgfsys@end@idscope{
+ \endgroup%
+ \ifx\pgfsys@beg@save\relax%
+ \ifx\pgfsys@end@save\relax%
+ \else%
+ \pgfsys@call@end%
+ \fi%
+ \else%
+ \pgfsys@call@end%
+ \fi%
+ \endgroup
+}
+% Ends an id scope.
+
+\def\pgfsys@call@end{%
+ \pgfsys@end@save%
+ \pgfsys@endscope%
+}
+
+
+\def\pgfsys@begin@text{}
+% Inside a text box you should not use graphics command. However, TikZ
+% needs to insert some color commands at the beginnings of text
+% boxes. For most drivers, this is not a problem; except for SVG,
+% where every change of the graphics state opens a scope and needs a
+% closing scope. This command should be used at the beginning of text
+% boxes containing such color commands and the matching
+% \pgfsys@end@text at the end. If the box does not contain commands
+% that change the graphics state, this command is not needed.
+
+\def\pgfsys@end@text{}
+% Closes a \pgfsys@begin@text.
+
+
+
+%
+%
+% Id management (all of these commands have a default implementation
+% any typically need not be redefined by a driver)
+%
+%
+
+% The id count
+\newcount\pgf@sys@id@count
+
+\def\pgfsys@new@id#1{%
+ \edef#1{pgf\the\pgf@sys@id@count}%
+ \global\advance\pgf@sys@id@count by1\relax%
+}
+% Creates a new id and stores it in the macro #1.
+
+\def\pgfsys@use@id#1{%
+ \edef\pgf@sys@id@current@id{#1}%
+ \let\pgfsys@current@type\pgfutil@empty%
+}
+\let\pgf@sys@id@current@id\pgfutil@empty
+% Sets the id to be used for the next graphic object (group, box, or
+% path). The type is reset to be empty. #1 must be a macro name that
+% has previously been set using \pgfsys@new@id.
+%
+% Each combination of id and type can be used only once, on a second
+% use nothing happens.
+
+\def\pgfsys@clear@id{%
+ \let\pgf@sys@id@current@id\pgfutil@empty%
+}
+% Clears the current id, so nothing can be referenced.
+
+\def\pgfsys@use@type#1{%
+ \edef\pgfsys@current@type{#1}%
+ \pgfsys@register@type\pgfsys@current@type%
+}
+\let\pgfsys@current@type\pgfutil@empty
+% Sets the type to be used for the next graphic object.
+
+\def\pgfsys@append@type#1{%
+ \ifx\pgfsys@current@type\pgfutil@empty%
+ \pgfsys@use@type{#1}%
+ \else%
+ \pgfsys@use@type{\pgfsys@current@type.#1}%
+ \fi%
+}
+% Appends something to the current type
+
+\def\pgfsys@register@type#1{%
+ \expandafter\let\expandafter\pgf@sys@temp\csname pgf@sys@reg@type@#1\endcsname%
+ \ifx\pgf@sys@temp\relax%
+ {%
+ \c@pgf@counta\pgf@sys@type@count\relax%
+ \global\advance\c@pgf@counta by1\relax%
+ \edef\pgf@sys@type@count{\the\c@pgf@counta}%
+ \expandafter\xdef\csname pgf@sys@reg@type@#1\endcsname{y\the\c@pgf@counta}%
+ }%
+ \fi%
+}
+% Registers a type with the system. Must be called before any use of
+% the type
+\def\pgf@sys@reg@type@{}
+\def\pgf@sys@reg@type@background{b}
+\def\pgf@sys@reg@type@path{p}
+\def\pgf@sys@reg@type@text{t}
+\expandafter\def\csname pgf@sys@reg@type@background.path\endcsname{bp}
+\def\pgf@sys@type@count{0}
+
+\def\pgfsys@push@type{%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgf@sys@typestack%
+ \expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsys@current@type%
+ \expandafter\expandafter\expandafter{\expandafter\pgfsys@current@type\expandafter}%
+ \expandafter\def\expandafter\pgf@sys@typestack\expandafter{\pgf@sys@typestack}}%
+}
+\let\pgf@sys@typestack\pgfutil@empty
+% Pushes the current type onto a global stack. This is useful for
+% temporarily changing the type without creating \TeX scopes.
+
+\def\pgfsys@pop@type{\pgf@sys@typestack}
+% Pops the last id from the stack.
+
+\def\pgfsys@id@ref#1#2{#1\csname pgf@sys@reg@type@#2\endcsname}
+% Expands to a text that can be inserted as a reference. #1 must be a
+% reference created \pgfsys@new@id, #2 must be a type that has been
+% registered using \pgfsys@id@register@type.
+
+\def\pgfsys@id@refcurrent{\pgfsys@id@ref{\pgf@sys@id@current@id}{\pgfsys@current@type}}
+% Expands to a text that can be inserted as a reference to the current
+% id-type pair in use.
+
+\def\pgfsys@invalidate@currentid{%
+ \expandafter\global\expandafter\let\csname pgf@sys@id@keylist@\pgfsys@id@refcurrent\endcsname\pgfutil@empty%
+}
+% Mark the current id-type pair as used.
+
+\def\pgfsys@attach@to@id#1#2#3#4{%
+ \pgfsys@register@type{#2}%
+ \expandafter\def\expandafter\pgf@sys@tempbeg\expandafter{\csname pgf@sys@att@beg@\pgfsys@id@ref{#1}{#2}\endcsname}%
+ \expandafter\def\expandafter\pgf@sys@tempend\expandafter{\csname pgf@sys@att@end@\pgfsys@id@ref{#1}{#2}\endcsname}%
+ \expandafter\ifx\pgf@sys@tempbeg\relax%
+ \expandafter\let\pgf@sys@tempbeg\pgfutil@empty%
+ \fi%
+ \expandafter\ifx\pgf@sys@tempend\relax%
+ \expandafter\let\pgf@sys@tempend\pgfutil@empty%
+ \fi%
+ \expandafter\let\expandafter\pgf@sys@tempbeg@cont\pgf@sys@tempbeg%
+ \expandafter\let\expandafter\pgf@sys@tempend@cont\pgf@sys@tempend%
+ \expandafter\expandafter\expandafter\gdef\expandafter\pgf@sys@tempbeg\expandafter{\pgf@sys@tempbeg@cont#3}%
+ \def\pgf@sys@temp{#4}%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter\pgf@sys@tempend\expandafter\expandafter\expandafter{\expandafter\pgf@sys@temp\pgf@sys@tempend@cont}%
+}
+% Attaches some code to an id-type pair so that when the id's scope
+% gets created, #3 is added at the beginning and #4 is added at the
+% end.
+
+\def\pgfsys@if@fresh@id#1#2#3#4{%
+ \edef\pgf@sys@temp{#1}%
+ \ifx\pgf@sys@temp\pgfutil@empty% empty id always counts as "has been used"
+ #4%
+ \else%
+ \pgfsys@register@type{#2}%
+ \expandafter\ifx\csname pgf@sys@id@keylist@\pgfsys@id@ref{#1}{#2}\endcsname\pgfutil@empty%
+ % has already been used!
+ #4%
+ \else%
+ #3%
+ \fi%
+ \fi%
+}
+% Checks whether a given id-type pair #1-#2 has not been used, yet. If
+% so, #3 is executed, otherwise #4.
+
+\def\pgfsys@if@fresh@currentid#1#2{%
+ \ifx\pgf@sys@id@current@id\pgfutil@empty% empty id always counts as "has been used"
+ #2%
+ \else%
+ \expandafter\ifx\csname pgf@sys@id@keylist@\pgfsys@id@refcurrent\endcsname\pgfutil@empty%
+ % has already been used!
+ #2%
+ \else%
+ #1%
+ \fi%
+ \fi%
+}
+% Checks whether the current id-type pair in use has not been used,
+% yet. If so, #1 is executed, otherwise #2.
+
@@ -515,6 +798,13 @@
%
%
+\def\pgfsys@opacity#1{\pgfsys@stroke@opacity{#1}\pgfsys@fill@opacity{#1}}
+% Ideally, this should sets the opacity of all operations, treating
+% the group as a transparency group with 1 meaning fully opaque, 0
+% meaning fully transparent. Since most drivers do not support this,
+% the fallback is to set the stroke and fill opacity at the same
+% time. This is not quite the same, however.
+
\def\pgfsys@stroke@opacity#1{\pgf@sys@fail{opacity}}
% Sets the opacity of stroking operations. 1 means fully opaque, 0
% means fully transparent.
@@ -659,6 +949,463 @@
% Sets an colored pattern #1 as filling color.
+
+
+
+%
+%
+% Animations
+%
+%
+
+
+\newif\ifpgfsysanimationsupported
+% Will be set to true by a driver when animations are supported. Note
+% that snapshots are always supported.
+
+
+\def\pgfsys@animate#1{\pgf@sys@fail{animations}}
+% Adds an animation of the attribute #1 to the current scope.
+% The configuration of the animation (like start times, etc.) is taken
+% from the current values of the animation keys, which are configured
+% using calls to \pgfsys@animation@..., which setup an animation
+% key for the local scope. This means that you typically setup these
+% keys in a scope and at the end of the scope call \pgfsys@animate.
+%
+% Some keys accumulate (like begin or keytime), most do not. In those
+% cases, the last call overrides the previous one.
+%
+% Not all value types make sense or are allowed, it depends on the
+% specific \pgfsys@animate call.
+%
+% Example:
+%
+% {
+% \pgfsys@animation@offset{10}{begin}%
+% \pgfsys@animation@event{}{click}{1}{begin}%
+% \pgfsys@animation@time{5}{1}{1}{0}{0}
+% \pgfsys@animation@val@scalar{1}
+% \pgfsys@animation@time{8}{1}{1}{0}{0}
+% \pgfsys@animation@val@scalar{0.5}
+% \pgfsys@animation@sum%
+% \pgfsys@animate{fillopacity}%
+% }
+%
+% When a driver does not support a specific attribute #1, it should
+% issue a \pgf@sys@fail. Typical attributes are things like "opacity"
+% or "linewidth" or "dash".
+%
+% The following values are permissible for "#1":
+%
+% "opacity" adds an animation of the opacity.
+% Type: scalar
+%
+% "fillopacity" adds an animation of the fill opacity.
+% Type: scalar
+%
+% "strokeopacity" adds an animation of the stroke opacity.
+% Type: scalar
+%
+% "visibility" adds an animation of the visiblity.
+% Type: text ("visible" or "hidden")
+%
+% "linewidth" adds an animation of the line width.
+% Type: dimension
+%
+% "dash" adds an animation of the dash.
+% Type: dash
+%
+% "translate" adds an animation of the transformation.
+% Type: translate
+%
+% "scale" adds an animation of the transformation.
+% Type: scale
+%
+% "rotate" adds an animation of the transformation.
+% Type: scalar
+%
+% "skewx" adds an animation of the transformation.
+% Type: scalar
+%
+% "skewy" adds an animation of the transformation.
+% Type: scalar
+%
+% "motion" adds a movement along a path.
+% Type: motion
+%
+% "strokecolor" adds an animation of the stroke color.
+% Type: color
+%
+% "fillcolor" adds an animation of the fill color.
+% Type: color
+%
+% "viewbox" adds an animation of the view box.
+% Type: view box
+%
+% "path" adds an animation of the path to the path specified by
+% \pgfsys@animation@whom
+% Type: path
+%
+% "syncbase" adds a sync base to the animation. A sync base does not animate
+% anything by itself, but other animations can begin and end relative
+% to it.
+%
+% "none" supresses the animation
+% Type: any
+
+
+
+
+% Animation timing :
+%
+% You specify an animation using a timeline. A timeline consists of a
+% sequence of times together with values for these times. The times
+% must be given in increasing order. You use the command
+% \pgfsys@animation@time to specify a time and
+% \pgfsys@animation@val@... to specify a value. The time must be
+% specfied first, the time--value is created when the value command is
+% used.
+%
+% Times are given in seconds (so 0.01 is one hundreth of a second).
+%
+% The animation's timeline will start with the first time mentioned
+% (not necessarily zero and not necessarily a positive value) and ends
+% with the last value. The duration is the difference between these
+% two values.
+
+\def\pgfsys@animation@restart@always{}
+% Specifies that the animation can always restart
+
+\def\pgfsys@animation@restart@never{}
+% Specifies that the animation should never restart
+
+\def\pgfsys@animation@restart@whennotactive{}
+% Specifies that the animation should only restart when it is not active
+
+\def\pgfsys@animation@repeat#1{}
+% #1 must be a number
+
+\def\pgfsys@animation@repeat@indefinite{}
+% Repeats forever
+
+\def\pgfsys@animation@repeat@dur#1{}
+% #1 must be a clock value
+
+\def\pgfsys@animation@freezeatend{}
+% Specifies that the last value of the animation remains in force at
+% the end
+
+\def\pgfsys@animation@removeatend{}
+% Specifies that the effect of the animation is removed at the end
+
+\def\pgfsys@animation@time#1#2#3#4#5{}
+% Specifies a time together with spline control points for the entry
+% and the exit to this time. The value #1 is a time in seconds (so 60
+% means 1 minute, 0.001 means one millisecond). The values #2 and #3
+% specify the control point of the spline *entering* the time point,
+% while the values #4 and #5 specify the control point of the spline
+% *leaving* the time point. They are all dimensionless values between
+% 0 and 1. For a linear animation, set the first two to 1 and the last
+% two to 0.
+%
+% Example:
+% \pgfsys@animation@time{5}{1}{1}{0.25}{0.1}
+% \pgfsys@animation@val@scalar{80}
+% \pgfsys@animation@time{8}{.75}{1}{0}{0}
+% \pgfsys@animation@val@scalar{90}
+%
+% In SVG, this will create the following entries:
+% begin = +5s
+% duration = 3s
+% keyTimes = 0;1
+% values = 80;90
+% keySpline = 0.25 0.1 0.75 1
+%
+% For the key spline, note that the entry spline controls of the first
+% time and the exit spline controls of the last point are dropped.
+%
+%
+% When the exit spline takes the special values #4="stay" and #5="0",
+% the attribute's value "stays" until the next value for the next time
+% (it "jumps" to the next value then). This corresponds, roughly, to
+% an "infinite" #4.
+%
+% Similarly, when the entry spline takes the special value #2="jump"
+% and #3="1", the value immediately jumps from the previous value to
+% the next value when the previous value was "created".
+
+\def\pgfsys@stay@text{{stay}{0}}
+\def\pgfsys@jump@text{{jump}{1}}
+
+\def\pgfsys@animation@base{}
+% Think of this command as setting the value of the attribute in the
+% timeline before the timeline starts. Normally, an animation only
+% influences the timeline while the animation is running (which may be
+% forever) and before and after the animation is running, the
+% attribute's value is not modified by the animation (so, it is just
+% inherited from the surrounding scope). When a base value is set,
+% while the animation is not running, this value is used. For most
+% attributes you can achieve the same effect by surrounding the
+% to-be-animated object by a scope and setting the value there, but
+% using bases is often more convenient and, for instance for the
+% visibility attribute, it is necessary to use a base.
+%
+% Note that when a backend driver does not support animations, base
+% values will not be depicted unless a snapshot is used explicitly.
+
+\def\pgfsys@animation@offset#1#2{}
+% #1 must be a value in seconds, #2 is the target "begin" or "end" to
+% which this offset is appended.
+
+\def\pgfsys@animation@syncbegin#1#2#3#4{}
+% #1 is the id of a sync base (obtained by
+% \pgfsys@new@id), #2 is the id type (or empty), #3 is an optional
+% offset, #4 is the target.
+
+\def\pgfsys@animation@syncend#1#2#3#4{}
+% Like the previous command.
+
+\def\pgfsys@animation@event#1#2#3#4#5{}
+% #1 is the optional id of another element (obtained by
+% \pgfsys@new@id), #2 is the optional type of the id, #3 is an event
+% name, #4 is an optional offset, #5 is the target.
+
+\def\pgfsys@animation@repeat@event#1#2#3#4#5{}
+% #1 is the optional id of another element, #2 is the type, #3 is a
+% repeat count, and #4 is an optional offset, #5 is the target.
+
+\def\pgfsys@animation@accesskey#1#2#3{}
+% #1 is a character, #2 is an optional offset, #3 is the target.
+
+\def\pgf@sys@begin@text{begin}
+
+
+% Accumulation
+
+\def\pgfsys@animation@accumulate{}
+% Corresponds to accumulate="sum" in SVG
+
+\def\pgfsys@animation@noaccumulate{}
+% Corresponds to accumulate="none" in SVG
+
+
+% Targeting
+
+\def\pgfsys@animation@whom#1#2{}
+% Sets the target of the animation. #1 must be an id previously
+% created using \pgfsys@new@id and #2 must be empty or a type
+% previously created using \pgfsys@new@id@type
+
+
+% Attribute definitions
+
+\def\pgfsys@animation@rotatealong{}
+% Applicable only to motion animations. Indicates that the
+% to-be-animated group should be rotated automatically so that it
+% points along the path as time progresses.
+
+\def\pgfsys@animation@norotatealong{}
+% Corresponds to rotate="0"
+
+\def\pgfsys@animation@movealong#1{}
+% Applicable only to motion animations. #1 is a softpath along which
+% the movement will be done.
+
+\def\pgfsys@animation@tip@markers#1#2{}
+% Applicable only to path animations. #1 and #2 are markers (declared
+% using \pgfsys@marker@declare) that store marker symbols to be added
+% at the start and at the end of the to-be-animated path. If empty, no
+% markers are added.
+
+\def\pgfsys@animation@canvas@transform#1#2{}
+% #1 is some code that may call \pgfsys@transformcm at most once. It
+% will be executed when a canvas transformation animation is
+% installed for a scope id. #2 is some further codes that may also
+% call \pgfsys@transformcm at most once. It will be installed right
+% after the animation.
+%
+% Typically, #1 is some pgf coordinate shift followed by
+% {\pgflowlevelsynccm} and #2 is \pgftransforminvert followed by
+% \pgflowlevelsynccm.
+
+
+
+% Values
+
+\def\pgfsys@animation@val@current{}
+% The current value of the attribute. At least with SVG, this can only
+% be used for the first value and, then, only if there is only one
+% other value.
+
+\def\pgfsys@animation@val@text#1{}
+% #1 should be some text.
+
+\def\pgfsys@animation@val@scalar#1{}
+% #1 should be a single value.
+
+\def\pgfsys@animation@val@dimension#1{}
+% #1 must be a dimension.
+
+\def\pgfsys@animation@val@color@rgb#1#2#3{}
+% #1,#2,#3 must be an rgb tuple
+
+\def\pgfsys@animation@val@color@cmyk#1#2#3#4{}
+% #1,#2,#3,#4 must be an cmyk tuple
+
+\def\pgfsys@animation@val@color@cmy#1#2#3{}
+% #1,#2,#3 must be an cmy tuple
+
+\def\pgfsys@animation@val@color@gray#1{}
+% #1 must be a gray value
+
+\def\pgfsys@animation@val@path#1{}
+% #1 must consist of path-construction tokens (as returned by the
+% softpath layer)
+
+\def\pgfsys@animation@val@translate#1#2{}
+% #1,#2 must be dimensions
+
+\def\pgfsys@animation@val@scale#1#2{}
+% #1,#2 must be dimensionless
+
+\def\pgfsys@animation@val@viewbox#1#2#3#4{}
+% #1,#2 describe the lower left, #3,#4 the upper right corner of the
+% view box.
+
+\def\pgfsys@animation@val@dash#1#2{}
+% #1,#2 have the syntax of \pgfsys@setdash.
+
+
+
+%
+%
+% Markers
+%
+%
+
+\def\pgfsys@marker@declare#1#2{%
+ {%
+ \pgfpicturetrue%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@marker@temp%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+ \pgfsysprotocol@bufferedtrue%
+ \pgfsys@beginscope%
+ #2%
+ \pgfsys@endscope%
+ \xdef#1{\the\pgf@sys@id@count}%
+ \expandafter\expandafter\expandafter\global\expandafter\pgfsysprotocol@getcurrentprotocol\csname pgf@sys@marker@prot@#1\endcsname%
+ \pgfsys@marker@declare@% curtesy hook
+ \pgfsysprotocol@setcurrentprotocol\pgfsys@marker@temp%
+ \global\advance\pgf@sys@id@count by1\relax%
+ }%
+}
+\let\pgfsys@marker@declare@\relax
+% Declares a new marker symbol whose code is in #2. #1 should be a
+% macro name, which will be set to a unique
+% value by which the marker can be referenced later on. #2 should be
+% code that, when executed, produces recordable code.
+
+\def\pgfsys@marker@use#1{%
+ \pgfsysprotocol@literal{\csname pgf@sys@marker@prot@#1\endcsname}%
+}
+% Draws the marker symbol not at the end of a path, but simply with
+% the current transformation matrix
+
+
+
+
+
+
+%
+%
+% RDF
+%
+%
+
+\def\pgfsys@rdf@about#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute "about" with value #1 to the next
+% idscope. The RDF-spec says: "a SafeCURIEorCURIEorIRI, used for
+% stating what the data is about (a 'subject' in RDF terminology);"
+
+\def\pgfsys@rdf@content#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute content with value #1 to the next
+% idscope. The RDF-spec says: "a CDATA string, for supplying
+% machine-readable content for a literal (a 'literal object', in RDF
+% terminology);"
+
+\def\pgfsys@rdf@datatype#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute datatype with value #1 to the next
+% idscope. The RDF-spec says: "a TERMorCURIEorAbsIRI representing a
+% datatype, to express the datatype of a literal;"
+
+\def\pgfsys@rdf@href#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute href with value #1 to the next idscope
+% The RDF-spec says: "a traditionally navigable IRI for
+% expressing the partner resource of a relationship (a 'resource
+% object', in RDF terminology);"
+
+\def\pgfsys@rdf@inlist{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute inlist to the next idscope. The
+% RDF-spec says: "An attribute used to indicate that the object
+% associated with a rel or property attribute on the same element is
+% to be added to the list for that predicate. The value of this
+% attribute must be ignored. Presence of this attribute causes a list
+% to be created if it does not already exist."
+
+\def\pgfsys@rdf@prefix#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf prefix attribute to the next
+% idscope. Can be called several times, in which case all values of #1
+% are concatenated with whitespaces. The RDF-spec says: "a white space
+% separated list of prefix-name IRI pairs of the form NCName ':' ' '+
+% xsd:anyURI"
+
+\def\pgfsys@rdf@property#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf property attribute to the next
+% idscope. Can be called repeatedly. The RDF-spec says: "a white space
+% separated list of TERMorCURIEorAbsIRIs, used for expressing
+% relationships between a subject and either a resource object if
+% given or some literal text (also a 'predicate');"
+
+\def\pgfsys@rdf@rel#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf rel attribute to the next
+% next idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of
+% TERMorCURIEorAbsIRIs, used for expressing relationships between two
+% resources ('predicates' in RDF terminology);"
+
+\def\pgfsys@rdf@resource#1{\pgf@sys@fail{rdf}}
+% Adds the rdf attribute resource with value #1 to the next idscope. The
+% RDF-spec says: "a SafeCURIEorCURIEorIRI for expressing the partner
+% resource of a relationship that is not intended to be navigable
+% (e.g., a 'clickable' link) (also an 'object');"
+
+\def\pgfsys@rdf@rev#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf rev attribute to the next
+% idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of
+% TERMorCURIEorAbsIRIs, used for expressing reverse relationships
+% between two resources (also 'predicates');
+
+\def\pgfsys@rdf@src#1{\pgf@sys@fail{rdf}}
+% Adds an rdf attribute src with value #1 to the next idscope. The
+% RDF-spec says: "an IRI for expressing the partner resource of a
+% relationship when the resource is embedded (also a 'resource
+% object');"
+
+\def\pgfsys@rdf@typeof#1{\pgf@sys@fail{rdf}}
+% Adds #1 to the list of the rdf typeof attribute to the next
+% idscope. Can be called repeatedly. The
+% RDF-spec says: "a white space separated list of TERMorCURIEorAbsIRIs
+% that indicate the RDF type(s) to associate with a subject;"
+
+\def\pgfsys@rdf@vocab#1{\pgf@sys@fail{rdf}}
+% Adds an rdf attribute vocab with value #1 to the next idscope. The
+% RDF-spec says: "an IRI that defines the mapping to use when a TERM
+% is referenced in an attribute value. See General Use of Terms in
+% Attributes and the section on Vocabulary Expansion."
+
+
+
%
%
% Page size stuff
@@ -765,27 +1512,8 @@
% This command has a default implementation.
-
-
-
-\def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke}
-% This command should have the same effect as first closing the path
-% and then stroking it.
-
-
-\def\pgfsys@transformshift#1#2{\pgfsys@transformcm{1}{0}{0}{1}{#1}{#2}}
-% This command will change the origin of the low-level coordinate
-% system to (#1,#2).
-
-\def\pgfsys@transformxyscale#1#2{\pgfsys@transformcm{#1}{0}{0}{#2}{0bp}{0bp}}
-% This command will scale the low-level coordinate system (and
-% everything that is drawn) by a factor of #1 in x-directed and #2 in
-% y-direction. Note that this applies to everything, including
-% lines. So a scaled line will have a different width and may even
-% have a different width when going along the x-axis and when going
-% along the y-axis, if the scaling is different in these directions.
-
\def\pgfsys@hbox#1{%
+ \pgfsys@begin@idscope%
\pgfsys@beginscope%
\setbox#1=\hbox{\box#1}%
\wd#1=0pt%
@@ -793,21 +1521,22 @@
\dp#1=0pt%
\box#1%
\pgfsys@endscope%
+ \pgfsys@end@idscope%
}
% Called to insert a TeX hbox into a pgfpicture.
\def\pgfsys@hboxsynced#1{%
- {\pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope}%
-}
-% Called to insert a TeX hbox into a pgfpicture, but with the current
+ \pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope%
+}%
+% Called to insert box #1 into a pgfpicture, but with the current
% coordinate transformation matrix synced with the canvas
-% transformation matrix.
+% transformation matrix and surrounded by a scope.
%
% In essence, this command does the same as if you first said
-% \pgflowlevelsynccm and then \pgfsys@hbox. However, a driver may
-% choose to use a ``TeX-translation'' for the translation part of the
+% \pgflowlevelsynccm and then \pgfsys@hbox#1. However, a
+% ``TeX-translation'' is used for the translation part of the
% transformation cm. This will ensure that hyperlinks ``survive'' at
-% least translations.
+% least translations.
\def\pgfsys@pictureboxsynced#1{%
{%
@@ -820,7 +1549,7 @@
% stream. However, the default implementation uses \pgfsys@hboxsynced
% in conjunction with \pgfsys@beginpicture to ensure that, if
% possible, hyperlinks survive in pdfs. Drivers that are sensitive to
-% picture-in-picture scopes shuold replace this implementation by
+% picture-in-picture scopes should replace this implementation by
% \pgfsys@beginscope\pgflowlevelsynccm\box#1\pgfsys@endscope
\def\pgfsys@beginpicture{}
@@ -917,6 +1646,7 @@
\def\pgfsys@defobject#1#2#3#4{%
\pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
{%
+ \pgfpicturetrue%
\pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
\pgfsysprotocol@bufferedtrue%
\pgfsys@beginscope%
@@ -957,12 +1687,19 @@
\def\pgfsys@begininvisible{\pgfsys@transformcm{1}{0}{0}{1}{2000bp}{2000bp}}
% Between this command and the closing endinvisible, all output should
% be suppressed. Nothing should be drawn at all, which includes all
-% paths, images and shadings.
+% paths, images and shadings. This command typically should not open a
+% graphic scope.
\def\pgfsys@endinvisible{\pgfsys@transformcm{1}{0}{0}{1}{-2000bp}{-2000bp}}
% Ends the invisibilty section, unless invisibility blocks have been
% nested. In this case, only the `last' one restores visibility.
+\def\pgfsys@begininvisiblescope{\pgfsys@beginscope\pgfsys@begininvisible}
+% Works like pgfsys@begininvisible, but it may open a graphics scope.
+
+\def\pgfsys@endinvisiblescope{\pgfsys@endinvisible\pgfsys@endscope}
+% Closes the invisibility scope.
+
\def\pgfsys@atbegindocument{}
% This command will be executed at the begin of the document. If for
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
new file mode 100644
index 00000000000..12862bee9db
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysanimations.code.tex
@@ -0,0 +1,2009 @@
+% Copyright 2016 by Till Tantau
+%
+% 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.
+
+
+
+% Guard against reading twice
+\ifx\pgfsysanimationsloaded\pgfutil@undefined
+ \let\pgfsysanimationsloaded=\relax
+\else
+ \expandafter\endinput
+\fi
+
+
+% We need some support:
+\usepgfmodule{decorations}
+
+
+% Animation abstraction layer
+%
+% This layer provides an abstraction of the
+% \pgfsys@anim... commands. The idea is to provide an interface that
+% can map animation commands either to "real" animations (for instance
+% in the sense of SVG) or to "snapshots" of animations, which are
+% especially useful for printing. For these snapshots, instead of
+% adding an animation property to a scope, the property is actually
+% set to a certain value computed by \TeX.
+%
+% For each \pgfsys@animation@... command there is a corresponding
+% \pgfsysanim command.
+
+
+% Set the current time to a snapshot time
+%
+% #1 = a global snapshot time (a dimensionless number, measured in
+% seconds).
+%
+% Description:
+%
+% When this command is used in a scope, instead of creating an
+% animation, pgf will insert appropriate commands that show the state
+% of the animation at the given time.
+%
+% The value #1 can be thought of as the "global time", which can be
+% thought of as the time that elapsed since the "onload" event.
+%
+% The command \pgfsysanimsnapshotafter works the same way as
+% pgfsysanimsnapshot, only the time #1 is interpreted as "global time
+% #1 + epsilon". This means that when two or mroe values are specified
+% for time #1, the last of them is used rather than the
+% first. Likewise, when a non-freezing timeline ends at time #1,
+% \pgfsysanimsnapshot will set the value to the last value in the
+% timeline, while \pgfsysanimsnapshotafter removes the animation.
+%
+% The following commands and effect for animations are ignored / not
+% implemented for snapshots (meaning that even if the "real" animation
+% would look in a certain way because of one of the following commands
+% or effects, the snapshot will not reflect this):
+%
+% - Events and restarts are ignored. For the snapshot, all animations
+% start at global time 0, except if the command
+% \pgfsysanimkeysnapshotstart is used to specify a different
+% start for a specific animation.
+% - The "current value" as starting value (pgf has no real chance of
+% determining the correct value of this). Using this with a snapshot
+% will raise an errer.
+%
+% Example:
+%
+% {
+% \pgfsyssnapshot{2}%
+% \pgfsysanimkeytime{0}{1}{1}{0}{0}
+% \pgfsysanimvalscalar{1}
+% \pgfsysanimkeytime{5}{1}{1}{0}{0}
+% \pgfsysanimvalscalar{0}
+% \pgfsysanimkeywhom{\someid}{}
+% \pgfsysanimate{fillopacity}%
+% % Will set the opacity of \someid to 0.6
+% }
+
+\def\pgfsysanimsnapshot#1{%
+ \def\pgfsysanim@snaptime{#1}%
+ \pgfsysanim@snap@firsttrue%
+ \pgfsysanim@is@snaptrue%
+}
+\def\pgfsysanimsnapshotafter#1{%
+ \def\pgfsysanim@snaptime{#1}%
+ \pgfsysanim@snap@firstfalse%
+ \pgfsysanim@is@snaptrue%
+}
+\newif\ifpgfsysanim@is@snap
+\newif\ifpgfsysanim@snap@first
+
+
+
+% Companion for \pgfsys@animate
+%
+% #1 = attribute
+%
+% Description:
+%
+% If not snapshot is set, \pgfsys@animate is simply called. Otherwise,
+% appropriate code is generated that sets the specified attribute of
+% the whom object to the value it would have during the animation at
+% the moment of the snapshot.
+
+\def\pgfsysanimate#1{%
+ \csname pgfsysanim@checks@#1\endcsname%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@do@snap{#1}%
+ \else%
+ \pgfsys@animate{#1}%
+ \fi%
+}
+
+\def\pgfsysanim@do@snap#1{%
+ {%
+ \expandafter\ifx\csname pgfsysanim@prep@attr@#1\endcsname\pgfutil@undefined%
+ \else%
+ % First, compute time frame:
+ \pgfsysanim@compute@interval%
+ % Second, compute code:
+ \let\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@end\pgfutil@empty%
+ \csname pgfsysanim@prep@attr@#1\endcsname%
+ \ifx\pgfsysanim@code@begin\relax%
+ \else%
+ % Attach to object:
+ \expandafter\expandafter\expandafter\pgfsysanim@call@attacher%
+ \expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@begin\expandafter}\expandafter{\pgfsysanim@code@end}{}%
+ \fi%
+ \fi%
+ }%
+}
+\def\pgfsysanim@call@attacher{\pgfsys@attach@to@id{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}}
+
+
+% Do some checks:
+\def\pgfsysanim@checks@path{%
+ \expandafter\global\expandafter\let\csname pgfsysanim@path@is@animated@\pgfsysanim@whom@id @\pgfsysanim@whom@type\endcsname\pgfutil@empty%
+}
+
+
+% Companions for \pgfsys@animation@restart@...
+%
+% Description:
+%
+% These commands just call \pgfsys@animation@restart@... and they are
+% *ignored* when it comes to snapshots.
+
+\def\pgfsysanimkeyrestartalways{\pgfsys@animation@restart@always}
+\def\pgfsysanimkeyrestartnever{\pgfsys@animation@restart@never}
+\def\pgfsysanimkeyrestartwhennotactive{\pgfsys@animation@restart@whennotactive}
+
+
+
+% Companions for \pgfsys@animation@repeat...
+%
+% Description:
+%
+% These commands call \pgfsys@animation@repeat... and, if there is a
+% snapshot installed, the passed values are taken into consideration.
+
+\def\pgfsysanimkeyrepeat#1{%
+ \pgfsys@animation@repeat{#1}%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal%
+ {%
+ \pgf@x#1pt\relax%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}%
+}
+\def\pgfsysanimkeyrepeatindefinite{%
+ \pgfsys@animation@repeat@indefinite%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite%
+ \let\pgfsysanim@snap@repeat@arg\pgfutil@empty%
+}
+\def\pgfsysanimkeyrepeatdur#1{%
+ \pgfsys@animation@repeat@dur{#1}%
+ % Snapshot
+ \let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur%
+ {%
+ \pgf@x#1pt\relax%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@snap@repeat@arg\expandafter{\the\pgf@x}%
+}
+\def\pgfsysanim@snap@repeat@none{n}%
+\def\pgfsysanim@snap@repeat@normal{m}%
+\def\pgfsysanim@snap@repeat@indefinite{i}%
+\def\pgfsysanim@snap@repeat@dur{d}%
+\let\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none
+\let\pgfsysanim@snap@repeat@arg\pgfutil@empty
+
+
+
+% Companions for \pgfsys@animation@freezeatend and
+% \pgfsys@animation@removeatend
+%
+% Description:
+%
+% These commands call the two system commands and, if there is a
+% snapshot installed, the settings are taken into consideration.
+
+\def\pgfsysanimkeyfreezeatend{\pgfsys@animation@freezeatend\pgfsysanim@freezeatendtrue}
+\def\pgfsysanimkeyremoveatend{\pgfsys@animation@removeatend\pgfsysanim@freezeatendfalse}
+\newif\ifpgfsysanim@freezeatend
+
+
+
+% Companion for \pgfsys@animation@time
+%
+% #1 to #5 = as in \pgfsys@animation@time
+%
+% Description:
+%
+% Calls \pgfsys@animation@time. Furthermore, the specified times are
+% recorded so that they can later be analysed for the computation
+% needed for a snapshot.
+
+\def\pgfsysanimkeytime#1#2#3#4#5{%
+ % Setup animation
+ \pgfsys@animation@time{#1}{#2}{#3}{#4}{#5}%
+ % and rember for snapshots
+ \def\pgfsysanim@time{{#1}{#2}{#3}{#4}{#5}}%
+}
+
+
+% Sets the base value
+%
+% Description:
+%
+% This will set the "base" value for an animation, which is installed
+% prior to any animation of the attribute.
+
+\def\pgfsysanimkeybase{%
+ \pgfsys@animation@base%
+ \let\pgfsysanim@time\pgfsysanim@base@text%
+}
+\def\pgfsysanim@base@text{base}%
+
+% Sets the beginning of the timeline for snapshots
+%
+% #1 = a time (a scalar)
+%
+% Description:
+%
+% Sets the start of current animation to #1 for snapshots. For
+% instance, if #1 is 5 (=five seconds), and you say
+% \pgfsysanimsnapshot{6}, the attribute will be set to whatever the
+% animation specifies after one second.
+
+\def\pgfsysanimkeysnapshotstart#1{%
+ \def\pgfsysanim@snapshotstart{#1}%
+}
+\def\pgfsysanim@snapshotstart{0}
+
+
+% Companion for \pgfsys@animation@offset
+%
+% #1, #2 = as in \pgfsys@animation@offset
+%
+% Description:
+%
+% Calls \pgfsys@animation@offset.
+
+\def\pgfsysanimkeyoffset#1#2{%
+ \pgfsys@animation@offset{#1}{#2}%
+}
+
+
+% Companion for \pgfsys@animation@sync(begin|end)
+%
+% #1 to #4 = as in \pgfsys@animation@sync(begin|end)
+%
+% Description:
+%
+% Calls \pgfsys@animation@sync(begin|end).
+
+\def\pgfsysanimkeysyncbegin#1#2#3#4{%
+ \pgfsys@animation@syncbegin{#1}{#2}{#3}{#4}%
+}
+
+\def\pgfsysanimkeysyncend#1#2#3#4{%
+ \pgfsys@animation@syncend{#1}{#2}{#3}{#4}%
+}
+
+
+% Companion for \pgfsys@animation@event
+%
+% #1 to #5 = as in \pgfsys@animation@event
+%
+% Description:
+%
+% Calls \pgfsys@animation@event.
+
+\def\pgfsysanimkeyevent#1#2#3#4#5{%
+ \pgfsys@animation@event{#1}{#2}{#3}{#4}{#5}%
+}
+
+
+% Companion for \pgfsys@animation@repeat@event
+%
+% #1 to #5 = as in \pgfsys@animation@repeat@event
+%
+% Description:
+%
+% Calls \pgfsys@animation@repeat@event.
+
+\def\pgfsysanimkeyrepeatevent#1#2#3#4#5{%
+ \pgfsys@animation@repeat@event{#1}{#2}{#3}{#4}{#5}%
+}
+
+
+
+% Companion for \pgfsys@animation@accesskey
+%
+% #1 to #3 = as in \pgfsys@animation@accesskey
+%
+% Description:
+%
+% Calls \pgfsys@animation@accesskey.
+
+\def\pgfsysanimkeyaccesskey#1#2#3{%
+ \pgfsys@animation@accesskey{#1}{#2}{#3}%
+}
+
+
+
+
+% Companions for \pgfsys@animation@(no)accumulate
+%
+% Description:
+%
+% Calls \pgfsys@animaion@(no)accumulate and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeyaccumulate{\pgfsys@animation@accumulate\pgfsysanim@accumulatetrue}
+\def\pgfsysanimkeynoaccumulate{\pgfsys@animation@noaccumulate\pgfsysanim@accumulatefalse}
+\newif\ifpgfsysanim@accumulate
+
+
+
+
+% Companion for \pgfsys@animation@whom
+%
+% #1 and #2 = as for \pgfsys@animation@whom
+%
+% Description:
+%
+% Calls \pgfsys@animation@whom and records the setting for snapshots.
+
+\def\pgfsysanimkeywhom#1#2{%
+ \pgfsys@register@type{#2}%
+ \pgfsys@animation@whom{#1}{#2}%
+ % Snapshots
+ \def\pgfsysanim@whom@id{#1}%
+ \def\pgfsysanim@whom@type{#2}%
+}
+
+
+
+
+
+% Companions for \pgfsys@animation@rotatealong and
+% \pgfsys@animation@norotatealong
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeyrotatealong{\pgfsys@animation@rotatealong\pgfsysanim@rotatealongtrue}
+\def\pgfsysanimkeynorotatealong{\pgfsys@animation@norotatealong\pgfsysanim@rotatealongfalse}
+\newif\ifpgfsysanim@rotatealong
+
+
+% Companion for \pgfsys@animation@movealong
+%
+% #1 = the path
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeymovealong#1{%
+ \pgfsys@animation@movealong{#1}%
+ % Snapshot
+ \def\pgfsysanim@snap@movealong{#1}%
+}
+
+
+
+
+% Companion for \pgfsys@animation@tip@markers
+%
+% #1, #2 = the markers
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeytipmarkers#1#2{%
+ \pgfsys@animation@tip@markers{#1}{#2}%
+ % Snapshot
+ \def\pgfsysanim@snap@tip@start{#1}%
+ \def\pgfsysanim@snap@tip@end{#2}%
+}
+\let\pgfsysanim@snap@tip@start\pgfutil@empty%
+\let\pgfsysanim@snap@tip@end\pgfutil@empty%
+
+
+% Companion for \pgfsys@animation@canvas@transform
+%
+% Description:
+%
+% Calls the system layer command and records the setting for
+% snapshots.
+
+\def\pgfsysanimkeycanvastransform#1#2{%
+ \pgfsys@animation@canvas@transform{#1}{#2}%
+ % Snapshot
+ \def\pgfsysanim@snap@canvas@transform@pre{#1}%
+ \def\pgfsysanim@snap@canvas@transform@post{#2}%
+}
+\let\pgfsysanim@snap@canvas@transform@pre\relax
+\let\pgfsysanim@snap@canvas@transform@post\relax
+
+
+
+% Companion for \pgfsys@animation@val@current
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% an error results.
+
+\def\pgfsysanimvalcurrent{%
+ \pgfsys@animation@val@current%
+ \ifpgfsysanim@is@snap%
+ \pgferror{You may not use "current value" with an animation snapshot}%
+ \fi%
+}
+
+
+% Supresses the animation value
+%
+% Description:
+%
+% The animation value is simply ignored.
+
+\def\pgfsysanimvalnone{%
+}
+
+
+
+% Companion for \pgfsys@animation@val@text
+%
+% #1 = as for \pgfsys@animation@val@text
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaltext#1{%
+ \pgfsys@animation@val@text{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@scalar
+%
+% #1 = as for \pgfsys@animation@val@scalar
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalscalar#1{%
+ \pgfsys@animation@val@scalar{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@dimension
+%
+% #1 = as for \pgfsys@animation@val@dimension
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaldimension#1{%
+ \pgfsys@animation@val@dimension{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{#1}%
+ \fi%
+}
+
+
+
+% Dispatcher for different color values
+%
+% #1 = a color value (like "red" or "black!20")
+%
+% Description:
+%
+% This macro transforms #1 into its correct color model and, then,
+% calls the correct \pgfsysanimcolor... macro.
+
+\def\pgfsysanimvalcolor#1{%
+ \pgfutil@colorlet{pgf@anim@temp}{#1}%
+ \pgfutil@ifundefined{applycolormixins}{}{\applycolormixins{pgf@anim@temp}}%
+ \expandafter\let\expandafter\pgf@sys@temp\csname\string\color@pgf@anim@temp\endcsname
+ \expandafter\pgfanim@parse@type@color@\pgf@sys@temp%
+}
+\def\pgfanim@parse@type@color@#1#2#3#4#5{%
+ \expandafter\ifx\csname pgfsysanimvalcolor#4\endcsname\relax%
+ \pgferror{Unsupported color model `#4'}%
+ \else%
+ \edef\pgf@sys@colmarshal{\expandafter\noexpand\csname pgfsysanimvalcolor#4\endcsname}%
+ \pgf@sys@uncomma#5,,%
+ \pgf@sys@colmarshal%
+ \fi%
+}
+
+\def\pgf@sys@uncomma#1,{%
+ \def\pgf@sys@coltest{#1}%
+ \ifx\pgf@sys@coltest\pgfutil@empty%
+ \else%
+ \expandafter\def\expandafter\pgf@sys@colmarshal\expandafter{\pgf@sys@colmarshal{#1}}%
+ \expandafter\pgf@sys@uncomma%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@color@rgb
+%
+% #1, #2, #3 = as for \pgfsys@animation@val@color@rgb
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorrgb#1#2#3{%
+ \pgfsys@animation@val@color@rgb{#1}{#2}{#3}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}{#3}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@color@cmyk
+%
+% #1, #2, #3, #4 = as for \pgfsys@animation@val@color@cmyk
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorcmyk#1#2#3#4{%
+ \pgfsys@animation@val@color@cmyk{#1}{#2}{#3}{#4}%
+ \ifpgfsysanim@is@snap%
+ {%
+ \pgf@xa=1pt%
+ \advance\pgf@xa by-#1pt%
+ \advance\pgf@xa by-#4pt\relax%
+ \ifdim\pgf@xa<0pt\pgf@xa0pt\fi%
+ \pgf@xb=1pt%
+ \advance\pgf@xb by-#1pt%
+ \advance\pgf@xb by-#4pt\relax%
+ \ifdim\pgf@xb<0pt\pgf@xb0pt\fi%
+ \pgf@xc=1pt%
+ \advance\pgf@xc by-#1pt%
+ \advance\pgf@xc by-#4pt\relax%
+ \ifdim\pgf@xc<0pt\pgf@xc0pt\fi%
+ \edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}%
+ \expandafter}%
+ \expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}%
+ \fi%
+}
+
+
+% Companion for \pgfsys@animation@val@color@cmy
+%
+% #1, #2, #3 = as for \pgfsys@animation@val@color@cmy
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorcmy#1#2#3{%
+ \pgfsys@animation@val@color@cmy{#1}{#2}{#3}%
+ \ifpgfsysanim@is@snap%
+ {%
+ \pgf@xa=1pt%
+ \advance\pgf@xa by-#1pt%
+ \pgf@xb=1pt%
+ \advance\pgf@xb by-#1pt%
+ \pgf@xc=1pt%
+ \advance\pgf@xc by-#1pt%
+ \edef\pgfsys@temp{{\pgf@sys@tonumber\pgf@xa}{\pgf@sys@tonumber\pgf@xb}{\pgf@sys@tonumber\pgf@xc}}%
+ \expandafter}%
+ \expandafter\pgfsysanim@esnap@record\expandafter{\pgfsys@temp}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@color@gray
+%
+% #1 = as for \pgfsys@animation@val@color@gray
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalcolorgray#1{%
+ \pgfsys@animation@val@color@gray{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#1}{#1}}%
+ \fi%
+}
+
+
+
+% Special companion for \pgfsys@animation@val@path
+%
+% #1 = as for \pgfsys@animation@val@path
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalpath#1{%
+ \pgfsys@animation@val@path{#1}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@snap@record{#1}%
+ \fi%
+}
+
+
+% Companion for \pgfsys@animation@val@translate
+%
+% #1, #2 = as for \pgfsys@animation@val@translate
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaltranslate#1#2{%
+ \pgfsys@animation@val@translate{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@scale
+%
+% #1, #2 = as for \pgfsys@animation@val@scale
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalscale#1#2{%
+ \pgfsys@animation@val@scale{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+% Companion for \pgfsys@animation@val@viewbox
+%
+% #1, #2, #3, #4 = as for \pgfsys@animation@val@viewbox
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvalviewbox#1#2#3#4{%
+ \pgfsys@animation@val@viewbox{#1}{#2}{#3}{#4}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}{#3}{#4}}%
+ \fi%
+}
+
+
+
+
+% Companion for \pgfsys@animation@val@dash
+%
+% #1, #2 = as for \pgfsys@animation@val@dash
+%
+% Description:
+%
+% Calls the system layer command. If a snapshot is currently active,
+% the value is recorded in the timeline.
+
+\def\pgfsysanimvaldash#1#2{%
+ \pgfsys@animation@val@dash{#1}{#2}%
+ \ifpgfsysanim@is@snap%
+ \pgfsysanim@esnap@record{{#1}{#2}}%
+ \fi%
+}
+
+
+
+
+
+%
+% Recording mechanism: We record entries in an array.
+%
+
+\def\pgfsysanim@esnap@record#1{% records a new entry for the timeline
+ \edef\pgfsysanim@temp{#1}%
+ \expandafter\pgfsysanim@snap@record\expandafter{\pgfsysanim@temp}%
+}
+\def\pgfsysanim@snap@record#1{% records a new entry for the timeline
+ \ifx\pgfsysanim@time\pgfsysanim@base@text%
+ \def\pgfsysanim@base@value{#1}%
+ \else%
+ \advance\pgfsysanim@snap@count by1\relax%
+ \expandafter\def\expandafter\pgfsysanim@temp\expandafter{\pgfsysanim@time{#1}}%
+ \expandafter\let\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname\pgfsysanim@temp%
+ \fi%
+}
+\newcount\pgfsysanim@snap@count
+\let\pgfsysanim@base@value\pgfutil@empty%
+
+
+% Compute the time-value interval of the snapshot: Based on the value of \pgfsysanim@snaptime,
+% computes the interval containing the specified time. This interval
+% will start at \pgfsysanim@prev@time and end at
+% \pgfsysanim@next@time. The values will be \pgfsysanim@prev@val and
+% \pgfsysanim@next@val.
+%
+\def\pgfsysanim@compute@interval{%
+ \let\pgfsysanim@prev@val\relax%
+ \let\pgfsysanim@prev@time\relax%
+ \let\pgfsysanim@prev@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@next@val\relax%
+ \let\pgfsysanim@next@time\relax%
+ \let\pgfsysanim@next@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@first@time\relax%
+ \let\pgfsysanim@last@time\relax%
+ \let\pgfsysanim@last@val\relax%
+ \ifnum\pgfsysanim@snap@count>0\relax%
+ \pgf@xc\pgfsysanim@snaptime pt\relax%
+ \pgf@x\pgfsysanim@snapshotstart pt\relax%
+ \advance\pgf@xc-\pgf@x\relax%
+ % Compute the start and end times:
+ \pgfsysanim@compute@start@end%
+ \pgfsysanim@compute@value%
+ \fi%
+ % Test whether a valid interval has been found:
+ \pgfsysanim@valid@snapshot@timefalse%
+ \ifx\pgfsysanim@prev@time\relax%
+ \else\ifx\pgfsysanim@next@time\relax%
+ \else\pgfsysanim@valid@snapshot@timetrue%
+ \fi\fi%
+ \ifpgfsysanim@valid@snapshot@time%
+ % ok, computed later
+ \else%
+ \ifx\pgfsysanim@base@value\pgfutil@empty%
+ \else%
+ % Ah, use base value!
+ \let\pgfsysanim@prev@val\pgfsysanim@base@value%
+ \def\pgfsysanim@prev@time{0}%
+ \let\pgfsysanim@prev@spline\pgfsysanim@default@spline%
+ \let\pgfsysanim@next@val\pgfsysanim@base@value%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@default@spline%
+ \def\pgfsysanim@first@time{-16382}%
+ \let\pgfsysanim@last@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@last@val\pgfsysanim@base@value%
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \pgfsysanim@valid@snapshot@timetrue% counts as valid!
+ \fi%
+ \fi%
+}
+\newif\ifpgfsysanim@cont%
+\newif\ifpgfsysanim@valid@snapshot@time
+\def\pgfsysanim@default@spline{{0}{0}{1}{1}}
+
+\def\pgfsysanim@compute@start@end{%
+ \expandafter\expandafter\expandafter\pgfsysanim@compute@start\csname pgfsysanim@snap@1\endcsname%
+ \expandafter\expandafter\expandafter\pgfsysanim@compute@end\csname pgfsysanim@snap@\the\pgfsysanim@snap@count\endcsname%
+}
+\def\pgfsysanim@compute@start#1#2#3#4#5#6{%
+ \def\pgfsysanim@first@time{#1}%
+}
+\def\pgfsysanim@compute@end#1#2#3#4#5#6{%
+ \def\pgfsysanim@last@time{#1}%
+ \def\pgfsysanim@last@val{#6}%
+}
+
+
+\def\pgfsysanim@compute@value{%
+ % First, are we before start?
+ \ifdim\pgf@xc<\pgfsysanim@first@time pt\relax%
+ % snapshot time (xc) is before start of animation. So, nothing happens:
+ \else%
+ \ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@none%
+ \pgfsysanim@handle@repeat@none%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@normal%
+ \pgfsysanim@handle@repeat@normal%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@indefinite%
+ \pgfsysanim@handle@repeat@indefinite%
+ \else\ifx\pgfsysanim@snap@repeat@kind\pgfsysanim@snap@repeat@dur%
+ \pgfsysanim@handle@repeat@dur%
+ \fi\fi\fi\fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@none{%
+ \ifdim\pgf@xc<\pgfsysanim@last@time pt\relax%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifdim\pgf@xc=\pgfsysanim@last@time pt\relax%
+ % A bit tricky:
+ \ifpgfsysanim@snap@first%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifpgfsysanim@freezeatend%
+ \let\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \let\pgfsysanim@prev@time\pgfsysanim@last@time%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \let\pgfsysanim@next@time\pgfsysanim@last@time%
+ \fi%
+ \fi%
+ \else%
+ % Called when we are past the end.
+ \ifpgfsysanim@freezeatend%
+ \let\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \let\pgfsysanim@prev@time\pgfsysanim@last@time%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \let\pgfsysanim@next@time\pgfsysanim@last@time%
+ \fi%
+ \fi%
+ \fi%
+}
+
+
+\def\pgfsysanim@handle@repeat@indefinite{%
+ \ifdim\pgf@xc<\pgfsysanim@last@time pt\relax%
+ \pgfsysanim@compute@time%
+ \else%
+ % Compute interval length
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \fi%
+}
+{\catcode`\p=12\catcode`\t=12\gdef\Pgfsysanim@sPliTTer#1.#2pt{\Pgfsysanim@seTTer{#1}{#2}}}
+\let\pgfsysanim@splitter\Pgfsysanim@sPliTTer
+\def\Pgfsysanim@seTTer#1#2{%
+ \def\pgfsysanim@repeat@decimal{#1}%
+ \def\pgfsysanim@repeat@frac{.#2}%
+ \ifdim\pgfsysanim@repeat@frac pt=0pt% goto one before:
+ \c@pgf@counta\pgfsysanim@repeat@decimal%
+ \advance\c@pgf@counta by-1\relax%
+ \edef\pgfsysanim@repeat@decimal{\the\c@pgf@counta}%
+ \def\pgfsysanim@repeat@frac{1}%
+ \fi%
+}
+\def\pgfsysanim@repeat@decimal{0}%
+
+
+\def\pgfsysanim@handle@repeat@normal{%
+ % Compute interval length
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ % Cases:
+ \ifdim\pgfmathresult pt<\pgfsysanim@snap@repeat@arg\relax%
+ % Ok! Compute!
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ % Hmm. Freeze?
+ \ifpgfsysanim@freezeatend%
+ \expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifdim\pgfmathresult pt=\pgfsysanim@snap@repeat@arg\relax%
+ \ifpgfsysanim@snap@first%
+ \expandafter\pgfsysanim@splitter\pgfsysanim@snap@repeat@arg%
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \fi%
+ % else: nothing!
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@dur{%
+ \pgf@yb=\pgfsysanim@first@time pt%
+ \advance\pgf@yb by\pgfsysanim@snap@repeat@arg\relax%
+ \ifdim\pgf@xc<\pgf@yb% inside interval
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \pgf@ya\pgf@xc%
+ \advance\pgf@ya by-\pgf@xb%
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgf@ya}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ %
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+ \else%
+ \ifpgfsysanim@freezeatend%
+ \pgfsysanim@handle@repeat@dur@freeze%
+ \else%
+ \ifdim\pgf@xc=\pgf@yb%
+ \ifpgfsysanim@snap@first%
+ \pgfsysanim@handle@repeat@dur@freeze%
+ \fi%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\def\pgfsysanim@handle@repeat@dur@freeze{%
+ \pgf@xa=\pgfsysanim@last@time pt%
+ \pgf@xb=\pgfsysanim@first@time pt%
+ \advance\pgf@xa by-\pgf@xb%
+ % Compute repeat count and fraction:
+ \ifdim\pgf@xa<0.01pt\relax%
+ % Interval too small: Goto end of interval
+ \def\pgfmathresult{1.0}%
+ \else%
+ \pgfmathdivide@{\pgfsysanim@snap@repeat@arg}{\pgf@xa}%
+ \fi%
+ \pgf@x\pgfmathresult pt\relax%
+ \expandafter\pgfsysanim@splitter\the\pgf@x%
+ %
+ \pgf@xc=\pgfsysanim@repeat@frac\pgf@xa%
+ \advance\pgf@xc by\pgf@xb%
+ \pgfsysanim@compute@time%
+}
+
+
+
+
+
+\def\pgfsysanim@compute@time{%
+ % Ok, let us iterate over all points of time.
+ \pgfutil@tempcnta=1\relax%
+ \pgfsysanim@conttrue%
+ \pgfutil@loop%
+ \ifnum\pgfutil@tempcnta>\pgfsysanim@snap@count%
+ \pgfsysanim@contfalse%
+ \else%
+ \expandafter\let\expandafter\pgfsys@temp\csname pgfsysanim@snap@\the\pgfutil@tempcnta\endcsname%
+ \expandafter\pgfsysanim@test@time\pgfsys@temp%
+ \fi%
+ \ifpgfsysanim@cont%
+ \advance\pgfutil@tempcnta by1\relax%
+ \pgfutil@repeat%
+}
+
+
+\def\pgfsysanim@test@time#1#2#3#4#5#6{%
+ % #1 = time in seconds
+ % #2 to #5 = spline controls
+ % #6 = value
+ \ifdim#1pt<\pgf@xc%
+ % snap time not yet reached. Update previous:
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \else%
+ \ifdim#1pt=\pgf@xc%
+ \ifpgfsysanim@snap@first%
+ \ifx\pgfsysanim@next@val\relax%
+ % first? Save!
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \let\pgfsysanim@next@val\pgfsysanim@prev@val%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@prev@spline%
+ \pgfsysanim@contfalse%
+ % else, do nothing
+ \fi
+ \else%
+ % always overwrite:
+ \def\pgfsysanim@prev@val{#6}%
+ \def\pgfsysanim@prev@time{#1}%
+ \def\pgfsysanim@prev@spline{{#2}{#3}{#4}{#5}}%
+ \let\pgfsysanim@next@val\pgfsysanim@prev@val%
+ \let\pgfsysanim@next@time\pgfsysanim@prev@time%
+ \let\pgfsysanim@next@spline\pgfsysanim@prev@spline%
+ \fi%
+ \else%
+ % we passed the time!
+ \ifx\pgfsysanim@next@val\relax%
+ % first? Then save!
+ \def\pgfsysanim@next@val{#6}%
+ \def\pgfsysanim@next@time{#1}%
+ \def\pgfsysanim@next@spline{{#2}{#3}{#4}{#5}}%
+ \else%
+ % ignore later times!
+ \pgfsysanim@contfalse%
+ \fi%
+ \fi%
+ \fi%
+}
+
+\let\pgfsysanim@prev@val\relax%
+\let\pgfsysanim@prev@time\relax%
+\let\pgfsysanim@next@val\relax%
+\let\pgfsysanim@next@time\relax%
+
+% Help function
+\def\pgfsysanim@attach#1#2#3{%
+ \expandafter\pgfsysanim@prep@beg\expandafter{\pgfsysanim@first@time}{#2}{#3}%
+ \expandafter\def\expandafter\pgfsysanim@code@main\expandafter{\csname pgfsysanim@main@of@\pgfsysanim@whom@id @\pgfsysanim@whom@type @#1\endcsname}%
+ \expandafter\ifx\pgfsysanim@code@main\relax%
+ \edef\pgfsysanim@code@begin{%
+ \let\noexpand\pgfsysanim@c@begin\noexpand\pgfutil@empty%
+ \let\noexpand\pgfsysanim@c@end\noexpand\pgfutil@empty%
+ \pgfsysanim@lasttime-16383pt\relax%
+ \expandafter\noexpand\pgfsysanim@code@main%
+ \global\let\expandafter\noexpand\pgfsysanim@code@main\relax%
+ \noexpand\pgfsysanim@c@begin%
+ }%
+ \let\pgfsysanim@code@end\pgfsysanim@code@closer%
+ \expandafter\global\expandafter\let\pgfsysanim@code@main\pgfutil@empty%
+ \else%
+ \let\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@end\relax%
+ \fi%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\def%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\pgfsysanim@new@main%
+ \expandafter\expandafter\expandafter\expandafter\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@code@main\pgfsysanim@add@main}
+ \expandafter\global\expandafter\let\pgfsysanim@code@main\pgfsysanim@new@main%
+}
+\def\pgfsysanim@code@closer{\pgfsysanim@c@end}
+
+\def\pgfsysanim@prep@beg#1#2#3{%
+ \edef\pgfsysanim@add@main{%
+ \noexpand\ifdim\pgfsysanim@lasttime>#1pt%
+ % ignore!
+ \noexpand\else%
+ \pgfsysanim@lasttime#1pt%
+ \def\noexpand\pgfsysanim@c@begin{#2}%
+ \def\noexpand\pgfsysanim@c@end{#3}%
+ \noexpand\fi%
+ }
+}
+
+\def\pgfsysanim@prep@beg@special#1#2{%
+ \def\pgfsysanim@add@main{%
+ \ifdim\pgfsysanim@lasttime>#1pt%
+ % ignore!
+ \else%
+ \pgfsysanim@lasttime#1pt%
+ \def\pgfsysanim@c@begin{#2}%
+ \fi%
+ }
+}
+
+
+
+\def\pgfsysanim@attach@special#1#2{%
+ \expandafter\expandafter\expandafter\pgfsysanim@prep@beg@special\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@first@time\expandafter}\expandafter{#2}%
+ \ifx#1\relax%
+ \def#1{%
+ \pgfsysanim@lasttime-16383pt\relax%
+ \let\pgfsysanim@c@begin\pgfutil@empty%
+ }%
+ \fi%
+ \expandafter\expandafter\expandafter\gdef\expandafter\expandafter\expandafter#1\expandafter\expandafter\expandafter{\expandafter#1\pgfsysanim@add@main}%
+}
+
+
+
+\newdimen\pgfsysanim@lasttime
+
+
+\def\pgfsysanim@add@trans{%
+ \ifx\pgfsysanim@snap@canvas@transform@pre\relax%
+ \else%
+ \ifx\pgfsysanim@code@begin\relax%
+ \let\pgfsysanim@code@begin\pgfutil@empty%
+ \fi%
+ \pgfsysanim@add@trans@%
+ \fi%
+}
+\def\pgfsysanim@add@trans@{%
+ \toks0\expandafter{\pgfsysanim@snap@canvas@transform@pre}%
+ \toks1\expandafter{\pgfsysanim@code@begin}%
+ \toks2\expandafter{\pgfsysanim@snap@canvas@transform@post}%
+ \edef\pgfsysanim@code@begin{{\the\toks0 \the\toks1 \the\toks2}}%
+}
+
+% The code for the different attributes
+
+\def\pgfsysanim@prep@attr@opacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{opacity}{\noexpand\pgfsys@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@fillopacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{fillopacity}{\noexpand\pgfsys@fill@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@strokeopacity{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@attach{strokeopacity}{\noexpand\pgfsys@stroke@opacity{\pgfsysanim@x@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@visibility{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@text%
+ \ifx\pgfsysanim@text@val\pgf@hidden@text%
+ \pgfsysanim@attach{visibility}{\noexpand\pgfsys@begininvisiblescope}{\noexpand\pgfsys@endinvisiblescope}%
+ \else%
+ \pgfsysanim@attach{visibility}{}{}%
+ \fi%
+ \fi%
+}
+\def\pgf@hidden@text{hidden}
+
+\def\pgfsysanim@prep@attr@linewidth{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@dimension%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{16382}%
+ \pgfsysanim@attach{linewidth}{\noexpand\pgfsys@setlinewidth{\pgfsysanim@x@val pt}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@dash{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@dash%
+ \pgfsysanim@attach{dash}{\noexpand\pgfsys@setdash{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@translate{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@translate%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformshift{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+
+\def\pgfsysanim@prep@attr@scale{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scale%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformxyscale{\pgfsysanim@x@val}{\pgfsysanim@y@val}}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@rotate{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathsin@{\pgfsysanim@x@val}%
+ \let\pgftransform@sin=\pgfmathresult%
+ \pgfmathcos@{\pgfsysanim@x@val}%
+ \let\pgftransform@cos=\pgfmathresult%
+ \pgf@x=\pgftransform@sin pt%
+ \pgf@xa=-\pgf@x%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{\pgftransform@cos}{\pgftransform@sin}{\pgf@sys@tonumber{\pgf@xa}}{\pgftransform@cos}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@skewx{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathtan@{\pgfsysanim@x@val}%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{0}{\pgfmathresult}{1}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@skewy{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@scalar%
+ {%
+ \pgfmathtan@{\pgfsysanim@x@val}%
+ \edef\pgfsysanim@code@begin{\noexpand\pgfsys@transformcm{1}{\pgfmathresult}{0}{1}{0pt}{0pt}}%
+ \expandafter}%
+ \expandafter\def\expandafter\pgfsysanim@code@begin\expandafter{\pgfsysanim@code@begin}%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+
+\def\pgfsysanim@prep@attr@motion{%
+ \ifx\pgfsysanim@base@value\pgfutil@empty%
+ \else%
+ \pgferror{You may not provide a base value for a motion}%
+ \let\pgfsysanim@base@value\pgfutil@empty%
+ \fi%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@motion%
+ \expandafter\pgfsysanim@prep@attr@motion@\pgfsysanim@motion@trans%
+ \fi%
+ \pgfsysanim@add@trans%
+}
+\def\pgfsysanim@prep@attr@motion@#1#2#3#4#5#6{%
+ \ifpgfsysanim@rotatealong%
+ \def\pgfsysanim@code@begin{\pgfsys@transformcm{#1}{#2}{#3}{#4}{#5}{#6}}%
+ \else%
+ \def\pgfsysanim@code@begin{\pgfsys@transformshift{#5}{#6}}%
+ \fi%
+}
+
+
+\def\pgfsysanim@prep@attr@strokecolor{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{strokecolor}{\noexpand\pgfsys@color@rgb@stroke{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@fillcolor{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{fillcolor}{\noexpand\pgfsys@color@rgb@fill{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\def\pgfsysanim@prep@attr@color{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@color%
+ \pgfsysanim@cap@scalar{\pgfsysanim@x@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@y@val}{0}{1}%
+ \pgfsysanim@cap@scalar{\pgfsysanim@z@val}{0}{1}%
+ \pgfsysanim@attach{color}{\noexpand\pgfsys@color@rgb{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}}{}%
+ \fi%
+}
+
+\newif\ifpgfsys@animation@view@hooked
+
+\def\pgfsysanim@prep@attr@viewbox{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@viewbox%
+ \pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{%
+ \ifpgfsys@animation@view@hooked%
+ \else%
+ % Hook into viewbox systems layer commands
+ \let\pgfsys@viewboxmeet@orig\pgfsys@viewboxmeet%
+ \let\pgfsys@viewboxmeet\pgfsysanim@hooked@viewboxmeet%
+ \let\pgfsys@viewboxslice@orig\pgfsys@viewboxslice%
+ \let\pgfsys@viewboxslice\pgfsysanim@hooked@viewboxslice%
+ \pgfsys@animation@view@hookedtrue%
+ \fi%
+ }{}{}%
+ \edef\pgfsysanim@temp{{\pgfsysanim@x@val}{\pgfsysanim@y@val}{\pgfsysanim@z@val}{\pgfsysanim@w@val}}%
+ \expandafter\pgfsysanim@attach@special\csname pgfsysanim@hook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@temp%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxmeet#1#2#3#4#5#6#7#8{%
+ \expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \pgfsys@viewboxmeet@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \else%
+ \csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname%
+ \ifx\pgfsysanim@c@begin\pgfutil@empty%
+ % should not happen, but, then, ignore
+ \else%
+ \expandafter\pgfsysanim@hooked@viewboxmeet@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}%
+ \fi%
+ \expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxmeet@#1#2#3#4#5#6#7#8{%
+ \pgfsys@viewboxmeet@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+}
+\def\pgfsysanim@hooked@viewboxslice#1#2#3#4#5#6#7#8{%
+ \expandafter\ifx\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \pgfsys@viewboxslice@orig{#1}{#2}{#3}{#4}{#5}{#6}{#7}{#8}%
+ \else%
+ \csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname%
+ \expandafter\pgfsysanim@hooked@viewboxslice@\pgfsysanim@c@begin{#1}{#2}{#3}{#4}%
+ \expandafter\global\expandafter\let\csname pgfsysanim@hook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+}
+\def\pgfsysanim@hooked@viewboxslice@#1#2#3#4#5#6#7#8{%
+ \pgfsys@viewboxslice@orig{#5}{#6}{#7}{#8}{#1}{#2}{#3}{#4}%
+}
+
+
+\newif\ifpgfsys@animation@path@hooked
+
+\def\pgfsysanim@prep@attr@path{%
+ \ifpgfsysanim@valid@snapshot@time%
+ \pgfsysanim@comp@path%
+ \pgfsys@attach@to@id{\pgfsysanim@whom@id}{}{%
+ \ifpgfsys@animation@path@hooked%
+ \else%
+ % Hook into path systems layer commands
+ \let\pgfsys@discardpath@orig\pgfsys@discardpath%
+ \let\pgfsys@stroke@orig\pgfsys@stroke%
+ \let\pgfsys@fill@orig\pgfsys@fill%
+ \let\pgfsys@fillstroke@orig\pgfsys@fillstroke%
+ \let\pgfsys@closestroke@orig\pgfsys@closestroke%
+ \let\pgfsys@discardpath\pgfsys@discardpath@hook%
+ \let\pgfsys@stroke\pgfsys@stroke@hook%
+ \let\pgfsys@fill\pgfsys@fill@hook%
+ \let\pgfsys@fillstroke\pgfsys@fillstroke@hook%
+ \let\pgfsys@closestroke\pgfsys@closestroke@hook%
+ \pgfsys@animation@path@hookedtrue%
+ \fi%
+ }{}{}%
+ \expandafter\pgfsysanim@attach@special\csname pgfsysanim@phook@for@\pgfsys@id@ref{\pgfsysanim@whom@id}{\pgfsysanim@whom@type}\endcsname\pgfsysanim@path@all%
+ \fi%
+}
+\def\pgfsys@stroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@stroke@orig}
+\def\pgfsys@fill@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@fill@orig}
+\def\pgfsys@fillstroke@hook{\pgfsysanim@with@tipstrue\pgfsysanim@path@hooks\pgfsys@fillstroke@orig}
+\def\pgfsys@closestroke@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@closestroke@orig}
+\def\pgfsys@discardpath@hook{\pgfsysanim@with@tipsfalse\pgfsysanim@path@hooks\pgfsys@discardpath@orig}
+
+\newif\ifpgfsysanim@with@tips
+
+\def\pgfsysanim@path@hooks#1{%
+ {%
+ \expandafter\ifx\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ #1%
+ \else%
+ \pgfsys@discardpath@orig%
+ \csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname%
+ \pgfsysanim@c@begin%
+ \pgfsysanim@path@val%
+ #1%
+ \ifpgfsysanim@with@tips%
+ \ifx\pgfsysanim@path@val\pgfutil@empty\else%
+ \pgfsysanim@prepare@end@of@path%
+ \begingroup%
+ \pgfsysanim@prepare@start@of@path%
+ \pgfsysanim@add@marker@at@start%
+ \endgroup%
+ \pgfsysanim@add@marker@at@end%
+ \fi%
+ \fi%
+ \expandafter\global\expandafter\let\csname pgfsysanim@phook@for@\pgfsys@id@refcurrent\endcsname\relax%
+ \fi%
+ }%
+}
+
+
+\def\pgfsysanim@prepare@start@of@path{%
+ \ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else
+ %
+ % Step 1: Split
+ %
+ \ifx\pgfprocessresultpathsuffix\relax%
+ % Ok, still need to compute the split:
+ \pgfprocesssplitpath{\pgf@arrowpath}%
+ \fi%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@start\pgfprocessresultpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@start%
+ \fi%
+}
+\def\pgfsysanim@add@marker@at@start{%
+ \ifx\pgfsysanim@snap@tip@start\pgfutil@empty\else
+ %
+ % Step 4: draw
+ %
+ {%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@marker@use{\pgfsysanim@snap@tip@start}%
+ \pgfsys@endscope%
+ }%
+ \fi%
+}
+
+
+\def\pgfsysanim@prepare@end@of@path{%
+ \let\pgfprocessresultpathsuffix\relax% flag that nothing has happened...
+ \let\pgfprocessresultsubpathsuffix\relax%
+ \pgf@precise@shorteningfalse%
+ \edef\pgf@path@shortening@distance{0pt}%
+ \ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else
+ %
+ % Step 1: Split
+ %
+ \pgfprocesssplitpath{\pgfsysanim@path@val}%
+ \pgfprocesssplitsubpath{\pgfprocessresultpathsuffix}%
+ %
+ % Step 2: extract
+ %
+ \expandafter\pgf@parse@end\pgfprocessresultsubpathsuffix\pgf@stop\pgf@stop\pgf@stop%
+ %
+ % Step 3: prep
+ %
+ \pgf@prep@end%
+ \fi%
+}
+\def\pgfsysanim@add@marker@at@end{%
+ \ifx\pgfsysanim@snap@tip@end\pgfutil@empty\else
+ %
+ % Step 4: draw
+ %
+ {%
+ \pgftransformreset%
+ \pgftransformarrow{\pgfqpoint{\pgf@xc}{\pgf@yc}}{\pgfqpoint{\pgf@xb}{\pgf@yb}}%
+ \pgfsys@beginscope%
+ \pgflowlevelsynccm%
+ \pgfsys@marker@use{\pgfsysanim@snap@tip@end}%
+ \pgfsys@endscope%
+ }%
+ \fi%
+}
+
+
+
+%
+% Interpolation functions
+%
+
+% Scalar interpolation
+
+\def\pgfsysanim@comp@scalar{%
+ \pgfsysanim@compute@fractions%
+ \pgfsysanim@mix@scalar%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@prev@val\pgfsysanim@x@val%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \pgfsysanim@mix@scalar%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@one{1}
+
+\def\pgfsysanim@mix@scalar{%
+ \pgf@x\pgfsysanim@prev@val pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+}
+\def\pgfsysanim@cap@scalar#1#2#3{%
+ \ifdim#1 pt<#2 pt%
+ \def#1{#2}%
+ \else\ifdim#1 pt>#3 pt%
+ \def#1{#3}%
+ \fi\fi%
+}
+
+
+% Scale interpolation
+
+\def\pgfsysanim@comp@scale{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \expandafter\pgfsysanim@mix@scale\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@scale#1#2#3#4{%
+ \pgf@x#1pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+% Dimension interpolation
+
+\def\pgfsysanim@comp@dimension{%
+ \pgfsysanim@compute@fractions%
+ \pgfsysanim@mix@dimension%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \def\pgfsysanim@prev@val{\pgfsysanim@x@val pt}%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \let\pgfsysanim@next@val\pgfsysanim@last@val%
+ \pgfsysanim@mix@dimension%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@dimension{%
+ \pgf@x\pgfsysanim@prev@val%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+
+% Translate interpolation
+
+\def\pgfsysanim@comp@translate{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \edef\pgfsysanim@prev@val{{\pgfsysanim@x@val pt}{\pgfsysanim@y@val pt}}
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@translate\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@translate#1#2#3#4{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+
+% Color interpolation
+
+\def\pgfsysanim@comp@color{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \expandafter\pgfsysanim@mix@color\expandafter\pgfsysanim@x@val\expandafter\pgfsysanim@y@val\expandafter\pgfsysanim@z@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@color#1#2#3#4#5#6{%
+ \pgf@x#1pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#2pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#5pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\pgf@sys@tonumber\pgf@x}%
+ \pgf@x#3pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#6pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@z@val{\pgf@sys@tonumber\pgf@x}%
+}
+
+
+% Text interpolation
+
+\def\pgfsysanim@comp@text{%
+ \let\pgfsysanim@text@val\pgfsysanim@prev@val%
+}
+
+
+
+% Dash interpolation
+
+\def\pgfsysanim@comp@dash{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \ifnum\pgfsysanim@repeat@decimal=0\else%
+ \let\pgfsysanim@frac@b\pgfsysanim@one%
+ \let\pgfsysanim@frac@a\pgfsysanim@repeat@decimal%
+ \edef\pgfsysanim@prev@val{{\pgfsysanim@dash@vals}{\pgfsysanim@x@val pt}}%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@dash\expandafter\pgfsysanim@prev@val\pgfsysanim@last@val%
+ \fi%
+ \fi%
+}
+\def\pgfsysanim@mix@dash#1#2#3#4{%
+ \pgf@x#2\relax%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#4\relax%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \let\pgfsysanim@dash@vals\pgfutil@empty%
+ \pgfsysanim@parse@dash#1,\pgf@stop#3,\pgf@stop%
+}
+\def\pgfsysanim@parse@dash{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@dash@done\pgfsysanim@parse@dash@first}
+\def\pgfsysanim@parse@dash@done\pgf@stop\pgf@stop{}%
+\def\pgfsysanim@parse@dash@first#1,#2\pgf@stop#3\pgf@stop{%
+ \pgf@x#1\relax%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgfsysanim@parse@dash@second#3\pgf@stop{#2}%
+}
+\def\pgfsysanim@parse@dash@second#1,#2\pgf@stop#3{%
+ \pgf@y#1\relax%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \def\pgfsys@temp{#2}%
+ \edef\pgfsysanim@dash@vals{\pgfsysanim@dash@vals\the\pgf@x\ifx\pgfsys@temp\pgfutil@empty\else,\fi}%
+ \pgfsysanim@parse@dash#3\pgf@stop#2\pgf@stop%
+}
+
+
+
+
+% Viewbox interpolation
+
+\def\pgfsysanim@comp@viewbox{%
+ \pgfsysanim@compute@fractions%
+ \expandafter\expandafter\expandafter\pgfsysanim@mix@viewbox\expandafter\pgfsysanim@prev@val\pgfsysanim@next@val%
+ \ifpgfsysanim@accumulate%
+ \pgferror{viewbox animations cannot accumulate / add}%
+ \fi%
+}
+\def\pgfsysanim@mix@viewbox#1#2#3#4#5#6#7#8{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#5%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\the\pgf@x}%
+ \pgf@x#2%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#6%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@y@val{\the\pgf@x}%
+ \pgf@x#3%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#7%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@z@val{\the\pgf@x}%
+ \pgf@x#4%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#8%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@w@val{\the\pgf@x}%
+}
+
+
+
+
+% Path interpolation
+
+\def\pgfsysanim@comp@path{%
+ \pgfsysanim@compute@fractions%
+ \edef\pgfsysanim@path@tips{%
+ \def\noexpand\pgfsysanim@snap@tip@start{\pgfsysanim@snap@tip@start}%
+ \def\noexpand\pgfsysanim@snap@tip@end{\pgfsysanim@snap@tip@end}%
+ }%
+ \let\pgfsysanim@path@val\pgfutil@empty%
+ \expandafter\expandafter\expandafter\pgfsysanim@parse@path\expandafter\pgfsysanim@prev@val\expandafter\pgf@stop\expandafter\relax\pgfsysanim@next@val\pgf@stop\relax%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@all\expandafter\expandafter\expandafter{\expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter}\pgfsysanim@path@tips}%
+ \ifpgfsysanim@accumulate%
+ \pgferror{path animations cannot accumulate / add}%
+ \fi%
+}
+\def\pgfsysanim@parse@path{\pgfutil@ifnextchar\pgf@stop\pgfsysanim@parse@path@done\pgfsysanim@parse@path@first}
+\def\pgfsysanim@parse@path@done\pgf@stop\relax\pgf@stop\relax{}%
+\def\pgfsysanim@parse@path@first{\pgfutil@ifnextchar\bgroup\pgfsysanim@parse@path@first@num\pgfsysanim@parse@path@token}
+\def\pgfsysanim@parse@path@token#1#2\relax#3#4\relax{%
+ \expandafter\def\expandafter\pgfsysanim@path@val\expandafter{\pgfsysanim@path@val#1}%
+ \pgfsysanim@parse@path#2\relax#4\relax%
+}
+\def\pgfsysanim@parse@path@first@num#1#2\relax#3#4\relax{%
+ \pgf@x#1%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y#3%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\pgfsysanim@path@val\expandafter\expandafter\expandafter{\expandafter\pgfsysanim@path@val\expandafter{\the\pgf@x}}%
+ \pgfsysanim@parse@path#2\relax#4\relax%
+}
+
+
+
+% Motion interpolation
+
+\def\pgfsysanim@comp@motion{%
+ \pgfsysanim@compute@fractions%
+ \pgf@x\pgfsysanim@prev@val pt%
+ \pgf@x\pgfsysanim@frac@b\pgf@x%
+ \pgf@y\pgfsysanim@next@val pt%
+ \advance\pgf@x by\pgfsysanim@frac@a\pgf@y%
+ \edef\pgfsysanim@x@val{\pgf@sys@tonumber\pgf@x}%
+ \ifdim\pgfsysanim@x@val pt=1pt%
+ \def\pgfsysanim@x@val{0.9999}% because of rounding problems in decorations
+ \fi%
+ \pgf@relevantforpicturesizefalse%
+ \pgfdecoratepath{pgfsysanim@motion}{%
+ \pgfsyssoftpath@setcurrentpath\pgfsysanim@snap@movealong%
+ }%
+ \ifpgfsysanim@accumulate%
+ \pgferror{motion animations cannot accumulate / add}%
+ \fi%
+}
+\pgfdeclaredecoration{pgfsysanim@motion}{s}{%
+ \state{s}[width=\pgfsysanim@x@val\pgfdecoratedremainingdistance,next state=final]{}%
+ \state{final}{\pgfgettransform\pgfsysanim@motion@trans\global\let\pgfsysanim@motion@trans\pgfsysanim@motion@trans}%
+}
+
+
+
+
+
+
+% Compute fractions and splines:
+
+\def\pgfsysanim@compute@fractions{%
+ \ifdim\pgf@xc=\pgfsysanim@prev@time pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \pgfmathsubtract@{\pgfsysanim@next@time}{\pgfsysanim@prev@time}%
+ \ifdim\pgfmathresult pt<0.01pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \let\pgfsysanim@divby\pgfmathresult%
+ \pgfmathsubtract@{\pgf@xc}{\pgfsysanim@prev@time}%
+ \pgfmathdivide@{\pgfmathresult}{\pgfsysanim@divby}%
+ \ifdim\pgfmathresult pt<0pt\def\pgfmathresult{0}\fi%
+ \ifdim\pgfmathresult pt>1pt\def\pgfmathresult{1}\fi%
+ \let\pgfsysanim@frac@a\pgfmathresult%
+ \pgfmathsubtract@{1}{\pgfmathresult}%
+ \let\pgfsysanim@frac@b\pgfmathresult%
+ \fi%
+ \fi%
+ \ifdim\pgfsysanim@frac@a pt=0pt%
+ \else\ifdim\pgfsysanim@frac@b pt=0pt%
+ \else%
+ \expandafter\expandafter\expandafter\pgfsysanim@apply@spline\expandafter\pgfsysanim@prev@spline\pgfsysanim@next@spline%
+ \fi\fi%
+}
+
+
+\def\pgfsysanim@apply@spline#1#2#3#4#5#6#7#8{%
+ \edef\pgfsys@temp{#3,#5,#4,#6}%
+ \ifx\pgfsys@temp\pgfsysanim@id@spline%
+ \else%
+ \def\pgfsysanim@prev@out@time{{#3}{#4}}%
+ \def\pgfsysanim@next@in@time{{#5}{#6}}%
+ \ifx\pgfsysanim@prev@out@time\pgfsys@stay@text%
+ \pgfsysanim@jump@splines%
+ \else\ifx\pgfsysanim@next@in@time\pgfsys@jump@text%
+ \pgfsysanim@jump@splines%
+ \else%
+ \pgf@xa#3pt%
+ \pgf@xb#5pt%
+ % #4 is val supoort a
+ % #6 is val support b
+ % our first approximation
+ \let\pgfsysanim@t\pgfsysanim@frac@a%
+ \let\pgfsysanim@s\pgfsysanim@frac@b%
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step2
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ % Third newton:
+ \pgfsysanim@eval@spline%
+ \edef\pgfsysanim@ft{\the\pgf@x}%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by256sp%
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ \pgfsysanim@eval@spline%
+ % Ok, now do Newton one step2
+ \advance\pgf@x by-\pgfsysanim@ft%
+ \pgf@x256\pgf@x%
+ % \pgf@x is f'(t)
+ % must compute t - (f(t)-frac@a)/f'(t)
+ \pgf@ya\pgfsysanim@ft%
+ \advance\pgf@ya by-\pgfsysanim@frac@a pt%
+ \pgf@yb\pgf@x
+ \pgfmathreciprocal@{\pgf@yb}%
+ \ifdim\pgfmathresult pt>2.5pt%
+ \def\pgfmathresult{2.5}%
+ \fi%
+ \ifdim\pgfmathresult pt<-2.5pt%
+ \def\pgfmathresult{-2.5}%
+ \fi%
+ \pgf@x\pgfsysanim@t pt%
+ \advance\pgf@x by-\pgfmathresult\pgf@ya%
+ % \pgf@x is new t:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@t{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@s{\pgf@sys@tonumber\pgf@y}%
+ % now, evaluate target:
+ \pgf@xa#4pt%
+ \pgf@xb#6pt%
+ \pgfsysanim@eval@spline%
+ % \pgf@x is result:
+ \pgf@y1pt%
+ \advance\pgf@y by-\pgf@x%
+ \edef\pgfsysanim@frac@a{\pgf@sys@tonumber\pgf@x}%
+ \edef\pgfsysanim@frac@b{\pgf@sys@tonumber\pgf@y}%
+ \fi\fi%
+ \fi%
+}
+\def\pgfsysanim@id@spline{0,1,0,1}
+
+\def\pgfsysanim@eval@spline{%
+ % Iteration one: (0,#1,#2,1) reduced to (ya,yb,yc)
+ \pgf@ya\pgfsysanim@t\pgf@xa%
+ \pgf@yb\pgfsysanim@t\pgf@xb%
+ \advance\pgf@yb by\pgfsysanim@s\pgf@xa%
+ \pgf@yc\pgfsysanim@t pt%
+ \advance\pgf@yc by\pgfsysanim@s\pgf@xb%
+ % Iteration two: (ya,yb,yc) recuded to (y,xc)
+ \pgf@y\pgfsysanim@t\pgf@yb%
+ \advance\pgf@y by\pgfsysanim@s\pgf@ya%
+ \pgf@xc\pgfsysanim@t\pgf@yc%
+ \advance\pgf@xc by\pgfsysanim@s\pgf@yb%
+ % Iteration three: (y,xc) recuded to (x)
+ \pgf@x\pgfsysanim@t\pgf@xc%
+ \advance\pgf@x by\pgfsysanim@s\pgf@y%
+}
+
+\def\pgfsysanim@jump@splines{%
+ \ifx\pgfsysanim@prev@out@time\pgfsys@stay@text%
+ \ifx\pgfsysanim@next@in@time\pgfsys@jump@text%
+ \ifdim\pgfsysanim@frac@a pt<0.5pt%
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \else%
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \fi%
+ \else%
+ % Only stay, so go to begin
+ \def\pgfsysanim@frac@a{0}%
+ \def\pgfsysanim@frac@b{1}%
+ \fi%
+ \else
+ % Only jump, so go to end
+ \def\pgfsysanim@frac@a{1}%
+ \def\pgfsysanim@frac@b{0}%
+ \fi%
+}
+
+
+\endinput
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
index b34ae3bcdc7..09e6eed0a84 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsysprotocol.code.tex,v 1.4 2006/10/16 22:32:59 tantau Exp $
+\ProvidesFileRCS{pgfsysprotocol.code.tex}
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
index 0b6310873ab..c52f4d49de8 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex
@@ -7,7 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsyssoftpath.code.tex,v 1.9 2013/09/09 10:05:41 tantau Exp $
+\ProvidesFileRCS{pgfsyssoftpath.code.tex}
% This package provides the pgf system path abstraction layer. This