summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-postscript.def170
1 files changed, 169 insertions, 1 deletions
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 0f6981d04da..81b062a6a6e 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
@@ -1,4 +1,4 @@
-\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.6 2005/10/18 18:03:38 tantau Exp $
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys-common-postscript.def,v 1.7 2005/10/25 08:18:14 tantau Exp $
% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>.
%
@@ -148,6 +148,174 @@
\pgfsysprotocol@literal{#1 .pgfsetstrokeopacityalpha}
}
+% Objects
+\newcount\pgf@objectcount
+\def\pgfsys@defobject#1#2#3#4{%
+ \global\advance\pgf@objectcount by 1%
+ \expandafter\xdef\csname#1\endcsname{\the\pgf@objectcount}%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
+ {%
+ \pgfsysprotocol@setcurrentprotocol\@empty%
+ \pgfsysprotocol@bufferedtrue%
+ #4%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@@temp%
+ \pgf@sys@postscript@object{/pgf\csname#1\endcsname{gsave exec \pgfsys@@temp\space grestore} bind def}%
+ }%
+ \pgfsysprotocol@setcurrentprotocol\pgfsys@temp%
+}
+\def\pgfsys@useobject#1#2{%
+ \pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
+ {%
+ \pgfsysprotocol@setcurrentprotocol\@empty%
+ \pgfsysprotocol@bufferedfalse%
+ #2%
+ \pgfsysprotocol@invokecurrentprotocol%
+ \pgfsys@invoke{pgf\csname#1\endcsname}%
+ }%
+ \pgfsysprotocol@setcurrentprotocol\pgfsys@temp}
+
+% Shadings
+
+\def\pgfsys@horishading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \setlength\pgf@x{#2}%
+ \pgf@xa=\pgf@x%
+ \pgf@sys@bp@correct{\pgf@x}%
+ \pgf@y=\pgf@max%
+ \pgf@sys@bp@correct{\pgf@y}%
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{\hbox to \the\pgf@max{%
+ \noexpand\vrule width0pt height\the\pgf@xa%
+ \noexpand\pgfsys@beginpurepicture%
+ \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@y}{\the\pgf@x}%
+ \noexpand\pgfsys@clipnext%
+ \noexpand\pgfsys@discardpath%
+ \noexpand\pgfsys@invoke{\pgf@domb\space \pgf@sys@tonumber{\pgf@x} pgfH \pgf@psfuncs\space pop}%
+ \hss%
+ \noexpand\pgfsys@endpurepicture}}%
+ }%
+}
+\def\pgfsys@vertshading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \setlength\pgf@x{#2}%
+ \pgf@xa=\pgf@x%
+ \pgf@sys@bp@correct{\pgf@x}%
+ \pgf@y=\pgf@max%
+ \pgf@sys@bp@correct{\pgf@y}%
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{\hbox to\the\pgf@xa{%
+ \noexpand\vrule width0pt height\the\pgf@max%
+ \noexpand\pgfsys@beginpurepicture%
+ \noexpand\pgfsys@rect{0pt}{0pt}{\the\pgf@x}{\the\pgf@y}%
+ \noexpand\pgfsys@clipnext%
+ \noexpand\pgfsys@discardpath%
+ \noexpand\pgfsys@invoke{\pgf@domb\space \pgf@sys@tonumber{\pgf@x} pgfV \pgf@psfuncs\space pop}%
+ \hss%
+ \noexpand\pgfsys@endpurepicture}}%
+ }%
+}
+\def\pgfsys@radialshading#1#2#3{%
+ {%
+ \pgf@parsefunc{#3}%
+ \pgf@process{#2}%
+ \pgf@xa=2\pgf@max%
+ \pgf@sys@bp@correct{\pgf@max}%
+ \advance\pgf@x by \pgf@max%
+ \advance\pgf@y by \pgf@max%
+ \expandafter\xdef\csname @pgfshading#1!\endcsname{\hbox to \the\pgf@xa{%
+ \noexpand\vrule width0pt height\the\pgf@xa%
+ \noexpand\pgfsys@beginpurepicture%
+ \noexpand\pgfsys@invoke{%
+ \pgf@domb\space \pgf@sys@tonumber{\pgf@y} \pgf@sys@tonumber{\pgf@x} \pgf@sys@tonumber{\pgf@max} pgfR1
+ \pgf@psfuncs\space \pgf@firstcolor\space \pgf@doma\space pgfR2}%
+ \hss%
+ \noexpand\pgfsys@endpurepicture}}%
+ }%
+}
+
+\AtBeginDocument{
+ % Parameters to horizontal pre axishade: \pgf@domb x
+ \pgf@sys@postscript@header{/pgfH{%
+ /pgfheight exch def 0.75 setlinewidth [] 0 setdash
+ /pgfshade {pgfA} def /pgfdir { dup 0 moveto
+ dup 5 index lineto } bind def} bind def}%
+
+ % Parameters to vertical pre axishade: \pgf@domb x
+ \pgf@sys@postscript@header{/pgfV{%
+ /pgfheight exch def 0.75 setlinewidth [] 0 setdash
+ /pgfshade {pgfA} def /pgfdir { dup 0 exch moveto dup 5 index
+ exch lineto } bind def} bind def}%
+
+ % Parameters to axishade: end x, start x, r-, g-, b- of first color, r-, g-, b- of second color
+ % Stack afterwards: end x
+ \pgf@sys@postscript@header{/pgfA{
+ /pgfdiff 8 index round cvi 8 index round cvi sub 2 mul 1 add def
+ 2 index 6 index sub pgfdiff div % put red-step on stack
+ 2 index 6 index sub pgfdiff div % put green-step on stack
+ 2 index 6 index sub pgfdiff div % put green-step on stack
+ pgfheight 9 index 9 index 9 index 14 index
+ pgfdiff {
+ 3 index 3 index 3 index setrgbcolor % Set color
+ pgfdir
+ stroke
+ 4 -1 roll 7 index add % red += incred
+ 4 -1 roll 6 index add % green += incgreen
+ 4 -1 roll 5 index add % blue += incblue
+ 4 -1 roll .5 sub % x += 0.5
+ } repeat
+ mark 15 1 roll cleartomark exch pop % leave only start x on stack
+ }bind def }
+
+ % Parameters to radialshade pre: \pgf@domb y x max
+ \pgf@sys@postscript@header{/pgfR1{
+ newpath dup dup dup 0 360 arc clip newpath
+ dup /pgfendx exch def
+ /pgfendy exch def
+ 0.875 setlinewidth
+ [] 0 setdash
+ /pgfshade {pgfR} def
+ /pgfstartx exch def
+ /pgfstarty exch def
+ /pgfdiffx pgfendx pgfstartx sub def
+ /pgfdiffy pgfendy pgfstarty sub def
+ dup /pgfdomb exch def
+ }bind def }
+
+ % Parameters to radialshade post: \pgf@firstcolor \pgf@doma
+ \pgf@sys@postscript@header{/pgfR2{
+ newpath 0.5 add pgfcircx pgfcircy 3 2 roll 0 360 arc
+ setrgbcolor fill pop}bind def }%
+
+ % Parameters to radialshade: end x, start x, r-, g-, b- of first color, r-, g-, b- of second color
+ % Stack afterwards: end x
+ \pgf@sys@postscript@header{/pgfR{
+ /pgfdiff 8 index round cvi 8 index round cvi sub 4 mul 1 add def
+ /pgfcircx pgfstartx 9 index pgfdiffx pgfdomb div mul add def
+ /pgfcircy pgfstarty 9 index pgfdiffy pgfdomb div mul add def
+ /pgfcircxe pgfstartx 8 index pgfdiffx pgfdomb div mul add def
+ /pgfcircye pgfstarty 8 index pgfdiffy pgfdomb div mul add def
+ /pgfxstep pgfcircxe pgfcircx sub pgfdiff div def
+ /pgfystep pgfcircye pgfcircy sub pgfdiff div def
+ 2 index 6 index sub pgfdiff div % put red-step on stack
+ 2 index 6 index sub pgfdiff div % put green-step on stack
+ 2 index 6 index sub pgfdiff div % put green-step on stack
+ 8 index 8 index 8 index 13 index
+ pgfdiff {
+ 3 index 3 index 3 index setrgbcolor % Set color
+ pgfcircx pgfcircy 2 index 0 360 arc closepath
+ stroke
+ 4 -1 roll 6 index add % red += incred
+ 4 -1 roll 5 index add % green += incgreen
+ 4 -1 roll 4 index add % blue += incblue
+ 4 -1 roll .25 sub % x += 0.25
+ /pgfcircx pgfcircx pgfxstep add def
+ /pgfcircy pgfcircy pgfystep add def
+ } repeat
+ mark 14 1 roll cleartomark exch pop % leave only start x on stack
+ }bind def}
+}
+
+
\endinput
%%% Local Variables: