mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2025-05-02 08:56:33 +00:00
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:
parent
6300effd3a
commit
3ff334d0cc
|
@ -72,6 +72,19 @@ namespace Gdk {
|
||||||
return !(r1 == r2);
|
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 ()
|
public override string ToString ()
|
||||||
{
|
{
|
||||||
return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y);
|
return String.Format ("{0}x{1}+{2}+{3}", Width, Height, X, Y);
|
||||||
|
|
Loading…
Reference in a new issue