Implement per-page paper sizes.

2006-05-05  Alexander Larsson  <alexl@redhat.com>

	* gtk/gtkprintoperation-unix.c:
	Implement per-page paper sizes.

	* gtk/gtkprintoperation.c:
	Implement per-page paper sizes for pdf output.
	Make gtk_print_operation_set_pdf_target() work again

	* tests/Makefile.am:
	* tests/testprint.c:
	* tests/testprintfileoperation.[ch]:
	Add more test code for printing support.
	This tests per-page paper sizes & orientation and
	deriving from GtkPrintOperation.
This commit is contained in:
Alexander Larsson
2006-05-05 11:03:33 +00:00
committed by Alexander Larsson
parent f78961034b
commit 719050ed1f
8 changed files with 399 additions and 2 deletions

View File

@ -58,7 +58,21 @@ unix_start_page (GtkPrintOperation *op,
GtkPrintContext *print_context,
GtkPageSetup *page_setup)
{
GtkPaperSize *paper_size;
cairo_surface_type_t type;
double w, h;
paper_size = gtk_page_setup_get_paper_size (page_setup);
w = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
h = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
type = cairo_surface_get_type (op->priv->surface);
if (type == CAIRO_SURFACE_TYPE_PS)
cairo_ps_surface_set_size (op->priv->surface, w, h);
else if (type == CAIRO_SURFACE_TYPE_PDF)
cairo_pdf_surface_set_size (op->priv->surface, w, h);
}
static void