Author: mkestner
Date: 2005-03-07 10:54:49 -0500 (Mon, 07 Mar 2005)
New Revision: 41528

Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/generator/MethodBody.cs
   trunk/gtk-sharp/generator/ReturnValue.cs
Log:

2005-03-07  Mike Kestner  <[EMAIL PROTECTED]>

        * generator/MethodBody.cs : remove an unused var.
        * generator/ReturnValue.cs : privatize a couple props. Refactor the
        SymbolTable lookup logic to be generatable based.


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2005-03-07 15:26:35 UTC (rev 41527)
+++ trunk/gtk-sharp/ChangeLog   2005-03-07 15:54:49 UTC (rev 41528)
@@ -1,3 +1,9 @@
+2005-03-07  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * generator/MethodBody.cs : remove an unused var.
+       * generator/ReturnValue.cs : privatize a couple props. Refactor the
+       SymbolTable lookup logic to be generatable based.
+
 2005-03-04  Mike Kestner  <[EMAIL PROTECTED]>
 
        * generator/ImportSignature.cs : out param handling fix.

Modified: trunk/gtk-sharp/generator/MethodBody.cs
===================================================================
--- trunk/gtk-sharp/generator/MethodBody.cs     2005-03-07 15:26:35 UTC (rev 
41527)
+++ trunk/gtk-sharp/generator/MethodBody.cs     2005-03-07 15:54:49 UTC (rev 
41528)
@@ -158,7 +158,6 @@
 
                                IGeneratable gen = p.Generatable;
 
-                               string name = p.Name;
                                if (p.PassAs == "out" && p.CSType != 
p.MarshalType && !(gen is StructBase || gen is ByRefGen))
                                        sw.WriteLine(indent + "\t\t\t" + p.Name 
+ " = " + gen.FromNative (p.Name + "_as_native") + ";");
                        }

Modified: trunk/gtk-sharp/generator/ReturnValue.cs
===================================================================
--- trunk/gtk-sharp/generator/ReturnValue.cs    2005-03-07 15:26:35 UTC (rev 
41527)
+++ trunk/gtk-sharp/generator/ReturnValue.cs    2005-03-07 15:54:49 UTC (rev 
41528)
@@ -41,18 +41,29 @@
 
                public string CSType {
                        get {
-                               return SymbolTable.Table.GetCSType (CType) + 
(IsArray ? "[]" : String.Empty);
+                               if (IGen == null)
+                                       return String.Empty;
+                               return IGen.QualifiedName + (IsArray ? "[]" : 
String.Empty);
                        }
                }
 
-               public string ElementType {
+               string ElementType {
                        get {
                                return elem == null ? String.Empty : 
elem.GetAttribute("element_type");
                        }
                }
 
-               public bool IsArray {
+               IGeneratable igen;
+               IGeneratable IGen {
                        get {
+                               if (igen == null)
+                                       igen = SymbolTable.Table [CType];
+                               return igen;
+                       }
+               }
+
+               bool IsArray {
+                       get {
                                return elem == null ? false : elem.HasAttribute 
("array");
                        }
                }
@@ -65,11 +76,13 @@
 
                public string MarshalType {
                        get {
-                               return SymbolTable.Table.GetMarshalReturnType 
(CType) + (IsArray ? "[]" : String.Empty);
+                               if (IGen == null)
+                                       return String.Empty;
+                               return IGen.MarshalReturnType + (IsArray ? "[]" 
: String.Empty);
                        }
                }
 
-               public bool Owned {
+               bool Owned {
                        get {
                                return elem.GetAttribute ("owned") == "true";
                        }
@@ -77,17 +90,21 @@
 
                public string ToNativeType {
                        get {
-                               return SymbolTable.Table.GetToNativeReturnType 
(CType) + (IsArray ? "[]" : String.Empty);
+                               if (IGen == null)
+                                       return String.Empty;
+                               return IGen.ToNativeReturnType + (IsArray ? 
"[]" : String.Empty);
                        }
                }
 
                public string FromNative (string var)
                {
+                       if (IGen == null)
+                               return String.Empty;
                        if (Owned)
                                var += ", true";
                        else if (ElementType != String.Empty)
                                var += ", typeof (" + ElementType + ")";
-                       return SymbolTable.Table.FromNativeReturn (CType, var);
+                       return IGen.FromNativeReturn (var);
                }
                        
                public bool Validate ()

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to