nethercote | 5912c81 | 2004-02-15 15:38:08 +0000 | [diff] [blame] | 1 | /* This file is part of hp2ps, a graph drawer for memory profiles. |
| 2 | Copyright (C) 2002 The University Court of the University of Glasgow. |
| 3 | This program is governed by the license contained in the file LICENSE. */ |
| 4 | |
nethercote | c9f3692 | 2004-02-14 16:40:02 +0000 | [diff] [blame] | 5 | #include <stdio.h> |
| 6 | #include "Main.h" |
| 7 | #include "Curves.h" |
| 8 | #include "Dimensions.h" |
| 9 | #include "HpFile.h" |
| 10 | |
| 11 | /* own stuff */ |
| 12 | #include "Marks.h" |
| 13 | |
| 14 | static void Caret PROTO((floatish, floatish, floatish)); |
| 15 | |
| 16 | void |
| 17 | Marks() |
| 18 | { |
| 19 | intish i; |
| 20 | floatish m; |
| 21 | |
| 22 | for (i = 0; i < nmarks; i++) { |
| 23 | m = ((markmap[i] - samplemap[0]) / xrange) * graphwidth; |
| 24 | Caret(xpage(m), ypage(0.0), 4.0); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | |
| 29 | /* |
| 30 | * Draw a small white caret at (x,y) with width 2 * d |
| 31 | */ |
| 32 | |
| 33 | static void |
| 34 | Caret(x,y,d) |
| 35 | floatish x; floatish y; floatish d; |
| 36 | { |
| 37 | fprintf(psfp, "%f %f moveto\n", x - d, y); |
| 38 | fprintf(psfp, "%f %f rlineto\n", d, -d); |
| 39 | fprintf(psfp, "%f %f rlineto\n", d, d); |
| 40 | fprintf(psfp, "closepath\n"); |
| 41 | |
| 42 | fprintf(psfp, "gsave\n"); |
| 43 | fprintf(psfp, "1.0 setgray\n"); |
| 44 | fprintf(psfp, "fill\n"); |
| 45 | fprintf(psfp, "grestore\n"); |
| 46 | fprintf(psfp, "stroke\n"); |
| 47 | } |