2004-12-01 Todd Berman <tberman@off.net>

* generator/StructGen.cs: Check to see if a GType is going to be
        generated. If not, generate a GType.Pointer. This fixes bug
        #70017.
        * glib/TypeConverter.cs: Remove the .IsValueType check, as those
        now have GType properties.
        * gda/Gda.metadata: Change GdaValue.GType to GdaValue.GdaType.
        * doc/en/Gda/Value.xml: Regenerated to reflect new API.

svn path=/trunk/gtk-sharp/; revision=36912
This commit is contained in:
Todd Berman 2004-12-01 21:41:10 +00:00
parent e03eb3f68d
commit 6d9785c7f7
5 changed files with 39 additions and 18 deletions

View file

@ -1,3 +1,13 @@
2004-12-01 Todd Berman <tberman@off.net>
* generator/StructGen.cs: Check to see if a GType is going to be
generated. If not, generate a GType.Pointer. This fixes bug
#70017.
* glib/TypeConverter.cs: Remove the .IsValueType check, as those
now have GType properties.
* gda/Gda.metadata: Change GdaValue.GType to GdaValue.GdaType.
* doc/en/Gda/Value.xml: Regenerated to reflect new API.
2004-11-30 Dan Winship <danw@novell.com>
* sample/GtkDemo/DemoImages.cs: Fix some crashers discovered while

View file

@ -696,19 +696,6 @@
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="GType">
<MemberSignature Language="C#" Value="public Gda.ValueType GType { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gda.ValueType</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added</summary>
<returns>a <see cref="T:Gda.ValueType" /></returns>
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="Numeric">
<MemberSignature Language="C#" Value="public Gda.Numeric Numeric { set; get; };" />
<MemberType>Property</MemberType>
@ -1209,5 +1196,18 @@
<remarks>To be added</remarks>
</Docs>
</Member>
<Member MemberName="GdaType">
<MemberSignature Language="C#" Value="public Gda.ValueType GdaType { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gda.ValueType</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added</summary>
<returns>a <see cref="T:Gda.ValueType" /></returns>
<remarks>To be added</remarks>
</Docs>
</Member>
</Members>
</Type>

View file

@ -16,5 +16,6 @@
<attr path="//struct[@cname='GdaCommand']" name="opaque">1</attr>
<attr path="//struct[@cname='GdaFieldAttributes']" name="opaque">1</attr>
<attr path="//struct[@cname='GdaParameter']" name="opaque">1</attr>
<attr path="/api/namespace/struct[@cname='GdaValue']/method[@cname='gda_value_get_type']" name="name">GetGdaType</attr>
</metadata>

View file

@ -37,7 +37,19 @@ namespace GtkSharp.Generation {
public override void Generate (GenerationInfo gen_info)
{
StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name);
base.Generate (gen_info);
if (GetMethod ("GetType") == null && GetMethod ("GetGType") == null) {
sw.WriteLine ("\t\tprivate static GLib.GType GType {");
sw.WriteLine ("\t\t\tget { return GLib.GType.Pointer; }");
sw.WriteLine ("\t\t}");
}
sw.WriteLine ("#endregion");
AppendCustom (sw, gen_info.CustomDir);
sw.WriteLine ("\t}");
sw.WriteLine ("}");
sw.Close ();
gen_info.Writer = null;
Statistics.StructCount++;
}
}

View file

@ -46,13 +46,11 @@ namespace GLib {
return GType.UInt;
if (type.IsSubclassOf (typeof (GLib.Object)))
return GType.Object;
PropertyInfo pi = type.GetProperty ("GType", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
PropertyInfo pi = type.GetProperty ("GType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.FlattenHierarchy);
if (pi != null)
return (GType) pi.GetValue (null, null);
if (type.IsSubclassOf (typeof (GLib.Opaque)))
return GType.Pointer;
if (type.IsValueType)
return GType.Pointer;
return ManagedValue.GType;
}