diff --git a/generator/gst-codegen.diff b/generator/gst-codegen.diff index f252d0ec96..a8bffd8fc5 100644 --- a/generator/gst-codegen.diff +++ b/generator/gst-codegen.diff @@ -1,6 +1,125 @@ -diff -Naur tmp/gtk-sharp/generator/Ctor.cs generator/Ctor.cs ---- tmp/gtk-sharp/generator/Ctor.cs 2009-04-24 10:08:17.000000000 +0200 -+++ generator/Ctor.cs 2009-06-02 12:37:47.000000000 +0200 +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/BoxedGen.cs generator/BoxedGen.cs +--- gtk-sharp/generator/BoxedGen.cs 2009-01-04 23:29:56.000000000 +0100 ++++ generator/BoxedGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -40,16 +40,16 @@ + + StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name); + base.Generate (gen_info); +- sw.WriteLine ("\t\tpublic static explicit operator GLib.Value (" + QualifiedName + " boxed)"); ++ sw.WriteLine ("\t\tpublic static explicit operator Gst.GLib.Value (" + QualifiedName + " boxed)"); + sw.WriteLine ("\t\t{"); + +- sw.WriteLine ("\t\t\tGLib.Value val = GLib.Value.Empty;"); ++ sw.WriteLine ("\t\t\tGst.GLib.Value val = Gst.GLib.Value.Empty;"); + sw.WriteLine ("\t\t\tval.Init (" + QualifiedName + ".GType);"); + sw.WriteLine ("\t\t\tval.Val = boxed;"); + sw.WriteLine ("\t\t\treturn val;"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); +- sw.WriteLine ("\t\tpublic static explicit operator " + QualifiedName + " (GLib.Value val)"); ++ sw.WriteLine ("\t\tpublic static explicit operator " + QualifiedName + " (Gst.GLib.Value val)"); + sw.WriteLine ("\t\t{"); + + sw.WriteLine ("\t\t\treturn (" + QualifiedName + ") val.Val;"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ByRefGen.cs generator/ByRefGen.cs +--- gtk-sharp/generator/ByRefGen.cs 2008-02-26 17:29:14.000000000 +0100 ++++ generator/ByRefGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -46,7 +46,7 @@ + + public string AllocNative (string var_name) + { +- return "GLib.Marshaller.StructureToPtrAlloc (" + var_name + ")"; ++ return "Gst.GLib.Marshaller.StructureToPtrAlloc (" + var_name + ")"; + } + + public override string FromNative (string var_name) +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/CallbackGen.cs generator/CallbackGen.cs +--- gtk-sharp/generator/CallbackGen.cs 2009-07-02 22:18:10.000000000 +0200 ++++ generator/CallbackGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -140,7 +140,7 @@ + sw.WriteLine (); + sw.WriteLine ("\t\t" + Name + "Native native_cb;"); + sw.WriteLine ("\t\tIntPtr __data;"); +- sw.WriteLine ("\t\tGLib.DestroyNotify __notify;"); ++ sw.WriteLine ("\t\tGst.GLib.DestroyNotify __notify;"); + sw.WriteLine (); + sw.WriteLine ("\t\t~" + Name + "Invoker ()"); + sw.WriteLine ("\t\t{"); +@@ -153,7 +153,7 @@ + sw.WriteLine (); + sw.WriteLine ("\t\tinternal " + Name + "Invoker (" + Name + "Native native_cb, IntPtr data) : this (native_cb, data, null) {}"); + sw.WriteLine (); +- sw.WriteLine ("\t\tinternal " + Name + "Invoker (" + Name + "Native native_cb, IntPtr data, GLib.DestroyNotify notify)"); ++ sw.WriteLine ("\t\tinternal " + Name + "Invoker (" + Name + "Native native_cb, IntPtr data, Gst.GLib.DestroyNotify notify)"); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tthis.native_cb = native_cb;"); + sw.WriteLine ("\t\t\t__data = data;"); +@@ -233,7 +233,7 @@ + */ + bool fatal = (retval.MarshalType != "void" && retval.MarshalType != "bool") || call.HasOutParam; + sw.WriteLine ("\t\t\t} catch (Exception e) {"); +- sw.WriteLine ("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); ++ sw.WriteLine ("\t\t\t\tGst.GLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); + if (fatal) { + sw.WriteLine ("\t\t\t\t// NOTREACHED: Above call does not return."); + sw.WriteLine ("\t\t\t\tthrow e;"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ConstFilenameGen.cs generator/ConstFilenameGen.cs +--- gtk-sharp/generator/ConstFilenameGen.cs 2007-09-21 18:37:04.000000000 +0200 ++++ generator/ConstFilenameGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -35,17 +35,17 @@ + + public override string FromNative (string var) + { +- return "GLib.Marshaller.FilenamePtrToString (" + var + ")"; ++ return "Gst.GLib.Marshaller.FilenamePtrToString (" + var + ")"; + } + + public string AllocNative (string managed_var) + { +- return "GLib.Marshaller.StringToFilenamePtr (" + managed_var + ")"; ++ return "Gst.GLib.Marshaller.StringToFilenamePtr (" + managed_var + ")"; + } + + public string ReleaseNative (string native_var) + { +- return "GLib.Marshaller.Free (" + native_var + ")"; ++ return "Gst.GLib.Marshaller.Free (" + native_var + ")"; + } + } + } +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ConstStringGen.cs generator/ConstStringGen.cs +--- gtk-sharp/generator/ConstStringGen.cs 2007-09-21 18:37:04.000000000 +0200 ++++ generator/ConstStringGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -37,22 +37,22 @@ + + public override string FromNative (string var) + { +- return "GLib.Marshaller.Utf8PtrToString (" + var + ")"; ++ return "Gst.GLib.Marshaller.Utf8PtrToString (" + var + ")"; + } + + public override string ToNativeReturn (string var) + { +- return "GLib.Marshaller.StringToPtrGStrdup (" + var + ")"; ++ return "Gst.GLib.Marshaller.StringToPtrGStrdup (" + var + ")"; + } + + public string AllocNative (string managed_var) + { +- return "GLib.Marshaller.StringToPtrGStrdup (" + managed_var + ")"; ++ return "Gst.GLib.Marshaller.StringToPtrGStrdup (" + managed_var + ")"; + } + + public string ReleaseNative (string native_var) + { +- return "GLib.Marshaller.Free (" + native_var + ")"; ++ return "Gst.GLib.Marshaller.Free (" + native_var + ")"; + } + } + } +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Ctor.cs generator/Ctor.cs +--- gtk-sharp/generator/Ctor.cs 2009-04-24 10:08:17.000000000 +0200 ++++ generator/Ctor.cs 2009-08-05 16:49:19.000000000 +0200 @@ -32,14 +32,16 @@ private bool preferred; private string name; @@ -27,7 +146,7 @@ diff -Naur tmp/gtk-sharp/generator/Ctor.cs generator/Ctor.cs + if (mini_object) + sw.WriteLine ("\t\t\t\tCreateNativeObject ();"); + else -+ sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new GLib.Value[0]);"); ++ sw.WriteLine ("\t\t\t\tCreateNativeObject (new string [0], new Gst.GLib.Value[0]);"); sw.WriteLine ("\t\t\t\treturn;"); } else { + if (mini_object) @@ -35,21 +154,137 @@ diff -Naur tmp/gtk-sharp/generator/Ctor.cs generator/Ctor.cs ArrayList names = new ArrayList (); ArrayList values = new ArrayList (); for (int i = 0; i < Parameters.Count; i++) { -diff -Naur tmp/gtk-sharp/generator/DefaultSignalHandler.cs generator/DefaultSignalHandler.cs ---- tmp/gtk-sharp/generator/DefaultSignalHandler.cs 2009-04-13 19:44:48.000000000 +0200 -+++ generator/DefaultSignalHandler.cs 2009-06-02 12:32:24.000000000 +0200 -@@ -124,6 +124,8 @@ +@@ -137,13 +144,13 @@ + indent += "\t"; + } + sw.WriteLine (indent + "names.Add (\"" + names [i] + "\");"); +- sw.WriteLine (indent + "vals.Add (new GLib.Value (" + values[i] + "));"); ++ sw.WriteLine (indent + "vals.Add (new Gst.GLib.Value (" + values[i] + "));"); + + if (p.Generatable is ClassBase && !(p.Generatable is StructBase)) + sw.WriteLine ("\t\t\t\t}"); + } + +- sw.WriteLine ("\t\t\t\tCreateNativeObject ((string[])names.ToArray (typeof (string)), (GLib.Value[])vals.ToArray (typeof (GLib.Value)));"); ++ sw.WriteLine ("\t\t\t\tCreateNativeObject ((string[])names.ToArray (typeof (string)), (Gst.GLib.Value[])vals.ToArray (typeof (Gst.GLib.Value)));"); + sw.WriteLine ("\t\t\t\treturn;"); + } else + sw.WriteLine ("\t\t\t\tthrow new InvalidOperationException (\"Can't override this constructor.\");"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/DefaultSignalHandler.cs generator/DefaultSignalHandler.cs +--- gtk-sharp/generator/DefaultSignalHandler.cs 2009-04-13 19:44:48.000000000 +0200 ++++ generator/DefaultSignalHandler.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -68,13 +68,13 @@ + { + GenerateMethodBody (sw, implementor); + if (retval.IsVoid) +- sw.WriteLine ("\t\t\tGLib.Value ret = GLib.Value.Empty;"); ++ sw.WriteLine ("\t\t\tGst.GLib.Value ret = Gst.GLib.Value.Empty;"); + else +- sw.WriteLine ("\t\t\tGLib.Value ret = new GLib.Value (" + ReturnGType + ");"); ++ sw.WriteLine ("\t\t\tGst.GLib.Value ret = new Gst.GLib.Value (" + ReturnGType + ");"); + +- sw.WriteLine ("\t\t\tGLib.ValueArray inst_and_params = new GLib.ValueArray (" + (parms.Count + 1) + ");"); +- sw.WriteLine ("\t\t\tGLib.Value[] vals = new GLib.Value [" + (parms.Count + 1) + "];"); +- sw.WriteLine ("\t\t\tvals [0] = new GLib.Value (this);"); ++ sw.WriteLine ("\t\t\tGst.GLib.ValueArray inst_and_params = new Gst.GLib.ValueArray (" + (parms.Count + 1) + ");"); ++ sw.WriteLine ("\t\t\tGst.GLib.Value[] vals = new Gst.GLib.Value [" + (parms.Count + 1) + "];"); ++ sw.WriteLine ("\t\t\tvals [0] = new Gst.GLib.Value (this);"); + sw.WriteLine ("\t\t\tinst_and_params.Append (vals [0]);"); + string cleanup = ""; + for (int i = 0; i < parms.Count; i++) { +@@ -82,24 +82,24 @@ + if (p.PassAs != "") { + if (SymbolTable.Table.IsBoxed (p.CType)) { + if (p.PassAs == "ref") +- sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new GLib.Value (" + p.Name + ");"); ++ sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new Gst.GLib.Value (" + p.Name + ");"); + else +- sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new GLib.Value ((GLib.GType)typeof (" + p.CSType + "));"); ++ sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new Gst.GLib.Value ((Gst.GLib.GType)typeof (" + p.CSType + "));"); + cleanup += "\t\t\t" + p.Name + " = (" + p.CSType + ") vals [" + i + "];\n"; + } else { + if (p.PassAs == "ref") +- sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = GLib.Marshaller.StructureToPtrAlloc (" + p.Generatable.CallByName (p.Name) + ");"); ++ sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = Gst.GLib.Marshaller.StructureToPtrAlloc (" + p.Generatable.CallByName (p.Name) + ");"); + else + sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (" + p.MarshalType + ")));"); + +- sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new GLib.Value (" + p.Name + "_ptr);"); ++ sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new Gst.GLib.Value (" + p.Name + "_ptr);"); + cleanup += "\t\t\t" + p.Name + " = " + p.FromNative ("(" + p.MarshalType + ") Marshal.PtrToStructure (" + p.Name + "_ptr, typeof (" + p.MarshalType + "))") + ";\n"; + cleanup += "\t\t\tMarshal.FreeHGlobal (" + p.Name + "_ptr);\n"; + } + } else if (p.IsLength && i > 0 && parms [i - 1].IsString) +- sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new GLib.Value (System.Text.Encoding.UTF8.GetByteCount (" + parms [i-1].Name + "));"); ++ sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new Gst.GLib.Value (System.Text.Encoding.UTF8.GetByteCount (" + parms [i-1].Name + "));"); + else +- sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new GLib.Value (" + p.Name + ");"); ++ sw.WriteLine ("\t\t\tvals [" + (i + 1) + "] = new Gst.GLib.Value (" + p.Name + ");"); + + sw.WriteLine ("\t\t\tinst_and_params.Append (vals [" + (i + 1) + "]);"); + } +@@ -107,7 +107,7 @@ + sw.WriteLine ("\t\t\tg_signal_chain_from_overridden (inst_and_params.ArrayPtr, ref ret);"); + if (cleanup != "") + sw.WriteLine (cleanup); +- sw.WriteLine ("\t\t\tforeach (GLib.Value v in vals)"); ++ sw.WriteLine ("\t\t\tforeach (Gst.GLib.Value v in vals)"); + sw.WriteLine ("\t\t\t\tv.Dispose ();"); + if (!retval.IsVoid) { + IGeneratable igen = SymbolTable.Table [retval.CType]; +@@ -123,7 +123,9 @@ + IGeneratable igen = SymbolTable.Table [retval.CType]; if (igen is ObjectGen) - return "GLib.GType.Object"; +- return "GLib.GType.Object"; ++ return "Gst.GLib.GType.Object"; + if (igen is MiniObjectGen) + return "Gst.MiniObject.GType"; if (igen is BoxedGen) return retval.CSType + ".GType"; if (igen is EnumGen) -diff -Naur tmp/gtk-sharp/generator/FieldBase.cs generator/FieldBase.cs ---- tmp/gtk-sharp/generator/FieldBase.cs 2009-05-06 16:58:39.000000000 +0200 -+++ generator/FieldBase.cs 2009-05-14 21:32:21.000000000 +0200 +@@ -131,11 +133,11 @@ + + switch (retval.CSType) { + case "bool": +- return "GLib.GType.Boolean"; ++ return "Gst.GLib.GType.Boolean"; + case "string": +- return "GLib.GType.String"; ++ return "Gst.GLib.GType.String"; + case "int": +- return "GLib.GType.Int"; ++ return "Gst.GLib.GType.Int"; + default: + throw new Exception (retval.CSType); + } +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/EnumGen.cs generator/EnumGen.cs +--- gtk-sharp/generator/EnumGen.cs 2009-05-28 20:49:11.000000000 +0200 ++++ generator/EnumGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -98,7 +98,7 @@ + if (Elem.GetAttribute("type") == "flags") + sw.WriteLine ("\t[Flags]"); + if (Elem.HasAttribute("gtype")) +- sw.WriteLine ("\t[GLib.GType (typeof (" + NS + "." + Name + "GType))]"); ++ sw.WriteLine ("\t[Gst.GLib.GType (typeof (" + NS + "." + Name + "GType))]"); + + string access = IsInternal ? "internal" : "public"; + sw.WriteLine ("\t" + access + " enum " + Name + enum_type + " {"); +@@ -115,9 +115,9 @@ + sw.WriteLine ("\t\t[DllImport (\"" + LibraryName + "\")]"); + sw.WriteLine ("\t\tstatic extern IntPtr " + Elem.GetAttribute ("gtype") + " ();"); + sw.WriteLine (); +- sw.WriteLine ("\t\tpublic static GLib.GType GType {"); ++ sw.WriteLine ("\t\tpublic static Gst.GLib.GType GType {"); + sw.WriteLine ("\t\t\tget {"); +- sw.WriteLine ("\t\t\t\treturn new GLib.GType (" + Elem.GetAttribute ("gtype") + " ());"); ++ sw.WriteLine ("\t\t\t\treturn new Gst.GLib.GType (" + Elem.GetAttribute ("gtype") + " ());"); + sw.WriteLine ("\t\t\t}"); + sw.WriteLine ("\t\t}"); + sw.WriteLine ("\t}"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/FieldBase.cs generator/FieldBase.cs +--- gtk-sharp/generator/FieldBase.cs 2009-05-06 16:58:39.000000000 +0200 ++++ generator/FieldBase.cs 2009-08-05 16:49:19.000000000 +0200 @@ -89,7 +89,7 @@ void CheckGlue () { @@ -70,39 +305,195 @@ diff -Naur tmp/gtk-sharp/generator/FieldBase.cs generator/FieldBase.cs if (Getter != null) { sw.Write (indent + "\tget "); -diff -Naur tmp/gtk-sharp/generator/Makefile.am generator/Makefile.am ---- tmp/gtk-sharp/generator/Makefile.am 2009-07-23 19:18:03.000000000 +0200 -+++ generator/Makefile.am 2009-05-27 15:02:46.000000000 +0200 -@@ -1,8 +1,4 @@ --assemblydir = $(prefix)/lib/gapi-3.0 --assembly_DATA = gapi_codegen.exe --bin_SCRIPTS = gapi3-codegen --CLEANFILES = gapi_codegen.exe --DISTCLEANFILES = gapi3-codegen -+noinst_SCRIPTS = gst-gapi_codegen.exe +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/GObjectVM.cs generator/GObjectVM.cs +--- gtk-sharp/generator/GObjectVM.cs 2009-05-04 19:39:45.000000000 +0200 ++++ generator/GObjectVM.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -154,17 +154,17 @@ + sw.WriteLine ("\t\tpublic static " + Name + "Delegate " + Name + "Handler {"); + sw.WriteLine ("\t\t\tset {"); + sw.WriteLine ("\t\t\t\t{0}_handler = value;", CName); +- sw.WriteLine ("\t\t\t\tOverride{0} ((GLib.GType) typeof ({1}), value == null ? null : {0}VMCallback);", Name, container_type.Name); ++ sw.WriteLine ("\t\t\t\tOverride{0} ((Gst.GLib.GType) typeof ({1}), value == null ? null : {0}VMCallback);", Name, container_type.Name); + sw.WriteLine ("\t\t\t}"); + sw.WriteLine ("\t\t}"); + } else { +- sw.WriteLine ("\t\tstatic void Override{0} (GLib.GType gtype)", this.Name); ++ sw.WriteLine ("\t\tstatic void Override{0} (Gst.GLib.GType gtype)", this.Name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tOverride{0} (gtype, {0}VMCallback);", this.Name); + sw.WriteLine ("\t\t}"); + } + sw.WriteLine (); +- sw.WriteLine ("\t\tstatic void Override{0} (GLib.GType gtype, {0}NativeDelegate callback)", this.Name); ++ sw.WriteLine ("\t\tstatic void Override{0} (Gst.GLib.GType gtype, {0}NativeDelegate callback)", this.Name); + sw.WriteLine ("\t\t{"); + } - references = +@@ -181,7 +181,7 @@ -@@ -39,6 +35,7 @@ - MethodBase.cs \ - MethodBody.cs \ - Method.cs \ -+ MiniObjectGen.cs \ - ObjectField.cs \ - ObjectBase.cs \ - ObjectGen.cs \ -@@ -66,6 +63,6 @@ - EXTRA_DIST = \ - $(dist_sources) - --gapi_codegen.exe: $(build_sources) -- $(CSC) /out:gapi_codegen.exe $(OFF_T_FLAGS) $(references) $(build_sources) -+gst-gapi_codegen.exe: $(build_sources) -+ $(CSC) -debug -out:gst-gapi_codegen.exe $(OFF_T_FLAGS) $(references) $(build_sources) - -diff -Naur tmp/gtk-sharp/generator/Method.cs generator/Method.cs ---- tmp/gtk-sharp/generator/Method.cs 2009-01-08 19:00:47.000000000 +0100 -+++ generator/Method.cs 2009-06-02 12:31:51.000000000 +0200 + protected void GenerateMethodBody (StreamWriter sw, ClassBase implementor) + { +- sw.WriteLine ("\t\t[GLib.DefaultSignalHandler(Type=typeof(" + (implementor != null ? implementor.QualifiedName : container_type.QualifiedName) + "), ConnectionMethod=\"Override" + this.Name +"\")]"); ++ sw.WriteLine ("\t\t[Gst.GLib.DefaultSignalHandler(Type=typeof(" + (implementor != null ? implementor.QualifiedName : container_type.QualifiedName) + "), ConnectionMethod=\"Override" + this.Name +"\")]"); + sw.Write ("\t\t{0} ", this.Protection); + if (this.modifiers != "") + sw.Write ("{0} ", this.modifiers); +@@ -261,7 +261,7 @@ + return "FALSE"; + case "true": + return "TRUE"; +- case "GLib.GType.None": ++ case "Gst.GLib.GType.None": + return "G_TYPE_NONE"; + default: + return val; +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/InterfaceGen.cs generator/InterfaceGen.cs +--- gtk-sharp/generator/InterfaceGen.cs 2009-08-05 08:24:27.000000000 +0200 ++++ generator/InterfaceGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -60,7 +60,7 @@ + + public override string CallByName (string var, bool owned) + { +- return String.Format ("{0} == null ? IntPtr.Zero : (({0} is GLib.Object) ? ({0} as GLib.Object).{1} : ({0} as {2}Adapter).{1})", var, owned ? "OwnedHandle" : "Handle", QualifiedName); ++ return String.Format ("{0} == null ? IntPtr.Zero : (({0} is Gst.GLib.Object) ? ({0} as Gst.GLib.Object).{1} : ({0} as {2}Adapter).{1})", var, owned ? "OwnedHandle" : "Handle", QualifiedName); + } + + public override string FromNative (string var, bool owned) +@@ -91,7 +91,7 @@ + sw.WriteLine (); + sw.WriteLine ("\t\tstatic " + Name + "Adapter ()"); + sw.WriteLine ("\t\t{"); +- sw.WriteLine ("\t\t\tGLib.GType.Register (_gtype, typeof({0}Adapter));", Name); ++ sw.WriteLine ("\t\t\tGst.GLib.GType.Register (_gtype, typeof({0}Adapter));", Name); + foreach (InterfaceVM vm in interface_vms) { + if (vm.IsValid) + sw.WriteLine ("\t\t\tiface.{0} = new {0}NativeDelegate ({0}_cb);", vm.Name); +@@ -127,22 +127,22 @@ + void GenerateCtors (StreamWriter sw) + { + // Native GObjects do not implement the *Implementor interfaces +- sw.WriteLine ("\t\tGLib.Object implementor;", Name); ++ sw.WriteLine ("\t\tGst.GLib.Object implementor;", Name); + sw.WriteLine (); + + if (!IsConsumeOnly) { + sw.WriteLine ("\t\tpublic " + Name + "Adapter ()"); + sw.WriteLine ("\t\t{"); +- sw.WriteLine ("\t\t\tInitHandler = new GLib.GInterfaceInitHandler (Initialize);"); ++ sw.WriteLine ("\t\t\tInitHandler = new Gst.GLib.GInterfaceInitHandler (Initialize);"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); + sw.WriteLine ("\t\tpublic {0}Adapter ({0}Implementor implementor)", Name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tif (implementor == null)"); + sw.WriteLine ("\t\t\t\tthrow new ArgumentNullException (\"implementor\");"); +- sw.WriteLine ("\t\t\telse if (!(implementor is GLib.Object))"); +- sw.WriteLine ("\t\t\t\tthrow new ArgumentException (\"implementor must be a subclass of GLib.Object\");"); +- sw.WriteLine ("\t\t\tthis.implementor = implementor as GLib.Object;"); ++ sw.WriteLine ("\t\t\telse if (!(implementor is Gst.GLib.Object))"); ++ sw.WriteLine ("\t\t\t\tthrow new ArgumentException (\"implementor must be a subclass of Gst.GLib.Object\");"); ++ sw.WriteLine ("\t\t\tthis.implementor = implementor as Gst.GLib.Object;"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); + } +@@ -151,7 +151,7 @@ + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tif (!_gtype.IsInstance (handle))"); + sw.WriteLine ("\t\t\t\tthrow new ArgumentException (\"The gobject doesn't implement the GInterface of this adapter\", \"handle\");"); +- sw.WriteLine ("\t\t\timplementor = GLib.Object.GetObject (handle);"); ++ sw.WriteLine ("\t\t\timplementor = Gst.GLib.Object.GetObject (handle);"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); + } +@@ -160,9 +160,9 @@ + { + Method m = GetMethod ("GetType"); + m.GenerateImport (sw); +- sw.WriteLine ("\t\tprivate static GLib.GType _gtype = new GLib.GType ({0} ());", m.CName); ++ sw.WriteLine ("\t\tprivate static Gst.GLib.GType _gtype = new Gst.GLib.GType ({0} ());", m.CName); + sw.WriteLine (); +- sw.WriteLine ("\t\tpublic override GLib.GType GType {"); ++ sw.WriteLine ("\t\tpublic override Gst.GLib.GType GType {"); + sw.WriteLine ("\t\t\tget {"); + sw.WriteLine ("\t\t\t\treturn _gtype;"); + sw.WriteLine ("\t\t\t}"); +@@ -190,11 +190,11 @@ + { + sw.WriteLine ("\t\tpublic static " + Name + " GetObject (IntPtr handle, bool owned)"); + sw.WriteLine ("\t\t{"); +- sw.WriteLine ("\t\t\tGLib.Object obj = GLib.Object.GetObject (handle, owned);"); ++ sw.WriteLine ("\t\t\tGst.GLib.Object obj = Gst.GLib.Object.GetObject (handle, owned);"); + sw.WriteLine ("\t\t\treturn GetObject (obj);"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); +- sw.WriteLine ("\t\tpublic static " + Name + " GetObject (GLib.Object obj)"); ++ sw.WriteLine ("\t\tpublic static " + Name + " GetObject (Gst.GLib.Object obj)"); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tif (obj == null)"); + sw.WriteLine ("\t\t\t\treturn null;"); +@@ -230,7 +230,7 @@ + sw.WriteLine ("\tusing System.Runtime.InteropServices;"); + sw.WriteLine (); + sw.WriteLine ("#region Autogenerated code"); +- sw.WriteLine ("\tpublic class " + Name + "Adapter : GLib.GInterfaceAdapter, " + QualifiedName + " {"); ++ sw.WriteLine ("\tpublic class " + Name + "Adapter : Gst.GLib.GInterfaceAdapter, " + QualifiedName + " {"); + sw.WriteLine (); + + if (!IsConsumeOnly) { +@@ -249,7 +249,7 @@ + GenProperties (gen_info, null); + + foreach (Signal sig in sigs.Values) +- sig.GenEvent (sw, null, "GLib.Object.GetObject (Handle)"); ++ sig.GenEvent (sw, null, "Gst.GLib.Object.GetObject (Handle)"); + + Method temp = methods ["GetType"] as Method; + if (temp != null) +@@ -275,9 +275,9 @@ + return; + + sw.WriteLine (); +- sw.WriteLine ("\t[GLib.GInterface (typeof (" + Name + "Adapter))]"); ++ sw.WriteLine ("\t[Gst.GLib.GInterface (typeof (" + Name + "Adapter))]"); + string access = IsInternal ? "internal" : "public"; +- sw.WriteLine ("\t" + access + " interface " + Name + "Implementor : GLib.IWrapper {"); ++ sw.WriteLine ("\t" + access + " interface " + Name + "Implementor : Gst.GLib.IWrapper {"); + sw.WriteLine (); + Hashtable vm_table = new Hashtable (); + foreach (InterfaceVM vm in interface_vms) { +@@ -323,7 +323,7 @@ + sw.WriteLine (); + sw.WriteLine ("#region Autogenerated code"); + string access = IsInternal ? "internal" : "public"; +- sw.WriteLine ("\t" + access + " interface " + Name + " : GLib.IWrapper {"); ++ sw.WriteLine ("\t" + access + " interface " + Name + " : Gst.GLib.IWrapper {"); + sw.WriteLine (); + + foreach (Signal sig in sigs.Values) { +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/MethodBody.cs generator/MethodBody.cs +--- gtk-sharp/generator/MethodBody.cs 2009-01-07 18:10:08.000000000 +0100 ++++ generator/MethodBody.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -111,7 +111,7 @@ + sw.WriteLine (indent + "\t\t\t\t{0} = null;", parameters [i + 2].Name); + sw.WriteLine (indent + "\t\t\t} else {"); + sw.WriteLine (indent + "\t\t\t\t{0} = (IntPtr) GCHandle.Alloc ({1}_wrapper);", parameters [i + 1].Name, name); +- sw.WriteLine (indent + "\t\t\t\t{0} = GLib.DestroyHelper.NotifyHandler;", parameters [i + 2].Name, parameters [i + 2].CSType); ++ sw.WriteLine (indent + "\t\t\t\t{0} = Gst.GLib.DestroyHelper.NotifyHandler;", parameters [i + 2].Name, parameters [i + 2].CSType); + sw.WriteLine (indent + "\t\t\t}"); + break; + +@@ -154,7 +154,7 @@ + { + if (!ThrowsException) + return; +- sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new GLib.GException (error);"); ++ sw.WriteLine (indent + "\t\t\tif (error != IntPtr.Zero) throw new Gst.GLib.GException (error);"); + } + + public bool ThrowsException { +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Method.cs generator/Method.cs +--- gtk-sharp/generator/Method.cs 2009-01-08 19:00:47.000000000 +0100 ++++ generator/Method.cs 2009-08-05 16:49:19.000000000 +0200 @@ -118,7 +118,7 @@ if (Name == "ToString" && Parameters.Count == 0) @@ -112,107 +503,9 @@ diff -Naur tmp/gtk-sharp/generator/Method.cs generator/Method.cs sw.Write("new "); else if (Modifiers == "new " || (dup != null && ((dup.Signature != null && Signature != null && dup.Signature.ToString() == Signature.ToString()) || (dup.Signature == null && Signature == null)))) sw.Write("new "); -diff -Naur tmp/gtk-sharp/generator/Parameters.cs generator/Parameters.cs ---- tmp/gtk-sharp/generator/Parameters.cs 2009-07-13 00:01:52.000000000 +0200 -+++ generator/Parameters.cs 2009-06-12 22:13:30.000000000 +0200 -@@ -262,10 +262,12 @@ - call_parm += CallName; - } else if (gen is IManualMarshaler) - call_parm = "native_" + CallName; -- else if (gen is ObjectBase) -- call_parm = (gen as ObjectBase).CallByName (CallName, Owned); -+ else if (gen is MiniObjectGen) -+ call_parm = ((MiniObjectGen) gen).CallByName(CallName, Owned); -+ else if (gen is ObjectGen) -+ call_parm = ((ObjectGen) gen).CallByName(CallName, Owned); - else -- call_parm = gen.CallByName (CallName); -+ call_parm = gen.CallByName(CallName); - - return call_parm; - } -@@ -283,7 +285,7 @@ - result [i] = (gen as IManualMarshaler).ReleaseNative ("native_" + CallName) + ";"; - return result; - } else if (PassAs != String.Empty && MarshalType != CSType) -- if (gen is HandleBase) -+ if (gen is HandleBase) - return new string [] { CallName + " = " + (gen as HandleBase).FromNative ("native_" + CallName, Owned) + ";" }; - else - return new string [] { CallName + " = " + gen.FromNative ("native_" + CallName) + ";" }; -diff -Naur tmp/gtk-sharp/generator/Parser.cs generator/Parser.cs ---- tmp/gtk-sharp/generator/Parser.cs 2009-04-13 19:44:48.000000000 +0200 -+++ generator/Parser.cs 2009-05-14 21:40:56.000000000 +0200 -@@ -138,6 +138,9 @@ - case "object": - result.Add (new ObjectGen (ns, elem)); - break; -+ case "mini-object": -+ result.Add (new MiniObjectGen (ns, elem)); -+ break; - case "class": - result.Add (new ClassGen (ns, elem)); - break; -diff -Naur tmp/gtk-sharp/generator/ReturnValue.cs generator/ReturnValue.cs ---- tmp/gtk-sharp/generator/ReturnValue.cs 2009-05-06 18:20:35.000000000 +0200 -+++ generator/ReturnValue.cs 2009-06-03 20:59:07.000000000 +0200 -@@ -110,7 +110,9 @@ - get { - if (IGen == null) - return String.Empty; -- return IGen.ToNativeReturnType + (is_array || is_null_term ? "[]" : String.Empty); -+ else if (is_null_term) -+ return "IntPtr"; -+ return IGen.ToNativeReturnType + (is_array ? "[]" : String.Empty); - } - } - -@@ -128,7 +130,7 @@ - } else if (IGen is HandleBase) - return ((HandleBase)IGen).FromNative (var, owned); - else if (is_null_term) -- return String.Format ("GLib.Marshaller.NullTermPtrToStringArray ({0}, {1})", var, owned ? "true" : "false"); -+ return String.Format ("Gst.Marshaller.NullTermPtrToStringArray ({0}, {1})", var, owned ? "true" : "false"); - else - return IGen.FromNativeReturn (var); - } -@@ -142,11 +144,11 @@ - string args = ", typeof (" + ElementType + "), " + (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false"); - var = "new " + IGen.QualifiedName + "(" + var + args + ")"; - } else if (is_null_term) -- return String.Format ("GLib.Marshaller.StringArrayToNullTermPointer ({0})", var); -+ return String.Format ("Gst.Marshaller.StringArrayToNullTermPointer ({0})", var); - - if (IGen is IManualMarshaler) - return (IGen as IManualMarshaler).AllocNative (var); -- else if (IGen is ObjectGen && owned) -+ else if ((IGen is ObjectGen || IGen is MiniObjectGen) && owned) - return var + " == null ? IntPtr.Zero : " + var + ".OwnedHandle"; - else if (IGen is OpaqueGen && owned) - return var + " == null ? IntPtr.Zero : " + var + ".OwnedCopy"; -diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs ---- tmp/gtk-sharp/generator/SymbolTable.cs 2009-04-13 19:44:48.000000000 +0200 -+++ generator/SymbolTable.cs 2009-05-14 21:56:41.000000000 +0200 -@@ -116,6 +116,7 @@ - // manually wrapped types requiring more complex marshaling - AddType (new ManualGen ("GInitiallyUnowned", "GLib.InitiallyUnowned", "GLib.Object.GetObject ({0})")); - AddType (new ManualGen ("GObject", "GLib.Object", "GLib.Object.GetObject ({0})")); -+ AddType (new ManualGen ("GstMiniObject", "Gst.MiniObject", "Gst.MiniObject.GetObject ({0})")); - AddType (new ManualGen ("GList", "GLib.List")); - AddType (new ManualGen ("GPtrArray", "GLib.PtrArray")); - AddType (new ManualGen ("GSList", "GLib.SList")); -@@ -338,7 +339,8 @@ - - public bool IsObject(string c_type) - { -- if (this[c_type] is ObjectGen) -+ if ((this[c_type] is ObjectGen) || -+ (this[c_type] is MiniObjectGen)) - return true; - - return false; ---- /dev/null 2009-07-17 07:52:05.502147313 +0200 -+++ generator/MiniObjectGen.cs 2009-06-12 22:11:07.000000000 +0200 +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/MiniObjectGen.cs generator/MiniObjectGen.cs +--- gtk-sharp/generator/MiniObjectGen.cs 1970-01-01 01:00:00.000000000 +0100 ++++ generator/MiniObjectGen.cs 2009-08-05 16:49:19.000000000 +0200 @@ -0,0 +1,326 @@ +// GtkSharp.Generation.MiniObjectGen.cs - The Mini Object Generatable. +// @@ -275,6 +568,11 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + } + } + ++ public override string CallByName (string var, bool owned) ++ { ++ return String.Format ("{0} == null ? IntPtr.Zero : {0}.{1}", var, owned ? "OwnedHandle" : "Handle"); ++ } ++ + public override bool Validate () + { + ArrayList invalids = new ArrayList (); @@ -398,7 +696,7 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + + if (!DisableGTypeCtor) { + gen_info.Writer.WriteLine("\t\t[Obsolete]"); -+ gen_info.Writer.WriteLine("\t\tprotected " + Name + "(GLib.GType gtype) : base(gtype) {}"); ++ gen_info.Writer.WriteLine("\t\tprotected " + Name + "(Gst.GLib.GType gtype) : base(gtype) {}"); + } + gen_info.Writer.WriteLine("\t\tpublic " + Name + "(IntPtr raw) : base(raw) {}"); + if (ctors.Count == 0 && !DisableVoidCtor) { @@ -423,10 +721,10 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + if (cs_parent == "") + sw.WriteLine ("\t\tstatic uint class_offset = 0;"); + else -+ sw.WriteLine ("\t\tstatic uint class_offset = ((GLib.GType) typeof ({0})).ClassSize;", cs_parent); ++ sw.WriteLine ("\t\tstatic uint class_offset = ((Gst.GLib.GType) typeof ({0})).ClassSize;", cs_parent); + sw.WriteLine ("\t\tstatic Hashtable class_structs;"); + sw.WriteLine (); -+ sw.WriteLine ("\t\tstatic {0} GetClassStruct (GLib.GType gtype, bool use_cache)", class_struct_name); ++ sw.WriteLine ("\t\tstatic {0} GetClassStruct (Gst.GLib.GType gtype, bool use_cache)", class_struct_name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tif (class_structs == null)"); + sw.WriteLine ("\t\t\t\tclass_structs = new Hashtable ();"); @@ -442,7 +740,7 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + sw.WriteLine ("\t\t\t}"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); -+ sw.WriteLine ("\t\tstatic void OverrideClassStruct (GLib.GType gtype, {0} class_struct)", class_struct_name); ++ sw.WriteLine ("\t\tstatic void OverrideClassStruct (Gst.GLib.GType gtype, {0} class_struct)", class_struct_name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tIntPtr class_ptr = new IntPtr (gtype.ClassPtr.ToInt64 () + class_offset);"); + sw.WriteLine ("\t\t\tMarshal.StructureToPtr (class_struct, class_ptr, false);"); @@ -456,7 +754,7 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + for (int i = 1; i < cname.Length; i++) { + if (Char.IsUpper (cname[i])) { + if (i == 1 && cname[0] == 'G') -+ return "GLib." + cname.Substring (1); ++ return "Gst.GLib." + cname.Substring (1); + else + return cname.Substring (0, i) + "." + cname.Substring (i); + } @@ -519,7 +817,7 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + + foreach (string key in dir_info.objects.Keys) { + if (GetExpected(key) != ((string) dir_info.objects[key])) -+ sw.WriteLine ("\t\t\tGLib.GType.Register ({0}.GType, typeof ({0}));", dir_info.objects [key]); ++ sw.WriteLine ("\t\t\tGst.GLib.GType.Register ({0}.GType, typeof ({0}));", dir_info.objects [key]); + } + + sw.WriteLine ("\t\t}"); @@ -528,11 +826,6 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + sw.Close (); + } + -+ public string CallByName (string name, bool owned) -+ { -+ return name + " == null ? IntPtr.Zero : " + name + (owned ? ".OwnedHandle" : ".Handle"); -+ } -+ + public override string FromNative (string var, bool owned) + { + return "Gst.MiniObject.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName; @@ -540,3 +833,419 @@ diff -Naur tmp/gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs + } +} + +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ObjectBase.cs generator/ObjectBase.cs +--- gtk-sharp/generator/ObjectBase.cs 2009-08-05 08:24:27.000000000 +0200 ++++ generator/ObjectBase.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -164,7 +164,7 @@ + + public override string FromNative (string var, bool owned) + { +- return "GLib.Object.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName; ++ return "Gst.GLib.Object.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName; + } + + public string ClassStructName { +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ObjectGen.cs generator/ObjectGen.cs +--- gtk-sharp/generator/ObjectGen.cs 2009-08-05 08:24:27.000000000 +0200 ++++ generator/ObjectGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -256,14 +256,14 @@ + + if (!DisableGTypeCtor) { + gen_info.Writer.WriteLine("\t\t[Obsolete]"); +- gen_info.Writer.WriteLine("\t\tprotected " + Name + "(GLib.GType gtype) : base(gtype) {}"); ++ gen_info.Writer.WriteLine("\t\tprotected " + Name + "(Gst.GLib.GType gtype) : base(gtype) {}"); + } + gen_info.Writer.WriteLine("\t\tpublic " + Name + "(IntPtr raw) : base(raw) {}"); + if (ctors.Count == 0 && !DisableVoidCtor) { + gen_info.Writer.WriteLine(); + gen_info.Writer.WriteLine("\t\tprotected " + Name + "() : base(IntPtr.Zero)"); + gen_info.Writer.WriteLine("\t\t{"); +- gen_info.Writer.WriteLine("\t\t\tCreateNativeObject (new string [0], new GLib.Value [0]);"); ++ gen_info.Writer.WriteLine("\t\t\tCreateNativeObject (new string [0], new Gst.GLib.Value [0]);"); + gen_info.Writer.WriteLine("\t\t}"); + } + gen_info.Writer.WriteLine(); +@@ -312,10 +312,10 @@ + if (cs_parent == "") + sw.WriteLine ("\t\tstatic uint class_offset = 0;"); + else +- sw.WriteLine ("\t\tstatic uint class_offset = ((GLib.GType) typeof ({0})).ClassSize;", cs_parent); ++ sw.WriteLine ("\t\tstatic uint class_offset = ((Gst.GLib.GType) typeof ({0})).ClassSize;", cs_parent); + sw.WriteLine ("\t\tstatic Hashtable class_structs;"); + sw.WriteLine (); +- sw.WriteLine ("\t\tstatic {0} GetClassStruct (GLib.GType gtype, bool use_cache)", class_struct_name); ++ sw.WriteLine ("\t\tstatic {0} GetClassStruct (Gst.GLib.GType gtype, bool use_cache)", class_struct_name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tif (class_structs == null)"); + sw.WriteLine ("\t\t\t\tclass_structs = new Hashtable ();"); +@@ -331,7 +331,7 @@ + sw.WriteLine ("\t\t\t}"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); +- sw.WriteLine ("\t\tstatic void OverrideClassStruct (GLib.GType gtype, {0} class_struct)", class_struct_name); ++ sw.WriteLine ("\t\tstatic void OverrideClassStruct (Gst.GLib.GType gtype, {0} class_struct)", class_struct_name); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\tIntPtr class_ptr = new IntPtr (gtype.ClassPtr.ToInt64 () + class_offset);"); + sw.WriteLine ("\t\t\tMarshal.StructureToPtr (class_struct, class_ptr, false);"); +@@ -345,7 +345,7 @@ + for (int i = 1; i < cname.Length; i++) { + if (Char.IsUpper (cname[i])) { + if (i == 1 && cname[0] == 'G') +- return "GLib." + cname.Substring (1); ++ return "Gst.GLib." + cname.Substring (1); + else + return cname.Substring (0, i) + "." + cname.Substring (i); + } +@@ -408,7 +408,7 @@ + + foreach (string key in dir_info.objects.Keys) { + if (GetExpected(key) != ((string) dir_info.objects[key])) +- sw.WriteLine ("\t\t\tGLib.GType.Register ({0}.GType, typeof ({0}));", dir_info.objects [key]); ++ sw.WriteLine ("\t\t\tGst.GLib.GType.Register ({0}.GType, typeof ({0}));", dir_info.objects [key]); + } + + sw.WriteLine ("\t\t}"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/OpaqueGen.cs generator/OpaqueGen.cs +--- gtk-sharp/generator/OpaqueGen.cs 2009-04-26 05:21:47.000000000 +0200 ++++ generator/OpaqueGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -32,7 +32,7 @@ + + public override string FromNative(string var, bool owned) + { +- return var + " == IntPtr.Zero ? null : (" + QualifiedName + ") GLib.Opaque.GetOpaque (" + var + ", typeof (" + QualifiedName + "), " + (owned ? "true" : "false") + ")"; ++ return var + " == IntPtr.Zero ? null : (" + QualifiedName + ") Gst.GLib.Opaque.GetOpaque (" + var + ", typeof (" + QualifiedName + "), " + (owned ? "true" : "false") + ")"; + } + + private bool DisableRawCtor { +@@ -68,7 +68,7 @@ + if (cs_parent != "") + sw.Write (" : " + cs_parent); + else +- sw.Write (" : GLib.Opaque"); ++ sw.Write (" : Gst.GLib.Opaque"); + + foreach (string iface in managed_interfaces) { + if (Parent != null && Parent.Implements (iface)) +@@ -165,7 +165,7 @@ + sw.WriteLine ("\t\t\tif (!Owned)"); + sw.WriteLine ("\t\t\t\treturn;"); + sw.WriteLine ("\t\t\tFinalizerInfo info = new FinalizerInfo (Handle);"); +- sw.WriteLine ("\t\t\tGLib.Timeout.Add (50, new GLib.TimeoutHandler (info.Handler));"); ++ sw.WriteLine ("\t\t\tGst.GLib.Timeout.Add (50, new Gst.GLib.TimeoutHandler (info.Handler));"); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); + } +@@ -173,9 +173,9 @@ + #if false + Method copy = Methods ["Copy"] as Method; + if (copy != null && copy.Parameters.Count == 0) { +- sw.WriteLine ("\t\tprotected override GLib.Opaque Copy (IntPtr raw)"); ++ sw.WriteLine ("\t\tprotected override Gst.GLib.Opaque Copy (IntPtr raw)"); + sw.WriteLine ("\t\t{"); +- sw.WriteLine ("\t\t\tGLib.Opaque result = new " + QualifiedName + " (" + copy.CName + " (raw));"); ++ sw.WriteLine ("\t\t\tGst.GLib.Opaque result = new " + QualifiedName + " (" + copy.CName + " (raw));"); + sw.WriteLine ("\t\t\tresult.Owned = true;"); + sw.WriteLine ("\t\t\treturn result;"); + sw.WriteLine ("\t\t}"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Parameters.cs generator/Parameters.cs +--- gtk-sharp/generator/Parameters.cs 2009-07-13 00:01:52.000000000 +0200 ++++ generator/Parameters.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -263,9 +263,9 @@ + } else if (gen is IManualMarshaler) + call_parm = "native_" + CallName; + else if (gen is ObjectBase) +- call_parm = (gen as ObjectBase).CallByName (CallName, Owned); ++ call_parm = (gen as ObjectBase).CallByName(CallName, Owned); + else +- call_parm = gen.CallByName (CallName); ++ call_parm = gen.CallByName(CallName); + + return call_parm; + } +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Parser.cs generator/Parser.cs +--- gtk-sharp/generator/Parser.cs 2009-04-13 19:44:48.000000000 +0200 ++++ generator/Parser.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -138,6 +138,9 @@ + case "object": + result.Add (new ObjectGen (ns, elem)); + break; ++ case "mini-object": ++ result.Add (new MiniObjectGen (ns, elem)); ++ break; + case "class": + result.Add (new ClassGen (ns, elem)); + break; +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Property.cs generator/Property.cs +--- gtk-sharp/generator/Property.cs 2008-09-17 01:21:50.000000000 +0200 ++++ generator/Property.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -64,7 +64,7 @@ + } + + protected virtual string PropertyAttribute (string qpname) { +- return "[GLib.Property (" + qpname + ")]"; ++ return "[Gst.GLib.Property (" + qpname + ")]"; + } + + protected virtual string RawGetter (string qpname) { +@@ -117,9 +117,9 @@ + + string v_type = ""; + if (table.IsInterface (CType)) { +- v_type = "(GLib.Object)"; ++ v_type = "(Gst.GLib.Object)"; + } else if (table.IsOpaque (CType)) { +- v_type = "(GLib.Opaque)"; ++ v_type = "(Gst.GLib.Opaque)"; + } else if (table.IsEnum (CType)) { + v_type = "(Enum)"; + } +@@ -140,12 +140,12 @@ + sw.WriteLine(); + } else if (Readable) { + sw.WriteLine(indent + "get {"); +- sw.WriteLine(indent + "\tGLib.Value val = " + RawGetter (qpname) + ";"); ++ sw.WriteLine(indent + "\tGst.GLib.Value val = " + RawGetter (qpname) + ";"); + if (table.IsOpaque (CType) || table.IsBoxed (CType)) { + sw.WriteLine(indent + "\t" + CSType + " ret = (" + CSType + ") val;"); + } else if (table.IsInterface (CType)) { +- // Do we have to dispose the GLib.Object from the GLib.Value? +- sw.WriteLine (indent + "\t{0} ret = {0}Adapter.GetObject ((GLib.Object) val);", CSType); ++ // Do we have to dispose the Gst.GLib.Object from the Gst.GLib.Value? ++ sw.WriteLine (indent + "\t{0} ret = {0}Adapter.GetObject ((Gst.GLib.Object) val);", CSType); + } else { + sw.Write(indent + "\t" + CSType + " ret = "); + sw.Write ("(" + CSType + ") "); +@@ -166,13 +166,13 @@ + sw.WriteLine(); + } else if (Writable) { + sw.WriteLine(indent + "set {"); +- sw.Write(indent + "\tGLib.Value val = "); ++ sw.Write(indent + "\tGst.GLib.Value val = "); + if (table.IsBoxed (CType)) { +- sw.WriteLine("(GLib.Value) value;"); ++ sw.WriteLine("(Gst.GLib.Value) value;"); + } else if (table.IsOpaque (CType)) { +- sw.WriteLine("new GLib.Value(value, \"{0}\");", CType); ++ sw.WriteLine("new Gst.GLib.Value(value, \"{0}\");", CType); + } else { +- sw.Write("new GLib.Value("); ++ sw.Write("new Gst.GLib.Value("); + if (v_type != "" && !(table.IsObject (CType) || table.IsInterface (CType) || table.IsOpaque (CType))) { + sw.Write(v_type + " "); + } +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/ReturnValue.cs generator/ReturnValue.cs +--- gtk-sharp/generator/ReturnValue.cs 2009-05-06 18:20:35.000000000 +0200 ++++ generator/ReturnValue.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -110,7 +110,9 @@ + get { + if (IGen == null) + return String.Empty; +- return IGen.ToNativeReturnType + (is_array || is_null_term ? "[]" : String.Empty); ++ else if (is_null_term) ++ return "IntPtr"; ++ return IGen.ToNativeReturnType + (is_array ? "[]" : String.Empty); + } + } + +@@ -121,14 +123,14 @@ + + if (ElementType != String.Empty) { + string args = (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false"); +- if (IGen.QualifiedName == "GLib.PtrArray") +- return String.Format ("({0}[]) GLib.Marshaller.PtrArrayToArray ({1}, {2}, typeof({0}))", ElementType, var, args); ++ if (IGen.QualifiedName == "Gst.GLib.PtrArray") ++ return String.Format ("({0}[]) Gst.GLib.Marshaller.PtrArrayToArray ({1}, {2}, typeof({0}))", ElementType, var, args); + else +- return String.Format ("({0}[]) GLib.Marshaller.ListPtrToArray ({1}, typeof({2}), {3}, typeof({4}))", ElementType, var, IGen.QualifiedName, args, element_ctype == "gfilename*" ? "GLib.ListBase.FilenameString" : ElementType); ++ return String.Format ("({0}[]) Gst.GLib.Marshaller.ListPtrToArray ({1}, typeof({2}), {3}, typeof({4}))", ElementType, var, IGen.QualifiedName, args, element_ctype == "gfilename*" ? "Gst.GLib.ListBase.FilenameString" : ElementType); + } else if (IGen is HandleBase) + return ((HandleBase)IGen).FromNative (var, owned); + else if (is_null_term) +- return String.Format ("GLib.Marshaller.NullTermPtrToStringArray ({0}, {1})", var, owned ? "true" : "false"); ++ return String.Format ("Gst.Marshaller.NullTermPtrToStringArray ({0}, {1})", var, owned ? "true" : "false"); + else + return IGen.FromNativeReturn (var); + } +@@ -142,11 +144,11 @@ + string args = ", typeof (" + ElementType + "), " + (owned ? "true" : "false") + ", " + (elements_owned ? "true" : "false"); + var = "new " + IGen.QualifiedName + "(" + var + args + ")"; + } else if (is_null_term) +- return String.Format ("GLib.Marshaller.StringArrayToNullTermPointer ({0})", var); ++ return String.Format ("Gst.Marshaller.StringArrayToNullTermPointer ({0})", var); + + if (IGen is IManualMarshaler) + return (IGen as IManualMarshaler).AllocNative (var); +- else if (IGen is ObjectGen && owned) ++ else if ((IGen is ObjectGen || IGen is MiniObjectGen) && owned) + return var + " == null ? IntPtr.Zero : " + var + ".OwnedHandle"; + else if (IGen is OpaqueGen && owned) + return var + " == null ? IntPtr.Zero : " + var + ".OwnedCopy"; +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/Signal.cs generator/Signal.cs +--- gtk-sharp/generator/Signal.cs 2009-07-02 22:18:10.000000000 +0200 ++++ generator/Signal.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -202,7 +202,7 @@ + } + sw.WriteLine("\t\t\t} catch (Exception) {"); + sw.WriteLine ("\t\t\t\tException ex = new Exception (\"args.RetVal or 'out' property unset or set to incorrect type in " + EventHandlerQualifiedName + " callback\");"); +- sw.WriteLine("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (ex, true);"); ++ sw.WriteLine("\t\t\t\tGst.GLib.ExceptionManager.RaiseUnhandledException (ex, true);"); + + sw.WriteLine ("\t\t\t\t// NOTREACHED: above call doesn't return."); + sw.WriteLine ("\t\t\t\tthrow ex;"); +@@ -226,15 +226,15 @@ + sw.WriteLine("\t\t{"); + sw.WriteLine("\t\t\t{0} args = new {0} ();", EventArgsQualifiedName); + sw.WriteLine("\t\t\ttry {"); +- sw.WriteLine("\t\t\t\tGLib.Signal sig = ((GCHandle) gch).Target as GLib.Signal;"); ++ sw.WriteLine("\t\t\t\tGst.GLib.Signal sig = ((GCHandle) gch).Target as Gst.GLib.Signal;"); + sw.WriteLine("\t\t\t\tif (sig == null)"); + sw.WriteLine("\t\t\t\t\tthrow new Exception(\"Unknown signal GC handle received \" + gch);"); + sw.WriteLine(); + string finish = GenArgsInitialization (sw); + sw.WriteLine("\t\t\t\t{0} handler = ({0}) sig.Handler;", EventHandlerQualifiedName); +- sw.WriteLine("\t\t\t\thandler (GLib.Object.GetObject (inst), args);"); ++ sw.WriteLine("\t\t\t\thandler (Gst.GLib.Object.GetObject (inst), args);"); + sw.WriteLine("\t\t\t} catch (Exception e) {"); +- sw.WriteLine("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (e, false);"); ++ sw.WriteLine("\t\t\t\tGst.GLib.ExceptionManager.RaiseUnhandledException (e, false);"); + sw.WriteLine("\t\t\t}"); + GenArgsCleanup (sw, finish); + sw.WriteLine("\t\t}"); +@@ -264,7 +264,7 @@ + sw.WriteLine (); + sw.WriteLine ("\tpublic delegate void " + EventHandlerName + "(object o, " + EventArgsName + " args);"); + sw.WriteLine (); +- sw.WriteLine ("\tpublic class " + EventArgsName + " : GLib.SignalArgs {"); ++ sw.WriteLine ("\tpublic class " + EventArgsName + " : Gst.GLib.SignalArgs {"); + for (int i = 0; i < parms.Count; i++) { + sw.WriteLine ("\t\tpublic " + parms[i].CSType + " " + parms[i].StudlyName + "{"); + if (parms[i].PassAs != "out") { +@@ -294,17 +294,17 @@ + args_type = ", new " + DelegateName + "(" + CallbackName + ")"; + } + +- sw.WriteLine("\t\t[GLib.Signal("+ CName + ")]"); ++ sw.WriteLine("\t\t[Gst.GLib.Signal("+ CName + ")]"); + sw.Write("\t\tpublic "); + if (NeedNew (implementor)) + sw.Write("new "); + sw.WriteLine("event " + EventHandlerQualifiedName + " " + Name + " {"); + sw.WriteLine("\t\t\tadd {"); +- sw.WriteLine("\t\t\t\tGLib.Signal sig = GLib.Signal.Lookup (" + target + ", " + CName + args_type + ");"); ++ sw.WriteLine("\t\t\t\tGst.GLib.Signal sig = Gst.GLib.Signal.Lookup (" + target + ", " + CName + args_type + ");"); + sw.WriteLine("\t\t\t\tsig.AddDelegate (value);"); + sw.WriteLine("\t\t\t}"); + sw.WriteLine("\t\t\tremove {"); +- sw.WriteLine("\t\t\t\tGLib.Signal sig = GLib.Signal.Lookup (" + target + ", " + CName + args_type + ");"); ++ sw.WriteLine("\t\t\t\tGst.GLib.Signal sig = Gst.GLib.Signal.Lookup (" + target + ", " + CName + args_type + ");"); + sw.WriteLine("\t\t\t\tsig.RemoveDelegate (value);"); + sw.WriteLine("\t\t\t}"); + sw.WriteLine("\t\t}"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/StructBase.cs generator/StructBase.cs +--- gtk-sharp/generator/StructBase.cs 2008-09-30 23:21:53.000000000 +0200 ++++ generator/StructBase.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -92,7 +92,7 @@ + + public string AllocNative (string var) + { +- return "GLib.Marshaller.StructureToPtrAlloc (" + var + ")"; ++ return "Gst.GLib.Marshaller.StructureToPtrAlloc (" + var + ")"; + } + + public string ReleaseNative (string var) +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/StructGen.cs generator/StructGen.cs +--- gtk-sharp/generator/StructGen.cs 2005-08-05 22:34:45.000000000 +0200 ++++ generator/StructGen.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -36,8 +36,8 @@ + StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name); + base.Generate (gen_info); + if (GetMethod ("GetType") == null && GetMethod ("GetGType") == null) { +- sw.WriteLine ("\t\tprivate static GLib.GType GType {"); +- sw.WriteLine ("\t\t\tget { return GLib.GType.Pointer; }"); ++ sw.WriteLine ("\t\tprivate static Gst.GLib.GType GType {"); ++ sw.WriteLine ("\t\t\tget { return Gst.GLib.GType.Pointer; }"); + sw.WriteLine ("\t\t}"); + } + sw.WriteLine ("#endregion"); +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/SymbolTable.cs generator/SymbolTable.cs +--- gtk-sharp/generator/SymbolTable.cs 2009-04-13 19:44:48.000000000 +0200 ++++ generator/SymbolTable.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -108,23 +108,24 @@ + AddType (new ConstStringGen ("const-xmlChar")); + AddType (new ConstStringGen ("const-char")); + AddType (new ConstFilenameGen ("const-gfilename")); +- AddType (new MarshalGen ("gfilename", "string", "IntPtr", "GLib.Marshaller.StringToFilenamePtr({0})", "GLib.Marshaller.FilenamePtrToStringGFree({0})")); +- AddType (new MarshalGen ("gchar", "string", "IntPtr", "GLib.Marshaller.StringToPtrGStrdup({0})", "GLib.Marshaller.PtrToStringGFree({0})")); +- AddType (new MarshalGen ("char", "string", "IntPtr", "GLib.Marshaller.StringToPtrGStrdup({0})", "GLib.Marshaller.PtrToStringGFree({0})")); ++ AddType (new MarshalGen ("gfilename", "string", "IntPtr", "Gst.GLib.Marshaller.StringToFilenamePtr({0})", "Gst.GLib.Marshaller.FilenamePtrToStringGFree({0})")); ++ AddType (new MarshalGen ("gchar", "string", "IntPtr", "Gst.GLib.Marshaller.StringToPtrGStrdup({0})", "Gst.GLib.Marshaller.PtrToStringGFree({0})")); ++ AddType (new MarshalGen ("char", "string", "IntPtr", "Gst.GLib.Marshaller.StringToPtrGStrdup({0})", "Gst.GLib.Marshaller.PtrToStringGFree({0})")); + AddType (new SimpleGen ("GStrv", "string[]", "null")); + + // manually wrapped types requiring more complex marshaling +- AddType (new ManualGen ("GInitiallyUnowned", "GLib.InitiallyUnowned", "GLib.Object.GetObject ({0})")); +- AddType (new ManualGen ("GObject", "GLib.Object", "GLib.Object.GetObject ({0})")); +- AddType (new ManualGen ("GList", "GLib.List")); +- AddType (new ManualGen ("GPtrArray", "GLib.PtrArray")); +- AddType (new ManualGen ("GSList", "GLib.SList")); +- AddType (new MarshalGen ("gunichar", "char", "uint", "GLib.Marshaller.CharToGUnichar ({0})", "GLib.Marshaller.GUnicharToChar ({0})")); +- AddType (new MarshalGen ("time_t", "System.DateTime", "IntPtr", "GLib.Marshaller.DateTimeTotime_t ({0})", "GLib.Marshaller.time_tToDateTime ({0})")); +- AddType (new MarshalGen ("GString", "string", "IntPtr", "new GLib.GString ({0}).Handle", "GLib.GString.PtrToString ({0})")); +- AddType (new MarshalGen ("GType", "GLib.GType", "IntPtr", "{0}.Val", "new GLib.GType({0})", "GLib.GType.None")); +- AddType (new ByRefGen ("GValue", "GLib.Value")); +- AddType (new SimpleGen ("GDestroyNotify", "GLib.DestroyNotify", "null")); ++ AddType (new ManualGen ("GInitiallyUnowned", "Gst.GLib.InitiallyUnowned", "Gst.GLib.Object.GetObject ({0})")); ++ AddType (new ManualGen ("GObject", "Gst.GLib.Object", "Gst.GLib.Object.GetObject ({0})")); ++ AddType (new ManualGen ("GstMiniObject", "Gst.MiniObject", "Gst.MiniObject.GetObject ({0})")); ++ AddType (new ManualGen ("GList", "Gst.GLib.List")); ++ AddType (new ManualGen ("GPtrArray", "Gst.GLib.PtrArray")); ++ AddType (new ManualGen ("GSList", "Gst.GLib.SList")); ++ AddType (new MarshalGen ("gunichar", "char", "uint", "Gst.GLib.Marshaller.CharToGUnichar ({0})", "Gst.GLib.Marshaller.GUnicharToChar ({0})")); ++ AddType (new MarshalGen ("time_t", "System.DateTime", "IntPtr", "Gst.GLib.Marshaller.DateTimeTotime_t ({0})", "Gst.GLib.Marshaller.time_tToDateTime ({0})")); ++ AddType (new MarshalGen ("GString", "string", "IntPtr", "new Gst.GLib.GString ({0}).Handle", "Gst.GLib.GString.PtrToString ({0})")); ++ AddType (new MarshalGen ("GType", "Gst.GLib.GType", "IntPtr", "{0}.Val", "new Gst.GLib.GType({0})", "Gst.GLib.GType.None")); ++ AddType (new ByRefGen ("GValue", "Gst.GLib.Value")); ++ AddType (new SimpleGen ("GDestroyNotify", "Gst.GLib.DestroyNotify", "null")); + + // FIXME: These ought to be handled properly. + AddType (new SimpleGen ("GC", "IntPtr", "IntPtr.Zero")); +@@ -136,7 +137,7 @@ + AddType (new SimpleGen ("GByteArray", "IntPtr", "IntPtr.Zero")); + AddType (new SimpleGen ("GData", "IntPtr", "IntPtr.Zero")); + AddType (new SimpleGen ("GIOChannel", "IntPtr", "IntPtr.Zero")); +- AddType (new SimpleGen ("GTypeModule", "GLib.Object", "null")); ++ AddType (new SimpleGen ("GTypeModule", "Gst.GLib.Object", "null")); + AddType (new SimpleGen ("GHashTable", "System.IntPtr", "IntPtr.Zero")); + AddType (new SimpleGen ("va_list", "IntPtr", "IntPtr.Zero")); + AddType (new SimpleGen ("GParamSpec", "IntPtr", "IntPtr.Zero")); +@@ -338,7 +339,8 @@ + + public bool IsObject(string c_type) + { +- if (this[c_type] is ObjectGen) ++ if ((this[c_type] is ObjectGen) || ++ (this[c_type] is MiniObjectGen)) + return true; + + return false; +diff -x'*Makefile' -x'*exe*' -x'*in' -x'*Makefile.am' -x'*orig' -x'*diff' -Naur gtk-sharp/generator/VirtualMethod.cs generator/VirtualMethod.cs +--- gtk-sharp/generator/VirtualMethod.cs 2009-07-02 22:18:10.000000000 +0200 ++++ generator/VirtualMethod.cs 2009-08-05 16:49:19.000000000 +0200 +@@ -92,7 +92,7 @@ + else + type = this.container_type.Name; + +- sw.WriteLine ("\t\t\t\t{0} __obj = GLib.Object.GetObject (inst, false) as {0};", type); ++ sw.WriteLine ("\t\t\t\t{0} __obj = Gst.GLib.Object.GetObject (inst, false) as {0};", type); + } + + sw.Write (call.Setup ("\t\t\t\t")); +@@ -108,7 +108,7 @@ + + bool fatal = parms.HasOutParam || !retval.IsVoid; + sw.WriteLine ("\t\t\t} catch (Exception e) {"); +- sw.WriteLine ("\t\t\t\tGLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); ++ sw.WriteLine ("\t\t\t\tGst.GLib.ExceptionManager.RaiseUnhandledException (e, " + (fatal ? "true" : "false") + ");"); + if (fatal) { + sw.WriteLine ("\t\t\t\t// NOTREACHED: above call does not return."); + sw.WriteLine ("\t\t\t\tthrow e;"); diff --git a/gstreamer-sharp/glib-sharp/gst-glib-sharp.diff b/gstreamer-sharp/glib-sharp/gst-glib-sharp.diff new file mode 100644 index 0000000000..88ca0e86cd --- /dev/null +++ b/gstreamer-sharp/glib-sharp/gst-glib-sharp.diff @@ -0,0 +1,985 @@ +--- ../gtk-sharp/glib/Argv.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/Argv.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Boxed.cs 2004-10-21 03:08:10.000000000 +0200 ++++ glib-sharp/Boxed.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -18,7 +18,7 @@ + // Free Software Foundation, Inc., 59 Temple Place - Suite 330, + // Boston, MA 02111-1307, USA. + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/CDeclCallbackAttribute.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/CDeclCallbackAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/ClassInitializerAttribute.cs 2007-09-07 16:40:46.000000000 +0200 ++++ glib-sharp/ClassInitializerAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/ConnectBeforeAttribute.cs 2004-06-25 20:42:19.000000000 +0200 ++++ glib-sharp/ConnectBeforeAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/DefaultSignalHandlerAttribute.cs 2004-06-25 20:42:19.000000000 +0200 ++++ glib-sharp/DefaultSignalHandlerAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/DelegateWrapper.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/DelegateWrapper.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -22,7 +22,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/DestroyNotify.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/DestroyNotify.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -18,7 +18,7 @@ + // Free Software Foundation, Inc., 59 Temple Place - Suite 330, + // Boston, MA 02111-1307, USA. + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/EnumWrapper.cs 2005-07-22 20:36:50.000000000 +0200 ++++ glib-sharp/EnumWrapper.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/ExceptionManager.cs 2007-03-08 21:28:24.000000000 +0100 ++++ glib-sharp/ExceptionManager.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/FileUtils.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/FileUtils.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Text; +--- ../gtk-sharp/glib/Format.cs 2008-11-21 17:42:46.000000000 +0100 ++++ glib-sharp/Format.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -23,7 +23,7 @@ + using System; + using System.Runtime.InteropServices; + +-namespace GLib { ++namespace Gst.GLib { + #if GTK_SHARP_2_14 + public class Format { + [DllImport("libglib-2.0-0.dll")] +--- ../gtk-sharp/glib/GException.cs 2008-12-19 19:57:42.000000000 +0100 ++++ glib-sharp/GException.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/GInterfaceAdapter.cs 2009-07-21 08:51:10.000000000 +0200 ++++ glib-sharp/GInterfaceAdapter.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/GInterfaceAttribute.cs 2007-09-11 22:34:24.000000000 +0200 ++++ glib-sharp/GInterfaceAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -17,7 +17,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/Global.cs 2008-11-21 17:54:10.000000000 +0100 ++++ glib-sharp/Global.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Text; +--- ../gtk-sharp/glib/GString.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/GString.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + using System.Runtime.InteropServices; + +--- ../gtk-sharp/glib/GTypeAttribute.cs 2005-05-04 18:54:24.000000000 +0200 ++++ glib-sharp/GTypeAttribute.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -17,7 +17,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/GType.cs 2009-08-01 19:20:35.000000000 +0200 ++++ glib-sharp/GType.cs 2009-08-05 16:48:02.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/Idle.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/Idle.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -24,7 +24,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/IgnoreClassInitializersAttribute.cs 2007-09-07 16:40:46.000000000 +0200 ++++ glib-sharp/IgnoreClassInitializersAttribute.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/InitiallyUnowned.cs 2006-05-10 19:13:30.000000000 +0200 ++++ glib-sharp/InitiallyUnowned.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + + #if GTK_SHARP_2_10 + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/IOChannel.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/IOChannel.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLibSharp { ++namespace Gst.GLibSharp { + + using System; + using System.Runtime.InteropServices; +@@ -51,7 +51,7 @@ + } + } + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/IWrapper.cs 2004-06-25 20:42:19.000000000 +0200 ++++ glib-sharp/IWrapper.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib ++namespace Gst.GLib + { + using System; + +--- ../gtk-sharp/glib/ListBase.cs 2009-04-09 16:38:16.000000000 +0200 ++++ glib-sharp/ListBase.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/List.cs 2008-12-19 19:57:42.000000000 +0100 ++++ glib-sharp/List.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Log.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/Log.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -22,7 +22,7 @@ + + // + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/MainContext.cs 2005-10-07 23:33:30.000000000 +0200 ++++ glib-sharp/MainContext.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/MainLoop.cs 2004-08-25 20:11:41.000000000 +0200 ++++ glib-sharp/MainLoop.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -21,7 +21,7 @@ + using System; + using System.Runtime.InteropServices; + +-namespace GLib { ++namespace Gst.GLib { + public class MainLoop { + private IntPtr handle; + +--- ../gtk-sharp/glib/ManagedValue.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/ManagedValue.cs 2009-08-05 16:54:43.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + using System.Collections; + using System.Runtime.InteropServices; +@@ -76,7 +76,7 @@ + copy = new CopyFunc (Copy); + free = new FreeFunc (Free); + +- IntPtr name = Marshaller.StringToPtrGStrdup ("GtkSharpValue"); ++ IntPtr name = Marshaller.StringToPtrGStrdup ("GstGLibSharpValue"); + boxed_type = new GLib.GType (g_boxed_type_register_static (name, copy, free)); + Marshaller.Free (name); + } +--- ../gtk-sharp/glib/Markup.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/Markup.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -23,7 +23,7 @@ + using System; + using System.Runtime.InteropServices; + +-namespace GLib { ++namespace Gst.GLib { + + + public class Markup { +--- ../gtk-sharp/glib/Marshaller.cs 2009-01-08 19:43:00.000000000 +0100 ++++ glib-sharp/Marshaller.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -21,7 +21,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + using System.Runtime.InteropServices; + +--- ../gtk-sharp/glib/MissingIntPtrCtorException.cs 2004-06-25 20:42:19.000000000 +0200 ++++ glib-sharp/MissingIntPtrCtorException.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/NotifyHandler.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/NotifyHandler.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -14,7 +14,7 @@ + // Free Software Foundation, Inc., 59 Temple Place - Suite 330, + // Boston, MA 02111-1307, USA. + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Object.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/Object.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +@@ -185,21 +185,23 @@ + } + } + ++ [StructLayout(LayoutKind.Sequential)] + struct GTypeClass { + public IntPtr gtype; + } + ++ [StructLayout(LayoutKind.Sequential)] + struct GObjectClass { + GTypeClass type_class; + IntPtr construct_props; +- IntPtr constructor_cb; ++ public ConstructorDelegate constructor_cb; + public SetPropertyDelegate set_prop_cb; + public GetPropertyDelegate get_prop_cb; + IntPtr dispose; + IntPtr finalize; + IntPtr dispatch_properties_changed; + IntPtr notify; +- IntPtr constructed; ++ public ConstructedDelegate constructed_cb; + IntPtr dummy1; + IntPtr dummy2; + IntPtr dummy3; +@@ -209,13 +211,36 @@ + IntPtr dummy7; + } + ++ static Hashtable class_structs; ++ ++ static GObjectClass GetClassStruct (GLib.GType gtype, bool use_cache) ++ { ++ if (class_structs == null) ++ class_structs = new Hashtable (); ++ ++ if (use_cache && class_structs.Contains (gtype)) ++ return (GObjectClass) class_structs [gtype]; ++ else { ++ IntPtr class_ptr = gtype.ClassPtr; ++ GObjectClass class_struct = (GObjectClass) Marshal.PtrToStructure (class_ptr, typeof (GObjectClass)); ++ if (use_cache) ++ class_structs.Add (gtype, class_struct); ++ return class_struct; ++ } ++ } ++ ++ static void OverrideClassStruct (GLib.GType gtype, GObjectClass class_struct) ++ { ++ IntPtr class_ptr = gtype.ClassPtr; ++ Marshal.StructureToPtr (class_struct, class_ptr, false); ++ } ++ + static void OverridePropertyHandlers (GType gtype, GetPropertyDelegate get_cb, SetPropertyDelegate set_cb) + { +- IntPtr class_ptr = gtype.ClassPtr; +- GObjectClass klass = (GObjectClass) Marshal.PtrToStructure (class_ptr, typeof (GObjectClass)); ++ GObjectClass klass = GetClassStruct (gtype, false); + klass.get_prop_cb = get_cb; + klass.set_prop_cb = set_cb; +- Marshal.StructureToPtr (klass, class_ptr, false); ++ OverrideClassStruct (gtype, klass); + } + + [DllImport("libgobject-2.0-0.dll")] +@@ -230,9 +255,68 @@ + return pspec.Handle; + } + ++ static ConstructorDelegate Constructor_cb = new ConstructorDelegate (constructor_cb); ++ delegate IntPtr ConstructorDelegate (IntPtr gtype, uint n_construct_properties, IntPtr construct_properties); ++ ++ [StructLayout(LayoutKind.Sequential)] ++ struct GObjectConstructParam { ++ public IntPtr pspec; ++ public IntPtr value; ++ } ++ ++ static IntPtr constructor_cb (IntPtr gtype, uint n_construct_properties, IntPtr construct_properties) ++ { ++ GType type = new GLib.GType (gtype); ++ IntPtr instance = GetClassStruct (type.ThresholdType, false).constructor_cb (gtype, n_construct_properties, construct_properties); ++ for (int i = 0; i < n_construct_properties; i++) { ++ IntPtr p = new IntPtr ((long) construct_properties + i * Marshal.SizeOf (typeof (GObjectConstructParam))); ++ ++ GObjectConstructParam cparam = (GObjectConstructParam) Marshal.PtrToStructure (p, typeof (GObjectConstructParam)); ++ ++ ParamSpec pspec = new ParamSpec (cparam.pspec); ++ GLib.Value val = (Value) Marshal.PtrToStructure (cparam.value, typeof (Value)); ++ ++ if (pspec.Name == "gtk-sharp-managed-instance" && (IntPtr) val.Val != IntPtr.Zero) { ++ GCHandle gch = (GCHandle) (IntPtr) val.Val; ++ Object o = (GLib.Object) gch.Target; ++ o.Raw = instance; ++ } ++ } ++ ++ return instance; ++ } ++ ++ static ConstructedDelegate Constructed_cb = new ConstructedDelegate (constructed_cb); ++ [GLib.CDeclCallback] ++ delegate void ConstructedDelegate (IntPtr o); ++ ++ static void constructed_cb (IntPtr o) ++ { ++ GLib.Object __obj = GLib.Object.GetObject (o, false) as GLib.Object; ++ ConstructedDelegate unmanaged = GetClassStruct (__obj.LookupGType ().ThresholdType, true).constructed_cb; ++ if (unmanaged != null) ++ unmanaged (__obj.Handle); ++ } ++ ++ static SetPropertyDelegate Set_prop_dummy_cb = new SetPropertyDelegate (set_prop_dummy_cb); ++ static void set_prop_dummy_cb (IntPtr GObject, uint property_id, ref GLib.Value value, IntPtr pspec) {} ++ + static void AddProperties (GType gtype, System.Type t) + { + uint idx = 1; ++ ++ if (gtype.BaseType == gtype.ThresholdType) { ++ GObjectClass gobject_class = GetClassStruct (gtype, false); ++ gobject_class.constructor_cb = Constructor_cb; ++ gobject_class.constructed_cb = Constructed_cb; ++ gobject_class.set_prop_cb = Set_prop_dummy_cb; ++ OverrideClassStruct (gtype, gobject_class); ++ ++ IntPtr declaring_class = gtype.ClassPtr; ++ ParamSpec pspec = new ParamSpec ("gtk-sharp-managed-instance", "", "", GType.Pointer, ParamFlags.Writable | ParamFlags.ConstructOnly); ++ g_object_class_install_property (declaring_class, idx, pspec.Handle); ++ idx++; ++ } + + bool handlers_overridden = false; + foreach (PropertyInfo pinfo in t.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)) { +@@ -262,6 +346,9 @@ + + static void GetPropertyCallback (IntPtr handle, uint property_id, ref GLib.Value value, IntPtr param_spec) + { ++ if (!Properties.Contains (param_spec)) ++ return; ++ + GLib.Object obj = GLib.Object.GetObject (handle, false); + value.Val = (Properties [param_spec] as PropertyInfo).GetValue (obj, new object [0]); + } +@@ -280,6 +367,9 @@ + + static void SetPropertyCallback(IntPtr handle, uint property_id, ref GLib.Value value, IntPtr param_spec) + { ++ if (!Properties.Contains (param_spec)) ++ return; ++ + GLib.Object obj = GLib.Object.GetObject (handle, false); + (Properties [param_spec] as PropertyInfo).SetValue (obj, value.Val, new object [0]); + } +@@ -366,12 +456,28 @@ + + protected virtual void CreateNativeObject (string[] names, GLib.Value[] vals) + { +- GParameter[] parms = new GParameter [names.Length]; ++ GLib.GType gtype = LookupGType (); ++ bool managed_type = gtype.ToString().StartsWith ("__gtksharp_"); ++ ++ GParameter[] parms = new GParameter [names.Length + ((managed_type) ? 1 : 0)]; ++ + for (int i = 0; i < names.Length; i++) { + parms [i].name = GLib.Marshaller.StringToPtrGStrdup (names [i]); + parms [i].val = vals [i]; + } +- Raw = g_object_newv (LookupGType ().Val, parms.Length, parms); ++ ++ if (managed_type) { ++ GCHandle gch = GCHandle.Alloc (this); ++ parms[names.Length].name = GLib.Marshaller.StringToPtrGStrdup ("gtk-sharp-managed-instance"); ++ parms[names.Length].val = new GLib.Value ((IntPtr) gch); ++ ++ Raw = g_object_newv (gtype.Val, parms.Length, parms); ++ ++ gch.Free (); ++ } else { ++ Raw = g_object_newv (gtype.Val, parms.Length, parms); ++ } ++ + foreach (GParameter p in parms) + GLib.Marshaller.Free (p.name); + } +@@ -599,10 +705,12 @@ + return g_type_check_instance_is_a (obj, GType.Object.Val); + } + ++ [StructLayout(LayoutKind.Sequential)] + struct GTypeInstance { + public IntPtr g_class; + } + ++ [StructLayout(LayoutKind.Sequential)] + struct GObject { + public GTypeInstance type_instance; + public uint ref_count; +--- ../gtk-sharp/glib/ObjectManager.cs 2008-12-19 19:57:42.000000000 +0100 ++++ glib-sharp/ObjectManager.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Opaque.cs 2009-01-29 17:26:09.000000000 +0100 ++++ glib-sharp/Opaque.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -24,7 +24,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/ParamSpec.cs 2009-04-21 10:11:35.000000000 +0200 ++++ glib-sharp/ParamSpec.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,50 +19,49 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; + + internal enum ParamFlags { +- None = 0, +- Readable = 1 << 0, +- Writable = 1 << 1, ++ None = 0, ++ Readable = 1 << 0, ++ Writable = 1 << 1, ++ Construct = 1 << 2, ++ ConstructOnly = 1 << 3, + } + + public class ParamSpec { + + IntPtr handle; + +- public ParamSpec (string name, string nick, string blurb, GType type, bool readable, bool writable) +- { +- ParamFlags pflags = ParamFlags.None; +- if (readable) pflags |= ParamFlags.Readable; +- if (writable) pflags |= ParamFlags.Writable; ++ private static IntPtr CreateParamSpec (string name, string nick, string blurb, GType type, ParamFlags pflags) { + int flags = (int) pflags; ++ IntPtr ret; + + IntPtr p_name = GLib.Marshaller.StringToPtrGStrdup (name); + IntPtr p_nick = GLib.Marshaller.StringToPtrGStrdup (nick); + IntPtr p_blurb = GLib.Marshaller.StringToPtrGStrdup (blurb); + + if (type == GType.Char) +- handle = g_param_spec_char (p_name, p_nick, p_blurb, SByte.MinValue, SByte.MaxValue, 0, flags); ++ ret = g_param_spec_char (p_name, p_nick, p_blurb, SByte.MinValue, SByte.MaxValue, 0, flags); + else if (type == GType.UChar) +- handle = g_param_spec_uchar (p_name, p_nick, p_blurb, Byte.MinValue, Byte.MaxValue, 0, flags); ++ ret = g_param_spec_uchar (p_name, p_nick, p_blurb, Byte.MinValue, Byte.MaxValue, 0, flags); + else if (type == GType.Boolean) +- handle = g_param_spec_boolean (p_name, p_nick, p_blurb, false, flags); ++ ret = g_param_spec_boolean (p_name, p_nick, p_blurb, false, flags); + else if (type == GType.Int) +- handle = g_param_spec_int (p_name, p_nick, p_blurb, Int32.MinValue, Int32.MaxValue, 0, flags); ++ ret = g_param_spec_int (p_name, p_nick, p_blurb, Int32.MinValue, Int32.MaxValue, 0, flags); + else if (type == GType.UInt) +- handle = g_param_spec_uint (p_name, p_nick, p_blurb, 0, UInt32.MaxValue, 0, flags); ++ ret = g_param_spec_uint (p_name, p_nick, p_blurb, 0, UInt32.MaxValue, 0, flags); + else if (type == GType.Long) +- handle = g_param_spec_long (p_name, p_nick, p_blurb, IntPtr.Zero, IntPtr.Size == 4 ? new IntPtr (Int32.MaxValue) : new IntPtr (Int64.MaxValue), IntPtr.Zero, flags); ++ ret = g_param_spec_long (p_name, p_nick, p_blurb, IntPtr.Zero, IntPtr.Size == 4 ? new IntPtr (Int32.MaxValue) : new IntPtr (Int64.MaxValue), IntPtr.Zero, flags); + else if (type == GType.ULong) +- handle = g_param_spec_ulong (p_name, p_nick, p_blurb, UIntPtr.Zero, UIntPtr.Size == 4 ? new UIntPtr (UInt32.MaxValue) : new UIntPtr (UInt64.MaxValue), UIntPtr.Zero, flags); ++ ret = g_param_spec_ulong (p_name, p_nick, p_blurb, UIntPtr.Zero, UIntPtr.Size == 4 ? new UIntPtr (UInt32.MaxValue) : new UIntPtr (UInt64.MaxValue), UIntPtr.Zero, flags); + else if (type == GType.Int64) +- handle = g_param_spec_int64 (p_name, p_nick, p_blurb, Int64.MinValue, Int64.MaxValue, 0, flags); ++ ret = g_param_spec_int64 (p_name, p_nick, p_blurb, Int64.MinValue, Int64.MaxValue, 0, flags); + else if (type == GType.UInt64) +- handle = g_param_spec_uint64 (p_name, p_nick, p_blurb, 0, UInt64.MaxValue, 0, flags); ++ ret = g_param_spec_uint64 (p_name, p_nick, p_blurb, 0, UInt64.MaxValue, 0, flags); + /* + else if (type == GType.Enum) + else if (type == GType.Flags) +@@ -70,25 +69,40 @@ + * Both g_param_spec_enum and g_param_spec_flags expect default property values and the members of the enum seemingly cannot be enumerated + */ + else if (type == GType.Float) +- handle = g_param_spec_float (p_name, p_nick, p_blurb, Single.MinValue, Single.MaxValue, 0.0f, flags); ++ ret = g_param_spec_float (p_name, p_nick, p_blurb, Single.MinValue, Single.MaxValue, 0.0f, flags); + else if (type == GType.Double) +- handle = g_param_spec_double (p_name, p_nick, p_blurb, Double.MinValue, Double.MaxValue, 0.0, flags); ++ ret = g_param_spec_double (p_name, p_nick, p_blurb, Double.MinValue, Double.MaxValue, 0.0, flags); + else if (type == GType.String) +- handle = g_param_spec_string (p_name, p_nick, p_blurb, IntPtr.Zero, flags); ++ ret = g_param_spec_string (p_name, p_nick, p_blurb, IntPtr.Zero, flags); + else if (type == GType.Pointer) +- handle = g_param_spec_pointer (p_name, p_nick, p_blurb, flags); ++ ret = g_param_spec_pointer (p_name, p_nick, p_blurb, flags); + else if (type.Val == g_gtype_get_type ()) +- handle = g_param_spec_gtype (p_name, p_nick, p_blurb, GType.None.Val, flags); ++ ret = g_param_spec_gtype (p_name, p_nick, p_blurb, GType.None.Val, flags); + else if (g_type_is_a (type.Val, GType.Boxed.Val)) +- handle = g_param_spec_boxed (p_name, p_nick, p_blurb, type.Val, flags); ++ ret = g_param_spec_boxed (p_name, p_nick, p_blurb, type.Val, flags); + else if (g_type_is_a (type.Val, GType.Object.Val)) +- handle = g_param_spec_object (p_name, p_nick, p_blurb, type.Val, flags); ++ ret = g_param_spec_object (p_name, p_nick, p_blurb, type.Val, flags); + else + throw new ArgumentException ("type"); + + GLib.Marshaller.Free (p_name); + GLib.Marshaller.Free (p_nick); + GLib.Marshaller.Free (p_blurb); ++ ++ return ret; ++ } ++ ++ internal ParamSpec (string name, string nick, string blurb, GType type, ParamFlags pflags) { ++ handle = CreateParamSpec (name, nick, blurb, type, pflags); ++ } ++ ++ public ParamSpec (string name, string nick, string blurb, GType type, bool readable, bool writable) ++ { ++ ParamFlags pflags = ParamFlags.None; ++ if (readable) pflags |= ParamFlags.Readable; ++ if (writable) pflags |= ParamFlags.Writable; ++ ++ handle = CreateParamSpec (name, nick, blurb, type, pflags); + } + + public ParamSpec (IntPtr native) +@@ -107,6 +121,13 @@ + } + } + ++ public string Name { ++ get { ++ GParamSpec spec = (GParamSpec) Marshal.PtrToStructure (Handle, typeof (GParamSpec)); ++ return GLib.Marshaller.Utf8PtrToString (spec.name); ++ } ++ } ++ + struct GTypeInstance { + IntPtr g_class; + } +@@ -114,7 +135,7 @@ + struct GParamSpec { + GTypeInstance g_type_instance; + +- IntPtr name; ++ public IntPtr name; + ParamFlags flags; + public IntPtr value_type; + IntPtr owner_type; +--- ../gtk-sharp/glib/Priority.cs 2009-05-03 21:34:22.000000000 +0200 ++++ glib-sharp/Priority.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Free Software Foundation, Inc., 59 Temple Place - Suite 330, + // Boston, MA 02111-1307, USA. + +-namespace GLib { ++namespace Gst.GLib { + public enum Priority + { + High = -100, +--- ../gtk-sharp/glib/PropertyAttribute.cs 2008-06-06 18:55:00.000000000 +0200 ++++ glib-sharp/PropertyAttribute.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -17,7 +17,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/PtrArray.cs 2008-12-19 19:57:42.000000000 +0100 ++++ glib-sharp/PtrArray.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/SignalArgs.cs 2004-06-25 20:42:19.000000000 +0200 ++++ glib-sharp/SignalArgs.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + using System.Collections; + +--- ../gtk-sharp/glib/SignalAttribute.cs 2005-10-08 23:08:04.000000000 +0200 ++++ glib-sharp/SignalAttribute.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/SignalCallback.cs 2005-03-08 22:28:08.000000000 +0100 ++++ glib-sharp/SignalCallback.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + using System.Collections; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/SignalClosure.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/SignalClosure.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/Signal.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/Signal.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/SList.cs 2008-12-19 19:57:42.000000000 +0100 ++++ glib-sharp/SList.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Source.cs 2008-02-21 17:32:03.000000000 +0100 ++++ glib-sharp/Source.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/Spawn.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/Spawn.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Thread.cs 2005-12-30 13:14:59.000000000 +0100 ++++ glib-sharp/Thread.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib ++namespace Gst.GLib + { + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/Timeout.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/Timeout.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -22,7 +22,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/ToggleRef.cs 2009-07-02 22:18:10.000000000 +0200 ++++ glib-sharp/ToggleRef.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/TypeConverter.cs 2005-05-04 18:54:24.000000000 +0200 ++++ glib-sharp/TypeConverter.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + using System; + + public class TypeConverter { +--- ../gtk-sharp/glib/TypeFundamentals.cs 2004-07-09 17:25:39.000000000 +0200 ++++ glib-sharp/TypeFundamentals.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + public enum TypeFundamentals { + TypeInvalid = 0 << 2, +--- ../gtk-sharp/glib/TypeInitializerAttribute.cs 2007-09-07 16:40:46.000000000 +0200 ++++ glib-sharp/TypeInitializerAttribute.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + +--- ../gtk-sharp/glib/UnwrappedObject.cs 2005-07-22 20:36:50.000000000 +0200 ++++ glib-sharp/UnwrappedObject.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Runtime.InteropServices; +--- ../gtk-sharp/glib/ValueArray.cs 2009-05-13 21:04:40.000000000 +0200 ++++ glib-sharp/ValueArray.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -19,7 +19,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections; +--- ../gtk-sharp/glib/Value.cs 2009-05-13 21:27:39.000000000 +0200 ++++ glib-sharp/Value.cs 2009-08-05 16:48:03.000000000 +0200 +@@ -20,7 +20,7 @@ + // Boston, MA 02111-1307, USA. + + +-namespace GLib { ++namespace Gst.GLib { + + using System; + using System.Collections;