summaryrefslogtreecommitdiff
path: root/tex/context/base/prop-ini.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/prop-ini.tex')
-rw-r--r--tex/context/base/prop-ini.tex119
1 files changed, 110 insertions, 9 deletions
diff --git a/tex/context/base/prop-ini.tex b/tex/context/base/prop-ini.tex
index 3c077564f..49f4e48de 100644
--- a/tex/context/base/prop-ini.tex
+++ b/tex/context/base/prop-ini.tex
@@ -2,7 +2,7 @@
%D [ file=prop-ini,
%D version=2003.04.20,
%D title=\CONTEXT\ Property Macros,
-%D subtitle=Initialization,
+%D subtitle=Initialization,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -11,11 +11,11 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\writestatus{loading}{Context Property Macros / initialization}
+\writestatus{loading}{Context Property Macros / initialization}
-%D Experimental module.
+%D Experimental module.
-%D local or not? like colors? cross pages? needed?
+%D local or not? like colors? cross pages? needed?
%D combine with newfont.tex
@@ -24,13 +24,44 @@
\def\defineproperty
{\dotripleempty\dodefineproperty}
-\def\dodefineproperty[#1][#2][#3]% todo : global def
+% \def\dodefineproperty[#1][#2][#3]% todo : global def
+% {\ifundefined{\??py#1\c!titel}%
+% \getgparameters[\??py#1][\c!titel=#1,\c!type=#2,#3]% global ! ! ! !
+% \setgvalue{\e!start#1}{\getvalue{init#2property}{#1}{#2}}% init should set "start#2property"
+% \setgvalue{\e!stop #1}{\getvalue{stop#2property}}%
+% \fi}
+
+\def\dodefineproperty[#1][#2][#3]% todo : global def
{\ifundefined{\??py#1\c!titel}%
- \getgparameters[\??py#1][\c!titel=#1,#3]%
- \setgvalue{\e!start#1}{\getvalue{init#2property}{#1}{#2}}%
- \setgvalue{\e!stop #1}{\getvalue{stop#2property}}%
+ \getgparameters[\??py#1][\c!titel=#1,\c!type=#2,#3]% global ! ! ! !
+ \setgvalue{\s!check#1}{\docheckproperty{#1}}%
+ \setgvalue{\e!start#1}{\dostartproperty{#1}}%
+ \setgvalue{\e!stop #1}{\dostopproperty {#1}}%
\fi}
+\def\docheckproperty#1% watch the s instead of e
+ {\def\currentproperty{#1}%
+ \csname\s!check\csname\??py#1\c!type\endcsname property\endcsname{#1}%
+ \letgvalue{\s!check#1}\relax}
+
+\def\dostartproperty#1%
+ {\checkproperty{#1}%
+ \csname\s!start\csname\??py#1\c!type\endcsname property\endcsname{#1}}
+
+\def\dostopproperty#1%
+ {\csname\s!stop\csname\??py#1\c!type\endcsname property\endcsname}
+
+\def\checkproperty#1%
+ {\csname\s!check#1\endcsname}
+
+\def\propertyparameter#1{\csname\??py\currentproperty #1\endcsname}
+%def\currentpropertytype{\csname\??py\currentproperty\c!type\endcsname}
+
+%def\checkedpropertyparameter#1#2{\executeifdefined{\??py\currentproperty#1}{#2}}
+\def\checkedpropertyparameter #1{\executeifdefined{\??py\currentproperty#1}}
+
+\let\currentproperty\s!unknown
+
\unexpanded\def\startproperty[#1]%
{\bgroup\edef\currentproperty{#1}%
\csname\e!start\currentproperty\endcsname}
@@ -45,4 +76,74 @@
\csname\e!start\currentproperty\endcsname}
{\csname\e!stop \currentproperty\endcsname}}
-\protect \endinput
+% grouped
+
+% \def\restartproperty#1%
+% {\edef\currentproperty{#1}%
+% \csname\e!start\currentproperty\endcsname}
+
+% \def\restopproperty
+% {\csname\e!stop \currentproperty\endcsname}
+
+% \unexpanded\def\startproperty[#1]%
+% {\bgroup\restartproperty{#1}}
+
+% \unexpanded\def\stopproperty
+% {\restopproperty\egroup}
+
+% \unexpanded\def\property[#1]%
+% {\groupedcommand{\restartproperty{#1}}\restopproperty}
+
+% \newtoks\nestedproperties
+
+% \unexpanded\def\startproperties[#1]%
+% {\bgroup
+% \getcommalistsize[#1]\edef\nofnestedproperties{\number\commalistsize}%
+% \nestedproperties\emptytoks
+% \doxprecurse\nofnestedproperties
+% {\appendtoks\restopproperty\to\nestedproperties
+% \expanded{\appendtoks\noexpand\restartproperty{\commalistelement}}\to\scratchtoks}%
+% \the\scratchtoks}
+
+% \unexpanded\def\stopproperties
+% {\the\nestedproperties\egroup}
+
+% not grouped (but we assume grouped, maybe some day an ungrouped extra!)
+
+% \newcount\propertydepth
+% \newcount\pstackeddepth
+
+% \def\currentproperty{\csname\??py:\number\propertydepth\endcsname}
+% \def\currentpstacked{\csname\??py:\number\pstackeddepth\endcsname}
+
+% \def\restartproperty#1%
+% {\advance\propertydepth\plusone
+% \setvalue{\??py:\number\propertydepth}{#1}%
+% \csname\e!start\currentproperty\endcsname}
+
+% \def\restopproperty
+% {\csname\e!stop \currentproperty\endcsname
+% \advance\propertydepth\minusone}
+
+% \unexpanded\def\startproperty[#1]%
+% {\restartproperty{#1}}
+
+% \unexpanded\def\stopproperty
+% {\restopproperty}
+
+% \unexpanded\def\property[#1]%
+% {\groupedcommand{\restartproperty{#1}}\restopproperty}
+
+% \unexpanded\def\startproperties[#1]%
+% {\advance\pstackeddepth\plusone
+% \getcommacommandsize[#1]%
+% \setvalue{\??py:\number\pstackeddepth}{\number\commalistsize}%
+% \rawprocesscommacomand[#1]\restartproperty}
+
+% \unexpanded\def\stopproperties
+% {\doxprecurse\currentpstacked\restopproperty
+% \advance\pstackeddepth\minusone}
+
+% so far
+
+\protect \endinput \ No newline at end of file