diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-13 16:02:42 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-13 16:02:42 -0700 |
commit | ce86289eed0651c846a609743d77e26cacbcfde6 (patch) | |
tree | 5b50566f8b34efb18049636b67856e811e0e7d43 /profile.c | |
parent | c6b13fad5aebdf7ee7f1b67da58512e49840a7c1 (diff) | |
download | subsurface-ce86289eed0651c846a609743d77e26cacbcfde6.tar.gz |
Add the capability to print a dive profile
Ok, this is the ugliest f*&$ing printout I have ever seen in my life,
but think of it as a "the concept of printing works" commit, and you'll
be able to hold your lunch down and not gouge out your eyeballs with a
spoon. Maybe.
I'm just doing the cairo display as-is for the printout, which is a
seriously bad idea. I need to not try to do colors etc, and instead of
having white lines on a black background I just need to make thelines be
black on white paper.
But that would involve actually changing the current "plot()" routine,
which is against the point of the exercise right now. This really is
just a demonstration of how to add printing capabilities.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 17 |
1 files changed, 1 insertions, 16 deletions
@@ -10,21 +10,6 @@ int selected_dive = 0; -/* - * Cairo scaling really is horribly horribly mis-designed. - * - * Which is sad, because I really like Cairo otherwise. But - * the fact that the line width is scaled with the same scale - * as the coordinate system is a f*&%ing disaster. So we - * can't use it, and instead have this butt-ugly wrapper thing.. - */ -struct graphics_context { - cairo_t *cr; - double maxx, maxy; - double leftx, rightx; - double topy, bottomy; -}; - /* Plot info with smoothing and one-, two- and three-minute minimums and maximums */ struct plot_info { int nr; @@ -645,7 +630,7 @@ static struct plot_info *depth_plot_info(struct dive *dive) return analyze_plot_info(pi); } -static void plot(struct graphics_context *gc, int w, int h, struct dive *dive) +void plot(struct graphics_context *gc, int w, int h, struct dive *dive) { double topx, topy; struct plot_info *pi = depth_plot_info(dive); |