summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-02-24 18:22:07 +0000
committerKarl Berry <karl@freefriends.org>2008-02-24 18:22:07 +0000
commitac768be5ab2e638802806ac364ca4402e8e9935e (patch)
treebf26e0d972206f02cda2535e35dd8c2a33c04eaa /Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
parentbc195e7c0fe9d96cd9b6c0230da50da6fc28de26 (diff)
pgf 2.0, third try
git-svn-id: svn://tug.org/texlive/trunk@6747 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex')
-rw-r--r--Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex70
1 files changed, 70 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
new file mode 100644
index 00000000000..b34ae3bcdc7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex
@@ -0,0 +1,70 @@
+% Copyright 2006 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.
+
+\ProvidesFileRCS $Header: /cvsroot/pgf/pgf/generic/pgf/systemlayer/pgfsysprotocol.code.tex,v 1.4 2006/10/16 22:32:59 tantau Exp $
+
+
+
+% This package provides the pgf system protcol layer. Protocolling is
+% used to record a bunch of graphic operations so that they can be
+% reused quickly at a later point.
+%
+% Basically, all ``recordable'' \pgfsys@xxxx commands call
+% \pgfsysprotocol@protocol for their protocolable literal
+% specials. The literal text will either be stored in the current
+% protocol. At a later point (actually, normally this happens
+% immediately afterwards), the accumulated protocolled text is invoked
+% using pgfsys@invokeprotocol.
+
+
+
+\let\pgfsysprotocol@currentprotocol=\pgfutil@empty
+\newif\ifpgfsysprotocol@buffered
+
+
+% Add to the protocol buffered
+\def\pgfsysprotocol@literalbuffered#1{%
+ \edef\pgfsysprotocol@temp{{#1\space}}%
+ \expandafter\pgfutil@g@addto@macro\expandafter\pgfsysprotocol@currentprotocol\pgfsysprotocol@temp%
+}
+
+% Add to the protocol
+\def\pgfsysprotocol@literal#1{%
+ \pgfsysprotocol@literalbuffered{#1}%
+ \ifpgfsysprotocol@buffered%
+ \else%
+ \pgfsysprotocol@flushcurrentprotocol%
+ \fi%
+}
+
+% Getting and setting the current protocol
+\def\pgfsysprotocol@getcurrentprotocol#1{%
+ \let#1=\pgfsysprotocol@currentprotocol%
+}
+
+\def\pgfsysprotocol@setcurrentprotocol#1{%
+ \global\let\pgfsysprotocol@currentprotocol=#1%
+}
+
+
+% Invoking the current protocol
+\def\pgfsysprotocol@invokecurrentprotocol{%
+ \ifx\pgfsysprotocol@currentprotocol\pgfutil@empty%
+ \else%
+ \expandafter\pgfsys@invoke\expandafter{\pgfsysprotocol@currentprotocol}%
+ \fi%
+}
+
+\def\pgfsysprotocol@flushcurrentprotocol{%
+ \pgfsysprotocol@invokecurrentprotocol%
+ \pgfsysprotocol@setcurrentprotocol\pgfutil@empty%
+}
+
+
+\endinput