meta-imp-nav.mkiv /size: 1823 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=meta-nav,
3%D        version=2003.03.28,
4%D          title=\METAPOST\ Graphics,
5%D       subtitle=Navigational Graphics,
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\startuniqueMPgraphic{navplus}{size,color,type,mode}
15  color c ; numeric s, t ; path p ;
16  t := \MPvar{type} ; c := \MPvar{color} ; s := \MPvar{size} ;
17  if \MPvar{mode} = 1 : c := .5[c,white] fi ;
18  if    t = 1 :
19    p := ((0,0)--(1/2,0)--(1,1/3)--(1,1)--(0,1)--(0,0)--cycle)
20      xyscaled (3,4) ;
21  elseif t = 2 :
22    p := ((0,0)--(1,0)--(1,1)--(0,1)--(1/2,2/5)--(1,1)--(0,1)--cycle)
23      xyscaled (4,3) ;
24  else :
25    p := fullsquare xyscaled (3,3) ;
26  fi ;
27  draw p withpen pencircle scaled (1/2) withcolor .75white ;
28  fill p withcolor c ;
29  draw p withpen pencircle scaled (1/3) withcolor .5c ;
30  currentpicture := currentpicture scaled s ;
31  currentpicture := currentpicture shifted -center currentpicture ;
32\stopuniqueMPgraphic
33
34\setupMPvariables
35  [navplus]
36  [size=1ex,
37   color=black,
38   type=1,
39   mode=0]
40
41\definepalet
42  [navplus]
43  [attach=darkred,
44   comment=darkblue]
45
46\definesymbol
47  [comment-normal]
48  [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment}]
49\definesymbol
50  [comment-down]
51  [\uniqueMPgraphic{navplus}{type=1,color=navplus:comment,mode=1}]
52
53\definesymbol
54  [attach-normal]
55  [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach}]
56\definesymbol
57  [attach-down]
58  [\uniqueMPgraphic{navplus}{type=2,color=navplus:attach,mode=1}]
59
60\unprotect
61
62\setupcomment    [\c!symbol={comment-normal,comment-down}]
63\setupattachments[\c!symbol={attach-normal,attach-down}]
64
65\protect \endinput
66