node-fin.mkiv /size: 2511 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=attr-ini,
3%D        version=2007.06.06, % probably a bit older
4%D          title=\CONTEXT\ Node Macros,
5%D       subtitle=Finalizing,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14\writestatus{loading}{ConTeXt Node Support / Finalizing}
15
16% Objects are processed indepently \unknown\ actually we may
17% need a proper callback.
18
19\unprotect
20
21\registerctxluafile{node-shp}{optimize}
22% \registerctxluafile{node-fin}{autosuffix,optimize} % we might generalize this one
23\registerctxluafile{node-fin}{optimize} % we might generalize this one
24
25% we might have two variants at some point (efficiency)
26
27\unexpanded\def\finalizeobjectbox #1{\clf_finalizebox#1\relax}
28\unexpanded\def\finalizeshipoutbox#1{\clf_finalizebox#1\relax}
29
30% Experimental (for Aditya):
31
32\unexpanded\def\cleanupbox#1{\clf_cleanupbox#1\relax}
33
34% Tricky stuff: this might become obsolete.
35
36\definesystemattribute[trigger][public]
37
38\newcount\c_syst_attr_trigger
39
40\edef\startinheritattributes{\c_attr_trigger\plusone}
41\edef\stopinheritattributes {\c_attr_trigger\attributeunsetvalue}
42
43\def\syst_attr_trigger_copy_yes{\afterassignment\syst_attr_trigger_copy_indeed\c_syst_attr_trigger}
44\def\syst_attr_trigger_dump_yes{\afterassignment\syst_attr_trigger_dump_indeed\c_syst_attr_trigger}
45
46\def\syst_attr_trigger_copy_indeed
47  {\ifvbox\c_syst_attr_trigger
48     \vpack attr \triggerattribute \plusone {\unvcopy\c_syst_attr_trigger}%
49   \else
50     \hpack attr \triggerattribute \plusone {\unhcopy\c_syst_attr_trigger}%
51   \fi}
52
53\def\syst_attr_trigger_dump_indeed
54  {\ifvbox\c_syst_attr_trigger
55     \vpack attr \triggerattribute \plusone {\unvbox\c_syst_attr_trigger}%
56   \else
57     \hpack attr \triggerattribute \plusone {\unhbox\c_syst_attr_trigger}%
58   \fi}
59
60\unexpanded\def\enableattributeinheritance
61  {\clf_enablestatetriggering
62   \let\attributedcopy\syst_attr_trigger_copy_yes
63   \let\attributedbox \syst_attr_trigger_dump_yes}
64
65\unexpanded\def\disableattributeinheritance
66  {\clf_disablestatetriggering
67   \let\attributedcopy\copy
68   \let\attributedbox \box}
69
70\disableattributeinheritance
71
72\installtexdirective
73  {attributes.inheritance}
74  {\enableattributeinheritance}
75  {\disableattributeinheritance}
76
77% \appendtoks
78%     \enableattributeinheritance % might become default
79% \to\everyjob
80
81\protect \endinput
82