diff --git a/generator/OpaqueGen.cs b/generator/OpaqueGen.cs index 45be933ea..7ca2cc443 100644 --- a/generator/OpaqueGen.cs +++ b/generator/OpaqueGen.cs @@ -59,8 +59,8 @@ namespace GtkSharp.Generation { SymbolTable table = SymbolTable.Table; - Method ref_, unref, dispose; - GetSpecialMethods (out ref_, out unref, out dispose); + Method ref_, unref, dispose, set_gvalue; + GetSpecialMethods (out ref_, out unref, out dispose, out set_gvalue); if (IsDeprecated) sw.WriteLine ("\t[Obsolete]"); @@ -184,6 +184,17 @@ namespace GtkSharp.Generation { sw.WriteLine (); } #endif + if (set_gvalue != null) { + sw.WriteLine ("\t\t[DllImport(\"{0}\", CallingConvention = CallingConvention.Cdecl)]", LibraryName); + sw.WriteLine ("\t\tstatic extern void {0}(ref GLib.Value val, IntPtr obj);", set_gvalue.CName); + sw.WriteLine (); + sw.WriteLine ("\t\tpublic void SetGValue (ref GLib.Value val)"); + sw.WriteLine ("\t\t{"); + sw.WriteLine ("\t\t\t{0} (ref val, Handle);", set_gvalue.CName); + sw.WriteLine ("\t\t}"); + sw.WriteLine (); + } + sw.WriteLine ("#endregion"); sw.WriteLine ("\t}"); @@ -194,7 +205,7 @@ namespace GtkSharp.Generation { Statistics.OpaqueCount++; } - void GetSpecialMethods (out Method ref_, out Method unref, out Method dispose) + void GetSpecialMethods (out Method ref_, out Method unref, out Method dispose, out Method set_gvalue) { ref_ = CheckSpecialMethod (GetMethod ("Ref")); unref = CheckSpecialMethod (GetMethod ("Unref")); @@ -206,6 +217,9 @@ namespace GtkSharp.Generation { dispose = GetMethod ("Dispose"); } dispose = CheckSpecialMethod (dispose); + + set_gvalue = GetMethod ("SetGValue"); + Methods.Remove ("SetGValue"); } Method CheckSpecialMethod (Method method)