summaryrefslogtreecommitdiff
path: root/ghc/utils/hp2ps/Marks.c
blob: f86cff9939e6d0f89f99061e9c89dae6814a7671 (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
#include <stdio.h>
#include "Main.h"
#include "Curves.h"
#include "Dimensions.h"
#include "HpFile.h"

/* own stuff */
#include "Marks.h"

static void Caret PROTO((floatish, floatish, floatish));

void
Marks()
{
    intish i;
    floatish m;

    for (i = 0; i < nmarks; i++) {
	m = (markmap[i] / xrange) * graphwidth;
	Caret(xpage(m), ypage(0.0), 4.0);
    }
}


/*
 * Draw a small white caret at (x,y) with width 2 * d
 */

static void
Caret(x,y,d)
  floatish x; floatish y; floatish d;
{
    fprintf(psfp, "%f %f moveto\n", x - d, y);
    fprintf(psfp, "%f %f rlineto\n",  d, -d);
    fprintf(psfp, "%f %f rlineto\n",  d,  d);
    fprintf(psfp, "closepath\n");

    fprintf(psfp, "gsave\n");
    fprintf(psfp, "1.0 setgray\n");
    fprintf(psfp, "fill\n");
    fprintf(psfp, "grestore\n");
    fprintf(psfp, "stroke\n");
}