+ int xh, yh;
+ Pixmap b2;
+ bitmap = XmuLocateBitmapFile (DefaultScreenOfDisplay (dpy), bitmap_name,
+ 0, 0, widthP, heightP, &xh, &yh);
+ if (! bitmap)
+ {
+ fprintf (stderr, "%s: couldn't find bitmap %s\n", progname,
+ bitmap_name);
+ exit (1);
+ }
+ b2 = XmuCreatePixmapFromBitmap (dpy, window, bitmap, *widthP, *heightP,
+ depth, fg, bg);
+ XFreePixmap (dpy, bitmap);
+ bitmap = b2;
+ }
+}
+
+static void
+init ()
+{
+ XWindowAttributes xgwa;
+ Colormap cmap;
+ XGCValues gcv;
+ int width, height;
+ unsigned int real_size;
+ char *bitmap_name;
+ int i;
+
+ XGetWindowAttributes (dpy, window, &xgwa);
+ cmap = xgwa.colormap;
+ depth = xgwa.depth;
+
+ fg = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+ bg = get_pixel_resource ("background", "Background", dpy, cmap);
+ delay = get_integer_resource ("delay", "Integer");
+ delay2 = get_integer_resource ("delay2", "Integer");
+ if (delay < 0) delay = 0;
+ if (delay2 < 0) delay2 = 0;
+ bitmap_name = get_string_resource ("bitmap", "Bitmap");
+ if (! bitmap_name || !*bitmap_name)
+ bitmap_name = "(default)";
+
+ if (!strcmp (bitmap_name, "(default)"))
+ {
+ width = logo_width;
+ height = logo_height;
+ bitmap = XCreatePixmapFromBitmapData (dpy, window, (char *) logo_bits,
+ width, height, fg, bg, depth);
+ }
+ else
+ {
+ read_bitmap (bitmap_name, &width, &height);