+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, &st->theimx, &st->theimy);
+
+ /* utils/xshm.c doesn't provide a way to free the shared-memory image, which
+ makes it hard for us to react to window resizing. So, punt for now. The
+ size of the window at startup is the size it will stay.
+ */
+ GetXInfo(st);
+
+ MakeImage(st);
+ InitFlame(st);
+ FlameFill(st,0);
+
+ return st;
+}
+
+static unsigned long
+xflame_draw (Display *dpy, Window win, void *closure)
+{
+ struct state *st = (struct state *) closure;
+ FlameActive(st);
+
+ if (st->theim)
+ FlamePasteData(st, st->theim, (st->fwidth - st->theimx) / 2,
+ st->fheight - st->theimy - st->baseline, st->theimx, st->theimy);
+
+ FlameAdvance(st);
+ Flame2Image(st);
+ DisplayImage(st);
+
+ return st->delay;
+}
+
+static void
+xflame_reshape (Display *dpy, Window window, void *closure,
+ unsigned int w, unsigned int h)
+{
+}
+
+static Bool
+xflame_event (Display *dpy, Window window, void *closure, XEvent *event)
+{
+ return False;
+}
+
+static void
+xflame_free (Display *dpy, Window window, void *closure)
+{
+}
+