[evince] [printing] Set page orientation of each page when printing
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evince] [printing] Set page orientation of each page when printing
- Date: Sun, 25 Oct 2009 12:17:49 +0000 (UTC)
commit 81a61466af2516daf6ba4b716234c0bcbeee959c
Author: Adrian Johnson <ajohnson redneon com>
Date: Sat Oct 24 18:44:02 2009 +1030
[printing] Set page orientation of each page when printing
so that documents with mixed portrait/landscape pages print correctly.
Fixes bgo#599470.
shell/ev-print-operation.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/shell/ev-print-operation.c b/shell/ev-print-operation.c
index 8dbe6c5..9ea42c1 100644
--- a/shell/ev-print-operation.c
+++ b/shell/ev-print-operation.c
@@ -1642,6 +1642,23 @@ print_job_cancelled (EvJobPrint *job,
}
static void
+ev_print_operation_print_request_page_setup (EvPrintOperationPrint *print,
+ GtkPrintContext *context,
+ gint page_nr,
+ GtkPageSetup *setup)
+{
+ EvPrintOperation *op = EV_PRINT_OPERATION (print);
+ gdouble width, height;
+
+ ev_document_get_page_size (op->document, page_nr,
+ &width, &height);
+ if (width > height)
+ gtk_page_setup_set_orientation (setup, GTK_PAGE_ORIENTATION_LANDSCAPE);
+ else
+ gtk_page_setup_set_orientation (setup, GTK_PAGE_ORIENTATION_PORTRAIT);
+}
+
+static void
ev_print_operation_print_draw_page (EvPrintOperationPrint *print,
GtkPrintContext *context,
gint page)
@@ -1727,6 +1744,9 @@ ev_print_operation_print_init (EvPrintOperationPrint *print)
g_signal_connect_swapped (print->op, "status_changed",
G_CALLBACK (ev_print_operation_print_status_changed),
print);
+ g_signal_connect_swapped (print->op, "request_page_setup",
+ G_CALLBACK (ev_print_operation_print_request_page_setup),
+ print);
gtk_print_operation_set_allow_async (print->op, TRUE);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]