%D \module
%D   [       file=strc-doc,
%D        version=2008.10.20,
%D          title=\CONTEXT\ Structure Macros,
%D       subtitle=Document Structure,
%D         author=Hans Hagen,
%D           date=\currentdate,
%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
%C details.

\writestatus{loading}{ConTeXt Structure Macros / Document Structure}

\registerctxluafile{strc-doc}{}

\unprotect

%D This will move:

\mutable\lettonothing\currentstructureattribute
\mutable\lettonothing\currentstructurebackreference
\mutable\lettonothing\currentstructurebookmark
\mutable\lettonothing\currentstructurecatcodes
\mutable\lettonothing\currentstructurecoding
\mutable\lettonothing\currentstructurecoupling
\mutable\lettonothing\currentstructureexpansion
\mutable\lettonothing\currentstructureincrementnumber
\mutable\lettonothing\currentstructurelabel
\mutable\lettonothing\currentstructurelevel
\mutable\lettonothing\currentstructurelist
\mutable\lettonothing\currentstructurelistattribute
\mutable\lettonothing\currentstructuremarking
\mutable\lettonothing\currentstructurename
\mutable\lettonothing\currentstructureownnumber
\mutable\lettonothing\currentstructureplaceholder
\mutable\lettonothing\currentstructurereference
\mutable\lettonothing\currentstructurereferenceattribute
\mutable\lettonothing\currentstructurereferenceprefix
\mutable\lettonothing\currentstructuresaveinlist
\mutable\lettonothing\currentstructureshownumber
\mutable\lettonothing\currentstructuretitle
\mutable\lettonothing\currentstructurexmlsetup

\mutable\lettonothing\currentstructurecomponentattribute
\mutable\lettonothing\currentstructurecomponentbookmark
\mutable\lettonothing\currentstructurecomponentcatcodes
\mutable\lettonothing\currentstructurecomponentcoding
\mutable\lettonothing\currentstructurecomponentcounter
\mutable\lettonothing\currentstructurecomponentexpansion
\mutable\lettonothing\currentstructurecomponentlabel
\mutable\lettonothing\currentstructurecomponentlevel
\mutable\lettonothing\currentstructurecomponentlist
\mutable\lettonothing\currentstructurecomponentmarking
\mutable\lettonothing\currentstructurecomponentname
\mutable\lettonothing\currentstructurecomponentreference
\mutable\lettonothing\currentstructurecomponentreferenceprefix
\mutable\lettonothing\currentstructurecomponentsynchronize
\mutable\lettonothing\currentstructurecomponenttitle
\mutable\lettonothing\currentstructurecomponentxmlsetup

\permanent\protected\def\setstructuresynchronization#1% todo: use ctxcontext
  {\clf_setinternalreference
     prefix    {\currentstructurereferenceprefix}%
     reference {\currentstructurereference}
     internal  \locationcount
     view      {\interactionparameter\c!focus}%
   \relax
   \enforced\xdef\currentstructureattribute
     {\the\lastdestinationattribute}%
   \enforced\xdef\currentstructuresynchronize
     {\currentstructuresynchronize
      \strc_lists_inject_enhance{#1}}}

\permanent\protected\def\setstructurecomponentsynchronization#1% todo: use ctxcontext
  {\clf_setinternalreference
     prefix    {\currentstructurecomponentreferenceprefix}%
     reference {\currentstructurecomponentreference}
     internal  \locationcount
     view      {\interactionparameter\c!focus}%
   \relax
   \enforced\xdef\currentstructurecomponentattribute  {\the\lastdestinationattribute}%
   \enforced\xdef\currentstructurecomponentsynchronize{\strc_lists_inject_enhance{#1}}}

\protect \endinput

