mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-16 11:34:47 +02:00
* generator/Parameters.cs: Remove the AllowComplexRefs flag.
(They're always allowed now.) * generator/Signal.cs (GenVirtualMethod): Fix up the use of CSType vs MarshalType in the ref/out-handling code so that this can marshal any type. svn path=/trunk/gtk-sharp/; revision=47412
This commit is contained in:
parent
fbcb47f5e6
commit
6b31c3542f
@ -1,3 +1,12 @@
|
|||||||
|
2005-07-19 Dan Winship <danw@novell.com>
|
||||||
|
|
||||||
|
* generator/Parameters.cs: Remove the AllowComplexRefs flag.
|
||||||
|
(They're always allowed now.)
|
||||||
|
|
||||||
|
* generator/Signal.cs (GenVirtualMethod): Fix up the use of CSType
|
||||||
|
vs MarshalType in the ref/out-handling code so that this can
|
||||||
|
marshal any type.
|
||||||
|
|
||||||
2005-07-18 Dan Winship <danw@novell.com>
|
2005-07-18 Dan Winship <danw@novell.com>
|
||||||
|
|
||||||
* parser/gapi2xml.pl: Change a few instances of
|
* parser/gapi2xml.pl: Change a few instances of
|
||||||
|
@ -310,12 +310,6 @@ namespace GtkSharp.Generation {
|
|||||||
set { is_static = value; }
|
set { is_static = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allow_complex_refs = true;
|
|
||||||
public bool AllowComplexRefs {
|
|
||||||
get { return allow_complex_refs; }
|
|
||||||
set { allow_complex_refs = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
bool cleared = false;
|
bool cleared = false;
|
||||||
void Clear ()
|
void Clear ()
|
||||||
{
|
{
|
||||||
@ -350,14 +344,6 @@ namespace GtkSharp.Generation {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p.PassAs != "" && !allow_complex_refs) {
|
|
||||||
if (!(p.Generatable is BoxedGen) &&
|
|
||||||
!(p.Generatable is SimpleGen)) {
|
|
||||||
Console.Write("Complex " + p.PassAs + " param " + p.Name + " ");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p.Generatable is CallbackGen) {
|
if (p.Generatable is CallbackGen) {
|
||||||
has_cb = true;
|
has_cb = true;
|
||||||
if (i == Count - 3 &&
|
if (i == Count - 3 &&
|
||||||
|
@ -41,7 +41,6 @@ namespace GtkSharp.Generation {
|
|||||||
name = elem.GetAttribute ("name");
|
name = elem.GetAttribute ("name");
|
||||||
retval = new ReturnValue (elem ["return-type"]);
|
retval = new ReturnValue (elem ["return-type"]);
|
||||||
parms = new Parameters (elem["parameters"]);
|
parms = new Parameters (elem["parameters"]);
|
||||||
parms.AllowComplexRefs = false;
|
|
||||||
this.container_type = container_type;
|
this.container_type = container_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,12 +311,12 @@ namespace GtkSharp.Generation {
|
|||||||
cleanup += "\t\t\t" + p.Name + " = (" + p.CSType + ") vals [" + i + "];\n";
|
cleanup += "\t\t\t" + p.Name + " = (" + p.CSType + ") vals [" + i + "];\n";
|
||||||
} else {
|
} else {
|
||||||
if (p.PassAs == "ref")
|
if (p.PassAs == "ref")
|
||||||
sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = GLib.Marshaller.StructureToPtrAlloc ((" + p.CSType + ") " + p.Name + ");");
|
sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = GLib.Marshaller.StructureToPtrAlloc (" + p.Generatable.CallByName (p.Name) + ");");
|
||||||
else
|
else
|
||||||
sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (" + p.CSType + ")));");
|
sw.WriteLine ("\t\t\tIntPtr " + p.Name + "_ptr = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (" + p.MarshalType + ")));");
|
||||||
|
|
||||||
sw.WriteLine ("\t\t\tvals [" + i + "] = new GLib.Value (" + p.Name + "_ptr);");
|
sw.WriteLine ("\t\t\tvals [" + i + "] = new GLib.Value (" + p.Name + "_ptr);");
|
||||||
cleanup += "\t\t\t" + p.Name + " = (" + p.CSType + ") Marshal.PtrToStructure (" + p.Name + "_ptr, typeof (" + p.CSType + "));\n";
|
cleanup += "\t\t\t" + p.Name + " = " + p.Generatable.FromNative ("(" + p.MarshalType + ") Marshal.PtrToStructure (" + p.Name + "_ptr, typeof (" + p.MarshalType + "))") + ";\n";
|
||||||
cleanup += "\t\t\tMarshal.FreeHGlobal (" + p.Name + "_ptr);\n";
|
cleanup += "\t\t\tMarshal.FreeHGlobal (" + p.Name + "_ptr);\n";
|
||||||
}
|
}
|
||||||
} else if (p.IsLength && parms [i - 1].IsString)
|
} else if (p.IsLength && parms [i - 1].IsString)
|
||||||
|
Loading…
Reference in New Issue
Block a user