mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-26 01:45:32 +00:00
23464e6514
[Equal credit to Ettore Perazzoli <ettore@ximian.com> for fixing all the bugs in the initial patch] * */*.custom : fix incorrect usage of new Object (IntPtr) where Glib.Object.GetObject should've been used. add ref_owned param to GetObject calls. * generator/CallbackGen.cs : setup ref_owned in bodies * generator/ClassBase.cs : add ref_owned to GetObject FromNative call * generator/Method.cs : setup ref_owned in bodies * generator/Property.cs : setup ref_owned in bodies * generator/SignalHandler.cs : pass ref_owned to GetObject * generator/StructBase.cs : setup ref_owned in bodies * glib/Object.cs : kill Ref/Unref methods. Don't want it to be easy for users to screw with ref counts, or make it look like they should need to. (GetObject): add ref_owned param and ref/unref to remain at 1 * glib/Value.cs : pass ref_owned to GetObject svn path=/trunk/gtk-sharp/; revision=16581
47 lines
1,011 B
Plaintext
47 lines
1,011 B
Plaintext
//
|
|
// Gtk.Widget.custom - Gtk Widget class customizations
|
|
//
|
|
// Author: Rachel Hestilow <hestilow@ximian.com>
|
|
//
|
|
// Copyright (C) 2002 Rachel Hestilow
|
|
//
|
|
// This code is inserted after the automatically generated code.
|
|
//
|
|
|
|
[DllImport("gtksharpglue")]
|
|
static extern IntPtr gtksharp_gtk_widget_get_allocation (IntPtr style);
|
|
|
|
public Gdk.Rectangle Allocation {
|
|
get { return Gdk.Rectangle.New (gtksharp_gtk_widget_get_allocation (Handle)); }
|
|
}
|
|
|
|
|
|
[DllImport ("gtksharpglue")]
|
|
static extern IntPtr gtksharp_gtk_widget_get_window (IntPtr widget);
|
|
public Gdk.Window GdkWindow {
|
|
get {
|
|
IntPtr raw_ret = gtksharp_gtk_widget_get_window (Handle);
|
|
|
|
if (raw_ret != (IntPtr) 0){
|
|
Gdk.Window ret = (Gdk.Window) GLib.Object.GetObject(raw_ret, false);
|
|
return ret;
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public System.Drawing.Size RequestSize {
|
|
get {
|
|
int x, y;
|
|
GetSizeRequest (out x, out y);
|
|
|
|
return new System.Drawing.Size (x, y);
|
|
}
|
|
set {
|
|
int x = value.Width;
|
|
int y = value.Height;
|
|
SetSizeRequest (x, y);
|
|
}
|
|
}
|
|
|