summaryrefslogtreecommitdiff
path: root/tex/context/base/m-chart.tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2008-10-31 13:58:00 +0100
committerHans Hagen <pragma@wxs.nl>2008-10-31 13:58:00 +0100
commit94d83f84758766511c5e324721e39fea6ab71dae (patch)
treef167feb88a41f95f09e3b9cee5f2db2f765de38e /tex/context/base/m-chart.tex
parent560319dff7b42057a116447a8043b59d56d21cd8 (diff)
downloadcontext-94d83f84758766511c5e324721e39fea6ab71dae.tar.gz
stable 2008.10.31 13:58
Diffstat (limited to 'tex/context/base/m-chart.tex')
-rw-r--r--tex/context/base/m-chart.tex62
1 files changed, 21 insertions, 41 deletions
diff --git a/tex/context/base/m-chart.tex b/tex/context/base/m-chart.tex
index f5d0ea7b9..c8928f2d5 100644
--- a/tex/context/base/m-chart.tex
+++ b/tex/context/base/m-chart.tex
@@ -11,7 +11,9 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-% to do: \localpushmacro/\localpopmacro (dohandleflowchart etc)
+% todo: \localpushmacro/\localpopmacro (dohandleflowchart etc)
+% todo: make mkiv variant
+% todo: use dimexpr/numspr
% will be redone with layers and dimexpr ro even better, by just using
% textext
@@ -185,10 +187,10 @@
\def\dodoFLOWconnection[#1][#2]#3%
{\ignorespaces}
-\def\doFLOWconnect%
+\def\doFLOWconnect
{\connection}
-\def\doFLOWlocate%
+\def\doFLOWlocate
{\location}
\def\doFLOWexit[#1]#2%
@@ -300,26 +302,19 @@
\popmacro\includeFLOWx
\popmacro\includeFLOWy}
-%\def\setFLOWlocation#1,#2\end%
-% {\scratchcounter=0#1\advance\scratchcounter\includeFLOWx
-% \xdef\FLOWlocation{\the\scratchcounter}%
-% \scratchcounter=0#2\advance\scratchcounter\includeFLOWy
-% \xdef\FLOWlocation{\FLOWlocation,\the\scratchcounter}}
-
\def\resetFLOWlocation
- {\gdef\lastFLOWx{0}%
- \gdef\lastFLOWy{0}}
+ {\globallet\lastFLOWx\!!zerocount
+ \globallet\lastFLOWy\!!zerocount}
\def\dosetFLOWlocation[#1#2]#3#4%
{\processaction
[#1#2]
- [ +=>\scratchcounter=#4\advance\scratchcounter+1,
- -=>\scratchcounter=#4\advance\scratchcounter-1,
- +#2=>\scratchcounter=#4\advance\scratchcounter+#2,
- -#2=>\scratchcounter=#4\advance\scratchcounter-#2,
- \s!default=>\scratchcounter=#4,
- \s!unknown=>\scratchcounter=0#1#2]%
- \advance\scratchcounter#3%
+ [ +=>\scratchcounter\numexpr#4+ 1+#3\relax,
+ -=>\scratchcounter\numexpr#4- 1+#3\relax,
+ +#2=>\scratchcounter\numexpr#4+#2+#3\relax,
+ -#2=>\scratchcounter\numexpr#4-#2+#3\relax,
+ \s!default=>\scratchcounter\numexpr#4 +#3\relax,
+ \s!unknown=>\scratchcounter\numexpr0#1#2+#3\relax]%
\xdef#4{\the\scratchcounter}}
\def\setFLOWlocation#1,#2\end
@@ -340,8 +335,8 @@
{\donefalse
\let\cFLOWfrom\empty
\let\cFLOWto\empty
- \def\zFLOWfrom{0}%
- \def\zFLOWto{0}%
+ \let\zFLOWfrom\!!zerocount
+ \let\zFLOWto\!!zerocount
\handletokens#1\with\doFLOWsetconnect
\ifx\cFLOWto\empty\let\cFLOWfrom\empty\fi}
@@ -404,7 +399,7 @@
\ifFLOWscaling
\doifnothing{\@@FLOWmaxwidth }{\let\@@FLOWmaxwidth \maxdimen}%
\doifnothing{\@@FLOWmaxheight}{\let\@@FLOWmaxheight\maxdimen}%
- \scratchcounter=\bodyfontpoints
+ \scratchcounter\bodyfontpoints
\doloop % NOG FONTSWITCH OM EX EN EM TE LATEN WERKEN
{\ifnum\scratchcounter>1 % NU DIMENSIONS IN TERMS OF BODYFONTSIZE
\bodyfontsize=\the\scratchcounter pt
@@ -492,23 +487,7 @@
connection_smooth_size := \@@FLOLradius ;
connection_arrow_size := \@@FLOLradius ;
connection_dash_size := \@@FLOLradius ;
-% \stopMPdrawing
-% \def\getFLOWlocationX##1,##2\end%
-% {\ifnum0##1>\FLOWwidth \xdef\FLOWwidth {##1}\fi
-% \ifnum0##2>\FLOWheight\xdef\FLOWheight{##2}\fi}%
-% \long\def\startFLOWcellX##1\stopFLOWcell%
-% {\resetFLOWcell
-% \ignorespaces##1\unskip
-% \expandafter\getFLOWlocationX\FLOWlocation\end
-% \ignorespaces}%
-% \let\startFLOWcell\startFLOWcellX
-% \resetFLOWlocation
-% \processFLOWbuffer\currentFLOWnumber
-% \ifnum\@@FLOWnx\@@FLOWny=11 % listig
-% \let\@@FLOWnx\FLOWwidth
-% \let\@@FLOWny\FLOWheight
-% \fi
-% \startMPdrawing
+ currentpicture := nullpicture ;
begin_chart(0,\FLOWwidth,\FLOWheight);
reverse_y := true ;
chart_offset := \@@FLOW@@offset ;
@@ -1026,7 +1005,8 @@
\ifnum\!!counta<1 \!!counta=1 \fi
\edef#4{\the\!!counta}%
\else
- \def#1{1}\def#4{0}% no {1}
+ \let#1\!!plusone
+ \let#4\!!zerocount % no {1}
\fi}
% \useFLOWchart[name][parent][setting,setting][additional settings]
@@ -1086,8 +1066,8 @@
\def\dogetFLOWsize[#1][#2]%
{\setbox\scratchbox=\vbox
- {\xdef\FLOWmaxwidth {0}%
- \xdef\FLOWmaxheight{0}%
+ {\globallet\FLOWmaxwidth \!!zerocount
+ \globallet\FLOWmaxheight\!!zerocount
\def\getFLOWlocation##1,##2\end
{\ifnum0##1>\FLOWmaxwidth \xdef\FLOWmaxwidth {##1}\fi
\ifnum0##2>\FLOWmaxheight\xdef\FLOWmaxheight{##2}\fi}%