diff --git a/ChangeLog b/ChangeLog index f3643920d..b6f5befc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,19 @@ * generator/InterfaceGen.cs (ValidateForSubclass): for interfaces we need to validate the methods too. + * generator/ObjectGen.cs (Generate): Check for interface method + collisions against the class's own methods too, not just its other + interfaces. Also, it's only a collision if the methods' signatures + have the same types. + + * generator/Signal.cs (GenDefaultHandlerDelegate): Use + "{0}_managed" rather than "obj" for the internal variable name, to + avoid compile problems with signals that have a parameter named + "obj". + + * generator/SymbolTable.cs (MangleName): mangle "internal" to + "_internal". + 2005-08-09 Dan Winship * generator/OpaqueGen.cs (Generate): Tweak the generated Ref/Unref diff --git a/doc/en/Atk/NoOpObject.xml b/doc/en/Atk/NoOpObject.xml index 88c23d05d..d67e843d7 100644 --- a/doc/en/Atk/NoOpObject.xml +++ b/doc/en/Atk/NoOpObject.xml @@ -1996,5 +1996,39 @@ To be added. + + + Method + + System.Boolean + + + + + + To be added. + To be added. + To be added. + To be added. + + + + + Method + + System.Boolean + + + + + + + To be added. + To be added. + To be added. + To be added. + To be added. + + diff --git a/doc/en/GLib/Opaque.xml b/doc/en/GLib/Opaque.xml index e3d4d1a6a..1d0bd21d2 100644 --- a/doc/en/GLib/Opaque.xml +++ b/doc/en/GLib/Opaque.xml @@ -177,7 +177,7 @@ Whether or not this wrapper owns the raw object. - if the wrapper owns the raw object and will / it when the wrapper is disposed. + if the wrapper owns the raw object and will / it when the wrapper is disposed. By default, this is set to for opaque objects created with the no-argument constructor, and for opaque objects created with the constructor. Methods that return an opaque object can override this by setting the property accordingly to obey the memory-management conventions of the underlying C code. diff --git a/doc/en/Gtk/TreeModelFilter.xml b/doc/en/Gtk/TreeModelFilter.xml index 0bb521fa6..07c6e9f29 100644 --- a/doc/en/Gtk/TreeModelFilter.xml +++ b/doc/en/Gtk/TreeModelFilter.xml @@ -1185,4 +1185,4 @@ public class MyWindow : Window - \ No newline at end of file + diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index 45e9152c4..052177332 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -128,7 +128,7 @@ namespace GtkSharp.Generation { return result; } - + public override void Generate (GenerationInfo gen_info) { gen_info.CurrentType = Name; @@ -202,14 +202,17 @@ namespace GtkSharp.Generation { if (interfaces.Count != 0) { Hashtable all_methods = new Hashtable (); + foreach (Method m in Methods.Values) + all_methods[m.Name] = m; Hashtable collisions = new Hashtable (); foreach (string iface in interfaces) { ClassBase igen = table.GetClassGen (iface); foreach (Method m in igen.Methods.Values) { - if (all_methods.Contains (m.Name)) + Method collision = all_methods[m.Name] as Method; + if (collision != null && collision.Signature.Types == m.Signature.Types) collisions[m.Name] = true; else - all_methods[m.Name] = true; + all_methods[m.Name] = m; } } diff --git a/generator/Signal.cs b/generator/Signal.cs index 4d4a716dd..d0def6dc5 100644 --- a/generator/Signal.cs +++ b/generator/Signal.cs @@ -346,10 +346,10 @@ namespace GtkSharp.Generation { sw.WriteLine ("\t\tstatic {0} {1};\n", Name + "VMDelegate", Name + "VMCallback"); sw.WriteLine ("\t\tstatic " + retval.ToNativeType + " " + Name.ToLower() + "_cb (" + isig.ToString () + ")"); sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\t{0} obj = GLib.Object.GetObject ({1}, false) as {0};", implementor != null ? implementor.Name : container_type.Name, parms[0].Name); + sw.WriteLine ("\t\t\t{0} {1}_managed = GLib.Object.GetObject ({1}, false) as {0};", implementor != null ? implementor.Name : container_type.Name, parms[0].Name); sw.Write (call.Setup ("\t\t\t")); sw.Write ("\t\t\t{0}", IsVoid ? "" : retval.CSType == retval.ToNativeType ? "return " : retval.CSType + " raw_ret = "); - sw.WriteLine ("obj.{0} ({1});", "On" + Name, call.ToString ()); + sw.WriteLine ("{2}_managed.{0} ({1});", "On" + Name, call.ToString (), parms[0].Name); sw.Write (call.Finish ("\t\t\t")); if (!IsVoid && retval.CSType != retval.ToNativeType) sw.WriteLine ("\t\t\treturn {0};", SymbolTable.Table.ToNativeReturn (retval.CType, "raw_ret")); diff --git a/generator/SymbolTable.cs b/generator/SymbolTable.cs index 227f8e775..5d4893eca 100644 --- a/generator/SymbolTable.cs +++ b/generator/SymbolTable.cs @@ -377,6 +377,8 @@ namespace GtkSharp.Generation { return "read_only"; case "interface": return "iface"; + case "internal": + return "_internal"; default: break; }