summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/prop-ini.mkiv
blob: 3b1c59b245cc0741249335dfcb7dae950eb0eaed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
%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 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 Property Macros / Initialization}

%D This module is replaced by dedicated mechanisms. Originally properties were
%D a sort of attributes in \MKII, but now we do things different anyway. We keep
%D a surrogate mechanism around for compatibility reasons but even this will
%D become obsolete some day.

\unprotect

\installcorenamespace{propertytypes}
\installcorenamespace{propertydefiners}
\installcorenamespace{propertystarters}

\def\properties_obsolete_message
  {\writestatus\m!system{properties are obsolete, use dedicated commands}%
   \glet\properties_obsolete_message\donothing}

\setvalue{\??propertydefiners\v!layer   }[#1][#2][#3]{\defineviewerlayer[#1][#3]}
\setvalue{\??propertydefiners\s!effect  }[#1][#2][#3]{\defineeffect     [#1][#3]}
\setvalue{\??propertydefiners\v!negative}[#1][#2][#3]{}

\unexpanded\def\defineproperty
  {\dotripleempty\properties_define}

\def\properties_define[#1][#2][#3]%
  {\properties_obsolete_message
   \setevalue{\??propertytypes#1}{#2}%
   \getvalue{\??propertydefiners#2}[#1][#2][#3]}

\setvalue{\??propertystarters\v!layer   }#1{\let\properties_stop\stopviewerlayer\startviewerlayer[#1]}
\setvalue{\??propertystarters\s!effect  }#1{\let\properties_stop\stopeffect     \starteffect     [#1]}
\setvalue{\??propertystarters\v!negative}#1{\let\properties_stop\stopnegative   \startnegative       }

\unexpanded\def\property[#1]%
  {\groupedcommand{\properties_start{#1}}\properties_stop}

\unexpanded\def\startproperty[#1]%
  {\properties_start{#1}}

\unexpanded\def\stopproperty
  {\properties_stop}

\unexpanded\def\properties_start#1%
  {\pushmacro\properties_stop
   \getvalue{\??propertystarters\getvalue{\??propertytypes#1}}{#1}}

\unexpanded\def\properties_stop
  {\properties_stop
   \popmacro\properties_stop}

\protect \endinput