goop - Squishy transparent oil-and-bubble images
starfish - Radially-symmetric throbbing colormap-hacking blobs.
munch - The classic 1962-vintage "munching squares" hack.
+ rd-bomb - Reaction-diffusion fractals.
+ coral - Simulation of coral growth, sort of.
fadeplot - Draws a swimming ribbon.
escher - Draws some escher-like scenes (GLX only.)
gears - Draws interlocking rotating gears (GLX only.)
-- Jamie Zawinski <jwz@netscape.com>
\f
+Changes since 2.09: Fixed color bugs in rd-bomb; sped up coral.
+Changes since 2.07: New hacks "rd-bomb" and "coral".
+ New version of "maze" with some new algorithms.
+ New colorized version of "rocks".
+ Fixed a bug in qix on 64-bit machines.
+ Fixed a bug in the -time option.
+ Fixed a bug in configure related to LessTif.
Changes since 2.06: Minor header tweaks in windows.c and flag.c.
Made multi-architecture (VPATH) builds work properly.
Merged new GL stuff from xlockmore (rubik, morph3d.)
*/
#undef HAVE_MESA_GL
+/* Define this if you have the X Shared Memory Extension.
+ */
+#undef HAVE_XSHM_EXTENSION
+
/* Some screenhacks like to run an external program to generate random pieces
of text; set this to the one you like ("yow" and "fortune" are the most
likely prospects.) Note that this is just the default; X resources can
if possible (this is the default).
--without-xidle-ext Do not compile in support for this extension."
ac_help="$ac_help
+ --with-xshm-ext Include support for the XSHM (Shared Memory) server
+ extension, if possible (this is the default).
+ --without-xshm-ext Do not compile in support for this extension."
+ac_help="$ac_help
Toolkit options:
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:633: checking host system type" >&5
+echo "configure:637: checking host system type" >&5
host_alias=$host
case "$host_alias" in
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:657: checking for $ac_word" >&5
+echo "configure:661: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:686: checking for $ac_word" >&5
+echo "configure:690: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:734: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:738: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 744 "configure"
+#line 748 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:773: checking whether we are using GNU C" >&5
+echo "configure:777: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:782: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:797: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:801: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$GCC"; then
echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
-echo "configure:827: checking how to request ANSI compilation" >&5
+echo "configure:831: checking how to request ANSI compilation" >&5
case "$host" in
*-hpux*)
echo "$ac_t""HPUX: adding -Ae" 1>&6
echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
-echo "configure:845: checking whether the compiler works on ANSI C" >&5
+echo "configure:849: checking whether the compiler works on ANSI C" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 850 "configure"
+#line 854 "configure"
#include "confdefs.h"
main(int ac, char **av) { return 0; }
EOF
-if { (eval echo configure:854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
else
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:883: checking how to run the C preprocessor" >&5
+echo "configure:887: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 898 "configure"
+#line 902 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:904: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 915 "configure"
+#line 919 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:954: checking for a BSD compatible install" >&5
+echo "configure:958: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1004: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1008: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1032: checking for working const" >&5
+echo "configure:1036: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1037 "configure"
+#line 1041 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1090: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1107: checking for inline" >&5
+echo "configure:1111: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1114 "configure"
+#line 1118 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1148: checking for ANSI C header files" >&5
+echo "configure:1152: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1153 "configure"
+#line 1157 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1165: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1178 "configure"
+#line 1182 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1196 "configure"
+#line 1200 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1217 "configure"
+#line 1221 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1252: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1256: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1257 "configure"
+#line 1261 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1287: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1291: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1292 "configure"
+#line 1296 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1308: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1312: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1333: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1337: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1338 "configure"
+#line 1342 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1346: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1350: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1371: checking for opendir in -ldir" >&5
+echo "configure:1375: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1379 "configure"
+#line 1383 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1412: checking for opendir in -lx" >&5
+echo "configure:1416: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1420 "configure"
+#line 1424 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1455: checking for mode_t" >&5
+echo "configure:1459: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1460 "configure"
+#line 1464 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1488: checking for pid_t" >&5
+echo "configure:1492: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1493 "configure"
+#line 1497 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1521: checking return type of signal handlers" >&5
+echo "configure:1525: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1526 "configure"
+#line 1530 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:1543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1562: checking for size_t" >&5
+echo "configure:1566: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1567 "configure"
+#line 1571 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
-echo "configure:1597: checking how to call gettimeofday" >&5
+echo "configure:1601: checking how to call gettimeofday" >&5
if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
+#line 1606 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
struct timeval tv; gettimeofday(&tv);
; return 0; }
EOF
-if { (eval echo configure:1610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=1
else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1618 "configure"
+#line 1622 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
gettimeofday(&tv, &tzp);
; return 0; }
EOF
-if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=2
else
for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1667: checking for $ac_func" >&5
+echo "configure:1671: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1672 "configure"
+#line 1676 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1723: checking for $ac_hdr" >&5
+echo "configure:1727: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1728 "configure"
+#line 1732 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1785: checking for X" >&5
+echo "configure:1789: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 1847 "configure"
+#line 1851 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1921 "configure"
+#line 1925 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:2034: checking whether -R must be followed by a space" >&5
+echo "configure:2038: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 2037 "configure"
+#line 2041 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 2060 "configure"
+#line 2064 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:2099: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:2103: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2107 "configure"
+#line 2111 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:2140: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:2144: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2148 "configure"
+#line 2152 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2159: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2188: checking for gethostbyname" >&5
+echo "configure:2192: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2193 "configure"
+#line 2197 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
; return 0; }
EOF
-if { (eval echo configure:2216: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2237: checking for gethostbyname in -lnsl" >&5
+echo "configure:2241: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2245 "configure"
+#line 2249 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:2286: checking for connect" >&5
+echo "configure:2290: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2291 "configure"
+#line 2295 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
; return 0; }
EOF
-if { (eval echo configure:2314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:2335: checking for connect in -lsocket" >&5
+echo "configure:2339: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2343 "configure"
+#line 2347 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
connect()
; return 0; }
EOF
-if { (eval echo configure:2354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:2378: checking for remove" >&5
+echo "configure:2382: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2383 "configure"
+#line 2387 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
; return 0; }
EOF
-if { (eval echo configure:2406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2427: checking for remove in -lposix" >&5
+echo "configure:2431: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2435 "configure"
+#line 2439 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
remove()
; return 0; }
EOF
-if { (eval echo configure:2446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2470: checking for shmat" >&5
+echo "configure:2474: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2475 "configure"
+#line 2479 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
; return 0; }
EOF
-if { (eval echo configure:2498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2519: checking for shmat in -lipc" >&5
+echo "configure:2523: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2527 "configure"
+#line 2531 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
shmat()
; return 0; }
EOF
-if { (eval echo configure:2538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2571: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2575: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2579 "configure"
+#line 2583 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:2590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
-echo "configure:2627: checking for X app-defaults directory" >&5
+echo "configure:2631: checking for X app-defaults directory" >&5
if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 2748 "configure"
+#line 2752 "configure"
#include "confdefs.h"
#include <X11/XHPlib.h>
EOF
# Check for the availability of the XPointer typedef, and define it otherwise.
#
echo $ac_n "checking for XPointer""... $ac_c" 1>&6
-echo "configure:2769: checking for XPointer" >&5
+echo "configure:2773: checking for XPointer" >&5
if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 2780 "configure"
+#line 2784 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
int main() {
XPointer foo = (XPointer) 0;
; return 0; }
EOF
-if { (eval echo configure:2787: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2791: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_xpointer=yes
else
# Some versions of Slowlaris Motif require -lgen. But not all. Why?
echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
-echo "configure:2839: checking for regcmp in -lgen" >&5
+echo "configure:2843: checking for regcmp in -lgen" >&5
ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2847 "configure"
+#line 2851 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
regcmp()
; return 0; }
EOF
-if { (eval echo configure:2858: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
-echo "configure:2895: checking for X11/Xmu/Error.h" >&5
+echo "configure:2899: checking for X11/Xmu/Error.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2900 "configure"
+#line 2904 "configure"
#include "confdefs.h"
#include <X11/Xmu/Error.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
case "$host" in
*-sunos4*)
echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
-echo "configure:2949: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
+echo "configure:2953: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# with X libraries because we know it's SunOS.
LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
cat > conftest.$ac_ext <<EOF
-#line 2962 "configure"
+#line 2966 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_sunos_xmu_bug=no
else
echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
if test $ac_cv_sunos_xmu_bug = yes ; then
echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
-echo "configure:2985: checking whether the compiler understands -static" >&5
+echo "configure:2989: checking whether the compiler understands -static" >&5
if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static"
cat > conftest.$ac_ext <<EOF
-#line 2992 "configure"
+#line 2996 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3003: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_ld_static=yes
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
-echo "configure:3045: checking for X11/extensions/XScreenSaver.h" >&5
+echo "configure:3049: checking for X11/extensions/XScreenSaver.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3050 "configure"
+#line 3054 "configure"
#include "confdefs.h"
#include <X11/extensions/XScreenSaver.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3055: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3059: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
-echo "configure:3110: checking for X11/extensions/scrnsaver.h" >&5
+echo "configure:3114: checking for X11/extensions/scrnsaver.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3115 "configure"
+#line 3119 "configure"
#include "confdefs.h"
#include <X11/extensions/scrnsaver.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
-echo "configure:3162: checking for XScreenSaverRegister in -lXext" >&5
+echo "configure:3166: checking for XScreenSaverRegister in -lXext" >&5
ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3170 "configure"
+#line 3174 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
-echo "configure:3230: checking for XScreenSaverRegister in -lXExExt" >&5
+echo "configure:3234: checking for XScreenSaverRegister in -lXExExt" >&5
ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3238 "configure"
+#line 3242 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
-echo "configure:3293: checking for XScreenSaverRegister in -lXss" >&5
+echo "configure:3297: checking for XScreenSaverRegister in -lXss" >&5
ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXss -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3301 "configure"
+#line 3305 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
-# Check for the XIDLE server extension header,
+# Check for the XIDLE server extension header.
#
have_xidle=no
with_xidle_req=unspecified
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
-echo "configure:3373: checking for X11/extensions/xidle.h" >&5
+echo "configure:3377: checking for X11/extensions/xidle.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3378 "configure"
+#line 3382 "configure"
#include "confdefs.h"
#include <X11/extensions/xidle.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3387: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
+# Check for the XSHM server extension header.
+#
+have_xshm=no
+with_xshm_req=unspecified
+# Check whether --with-xshm-ext or --without-xshm-ext was given.
+if test "${with_xshm_ext+set}" = set; then
+ withval="$with_xshm_ext"
+ with_xshm="$withval"; with_xshm_req="$withval"
+else
+ with_xshm=yes
+fi
+
+if test $with_xshm = yes; then
+
+ # first check for Xshm.h.
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
+echo "configure:3442: checking for X11/extensions/XShm.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3447 "configure"
+#include "confdefs.h"
+#include <X11/extensions/XShm.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3452: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ # if that succeeded, then check for sys/ipc.h.
+ if test $have_xshm = yes; then
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
+echo "configure:3486: checking for sys/ipc.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3491 "configure"
+#include "confdefs.h"
+#include <sys/ipc.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ fi
+
+ # if that succeeded, then check for sys/shm.h.
+ if test $have_xshm = yes; then
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
+echo "configure:3531: checking for sys/shm.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3536 "configure"
+#include "confdefs.h"
+#include <sys/shm.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:3541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ fi
+
+ # if that succeeded, then we've really got it.
+ if test $have_xshm = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_XSHM_EXTENSION 1
+EOF
+
+ fi
+
+elif test $with_xshm != no; then
+ echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
+ exit 1
+fi
+
+
# Check for Motif and Athena --with and --without arguments.
#
have_motif=no
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:3474: checking for Xm/Xm.h" >&5
+echo "configure:3638: checking for Xm/Xm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3479 "configure"
+#line 3643 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3648: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
-echo "configure:3522: checking for X11/Xaw/Dialog.h" >&5
+echo "configure:3686: checking for X11/Xaw/Dialog.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3527 "configure"
+#line 3691 "configure"
#include "confdefs.h"
#include <X11/Xaw/Dialog.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
if test $have_athena = yes ; then
echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
-echo "configure:3602: checking for XawViewportSetCoordinates in Viewport.h" >&5
+echo "configure:3766: checking for XawViewportSetCoordinates in Viewport.h" >&5
if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 3614 "configure"
+#line 3778 "configure"
#include "confdefs.h"
#include <X11/Xaw/Viewport.h>
EOF
# If we have Motif, check whether it's really LessTif.
#
+have_lesstif=no
if test $have_motif = yes ; then
echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
-echo "configure:3642: checking whether Motif is really LessTif" >&5
+echo "configure:3807: checking whether Motif is really LessTif" >&5
if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 3653 "configure"
+#line 3818 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() {
long vers = LesstifVersion;
; return 0; }
EOF
-if { (eval echo configure:3660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_have_lesstif=yes
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
-echo "configure:3699: checking for X11/xpm.h" >&5
+echo "configure:3864: checking for X11/xpm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3704 "configure"
+#line 3869 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3874: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
-echo "configure:3764: checking for GL/gl.h" >&5
+echo "configure:3929: checking for GL/gl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3769 "configure"
+#line 3934 "configure"
#include "confdefs.h"
#include <GL/gl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3774: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
-echo "configure:3805: checking for GL/glx.h" >&5
+echo "configure:3970: checking for GL/glx.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3810 "configure"
+#line 3975 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 3855 "configure"
+#line 4020 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
-echo "configure:3905: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:4070: checking for X11/extensions/readdisplay.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3910 "configure"
+#line 4075 "configure"
#include "confdefs.h"
#include <X11/extensions/readdisplay.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3915: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3984: checking for $ac_word" >&5
+echo "configure:4149: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4017: checking for $ac_word" >&5
+echo "configure:4182: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$emacs_exe" ; then
echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
-echo "configure:4051: checking for emacs yow" >&5
+echo "configure:4216: checking for emacs yow" >&5
#
# get emacs to tell us where the libexec directory is.
#
if test -z "$ac_cv_zippy_program" ; then
echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
-echo "configure:4073: checking for xemacs yow" >&5
+echo "configure:4238: checking for xemacs yow" >&5
if test -n "$xemacs_exe" ; then
#
# get xemacs to tell us where the libexec directory is.
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4119: checking for $ac_word" >&5
+echo "configure:4284: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4154: checking for $ac_word" >&5
+echo "configure:4319: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $with_kerberos = yes; then
echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
-echo "configure:4233: checking for Kerberos" >&5
+echo "configure:4398: checking for Kerberos" >&5
if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4244 "configure"
+#line 4409 "configure"
#include "confdefs.h"
#include <krb.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:4251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_kerberos=yes
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:4301: checking for Sun-style shadow passwords" >&5
+echo "configure:4466: checking for Sun-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4312 "configure"
+#line 4477 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pwa_passwd;
; return 0; }
EOF
-if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sun_adjunct=yes
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:4354: checking for DEC-style shadow passwords" >&5
+echo "configure:4519: checking for DEC-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4365 "configure"
+#line 4530 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
pw = p->ufld.fd_encrypt;
; return 0; }
EOF
-if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_enhanced_passwd=yes
else
# On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
# (I'm told it needs -lcurses too, but I don't understand why.)
echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
-echo "configure:4408: checking for getprpwnam in -lprot" >&5
+echo "configure:4573: checking for getprpwnam in -lprot" >&5
ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lprot -lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4416 "configure"
+#line 4581 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getprpwnam()
; return 0; }
EOF
-if { (eval echo configure:4427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
# On DEC, getprpwnam() is in -lsecurity
echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:4447: checking for getprpwnam in -lsecurity" >&5
+echo "configure:4612: checking for getprpwnam in -lsecurity" >&5
ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsecurity $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4455 "configure"
+#line 4620 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getprpwnam()
; return 0; }
EOF
-if { (eval echo configure:4466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:4495: checking for HP-style shadow passwords" >&5
+echo "configure:4660: checking for HP-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4506 "configure"
+#line 4671 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pw_passwd;
; return 0; }
EOF
-if { (eval echo configure:4519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_hpux_passwd=yes
else
# on HPUX, bigcrypt is in -lsec
echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:4544: checking for bigcrypt in -lsec" >&5
+echo "configure:4709: checking for bigcrypt in -lsec" >&5
ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsec $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4552 "configure"
+#line 4717 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
bigcrypt()
; return 0; }
EOF
-if { (eval echo configure:4563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:4590: checking for generic shadow passwords" >&5
+echo "configure:4755: checking for generic shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4601 "configure"
+#line 4766 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->sp_pwdp;
; return 0; }
EOF
-if { (eval echo configure:4613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_shadow=yes
else
# On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
have_getspnam=no
echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
-echo "configure:4639: checking for getspnam in -lc" >&5
+echo "configure:4804: checking for getspnam in -lc" >&5
ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4647 "configure"
+#line 4812 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getspnam()
; return 0; }
EOF
-if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $have_getspnam = no ; then
echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:4680: checking for getspnam in -lgen" >&5
+echo "configure:4845: checking for getspnam in -lgen" >&5
ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4688 "configure"
+#line 4853 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getspnam()
; return 0; }
EOF
-if { (eval echo configure:4699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
have_crypt=no
echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
-echo "configure:4726: checking for crypt in -lc" >&5
+echo "configure:4891: checking for crypt in -lc" >&5
ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4734 "configure"
+#line 4899 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
crypt()
; return 0; }
EOF
-if { (eval echo configure:4745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $have_crypt = no ; then
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:4767: checking for crypt in -lcrypt" >&5
+echo "configure:4932: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4775 "configure"
+#line 4940 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
crypt()
; return 0; }
EOF
-if { (eval echo configure:4786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test $need_setuid = no ; then
case "$host" in
- *-hpux* | *-aix* | *-netbsd* )
+ *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
need_setuid=yes
;;
esac
warn 'The XIdle extension was requested, but was not found.'
fi
+if test $with_xshm_req = yes -a $have_xshm = no ; then
+ warn 'The XSHM extension was requested, but was not found.'
+fi
+
if test $have_motif = no -a $have_athena = no ; then
warn "Neither Motif nor Athena widgets seem to be available;"
warn2 "one or the other is required."
fi
-# Check for the XIDLE server extension header,
+# Check for the XIDLE server extension header.
#
have_xidle=no
with_xidle_req=unspecified
fi
+# Check for the XSHM server extension header.
+#
+have_xshm=no
+with_xshm_req=unspecified
+AC_ARG_WITH(xshm-ext,
+[ --with-xshm-ext Include support for the XSHM (Shared Memory) server
+ extension, if possible (this is the default).
+ --without-xshm-ext Do not compile in support for this extension.],
+ [with_xshm="$withval"; with_xshm_req="$withval"],[with_xshm=yes])
+if test $with_xshm = yes; then
+
+ # first check for Xshm.h.
+ AC_CHECK_X_HEADER(X11/extensions/XShm.h, [have_xshm=yes])
+
+ # if that succeeded, then check for sys/ipc.h.
+ if test $have_xshm = yes; then
+ have_xshm=no
+ AC_CHECK_X_HEADER(sys/ipc.h, [have_xshm=yes])
+ fi
+
+ # if that succeeded, then check for sys/shm.h.
+ if test $have_xshm = yes; then
+ have_xshm=no
+ AC_CHECK_X_HEADER(sys/shm.h, [have_xshm=yes])
+ fi
+
+ # if that succeeded, then we've really got it.
+ if test $have_xshm = yes; then
+ AC_DEFINE(HAVE_XSHM_EXTENSION)
+ fi
+
+elif test $with_xshm != no; then
+ echo "error: must be yes or no: --with-xshm-ext=$with_xshm"
+ exit 1
+fi
+
+
# Check for Motif and Athena --with and --without arguments.
#
have_motif=no
# If we have Motif, check whether it's really LessTif.
#
+have_lesstif=no
if test $have_motif = yes ; then
AC_CACHE_CHECK([whether Motif is really LessTif],
ac_cv_have_lesstif,
#
if test $need_setuid = no ; then
case "$host" in
- *-hpux* | *-aix* | *-netbsd* )
+ *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* )
need_setuid=yes
;;
esac
warn 'The XIdle extension was requested, but was not found.'
fi
+if test $with_xshm_req = yes -a $have_xshm = no ; then
+ warn 'The XSHM extension was requested, but was not found.'
+fi
+
if test $have_motif = no -a $have_athena = no ; then
warn "Neither Motif nor Athena widgets seem to be available;"
warn2 "one or the other is required."
starfish -root -blob \n\
munch -root \n\
fadeplot -root \n\
+ coral -root \n\
\
mono: rocks -root \n\
color: rocks -root -fg darksalmon \n\
color: attraction -root -glow -points 10 \n\
color: bubbles -root \n\
\
+ color: rd-bomb -root \n\
+ color: rd-bomb -root -speed 1 -size 0.1 \n\
+ \
PseudoColor: qix -root -count 4 -solid -transparent \n\
PseudoColor: qix -root -count 5 -solid -transparent -linear \
-segments 250 -size 100 \n\
starfish -root -blob \\n\
munch -root \\n\
fadeplot -root \\n\
+ coral -root \\n\
\
mono: rocks -root \\n\
color: rocks -root -fg darksalmon \\n\
color: attraction -root -glow -points 10 \\n\
color: bubbles -root \\n\
\
+ color: rd-bomb -root \\n\
+ color: rd-bomb -root -speed 1 -size 0.1 \\n\
+ \
PseudoColor: qix -root -count 4 -solid -transparent \\n\
PseudoColor: qix -root -count 5 -solid -transparent -linear \
-segments 250 -size 100 \\n\
Bool
passwd_valid_p (const char *typed_passwd)
{
+ char *s = 0; /* note that on some systems, crypt() may return null */
+
if (encrypted_user_passwd &&
- !strcmp ((char *) crypt (typed_passwd, encrypted_user_passwd),
- encrypted_user_passwd))
+ (s = (char *) crypt (typed_passwd, encrypted_user_passwd)) &&
+ !strcmp (s, encrypted_user_passwd))
return True;
/* do not allow root to have a null password. */
else if (typed_passwd[0] &&
encrypted_root_passwd &&
- !strcmp ((char *) crypt (typed_passwd, encrypted_root_passwd),
- encrypted_root_passwd))
+ (s = (char *) crypt (typed_passwd, encrypted_root_passwd)) &&
+ !strcmp (s, encrypted_root_passwd))
return True;
else
if (done) return;
done = True;
+ real_stderr = stderr;
+ real_stdout = stdout;
+
stderr_dialog_p = get_boolean_resource ("captureStderr", "Boolean");
stdout_dialog_p = get_boolean_resource ("captureStdout", "Boolean");
if (!stderr_dialog_p && !stdout_dialog_p)
return;
- real_stderr = stderr;
- real_stdout = stdout;
-
if (pipe (fds))
{
perror ("error creating pipe:");
ssi->screensaver_window,
ssi->screensaver_window);
}
- store_activate_time (si, True);
+ store_activate_time (si, si->screen_blanked_p);
raise_window (si, False, False, False);
/* #### */
grab_keyboard_and_mouse (si->dpy, si->screens[0].screensaver_window,
kill_xsetroot_data (si->dpy, ssi->screensaver_window, p->verbose_p);
}
+ store_activate_time(si, False); /* store unblank time */
+
ungrab_keyboard_and_mouse (si->dpy);
restore_real_vroot (si);
raise_window (si, True, True, False);
store_vroot_property (si->dpy,
ssi->screensaver_window, ssi->screensaver_window);
- store_activate_time (si, False);
+ store_activate_time (si, True);
XDestroyWindow (si->dpy, old_w);
if (old_c &&
It also may mean that your system uses shadow passwords instead of the
standard \fIgetpwent\fP interface; in that case, you may need to change
some options in \fIconfig.h\fP and recompile.
+
+If you change your password after xscreensaver has been launched, it will
+continue using your old password to unlock the screen until xscreensaver
+is restarted. This turns out to be kind of hard to fix. (But remember,
+kids! Unix security doesn't do much more than keep honest people honest...)
.TP 8
TWM and Colormaps
The \fBinstallColormap\fP option doesn't work very well with the
$(UTILS_SRC)/grabscreen.c $(UTILS_SRC)/hsv.c \
$(UTILS_SRC)/resources.c $(UTILS_SRC)/spline.c \
$(UTILS_SRC)/usleep.c $(UTILS_SRC)/visual.c \
- $(UTILS_SRC)/xroger.c $(UTILS_SRC)/yarandom.c
+ $(UTILS_SRC)/xroger.c $(UTILS_SRC)/yarandom.c \
+ $(UTILS_SRC)/erase.c
UTIL_OBJS = $(UTILS_SRC)/alpha.o $(UTILS_SRC)/colors.o \
$(UTILS_SRC)/grabscreen.o $(UTILS_SRC)/hsv.o \
$(UTILS_SRC)/resources.o $(UTILS_SRC)/spline.o \
$(UTILS_SRC)/usleep.o $(UTILS_SRC)/visual.o \
- $(UTILS_SRC)/xroger.o $(UTILS_SRC)/yarandom.o
+ $(UTILS_SRC)/xroger.o $(UTILS_SRC)/yarandom.o \
+ $(UTILS_SRC)/erase.o
SRCS = attraction.c blitspin.c bouboule.c braid.c bubbles.c \
bubbles_default.c decayscreen.c deco.c drift.c flag.c \
maze.c moire.c noseguy.c pedal.c penrose.c pyro.c qix.c \
rocks.c rorschach.c screenhack.c sierpinski.c slidescreen.c \
slip.c sphere.c spiral.c strange.c swirl.c xlockmore.c \
- xroger-hack.c goop.c starfish.c munch.c fadeplot.c
+ xroger-hack.c goop.c starfish.c munch.c fadeplot.c \
+ rd-bomb.c coral.c
OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \
bubbles_default.o decayscreen.o deco.o drift.o flag.o \
maze.o moire.o noseguy.o pedal.o penrose.o pyro.o qix.o \
rocks.o rorschach.o screenhack.o sierpinski.o slidescreen.o \
slip.o sphere.o spiral.o strange.o swirl.o xlockmore.o \
- xroger-hack.o goop.o starfish.o munch.o fadeplot.o
+ xroger-hack.o goop.o starfish.o munch.o fadeplot.o \
+ rd-bomb.o coral.o
EXES = attraction blitspin bouboule braid bubbles decayscreen deco \
drift flag flame forest fract galaxy grav greynetic halo \
laser lightning lisa lmorph maze moire noseguy pedal \
penrose pyro qix rocks rorschach sierpinski slidescreen \
slip sphere spiral strange swirl xroger goop starfish munch \
- fadeplot
+ fadeplot rd-bomb coral
HACK_OBJS_1 = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
$(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
noseguy.man pedal.man penrose.man pyro.man qix.man \
rocks.man rorschach.man sierpinski.man slidescreen.man \
slip.man sphere.man spiral.man strange.man swirl.man \
- xroger.man goop.man starfish.man munch.man
+ xroger.man goop.man starfish.man munch.man rd-bomb.man
STAR = *
EXTRAS = README Makefile.in xlock.h default.xbm bob.xbm .gdbinit \
noses/nose-$(STAR).xbm noses/nose-$(STAR).xpm \
$(UTILS_BIN)/xmu.o: $(UTILS_SRC)/xmu.c
$(UTILS_BIN)/xroger.o: $(UTILS_SRC)/xroger.c
$(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
+$(UTILS_BIN)/erase.o: $(UTILS_SRC)/erase.c
$(UTIL_OBJS):
cd $(UTILS_BIN) ; \
SPL = $(UTILS_BIN)/spline.o
XROG = $(UTILS_BIN)/xroger.o
GRAB = $(UTILS_BIN)/grabscreen.o
+ERASE = $(UTILS_BIN)/erase.o
COL = $(COLOR_OBJS)
CC_HACK = $(CC) $(LDFLAGS)
halo: $(HACK_OBJS) halo.o $(COL)
$(CC_HACK) -o $@ $(HACK_OBJS) halo.o $(COL) $(HACK_LIBS)
-helix: $(HACK_OBJS) helix.o $(HSV)
- $(CC_HACK) -o $@ $(HACK_OBJS) helix.o $(HSV) $(HACK_LIBS)
+helix: $(HACK_OBJS) helix.o $(HSV) $(ERASE)
+ $(CC_HACK) -o $@ $(HACK_OBJS) helix.o $(HSV) $(ERASE) $(HACK_LIBS)
hypercube: $(HACK_OBJS) hypercube.o
$(CC_HACK) -o $@ $(HACK_OBJS) hypercube.o $(HACK_LIBS)
qix: $(HACK_OBJS) qix.o $(ALP)
$(CC_HACK) -o $@ $(HACK_OBJS) qix.o $(ALP) $(HACK_LIBS)
-rocks: $(HACK_OBJS) rocks.o
- $(CC_HACK) -o $@ $(HACK_OBJS) rocks.o $(HACK_LIBS)
+rocks: $(HACK_OBJS) rocks.o $(COL)
+ $(CC_HACK) -o $@ $(HACK_OBJS) rocks.o $(COL) $(HACK_LIBS)
-rorschach: $(HACK_OBJS) rorschach.o $(HSV)
- $(CC_HACK) -o $@ $(HACK_OBJS) rorschach.o $(HSV) $(HACK_LIBS)
+rorschach: $(HACK_OBJS) rorschach.o $(HSV) $(ERASE)
+ $(CC_HACK) -o $@ $(HACK_OBJS) rorschach.o $(HSV) $(ERASE) $(HACK_LIBS)
slidescreen: $(HACK_OBJS) slidescreen.o $(GRAB_OBJS)
$(CC_HACK) -o $@ $(HACK_OBJS) slidescreen.o $(GRAB_OBJS) $(HACK_LIBS)
munch: $(HACK_OBJS) munch.o $(COL) $(SPL)
$(CC_HACK) -o $@ $(HACK_OBJS) munch.o $(COL) $(SPL) $(HACK_LIBS)
+rd-bomb: $(HACK_OBJS) rd-bomb.o $(COL)
+ $(CC_HACK) -o $@ $(HACK_OBJS) rd-bomb.o $(COL) $(HACK_LIBS)
+
+coral: $(HACK_OBJS) coral.o $(COLOR_OBJS)
+ $(CC_HACK) -o $@ $(HACK_OBJS) coral.o $(COLOR_OBJS) $(HACK_LIBS)
+
# The rules for those hacks which follow the `xlockmore' API.
#
helix.o: $(UTILS_SRC)/colors.h
helix.o: $(UTILS_SRC)/grabscreen.h
helix.o: $(UTILS_SRC)/visual.h
+helix.o: $(UTILS_SRC)/erase.h
hopalong.o: $(srcdir)/xlockmore.h
hopalong.o: $(srcdir)/../config.h
hopalong.o: $(srcdir)/xlockmoreI.h
rorschach.o: $(UTILS_SRC)/colors.h
rorschach.o: $(UTILS_SRC)/grabscreen.h
rorschach.o: $(UTILS_SRC)/visual.h
+rorschach.o: $(UTILS_SRC)/erase.h
screenhack.o: $(UTILS_SRC)/xmu.h
screenhack.o: $(srcdir)/screenhack.h
screenhack.o: $(srcdir)/../config.h
fadeplot.o: $(UTILS_SRC)/colors.h
fadeplot.o: $(UTILS_SRC)/grabscreen.h
fadeplot.o: $(UTILS_SRC)/visual.h
+rd-bomb.o: $(srcdir)/screenhack.h
+rd-bomb.o: $(srcdir)/../config.h
+rd-bomb.o: $(UTILS_SRC)/yarandom.h
+rd-bomb.o: $(UTILS_SRC)/usleep.h
+rd-bomb.o: $(UTILS_SRC)/resources.h
+rd-bomb.o: $(UTILS_SRC)/hsv.h
+rd-bomb.o: $(UTILS_SRC)/colors.h
+rd-bomb.o: $(UTILS_SRC)/grabscreen.h
+rd-bomb.o: $(UTILS_SRC)/visual.h
+coral.o: $(srcdir)/screenhack.h
+coral.o: $(srcdir)/../config.h
+coral.o: $(UTILS_SRC)/yarandom.h
+coral.o: $(UTILS_SRC)/usleep.h
+coral.o: $(UTILS_SRC)/resources.h
+coral.o: $(UTILS_SRC)/hsv.h
+coral.o: $(UTILS_SRC)/colors.h
+coral.o: $(UTILS_SRC)/grabscreen.h
+coral.o: $(UTILS_SRC)/visual.h
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECAYSCREEN.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECO.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DRIFT.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAG.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FOREST.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECAYSCREEN.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECO.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DRIFT.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAG.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FOREST.C
--- /dev/null
+/* coral, by "Frederick G.M. Roeber" <roeber@netscape.com>, 15-jul-97.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+#include "screenhack.h"
+#include "colors.h"
+
+static GC draw_gc;
+static unsigned int default_fg_pixel;
+#define NCOLORSMAX 200
+static XColor colors[NCOLORSMAX];
+static int ncolors = 0;
+static int colorindex = 0;
+static int colorsloth;
+
+static XPoint *walkers;
+static int nwalkers;
+static int width, widthb;
+static int height;
+
+static unsigned int *board;
+#define getdot(x,y) (board[(y*widthb)+(x>>5)] & (1<<(x & 31)))
+#define setdot(x,y) (board[(y*widthb)+(x>>5)] |= (1<<(x & 31)))
+
+
+static void
+init_coral(Display *dpy, Window window)
+{
+ XGCValues gcv;
+ Colormap cmap;
+ XWindowAttributes xgwa;
+ Bool writeable = False;
+ int seeds;
+ int density;
+ int i;
+
+ XClearWindow(dpy, window);
+ XGetWindowAttributes(dpy, window, &xgwa);
+ width = xgwa.width;
+ widthb = ((xgwa.width + 31) >> 5);
+ height = xgwa.height;
+ board = (unsigned int *)calloc(widthb * xgwa.height, sizeof(unsigned int));
+ if(!board) exit(1);
+ cmap = xgwa.colormap;
+ if( ncolors ) {
+ free_colors(dpy, cmap, colors, ncolors);
+ ncolors = 0;
+ }
+ gcv.foreground = default_fg_pixel = get_pixel_resource("foreground", "Foreground", dpy, cmap);
+ draw_gc = XCreateGC(dpy, window, GCForeground, &gcv);
+ ncolors = NCOLORSMAX;
+ make_uniform_colormap(dpy, xgwa.visual, cmap, colors, &ncolors, True, &writeable, False);
+ colorindex = random()%ncolors;
+
+ density = get_integer_resource("density", "Integer");
+ if( density < 1 ) density = 1;
+ if( density > 100 ) density = 90; /* more like mold than coral */
+ nwalkers = (width*height*density)/100;
+ walkers = (XPoint *)calloc(nwalkers, sizeof(XPoint));
+ if( (XPoint *)0 == walkers ) exit(1);
+
+ seeds = get_integer_resource("seeds", "Integer");
+ if( seeds < 1 ) seeds = 1;
+ if( seeds > 1000 ) seeds = 1000;
+
+ colorsloth = nwalkers*2/ncolors;
+ XSetForeground(dpy, draw_gc, colors[colorindex].pixel);
+
+ for( i = 0; i < seeds; i++ ) {
+ int x, y;
+ do {
+ x = random() % width;
+ y = random() % height;
+ } while( getdot(x, y) );
+
+ setdot((x-1), (y-1)); setdot(x, (y-1)); setdot((x+1), (y-1));
+ setdot((x-1), y ); setdot(x, y ); setdot((x+1), y );
+ setdot((x-1), (y+1)); setdot(x, (y+1)); setdot((x+1), (y+1));
+ XDrawPoint(dpy, window, draw_gc, x, y);
+ }
+
+ for( i = 0; i < nwalkers; i++ ) {
+ walkers[i].x = (random() % (width-2)) + 1;
+ walkers[i].y = (random() % (height-2)) + 1;
+ }
+}
+
+
+/* returns 2 bits of randomness (conserving calls to random()).
+ This speeds things up a little, but not a lot (5-10% or so.)
+ */
+static int
+rand_2(void)
+{
+ static int i = 0;
+ static int r = 0;
+ if (i != 0) {
+ i--;
+ } else {
+ i = 15;
+ r = random();
+ }
+
+ {
+ register int j = (r & 3);
+ r = r >> 2;
+ return j;
+ }
+}
+
+
+static void
+coral(Display *dpy, Window window)
+{
+ int delay2 = get_integer_resource ("delay2", "Integer");
+
+ int max_points = 200;
+ int npoints = 0;
+ XPoint *pointbuf = (XPoint *) calloc(sizeof(XPoint), max_points+2);
+ if (!pointbuf) exit(-1);
+
+ while( 1 ) {
+ int i;
+
+ for( i = 0; i < nwalkers; i++ ) {
+ int x = walkers[i].x;
+ int y = walkers[i].y;
+
+ if( getdot(x, y) ) {
+
+ Bool flush = False;
+ Bool color = False;
+
+ /* XDrawPoint(dpy, window, draw_gc, x, y); */
+ pointbuf[npoints].x = x;
+ pointbuf[npoints].y = y;
+ npoints++;
+
+ /* Mark the surrounding area as "sticky" */
+ setdot((x-1), (y-1)); setdot(x, (y-1)); setdot((x+1), (y-1));
+ setdot((x-1), y ); setdot((x+1), y );
+ setdot((x-1), (y+1)); setdot(x, (y+1)); setdot((x+1), (y+1));
+ nwalkers--;
+ walkers[i].x = walkers[nwalkers].x;
+ walkers[i].y = walkers[nwalkers].y;
+ if( 0 == (nwalkers%colorsloth) ) {
+ color = True;
+ }
+
+ if (flush || color || 0 == nwalkers || npoints >= max_points) {
+ XDrawPoints(dpy, window, draw_gc, pointbuf, npoints,
+ CoordModeOrigin);
+ npoints = 0;
+ XSync(dpy, True);
+ }
+
+ if (color) {
+ colorindex++;
+ if( colorindex == ncolors )
+ colorindex = 0;
+ XSetForeground(dpy, draw_gc, colors[colorindex].pixel);
+ }
+
+ if( 0 == nwalkers ) {
+ XSync(dpy, True);
+ free(pointbuf);
+ return;
+ }
+ } else {
+ /* move it a notch */
+ do {
+ switch(rand_2()) {
+ case 0:
+ if( 1 == x ) continue;
+ walkers[i].x--;
+ break;
+ case 1:
+ if( width-2 == x ) continue;
+ walkers[i].x++;
+ break;
+ case 2:
+ if( 1 == y ) continue;
+ walkers[i].y--;
+ break;
+ default: /* case 3: */
+ if( height-2 == y ) continue;
+ walkers[i].y++;
+ break;
+ /* default:
+ abort(); */
+ }
+ } while(0);
+ }
+ }
+
+ if (delay2 > 0) {
+ if (npoints > 0) {
+ XDrawPoints(dpy, window, draw_gc, pointbuf, npoints,
+ CoordModeOrigin);
+ npoints = 0;
+ XSync(dpy, True);
+ }
+ usleep(delay2);
+ }
+ }
+}
+
+char *progclass = "Coral";
+
+char *defaults[] = {
+ "Coral.background: black",
+ "Coral.foreground: white",
+ "*density: 25",
+ "*seeds: 20", /* too many for 640x480, too few for 1280x1024 */
+ "*delay: 5",
+ "*delay2: 1000",
+ 0
+};
+
+XrmOptionDescRec options[] = {
+ { "-density", ".density", XrmoptionSepArg, 0 },
+ { "-seeds", ".seeds", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-delay2", ".delay2", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
+};
+
+void
+screenhack(dpy, window)
+Display *dpy;
+Window window;
+{
+ int delay = get_integer_resource ("delay", "Integer");
+
+ while( 1 ) {
+ init_coral(dpy, window);
+ coral(dpy, window);
+ if( delay ) sleep(delay);
+ }
+}
/* Algorithm from a Mac program by Chris Tate, written in 1988 or so. */
-/* 10-May-97: merged ellipse code by Dan Stromberg <strombrg@nis.acs.uci.edu>
+/* 18-Sep-97: Johannes Keukelaar (johannes@nada.kth.se): Improved screen
+ * eraser.
+ * 10-May-97: merged ellipse code by Dan Stromberg <strombrg@nis.acs.uci.edu>
* as found in xlockmore 4.03a10.
* 1992: jwz created.
*/
#include <math.h>
#include "screenhack.h"
+#include "erase.h"
static double sins [360];
static double coss [360];
static GC draw_gc, erase_gc;
static unsigned int default_fg_pixel;
+static int erase_speed, sleep_time, erase_mode;
+
+void erase_window (Display *dpy, Window win, GC gc, int width, int height,
+ int mode, int delay);
static void
init_helix (Display *dpy, Window window)
random_trig(dpy, window, &color, &free_color);
XSync (dpy, True);
- sleep (5);
+ sleep ( sleep_time );
+
+ erase_window(dpy, window, erase_gc, width, height, erase_mode, erase_speed);
- for (i = 0; i < height; i++)
- {
- int y = (random () % height);
- XDrawLine (dpy, window, erase_gc, 0, y, width, y);
- XFlush (dpy);
- if ((i % 50) == 0)
- usleep (10000);
- }
- XClearWindow (dpy, window);
if (free_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XSync (dpy, True);
sleep (1);
char *defaults [] = {
"Helix.background: black", /* to placate SGI */
+ "Helix.eraseSpeed: 400",
+ "Helix.delay: 5",
+ "Helix.eraseMode: -1",
0
};
-XrmOptionDescRec options [] = { { 0, } };
+XrmOptionDescRec options [] = {
+ { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-erase-mode", ".eraseMode", XrmoptionSepArg, 0 },
+ { 0 },
+};
+int options_size = (sizeof (options) / sizeof (options[0]));
void
screenhack (Display *dpy, Window window)
{
+ erase_speed = get_integer_resource("eraseSpeed", "Integer");
+ sleep_time = get_integer_resource("delay", "Integer");
+ erase_mode = get_integer_resource("eraseMode", "Integer");
init_helix (dpy, window);
while (1)
random_helix_or_trig (dpy, window);
-.TH XScreenSaver 1 "13-aug-92" "X Version 11"
+.TH XScreenSaver 1 "18-sep-97" "X Version 11"
.SH NAME
helix - draw helical string-art patterns
.SH SYNOPSIS
.B helix
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-erase\-speed \fIusecs\fP] [\-erase\-mode \fIinteger\fP] [\-delay \fIseconds\fP] [\-install] [\-visual \fIvisual\fP]
.SH DESCRIPTION
The \fIhelix\fP program draws interesting patterns composed of line segments
in random colors.
.B \-mono
If on a color display, pretend we're on a monochrome display.
.TP 8
+.B \-erase\-speed \fIusecs\fP
+This controls the speed at which the screen will be erased. Lower numbers
+erase faster.
+.TP 8
+.B \-erase\-mode \fIinteger\fP
+This sets the erase mode. Mode \-1 chooses a random mode each time. There
+are currently 6 modes defined (0\-5).
+.TP 8
+.B \-delay \fIseconds\fP
+This sets the number of seconds that the helix will be on the screen.
+.TP 8
.B \-install
Install a private colormap for the window.
.TP 8
express or implied warranty.
.SH AUTHOR
Jamie Zawinski <jwz@netscape.com>, 13-aug-92.
+Screen eraser improved by Johannes Keukelaar <johannes@nada.kth.se>,
+ 18-sep-97.
$ link/exe=decayscreen.exe screenhack,decayscreen,vms_axp_12.opt/opt
$ link/exe=deco.exe screenhack,deco,vms_axp_12.opt/opt
$ link/exe=drift.exe screenhack-xlock,drift,xlockmore,vms_axp_12.opt/opt
+$ link/exe=fadeplot.exe screenhack-xlock,fadeplot,xlockmore,vms_axp_12.opt/opt
$ link/exe=flag.exe screenhack-xlock,flag,xlockmore,vms_axp_12.opt/opt
$ link/exe=flame.exe screenhack,flame,vms_axp_12.opt/opt
$ link/exe=forest.exe screenhack-xlock,forest,xlockmore,vms_axp_12.opt/opt
$ link/exe=decayscreen.exe screenhack,decayscreen,vms_axp.opt/opt
$ link/exe=deco.exe screenhack,deco,vms_axp.opt/opt
$ link/exe=drift.exe screenhack-xlock,drift,xlockmore,vms_axp.opt/opt
+$ link/exe=fadeplot.exe screenhack-xlock,fadeplot,xlockmore,vms_axp.opt/opt
$ link/exe=flag.exe screenhack-xlock,flag,xlockmore,vms_axp.opt/opt
$ link/exe=flame.exe screenhack,flame,vms_axp.opt/opt
$ link/exe=forest.exe screenhack-xlock,forest,xlockmore,vms_axp.opt/opt
$ link/exe=decayscreen.exe screenhack,decayscreen,vms_decc_12.opt/opt
$ link/exe=deco.exe screenhack,deco,vms_decc_12.opt/opt
$ link/exe=drift.exe screenhack-xlock,drift,xlockmore,vms_decc_12.opt/opt
+$ link/exe=fadeplot.exe screenhack-xlock,fadeplot,xlockmore,vms_decc_12.opt/opt
$ link/exe=flag.exe screenhack-xlock,flag,xlockmore,vms_decc_12.opt/opt
$ link/exe=flame.exe screenhack,flame,vms_decc_12.opt/opt
$ link/exe=forest.exe screenhack-xlock,forest,xlockmore,vms_decc_12.opt/opt
$ link/exe=decayscreen.exe screenhack,decayscreen,vms_decc.opt/opt
$ link/exe=deco.exe screenhack,deco,vms_decc.opt/opt
$ link/exe=drift.exe screenhack-xlock,drift,xlockmore,vms_decc.opt/opt
+$ link/exe=fadeplot.exe screenhack-xlock,fadeplot,xlockmore,vms_decc.opt/opt
$ link/exe=flag.exe screenhack-xlock,flag,xlockmore,vms_decc.opt/opt
$ link/exe=flame.exe screenhack,flame,vms_decc.opt/opt
$ link/exe=forest.exe screenhack-xlock,forest,xlockmore,vms_decc.opt/opt
/******************************************************************************
* [ maze ] ...
*
+ * modified: [ 4-10-97 ] Johannes Keukelaar <johannes@nada.kth.se>
+ * Added multiple maze creators. Robustified solver.
+ * Added bridge option.
* modified: [ 8-11-95 ] Ed James <james@mml.mmc.com>
* added fill of dead-end box to solve_maze while loop.
* modified: [ 3-7-93 ] Jamie Zawinski <jwz@netscape.com>
#define DOOR_OUT_BOTTOM 0x20
#define DOOR_OUT_LEFT 0x10
+#define SOLVER_VISIT 0x4
#define START_SQUARE 0x2
#define END_SQUARE 0x1
static int sqnum, cur_sq_x, cur_sq_y, path_length;
static int start_x, start_y, start_dir, end_x, end_y, end_dir;
static int grid_width, grid_height;
+static int bw;
static Display *dpy;
static Window win;
-static GC gc, cgc, tgc, logo_gc;
+static GC gc, cgc, tgc, logo_gc, erase_gc;
static Pixmap logo_map;
-static int x = 0, y = 0, restart = 0, stop = 1, state = 1;
+static int x = 0, y = 0, restart = 0, stop = 1, state = 1, max_length;
+static int sync_p, bridge_p;
static int
check_events (void) /* X event handler [ rhess ] */
initialize_maze (void) /* draw the surrounding wall and start/end squares */
{
register int i, j, wall;
+ int logow = 1 + logo_width / grid_width;
+ int logoh = 1 + logo_height / grid_height;
/* initialize all squares */
for ( i=0; i<maze_size_x; i++) {
end_dir = wall;
/* set logo */
- if ((maze_size_x > 15) && (maze_size_y > 15))
+ if ((maze_size_x-logow >= 6) && (maze_size_y-logoh >= 6))
{
- int logow = 1 + logo_width / grid_width;
- int logoh = 1 + logo_height / grid_height;
/* not closer than 3 grid units from a wall */
- logo_x = get_random (maze_size_x - logow - 6) + 3;
- logo_y = get_random (maze_size_y - logoh - 6) + 3;
+ logo_x = get_random (maze_size_x - logow - 5) + 3;
+ logo_y = get_random (maze_size_y - logoh - 5) + 3;
for (i=0; i<logow; i++)
for (j=0; j<logoh; j++)
maze[logo_x + i][logo_y + j] |= DOOR_IN_TOP;
static int choose_door (void);
static int backup (void);
-static void draw_wall (int, int, int);
+static void draw_wall (int, int, int, GC);
static void draw_solid_square (int, int, int, GC);
-static void enter_square (int);
+/*static void enter_square (int);*/
+static void build_wall (int, int, int);
+/*static void break_wall (int, int, int);*/
+
+static void join_sets(int, int);
+
+/* For set_create_maze. */
+/* The sets that our squares are in. */
+static int *sets = 0;
+/* The `list' of hedges. */
+static int *hedges = 0;
+
+#define DEBUG_SETS 0
+
+/* Initialise the sets. */
+static void
+init_sets(void)
+{
+ int i, t, r, x, y;
+
+ if(sets)
+ free(sets);
+ sets = (int *)malloc(maze_size_x*maze_size_y*sizeof(int));
+ if(!sets)
+ abort();
+ for(i = 0; i < maze_size_x*maze_size_y; i++)
+ {
+ sets[i] = i;
+ }
+
+ if(hedges)
+ free(hedges);
+ hedges = (int *)malloc(maze_size_x*maze_size_y*2*sizeof(int));
+ if(!hedges)
+ abort();
+ for(i = 0; i < maze_size_x*maze_size_y*2; i++)
+ {
+ hedges[i] = i;
+ }
+ /* Mask out outside walls. */
+ for(i = 0; i < maze_size_y; i++)
+ {
+ hedges[2*((maze_size_x)*i+maze_size_x-1)+1] = -1;
+ }
+ for(i = 0; i < maze_size_x; i++)
+ {
+ hedges[2*((maze_size_y-1)*maze_size_x+i)] = -1;
+ }
+ /* Mask out a possible logo. */
+ if(logo_x!=-1)
+ {
+ int logow = 1 + logo_width / grid_width;
+ int logoh = 1 + logo_height / grid_height;
+ int bridge_dir, bridge_c;
+
+ if(bridge_p && logoh>=3 && logow>=3)
+ {
+ bridge_dir = 1+random()%2;
+ if(bridge_dir==1)
+ {
+ bridge_c = logo_y+random()%(logoh-2)+1;
+ }
+ else
+ {
+ bridge_c = logo_x+random()%(logow-2)+1;
+ }
+ }
+ else
+ {
+ bridge_dir = 0;
+ bridge_c = -1;
+ }
+
+ for(x = logo_x; x < logo_x+logow; x++)
+ for(y = logo_y; y < logo_y+logoh; y++)
+ {
+ /* I should check for the bridge here, except that I join the
+ * bridge together below.
+ */
+ hedges[2*(x+maze_size_x*y)+1] = -1;
+ hedges[2*(x+maze_size_x*y)] = -1;
+ }
+ for(x = logo_x; x < logo_x+logow; x++)
+ {
+ if(!(bridge_dir==2 && x==bridge_c))
+ {
+ build_wall(x, logo_y, 0);
+ build_wall(x, logo_y+logoh, 0);
+ }
+ hedges[2*(x+maze_size_x*(logo_y-1))] = -1;
+ if(bridge_dir==1)
+ {
+ build_wall(x, bridge_c, 0);
+ build_wall(x, bridge_c, 2);
+ }
+ }
+ for(y = logo_y; y < logo_y+logoh; y++)
+ {
+ if(!(bridge_dir==1 && y==bridge_c))
+ {
+ build_wall(logo_x, y, 3);
+ build_wall(logo_x+logow, y, 3);
+ }
+ hedges[2*(logo_x-1+maze_size_x*y)+1] = -1;
+ if(bridge_dir==2)
+ {
+ build_wall(bridge_c, y, 1);
+ build_wall(bridge_c, y, 3);
+ }
+ }
+ /* Join the whole bridge together. */
+ if(bridge_p)
+ {
+ if(bridge_dir==1)
+ {
+ x = logo_x-1;
+ y = bridge_c;
+ for(i = logo_x; i < logo_x+logow+1; i++)
+ join_sets(x+y*maze_size_x, i+y*maze_size_x);
+ }
+ else
+ {
+ y = logo_y-1;
+ x = bridge_c;
+ for(i = logo_y; i < logo_y+logoh+1; i++)
+ join_sets(x+y*maze_size_x, x+i*maze_size_x);
+ }
+ }
+ }
+
+ for(i = 0; i < maze_size_x*maze_size_y*2; i++)
+ {
+ t = hedges[i];
+ r = random()%(maze_size_x*maze_size_y*2);
+ hedges[i] = hedges[r];
+ hedges[r] = t;
+ }
+}
+
+/* Get the representative of a set. */
+static int
+get_set(int num)
+{
+ int s;
+
+ if(sets[num]==num)
+ return num;
+ else
+ {
+ s = get_set(sets[num]);
+ sets[num] = s;
+ return s;
+ }
+}
+/* Join two sets together. */
static void
-create_maze (void) /* create a maze layout given the intiialized maze */
+join_sets(num1, num2)
+ int num1, num2;
+{
+ int s1, s2;
+
+ s1 = get_set(num1);
+ s2 = get_set(num2);
+
+ if(s1<s2)
+ sets[s2] = s1;
+ else
+ sets[s1] = s2;
+}
+
+/* Exitialise the sets. */
+static void
+exit_sets(void)
+{
+ if(hedges)
+ free(hedges);
+ hedges = 0;
+ if(sets)
+ free(sets);
+ sets = 0;
+}
+
+#if DEBUG_SETS
+/* Temporary hack. */
+static void
+show_set(int num, GC gc)
+{
+ int x, y, set;
+
+ set = get_set(num);
+
+ for(x = 0; x < maze_size_x; x++)
+ for(y = 0; y < maze_size_y; y++)
+ {
+ if(get_set(x+y*maze_size_x)==set)
+ {
+ XFillRectangle(dpy, win, gc, border_x + bw + grid_width * x,
+ border_y + bw + grid_height * y,
+ grid_width-2*bw , grid_height-2*bw);
+ }
+ }
+}
+#endif
+
+/* Second alternative maze creator: Put each square in the maze in a
+ * separate set. Also, make a list of all the hedges. Randomize that list.
+ * Walk through the list. If, for a certain hedge, the two squares on both
+ * sides of it are in different sets, union the sets and remove the hedge.
+ * Continue until all hedges have been processed or only one set remains.
+ */
+static void
+set_create_maze(void)
+{
+ int i, h, x, y, dir, v, w;
+#if DEBUG_SETS
+ int cont = 0;
+ char c;
+#endif
+
+ /* Do almost all the setup. */
+ init_sets();
+
+ /* Start running through the hedges. */
+ for(i = 0; i < 2*maze_size_x*maze_size_y; i++)
+ {
+ h = hedges[i];
+
+ /* This one is in the logo or outside border. */
+ if(h==-1)
+ continue;
+
+ dir = h%2?1:2;
+ x = (h>>1)%maze_size_x;
+ y = (h>>1)/maze_size_x;
+
+ v = x;
+ w = y;
+ switch(dir)
+ {
+ case 1:
+ v++;
+ break;
+ case 2:
+ w++;
+ break;
+ }
+
+#if DEBUG_SETS
+ show_set(x+y*maze_size_x, logo_gc);
+ show_set(v+w*maze_size_x, tgc);
+#endif
+ if(get_set(x+y*maze_size_x)!=get_set(v+w*maze_size_x))
+ {
+#if DEBUG_SETS
+ printf("Join!");
+#endif
+ join_sets(x+y*maze_size_x, v+w*maze_size_x);
+ /* Don't draw the wall. */
+ }
+ else
+ {
+#if DEBUG_SETS
+ printf("Build.");
+#endif
+ /* Don't join the sets. */
+ build_wall(x, y, dir);
+ }
+#if DEBUG_SETS
+ if(!cont)
+ {
+ XSync(dpy, False);
+ c = getchar();
+ if(c=='c')
+ cont = 1;
+ }
+ show_set(x+y*maze_size_x, erase_gc);
+ show_set(v+w*maze_size_x, erase_gc);
+#endif
+ }
+
+ /* Free some memory. */
+ exit_sets();
+}
+
+/* First alternative maze creator: Pick a random, empty corner in the maze.
+ * Pick a random direction. Draw a wall in that direction, from that corner
+ * until we hit a wall. Option: Only draw the wall if it's going to be
+ * shorter than a certain length. Otherwise we get lots of long walls.
+ */
+static void
+alt_create_maze(void)
+{
+ char *corners;
+ int *c_idx;
+ int i, j, height, width, open_corners, k, dir, x, y;
+
+ height = maze_size_y+1;
+ width = maze_size_x+1;
+
+ /* Allocate and clear some mem. */
+ corners = (char *)calloc(height*width, 1);
+ if(!corners)
+ return;
+
+ /* Set up the indexing array. */
+ c_idx = (int *)malloc(sizeof(int)*height*width);
+ if(!c_idx)
+ {
+ free(corners);
+ return;
+ }
+ for(i = 0; i < height*width; i++)
+ c_idx[i] = i;
+ for(i = 0; i < height*width; i++)
+ {
+ j = c_idx[i];
+ k = random()%(height*width);
+ c_idx[i] = c_idx[k];
+ c_idx[k] = j;
+ }
+
+ /* Set up some initial walls. */
+ /* Outside walls. */
+ for(i = 0; i < width; i++)
+ {
+ corners[i] = 1;
+ corners[i+width*(height-1)] = 1;
+ }
+ for(i = 0; i < height; i++)
+ {
+ corners[i*width] = 1;
+ corners[i*width+width-1] = 1;
+ }
+ /* Walls around logo. In fact, inside the logo, too. */
+ /* Also draw the walls. */
+ if(logo_x!=-1)
+ {
+ int logow = 1 + logo_width / grid_width;
+ int logoh = 1 + logo_height / grid_height;
+ int bridge_dir, bridge_c;
+
+ if(bridge_p && logoh>=3 && logow>=3)
+ {
+ bridge_dir = 1+random()%2;
+ if(bridge_dir==1)
+ {
+ bridge_c = logo_y+random()%(logoh-2)+1;
+ }
+ else
+ {
+ bridge_c = logo_x+random()%(logow-2)+1;
+ }
+ }
+ else
+ {
+ bridge_dir = 0;
+ bridge_c = -1;
+ }
+ for(i = logo_x; i <= logo_x + logow; i++)
+ {
+ for(j = logo_y; j <= logo_y + logoh; j++)
+ {
+ corners[i+width*j] = 1;
+ }
+ }
+ for(x = logo_x; x < logo_x+logow; x++)
+ {
+ if(!(bridge_dir==2 && x==bridge_c))
+ {
+ build_wall(x, logo_y, 0);
+ build_wall(x, logo_y+logoh, 0);
+ }
+ if(bridge_dir==1)
+ {
+ build_wall(x, bridge_c, 0);
+ build_wall(x, bridge_c, 2);
+ }
+ }
+ for(y = logo_y; y < logo_y+logoh; y++)
+ {
+ if(!(bridge_dir==1 && y==bridge_c))
+ {
+ build_wall(logo_x, y, 3);
+ build_wall(logo_x+logow, y, 3);
+ }
+ if(bridge_dir==2)
+ {
+ build_wall(bridge_c, y, 1);
+ build_wall(bridge_c, y, 3);
+ }
+ }
+ /* Connect one wall of the logo with an outside wall. */
+ if(bridge_p)
+ dir = (bridge_dir+1)%4;
+ else
+ dir = random()%4;
+ switch(dir)
+ {
+ case 0:
+ x = logo_x+(random()%(logow+1));
+ y = logo_y;
+ break;
+ case 1:
+ x = logo_x+logow;
+ y = logo_y+(random()%(logoh+1));
+ break;
+ case 2:
+ x = logo_x+(random()%(logow+1));
+ y = logo_y+logoh;
+ break;
+ case 3:
+ x = logo_x;
+ y = logo_y+(random()%(logoh+1));
+ break;
+ }
+ do
+ {
+ corners[x+width*y] = 1;
+ switch(dir)
+ {
+ case 0:
+ build_wall(x-1, y-1, 1);
+ y--;
+ break;
+ case 1:
+ build_wall(x, y, 0);
+ x++;
+ break;
+ case 2:
+ build_wall(x, y, 3);
+ y++;
+ break;
+ case 3:
+ build_wall(x-1, y-1, 2);
+ x--;
+ break;
+ }
+ }
+ while(!corners[x+width*y]);
+ if(bridge_p)
+ {
+ dir = (dir+2)%4;
+ switch(dir)
+ {
+ case 0:
+ x = logo_x+(random()%(logow+1));
+ y = logo_y;
+ break;
+ case 1:
+ x = logo_x+logow;
+ y = logo_y+(random()%(logoh+1));
+ break;
+ case 2:
+ x = logo_x+(random()%(logow+1));
+ y = logo_y+logoh;
+ break;
+ case 3:
+ x = logo_x;
+ y = logo_y+(random()%(logoh+1));
+ break;
+ }
+ do
+ {
+ corners[x+width*y] = 1;
+ switch(dir)
+ {
+ case 0:
+ build_wall(x-1, y-1, 1);
+ y--;
+ break;
+ case 1:
+ build_wall(x, y, 0);
+ x++;
+ break;
+ case 2:
+ build_wall(x, y, 3);
+ y++;
+ break;
+ case 3:
+ build_wall(x-1, y-1, 2);
+ x--;
+ break;
+ }
+ }
+ while(!corners[x+width*y]);
+ }
+ }
+
+ /* Count open gridpoints. */
+ open_corners = 0;
+ for(i = 0; i < width; i++)
+ for(j = 0; j < height; j++)
+ if(!corners[i+width*j])
+ open_corners++;
+
+ /* Now do actual maze generation. */
+ while(open_corners>0)
+ {
+ for(i = 0; i < width*height; i++)
+ {
+ if(!corners[c_idx[i]])
+ {
+ x = c_idx[i]%width;
+ y = c_idx[i]/width;
+ /* Choose a random direction. */
+ dir = random()%4;
+
+ k = 0;
+ /* Measure the length of the wall we'd draw. */
+ while(!corners[x+width*y])
+ {
+ k++;
+ switch(dir)
+ {
+ case 0:
+ y--;
+ break;
+ case 1:
+ x++;
+ break;
+ case 2:
+ y++;
+ break;
+ case 3:
+ x--;
+ break;
+ }
+ }
+
+ if(k<=max_length)
+ {
+ x = c_idx[i]%width;
+ y = c_idx[i]/width;
+
+ /* Draw a wall until we hit something. */
+ while(!corners[x+width*y])
+ {
+ open_corners--;
+ corners[x+width*y] = 1;
+ switch(dir)
+ {
+ case 0:
+ build_wall(x-1, y-1, 1);
+ y--;
+ break;
+ case 1:
+ build_wall(x, y, 0);
+ x++;
+ break;
+ case 2:
+ build_wall(x, y, 3);
+ y++;
+ break;
+ case 3:
+ build_wall(x-1, y-1, 2);
+ x--;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* Free some memory we used. */
+ free(corners);
+ free(c_idx);
+}
+
+/* The original maze creator. Start somewhere. Take a step in a random
+ * direction. Keep doing this until we hit a wall. Then, backtrack until
+ * we find a point where we can go in another direction.
+ */
+static void
+create_maze (void) /* create a maze layout given the initialized maze */
{
register int i, newdoor = 0;
+ int logow = 1 + logo_width / grid_width;
+ int logoh = 1 + logo_height / grid_height;
+ /* Maybe we should make a bridge? */
+ if(bridge_p && logo_x>=0 && logow>=3 && logoh>=3)
+ {
+ int bridge_dir, bridge_c;
+
+ bridge_dir = 1+random()%2;
+ if(bridge_dir==1)
+ {
+ if(logoh>=3)
+ bridge_c = logo_y+random()%(logoh-2)+1;
+ else
+ bridge_c = logo_y+random()%logoh;
+ }
+ else
+ {
+ if(logow>=3)
+ bridge_c = logo_x+random()%(logow-2)+1;
+ else
+ bridge_c = logo_x+random()%logow;
+ }
+
+ if(bridge_dir==1)
+ {
+ for(i = logo_x; i < logo_x+logow; i++)
+ {
+ maze[i][bridge_c] &= ~DOOR_IN_TOP;
+ }
+ }
+ else
+ {
+ for(i = logo_y; i < logo_y+logoh; i++)
+ {
+ maze[bridge_c][i] &= ~DOOR_IN_TOP;
+ }
+ }
+ }
+
do {
move_list[sqnum].x = cur_sq_x;
move_list[sqnum].y = cur_sq_y;
if ( maze[cur_sq_x][cur_sq_y - 1] & DOOR_IN_ANY ) {
maze[cur_sq_x][cur_sq_y] |= WALL_TOP;
maze[cur_sq_x][cur_sq_y - 1] |= WALL_BOTTOM;
- draw_wall(cur_sq_x, cur_sq_y, 0);
+ draw_wall(cur_sq_x, cur_sq_y, 0, gc);
goto rightwall;
}
candidates[num_candidates++] = 0;
if ( maze[cur_sq_x + 1][cur_sq_y] & DOOR_IN_ANY ) {
maze[cur_sq_x][cur_sq_y] |= WALL_RIGHT;
maze[cur_sq_x + 1][cur_sq_y] |= WALL_LEFT;
- draw_wall(cur_sq_x, cur_sq_y, 1);
+ draw_wall(cur_sq_x, cur_sq_y, 1, gc);
goto bottomwall;
}
candidates[num_candidates++] = 1;
if ( maze[cur_sq_x][cur_sq_y + 1] & DOOR_IN_ANY ) {
maze[cur_sq_x][cur_sq_y] |= WALL_BOTTOM;
maze[cur_sq_x][cur_sq_y + 1] |= WALL_TOP;
- draw_wall(cur_sq_x, cur_sq_y, 2);
+ draw_wall(cur_sq_x, cur_sq_y, 2, gc);
goto leftwall;
}
candidates[num_candidates++] = 2;
if ( maze[cur_sq_x - 1][cur_sq_y] & DOOR_IN_ANY ) {
maze[cur_sq_x][cur_sq_y] |= WALL_LEFT;
maze[cur_sq_x - 1][cur_sq_y] |= WALL_RIGHT;
- draw_wall(cur_sq_x, cur_sq_y, 3);
+ draw_wall(cur_sq_x, cur_sq_y, 3, gc);
goto donewall;
}
candidates[num_candidates++] = 3;
static void
-draw_wall(int i, int j, int dir) /* draw a single wall */
+draw_wall(int i, int j, int dir, GC gc) /* draw a single wall */
{
switch (dir) {
case 0:
border_y + grid_height * (j+1));
break;
}
+ if(sync_p)
+ XSync(dpy, False);
}
-static int bw;
+/* Actually build a wall. */
+static void
+build_wall(i, j, dir)
+ int i, j, dir;
+{
+ /* Draw it on the screen. */
+ draw_wall(i, j, dir, gc);
+ /* Put it in the maze. */
+ switch(dir)
+ {
+ case 0:
+ maze[i][j] |= WALL_TOP;
+ if(j>0)
+ maze[i][j-1] |= WALL_BOTTOM;
+ break;
+ case 1:
+ maze[i][j] |= WALL_RIGHT;
+ if(i<maze_size_x-1)
+ maze[i+1][j] |= WALL_LEFT;
+ break;
+ case 2:
+ maze[i][j] |= WALL_BOTTOM;
+ if(j<maze_size_y-1)
+ maze[i][j+1] |= WALL_TOP;
+ break;
+ case 3:
+ maze[i][j] |= WALL_LEFT;
+ if(i>0)
+ maze[i-1][j] |= WALL_RIGHT;
+ break;
+ }
+}
+
+/* Break out a wall. */
+#if 0
+static void
+break_wall(i, j, dir)
+ int i, j, dir;
+{
+ /* Draw it on the screen. */
+ draw_wall(i, j, dir, erase_gc);
+ /* Put it in the maze. */
+ switch(dir)
+ {
+ case 0:
+ maze[i][j] &= ~WALL_TOP;
+ if(j>0)
+ maze[i][j-1] &= ~WALL_BOTTOM;
+ break;
+ case 1:
+ maze[i][j] &= ~WALL_RIGHT;
+ if(i<maze_size_x-1)
+ maze[i+1][j] &= ~WALL_LEFT;
+ break;
+ case 2:
+ maze[i][j] &= ~WALL_BOTTOM;
+ if(j<maze_size_y-1)
+ maze[i][j+1] &= ~WALL_BOTTOM;
+ break;
+ case 3:
+ maze[i][j] &= ~WALL_LEFT;
+ if(i>0)
+ maze[i-1][j] &= ~WALL_RIGHT;
+ break;
+ }
+}
+#endif /* 0 */
+
static void
draw_solid_square(int i, int j, /* draw a solid square in a square */
solve_maze (void) /* solve it with graphical feedback */
{
int i;
-
-
+ int step_x[4] = { 0, 1, 0, -1 };
+ int step_y[4] = { -1, 0, 1, 0 };
+
/* plug up the surrounding wall */
maze[start_x][start_y] |= (WALL_TOP >> start_dir);
maze[end_x][end_y] |= (WALL_TOP >> end_dir);
path[i].x = end_x;
path[i].y = end_y;
path[i].dir = -1;
+ maze[end_x][end_y] |= SOLVER_VISIT;
/* do it */
while (1) {
border_y + bw + grid_height * (int)(path[i].y),
grid_width - (bw+bw), grid_height - (bw+bw));
i--;
+ if(i<0) /* Can't solve this maze. */
+ {
+ printf("Unsolvable maze.\n");
+ return;
+ }
draw_solid_square( (int)(path[i].x), (int)(path[i].y),
(int)(path[i].dir), cgc);
}
- else if ( ! (maze[path[i].x][path[i].y] &
- (WALL_TOP >> path[i].dir)) &&
- ( (i == 0) || ( (path[i].dir !=
- (int)(path[i-1].dir+2)%4) ) ) ) {
- enter_square(i);
+ else if ( (! (maze[path[i].x][path[i].y] & (WALL_TOP >> path[i].dir))) &&
+ (!( maze[path[i].x+step_x[path[i].dir]]
+ [path[i].y+step_y[path[i].dir]]&SOLVER_VISIT)) ) {
+ path[i+1].x = path[i].x+step_x[path[i].dir];
+ path[i+1].y = path[i].y+step_y[path[i].dir];
+ path[i+1].dir = -1;
+ draw_solid_square(path[i].x, path[i].y, path[i].dir, tgc);
i++;
+ maze[path[i].x][path[i].y] |= SOLVER_VISIT;
if ( maze[path[i].x][path[i].y] & START_SQUARE ) {
return;
}
}
+#if 0
static void
enter_square (int n) /* move into a neighboring square */
{
break;
}
}
+#endif /* 0 */
/*
"*postDelay: 4000000",
"*liveColor: green",
"*deadColor: red",
+ "*generator: -1",
+ "*maxLength: 5",
+ "*syncDraw: False",
+ "*bridge: False",
#ifdef XROGER
"*logoColor: red3",
#endif
{ "-post-delay", ".postDelay", XrmoptionSepArg, 0 },
{ "-live-color", ".liveColor", XrmoptionSepArg, 0 },
{ "-dead-color", ".deadColor", XrmoptionSepArg, 0 },
+ { "-generator", ".generator", XrmoptionSepArg, 0 },
+ { "-max-length", ".maxLength", XrmoptionSepArg, 0 },
+ { "-bridge", ".bridge", XrmoptionNoArg, "True" },
+ { "-no-bridge", ".bridge", XrmoptionNoArg, "False" },
{ 0, 0, 0, 0 }
};
screenhack(Display *display, Window window)
{
Pixmap gray;
- int size, root;
+ int size, root, generator, this_gen;
XWindowAttributes xgwa;
unsigned long bg, fg, pfg, pbg, lfg;
solve_delay = get_integer_resource ("solveDelay", "Integer");
pre_solve_delay = get_integer_resource ("preDelay", "Integer");
post_solve_delay = get_integer_resource ("postDelay", "Integer");
+ generator = get_integer_resource("generator", "Integer");
+ max_length = get_integer_resource("maxLength", "Integer");
+ bridge_p = get_boolean_resource("bridge", "Boolean");
if (size < 2) size = 7 + (random () % 30);
grid_width = grid_height = size;
cgc = XCreateGC(dpy, win, 0, 0);
tgc = XCreateGC(dpy,win,0,0);
logo_gc = XCreateGC(dpy, win, 0, 0);
+ erase_gc = XCreateGC(dpy, win, 0, 0);
gray = XCreateBitmapFromData (dpy,win,gray1_bits,gray1_width,gray1_height);
XSetBackground (dpy, tgc, bg);
XSetForeground (dpy, logo_gc, lfg);
XSetBackground (dpy, logo_gc, bg);
+ XSetForeground (dpy, erase_gc, bg);
+ XSetBackground (dpy, erase_gc, bg);
XSetStipple (dpy, cgc, gray);
XSetFillStyle (dpy, cgc, FillOpaqueStippled);
}
#endif
XMapRaised(dpy, win);
- srandom(getpid());
restart = root;
+ sync_p = !(random() % 10);
+
while (1) { /* primary execution loop [ rhess ] */
if (check_events()) continue ;
if (restart || stop) goto pop;
draw_maze_border();
break;
case 3:
- create_maze();
+ this_gen = generator;
+ if(this_gen<0 || this_gen>2)
+ this_gen = random()%3;
+
+ switch(this_gen)
+ {
+ case 0:
+ create_maze();
+ break;
+ case 1:
+ alt_create_maze();
+ break;
+ case 2:
+ set_create_maze();
+ break;
+ }
break;
case 4:
XSync (dpy, False);
set_maze_sizes (wattr.width, wattr.height);
XClearWindow (dpy, win);
XSync (dpy, False);
+ sync_p = !(random() % 10);
}
}
}
maze \- an automated X11 demo repeatedly creating and solving a random maze
.SH SYNOPSIS
.B maze
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-install] [\-visual \fIvisual\fP] [\-grid\-size \fIpixels\fP] [\-live\-color \fIcolor\fP] [\-dead\-color \fIcolor\fP] [\-solve\-delay \fIusecs\fP] [\-pre\-delay \fIusecs\fP] [\-post\-delay \fIusecs\fP]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-install] [\-visual \fIvisual\fP] [\-grid\-size \fIpixels\fP] [\-live\-color \fIcolor\fP] [\-dead\-color \fIcolor\fP] [\-solve\-delay \fIusecs\fP] [\-pre\-delay \fIusecs\fP] [\-post\-delay \fIusecs\fP] [\-generator \fIinteger\fP] [\-max\-length \fIinteger\fP] [\-bridge] [\-no\-bridge]
.SH DESCRIPTION
The \fImaze\fP program creates a "random" maze and then solves it with
graphical feedback.
.B \-post\-delay \fIinteger\fP
Delay (in microseconds) after solving a maze and before generating a new one.
Default 4000000 (4 seconds.)
+.TP 8
+.B \-generator \fInum\fP
+Sets the algorithm that will be used to generate the mazes. The
+default is \-1, which randomly selects an algorithm for each maze that
+is generated. Generator 0 is the original one, and works by walking
+around randomly until we hit a place we've been before, then
+backtracking and trying a new direction somewhere. Generator 1 picks a
+random spot in the maze, then draws a straight wall from that spot in
+a random direction until it hits another wall (and continues until the
+maze is complete). Generator 2 is based on sets. Initially all cells
+are in different sets. Then two neighboring cells are chosen and if
+they are in different sets, their sets are joined. If they were in the
+same set, a wall is built between them. This continues until the maze is
+complete.
+
+All generators generate mazes with a certain 'characteristic'. See if you
+can spot them!
+.TP 8
+.B \-max\-length \fInum\fP
+Controls the maximum length of walls drawn in one go by generator 1.
+.TP 8
+.B \-bridge
+.TP 8
+.B \-no\-bridge
+Controls whether or not a 'bridge' will appear over the logo.
.PP
Clicking the mouse in the maze window controls it.
.TP 16
OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.SH AUTHOR(s)
.nf
+Johannes Keukelaar [ Generators 1 and 2 ] johannes@nada.kth.se
+ Royal Institute of Technology, Stockholm, Sweden
Jim Randell [ XScreenSaver version ] jmr@mddjmr.fc.hp.com
HPLabs, Bristol
Richard Hess [ X11 extensions ] {...}!uunet!cimshop!rhess
#define SCALE 6
struct qpoint {
- long x, y;
- long dx, dy;
+ int x, y;
+ int dx, dy;
};
struct qline {
--- /dev/null
+/* xscreensaver, Copyright (c) 1992, 1995, 1997
+ * Jamie Zawinski <jwz@netscape.com>
+ *
+ * reaction/diffusion textures
+ * Copyright (c) 1997 Scott Draves spot@transmeta.com
+ * this code is derived from Bomb
+ * see http://www.cs.cmu.edu/~spot/bomb.html
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * And remember: X Windows is to graphics hacking as roman numerals are to
+ * the square root of pi.
+ */
+
+#include <math.h>
+
+#include "screenhack.h"
+
+/* why doesn't this work??? */
+#ifdef HAVE_XSHM_EXTENSION
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <X11/extensions/XShm.h>
+#endif
+
+#define test_pattern_hyper 0
+
+/* costs ~6% speed */
+#define dither_when_mapped 1
+
+char *progclass = "RD";
+
+
+char *defaults [] = {
+ "RD.background: black", /* to placate SGI */
+ "RD.foreground: white",
+ "*width: 100",
+ "*height: 100",
+ "*epoch: 40000",
+ "*palette: -1",
+ "*reaction: -1",
+ "*diffusion: -1",
+ "*verbose: off",
+ "*radius: -1",
+ "*speed: 0.0",
+ "*size: 0.66",
+ "*delay: 1000",
+ "*colors: -1",
+ 0
+};
+
+XrmOptionDescRec options [] = {
+ { "-width", ".width", XrmoptionSepArg, 0 },
+ { "-height", ".height", XrmoptionSepArg, 0 },
+ { "-epoch", ".epoch", XrmoptionSepArg, 0 },
+ { "-palette", ".palette", XrmoptionSepArg, 0 },
+ { "-reaction", ".reaction", XrmoptionSepArg, 0 },
+ { "-diffusion", ".diffusion", XrmoptionSepArg, 0 },
+ { "-verbose", ".verbose", XrmoptionSepArg, 0 },
+ { "-radius", ".radius", XrmoptionSepArg, 0 },
+ { "-speed", ".speed", XrmoptionSepArg, 0 },
+ { "-size", ".size", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-ncolors", ".colors", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
+};
+
+#define bps 16
+#define mx ((1<<16)-1)
+
+/* you can replace integer mults wish shift/adds with these,
+ but it doesn't help on my 586 */
+#define x5(n) ((n<<2)+n)
+#define x7(n) ((n<<3)-n)
+
+/* why strip bit? */
+#define R (ya_random()&((1<<30)-1))
+
+/* should factor into RD-specfic and compute-every-pixel general */
+void
+screenhack (Display *dpy, Window win)
+{
+ GC gc;
+ XGCValues gcv;
+ XWindowAttributes xgwa;
+ Colormap cmap = 0;
+ XImage *image;
+ int width, height, radius;
+ int array_width, array_height;
+ double array_x, array_y;
+ double array_dx, array_dy;
+ int w2;
+ int frame = 0, epoch_time;
+ char *p;
+ int vdepth, pdepth;
+ ushort *r1, *r2, *r1b, *r2b;
+ int npix;
+ int reaction = 0;
+ int diffusion = 0;
+ int verbose;
+ int mapped;
+ int *m = 0;
+#if dither_when_mapped
+ unsigned char *mc = 0;
+#endif
+#ifdef HAVE_XSHM_EXTENSION
+ int use_shm = 0;
+ XShmSegmentInfo shm_info;
+#endif
+ int ncolors = 0;
+ XColor *colors = 0;
+
+ int delay = get_float_resource ("delay", "Integer");
+
+ XGetWindowAttributes (dpy, win, &xgwa);
+ width = get_integer_resource ("width", "Integer");
+ height = get_integer_resource ("height", "Integer");
+ {
+ double s = get_float_resource ("size", "Float");
+ double p = get_float_resource ("speed", "Float");
+ if (s < 0.0 || s > 1.0)
+ s = 1.0;
+ s = sqrt(s);
+ array_width = xgwa.width * s;
+ array_height = xgwa.height * s;
+ if (s < 0.99) {
+ array_width = (array_width / width) * width;
+ array_height = (array_height / height) * height;
+ }
+ if (array_width < width) array_width = width;
+ if (array_height < height) array_height = height;
+ array_x = (xgwa.width - array_width)/2;
+ array_y = (xgwa.height - array_height)/2;
+ array_dx = p;
+ array_dy = .31415926 * p;
+ }
+ if (width < 10) width = 10;
+ if (height < 10) height = 10;
+ verbose = get_boolean_resource ("verbose", "Boolean");
+ npix = (width + 2) * (height + 2);
+ epoch_time = get_integer_resource ("epoch", "Integer");
+ w2 = width + 2;
+ gcv.function = GXcopy;
+ gc = XCreateGC(dpy, win, GCFunction, &gcv);
+ vdepth = visual_depth(DefaultScreenOfDisplay(dpy), xgwa.visual);
+
+ /* This code only deals with pixmap depths of 1, 8, 16, and 32.
+ Therefore, we assume that those depths will be supported by the
+ coresponding visual depths (that depth-24 displays accept depth-32
+ pixmaps, and that depth-12 displays accept depth-16 pixmaps.) */
+ pdepth = (vdepth == 1 ? 1 :
+ vdepth <= 8 ? 8 :
+ vdepth <= 16 ? 16 :
+ 32);
+
+ cmap = xgwa.colormap;
+ ncolors = get_integer_resource ("colors", "Integer");
+
+ if (ncolors <= 0) {
+ if (vdepth > 8)
+ ncolors = 2047;
+ else
+ ncolors = 255;
+ }
+
+ if (mono_p || ncolors < 2) ncolors = 2;
+ if (ncolors <= 2) mono_p = True;
+ colors = (XColor *) malloc(sizeof(*colors) * (ncolors+1));
+
+ mapped = (vdepth <= 8 &&
+ has_writable_cells(xgwa.screen, xgwa.visual));
+
+ if (!mapped)
+ m = (int *) malloc(sizeof(int) * (1<<16));
+#if dither_when_mapped
+ else {
+ int i, di;
+ mc = (unsigned char *) malloc(1<<16);
+ for (i = 0; i < (1<<16); i++) {
+ di = (i + (ya_random()&255))>>8;
+ if (di > 255) di = 255;
+ mc[i] = di;
+ }
+ }
+#endif
+ p = malloc(npix * (pdepth == 1 ? 1 : (pdepth / 8)));
+ r1 = (ushort *) malloc(sizeof(ushort) * npix);
+ r2 = (ushort *) malloc(sizeof(ushort) * npix);
+ r1b = (ushort *) malloc(sizeof(ushort) * npix);
+ r2b = (ushort *) malloc(sizeof(ushort) * npix);
+ if (!p || !r1 || !r2 || !r1b || !r2b) {
+ fprintf(stderr, "not enough memory for %d pixels.\n", npix);
+ exit(1);
+ }
+
+#ifdef HAVE_XSHM_EXTENSION
+ if (use_shm) {
+ printf("p=%X\n", p);
+ free(p);
+ image = XShmCreateImage(dpy, xgwa.visual, vdepth,
+ ZPixmap, 0, &shm_info, width, height);
+ shm_info.shmid = shmget(IPC_PRIVATE,
+ image->bytes_per_line * image->height,
+ IPC_CREAT | 0777);
+ if (shm_info.shmid == -1)
+ printf ("shmget failed!");
+ shm_info.readOnly = False;
+ p = shmat(shm_info.shmid, 0, 0);
+ printf("p=%X %d\n", p, image->bytes_per_line);
+ XShmAttach(dpy, &shm_info);
+ XSync(dpy, False);
+ } else
+#endif
+ image = XCreateImage(dpy, xgwa.visual, vdepth,
+ ZPixmap, 0, p,
+ width, height, 8, 0);
+
+ while (1) {
+ int i, j;
+ ushort *t;
+#if test_pattern_hyper
+ if (frame&0x100)
+ sleep(1);
+#endif
+ if (verbose) {
+ double tm = 0;
+ struct timeval tp;
+ struct timezone tzp;
+ if (!(frame%100)) {
+ double tm2;
+ gettimeofday(&tp, &tzp);
+ tm2 = tp.tv_sec + tp.tv_usec * 1e-6;
+ if (frame > 0)
+ printf("fps = %2.4g\n", 100.0 / (tm2 - tm));
+ tm = tm2;
+ }
+ }
+ if (!(frame%epoch_time)) {
+ int s;
+ if (0 != frame) {
+ int t = epoch_time / 500;
+ if (t > 15)
+ t = 15;
+ sleep(t);
+ }
+
+ for (i = 0; i < npix; i++) {
+ /* equilibrium */
+ r1[i] = 65500;
+ r2[i] = 11;
+ }
+
+ memset(colors, 0, ncolors*sizeof(*colors));
+ make_smooth_colormap (dpy, xgwa.visual, cmap, colors, &ncolors,
+ True, 0, True);
+ if (ncolors <= 2) {
+ mono_p = True;
+ ncolors = 2;
+ colors[0].flags = DoRed|DoGreen|DoBlue;
+ colors[0].red = colors[0].green = colors[0].blue = 0;
+ XAllocColor(dpy, cmap, &colors[0]);
+ colors[1].flags = DoRed|DoGreen|DoBlue;
+ colors[1].red = colors[1].green = colors[1].blue = 0xFFFF;
+ XAllocColor(dpy, cmap, &colors[1]);
+ }
+
+ /* Scale it up so that there are exactly 255 colors -- that keeps the
+ animation speed consistent, even when there aren't many allocatable
+ colors, and prevents the -mono mode from looking like static. */
+ if (ncolors != 255) {
+ int i, n = 255;
+ double scale = (double) ncolors / (double) (n+1);
+ XColor *c2 = (XColor *) malloc(sizeof(*c2) * (n+1));
+ for (i = 0; i < n; i++)
+ c2[i] = colors[(int) (i * scale)];
+ free(colors);
+ colors = c2;
+ ncolors = n;
+ }
+
+
+ XSetWindowBackground(dpy, win, colors[255 % ncolors].pixel);
+ XClearWindow(dpy, win);
+
+ s = w2 * height/2 + width/2;
+ radius = get_integer_resource ("radius", "Integer");
+ if (radius < 0)
+ radius = 1 + ((R%10) ? (R%5) : (R % (width/2-2)));
+ for (i = -radius; i < (radius+1); i++)
+ for (j = -radius; j < (radius+1); j++)
+ r2[s + i + j*w2] = mx - (R&63);
+ reaction = get_integer_resource ("reaction", "Integer");
+ if (reaction < 0 || reaction > 2) reaction = R&1;
+ diffusion = get_integer_resource ("diffusion", "Integer");
+ if (diffusion < 0 || diffusion > 2)
+ diffusion = (R%5) ? ((R%3)?0:1) : 2;
+ if (2 == reaction && 2 == diffusion)
+ reaction = diffusion = 0;
+
+/* if (verbose)
+ printf("reaction = %d\ndiffusion = %d\n"
+ "palette = %d\nradius = %d\n",
+ reaction, diffusion, palette, radius);
+*/
+ }
+ for (i = 0; i <= width+1; i++) {
+ r1[i] = r1[i + w2 * height];
+ r2[i] = r2[i + w2 * height];
+ r1[i + w2 * (height + 1)] = r1[i + w2];
+ r2[i + w2 * (height + 1)] = r2[i + w2];
+ }
+ for (i = 0; i <= height+1; i++) {
+ r1[w2 * i] = r1[width + w2 * i];
+ r2[w2 * i] = r2[width + w2 * i];
+ r1[w2 * i + width + 1] = r1[w2 * i + 1];
+ r2[w2 * i + width + 1] = r2[w2 * i + 1];
+ }
+ for (i = 0; i < height; i++) {
+ int ii = i + 1;
+ char *q = p + width * i;
+ short *qq = ((short *) p) + width * i;
+ long *qqq = ((long *) p) + width * i;
+ ushort *i1 = r1 + 1 + w2 * ii;
+ ushort *i2 = r2 + 1 + w2 * ii;
+ ushort *o1 = r1b + 1 + w2 * ii;
+ ushort *o2 = r2b + 1 + w2 * ii;
+ for (j = 0; j < width; j++) {
+#if test_pattern_hyper
+ int r1 = (i * j + (frame&127)*frame)&65535;
+#else
+ int uvv, r1 = 0, r2 = 0;
+ switch (diffusion) {
+ case 0:
+ r1 = i1[j] + i1[j+1] + i1[j-1] + i1[j+w2] + i1[j-w2];
+ r1 = r1 / 5;
+ r2 = (i2[j]<<3) + i2[j+1] + i2[j-1] + i2[j+w2] + i2[j-w2];
+ r2 = r2 / 12;
+ break;
+ case 1:
+ r1 = i1[j+1] + i1[j-1] + i1[j+w2] + i1[j-w2];
+ r1 = r1 >> 2;
+ r2 = (i2[j]<<2) + i2[j+1] + i2[j-1] + i2[j+w2] + i2[j-w2];
+ r2 = r2 >> 3;
+ break;
+ case 2:
+ r1 = (i1[j]<<1) + (i1[j+1]<<1) + (i1[j-1]<<1) + i1[j+w2] + i1[j-w2];
+ r1 = r1 >> 3;
+ r2 = (i2[j]<<2) + i2[j+1] + i2[j-1] + i2[j+w2] + i2[j-w2];
+ r2 = r2 >> 3;
+ break;
+ }
+ uvv = (((r1 * r2) >> bps) * r2) >> bps;
+ switch (reaction) { /* costs 4% */
+ case 0:
+ r1 += 4 * (((28 * (mx-r1)) >> 10) - uvv);
+ r2 += 4 * (uvv - ((80 * r2) >> 10));
+ break;
+ case 1:
+ r1 += 3 * (((27 * (mx-r1)) >> 10) - uvv);
+ r2 += 3 * (uvv - ((80 * r2) >> 10));
+ break;
+ case 2:
+ r1 += 2 * (((28 * (mx-r1)) >> 10) - uvv);
+ r2 += 3 * (uvv - ((80 * r2) >> 10));
+ break;
+ }
+ if (r1 > mx) r1 = mx;
+ if (r2 > mx) r2 = mx;
+ if (r1 < 0) r1 = 0;
+ if (r2 < 0) r2 = 0;
+ o1[j] = r1;
+ o2[j] = r2;
+#endif
+
+ if (mapped)
+#if dither_when_mapped
+ q[j] = colors[mc[r1] % ncolors].pixel;
+#else
+ q[j] = colors[(r1>>8) % ncolors].pixel;
+#endif
+ else if (pdepth == 8)
+ q[j] = colors[(r1>>8) % ncolors].pixel;
+ else if (pdepth == 16)
+ qq[j] = colors[(r1>>8) % ncolors].pixel;
+ else if (pdepth == 32)
+ qqq[j] = colors[(r1>>8) % ncolors].pixel;
+ else
+ abort();
+ }
+ }
+ t = r1; r1 = r1b; r1b = t;
+ t = r2; r2 = r2b; r2b = t;
+ for (i = 0; i < array_width; i += width)
+ for (j = 0; j < array_height; j += height)
+#ifdef HAVE_XSHM_EXTENSION
+ if (use_shm)
+ XShmPutImage(dpy, win, gc, image, 0, 0, i, j,
+ width, height, False);
+ else
+#endif
+ XPutImage(dpy, win, gc, image, 0, 0, i+array_x, j+array_y, width, height);
+
+ array_x += array_dx;
+ array_y += array_dy;
+ if (array_x < 0) {
+ array_x = 0;
+ array_dx = -array_dx;
+ } else if (array_x > (xgwa.width - array_width)) {
+ array_x = (xgwa.width - array_width);
+ array_dx = -array_dx;
+ }
+ if (array_y < 0) {
+ array_y = 0;
+ array_dy = -array_dy;
+ } else if (array_y > (xgwa.height - array_height)) {
+ array_y = (xgwa.height - array_height);
+ array_dy = -array_dy;
+ }
+ frame++;
+
+ XSync(dpy, False);
+ if (delay > 0)
+ usleep(delay);
+ }
+}
--- /dev/null
+.TH XScreenSaver 1 "10-May-97" "X Version 11"
+.SH NAME
+rd-bomb - reaction/diffusion textures
+.SH SYNOPSIS
+.B rd-bomb
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP]
+[\-background \fIcolor\fP] [\-window] [\-root] [\-install]
+[\-visual \fIvisual\fP] [\-width \fIn\fP] [\-height \fIn\fP]
+[\-reaction \fIn\fP] [\-diffusion \fIn\fP]
+[\-size \fIf\fP] [\-speed \fIf\fP] [\-delay \fIusecs\fP]
+.SH DESCRIPTION
+
+The \fIrd-bomb\fP program draws reaction/diffusion textures. The code
+is derived from the 'd' mode of the "bomb" visual musical instrument
+(see http://www.cs.cmu.edu/~spot/bomb.html). I got the equations from
+xmorphia (http://www.ccsf.caltech.edu/ismap/image.html), which is
+based on a version of the Gray-Scott model taken from:
+ John E. Pearson "Complex Patterns in a Simple System"
+ Science, 261,189, 9 July 1993.
+
+If the frame-rate is too low, consider decreasing the width and height
+of the tile, or decreasing the size of the active part of the screen.
+
+.SH OPTIONS
+
+If one of the reaction, diffusion, radius, and palette options is set
+to a negative value, then that option will be set to a random
+appropriate value.
+
+Be sure to try "-speed 1 -size 0.1 -epoch 3000".
+
+.I rd-bomb
+accepts the following options:
+.TP 8
+.B \-window
+Draw on a newly-created window. This is the default.
+.TP 8
+.B \-root
+Draw on the root window.
+.TP 8
+.B \-install
+Install a private colormap for the window.
+.TP 8
+.B \-visual \fIvisual\fP
+Specify which visual to use. Legal values are the name of a visual class,
+or the id number (decimal or hex) of a specific visual.
+.TP 8
+.B \-width \fIn\fP
+.TP 8
+.B \-height \fIn\fP
+Specify the size of the tile, in pixels.
+.TP 8
+.B \-reaction \fIn\fP
+.TP 8
+.B \-diffusion \fIn\fP
+These are constants in the equations that effect its visual nature.
+Each may be one of 0, 1, or 2.
+.TP 8
+.B \-radius \fIn\fP
+Size of the seed.
+.TP 8
+.B \-palette \fIn\fP
+Selects a palette. Must be between 0 and 80, inclusive.
+.TP 8
+.B \-size \fIf\fP
+What fraction of the window is actively drawn, a floating point number
+between 0 (exclusive) and 1 (inclusive). Default is 0.66.
+.TP 8
+.B \-speed \fIf\fP
+When a fraction of the screen is active, the active area moves at this
+rate (a floating point number). Default is zero. Suggested value: 1.0.
+.TP 8
+.B \-delay \fIusecs\fP
+How many microseconds to delay between frames; default 1000, or
+about 1/1000th of a second.
+.SH ENVIRONMENT
+.PP
+.TP 8
+.B DISPLAY
+to get the default host and display number.
+.TP 8
+.B XENVIRONMENT
+to get the name of a resource file that overrides the global resources
+stored in the RESOURCE_MANAGER property.
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1),
+.BR xlock (1)
+.SH COPYRIGHT
+Copyright \(co 1997 by Scott Draves.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation.
+.SH AUTHOR
+Scott Draves <spot@cs.cmu.edu>, 9/97
* implied warranty.
*/
-/* Flying through an asteroid field. Based on TI Explorer Lisp code by
+/* 18-Sep-97: Johannes Keukelaar <johannes@nada.kth.se>: Added some color.
+ * Using -mono gives the old behaviour. (Modified by jwz.)
+ */
+/* Flying through an asteroid field. Based on TI Explorer Lisp code by
John Nguyen <johnn@hx.lcs.mit.edu>
*/
static Window window;
static int width, height, midx, midy;
static int dep_x, dep_y;
+static int ncolors;
+static XColor *colors;
static float max_dep;
-static GC draw_gc, erase_gc;
+static GC erase_gc;
+static GC *draw_gcs;
static Bool rotate_p;
static Bool move_p;
static int speed;
int depth;
int size, x, y;
int diff;
+ int color;
};
static struct rock *rocks;
rock->r = (SIN_RESOLUTION * 0.7) + (random () % (30 * SIN_RESOLUTION));
rock->theta = random () % SIN_RESOLUTION;
rock->depth = MAX_DEPTH * DEPTH_SCALE;
+ rock->color = random() % ncolors;
rock_compute (rock);
rock_draw (rock, True);
}
Bool draw_p;
{
GC gc = (draw_p
- ? (threed ? erase_gc : draw_gc)
+ ? (threed ? erase_gc : draw_gcs[rock->color])
: erase_gc);
if (rock->x <= 0 || rock->y <= 0 || rock->x >= width || rock->y >= height)
XGCValues gcv;
Colormap cmap;
XWindowAttributes xgwa;
- unsigned int fg, bg;
+ unsigned int bg;
dpy = d;
window = w;
XGetWindowAttributes (dpy, window, &xgwa);
if (speed > 100) speed = 100;
rotate_p = get_boolean_resource ("rotate", "Boolean");
move_p = get_boolean_resource ("move", "Boolean");
- fg = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+ if (mono_p)
+ ncolors = 2;
+ else
+ ncolors = get_integer_resource ("colors", "Colors");
+
+ if (ncolors < 2)
+ {
+ ncolors = 2;
+ mono_p = True;
+ }
+
+ colors = (XColor *) malloc(ncolors * sizeof(*colors));
+ draw_gcs = (GC *) malloc(ncolors * sizeof(*draw_gcs));
+
bg = get_pixel_resource ("background", "Background", dpy, cmap);
- gcv.foreground = fg;
- gcv.background = bg;
- draw_gc = XCreateGC (dpy, window, GCForeground|GCBackground, &gcv);
+ colors[0].pixel = bg;
+ colors[0].flags = DoRed|DoGreen|DoBlue;
+ XQueryColor(dpy, cmap, &colors[0]);
+
+ ncolors--;
+ make_random_colormap(dpy, xgwa.visual, cmap, colors+1, &ncolors, True,
+ True, 0, True);
+ ncolors++;
+
+ if (ncolors < 2)
+ {
+ ncolors = 2;
+ mono_p = True;
+ }
+
+ if (mono_p)
+ {
+ unsigned int fg = get_pixel_resource("foreground", "Foreground",
+ dpy, cmap);
+ colors[1].pixel = fg;
+ colors[1].flags = DoRed|DoGreen|DoBlue;
+ XQueryColor(dpy, cmap, &colors[1]);
+ gcv.foreground = fg;
+ gcv.background = bg;
+ draw_gcs[0] = XCreateGC (dpy, window, GCForeground|GCBackground, &gcv);
+ draw_gcs[1] = draw_gcs[0];
+ }
+ else
+ for( i = 0; i < ncolors; i++ )
+ {
+ gcv.foreground = colors[i].pixel;
+ gcv.background = bg;
+ draw_gcs[i] = XCreateGC (dpy, window, GCForeground|GCBackground, &gcv);
+ }
+
gcv.foreground = bg;
- gcv.background = fg;
erase_gc = XCreateGC (dpy, window, GCForeground|GCBackground, &gcv);
max_dep = (move_p ? MAX_DEP : 0);
}
/* don't want any exposure events from XCopyPlane */
- XSetGraphicsExposures (dpy, draw_gc, False);
+ for( i = 0; i < ncolors; i++)
+ XSetGraphicsExposures (dpy, draw_gcs[i], False);
XSetGraphicsExposures (dpy, erase_gc, False);
nrocks = get_integer_resource ("count", "Count");
char *defaults [] = {
"Rocks.background: Black", /* to placate SGI */
"Rocks.foreground: #E9967A",
+ "*colors: 5",
"*count: 100",
"*delay: 50000",
"*speed: 100",
{"-left3d", ".left3d", XrmoptionSepArg, 0 },
{"-right3d", ".right3d", XrmoptionSepArg, 0 },
{"-delta3d", ".delta3d", XrmoptionSepArg, 0 },
+ { "-colors", ".colors", XrmoptionSepArg, 0 },
{ 0, 0, 0, 0 }
};
rocks - animation of flying through an asteroid field
.SH SYNOPSIS
.B rocks
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-install] [\-visual \fIvisual\fP] [\-count \fIinteger\fP] [\-delay \fIusecs\fP] [\-speed \fIinteger\fP] [\-norotate] [\-nomove] [\-3d]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-ncolors \fIn\fP] [\-install] [\-visual \fIvisual\fP] [\-count \fIinteger\fP] [\-delay \fIusecs\fP] [\-speed \fIinteger\fP] [\-norotate] [\-nomove] [\-3d]
.SH DESCRIPTION
The \fIrocks\fP program draws an animation of an asteroid field moving past
the observer (or vice versa). Sometimes the observer picks up spin on Z axis.
.B \-root
Draw on the root window.
.TP 8
+.B \-mono
+Make all the rocks the same color.
+.TP 8
+.B \-ncolors colors
+How many different colors to use. Default 5. Colors are chosen randomly.
+.TP 8
.B \-install
Install a private colormap for the window.
.TP 8
* 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 erase_speed, sleep_time, erase_mode;
+
+void erase_window (Display *dpy, Window win, GC gc, int width, int height,
+ int mode, int delay);
static void
init_rorschach (Display *dpy, Window window)
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);
- }
+ sleep ( sleep_time );
+
+ erase_window(dpy, window, erase_gc, xlim, ylim, erase_mode, erase_speed);
+
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XSync (dpy, True);
"*ysymmetry: false",
"*iterations: 4000",
"*offset: 4",
+ "Rorschach.eraseSpeed: 400",
+ "Rorschach.delay: 5",
+ "Rorschach.eraseMode: -1",
0
};
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
{ "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" },
+ { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-erase-mode", ".eraseMode", XrmoptionSepArg, 0 },
{ 0, 0, 0, 0 }
};
void
screenhack (Display *dpy, Window window)
{
+ erase_speed = get_integer_resource("eraseSpeed", "Integer");
+ sleep_time = get_integer_resource("delay", "Integer");
+ erase_mode = get_integer_resource("eraseMode", "Integer");
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);
rorschach - simulate ink-blot patterns
.SH SYNOPSIS
.B rorschach
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-iterations \fIinteger\fP] [\-offset \fIinteger\fP] [\-xsymmetry] [\-ysymmetry]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-iterations \fIinteger\fP] [\-offset \fIinteger\fP] [\-xsymmetry] [\-ysymmetry] [\-erase\-mode \fIinteger\fP] [\-erase\-speed \fIusecs\fP] [\-delay \fIsecs\fP]
.SH DESCRIPTION
The \fIrorschach\fP program draws random patterns reminiscent of the
psychological test of same name.
.TP 8
.B \-ysymmetry
Whether the images should be vertically symmetrical. Default false.
+.TP 8
+.B \-erase\-mode \fIinteger\fP
+This sets the erase mode. Mode \-1 chooses a random mode each time. There
+are currently 6 modes defined (0\-5).
+.TP 8
+.B \-erase\-speed \fIusecs\fP
+This controls the speed at which the screen will be erased. (Delay between
+erasing of individual lines.)
+.TP 8
+.B \-delay \fIseconds\fP
+This sets the number of seconds that the figure will be on the screen.
.SH ENVIRONMENT
.PP
.TP 8
/* -*- Mode: C; tab-width: 4 -*-
- * tri --- Sierpinski triangle fractal.
+ * sierpinski --- Sierpinski's triangle fractal.
*/
#if !defined( lint ) && !defined( SABER )
-static const char sccsid[] = "@(#)tri.c 4.00 97/01/01 xlockmore";
+static const char sccsid[] = "@(#)sierpinski.c 4.05 97/09/19 xlockmore";
#endif
-/* Copyright (c) 1988-91 by Patrick J. Naughton.
+/* Copyright (c) 1996 by Desmond Daignault
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* other special, indirect and consequential damages.
*
* Revision History:
+ * 18-Sep-97: 3D version Antti Kuntsi <kuntsi@iki.fi>.
+ * 20-May-97: Changed the name tri to sierpinski for more compatiblity
* 10-May-97: jwz@netscape.com: turned into a standalone program.
* 05-Sep-96: Desmond Daignault Datatimes Incorporated
* <tekdd@dtol.datatimes.com> .
#ifdef STANDALONE
# define PROGCLASS "Sierpinski"
-# define HACK_INIT init_tri
-# define HACK_DRAW draw_tri
-# define tri_opts xlockmore_opts
+# define HACK_INIT init_sierpinski
+# define HACK_DRAW draw_sierpinski
+# define sierpinski_opts xlockmore_opts
# define DEFAULTS "*count: 2000 \n" \
"*cycles: 100 \n" \
"*delay: 400000 \n" \
# include "xlock.h" /* from the xlockmore distribution */
#endif /* !STANDALONE */
-ModeSpecOpt tri_opts = {
- 0, NULL, 0, NULL, NULL };
+ModeSpecOpt sierpinski_opts =
+{0, NULL, 0, NULL, NULL};
+
+#define MAXCORNERS 4
typedef struct {
int width, height;
int time;
int px, py;
int total_npoints;
- int npoints[3];
- unsigned long colors[3];
- XPoint *pointBuffer[3];
- XPoint vertex[3];
-} tristruct;
+ int corners;
+ int npoints[MAXCORNERS];
+ unsigned long colors[MAXCORNERS];
+ XPoint *pointBuffer[MAXCORNERS];
+ XPoint vertex[MAXCORNERS];
+} sierpinskistruct;
-static tristruct *tris = NULL;
+static sierpinskistruct *tris = NULL;
static void
startover(ModeInfo * mi)
{
int j;
- tristruct *tp = &tris[MI_SCREEN(mi)];
+ sierpinskistruct *sp = &tris[MI_SCREEN(mi)];
if (MI_NPIXELS(mi) > 2) {
- tp->colors[0] = (NRAND(MI_NPIXELS(mi)));
- tp->colors[1] = (tp->colors[0] + MI_NPIXELS(mi) / 7 +
- NRAND(2 * MI_NPIXELS(mi) / 7)) % MI_NPIXELS(mi);
- tp->colors[2] = (tp->colors[0] + 4 * MI_NPIXELS(mi) / 7 +
- NRAND(2 * MI_NPIXELS(mi) / 7)) % MI_NPIXELS(mi);
+ if (sp->corners == 3) {
+ sp->colors[0] = (NRAND(MI_NPIXELS(mi)));
+ sp->colors[1] = (sp->colors[0] + MI_NPIXELS(mi) / 7 +
+ NRAND(2 * MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+ sp->colors[2] = (sp->colors[0] + 4 * MI_NPIXELS(mi) / 7 +
+ NRAND(2 * MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+ } else if (sp->corners == 4) {
+ sp->colors[0] = (NRAND(MI_NPIXELS(mi)));
+ sp->colors[1] = (sp->colors[0] + MI_NPIXELS(mi) / 7 +
+ NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+ sp->colors[2] = (sp->colors[0] + 3 * MI_NPIXELS(mi) / 7 +
+ NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+ sp->colors[3] = (sp->colors[0] + 5 * MI_NPIXELS(mi) / 7 +
+ NRAND(MI_NPIXELS(mi) / 7 + 1)) % MI_NPIXELS(mi);
+ } else {
+ (void) fprintf(stderr, "colors not set for %d corners\n", sp->corners);
+ }
}
- for (j = 0; j < 3; j++) {
- tp->vertex[j].x = NRAND(tp->width);
- tp->vertex[j].y = NRAND(tp->height);
+ for (j = 0; j < sp->corners; j++) {
+ sp->vertex[j].x = NRAND(sp->width);
+ sp->vertex[j].y = NRAND(sp->height);
}
- tp->px = NRAND(tp->width);
- tp->py = NRAND(tp->height);
- tp->time = 0;
+ sp->px = NRAND(sp->width);
+ sp->py = NRAND(sp->height);
+ sp->time = 0;
XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi));
}
void
-init_tri(ModeInfo * mi)
+init_sierpinski(ModeInfo * mi)
{
- tristruct *tp;
+ sierpinskistruct *sp;
int i;
if (tris == NULL) {
- if ((tris = (tristruct *) calloc(MI_NUM_SCREENS(mi),
- sizeof (tristruct))) == NULL)
+ if ((tris = (sierpinskistruct *) calloc(MI_NUM_SCREENS(mi),
+ sizeof (sierpinskistruct))) == NULL)
return;
}
- tp = &tris[MI_SCREEN(mi)];
-
- tp->width = MI_WIN_WIDTH(mi);
- tp->height = MI_WIN_HEIGHT(mi);
-
- tp->total_npoints = MI_BATCHCOUNT(mi);
- if (tp->total_npoints < 1)
- tp->total_npoints = 1;
- for (i = 0; i < 3; i++) {
- if (!tp->pointBuffer[i])
- tp->pointBuffer[i] = (XPoint *) malloc(tp->total_npoints *
+ sp = &tris[MI_SCREEN(mi)];
+
+ sp->width = MI_WIN_WIDTH(mi);
+ sp->height = MI_WIN_HEIGHT(mi);
+
+ sp->total_npoints = MI_BATCHCOUNT(mi);
+ if (sp->total_npoints < 1)
+ sp->total_npoints = 1;
+ sp->corners = (LRAND() & 1) + 3;
+ for (i = 0; i < sp->corners; i++) {
+ if (!sp->pointBuffer[i])
+ sp->pointBuffer[i] = (XPoint *) malloc(sp->total_npoints *
sizeof (XPoint));
}
startover(mi);
}
void
-draw_tri(ModeInfo * mi)
+draw_sierpinski(ModeInfo * mi)
{
Display *display = MI_DISPLAY(mi);
GC gc = MI_GC(mi);
- tristruct *tp = &tris[MI_SCREEN(mi)];
- XPoint *xp[3];
+ sierpinskistruct *sp = &tris[MI_SCREEN(mi)];
+ XPoint **xp;
int i = 0, v;
+ xp = (XPoint **) malloc (sp->corners * sizeof (XPoint *));
+
if (MI_NPIXELS(mi) <= 2)
XSetForeground(display, gc, MI_WIN_WHITE_PIXEL(mi));
- for (i = 0; i < 3; i++)
- xp[i] = tp->pointBuffer[i];
- for (i = 0; i < tp->total_npoints; i++) {
- v = NRAND(3);
- tp->px = (tp->px + tp->vertex[v].x) / 2;
- tp->py = (tp->py + tp->vertex[v].y) / 2;
- xp[v]->x = tp->px;
- xp[v]->y = tp->py;
+ for (i = 0; i < sp->corners; i++)
+ xp[i] = sp->pointBuffer[i];
+ for (i = 0; i < sp->total_npoints; i++) {
+ v = NRAND(sp->corners);
+ sp->px = (sp->px + sp->vertex[v].x) / 2;
+ sp->py = (sp->py + sp->vertex[v].y) / 2;
+ xp[v]->x = sp->px;
+ xp[v]->y = sp->py;
xp[v]++;
- tp->npoints[v]++;
+ sp->npoints[v]++;
}
- for (i = 0; i < 3; i++) {
+ for (i = 0; i < sp->corners; i++) {
if (MI_NPIXELS(mi) > 2)
- XSetForeground(display, gc, MI_PIXEL(mi, tp->colors[i]));
- XDrawPoints(display, MI_WINDOW(mi), gc, tp->pointBuffer[i], tp->npoints[i],
+ XSetForeground(display, gc, MI_PIXEL(mi, sp->colors[i]));
+ XDrawPoints(display, MI_WINDOW(mi), gc, sp->pointBuffer[i], sp->npoints[i],
CoordModeOrigin);
- tp->npoints[i] = 0;
+ sp->npoints[i] = 0;
}
- if (++tp->time >= MI_CYCLES(mi))
+ if (++sp->time >= MI_CYCLES(mi))
startover(mi);
+
+ free (xp);
}
void
-release_tri(ModeInfo * mi)
+release_sierpinski(ModeInfo * mi)
{
if (tris != NULL) {
int screen, i;
for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- for (i = 0; i < 3; i++)
+ for (i = 0; i < MAXCORNERS; i++)
if (tris[screen].pointBuffer[i] != NULL) {
(void) free((void *) tris[screen].pointBuffer[i]);
}
}
void
-refresh_tri(ModeInfo * mi)
+refresh_sierpinski(ModeInfo * mi)
{
/* Do nothing, it will refresh by itself */
}
$ decays*creen:== $'mydir'decayscreen
$ deco :== $'mydir'deco
$ drift :== $'mydir'drift
+$ fadeplot :== $'mydir'fadeplot
$ flag :== $'mydir'flag
$ flame :== $'mydir'flame
$ forest :== $'mydir'forest
SRCS = alpha.c colors.c fade.c grabscreen.c hsv.c overlay.c \
resources.c spline.c usleep.c visual.c xmu.c xroger.c \
- yarandom.c
+ yarandom.c erase.c
OBJS = alpha.o colors.o fade.o grabscreen.o hsv.o overlay.o \
resources.o spline.o usleep.o visual.o xmu.o xroger.o \
- yarandom.o
+ yarandom.o erase.o
HDRS = alpha.h colors.h fade.h grabscreen.h hsv.h resources.h \
spline.h usleep.h utils.h version.h visual.h vroot.h xmu.h \
- yarandom.h
+ yarandom.h erase.h
EXTRAS = README Makefile.in ad2c
VMSFILES = compile_axp.com compile_decc.com vms-gtod.c vms-gtod.h \
vms-strdup.c
xroger.o: $(srcdir)/../config.h
yarandom.o: $(srcdir)/../config.h
yarandom.o: $(srcdir)/yarandom.h
+erase.o: $(srcdir)/utils.h
+erase.o: $(srcdir)/../config.h
+erase.o: $(srcdir)/yarandom.h
+erase.o: $(srcdir)/usleep.h
free_colors(Display *dpy, Colormap cmap, XColor *colors, int ncolors)
{
int i;
- unsigned long *pixels = (unsigned long *) malloc(sizeof(*pixels) * ncolors);
- for (i = 0; i < ncolors; i++)
- pixels[i] = colors[i].pixel;
- XFreeColors (dpy, cmap, pixels, ncolors, 0L);
- free(pixels);
+ if (ncolors > 0)
+ {
+ unsigned long *pixels = (unsigned long *)
+ malloc(sizeof(*pixels) * ncolors);
+ for (i = 0; i < ncolors; i++)
+ pixels[i] = colors[i].pixel;
+ XFreeColors (dpy, cmap, pixels, ncolors, 0L);
+ free(pixels);
+ }
}
--- /dev/null
+/* erase.c: Erase the screen in various more or less interesting ways.
+ * (c) 1997 by Johannes Keukelaar <johannes@nada.kth.se>
+ * Permission to use in any way granted. Provided "as is" without expressed
+ * or implied warranty. NO WARRANTY, NO EXPRESSION OF SUITABILITY FOR ANY
+ * PURPOSE. (I.e.: Use in any way, but at your own risk!)
+ */
+
+#include "utils.h"
+#include "yarandom.h"
+#include "usleep.h"
+
+#define NUM_MODES 6
+
+void
+erase_window(Display *dpy, Window window, GC gc,
+ int width, int height, int mode, int delay)
+{
+ int *clear_lines;
+ int i, j, line, num_lines=0, granularity, max_num;
+
+ max_num = 2*height;
+ if(2*width>max_num)
+ max_num = 2*width;
+
+ clear_lines = (int *)calloc(max_num, sizeof(int));
+ if(clear_lines)
+ {
+ if(mode<0 || mode>=NUM_MODES)
+ mode = random()%NUM_MODES;
+ granularity = 25;
+ switch(mode)
+ {
+ case 0:
+ for(i = 0; i < height; i++)
+ clear_lines[i] = i;
+ for(i = 0; i < height; i++)
+ {
+ int t, r;
+ t = clear_lines[i];
+ r = random()%height;
+ clear_lines[i] = clear_lines[r];
+ clear_lines[r] = t;
+ }
+ num_lines = height;
+ break;
+ case 1:
+ for(i = 0; i < width; i++)
+ clear_lines[i] = i+height;
+ for(i = 0; i < width; i++)
+ {
+ int t, r;
+ t = clear_lines[i];
+ r = random()%width;
+ clear_lines[i] = clear_lines[r];
+ clear_lines[r] = t;
+ }
+ num_lines = width;
+ break;
+ case 2:
+ for(i = 0; i < width/2; i++)
+ clear_lines[i] = i*2+height;
+ for(i = 0; i < height/2; i++)
+ clear_lines[i+width/2] = i*2;
+ for(i = 0; i < width/2; i++)
+ clear_lines[i+width/2+height/2] = width-i*2-(width%2?0:1)+height;
+ num_lines = width+height/2;
+ granularity = 4;
+ break;
+ case 3:
+ for(i = 0; i < max_num/4; i++)
+ {
+ clear_lines[i*4] = i*2;
+ clear_lines[i*4+1] = height-i*2-(height%2?0:1);
+ clear_lines[i*4+2] = height+i*2;
+ clear_lines[i*4+3] = height+width-i*2-(width%2?0:1);
+ }
+ num_lines = max_num;
+ granularity = 4;
+ break;
+ case 4:
+ j = 0;
+ for(i = 0; i < width*2; i++)
+ {
+ line = (i/16)*16-(i%16)*15;
+ if(line>=0 && line<width)
+ {
+ clear_lines[j] = height+line;
+ j++;
+ }
+ }
+ num_lines = width;
+ granularity = 4;
+ break;
+ case 5:
+ j = 0;
+ for(i = width*2; i >= 0; i--)
+ {
+ line = (i/16)*16-(i%16)*15;
+ if(line>=0 && line<width)
+ {
+ clear_lines[j] = height+line;
+ j++;
+ }
+ }
+ num_lines = width;
+ granularity = 4;
+ break;
+ }
+ for (i = 0; i < num_lines; i++)
+ {
+ if(clear_lines[i] < height)
+ XDrawLine (dpy, window, gc, 0, clear_lines[i], width,
+ clear_lines[i]);
+ else
+ XDrawLine (dpy, window, gc, clear_lines[i]-height, 0,
+ clear_lines[i]-height, height);
+ XFlush (dpy);
+ if ((i % granularity) == 0)
+ {
+ usleep (delay*granularity);
+ }
+ }
+
+ free(clear_lines);
+ }
+
+ XClearWindow (dpy, window);
+}
--- /dev/null
+/* erase.c: Erase the screen in various more or less interesting ways.
+ * (c) 1997 by Johannes Keukelaar <johannes@nada.kth.se>
+ * Permission to use in any way granted. Provided "as is" without expressed
+ * or implied warranty. NO WARRANTY, NO EXPRESSION OF SUITABILITY FOR ANY
+ * PURPOSE. (I.e.: Use in any way, but at your own risk!)
+ */
+
+#ifndef __XSCREENSAVER_ERASE_H__
+#define __XSCREENSAVER_ERASE_H__
+
+extern void erase_window(Display *dpy, Window window, GC gc,
+ int width, int height, int mode, int delay);
+
+#endif /* __XSCREENSAVER_ERASE_H__ */
static const char screensaver_id[] =
- "@(#)xscreensaver 2.07, by Jamie Zawinski (jwz@netscape.com)";
+ "@(#)xscreensaver 2.10, by Jamie Zawinski (jwz@netscape.com)";