- bl->xpmattrs.valuemask = 0;
-
-#ifdef XpmCloseness
- bl->xpmattrs.valuemask |= XpmCloseness;
- bl->xpmattrs.closeness = 40000;
-#endif
-#ifdef XpmVisual
- bl->xpmattrs.valuemask |= XpmVisual;
- bl->xpmattrs.visual = defvisual;
-#endif
-#ifdef XpmDepth
- bl->xpmattrs.valuemask |= XpmDepth;
- bl->xpmattrs.depth = screen_depth;
-#endif
-#ifdef XpmColormap
- bl->xpmattrs.valuemask |= XpmColormap;
- bl->xpmattrs.colormap = defcmap;
-#endif
-
-
- /* This is the only line which is different from make_pixmap_from_file() */
- result = XpmCreatePixmapFromData(defdsp, defwin, pixmap_data, &bl->ball,
- &bl->shape_mask, &bl->xpmattrs);
-
- switch(result) {
- case XpmColorError:
- fprintf(stderr, "xpm: color substitution performed\n");
- /* fall through */
- case XpmSuccess:
- bl->radius = MAX(bl->xpmattrs.width, bl->xpmattrs.height) / 2;
- bl->area = calc_bubble_area(bl->radius);
- break;
- case XpmColorFailed:
- fprintf(stderr, "xpm: color allocation failed\n");
- exit(1);
- case XpmNoMemory:
- fprintf(stderr, "xpm: out of memory\n");
- exit(1);
- default:
- fprintf(stderr, "xpm: unknown error code %d\n", result);
- exit(1);
+#ifdef FANCY_BUBBLES
+ {
+ int w, h;
+ bl->ball = xpm_data_to_pixmap (st->dpy, st->window, (char **) pixmap_data,
+ &w, &h, &bl->shape_mask);
+ bl->radius = MAX(w, h) / 2;
+ bl->area = calc_bubble_area(st, bl->radius);