GtkSharp/gdk/Drawable.custom
Miguel de Icaza 2410790dbf Add helper rouintes
svn path=/trunk/gtk-sharp/; revision=24064
2004-03-15 20:13:30 +00:00

45 lines
No EOL
1.3 KiB
Text

// Gdk.Drawble.custom - Gdk Drawble class customizations
//
// Author: Pedro Abelleira Seco <pedroabelleira@yahoo.es>
//
// This code is inserted after the automatically generated code.
public void DrawRectangle(Gdk.GC gc, bool filled, Gdk.Rectangle area)
{
gdk_draw_rectangle(Handle, gc.Handle, filled, area.X, area.Y, area.Width, area.Height);
}
[DllImport("libgdk-win32-2.0-0.dll")]
static extern void gdk_draw_polygon(IntPtr raw, IntPtr gc, int filled, Gdk.Point[] points, int npoints);
public void DrawPolygon(Gdk.GC gc, int filled, Gdk.Point[] points)
{
gdk_draw_polygon(Handle, gc.Handle, filled, points, points.Length);
}
[DllImport("libgdk-win32-2.0-0.dll")]
static extern void gdk_draw_lines(IntPtr raw, IntPtr gc, Gdk.Point[] points, int npoints);
public void DrawLines(Gdk.GC gc, Gdk.Point[] points)
{
gdk_draw_lines(Handle, gc.Handle, points, points.Length);
}
[DllImport("libgdk-win32-2.0-0.dll")]
internal static extern IntPtr gdk_x11_drawable_get_xdisplay (IntPtr raw);
[DllImport("libgdk-win32-2.0-0.dll")]
internal static extern IntPtr gdk_x11_drawable_get_xid (IntPtr raw);
#if MANLY_ENOUGH_TO_INCLUDE
public virtual Cairo.Graphics CairoGraphics ()
{
Cairo.Graphics o = new Cairo.Graphics ();
IntPtr display = gdk_x11_drawable_get_xdisplay (Handle);
o.SetTargetDrawable (display, gdk_x11_drawable_get_xid (Handle));
return o;
}
#endif