gdk: Add explicit conversion to and from GLib.Value for Rectangle

This allows the valtest sample to compile and work.
This commit is contained in:
Bertrand Lorentz 2011-06-18 16:16:41 +02:00
parent 6300effd3a
commit 3ff334d0cc

View file

@ -72,6 +72,19 @@ namespace Gdk {
return !(r1 == r2);
}
public static explicit operator GLib.Value (Gdk.Rectangle boxed)
{
GLib.Value val = GLib.Value.Empty;
val.Init (Gdk.Rectangle.GType);
val.Val = boxed;
return val;
}
public static explicit operator Gdk.Rectangle (GLib.Value val)
{
return (Gdk.Rectangle) val.Val;
}
public override string ToString ()
{
return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y);