diff --git a/gdk/Drawable.custom b/gdk/Drawable.custom index e35256f23..f67496750 100644 --- a/gdk/Drawable.custom +++ b/gdk/Drawable.custom @@ -26,3 +26,20 @@ 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 \ No newline at end of file diff --git a/gdk/Pixmap.custom b/gdk/Pixmap.custom new file mode 100644 index 000000000..4792cb15b --- /dev/null +++ b/gdk/Pixmap.custom @@ -0,0 +1,9 @@ +// +// Pixmap extensions +// + + public Pixmap (Gdk.Drawable drawable, int width, int height) + : this (drawable, width, height, -1) + { + } + diff --git a/gdk/Window.custom b/gdk/Window.custom index 59c802ad6..d1edb2898 100644 --- a/gdk/Window.custom +++ b/gdk/Window.custom @@ -52,3 +52,35 @@ } } + 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); + } + +#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 \ No newline at end of file