Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!ucla-cs!zen!ucbvax!unl::spa!psi From: psi@unl::spa (Salvador Pinto Abreu) Newsgroups: comp.windows.x Subject: xrload (part 6 of 6) Message-ID: <8708131105.AA04176@decwrl.dec.com> Date: Thu, 13-Aug-87 14:58:00 EDT Article-I.D.: decwrl.8708131105.AA04176 Posted: Thu Aug 13 14:58:00 1987 Date-Received: Sat, 15-Aug-87 08:27:23 EDT Sender: daemon@ucbvax.BERKELEY.EDU Distribution: world Organization: The ARPA Internet Lines: 244 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh init.c <<'END_OF_init.c' X/**************************************************************************/ X/* */ X/* Initialization */ X/* */ X/**************************************************************************/ X X#include "xrload.h" X Xvoid initialize (argc, argv) X int argc; X char *argv[]; X{ X register int i, nsys; X char *option, *display = NULL, *getenv(); X X if ((option = XGetDefault ("xrload", "SameScale")) != NULL) X same_scale = streq(option, "on"); X if ((option = XGetDefault ("xrload", "Columns")) != NULL) X ncols = atoi(option); X if ((option = XGetDefault ("xrload", "Delay")) != NULL) X delay = atoi(option); X if ((option = XGetDefault ("xrload", "ReverseVideo")) != NULL) X reverse = streq(option, "on"); X if ((option = XGetDefault ("xrload", "BodyFont")) != NULL) X font_name = option; X if ((option = XGetDefault ("xrload", "BorderWidth")) != NULL) X border_width = atoi(option); X if ((option = XGetDefault ("xrload", "Spacing")) != NULL) X dd = atoi(option); X X for (i=1; iid), X max_swidth); X X ww = max (back.width, max_swidth) + dd; X hh = back.height + dd + theFont->height; X rr = (ww-1)/2; X } X X minWidth = ncols * ww + (ncols+1) * dd; X minHeight = ((nsys+ncols-1)/ncols) * hh + ((nsys+ncols-1)/ncols) * dd; X X sprintf (defGeometry, "=%dx%d", minWidth, minHeight); X X if (reverse) { X whitePixmap = WhitePixmap; X blackPixmap = BlackPixmap; X whitePixel = WhitePixel; X blackPixel = BlackPixel; X } X else { X whitePixmap = BlackPixmap; X blackPixmap = WhitePixmap; X whitePixel = BlackPixel; X blackPixel = WhitePixel; X } X X frame.bdrwidth = border_width; X frame.border = whitePixmap; X frame.background = blackPixmap; X X mainWindow = XCreate ("Load Averages", argv[0], X geometry, defGeometry, &frame, minWidth, minHeight); X X XStoreName (mainWindow, "Load Averages"); X XSelectInput (mainWindow, ExposeWindow|UnmapWindow); X X bitmap = XStoreBitmap (gray1.width, gray1.height, gray1.bits); X GrayPixmap = XMakePixmap (bitmap, WhitePixel, BlackPixel); X XFreeBitmap (bitmap); X X XSetResizeHint (mainWindow, dd, 0, ww+dd, hh+dd); X XMapWindow (mainWindow); X} END_OF_init.c if test 5144 -ne `wc -c