1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Page Macros Tracing Info}
15
16
17
18\unprotect
19
20\installcorenamespace{layoutinfo}
21
22\newtoks\everyresetversion
23\newtoks\everysetupversion
24
25\let\currentversioninfo\empty
26\let\currentversiontext\empty
27
28\unexpanded\def\setupversion
29 {\dosingleargument\page_info_setup}
30
31\let\version\setupversion
32
33\let\page_info_add_to_box\gobbleoneargument
34
35\def\page_info_setup[#1]
36 {\the\everyresetversion
37 \doifelseassignment{#1}
38 {\getdummyparameters[\c!alternative=,\c!text=,#1]
39 \edef\currentversioninfo{\dummyparameter\c!alternative}
40 \edef\currentversiontext{\dummyparameter\c!text}}
41 {\edef\currentversioninfo{#1}
42 \let \currentversiontext\empty}
43 \ifcsname\??layoutinfo\currentversioninfo\endcsname
44 \let\page_info_add_to_box\page_info_add_to_box_indeed
45 \else
46 \let\currentversioninfo\empty
47 \let\page_info_add_to_box\gobbleoneargument
48 \fi
49 \the\everysetupversion}
50
51\unexpanded\def\page_info_place_info
52 {\begincsname\??layoutinfo\currentversioninfo\endcsname}
53
54\unexpanded\def\installversioninfo#1#2
55 {\setvalue{\??layoutinfo#1}{#2}}
56
57\unexpanded\def\includeversioninfo#1
58 {\begincsname\??layoutinfo#1\endcsname}
59
60\installversioninfo\v!final
61 {\let\currentversioninfo\empty
62 \let\page_info_add_to_box\gobbleoneargument}
63
64\installversioninfo\v!concept
65 {\vskip6\points
66 \hbox to \makeupwidth
67 {\infofont
68 \rlap{\v!concept:\space\currentdate}
69 \hss
70 \currentversiontext
71 \hss
72 \llap{\page_adapts_status_info}}}
73
74\installversioninfo\v!file
75 {\vskip6\points
76 \hbox to \makeupwidth
77 {\infofont
78 \getmessage\m!system{27}:\space\currentdate\quad
79 \donefalse
80 \doif\currentproject\currentproduct{\doif\currentproduct\currentcomponent\donetrue}
81 \ifdone
82 \donefalse
83 \else
84 \ifx\currentproject \empty \else \space\v!project :\space\currentproject \space \donetrue \fi
85 \ifx\currentproduct \empty \else \space\v!product :\space\currentproduct \space \donetrue \fi
86 \ifx\currentcomponent\empty \else \space\v!component:\space\currentcomponent\space \donetrue \fi
87 \fi
88 \ifdone \else \space\v!file :\space\jobname \space \fi
89 \hss
90 \currentversiontext
91 \quad
92 \page_adapts_status_info}}
93
94\installversioninfo\v!temporary
95 {\includeversioninfo\v!file}
96
97\appendtoks
98 \overfullrule\zeropoint
99\to \everyresetversion
100
101\appendtoks
102 \ifx\currentversioninfo\v!temporary
103 \overfullrule5\points
104 \fi
105\to \everysetupversion
106
107\newbox\b_page_versions
108
109\def\page_info_add_to_box_indeed#1
110 {\scratchdimen\wd#1
111 \setbox\b_page_versions\vpack to \ht#1
112 {\vfill
113 \settexthoffset
114 \hsize\dimexpr\scratchdimen2\texthoffset\relax
115 \hkern\texthoffset
116 \vbox to \zeropoint{\vss\page_info_place_info}
117 \vkern\bodyfontsize}
118 \dp\b_page_versions\zeropoint
119 \wd\b_page_versions\scratchdimen
120 \setbox#1\hpack{\box#1\hkern\scratchdimen\box\b_page_versions}}
121
122\setupversion
123 [\v!final]
124
125\let\page_info_add_to_box\gobbleoneargument
126
127\protect \endinput
128 |