%D \module
%D   [       file=prop-ini,
%D        version=2003.04.20,
%D          title=\CONTEXT\ Property Macros,
%D       subtitle=Initialization, 
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%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 Property Macros / initialization} 

%D Experimental module. 

%D local or not? like colors? cross pages? needed? 

%D combine with newfont.tex

\unprotect

\def\defineproperty
  {\dotripleempty\dodefineproperty}

\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}}%
   \fi}

\unexpanded\def\startproperty[#1]%
  {\bgroup\edef\currentproperty{#1}%
   \csname\e!start\currentproperty\endcsname}

\unexpanded\def\stopproperty
  {\csname\e!stop \currentproperty\endcsname
   \egroup}

\unexpanded\def\property[#1]%
  {\groupedcommand
     {\edef\currentproperty{#1}%
      \csname\e!start\currentproperty\endcsname}
     {\csname\e!stop \currentproperty\endcsname}}

\protect \endinput 
