summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
diff options
context:
space:
mode:
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.tex176
1 files changed, 153 insertions, 23 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 22b257f7448..6057cbec149 100644
--- a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
@@ -1,11 +1,13 @@
-\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.9 2005/10/18 18:03:38 tantau Exp $
-
-% Copyright 2005 by Till Tantau <tantau@cs.tu-berlin.de>.
+% Copyright 2006 by Till Tantau
%
-% This program can be redistributed and/or modified under the terms
-% of the GNU Public License, version 2.
-
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the file doc/generic/pgf/licenses/LICENSE for more details.
+\ProvidesPackageRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsys.code.tex,v 1.18 2006/10/11 15:22:26 tantau Exp $
%
@@ -36,6 +38,51 @@
}%
}
+
+%
+% Useful commands that are used throughout pgf. The corresponding
+% latex commands are not used because a) latex might not be in use and
+% b) the latex commands are redefined by some *very vile and evil*
+% packages.
+%
+\long\def\pgf@ifundefined#1{%
+ \expandafter\ifx\csname#1\endcsname\relax
+ \expandafter\pgf@firstoftwo
+ \else
+ \expandafter\pgf@secondoftwo
+ \fi}
+\def\pgf@firstoftwo#1#2{#1}
+\def\pgf@secondoftwo#1#2{#2}
+\def\pgf@empty{}
+\def\pgf@gobble#1{}
+\def\pgf@gobbletwo#1#2{}
+\long\def\pgf@ifnextchar#1#2#3{%
+ \let\reserved@d=#1%
+ \def\reserved@a{#2}%
+ \def\reserved@b{#3}%
+ \futurelet\pgf@let@token\pgf@ifnch}
+\def\pgf@ifnch{%
+ \ifx\pgf@let@token\pgf@sptoken
+ \let\reserved@c\pgf@xifnch
+ \else
+ \ifx\pgf@let@token\reserved@d
+ \let\reserved@c\reserved@a
+ \else
+ \let\reserved@c\reserved@b
+ \fi
+ \fi
+ \reserved@c}
+\def\:{\global\let\pgf@sptoken= } \:
+\def\:{\pgf@xifnch} \expandafter\def\: {\futurelet\pgf@let@token\pgf@ifnch}
+\def\pgf@namedef#1{\expandafter\def\csname #1\endcsname}
+\long\def\pgf@g@addto@macro#1#2{%
+ \begingroup
+ \toks@\expandafter{#1#2}%
+ \xdef#1{\the\toks@}%
+ \endgroup}
+
+
+
% internal dimensions that are always present when pgsys is loaded.
\newdimen\pgf@x
\newdimen\pgf@y
@@ -73,9 +120,9 @@
% given at the end.
\def\pgf@sys@fail#1{%
- \expandafter\ifx\csname pgf@sys@fail@#1\endcsname\@empty%
+ \expandafter\ifx\csname pgf@sys@fail@#1\endcsname\pgf@empty%
\else%
- \expandafter\global\expandafter\let\csname pgf@sys@fail@#1\endcsname=\@empty%
+ \expandafter\global\expandafter\let\csname pgf@sys@fail@#1\endcsname=\pgf@empty%
\PackageWarning{pgf}{%
Your graphic driver \pgfsysdriver\space does not supported #1. This warning is given only once}%
\fi%
@@ -543,6 +590,84 @@
% The parameter #2 is a pgf point specification if the starting point
% of the shading. See the pgfuserguide for details.
+
+
+
+
+%
+%
+% Pattern stuff
+%
+%
+
+\def\pgfsys@declarepattern#1#2#3#4#5#6#7#8#9{\pgf@sys@fail{patterns}}
+% This command declares a new colored or uncolored pattern. Uncolored
+% patterns have no inherent color, the color is provided when they are
+% set. Colored patters have an inherent color.
+% #1 = name of the pattern (must be a plain suffix for use in
+% postscript/pdf/etc.)
+% #2 to #5 = four coordinates describing the corners of a bounding box
+% of pattern cells
+% #6 = x-step
+% #7 = y-step
+% #8 = pattern code
+% #9 = 0 if uncolored patter, 1 if colored pattern.
+
+\def\pgfsys@setpatternuncolored#1#2#3#4{\pgf@sys@fail{patterns}}
+% Sets an uncolored pattern #1 as filling color. The numbers #2, #3,
+% #4 must be an rgb-value to be used as the color of the pattern.
+
+\def\pgfsys@setpatterncolored#1{\pgf@sys@fail{patterns}}
+% Sets an colored pattern #1 as filling color.
+
+
+%
+%
+% Page size stuff
+%
+%
+\def\pgfsys@papersize#1#2{\pgf@sys@fail{papersize}}
+% This command sets the paper size in a portable way.
+% #1 = width
+% #2 = height
+
+
+
+%
+%
+% Position tracking commands
+%
+%
+
+% Marks the current position on the page. This position can later be
+% referenced using \pgfsys@getposition
+\def\pgfsys@markposition#1{\pgf@sys@fail{marking the current position}}
+
+% Sets #2 to a pgfpoint macro that returns the position #1 is
+% returned in a coordinate system where the x-axis goes right and the
+% y-axis goes up. The origin of this coordinate system may or may not
+% lie in the lower left corner; you should shift the coordinate system
+% to the position "pgfpageorigin" to make sure that the origin is at
+% the lower left corner. Typically, getting this position
+% requires two runs of TeX. On the first run, the macro will be set to
+% \relax, indicating that the position is not available.
+%
+% If #1 is set to the special position "pgfpageorigin", the position
+% of the the lower left page corner is returned.
+
+\def\pgfsys@getposition#1#2{\let#2=\relax}
+
+
+
+%
+%
+% Commands having a default implementation. These commands only need
+% not be implemented by drivers if this results in a better
+% preformance.
+%
+%
+
+
\def\pgfsys@shadingoutsidepgfpicture#1{%
#1%
}
@@ -568,15 +693,6 @@
-%
-%
-% Commands having a default implementation. These commands only need
-% not be implemented by drivers if this results in a better
-% preformance.
-%
-%
-
-
\def\pgfsys@closestroke{\pgfsys@closepath\pgfsys@stroke}
% This command should have the same effect as first closing the path
% and then stroking it.
@@ -608,7 +724,7 @@
{\pgfsys@beginscope\pgflowlevelsynccm\pgfsys@hbox#1\pgfsys@endscope}%
}
% Called to insert a TeX hbox into a pgfpicture, but with the current
-% coordiante transformation matrix synced with the canvas
+% coordinate transformation matrix synced with the canvas
% transformation matrix.
%
% In essence, this command does the same as if you first said
@@ -651,9 +767,9 @@
% Called at the end of a ``pure'' pgfpicture.
\def\pgfsys@defineimage{%
- \ifx\pgf@imagewidth\@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi%
- \ifx\pgf@imageheight\@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi%
- \ifx\pgf@imagepage\@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi%
+ \ifx\pgf@imagewidth\pgf@empty\else\edef\pgf@imagewidth{width=\pgf@imagewidth,}\fi%
+ \ifx\pgf@imageheight\pgf@empty\else\edef\pgf@imageheight{height=\pgf@imageheight,}\fi%
+ \ifx\pgf@imagepage\pgf@empty\else\edef\pgf@imagepage{page=\pgf@imagepage,}\fi%
\edef\pgf@image{\noexpand\includegraphics[\pgf@imageheight\pgf@imagewidth]{\pgf@filename}}%
}
% Called, when an image should be defined.
@@ -706,7 +822,7 @@
\def\pgfsys@defobject#1#2#3#4{%
\pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
{%
- \pgfsysprotocol@setcurrentprotocol\@empty%
+ \pgfsysprotocol@setcurrentprotocol\pgf@empty%
\pgfsysprotocol@bufferedtrue%
#4%
\pgfsysprotocol@getcurrentprotocol\pgfsys@@temp%
@@ -727,7 +843,7 @@
\def\pgfsys@useobject#1#2{%
\pgfsysprotocol@getcurrentprotocol\pgfsys@temp%
{%
- \pgfsysprotocol@setcurrentprotocol\@empty%
+ \pgfsysprotocol@setcurrentprotocol\pgf@empty%
\pgfsysprotocol@bufferedfalse%
#2%
\expandafter\pgfsysprotocol@setcurrentprotocol\csname #1\endcsname%
@@ -751,6 +867,20 @@
% nested. In this case, only the `last' one restores visibility.
+\def\pgfsys@atbegindocument{}
+% This command will be executed at the begin of the document. If for
+% whatever reason this is not done, you may wish to execute this
+% command yourself. It will setup certain specials that need to be
+% inserted into the resulting .pdf/.ps/.xxx file.
+
+
+
+\AtBeginDocument{
+ \pgfsys@atbegindocument
+ \let\pgfsys@atbegindocument=\relax
+}
+
+
% Discern the driver: