summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/strc-mar.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/strc-mar.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/strc-mar.mkiv79
1 files changed, 24 insertions, 55 deletions
diff --git a/Master/texmf-dist/tex/context/base/strc-mar.mkiv b/Master/texmf-dist/tex/context/base/strc-mar.mkiv
index 2fe8631b27b..19fc30c3191 100644
--- a/Master/texmf-dist/tex/context/base/strc-mar.mkiv
+++ b/Master/texmf-dist/tex/context/base/strc-mar.mkiv
@@ -5,7 +5,7 @@
%D subtitle=Markings,
%D author=Hans Hagen,
%D date=\currentdate,
-%D copyright=PRAGMA-ADE / Hans Hagen]
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
@@ -41,59 +41,28 @@
\definesystemattribute [marks] [global]
-\let\currentmarking\empty
-
-\def\markingparameter #1{\csname\domarkingparameter{\??mk\currentmarking}#1\endcsname}
-\def\namedmarkingparameter #1#2{\csname\domarkingparameter{\??mk#1}#2\endcsname}
-\def\domarkingparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\domarkingparentparameter\csname#1\s!parent\endcsname#2\fi}
-\def\domarkingparentparameter#1#2{\ifx#1\relax\s!empty\else\domarkingparameter#1#2\fi}
-
-% \def\markingparameterhash #1{\domarkingparameterhash{\??mk\currentmarking}#1}
-% \def\domarkingparameterhash #1#2{\ifcsname#1#2\endcsname#1\else\expandafter\domarkingparentparameterhash\csname#1\s!parent\endcsname#2\fi}
-% \def\domarkingparentparameterhash#1#2{\ifx#1\relax\else\domarkingparameterhash#1#2\fi}
-%
-% \def\detokenizedmarkingparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??mk\currentmarking#1\endcsname}}
-%
-% \def\dosetmarkingattributes#1#2% style color
-% {\edef\fontattributehash {\markingparameterhash#1}%
-% \edef\colorattributehash{\markingparameterhash#2}%
-% \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi
-% \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi}
-
-\newconditional\inhibitgetmarking
-\newconditional\inhibitsetmarking
-\newtoks \everymarking
+\installcorenamespace{marking}
-\unexpanded\def\setupmarking
- {\dodoubleargument\dosetupmarking}
+\installcommandhandler \??marking {marking} \??marking
-\def\dosetupmarking[#1][#2]%
- {\ifsecondargument
- \def\docommand##1{\getparameters[\??mk##1][#2]}%
- \processcommalist[#1]\docommand
- \else
- \getparameters[\??mk][#1]%
- \fi}
+\newconditional\inhibitgetmarking % will become private
+\newconditional\inhibitsetmarking % will become private
-% management
+\newtoks \everymarking
-\unexpanded\def\definemarking {\dodoubleempty \dodefinemarking}
-\unexpanded\def\relatemarking {\dodoubleempty \dorelatemarking}
-\unexpanded\def\setmarking {\dosingleargument\dosetmarking } \let\marking\setmarking
-\unexpanded\def\resetmarking {\dosingleargument\doresetmarking }
-\unexpanded\def\synchronizemarking{\dodoubleargument\dosynchronizemarking }
+\unexpanded\def\relatemarking {\dodoubleempty \strc_markings_relate }
+\unexpanded\def\setmarking {\dosingleargument\strc_markings_set } \let\marking\setmarking
+\unexpanded\def\resetmarking {\dosingleargument\strc_markings_reset }
+\unexpanded\def\synchronizemarking{\dotripleargument\strc_markings_synchronize}
-\def\dodefinemarking[#1][#2]% marking parent
- {\doifelsenothing{#2}
- {\ctxcommand{definemarking("#1")}%
- \getparameters[\??mk#1][\s!parent=\??mk]}
- {\ctxcommand{definemarking("#1",{ parent = "#2" })}%
- \getparameters[\??mk#1][\s!parent=\??mk#2]}}
+\appendtoks
+ \ctxcommand{definemarking("\currentmarking",{ parent = "\currentmarkingparent" })}%
+\to \everydefinemarking
-\def\dorelatemarking[#1][#2]%
+\def\strc_markings_relate[#1][#2]%
{\ctxcommand{relatemarking("#1","#2")}}
-\def\dosetmarking[#1]#2%
+\def\strc_markings_set[#1]#2%
{\ifconditional\inhibitsetmarking
% nothing
\else
@@ -102,17 +71,17 @@
{\ctxcommand{setmarking("#1",\!!bs\detokenize{#2}\!!es)}}%
\fi}
-\def\doresetmarking[#1]%
+\def\strc_markings_reset[#1]%
{\ctxcommand{resetmarking("#1")}}
+\def\strc_markings_synchronize[#1][#2][#3]% #1=class #2=boxnumber (some day also name) #3=options, maybe second argument table
+ {\ifvoid#2\else\ctxcommand{synchronizemarking("#1",\number#2,"#3")}\fi}
+
\def\doifelsemarking#1%
{\ctxcommand{doifelsemarking("#1")}}
-\def\dosynchronizemarking[#1][#2]% class boxnumber (some day also name), maybe second argument table
- {\ifvoid#2\else\ctxcommand{synchronizemarking("#1",\number#2)}\fi}
-
% \appendtoks
-% \dosynchronizemarking[\v!page][\normalpagebox]%
+% \strc_markings_synchronize[\v!page][\normalpagebox][\v!keep]% keep if no marks
% \to \everybeforepagebody
% defaults
@@ -127,15 +96,15 @@
\unexpanded\def\getmarking
{\ifconditional\inhibitgetmarking
- \expandafter\dotripleargument\expandafter\nogetmarking
+ \expandafter\dotripleargument\expandafter\strc_markings_get_nop
\else
- \expandafter\dotripleargument\expandafter\dogetmarking
+ \expandafter\dotripleargument\expandafter\strc_markings_get_yes
\fi}
-\def\nogetmarking[#1][#2][#3]%
+\def\strc_markings_get_nop[#1][#2][#3]%
{}
-\def\dogetmarking[#1][#2][#3]%
+\def\strc_markings_get_yes[#1][#2][#3]%
{\doif{\namedmarkingparameter{#1}\c!state}\v!start
{\begingroup
\setsystemmode\v!marking