summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/meta-imp-nav.mkiv
blob: 9c1cbb4dbb4a1341b9f54e5db4fd4666a28d6d03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%D \module
%D   [       file=meta-nav,
%D        version=2003.03.28,
%D          title=\METAPOST\ Graphics,
%D       subtitle=Navigational Graphics,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\startuniqueMPgraphic{navplus}{size,color,type,mode}
  color c ; numeric s, t ; path p ;
  t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
  if \MPvar{mode} = 1 : c := .5[c,white] fi ;
  if    t = 1 :
    p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle)
      xyscaled (3,4) ;
  elseif t = 2 :
    p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
      xyscaled (4,3) ;
  else :
    p := fullsquare xyscaled (3,3) ;
  fi ;
  draw p withpen pencircle scaled (1/2) withcolor .75white ;
  fill p withcolor c ;
  draw p withpen pencircle scaled (1/3) withcolor .5c ;
  currentpicture := currentpicture scaled s ;
  currentpicture := currentpicture shifted -center currentpicture ;
\stopuniqueMPgraphic

\setupMPvariables
  [navplus]
  [size=1ex,
   color=black,
   type=1,
   mode=0]

\definepalet
  [navplus]
  [attach=darkred,
   comment=darkblue]

\definesymbol
  [comment-normal]
  [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
\definesymbol
  [comment-down]
  [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]

\definesymbol
  [attach-normal]
  [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
\definesymbol
  [attach-down]
  [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]

\unprotect

\setupcomment    [\c!symbol={comment-normal,comment-down}]
\setupattachments[\c!symbol={attach-normal,attach-down}]

\protect \endinput