projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.05.tar.gz
[xscreensaver]
/
hacks
/
rorschach.c
diff --git
a/hacks/rorschach.c
b/hacks/rorschach.c
index eab1388743c82d4885cc38ed18309aa648ba7bdf..d9b0010ae85317239327d0bbbe7fd8c8ce009369 100644
(file)
--- a/
hacks/rorschach.c
+++ b/
hacks/rorschach.c
@@
-1,4
+1,5
@@
-/* xscreensaver, Copyright (c) 1992, 1996 Jamie Zawinski <jwz@netscape.com>
+/* xscreensaver, Copyright (c) 1992, 1996, 1998, 2001
+ * 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
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@
-7,14
+8,19
@@
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
* 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 "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 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 (Display *dpy, Window window)
static void
init_rorschach (Display *dpy, Window window)
@@
-87,20
+93,17
@@
hurm (Display *dpy, Window window)
j++;
}
XDrawPoints (dpy, window, draw_gc, points, j, CoordModeOrigin);
j++;
}
XDrawPoints (dpy, window, draw_gc, points, j, CoordModeOrigin);
- XSync (dpy, True);
- }
- sleep (5);
- for (i = 0; i < (ylim >> 1); i++)
- {
- y = (random () % ylim);
- XDrawLine (dpy, window, erase_gc, 0, y, xlim, y);
- XFlush (dpy);
- if ((i % 50) == 0)
- usleep (10000);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
}
}
+ sleep ( sleep_time );
+
+ erase_full_window(dpy, window);
+
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
- XSync (dpy, True);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
sleep (1);
}
sleep (1);
}
@@
-108,12
+111,13
@@
hurm (Display *dpy, Window window)
char *progclass = "Rorschach";
char *defaults [] = {
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",
"*xsymmetry: true",
"*ysymmetry: false",
"*iterations: 4000",
"*offset: 4",
+ "*delay: 5",
0
};
0
};
@@
-122,12
+126,17
@@
XrmOptionDescRec options [] = {
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
{ "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" },
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
{ "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" },
+ { "-no-xsymmetry", ".xsymmetry", XrmoptionNoArg, "false" },
+ { "-no-ysymmetry", ".ysymmetry", XrmoptionNoArg, "false" },
+ { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
{ 0, 0, 0, 0 }
};
void
screenhack (Display *dpy, Window window)
{
{ 0, 0, 0, 0 }
};
void
screenhack (Display *dpy, Window window)
{
+ sleep_time = get_integer_resource("delay", "Integer");
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);