[Gtk-sharp-list] GStreamer bindings

Owen Fraser-Green owen@discobabe.net
Wed, 28 Apr 2004 16:36:15 +0200


--=-0Qgujds096TrPibIbTNZ
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi,

I've now imported a new module into mono CVS, gst-sharp, containing the
gstreamer bindings with the changes I've been working on. The idea is to
remove it altogether from the Gtk# tree although I'll wait a little
longer before doing that step in case anyone reacts.

To work, however, a couple of minor changes are needed to Gtk# (see
attached patch).

The first, adds a base case to a recursive method in generator which,
otherwise, leads to an infinite loop. The second, corrects the argument
marshaling functions in glib.

Can I commit this patch?

Cheers,
Owen


--=-0Qgujds096TrPibIbTNZ
Content-Disposition: attachment; filename=gtk-sharp.patch
Content-Type: text/x-diff; name=gtk-sharp.patch; charset=UTF-8
Content-Transfer-Encoding: 7bit

Index: generator/ClassBase.cs
===================================================================
RCS file: /cvs/public/gtk-sharp/generator/ClassBase.cs,v
retrieving revision 1.23
diff -u -r1.23 ClassBase.cs
--- generator/ClassBase.cs	7 Apr 2004 19:15:01 -0000	1.23
+++ generator/ClassBase.cs	28 Apr 2004 13:51:16 -0000
@@ -39,7 +39,11 @@
 		public ClassBase Parent {
 			get {
 				string parent = Elem.GetAttribute("parent");
-				return SymbolTable.Table.GetClassGen(parent);
+
+				if (parent == "")
+					return null;
+				else
+					return SymbolTable.Table.GetClassGen(parent);
 			}
 		}
 
Index: glib/Marshaller.cs
===================================================================
RCS file: /cvs/public/gtk-sharp/glib/Marshaller.cs,v
retrieving revision 1.3
diff -u -r1.3 Marshaller.cs
--- glib/Marshaller.cs	19 Jan 2004 03:24:25 -0000	1.3
+++ glib/Marshaller.cs	28 Apr 2004 13:51:17 -0000
@@ -84,7 +84,7 @@
 			for (int i = 0; i < args.Length; i++)
 				ptrs[i] = (int) Marshal.StringToHGlobalAuto (args[i]);
 
-			IntPtr buf = g_malloc ((ulong) Marshal.SizeOf(typeof(string)) * 
+			IntPtr buf = g_malloc ((ulong) Marshal.SizeOf(typeof(int)) * 
 					       (ulong) args.Length);
 			Marshal.Copy (ptrs, 0, buf, ptrs.Length);
 			return buf;
@@ -97,7 +97,7 @@
 			for (int i = 0; i < args.Length; i++)
 				ptrs[i] = (long) Marshal.StringToHGlobalAuto (args[i]);
 				
-			IntPtr buf = g_malloc ((ulong) Marshal.SizeOf(typeof(string)) * 
+			IntPtr buf = g_malloc ((ulong) Marshal.SizeOf(typeof(long)) * 
 					       (ulong) args.Length);
 			Marshal.Copy (ptrs, 0, buf, ptrs.Length);
 			return buf;

--=-0Qgujds096TrPibIbTNZ--