]> Pileus Git - ~andy/gtk/blobdiff - modules/printbackends/papi/gtkprintbackendpapi.c
Change FSF Address
[~andy/gtk] / modules / printbackends / papi / gtkprintbackendpapi.c
index eb16e1553db998a2492405369c4c97289e047722..6a40f56e362fa92d8c3a26753868fc5c9d898c30 100644 (file)
@@ -15,9 +15,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <unistd.h>
@@ -105,7 +103,7 @@ static void                 papi_display_printer_status_done       (gpointer use
 static void
 gtk_print_backend_papi_register_type (GTypeModule *module)
 {
-  static const GTypeInfo print_backend_papi_info =
+  const GTypeInfo print_backend_papi_info =
   {
     sizeof (GtkPrintBackendPapiClass),
     NULL,              /* base_init */
@@ -234,8 +232,9 @@ papi_printer_create_cairo_surface (GtkPrinter       *printer,
   
   surface = cairo_ps_surface_create_for_stream (_cairo_write, cache_io, width, height);
 
-  /* TODO: DPI from settings object? */
-  cairo_surface_set_fallback_resolution (surface, 300, 300);
+  cairo_surface_set_fallback_resolution (surface,
+                                         2.0 * gtk_print_settings_get_printer_lpi (settings),
+                                         2.0 * gtk_print_settings_get_printer_lpi (settings));
 
   return surface;
 }
@@ -605,7 +604,7 @@ papi_get_printer_list (GtkPrintBackendPapi *papi_backend)
                    gtk_printer_set_is_default (printer, TRUE);
                  }     
 
-              gtk_printer_set_icon_name (printer, "gtk-print");
+              gtk_printer_set_icon_name (printer, "printer");
              gtk_print_backend_add_printer (backend, printer);
               gtk_printer_set_is_active (printer, TRUE);
 
@@ -801,7 +800,7 @@ papi_display_printer_status (gpointer user_data)
   papi_printer = GTK_PRINTER_PAPI (printer);
   if (papiServiceCreate (&service, NULL, NULL, NULL, NULL, PAPI_ENCRYPT_NEVER,
                           NULL) != PAPI_OK)
-    return FALSE;
+    return G_SOURCE_REMOVE;
 
   if (papiPrinterQuery (service, papi_printer->printer_name, NULL, NULL,
                         &current_printer) != PAPI_OK) 
@@ -844,7 +843,7 @@ papi_display_printer_status (gpointer user_data)
   papiServiceDestroy (service);
   gtk_printer_set_has_details (printer, TRUE);
 
-  return FALSE;
+  return G_SOURCE_REMOVE;
 }
 
 static void