From d837953e6cb3d012b795e05c17b1e0c6fdc1cfad Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Sat, 20 Jul 2002 14:43:48 +0000 Subject: [PATCH] 2002-07-20 Mike Kestner * generator/Method.cs : beef up !Validate warnings * generator/ObjectGen.cs : beef up !Validate warnings * generator/Parameters.cs (Validate): fail on ellipsis parm * parser/gapi2xml.pl : Handle more opaque types properly svn path=/trunk/gtk-sharp/; revision=5965 --- ChangeLog | 7 +++++++ generator/Method.cs | 7 ++++--- generator/ObjectGen.cs | 18 +++++++++++++----- generator/Parameters.cs | 6 ++++++ generator/gtkapi.xml | 23 +++++++++++++++++++++++ parser/gapi2xml.pl | 3 +-- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fb725d05..f4c9f98c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-07-20 Mike Kestner + + * generator/Method.cs : beef up !Validate warnings + * generator/ObjectGen.cs : beef up !Validate warnings + * generator/Parameters.cs (Validate): fail on ellipsis parm + * parser/gapi2xml.pl : Handle more opaque types properly + 2002-07-19 Duncan Mak * gtk/Paned.custom: diff --git a/generator/Method.cs b/generator/Method.cs index 7a3cc119a..51b77fdfa 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -106,8 +106,10 @@ namespace GtkSharp.Generation { if (initialized) return true; - if (parms != null && !parms.Validate ()) - return false; + if (parms != null && !parms.Validate ()) { + Console.Write ("in method " + Name + " "); + return false; + } XmlElement ret_elem = elem["return-type"]; if (ret_elem == null) { @@ -182,7 +184,6 @@ namespace GtkSharp.Generation { else if (elem.HasAttribute("new_flag") || (container_type != null && (dup = container_type.GetMethodRecursively (Name)) != null) || (implementor != null && (dup = implementor.GetMethodRecursively (Name)) != null)) { if (dup != null && dup.parms != null) dup.parms.CreateSignature (false); - if (Name == "Toggle") Console.WriteLine ("FOOK {0} {1}", (dup.parms != null) ? dup.parms.Signature : null, (parms != null) ? parms.Signature : null); if (dup != null && ((dup.parms != null && dup.parms.Signature == parms.Signature) || (dup.parms == null && parms == null))) sw.Write("new "); } diff --git a/generator/ObjectGen.cs b/generator/ObjectGen.cs index 46bee874f..c1d2d8c84 100644 --- a/generator/ObjectGen.cs +++ b/generator/ObjectGen.cs @@ -140,29 +140,37 @@ namespace GtkSharp.Generation { string parent = Elem.GetAttribute("parent"); string cs_parent = SymbolTable.GetCSType(parent); if (cs_parent == "") { - Console.WriteLine ("Object " + Name + " Unknown parent " + parent); + Console.WriteLine ("Object " + QualifiedName + " Unknown parent " + parent); return false; } if (ctors != null) foreach (Ctor ctor in ctors) - if (!ctor.Validate()) + if (!ctor.Validate()) { + Console.WriteLine ("in Object " + QualifiedName); return false; + } if (props != null) foreach (Property prop in props.Values) - if (!prop.Validate()) + if (!prop.Validate()) { + Console.WriteLine ("in Object " + QualifiedName); return false; + } if (sigs != null) foreach (Signal sig in sigs.Values) - if (!sig.Validate()) + if (!sig.Validate()) { + Console.WriteLine ("in Object " + QualifiedName); return false; + } if (methods != null) foreach (Method method in methods.Values) - if (!method.Validate()) + if (!method.Validate()) { + Console.WriteLine ("in Object " + QualifiedName); return false; + } if (SymbolTable.GetCSType(parent) == null) return false; diff --git a/generator/Parameters.cs b/generator/Parameters.cs index 204e73615..fb149d3d6 100644 --- a/generator/Parameters.cs +++ b/generator/Parameters.cs @@ -114,6 +114,12 @@ namespace GtkSharp.Generation { } XmlElement p_elem = (XmlElement) parm; + + if (p_elem.HasAttribute("ellipsis")) { + Console.Write("Ellipsis parameter "); + return false; + } + string type = p_elem.GetAttribute("type"); string cs_type = SymbolTable.GetCSType(type); string m_type = SymbolTable.GetMarshalType(type); diff --git a/generator/gtkapi.xml b/generator/gtkapi.xml index 46fe10ddb..7f4fbcd82 100644 --- a/generator/gtkapi.xml +++ b/generator/gtkapi.xml @@ -673,6 +673,7 @@ + @@ -3028,6 +3029,7 @@ + @@ -3245,6 +3247,7 @@ + @@ -12934,6 +12937,7 @@ + @@ -13255,6 +13259,7 @@ + @@ -13480,6 +13485,7 @@ + @@ -16157,6 +16163,7 @@ + @@ -16983,6 +16990,7 @@ + @@ -17033,6 +17041,8 @@ + + @@ -19364,6 +19374,17 @@ + + + + + + + + + + + @@ -19522,6 +19543,8 @@ + + diff --git a/parser/gapi2xml.pl b/parser/gapi2xml.pl index 273d45bac..d1994e028 100755 --- a/parser/gapi2xml.pl +++ b/parser/gapi2xml.pl @@ -320,8 +320,7 @@ foreach $key (sort (keys (%types))) { if (exists($sdefs{$type})) { $def = $sdefs{$type}; } else { - warn "Couldn't find $type\n" if $debug; - next; + $def = "privatestruct"; } if (exists($boxdefs{$key})) {