GtkSharp/gdk/Window.custom
Todd Berman 9698c4d2f9 2004-06-07 Todd Berman <tberman@sevenl.net>
* gtk/Widget.custom: expose some easy bool properties for checking
        certain WidgetFlags. Make Allocation a settable property.
        * gtk/glue/widget.c: bit of glue to make Allocation settable.
        * gdk/Window.custom: expose UserData as a usable IntPtr property.
        * gdk/Gdk.metadata: hide old GetUserData/SetUserData methods.
        * doc/*: ran the updater.

svn path=/trunk/gtk-sharp/; revision=28974
2004-06-07 17:14:35 +00:00

102 lines
2.7 KiB
Text

// Gdk.Window.custom - Gdk Window class customizations
//
// Author: Moritz Balz <ich@mbalz.de>
// Mike Kestner <mkestner@ximian.com>
//
// (c) 2003 Moritz Balz
// (c) 2004 Novell, Inc.
//
// This code is inserted after the automatically generated code.
[DllImport("libgdk-win32-2.0-0.dll")]
static extern IntPtr gdk_window_get_children(IntPtr raw);
public Window[] Children {
get {
IntPtr raw_ret = gdk_window_get_children(Handle);
if (raw_ret == IntPtr.Zero)
return new Window [0];
GLib.List list = new GLib.List(raw_ret);
Window[] result = new Window [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Window;
return result;
}
}
[DllImport("libgdk-win32-2.0-0.dll")]
static extern void gdk_window_set_icon_list(IntPtr raw, IntPtr pixbufs);
public Pixbuf[] IconList {
set {
GLib.List list = new GLib.List(IntPtr.Zero);
foreach (Pixbuf val in value)
list.Append (val.Handle);
gdk_window_set_icon_list(Handle, list.Handle);
}
}
[DllImport("libgdk-win32-2.0-0.dll")]
static extern IntPtr gdk_window_get_toplevels();
public static Window[] Toplevels {
get {
IntPtr raw_ret = gdk_window_get_toplevels();
if (raw_ret == IntPtr.Zero)
return new Window [0];
GLib.List list = new GLib.List(raw_ret);
Window[] result = new Window [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = list [i] as Window;
return result;
}
}
public void MoveResize (Gdk.Rectangle rect) {
gdk_window_move_resize (Handle, rect.X, rect.Y, rect.Width, rect.Height);
}
public void ClearArea (Gdk.Rectangle rect, bool expose) {
if (expose)
gdk_window_clear_area_e (Handle, rect.X, rect.Y, rect.Width, rect.Height);
else
gdk_window_clear_area (Handle, rect.X, rect.Y, rect.Width, rect.Height);
}
[DllImport ("libgdk-win32-2.0-0.dll")]
static extern void gdk_window_get_user_data (IntPtr raw, out IntPtr data);
[DllImport("libgdk-win32-2.0-0.dll")]
static extern void gdk_window_set_user_data(IntPtr raw, IntPtr user_data);
public IntPtr UserData {
get {
IntPtr data;
gdk_window_get_user_data (Handle, out data);
return data;
}
set {
gdk_window_set_user_data(Handle, value);
}
}
#if MANLY_ENOUGH_TO_INCLUDE
public Cairo.Graphics CairoGraphics (out int offset_x, out int offset_y)
{
IntPtr real_drawable;
Cairo.Graphics o = new Cairo.Graphics ();
gdk_window_get_internal_paint_info (Handle, out real_drawable, out offset_x, out offset_y);
IntPtr x11 = gdk_x11_drawable_get_xid (real_drawable);
IntPtr display = gdk_x11_drawable_get_xdisplay (real_drawable);
o.SetTargetDrawable (display, x11);
return o;
}
public override Cairo.Graphics CairoGraphics ()
{
int x, y;
return CairoGraphics (out x, out y);
}
#endif