220
207
!!strcmp(bitmap_name, "(default)"))
223
Window window = MI_WINDOW(mi);
224
XWindowAttributes xgwa;
225
XpmAttributes xpmattrs;
227
209
Pixmap bitmap = 0;
228
int width = 0, height = 0;
229
xpmattrs.valuemask = 0;
231
XGetWindowAttributes (dpy, window, &xgwa);
234
xpmattrs.valuemask |= XpmCloseness;
235
xpmattrs.closeness = 40000;
238
xpmattrs.valuemask |= XpmVisual;
239
xpmattrs.visual = xgwa.visual;
242
xpmattrs.valuemask |= XpmDepth;
243
xpmattrs.depth = xgwa.depth;
246
xpmattrs.valuemask |= XpmColormap;
247
xpmattrs.colormap = xgwa.colormap;
250
/* Uh, we don't need these now. We use the colors from the xpm.
251
It kinda sucks that we already allocated them. */
252
XFreeColors(dpy, xgwa.colormap, mi->pixels, mi->npixels, 0L);
254
result = XpmReadFileToPixmap (dpy, window, bitmap_name, &bitmap, 0,
259
fprintf (stderr, "%s: warning: xpm color substitution performed\n",
263
width = xpmattrs.width;
264
height = xpmattrs.height;
271
fprintf (stderr, "%s: xpm: color allocation failed\n", progname);
274
fprintf (stderr, "%s: xpm: out of memory\n", progname);
277
fprintf (stderr, "%s: xpm: unknown error code %d\n", progname,
213
bitmap = xpm_file_to_pixmap (dpy, MI_WINDOW (mi), bitmap_name,
284
217
fp->image = XGetImage(dpy, bitmap, 0, 0, width, height, ~0L,
286
219
XFreePixmap(dpy, bitmap);
289
#endif /* HAVE_XPM */
293
int width, height, xh, yh;
295
XmuLocateBitmapFile (DefaultScreenOfDisplay (dpy),
296
bitmap_name, 0, 0, &width, &height, &xh, &yh);
299
fprintf(stderr, "%s: unable to load bitmap file %s\n",
300
progname, bitmap_name);
303
fp->image = XGetImage(dpy, bitmap, 0, 0, width, height,
305
XFreePixmap(dpy, bitmap);
310
"%s: your vendor doesn't ship the standard Xmu library.\n",
312
fprintf (stderr, "\tWe can't load XBM files without it.\n");
317
222
else if (text && *text)