diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2008-05-21 02:17:30 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-05-21 02:17:30 +0000 |
commit | 59ae44d00ee7876b3c69fd462d515a4f50c55b6a (patch) | |
tree | 76c8f2df967022569c134fa9e177663ffb07b27f /gtk/gtkprinter.c | |
parent | 75a9722aa14784e70c49b988ce28589eceb752e3 (diff) | |
download | gtk+-59ae44d00ee7876b3c69fd462d515a4f50c55b6a.tar.gz |
RH bug 204621 - "GtkPrint" asks for "Letter" size paper when "A4" size
was chosen
Patch by Marek Kasik.
* gtk/gtk.symbols:
* gtk/gtkprinter.[hc]: Add gtk_printer_get_default_page_size.
* gtk/gtkprintbackend.[hc]: Add fallback implementation.
* modules/printbackends/file/gtkprintbackendfile.c:
* modules/printbackends/cups/gtkprintbackendcups.c: Implement
get_default_page_size.
* gtk/gtkpagesetupunixdialog.c: When selecting a different printer,
select its default paper size.
* gtk/gtkprintunixdialog.c: If no explicit page setup has been set,
use the printer default.
* gtk/gtkprintoperation-unix.c: Don't create an empty page setup
if we don't have a default page setup.
svn path=/trunk/; revision=20120
Diffstat (limited to 'gtk/gtkprinter.c')
-rw-r--r-- | gtk/gtkprinter.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk/gtkprinter.c b/gtk/gtkprinter.c index 15c866f8a1..1ce3ed55b1 100644 --- a/gtk/gtkprinter.c +++ b/gtk/gtkprinter.c @@ -832,6 +832,27 @@ gtk_printer_list_papers (GtkPrinter *printer) return backend_class->printer_list_papers (printer); } +/** + * gtk_printer_get_default_page_size: + * @printer: a #GtkPrinter + * + * Returns default page size of @printer. + * + * Return value: a newly allocated #GtkPageSetup with default page size of the printer. + * + * Since: 2.13 + */ +GtkPageSetup * +gtk_printer_get_default_page_size (GtkPrinter *printer) +{ + GtkPrintBackendClass *backend_class; + + g_return_val_if_fail (GTK_IS_PRINTER (printer), NULL); + + backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend); + return backend_class->printer_get_default_page_size (printer); +} + void _gtk_printer_get_hard_margins (GtkPrinter *printer, gdouble *top, |