From: Zygo Blaxell Date: Mon, 2 Mar 2009 05:42:22 +0000 (-0500) Subject: ftp://ftp.sunet.se/pub/os/Linux/distributions/ultrapenguin/ultrapenguin-1.1/SRPMS... X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=commitdiff_plain;h=186b0b9f1638444c650c9273df38085e0db71e4a ftp://ftp.sunet.se/pub/os/Linux/distributions/ultrapenguin/ultrapenguin-1.1/SRPMS/xscreensaver-2.10-2.src.rpm -rw-r--r-- 1 zblaxell zblaxell 644819 Feb 27 16:56 xscreensaver-2.10-2.src.rpm 6fa56ee5eb79337797c2c9c4c7638a6331703650 xscreensaver-2.10-2.src.rpm xscreensaver-2.10.tar.gz -rw-r--r-- 2 zblaxell zblaxell 643509 Oct 23 1997 xscreensaver-2.10.tar.gz 91d4644bc55c8803b7e6741b0748fff3e1013378 xscreensaver-2.10.tar.gz --- diff --git a/README b/README index a8e65ba7..22e0c4f8 100644 --- a/README +++ b/README @@ -105,6 +105,8 @@ window, which are pointed at by the screensaver's default resource settings. 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.) @@ -140,6 +142,13 @@ http://people.netscape.com/jwz/xscreensaver/. -- Jamie Zawinski +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.) diff --git a/config.h.in b/config.h.in index 8cac343a..c9ff754e 100644 --- a/config.h.in +++ b/config.h.in @@ -121,6 +121,10 @@ */ #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 diff --git a/configure b/configure index 83a5d96a..28f08460 100755 --- a/configure +++ b/configure @@ -46,6 +46,10 @@ ac_help="$ac_help 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: @@ -629,7 +633,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } 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 @@ -653,7 +657,7 @@ echo "$ac_t""$host" 1>&6 # 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 @@ -682,7 +686,7 @@ if test -z "$CC"; then # 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 @@ -730,7 +734,7 @@ fi 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. @@ -740,11 +744,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&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 @@ -764,12 +768,12 @@ if test $ac_cv_prog_cc_works = no; 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 @@ -778,7 +782,7 @@ 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 @@ -793,7 +797,7 @@ if test $ac_cv_prog_gcc = yes; then 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 @@ -823,7 +827,7 @@ fi 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 @@ -841,16 +845,16 @@ fi 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 <&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 @@ -879,7 +883,7 @@ esac 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= @@ -894,13 +898,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < 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 : @@ -911,13 +915,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < 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 : @@ -950,7 +954,7 @@ echo "$ac_t""$CPP" 1>&6 # 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 @@ -1000,7 +1004,7 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' 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 @@ -1028,12 +1032,12 @@ fi 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 <&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 @@ -1103,21 +1107,21 @@ EOF 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 <&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 @@ -1144,12 +1148,12 @@ esac 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 < #include @@ -1157,7 +1161,7 @@ else #include 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* @@ -1174,7 +1178,7 @@ rm -f 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 @@ -1192,7 +1196,7 @@ fi 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 @@ -1213,7 +1217,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1224,7 +1228,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); 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 @@ -1248,12 +1252,12 @@ EOF 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 < #include @@ -1262,7 +1266,7 @@ int main() { 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 @@ -1283,12 +1287,12 @@ EOF 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 < #include @@ -1304,7 +1308,7 @@ wait (&s); 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 @@ -1329,12 +1333,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h 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 < #include <$ac_hdr> @@ -1342,7 +1346,7 @@ int main() { 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 @@ -1367,7 +1371,7 @@ done # 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 @@ -1375,7 +1379,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&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 @@ -1408,7 +1412,7 @@ fi 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 @@ -1416,7 +1420,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&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 @@ -1451,12 +1455,12 @@ fi 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 < #if STDC_HEADERS @@ -1484,12 +1488,12 @@ EOF 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 < #if STDC_HEADERS @@ -1517,12 +1521,12 @@ EOF 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 < #include @@ -1539,7 +1543,7 @@ int main() { 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 @@ -1558,12 +1562,12 @@ EOF 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 < #if STDC_HEADERS @@ -1593,12 +1597,12 @@ fi 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 < #include @@ -1606,7 +1610,7 @@ int main() { 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 @@ -1614,7 +1618,7 @@ else cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < #include @@ -1623,7 +1627,7 @@ struct timeval tv; struct timezone tzp; 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 @@ -1663,12 +1667,12 @@ fi 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 <&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 @@ -1719,17 +1723,17 @@ for ac_hdr in unistd.h 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 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* @@ -1781,7 +1785,7 @@ fi # 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 @@ -1843,12 +1847,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < 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* @@ -1917,14 +1921,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&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. @@ -2030,17 +2034,17 @@ else 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 <&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 @@ -2056,14 +2060,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&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 @@ -2095,7 +2099,7 @@ rm -f conftest* # 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 @@ -2103,7 +2107,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&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 @@ -2136,7 +2140,7 @@ fi 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 @@ -2144,7 +2148,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&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 @@ -2184,12 +2188,12 @@ fi # 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 <&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 @@ -2233,7 +2237,7 @@ fi 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 @@ -2241,7 +2245,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&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 @@ -2282,12 +2286,12 @@ fi # -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 <&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 @@ -2331,7 +2335,7 @@ fi 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 @@ -2339,7 +2343,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&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 @@ -2374,12 +2378,12 @@ fi # 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 <&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 @@ -2423,7 +2427,7 @@ fi 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 @@ -2431,7 +2435,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&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 @@ -2466,12 +2470,12 @@ fi # 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 <&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 @@ -2515,7 +2519,7 @@ fi 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 @@ -2523,7 +2527,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&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 @@ -2567,7 +2571,7 @@ fi # 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 @@ -2575,7 +2579,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $LIBS" cat > conftest.$ac_ext <&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 @@ -2623,7 +2627,7 @@ fi 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 @@ -2744,7 +2748,7 @@ APPDEFAULTS=$ac_x_app_defaults fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -2765,7 +2769,7 @@ rm -f conftest* # 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 @@ -2776,14 +2780,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -2835,7 +2839,7 @@ case "$host" in # 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 @@ -2843,7 +2847,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&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 @@ -2891,17 +2895,17 @@ have_xmu=no 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 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* @@ -2945,7 +2949,7 @@ if test $have_xmu = yes ; then 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 @@ -2958,14 +2962,14 @@ else # with X libraries because we know it's SunOS. LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm" cat > conftest.$ac_ext <&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 @@ -2981,21 +2985,21 @@ fi 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 <&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 @@ -3041,17 +3045,17 @@ if test $with_sgi = yes; then 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 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* @@ -3106,17 +3110,17 @@ if test $have_sgi != yes; then 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 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* @@ -3158,7 +3162,7 @@ fi 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 @@ -3166,7 +3170,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -3226,7 +3230,7 @@ fi 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 @@ -3234,7 +3238,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXExExt -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -3289,7 +3293,7 @@ fi 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 @@ -3297,7 +3301,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXss -lX11 -lXext -lm $LIBS" cat > conftest.$ac_ext <&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 @@ -3348,7 +3352,7 @@ EOF fi -# Check for the XIDLE server extension header, +# Check for the XIDLE server extension header. # have_xidle=no with_xidle_req=unspecified @@ -3369,17 +3373,17 @@ if test $with_xidle = yes; then 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 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* @@ -3411,6 +3415,166 @@ elif test $with_xidle != no; then 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 +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 +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 +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 @@ -3470,17 +3634,17 @@ check_motif() { 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 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* @@ -3518,17 +3682,17 @@ check_athena() { 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 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* @@ -3598,7 +3762,7 @@ fi # 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 @@ -3610,7 +3774,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -3636,9 +3800,10 @@ fi # 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 @@ -3649,14 +3814,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -3695,17 +3860,17 @@ if test $with_xpm = yes; then 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 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* @@ -3760,17 +3925,17 @@ if test $with_gl = yes; then 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 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* @@ -3801,17 +3966,17 @@ fi 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 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* @@ -3851,7 +4016,7 @@ EOF fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < EOF @@ -3901,17 +4066,17 @@ if test $with_readdisplay = yes; then 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 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* @@ -3980,7 +4145,7 @@ do # 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 @@ -4013,7 +4178,7 @@ do # 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 @@ -4047,7 +4212,7 @@ done 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. # @@ -4069,7 +4234,7 @@ echo "configure:4051: checking for emacs yow" >&5 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. @@ -4115,7 +4280,7 @@ do # 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 @@ -4150,7 +4315,7 @@ do # 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 @@ -4229,7 +4394,7 @@ fi 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 @@ -4240,14 +4405,14 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < 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 @@ -4297,7 +4462,7 @@ fi # 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 @@ -4308,7 +4473,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -4321,7 +4486,7 @@ struct passwd_adjunct *p = getpwanam("nobody"); 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 @@ -4350,7 +4515,7 @@ EOF # 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 @@ -4361,7 +4526,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -4378,7 +4543,7 @@ struct pr_passwd *p; 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 @@ -4404,7 +4569,7 @@ EOF # 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 @@ -4412,7 +4577,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lprot -lx $LIBS" cat > conftest.$ac_ext <&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 @@ -4443,7 +4608,7 @@ 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 @@ -4451,7 +4616,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsecurity $LIBS" cat > conftest.$ac_ext <&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 @@ -4491,7 +4656,7 @@ fi # 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 @@ -4502,7 +4667,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -4515,7 +4680,7 @@ struct s_passwd *p = getspwnam("nobody"); 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 @@ -4540,7 +4705,7 @@ EOF # 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 @@ -4548,7 +4713,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsec $LIBS" cat > conftest.$ac_ext <&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 @@ -4586,7 +4751,7 @@ fi # 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 @@ -4597,7 +4762,7 @@ else fi CPPFLAGS="$CPPFLAGS $X_CFLAGS" cat > conftest.$ac_ext < #include @@ -4609,7 +4774,7 @@ struct spwd *p = getspnam("nobody"); 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 @@ -4635,7 +4800,7 @@ EOF # 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 @@ -4643,7 +4808,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&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 @@ -4676,7 +4841,7 @@ fi 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 @@ -4684,7 +4849,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgen $LIBS" cat > conftest.$ac_ext <&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 @@ -4722,7 +4887,7 @@ fi # 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 @@ -4730,7 +4895,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&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 @@ -4763,7 +4928,7 @@ fi 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 @@ -4771,7 +4936,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&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 @@ -4811,7 +4976,7 @@ fi # if test $need_setuid = no ; then case "$host" in - *-hpux* | *-aix* | *-netbsd* ) + *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* ) need_setuid=yes ;; esac @@ -4956,6 +5121,10 @@ if test $with_xidle_req = yes -a $have_xidle = no ; then 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." diff --git a/configure.in b/configure.in index 51cefe54..8fa05ce0 100644 --- a/configure.in +++ b/configure.in @@ -463,7 +463,7 @@ if test $have_sgi != yes; then fi -# Check for the XIDLE server extension header, +# Check for the XIDLE server extension header. # have_xidle=no with_xidle_req=unspecified @@ -482,6 +482,43 @@ elif test $with_xidle != no; then 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 @@ -596,6 +633,7 @@ fi # 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, @@ -990,7 +1028,7 @@ if test $enable_locking = yes; then # if test $need_setuid = no ; then case "$host" in - *-hpux* | *-aix* | *-netbsd* ) + *-hpux* | *-aix* | *-netbsd* | *-freebsd* | *-openbsd* ) need_setuid=yes ;; esac @@ -1126,6 +1164,10 @@ if test $with_xidle_req = yes -a $have_xidle = no ; then 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." diff --git a/driver/XScreenSaver.ad.in b/driver/XScreenSaver.ad.in index 83081960..67923746 100644 --- a/driver/XScreenSaver.ad.in +++ b/driver/XScreenSaver.ad.in @@ -104,6 +104,7 @@ starfish -root -blob \n\ munch -root \n\ fadeplot -root \n\ + coral -root \n\ \ mono: rocks -root \n\ color: rocks -root -fg darksalmon \n\ @@ -116,6 +117,9 @@ 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\ diff --git a/driver/XScreenSaver_ad.h b/driver/XScreenSaver_ad.h index 1c31b5f3..4bbbc54c 100644 --- a/driver/XScreenSaver_ad.h +++ b/driver/XScreenSaver_ad.h @@ -69,6 +69,7 @@ starfish -root -blob \\n\ munch -root \\n\ fadeplot -root \\n\ + coral -root \\n\ \ mono: rocks -root \\n\ color: rocks -root -fg darksalmon \\n\ @@ -81,6 +82,9 @@ 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\ diff --git a/driver/passwd.c b/driver/passwd.c index c8e6f56f..cc121221 100644 --- a/driver/passwd.c +++ b/driver/passwd.c @@ -214,16 +214,18 @@ lock_init (int argc, char **argv) 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 diff --git a/driver/stderr.c b/driver/stderr.c index 1a7bcb66..d2d4cc7b 100644 --- a/driver/stderr.c +++ b/driver/stderr.c @@ -353,15 +353,15 @@ initialize_stderr (saver_info *si) 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:"); diff --git a/driver/windows.c b/driver/windows.c index 7dabe9f1..5dcc3d35 100644 --- a/driver/windows.c +++ b/driver/windows.c @@ -918,7 +918,7 @@ blank_screen (saver_info *si) 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, @@ -1035,6 +1035,8 @@ unblank_screen (saver_info *si) 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); @@ -1113,7 +1115,7 @@ select_visual (saver_screen_info *ssi, const char *visual_name) 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 && diff --git a/driver/xscreensaver.man b/driver/xscreensaver.man index 8cef0182..71e8cbfa 100644 --- a/driver/xscreensaver.man +++ b/driver/xscreensaver.man @@ -539,6 +539,11 @@ been taken to make this a safe thing to do. 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 diff --git a/hacks/Makefile.in b/hacks/Makefile.in index 8efdb451..b991c659 100644 --- a/hacks/Makefile.in +++ b/hacks/Makefile.in @@ -52,12 +52,14 @@ UTIL_SRCS = $(UTILS_SRC)/alpha.c $(UTILS_SRC)/colors.c \ $(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 \ @@ -67,7 +69,8 @@ SRCS = attraction.c blitspin.c bouboule.c braid.c bubbles.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 \ @@ -77,7 +80,8 @@ OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.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 \ @@ -85,7 +89,7 @@ EXES = attraction blitspin bouboule braid bubbles decayscreen deco \ 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@ @@ -104,7 +108,7 @@ MEN = attraction.man blitspin.man bouboule.man braid.man \ 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 \ @@ -211,6 +215,7 @@ $(UTILS_BIN)/visual.o: $(UTILS_SRC)/visual.c $(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) ; \ @@ -233,6 +238,7 @@ HSV = $(UTILS_BIN)/hsv.o 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) @@ -268,8 +274,8 @@ greynetic: $(HACK_OBJS) greynetic.o 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) @@ -301,11 +307,11 @@ pyro: $(HACK_OBJS) pyro.o $(HSV) 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) @@ -322,6 +328,12 @@ starfish: $(HACK_OBJS) starfish.o $(COL) $(SPL) 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. # @@ -572,6 +584,7 @@ helix.o: $(UTILS_SRC)/hsv.h 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 @@ -767,6 +780,7 @@ rorschach.o: $(UTILS_SRC)/hsv.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 @@ -914,4 +928,22 @@ fadeplot.o: $(UTILS_SRC)/hsv.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 diff --git a/hacks/compile_axp.com b/hacks/compile_axp.com index b65f53eb..a8d2794a 100644 --- a/hacks/compile_axp.com +++ b/hacks/compile_axp.com @@ -7,6 +7,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ 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 diff --git a/hacks/compile_decc.com b/hacks/compile_decc.com index b65f53eb..a8d2794a 100644 --- a/hacks/compile_decc.com +++ b/hacks/compile_decc.com @@ -7,6 +7,7 @@ $ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS $ 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 diff --git a/hacks/coral.c b/hacks/coral.c new file mode 100644 index 00000000..eddde276 --- /dev/null +++ b/hacks/coral.c @@ -0,0 +1,247 @@ +/* coral, by "Frederick G.M. Roeber" , 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); + } +} diff --git a/hacks/helix.c b/hacks/helix.c index 758c5557..cb6bd38b 100644 --- a/hacks/helix.c +++ b/hacks/helix.c @@ -12,19 +12,26 @@ /* Algorithm from a Mac program by Chris Tate, written in 1988 or so. */ -/* 10-May-97: merged ellipse code by Dan Stromberg +/* 18-Sep-97: Johannes Keukelaar (johannes@nada.kth.se): Improved screen + * eraser. + * 10-May-97: merged ellipse code by Dan Stromberg * as found in xlockmore 4.03a10. * 1992: jwz created. */ #include #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) @@ -267,17 +274,10 @@ random_helix_or_trig (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); @@ -288,14 +288,26 @@ char *progclass = "Helix"; 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); diff --git a/hacks/helix.man b/hacks/helix.man index 76c7cfef..abc0a827 100644 --- a/hacks/helix.man +++ b/hacks/helix.man @@ -1,9 +1,9 @@ -.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. @@ -20,6 +20,17 @@ Draw on the root window. .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 @@ -48,3 +59,5 @@ suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .SH AUTHOR Jamie Zawinski , 13-aug-92. +Screen eraser improved by Johannes Keukelaar , + 18-sep-97. diff --git a/hacks/link_axp.com b/hacks/link_axp.com index 942dd7ae..ede1e6f8 100644 --- a/hacks/link_axp.com +++ b/hacks/link_axp.com @@ -12,6 +12,7 @@ $ link/exe=bubbles.exe screenhack,bubbles,bubbles_default,vms_axp_12.opt/op $ 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 @@ -61,6 +62,7 @@ $ link/exe=bubbles.exe screenhack,bubbles,bubbles_default,vms_axp.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 diff --git a/hacks/link_decc.com b/hacks/link_decc.com index daf6a3b5..e730fb80 100644 --- a/hacks/link_decc.com +++ b/hacks/link_decc.com @@ -12,6 +12,7 @@ $ link/exe=bubbles.exe screenhack,bubbles,bubbles_default,vms_decc_12.opt/o $ 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 @@ -61,6 +62,7 @@ $ link/exe=bubbles.exe screenhack,bubbles,bubbles_default,vms_decc.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 diff --git a/hacks/maze.c b/hacks/maze.c index 22af1d6a..aa2de92f 100644 --- a/hacks/maze.c +++ b/hacks/maze.c @@ -1,6 +1,9 @@ /****************************************************************************** * [ maze ] ... * + * modified: [ 4-10-97 ] Johannes Keukelaar + * Added multiple maze creators. Robustified solver. + * Added bridge option. * modified: [ 8-11-95 ] Ed James * added fill of dead-end box to solve_maze while loop. * modified: [ 3-7-93 ] Jamie Zawinski @@ -81,6 +84,7 @@ static int solve_delay, pre_solve_delay, post_solve_delay; #define DOOR_OUT_BOTTOM 0x20 #define DOOR_OUT_LEFT 0x10 +#define SOLVER_VISIT 0x4 #define START_SQUARE 0x2 #define END_SQUARE 0x1 @@ -113,13 +117,15 @@ static int maze_size_x, maze_size_y; 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 ] */ @@ -180,6 +186,8 @@ static void 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 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=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>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; @@ -353,7 +970,7 @@ choose_door (void) /* pick a new path */ 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; @@ -369,7 +986,7 @@ choose_door (void) /* pick a new path */ 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; @@ -385,7 +1002,7 @@ choose_door (void) /* pick a new path */ 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; @@ -401,7 +1018,7 @@ choose_door (void) /* pick a new path */ 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; @@ -482,7 +1099,7 @@ draw_maze_border (void) /* draw the maze outline */ 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: @@ -514,9 +1131,78 @@ draw_wall(int i, int j, int dir) /* draw a single wall */ 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(i0) + 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(i0) + 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 */ @@ -552,8 +1238,9 @@ static void 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); @@ -563,6 +1250,7 @@ solve_maze (void) /* solve it with graphical feedback */ 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) { @@ -572,15 +1260,23 @@ solve_maze (void) /* solve it with graphical feedback */ 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; } @@ -592,6 +1288,7 @@ solve_maze (void) /* solve it with graphical feedback */ } +#if 0 static void enter_square (int n) /* move into a neighboring square */ { @@ -614,6 +1311,7 @@ enter_square (int n) /* move into a neighboring square */ break; } } +#endif /* 0 */ /* @@ -633,6 +1331,10 @@ char *defaults[] = { "*postDelay: 4000000", "*liveColor: green", "*deadColor: red", + "*generator: -1", + "*maxLength: 5", + "*syncDraw: False", + "*bridge: False", #ifdef XROGER "*logoColor: red3", #endif @@ -646,6 +1348,10 @@ XrmOptionDescRec options[] = { { "-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 } }; @@ -657,7 +1363,7 @@ void 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; @@ -666,6 +1372,9 @@ screenhack(Display *display, Window window) 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; @@ -687,6 +1396,7 @@ screenhack(Display *display, Window window) 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); @@ -710,6 +1420,8 @@ screenhack(Display *display, Window window) 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); @@ -741,10 +1453,11 @@ screenhack(Display *display, Window window) } #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; @@ -757,7 +1470,22 @@ screenhack(Display *display, Window window) 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); @@ -786,6 +1514,7 @@ screenhack(Display *display, Window window) set_maze_sizes (wattr.width, wattr.height); XClearWindow (dpy, win); XSync (dpy, False); + sync_p = !(random() % 10); } } } diff --git a/hacks/maze.man b/hacks/maze.man index f93a70f4..1321995a 100644 --- a/hacks/maze.man +++ b/hacks/maze.man @@ -3,7 +3,7 @@ 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. @@ -45,6 +45,31 @@ Default 2000000 (2 seconds.) .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 @@ -96,6 +121,8 @@ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 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 diff --git a/hacks/qix.c b/hacks/qix.c index ed3ac0a0..24ea10ba 100644 --- a/hacks/qix.c +++ b/hacks/qix.c @@ -18,8 +18,8 @@ #define SCALE 6 struct qpoint { - long x, y; - long dx, dy; + int x, y; + int dx, dy; }; struct qline { diff --git a/hacks/rd-bomb.c b/hacks/rd-bomb.c new file mode 100644 index 00000000..c648bd66 --- /dev/null +++ b/hacks/rd-bomb.c @@ -0,0 +1,431 @@ +/* xscreensaver, Copyright (c) 1992, 1995, 1997 + * Jamie Zawinski + * + * 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 + +#include "screenhack.h" + +/* why doesn't this work??? */ +#ifdef HAVE_XSHM_EXTENSION +#include +#include +#include +#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); + } +} diff --git a/hacks/rd-bomb.man b/hacks/rd-bomb.man new file mode 100644 index 00000000..161c4783 --- /dev/null +++ b/hacks/rd-bomb.man @@ -0,0 +1,98 @@ +.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 , 9/97 diff --git a/hacks/rocks.c b/hacks/rocks.c index 55abbd84..8b12fa76 100644 --- a/hacks/rocks.c +++ b/hacks/rocks.c @@ -10,7 +10,10 @@ * implied warranty. */ -/* Flying through an asteroid field. Based on TI Explorer Lisp code by +/* 18-Sep-97: Johannes Keukelaar : 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 */ @@ -46,8 +49,11 @@ static Display *dpy; 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; @@ -67,6 +73,7 @@ struct rock { int depth; int size, x, y; int diff; + int color; }; static struct rock *rocks; @@ -84,6 +91,7 @@ rock_reset (struct rock *rock) 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); } @@ -142,7 +150,7 @@ rock_draw (rock, draw_p) 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) @@ -375,7 +383,7 @@ init_rocks (Display *d, Window w) XGCValues gcv; Colormap cmap; XWindowAttributes xgwa; - unsigned int fg, bg; + unsigned int bg; dpy = d; window = w; XGetWindowAttributes (dpy, window, &xgwa); @@ -387,13 +395,57 @@ init_rocks (Display *d, Window w) 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); @@ -420,7 +472,8 @@ init_rocks (Display *d, Window w) } /* 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"); @@ -437,6 +490,7 @@ char *progclass = "Rocks"; char *defaults [] = { "Rocks.background: Black", /* to placate SGI */ "Rocks.foreground: #E9967A", + "*colors: 5", "*count: 100", "*delay: 50000", "*speed: 100", @@ -462,6 +516,7 @@ XrmOptionDescRec options [] = { {"-left3d", ".left3d", XrmoptionSepArg, 0 }, {"-right3d", ".right3d", XrmoptionSepArg, 0 }, {"-delta3d", ".delta3d", XrmoptionSepArg, 0 }, + { "-colors", ".colors", XrmoptionSepArg, 0 }, { 0, 0, 0, 0 } }; diff --git a/hacks/rocks.man b/hacks/rocks.man index 37a163b9..18d16ab4 100644 --- a/hacks/rocks.man +++ b/hacks/rocks.man @@ -3,7 +3,7 @@ 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. @@ -17,6 +17,12 @@ Draw on a newly-created window. This is the default. .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 diff --git a/hacks/rorschach.c b/hacks/rorschach.c index eab13887..2eeb6170 100644 --- a/hacks/rorschach.c +++ b/hacks/rorschach.c @@ -7,14 +7,22 @@ * 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 : 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) @@ -89,15 +97,10 @@ hurm (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); @@ -114,6 +117,9 @@ char *defaults [] = { "*ysymmetry: false", "*iterations: 4000", "*offset: 4", + "Rorschach.eraseSpeed: 400", + "Rorschach.delay: 5", + "Rorschach.eraseMode: -1", 0 }; @@ -122,12 +128,18 @@ XrmOptionDescRec options [] = { { "-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); diff --git a/hacks/rorschach.man b/hacks/rorschach.man index 4619f0ff..c89b1704 100644 --- a/hacks/rorschach.man +++ b/hacks/rorschach.man @@ -3,7 +3,7 @@ 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. @@ -38,6 +38,17 @@ Whether the images should be horizontally symmetrical. Default true. .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 diff --git a/hacks/sierpinski.c b/hacks/sierpinski.c index a75c3eb1..65110247 100644 --- a/hacks/sierpinski.c +++ b/hacks/sierpinski.c @@ -1,11 +1,11 @@ /* -*- 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, @@ -20,6 +20,8 @@ static const char sccsid[] = "@(#)tri.c 4.00 97/01/01 xlockmore"; * other special, indirect and consequential damages. * * Revision History: + * 18-Sep-97: 3D version Antti Kuntsi . + * 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 * . @@ -27,9 +29,9 @@ static const char sccsid[] = "@(#)tri.c 4.00 97/01/01 xlockmore"; #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" \ @@ -39,113 +41,133 @@ static const char sccsid[] = "@(#)tri.c 4.00 97/01/01 xlockmore"; # 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]); } @@ -156,7 +178,7 @@ release_tri(ModeInfo * mi) } void -refresh_tri(ModeInfo * mi) +refresh_sierpinski(ModeInfo * mi) { /* Do nothing, it will refresh by itself */ } diff --git a/setup.com b/setup.com index 6fe518f3..24002f69 100644 --- a/setup.com +++ b/setup.com @@ -11,6 +11,7 @@ $ bubbles :== $'mydir'bubbles $ decays*creen:== $'mydir'decayscreen $ deco :== $'mydir'deco $ drift :== $'mydir'drift +$ fadeplot :== $'mydir'fadeplot $ flag :== $'mydir'flag $ flame :== $'mydir'flame $ forest :== $'mydir'forest diff --git a/utils/Makefile.in b/utils/Makefile.in index 9198bd87..8931dc56 100644 --- a/utils/Makefile.in +++ b/utils/Makefile.in @@ -25,13 +25,13 @@ INCLUDES = -I$(srcdir) -I$(srcdir)/.. @INCLUDES@ 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 @@ -147,4 +147,8 @@ xroger.o: $(srcdir)/utils.h 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 diff --git a/utils/colors.c b/utils/colors.c index 93366b64..86b13442 100644 --- a/utils/colors.c +++ b/utils/colors.c @@ -25,11 +25,15 @@ void 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); + } } diff --git a/utils/erase.c b/utils/erase.c new file mode 100644 index 00000000..f30f9716 --- /dev/null +++ b/utils/erase.c @@ -0,0 +1,128 @@ +/* erase.c: Erase the screen in various more or less interesting ways. + * (c) 1997 by Johannes Keukelaar + * 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= 0; i--) + { + line = (i/16)*16-(i%16)*15; + if(line>=0 && line + * 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__ */ diff --git a/utils/version.h b/utils/version.h index 598c744a..bf753aca 100644 --- a/utils/version.h +++ b/utils/version.h @@ -1,2 +1,2 @@ static const char screensaver_id[] = - "@(#)xscreensaver 2.07, by Jamie Zawinski (jwz@netscape.com)"; + "@(#)xscreensaver 2.10, by Jamie Zawinski (jwz@netscape.com)";