- XWindowAttributes xgwa;
- XpmAttributes xpmattrs;
- Pixmap pixmap = 0;
- int result;
- xpmattrs.valuemask = 0;
-
- XGetWindowAttributes (dpy, window, &xgwa);
-
-# ifdef XpmCloseness
- xpmattrs.valuemask |= XpmCloseness;
- xpmattrs.closeness = 40000;
-# endif
-# ifdef XpmVisual
- xpmattrs.valuemask |= XpmVisual;
- xpmattrs.visual = xgwa.visual;
-# endif
-# ifdef XpmDepth
- xpmattrs.valuemask |= XpmDepth;
- xpmattrs.depth = xgwa.depth;
-# endif
-# ifdef XpmColormap
- xpmattrs.valuemask |= XpmColormap;
- xpmattrs.colormap = xgwa.colormap;
-# endif
-
- result = XpmCreatePixmapFromData(dpy, window, bits[i],
- &pixmap, 0 /* mask */, &xpmattrs);
- if (!pixmap || (result != XpmSuccess && result != XpmColorError))
+ Pixmap pixmap = xpm_data_to_pixmap (dpy, window, bits[i],
+ 0, 0, 0);
+ if (!pixmap)