+ splash_dialog_data *sp = si->sp_data;
+ XGCValues gcv;
+ GC gc1, gc2;
+ int hspacing, vspacing, height;
+ int x1, x2, x3, y1, y2;
+ int sw;
+
+#ifdef PREFS_BUTTON
+ int nbuttons = 3;
+#else /* !PREFS_BUTTON */
+ int nbuttons = 2;
+#endif /* !PREFS_BUTTON */
+
+ height = (sp->heading_font->ascent + sp->heading_font->descent +
+ sp->body_font->ascent + sp->body_font->descent +
+ sp->body_font->ascent + sp->body_font->descent +
+ sp->button_font->ascent + sp->button_font->descent);
+ vspacing = ((sp->height
+ - (4 * sp->shadow_width)
+ - (2 * sp->internal_border)
+ - height) / 5);
+ if (vspacing < 0) vspacing = 0;
+ if (vspacing > (sp->heading_font->ascent * 2))
+ vspacing = (sp->heading_font->ascent * 2);
+
+ gcv.foreground = sp->foreground;
+ gc1 = XCreateGC (si->dpy, si->splash_dialog, GCForeground, &gcv);
+ gc2 = XCreateGC (si->dpy, si->splash_dialog, GCForeground, &gcv);
+ x1 = sp->logo_width;
+ x3 = sp->width - (sp->shadow_width * 2);
+ y1 = sp->internal_border;
+
+ /* top heading
+ */
+ XSetFont (si->dpy, gc1, sp->heading_font->fid);
+ sw = string_width (sp->heading_font, sp->heading_label);
+ x2 = (x1 + ((x3 - x1 - sw) / 2));
+ y1 += sp->heading_font->ascent;
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y1,
+ sp->heading_label, strlen(sp->heading_label));
+ y1 += sp->heading_font->descent;
+
+ /* text below top heading
+ */
+ XSetFont (si->dpy, gc1, sp->body_font->fid);
+ y1 += vspacing + sp->body_font->ascent;
+ sw = string_width (sp->body_font, sp->body_label);
+ x2 = (x1 + ((x3 - x1 - sw) / 2));
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y1,
+ sp->body_label, strlen(sp->body_label));
+ y1 += sp->body_font->descent;
+
+ y1 += sp->body_font->ascent;
+ sw = string_width (sp->body_font, sp->body2_label);
+ x2 = (x1 + ((x3 - x1 - sw) / 2));
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y1,
+ sp->body2_label, strlen(sp->body2_label));
+ y1 += sp->body_font->descent;
+
+ /* The buttons
+ */
+ XSetForeground (si->dpy, gc1, sp->button_foreground);
+ XSetForeground (si->dpy, gc2, sp->button_background);
+
+/* y1 += (vspacing * 2);*/
+ y1 = sp->height - sp->internal_border - sp->button_height;
+
+ x1 += sp->internal_border;
+ y2 = (y1 + ((sp->button_height -
+ (sp->button_font->ascent + sp->button_font->descent))
+ / 2)
+ + sp->button_font->ascent);
+ hspacing = ((sp->width - x1 - (sp->shadow_width * 2) -
+ sp->internal_border - (sp->button_width * nbuttons))
+ / 2);
+
+ x2 = x1 + ((sp->button_width - string_width(sp->button_font, sp->demo_label))
+ / 2);
+ XFillRectangle (si->dpy, si->splash_dialog, gc2, x1, y1,
+ sp->button_width, sp->button_height);
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y2,
+ sp->demo_label, strlen(sp->demo_label));
+ sp->demo_button_x = x1;
+ sp->demo_button_y = y1;
+
+#ifdef PREFS_BUTTON
+ x1 += hspacing + sp->button_width;
+ x2 = x1 + ((sp->button_width - string_width(sp->button_font,sp->prefs_label))
+ / 2);
+ XFillRectangle (si->dpy, si->splash_dialog, gc2, x1, y1,
+ sp->button_width, sp->button_height);
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y2,
+ sp->prefs_label, strlen(sp->prefs_label));
+ sp->prefs_button_x = x1;
+ sp->prefs_button_y = y1;
+#endif /* PREFS_BUTTON */
+
+#ifdef PREFS_BUTTON
+ x1 += hspacing + sp->button_width;
+#else /* !PREFS_BUTTON */
+ x1 = (sp->width - sp->button_width -
+ sp->internal_border - (sp->shadow_width * 2));
+#endif /* !PREFS_BUTTON */
+
+ x2 = x1 + ((sp->button_width - string_width(sp->button_font,sp->help_label))
+ / 2);
+ XFillRectangle (si->dpy, si->splash_dialog, gc2, x1, y1,
+ sp->button_width, sp->button_height);
+ XDrawString (si->dpy, si->splash_dialog, gc1, x2, y2,
+ sp->help_label, strlen(sp->help_label));
+ sp->help_button_x = x1;
+ sp->help_button_y = y1;
+
+
+ /* The logo
+ */
+ x1 = sp->shadow_width * 6;
+ y1 = sp->shadow_width * 6;
+ x2 = sp->logo_width - (sp->shadow_width * 12);
+ y2 = sp->logo_height - (sp->shadow_width * 12);
+
+ if (sp->logo_pixmap)
+ {
+ Window root;
+ int x, y;
+ unsigned int w, h, bw, d;
+ XGetGeometry (si->dpy, sp->logo_pixmap, &root, &x, &y, &w, &h, &bw, &d);
+ XSetForeground (si->dpy, gc1, sp->foreground);
+ XSetBackground (si->dpy, gc1, sp->background);
+ if (d == 1)
+ XCopyPlane (si->dpy, sp->logo_pixmap, si->splash_dialog, gc1,
+ 0, 0, w, h,
+ x1 + ((x2 - (int)w) / 2),
+ y1 + ((y2 - (int)h) / 2),
+ 1);
+ else
+ XCopyArea (si->dpy, sp->logo_pixmap, si->splash_dialog, gc1,
+ 0, 0, w, h,
+ x1 + ((x2 - (int)w) / 2),
+ y1 + ((y2 - (int)h) / 2));
+ }
+
+ /* Solid border inside the logo box. */
+#if 0
+ XSetForeground (si->dpy, gc1, sp->foreground);
+ XDrawRectangle (si->dpy, si->splash_dialog, gc1, x1, y1, x2-1, y2-1);
+#endif
+
+ /* The shadow around the logo
+ */
+ draw_shaded_rectangle (si->dpy, si->splash_dialog,
+ sp->shadow_width * 4,
+ sp->shadow_width * 4,
+ sp->logo_width - (sp->shadow_width * 8),
+ sp->logo_height - (sp->shadow_width * 8),
+ sp->shadow_width,
+ sp->shadow_bottom, sp->shadow_top);
+
+ /* The shadow around the whole window
+ */
+ draw_shaded_rectangle (si->dpy, si->splash_dialog,
+ 0, 0, sp->width, sp->height, sp->shadow_width,
+ sp->shadow_top, sp->shadow_bottom);
+
+ XFreeGC (si->dpy, gc1);
+ XFreeGC (si->dpy, gc2);
+
+ update_splash_window (si);