gpaint-develop
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gpaint-develop] gnome-2 dependencies


From: Michael Meffie
Subject: Re: [Gpaint-develop] gnome-2 dependencies
Date: Wed, 7 Jan 2004 19:10:20 -0500

On Mon, 05 Jan 2004 21:55:16 -0800 (PST)
Andy Tai <address@hidden> wrote:

> Michael, I think 2.2 should work.  There are just
> generic calls to the printing library.
> 
> If the build does not work, it may just be matters of
> small changes to the configure.in to make it work...

Hello Andy,

I've made a change to the configure.in to use the 2.2
version of gnomeprint and gnomeprintui.  I've found that
GnomePrintMaster has been changed to GnomePrintJob, and
some of the API names have changed.   Changes to compile
are needed only in print.c.  Here's the diff.

--- gpaint-2.3/src/print.c      2004-01-06 22:40:38.000000000 -0500
+++ gpaint/src/print.c  2004-01-06 22:53:19.000000000 -0500
@@ -25,10 +25,10 @@
 #include <gtk/gtk.h>
 
 #include <libgnomeprint/gnome-print.h>
-#include <libgnomeprint/gnome-print-master.h>
+#include <libgnomeprint/gnome-print-job.h>
 #include <libgnomeprint/gnome-font.h>
 #include <libgnomeprintui/gnome-print-dialog.h>
-#include <libgnomeprintui/gnome-print-master-preview.h>
+#include <libgnomeprintui/gnome-print-job-preview.h>
 
 static int image_buf_print(image_buf *ibuf, GnomePrintContext *pc, double 
page_width, double page_height)
 {
@@ -53,26 +53,26 @@
    
     GnomePrintConfig *cfg;
     GnomePrintContext *ctx;
-    GnomePrintMaster *master;
+    GnomePrintJob *job;
     gint response;
     gdouble page_width, page_height;
     cfg = gnome_print_config_default ();
-    master = gnome_print_master_new_from_config (cfg);
+    job = gnome_print_job_new (cfg);
     {
         gdouble width, height;
-        gnome_print_master_get_page_size_from_config (cfg, &page_width, 
&page_height);
-        ctx = gnome_print_master_get_context (master);
+        gnome_print_job_get_page_size_from_config (cfg, &page_width, 
&page_height);
+        ctx = gnome_print_job_get_context (job);
         /* Do page rendering, using width and height retrieved */
         image_buf_print(ibuf, ctx, page_width, page_height);
         g_object_unref (G_OBJECT (ctx));
-        gnome_print_master_close (master);
+        gnome_print_job_close (job);
         {
             GtkWidget *p;
-            p = gnome_print_master_preview_new (master, ibuf->name);
+            p = gnome_print_job_preview_new (job, ibuf->name);
             gtk_widget_show (p);
             /* Connect signals etc. and run gtk_main () */
         }
-        g_object_unref (G_OBJECT (master));
+        g_object_unref (G_OBJECT (job));
 
 
 
@@ -84,7 +84,7 @@
     GtkWidget *dlg;
     static GnomePrintConfig *cfg = 0;
     GnomePrintContext *ctx;
-    GnomePrintMaster *master;
+    GnomePrintJob *job;
     gint response;
     gdouble page_width, page_height;
     char tmp[2000];
@@ -92,34 +92,34 @@
     
     if (!cfg)
         cfg = gnome_print_config_default ();
-    master = gnome_print_master_new_from_config (cfg);
-    dlg = gnome_print_dialog_new_from_master (master, tmp, 0); /* 
libgnomeprintui method */
+    job = gnome_print_job_new (cfg);
+    dlg = gnome_print_dialog_new (job, tmp, 0); /* libgnomeprintui method */
     response = gtk_dialog_run (GTK_DIALOG(dlg));
     if ((response == GNOME_PRINT_DIALOG_RESPONSE_PRINT) || (response == 
GNOME_PRINT_DIALOG_RESPONSE_PREVIEW))
     {
       
-        gnome_print_master_get_page_size_from_config (cfg, &page_width, 
&page_height);
-        ctx = gnome_print_master_get_context (master);
+        gnome_print_job_get_page_size_from_config (cfg, &page_width, 
&page_height);
+        ctx = gnome_print_job_get_context (job);
         /* Do page rendering, using width and height retrieved */
         image_buf_print(ibuf, ctx, page_width, page_height);
-        gnome_print_master_close (master);
+        gnome_print_job_close (job);
         if (response == GNOME_PRINT_DIALOG_RESPONSE_PREVIEW)
         {
             GtkWidget *p;
-            p = gnome_print_master_preview_new (master, ibuf->name);
+            p = gnome_print_job_preview_new (job, ibuf->name);
             gtk_widget_show (p);
             /* Connect signals etc. and run gtk_main () */
         }
         else
         {
-            gnome_print_master_print (master);
+            gnome_print_job_print (job);
         }
 
 
     }
   
     g_object_unref (G_OBJECT (ctx));
-    g_object_unref (G_OBJECT (master));
+    g_object_unref (G_OBJECT (job));
     gtk_widget_destroy(dlg);
            
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]