summaryrefslogtreecommitdiff
path: root/src/cairo/cdcairoprn_unix.c
diff options
context:
space:
mode:
authorscuri <scuri>2010-06-25 03:00:48 +0000
committerscuri <scuri>2010-06-25 03:00:48 +0000
commitb880f13768528657cb392f6894bf626f16590e64 (patch)
tree9bceab7e9a4b9615019bafea294c392be18eb456 /src/cairo/cdcairoprn_unix.c
parentcc230deb11b91957dcd656f150ffff698237f906 (diff)
*** empty log message ***
Diffstat (limited to 'src/cairo/cdcairoprn_unix.c')
-rw-r--r--src/cairo/cdcairoprn_unix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cairo/cdcairoprn_unix.c b/src/cairo/cdcairoprn_unix.c
index b201230..fa13522 100644
--- a/src/cairo/cdcairoprn_unix.c
+++ b/src/cairo/cdcairoprn_unix.c
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include <string.h>
+#include <gtk/gtk.h>
#include <gtk/gtkprintunixdialog.h>
#include "cdcairoctx.h"
@@ -147,8 +148,13 @@ static void cdcreatecanvas(cdCanvas* canvas, void *data)
canvas->w_mm = (int)gtk_page_setup_get_page_width(page_setup, GTK_UNIT_MM);
canvas->h_mm = (int)gtk_page_setup_get_page_height(page_setup, GTK_UNIT_MM);
canvas->bpp = 24;
+#if GTK_CHECK_VERSION(2, 16, 0)
canvas->xres = (double)gtk_print_settings_get_resolution_x(settings) / 25.4;
canvas->yres = (double)gtk_print_settings_get_resolution_y(settings) / 25.4;
+#else
+ canvas->xres = (double)gtk_print_settings_get_int (settings, GTK_PRINT_SETTINGS_RESOLUTION) / 25.4;
+ canvas->yres = (double)gtk_print_settings_get_int (settings, GTK_PRINT_SETTINGS_RESOLUTION) / 25.4;
+#endif
canvas->w = cdRound(canvas->w_mm*canvas->xres);
canvas->h = cdRound(canvas->h_mm*canvas->yres);