-/* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@mcom.com>
+/* xscreensaver, Copyright (c) 1992, 1996 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
+ *
+ * 19971004: Johannes Keukelaar <johannes@nada.kth.se>: Use helix screen
+ * eraser.
*/
#include "screenhack.h"
+#include "erase.h"
static GC draw_gc, erase_gc;
static unsigned int default_fg_pixel;
static int iterations, offset;
static Bool xsym, ysym;
+static int sleep_time;
static void
-init_rorschach (dpy, window)
- Display *dpy;
- Window window;
+init_rorschach (Display *dpy, Window window)
{
XGCValues gcv;
Colormap cmap;
}
static void
-hurm (dpy, window)
- Display *dpy;
- Window window;
+hurm (Display *dpy, Window window)
{
Colormap cmap;
XWindowAttributes xgwa;
XDrawPoints (dpy, window, draw_gc, points, j, CoordModeOrigin);
XSync (dpy, True);
}
- sleep (5);
- for (i = 0; i < (ylim >> 1); i++)
- {
- int y = (random () % ylim);
- XDrawLine (dpy, window, erase_gc, 0, y, xlim, y);
- XFlush (dpy);
- if ((i % 50) == 0)
- usleep (10000);
- }
+ sleep ( sleep_time );
+
+ erase_full_window(dpy, window);
+
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XSync (dpy, True);
char *progclass = "Rorschach";
char *defaults [] = {
- "Rorschach.background: black", /* to placate SGI */
- "Rorschach.foreground: white",
+ ".background: black",
+ ".foreground: white",
"*xsymmetry: true",
"*ysymmetry: false",
"*iterations: 4000",
"*offset: 4",
+ "*delay: 5",
0
};
{ "-iterations", ".iterations", XrmoptionSepArg, 0 },
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
- { "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" }
+ { "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" },
+ { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
};
-int options_size = (sizeof (options) / sizeof (options[0]));
void
-screenhack (dpy, window)
- Display *dpy;
- Window window;
+screenhack (Display *dpy, Window window)
{
+ sleep_time = get_integer_resource("delay", "Integer");
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);