diff --git a/ChangeLog b/ChangeLog index 4c1ef253c..f3643920d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2005-08-09 Dan Winship + + * 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. + 2005-08-09 Dan Winship * generator/OpaqueGen.cs (Generate): Tweak the generated Ref/Unref diff --git a/generator/ClassBase.cs b/generator/ClassBase.cs index a68085636..b3910f602 100644 --- a/generator/ClassBase.cs +++ b/generator/ClassBase.cs @@ -125,15 +125,15 @@ namespace GtkSharp.Generation { public override bool Validate () { - if (Parent != null && !Parent.Validate ()) + if (Parent != null && !Parent.ValidateForSubclass ()) return false; foreach (string iface in interfaces) { - IGeneratable gen = SymbolTable.Table[iface]; - if (!(gen is InterfaceGen)) { + InterfaceGen igen = SymbolTable.Table[iface] as InterfaceGen; + if (igen == null) { Console.WriteLine (QualifiedName + " implements unknown GInterface " + iface); return false; } - if (!gen.Validate ()) { + if (!igen.ValidateForSubclass ()) { Console.WriteLine (QualifiedName + " implements invalid GInterface " + iface); return false; } @@ -194,6 +194,23 @@ namespace GtkSharp.Generation { return true; } + public virtual bool ValidateForSubclass () + { + ArrayList invalids = new ArrayList (); + + foreach (Signal sig in sigs.Values) { + if (!sig.Validate ()) { + Console.WriteLine ("in type " + QualifiedName); + invalids.Add (sig); + } + } + foreach (Signal sig in invalids) + sigs.Remove (sig.Name); + invalids.Clear (); + + return true; + } + public bool IsDeprecated { get { return deprecated; diff --git a/generator/InterfaceGen.cs b/generator/InterfaceGen.cs index 7fee5923b..2c0e2bebe 100644 --- a/generator/InterfaceGen.cs +++ b/generator/InterfaceGen.cs @@ -52,6 +52,23 @@ namespace GtkSharp.Generation { } } + public override bool ValidateForSubclass () + { + ArrayList invalids = new ArrayList (); + + foreach (Method method in methods.Values) { + if (!method.Validate ()) { + Console.WriteLine ("in type " + QualifiedName); + invalids.Add (method); + } + } + foreach (Method method in invalids) + methods.Remove (method.Name); + invalids.Clear (); + + return base.ValidateForSubclass (); + } + string IfaceName { get { return Name + "Iface";