node-fin.mkiv /size: 2427 b    last modification: 2020-07-01 14:35
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
}{
optimize
}
% we might generalize this one
23 24
% we might have two variants at some point (efficiency)
25 26
\unexpanded
\def
\finalizeobjectbox
#
1
{
\clf_finalizebox
#
1
\relax
}
27
\unexpanded
\def
\finalizeshipoutbox
#
1
{
\clf_finalizebox
#
1
\relax
}
28 29
% Experimental (for Aditya):
30 31
\unexpanded
\def
\cleanupbox
#
1
{
\clf_cleanupbox
#
1
\relax
}
32 33
% Tricky stuff: this might become obsolete.
34 35
\definesystemattribute
[
trigger
][
public
]
36 37
\newcount
\c_syst_attr_trigger
38 39
\edef
\startinheritattributes
{
\c_attr_trigger
\plusone
}
40
\edef
\stopinheritattributes
{
\c_attr_trigger
\attributeunsetvalue
}
41 42
\def
\syst_attr_trigger_copy_yes
{
\afterassignment
\syst_attr_trigger_copy_indeed
\c_syst_attr_trigger
}
43
\def
\syst_attr_trigger_dump_yes
{
\afterassignment
\syst_attr_trigger_dump_indeed
\c_syst_attr_trigger
}
44 45
\def
\syst_attr_trigger_copy_indeed
46
{
\ifvbox
\c_syst_attr_trigger
47
\vpack
attr
\triggerattribute
\plusone
{
\unvcopy
\c_syst_attr_trigger
}
%
48
\else
49
\hpack
attr
\triggerattribute
\plusone
{
\unhcopy
\c_syst_attr_trigger
}
%
50
\fi
}
51 52
\def
\syst_attr_trigger_dump_indeed
53
{
\ifvbox
\c_syst_attr_trigger
54
\vpack
attr
\triggerattribute
\plusone
{
\unvbox
\c_syst_attr_trigger
}
%
55
\else
56
\hpack
attr
\triggerattribute
\plusone
{
\unhbox
\c_syst_attr_trigger
}
%
57
\fi
}
58 59
\unexpanded
\def
\enableattributeinheritance
60
{
\clf_enablestatetriggering
61
\let
\attributedcopy
\syst_attr_trigger_copy_yes
62
\let
\attributedbox
\syst_attr_trigger_dump_yes
}
63 64
\unexpanded
\def
\disableattributeinheritance
65
{
\clf_disablestatetriggering
66
\let
\attributedcopy
\copy
67
\let
\attributedbox
\box
}
68 69
\disableattributeinheritance
70 71
\installtexdirective
72
{
attributes
.
inheritance
}
73
{
\enableattributeinheritance
}
74
{
\disableattributeinheritance
}
75 76
% \appendtoks
77
% \enableattributeinheritance % might become default
78
% \to\everyjob
79 80
\protect
\endinput
81