[Gtk-sharp-list] GnomePrint patch

Martin Willemoes Hansen mwh@sysrq.dk
Thu, 25 Sep 2003 17:15:54 +0200


--=-XUcmHdE7TNBPqgsG0iVu
Content-Type: multipart/alternative; boundary="=-cUMwFa+L61gHk0pDjCdq"


--=-cUMwFa+L61gHk0pDjCdq
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi!

I found that after adding the const-guchar* in the SymbolChanges two
modifications had to be made to get the build going. I have attached
thoese changes as well as the changes made to make GnomePrintUi use the
right library. The changes from modifying the gnomeprintui c src code is
also attached.

Okay to commit?
-- 
Martin Willemoes Hansen

--------------------------------------------------------
E-Mail	mwh@sysrq.dk	Website	mwh.sysrq.dk
IRC     MWH, freenode.net
--------------------------------------------------------               


--=-cUMwFa+L61gHk0pDjCdq
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.0.9">
</HEAD>
<BODY>
Hi!<BR>
<BR>
I found that after adding the const-guchar* in the SymbolChanges two modifications had to be made to get the build going. I have attached thoese changes as well as the changes made to make GnomePrintUi use the right library. The changes from modifying the gnomeprintui c src code is also attached.<BR>
<BR>
Okay to commit?<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>-- 
Martin Willemoes Hansen

--------------------------------------------------------
E-Mail	mwh@sysrq.dk	Website	mwh.sysrq.dk
IRC     MWH, freenode.net
--------------------------------------------------------               
</PRE>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>

--=-cUMwFa+L61gHk0pDjCdq--

--=-XUcmHdE7TNBPqgsG0iVu
Content-Disposition: attachment; filename=GnomePrintChanges.diff
Content-Type: text/x-patch; name=GnomePrintChanges.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

? GnomePrintChanges.diff
Index: ChangeLog
===================================================================
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.475
diff -u -r1.475 ChangeLog
--- ChangeLog	24 Sep 2003 01:36:35 -0000	1.475
+++ ChangeLog	25 Sep 2003 15:25:21 -0000
@@ -1,3 +1,13 @@
+2003-09-25  Martin Willemoes Hansen  <mwh@sysrq.dk>
+
+	* sources/gtk-sharp.sources: Fixed, wrong library used for libgnomeprintui
+	* api/gnome-api.xml: Ditto
+	* generator/SymbolTable.cs: Added mapping of const-guchar* to string
+	* sources/Gdk.metadata: Added rule to give correct type to 
+	  PixbufLoader.Write buf parameter
+	* sources/Gtk.metadata: Changed rule to give correct type to 
+	  HTMLStream.Write buffer parameter
+
 2003-09-23  John Luke  <jluke@cfl.rr.com>
 
 	* README:
Index: api/gdk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/api/gdk-api.xml,v
retrieving revision 1.25
diff -u -r1.25 gdk-api.xml
--- api/gdk-api.xml	16 Sep 2003 18:07:38 -0000	1.25
+++ api/gdk-api.xml	25 Sep 2003 15:25:24 -0000
@@ -4121,7 +4121,7 @@
       <method name="Write" cname="gdk_pixbuf_loader_write">
         <return-type type="gboolean"/>
         <parameters>
-          <parameter type="const-guchar*" name="buf" array="1"/>
+          <parameter type="guchar*" name="buf" array="1"/>
           <parameter type="gsize" name="count"/>
           <parameter type="GError**" name="error"/>
         </parameters>
Index: api/gnome-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/api/gnome-api.xml,v
retrieving revision 1.13
diff -u -r1.13 gnome-api.xml
--- api/gnome-api.xml	16 Sep 2003 18:07:38 -0000	1.13
+++ api/gnome-api.xml	25 Sep 2003 15:25:24 -0000
@@ -6258,7 +6258,27 @@
       </method>
     </class>
   </namespace>
-  <namespace name="Gnome" library="gnomeprint-2-2">
+  <namespace name="Gnome" library="gnomeprintui-2-2">
+    <enum name="PaperSelectorFlags" cname="GnomePaperSelectorFlags" type="enum">
+      <member cname="GNOME_PAPER_SELECTOR_MARGINS" name="Margins"/>
+      <member cname="GNOME_PAPER_SELECTOR_FEED_ORIENTATION" name="FeedOrientation"/>
+    </enum>
+    <enum name="PrintButtons" cname="GnomePrintButtons" type="enum">
+      <member cname="GNOME_PRINT_DIALOG_RESPONSE_PRINT" name="Print" value="1"/>
+      <member cname="GNOME_PRINT_DIALOG_RESPONSE_PREVIEW" name="Preview"/>
+      <member cname="GNOME_PRINT_DIALOG_RESPONSE_CANCEL" name="Cancel"/>
+    </enum>
+    <enum name="PrintDialogFlags" cname="GnomePrintDialogFlags" type="enum">
+      <member cname="GNOME_PRINT_DIALOG_RANGE" name="Range"/>
+      <member cname="GNOME_PRINT_DIALOG_COPIES" name="Copies"/>
+    </enum>
+    <enum name="PrintDialogRangeFlags" cname="GnomePrintDialogRangeFlags" type="enum">
+      <member cname="GNOME_PRINT_RANGE_CURRENT" name="Current"/>
+      <member cname="GNOME_PRINT_RANGE_ALL" name="All"/>
+      <member cname="GNOME_PRINT_RANGE_RANGE" name="Range"/>
+      <member cname="GNOME_PRINT_RANGE_SELECTION" name="Selection"/>
+      <member cname="GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE" name="SelectionUnsensitive"/>
+    </enum>
     <enum name="PrintRangeType" cname="GnomePrintRangeType" type="enum">
       <member cname="GNOME_PRINT_RANGETYPE_NONE" name="None"/>
       <member cname="GNOME_PRINT_RANGETYPE_CUSTOM" name="Custom"/>
@@ -6578,7 +6598,7 @@
     </object>
     <struct name="CanvasHacktextPriv" cname="GnomeCanvasHacktextPriv" opaque="true"/>
   </namespace>
-  <namespace name="Gnome" library="gnomeprint-2.2">
+  <namespace name="Gnome" library="gnomeprintui-2.2">
     <object name="GPAOptionMenu" cname="GPAOptionMenu" parent="GPAWidget">
       <field cname="menu" type="GtkWidget*"/>
       <field cname="node" type="GPANode*"/>
Index: api/gtk-api.xml
===================================================================
RCS file: /cvs/public/gtk-sharp/api/gtk-api.xml,v
retrieving revision 1.47
diff -u -r1.47 gtk-api.xml
--- api/gtk-api.xml	20 Sep 2003 02:56:10 -0000	1.47
+++ api/gtk-api.xml	25 Sep 2003 15:25:28 -0000
@@ -14247,7 +14247,7 @@
       <method name="Write" cname="gtk_html_stream_write">
         <return-type type="void"/>
         <parameters>
-          <parameter type="const-guchar*" name="buffer" array="1"/>
+          <parameter type="guchar*" name="buffer" array="1"/>
           <parameter type="size_t" name="size"/>
         </parameters>
       </method>
Index: generator/SymbolTable.cs
===================================================================
RCS file: /cvs/public/gtk-sharp/generator/SymbolTable.cs,v
retrieving revision 1.47
diff -u -r1.47 SymbolTable.cs
--- generator/SymbolTable.cs	28 Aug 2003 16:49:29 -0000	1.47
+++ generator/SymbolTable.cs	25 Sep 2003 15:25:28 -0000
@@ -42,6 +42,7 @@
 			// Const returned strings must be generated 
 			// differently from memory-managed strings
 			AddType (new ConstStringGen ("const-gchar"));
+			AddType (new ConstStringGen ("const-guchar"));
 			AddType (new ConstStringGen ("const-char"));
 			AddType (new StringGen ("gchar"));
 			AddType (new SimpleGen ("gfloat", "float"));
@@ -133,7 +134,11 @@
 			string trim_type = type.TrimEnd('*');
 
 			// HACK: Similar to above, but for const strings
-			if (trim_type == "const-gchar" || trim_type == "const-char") return trim_type;
+			switch (trim_type) {
+			case "const-gchar": return trim_type;
+			case "const-guchar": return trim_type;
+			case "const-char": return trim_type;
+			}
 			
 			if (trim_type.StartsWith("const-")) return trim_type.Substring(6);
 			return trim_type;
Index: sources/Gdk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/sources/Gdk.metadata,v
retrieving revision 1.20
diff -u -r1.20 Gdk.metadata
--- sources/Gdk.metadata	16 Sep 2003 18:07:39 -0000	1.20
+++ sources/Gdk.metadata	25 Sep 2003 15:25:28 -0000
@@ -54,6 +54,20 @@
  </data>
 </rule>
 
+<!-- type change -->
+<rule>
+  <class name="GdkPixbufLoader">
+    <method>Write</method>
+  </class>
+  <data>
+    <attribute target="param">
+      <filter level="name">buf</filter>
+      <name>type</name>
+      <value>guchar*</value>
+    </attribute>
+  </data>
+</rule>
+
 <!-- null args -->
 <rule>
   <class name="GdkPixmap">
Index: sources/Gtk.metadata
===================================================================
RCS file: /cvs/public/gtk-sharp/sources/Gtk.metadata,v
retrieving revision 1.62
diff -u -r1.62 Gtk.metadata
--- sources/Gtk.metadata	20 Sep 2003 02:56:10 -0000	1.62
+++ sources/Gtk.metadata	25 Sep 2003 15:25:28 -0000
@@ -467,7 +467,7 @@
     <attribute target="param">
       <filter level="name">buffer</filter>
       <name>type</name>
-      <value>const-guchar*</value>
+      <value>guchar*</value>
     </attribute>
   </data>
 </rule>
Index: sources/gtk-sharp.sources
===================================================================
RCS file: /cvs/public/gtk-sharp/sources/gtk-sharp.sources,v
retrieving revision 1.21
diff -u -r1.21 gtk-sharp.sources
--- sources/gtk-sharp.sources	16 Sep 2003 18:07:39 -0000	1.21
+++ sources/gtk-sharp.sources	25 Sep 2003 15:25:28 -0000
@@ -7,8 +7,8 @@
 libgnomecanvas-2.2.1/libgnomecanvas Gnome gnomecanvas-2
 libgnomeui-2.2.2/libgnomeui Gnome gnomeui-2
 libgnomeprint-2.2.1.3/libgnomeprint Gnome gnomeprint-2-2
-libgnomeprintui-2.2.1.3/libgnomeprintui Gnome gnomeprint-2-2
-libgnomeprintui-2.2.1.3/libgnomeprintui/gpaui Gnome gnomeprint-2.2
+libgnomeprintui-2.2.1.3/libgnomeprintui Gnome gnomeprintui-2-2
+libgnomeprintui-2.2.1.3/libgnomeprintui/gpaui Gnome gnomeprintui-2.2
 gtkhtml-3.0.8/src Gtk gtkhtml-3.0
 libglade-2.0.0/glade Glade libglade-2.0-0.dll
 libart_lgpl-2.3.10 Art art_lgpl

--=-XUcmHdE7TNBPqgsG0iVu
Content-Disposition: attachment; filename=gnome-print-dialog.h.diff
Content-Type: text/x-patch; name=gnome-print-dialog.h.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

--- gnome-print-dialog.h.old	2003-09-25 13:05:07.000000000 +0200
+++ gnome-print-dialog.h	2003-09-25 13:06:09.000000000 +0200
@@ -60,31 +60,31 @@
 /*
  * Flags for creation of range widget
  */
-enum GnomePrintDialogRangeFlags {
+typedef enum {
 	GNOME_PRINT_RANGE_CURRENT = (1 << 0),
 	GNOME_PRINT_RANGE_ALL = (1 << 1),
 	GNOME_PRINT_RANGE_RANGE = (1 << 2),
 	GNOME_PRINT_RANGE_SELECTION = (1 << 3),
 	GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE  = (1 << 4),
-};
+} GnomePrintDialogRangeFlags;
 
 /*
  * Flags to specify, whether we want range and copies widgets
  */
-enum GnomePrintDialogFlags {
+typedef enum {
 	GNOME_PRINT_DIALOG_RANGE = (1 << 0),
 	GNOME_PRINT_DIALOG_COPIES = (1 << 1)
-};
+} GnomePrintDialogFlags;
 
 /*
  * The button numbers corresponding to the standard buttons
  * Used with the GnomeDialog "clicked" signal.
  */
-enum GnomePrintButtons {
+typedef enum {
 	GNOME_PRINT_DIALOG_RESPONSE_PRINT = 1,
 	GNOME_PRINT_DIALOG_RESPONSE_PREVIEW,
 	GNOME_PRINT_DIALOG_RESPONSE_CANCEL = GTK_RESPONSE_CANCEL,
-};
+} GnomePrintButtons;
 
 GType gnome_print_dialog_get_type (void);
 

--=-XUcmHdE7TNBPqgsG0iVu
Content-Disposition: attachment; filename=gnome-print-paper-selector.h.diff
Content-Type: text/x-patch; name=gnome-print-paper-selector.h.diff; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

--- gnome-print-paper-selector.h.old	2003-01-11 17:46:47.000000000 +0100
+++ gnome-print-paper-selector.h	2003-09-25 13:10:12.000000000 +0200
@@ -44,10 +44,10 @@
 #include <glib-object.h>
 #include <libgnomeprint/gnome-print-config.h>
 
-enum GnomePaperSelectorFlags {
+typedef enum {
 	GNOME_PAPER_SELECTOR_MARGINS = (1 << 0),
 	GNOME_PAPER_SELECTOR_FEED_ORIENTATION = (1 << 1)
-};
+} GnomePaperSelectorFlags;
 
 GType       gnome_paper_selector_get_type (void);
 GtkWidget * gnome_paper_selector_new (GnomePrintConfig *config);

--=-XUcmHdE7TNBPqgsG0iVu--