+static struct bsod_state *
+atm (Display *dpy, Window window)
+{
+ struct bsod_state *bst = make_bsod_state (dpy, window, "atm", "ATM");
+
+ Pixmap pixmap = 0;
+ int pix_w = atm_width;
+ int pix_h = atm_height;
+ int x, y, i = 0;
+ float scale = 0.48;
+
+ XClearWindow (dpy, window);
+
+ pixmap = XCreatePixmapFromBitmapData (dpy, window, (char *) atm_bits,
+ atm_width, atm_height,
+ bst->fg, bst->bg, bst->xgwa.depth);
+
+ while (pix_w <= bst->xgwa.width * scale &&
+ pix_h <= bst->xgwa.height * scale)
+ {
+ pixmap = double_pixmap (dpy, bst->gc, bst->xgwa.visual, bst->xgwa.depth,
+ pixmap, pix_w, pix_h);
+ pix_w *= 2;
+ pix_h *= 2;
+ i++;
+ }
+
+ x = (bst->xgwa.width - pix_w) / 2;
+ y = (bst->xgwa.height - pix_h) / 2;
+ if (y < 0) y = 0;
+
+ if (i > 0)
+ {
+ int j;
+ XSetForeground (dpy, bst->gc,
+ get_pixel_resource (dpy, bst->xgwa.colormap,
+ "atm.background",
+ "ATM.Background"));
+ for (j = -1; j < pix_w; j += i+1)
+ XDrawLine (bst->dpy, pixmap, bst->gc, j, 0, j, pix_h);
+ for (j = -1; j < pix_h; j += i+1)
+ XDrawLine (bst->dpy, pixmap, bst->gc, 0, j, pix_w, j);
+ }
+
+ XCopyArea (dpy, pixmap, window, bst->gc, 0, 0, pix_w, pix_h, x, y);
+
+ XFreePixmap (dpy, pixmap);
+
+ return bst;
+}
+
+