--- ./configure.in	2005-04-02 02:07:45.000000000 +1200
+++ ./configure.in	2005-10-31 12:23:43.000000000 +1300
@@ -67,7 +67,7 @@
 AC_CHECK_HEADERS(X11/extensions/shape.h, XSHAPE_LIBS="-lXext")
 AC_SUBST(XSHAPE_LIBS)
 
-PKG_CHECK_MODULES(SCREENSHOT, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED)
+PKG_CHECK_MODULES(SCREENSHOT, gtk+-2.0 >= $GTK_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED libglade-2.0 >= $LIBGLADE_REQUIRED libgnomeprint-2.2 >= $LIBGNOMEPRINT_REQUIRED libgnomeprintui-2.2 >= $LIBGNOMEPRINTUI_REQUIRED)
 AC_SUBST(SCREENSHOT_CFLAGS)
 AC_SUBST(SCREENSHOT_LIBS)

--- ./gnome-screenshot/gnome-panel-screenshot.c	2004-12-23 06:57:01.000000000 +1300
+++ ./gnome-screenshot/gnome-panel-screenshot.c	2005-10-31 13:13:20.000000000 +1300
@@ -37,6 +37,13 @@
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <libgnomevfs/gnome-vfs-async-ops.h>
 #include <libgnomevfs/gnome-vfs-ops.h>
+#include <libgnomeprint/gnome-print.h>
+#include <libgnomeprint/gnome-print-unit.h>
+#include <libgnomeprint/gnome-print-job.h>
+#include <libgnomeprintui/gnome-print-preview.h>
+#include <libgnomeprintui/gnome-print-job-preview.h>
+#include <libgnomeprintui/gnome-print-dialog.h>
+#include <libgnomeprintui/gnome-print-paper-selector.h>
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 #include <X11/Xmu/WinUtil.h>
@@ -63,9 +70,116 @@
 
 /* some local prototypes */
 static void display_help           (ScreenshotDialog *dialog);
+static void display_print          (ScreenshotDialog *dialog);
 static void save_done_notification (gpointer          data);
 
 static void
+display_print (ScreenshotDialog *dialog)
+{
+    int response;
+    GtkWidget *printdialog, *printpreview;
+    GnomePrintContext *pc;
+    GnomePrintJob *printjob;
+    double trans_x, trans_y, scale_x, scale_y;
+
+    // create new printjob
+    printjob = gnome_print_job_new(gnome_print_config_default());
+
+    // fetch context
+    pc = gnome_print_job_get_context(printjob),
+
+    // create a new page on the printjob
+    gnome_print_beginpage(pc, NULL);
+
+    // fetch data from screenshot
+    guchar *p;
+    int pw, ph, rs;
+
+    p = gdk_pixbuf_get_pixels (screenshot);
+    pw = gdk_pixbuf_get_width (screenshot);
+    ph = gdk_pixbuf_get_height (screenshot);
+    rs = gdk_pixbuf_get_rowstride (screenshot);
+
+    // calculate translation and scale
+	const      GnomePrintUnit *unit, *ps_unit;
+	double     paper_width, paper_height, paper_lmargin, paper_tmargin, paper_rmargin, paper_bmargin;
+
+	ps_unit = gnome_print_unit_get_identity (GNOME_PRINT_UNIT_DIMENSIONLESS);
+
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAPER_WIDTH, &paper_width, &unit))
+        gnome_print_convert_distance (&paper_width, unit, ps_unit);
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAPER_HEIGHT, &paper_height, &unit))
+		gnome_print_convert_distance (&paper_height, unit, ps_unit);
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAGE_MARGIN_LEFT, &paper_lmargin, &unit))
+		gnome_print_convert_distance (&paper_lmargin, unit, ps_unit);
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAGE_MARGIN_RIGHT, &paper_rmargin, &unit))
+		gnome_print_convert_distance (&paper_rmargin, unit, ps_unit);
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAGE_MARGIN_TOP, &paper_tmargin, &unit))
+		gnome_print_convert_distance (&paper_tmargin, unit, ps_unit);
+	if (gnome_print_config_get_length (gnome_print_job_get_config(printjob), GNOME_PRINT_KEY_PAGE_MARGIN_BOTTOM, &paper_bmargin, &unit))
+		gnome_print_convert_distance (&paper_bmargin, unit, ps_unit);
+
+    scale_x = paper_width - paper_rmargin - paper_lmargin;
+    scale_y = paper_height - paper_bmargin - paper_tmargin;
+
+    if ( scale_x < scale_y )
+        scale_y = ( (double) ph / (double) pw ) * scale_x;
+    else
+        scale_x = scale_y;
+
+    trans_x = paper_lmargin;
+    trans_y = paper_height - paper_tmargin - scale_y;
+
+    // put the data onto the print context
+
+    gnome_print_gsave(pc);
+
+	gnome_print_translate (pc, trans_x, trans_y);
+    gnome_print_scale(pc, scale_x , scale_y);
+
+    gnome_print_rgbimage ( pc, p, pw, ph, rs);
+
+    gnome_print_grestore(pc);
+
+
+    // finalises the page
+    gnome_print_showpage(pc);
+
+    // finalises the print job (needs to be done before the job can be printed/previewed)
+    gnome_print_job_close(printjob);
+
+
+    // Create and display the print dialog ...
+    screenshot_dialog_set_busy (dialog, TRUE);
+    printdialog = gnome_print_dialog_new(printjob, "Print Screenshot", 0);
+    gtk_widget_show(printdialog);
+    response = gtk_dialog_run(GTK_DIALOG(printdialog));
+    screenshot_dialog_set_busy (dialog, FALSE);
+
+    // Check out the response from the print dialog
+    switch (response)
+    {
+        case GNOME_PRINT_DIALOG_RESPONSE_PRINT:
+            gnome_print_job_print(printjob);
+            break;
+        case GNOME_PRINT_DIALOG_RESPONSE_PREVIEW:
+            printpreview = gnome_print_job_preview_new(printjob, "Preview Screenshot");
+            //gtk_window_set_transient_for (GTK_WINDOW (printpreview), printdialog);
+            gtk_window_set_modal (GTK_WINDOW (printpreview), TRUE);
+
+            gtk_widget_show(printpreview);
+            // gtk_dialog_run(GTK_DIALOG(printpreview));
+            //gtk_widget_destroy(printpreview);
+            break;
+        default:
+            break;
+    }
+
+    // no longer need the print dialog
+    gtk_widget_destroy(printdialog);
+}
+
+static void
 display_help (ScreenshotDialog *dialog)
 {
   GError *error = NULL;
@@ -276,6 +390,10 @@
 		keep_going = TRUE;
 	    }
 	  break;
+    case -12:
+      display_print(dialog);
+      keep_going = TRUE;
+      break;
 	default:
 	  break;
 	}
--- ./gnome-screenshot/gnome-screenshot.glade	2004-12-22 12:33:59.000000000 +1300
+++ ./gnome-screenshot/gnome-screenshot.glade	2005-10-31 12:18:54.000000000 +1300
@@ -44,6 +44,19 @@
 	    </widget>
 	  </child>
 
+      <child>
+        <widget class="GtkButton" id="print_button">
+          <property name="visible">True</property>
+          <property name="can_default">True</property>
+          <property name="can_focus">True</property>
+          <property name="label">gtk-print</property>
+          <property name="use_stock">True</property>
+          <property name="relief">GTK_RELIEF_NORMAL</property>
+          <property name="focus_on_click">True</property>
+          <property name="response_id">-12</property>
+        </widget>
+      </child>
+
 	  <child>
 	    <widget class="GtkButton" id="cancel_button">
 	      <property name="visible">True</property>
--- ./gnome-screenshot/screenshot-utils.c	2004-10-24 14:23:39.000000000 +1300
+++ ./gnome-screenshot/screenshot-utils.c	2005-10-31 12:16:21.000000000 +1300
@@ -514,7 +514,7 @@
     {
       gboolean has_alpha = gdk_pixbuf_get_has_alpha (tmp);
 
-      screenshot = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
+      screenshot = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8,
 				   width, height);
       gdk_pixbuf_fill (screenshot, 0);
 	
@@ -555,14 +555,13 @@
 		rec_x * (has_alpha ? 4 : 3);
 	      dest_pixels = gdk_pixbuf_get_pixels (screenshot) +
 		y * gdk_pixbuf_get_rowstride (screenshot) +
-		rec_x * 4;
+		rec_x * 3;
 				
 	      for (x = 0; x < rec_width; x++)
 		{
 		  *dest_pixels++ = *src_pixels ++;
 		  *dest_pixels++ = *src_pixels ++;
 		  *dest_pixels++ = *src_pixels ++;
-		  *dest_pixels++ = 255;
 		  if (has_alpha)
 		    src_pixels++;
 		}
