2009-03-06 [colin] 3.7.1cvs1
[claws.git] / src / gedit-print.c
index 6ca1edeb5ddc46b0d00bc7529d4c94ca42da9610..43e1932136bca0c3d405363635218d9ebe8f8b8b 100644 (file)
@@ -8,7 +8,7 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -17,9 +17,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, 
- * Boston, MA 02111-1307, USA. 
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
  
 /*
 #include <string.h>    /* For strlen */
 
 #include <glib/gi18n.h>
-#include <gtk/gtkframe.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkvbox.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkprogressbar.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtkwindow.h>
+#include <gtk/gtk.h>
 #include <libgnomeprintui/gnome-print-dialog.h>
 #include <libgnomeprintui/gnome-print-job-preview.h>
 
@@ -113,7 +104,7 @@ gedit_print_job_info_destroy (GeditPrintJobInfo *pji, gboolean save_config)
 {
        gedit_debug (DEBUG_PRINT, "");
 
-       g_return_if_fail (pji != NULL);
+       cm_return_if_fail (pji != NULL);
 
        if (pji->pjob != NULL)
                g_object_unref (pji->pjob);
@@ -131,14 +122,14 @@ get_print_dialog (GeditPrintJobInfo *pji, GtkWindow *parent)
 
        gedit_debug (DEBUG_PRINT, "");
 
-       g_return_val_if_fail (pji != NULL, NULL);
+       cm_return_val_if_fail (pji != NULL, NULL);
        
        if (!gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (pji->doc), NULL, NULL))
                selection_flag = GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE;
        else
                selection_flag = GNOME_PRINT_RANGE_SELECTION;
        
-       g_return_val_if_fail(pji->pjob != NULL, NULL);
+       cm_return_val_if_fail(pji->pjob != NULL, NULL);
        config = gtk_source_print_job_get_config (pji->pjob);
        
        dialog = g_object_new (GNOME_TYPE_PRINT_DIALOG, "print_config", config, NULL);
@@ -216,7 +207,7 @@ show_printing_dialog (GeditPrintJobInfo *pji, GtkWindow *parent)
        GtkWidget *label;
        GtkWidget *progressbar;
 
-       window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+       window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "gedit-print");
        gtk_window_set_modal (GTK_WINDOW (window), TRUE);
        gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
        gtk_window_set_destroy_with_parent (GTK_WINDOW (window), TRUE);
@@ -340,7 +331,7 @@ gedit_print (GtkTextView *view)
 
        gedit_debug (DEBUG_PRINT, "");
 
-       g_return_if_fail (view != NULL);
+       cm_return_if_fail (view != NULL);
 
        pji = gedit_print_job_info_new (view);
        pji->preview = PREVIEW_NO;
@@ -402,25 +393,6 @@ gedit_print_real (GeditPrintJobInfo *pji,
        }
 }
 
-void 
-gedit_print_preview (GtkTextView *view)
-{
-       GeditPrintJobInfo *pji;
-       GtkTextIter start, end;
-
-       gedit_debug (DEBUG_PRINT, "");
-               
-       g_return_if_fail (view != NULL);
-
-       pji = gedit_print_job_info_new (view);
-
-       gtk_text_buffer_get_bounds (pji->doc, &start, &end);
-
-       pji->preview = PREVIEW;
-       gedit_print_preview_real (pji, &start, &end, 
-                                 GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (view))));
-}
-
 static GeditPrintJobInfo *
 gedit_print_job_info_new (GtkTextView* view)
 {      
@@ -433,13 +405,13 @@ gedit_print_job_info_new (GtkTextView* view)
        
        gedit_debug (DEBUG_PRINT, "");
        
-       g_return_val_if_fail (view != NULL, NULL);
+       cm_return_val_if_fail (view != NULL, NULL);
 
        buffer = gtk_text_view_get_buffer (view);
-       g_return_val_if_fail (buffer != NULL, NULL);
+       cm_return_val_if_fail (buffer != NULL, NULL);
 
        config = gnome_print_config_default ();
-       g_return_val_if_fail (config != NULL, NULL);
+       cm_return_val_if_fail (config != NULL, NULL);
 
        gnome_print_config_set_int (config, GNOME_PRINT_KEY_NUM_COPIES, 1);
        gnome_print_config_set_boolean (config, GNOME_PRINT_KEY_COLLATE, FALSE);