Re: [gtk-list] gdk_draw_pixmap, bitmaps, and XCopyPlane

Gary Wong <gary@CS.Arizona.EDU> writes:

> Hi,
>   I'm an old Xlib programmer starting out with GTK+.  I'm porting some
> old code of mine and have run into trouble with bitmap manipulation
> code -- I don't seem to be able to find a GDK equivalent to
> XCopyPlane().  gdk_draw_pixmap (i.e. gdk_draw_drawable) will do the
> job in some circumstances, but I can't find anything capable of
> copying between drawables of differing depths.  If I include <gdk/gdkx.h>
> I can call XCopyPlane myself, of course, but that's fairly ugly.
>   What I would like is this function:
> void
> gdk_draw_bitplane (GdkDrawable *drawable,
>                    GdkGC       *gc,
>                    GdkDrawable *src,
>                    gint         xsrc,
>                    gint         ysrc,
>                    gint         xdest,
>                    gint         ydest,
>                    gint         width,
>                    gint         height,
>                    gulong       plane)
> gdk_draw_bitplane would be to XCopyPlane what gdk_draw_pixmap
> (gdk_draw_drawable) is to XCopyArea.  I'm happy to write a patch and
> documentation for this function if necessary, but I'd appreciate advice
> from a GDK guru first.

For GTK+-1.4, gdk_draw_pixmap() has been renamed to gdk_draw_drawable()
and automatically uses XCopyPlane when the source is a bitmap.

(We aren't going to support using XCopyPlane() when the source is not
a bitmap; this isn't useful on TrueColor displays, which by now are a large
majority of the displays out there.)

For now (GTK+-1.2), you probably should just call XCopyPlane()
directly as you say.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]