+ if (!bitmap_name ||
+ !*bitmap_name ||
+ !strcmp(bitmap_name, "none"))
+ ;
+ else if (!strcmp(bitmap_name, "(default)")) /* use the builtin */
+ {
+ XImage *ximage;
+ unsigned char *result, *o;
+ char *bits = (char *) malloc (sizeof(bob_bits));
+ int x, y;
+ int scale = ((width > bob_width * 11) ? 2 : 1);
+
+ memcpy (bits, bob_bits, sizeof(bob_bits));
+ ximage = XCreateImage (display, visual, 1, XYBitmap, 0, bits,
+ bob_width, bob_height, 8, 0);
+ ximage->byte_order = LSBFirst;
+ ximage->bitmap_bit_order = LSBFirst;
+ *w = ximage->width * scale;
+ *h = ximage->height * scale;
+ o = result = (unsigned char *) malloc ((*w * scale) * (*h * scale));
+ for (y = 0; y < *h; y++)
+ for (x = 0; x < *w; x++)
+ *o++ = (XGetPixel(ximage, x/scale, y/scale) ? 255 : 0);
+
+ return result;
+ }
+ else /* load a bitmap file */