From 3ff334d0cc60a9a76d4f00f20486bbe47693ef63 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Sat, 18 Jun 2011 16:16:41 +0200 Subject: [PATCH] gdk: Add explicit conversion to and from GLib.Value for Rectangle This allows the valtest sample to compile and work. --- gdk/Rectangle.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gdk/Rectangle.cs b/gdk/Rectangle.cs index d2b5511a0..deebb6852 100644 --- a/gdk/Rectangle.cs +++ b/gdk/Rectangle.cs @@ -71,6 +71,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 () {