Encode shape information in `PmOracle`
[ghc.git] / utils / hp2ps / Marks.c
1 #include "Main.h"
2 #include <stdio.h>
3 #include "Curves.h"
4 #include "Dimensions.h"
5 #include "HpFile.h"
6
7 /* own stuff */
8 #include "Marks.h"
9
10 static void Caret PROTO((floatish, floatish, floatish));
11
12 void
13 Marks(void)
14 {
15 intish i;
16 floatish m;
17
18 for (i = 0; i < nmarks; i++) {
19 m = ((markmap[i] - samplemap[0]) / xrange) * graphwidth;
20 Caret(xpage(m), ypage(0.0), 4.0);
21 }
22 }
23
24
25 /*
26 * Draw a small white caret at (x,y) with width 2 * d
27 */
28
29 static void
30 Caret(floatish x, floatish y, floatish d)
31 {
32 fprintf(psfp, "%f %f moveto\n", x - d, y);
33 fprintf(psfp, "%f %f rlineto\n", d, -d);
34 fprintf(psfp, "%f %f rlineto\n", d, d);
35 fprintf(psfp, "closepath\n");
36
37 fprintf(psfp, "gsave\n");
38 fprintf(psfp, "1.0 setgray\n");
39 fprintf(psfp, "fill\n");
40 fprintf(psfp, "grestore\n");
41 fprintf(psfp, "stroke\n");
42 }