** for xlock 2.3 and xscreensaver 1.2, 28AUG92
**
**
+** Modified for xlockmore 3.0 by Anthony Thyssen <anthony@cit.gu.edu.au>
+** on August 1995.
+**
** To use, just copy the appropriate file from xlock, add a target
** for it in the Imakefile, and do the following:
**
static int batchcount;
static unsigned int delay;
+static unsigned int cycles;
static double saturation;
+#ifndef min
+#define min(a,b) ((a)<(b)?(a):(b))
+#endif
+
typedef struct {
GC gc;
int npixels;
bg_pixel = get_pixel_resource ("background", "Background", dpy, cmap);
if (! mono_p) {
for (npixels = 0; npixels < i; npixels++) {
- hsv_to_rgb ((360*npixels)/i, saturation, 1.0, &color.red, &color.green, &color.blue);
+ hsv_to_rgb ((360*npixels)/i, saturation, 1.0,
+ &color.red, &color.green, &color.blue);
if (! XAllocColor (dpy, cmap, &color))
break;
pixels[npixels] = color.pixel;
n = get_integer_resource ("count", "Integer");
if (n > 0) batchcount = n;
+ n = get_integer_resource ("cycles", "Integer");
+ if (n >= 0) cycles = n;
+
gcv.foreground = fg_pixel;
gcv.background = bg_pixel;
gc = XCreateGC (dpy, win, GCForeground|GCBackground, &gcv);
"*foreground: white",
"*ncolors: 64",
"*delay: -1",
+ "*count: -1",
+ "*cycles: -1",
0
};
{"-count", ".count", XrmoptionSepArg, 0},
{"-ncolors", ".ncolors", XrmoptionSepArg, 0},
{"-delay", ".delay", XrmoptionSepArg, 0},
+ {"-cycles", ".cycles", XrmoptionSepArg, 0},
};
int options_size = (sizeof (options) / sizeof (options[0]));
-#define PROGRAM(Y,Z,D,B,S) \
+#define PROGRAM(Y,Z,D,B,C,S) \
char *progclass = Y; \
\
void screenhack (dpy, window) \
{ \
batchcount = B; \
delay = D; \
+ cycles = C; \
saturation = S; \
dsp = dpy; \
\
+ init##Z (window); \
while (1) { \
- init##Z (window); \
- for (;;) { \
- draw##Z (window); \
- XSync (dpy, True); \
- if (delay) usleep (delay); \
- } \
+ draw##Z (window); \
+ XSync (dpy, True); \
+ if (delay) usleep (delay); \
} \
}