diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-05-04 17:24:23 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-04 19:51:33 -0700 |
commit | fa82ba60798be8b5e20277527053199916888b16 (patch) | |
tree | 7cc67c1bcad3ba1f1612bc5bf52d4c33c223cb7d /display.h | |
parent | ec4d4566adc59d5fa2642c5f4ca12653b3f384a3 (diff) | |
download | subsurface-fa82ba60798be8b5e20277527053199916888b16.tar.gz |
Moved the plot from the cairo version to the Qt version
Started working on the Qt version of the Plot, initially
nothing is printed - but this is not a bad thing,
the program doesn't explodes too. :)
some work had to be done about the 'bool/gboolean' stuff
so I removed all gbooleans in the code that I'v encountered.
A new file was created ( profile.h ) so I could put the
signatures of helper methods that cairo used to call.
till now the code computes the max limits.
Next patch the first drawing will be made.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'display.h')
-rw-r--r-- | display.h | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -1,18 +1,26 @@ #ifndef DISPLAY_H #define DISPLAY_H -#include <cairo.h> - #ifdef __cplusplus extern "C" { +#else +#if __STDC_VERSION__ >= 199901L +#include <stdbool.h> +#else +typedef int bool; +#endif #endif #define SCALE_SCREEN 1.0 -#define SCALE_PRINT (1.0 / get_screen_dpi()) +#warning "PORT THE get_screen_dpi to Qt" +#define SCALE_PRINT 1.0 +//#define SCALE_PRINT (1.0 / get_screen_dpi()) extern void repaint_dive(void); extern void do_print(void); -extern gdouble get_screen_dpi(void); + +// Commented out because I don't know how to get the dpi on a paint device yet. +// extern gdouble get_screen_dpi(void); /* Plot info with smoothing, velocity indication * and one-, two- and three-minute minimums and maximums */ @@ -24,11 +32,16 @@ struct plot_info { int mintemp, maxtemp; double endtempcoord; double maxpp; - gboolean has_ndl; + bool has_ndl; struct plot_data *entry; }; /* +// I'm not sure if this is needed anymore - but keeping this here +// so I wont break stuff trying to redo the well. +*/ + +/* * Cairo scaling really is horribly horribly mis-designed. * * Which is sad, because I really like Cairo otherwise. But @@ -38,8 +51,6 @@ struct plot_info { */ struct graphics_context { int printer; - cairo_t *cr; - cairo_rectangle_t drawing_area; double maxx, maxy; double leftx, rightx; double topy, bottomy; @@ -61,7 +72,7 @@ struct options { enum { PRETTY, TABLE, TWOPERPAGE } type; int print_selected; int color_selected; - gboolean notes_up; + bool notes_up; int profile_height, notes_height, tanks_height; }; |