summaryrefslogtreecommitdiffstats
path: root/display.h
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-05-04 17:24:23 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-04 19:51:33 -0700
commitfa82ba60798be8b5e20277527053199916888b16 (patch)
tree7cc67c1bcad3ba1f1612bc5bf52d4c33c223cb7d /display.h
parentec4d4566adc59d5fa2642c5f4ca12653b3f384a3 (diff)
downloadsubsurface-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.h27
1 files changed, 19 insertions, 8 deletions
diff --git a/display.h b/display.h
index b1a034e88..bc60c059f 100644
--- a/display.h
+++ b/display.h
@@ -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;
};