Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2007-08-25 15:55:07 (GMT)
committer Carlos Garcia Campos <carlosgc@src.gnome.org>2007-08-25 15:55:07 (GMT)
commita50e3f1032fe4e868c92668477aea37bb86052d6 (patch)
tree47134389e1f81c406894d11eb731ed60ebd8acbe /shell
parentaa5d60b07e188daa855d269e7e9b2da4388ed070 (diff)
Adjust number of pages per row according to page orientation when printing
2007-08-25 Carlos Garcia Campos <carlosgc@gnome.org> * backend/pdf/ev-poppler.cc: (pdf_document_file_exporter_begin): * libdocument/ev-file-exporter.[ch]: (ev_file_exporter_get_capabilities): * shell/ev-jobs.[ch]: (ev_job_print_new), (ev_job_print_run): * shell/ev-window.c: (ev_window_print_dialog_response_cb): Adjust number of pages per row according to page orientation when printing 2 or 6 pages per sheet. svn path=/trunk/; revision=2641
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-jobs.c5
-rw-r--r--shell/ev-jobs.h3
-rw-r--r--shell/ev-window.c13
3 files changed, 19 insertions, 2 deletions
diff --git a/shell/ev-jobs.c b/shell/ev-jobs.c
index 1218cd0..c78b28c 100644
--- a/shell/ev-jobs.c
+++ b/shell/ev-jobs.c
@@ -10,8 +10,6 @@
#include "ev-document-fonts.h"
#include "ev-selection.h"
#include "ev-async-renderer.h"
-#include "ev-file-exporter.h"
-#include "ev-window.h"
#include <glib/gstdio.h>
#include <unistd.h>
@@ -564,6 +562,7 @@ ev_job_print_new (EvDocument *document,
const gchar *format,
gdouble width,
gdouble height,
+ EvFileExporterOrientation orientation,
EvPrintRange *ranges,
gint n_ranges,
EvPrintPageSet page_set,
@@ -585,6 +584,7 @@ ev_job_print_new (EvDocument *document,
job->width = width;
job->height = height;
+ job->orientation = orientation;
job->ranges = ranges;
job->n_ranges = n_ranges;
@@ -718,6 +718,7 @@ ev_job_print_run (EvJobPrint *job)
fc.last_page = MAX (first_page, last_page);
fc.paper_width = job->width;
fc.paper_height = job->height;
+ fc.orientation = job->orientation;
fc.duplex = FALSE;
fc.pages_per_sheet = job->pages_per_sheet;
diff --git a/shell/ev-jobs.h b/shell/ev-jobs.h
index 1f348d8..b15f260 100644
--- a/shell/ev-jobs.h
+++ b/shell/ev-jobs.h
@@ -23,6 +23,7 @@
#include <gtk/gtk.h>
#include "ev-document.h"
#include "ev-window.h"
+#include "ev-file-exporter.h"
G_BEGIN_DECLS
@@ -204,6 +205,7 @@ struct _EvJobPrint
gboolean reverse;
gdouble width;
gdouble height;
+ EvFileExporterOrientation orientation;
};
struct _EvJobPrintClass
@@ -262,6 +264,7 @@ EvJob *ev_job_print_new (EvDocument *document,
const gchar *format,
gdouble width,
gdouble height,
+ EvFileExporterOrientation orientation,
EvPrintRange *ranges,
gint n_ranges,
EvPrintPageSet page_set,
diff --git a/shell/ev-window.c b/shell/ev-window.c
index b390644..9700746 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -2332,6 +2332,7 @@ ev_window_print_dialog_response_cb (GtkDialog *dialog,
gdouble width;
gdouble height;
GtkPrintPages print_pages;
+ EvFileExporterOrientation orientation;
const gchar *file_format;
if (response == GTK_RESPONSE_CANCEL) {
@@ -2410,6 +2411,17 @@ ev_window_print_dialog_response_cb (GtkDialog *dialog,
GTK_UNIT_PIXEL);
height = gtk_page_setup_get_paper_height (window->priv->print_page_setup,
GTK_UNIT_PIXEL);
+
+ switch (gtk_page_setup_get_orientation (window->priv->print_page_setup)) {
+ case GTK_PAGE_ORIENTATION_PORTRAIT:
+ case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
+ orientation = EV_FILE_EXPORTER_PORTRAIT;
+ break;
+ case GTK_PAGE_ORIENTATION_LANDSCAPE:
+ case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
+ orientation = EV_FILE_EXPORTER_LANDSCAPE;
+ break;
+ }
if (scale != 1.0) {
width *= scale;
@@ -2425,6 +2437,7 @@ ev_window_print_dialog_response_cb (GtkDialog *dialog,
window->priv->print_job = ev_job_print_new (window->priv->document,
file_format ? file_format : "ps",
width, height,
+ orientation,
ranges, n_ranges,
page_set,
pages_per_sheet,