2004-02-17 Radek Doulik <rodo@ximian.com>
* glib/Value.cs: use g_value_set_pointer for GType.Pointer/IWrapper objects * glib/TypeConverter.cs: return GType.Pointer for Opaque objects which do not have GType property svn path=/trunk/gtk-sharp/; revision=23197
This commit is contained in:
parent
d8fa643aca
commit
21ddf92108
3 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2004-02-17 Radek Doulik <rodo@ximian.com>
|
||||||
|
|
||||||
|
* glib/Value.cs: use g_value_set_pointer for
|
||||||
|
GType.Pointer/IWrapper objects
|
||||||
|
|
||||||
|
* glib/TypeConverter.cs: return GType.Pointer for Opaque objects
|
||||||
|
which do not have GType property
|
||||||
|
|
||||||
2004-02-17 John Luke <jluke@cfl.rr.com>
|
2004-02-17 John Luke <jluke@cfl.rr.com>
|
||||||
|
|
||||||
* gdk/Gdk.metadata: set Gdk.Window.Cursor null_ok
|
* gdk/Gdk.metadata: set Gdk.Window.Cursor null_ok
|
||||||
|
|
|
@ -42,6 +42,8 @@ namespace GLibSharp {
|
||||||
PropertyInfo pi = type.GetProperty ("GType", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
PropertyInfo pi = type.GetProperty ("GType", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
|
||||||
if (pi != null)
|
if (pi != null)
|
||||||
return (GType) pi.GetValue (null, null);
|
return (GType) pi.GetValue (null, null);
|
||||||
|
if (type.IsSubclassOf (typeof (GLib.Opaque)))
|
||||||
|
return GType.Pointer;
|
||||||
if (type.IsValueType)
|
if (type.IsValueType)
|
||||||
return GType.Pointer;
|
return GType.Pointer;
|
||||||
|
|
||||||
|
|
|
@ -392,6 +392,10 @@ namespace GLib {
|
||||||
else if (type == GType.Object)
|
else if (type == GType.Object)
|
||||||
g_value_set_object (_val, ((GLib.Object) obj).Handle);
|
g_value_set_object (_val, ((GLib.Object) obj).Handle);
|
||||||
else if (type == GType.Pointer) {
|
else if (type == GType.Pointer) {
|
||||||
|
if (obj is IWrapper) {
|
||||||
|
g_value_set_pointer (_val, ((IWrapper)obj).Handle);
|
||||||
|
return;
|
||||||
|
}
|
||||||
buf = Marshal.AllocHGlobal (Marshal.SizeOf (obj.GetType()));
|
buf = Marshal.AllocHGlobal (Marshal.SizeOf (obj.GetType()));
|
||||||
Marshal.StructureToPtr (obj, buf, false);
|
Marshal.StructureToPtr (obj, buf, false);
|
||||||
g_value_set_pointer (_val, buf);
|
g_value_set_pointer (_val, buf);
|
||||||
|
|
Loading…
Reference in a new issue