* generator/ClassBase.cs (Validate): Don't fully validate the
parent class and interfaces (because we don't want to see the warnings about certain GtkWidget methods in every single library that defines a widget, etc). Instead, use the new ValidateForSubclass() method. (ValidateForSubclass): only validate the signals * 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". svn path=/trunk/gtk-sharp/; revision=48184
This commit is contained in:
parent
9a71bd5ee2
commit
d6ec3f77ff
7 changed files with 59 additions and 7 deletions
13
ChangeLog
13
ChangeLog
|
@ -10,6 +10,19 @@
|
||||||
* generator/InterfaceGen.cs (ValidateForSubclass): for interfaces
|
* generator/InterfaceGen.cs (ValidateForSubclass): for interfaces
|
||||||
we need to validate the methods too.
|
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 <danw@novell.com>
|
2005-08-09 Dan Winship <danw@novell.com>
|
||||||
|
|
||||||
* generator/OpaqueGen.cs (Generate): Tweak the generated Ref/Unref
|
* generator/OpaqueGen.cs (Generate): Tweak the generated Ref/Unref
|
||||||
|
|
|
@ -1996,5 +1996,39 @@
|
||||||
<remarks>To be added.</remarks>
|
<remarks>To be added.</remarks>
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
|
<Member MemberName="AddSelection">
|
||||||
|
<MemberSignature Language="C#" Value="public bool AddSelection (int i);" />
|
||||||
|
<MemberType>Method</MemberType>
|
||||||
|
<ReturnValue>
|
||||||
|
<ReturnType>System.Boolean</ReturnType>
|
||||||
|
</ReturnValue>
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="i" Type="System.Int32" />
|
||||||
|
</Parameters>
|
||||||
|
<Docs>
|
||||||
|
<param name="i">To be added.</param>
|
||||||
|
<summary>To be added.</summary>
|
||||||
|
<returns>To be added.</returns>
|
||||||
|
<remarks>To be added.</remarks>
|
||||||
|
</Docs>
|
||||||
|
</Member>
|
||||||
|
<Member MemberName="AddSelection">
|
||||||
|
<MemberSignature Language="C#" Value="public bool AddSelection (int start_offset, int end_offset);" />
|
||||||
|
<MemberType>Method</MemberType>
|
||||||
|
<ReturnValue>
|
||||||
|
<ReturnType>System.Boolean</ReturnType>
|
||||||
|
</ReturnValue>
|
||||||
|
<Parameters>
|
||||||
|
<Parameter Name="start_offset" Type="System.Int32" />
|
||||||
|
<Parameter Name="end_offset" Type="System.Int32" />
|
||||||
|
</Parameters>
|
||||||
|
<Docs>
|
||||||
|
<param name="start_offset">To be added.</param>
|
||||||
|
<param name="end_offset">To be added.</param>
|
||||||
|
<summary>To be added.</summary>
|
||||||
|
<returns>To be added.</returns>
|
||||||
|
<remarks>To be added.</remarks>
|
||||||
|
</Docs>
|
||||||
|
</Member>
|
||||||
</Members>
|
</Members>
|
||||||
</Type>
|
</Type>
|
||||||
|
|
|
@ -177,7 +177,7 @@
|
||||||
<Docs>
|
<Docs>
|
||||||
<summary>Whether or not this <see cref="T:GLib.Opaque" /> wrapper owns the raw object.</summary>
|
<summary>Whether or not this <see cref="T:GLib.Opaque" /> wrapper owns the raw object.</summary>
|
||||||
<value>
|
<value>
|
||||||
<see langword="true" /> if the wrapper owns the raw object and will <see cref="M:GLib.Opaque.Unref"/> / <see cref="M:GLib.Opaque.Free"/> it when the wrapper is disposed.</value>
|
<see langword="true" /> if the wrapper owns the raw object and will <see cref="M:GLib.Opaque.Unref" /> / <see cref="M:GLib.Opaque.Free" /> it when the wrapper is disposed.</value>
|
||||||
<remarks>By default, this is set to <see langword="true" /> for opaque objects created with the no-argument constructor, and <see langword="false" /> for opaque objects created with the <see cref="T:System.IntPtr" /> constructor. Methods that return an opaque object can override this by setting the <see cref="M:GLib.Opaque.Owned" /> property accordingly to obey the memory-management conventions of the underlying C code.</remarks>
|
<remarks>By default, this is set to <see langword="true" /> for opaque objects created with the no-argument constructor, and <see langword="false" /> for opaque objects created with the <see cref="T:System.IntPtr" /> constructor. Methods that return an opaque object can override this by setting the <see cref="M:GLib.Opaque.Owned" /> property accordingly to obey the memory-management conventions of the underlying C code.</remarks>
|
||||||
</Docs>
|
</Docs>
|
||||||
</Member>
|
</Member>
|
||||||
|
|
|
@ -202,14 +202,17 @@ namespace GtkSharp.Generation {
|
||||||
|
|
||||||
if (interfaces.Count != 0) {
|
if (interfaces.Count != 0) {
|
||||||
Hashtable all_methods = new Hashtable ();
|
Hashtable all_methods = new Hashtable ();
|
||||||
|
foreach (Method m in Methods.Values)
|
||||||
|
all_methods[m.Name] = m;
|
||||||
Hashtable collisions = new Hashtable ();
|
Hashtable collisions = new Hashtable ();
|
||||||
foreach (string iface in interfaces) {
|
foreach (string iface in interfaces) {
|
||||||
ClassBase igen = table.GetClassGen (iface);
|
ClassBase igen = table.GetClassGen (iface);
|
||||||
foreach (Method m in igen.Methods.Values) {
|
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;
|
collisions[m.Name] = true;
|
||||||
else
|
else
|
||||||
all_methods[m.Name] = true;
|
all_methods[m.Name] = m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -346,10 +346,10 @@ namespace GtkSharp.Generation {
|
||||||
sw.WriteLine ("\t\tstatic {0} {1};\n", Name + "VMDelegate", Name + "VMCallback");
|
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\tstatic " + retval.ToNativeType + " " + Name.ToLower() + "_cb (" + isig.ToString () + ")");
|
||||||
sw.WriteLine ("\t\t{");
|
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 (call.Setup ("\t\t\t"));
|
||||||
sw.Write ("\t\t\t{0}", IsVoid ? "" : retval.CSType == retval.ToNativeType ? "return " : retval.CSType + " raw_ret = ");
|
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"));
|
sw.Write (call.Finish ("\t\t\t"));
|
||||||
if (!IsVoid && retval.CSType != retval.ToNativeType)
|
if (!IsVoid && retval.CSType != retval.ToNativeType)
|
||||||
sw.WriteLine ("\t\t\treturn {0};", SymbolTable.Table.ToNativeReturn (retval.CType, "raw_ret"));
|
sw.WriteLine ("\t\t\treturn {0};", SymbolTable.Table.ToNativeReturn (retval.CType, "raw_ret"));
|
||||||
|
|
|
@ -377,6 +377,8 @@ namespace GtkSharp.Generation {
|
||||||
return "read_only";
|
return "read_only";
|
||||||
case "interface":
|
case "interface":
|
||||||
return "iface";
|
return "iface";
|
||||||
|
case "internal":
|
||||||
|
return "_internal";
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue