summaryrefslogtreecommitdiff
path: root/src/cairo
diff options
context:
space:
mode:
Diffstat (limited to 'src/cairo')
-rw-r--r--src/cairo/cdcairoprn_unix.c6
-rw-r--r--src/cairo/cdcairops.c2
2 files changed, 8 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);
diff --git a/src/cairo/cdcairops.c b/src/cairo/cdcairops.c
index 52268e5..b08aee4 100644
--- a/src/cairo/cdcairops.c
+++ b/src/cairo/cdcairops.c
@@ -126,10 +126,12 @@ static void cdcreatecanvas(cdCanvas* canvas, void* data)
surface = cairo_ps_surface_create(filename, w_pt, h_pt);
+#if (CAIRO_VERSION_MAJOR>1 || (CAIRO_VERSION_MAJOR==1 && CAIRO_VERSION_MINOR>=6))
if (level == 2)
cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_2);
else if (level == 3)
cairo_ps_surface_restrict_to_level(surface, CAIRO_PS_LEVEL_3);
+#endif
if (eps)
cairo_ps_surface_set_eps(surface, 1);