( cd BIN/motif ; \
CC=cc ; \
export CC ; \
- ../../configure --without-xpm --with-motif=/usr/local/motif ; \
+ ../../configure --without-xpm --without-xdbe --without-xshm \
+ --with-motif=/usr/local/motif ; \
echo --------------------------------------------------------------- ; \
gmake ; \
( cd driver; gmake xscreensaver-demo-Xaw ) ; \
numerous graphics hacks for use as screensavers. There is nothing magic
about these: they are just programs that draw on the root window.
-More than 80 such programs are included. For details, see the xscreensaver
+More than 90 such programs are included. For details, see the xscreensaver
web page, or the enclosed manual pages. There are also some helpful hints
on customization in the xscreensaver app-defaults file (normally installed
in /usr/lib/X11/app-defaults/XScreenSaver.)
============
+Changes since 3.08: * Added `compass', `squiral', `xflame', `wander',
+ `spotlight', and `critical' hacks.
+ * Added some new modes to `decayscreen'.
+ * Made `deluxe' work in monochrome.
+ * Generalized usage of the Double-Buffer server extension
+ in several hacks (`compass', `deluxe', `interference',
+ `kumppa', and `moire2'.)
+ * Fixed another visual-depth problem in `rd-bomb'.
+ * The screen saver will now defer blanking if neither
+ the keyboard nor the mouse could be grabbed. Instead,
+ it will just try again in a few minutes. This fixes
+ a bad interaction between xscreensaver and programs
+ like VMware that hold the mouse and keyboard grabbed
+ for a long time.
+ * Added a new erase mode (expanding spiral.)
Changes since 3.07: * Fixed some bugs in my port of `t3d'.
* Added `penetrate' and `deluxe' hacks.
* When linking against Motif 2.x, also link against XPM.
*/
#undef HAVE_XSHM_EXTENSION
+/* Define this if you have the X Double Buffer Extension.
+ */
+#undef HAVE_DOUBLE_BUFFER_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
--enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
instead of putting them in bindir itself. You can
specify the name of the subdirectory. For example,
- --exec-prefix=/usr/local/bin --enable-subdir=demos
+ \`--exec-prefix=/usr/local --enable-subdir=demos'
would put xscreensaver in /usr/local/bin/, and would
put the demos in /usr/local/bin/demos/. (If DIR
begins with /, then bindir will not be prepended.)
--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
+ --with-xdbe-ext Include support for the DOUBLE-BUFFER server
+ extension, if possible (this is the default).
+ --without-xdbe-ext Do not compile in support for this extension."
ac_help="$ac_help
--with-sgivc-ext Include support for the SGI-VIDEO-CONTROL server
extension, if possible (this is the default).
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:673: checking host system type" >&5
+echo "configure:677: checking host system type" >&5
host_alias=$host
case "$host_alias" in
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:697: checking for $ac_word" >&5
+echo "configure:701: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:727: checking for $ac_word" >&5
+echo "configure:731: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:778: checking for $ac_word" >&5
+echo "configure:782: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:810: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:814: 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.
cat > conftest.$ac_ext << EOF
-#line 821 "configure"
+#line 825 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:852: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:856: 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:857: checking whether we are using GNU C" >&5
+echo "configure:861: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:866: \"$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:870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:885: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:889: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -z "$GCC"; then
echo $ac_n "checking how to request ANSI compilation""... $ac_c" 1>&6
-echo "configure:919: checking how to request ANSI compilation" >&5
+echo "configure:923: checking how to request ANSI compilation" >&5
case "$host" in
*-hpux*)
echo "$ac_t""HPUX: adding -Ae" 1>&6
echo $ac_n "checking whether the compiler works on ANSI C""... $ac_c" 1>&6
-echo "configure:943: checking whether the compiler works on ANSI C" >&5
+echo "configure:947: checking whether the compiler works on ANSI C" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: Couldn't build even a trivial ANSI C program: check CC." 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 948 "configure"
+#line 952 "configure"
#include "confdefs.h"
main(int ac, char **av) { return 0; }
EOF
-if { (eval echo configure:952: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
else
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1001: checking how to run the C preprocessor" >&5
+echo "configure:1005: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1016 "configure"
+#line 1020 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1022: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1033 "configure"
+#line 1037 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1039: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1050 "configure"
+#line 1054 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1092: checking for a BSD compatible install" >&5
+echo "configure:1096: 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
INSTALL_DIRS='${INSTALL} -d'
echo $ac_n "checking whether \"\${INSTALL} -d\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1146: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
+echo "configure:1150: checking whether \"\${INSTALL} -d\" creates intermediate directories" >&5
rm -rf conftestdir
if mkdir conftestdir; then
cd conftestdir >&-
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking whether \"mkdir -p\" creates intermediate directories""... $ac_c" 1>&6
-echo "configure:1157: checking whether \"mkdir -p\" creates intermediate directories" >&5
+echo "configure:1161: checking whether \"mkdir -p\" creates intermediate directories" >&5
rm -rf dir1
mkdir -p dir1/dir2 >&- 2>&-
if test -d dir1/dir2/. ; then
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1172: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1176: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1200: checking for working const" >&5
+echo "configure:1204: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1205 "configure"
+#line 1209 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1258: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1275: checking for inline" >&5
+echo "configure:1279: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1282 "configure"
+#line 1286 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1289: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1316: checking for ANSI C header files" >&5
+echo "configure:1320: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1321 "configure"
+#line 1325 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1346 "configure"
+#line 1350 "configure"
#include "confdefs.h"
#include <string.h>
EOF
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1364 "configure"
+#line 1368 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1385 "configure"
+#line 1389 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1420: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1424: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1425 "configure"
+#line 1429 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1434: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1438: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:1455: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1459: checking for sys/wait.h that is POSIX.1 compatible" >&5
if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1460 "configure"
+#line 1464 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1501: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1505: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1506 "configure"
+#line 1510 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1514: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1518: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1539: checking for opendir in -ldir" >&5
+echo "configure:1543: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1547 "configure"
+#line 1551 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1580: checking for opendir in -lx" >&5
+echo "configure:1584: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1588 "configure"
+#line 1592 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
opendir()
; return 0; }
EOF
-if { (eval echo configure:1599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1623: checking for mode_t" >&5
+echo "configure:1627: checking for mode_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1628 "configure"
+#line 1632 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:1656: checking for pid_t" >&5
+echo "configure:1660: checking for pid_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1661 "configure"
+#line 1665 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1689: checking for size_t" >&5
+echo "configure:1693: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1694 "configure"
+#line 1698 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1722: checking return type of signal handlers" >&5
+echo "configure:1726: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1727 "configure"
+#line 1731 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:1744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking how to call gettimeofday""... $ac_c" 1>&6
-echo "configure:1764: checking how to call gettimeofday" >&5
+echo "configure:1768: checking how to call gettimeofday" >&5
if eval "test \"`echo '$''{'ac_cv_gettimeofday_args'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1769 "configure"
+#line 1773 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
gettimeofday(&tv, &tzp);
; return 0; }
EOF
-if { (eval echo configure:1778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=2
else
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1786 "configure"
+#line 1790 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
struct timeval tv; gettimeofday(&tv);
; return 0; }
EOF
-if { (eval echo configure:1794: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1798: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_gettimeofday_args=1
else
for ac_func in select fcntl uname nice setpriority getcwd getwd putenv
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1834: checking for $ac_func" >&5
+echo "configure:1838: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1839 "configure"
+#line 1843 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in sigaction syslog
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1889: checking for $ac_func" >&5
+echo "configure:1893: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1894 "configure"
+#line 1898 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
; return 0; }
EOF
-if { (eval echo configure:1917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1946: checking for $ac_hdr" >&5
+echo "configure:1950: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1951 "configure"
+#line 1955 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2018: checking for X" >&5
+echo "configure:2022: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 2080 "configure"
+#line 2084 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2154 "configure"
+#line 2158 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:2161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:2267: checking whether -R must be followed by a space" >&5
+echo "configure:2271: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 2270 "configure"
+#line 2274 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 2293 "configure"
+#line 2297 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:2332: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:2336: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2340 "configure"
+#line 2344 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:2373: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:2377: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2381 "configure"
+#line 2385 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:2392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2421: checking for gethostbyname" >&5
+echo "configure:2425: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2426 "configure"
+#line 2430 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
; return 0; }
EOF
-if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2470: checking for gethostbyname in -lnsl" >&5
+echo "configure:2474: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2478 "configure"
+#line 2482 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:2489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:2519: checking for connect" >&5
+echo "configure:2523: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2524 "configure"
+#line 2528 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
; return 0; }
EOF
-if { (eval echo configure:2547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2551: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:2568: checking for connect in -lsocket" >&5
+echo "configure:2572: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2576 "configure"
+#line 2580 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
connect()
; return 0; }
EOF
-if { (eval echo configure:2587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:2611: checking for remove" >&5
+echo "configure:2615: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2616 "configure"
+#line 2620 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
; return 0; }
EOF
-if { (eval echo configure:2639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2660: checking for remove in -lposix" >&5
+echo "configure:2664: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2668 "configure"
+#line 2672 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
remove()
; return 0; }
EOF
-if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2703: checking for shmat" >&5
+echo "configure:2707: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2708 "configure"
+#line 2712 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
; return 0; }
EOF
-if { (eval echo configure:2731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2752: checking for shmat in -lipc" >&5
+echo "configure:2756: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2760 "configure"
+#line 2764 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
shmat()
; return 0; }
EOF
-if { (eval echo configure:2771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2804: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2808: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2812 "configure"
+#line 2816 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
-echo "configure:2865: checking for X app-defaults directory" >&5
+echo "configure:2869: checking for X app-defaults directory" >&5
if eval "test \"`echo '$''{'ac_cv_x_app_defaults'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 3012 "configure"
+#line 3016 "configure"
#include "confdefs.h"
#include <X11/XHPlib.h>
EOF
# Check for the availability of the XPointer typedef, and define it otherwise.
#
echo $ac_n "checking for XPointer""... $ac_c" 1>&6
-echo "configure:3033: checking for XPointer" >&5
+echo "configure:3037: checking for XPointer" >&5
if eval "test \"`echo '$''{'ac_cv_xpointer'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 3044 "configure"
+#line 3048 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
int main() {
XPointer foo = (XPointer) 0;
; return 0; }
EOF
-if { (eval echo configure:3051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_xpointer=yes
else
# Some versions of Slowlaris Motif require -lgen. But not all. Why?
echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>&6
-echo "configure:3185: checking for regcmp in -lgen" >&5
+echo "configure:3189: checking for regcmp in -lgen" >&5
ac_lib_var=`echo gen'_'regcmp | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3193 "configure"
+#line 3197 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
regcmp()
; return 0; }
EOF
-if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
-echo "configure:3241: checking for X11/Xmu/Error.h" >&5
+echo "configure:3245: checking for X11/Xmu/Error.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3246 "configure"
+#line 3250 "configure"
#include "confdefs.h"
#include <X11/Xmu/Error.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
case "$host" in
*-sunos4*)
echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
-echo "configure:3296: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
+echo "configure:3300: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
if eval "test \"`echo '$''{'ac_cv_sunos_xmu_bug'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# with X libraries because we know it's SunOS.
LDFLAGS="$LDFLAGS -lXmu -lXt -lX11 -lXext -lm"
cat > conftest.$ac_ext <<EOF
-#line 3309 "configure"
+#line 3313 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_sunos_xmu_bug=no
else
echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
if test "$ac_cv_sunos_xmu_bug" = yes ; then
echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
-echo "configure:3332: checking whether the compiler understands -static" >&5
+echo "configure:3336: checking whether the compiler understands -static" >&5
if eval "test \"`echo '$''{'ac_cv_ld_static'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -static"
cat > conftest.$ac_ext <<EOF
-#line 3339 "configure"
+#line 3343 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_ld_static=yes
else
/*)
echo $ac_n "checking for SGI SCREEN_SAVER headers""... $ac_c" 1>&6
-echo "configure:3391: checking for SGI SCREEN_SAVER headers" >&5
+echo "configure:3395: checking for SGI SCREEN_SAVER headers" >&5
d=$with_sgi/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for SGI SCREEN_SAVER libs""... $ac_c" 1>&6
-echo "configure:3401: checking for SGI SCREEN_SAVER libs" >&5
+echo "configure:3405: checking for SGI SCREEN_SAVER libs" >&5
d=$with_sgi/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:3439: checking for X11/extensions/XScreenSaver.h" >&5
+echo "configure:3443: checking for X11/extensions/XScreenSaver.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3444 "configure"
+#line 3448 "configure"
#include "confdefs.h"
#include <X11/extensions/XScreenSaver.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3453: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for MIT-SCREEN-SAVER headers""... $ac_c" 1>&6
-echo "configure:3502: checking for MIT-SCREEN-SAVER headers" >&5
+echo "configure:3506: checking for MIT-SCREEN-SAVER headers" >&5
d=$with_mit/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for MIT-SCREEN-SAVER libs""... $ac_c" 1>&6
-echo "configure:3512: checking for MIT-SCREEN-SAVER libs" >&5
+echo "configure:3516: checking for MIT-SCREEN-SAVER libs" >&5
d=$with_mit/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:3551: checking for X11/extensions/scrnsaver.h" >&5
+echo "configure:3555: checking for X11/extensions/scrnsaver.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3556 "configure"
+#line 3560 "configure"
#include "confdefs.h"
#include <X11/extensions/scrnsaver.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3565: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
-echo "configure:3605: checking for XScreenSaverRegister in -lXext" >&5
+echo "configure:3609: checking for XScreenSaverRegister in -lXext" >&5
ac_lib_var=`echo Xext'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3613 "configure"
+#line 3617 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
-echo "configure:3675: checking for XScreenSaverRegister in -lXExExt" >&5
+echo "configure:3679: checking for XScreenSaverRegister in -lXExExt" >&5
ac_lib_var=`echo XExExt'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXExExt -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3683 "configure"
+#line 3687 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
-echo "configure:3740: checking for XScreenSaverRegister in -lXss" >&5
+echo "configure:3744: checking for XScreenSaverRegister in -lXss" >&5
ac_lib_var=`echo Xss'_'XScreenSaverRegister | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXss -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3748 "configure"
+#line 3752 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XScreenSaverRegister()
; return 0; }
EOF
-if { (eval echo configure:3759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
/*)
echo $ac_n "checking for XIDLE headers""... $ac_c" 1>&6
-echo "configure:3819: checking for XIDLE headers" >&5
+echo "configure:3823: checking for XIDLE headers" >&5
d=$with_xidle/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XIDLE libs""... $ac_c" 1>&6
-echo "configure:3829: checking for XIDLE libs" >&5
+echo "configure:3833: checking for XIDLE libs" >&5
d=$with_xidle/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:3867: checking for X11/extensions/xidle.h" >&5
+echo "configure:3871: checking for X11/extensions/xidle.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3872 "configure"
+#line 3876 "configure"
#include "confdefs.h"
#include <X11/extensions/xidle.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3877: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for XSHM headers""... $ac_c" 1>&6
-echo "configure:3929: checking for XSHM headers" >&5
+echo "configure:3933: checking for XSHM headers" >&5
d=$with_xshm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XSHM libs""... $ac_c" 1>&6
-echo "configure:3939: checking for XSHM libs" >&5
+echo "configure:3943: checking for XSHM libs" >&5
d=$with_xshm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:3979: checking for X11/extensions/XShm.h" >&5
+echo "configure:3983: checking for X11/extensions/XShm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3984 "configure"
+#line 3988 "configure"
#include "confdefs.h"
#include <X11/extensions/XShm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
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:4023: checking for sys/ipc.h" >&5
+echo "configure:4027: checking for sys/ipc.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4028 "configure"
+#line 4032 "configure"
#include "confdefs.h"
#include <sys/ipc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
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:4068: checking for sys/shm.h" >&5
+echo "configure:4072: checking for sys/shm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4073 "configure"
+#line 4077 "configure"
#include "confdefs.h"
#include <sys/shm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4078: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
-echo "configure:4127: checking for XShmQueryExtension in -lXextSam" >&5
+echo "configure:4131: checking for XShmQueryExtension in -lXextSam" >&5
ac_lib_var=`echo XextSam'_'XShmQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4135 "configure"
+#line 4139 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XShmQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:4146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
+# Check for the DOUBLE-BUFFER server extension header.
+#
+have_xdbe=no
+with_xdbe_req=unspecified
+# Check whether --with-xdbe-ext or --without-xdbe-ext was given.
+if test "${with_xdbe_ext+set}" = set; then
+ withval="$with_xdbe_ext"
+ with_xdbe="$withval"; with_xdbe_req="$withval"
+else
+ with_xdbe=yes
+fi
+
+
+
+ case "$with_xdbe" in
+ yes) ;;
+ no) ;;
+
+ /*)
+ echo $ac_n "checking for DOUBLE-BUFFER headers""... $ac_c" 1>&6
+echo "configure:4209: checking for DOUBLE-BUFFER headers" >&5
+ d=$with_xdbe/include
+ if test -d $d; then
+ X_CFLAGS="-I$d $X_CFLAGS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ echo $ac_n "checking for DOUBLE-BUFFER libs""... $ac_c" 1>&6
+echo "configure:4219: checking for DOUBLE-BUFFER libs" >&5
+ d=$with_xdbe/lib
+ if test -d $d; then
+ X_LIBS="-L$d $X_LIBS"
+ echo "$ac_t""$d" 1>&6
+ else
+ echo "$ac_t""not found ($d: no such directory)" 1>&6
+ fi
+
+ # replace the directory string with "yes".
+ with_xdbe_req="yes"
+ with_xdbe=$with_xdbe_req
+ ;;
+
+ *)
+ echo ""
+ echo "error: argument to --with-xdbe-ext must be \"yes\", \"no\", or a directory."
+ echo " If it is a directory, then \`DIR/include' will be added to"
+ echo " the -I list, and \`DIR/lib' will be added to the -L list."
+ exit 1
+ ;;
+ esac
+
+ # why is this necessary?
+ # if we don't do this, then "./configure --with-motif=/usr/local/lesstif"
+ # behaves as if "--with-zippy=/usr/local/lesstif" was also present!
+ withval=
+
+
+if test "$with_xdbe" = yes; then
+
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_safe=`echo "X11/extensions/Xdbe.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/Xdbe.h""... $ac_c" 1>&6
+echo "configure:4258: checking for X11/extensions/Xdbe.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 4263 "configure"
+#include "confdefs.h"
+#include <X11/extensions/Xdbe.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+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_xdbe=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ if test "$have_xdbe" = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DOUBLE_BUFFER_EXTENSION 1
+EOF
+
+ fi
+
+elif test "$with_xdbe" != no; then
+ echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
+ exit 1
+fi
+
+
# Check for the SGI-VIDEO-CONTROL server extension header.
#
have_sgivc=no
/*)
echo $ac_n "checking for SGI-VIDEO-CONTROL headers""... $ac_c" 1>&6
-echo "configure:4205: checking for SGI-VIDEO-CONTROL headers" >&5
+echo "configure:4323: checking for SGI-VIDEO-CONTROL headers" >&5
d=$with_sgivc/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for SGI-VIDEO-CONTROL libs""... $ac_c" 1>&6
-echo "configure:4215: checking for SGI-VIDEO-CONTROL libs" >&5
+echo "configure:4333: checking for SGI-VIDEO-CONTROL libs" >&5
d=$with_sgivc/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XSGIvc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XSGIvc.h""... $ac_c" 1>&6
-echo "configure:4255: checking for X11/extensions/XSGIvc.h" >&5
+echo "configure:4373: checking for X11/extensions/XSGIvc.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4260 "configure"
+#line 4378 "configure"
#include "confdefs.h"
#include <X11/extensions/XSGIvc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
-echo "configure:4308: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
+echo "configure:4426: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
ac_lib_var=`echo Xsgivc'_'XSGIvcQueryGammaMap | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXsgivc -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4316 "configure"
+#line 4434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XSGIvcQueryGammaMap()
; return 0; }
EOF
-if { (eval echo configure:4327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
/*)
echo $ac_n "checking for DPMS headers""... $ac_c" 1>&6
-echo "configure:4385: checking for DPMS headers" >&5
+echo "configure:4503: checking for DPMS headers" >&5
d=$with_dpms/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for DPMS libs""... $ac_c" 1>&6
-echo "configure:4395: checking for DPMS libs" >&5
+echo "configure:4513: checking for DPMS libs" >&5
d=$with_dpms/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/dpms.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/dpms.h""... $ac_c" 1>&6
-echo "configure:4435: checking for X11/extensions/dpms.h" >&5
+echo "configure:4553: checking for X11/extensions/dpms.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4440 "configure"
+#line 4558 "configure"
#include "confdefs.h"
#include <X11/extensions/dpms.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
-echo "configure:4488: checking for DPMSInfo in -lXdpms" >&5
+echo "configure:4606: checking for DPMSInfo in -lXdpms" >&5
ac_lib_var=`echo Xdpms'_'DPMSInfo | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXdpms -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4496 "configure"
+#line 4614 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
DPMSInfo()
; return 0; }
EOF
-if { (eval echo configure:4507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test "$with_proc_interrupts" = yes; then
echo $ac_n "checking whether /proc/interrupts contains keyboard data""... $ac_c" 1>&6
-echo "configure:4561: checking whether /proc/interrupts contains keyboard data" >&5
+echo "configure:4679: checking whether /proc/interrupts contains keyboard data" >&5
if eval "test \"`echo '$''{'ac_cv_have_proc_interrupts'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
/*)
echo $ac_n "checking for Motif headers""... $ac_c" 1>&6
-echo "configure:4614: checking for Motif headers" >&5
+echo "configure:4732: checking for Motif headers" >&5
d=$with_motif/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Motif libs""... $ac_c" 1>&6
-echo "configure:4624: checking for Motif libs" >&5
+echo "configure:4742: checking for Motif libs" >&5
d=$with_motif/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
/*)
echo $ac_n "checking for Athena headers""... $ac_c" 1>&6
-echo "configure:4669: checking for Athena headers" >&5
+echo "configure:4787: checking for Athena headers" >&5
d=$with_athena/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Athena libs""... $ac_c" 1>&6
-echo "configure:4679: checking for Athena libs" >&5
+echo "configure:4797: checking for Athena libs" >&5
d=$with_athena/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:4742: checking for Xm/Xm.h" >&5
+echo "configure:4860: checking for Xm/Xm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4747 "configure"
+#line 4865 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/Xaw/Dialog.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/Xaw/Dialog.h""... $ac_c" 1>&6
-echo "configure:4792: checking for X11/Xaw/Dialog.h" >&5
+echo "configure:4910: checking for X11/Xaw/Dialog.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4797 "configure"
+#line 4915 "configure"
#include "confdefs.h"
#include <X11/Xaw/Dialog.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
-echo "configure:4842: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
+echo "configure:4960: checking for Xaw3dComputeTopShadowRGB in -lXaw3d" >&5
ac_lib_var=`echo Xaw3d'_'Xaw3dComputeTopShadowRGB | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4850 "configure"
+#line 4968 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
Xaw3dComputeTopShadowRGB()
; return 0; }
EOF
-if { (eval echo configure:4861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# 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:4938: checking for XawViewportSetCoordinates in Viewport.h" >&5
+echo "configure:5056: checking for XawViewportSetCoordinates in Viewport.h" >&5
if eval "test \"`echo '$''{'ac_cv_have_XawViewportSetCoordinates'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4950 "configure"
+#line 5068 "configure"
#include "confdefs.h"
#include <X11/Xaw/Viewport.h>
EOF
have_lesstif=no
if test "$have_motif" = yes ; then
echo $ac_n "checking whether Motif is really LessTif""... $ac_c" 1>&6
-echo "configure:4979: checking whether Motif is really LessTif" >&5
+echo "configure:5097: checking whether Motif is really LessTif" >&5
if eval "test \"`echo '$''{'ac_cv_have_lesstif'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4990 "configure"
+#line 5108 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() {
long vers = LesstifVersion;
; return 0; }
EOF
-if { (eval echo configure:4997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_have_lesstif=yes
else
ltv=unknown
echo unknown > conftest-lt
echo $ac_n "checking LessTif version number""... $ac_c" 1>&6
-echo "configure:5025: checking LessTif version number" >&5
+echo "configure:5143: checking LessTif version number" >&5
if eval "test \"`echo '$''{'ac_cv_lesstif_version_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_lesstif_version_string=unknown
else
cat > conftest.$ac_ext <<EOF
-#line 5040 "configure"
+#line 5158 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <Xm/Xm.h>
exit(0);
}
EOF
-if { (eval echo configure:5053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ltv=`cat conftest-lt`
ac_cv_lesstif_version=`echo $ltv | sed 's/ .*//'`
mtv=unknown
echo unknown > conftest-mt
echo $ac_n "checking Motif version number""... $ac_c" 1>&6
-echo "configure:5083: checking Motif version number" >&5
+echo "configure:5201: checking Motif version number" >&5
if eval "test \"`echo '$''{'ac_cv_motif_version_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_motif_version_string=unknown
else
cat > conftest.$ac_ext <<EOF
-#line 5098 "configure"
+#line 5216 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <Xm/Xm.h>
exit(0);
}
EOF
-if { (eval echo configure:5111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
mtv=`cat conftest-mt`
ac_cv_motif_version=`echo $mtv | sed 's/ .*//'`
motif_requires_xpm=no
if test "$have_motif" = yes ; then
echo $ac_n "checking whether Motif requires XPM""... $ac_c" 1>&6
-echo "configure:5149: checking whether Motif requires XPM" >&5
+echo "configure:5267: checking whether Motif requires XPM" >&5
if test "$motif_version" -ge 2000; then
motif_requires_xpm=yes
echo "$ac_t""maybe" 1>&6
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
-echo "configure:5184: checking for XpQueryExtension in -lXp" >&5
+echo "configure:5302: checking for XpQueryExtension in -lXp" >&5
ac_lib_var=`echo Xp'_'XpQueryExtension | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXp -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5192 "configure"
+#line 5310 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
XpQueryExtension()
; return 0; }
EOF
-if { (eval echo configure:5203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for _Xsetlocale in -lXintl""... $ac_c" 1>&6
-echo "configure:5250: checking for _Xsetlocale in -lXintl" >&5
+echo "configure:5368: checking for _Xsetlocale in -lXintl" >&5
ac_lib_var=`echo Xintl'_'_Xsetlocale | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lXintl -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5258 "configure"
+#line 5376 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
_Xsetlocale()
; return 0; }
EOF
-if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
/*)
echo $ac_n "checking for XPM headers""... $ac_c" 1>&6
-echo "configure:5318: checking for XPM headers" >&5
+echo "configure:5436: checking for XPM headers" >&5
d=$with_xpm/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XPM libs""... $ac_c" 1>&6
-echo "configure:5328: checking for XPM libs" >&5
+echo "configure:5446: checking for XPM libs" >&5
d=$with_xpm/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:5366: checking for X11/xpm.h" >&5
+echo "configure:5484: checking for X11/xpm.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5371 "configure"
+#line 5489 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5494: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for GL headers""... $ac_c" 1>&6
-echo "configure:5439: checking for GL headers" >&5
+echo "configure:5557: checking for GL headers" >&5
d=$with_gl/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for GL libs""... $ac_c" 1>&6
-echo "configure:5449: checking for GL libs" >&5
+echo "configure:5567: checking for GL libs" >&5
d=$with_gl/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:5490: checking for GL/gl.h" >&5
+echo "configure:5608: checking for GL/gl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5495 "configure"
+#line 5613 "configure"
#include "confdefs.h"
#include <GL/gl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
-echo "configure:5531: checking for GL/glx.h" >&5
+echo "configure:5649: checking for GL/glx.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5536 "configure"
+#line 5654 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# to link against.
#
echo $ac_n "checking whether GL is really MesaGL""... $ac_c" 1>&6
-echo "configure:5578: checking whether GL is really MesaGL" >&5
+echo "configure:5696: checking whether GL is really MesaGL" >&5
if eval "test \"`echo '$''{'ac_cv_have_mesa_gl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 5590 "configure"
+#line 5708 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
unset ac_cv_mesagl_version_string
echo $ac_n "checking MesaGL version number""... $ac_c" 1>&6
-echo "configure:5631: checking MesaGL version number" >&5
+echo "configure:5749: checking MesaGL version number" >&5
if eval "test \"`echo '$''{'ac_cv_mesagl_version_string'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5636 "configure"
+#line 5754 "configure"
#include "confdefs.h"
#include <GL/gl.h>
configure: MESA_MAJOR_VERSION MESA_MINOR_VERSION
if test "$ac_have_mesa_gl" = yes; then
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:5689: checking for pthread_create in -lpthread" >&5
+echo "configure:5807: checking for pthread_create in -lpthread" >&5
ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5697 "configure"
+#line 5815 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:5708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for gl_get_thread_context in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:5746: checking for gl_get_thread_context in -l$gl_lib_1" >&5
+echo "configure:5864: checking for gl_get_thread_context in -l$gl_lib_1" >&5
ac_lib_var=`echo $gl_lib_1'_'gl_get_thread_context | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$gl_lib_1 $GL_LIBS -lpthread -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5754 "configure"
+#line 5872 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
gl_get_thread_context()
; return 0; }
EOF
-if { (eval echo configure:5765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS $X_LIBS"
echo $ac_n "checking for glBindTexture in -l$gl_lib_1""... $ac_c" 1>&6
-echo "configure:5813: checking for glBindTexture in -l$gl_lib_1" >&5
+echo "configure:5931: checking for glBindTexture in -l$gl_lib_1" >&5
ac_lib_var=`echo $gl_lib_1'_'glBindTexture | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-l$gl_lib_1 $GL_LIBS -lX11 -lXext -lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5821 "configure"
+#line 5939 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
glBindTexture()
; return 0; }
EOF
-if { (eval echo configure:5832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
/*)
echo $ac_n "checking for XReadDisplay headers""... $ac_c" 1>&6
-echo "configure:5886: checking for XReadDisplay headers" >&5
+echo "configure:6004: checking for XReadDisplay headers" >&5
d=$with_readdisplay/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for XReadDisplay libs""... $ac_c" 1>&6
-echo "configure:5896: checking for XReadDisplay libs" >&5
+echo "configure:6014: checking for XReadDisplay libs" >&5
d=$with_readdisplay/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
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:5934: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:6052: checking for X11/extensions/readdisplay.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5939 "configure"
+#line 6057 "configure"
#include "confdefs.h"
#include <X11/extensions/readdisplay.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5944: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
/*)
echo $ac_n "checking for Iris Video headers""... $ac_c" 1>&6
-echo "configure:5995: checking for Iris Video headers" >&5
+echo "configure:6113: checking for Iris Video headers" >&5
d=$with_sgivideo/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Iris Video libs""... $ac_c" 1>&6
-echo "configure:6005: checking for Iris Video libs" >&5
+echo "configure:6123: checking for Iris Video libs" >&5
d=$with_sgivideo/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
-echo "configure:6043: checking for dmedia/vl.h" >&5
+echo "configure:6161: checking for dmedia/vl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6048 "configure"
+#line 6166 "configure"
#include "confdefs.h"
#include <dmedia/vl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6053: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if test "$have_sgivideo" = yes; then
have_sgivideo=no
echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
-echo "configure:6078: checking for vlOpenVideo in -lvl" >&5
+echo "configure:6196: checking for vlOpenVideo in -lvl" >&5
ac_lib_var=`echo vl'_'vlOpenVideo | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lvl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6086 "configure"
+#line 6204 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
vlOpenVideo()
; return 0; }
EOF
-if { (eval echo configure:6097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
case "$with_zippy_req" in
/*)
echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
-echo "configure:6165: checking for $with_zippy_req" >&5
+echo "configure:6283: checking for $with_zippy_req" >&5
if test -x "$with_zippy_req" ; then
echo "$ac_t""yes" 1>&6
else
# Extract the first word of "$with_zippy_req", so it can be a program name with args.
set dummy $with_zippy_req; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6179: checking for $ac_word" >&5
+echo "configure:6297: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_zip2'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6229: checking for $ac_word" >&5
+echo "configure:6347: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_emacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6263: checking for $ac_word" >&5
+echo "configure:6381: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_xemacs_exe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$emacs_exe" ; then
echo $ac_n "checking for emacs yow""... $ac_c" 1>&6
-echo "configure:6298: checking for emacs yow" >&5
+echo "configure:6416: checking for emacs yow" >&5
#
# get emacs to tell us where the libexec directory is.
#
if test -z "$ac_cv_zippy_program" ; then
echo $ac_n "checking for xemacs yow""... $ac_c" 1>&6
-echo "configure:6320: checking for xemacs yow" >&5
+echo "configure:6438: checking for xemacs yow" >&5
if test -n "$xemacs_exe" ; then
#
# get xemacs to tell us where the libexec directory is.
dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
- yow="yow -f $dir_up/etc/yow.lines"
- if $dir/$yow >&- 2>&- ; then
- ac_cv_zippy_program="$dir/$yow"
+ yowlines="$dir_up/etc/yow.lines"
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
echo "$ac_t""$ac_cv_zippy_program" 1>&6
else
- echo "$ac_t""no" 1>&6
+ #
+ # In newer XEmacs releases, yow.lines is in a different place,
+ # and the easiest way to get it is by calling the new function
+ # `locate-data-file'.
+ #
+ yowlines=`$xemacs_exe $eargs \
+ '(princ (concat (locate-data-file "yow.lines") "\n"))' \
+ 2>/dev/null | tail -1`
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
+ echo "$ac_t""$ac_cv_zippy_program" 1>&6
+ else
+ echo "$ac_t""no" 1>&6
+ fi
fi
fi
fi
# 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:6366: checking for $ac_word" >&5
+echo "configure:6497: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6402: checking for $ac_word" >&5
+echo "configure:6533: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test "$enable_vt_locking" = yes; then
echo $ac_n "checking for the VT_LOCKSWITCH ioctl""... $ac_c" 1>&6
-echo "configure:6501: checking for the VT_LOCKSWITCH ioctl" >&5
+echo "configure:6632: checking for the VT_LOCKSWITCH ioctl" >&5
if eval "test \"`echo '$''{'ac_cv_vt_lockswitch'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6506 "configure"
+#line 6637 "configure"
#include "confdefs.h"
#include <fcntl.h>
#include <sys/ioctl.h>
int x = VT_LOCKSWITCH; int y = VT_UNLOCKSWITCH;
; return 0; }
EOF
-if { (eval echo configure:6515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_vt_lockswitch=yes
else
/*)
echo $ac_n "checking for Kerberos headers""... $ac_c" 1>&6
-echo "configure:6569: checking for Kerberos headers" >&5
+echo "configure:6700: checking for Kerberos headers" >&5
d=$with_kerberos/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for Kerberos libs""... $ac_c" 1>&6
-echo "configure:6579: checking for Kerberos libs" >&5
+echo "configure:6710: checking for Kerberos libs" >&5
d=$with_kerberos/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
if test "$with_kerberos" = yes; then
echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
-echo "configure:6610: checking for Kerberos" >&5
+echo "configure:6741: checking for Kerberos" >&5
if eval "test \"`echo '$''{'ac_cv_kerberos'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 6621 "configure"
+#line 6752 "configure"
#include "confdefs.h"
#include <krb.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:6628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_kerberos=yes
else
# from Tim Showalter <tjs+@andrew.cmu.edu>
PASSWD_LIBS="$PASSWD_LIBS -lkrb -ldes"
echo $ac_n "checking for res_search""... $ac_c" 1>&6
-echo "configure:6652: checking for res_search" >&5
+echo "configure:6783: checking for res_search" >&5
if eval "test \"`echo '$''{'ac_cv_func_res_search'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6657 "configure"
+#line 6788 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char res_search(); below. */
; return 0; }
EOF
-if { (eval echo configure:6680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_res_search=yes"
else
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
-echo "configure:6698: checking for res_search in -lresolv" >&5
+echo "configure:6829: checking for res_search in -lresolv" >&5
ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6706 "configure"
+#line 6837 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
res_search()
; return 0; }
EOF
-if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
/*)
echo $ac_n "checking for PAM headers""... $ac_c" 1>&6
-echo "configure:6767: checking for PAM headers" >&5
+echo "configure:6898: checking for PAM headers" >&5
d=$with_pam/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for PAM libs""... $ac_c" 1>&6
-echo "configure:6777: checking for PAM libs" >&5
+echo "configure:6908: checking for PAM libs" >&5
d=$with_pam/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
if test "$with_pam" = yes; then
echo $ac_n "checking for PAM""... $ac_c" 1>&6
-echo "configure:6808: checking for PAM" >&5
+echo "configure:6939: checking for PAM" >&5
if eval "test \"`echo '$''{'ac_cv_pam'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 6819 "configure"
+#line 6950 "configure"
#include "confdefs.h"
#include <security/pam_appl.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:6826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_pam=yes
else
/*)
echo $ac_n "checking for shadow password headers""... $ac_c" 1>&6
-echo "configure:6872: checking for shadow password headers" >&5
+echo "configure:7003: checking for shadow password headers" >&5
d=$with_shadow/include
if test -d $d; then
X_CFLAGS="-I$d $X_CFLAGS"
fi
echo $ac_n "checking for shadow password libs""... $ac_c" 1>&6
-echo "configure:6882: checking for shadow password libs" >&5
+echo "configure:7013: checking for shadow password libs" >&5
d=$with_shadow/lib
if test -d $d; then
X_LIBS="-L$d $X_LIBS"
#
if test "$pwent_cruft_done" = no ; then
echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6923: checking for Sun-style shadow passwords" >&5
+echo "configure:7054: checking for Sun-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_sun_adjunct'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 6934 "configure"
+#line 7065 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pwa_passwd;
; return 0; }
EOF
-if { (eval echo configure:6947: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sun_adjunct=yes
else
#
if test "$pwent_cruft_done" = no ; then
echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:6976: checking for DEC-style shadow passwords" >&5
+echo "configure:7107: checking for DEC-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_enhanced_passwd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 6987 "configure"
+#line 7118 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
pw = p->ufld.fd_encrypt;
; return 0; }
EOF
-if { (eval echo configure:7004: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7135: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_enhanced_passwd=yes
else
# On SCO, getprpwnam() is in -lprot (which uses nap() from -lx)
# (I'm told it needs -lcurses too, but I don't understand why.)
echo $ac_n "checking for getprpwnam in -lprot""... $ac_c" 1>&6
-echo "configure:7030: checking for getprpwnam in -lprot" >&5
+echo "configure:7161: checking for getprpwnam in -lprot" >&5
ac_lib_var=`echo prot'_'getprpwnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lprot -lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7038 "configure"
+#line 7169 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getprpwnam()
; return 0; }
EOF
-if { (eval echo configure:7049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
# On DEC, getprpwnam() is in -lsecurity
echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:7069: checking for getprpwnam in -lsecurity" >&5
+echo "configure:7200: checking for getprpwnam in -lsecurity" >&5
ac_lib_var=`echo security'_'getprpwnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsecurity $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7077 "configure"
+#line 7208 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getprpwnam()
; return 0; }
EOF
-if { (eval echo configure:7088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test "$pwent_cruft_done" = no ; then
echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:7117: checking for HP-style shadow passwords" >&5
+echo "configure:7248: checking for HP-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_hpux_passwd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 7128 "configure"
+#line 7259 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pw_passwd;
; return 0; }
EOF
-if { (eval echo configure:7141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7272: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_hpux_passwd=yes
else
# on HPUX, bigcrypt is in -lsec
echo $ac_n "checking for bigcrypt in -lsec""... $ac_c" 1>&6
-echo "configure:7166: checking for bigcrypt in -lsec" >&5
+echo "configure:7297: checking for bigcrypt in -lsec" >&5
ac_lib_var=`echo sec'_'bigcrypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lsec $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7174 "configure"
+#line 7305 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
bigcrypt()
; return 0; }
EOF
-if { (eval echo configure:7185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test "$pwent_cruft_done" = no ; then
echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:7212: checking for generic shadow passwords" >&5
+echo "configure:7343: checking for generic shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_shadow'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 7223 "configure"
+#line 7354 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->sp_pwdp;
; return 0; }
EOF
-if { (eval echo configure:7235: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7366: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_shadow=yes
else
# On some systems (UnixWare 2.1), getspnam() is in -lgen instead of -lc.
have_getspnam=no
echo $ac_n "checking for getspnam in -lc""... $ac_c" 1>&6
-echo "configure:7261: checking for getspnam in -lc" >&5
+echo "configure:7392: checking for getspnam in -lc" >&5
ac_lib_var=`echo c'_'getspnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7269 "configure"
+#line 7400 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getspnam()
; return 0; }
EOF
-if { (eval echo configure:7280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test "$have_getspnam" = no ; then
echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:7302: checking for getspnam in -lgen" >&5
+echo "configure:7433: checking for getspnam in -lgen" >&5
ac_lib_var=`echo gen'_'getspnam | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lgen $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7310 "configure"
+#line 7441 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
getspnam()
; return 0; }
EOF
-if { (eval echo configure:7321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test "$pwent_cruft_done" = no ; then
echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
-echo "configure:7352: checking for FreeBSD-style shadow passwords" >&5
+echo "configure:7483: checking for FreeBSD-style shadow passwords" >&5
if eval "test \"`echo '$''{'ac_cv_master_passwd'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
have_crypt=no
echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
-echo "configure:7373: checking for crypt in -lc" >&5
+echo "configure:7504: checking for crypt in -lc" >&5
ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7381 "configure"
+#line 7512 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
crypt()
; return 0; }
EOF
-if { (eval echo configure:7392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test "$have_crypt" = no ; then
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:7414: checking for crypt in -lcrypt" >&5
+echo "configure:7545: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7422 "configure"
+#line 7553 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
crypt()
; return 0; }
EOF
-if { (eval echo configure:7433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
warn 'The XSHM extension was requested, but was not found.'
fi
+if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
+ warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
+fi
+
if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
echo " will be installed in ${bindir}."
echo ""
- echo " The various graphics demos (80+ different executables) will"
+ echo " The various graphics demos (90+ different executables) will"
echo " also be installed in ${HACKDIR}."
echo ""
echo " If you would prefer the demos to be installed elsewhere"
--enable-subdir=DIR Put the demo programs in a subdirectory of \`bindir',
instead of putting them in bindir itself. You can
specify the name of the subdirectory. For example,
- --exec-prefix=/usr/local/bin --enable-subdir=demos
+ \`--exec-prefix=/usr/local --enable-subdir=demos'
would put xscreensaver in /usr/local/bin/, and would
put the demos in /usr/local/bin/demos/. (If DIR
begins with /, then bindir will not be prepended.)
fi
+# Check for the DOUBLE-BUFFER server extension header.
+#
+have_xdbe=no
+with_xdbe_req=unspecified
+AC_ARG_WITH(xdbe-ext,
+[ --with-xdbe-ext Include support for the DOUBLE-BUFFER server
+ extension, if possible (this is the default).
+ --without-xdbe-ext Do not compile in support for this extension.],
+ [with_xdbe="$withval"; with_xdbe_req="$withval"],[with_xdbe=yes])
+
+HANDLE_X_PATH_ARG(with_xdbe, --with-xdbe-ext, DOUBLE-BUFFER)
+
+if test "$with_xdbe" = yes; then
+
+ AC_CHECK_X_HEADER(X11/extensions/Xdbe.h, [have_xdbe=yes])
+ if test "$have_xdbe" = yes; then
+ AC_DEFINE(HAVE_DOUBLE_BUFFER_EXTENSION)
+ fi
+
+elif test "$with_xdbe" != no; then
+ echo "error: must be yes or no: --with-xdbe-ext=$with_xshm"
+ exit 1
+fi
+
+
# Check for the SGI-VIDEO-CONTROL server extension header.
#
have_sgivc=no
dir_up=`echo "$dir" | sed 's@/[^/]*$@@'`
changequote([,])
- yow="yow -f $dir_up/etc/yow.lines"
- if $dir/$yow >&- 2>&- ; then
- ac_cv_zippy_program="$dir/$yow"
+ yowlines="$dir_up/etc/yow.lines"
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
AC_MSG_RESULT($ac_cv_zippy_program)
else
- AC_MSG_RESULT(no)
+ #
+ # In newer XEmacs releases, yow.lines is in a different place,
+ # and the easiest way to get it is by calling the new function
+ # `locate-data-file'.
+ #
+ yowlines=`$xemacs_exe $eargs \
+ '(princ (concat (locate-data-file "yow.lines") "\n"))' \
+ 2>/dev/null | tail -1`
+ if $dir/yow -f $yowlines >&- 2>&- ; then
+ ac_cv_zippy_program="$dir/yow -f $yowlines"
+ AC_MSG_RESULT($ac_cv_zippy_program)
+ else
+ AC_MSG_RESULT(no)
+ fi
fi
fi
fi
warn 'The XSHM extension was requested, but was not found.'
fi
+if test "$with_xdbe_req" = yes -a "$have_xdbe" = no ; then
+ warn 'The DOUBLE-BUFFER extension was requested, but was not found.'
+fi
+
if test "$with_sgivc_req" = yes -a "$have_sgivc" = no ; then
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
echo ' "xscreensaver-demo", and "xscreensaver-command" executables'
echo " will be installed in ${bindir}."
echo ""
- echo " The various graphics demos (80+ different executables) will"
+ echo " The various graphics demos (90+ different executables) will"
echo " also be installed in ${HACKDIR}."
echo ""
echo " If you would prefer the demos to be installed elsewhere"
LOCK_SRCS_1 = lock.c passwd.c
LOCK_OBJS_1 = lock.o passwd.o
-TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c
+TEST_SRCS = test-passwd.c test-uid.c test-xdpms.c test-grab.c
TOOLKIT_SRCS = @TOOLKIT_SRCS@
TOOLKIT_OBJS = @TOOLKIT_OBJS@
test-xdpms: test-xdpms.o
$(CC) $(LDFLAGS) -o $@ test-xdpms.o $(SAVER_LIBS)
+test-grab: test-grab.o
+ $(CC) $(LDFLAGS) -o $@ test-grab.o $(SAVER_LIBS)
+
# This kludge is so that I can build/test the Athena version of the
# xscreensaver-demo program without having to re-run configure.
test-passwd.o: XScreenSaver_ad.h
test-uid.o: ../config.h
test-xdpms.o: ../config.h
+test-grab.o: ../config.h
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 3.08
-! 15-Mar-99
+! version 3.09
+! 11-Apr-99
!
! See "man xscreensaver" for more info. The latest version is always
! available at http://www.jwz.org/xscreensaver/
blitspin -root -grab \n\
slip -root \n\
distort -root \n\
+ spotlight -root \n\
hypercube -root \n\
halo -root \n\
maze -root \n\
t3d -root \n\
penetrate -root \n\
deluxe -root \n\
+ compass -root \n\
+ squiral -root \n\
+ xflame -root \n\
+ wander -root \n\
+ wander -root -advance 0 -size 10 -circles True \
+ -length 10000 -reset 100000 \n\
+ critical -root \n\
\
mono: rocks -root \n\
color: rocks -root -fg darksalmon \n\
blitspin -root -grab \\n\
slip -root \\n\
distort -root \\n\
+ spotlight -root \\n\
hypercube -root \\n\
halo -root \\n\
maze -root \\n\
t3d -root \\n\
penetrate -root \\n\
deluxe -root \\n\
+ compass -root \\n\
+ squiral -root \\n\
+ xflame -root \\n\
+ wander -root \\n\
+ wander -root -advance 0 -size 10 -circles True \
+ -length 10000 -reset 100000 \\n\
+ critical -root \\n\
\
mono: rocks -root \\n\
color: rocks -root -fg darksalmon \\n\
--- /dev/null
+/* test-uid.c --- playing with grabs.
+ * xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#include <stdio.h>
+#include <sys/time.h>
+
+#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
+
+char *progname = 0;
+char *progclass = "XScreenSaver";
+
+#define ALL_POINTER_EVENTS \
+ (ButtonPressMask | ButtonReleaseMask | EnterWindowMask | \
+ LeaveWindowMask | PointerMotionMask | PointerMotionHintMask | \
+ Button1MotionMask | Button2MotionMask | Button3MotionMask | \
+ Button4MotionMask | Button5MotionMask | ButtonMotionMask)
+
+int
+main (int argc, char **argv)
+{
+ XtAppContext app;
+ int kstatus, mstatus;
+ Cursor cursor = 0;
+ int delay = 60 * 15;
+ Widget toplevel_shell = XtAppInitialize (&app, progclass, 0, 0,
+ &argc, argv, 0, 0, 0);
+ Display *dpy = XtDisplay (toplevel_shell);
+ Window w = RootWindow (dpy, DefaultScreen(dpy));
+ XtGetApplicationNameAndClass (dpy, &progname, &progclass);
+
+ kstatus = XGrabKeyboard (dpy, w, True,
+ GrabModeSync, GrabModeAsync,
+ CurrentTime);
+ fprintf (stderr, "%s: grabbing keyboard on 0x%x... %s.\n",
+ progname, (unsigned long) w,
+ (kstatus == GrabSuccess ? "GrabSuccess" :
+ kstatus == AlreadyGrabbed ? "AlreadyGrabbed" :
+ kstatus == GrabInvalidTime ? "GrabInvalidTime" :
+ kstatus == GrabNotViewable ? "GrabNotViewable" :
+ kstatus == GrabFrozen ? "GrabFrozen" :
+ "???"));
+
+ mstatus = XGrabPointer (dpy, w, True, ALL_POINTER_EVENTS,
+ GrabModeAsync, GrabModeAsync, None,
+ cursor, CurrentTime);
+ fprintf (stderr, "%s: grabbing mouse on 0x%x... %s.\n",
+ progname, (unsigned long) w,
+ (mstatus == GrabSuccess ? "GrabSuccess" :
+ mstatus == AlreadyGrabbed ? "AlreadyGrabbed" :
+ mstatus == GrabInvalidTime ? "GrabInvalidTime" :
+ mstatus == GrabNotViewable ? "GrabNotViewable" :
+ mstatus == GrabFrozen ? "GrabFrozen" :
+ "???"));
+
+ XSync(dpy, False);
+
+ if (kstatus == GrabSuccess || mstatus == GrabSuccess)
+ {
+ fprintf (stderr, "%s: sleeping for %d:%02d:%02d...\n",
+ progname,
+ delay / (60 * 60),
+ (delay % (60 * 60)) / 60,
+ delay % 60);
+ fflush(stderr);
+ sleep (delay);
+ XSync(dpy, False);
+ }
+
+ exit (0);
+}
#endif
#include <stdlib.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
#include <stdio.h>
#include <sys/time.h>
/* Select for SubstructureNotify on all windows.
Select for KeyPress on all windows that already have it selected.
- Do we need to select for ButtonRelease? I don't think so.
+
+ Note that we can't select for ButtonPress, because of X braindamage:
+ only one client at a time may select for ButtonPress on a given
+ window, though any number can select for KeyPress. Someone explain
+ *that* to me.
+
+ So, if the user spends a while clicking the mouse without ever moving
+ the mouse or touching the keyboard, we won't know that they've been
+ active, and the screensaver will come on. That sucks, but I don't
+ know how to get around it.
*/
XSelectInput (si->dpy, window, SubstructureNotifyMask | events);
Button4MotionMask | Button5MotionMask | ButtonMotionMask)
-static int
-grab_kbd(saver_info *si, Window w)
-{
- saver_preferences *p = &si->prefs;
- int status = XGrabKeyboard (si->dpy, w, True,
- /* I don't really understand Sync vs Async,
- but these seem to work... */
- GrabModeSync, GrabModeAsync,
- CurrentTime);
- if (status == GrabSuccess)
- si->keyboard_grab_window = w;
-
- if (p->verbose_p)
- fprintf(stderr, "%s: grabbing keyboard on 0x%x... %s.\n",
- blurb(), (unsigned long) w,
- (status == GrabSuccess ? "GrabSuccess" :
- status == AlreadyGrabbed ? "AlreadyGrabbed" :
- status == GrabInvalidTime ? "GrabInvalidTime" :
- status == GrabNotViewable ? "GrabNotViewable" :
- status == GrabFrozen ? "GrabFrozen" :
- "???"));
-
- return status;
-}
-
static const char *
grab_string(int status)
{
}
}
+static int
+grab_kbd(saver_info *si, Window w)
+{
+ saver_preferences *p = &si->prefs;
+ int status = XGrabKeyboard (si->dpy, w, True,
+ /* I don't really understand Sync vs Async,
+ but these seem to work... */
+ GrabModeSync, GrabModeAsync,
+ CurrentTime);
+ if (status == GrabSuccess)
+ si->keyboard_grab_window = w;
+
+ if (p->verbose_p)
+ fprintf(stderr, "%s: grabbing keyboard on 0x%x... %s.\n",
+ blurb(), (unsigned long) w, grab_string(status));
+ return status;
+}
+
static int
grab_mouse (saver_info *si, Window w, Cursor cursor)
}
-Bool
+static Bool
grab_keyboard_and_mouse (saver_info *si, Window window, Cursor cursor)
{
Status mstatus, kstatus;
mstatus == GrabSuccess);
}
-void
+static void
ungrab_keyboard_and_mouse (saver_info *si)
{
ungrab_mouse (si);
}
}
-void
+Bool
blank_screen (saver_info *si)
{
int i;
+ Bool ok;
/* Note: we do our grabs on the root window, not on the screensaver window.
If we grabbed on the saver window, then the demo mode and lock dialog
boxes wouldn't get any events.
*/
- grab_keyboard_and_mouse (si,
- /*si->screens[0].screensaver_window,*/
- RootWindowOfScreen(si->screens[0].screen),
- (si->demoing_p
- ? 0
- : si->screens[0].cursor));
+ ok = grab_keyboard_and_mouse (si,
+ /*si->screens[0].screensaver_window,*/
+ RootWindowOfScreen(si->screens[0].screen),
+ (si->demoing_p
+ ? 0
+ : si->screens[0].cursor));
+
+
+ if (si->using_mit_saver_extension || si->using_sgi_saver_extension)
+ /* If we're using a server extension, then failure to get a grab is
+ not a big deal -- even without the grab, we will still be able
+ to un-blank when there is user activity, since the server will
+ tell us. */
+ ok = True;
+
+ if (!ok)
+ return False;
for (i = 0; i < si->nscreens; i++)
{
#endif
si->screen_blanked_p = True;
+
+ return True;
}
void
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "15-Mar-99 (3.08)" "X Version 11"
+.TH XScreenSaver 1 "11-Apr-99 (3.09)" "X Version 11"
.SH NAME
xscreensaver-command - control a running xscreensaver process
.SH SYNOPSIS
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "15-Mar-99 (3.08)" "X Version 11"
+.TH XScreenSaver 1 "11-Apr-99 (3.09)" "X Version 11"
.SH NAME
xscreensaver-demo - interactively control the background xscreensaver daemon
.SH SYNOPSIS
maybe_reload_init_file (si);
- blank_screen (si);
+ if (! blank_screen (si))
+ {
+ /* We were unable to grab either the keyboard or mouse.
+ This means we did not (and must not) blank the screen.
+ If we were to blank the screen while some other program
+ is holding both the mouse and keyboard grabbed, then
+ we would never be able to un-blank it! We would never
+ see any events, and the display would be wedged.
+
+ So, just go around the loop again and wait for the
+ next bout of idleness.
+ */
+
+ fprintf (stderr,
+ "%s: unable to grab keyboard or mouse! Blanking aborted.\n",
+ blurb(), timestring ());
+ continue;
+ }
+
kill_screenhack (si);
spawn_screenhack (si, True);
extern void raise_window (saver_info *si,
Bool inhibit_fade, Bool between_hacks_p,
Bool dont_clear);
-extern void blank_screen (saver_info *si);
+extern Bool blank_screen (saver_info *si);
extern void unblank_screen (saver_info *si);
-extern Bool grab_keyboard_and_mouse (saver_info *si, Window, Cursor);
-extern void ungrab_keyboard_and_mouse (saver_info *si);
/* =======================================================================
locking
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "15-Mar-99 (3.08)" "X Version 11"
+.TH XScreenSaver 1 "11-Apr-99 (3.09)" "X Version 11"
.SH NAME
xscreensaver - graphics hack and screen locker, launched when the user is idle
.SH SYNOPSIS
on the X console to cause the X display to lock, even if there is activity
on other virtual consoles. If you want that, then set this option to False.
(Or just lock the X console manually.)
+
+The default value for this resource is True, on systems where it works.
.TP 8
.B overlayStderr\fP (class \fBBoolean\fP)
If \fBcaptureStderr\fP is True, and your server supports ``overlay'' visuals,
as normal users, then the problem is that your \fI/dev/3dfx\fP file is not
configured properly. Check the Linux 3Dfx FAQ.
.TP 8
+.B Keyboard LEDs
+If \fIprocInterrupts\fP is on (which is the default on Linux systems) and
+you're using some program that toggles the state of your keyboard LEDs,
+xscreensaver won't work right: turning those LEDs on or off causes a
+keyboard interrupt, which xscreensaver will interpret as user activity.
+So if you're using such a program, set the \fIprocInterrupts\fP resource
+to False.
+.TP 8
.B Extensions
If you are not making use of one of the server extensions (\fBXIDLE\fP,
\fBSGI SCREEN_SAVER\fP, or \fBMIT-SCREEN-SAVER\fP), then it is possible, in
$(UTILS_SRC)/usleep.c $(UTILS_SRC)/visual.c \
$(UTILS_SRC)/xroger.c $(UTILS_SRC)/yarandom.c \
$(UTILS_SRC)/erase.c $(UTILS_SRC)/sgivideo.c \
- $(UTILS_SRC)/xshm.c
+ $(UTILS_SRC)/xshm.c $(UTILS_SRC)/xdbe.c
UTIL_OBJS = $(UTILS_BIN)/alpha.o $(UTILS_BIN)/colors.o \
$(UTILS_BIN)/grabscreen.o $(UTILS_BIN)/hsv.o \
$(UTILS_BIN)/resources.o $(UTILS_BIN)/spline.o \
$(UTILS_BIN)/usleep.o $(UTILS_BIN)/visual.o \
$(UTILS_BIN)/xroger.o $(UTILS_BIN)/yarandom.o \
$(UTILS_BIN)/erase.o $(UTILS_BIN)/sgivideo.o \
- $(UTILS_SRC)/xshm.o
+ $(UTILS_SRC)/xshm.o $(UTILS_SRC)/xdbe.o
SRCS = attraction.c blitspin.c bouboule.c braid.c bubbles.c \
bubbles-default.c decayscreen.c deco.c drift.c flag.c \
rotor.c ant.c xjack.c xlyap.c jigsaw.c xscreensaver-sgigl.c \
cynosure.c moire2.c flow.c epicycle.c interference.c \
truchet.c bsod.c crystal.c discrete.c distort.c kumppa.c \
- sonar.c demon.c loop.c t3d.c penetrate.c deluxe.c
+ sonar.c demon.c loop.c t3d.c penetrate.c deluxe.c compass.c \
+ squiral.c xflame.c wander.c spotlight.c critical.c
OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \
bubbles-default.o decayscreen.o deco.o drift.o flag.o \
rotor.o ant.o xjack.o xlyap.o jigsaw.o xscreensaver-sgigl.o \
cynosure.o moire2.o flow.o epicycle.o interference.o \
truchet.o bsod.o crystal.o discrete.o distort.o kumppa.o \
- sonar.o demon.o loop.o t3d.o penetrate.o deluxe.o
+ sonar.o demon.o loop.o t3d.o penetrate.o deluxe.o compass.o \
+ squiral.o xflame.o wander.o spotlight.o critical.o
EXES = attraction blitspin bouboule braid bubbles decayscreen deco \
drift flag flame forest vines galaxy grav greynetic halo \
fadeplot rd-bomb coral mountain triangle lissie worm rotor \
ant xjack xlyap jigsaw cynosure moire2 flow epicycle \
interference truchet bsod crystal discrete distort kumppa \
- sonar demon loop t3d penetrate deluxe
+ sonar demon loop t3d penetrate deluxe compass squiral \
+ xflame wander spotlight critical
HACK_OBJS_1 = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
$(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
GRAB_OBJS_1 = $(UTILS_BIN)/grabscreen.o $(SGI_VIDEO_OBJS)
GRAB_OBJS = $(GRAB_OBJS_1) $(COLOR_OBJS)
XSHM_OBJS = $(UTILS_BIN)/xshm.o
+XDBE_OBJS = $(UTILS_BIN)/xdbe.o
GRAB_LIBS = $(SGI_VIDEO_LIBS)
HDRS = bubbles.h screenhack.h xlockmore.h xlockmoreI.h automata.h
slip.man sphere.man spiral.man strange.man swirl.man \
xroger.man goop.man starfish.man munch.man rd-bomb.man \
xjack.man xlyap.man jigsaw.man epicycle.man bsod.man \
- sonar.man t3d.man
+ sonar.man t3d.man squiral.man spotlight.man critical.man
STAR = *
EXTRAS = README Makefile.in xlock_23.h .gdbinit \
vidwhacker \
$(UTILS_BIN)/yarandom.o: $(UTILS_SRC)/yarandom.c
$(UTILS_BIN)/erase.o: $(UTILS_SRC)/erase.c
$(UTILS_BIN)/xshm.o: $(UTILS_SRC)/xshm.c
+$(UTILS_BIN)/xdbe.o: $(UTILS_SRC)/xdbe.c
$(UTIL_OBJS):
cd $(UTILS_BIN) ; \
ERASE = $(UTILS_BIN)/erase.o
COL = $(COLOR_OBJS)
SHM = $(XSHM_OBJS)
+DBE = $(XDBE_OBJS)
CC_HACK = $(CC) $(LDFLAGS)
moire: moire.o $(HACK_OBJS) $(COL) $(SHM)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(SHM) $(HACK_LIBS)
-moire2: moire2.o $(HACK_OBJS) $(COL)
- $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS)
+moire2: moire2.o $(HACK_OBJS) $(COL) $(DBE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(DBE) $(HACK_LIBS)
noseguy: noseguy.o $(HACK_OBJS)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(XPM_LIBS)
epicycle: epicycle.o $(HACK_OBJS) $(COL) $(ERASE)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(ERASE) $(HACK_LIBS)
-interference: interference.o $(HACK_OBJS) $(COL) $(SHM)
- $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(SHM) $(HACK_LIBS)
+interference: interference.o $(HACK_OBJS) $(COL) $(SHM) $(DBE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(SHM) $(DBE) $(HACK_LIBS)
truchet: truchet.o $(HACK_OBJS) $(COL)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS)
distort: distort.o $(HACK_OBJS) $(GRAB) $(SHM)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(GRAB) $(SHM) $(HACK_LIBS) $(GRAB_LIBS)
-kumppa: kumppa.o $(HACK_OBJS)
- $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(HACK_LIBS)
+kumppa: kumppa.o $(HACK_OBJS) $(DBE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(DBE) $(HACK_LIBS)
sonar: sonar.o $(HACK_OBJS) $(COL)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS)
penetrate: penetrate.o $(HACK_OBJS) $(COL)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS)
-deluxe: deluxe.o $(HACK_OBJS) $(COL)
+deluxe: deluxe.o $(HACK_OBJS) $(COL) $(DBE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(DBE) $(HACK_LIBS)
+
+compass: compass.o $(HACK_OBJS) $(DBE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(DBE) $(HACK_LIBS)
+
+squiral: squiral.o $(HACK_OBJS) $(COL)
$(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(HACK_LIBS)
+xflame: xflame.o $(HACK_OBJS) $(SHM)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(SHM) $(HACK_LIBS) $(XPM_LIBS)
+
+wander: wander.o $(HACK_OBJS) $(COL) $(ERASE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(ERASE) $(HACK_LIBS)
+
+spotlight: spotlight.o $(HACK_OBJS) $(GRAB)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(GRAB) $(HACK_LIBS) $(GRAB_LIBS)
+
+critical: critical.o $(HACK_OBJS) $(COL) $(ERASE)
+ $(CC_HACK) -o $@ $@.o $(HACK_OBJS) $(COL) $(ERASE) $(HACK_LIBS)
+
# The rules for those hacks which follow the `xlockmore' API.
#
moire2.o: $(UTILS_SRC)/colors.h
moire2.o: $(UTILS_SRC)/grabscreen.h
moire2.o: $(UTILS_SRC)/visual.h
+moire2.o: $(UTILS_SRC)/xdbe.h
flow.o: $(srcdir)/xlockmore.h
flow.o: ../config.h
flow.o: $(srcdir)/xlockmoreI.h
interference.o: $(UTILS_SRC)/colors.h
interference.o: $(UTILS_SRC)/grabscreen.h
interference.o: $(UTILS_SRC)/visual.h
+interference.o: $(UTILS_SRC)/xdbe.h
truchet.o: $(srcdir)/screenhack.h
truchet.o: ../config.h
truchet.o: $(UTILS_SRC)/yarandom.h
kumppa.o: $(UTILS_SRC)/colors.h
kumppa.o: $(UTILS_SRC)/grabscreen.h
kumppa.o: $(UTILS_SRC)/visual.h
+kumppa.o: $(UTILS_SRC)/xdbe.h
sonar.o: $(srcdir)/screenhack.h
sonar.o: ../config.h
sonar.o: $(UTILS_SRC)/yarandom.h
deluxe.o: $(UTILS_SRC)/colors.h
deluxe.o: $(UTILS_SRC)/grabscreen.h
deluxe.o: $(UTILS_SRC)/visual.h
+deluxe.o: $(UTILS_SRC)/xdbe.h
+compass.o: $(srcdir)/screenhack.h
+compass.o: ../config.h
+compass.o: $(UTILS_SRC)/yarandom.h
+compass.o: $(UTILS_SRC)/usleep.h
+compass.o: $(UTILS_SRC)/resources.h
+compass.o: $(UTILS_SRC)/hsv.h
+compass.o: $(UTILS_SRC)/colors.h
+compass.o: $(UTILS_SRC)/grabscreen.h
+compass.o: $(UTILS_SRC)/visual.h
+compass.o: $(UTILS_SRC)/xdbe.h
+squiral.o: $(srcdir)/screenhack.h
+squiral.o: ../config.h
+squiral.o: $(UTILS_SRC)/yarandom.h
+squiral.o: $(UTILS_SRC)/usleep.h
+squiral.o: $(UTILS_SRC)/resources.h
+squiral.o: $(UTILS_SRC)/hsv.h
+squiral.o: $(UTILS_SRC)/colors.h
+squiral.o: $(UTILS_SRC)/grabscreen.h
+squiral.o: $(UTILS_SRC)/visual.h
+squiral.o: $(UTILS_SRC)/erase.h
+xflame.o: $(srcdir)/screenhack.h
+xflame.o: ../config.h
+xflame.o: $(UTILS_SRC)/yarandom.h
+xflame.o: $(UTILS_SRC)/usleep.h
+xflame.o: $(UTILS_SRC)/resources.h
+xflame.o: $(UTILS_SRC)/hsv.h
+xflame.o: $(UTILS_SRC)/colors.h
+xflame.o: $(UTILS_SRC)/grabscreen.h
+xflame.o: $(UTILS_SRC)/visual.h
+xflame.o: $(UTILS_SRC)/xshm.h
+wander.o: $(srcdir)/screenhack.h
+wander.o: ../config.h
+wander.o: $(UTILS_SRC)/yarandom.h
+wander.o: $(UTILS_SRC)/usleep.h
+wander.o: $(UTILS_SRC)/resources.h
+wander.o: $(UTILS_SRC)/hsv.h
+wander.o: $(UTILS_SRC)/colors.h
+wander.o: $(UTILS_SRC)/grabscreen.h
+wander.o: $(UTILS_SRC)/visual.h
+wander.o: $(UTILS_SRC)/erase.h
+spotlight.o: $(srcdir)/screenhack.h
+spotlight.o: ../config.h
+spotlight.o: $(UTILS_SRC)/yarandom.h
+spotlight.o: $(UTILS_SRC)/usleep.h
+spotlight.o: $(UTILS_SRC)/resources.h
+spotlight.o: $(UTILS_SRC)/hsv.h
+spotlight.o: $(UTILS_SRC)/colors.h
+spotlight.o: $(UTILS_SRC)/grabscreen.h
+spotlight.o: $(UTILS_SRC)/visual.h
+critical.o: $(srcdir)/screenhack.h
+critical.o: ../config.h
+critical.o: $(UTILS_SRC)/yarandom.h
+critical.o: $(UTILS_SRC)/usleep.h
+critical.o: $(UTILS_SRC)/resources.h
+critical.o: $(UTILS_SRC)/hsv.h
+critical.o: $(UTILS_SRC)/colors.h
+critical.o: $(UTILS_SRC)/grabscreen.h
+critical.o: $(UTILS_SRC)/visual.h
+critical.o: $(UTILS_SRC)/erase.h
bsod_sleep(Display *dpy, int seconds)
{
int q = seconds * 4;
+ int quantum = 250000;
+
+ if (seconds == -1)
+ q = 1, quantum = 100000;
+
do
{
XSync(dpy, False);
{
XEvent event;
XNextEvent (dpy, &event);
+ if (event.xany.type == ButtonPress)
+ return True;
if (event.xany.type == KeyPress)
{
KeySym keysym;
if (q > 0)
{
q--;
- usleep(250000);
+ usleep(quantum);
}
}
while (q > 0);
const char *def_font = "fixed";
XFontStruct *font;
GC gc;
- int lines = 1;
+ int lines_1 = 0, lines_2 = 0, lines_3 = 0, lines_4 = 0;
const char *s;
- const char *sco_panic =
+ const char *sco_panic_1 =
("Unexpected trap in kernel mode:\n"
"\n"
"cr0 0x80010013 cr2 0x00000014 cr3 0x00000000 tlb 0x00000000\n"
"\n"
"PANIC: k_trap - kernel mode trap type 0x0000000E\n"
"Trying to dump 5023 pages to dumpdev hd (1/41), 63 pages per '.'\n"
- "...............................................................................\n"
- "5023 pages dumped\n"
+ );
+ const char *sco_panic_2 =
+ ("...............................................................................\n"
+ );
+ const char *sco_panic_3 =
+ ("5023 pages dumped\n"
"\n"
"\n"
- "** Safe to Power Off **\n"
+ );
+ const char *sco_panic_4 =
+ ("** Safe to Power Off **\n"
" - or -\n"
"** Press Any Key to Reboot **\n"
);
if (!get_boolean_resource("doSCO", "DoSCO"))
return False;
- for (s = sco_panic; *s; s++) if (*s == '\n') lines++;
+ for (s = sco_panic_1; *s; s++) if (*s == '\n') lines_1++;
+ for (s = sco_panic_2; *s; s++) if (*s == '\n') lines_2++;
+ for (s = sco_panic_3; *s; s++) if (*s == '\n') lines_3++;
+ for (s = sco_panic_4; *s; s++) if (*s == '\n') lines_4++;
XGetWindowAttributes (dpy, window, &xgwa);
gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
draw_string(dpy, window, gc, &gcv, font,
- 10, xgwa.height - (lines * (font->ascent + font->descent + 1)),
+ 10, xgwa.height - ((lines_1 + lines_2 + lines_3 + lines_4 + 1) *
+ (font->ascent + font->descent + 1)),
10, 10,
- sco_panic, 0);
- XFreeGC(dpy, gc);
+ sco_panic_1, 0);
+ XSync(dpy, False);
+ for (s = sco_panic_2; *s; s++)
+ {
+ char *ss = strdup(sco_panic_2);
+ ss[s - sco_panic_2] = 0;
+ draw_string(dpy, window, gc, &gcv, font,
+ 10, xgwa.height - ((lines_2 + lines_3 + lines_4 + 1) *
+ (font->ascent + font->descent + 1)),
+ 10, 10,
+ ss, 0);
+ XSync(dpy, False);
+ free(ss);
+ if (bsod_sleep (dpy, -1))
+ goto DONE;
+ }
+
+ draw_string(dpy, window, gc, &gcv, font,
+ 10, xgwa.height - ((lines_3 + lines_4 + 1) *
+ (font->ascent + font->descent + 1)),
+ 10, 10,
+ sco_panic_3, 0);
XSync(dpy, False);
+ if (bsod_sleep(dpy, 1))
+ goto DONE;
+ draw_string(dpy, window, gc, &gcv, font,
+ 10, xgwa.height - ((lines_4 + 1) *
+ (font->ascent + font->descent + 1)),
+ 10, 10,
+ sco_panic_4, 0);
+ XSync(dpy, False);
+
bsod_sleep(dpy, delay);
+ DONE:
XClearWindow(dpy, window);
+ XFreeGC(dpy, gc);
XFreeFont(dpy, font);
return True;
}
}
for (i=7 ; i<10 ; i++) {
- bsod_sleep(dpy, 1);
+ if (bsod_sleep(dpy, 1))
+ goto DONE;
XCopyArea(dpy, pixmap, window, gc, 0, 0, pix_w, pix_h,
(x + (i*offset)), y);
}
+ bsod_sleep(dpy, delay);
+ DONE:
XFreePixmap(dpy, pixmap);
XFreeGC(dpy, gc);
XSync(dpy, False);
- bsod_sleep(dpy, delay);
XClearWindow(dpy, window);
XFreeFont(dpy, font);
return True;
--- /dev/null
+/* xscreensaver, Copyright (c) 1999 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * 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 <math.h>
+#include "screenhack.h"
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# include "xdbe.h"
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+#define countof(x) (sizeof(x)/sizeof(*(x)))
+#define ABS(x) ((x)<0?-(x):(x))
+#define MAX(x,y) ((x)<(y)?(y):(x))
+#define MIN(x,y) ((x)>(y)?(y):(x))
+#define RAND(n) ((long) ((random() & 0x7fffffff) % ((long) (n))))
+#define RANDSIGN() ((random() & 1) ? 1 : -1)
+
+struct disc {
+ int theta; /* 0 - 360*64 */
+ int velocity;
+ int acceleration;
+ int limit;
+ GC gc;
+ void (*draw) (Display *, Drawable, struct disc *,
+ int x, int y, int radius);
+};
+
+
+static void
+draw_letters (Display *dpy, Drawable d, struct disc *disc,
+ int x, int y, int radius)
+{
+ XPoint points[50];
+ double th2 = 2 * M_PI * (disc->theta / ((double) 360*64));
+ double th;
+
+ /* W */
+
+ th = th2;
+
+ points[0].x = x + radius * 0.8 * cos(th - 0.07);
+ points[0].y = y + radius * 0.8 * sin(th - 0.07);
+
+ points[1].x = x + radius * 0.7 * cos(th - 0.05);
+ points[1].y = y + radius * 0.7 * sin(th - 0.05);
+
+ points[2].x = x + radius * 0.78 * cos(th);
+ points[2].y = y + radius * 0.78 * sin(th);
+
+ points[3].x = x + radius * 0.7 * cos(th + 0.05);
+ points[3].y = y + radius * 0.7 * sin(th + 0.05);
+
+ points[4].x = x + radius * 0.8 * cos(th + 0.07);
+ points[4].y = y + radius * 0.8 * sin(th + 0.07);
+
+ XDrawLines (dpy, d, disc->gc, points, 5, CoordModeOrigin);
+
+ /* 30 (1) */
+
+ th = th2 + (2 * M_PI * 0.08333);
+
+ points[0].x = x + radius * 0.78 * cos(th - 0.13);
+ points[0].y = y + radius * 0.78 * sin(th - 0.13);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.08);
+ points[1].y = y + radius * 0.8 * sin(th - 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.03);
+ points[2].y = y + radius * 0.78 * sin(th - 0.03);
+
+ points[3].x = x + radius * 0.76 * cos(th - 0.03);
+ points[3].y = y + radius * 0.76 * sin(th - 0.03);
+
+ points[4].x = x + radius * 0.75 * cos(th - 0.08);
+ points[4].y = y + radius * 0.75 * sin(th - 0.08);
+
+ points[5].x = x + radius * 0.74 * cos(th - 0.03);
+ points[5].y = y + radius * 0.74 * sin(th - 0.03);
+
+ points[6].x = x + radius * 0.72 * cos(th - 0.03);
+ points[6].y = y + radius * 0.72 * sin(th - 0.03);
+
+ points[7].x = x + radius * 0.7 * cos(th - 0.08);
+ points[7].y = y + radius * 0.7 * sin(th - 0.08);
+
+ points[8].x = x + radius * 0.72 * cos(th - 0.13);
+ points[8].y = y + radius * 0.72 * sin(th - 0.13);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+ /* 30 (2) */
+
+ points[0].x = x + radius * 0.78 * cos(th + 0.03);
+ points[0].y = y + radius * 0.78 * sin(th + 0.03);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.08);
+ points[1].y = y + radius * 0.8 * sin(th + 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th + 0.13);
+ points[2].y = y + radius * 0.78 * sin(th + 0.13);
+
+ points[3].x = x + radius * 0.72 * cos(th + 0.13);
+ points[3].y = y + radius * 0.72 * sin(th + 0.13);
+
+ points[4].x = x + radius * 0.7 * cos(th + 0.08);
+ points[4].y = y + radius * 0.7 * sin(th + 0.08);
+
+ points[5].x = x + radius * 0.72 * cos(th + 0.03);
+ points[5].y = y + radius * 0.72 * sin(th + 0.03);
+
+ points[6] = points[0];
+
+ XDrawLines (dpy, d, disc->gc, points, 7, CoordModeOrigin);
+
+ /* 33 (1) */
+
+ th = th2 + (2 * M_PI * 0.16666);
+
+ points[0].x = x + radius * 0.78 * cos(th - 0.13);
+ points[0].y = y + radius * 0.78 * sin(th - 0.13);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.08);
+ points[1].y = y + radius * 0.8 * sin(th - 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.03);
+ points[2].y = y + radius * 0.78 * sin(th - 0.03);
+
+ points[3].x = x + radius * 0.76 * cos(th - 0.03);
+ points[3].y = y + radius * 0.76 * sin(th - 0.03);
+
+ points[4].x = x + radius * 0.75 * cos(th - 0.08);
+ points[4].y = y + radius * 0.75 * sin(th - 0.08);
+
+ points[5].x = x + radius * 0.74 * cos(th - 0.03);
+ points[5].y = y + radius * 0.74 * sin(th - 0.03);
+
+ points[6].x = x + radius * 0.72 * cos(th - 0.03);
+ points[6].y = y + radius * 0.72 * sin(th - 0.03);
+
+ points[7].x = x + radius * 0.7 * cos(th - 0.08);
+ points[7].y = y + radius * 0.7 * sin(th - 0.08);
+
+ points[8].x = x + radius * 0.72 * cos(th - 0.13);
+ points[8].y = y + radius * 0.72 * sin(th - 0.13);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+ /* 33 (2) */
+
+ points[0].x = x + radius * 0.78 * cos(th + 0.03);
+ points[0].y = y + radius * 0.78 * sin(th + 0.03);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.08);
+ points[1].y = y + radius * 0.8 * sin(th + 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th + 0.13);
+ points[2].y = y + radius * 0.78 * sin(th + 0.13);
+
+ points[3].x = x + radius * 0.76 * cos(th + 0.13);
+ points[3].y = y + radius * 0.76 * sin(th + 0.13);
+
+ points[4].x = x + radius * 0.75 * cos(th + 0.08);
+ points[4].y = y + radius * 0.75 * sin(th + 0.08);
+
+ points[5].x = x + radius * 0.74 * cos(th + 0.13);
+ points[5].y = y + radius * 0.74 * sin(th + 0.13);
+
+ points[6].x = x + radius * 0.72 * cos(th + 0.13);
+ points[6].y = y + radius * 0.72 * sin(th + 0.13);
+
+ points[7].x = x + radius * 0.7 * cos(th + 0.08);
+ points[7].y = y + radius * 0.7 * sin(th + 0.08);
+
+ points[8].x = x + radius * 0.72 * cos(th + 0.03);
+ points[8].y = y + radius * 0.72 * sin(th + 0.03);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+ /* N */
+
+ th = th2 + (2 * M_PI * 0.25);
+
+ points[0].x = x + radius * 0.7 * cos(th - 0.05);
+ points[0].y = y + radius * 0.7 * sin(th - 0.05);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.05);
+ points[1].y = y + radius * 0.8 * sin(th - 0.05);
+
+ points[2].x = x + radius * 0.7 * cos(th + 0.05);
+ points[2].y = y + radius * 0.7 * sin(th + 0.05);
+
+ points[3].x = x + radius * 0.8 * cos(th + 0.05);
+ points[3].y = y + radius * 0.8 * sin(th + 0.05);
+
+ XDrawLines (dpy, d, disc->gc, points, 4, CoordModeOrigin);
+
+ /* 3 */
+
+ th = th2 + (2 * M_PI * 0.33333);
+
+ points[0].x = x + radius * 0.78 * cos(th - 0.05);
+ points[0].y = y + radius * 0.78 * sin(th - 0.05);
+
+ points[1].x = x + radius * 0.8 * cos(th);
+ points[1].y = y + radius * 0.8 * sin(th);
+
+ points[2].x = x + radius * 0.78 * cos(th + 0.05);
+ points[2].y = y + radius * 0.78 * sin(th + 0.05);
+
+ points[3].x = x + radius * 0.76 * cos(th + 0.05);
+ points[3].y = y + radius * 0.76 * sin(th + 0.05);
+
+ points[4].x = x + radius * 0.75 * cos(th);
+ points[4].y = y + radius * 0.75 * sin(th);
+
+ points[5].x = x + radius * 0.74 * cos(th + 0.05);
+ points[5].y = y + radius * 0.74 * sin(th + 0.05);
+
+ points[6].x = x + radius * 0.72 * cos(th + 0.05);
+ points[6].y = y + radius * 0.72 * sin(th + 0.05);
+
+ points[7].x = x + radius * 0.7 * cos(th);
+ points[7].y = y + radius * 0.7 * sin(th);
+
+ points[8].x = x + radius * 0.72 * cos(th - 0.05);
+ points[8].y = y + radius * 0.72 * sin(th - 0.05);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+ /* 6 */
+
+ th = th2 + (2 * M_PI * 0.41666);
+
+ points[0].x = x + radius * 0.78 * cos(th + 0.05);
+ points[0].y = y + radius * 0.78 * sin(th + 0.05);
+
+ points[1].x = x + radius * 0.8 * cos(th);
+ points[1].y = y + radius * 0.8 * sin(th);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.05);
+ points[2].y = y + radius * 0.78 * sin(th - 0.05);
+
+ points[3].x = x + radius * 0.72 * cos(th - 0.05);
+ points[3].y = y + radius * 0.72 * sin(th - 0.05);
+
+ points[4].x = x + radius * 0.7 * cos(th);
+ points[4].y = y + radius * 0.7 * sin(th);
+
+ points[5].x = x + radius * 0.72 * cos(th + 0.05);
+ points[5].y = y + radius * 0.72 * sin(th + 0.05);
+
+ points[6].x = x + radius * 0.74 * cos(th + 0.05);
+ points[6].y = y + radius * 0.74 * sin(th + 0.05);
+
+ points[7].x = x + radius * 0.76 * cos(th);
+ points[7].y = y + radius * 0.76 * sin(th);
+
+ points[8].x = x + radius * 0.74 * cos(th - 0.05);
+ points[8].y = y + radius * 0.74 * sin(th - 0.05);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+
+ /* E */
+
+ th = th2 + (2 * M_PI * 0.5);
+
+ points[0].x = x + radius * 0.8 * cos(th + 0.05);
+ points[0].y = y + radius * 0.8 * sin(th + 0.05);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.05);
+ points[1].y = y + radius * 0.8 * sin(th - 0.05);
+
+ points[2].x = x + radius * 0.75 * cos(th - 0.05);
+ points[2].y = y + radius * 0.75 * sin(th - 0.05);
+
+ points[3].x = x + radius * 0.75 * cos(th + 0.025);
+ points[3].y = y + radius * 0.75 * sin(th + 0.025);
+
+ points[4].x = x + radius * 0.75 * cos(th - 0.05);
+ points[4].y = y + radius * 0.75 * sin(th - 0.05);
+
+ points[5].x = x + radius * 0.7 * cos(th - 0.05);
+ points[5].y = y + radius * 0.7 * sin(th - 0.05);
+
+ points[6].x = x + radius * 0.7 * cos(th + 0.05);
+ points[6].y = y + radius * 0.7 * sin(th + 0.05);
+
+ XDrawLines (dpy, d, disc->gc, points, 7, CoordModeOrigin);
+
+ /* 12 (1) */
+
+ th = th2 + (2 * M_PI * 0.58333);
+
+ points[0].x = x + radius * 0.77 * cos(th - 0.06);
+ points[0].y = y + radius * 0.77 * sin(th - 0.06);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.03);
+ points[1].y = y + radius * 0.8 * sin(th - 0.03);
+
+ points[2].x = x + radius * 0.7 * cos(th - 0.03);
+ points[2].y = y + radius * 0.7 * sin(th - 0.03);
+
+ XDrawLines (dpy, d, disc->gc, points, 3, CoordModeOrigin);
+
+ /* 12 (2) */
+
+ points[0].x = x + radius * 0.78 * cos(th + 0.02);
+ points[0].y = y + radius * 0.78 * sin(th + 0.02);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.07);
+ points[1].y = y + radius * 0.8 * sin(th + 0.07);
+
+ points[2].x = x + radius * 0.78 * cos(th + 0.11);
+ points[2].y = y + radius * 0.78 * sin(th + 0.11);
+
+ points[3].x = x + radius * 0.76 * cos(th + 0.11);
+ points[3].y = y + radius * 0.76 * sin(th + 0.11);
+
+ points[4].x = x + radius * 0.74 * cos(th + 0.02);
+ points[4].y = y + radius * 0.74 * sin(th + 0.02);
+
+ points[5].x = x + radius * 0.71 * cos(th + 0.03);
+ points[5].y = y + radius * 0.71 * sin(th + 0.03);
+
+ points[6].x = x + radius * 0.7 * cos(th + 0.03);
+ points[6].y = y + radius * 0.7 * sin(th + 0.03);
+
+ points[7].x = x + radius * 0.7 * cos(th + 0.13);
+ points[7].y = y + radius * 0.7 * sin(th + 0.13);
+
+ XDrawLines (dpy, d, disc->gc, points, 8, CoordModeOrigin);
+
+ /* 15 (1) */
+
+ th = th2 + (2 * M_PI * 0.66666);
+
+ points[0].x = x + radius * 0.77 * cos(th - 0.06);
+ points[0].y = y + radius * 0.77 * sin(th - 0.06);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.03);
+ points[1].y = y + radius * 0.8 * sin(th - 0.03);
+
+ points[2].x = x + radius * 0.7 * cos(th - 0.03);
+ points[2].y = y + radius * 0.7 * sin(th - 0.03);
+
+ XDrawLines (dpy, d, disc->gc, points, 3, CoordModeOrigin);
+
+ /* 15 (2) */
+
+ points[0].x = x + radius * 0.8 * cos(th + 0.11);
+ points[0].y = y + radius * 0.8 * sin(th + 0.11);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.02);
+ points[1].y = y + radius * 0.8 * sin(th + 0.02);
+
+ points[2].x = x + radius * 0.76 * cos(th + 0.02);
+ points[2].y = y + radius * 0.76 * sin(th + 0.02);
+
+ points[3].x = x + radius * 0.77 * cos(th + 0.06);
+ points[3].y = y + radius * 0.77 * sin(th + 0.06);
+
+ points[4].x = x + radius * 0.76 * cos(th + 0.10);
+ points[4].y = y + radius * 0.76 * sin(th + 0.10);
+
+ points[5].x = x + radius * 0.73 * cos(th + 0.11);
+ points[5].y = y + radius * 0.73 * sin(th + 0.11);
+
+ points[6].x = x + radius * 0.72 * cos(th + 0.10);
+ points[6].y = y + radius * 0.72 * sin(th + 0.10);
+
+ points[7].x = x + radius * 0.7 * cos(th + 0.06);
+ points[7].y = y + radius * 0.7 * sin(th + 0.06);
+
+ points[8].x = x + radius * 0.72 * cos(th + 0.02);
+ points[8].y = y + radius * 0.72 * sin(th + 0.02);
+
+ XDrawLines (dpy, d, disc->gc, points, 9, CoordModeOrigin);
+
+ /* S */
+
+ th = th2 + (2 * M_PI * 0.75);
+
+ points[0].x = x + radius * 0.78 * cos(th + 0.05);
+ points[0].y = y + radius * 0.78 * sin(th + 0.05);
+
+ points[1].x = x + radius * 0.8 * cos(th);
+ points[1].y = y + radius * 0.8 * sin(th);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.05);
+ points[2].y = y + radius * 0.78 * sin(th - 0.05);
+
+ points[3].x = x + radius * 0.76 * cos(th - 0.05);
+ points[3].y = y + radius * 0.76 * sin(th - 0.05);
+
+ points[4].x = x + radius * 0.74 * cos(th + 0.05);
+ points[4].y = y + radius * 0.74 * sin(th + 0.05);
+
+ points[5].x = x + radius * 0.72 * cos(th + 0.05);
+ points[5].y = y + radius * 0.72 * sin(th + 0.05);
+
+ points[6].x = x + radius * 0.7 * cos(th);
+ points[6].y = y + radius * 0.7 * sin(th);
+
+ points[7].x = x + radius * 0.72 * cos(th - 0.05);
+ points[7].y = y + radius * 0.72 * sin(th - 0.05);
+
+ XDrawLines (dpy, d, disc->gc, points, 8, CoordModeOrigin);
+
+ /* 21 (1) */
+
+ th = th2 + (2 * M_PI * 0.83333);
+
+ points[0].x = x + radius * 0.78 * cos(th - 0.13);
+ points[0].y = y + radius * 0.78 * sin(th - 0.13);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.08);
+ points[1].y = y + radius * 0.8 * sin(th - 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.03);
+ points[2].y = y + radius * 0.78 * sin(th - 0.03);
+
+ points[3].x = x + radius * 0.76 * cos(th - 0.03);
+ points[3].y = y + radius * 0.76 * sin(th - 0.03);
+
+ points[4].x = x + radius * 0.74 * cos(th - 0.12);
+ points[4].y = y + radius * 0.74 * sin(th - 0.12);
+
+ points[5].x = x + radius * 0.71 * cos(th - 0.13);
+ points[5].y = y + radius * 0.71 * sin(th - 0.13);
+
+ points[6].x = x + radius * 0.7 * cos(th - 0.13);
+ points[6].y = y + radius * 0.7 * sin(th - 0.13);
+
+ points[7].x = x + radius * 0.7 * cos(th - 0.02);
+ points[7].y = y + radius * 0.7 * sin(th - 0.02);
+
+ XDrawLines (dpy, d, disc->gc, points, 8, CoordModeOrigin);
+
+ /* 21 (2) */
+
+ points[0].x = x + radius * 0.77 * cos(th + 0.03);
+ points[0].y = y + radius * 0.77 * sin(th + 0.03);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.06);
+ points[1].y = y + radius * 0.8 * sin(th + 0.06);
+
+ points[2].x = x + radius * 0.7 * cos(th + 0.06);
+ points[2].y = y + radius * 0.7 * sin(th + 0.06);
+
+ XDrawLines (dpy, d, disc->gc, points, 3, CoordModeOrigin);
+
+ /* 24 (1) */
+
+ th = th2 + (2 * M_PI * 0.91666);
+
+ points[0].x = x + radius * 0.78 * cos(th - 0.13);
+ points[0].y = y + radius * 0.78 * sin(th - 0.13);
+
+ points[1].x = x + radius * 0.8 * cos(th - 0.08);
+ points[1].y = y + radius * 0.8 * sin(th - 0.08);
+
+ points[2].x = x + radius * 0.78 * cos(th - 0.03);
+ points[2].y = y + radius * 0.78 * sin(th - 0.03);
+
+ points[3].x = x + radius * 0.76 * cos(th - 0.03);
+ points[3].y = y + radius * 0.76 * sin(th - 0.03);
+
+ points[4].x = x + radius * 0.74 * cos(th - 0.12);
+ points[4].y = y + radius * 0.74 * sin(th - 0.12);
+
+ points[5].x = x + radius * 0.71 * cos(th - 0.13);
+ points[5].y = y + radius * 0.71 * sin(th - 0.13);
+
+ points[6].x = x + radius * 0.7 * cos(th - 0.13);
+ points[6].y = y + radius * 0.7 * sin(th - 0.13);
+
+ points[7].x = x + radius * 0.7 * cos(th - 0.02);
+ points[7].y = y + radius * 0.7 * sin(th - 0.02);
+
+ XDrawLines (dpy, d, disc->gc, points, 8, CoordModeOrigin);
+
+ /* 24 (2) */
+
+ points[0].x = x + radius * 0.69 * cos(th + 0.09);
+ points[0].y = y + radius * 0.69 * sin(th + 0.09);
+
+ points[1].x = x + radius * 0.8 * cos(th + 0.09);
+ points[1].y = y + radius * 0.8 * sin(th + 0.09);
+
+ points[2].x = x + radius * 0.72 * cos(th + 0.01);
+ points[2].y = y + radius * 0.72 * sin(th + 0.01);
+
+ points[3].x = x + radius * 0.72 * cos(th + 0.13);
+ points[3].y = y + radius * 0.72 * sin(th + 0.13);
+
+ XDrawLines (dpy, d, disc->gc, points, 4, CoordModeOrigin);
+}
+
+
+static void
+draw_ticks (Display *dpy, Drawable d, struct disc *disc,
+ int x, int y, int radius)
+{
+ XSegment segs[72];
+ int i;
+ double tick = (M_PI * 2) / 72;
+
+ for (i = 0; i < 72; i++)
+ {
+ int radius2 = radius;
+ double th = (i * tick) + (2 * M_PI * (disc->theta / ((double) 360*64)));
+
+ if (i % 6)
+ radius2 -= radius / 16;
+ else
+ radius2 -= radius / 8;
+
+ segs[i].x1 = x + radius * cos(th);
+ segs[i].y1 = y + radius * sin(th);
+ segs[i].x2 = x + radius2 * cos(th);
+ segs[i].y2 = y + radius2 * sin(th);
+ }
+ XDrawSegments (dpy, d, disc->gc, segs, countof(segs));
+
+ draw_letters (dpy, d, disc, x, y, radius);
+}
+
+
+static void
+draw_thin_arrow (Display *dpy, Drawable d, struct disc *disc,
+ int x, int y, int radius)
+{
+ XPoint points[3];
+ double th;
+ int radius2;
+ double tick = ((M_PI * 2) / 72) * 2;
+
+ radius *= 0.9;
+ radius2 = radius - (radius / 8) * 3;
+
+ th = 2 * M_PI * (disc->theta / ((double) 360*64));
+
+ points[0].x = x + radius * cos(th); /* tip */
+ points[0].y = y + radius * sin(th);
+
+ points[1].x = x + radius2 * cos(th - tick); /* tip left */
+ points[1].y = y + radius2 * sin(th - tick);
+
+ points[2].x = x + radius2 * cos(th + tick); /* tip right */
+ points[2].y = y + radius2 * sin(th + tick);
+
+ XDrawLine (dpy, d, disc->gc,
+ (int) (x + radius2 * cos(th)),
+ (int) (y + radius2 * sin(th)),
+ (int) (x + -radius * cos(th)),
+ (int) (y + -radius * sin(th)));
+
+ XFillPolygon (dpy, d, disc->gc, points, 3, Convex, CoordModeOrigin);
+}
+
+
+static void
+draw_thick_arrow (Display *dpy, Drawable d, struct disc *disc,
+ int x, int y, int radius)
+{
+ XPoint points[10];
+ double th;
+ int radius2, radius3;
+ double tick = ((M_PI * 2) / 72) * 2;
+
+ radius *= 0.9;
+ radius2 = radius - (radius / 8) * 3;
+ radius3 = radius - (radius / 8) * 2;
+ th = 2 * M_PI * (disc->theta / ((double) 360*64));
+
+ points[0].x = x + radius * cos(th); /* tip */
+ points[0].y = y + radius * sin(th);
+
+ points[1].x = x + radius2 * cos(th - tick); /* tip left */
+ points[1].y = y + radius2 * sin(th - tick);
+
+ points[2].x = x + radius2 * cos(th + tick); /* tip right */
+ points[2].y = y + radius2 * sin(th + tick);
+
+ points[3] = points[0];
+
+ XDrawLines (dpy, d, disc->gc, points, 4, CoordModeOrigin);
+
+ points[0].x = x + radius2 * cos(th - tick/2); /* top left */
+ points[0].y = y + radius2 * sin(th - tick/2);
+
+ points[1].x = x + -radius2 * cos(th + tick/2); /* bottom left */
+ points[1].y = y + -radius2 * sin(th + tick/2);
+
+ points[2].x = x + -radius3 * cos(th); /* bottom */
+ points[2].y = y + -radius3 * sin(th);
+
+ points[3].x = x + -radius * cos(th); /* bottom spike */
+ points[3].y = y + -radius * sin(th);
+
+ points[4] = points[2]; /* return */
+
+ points[5].x = x + -radius2 * cos(th - tick/2); /* bottom right */
+ points[5].y = y + -radius2 * sin(th - tick/2);
+
+ points[6].x = x + radius2 * cos(th + tick/2); /* top right */
+ points[6].y = y + radius2 * sin(th + tick/2);
+
+ XDrawLines (dpy, d, disc->gc, points, 7, CoordModeOrigin);
+}
+
+
+
+static void
+roll_disc (struct disc *disc)
+{
+ double th = disc->theta;
+ if (th < 0)
+ th = -(th + disc->velocity);
+ else
+ th = (th + disc->velocity);
+
+ if (th > (360*64))
+ th -= (360*64);
+ else if (th < 0)
+ th += (360*64);
+
+ disc->theta = (disc->theta > 0 ? th : -th);
+
+ disc->velocity += disc->acceleration;
+
+ if (disc->velocity > disc->limit ||
+ disc->velocity < -disc->limit)
+ disc->acceleration = -disc->acceleration;
+
+ /* Alter direction of rotational acceleration randomly. */
+ if (! (random() % 120))
+ disc->acceleration = -disc->acceleration;
+
+ /* Change acceleration very occasionally. */
+ if (! (random() % 200))
+ {
+ if (random() & 1)
+ disc->acceleration *= 1.2;
+ else
+ disc->acceleration *= 0.8;
+ }
+}
+
+
+static void
+init_spin (struct disc *disc)
+{
+ disc->limit = 5*64;
+ disc->theta = RAND(360*64);
+ disc->velocity = RAND(16) * RANDSIGN();
+ disc->acceleration = RAND(16) * RANDSIGN();
+}
+
+
+static void
+draw_compass (Display *dpy, Drawable d, struct disc **discs,
+ int x, int y, int radius)
+{
+ int i = 0;
+ while (discs[i])
+ {
+ discs[i]->draw (dpy, d, discs[i], x, y, radius);
+ roll_disc (discs[i]);
+ i++;
+ }
+}
+
+static void
+draw_pointer (Display *dpy, Drawable d, GC ptr_gc, GC dot_gc,
+ int x, int y, int radius)
+{
+ XPoint points[3];
+ int size = radius * 0.1;
+
+ /* top */
+
+ points[0].x = x - size;
+ points[0].y = y - radius - size;
+
+ points[1].x = x + size;
+ points[1].y = y - radius - size;
+
+ points[2].x = x;
+ points[2].y = y - radius;
+
+ XFillPolygon (dpy, d, ptr_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* top right */
+
+ points[0].x = x - (radius * 0.85);
+ points[0].y = y - (radius * 0.8);
+
+ points[1].x = x - (radius * 1.1);
+ points[1].y = y - (radius * 0.55);
+
+ points[2].x = x - (radius * 0.6);
+ points[2].y = y - (radius * 0.65);
+
+ XFillPolygon (dpy, d, ptr_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* left */
+
+ points[0].x = x - (radius * 1.05);
+ points[0].y = y;
+
+ points[1].x = x - (radius * 1.1);
+ points[1].y = y - (radius * 0.025);
+
+ points[2].x = x - (radius * 1.1);
+ points[2].y = y + (radius * 0.025);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* right */
+
+ points[0].x = x + (radius * 1.05);
+ points[0].y = y;
+
+ points[1].x = x + (radius * 1.1);
+ points[1].y = y - (radius * 0.025);
+
+ points[2].x = x + (radius * 1.1);
+ points[2].y = y + (radius * 0.025);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* bottom */
+
+ points[0].x = x;
+ points[0].y = y + (radius * 1.05);
+
+ points[1].x = x - (radius * 0.025);
+ points[1].y = y + (radius * 1.1);
+
+ points[2].x = x + (radius * 0.025);
+ points[2].y = y + (radius * 1.1);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* bottom left */
+
+ points[0].x = x + (radius * 0.74);
+ points[0].y = y + (radius * 0.74);
+
+ points[1].x = x + (radius * 0.78);
+ points[1].y = y + (radius * 0.75);
+
+ points[2].x = x + (radius * 0.75);
+ points[2].y = y + (radius * 0.78);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* top left */
+
+ points[0].x = x + (radius * 0.74);
+ points[0].y = y - (radius * 0.74);
+
+ points[1].x = x + (radius * 0.78);
+ points[1].y = y - (radius * 0.75);
+
+ points[2].x = x + (radius * 0.75);
+ points[2].y = y - (radius * 0.78);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+
+ /* bottom right */
+
+ points[0].x = x - (radius * 0.74);
+ points[0].y = y + (radius * 0.74);
+
+ points[1].x = x - (radius * 0.78);
+ points[1].y = y + (radius * 0.75);
+
+ points[2].x = x - (radius * 0.75);
+ points[2].y = y + (radius * 0.78);
+
+ XFillPolygon (dpy, d, dot_gc, points, 3, Convex, CoordModeOrigin);
+}
+
+\f
+char *progclass = "Compass";
+
+char *defaults [] = {
+ ".background: #000000",
+ ".foreground: #DDFFFF",
+ "*arrow1Foreground: #FFF66A",
+ "*arrow2Foreground: #F7D64A",
+ "*pointerForeground: #FF0000",
+ "*delay: 10000",
+ "*doubleBuffer: True",
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ "*useDBE: True",
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ 0
+};
+
+XrmOptionDescRec options [] = {
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-db", ".doubleBuffer", XrmoptionNoArg, "True" },
+ { "-no-db", ".doubleBuffer", XrmoptionNoArg, "False" },
+ { 0, 0, 0, 0 }
+};
+
+void
+screenhack (Display *dpy, Window window)
+{
+ XGCValues gcv;
+ int delay = get_integer_resource ("delay", "Integer");
+ Bool dbuf = get_boolean_resource ("doubleBuffer", "Boolean");
+ struct disc *discs[4];
+ int x, y, size, size2;
+ GC ptr_gc;
+ GC erase_gc = 0;
+ XWindowAttributes xgwa;
+ Pixmap b=0, ba=0, bb=0; /* double-buffer to reduce flicker */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ XdbeBackBuffer backb = 0;
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+ XGetWindowAttributes (dpy, window, &xgwa);
+ size2 = MIN(xgwa.width, xgwa.height);
+
+ if (size2 > 600) size2 = 600;
+
+ size = (size2 / 2) * 0.8;
+
+ x = xgwa.width/2;
+ y = xgwa.height/2;
+
+ if (dbuf)
+ {
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ b = backb = xdbe_get_backbuffer (dpy, window, XdbeUndefined);
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+ if (!b)
+ {
+ x = size2/2;
+ y = size2/2;
+ ba = XCreatePixmap (dpy, window, size2, size2, xgwa.depth);
+ bb = XCreatePixmap (dpy, window, size2, size2, xgwa.depth);
+ b = ba;
+ }
+ }
+ else
+ {
+ b = window;
+ }
+
+ discs[0] = (struct disc *) calloc (1, sizeof (struct disc));
+ discs[1] = (struct disc *) calloc (1, sizeof (struct disc));
+ discs[2] = (struct disc *) calloc (1, sizeof (struct disc));
+ discs[3] = 0;
+
+ gcv.foreground = get_pixel_resource ("foreground", "Foreground",
+ dpy, xgwa.colormap);
+ gcv.line_width = MAX(2, (size/60));
+ gcv.join_style = JoinBevel;
+ discs[0]->draw = draw_ticks;
+ discs[0]->gc = XCreateGC (dpy, b, GCForeground|GCLineWidth|GCJoinStyle,
+ &gcv);
+ init_spin (discs[0]);
+
+ gcv.foreground = get_pixel_resource ("arrow2Foreground", "Foreground",
+ dpy, xgwa.colormap);
+ gcv.line_width = MAX(4, (size / 30));
+ discs[1]->draw = draw_thick_arrow;
+ discs[1]->gc = XCreateGC (dpy, b, GCForeground|GCLineWidth, &gcv);
+ init_spin (discs[1]);
+
+ gcv.foreground = get_pixel_resource ("arrow1Foreground", "Foreground",
+ dpy, xgwa.colormap);
+ gcv.line_width = MAX(4, (size / 30));
+ discs[2]->draw = draw_thin_arrow;
+ discs[2]->gc = XCreateGC (dpy, b, GCForeground|GCLineWidth, &gcv);
+ init_spin (discs[2]);
+
+ gcv.foreground = get_pixel_resource ("pointerForeground", "Foreground",
+ dpy, xgwa.colormap);
+ ptr_gc = XCreateGC (dpy, b, GCForeground|GCLineWidth, &gcv);
+
+ gcv.foreground = get_pixel_resource ("background", "Background",
+ dpy, xgwa.colormap);
+ erase_gc = XCreateGC (dpy, b, GCForeground, &gcv);
+
+ if (ba) XFillRectangle (dpy, ba, erase_gc, 0, 0, size2, size2);
+ if (bb) XFillRectangle (dpy, bb, erase_gc, 0, 0, size2, size2);
+
+ while (1)
+ {
+ XFillRectangle (dpy, b, erase_gc, 0, 0, xgwa.width, xgwa.height);
+
+ draw_compass (dpy, b, discs, x, y, size);
+ draw_pointer (dpy, b, ptr_gc, discs[0]->gc, x, y, size);
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ if (backb)
+ {
+ XdbeSwapInfo info[1];
+ info[0].swap_window = window;
+ info[0].swap_action = XdbeUndefined;
+ XdbeSwapBuffers (dpy, info, 1);
+ }
+ else
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ if (dbuf)
+ {
+ XCopyArea (dpy, b, window, erase_gc, 0, 0,
+ size2, size2,
+ xgwa.width/2 - x,
+ xgwa.height/2 - y);
+ b = (b == ba ? bb : ba);
+ }
+
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
+ if (delay)
+ usleep (delay);
+ }
+}
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BSOD.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BUBBLES-DEFAULT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BUBBLES.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) COMPASS.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CORAL.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CRITICAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CRYSTAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CYNOSURE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECAYSCREEN.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SONAR.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPHERE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPIRAL.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPOTLIGHT.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SQUIRAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) STARFISH.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) STRANGE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SWIRL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRIANGLE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRUCHET.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) VINES.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) WANDER.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) WORM.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XFLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XJACK.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLOCKMORE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLYAP.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BSOD.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BUBBLES-DEFAULT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) BUBBLES.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) COMPASS.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CORAL.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CRITICAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CRYSTAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) CYNOSURE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DECAYSCREEN.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SONAR.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPHERE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPIRAL.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SPOTLIGHT.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SQUIRAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) STARFISH.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) STRANGE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) SWIRL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRIANGLE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) TRUCHET.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) VINES.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) WANDER.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) WORM.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XFLAME.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XJACK.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLOCKMORE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) XLYAP.C
--- /dev/null
+/* critical -- Self-organizing-criticality display hack for XScreenSaver
+ * Copyright (C) 1998, 1999 Martin Pool <mbp@humbug.org.au>
+ *
+ * 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.
+ *
+ * See `critical.man' for more information.
+ *
+ * Revision history:
+ * 13 Nov 1998: Initial version, Martin Pool <mbp@humbug.org.au>
+ */
+
+#include "screenhack.h"
+#include "erase.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+char *progclass = "Critical";
+
+
+typedef struct {
+ int width, height; /* in cells */
+ unsigned short *cells;
+} CriticalModel;
+
+
+CriticalModel * model_allocate (int w, int h);
+void model_initialize (CriticalModel *model);
+static void model_step (CriticalModel *model, int *top_x, int *top_y);
+
+
+/* Options this module understands. */
+XrmOptionDescRec options[] = {
+ { "-ncolors", ".ncolors", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-colorscheme", ".colorscheme", XrmoptionSepArg, 0 },
+ { "-restart", ".restart", XrmoptionSepArg, 0 },
+ { "-cellsize", ".cellsize", XrmoptionSepArg, 0 },
+ { "-batchcount", ".batchcount", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 } /* end */
+};
+
+
+/* Default xrm resources. */
+char *defaults[] = {
+ ".background: black",
+ "*colorscheme: smooth",
+ "*delay: 10000",
+ "*ncolors: 64",
+ "*restart: 8",
+ "*cellsize: 9",
+ "*batchcount: 1500",
+ 0 /* end */
+};
+
+
+/* Allocate an return a new simulation model datastructure.
+ */
+
+CriticalModel *
+model_allocate (int model_w, int model_h)
+{
+ CriticalModel *model;
+
+ model = malloc (sizeof (CriticalModel));
+ if (!model)
+ return 0;
+
+ model->width = model_w;
+ model->height = model_h;
+
+ model->cells = malloc (sizeof (int) * model_w * model_h);
+ if (!model->cells)
+ return 0;
+
+ return model;
+}
+
+
+
+/* Initialize the data model underlying the hack.
+
+ For the self-organizing criticality hack, this consists of a 2d
+ array full of random integers.
+
+ I've considered storing the data as (say) a binary tree within a 2d
+ array, to make finding the highest value faster at the expense of
+ storage space: searching the whole array on each iteration seems a
+ little inefficient. However, the screensaver doesn't seem to take
+ up many cycles as it is: presumably the search is pretty quick
+ compared to the sleeps. The current version uses less than 1% of
+ the CPU time of an AMD K6-233. Many machines running X11 at this
+ point in time seem to be memory-limited, not CPU-limited.
+
+ The root of all evil, and all that.
+*/
+
+
+void
+model_initialize (CriticalModel *model)
+{
+ int i;
+
+ for (i = model->width * model->height; i >= 0; i--)
+ {
+ model->cells[i] = (unsigned short) random ();
+ }
+}
+
+
+/* Move one step forward in the criticality simulation.
+
+ This function locates and returns in (TOP_X, TOP_Y) the location of
+ the highest-valued cell in the model. It also replaces that cell
+ and it's eight nearest neighbours with new random values.
+ Neighbours that fall off the edge of the model are simply
+ ignored. */
+static void
+model_step (CriticalModel *model, int *top_x, int *top_y)
+{
+ int x, y, i;
+ int dx, dy;
+ unsigned short top_value;
+
+ /* Find the top cell */
+ top_value = 0;
+ i = 0;
+ for (y = 0; y < model->height; y++)
+ for (x = 0; x < model->width; x++)
+ {
+ if (model->cells[i] >= top_value)
+ {
+ top_value = model->cells[i];
+ *top_x = x;
+ *top_y = y;
+ }
+ i++;
+ }
+
+ /* Replace it and its neighbours with new random values */
+ for (dy = -1; dy <= 1; dy++)
+ {
+ int y = *top_y + dy;
+ if (y < 0 || y >= model->height)
+ continue;
+
+ for (dx = -1; dx <= 1; dx++)
+ {
+ int x = *top_x + dx;
+ if (x < 0 || x >= model->width)
+ continue;
+
+ model->cells[y * model->width + x] = (unsigned short) random();
+ }
+ }
+}
+
+
+/* Construct and return in COLORS and N_COLORS a new set of colors,
+ depending on the resource settings. */
+void
+setup_colormap (Display *dpy, XWindowAttributes *wattr,
+ XColor **colors,
+ int *n_colors)
+{
+ Bool writable;
+ char const * color_scheme;
+
+ /* Make a colormap */
+ *n_colors = get_integer_resource ("ncolors", "Integer");
+ if (*n_colors < 2)
+ *n_colors = 2;
+
+ *colors = (XColor *) calloc (sizeof(XColor), *n_colors);
+ if (!*colors)
+ {
+ fprintf (stderr, "%s:%d: can't allocate memory for colors\n",
+ __FILE__, __LINE__);
+ return;
+ }
+
+ writable = False;
+ color_scheme = get_string_resource ("colorscheme", "ColorScheme");
+
+ if (!strcmp (color_scheme, "random"))
+ {
+ make_random_colormap (dpy, wattr->visual,
+ wattr->colormap,
+ *colors, n_colors,
+ True, True, &writable, True);
+ }
+ else if (!strcmp (color_scheme, "smooth"))
+ {
+ make_smooth_colormap (dpy, wattr->visual,
+ wattr->colormap,
+ *colors, n_colors,
+ True, &writable, True);
+ }
+ else
+ {
+ make_uniform_colormap (dpy, wattr->visual,
+ wattr->colormap,
+ *colors, n_colors, True,
+ &writable, True);
+ }
+}
+
+
+
+/* Display a self-organizing criticality screen hack. The program
+ runs indefinately on the root window. */
+void
+screenhack (Display *dpy, Window window)
+{
+ GC fgc, bgc;
+ XGCValues gcv;
+ XWindowAttributes wattr;
+ int n_colors;
+ XColor *colors;
+ int model_w, model_h;
+ CriticalModel *model;
+ int lines_per_color = 10;
+ int i_color = 0;
+ int x1, y1, x2, y2;
+ long delay_usecs;
+ int cell_size;
+ int batchcount;
+
+ /* Number of screens that should be drawn before reinitializing the
+ model, and count of the number of screens done so far. */
+ int n_restart, i_restart;
+
+ /* Find window attributes */
+ XGetWindowAttributes (dpy, window, &wattr);
+
+ /* Construct the initial model state. */
+ cell_size = get_integer_resource ("cellsize", "Integer");
+ if (cell_size < 1)
+ cell_size = 1;
+ if (cell_size >= 100)
+ cell_size = 99;
+
+ batchcount = get_integer_resource ("batchcount", "Integer");
+ if (batchcount < 5)
+ batchcount = 5;
+
+ model_w = wattr.width / cell_size;
+ model_h = wattr.height / cell_size;
+
+ model = model_allocate (model_w, model_h);
+ if (!model)
+ {
+ fprintf (stderr, "critical: error preparing the model\n");
+ return;
+ }
+
+ /* make a black gc for the background */
+ gcv.foreground = get_pixel_resource ("background", "Background",
+ dpy, wattr.colormap);
+ bgc = XCreateGC (dpy, window, GCForeground, &gcv);
+
+ fgc = XCreateGC (dpy, window, 0, &gcv);
+
+ x2 = rand() % model_w;
+ y2 = rand() % model_h;
+
+ delay_usecs = get_integer_resource ("delay", "Integer");
+ n_restart = get_integer_resource ("restart", "Integer");
+
+ /* xscreensaver will kill or stop us when the user does something
+ * that deserves attention. */
+ i_restart = 0;
+
+ while (1) {
+ int i_batch;
+
+ if (!i_restart)
+ {
+ setup_colormap (dpy, &wattr, &colors, &n_colors);
+ model_initialize (model);
+ }
+
+ for (i_batch = batchcount; i_batch; i_batch--)
+ {
+ /* Set color */
+ if ((i_batch % lines_per_color) == 0)
+ {
+ i_color = (i_color + 1) % n_colors;
+ gcv.foreground = colors[i_color].pixel;
+ XChangeGC (dpy, fgc, GCForeground, &gcv);
+ }
+
+ /* draw a line */
+ x1 = x2;
+ y1 = y2;
+
+ model_step (model, &x2, &y2);
+
+ XDrawLine (dpy, window, fgc,
+ x1 * cell_size + cell_size/2,
+ y1 * cell_size + cell_size/2,
+ x2 * cell_size + cell_size/2,
+ y2 * cell_size + cell_size/2);
+
+ /* Flush changes to display, and discard any pending input --
+ we'll never look at it anyhow, and it saves it filling up
+ memory. */
+ XSync (dpy, True);
+
+ usleep (delay_usecs);
+ }
+
+ i_restart = (i_restart + 1) % n_restart;
+ erase_full_window (dpy, window);
+ }
+}
+
+
+/*
+ * Local variables:
+ * c-indent-mode: gnu
+ * compile-command "make critical && ./critical"
+ * End:
+ */
--- /dev/null
+.TH XScreenSaver 1 "13-Nov-98" "X Version 11"
+.SH NAME
+critical - Draw a system showing self-organizing criticality
+.SH SYNOPSIS
+.B critical
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-delay \fIseconds\fP] [\-random \fIboolean\fP] [\-ncolors \fIint\fP] [\-offset \fIint\fP]
+.SH DESCRIPTION
+The \fIcritical\fP program displays a self-organizing critical system
+that gradually emerges from chaos.
+
+\fIcritical\fP performs a simulation on a two-dimensional array of
+integers. The array is initialized to random values. On each
+iteration, it draws a line to the array position with the greatest
+value. It then replaces that location and the eight neighboring
+locations with randomly-selected values.
+
+The lines are initially random, but over time a chaotic
+self-organizing system evolves: areas of the screen which happen to
+have lower values are less likely to be updated to new values, and so
+the line tends to avoid those areas. Eventually, the histogram of
+changes approaches the power-law curve typical of such systems.
+
+The simplest documented self-organizing system is the one-dimensional
+equivalent of \fIcritical\fP.
+
+I heard about this algorithm second-hand: apparently there was an
+article in \fIScientific American\fP describing it sometime in 1997.
+.SH OPTIONS
+.I critical
+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 \-mono
+If on a color display, pretend we're on a monochrome display.
+.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 \-delay \fIusecs\fP
+Number of microseconds to wait after drawing each line.
+.TP 8
+.B \-random \fIboolean\fP
+Whether to use randomly selected colours rather than a cycle around
+the colour wheel.
+.TP 8
+.B \-offset \fIinteger\fP
+The maximum random radius increment to use.
+.TP 8
+.B \-ncolors \fIinteger\fP
+How many colors should be allocated in the color ramp (note that this
+value interacts with \fIoffset\fP.)
+.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 xscreensaver-command (1)
+.BR xscreensaver-demo (1)
+.SH COPYRIGHT
+Copyright \(co 1998 by Martin Pool.
+
+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.
+.SH AUTHOR
+Martin Pool <mbp@humbug.org.au>, 13-Nov-1998. Based in part on the
+XScreenSaver code by Jamie Zawinski <jwz@jwz.org>.
* 5-AUG-1993
*
* Hacked by jwz, 28-Nov-97 (sped up and added new motion directions)
+
+ * R. Schultz
+ * Added "melt" & "stretch" modes 28-Mar-1999
+ *
*/
#include "screenhack.h"
static int delay;
static GC gc;
static int mode;
+static int iterations=100;
#define SHUFFLE 0
#define UP 1
#define DOWNRIGHT 8
#define IN 9
#define OUT 10
-
+#define MELT 11
+#define STRETCH 12
static void
init_decay (Display *dpy, Window window)
XGCValues gcv;
XWindowAttributes xgwa;
long gcflags;
+ unsigned long bg;
char *s = get_string_resource("mode", "Mode");
if (s && !strcmp(s, "shuffle")) mode = SHUFFLE;
else if (s && !strcmp(s, "downright")) mode = DOWNRIGHT;
else if (s && !strcmp(s, "in")) mode = IN;
else if (s && !strcmp(s, "out")) mode = OUT;
+ else if (s && !strcmp(s, "melt")) mode = MELT;
+ else if (s && !strcmp(s, "stretch")) mode = STRETCH;
else {
if (s && *s && !!strcmp(s, "random"))
fprintf(stderr, "%s: unknown mode %s\n", progname, s);
- mode = random() % (OUT+1);
+ mode = random() % (STRETCH+1);
}
delay = get_integer_resource ("delay", "Integer");
gcv.function = GXcopy;
gcv.subwindow_mode = IncludeInferiors;
+
+ if (mode == MELT || mode == STRETCH) {
+ bg = get_pixel_resource ("background", "Background", dpy, xgwa.colormap);
+ gcv.foreground = bg;
+ }
+
gcflags = GCForeground |GCFunction;
if (use_subwindow_mode_p(xgwa.screen, window)) /* see grabscreen.c */
gcflags |= GCSubwindowMode;
sizey = xgwa.height;
grab_screen_image (xgwa.screen, window);
+
+ if (mode == MELT || mode == STRETCH) {
+ /* make sure screen eventually turns background color */
+ XDrawLine(dpy, window, gc, 0, 0, sizex, 0);
+
+ /* slow down for smoother melting*/
+ iterations = 1;
+ }
+
}
case DOWNRIGHT: bias = downright_bias; break;
case IN: bias = no_bias; break;
case OUT: bias = no_bias; break;
- default: abort();
+ case MELT: bias = no_bias; break;
+ case STRETCH: bias = no_bias; break;
+ default: abort();
}
#define nrnd(x) (random() % (x))
- left = nrnd(sizex - 1);
- top = nrnd(sizey);
- width = nrnd(sizex - left);
- height = nrnd(sizey - top);
-
- toleft = left;
- totop = top;
-
- if (mode == IN || mode == OUT) {
- int x = left+(width/2);
- int y = top+(height/2);
- int cx = sizex/2;
- int cy = sizey/2;
- if (mode == IN) {
- if (x > cx && y > cy) bias = upleft_bias;
- else if (x < cx && y > cy) bias = upright_bias;
- else if (x < cx && y < cy) bias = downright_bias;
- else /* (x > cx && y < cy)*/ bias = downleft_bias;
- } else {
- if (x > cx && y > cy) bias = downright_bias;
- else if (x < cx && y > cy) bias = downleft_bias;
- else if (x < cx && y < cy) bias = upleft_bias;
- else /* (x > cx && y < cy)*/ bias = upright_bias;
+ if (mode == MELT || mode == STRETCH) {
+ left = nrnd(sizex/2);
+ top = nrnd(sizey);
+ width = nrnd( sizex/2 ) + sizex/2 - left;
+ height = nrnd(sizey - top);
+ toleft = left;
+ totop = top+1;
+
+ } else {
+
+ left = nrnd(sizex - 1);
+ top = nrnd(sizey);
+ width = nrnd(sizex - left);
+ height = nrnd(sizey - top);
+
+ toleft = left;
+ totop = top;
+ if (mode == IN || mode == OUT) {
+ int x = left+(width/2);
+ int y = top+(height/2);
+ int cx = sizex/2;
+ int cy = sizey/2;
+ if (mode == IN) {
+ if (x > cx && y > cy) bias = upleft_bias;
+ else if (x < cx && y > cy) bias = upright_bias;
+ else if (x < cx && y < cy) bias = downright_bias;
+ else /* (x > cx && y < cy)*/ bias = downleft_bias;
+ } else {
+ if (x > cx && y > cy) bias = downright_bias;
+ else if (x < cx && y > cy) bias = downleft_bias;
+ else if (x < cx && y < cy) bias = upleft_bias;
+ else /* (x > cx && y < cy)*/ bias = upright_bias;
+ }
}
- }
-
- switch (bias[random() % (sizeof(no_bias)/sizeof(*no_bias))]) {
+
+ switch (bias[random() % (sizeof(no_bias)/sizeof(*no_bias))]) {
case L: toleft = left-1; break;
case R: toleft = left+1; break;
case U: totop = top-1; break;
case D: totop = top+1; break;
default: abort(); break;
+ }
+ }
+
+ if (mode == STRETCH) {
+ XCopyArea (dpy, window, window, gc, 0, sizey-top-2, sizex, top+1,
+ 0, sizey-top-1);
+ } else {
+ XCopyArea (dpy, window, window, gc, left, top, width, height,
+ toleft, totop);
}
- XCopyArea (dpy, window, window, gc, left, top, width, height,
- toleft, totop);
#undef nrnd
}
init_decay (dpy, window);
while (1) {
int i;
- for (i = 0; i < 100; i++)
+ for (i = 0; i < iterations; i++)
decay1 (dpy, window);
XSync(dpy, False);
screenhack_handle_events (dpy);
-.TH XScreenSaver 1 "24-Nov-97" "X Version 11"
+.TH XScreenSaver 1 "05-Apr-1999" "X Version 11"
.SH NAME
decayscreen - make a screen meltdown.
.SH SYNOPSIS
\fIrandom\fP (meaning pick one), \fIup\fP, \fIleft\fP, \fIright\fP,
\fIdown\fP, \fIupleft\fP, \fIdownleft\fP, \fIupright\fP, \fIdownright\fP,
\fIshuffle\fP (meaning perfer no particular direction), \fIin\fP (meaning
-move things toward the center), and \fIout\fP (meaing move things away
-from the center).
+move things toward the center), \fIout\fP (meaning move things away
+from the center), \fImelt\fP (meaning melt straight downward), and \fIstretch\fP
+(meaning stretch the screen downward).
.SH RESOURCES
On some systems (currently, only SGIs), this program can, instead of grabbing
a desktop image, grab a frame of video from an external camera and manipulate
implied warranty.
.SH AUTHOR
Vivek Khera <khera@cs.duke.edu>, 05-Aug-93; based on code by David Wald, 1988.
-Modified by jwz, 28-Nov-97.
+Modified by jwz, 28-Nov-97. Modified by Rick Schultz <rick@skapunx.net> 05-Apr-1999.
+
#include <math.h>
#include "screenhack.h"
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# include "xdbe.h"
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
#define countof(x) (sizeof(x)/sizeof(*(x)))
#define ABS(x) ((x)<0?-(x):(x))
"*speed: 15",
"*ncolors: 20",
"*doubleBuffer: True",
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ "*useDBE: True",
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
0
};
{ "-count", ".count", XrmoptionSepArg, 0 },
{ "-ncolors", ".ncolors", XrmoptionSepArg, 0 },
{ "-speed", ".speed", XrmoptionSepArg, 0 },
+ { "-db", ".doubleBuffer", XrmoptionNoArg, "True" },
+ { "-no-db", ".doubleBuffer", XrmoptionNoArg, "False" },
{ 0, 0, 0, 0 }
};
struct throbber **throbbers;
XWindowAttributes xgwa;
Pixmap b=0, ba=0, bb=0; /* double-buffer to reduce flicker */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ XdbeBackBuffer backb = 0;
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
XGetWindowAttributes (dpy, window, &xgwa);
- make_random_colormap (dpy, xgwa.visual, xgwa.colormap,
- colors, &ncolors, True, True, 0, True);
+
+ if (get_boolean_resource("mono", "Boolean"))
+ {
+ MONO:
+ ncolors = 1;
+ colors[0].pixel = get_pixel_resource("foreground", "Foreground",
+ dpy, xgwa.colormap);
+ }
+ else
+ {
+ make_random_colormap (dpy, xgwa.visual, xgwa.colormap,
+ colors, &ncolors, True, True, 0, True);
+ if (ncolors < 2)
+ goto MONO;
+ }
if (dbuf)
{
- ba = XCreatePixmap (dpy, window, xgwa.width, xgwa.height, xgwa.depth);
- bb = XCreatePixmap (dpy, window, xgwa.width, xgwa.height, xgwa.depth);
- b = ba;
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ b = backb = xdbe_get_backbuffer (dpy, window, XdbeUndefined);
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+ if (!b)
+ {
+ ba = XCreatePixmap (dpy, window, xgwa.width, xgwa.height,xgwa.depth);
+ bb = XCreatePixmap (dpy, window, xgwa.width, xgwa.height,xgwa.depth);
+ b = ba;
+ }
}
else
{
throbbers[i] = make_throbber (dpy, b, xgwa.width, xgwa.height,
colors[random() % ncolors].pixel);
- if (dbuf)
- {
- gcv.foreground = get_pixel_resource ("background", "Background",
- dpy, xgwa.colormap);
- erase_gc = XCreateGC (dpy, b, GCForeground, &gcv);
- XFillRectangle (dpy, ba, erase_gc, 0, 0, xgwa.width, xgwa.height);
- XFillRectangle (dpy, bb, erase_gc, 0, 0, xgwa.width, xgwa.height);
- }
+ gcv.foreground = get_pixel_resource ("background", "Background",
+ dpy, xgwa.colormap);
+ erase_gc = XCreateGC (dpy, b, GCForeground, &gcv);
+
+ if (ba) XFillRectangle (dpy, ba, erase_gc, 0, 0, xgwa.width, xgwa.height);
+ if (bb) XFillRectangle (dpy, bb, erase_gc, 0, 0, xgwa.width, xgwa.height);
while (1)
{
- if (dbuf)
- XFillRectangle (dpy, b, erase_gc, 0, 0, xgwa.width, xgwa.height);
- else
- XClearWindow (dpy, b);
+ XFillRectangle (dpy, b, erase_gc, 0, 0, xgwa.width, xgwa.height);
for (i = 0; i < count; i++)
if (throb (dpy, b, throbbers[i]) < 0)
throbbers[i] = make_throbber (dpy, b, xgwa.width, xgwa.height,
colors[random() % ncolors].pixel);
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ if (backb)
+ {
+ XdbeSwapInfo info[1];
+ info[0].swap_window = window;
+ info[0].swap_action = XdbeUndefined;
+ XdbeSwapBuffers (dpy, info, 1);
+ }
+ else
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
if (dbuf)
{
XCopyArea (dpy, b, window, erase_gc, 0, 0,
}
-#ifdef __hpux
+#if defined(__hpux) && defined(PLOSS)
/* I don't understand why this is necessary, but I'm told that this program
does nothing at all on HP-sUX without it.
+
+ I'm further told that HPUX 11.0 doesn't define PLOSS, and works ok without
+ this section. Go figure.
*/
#undef random
#undef srandom
/* I thought it would be faster this way, but it turns out not to be... -jwz */
#undef USE_XIMAGE
-#undef HAVE_XSHM_EXTENSION
-#undef HAVE_XDBE
+
+#ifndef USE_XIMAGE
+# undef HAVE_XSHM_EXTENSION /* only applicable when using XImages */
+#endif /* USE_XIMAGE */
-#ifdef HAVE_XDBE
-# include <X11/extensions/Xdbe.h>
-#endif /* HAVE_XDBE */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# include "xdbe.h"
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
#ifdef HAVE_XSHM_EXTENSION
# include "xshm.h"
"*gray: false", /* color or grayscale */
"*mono: false", /* monochrome, not very much fun */
-#ifdef HAVE_XDBE
+ "*doubleBuffer: True",
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
"*useDBE: True", /* use double buffering extension */
-#endif /* HAVE_XDBE */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
#ifdef HAVE_XSHM_EXTENSION
"*useSHM: True", /* use shared memory extension */
{ "-radius", ".radius", XrmoptionSepArg, 0 },
{ "-gray", ".gray", XrmoptionNoArg, "True" },
{ "-mono", ".mono", XrmoptionNoArg, "True" },
-#ifdef HAVE_XDBE
- { "-db", ".useDBE", XrmoptionNoArg, "True" },
- { "-no-db", ".useDBE", XrmoptionNoArg, "False" },
-#endif /* HAVE_XDBE */
+ { "-db", ".doubleBuffer", XrmoptionNoArg, "True" },
+ { "-no-db", ".doubleBuffer", XrmoptionNoArg, "False" },
#ifdef HAVE_XSHM_EXTENSION
{ "-shm", ".useSHM", XrmoptionNoArg, "True" },
{ "-no-shm", ".useSHM", XrmoptionNoArg, "False" },
Display* dpy;
Window win;
- Pixmap dbuf;
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ XdbeBackBuffer back_buf;
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ Pixmap pix_buf;
+
GC copy_gc;
#ifdef USE_XIMAGE
XImage *ximage;
#endif /* USE_XIMAGE */
-#ifdef HAVE_XDBE
- Status has_dbe;
-#endif /* HAVE_XDBE */
-
#ifdef HAVE_XSHM_EXTENSION
Bool use_shm;
XShmSegmentInfo shm_info;
int h;
Colormap cmap;
XColor* pal;
-#ifdef HAVE_XDBE
- XdbeBackBuffer buf;
-#endif /* HAVE_XDBE */
GC* gcs;
/*
struct inter_source* source;
};
-#ifdef HAVE_XDBE
-# define TARGET(c) ((c)->has_dbe ? (c)->buf : (c)->dbuf)
-#else /* HAVE_XDBE */
-# define TARGET(c) ((c)->dbuf)
-#endif /* !HAVE_XDBE */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# define TARGET(c) ((c)->back_buf ? (c)->back_buf : \
+ (c)->pix_buf ? (c)->pix_buf : (c)->win)
+#else /* HAVE_DOUBLE_BUFFER_EXTENSION */
+# define TARGET(c) ((c)->pix_buf ? (c)->pix_buf : (c)->win)
+#endif /* !HAVE_DOUBLE_BUFFER_EXTENSION */
void inter_init(Display* dpy, Window win, struct inter_context* c)
{
int i;
int mono;
int gray;
-#ifdef HAVE_XDBE
- int major, minor;
- int use_dbe;
-#endif /* HAVE_XDBE */
-
XGCValues val;
unsigned long valmask = 0;
+ Bool dbuf = get_boolean_resource ("doubleBuffer", "Boolean");
+
+ memset (c, 0, sizeof(*c));
c->dpy = dpy;
c->win = win;
c->h = xgwa.height;
c->cmap = xgwa.colormap;
-#ifdef HAVE_XDBE
- use_dbe = get_boolean_resource("useDBE", "Boolean");
- if(!use_dbe) {
- c->has_dbe = False;
- } else {
- c->has_dbe = XdbeQueryExtension(dpy, &major, &minor);
- }
-#endif /* HAVE_XDBE */
-
#ifdef HAVE_XSHM_EXTENSION
c->use_shm = get_boolean_resource("useSHM", "Boolean");
#endif /* HAVE_XSHM_EXTENSION */
-#ifdef HAVE_XDBE
- if (!c->has_dbe)
-#endif /* HAVE_XDBE */
+ if (dbuf)
{
- c->dbuf = XCreatePixmap(dpy, win, xgwa.width, xgwa.height, xgwa.depth);
- val.function = GXcopy;
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ c->back_buf = xdbe_get_backbuffer (c->dpy, c->win, XdbeUndefined);
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ if (!c->back_buf)
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ c->pix_buf = XCreatePixmap (dpy, win, xgwa.width, xgwa.height,
+ xgwa.depth);
}
- c->copy_gc = XCreateGC(c->dpy, c->dbuf, GCFunction, &val);
+ val.function = GXcopy;
+ c->copy_gc = XCreateGC(c->dpy, TARGET(c), GCFunction, &val);
c->count = get_integer_resource("count", "Integer");
if(c->count < 1)
gray = get_boolean_resource("gray", "Boolean");
if(!gray) {
- H[0] = drand48()*360.0;
+ H[0] = frand(360.0);
H[1] = H[0] + c->shift < 360.0 ? H[0]+c->shift : H[0] + c->shift-360.0;
H[2] = H[1] + c->shift < 360.0 ? H[1]+c->shift : H[1] + c->shift-360.0;
S[0] = S[1] = S[2] = 1.0;
c->pal[1].pixel = WhitePixel(c->dpy, DefaultScreen(c->dpy));
}
-#ifdef HAVE_XDBE
- if(c->has_dbe)
- c->buf = XdbeAllocateBackBufferName(c->dpy, c->win, XdbeUndefined);
-#endif /* HAVE_XDBE */
-
valmask = GCForeground;
c->gcs = calloc(c->colors, sizeof(GC));
for(i = 0; i < c->colors; i++) {
c->source = calloc(c->count, sizeof(struct inter_source));
for(i = 0; i < c->count; i++) {
- c->source[i].x_theta = drand48()*2.0*3.14159;
- c->source[i].y_theta = drand48()*2.0*3.14159;
+ c->source[i].x_theta = frand(2.0)*3.14159;
+ c->source[i].y_theta = frand(2.0)*3.14159;
}
}
int i, j, k;
int result;
int dist;
-#ifdef HAVE_XDBE
- XdbeSwapInfo info[1];
-#endif /* HAVE_XDBE */
int g;
int dx, dy;
#endif /* USE_XIMAGE */
}
-#ifdef HAVE_XDBE
- if(c->has_dbe)
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ if (c->back_buf)
{
+ XdbeSwapInfo info[1];
info[0].swap_window = c->win;
info[0].swap_action = XdbeUndefined;
XdbeSwapBuffers(c->dpy, info, 1);
}
else
-#endif /* HAVE_XDBE */
- {
- XCopyArea (c->dpy, c->dbuf, c->win, c->copy_gc,
- 0, 0, c->w, c->h, 0, 0);
- }
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ if (c->pix_buf)
+ {
+ XCopyArea (c->dpy, c->pix_buf, c->win, c->copy_gc,
+ 0, 0, c->w, c->h, 0, 0);
+ }
+
XSync(c->dpy, False);
}
#include <math.h>
#include "screenhack.h"
-#ifdef HAVE_XDBE_EXTENSION
-# include <X11/extensions/Xdbe.h>
-#endif /* HAVE_XDBE_EXTENSION */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# include "xdbe.h"
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
char *progclass="Kumppa";
".background: black",
"*speed: 0.1",
"*delay: 0",
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ /* leave this off by default, since it slows things down. -- jwz. */
+ "*useDBE: False",
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
0
};
{"-delay",".delay",XrmoptionSepArg,0},
{"-speed",".speed",XrmoptionSepArg,0},
{"-random",".random",XrmoptionIsArg,0},
-#ifdef HAVE_XDBE_EXTENSION
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
{"-dbuf",".dbuf",XrmoptionIsArg,0},
-#endif /* HAVE_XDBE_EXTENSION */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
{0,0,0,0}
};
static int midx,midy;
static unsigned long delay;
static Bool cosilines=True;
-#ifdef HAVE_XDBE_EXTENSION
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
static Bool usedouble=False;
-#endif /* HAVE_XDBE_EXTENSION */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
static int *Xrotations;
static int *Yrotations;
}
-#ifdef HAVE_XDBE_EXTENSION
-static XErrorHandler old_handler = 0;
-static Bool got_BadMatch = False;
-static int
-BadMatch_ehandler (Display *dpy, XErrorEvent *error)
-{
- if (error->error_code == BadMatch) {
- got_BadMatch = True;
- return 0;
- } else if (old_handler)
- return old_handler(dpy, error);
- else
- exit(1);
-}
-#endif /* HAVE_XDBE_EXTENSION */
-
-
Bool InitializeAll(void)
{
XGCValues xgcv;
if (get_string_resource("random","String")!=NULL && get_string_resource("random","String")[0]!=0) cosilines=False;
-#ifdef HAVE_XDBE_EXTENSION
-if (get_string_resource("dbuf","String")!=NULL && get_string_resource("dbuf","String")[0]!=0) usedouble=True;
-if (usedouble)
- {
- XdbeQueryExtension(dpy,&n,&i);
- if (n==0 && i==0)
- {
- fprintf(stderr,"Double buffer extension not supported!\n");
- usedouble=False;
- }
- }
-if (usedouble)
- {
- /* We need to trap an X error when calling XdbeAllocateBackBufferName,
- because there is no way to know beforehand whether the call will
- succeed! This is a totally fucked design, but the man page says:
-
- ERRORS
- BadMatch
- The specified window is not an InputOutput window or
- its visual does not support DBE.
-
- With SGI's O2 X server, some visuals support double-buffering (the
- 12-bit pseudocolor visuals) and others yield a BadMatch error, as
- documented.
-
- However, it doesn't matter, because using the DBUF extension seems
- to make it run *slower* instead of faster anyway.
-
- -- jwz, 1-Jul-98
- */
- XSync(dpy, False);
- old_handler = XSetErrorHandler (BadMatch_ehandler);
- got_BadMatch = False;
- win[1] = 0;
- win[1] = XdbeAllocateBackBufferName(dpy,win[0],XdbeUndefined);
- XSync(dpy, False);
- XSetErrorHandler (old_handler);
- old_handler = 0;
- XSync(dpy, False);
- if (got_BadMatch || !win[1])
- {
- fprintf(stderr, "%s: visual 0x%x does not support double-buffering.\n",
- progname, XVisualIDFromVisual(xgwa.visual));
- usedouble = False;
- win[1] = win[0];
- got_BadMatch = False;
- }
- }
-#endif /* HAVE_XDBE_EXTENSION */
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ usedouble = True;
+ win[1] = xdbe_get_backbuffer (dpy, win[0], XdbeUndefined);
+ if (!win[1])
+ {
+ usedouble = False;
+ win[1] = win[0];
+ }
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
delay=get_integer_resource("delay","Integer");
rspeed=get_float_resource("speed","Float");
void screenhack(Display *d, Window w)
{
-#ifdef HAVE_XDBE_EXTENSION
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
XdbeSwapInfo xdswp;
-#endif /* HAVE_XDBE_EXTENSION */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
int a,b,c=0,e;
float f;
win[0]=w;
if (!InitializeAll()) return;
-#ifdef HAVE_XDBE_EXTENSION
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
if (usedouble)
{
xdswp.swap_action=XdbeUndefined;
xdswp.swap_window=win[0];
}
else
-#endif /* HAVE_XDBE_EXTENSION */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
win[1]=win[0];
while (0==0)
}
XFillRectangle(dpy,win[0],fgc[32],midx-2,midy-2,4,4);
rotate();
-#ifdef HAVE_XDBE_EXTENSION
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
if (usedouble) XdbeSwapBuffers(dpy,&xdswp,1);
-#endif /* HAVE_XDBE_EXTENSION */
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
XSync(dpy, False);
screenhack_handle_events (dpy);
if (delay) usleep (delay);
#include "screenhack.h"
#include <X11/Xutil.h>
-#include <stdio.h>
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+# include "xdbe.h"
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
static int ncolors;
static XColor *colors = 0;
static int dx1, dx2, dx3, dy1, dy2, dy3;
static int othickness, thickness;
static Bool do_three;
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+XdbeBackBuffer back_buf = 0;
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
static void
init_moire2 (Display *dpy, Window window)
xgwa.colormap);
fg_pixel = get_pixel_resource("foreground", "Foreground", dpy,
xgwa.colormap);
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ back_buf = xdbe_get_backbuffer (dpy, window, XdbeUndefined);
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
}
if (do_three)
XCopyArea(dpy, p3, p0, copy_gc, x3, y3, width, height, 0, 0);
- XSync(dpy, False);
- XCopyPlane(dpy, p0, window, window_gc, 0, 0, width, height, 0, 0, 1L);
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ if (back_buf)
+ {
+ XdbeSwapInfo info[1];
+ info[0].swap_window = window;
+ info[0].swap_action = XdbeUndefined;
+ XCopyPlane (dpy, p0, back_buf, window_gc, 0, 0, width, height, 0, 0, 1L);
+ XdbeSwapBuffers (dpy, info, 1);
+ }
+ else
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+ XCopyPlane (dpy, p0, window, window_gc, 0, 0, width, height, 0, 0, 1L);
+
XSync(dpy, False);
#if 0
"*thickness: 0",
"*colors: 150",
"*colorShift: 5",
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+ /* Off by default, since it slows it down a lot, and the flicker isn't really
+ all that bad without it... Or rather, it flickers just as badly with it.
+ The XFree86 implementation of the XDBE extension totally blows! There is
+ just *no* excuse for the "swap buffers" operation to flicker like it does.
+ */
+ "*useDBE: False",
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
0
};
width = XTextWidth(font, buf, strlen(buf));
XDrawString(dpy, window, level_gc, xlim / 2 - width / 2, ylim / 2 - font_height(font) / 2,
buf, strlen(buf));
- XSync(dpy, True);
+ XSync(dpy, False);
+ screenhack_handle_events(dpy);
sleep(1);
}
city[i].alive = 1;
AddScore(dpy, window, cmap, xlim, ylim, 100 * level);
DrawCities(dpy, window, cmap, xlim, ylim);
- XSync(dpy, True);
+ XSync(dpy, False);
+ screenhack_handle_events(dpy);
usleep(kCityPause);
}
}
}
else {
/* we're dead */
+ screenhack_handle_events(dpy);
sleep(3);
+ screenhack_handle_events(dpy);
/* start new */
gamez++;
Improve();
width = XTextWidth(font, buf, strlen(buf));
XDrawString(dpy, window, level_gc, xlim / 2 - width / 2, ylim / 4, buf, strlen(buf));
DrawCities(dpy, window, cmap, xlim, ylim);
- XSync(dpy, True);
+ XSync(dpy, False);
+ screenhack_handle_events(dpy);
sleep(1);
}
sprintf(buf, "Bonus Round");
width = XTextWidth(font, buf, strlen(buf));
XDrawString(dpy, window, level_gc, xlim / 2 - width / 2, ylim / 2 - font_height(font) / 2, buf, strlen(buf));
- XSync(dpy, True);
+ XSync(dpy, False);
+ screenhack_handle_events(dpy);
sleep(1);
XFillRectangle(dpy, window, erase_gc,
0, 0, xlim, ylim - 100);
if (laser[i].alive)
goto END_CHECK;
/* okay, nothing's alive, start end of level countdown */
+ screenhack_handle_events(dpy);
sleep(kLevelPause);
NewLevel(dpy, window, cmap, xlim, ylim);
return;
lastLaser = loop;
}
- XSync(dpy, True);
+ XSync(dpy, False);
+ screenhack_handle_events(dpy);
if (kSleepTime)
usleep(kSleepTime);
depth 24 directly (or even better, arbitrary depths, but that
would mean going through the XImage routines instead of messing
with the XImage->data directly.)
+
+ jwz, 18-Mar-99: well, the X servers I have access to these days do
+ support 32-deep images on deep visuals, so I no longer have the
+ ability to test this code -- but it was causing problems on the
+ visuals that I do have, and I think that's because I mistakenly
+ wrote `pfv[i].depth' when I meant to write `pfv[i].bits_per_pixel'.
+ The symptom I was seeing was that the grid was 64x64, but the
+ images were being drawn 32x32 -- so there was a black stripe on
+ every other row. Wow, this code sucks so much.
*/
if (pdepth == 32)
{
Bool ok = False;
XPixmapFormatValues *pfv = XListPixmapFormats (dpy, &pfvc);
for (i = 0; i < pfvc; i++)
- if (pfv[i].depth == pdepth)
+ if (pfv[i].bits_per_pixel == pdepth)
ok = True;
if (!ok)
pdepth = 16;
#include <X11/Shell.h>
#include <X11/StringDefs.h>
#include <X11/Xutil.h>
+#include <X11/keysym.h>
#ifdef __sgi
# include <X11/SGIScheme.h> /* for SgiUseSchemes() */
c == 3 || /* ^C */
c == 27) /* ESC */
exit (0);
+ else if (! (keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
+ XBell (dpy, 0); /* beep for non-chord keys */
}
+ break;
case ButtonPress:
XBell (dpy, 0);
break;
--- /dev/null
+/*
+ * spotlight - an xscreensaver module
+ * Copyright (c) 1999 Rick Schultz <rick@skapunx.net>
+ *
+ * loosely based on the BackSpace module "StefView" by Darcy Brockbank
+ */
+
+/* modified from a module from the xscreensaver distribution */
+
+/*
+ * xscreensaver, Copyright (c) 1992, 1993, 1994, 1996, 1997, 1998
+ * Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * 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.
+ */
+
+/* #define DEBUG */
+#include <math.h>
+#include "screenhack.h"
+#include <X11/Xutil.h>
+#include <sys/time.h>
+
+#define MINX 0.0
+#define MINY 0.0
+#define X_PERIOD 15000.0
+#define Y_PERIOD 12000.0
+
+static int sizex, sizey; /* screen size */
+static int delay; /* in case it's too fast... */
+static GC gc;
+#ifdef DEBUG
+static GC white_gc;
+#endif
+static GC buffer_gc; /* draw in buffer, then flush to screen
+ to avoid flicker */
+static int radius; /* radius of spotlight in pixels */
+static XGCValues gcv;
+
+static Pixmap pm; /* pixmap grabbed from screen */
+static Pixmap clip_pm; /* pixmap for clipping (spotlight shape) */
+static Pixmap buffer; /* pixmap for the buffer */
+
+static GC clip_gc; /* GC for the clip pixmap */
+
+int x, y, s; /* x & y coords of buffer (upper left corner) */
+ /* s is the width of the buffer */
+
+int oldx, oldy, max_x_speed, max_y_speed;
+ /* used to keep the new buffer position
+ over the old spotlight image to make sure
+ the old image is completely erased */
+
+/* The path the spotlight follows around the screen is sinusoidal.
+ This function is fed to sin() to get the x & y coords */
+static long
+currentTimeInMs(void)
+{
+ struct timeval curTime;
+#ifdef GETTIMEOFDAY_TWO_ARGS
+ struct timezone tz = {0,0};
+ gettimeofday(&curTime, &tz);
+#else
+ gettimeofday(&curTime);
+#endif
+ return curTime.tv_sec*1000 + curTime.tv_usec/1000.0;
+}
+
+
+static void
+init_hack (Display *dpy, Window window)
+{
+ XWindowAttributes xgwa;
+ long gcflags;
+ Colormap cmap;
+ unsigned long fg, bg;
+
+ XGetWindowAttributes (dpy, window, &xgwa);
+ sizex = xgwa.width;
+ sizey = xgwa.height;
+ cmap = xgwa.colormap;
+ fg = get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+ bg = get_pixel_resource ("background", "Background", dpy, cmap);
+
+ /* read parameters, keep em sane */
+ delay = get_integer_resource ("delay", "Integer");
+ if (delay < 1) delay = 1;
+ radius = get_integer_resource ("radius", "Integer");
+ if (radius < 0) radius = 125;
+
+ /* do the dance */
+ gcv.function = GXcopy;
+ gcv.subwindow_mode = IncludeInferiors;
+ gcflags = GCForeground | GCFunction;
+ gcv.foreground = bg;
+ gcv.background = fg;
+
+#ifdef NOPE
+ if (use_subwindow_mode_p(xgwa.screen, window)) /* see grabscreen.c */
+ gcflags |= GCSubwindowMode;
+#endif
+ gc = XCreateGC (dpy, window, gcflags, &gcv);
+
+
+ /* grab screen to window */
+ grab_screen_image (xgwa.screen, window);
+
+ /* save screen to pixmap for copying later */
+ pm = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
+ XCopyArea(dpy, window, pm, gc, 0, 0, sizex, sizey, 0, 0);
+
+
+ /* create buffer to reduce flicker */
+ buffer = XCreatePixmap(dpy, window, sizex, sizey, xgwa.depth);
+ buffer_gc = XCreateGC (dpy, buffer, gcflags, &gcv);
+
+ /* blank out screen */
+ XFillRectangle(dpy,window,gc,0,0,sizex,sizey);
+
+ /* create clip mask (so it's a circle, not a square) */
+ clip_pm = XCreatePixmap(dpy, window, radius*4, radius*4, 1);
+ gcv.foreground=bg;
+ gcv.background=bg;
+ clip_gc = XCreateGC(dpy, clip_pm, gcflags, &gcv);
+ XFillRectangle(dpy,clip_pm,clip_gc,0,0,radius*4, radius*4);
+ XSetForeground(dpy,clip_gc,fg);
+ XFillArc(dpy, clip_pm, clip_gc, radius , radius,
+ radius*2, radius*2, 0, 360*64);
+ /* set buffer's clip mask to the one we just made */
+ XSetClipMask(dpy, buffer_gc, clip_pm);
+ /* free everything */
+ XFreeGC(dpy, clip_gc);
+ XFreePixmap(dpy, clip_pm);
+
+ /* avoid remants */
+ max_x_speed = max_y_speed = radius;
+
+#ifdef DEBUG
+ /* create GC with white fg */
+ gcv.foreground = fg;
+ white_gc = XCreateGC (dpy, window, gcflags, &gcv);
+#endif
+
+ /* initialize x and y to avoid initial `jump' across screen */
+ x = ((1 + sin(((float)currentTimeInMs()) / X_PERIOD * 2. * M_PI))/2.0)
+ * (sizex - s/2) -s/4 + MINX;
+ y = ((1 + sin(((float)currentTimeInMs()) / Y_PERIOD * 2. * M_PI))/2.0)
+ * (sizey - s/2) -s/4 + MINY;
+
+}
+
+
+/*
+ * perform one iteration
+ */
+static void
+onestep (Display *dpy, Window window)
+{
+ long now;
+
+ /* clear buffer */
+ XFillRectangle(dpy, buffer, buffer_gc, x, y, s, s);
+
+
+#define nrnd(x) (random() % (x))
+
+ oldx = x;
+ oldy = y;
+
+ s = radius *4 ; /* s = width of buffer */
+
+ now = currentTimeInMs();
+
+ /* find new x,y */
+ x = ((1 + sin(((float)now) / X_PERIOD * 2. * M_PI))/2.0)
+ * (sizex - s/2) -s/4 + MINX;
+ y = ((1 + sin(((float)now) / Y_PERIOD * 2. * M_PI))/2.0)
+ * (sizey - s/2) -s/4 + MINY;
+
+ /* limit change in x and y to buffer width */
+ if ( x < (oldx - max_x_speed) ) x = oldx - max_x_speed;
+ if ( x > (oldx + max_x_speed) ) x = oldx + max_x_speed;
+ if ( y < (oldy - max_y_speed) ) y = oldy - max_y_speed;
+ if ( y > (oldy + max_y_speed) ) y = oldy + max_y_speed;
+
+ /* copy area of screen image (pm) to buffer
+ Clip to a circle */
+ XSetClipOrigin(dpy, buffer_gc, x,y);
+ XCopyArea(dpy, pm, buffer, buffer_gc, x, y, s, s, x, y);
+ /* copy buffer to screen (window) */
+ XCopyArea(dpy, buffer, window, gc, x , y, s, s, x, y);
+
+#ifdef DEBUG
+ /* draw a box around the buffer */
+ XDrawLine(dpy, window, white_gc, x, y, x+s, y);
+ XDrawLine(dpy, window, white_gc, x, y, x, y+s);
+ XDrawLine(dpy, window, white_gc, x+s, y, x+s, y+s);
+ XDrawLine(dpy, window, white_gc, x, y+s, x+s, y+s);
+#endif
+
+}
+
+\f
+char *progclass = "Spotlight";
+
+char *defaults [] = {
+ "*dontClearRoot: True",
+
+#ifdef __sgi /* really, HAVE_READ_DISPLAY_EXTENSION */
+ "*visualID: Best",
+#endif
+
+ "*delay: 10000",
+ "*radius: 125",
+ 0
+};
+
+XrmOptionDescRec options [] = {
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-radius", ".radius", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
+};
+
+void
+screenhack (Display *dpy, Window window)
+{
+ init_hack (dpy, window);
+ while (1) {
+ onestep(dpy, window);
+ XSync(dpy, False);
+ if (delay) usleep (delay);
+ screenhack_handle_events (dpy);
+ }
+}
+
--- /dev/null
+.TH XScreenSaver 1 "05-Apr-1999" "X Version 11"
+.SH NAME
+spotlight - move spotlight around desktop
+.SH SYNOPSIS
+.B spotlight
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-delay \fIusecs\fP] [\-radius \fIpixels\fP]
+.SH DESCRIPTION
+The \fIspotlight\fP program draws random rectangles.
+.SH OPTIONS
+.I spotlight
+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 \-mono
+If on a color display, pretend we're on a monochrome display.
+.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 \-delay \fImicroseconds\fP
+Slow it down.
+.TP 8
+.B \-radius \fIpixels\fP
+Radius of the spotlight in pixels.
+.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)
+.SH COPYRIGHT
+Copyright \(co 1999 by Rick Schultz. 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.
+.SH CREDITS
+Hacked together by Rick Schultz <rick@skapunx.net>, based on StefView for
+BackSpace by Darcy Brockbank and on several other xscreensaver hacks.
+
--- /dev/null
+/* squiral, by "Jeff Epler" <jepler@inetnebr.com>, 18-mar-1999.
+ *
+ * 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"
+#include "erase.h"
+#include "yarandom.h"
+
+#define R(x) (abs(random())%x)
+#define PROB(x) (abs(random())<(x*(double)RAND_MAX))
+
+#define NCOLORSMAX 255
+static int width, height, count, cycle;
+static double frac, disorder, handedness;
+static int ncolors=0;
+static GC draw_gc, erase_gc;
+static XColor colors[NCOLORSMAX];
+#define STATES 8
+
+/* 0- 3 left-winding */
+/* 4- 7 right-winding */
+
+#define CLEAR1(x,y) (!fill[((y)%height)*width+(x)%width])
+#define MOVE1(x,y) (fill[((y)%height)*width+(x)%width]=1, XDrawPoint(dpy, window, draw_gc, (x)%width,(y)%height), cov++)
+
+static int cov;
+static int dirh[4];
+static int dirv[4];
+
+static int *fill;
+
+#define CLEARDXY(x,y,dx,dy) CLEAR1(x+dx, y+dy) && CLEAR1(x+dx+dx, y+dy+dy)
+#define MOVEDXY(x,y,dx,dy) MOVE1 (x+dx, y+dy), MOVE1 (x+dx+dx, y+dy+dy)
+
+#define CLEAR(d) CLEARDXY(w->h,w->v, dirh[d],dirv[d])
+#define MOVE(d) (XSetForeground(dpy, draw_gc, colors[w->c].pixel), \
+ MOVEDXY(w->h,w->v, dirh[d],dirv[d]), \
+ w->h=w->h+dirh[d]*2, \
+ w->v=w->v+dirv[d]*2, dir=d)
+
+#define RANDOM (void) (w->h = R(width), w->v = R(height), w->c = R(ncolors), \
+ type=R(2), dir=R(4), (cycle && (w->cc=R(3)+ncolors)))
+
+struct worm {
+ int h;
+ int v;
+ int s;
+ int c;
+ int cc;
+} *worms;
+
+#define SUCC(x) ((x+1)%4)
+#define PRED(x) ((x+3)%4)
+#define CCW PRED(dir)
+#define CW SUCC(dir)
+#define REV ((dir+2)%4)
+#define STR (dir)
+#define TRY(x) if (CLEAR(x)) { MOVE(x); break; }
+
+static void
+do_worm(Display *dpy, Window window, struct worm *w)
+{
+ int type = w->s / 4;
+ int dir = w->s % 4;
+
+ w->c = (w->c+w->cc) % ncolors;
+
+ if (PROB(disorder)) type=PROB(handedness);
+ switch(type) {
+ case 0: /* CCW */
+ TRY(CCW)
+ TRY(STR)
+ TRY(CW)
+ RANDOM;
+ break;
+ case 1: /* CW */
+ TRY(CW)
+ TRY(STR)
+ TRY(CCW)
+ RANDOM;
+ break;
+ }
+ w->s = type*4+dir;
+ w->h = w->h % width;
+ w->v = w->v % height;
+}
+
+static void
+init_squiral(Display *dpy, Window window)
+{
+ XGCValues gcv;
+ Colormap cmap;
+ XWindowAttributes xgwa;
+ Bool writeable = False;
+ int i;
+
+ XClearWindow(dpy, window);
+ XGetWindowAttributes(dpy, window, &xgwa);
+ width = xgwa.width;
+ height = xgwa.height;
+
+ cmap = xgwa.colormap;
+ gcv.foreground = get_pixel_resource("foreground",
+ "Foreground", dpy, cmap);
+ draw_gc = XCreateGC(dpy, window, GCForeground, &gcv);
+ gcv.foreground = get_pixel_resource ("background", "Background",dpy, cmap);
+ erase_gc = XCreateGC (dpy, window, GCForeground, &gcv);
+ cmap = xgwa.colormap;
+ if( ncolors ) {
+ free_colors(dpy, cmap, colors, ncolors);
+ ncolors = 0;
+ }
+ if( mono_p ) {
+ ncolors=1;
+ colors[0].pixel=get_pixel_resource("foreground","Foreground", dpy, cmap);
+ } else {
+ ncolors = get_integer_resource("ncolors", "Integer");
+ if (ncolors < 0 || ncolors > NCOLORSMAX)
+ ncolors = NCOLORSMAX;
+ make_uniform_colormap(dpy, xgwa.visual, cmap, colors, &ncolors, True,
+ &writeable, False);
+ if (ncolors <= 0) {
+ ncolors = 1;
+ colors[0].pixel=get_pixel_resource("foreground","Foreground",dpy, cmap);
+ }
+ }
+ count= get_integer_resource("count", "Integer");
+ frac = get_integer_resource("fill", "Integer")*0.01;
+ cycle= get_boolean_resource("cycle", "Cycle");
+ disorder=get_float_resource("disorder", "Float");
+ handedness=get_float_resource("handedness", "Float");
+
+ if(frac<0.01) frac=0.01;
+ if(frac>0.99) frac=0.99;
+ if(count==0) count=width/32;
+ if(count<1) count=1;
+ if(count>1000) count=1000;
+
+ if(worms) free(worms);
+ if(fill) free(fill);
+
+ worms=calloc(count, sizeof(struct worm));
+ fill=calloc(width*height, sizeof(int));
+
+ dirh[0]=0; dirh[1]=1; dirh[2]=0; dirh[3]=width-1;
+ dirv[0]=height-1; dirv[1]=0; dirv[2]=1; dirv[3]=0;
+ for(i=0;i<count;i++) {
+ worms[i].h=R(width);
+ worms[i].v=R(height);
+ worms[i].s=R(4)+4*PROB(handedness);
+ worms[i].c=R(ncolors);
+ if(cycle) { worms[i].cc=R(3)+ncolors; }
+ else worms[i].cc=0;
+ }
+}
+
+void
+screenhack(Display *dpy, Window window)
+{
+ int inclear, i;
+ int delay= get_integer_resource("delay", "Integer");
+ init_squiral(dpy, window);
+ cov=0; inclear=height;
+ while(1) {
+ if(inclear<height) {
+ XDrawLine(dpy, window, erase_gc, 0, inclear, width-1, inclear);
+ memset(&fill[inclear*width], 0, sizeof(int)*width);
+ XDrawLine(dpy, window, erase_gc, 0, height-inclear-1, width-1,
+ height-inclear-1);
+ memset(&fill[(height-inclear-1)*width], 0, sizeof(int)*width);
+ inclear++;
+ XDrawLine(dpy, window, erase_gc, 0, inclear, width-1, inclear);
+ memset(&fill[inclear*width], 0, sizeof(int)*width);
+ XDrawLine(dpy, window, erase_gc, 0, height-inclear-1, width-1,
+ height-inclear-1);
+ memset(&fill[(height-inclear-1)*width], 0, sizeof(int)*width);
+ inclear++;
+ if(inclear>height/2) inclear=height;
+ }
+ else if(cov>(frac*width*height)) {
+ inclear=0;
+ cov=0;
+ }
+ for(i=0;i<count;i++) do_worm(dpy, window, &worms[i]);
+ screenhack_handle_events(dpy);
+ usleep(delay);
+ }
+}
+
+char *progclass="Squiral";
+
+char *defaults[] = {
+ ".background: black",
+ ".foreground: white",
+ "*fill: 75",
+ "*count: 0",
+ "*ncolors: 100",
+ "*delay: 1000",
+ "*disorder: 0.005",
+ "*cycle: False",
+ "*handedness: .5",
+ 0
+};
+
+XrmOptionDescRec options[] = {
+ {"-fill", ".fill", XrmoptionSepArg, 0},
+ {"-count", ".count", XrmoptionSepArg, 0},
+ {"-delay", ".delay", XrmoptionSepArg, 0},
+ {"-disorder", ".disorder", XrmoptionSepArg, 0},
+ {"-handedness", ".handedness", XrmoptionSepArg, 0},
+ {"-ncolors", ".ncolors", XrmoptionSepArg, 0},
+ {"-cycle", ".cycle", XrmoptionNoArg, "True"},
+ {"-no-cycle", ".cycle", XrmoptionNoArg, "False"},
+};
--- /dev/null
+.TH XScreenSaver 1 "18-mar-1999" "X Version 11"
+.SH NAME
+squiral - square spirals screensaver
+.SH SYNOPSIS
+.B squiral
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP]
+[\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install]
+[\-noinstall] [\-visual \fIvisual\fP] [\-fill \fIpercent\fP] [-count
+\fInumber\fP] [-delay \fIusec\fP] [-disorder \fIfraction\fP] [-handedness
+\fIfraction\fP] [-cycle]
+.SH DESCRIPTION
+The \fIsquiral\fP program displays interacting, spiral-producing automata
+
+.SH OPTIONS
+.I squiral
+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 \-mono
+If on a color display, pretend we're on a monochrome display.
+.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 \-fill \fIpercent\fP
+Specify the percent (0-100) of the screen which must be filled before
+the screen is cleared. 60-80 percent are good values.
+.TP 8
+.B \-count \fInumber\fP
+The number of squiralies. By default, the screen width divided by 32.
+.TP 8
+.B \-delay \fIusec\fP
+The wait between steps. The default is 1000.
+.TP 8
+.B \-disorder \fIfraction\fP
+The fraction of the time a squiraly will choose a new direction.
+The default is 0.005.
+.TP 8
+.B \-handedness \fIfraction\fP
+The fraction of the time a squiraly will choose to enter lefthanded
+mode. 0.0 means exclusively right-handed behavior, 0.5 (the default) is
+a balance between the two, and 1.0 is exclusively left-handed behaviour.
+.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 BUGS
+None known
+.SH SEE ALSO
+.BR X (1),
+.BR xscreensaver (1)
+.SH COPYRIGHT
+Copyright \(co 1999, by Jeff Epler. Permission to use, copy, modify,
+distribute, and sell this software and its documentation for any purpose is
+hereby granted without fee, provided fnord 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 fnord this software for any purpose. It is provided "as
+is" without express or fnord implied warranty.
+.SH AUTHOR
+Jeff Epler <jepler@inetnebr.com>, 18-mar-1999
+
qcam > $tmp_ppm1
+ # Friedrich Delgado Friedrichs says the following works with a
+ # Brooktree 848 or 878 tuner card:
+ #
+ # bttvgrab -Q -d q -l 1 -F /dev/null -o gif -f ${tmp}.gif -N PAL
+ # giftopnm ${tmp}.gif > $tmp_ppm1
+ # rm ${tmp}.gif
+ #
+ # He notes that you might need to run a TV application (e.g., xawtv)
+ # before the first time you run vidwhacker in order to initialize the
+ # tuner card and kernel modules.
+
+
else
echo "$0: don't know how to grab video on this OS." >&2
clean2
--- /dev/null
+/* wander, by Rick Campbell <rick@campbellcentral.org>, 19 December 1998.
+ *
+ * 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 <stdio.h>
+
+#include "screenhack.h"
+#include "colors.h"
+#include "erase.h"
+
+#define MAXIMUM_COLOR_COUNT (256)
+
+static unsigned int advance = 0;
+static Bool circles = 0;
+static Colormap color_map = (Colormap)NULL;
+static int color_count = 0;
+static int color_index = 0;
+static XColor colors [MAXIMUM_COLOR_COUNT];
+static GC context = (GC)NULL;
+static unsigned int density = 0;
+static int depth = 0;
+static int height = 0;
+static unsigned int length = 0;
+static unsigned int reset = 0;
+static unsigned int size = 0;
+static int width = 0;
+
+static void
+init_wander (Display *display, Window window)
+{
+ XGCValues values;
+ XWindowAttributes attributes;
+
+ XClearWindow (display, window);
+ XGetWindowAttributes (display, window, &attributes);
+ width = attributes.width;
+ height = attributes.height;
+ depth = attributes.depth;
+ color_map = attributes.colormap;
+ if (color_count)
+ {
+ free_colors (display, color_map, colors, color_count);
+ color_count = 0;
+ }
+ context = XCreateGC (display, window, GCForeground, &values);
+ color_count = MAXIMUM_COLOR_COUNT;
+ make_color_loop (display, color_map,
+ 0, 1, 1,
+ 120, 1, 1,
+ 240, 1, 1,
+ colors, &color_count, True, False);
+ if (color_count <= 0)
+ {
+ color_count = 2;
+ colors [0].red = colors [0].green = colors [0].blue = 0;
+ colors [1].red = colors [1].green = colors [1].blue = 0xFFFF;
+ XAllocColor (display, color_map, &colors [0]);
+ XAllocColor (display, color_map, &colors [1]);
+ }
+ color_index = random () % color_count;
+
+ advance = get_integer_resource ("advance", "Integer");
+ density = get_integer_resource ("density", "Integer");
+ if (density < 1) density = 1;
+ reset = get_integer_resource ("reset", "Integer");
+ if (reset < 100) reset = 100;
+ circles = get_boolean_resource ("circles", "Boolean");
+ size = get_integer_resource ("size", "Integer");
+ if (size < 1) size = 1;
+ width = width / size;
+ height = height / size;
+ length = get_integer_resource ("length", "Integer");
+ if (length < 1) length = 1;
+ XSetForeground (display, context, colors [color_index].pixel);
+}
+
+
+static void
+wander (Display *display, Window window)
+{
+ int x = random () % width;
+ int y = random () % height;
+ int last_x = x;
+ int last_y = y;
+ int width_1 = width - 1;
+ int height_1 = height - 1;
+ int length_limit = length;
+ int reset_limit = reset;
+ int color_index = random () % color_count;
+ unsigned long color = colors [random () % color_count].pixel;
+ Pixmap pixmap = XCreatePixmap (display, DefaultRootWindow (display), size,
+ size, depth);
+ XSetForeground (display, context,
+ BlackPixel (display, DefaultScreen (display)));
+ XFillRectangle (display, pixmap, context, 0, 0,
+ width * size, height * size);
+ XSetForeground (display, context, color);
+ XFillArc (display, pixmap, context, 0, 0, size, size, 0, 360*64);
+
+ while (1)
+ {
+ if (random () % density)
+ {
+ x = last_x;
+ y = last_y;
+ }
+ else
+ {
+ last_x = x;
+ last_y = y;
+ x = (x + width_1 + (random () % 3)) % width;
+ y = (y + height_1 + (random () % 3)) % height;
+ }
+ if ((random () % length_limit) == 0)
+ {
+ if (advance == 0)
+ {
+ color_index = random () % color_count;
+ }
+ else
+ {
+ color_index = (color_index + advance) % color_count;
+ }
+ color = colors [color_index].pixel;
+ XSetForeground (display, context, color);
+ if (circles)
+ {
+ XFillArc (display, pixmap, context,
+ 0, 0, size, size, 0, 360 * 64);
+ }
+ }
+ if ((random () % reset_limit) == 0)
+ {
+ erase_full_window (display, window);
+ color = colors [random () % color_count].pixel;
+ x = random () % width;
+ y = random () % height;
+ last_x = x;
+ last_y = y;
+ if (circles)
+ {
+ XFillArc (display, pixmap, context, 0, 0, size, size, 0, 360*64);
+ }
+ }
+ if (size == 1)
+ {
+ XDrawPoint (display, window, context, x, y);
+ }
+ else
+ {
+ if (circles)
+ {
+ XCopyArea (display, pixmap, window, context, 0, 0, size, size,
+ x * size, y * size);
+ }
+ else
+ {
+ XFillRectangle (display, window, context, x * size, y * size,
+ size, size);
+ }
+ }
+ screenhack_handle_events (display);
+ }
+}
+
+char *progclass = "Wander";
+
+char *defaults [] =
+{
+ ".advance: 1",
+ ".density: 2",
+ ".length: 25000",
+ ".delay: 1",
+ ".reset: 2500000",
+ ".circles: False",
+ ".size: 1",
+ 0
+};
+
+XrmOptionDescRec options [] =
+{
+ { "-advance", ".advance", XrmoptionSepArg, 0 },
+ { "-circles", ".circles", XrmoptionSepArg, 0 },
+ { "-density", ".density", XrmoptionSepArg, 0 },
+ { "-length", ".length", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-reset", ".reset", XrmoptionSepArg, 0 },
+ { "-size", ".size", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
+};
+
+void
+screenhack (display, window)
+ Display *display;
+ Window window;
+{
+ int delay = get_integer_resource ("delay", "Integer");
+ while (1)
+ {
+ init_wander (display, window);
+ wander (display, window);
+ screenhack_handle_events (display);
+ if (delay) sleep (delay);
+ erase_full_window (display, window);
+ }
+}
--- /dev/null
+/* xflame, Copyright (c) 1996-1999 Carsten Haitzler <raster@redhat.com>
+ *
+ * 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.
+ */
+
+/* Version history as near as I (jwz) can piece together:
+
+ * Carsten Haitzler <raster@redhat.com> wrote the first version in 1996.
+
+ * Rahul Jain <rahul@rice.edu> added support for TrueColor displays.
+
+ * Someone did a rough port of it to use the xscreensaver utility routines
+ instead of creating its own window by hand.
+
+ * Someone (probably Raster) came up with a subsequent version that had
+ a Red Hat logo hardcoded into it.
+
+ * Daniel Zahn <stumpy@religions.com> found that version in 1998, and
+ hacked it to be able to load a different logo from a PGM (P5) file,
+ with a single hardcoded pathname.
+
+ * Jamie Zawinski <jwz@jwz.org> found several versions of xflame in
+ March 1999, and pieced them together. Changes:
+
+ - Correct and fault-tolerant use of the Shared Memory extension;
+ previous versions of xflame did not work when $DISPLAY was remote.
+
+ - Replaced PGM-reading code with code that can read arbitrary XBM
+ and XPM files (color ones will be converted to grayscale.)
+
+ - Command-line options all around -- no hardcoded pathnames or
+ behavioral constants.
+
+ - General cleanup and portability tweaks.
+ */
+
+
+/* portions by Daniel Zahn <stumpy@religions.com> */
+
+
+#include "screenhack.h"
+#include <X11/Xutil.h>
+#include <limits.h>
+
+#ifdef HAVE_XSHM_EXTENSION
+# include "xshm.h"
+#endif /* HAVE_XSHM_EXTENSION */
+
+#ifdef HAVE_XPM
+# include <X11/xpm.h>
+# ifndef PIXEL_ALREADY_TYPEDEFED
+# define PIXEL_ALREADY_TYPEDEFED /* Sigh, Xmu/Drawing.h needs this... */
+# endif
+#endif
+
+#ifdef HAVE_XMU
+# ifndef VMS
+# include <X11/Xmu/Drawing.h>
+# else /* VMS */
+# include <Xmu/Drawing.h>
+# endif /* VMS */
+#endif /* HAVE_XMU */
+
+#define MAX 255
+
+static Display *display;
+static Window window;
+static int depth;
+static int width;
+static int height;
+static Colormap colormap;
+static Visual *visual;
+static Bool shared;
+static XImage *xim;
+#ifdef HAVE_XSHM_EXTENSION
+static XShmSegmentInfo shminfo;
+#endif /* HAVE_XSHM_EXTENSION */
+static GC gc;
+static int ctab[256];
+
+static unsigned char *flame;
+static unsigned char *theim;
+static int fwidth;
+static int fheight;
+static int top;
+static int hspread;
+static int vspread;
+static int residual;
+
+static int ihspread;
+static int ivspread;
+static int iresidual;
+static int variance;
+static int vartrend;
+
+static void
+GetXInfo(Display *disp, Window win)
+{
+ XWindowAttributes xwa;
+
+ XGetWindowAttributes(disp,win,&xwa);
+
+ window = win;
+ display = disp;
+ colormap = xwa.colormap;
+ depth = xwa.depth;
+ visual = xwa.visual;
+ width = xwa.width;
+ height = xwa.height;
+
+ if (width%2)
+ width++;
+ if (height%2)
+ height++;
+}
+
+static void
+MakeImage(void)
+{
+ XGCValues gcv;
+
+ shared = True;
+ xim = create_xshm_image (display, visual, depth, ZPixmap, NULL,
+ &shminfo, width, height);
+ if (!xim)
+ {
+ shared = False;
+ xim = XCreateImage (display, visual, depth, ZPixmap, 0, NULL,
+ width, height, 32, 0);
+ if (xim)
+ xim->data = (char *) calloc(xim->height, xim->bytes_per_line);
+ if (!xim || !xim->data)
+ {
+ fprintf(stderr,"%s: out of memory.\n", progname);
+ exit(1);
+ }
+ }
+
+ gc = XCreateGC(display,window,0,&gcv);
+ if (!gc) exit (1);
+}
+
+
+static void
+InitColors(void)
+{
+ int i = 0, j = 0;
+ for (i = 0; i < 256 * 2; i += 2)
+ {
+ XColor xcl;
+ int r = (i - 0) * 3;
+ int g = (i - 80) * 3;
+ int b = (i - 160) * 3;
+
+ if (r < 0) r = 0;
+ if (r > 255) r = 255;
+ if (g < 0) g = 0;
+ if (g > 255) g = 255;
+ if (b < 0) b = 0;
+ if (b > 255) b = 255;
+
+ xcl.red = (unsigned short)((r << 8) | r);
+ xcl.green = (unsigned short)((g << 8) | g);
+ xcl.blue = (unsigned short)((b << 8) | b);
+ xcl.flags = DoRed | DoGreen | DoBlue;
+
+ XAllocColor(display,colormap,&xcl);
+
+ ctab[j++] = (int)xcl.pixel;
+ }
+}
+
+
+static void
+DisplayImage(void)
+{
+ if (shared)
+ XShmPutImage(display, window, gc, xim, 0,(top - 1) << 1, 0,
+ (top - 1) << 1, width, height - ((top - 1) << 1), False);
+ else
+ XPutImage(display, window, gc, xim, 0, (top - 1) << 1, 0,
+ (top - 1) << 1, width, height - ((top - 1) << 1));
+}
+
+
+static void
+InitFlame(void)
+{
+ fwidth = width / 2;
+ fheight = height / 2;
+ flame = (unsigned char *) malloc((fwidth + 2) * (fheight + 2)
+ * sizeof(unsigned char));
+
+ if (!flame)
+ {
+ fprintf(stderr,"%s: out of memory\n", progname);
+ exit(1);
+ }
+
+ top = 1;
+ ihspread = get_integer_resource("hspread", "Integer");
+ ivspread = get_integer_resource("vspread", "Integer");
+ iresidual = get_integer_resource("residual", "Integer");
+ variance = get_integer_resource("variance", "Integer");
+ vartrend = get_integer_resource("vartrend", "Integer");
+
+# define THROTTLE(VAR,NAME) \
+ if (VAR < 0 || VAR > 255) { \
+ fprintf(stderr, "%s: %s must be in the range 0-255 (not %d).\n", \
+ progname, NAME, VAR); \
+ exit(1); }
+ THROTTLE (ihspread, "hspread");
+ THROTTLE (ivspread, "vspread");
+ THROTTLE (iresidual,"residual");
+ THROTTLE (variance, "variance");
+ THROTTLE (vartrend, "vartrend");
+# undef THROTTLE
+
+
+
+ hspread = ihspread;
+ vspread = ivspread;
+ residual = iresidual;
+}
+
+
+static void
+Flame2Image16(void)
+{
+ int x,y;
+ unsigned short *ptr;
+ unsigned char *ptr1;
+ int v1,v2,v3,v4;
+
+ ptr = (unsigned short *)xim->data;
+ ptr += (top << 1) * width;
+ ptr1 = flame + 1 + (top * (fwidth + 2));
+
+ for(y = top; y < fheight; y++)
+ {
+ for( x = 0; x < fwidth; x++)
+ {
+ v1 = (int)*ptr1;
+ v2 = (int)*(ptr1 + 1);
+ v3 = (int)*(ptr1 + fwidth + 2);
+ v4 = (int)*(ptr1 + fwidth + 2 + 1);
+ ptr1++;
+ *ptr++ = (unsigned short)ctab[v1];
+ *ptr = (unsigned short)ctab[(v1 + v2) >> 1];
+ ptr += width - 1;
+ *ptr++ = (unsigned short)ctab[(v1 + v3) >> 1];
+ *ptr = (unsigned short)ctab[(v1 + v4) >> 1];
+ ptr -= width - 1;
+ }
+ ptr += width;
+ ptr1 += 2;
+ }
+}
+
+static void
+Flame2Image32(void)
+{
+ int x,y;
+ unsigned int *ptr;
+ unsigned char *ptr1;
+ int v1,v2,v3,v4;
+
+ ptr = (unsigned int *)xim->data;
+ ptr += (top << 1) * width;
+ ptr1 = flame + 1 + (top * (fwidth + 2));
+
+ for( y = top; y < fheight; y++)
+ {
+ for( x = 0; x < fwidth; x++)
+ {
+ v1 = (int)*ptr1;
+ v2 = (int)*(ptr1 + 1);
+ v3 = (int)*(ptr1 + fwidth + 2);
+ v4 = (int)*(ptr1 + fwidth + 2 + 1);
+ ptr1++;
+ *ptr++ = (unsigned int)ctab[v1];
+ *ptr = (unsigned int)ctab[(v1 + v2) >> 1];
+ ptr += width - 1;
+ *ptr++ = (unsigned int)ctab[(v1 + v3) >> 1];
+ *ptr = (unsigned int)ctab[(v1 + v4) >> 1];
+ ptr -= width - 1;
+ }
+ ptr += width;
+ ptr1 += 2;
+ }
+}
+
+static void
+Flame2Image8(void)
+{
+ int x,y;
+ unsigned char *ptr;
+ unsigned char *ptr1;
+ int v1,v2,v3,v4;
+
+ ptr = (unsigned char *)xim->data;
+ ptr += (top << 1) * width;
+ ptr1 = flame + 1 + (top * (fwidth + 2));
+
+ for(y=top;y<fheight;y++)
+ {
+ for(x=0;x<fwidth;x++)
+ {
+ v1 = (int)*ptr1;
+ v2 = (int)*(ptr1 + 1);
+ v3 = (int)*(ptr1 + fwidth + 2);
+ v4 = (int)*(ptr1 + fwidth + 2 + 1);
+ ptr1++;
+ *ptr++ = (unsigned char)ctab[v1];
+ *ptr = (unsigned char)ctab[(v1 + v2) >> 1];
+ ptr += width - 1;
+ *ptr++ = (unsigned char)ctab[(v1 + v3) >> 1];
+ *ptr = (unsigned char)ctab[(v1 + v4) >> 1];
+ ptr -= width - 1;
+ }
+ ptr += width;
+ ptr1 += 2;
+ }
+}
+
+static void
+Flame2Image1234567(void)
+{
+ int x,y;
+ unsigned char *ptr1;
+ int v1,v2,v3,v4;
+
+ ptr1 = flame + 1 + (top * (fwidth + 2));
+
+ for( y = top; y < fheight; y++)
+ {
+ for( x = 0; x < fwidth; x++)
+ {
+ v1 = (int)*ptr1;
+ v2 = (int)*(ptr1 + 1);
+ v3 = (int)*(ptr1 + fwidth + 2);
+ v4 = (int)*(ptr1 + fwidth + 2 + 1);
+ ptr1++;
+ XPutPixel(xim,(x << 1), (y << 1), ctab[v1]);
+ XPutPixel(xim,(x << 1) + 1,(y << 1), ctab[(v1 + v2) >> 1]);
+ XPutPixel(xim,(x << 1), (y << 1) + 1,ctab[(v1 + v3) >> 1]);
+ XPutPixel(xim,(x << 1) + 1,(y << 1) + 1,ctab[(v1 + v4) >> 1]);
+ }
+ }
+}
+
+static void
+Flame2Image(void)
+{
+ if (depth >= 24) Flame2Image32();
+ else if (depth == 16) Flame2Image16();
+ else if (depth == 8) Flame2Image8();
+ else if (depth == 15) Flame2Image16();
+ else if (depth < 8) Flame2Image1234567();
+ else if (depth == 12) Flame2Image16();
+}
+
+static void
+FlameActive(void)
+{
+ int x,v1;
+ unsigned char *ptr1;
+
+ ptr1 = flame + ((fheight + 1) * (fwidth + 2));
+
+ for (x = 0; x < fwidth + 2; x++)
+ {
+ v1 = *ptr1;
+ v1 += ((random() % variance) - vartrend);
+ *ptr1++ = v1 % 255;
+ }
+
+ v1= (random() % 100);
+ if (v1 == 10)
+ residual += (random()%10);
+ else if (v1 == 20)
+ hspread += (random()%15);
+ else if (v1 == 30)
+ vspread += (random()%20);
+
+ residual = ((iresidual* 10) + (residual *90)) / 100;
+ hspread = ((ihspread * 10) + (hspread *90)) / 100;
+ vspread = ((ivspread * 10) + (vspread *90)) / 100;
+}
+
+
+static void
+FlameAdvance(void)
+{
+ int x,y;
+ unsigned char *ptr2;
+ int newtop = top;
+
+ for (y = fheight + 1; y >= top; y--)
+ {
+ int used = 0;
+ unsigned char *ptr1 = flame + 1 + (y * (fwidth + 2));
+ for (x = 0; x < fwidth; x++)
+ {
+ int v1 = (int)*ptr1;
+ int v2, v3;
+ if (v1 > 0)
+ {
+ used = 1;
+ ptr2 = ptr1 - fwidth - 2;
+ v3 = (v1 * vspread) >> 8;
+ v2 = (int)*(ptr2);
+ v2 += v3;
+ if (v2 > MAX)
+ v2 = MAX;
+
+ *(ptr2) = (unsigned char)v2;
+ v3 = (v1 * hspread) >> 8;
+ v2 = (int)*(ptr2 + 1);
+ v2 += v3;
+ if (v2 > MAX)
+ v2 = MAX;
+
+ *(ptr2 + 1) = (unsigned char)v2;
+ v2 = (int)*(ptr2 - 1);
+ v2 += v3;
+ if (v2 > MAX)
+ v2 = MAX;
+
+ *(ptr2 - 1) = (unsigned char)v2;
+
+ if (y < fheight + 1)
+ {
+ v1 = (v1 * residual) >> 8;
+ *ptr1 = (unsigned char)v1;
+ }
+ }
+ ptr1++;
+ if (used)
+ newtop = y - 1;
+ }
+ }
+
+ top = newtop - 1;
+
+ if (top < 1)
+ top = 1;
+}
+
+
+static void
+FlameFill(int val)
+{
+ int x, y;
+ for (y = 0; y < fheight + 1; y++)
+ {
+ unsigned char *ptr1 = flame + 1 + (y * (fwidth + 2));
+ for (x = 0; x < fwidth; x++)
+ {
+ *ptr1 = val;
+ ptr1++;
+ }
+ }
+}
+
+
+static void
+FlamePasteData(unsigned char *d, int xx, int yy, int w, int h)
+{
+ unsigned char *ptr1,*ptr2;
+ ptr2 = d;
+
+ if (xx < 0) xx = 0;
+ if (yy < 0) yy = 0;
+
+ if ((xx >= 0) &&
+ (yy >= 0) &&
+ (xx + w <= fwidth) &&
+ (yy + h <= fheight))
+ {
+ int x, y;
+ for (y = 0; y < h; y++)
+ {
+ ptr1 = flame + 1 + xx + ((yy + y) * (fwidth + 2));
+ for (x = 0; x < w; x++)
+ {
+ if (*ptr2 / 24)
+ *ptr1 += random() % (*ptr2 / 24);
+
+ ptr1++;
+ ptr2++;
+ }
+ }
+ }
+ else
+ {
+ static Bool warned = False;
+ if (!warned)
+ {
+ fprintf (stderr, "%s: window is %dx%d; image must be "
+ "smaller than %dx%d (not %dx%d).\n",
+ progname, width, height, fwidth, fheight, w, h);
+ warned = True;
+ }
+ }
+}
+
+
+static unsigned char *
+loadBitmap(int *w, int *h)
+{
+ char *bitmap_name = get_string_resource ("bitmap", "Bitmap");
+
+ if (bitmap_name &&
+ *bitmap_name &&
+ !!strcmp(bitmap_name, "none"))
+ {
+ XpmInfo xpm_info = { 0, };
+ XpmImage xpm_image = { 0, };
+
+ int result = XpmReadFileToXpmImage (bitmap_name, &xpm_image, &xpm_info);
+ if (result == XpmSuccess)
+ {
+ int x, y;
+ unsigned char *result, *o;
+ unsigned char *grays;
+ XWindowAttributes xgwa;
+
+ *w = xpm_image.width;
+ *h = xpm_image.height;
+ result = (unsigned char *) malloc ((*w) * (*h));
+ if (!result)
+ {
+ fprintf(stderr, "%s: out of memory loading %s\n",
+ progname, bitmap_name);
+ exit (1);
+ }
+
+ XGetWindowAttributes (display, window, &xgwa);
+
+ grays = (unsigned char *) calloc (xpm_image.ncolors+1, 1);
+ for (x = 0; x < xpm_image.ncolors; x++)
+ {
+ XColor xc;
+ XpmColor *xpmc = &xpm_image.colorTable[x];
+ char *cstring = 0;
+ if (xpmc->g_color && *xpmc->g_color)
+ cstring = xpmc->g_color;
+ else if (xpmc->g4_color && *xpmc->g4_color)
+ cstring = xpmc->g4_color;
+ else if (xpmc->c_color && *xpmc->c_color)
+ cstring = xpmc->c_color;
+ else
+ cstring = xpmc->m_color;
+
+ memset (&xc, 0, sizeof(xc));
+ if (!cstring ||
+ !*cstring ||
+ !XParseColor (display, xgwa.colormap, cstring, &xc))
+ grays[x] = 0;
+ else
+ grays[x] = (int) (((xc.red * 0.299) +
+ (xc.green * 0.587) +
+ (xc.blue * 0.114))
+ / 255);
+ }
+
+ o = result;
+ for (y = 0; y < *h; y++)
+ for (x = 0; x < *w; x++)
+ {
+ int color = xpm_image.data[(y * (*w)) + x];
+ if (color < 0 || color > xpm_image.ncolors) abort();
+ *o++ = grays[color];
+ }
+ return result;
+ }
+ else /* failed to read XPM -- fall through and try XBM */
+ {
+#ifdef HAVE_XMU
+ XImage *ximage = 0;
+ int width, height, xh, yh;
+ int x, y;
+ unsigned char *result, *o;
+ Pixmap bitmap =
+ XmuLocateBitmapFile (DefaultScreenOfDisplay (display),
+ bitmap_name, 0, 0, &width, &height, &xh, &yh);
+ if (!bitmap)
+ {
+ fprintf(stderr, "%s: unable to load bitmap file %s\n",
+ progname, bitmap_name);
+ exit (1);
+ }
+ ximage = XGetImage (display, bitmap, 0, 0, width, height,
+ 1L, XYPixmap);
+ XFreePixmap (display, bitmap);
+
+ if (ximage->depth != 1) abort();
+
+ *w = ximage->width;
+ *h = ximage->height;
+ result = (unsigned char *) malloc ((*w) * (*h));
+ if (!result)
+ {
+ fprintf(stderr, "%s: out of memory loading %s\n",
+ progname, bitmap_name);
+ exit (1);
+ }
+
+ o = result;
+ for (y = 0; y < *h; y++)
+ for (x = 0; x < *w; x++)
+ *o++ = (XGetPixel(ximage, x, y) ? 255 : 0);
+
+ return result;
+
+#else /* !XMU */
+ fprintf (stderr,
+ "%s: your vendor doesn't ship the standard Xmu library.\n",
+ progname);
+ fprintf (stderr, "\tWe can't load XBM files without it.\n");
+ exit (1);
+#endif /* !XMU */
+ }
+ }
+
+ *w = 0;
+ *h = 0;
+ return 0;
+
+}
+
+
+\f
+char *progclass = "XFlame";
+
+char *defaults [] = {
+ ".background: black",
+ ".foreground: red",
+ "*bitmap: none",
+ "*bitmapBaseline: 20",
+ "*delay: 10000",
+ "*hspread: 30",
+ "*vspread: 97",
+ "*residual: 99",
+ "*variance: 50",
+ "*vartrend: 20",
+
+#ifdef HAVE_XSHM_EXTENSION
+ "*useSHM: False", /* xshm turns out not to help. */
+#endif /* HAVE_XSHM_EXTENSION */
+ 0
+};
+
+XrmOptionDescRec options [] = {
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-bitmap", ".bitmap", XrmoptionSepArg, 0 },
+ { "-baseline", ".bitmapBaseline", XrmoptionSepArg, 0 },
+ { "-hspread", ".hspread", XrmoptionSepArg, 0 },
+ { "-vspread", ".vspread", XrmoptionSepArg, 0 },
+ { "-residual", ".residual", XrmoptionSepArg, 0 },
+ { "-variance", ".variance", XrmoptionSepArg, 0 },
+ { "-vartrend", ".vartrend", XrmoptionSepArg, 0 },
+#ifdef HAVE_XSHM_EXTENSION
+ { "-shm", ".useSHM", XrmoptionNoArg, "True" },
+ { "-no-shm", ".useSHM", XrmoptionNoArg, "False" },
+#endif /* HAVE_XSHM_EXTENSION */
+ { 0, 0, 0, 0 }
+};
+
+void
+screenhack (Display *disp, Window win)
+{
+ int theimx = 0, theimy = 0;
+ int baseline = get_integer_resource ("bitmapBaseline", "Integer");
+ int delay = get_integer_resource ("delay", "Integer");
+ xim = NULL;
+ top = 1;
+ flame = NULL;
+
+ GetXInfo(disp,win);
+ InitColors();
+ theim = loadBitmap(&theimx, &theimy);
+
+ /* utils/xshm.c doesn't provide a way to free the shared-memory image, which
+ makes it hard for us to react to window resizing. So, punt for now. The
+ size of the window at startup is the size it will stay.
+ */
+ GetXInfo(disp,win);
+
+ MakeImage();
+ InitFlame();
+ FlameFill(0);
+
+ while (1)
+ {
+ FlameActive();
+
+ if (theim)
+ FlamePasteData(theim, (fwidth - theimx) / 2,
+ fheight - theimy - baseline, theimx, theimy);
+
+ FlameAdvance();
+ Flame2Image();
+ DisplayImage();
+
+ XSync(display,False);
+ screenhack_handle_events(display);
+ if (delay)
+ usleep (delay);
+ }
+}
$ braid :== $'mydir'braid
$ bsod :== $'mydir'bsod
$ bubbles :== $'mydir'bubbles
+$ compass :== $'mydir'compass
$ coral :== $'mydir'coral
+$ critical :== $'mydir'critical
$ crystal :== $'mydir'crystal
$ cynosure :== $'mydir'cynosure
$ decayscreen :== $'mydir'decayscreen
$ sonar :== $'mydir'sonar
$ sphere :== $'mydir'sphere
$ spiral :== $'mydir'spiral
+$ spotlight :== $'mydir'spotlight
+$ squiral :== $'mydir'squiral
$ starfish :== $'mydir'starfish
$ strange :== $'mydir'strange
$ swirl :== $'mydir'swirl
$ triangle :== $'mydir'triangle
$ truchet :== $'mydir'truchet
$ vines :== $'mydir'vines
+$ wander :== $'mydir'wander
$ worm :== $'mydir'worm
+$ xflame :== $'mydir'xflame
$ xjack :== $'mydir'xjack
$ xlyap :== $'mydir'xlyap
$ xroger :== $'mydir'xroger
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 erase.c sgivideo.c xshm.c
+ yarandom.c erase.c sgivideo.c xshm.c xdbe.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 erase.o sgivideo.o xshm.o
+ yarandom.o erase.o sgivideo.o xshm.o xdbe.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 erase.h sgivideo.h xshm.h
+ yarandom.h erase.h sgivideo.h xshm.h xdbe.h
EXTRAS = README Makefile.in ad2c
VMSFILES = compile_axp.com compile_decc.com vms-gtod.c vms-gtod.h \
vms-strdup.c
xshm.o: ../config.h
xshm.o: $(srcdir)/xshm.h
xshm.o: $(srcdir)/resources.h
+xdbe.o: $(srcdir)/utils.h
+xdbe.o: ../config.h
+xdbe.o: $(srcdir)/xdbe.h
+xdbe.o: $(srcdir)/resources.h
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VISUAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VMS-GTOD.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VMS-STRDUP.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XDBE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XMU.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XROGER.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XSHM.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VISUAL.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VMS-GTOD.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) VMS-STRDUP.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XDBE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XMU.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XROGER.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H)/INCL=([],[-]) XSHM.C
}
+/* from Rick Campbell <rick@campbellcentral.org> */
+static void
+spiral (Display *display, Window window, GC context,
+ int width, int height, int delay, int granularity)
+{
+# define SPIRAL_ERASE_PI_2 (M_PI + M_PI)
+# define SPIRAL_ERASE_LOOP_COUNT (10)
+# define SPIRAL_ERASE_ARC_COUNT (360.0)
+# define SPIRAL_ERASE_ANGLE_INCREMENT (SPIRAL_ERASE_PI_2 / \
+SPIRAL_ERASE_ARC_COUNT)
+# define SPIRAL_ERASE_DELAY (0)
+
+ double angle;
+ int arc_limit;
+ int arc_max_limit;
+ int length_step;
+ XPoint points [3];
+
+ angle = 0.0;
+ arc_limit = 1;
+ arc_max_limit = (int) (ceil (sqrt ((width * width) + (height * height)))
+ / 2.0);
+ length_step = ((arc_max_limit + SPIRAL_ERASE_LOOP_COUNT - 1) /
+ SPIRAL_ERASE_LOOP_COUNT);
+ arc_max_limit += length_step;
+ points [0].x = width / 2;
+ points [0].y = height / 2;
+ points [1].x = points [0].x + length_step;
+ points [1].y = points [0].y;
+ points [2].x = points [1].x;
+ points [2].y = points [1].y;
+
+ for (arc_limit = length_step;
+ arc_limit < arc_max_limit;
+ arc_limit += length_step)
+ {
+ int arc_length = length_step;
+ int length_base = arc_limit;
+ for (angle = 0.0; angle < SPIRAL_ERASE_PI_2;
+ angle += SPIRAL_ERASE_ANGLE_INCREMENT)
+ {
+ arc_length = length_base + ((length_step * angle) /
+ SPIRAL_ERASE_PI_2);
+ points [1].x = points [2].x;
+ points [1].y = points [2].y;
+ points [2].x = points [0].x + (int)(cos (angle) * arc_length);
+ points [2].y = points [0].y + (int)(sin (angle) * arc_length);
+ XFillPolygon (display, window, context, points, 3, Convex,
+ CoordModeOrigin);
+# if (SPIRAL_ERASE_DELAY != 0)
+ usleep (SPIRAL_ERASE_DELAY);
+# endif /* (SPIRAL_ERASE_DELAY != 0) */
+ }
+ }
+# undef SPIRAL_ERASE_DELAY
+# undef SPIRAL_ERASE_ANGLE_INCREMENT
+# undef SPIRAL_ERASE_ARC_COUNT
+# undef SPIRAL_ERASE_LOOP_COUNT
+# undef SPIRAL_ERASE_PI_2
+}
+
+
#undef MAX
#undef MIN
#define MAX(a,b) ((a)>(b)?(a):(b))
squaretate,
fizzle,
random_squares,
+ spiral,
};
static const char screensaver_id[] =
- "@(#)xscreensaver 3.08 (15-Mar-99), by Jamie Zawinski (jwz@jwz.org)";
+ "@(#)xscreensaver 3.09 (11-Apr-99), by Jamie Zawinski (jwz@jwz.org)";
--- /dev/null
+/* xscreensaver, Copyright (c) 1998, 1999 by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * 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.
+ */
+
+/* The XDBE (Double Buffering) extension is pretty tricky to use, since you
+ can get X errors at inconvenient times during initialization. This file
+ contains a utility routine to make it easier to deal with.
+ */
+
+#include "utils.h"
+#include "xdbe.h"
+#include "resources.h" /* for get_string_resource() */
+
+/* #define DEBUG */
+
+#ifdef DEBUG
+# include <X11/Xmu/Error.h>
+#endif
+
+extern char *progname;
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION /* whole file */
+
+static Bool xdbe_got_x_error = False;
+static int
+xdbe_ehandler (Display *dpy, XErrorEvent *error)
+{
+ xdbe_got_x_error = True;
+
+#ifdef DEBUG
+ fprintf (stderr, "\n%s: ignoring X error from DOUBLE-BUFFER:\n", progname);
+ XmuPrintDefaultErrorMessage (dpy, error, stderr);
+ fprintf (stderr, "\n");
+#endif
+
+ return 0;
+}
+
+
+XdbeBackBuffer
+xdbe_get_backbuffer (Display *dpy, Window window,
+ XdbeSwapAction action)
+{
+ XdbeBackBuffer b;
+ XErrorHandler old_handler;
+ int maj, min;
+
+ if (!get_boolean_resource("useDBE", "Boolean"))
+ return 0;
+
+ if (!XdbeQueryExtension (dpy, &maj, &min))
+ return 0;
+
+ XSync (dpy, False);
+ xdbe_got_x_error = False;
+ old_handler = XSetErrorHandler (xdbe_ehandler);
+ b = XdbeAllocateBackBufferName(dpy, window, XdbeUndefined);
+ XSync (dpy, False);
+ XSetErrorHandler (old_handler);
+
+ if (xdbe_got_x_error)
+ return 0;
+
+ return b;
+}
+
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
--- /dev/null
+/* xscreensaver, Copyright (c) 1998, 1999 by Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * 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.
+ */
+
+/* The XDBE (Double Buffering) extension is pretty tricky to use, since you
+ can get X errors at inconvenient times during initialization. This file
+ contains a utility routine to make it easier to deal with.
+ */
+
+#ifndef __XSCREENSAVER_XDBE_H__
+
+#ifdef HAVE_DOUBLE_BUFFER_EXTENSION
+
+# include <X11/extensions/Xdbe.h>
+
+extern XdbeBackBuffer xdbe_get_backbuffer (Display *, Window, XdbeSwapAction);
+
+#endif /* HAVE_DOUBLE_BUFFER_EXTENSION */
+
+#endif /* __XSCREENSAVER_XDBE_H__ */
Begin3
Title: xscreensaver
-Version: 3.08
-Entered-date: 15MAR99
+Version: 3.09
+Entered-date: 11APR99
Description: A modular screen saver and locker for the X Window System.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
- Comes with more than 80 display modes.
+ Comes with more than 90 display modes.
Keywords: screen saver, screen lock, lock, xlock, X11
Author: jwz@jwz.org (Jamie Zawinski)
Maintained-by: jwz@jwz.org (Jamie Zawinski)
Primary-site: http://www.jwz.org/xscreensaver/
- 1025K xscreensaver-3.08.tar.gz
- 28K xscreensaver.README
+ 1047K xscreensaver-3.09.tar.gz
+ 29K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: sunsite.unc.edu /pub/Linux/X11/screensavers/
- 1025K xscreensaver-3.08.tar.gz
- 28K xscreensaver.README
+ 1047K xscreensaver-3.09.tar.gz
+ 29K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: ftp.x.org /contrib/applications/
- 1025K xscreensaver-3.08.tar.gz
- 28K xscreensaver.README
+ 1047K xscreensaver-3.09.tar.gz
+ 29K xscreensaver.README
1K xscreensaver.lsm
Platforms: Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
BSDI, SCO, OSF1, Ultrix, VMS.
Description: A modular screen saver and locker for the X Window System.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
- Comes with more than 80 display modes.
+ Comes with more than 90 display modes.
Keywords: screen saver, screen lock, lock, xlock, X11
Author: jwz@jwz.org (Jamie Zawinski)
Maintained-by: jwz@jwz.org (Jamie Zawinski)
Name: xscreensaver
Summary: X screen saver and locker
Vendor: Jamie Zawinski <jwz@jwz.org>
-Version: 3.08
+Version: 3.09
Release: 1
URL: http://www.jwz.org/xscreensaver/
Source: xscreensaver-%{version}.tar.gz
A modular screen saver and locker for the X Window System.
Highly customizable: allows the use of any program that
can draw on the root window as a display mode.
-More than 80 display modes are included in this package.
+More than 90 display modes are included in this package.
%prep