Index: gtk/gtkprinter.c
===================================================================
--- gtk/gtkprinter.c	(révision 18667)
+++ gtk/gtkprinter.c	(copie de travail)
@@ -832,16 +832,34 @@ gtk_printer_list_papers (GtkPrinter *pri
   return backend_class->printer_list_papers (printer);
 }
 
-void
-_gtk_printer_get_hard_margins (GtkPrinter *printer,
-			       gdouble    *top,
-			       gdouble    *bottom,
-			       gdouble    *left,
-			       gdouble    *right)
+/**
+ * gtk_printer_get_hard_margins:
+ * @printer: a #GtkPrinter
+ * @top: a location to store the top margin in
+ * @bottom: a location to store the bottom margin in
+ * @left: a location to store the left margin in
+ * @right: a location to store the right margin in
+ *
+ * Retrieve the hard margins of @printer, i.e. the margins that define
+ * the area at the borders of the paper that the printer cannot print to.
+ *
+ * Note: This will not succeed unless the printer's details are available,
+ * see gtk_printer_has_details() and gtk_printer_request_details().
+ *
+ * Return value: %TRUE iff the hard margins were retrieved
+ *
+ * Since: 2.14
+ */
+gboolean
+gtk_printer_get_hard_margins (GtkPrinter *printer,
+			      gdouble    *top,
+			      gdouble    *bottom,
+			      gdouble    *left,
+			      gdouble    *right)
 {
   GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
 
-  backend_class->printer_get_hard_margins (printer, top, bottom, left, right);
+  return backend_class->printer_get_hard_margins (printer, top, bottom, left, right);
 }
 
 /**
@@ -856,7 +874,7 @@ _gtk_printer_get_hard_margins (GtkPrinte
  *
  * This will return 0 unless the printer's details are available, see
  * gtk_printer_has_details() and gtk_printer_request_details().
- *  *
+ *
  * Return value: the printer's capabilities
  *
  * Since: 2.12
Index: gtk/gtkprinter.h
===================================================================
--- gtk/gtkprinter.h	(révision 18667)
+++ gtk/gtkprinter.h	(copie de travail)
@@ -105,6 +105,11 @@ gint                     gtk_printer_com
 gboolean                 gtk_printer_has_details       (GtkPrinter       *printer);
 void                     gtk_printer_request_details   (GtkPrinter       *printer);
 GtkPrintCapabilities     gtk_printer_get_capabilities  (GtkPrinter       *printer);
+gboolean                 gtk_printer_get_hard_margins  (GtkPrinter          *printer,
+							gdouble             *top,
+							gdouble             *bottom,
+							gdouble             *left,
+							gdouble             *right);
 
 typedef gboolean (*GtkPrinterFunc) (GtkPrinter *printer,
 				    gpointer    data);
Index: gtk/gtkprinter-private.h
===================================================================
--- gtk/gtkprinter-private.h	(révision 18667)
+++ gtk/gtkprinter-private.h	(copie de travail)
@@ -48,11 +48,6 @@ cairo_surface_t *    _gtk_printer_create
 							     gdouble              width,
 							     gdouble              height,
 							     GIOChannel          *cache_io);
-void                 _gtk_printer_get_hard_margins          (GtkPrinter          *printer,
-							     gdouble             *top,
-							     gdouble             *bottom,
-							     gdouble             *left,
-							     gdouble             *right);
 GHashTable *         _gtk_printer_get_custom_widgets        (GtkPrinter          *printer);
 
 /* GtkPrintJob private methods: */
Index: gtk/gtkprintbackend.c
===================================================================
--- gtk/gtkprintbackend.c	(révision 18667)
+++ gtk/gtkprintbackend.c	(copie de travail)
@@ -286,7 +286,7 @@ G_DEFINE_TYPE (GtkPrintBackend, gtk_prin
 static void                 fallback_printer_request_details  (GtkPrinter          *printer);
 static gboolean             fallback_printer_mark_conflicts   (GtkPrinter          *printer,
 							       GtkPrinterOptionSet *options);
-static void                 fallback_printer_get_hard_margins (GtkPrinter          *printer,
+static gboolean             fallback_printer_get_hard_margins (GtkPrinter          *printer,
 							       gdouble             *top,
 							       gdouble             *bottom,
 							       gdouble             *left,
@@ -400,7 +400,7 @@ fallback_printer_mark_conflicts (GtkPrin
   return FALSE;
 }
 
-static void
+static gboolean
 fallback_printer_get_hard_margins (GtkPrinter *printer,
 				   gdouble    *top,
 				   gdouble    *bottom,
@@ -411,6 +411,8 @@ fallback_printer_get_hard_margins (GtkPr
   *bottom = 0;
   *left = 0;
   *right = 0;
+  
+  return TRUE;
 }
 
 static GList *
Index: gtk/gtkprintbackend.h
===================================================================
--- gtk/gtkprintbackend.h	(révision 18667)
+++ gtk/gtkprintbackend.h	(copie de travail)
@@ -99,11 +99,11 @@ struct _GtkPrintBackendClass
 							      GtkPrintSettings    *settings,
 							      GtkPageSetup        *page_setup);
   GList  *              (*printer_list_papers)               (GtkPrinter          *printer);
-  void                  (*printer_get_hard_margins)          (GtkPrinter          *printer,
-							      double              *top,
-							      double              *bottom,
-							      double              *left,
-							      double              *right);
+  gboolean              (*printer_get_hard_margins)          (GtkPrinter          *printer,
+							      gdouble             *top,
+							      gdouble             *bottom,
+							      gdouble             *left,
+							      gdouble             *right);
   GtkPrintCapabilities  (*printer_get_capabilities)          (GtkPrinter          *printer);
 
   /* Signals */
Index: gtk/gtkpagesetupunixdialog.c
===================================================================
--- gtk/gtkpagesetupunixdialog.c	(révision 18667)
+++ gtk/gtkpagesetupunixdialog.c	(copie de travail)
@@ -1653,7 +1653,8 @@ set_margins_from_printer (CustomPaperDia
   gdouble top, bottom, left, right;
 
   top = bottom = left = right = 0;
-  _gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right);
+  if (!gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
+    return;
   
   data->non_user_change = TRUE;
   unit_widget_set (data->top_widget, _gtk_print_convert_to_mm (top, GTK_UNIT_POINTS));
Index: modules/printbackends/cups/gtkprintbackendcups.c
===================================================================
--- modules/printbackends/cups/gtkprintbackendcups.c	(révision 18667)
+++ modules/printbackends/cups/gtkprintbackendcups.c	(copie de travail)
@@ -137,11 +137,11 @@ static GList *              cups_printer
 static void                 cups_printer_request_details           (GtkPrinter                        *printer);
 static void                 cups_request_default_printer           (GtkPrintBackendCups               *print_backend);
 static void                 cups_request_ppd                       (GtkPrinter                        *printer);
-static void                 cups_printer_get_hard_margins          (GtkPrinter                        *printer,
-								    double                            *top,
-								    double                            *bottom,
-								    double                            *left,
-								    double                            *right);
+static gboolean             cups_printer_get_hard_margins          (GtkPrinter                        *printer,
+								    gdouble                           *top,
+								    gdouble                           *bottom,
+								    gdouble                           *left,
+								    gdouble                           *right);
 static GtkPrintCapabilities cups_printer_get_capabilities          (GtkPrinter                        *printer);
 static void                 set_option_from_settings               (GtkPrinterOption                  *option,
 								    GtkPrintSettings                  *setting);
@@ -2859,7 +2859,7 @@ cups_printer_list_papers (GtkPrinter *pr
   return g_list_reverse (l);
 }
 
-static void
+static gboolean
 cups_printer_get_hard_margins (GtkPrinter *printer,
 			       gdouble    *top,
 			       gdouble    *bottom,
@@ -2870,12 +2870,14 @@ cups_printer_get_hard_margins (GtkPrinte
 
   ppd_file = gtk_printer_cups_get_ppd (GTK_PRINTER_CUPS (printer));
   if (ppd_file == NULL)
-    return;
+    return FALSE;
 
   *left = ppd_file->custom_margins[0];
   *bottom = ppd_file->custom_margins[1];
   *right = ppd_file->custom_margins[2];
   *top = ppd_file->custom_margins[3];
+
+  return TRUE;
 }
 
 static GtkPrintCapabilities
Index: gtk/gtk.symbols
===================================================================
--- gtk/gtk.symbols	(révision 18667)
+++ gtk/gtk.symbols	(copie de travail)
@@ -2696,6 +2703,7 @@ gtk_printer_compare
 gtk_printer_has_details
 gtk_printer_request_details
 gtk_printer_get_capabilities
+gtk_printer_get_hard_margins
 gtk_enumerate_printers
 gtk_print_capabilities_get_type G_GNUC_CONST
 #endif

