+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_lines (drawable, gc, points, npoints);
+}
+
+void
+gdk_draw_glyphs (GdkDrawable *drawable,
+ GdkGC *gc,
+ PangoFont *font,
+ gint x,
+ gint y,
+ PangoGlyphString *glyphs)
+{
+ g_return_if_fail (GDK_IS_DRAWABLE (drawable));
+ g_return_if_fail (GDK_IS_GC (gc));
+
+
+ GDK_DRAWABLE_GET_CLASS (drawable)->draw_glyphs (drawable, gc, font, x, y, glyphs);
+}
+
+
+/**
+ * gdk_drawable_get_image:
+ * @drawable: a #GdkDrawable
+ * @x: x coordinate on @drawable
+ * @y: y coordinate on @drawable
+ * @width: width of region to get
+ * @height: height or region to get
+ *
+ * A #GdkImage stores client-side image data (pixels). In contrast,
+ * #GdkPixmap and #GdkWindow are server-side
+ * objects. gdk_drawable_get_image() obtains the pixels from a
+ * server-side drawable as a client-side #GdkImage. The format of a
+ * #GdkImage depends on the #GdkVisual of the current display, which
+ * makes manipulating #GdkImage extremely difficult; therefore, in
+ * most cases you should use gdk_pixbuf_get_from_drawable() instead of
+ * this lower-level function. A #GdkPixbuf contains image data in a
+ * canonicalized RGB format, rather than a display-dependent format.
+ * Of course, there's a convenience vs. speed tradeoff here, so you'll
+ * want to think about what makes sense for your application.
+ *
+ * @x, @y, @width, and @height define the region of @drawable to
+ * obtain as an image.
+ *
+ * You would usually copy image data to the client side if you intend
+ * to examine the values of individual pixels, for example to darken
+ * an image or add a red tint. It would be prohibitively slow to
+ * make a round-trip request to the windowing system for each pixel,
+ * so instead you get all of them at once, modify them, then copy
+ * them all back at once.
+ *
+ * If the X server or other windowing system backend is on the local
+ * machine, this function may use shared memory to avoid copying
+ * the image data.
+ *
+ * Return value: a #GdkImage containing the contents of @drawable
+ **/
+GdkImage*
+gdk_drawable_get_image (GdkDrawable *drawable,
+ gint x,
+ gint y,
+ gint width,
+ gint height)
+{
+ GdkDrawable *composite;
+ gint composite_x_offset = 0;
+ gint composite_y_offset = 0;
+ GdkImage *retval;
+
+ g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
+ g_return_val_if_fail (x >= 0, NULL);
+ g_return_val_if_fail (y >= 0, NULL);
+
+ /* FIXME? Note race condition since we get the size then
+ * get the image, and the size may have changed.
+ */
+
+ if (width < 0 || height < 0)
+ gdk_drawable_get_size (drawable,
+ width < 0 ? &width : NULL,
+ height < 0 ? &height : NULL);
+
+ composite =
+ GDK_DRAWABLE_GET_CLASS (drawable)->get_composite_drawable (drawable,
+ x, y,
+ width, height,
+ &composite_x_offset,
+ &composite_y_offset);
+
+ retval = GDK_DRAWABLE_GET_CLASS (composite)->get_image (composite,
+ x - composite_x_offset,
+ y - composite_y_offset,
+ width, height);
+
+ g_object_unref (G_OBJECT (composite));
+
+ return retval;
+}
+
+static GdkDrawable*
+gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
+ gint x,
+ gint y,
+ gint width,
+ gint height,
+ gint *composite_x_offset,
+ gint *composite_y_offset)
+{
+ g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
+
+ *composite_x_offset = 0;
+ *composite_y_offset = 0;
+
+ return GDK_DRAWABLE (g_object_ref (G_OBJECT (drawable)));
+}
+
+/**
+ * gdk_drawable_get_clip_region:
+ * @drawable: a #GdkDrawable
+ *
+ * Computes the region of a drawable that potentially can be written
+ * to by drawing primitives. This region will not take into account
+ * the clip region for the GC, and may also not take into account
+ * other factors such as if the window is obscured by other windows,
+ * but no area outside of this region will be affected by drawing
+ * primitives.
+ *
+ * Return value: a #GdkRegion. This must be freed with gdk_region_destroy()
+ * when you are done.
+ **/
+GdkRegion *
+gdk_drawable_get_clip_region (GdkDrawable *drawable)
+{
+ g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
+
+ return GDK_DRAWABLE_GET_CLASS (drawable)->get_clip_region (drawable);
+}
+
+/**
+ * gdk_drawable_get_visible_region:
+ * @drawable:
+ *
+ * Computes the region of a drawable that is potentially visible.
+ * This does not necessarily take into account if the window is
+ * obscured by other windows, but no area outside of this region
+ * is visible.
+ *
+ * Return value: a #GdkRegion. This must be freed with gdk_region_destroy()
+ * when you are done.
+ **/
+GdkRegion *
+gdk_drawable_get_visible_region (GdkDrawable *drawable)
+{
+ g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
+
+ return GDK_DRAWABLE_GET_CLASS (drawable)->get_visible_region (drawable);
+}
+
+static GdkRegion *
+gdk_drawable_real_get_visible_region (GdkDrawable *drawable)
+{
+ GdkRectangle rect;
+
+ rect.x = 0;
+ rect.y = 0;
+
+ gdk_drawable_get_size (drawable, &rect.width, &rect.height);