scrn-ref.mkvi /size: 3262 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=scrn-ref,
3%D        version=1998.01.15,
4%D          title=\CONTEXT\ Screen Macros,
5%D       subtitle=References, % moved code
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 Screen Macros / References}
15
16\registerctxluafile{scrn-ref}{}
17
18\unprotect
19
20\appendtoks
21    \doifsomething{\interactionparameter\c!calculate}%
22        {\clf_setfieldcalculationset{\interactionparameter\c!calculate}}%
23    \doifelse{\interactionparameter\c!click  }\v!yes
24        \settrue\setfalse\highlighthyperlinks
25    \doifelse{\interactionparameter\c!display}\v!new
26        \settrue\setfalse\gotonewwindow
27    \doifnot {\interactionparameter\c!page}\v!no
28        \scrn_reference_enable_page_destinations
29\to \everysetupinteraction
30
31\def\scrn_reference_enable_page_destinations % no reset
32  {\clf_setreferencelinkmethod{\interactionparameter\c!page}}
33
34\setupinteraction % start fit page and reset form
35  [\c!page=\v!no,
36   \c!click=\v!yes,
37   \c!display=\v!normal,
38   \c!focus=\v!fit,
39  %\c!focusoffset=\zeropoint, % when tested with al views it will become 5\points
40   \c!focusoffset=5\points,
41   \c!calculate=,
42   % rendering:
43   \c!width=\emwidth,
44   \c!height=\zeropoint,
45   \c!depth=\zeropoint,
46   \c!symbolset=]
47
48% for now here, might become per link
49
50\appendtoks
51    \enabledirectives[destinations.offset=\the\dimexpr\interactionparameter\c!focusoffset\relax]%
52\to \everysetupinteraction
53
54%D We have to make sure of some settings:
55
56\def\scrn_reference_set_text_actions
57  {\iflocation
58     \edef\currentinteractionopenaction {\interactionparameter\c!openaction }%
59     \edef\currentinteractioncloseaction{\interactionparameter\c!closeaction}%
60     \ifx\currentinteractionopenaction\empty \else
61       \clf_setopendocumentaction{\currentinteractionopenaction}%
62     \fi
63     \ifx\currentinteractioncloseaction\empty \else
64       \clf_setclosedocumentaction{\currentinteractioncloseaction}%
65     \fi
66     \glet\scrn_reference_set_text_actions\relax
67   \fi}
68
69\def\scrn_reference_set_page_actions
70  {\iflocation
71     \edef\currentinteractionopenpageaction {\interactionparameter\c!openpageaction }%
72     \edef\currentinteractionclosepageaction{\interactionparameter\c!closepageaction}%
73     \ifx\currentinteractionopenpageaction\empty \else
74       \clf_setopenpageaction{\currentinteractionopenpageaction}%
75     \fi
76     \ifx\currentinteractionclosepageaction\empty \else
77       \clf_setclosepageaction{\currentinteractionclosepageaction}%
78     \fi
79   \fi}
80
81\appendtoks \scrn_reference_set_text_actions \to \everyshipout
82\appendtoks \scrn_reference_set_page_actions \to \everyshipout
83
84%D delayed ...
85
86% \def\scrn_reference_enable_references
87%   {\ifproductionrun
88%      \clf_enableinteraction % only once anyway
89%      \glet\scrn_reference_enable_references\relax
90%    \fi}
91%
92% \appendtoks
93%     \scrn_reference_enable_references
94% \to \everysetupinteraction
95
96\setupinteraction % start fit page and reset form
97  [\c!openaction=,
98   \c!closeaction=,
99   \c!openpageaction=,
100   \c!closepageaction=]
101
102\protect \endinput
103