-
-
- XpmAttributes xpmattrs;
- int result;
- xpmattrs.valuemask = 0;
-
-# ifdef XpmCloseness
- xpmattrs.valuemask |= XpmCloseness;
- xpmattrs.closeness = 40000;
-# endif
-# ifdef XpmVisual
- xpmattrs.valuemask |= XpmVisual;
- xpmattrs.visual = state->xgwa.visual;
-# endif
-# ifdef XpmDepth
- xpmattrs.valuemask |= XpmDepth;
- xpmattrs.depth = state->xgwa.depth;
-# endif
-# ifdef XpmColormap
- xpmattrs.valuemask |= XpmColormap;
- xpmattrs.colormap = state->xgwa.colormap;
-# endif
-
- result = XpmCreatePixmapFromData (state->dpy, state->window,
- (which == 0 ? (state->small_p ? matrix0b_xpm : matrix0_xpm) :
- which == 1 ? (state->small_p ? matrix1b_xpm : matrix1_xpm) :
- (state->small_p ? matrix2b_xpm : matrix2_xpm)),
- &state->images[which], 0 /* mask */,
- &xpmattrs);
- if (!state->images || (result != XpmSuccess && result != XpmColorError))
- state->images[which] = 0;
-
- state->image_width = xpmattrs.width;
- state->image_height = xpmattrs.height;
+ char **bits =
+ (which == 0 ? (state->small_p ? matrix0b_xpm : matrix0_xpm) :
+ which == 1 ? (state->small_p ? matrix1b_xpm : matrix1_xpm) :
+ (state->small_p ? matrix2b_xpm : matrix2_xpm));
+
+ state->images[which] =
+ xpm_data_to_pixmap (state->dpy, state->window, bits,
+ &state->image_width, &state->image_height, 0);