- o = result;
- for (y = 0; y < *h; y++)
- for (x = 0; x < *w; x++)
- {
- int color = xpm_image.data[(y * (*w)) + x];
- if (color < 0 || color > xpm_image.ncolors) abort();
- *o++ = grays[color];
- }
- return result;
- }
- else /* failed to read XPM -- fall through and try XBM */
-#endif /* HAVE_XPM */
- {
-#ifdef HAVE_XMU
- XImage *ximage = 0;
- int width, height, xh, yh;
- int x, y;
- unsigned char *result, *o;
- Pixmap bitmap =
- XmuLocateBitmapFile (DefaultScreenOfDisplay (display),
- bitmap_name, 0, 0, &width, &height, &xh, &yh);
- if (!bitmap)
- {
- fprintf(stderr, "%s: unable to load bitmap file %s\n",
- progname, bitmap_name);
- exit (1);
- }
- ximage = XGetImage (display, bitmap, 0, 0, width, height,
- 1L, XYPixmap);
- XFreePixmap (display, bitmap);
+static void *
+xflame_init (Display *dpy, Window win)
+{
+ struct state *st = (struct state *) calloc (1, sizeof(*st));
+ st->dpy = dpy;
+ st->window = win;
+ st->baseline = get_integer_resource (dpy, "bitmapBaseline", "Integer");
+ st->delay = get_integer_resource (dpy, "delay", "Integer");
+ st->xim = NULL;
+ st->top = 1;
+ st->flame = NULL;
+
+ GetXInfo(st);
+ InitColors(st);
+ st->theim = loadBitmap(st);
+
+ MakeImage(st);
+ InitFlame(st);
+ FlameFill(st,0);
+
+ return st;
+}