From 7a44ce336669e7c3ac6418a7dbe8171a6749b49b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 19 Jun 2006 05:09:49 +0000 Subject: [PATCH] Add a capabilities argument to the printer_get_options method and to the 2006-06-19 Matthias Clasen * gtk/gtkprinter-private.h: * gtk/gtkprinter.c (_gtk_printer_get_options): * gtk/gtkprintbackend.h: Add a capabilities argument to the printer_get_options method and to the _gtk_printer_get_options function * modules/printbackends/lpr/gtkprintbackendlpr.c (lpr_printer_get_options): * modules/printbackends/pdf/gtkprintbackendpdf.c (pdf_printer_get_options): * modules/printbackends/cups/gtkprintbackendcups.c (cups_printer_get_options): * gtk/gtkprintunixdialog.c (selected_printer_changed): Adjust callers and implementations. --- ChangeLog | 15 +++++++++++++++ ChangeLog.pre-2-10 | 15 +++++++++++++++ gtk/gtkprintbackend.h | 3 ++- gtk/gtkprinter-private.h | 4 ++-- gtk/gtkprinter.c | 9 +++++---- modules/printbackends/lpr/gtkprintbackendlpr.c | 10 ++++++---- modules/printbackends/pdf/gtkprintbackendpdf.c | 11 +++++++---- 7 files changed, 52 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66228eb203..1e8b2bd269 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2006-06-19 Matthias Clasen + * gtk/gtkprinter-private.h: + * gtk/gtkprinter.c (_gtk_printer_get_options): + * gtk/gtkprintbackend.h: Add a capabilities argument to the + printer_get_options method and to the _gtk_printer_get_options + function + + * modules/printbackends/lpr/gtkprintbackendlpr.c + (lpr_printer_get_options): + * modules/printbackends/pdf/gtkprintbackendpdf.c + (pdf_printer_get_options): + * modules/printbackends/cups/gtkprintbackendcups.c + (cups_printer_get_options): + * gtk/gtkprintunixdialog.c (selected_printer_changed): Adjust + callers and implementations. + * gtk/gtkprintjob.h: Add a GENERATE_PS capability. * gtk/gtkprintunixdialog.c (is_printer_active): And use it here. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 66228eb203..1e8b2bd269 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,20 @@ 2006-06-19 Matthias Clasen + * gtk/gtkprinter-private.h: + * gtk/gtkprinter.c (_gtk_printer_get_options): + * gtk/gtkprintbackend.h: Add a capabilities argument to the + printer_get_options method and to the _gtk_printer_get_options + function + + * modules/printbackends/lpr/gtkprintbackendlpr.c + (lpr_printer_get_options): + * modules/printbackends/pdf/gtkprintbackendpdf.c + (pdf_printer_get_options): + * modules/printbackends/cups/gtkprintbackendcups.c + (cups_printer_get_options): + * gtk/gtkprintunixdialog.c (selected_printer_changed): Adjust + callers and implementations. + * gtk/gtkprintjob.h: Add a GENERATE_PS capability. * gtk/gtkprintunixdialog.c (is_printer_active): And use it here. diff --git a/gtk/gtkprintbackend.h b/gtk/gtkprintbackend.h index 5ccd1d7183..ba08c2d546 100644 --- a/gtk/gtkprintbackend.h +++ b/gtk/gtkprintbackend.h @@ -87,7 +87,8 @@ struct _GtkPrintBackendClass gint cache_fd); GtkPrinterOptionSet * (*printer_get_options) (GtkPrinter *printer, GtkPrintSettings *settings, - GtkPageSetup *page_setup); + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities); gboolean (*printer_mark_conflicts) (GtkPrinter *printer, GtkPrinterOptionSet *options); void (*printer_get_settings_from_options) (GtkPrinter *printer, diff --git a/gtk/gtkprinter-private.h b/gtk/gtkprinter-private.h index cfec13de7b..37a23a8bd2 100644 --- a/gtk/gtkprinter-private.h +++ b/gtk/gtkprinter-private.h @@ -34,8 +34,8 @@ gboolean _gtk_printer_has_details (GtkPrinter void _gtk_printer_request_details (GtkPrinter *printer); GtkPrinterOptionSet *_gtk_printer_get_options (GtkPrinter *printer, GtkPrintSettings *settings, - GtkPageSetup *page_setup); -gboolean _gtk_printer_mark_conflicts (GtkPrinter *printer, + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities);gboolean _gtk_printer_mark_conflicts (GtkPrinter *printer, GtkPrinterOptionSet *options); void _gtk_printer_get_settings_from_options (GtkPrinter *printer, GtkPrinterOptionSet *options, diff --git a/gtk/gtkprinter.c b/gtk/gtkprinter.c index 1b9912e964..abf8a80f64 100644 --- a/gtk/gtkprinter.c +++ b/gtk/gtkprinter.c @@ -713,12 +713,13 @@ _gtk_printer_request_details (GtkPrinter *printer) } GtkPrinterOptionSet * -_gtk_printer_get_options (GtkPrinter *printer, - GtkPrintSettings *settings, - GtkPageSetup *page_setup) +_gtk_printer_get_options (GtkPrinter *printer, + GtkPrintSettings *settings, + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities) { GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend); - return backend_class->printer_get_options (printer, settings, page_setup); + return backend_class->printer_get_options (printer, settings, page_setup, capabilities); } gboolean diff --git a/modules/printbackends/lpr/gtkprintbackendlpr.c b/modules/printbackends/lpr/gtkprintbackendlpr.c index d045208363..29a94d6901 100644 --- a/modules/printbackends/lpr/gtkprintbackendlpr.c +++ b/modules/printbackends/lpr/gtkprintbackendlpr.c @@ -67,7 +67,8 @@ static void lpr_printer_get_settings_from_options (GtkPrinter GtkPrintSettings *settings); static GtkPrinterOptionSet *lpr_printer_get_options (GtkPrinter *printer, GtkPrintSettings *settings, - GtkPageSetup *page_setup); + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities); static void lpr_printer_prepare_for_print (GtkPrinter *printer, GtkPrintJob *print_job, GtkPrintSettings *settings, @@ -392,9 +393,10 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backend) } static GtkPrinterOptionSet * -lpr_printer_get_options (GtkPrinter *printer, - GtkPrintSettings *settings, - GtkPageSetup *page_setup) +lpr_printer_get_options (GtkPrinter *printer, + GtkPrintSettings *settings, + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities) { GtkPrinterOptionSet *set; GtkPrinterOption *option; diff --git a/modules/printbackends/pdf/gtkprintbackendpdf.c b/modules/printbackends/pdf/gtkprintbackendpdf.c index 1a362a7260..81b9c07f75 100644 --- a/modules/printbackends/pdf/gtkprintbackendpdf.c +++ b/modules/printbackends/pdf/gtkprintbackendpdf.c @@ -39,6 +39,7 @@ #include "gtkprintbackendpdf.h" #include "gtkprinter.h" +#include "gtkprinter-private.h" typedef struct _GtkPrintBackendPdfClass GtkPrintBackendPdfClass; @@ -69,7 +70,8 @@ static void pdf_printer_get_settings_from_options (GtkPrinter GtkPrintSettings *settings); static GtkPrinterOptionSet *pdf_printer_get_options (GtkPrinter *printer, GtkPrintSettings *settings, - GtkPageSetup *page_setup); + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities); static void pdf_printer_prepare_for_print (GtkPrinter *printer, GtkPrintJob *print_job, GtkPrintSettings *settings, @@ -367,9 +369,10 @@ gtk_print_backend_pdf_init (GtkPrintBackendPdf *backend) } static GtkPrinterOptionSet * -pdf_printer_get_options (GtkPrinter *printer, - GtkPrintSettings *settings, - GtkPageSetup *page_setup) +pdf_printer_get_options (GtkPrinter *printer, + GtkPrintSettings *settings, + GtkPageSetup *page_setup, + GtkPrintCapabilities capabilities) { GtkPrinterOptionSet *set; GtkPrinterOption *option;