s-present-stack.mkiv /size: 5114 b    last modification: 2020-07-01 14:35
1
%D \module
2
%D [ file=s-present-stack, % was s-pre-11
3
%D version=1999.08.20,
4
%D title=\CONTEXT\ Style File,
5
%D subtitle=Presentation Environment Stack,
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
\startmodule
[
present
-
stack
]
15 16
%D This is ancient but shows a few tricks so we keep it around in \MKIV\
17
%D anyway.
18 19
\setuppapersize
20
[
S
6
][
S
6
]
21 22
\setuplayout
23
[
topspace
=
0
cm
,
24
backspace
=
0
cm
,
25
header
=
0
pt
,
26
footer
=
0
pt
,
27
width
=
middle
,
28
height
=
middle
]
29 30
\doifelsemode
{
asintended
}
{
31
\setupbodyfont
[
ludicaot
,
1
4
.
4
pt
]
32
}
{
33
\setupbodyfont
[
pagella
,
1
4
.
4
pt
]
34
}
35 36
\setupinteraction
37
[
click
=
no
,
38
display
=
new
,
39
state
=
start
]
40 41
\setupinteractionscreen
42
[
option
=
max
]
43 44
\unexpanded
\def
\SomeShape
45
{
\resetMPdrawing
46
\startMPdrawing
47
path
p
[]
,
q
[]
;
pair
a
,
b
;
48
StartPage
;
49
\stopMPdrawing
50
\dorecurse
{
\CurrentTopic
}
51
{
\startMPdrawing
52
initialize
_
box
(
\MPpos
{
topic
-
\realfolio
-
\recurselevel
}
)
;
53
p
[
\recurselevel
]
:
=
tensecircle
(
wxy
,
hxy
,
.
2
5
cm
)
shifted
cxy
;
54
fill
p
[
\recurselevel
]
withcolor
.
9
white
;
55
pickup
pencircle
scaled
.
2
5
cm
;
56
if
\recurselevel
=
\CurrentTopic
:
57
draw
p
[
\recurselevel
]
withcolor
\MPcolor
{
ShowColor
}
;
58
else
:
59
draw
p
[
\recurselevel
]
withcolor
\MPcolor
{
DoneColor
}
;
60
fi
;
61
\stopMPdrawing
}
%
62
\dorecurse
{
\CurrentMaxItem
}
63
{
\startMPdrawing
64
initialize
_
box
(
\MPpos
{
item
-
\realfolio
-
\recurselevel
}
)
;
65
linewidth
:
=
.
2
5
cm
;
66
q
[
\recurselevel
]
:
=
tensecircle
(
wxy
,
hxy
,
linewidth
)
shifted
cxy
;
67
fill
q
[
\recurselevel
]
withcolor
.
9
white
;
68
pickup
pencircle
scaled
linewidth
;
69
if
\recurselevel
=
\CurrentMaxItem
:
70
draw
q
[
\recurselevel
]
withcolor
\MPcolor
{
ShowColor
}
;
71
else
:
72
draw
q
[
\recurselevel
]
withcolor
\MPcolor
{
DoneColor
}
;
73
fi
;
74
\stopMPdrawing
}
%
75
\dostepwiserecurse
{
2
}{
\CurrentTopic
}{
1
}
76
{
\startMPdrawing
77
draw
78
rt
point
3
of
p
[
\recurselevel
-
1
]
--
79
lft
point
7
of
p
[
\recurselevel
]
80
withcolor
\MPcolor
{
ArrowColor
}
;
81
\stopMPdrawing
}
%
82
\dostepwiserecurse
{
2
}{
\CurrentMaxItem
}{
1
}
83
{
\startMPdrawing
84
draw
85
bot
point
9
of
q
[
\recurselevel
-
1
]
--
86
top
point
5
of
q
[
\recurselevel
]
87
withcolor
\MPcolor
{
ArrowColor
}
;
88
\stopMPdrawing
}
%
89
\startMPdrawing
90
draw
Page
91
withpen
pencircle
scaled
.
5
cm
92
withcolor
\MPcolor
{
EdgeColor
}
;
93
StopPage
;
94
\stopMPdrawing
95
\MPdrawingdonetrue
96
\getMPdrawing
}
97 98
\unexpanded
\def
\TitlePage
#
1
%
99
{
\startstandardmakeup
100
\setupalign
[
middle
]
101
\def
\\
{
\vfil
\bfb
\setupinterlinespace
}
102
\bfd
\setupinterlinespace
103
\vfil
#
1
\vfil\vfil
104
\stopstandardmakeup
}
105 106
\definecolor
[
PageColor
][
r
=
.
5
,
g
=
.
4
,
b
=
.
3
]
107
\definecolor
[
LineColor
][
r
=
.
7
,
g
=
.
6
,
b
=
.
5
]
108 109
\definecolor
[
PageColor
]
[
s
=
.
6
0
]
110
\definecolor
[
ShowColor
]
[
r
=
.
4
0
]
111
\definecolor
[
EdgeColor
]
[
g
=
.
4
0
]
112
\definecolor
[
DoneColor
]
[
r
=
.
4
0
,
g
=
.
4
0
]
113
\definecolor
[
ArrowColor
]
[
b
=
.
4
0
]
114
\definecolor
[
LineColor
]
[
r
=
.
6
0
,
g
=
.
6
0
]
115
\definecolor
[
GotoColor
]
[
ArrowColor
]
116 117
\setupinteraction
118
[
color
=
GotoColor
,
119
contrastcolor
=
GotoColor
]
120 121
\defineoverlay
[
shape
]
[
\SomeShape
]
122
\defineoverlay
[
next
]
[
\overlaybutton
{
forward
}
]
% [{nextpage}]
123 124
\setupbackgrounds
125
[
page
]
126
[
background
=
{
color
,
next
,
shape
}
,
127
backgroundcolor
=
PageColor
]
128 129
\doglobal
\newcounter
\CurrentMaxItem
130
\doglobal
\newcounter
\CurrentItem
131
\doglobal
\newcounter
\CurrentTopic
132 133
\unexpanded
\def
\StartIdea
134
{
\doglobal
\newcounter
\CurrentItem
}
135 136
\unexpanded
\def
\StartTopic
137
{
\doglobal
\increment
\CurrentTopic
138
\dostartbuffer
[
topic
-
\CurrentTopic
][
StartTopic
][
StopTopic
]
}
139 140
\unexpanded
\def
\StopIdea
141
{
\dorecurse
{
\CurrentItem
}
142
{
\let
\CurrentMaxItem
\recurselevel
143
\doStopIdea
}}
144 145
\unexpanded
\def
\doStopIdea
146
{
\startstandardmakeup
147
\dontcomplain
148
\vskip
.
8
7
5
cm
149
\hbox
to
\makeupwidth
150
{
\hfill
151
\dorecurse
{
\CurrentTopic
}
152
{
\edef
\Topic
{
topic
-
\realfolio
-
\recurselevel
}
%
153
\hpos
154
{
\Topic
}
155
{
\framed
156
[
frame
=
off
,
align
=
middle
,
offset
=
.
2
5
cm
]
157
{
\getbuffer
[
topic
-
\recurselevel
]
}}
%
158
\ifnum
\recurselevel
<
\CurrentTopic
159
\hskip
.
8
7
5
cm
160
\fi
}
%
161
\hfill
}
162
\vskip
.
8
7
5
cm
163
\vfilll
164
\dorecurse
{
\CurrentMaxItem
}
165
{
\edef
\Item
{
item
-
\realfolio
-
\recurselevel
}
166
\hbox
to
\makeupwidth
167
{
\hfill
168
\hpos
169
{
\Item
}
170
{
\framed
171
[
width
=
.
7
5
\makeupwidth
,
172
frame
=
off
,
173
align
=
middle
,
offset
=
.
1
2
5
cm
]
174
{
\getbuffer
[
item
-
\recurselevel
]
}}
%
175
\hfill
}
176
\vskip
.
8
7
5
cm
}
177
\vfilll
178
\stopstandardmakeup
}
179 180
\unexpanded
\def
\StartItem
181
{
\doglobal
\increment
\CurrentItem
182
\dostartbuffer
[
item
-
\CurrentItem
][
StartItem
][
StopItem
]
}
183 184
\setupalign
185
[
nothyphenated
]
186 187
\stopmodule
188 189
\continueifinputfile
{
s
-
present
-
stack
.
mkiv
}
190 191
\usemodule
[
present
-
common
]
192 193
\inputpresentationfile
{
examples
/
present
-
stack
-
0
0
1
.
tex
}
194 195