diff options
author | Cody Russell <bratsche@gnome.org> | 2008-04-01 20:46:18 +0000 |
---|---|---|
committer | Cody Russell <bratsche@src.gnome.org> | 2008-04-01 20:46:18 +0000 |
commit | b7e159658dbf2c2f8cd859d05d6b83e6e42762cc (patch) | |
tree | 0294a8495b237afe6970c8416ee13cddce13f004 /gtk/gtkprintoperation-win32.c | |
parent | d4a3e5a6e47f474d6520c168c6edb9274dc3e6c4 (diff) | |
download | gtk+-b7e159658dbf2c2f8cd859d05d6b83e6e42762cc.tar.gz |
Bump required Cairo to 1.5.2.
2008-04-01 Cody Russell <bratsche@gnome.org>
* configure.in: Bump required Cairo to 1.5.2.
* gtk/gtkprintoperation-win32.c: Add support for using the new
cairo_win32_printing_surface for printing. (#488833)
svn path=/trunk/; revision=19955
Diffstat (limited to 'gtk/gtkprintoperation-win32.c')
-rw-r--r-- | gtk/gtkprintoperation-win32.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gtk/gtkprintoperation-win32.c b/gtk/gtkprintoperation-win32.c index eb061afb53..a959ac9490 100644 --- a/gtk/gtkprintoperation-win32.c +++ b/gtk/gtkprintoperation-win32.c @@ -455,6 +455,9 @@ win32_end_page (GtkPrintOperation *op, GtkPrintContext *print_context) { GtkPrintOperationWin32 *op_win32 = op->priv->platform_data; + + cairo_surface_show_page (op_win32->surface); + EndPage (op_win32->hdc); } @@ -486,6 +489,8 @@ win32_end_run (GtkPrintOperation *op, GtkPrintOperationWin32 *op_win32 = op->priv->platform_data; LPDEVNAMES devnames; HANDLE printerHandle = 0; + + cairo_surface_finish (op_win32->surface); EndDoc (op_win32->hdc); @@ -501,7 +506,6 @@ win32_end_run (GtkPrintOperation *op, GlobalFree(op_win32->devmode); GlobalFree(op_win32->devnames); - cairo_surface_finish (op_win32->surface); cairo_surface_destroy (op_win32->surface); op_win32->surface = NULL; @@ -1601,7 +1605,8 @@ _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op, *do_print = TRUE; - op_win32->surface = cairo_win32_surface_create (printdlgex->hDC); + op_win32->surface = cairo_win32_printing_surface_create (printdlgex->hDC); + dpi_x = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSX); dpi_y = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSY); @@ -1619,7 +1624,7 @@ _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *op, job_id = StartDocW(printdlgex->hDC, &docinfo); g_free ((void *)docinfo.lpszDocName); if (job_id <= 0) - { + { result = GTK_PRINT_OPERATION_RESULT_ERROR; g_set_error (&priv->error, GTK_PRINT_ERROR, @@ -1703,8 +1708,9 @@ _gtk_print_operation_platform_backend_preview_end_page (GtkPrintOperation *op, cairo_surface_t *surface, cairo_t *cr) { - /* TODO: This doesn't actually seem to work. - * Do enhanced metafiles really support multiple pages? + cairo_surface_show_page (cr); + + /* TODO: Enhanced metafiles don't support multiple pages. */ HDC dc = cairo_win32_surface_get_dc (surface); EndPage (dc); @@ -1758,7 +1764,7 @@ _gtk_print_operation_platform_backend_create_preview_surface (GtkPrintOperation *dpi_x = (double)GetDeviceCaps (metafile_dc, LOGPIXELSX); *dpi_y = (double)GetDeviceCaps (metafile_dc, LOGPIXELSY); - return cairo_win32_surface_create (metafile_dc); + return cairo_win32_printing_surface_create (metafile_dc); } void |