mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-01-11 09:35:31 +00:00
2005-03-07 Mike Kestner <mkestner@novell.com>
* generator/MethodBody.cs : remove an unused var. * generator/ReturnValue.cs : privatize a couple props. Refactor the SymbolTable lookup logic to be generatable based. svn path=/trunk/gtk-sharp/; revision=41528
This commit is contained in:
parent
7dbba612c5
commit
24bbc054f2
|
@ -1,3 +1,9 @@
|
|||
2005-03-07 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* 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 <mkestner@novell.com>
|
||||
|
||||
* generator/ImportSignature.cs : out param handling fix.
|
||||
|
|
|
@ -158,7 +158,6 @@ namespace GtkSharp.Generation {
|
|||
|
||||
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") + ";");
|
||||
}
|
||||
|
|
|
@ -41,17 +41,28 @@ namespace GtkSharp.Generation {
|
|||
|
||||
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 @@ namespace GtkSharp.Generation {
|
|||
|
||||
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 @@ namespace GtkSharp.Generation {
|
|||
|
||||
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 ()
|
||||
|
|
Loading…
Reference in a new issue