diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex | 823 |
1 files changed, 780 insertions, 43 deletions
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 |