[gtk+] Use getters and setters for GtkPrintJob in gtkprintbackendtest.c
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use getters and setters for GtkPrintJob in gtkprintbackendtest.c
- Date: Wed, 22 Dec 2010 04:37:04 +0000 (UTC)
commit 2013e23c4bfc5dd8a154325f8dde865acec9cc42
Author: Robert Ancell <robert ancell canonical com>
Date: Wed Dec 22 15:36:47 2010 +1100
Use getters and setters for GtkPrintJob in gtkprintbackendtest.c
modules/printbackends/test/gtkprintbackendtest.c | 30 +++++++++++----------
1 files changed, 16 insertions(+), 14 deletions(-)
---
diff --git a/modules/printbackends/test/gtkprintbackendtest.c b/modules/printbackends/test/gtkprintbackendtest.c
index f40c03c..14c8e52 100644
--- a/modules/printbackends/test/gtkprintbackendtest.c
+++ b/modules/printbackends/test/gtkprintbackendtest.c
@@ -525,25 +525,27 @@ test_printer_prepare_for_print (GtkPrinter *printer,
{
gdouble scale;
- print_job->print_pages = gtk_print_settings_get_print_pages (settings);
- print_job->page_ranges = NULL;
- print_job->num_page_ranges = 0;
+ gtk_print_job_set_pages (print_job, gtk_print_settings_get_print_pages (settings));
+ gtk_print_job_set_page_ranges (print_job, NULL, 0);
- if (print_job->print_pages == GTK_PRINT_PAGES_RANGES)
- print_job->page_ranges =
- gtk_print_settings_get_page_ranges (settings,
- &print_job->num_page_ranges);
-
- print_job->collate = gtk_print_settings_get_collate (settings);
- print_job->reverse = gtk_print_settings_get_reverse (settings);
- print_job->num_copies = gtk_print_settings_get_n_copies (settings);
+ if (gtk_print_job_get_pages (print_job) == GTK_PRINT_PAGES_RANGES)
+ {
+ GtkPageRange *page_ranges;
+ gint num_page_ranges;
+ page_ranges = gtk_print_settings_get_page_ranges (settings, &num_page_ranges);
+ gtk_print_job_set_page_ranges (print_job, page_ranges, num_page_ranges);
+ }
+
+ gtk_print_job_set_collate (print_job, gtk_print_settings_get_collate (settings));
+ gtk_print_job_set_reverse (print_job, gtk_print_settings_get_reverse (settings));
+ gtk_print_job_set_num_copies (print_job, gtk_print_settings_get_n_copies (settings));
scale = gtk_print_settings_get_scale (settings);
if (scale != 100.0)
- print_job->scale = scale/100.0;
+ gtk_print_job_set_scale (print_job, scale/100.0);
- print_job->page_set = gtk_print_settings_get_page_set (settings);
- print_job->rotate_to_orientation = TRUE;
+ gtk_print_job_set_page_set (print_job, gtk_print_settings_get_page_set (settings));
+ gtk_print_job_set_rotate (print_job, TRUE);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]