summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty')
-rw-r--r--Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty100
1 files changed, 100 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty
new file mode 100644
index 00000000000..e81d3412b68
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tikz-timing/tikz-timing-counters.sty
@@ -0,0 +1,100 @@
+%%
+%% This is file `tikz-timing-counters.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tikz-timing.dtx (with options: `lib,lib-counters')
+%%
+%% Copyright (C) 2009 by Martin Scharrer <martin@scharrer-online.de>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%%
+%% http://www.latex-project.org/lppl.txt
+%%
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status `maintained'.
+%%
+%% The Current Maintainer of this work is Martin Scharrer.
+%%
+%% This work consists of the files tikz-timing.dtx, tikz-timing.ins
+%% and the derived file tikz-timing.sty.
+%%
+\RequirePackage{svn-prov}[2009/05/03]
+\ProvidesPackageSVN[tikz-timing-counters]
+ {$Id: tikz-timing.dtx 1580 2009-12-09 11:14:01Z martin $}
+ [v0.7
+ TikZ-Timing Library for
+ counter values]
+\GetFileInfoSVN*%
+\RequirePackage{tikz-timing}[\filedate]%
+\DefineFileInfoSVN
+
+\tikzset{%
+ timing/new counter/.style={timing/counter/new={#1}},
+ timing/counter/.cd,
+ new/.code={\tikztiming@counter@new{#1}},
+ new/.value required,
+ opt/.cd,
+ char/.estore in=\tikztiming@counter@char,
+ reset char/.estore in=\tikztiming@counter@resetchar,
+ base/.estore in=\tikztiming@counter@base,
+ half width char/.estore in=\tikztiming@counter@hwchar,
+ char/.value required,
+ reset char/.value required,
+ base/.value required,
+ half width char/.value required,
+}
+\def\tikztiming@counter@new#1{%
+ \let\tikztiming@counter@char\empty
+ \let\tikztiming@counter@resetchar\empty
+ \def\tikztiming@counter@base{10}%
+ \let\tikztiming@counter@hwchar\relax
+ \pgfqkeys{/tikz/timing/counter/opt}{#1}%
+ \ifx\tikztiming@counter@char\empty
+ \PackageError{tikz-timing-counters}{Counter character must be given using
+ the 'char' key!}%
+ \else
+ \edef\@tempa{%
+ \noexpand\tikztiming@counter@new@{\tikztiming@counter@char}{\tikztiming@counter@base}%
+ {\tikztiming@counter@hwchar}{\tikztiming@counter@resetchar}%
+ }%
+ \expandafter\@tempa
+ \fi
+}
+\def\tikztiming@counter@new@#1#2#3#4{%
+ \newcounter{tikztiming@counter@#1}%
+ \tikzset{timing/counter/#1/.append style={}}%
+ \tikztimingmetachar{#1}[1]{##1D{[timing/counter/#1]\tikztiming@counter@vs{#1}{#2}}}%
+ \ifx\tikztiming@counter@hwchar\empty\else
+ \ifx\tikztiming@counter@hwchar\relax
+ \tikztiming@iflower{#1}{}%
+ {\lowercase{\tikztimingmetachar{#1}}[1]%
+ {##1d{[timing/counter/#1]\tikztiming@counter@vs{#1}{#2}}}}%
+ \else
+ \tikztimingmetachar{#3}[1]{##1d{[timing/counter/#1]\tikztiming@counter@vs{#1}{#2}}}%
+ \fi
+ \fi
+ \ifx\tikztiming@counter@resetchar\empty\else
+ \tikztimingmetachar{#4}[1]{[|/utils/exec=\tikztiming@counter@reset{#1}{##1}|]}%
+ \fi
+}
+\def\tikztiming@counter@reset#1#2{%
+ \pgfmathsetcounter{tikztiming@counter@#1}{round((#2)/\tikztiming@wscale)}%
+ \setcounter{tikztiming@counter@#1}{\value{tikztiming@counter@#1}}%
+}
+\def\tikztiming@counter@vs#1#2{%
+ \pgfmathdectoBase\pgfmathresult{\value{tikztiming@counter@#1}}{#2}%
+ \pgfmathresult
+ \stepcounter{tikztiming@counter@#1}%
+}
+\RequirePackage{pgfopts}
+\ProcessPgfOptions{/tikz/timing/counter}
+\endinput
+%%
+%% End of file `tikz-timing-counters.sty'.