2009-04-21 Christian Hoff <christian_hoff@gmx.net>

* glib/Value.cs: Fixes for fundamental GType support. Patch
	provided by Sebastian Dröge.

svn path=/trunk/gtk-sharp/; revision=132225
This commit is contained in:
Christian Hoff 2009-04-21 08:16:57 +00:00
parent 37c1f46d17
commit 643a910cd6
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2009-04-21 Christian Hoff <christian_hoff@gmx.net>
* glib/Value.cs: Fixes for fundamental GType support. Patch
provided by Sebastian Dröge.
2009-04-21 Christian Hoff <christian_hoff@gmx.net>
* gtk/Widget.custom: Deglued implementation of StyleGetProperty.

View file

@ -346,7 +346,8 @@ namespace GLib {
while (ci == null && t != null) {
if (!t.IsAbstract)
ci = t.GetConstructor (new Type[] { typeof (GLib.Value) });
t = t.BaseType;
if (ci == null)
t = t.BaseType;
}
} catch (Exception) {
ci = null;
@ -364,10 +365,11 @@ namespace GLib {
try {
while (mi == null && t != null) {
mi = t.GetMethod ("SetGValue", new Type[] { typeof (GLib.Value) });
if (mi.IsAbstract)
mi = t.GetMethod ("SetGValue", new Type[] { Type.GetType ("GLib.Value&") });
if (mi != null && (mi.IsAbstract || mi.ReturnType != typeof (void)))
mi = null;
t = t.BaseType;
if (mi == null)
t = t.BaseType;
}
} catch (Exception) {
mi = null;
@ -376,7 +378,9 @@ namespace GLib {
if (mi == null)
throw new Exception ("Unknown type " + new GType (type).ToString ());
mi.Invoke (val, new object[] { this });
object[] parameters = new object[] { this };
mi.Invoke (val, parameters);
this = (GLib.Value) parameters[0];
}
object ToBoxed ()