- ximageinfo->pixmap_mask =
- XCreatePixmap(display, parent,
- ximageinfo->ximage->width,
- ximageinfo->ximage->height,
- 1);
-
- /* build and cache the GC */
-
- if (!ximageinfo->gc)
- {
- gcv.function = GXcopy;
- ximageinfo->gc =
- XCreateGC(ximageinfo->display, ximageinfo->pixmap,
- GCFunction, &gcv);
- }
-
- if (!ximageinfo->gc_mask)
- {
- gcv.function = GXcopy;
- gcv.foreground = ximageinfo->foreground;
- gcv.background = ximageinfo->background;
- ximageinfo->gc_mask =
- XCreateGC(ximageinfo->display, ximageinfo->pixmap_mask,
- GCFunction | GCForeground | GCBackground, &gcv);
- }
-
- XPutImage(ximageinfo->display, ximageinfo->pixmap, ximageinfo->gc,
- ximageinfo->ximage, 0, 0, 0, 0,
- ximageinfo->ximage->width, ximageinfo->ximage->height);
- XPutImage(ximageinfo->display, ximageinfo->pixmap_mask, ximageinfo->gc_mask,
- ximageinfo->ximage_mask, 0, 0, 0, 0,
- ximageinfo->ximage->width, ximageinfo->ximage->height);
-
- return (ximageinfo->pixmap != None && ximageinfo->pixmap_mask != None);