interference - More groovy colored fields.
truchet - Nonrepeating planar tilings.
bsod - Simulates the system crashes of various other OSes.
+ crystal - A kaleidoscope of moving polygons.
+ discrete - Various fractal-ish "discrete map" forms.
gears - Draws interlocking rotating gears (GLX only.)
morph3d - Draws shiny shape-changing 3d forms (GLX only.)
superquadrics - More shiny shape-changing 3d forms (GLX only.)
-- Jamie Zawinski <jwz@netscape.com>
\f
+Changes since 2.22: * The fix for SGI's "scheme" nonsense broke things, and
+ let the user's "*background" resource show through.
+ Fixed it in a different way.
+Changes since 2.21: * Added support for the DPMS server extension (Display
+ Power Management System.)
+ * Made configure advertize the --enable-subdir option a
+ little more, since that seemed to cause some people
+ stress. Also, made that directory be built into the
+ xscreensaver executable, as a hardcoded prefix to
+ $PATH. (Might help, shouldn't hurt.)
+ * Made configure prefer the two-arg gettimeofday to the
+ one-arg version, since AIX doesn't have any prototypes.
+ * Made it work with Xaw3d (the 3D Athena library.)
+ * Made "make install" create directories as necessary.
+ * New version of lmorph from Sverre.
+ * Added `crystal' and `discreet' hacks from xlockmore.
+ * Added a new mode to `bsod'.
Changes since 2.20: * Made "xscreensaver-command -time" use different words.
(It now describes the two states as "screen blanked
since..." and "screen non-blanked since..." instead of
*/
#undef HAVE_SGI_VC_EXTENSION
+/* Define this if you have the XDPMS extension. This is standard on
+ * sufficiently-recent XFree86 systems, and possibly elsewhere. (It's
+ * available if the file /usr/include/X11/extensions/dpms.h exists.)
+ */
+#undef HAVE_DPMS_EXTENSION
+
/* *************************************************************************
CONFIGURING GRAPHICS TOOLKITS
extension, if possible (this is the default).
--without-sgivc-ext Do not compile in support for this extension."
ac_help="$ac_help
+ --with-dpms-ext Include support for the DPMS server extension,
+ if possible (this is the default).
+ --without-dpms-ext Do not compile in support for this extension."
+ac_help="$ac_help
Toolkit options:
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:645: checking host system type" >&5
+echo "configure:649: 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:669: checking for $ac_word" >&5
+echo "configure:673: 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:698: checking for $ac_word" >&5
+echo "configure:702: 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:746: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:750: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 756 "configure"
+#line 760 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:780: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:784: 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:785: checking whether we are using GNU C" >&5
+echo "configure:789: 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:794: \"$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:798: \"$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:809: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:813: 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:839: checking how to request ANSI compilation" >&5
+echo "configure:843: 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:861: checking whether the compiler works on ANSI C" >&5
+echo "configure:865: 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 866 "configure"
+#line 870 "configure"
#include "confdefs.h"
main(int ac, char **av) { return 0; }
EOF
-if { (eval echo configure:870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
else
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:899: checking how to run the C preprocessor" >&5
+echo "configure:903: 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 914 "configure"
+#line 918 "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:920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:924: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 931 "configure"
+#line 935 "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:937: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:970: checking for a BSD compatible install" >&5
+echo "configure:974: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1020: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1024: 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:1048: checking for working const" >&5
+echo "configure:1052: 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 1053 "configure"
+#line 1057 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1106: \"$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:1123: checking for inline" >&5
+echo "configure:1127: 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 1130 "configure"
+#line 1134 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1137: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1141: \"$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:1164: checking for ANSI C header files" >&5
+echo "configure:1168: 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 1169 "configure"
+#line 1173 "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:1177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1194 "configure"
+#line 1198 "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 1212 "configure"
+#line 1216 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 1233 "configure"
+#line 1237 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:1244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:1268: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:1272: 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 1273 "configure"
+#line 1277 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:1282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1286: \"$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:1303: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:1307: 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 1308 "configure"
+#line 1312 "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:1324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1328: \"$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:1349: checking for $ac_hdr that defines DIR" >&5
+echo "configure:1353: 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 1354 "configure"
+#line 1358 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:1362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1366: \"$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:1387: checking for opendir in -ldir" >&5
+echo "configure:1391: 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 1395 "configure"
+#line 1399 "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:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1428: checking for opendir in -lx" >&5
+echo "configure:1432: 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 1436 "configure"
+#line 1440 "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:1447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:1471: checking for mode_t" >&5
+echo "configure:1475: 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 1476 "configure"
+#line 1480 "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:1504: checking for pid_t" >&5
+echo "configure:1508: 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 1509 "configure"
+#line 1513 "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:1537: checking for size_t" >&5
+echo "configure:1541: 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 1542 "configure"
+#line 1546 "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:1570: checking return type of signal handlers" >&5
+echo "configure:1574: 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 1575 "configure"
+#line 1579 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:1592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1596: \"$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:1612: checking how to call gettimeofday" >&5
+echo "configure:1616: 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 1617 "configure"
+#line 1621 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
int main() {
-struct timeval tv; gettimeofday(&tv);
+struct timeval tv; struct timezone tzp;
+ gettimeofday(&tv, &tzp);
; return 0; }
EOF
-if { (eval echo configure:1625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ac_gettimeofday_args=1
+ ac_gettimeofday_args=2
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 1633 "configure"
+#line 1638 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <sys/time.h>
int main() {
-struct timeval tv; struct timezone tzp;
- gettimeofday(&tv, &tzp);
+struct timeval tv; gettimeofday(&tv);
; return 0; }
EOF
-if { (eval echo configure:1642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
- ac_gettimeofday_args=2
+ ac_gettimeofday_args=1
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
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:1682: checking for $ac_func" >&5
+echo "configure:1686: 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 1687 "configure"
+#line 1691 "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:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1714: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
for ac_func in sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1737: checking for $ac_func" >&5
+echo "configure:1741: 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 1742 "configure"
+#line 1746 "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:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1794: checking for $ac_hdr" >&5
+echo "configure:1798: 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 1799 "configure"
+#line 1803 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
if test x"$enable_subdir" = xno; then
- HACKDIR='$(bindir)'
+ HACKDIR='${bindir}'
elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
exit 1
else
- HACKDIR='$(bindir)/'$enable_subdir
+ # there must be a better way than this...
+ if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
+ # absolute path
+ HACKDIR=$enable_subdir
+ else
+ # relative path
+ HACKDIR='${bindir}/'$enable_subdir
+ fi
fi
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:1856: checking for X" >&5
+echo "configure:1867: 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 1918 "configure"
+#line 1929 "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:1923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1992 "configure"
+#line 2003 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:1999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2010: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:2105: checking whether -R must be followed by a space" >&5
+echo "configure:2116: 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 2108 "configure"
+#line 2119 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 2131 "configure"
+#line 2142 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:2170: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:2181: 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 2178 "configure"
+#line 2189 "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:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:2211: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:2222: 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 2219 "configure"
+#line 2230 "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:2230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2259: checking for gethostbyname" >&5
+echo "configure:2270: 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 2264 "configure"
+#line 2275 "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:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2308: checking for gethostbyname in -lnsl" >&5
+echo "configure:2319: 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 2316 "configure"
+#line 2327 "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:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:2357: checking for connect" >&5
+echo "configure:2368: 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 2362 "configure"
+#line 2373 "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:2385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:2406: checking for connect in -lsocket" >&5
+echo "configure:2417: 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 2414 "configure"
+#line 2425 "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:2425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:2449: checking for remove" >&5
+echo "configure:2460: 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 2454 "configure"
+#line 2465 "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:2477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:2498: checking for remove in -lposix" >&5
+echo "configure:2509: 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 2506 "configure"
+#line 2517 "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:2517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:2541: checking for shmat" >&5
+echo "configure:2552: 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 2546 "configure"
+#line 2557 "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:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2590: checking for shmat in -lipc" >&5
+echo "configure:2601: 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 2598 "configure"
+#line 2609 "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:2609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
-echo "configure:2642: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:2653: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2650 "configure"
+#line 2661 "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:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo $ac_n "checking for X app-defaults directory""... $ac_c" 1>&6
-echo "configure:2698: checking for X app-defaults directory" >&5
+echo "configure:2709: 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 2825 "configure"
+#line 2836 "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:2846: checking for XPointer" >&5
+echo "configure:2857: 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 2857 "configure"
+#line 2868 "configure"
#include "confdefs.h"
#include <X11/Xlib.h>
int main() {
XPointer foo = (XPointer) 0;
; return 0; }
EOF
-if { (eval echo configure:2864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2875: \"$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:2923: checking for regcmp in -lgen" >&5
+echo "configure:2934: 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 2931 "configure"
+#line 2942 "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:2942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/Xmu/Error.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/Xmu/Error.h""... $ac_c" 1>&6
-echo "configure:2979: checking for X11/Xmu/Error.h" >&5
+echo "configure:2990: 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 2984 "configure"
+#line 2995 "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:2989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
case "$host" in
*-sunos4*)
echo $ac_n "checking for the SunOS 4.1.x _get_wmShellWidgetClass bug""... $ac_c" 1>&6
-echo "configure:3033: checking for the SunOS 4.1.x _get_wmShellWidgetClass bug" >&5
+echo "configure:3044: 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 3046 "configure"
+#line 3057 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_sunos_xmu_bug=no
else
echo "$ac_t""$ac_cv_sunos_xmu_bug" 1>&6
if test $ac_cv_sunos_xmu_bug = yes ; then
echo $ac_n "checking whether the compiler understands -static""... $ac_c" 1>&6
-echo "configure:3069: checking whether the compiler understands -static" >&5
+echo "configure:3080: 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 3076 "configure"
+#line 3087 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_ld_static=yes
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XScreenSaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XScreenSaver.h""... $ac_c" 1>&6
-echo "configure:3129: checking for X11/extensions/XScreenSaver.h" >&5
+echo "configure:3140: 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 3134 "configure"
+#line 3145 "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:3139: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/scrnsaver.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/scrnsaver.h""... $ac_c" 1>&6
-echo "configure:3194: checking for X11/extensions/scrnsaver.h" >&5
+echo "configure:3205: 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 3199 "configure"
+#line 3210 "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:3204: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3215: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
echo $ac_n "checking for XScreenSaverRegister in -lXext""... $ac_c" 1>&6
-echo "configure:3248: checking for XScreenSaverRegister in -lXext" >&5
+echo "configure:3259: 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 3256 "configure"
+#line 3267 "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:3267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
echo $ac_n "checking for XScreenSaverRegister in -lXExExt""... $ac_c" 1>&6
-echo "configure:3318: checking for XScreenSaverRegister in -lXExExt" >&5
+echo "configure:3329: 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 3326 "configure"
+#line 3337 "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:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
echo $ac_n "checking for XScreenSaverRegister in -lXss""... $ac_c" 1>&6
-echo "configure:3383: checking for XScreenSaverRegister in -lXss" >&5
+echo "configure:3394: 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 3391 "configure"
+#line 3402 "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:3402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/xidle.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/xidle.h""... $ac_c" 1>&6
-echo "configure:3463: checking for X11/extensions/xidle.h" >&5
+echo "configure:3474: 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 3468 "configure"
+#line 3479 "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:3473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3484: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/XShm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/XShm.h""... $ac_c" 1>&6
-echo "configure:3528: checking for X11/extensions/XShm.h" >&5
+echo "configure:3539: 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 3533 "configure"
+#line 3544 "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:3538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:3572: checking for sys/ipc.h" >&5
+echo "configure:3583: 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 3577 "configure"
+#line 3588 "configure"
#include "confdefs.h"
#include <sys/ipc.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3593: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "sys/shm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/shm.h""... $ac_c" 1>&6
-echo "configure:3617: checking for sys/shm.h" >&5
+echo "configure:3628: 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 3622 "configure"
+#line 3633 "configure"
#include "confdefs.h"
#include <sys/shm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$ac_save_CPPFLAGS"
fi
+ # AIX is pathological, as usual: apparently it's normal for the Xshm headers
+ # to exist, but the library code to not exist. And even better, the library
+ # code is in its own library: libXextSam.a. So, if we're on AIX, and that
+ # lib doesn't exist, give up.
+ #
+ case "$host" in
+ *-aix*)
+ have_xshm=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ if test \! -z "$x_libraries" ; then
+ LDFLAGS="$LDFLAGS -L$x_libraries"
+ fi
+ echo $ac_n "checking for XShmQueryExtension in -lXextSam""... $ac_c" 1>&6
+echo "configure:3687: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXextSam -lX11 -lXext -lm $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3695 "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
+ builtin and then its argument prototype would still apply. */
+char XShmQueryExtension();
+
+int main() {
+XShmQueryExtension()
+; return 0; }
+EOF
+if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_xshm=yes; SAVER_LIBS="$SAVER_LIBS -lXextSam"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+ ;;
+ esac
+
# if that succeeded, then we've really got it.
if test $have_xshm = yes; then
cat >> confdefs.h <<\EOF
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:3688: checking for X11/extensions/XSGIvc.h" >&5
+echo "configure:3768: 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 3693 "configure"
+#line 3773 "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:3698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
echo $ac_n "checking for XSGIvcQueryGammaMap in -lXsgivc""... $ac_c" 1>&6
-echo "configure:3741: checking for XSGIvcQueryGammaMap in -lXsgivc" >&5
+echo "configure:3821: 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 3749 "configure"
+#line 3829 "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:3760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
+# Check for the DPMS server extension header.
+#
+have_dpms=no
+with_dpms_req=unspecified
+# Check whether --with-dpms-ext or --without-dpms-ext was given.
+if test "${with_dpms_ext+set}" = set; then
+ withval="$with_dpms_ext"
+ with_dpms="$withval"; with_dpms_req="$withval"
+else
+ with_dpms=yes
+fi
+
+if test $with_dpms = yes; then
+
+ # first check for dpms.h
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ 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:3901: 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 3906 "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:3911: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_dpms=yes
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ # if that succeeded, then check for the -lXdpms
+ if test $have_dpms = yes; then
+ have_dpms=no
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ if test \! -z "$x_libraries" ; then
+ LDFLAGS="$LDFLAGS -L$x_libraries"
+ fi
+ echo $ac_n "checking for DPMSInfo in -lXdpms""... $ac_c" 1>&6
+echo "configure:3954: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXdpms -lXext -lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3962 "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
+ builtin and then its argument prototype would still apply. */
+char DPMSInfo();
+
+int main() {
+DPMSInfo()
+; return 0; }
+EOF
+if { (eval echo configure:3973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+ fi
+ # if that succeeded, then we've really got it.
+ if test $have_dpms = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_DPMS_EXTENSION 1
+EOF
+ fi
+elif test $with_dpms != no; then
+ echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
+ exit 1
+fi
#
have_motif=no
have_athena=no
+have_athena3d=no
with_motif_req=unspecified
with_athena_req=unspecified
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:3863: checking for Xm/Xm.h" >&5
+echo "configure:4072: 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 3868 "configure"
+#line 4077 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3873: \"$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`
if test -z "$ac_err"; then
rm -rf conftest*
}
check_athena() {
+ have_athena=no
+ have_athena3d=no
ac_save_CPPFLAGS="$CPPFLAGS"
if test \! -z "$includedir" ; then
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:3911: checking for X11/Xaw/Dialog.h" >&5
+echo "configure:4122: 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 3916 "configure"
+#line 4127 "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:3921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4132: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
have_athena=yes
- cat >> confdefs.h <<\EOF
-#define HAVE_ATHENA 1
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LDFLAGS="$LDFLAGS"
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$includedir" ; then
+ CPPFLAGS="$CPPFLAGS -I$includedir"
+ fi
+ if test \! -z "$libdir" ; then
+ LDFLAGS="$LDFLAGS -L$libdir"
+ fi
+ CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ if test \! -z "$x_libraries" ; then
+ LDFLAGS="$LDFLAGS -L$x_libraries"
+ fi
+ echo $ac_n "checking for Xaw3dComputeTopShadowRGB in -lXaw3d""... $ac_c" 1>&6
+echo "configure:4171: 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
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lXaw3d -lXt -lXmu -lXext -lX11 $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4179 "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
+ builtin and then its argument prototype would still apply. */
+char Xaw3dComputeTopShadowRGB();
+
+int main() {
+Xaw3dComputeTopShadowRGB()
+; return 0; }
EOF
+if { (eval echo configure:4190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
- SAVER_LIBS="-lXaw $SAVER_LIBS"
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ have_athena=yes; have_athena3d=yes
else
echo "$ac_t""no" 1>&6
fi
CPPFLAGS="$ac_save_CPPFLAGS"
+ LDFLAGS="$ac_save_LDFLAGS"
+
+ if test $have_athena3d = yes; then
+ SAVER_LIBS="-lXaw3d $SAVER_LIBS"
+ elif test $have_athena = yes; then
+ SAVER_LIBS="-lXaw $SAVER_LIBS"
+ fi
}
# XawViewportSetCoordinates in Viewport.h (R3 (or R4?) don't.)
if test $have_athena = yes ; then
echo $ac_n "checking for XawViewportSetCoordinates in Viewport.h""... $ac_c" 1>&6
-echo "configure:3996: checking for XawViewportSetCoordinates in Viewport.h" >&5
+echo "configure:4266: 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 4008 "configure"
+#line 4278 "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:4037: checking whether Motif is really LessTif" >&5
+echo "configure:4307: 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 4048 "configure"
+#line 4318 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() {
long vers = LesstifVersion;
; return 0; }
EOF
-if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_have_lesstif=yes
else
# It must be at least "GNU Lesstif 0.82".
# #### If you change this, also sync the warning message lower down.
echo $ac_n "checking whether LessTif is of a recent enough vintage""... $ac_c" 1>&6
-echo "configure:4080: checking whether LessTif is of a recent enough vintage" >&5
+echo "configure:4350: checking whether LessTif is of a recent enough vintage" >&5
if eval "test \"`echo '$''{'ac_cv_good_lesstif'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_good_lesstif=yes
else
cat > conftest.$ac_ext <<EOF
-#line 4095 "configure"
+#line 4365 "configure"
#include "confdefs.h"
#include <Xm/Xm.h>
int main() { exit(LesstifVersion < 82); }
EOF
-if { (eval echo configure:4100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_good_lesstif=yes
else
LDFLAGS="$LDFLAGS -L$x_libraries"
fi
echo $ac_n "checking for XpQueryExtension in -lXp""... $ac_c" 1>&6
-echo "configure:4144: checking for XpQueryExtension in -lXp" >&5
+echo "configure:4414: 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 4152 "configure"
+#line 4422 "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:4163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/xpm.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/xpm.h""... $ac_c" 1>&6
-echo "configure:4209: checking for X11/xpm.h" >&5
+echo "configure:4479: 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 4214 "configure"
+#line 4484 "configure"
#include "confdefs.h"
#include <X11/xpm.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/gl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/gl.h""... $ac_c" 1>&6
-echo "configure:4274: checking for GL/gl.h" >&5
+echo "configure:4544: 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 4279 "configure"
+#line 4549 "configure"
#include "confdefs.h"
#include <GL/gl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4284: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "GL/glx.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for GL/glx.h""... $ac_c" 1>&6
-echo "configure:4315: checking for GL/glx.h" >&5
+echo "configure:4585: 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 4320 "configure"
+#line 4590 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
fi
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
cat > conftest.$ac_ext <<EOF
-#line 4365 "configure"
+#line 4635 "configure"
#include "confdefs.h"
#include <GL/glx.h>
EOF
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "X11/extensions/readdisplay.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for X11/extensions/readdisplay.h""... $ac_c" 1>&6
-echo "configure:4415: checking for X11/extensions/readdisplay.h" >&5
+echo "configure:4685: 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 4420 "configure"
+#line 4690 "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:4425: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
ac_safe=`echo "dmedia/vl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dmedia/vl.h""... $ac_c" 1>&6
-echo "configure:4477: checking for dmedia/vl.h" >&5
+echo "configure:4747: 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 4482 "configure"
+#line 4752 "configure"
#include "confdefs.h"
#include <dmedia/vl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4487: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
if test $have_sgivideo = yes; then
have_sgivideo=no
echo $ac_n "checking for vlOpenVideo in -lvl""... $ac_c" 1>&6
-echo "configure:4512: checking for vlOpenVideo in -lvl" >&5
+echo "configure:4782: 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 4520 "configure"
+#line 4790 "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:4531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
case "$with_zippy_req" in
/*)
echo $ac_n "checking for $with_zippy_req""... $ac_c" 1>&6
-echo "configure:4599: checking for $with_zippy_req" >&5
+echo "configure:4869: 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:4613: checking for $ac_word" >&5
+echo "configure:4883: 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:4659: checking for $ac_word" >&5
+echo "configure:4929: 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:4692: checking for $ac_word" >&5
+echo "configure:4962: 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:4726: checking for emacs yow" >&5
+echo "configure:4996: 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:4748: checking for xemacs yow" >&5
+echo "configure:5018: checking for xemacs yow" >&5
if test -n "$xemacs_exe" ; then
#
# get xemacs to tell us where the libexec directory is.
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4794: checking for $ac_word" >&5
+echo "configure:5064: 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:4829: checking for $ac_word" >&5
+echo "configure:5099: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_fortune'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $with_kerberos = yes; then
echo $ac_n "checking for Kerberos""... $ac_c" 1>&6
-echo "configure:4908: checking for Kerberos" >&5
+echo "configure:5178: 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 4919 "configure"
+#line 5189 "configure"
#include "confdefs.h"
#include <krb.h>
int main() {
; return 0; }
EOF
-if { (eval echo configure:4926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_kerberos=yes
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for Sun-style shadow passwords""... $ac_c" 1>&6
-echo "configure:4976: checking for Sun-style shadow passwords" >&5
+echo "configure:5246: 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 4987 "configure"
+#line 5257 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pwa_passwd;
; return 0; }
EOF
-if { (eval echo configure:5000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sun_adjunct=yes
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for DEC-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5029: checking for DEC-style shadow passwords" >&5
+echo "configure:5299: 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 5040 "configure"
+#line 5310 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
pw = p->ufld.fd_encrypt;
; return 0; }
EOF
-if { (eval echo configure:5057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5327: \"$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:5083: checking for getprpwnam in -lprot" >&5
+echo "configure:5353: 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 5091 "configure"
+#line 5361 "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:5102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "$ac_t""no" 1>&6
# On DEC, getprpwnam() is in -lsecurity
echo $ac_n "checking for getprpwnam in -lsecurity""... $ac_c" 1>&6
-echo "configure:5122: checking for getprpwnam in -lsecurity" >&5
+echo "configure:5392: 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 5130 "configure"
+#line 5400 "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:5141: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for HP-style shadow passwords""... $ac_c" 1>&6
-echo "configure:5170: checking for HP-style shadow passwords" >&5
+echo "configure:5440: 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 5181 "configure"
+#line 5451 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->pw_passwd;
; return 0; }
EOF
-if { (eval echo configure:5194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5464: \"$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:5219: checking for bigcrypt in -lsec" >&5
+echo "configure:5489: 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 5227 "configure"
+#line 5497 "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:5238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
#
if test $passwd_cruft_done = no ; then
echo $ac_n "checking for generic shadow passwords""... $ac_c" 1>&6
-echo "configure:5265: checking for generic shadow passwords" >&5
+echo "configure:5535: 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 5276 "configure"
+#line 5546 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <unistd.h>
const char *pw = p->sp_pwdp;
; return 0; }
EOF
-if { (eval echo configure:5288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5558: \"$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:5314: checking for getspnam in -lc" >&5
+echo "configure:5584: 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 5322 "configure"
+#line 5592 "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:5333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $have_getspnam = no ; then
echo $ac_n "checking for getspnam in -lgen""... $ac_c" 1>&6
-echo "configure:5355: checking for getspnam in -lgen" >&5
+echo "configure:5625: 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 5363 "configure"
+#line 5633 "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:5374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
fi
fi
+ # On FreeBSD, getpwnam() and friends work just like on non-shadow-password
+ # systems -- except you only get stuff in the pw_passwd field if the running
+ # program is setuid. So, guess that we've got this lossage to contend with
+ # if /etc/master.passwd exists, and default to a setuid installation.
+ #
+ if test $passwd_cruft_done = no ; then
+ echo $ac_n "checking for FreeBSD-style shadow passwords""... $ac_c" 1>&6
+echo "configure:5675: 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
+ if test -f /etc/master.passwd ; then
+ ac_cv_master_passwd=yes
+ else
+ ac_cv_master_passwd=no
+ fi
+fi
+
+echo "$ac_t""$ac_cv_master_passwd" 1>&6
+ if test $ac_cv_master_passwd = yes; then
+ need_setuid=yes
+ passwd_cruft_done=yes
+ fi
+ fi
+
# On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
have_crypt=no
echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
-echo "configure:5401: checking for crypt in -lc" >&5
+echo "configure:5696: 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 5409 "configure"
+#line 5704 "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:5420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
if test $have_crypt = no ; then
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:5442: checking for crypt in -lcrypt" >&5
+echo "configure:5737: 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 5450 "configure"
+#line 5745 "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:5461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:5756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
DEPEND_DEFINES=
+# Autoconf doesn't seem to have an INSTALL_DIRS, so let's define our own...
+INSTALL_DIRS='$(INSTALL) -d'
# Done testing things -- now substitute in some stuff for the Makefiles.
#
+
# Print some warnings before emitting the Makefiles.
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
+if test $with_dpms_req = yes -a $have_dpms = no ; then
+ warn 'The DPMS extension was requested, but was not found.'
+fi
+
if test $have_motif = no -a $have_athena = no ; then
warnL "Neither Motif nor Athena widgets seem to be available;"
warn2 "one or the other is required."
s%@GL_LIBS@%$GL_LIBS%g
s%@PASSWD_LIBS@%$PASSWD_LIBS%g
s%@INSTALL_SETUID@%$INSTALL_SETUID%g
+s%@INSTALL_DIRS@%$INSTALL_DIRS%g
s%@NEED_SETUID@%$NEED_SETUID%g
s%@SGI_VIDEO_OBJS@%$SGI_VIDEO_OBJS%g
s%@SGI_VIDEO_LIBS@%$SGI_VIDEO_LIBS%g
rm -fr confdefs* $ac_clean_files
test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
+# You are in a twisty maze of namespaces and syntaxes, all alike.
+# Fuck the skull of Unix.
+#
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+
+echo ""
+echo "$warnsep"
+echo ""
+echo ' When you run "make install", the "xscreensaver" and'
+echo ' "xscreensaver-command" executables will be installed in'
+echo " ${bindir}."
+echo ""
+echo " The various graphics demos (60+ different executables) will"
+echo " be installed in ${HACKDIR}."
+echo ""
+echo " If you would prefer the demos to be installed elsewhere"
+echo " (for example, in a dedicated directory) you should re-run"
+echo " configure with the --enable-subdir=DIR option. For more"
+echo " information, run $0 --help."
+echo ""
+echo "$warnsep"
+echo ""
AC_CACHE_VAL(ac_cv_gettimeofday_args,
[AC_TRY_COMPILE([#include <stdlib.h>
#include <sys/time.h>],
- [struct timeval tv; gettimeofday(&tv);],
- [ac_gettimeofday_args=1],
+ [struct timeval tv; struct timezone tzp;
+ gettimeofday(&tv, &tzp);],
+ [ac_gettimeofday_args=2],
[AC_TRY_COMPILE([#include <stdlib.h>
#include <sys/time.h>],
- [struct timeval tv; struct timezone tzp;
- gettimeofday(&tv, &tzp);],
- [ac_gettimeofday_args=2],
+ [struct timeval tv; gettimeofday(&tv);],
+ [ac_gettimeofday_args=1],
[ac_gettimeofday_args=0])])
ac_cv_gettimeofday_args=$ac_gettimeofday_args])
ac_gettimeofday_args=$ac_cv_gettimeofday_args
],
[enable_subdir="$enableval"],[enable_subdir=no])
if test x"$enable_subdir" = xno; then
- HACKDIR='$(bindir)'
+ HACKDIR='${bindir}'
elif test x"$enable_subdir" = xyes -o x"$enable_subdir" = x ; then
echo "error: must be a subdirectory name: --enable-subdir=$enable_subdir"
exit 1
else
- HACKDIR='$(bindir)/'$enable_subdir
+ # there must be a better way than this...
+ if test -z "`echo $enable_subdir | sed 's@^/.*@@'`" ; then
+ # absolute path
+ HACKDIR=$enable_subdir
+ else
+ # relative path
+ HACKDIR='${bindir}/'$enable_subdir
+ fi
fi
fi
+# Check for the DPMS server extension header.
+#
+have_dpms=no
+with_dpms_req=unspecified
+AC_ARG_WITH(dpms-ext,
+[ --with-dpms-ext Include support for the DPMS server extension,
+ if possible (this is the default).
+ --without-dpms-ext Do not compile in support for this extension.],
+ [with_dpms="$withval"; with_dpms_req="$withval"],[with_dpms=yes])
+if test $with_dpms = yes; then
+
+ # first check for dpms.h
+ AC_CHECK_X_HEADER(X11/extensions/dpms.h, [have_dpms=yes])
+
+ # if that succeeded, then check for the -lXdpms
+ if test $have_dpms = yes; then
+ have_dpms=no
+ AC_CHECK_X_LIB(Xdpms, DPMSInfo,
+ [have_dpms=yes; SAVER_LIBS="$SAVER_LIBS -lXdpms"], [],
+ -lXext -lX11)
+ fi
+ # if that succeeded, then we've really got it.
+ if test $have_dpms = yes; then
+ AC_DEFINE(HAVE_DPMS_EXTENSION)
+ fi
-
+elif test $with_dpms != no; then
+ echo "error: must be yes or no: --with-dpms-ext=$with_dpms"
+ exit 1
+fi
#
have_motif=no
have_athena=no
+have_athena3d=no
with_motif_req=unspecified
with_athena_req=unspecified
}
check_athena() {
- AC_CHECK_X_HEADER(X11/Xaw/Dialog.h,
- [have_athena=yes
- AC_DEFINE(HAVE_ATHENA)
- SAVER_LIBS="-lXaw $SAVER_LIBS"])
+ have_athena=no
+ have_athena3d=no
+ AC_CHECK_X_HEADER(X11/Xaw/Dialog.h, [have_athena=yes])
+ AC_CHECK_X_LIB(Xaw3d, Xaw3dComputeTopShadowRGB,
+ [have_athena=yes; have_athena3d=yes], [],
+ -lXt -lXmu -lXext -lX11)
+
+ if test $have_athena3d = yes; then
+ SAVER_LIBS="-lXaw3d $SAVER_LIBS"
+ elif test $have_athena = yes; then
+ SAVER_LIBS="-lXaw $SAVER_LIBS"
+ fi
}
fi
fi
+ # On FreeBSD, getpwnam() and friends work just like on non-shadow-password
+ # systems -- except you only get stuff in the pw_passwd field if the running
+ # program is setuid. So, guess that we've got this lossage to contend with
+ # if /etc/master.passwd exists, and default to a setuid installation.
+ #
+ if test $passwd_cruft_done = no ; then
+ AC_CACHE_CHECK([for FreeBSD-style shadow passwords], ac_cv_master_passwd,
+ [if test -f /etc/master.passwd ; then
+ ac_cv_master_passwd=yes
+ else
+ ac_cv_master_passwd=no
+ fi])
+ if test $ac_cv_master_passwd = yes; then
+ need_setuid=yes
+ passwd_cruft_done=yes
+ fi
+ fi
+
# On some systems (UnixWare 2.1), crypt() is in -lcrypt instead of -lc.
have_crypt=no
AC_CHECK_LIB(c, crypt, [have_crypt=yes])
DEPEND_DEFINES=
+# Autoconf doesn't seem to have an INSTALL_DIRS, so let's define our own...
+INSTALL_DIRS='$(INSTALL) -d'
# Done testing things -- now substitute in some stuff for the Makefiles.
#
AC_SUBST(GL_LIBS)
AC_SUBST(PASSWD_LIBS)
AC_SUBST(INSTALL_SETUID)
+AC_SUBST(INSTALL_DIRS)
AC_SUBST(NEED_SETUID)
AC_SUBST(SGI_VIDEO_OBJS)
AC_SUBST(SGI_VIDEO_LIBS)
warn 'The SGI-VIDEO-CONTROL extension was requested, but was not found.'
fi
+if test $with_dpms_req = yes -a $have_dpms = no ; then
+ warn 'The DPMS extension was requested, but was not found.'
+fi
+
if test $have_motif = no -a $have_athena = no ; then
warnL "Neither Motif nor Athena widgets seem to be available;"
warn2 "one or the other is required."
hacks/Makefile
hacks/glx/Makefile
driver/XScreenSaver.ad)
+
+# You are in a twisty maze of namespaces and syntaxes, all alike.
+# Fuck the skull of Unix.
+#
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval bindir=${bindir}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+eval HACKDIR=${HACKDIR}
+
+echo ""
+echo "$warnsep"
+echo ""
+echo ' When you run "make install", the "xscreensaver" and'
+echo ' "xscreensaver-command" executables will be installed in'
+echo " ${bindir}."
+echo ""
+echo " The various graphics demos (60+ different executables) will"
+echo " be installed in ${HACKDIR}."
+echo ""
+echo " If you would prefer the demos to be installed elsewhere"
+echo " (for example, in a dedicated directory) you should re-run"
+echo " configure with the --enable-subdir=DIR option. For more"
+echo " information, run $0 --help."
+echo ""
+echo "$warnsep"
+echo ""
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
DEFS = @DEFS@
+DEFS2 = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
LIBS = @LIBS@
DEPEND = @DEPEND@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SETUID = @INSTALL_SETUID@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_DIRS = @INSTALL_DIRS@
X_CFLAGS = @X_CFLAGS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
-XLIBS = $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
+# Note:
+#
+# X_LIBS would more properly be called X_LDFLAGS (it contains the -L args.)
+# X_PRE_LIBS contains extra libraries you have to link against on some systems,
+# and that must come before -lX11. (e.g., -lSM and -lICE.)
+# X_EXTRA_LIBS contains extra libraries needed by X that aren't a part of X.
+# (e.g., -lsocket, -lnsl, etc.)
+#
+XLIBS = $(X_LIBS) $(X_PRE_LIBS) -lX11 -lXext $(X_EXTRA_LIBS)
+XTLIBS = $(X_LIBS) $(X_PRE_LIBS) -lXt -lX11 -lXext $(X_EXTRA_LIBS)
AD_DIR = @APPDEFAULTS@
SAVER_SRCS = $(SAVER_SRCS_1) $(DIALOG_SRCS) $(LOCK_SRCS) $(UTIL_SRCS)
SAVER_OBJS = $(SAVER_OBJS_1) $(DIALOG_OBJS) $(LOCK_OBJS) $(UTIL_OBJS)
-SAVER_LIBS = $(X_LIBS) @SAVER_LIBS@ -lXt $(XLIBS) $(PASSWD_LIBS) $(LIBS)
+SAVER_LIBS = @SAVER_LIBS@ -lXt $(XTLIBS) $(PASSWD_LIBS) $(LIBS)
CMD_SRCS = xscreensaver-command.c
CMD_OBJS = xscreensaver-command.o
-CMD_LIBS = $(X_LIBS) $(XLIBS) $(LIBS)
+CMD_LIBS = $(XLIBS) $(LIBS)
EXES = xscreensaver xscreensaver-command
$$e "" ;\
fi ; \
fi ; \
+ if [ ! -d $(bindir) ]; then $(INSTALL_DIRS) $(bindir) ; fi ; \
echo $$inst xscreensaver $(bindir)/xscreensaver ; \
$$inst xscreensaver $(bindir)/xscreensaver
$(INSTALL_PROGRAM) xscreensaver-command $(bindir)/xscreensaver-command
install-ad:
+ @if [ ! -d $(AD_DIR) ]; then $(INSTALL_DIRS) $(AD_DIR) ; fi ; \
$(INSTALL_DATA) XScreenSaver.ad $(AD_DIR)/XScreenSaver
install-man:
@men="$(MEN)" ; \
+ if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
# How we build object files in this directory.
.c.o:
- $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
+ $(CC) -c $(INCLUDES) $(DEFS) $(CFLAGS) $(X_CFLAGS) $<
+
+# subprocs is the only one that takes an extra -D option.
+subprocs.o: subprocs.c
+ $(CC) -c $(INCLUDES) $(DEFS2) $(CFLAGS) $(X_CFLAGS) $<
# How we build the default app-defaults file into the program.
! a screen saver and locker for the X window system
! by Jamie Zawinski
!
-! version 2.21
-! 15-Jun-98
+! version 2.23
+! 21-Jun-98
!
! See "man xscreensaver" for more info. The latest version is always
! available at http://people.netscape.com/jwz/xscreensaver/
*captureStderr: True
*captureStdout: True
-*overlayTextForeground: Yellow
-*overlayTextBackground: Black
+*overlayTextForeground: #FFFF00
+*overlayTextBackground: #000000
*overlayStderr: True
*font: *-medium-r-*-140-*-m-*
interference -root \n\
truchet -root -randomize \n\
bsod -root \n\
+ crystal -root \n\
+ discrete -root \n\
\
mono: rocks -root \n\
color: rocks -root -fg darksalmon \n\
XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
! Need to fully-qualify the preceeding in the case of of *sgiMode.
-*XmDialogShell*foreground: black
-*XmDialogShell*background: gray90
-*XmDialogShell*XmTextField.foreground: black
-*XmDialogShell*XmTextField.background: white
-*XmDialogShell*demoList.foreground: black
-*XmDialogShell*demoList.background: white
+*XmDialogShell*foreground: #000000
+*XmDialogShell*background: #E5E5E5
+*XmDialogShell*XmTextField.foreground: #000000
+*XmDialogShell*XmTextField.background: #FFFFFF
+*XmDialogShell*demoList.foreground: #000000
+*XmDialogShell*demoList.background: #FFFFFF
! Need to fully-qualify the following in the case of of *sgiMode.
-XScreenSaver*XmDialogShell*rogerLabel.foreground: red3
-XScreenSaver*XmDialogShell*rogerLabel.background: white
+XScreenSaver*XmDialogShell*rogerLabel.foreground: #CD0000
+XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF
*XmDialogShell.title: XScreenSaver
*allowShellResize: True
*fadeToggle.labelString: Fade Colormap
*unfadeToggle.labelString: Unfade Colormap
*lockToggle.labelString: Require Password
-*resourcesDone.labelString: Done
+*resourcesDone.labelString: OK
*resourcesCancel.labelString: Cancel
*passwdDialog.title: Password
*passwdLabel1.labelString: XScreenSaver %s
*passwdLabel2.labelString: This display is locked.
*passwdLabel3.labelString: Please type %s's password to unlock it.
-*passwdDone.labelString: Done
+*passwdDone.labelString: OK
*passwdCancel.labelString: Cancel
*passwdLabel1.alignment: ALIGNMENT_BEGINNING
*passwd_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1
*demo_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
*resources_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1
-*demo_dialog*List.font: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
+XScreenSaver.demo_dialog*List.font: \
+ *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1
! This is a hack to make the typed password invisible.
! Surely someone can do better than this...
-*passwd_dialog*passwd_form.value*font: *nil*
+XScreenSaver.passwd_dialog*passwd_form.value*font: *nil*
-*demo_dialog*foreground: black
-*demo_dialog*background: gray90
-*demo_dialog*List.background: white
-*demo_dialog*Scrollbar.background: gray85
-*demo_dialog*Command.background: gray85
+XScreenSaver.demo_dialog*foreground: #000000
+XScreenSaver.demo_dialog*background: #E5E5E5
+XScreenSaver.demo_dialog*List.background: #FFFFFF
+XScreenSaver.demo_dialog*Scrollbar.background: #D9D9D9
+XScreenSaver.demo_dialog*Command.background: #D9D9D9
-*resources_dialog*foreground: black
-*resources_dialog*background: gray90
-*resources_dialog*Command.background: gray85
-*resources_dialog*Toggle.background: gray85
-*resources_dialog*Text*background: white
+XScreenSaver.resources_dialog*foreground: #000000
+XScreenSaver.resources_dialog*background: #E5E5E5
+XScreenSaver.resources_dialog*Command.background: #D9D9D9
+XScreenSaver.resources_dialog*Toggle.background: #D9D9D9
+XScreenSaver.resources_dialog*Text*background: #FFFFFF
*resources_dialog*Dialog.value.translations: #override\n\
<Key>Return: beginning-of-line()\n
-*passwd_dialog*foreground: black
-*passwd_dialog*background: gray90
-*passwd_dialog*Text*background: white
+XScreenSaver.passwd_dialog*foreground: #000000
+XScreenSaver.passwd_dialog*background: #E5E5E5
+XScreenSaver.passwd_dialog*Command.background: #D9D9D9
+XScreenSaver.passwd_dialog*Text*background: #FFFFFF
+XScreenSaver.passwd_dialog*roger.foreground: #CD0000
+XScreenSaver.passwd_dialog*roger.background: #FFFFFF
*demo_dialog*viewport.width: 400
*demo_dialog*viewport.height: 200
*resources_dialog*buttonbox.fade.label: Fade Colormap
*resources_dialog*buttonbox.unfade.label: Unfade Colormap
*resources_dialog*buttonbox.lock.label: Require Password
-*resources_dialog*done.label: Done
+*resources_dialog*done.label: OK
*resources_dialog*cancel.label: Cancel
*passwd_dialog*label1.label: XScreenSaver %s
*passwd_dialog*label2.label: This display is locked.
*passwd_dialog*label3.label: Please type %s's password to unlock it.
-*passwd_dialog*ok.label: Done
+*passwd_dialog*ok.label: OK
*passwd_dialog*cancel.label: Cancel
*passwd_dialog*passwd_form*label.label: Enter password:
*passwd_dialog*Dialog.label: Enter password:
*passwd_dialog*passwd_form*Text.width: 200
*passwd_dialog*roger.width: 150
*passwd_dialog*roger.height: 150
-*passwd_dialog*roger.foreground: red3
-*passwd_dialog*roger.background: white
*passwd_dialog*roger.borderWidth: 1
"*fadeTicks: 20",
"*captureStderr: True",
"*captureStdout: True",
-"*overlayTextForeground: Yellow",
-"*overlayTextBackground: Black",
+"*overlayTextForeground: #FFFF00",
+"*overlayTextBackground: #000000",
"*overlayStderr: True",
"*font: *-medium-r-*-140-*-m-*",
"*installColormap: True",
interference -root \\n\
truchet -root -randomize \\n\
bsod -root \\n\
+ crystal -root \\n\
+ discrete -root \\n\
\
mono: rocks -root \\n\
color: rocks -root -fg darksalmon \\n\
"*XmTextField.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
"*passwdDialog.passwdText.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
"XScreenSaver*XmList.fontList: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*XmDialogShell*foreground: black",
-"*XmDialogShell*background: gray90",
-"*XmDialogShell*XmTextField.foreground: black",
-"*XmDialogShell*XmTextField.background: white",
-"*XmDialogShell*demoList.foreground: black",
-"*XmDialogShell*demoList.background: white",
-"XScreenSaver*XmDialogShell*rogerLabel.foreground: red3",
-"XScreenSaver*XmDialogShell*rogerLabel.background: white",
+"*XmDialogShell*foreground: #000000",
+"*XmDialogShell*background: #E5E5E5",
+"*XmDialogShell*XmTextField.foreground: #000000",
+"*XmDialogShell*XmTextField.background: #FFFFFF",
+"*XmDialogShell*demoList.foreground: #000000",
+"*XmDialogShell*demoList.background: #FFFFFF",
+"XScreenSaver*XmDialogShell*rogerLabel.foreground: #CD0000",
+"XScreenSaver*XmDialogShell*rogerLabel.background: #FFFFFF",
"*XmDialogShell.title: XScreenSaver",
"*allowShellResize: True",
"*autoUnmanage: False",
"*fadeToggle.labelString: Fade Colormap",
"*unfadeToggle.labelString: Unfade Colormap",
"*lockToggle.labelString: Require Password",
-"*resourcesDone.labelString: Done",
+"*resourcesDone.labelString: OK",
"*resourcesCancel.labelString: Cancel",
"*passwdDialog.title: Password",
"*passwdLabel1.labelString: XScreenSaver %s",
"*passwdLabel2.labelString: This display is locked.",
"*passwdLabel3.labelString: Please type %s's password to unlock it.",
-"*passwdDone.labelString: Done",
+"*passwdDone.labelString: OK",
"*passwdCancel.labelString: Cancel",
"*passwdLabel1.alignment: ALIGNMENT_BEGINNING",
"*passwdLabel2.alignment: ALIGNMENT_BEGINNING",
"*passwd_dialog*font: *-helvetica-bold-r-*-*-*-120-*-*-*-iso8859-1",
"*demo_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
"*resources_dialog*label1.font: *-helvetica-bold-r-*-*-*-140-*-*-*-iso8859-1",
-"*demo_dialog*List.font: *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
-"*passwd_dialog*passwd_form.value*font: *nil*",
-"*demo_dialog*foreground: black",
-"*demo_dialog*background: gray90",
-"*demo_dialog*List.background: white",
-"*demo_dialog*Scrollbar.background: gray85",
-"*demo_dialog*Command.background: gray85",
-"*resources_dialog*foreground: black",
-"*resources_dialog*background: gray90",
-"*resources_dialog*Command.background: gray85",
-"*resources_dialog*Toggle.background: gray85",
-"*resources_dialog*Text*background: white",
+"XScreenSaver.demo_dialog*List.font: \
+ *-courier-medium-r-*-*-*-120-*-*-*-iso8859-1",
+"XScreenSaver.passwd_dialog*passwd_form.value*font: *nil*",
+"XScreenSaver.demo_dialog*foreground: #000000",
+"XScreenSaver.demo_dialog*background: #E5E5E5",
+"XScreenSaver.demo_dialog*List.background: #FFFFFF",
+"XScreenSaver.demo_dialog*Scrollbar.background: #D9D9D9",
+"XScreenSaver.demo_dialog*Command.background: #D9D9D9",
+"XScreenSaver.resources_dialog*foreground: #000000",
+"XScreenSaver.resources_dialog*background: #E5E5E5",
+"XScreenSaver.resources_dialog*Command.background: #D9D9D9",
+"XScreenSaver.resources_dialog*Toggle.background: #D9D9D9",
+"XScreenSaver.resources_dialog*Text*background: #FFFFFF",
"*resources_dialog*Dialog.value.translations: #override\\n\
<Key>Return: beginning-of-line()\\n",
-"*passwd_dialog*foreground: black",
-"*passwd_dialog*background: gray90",
-"*passwd_dialog*Text*background: white",
+"XScreenSaver.passwd_dialog*foreground: #000000",
+"XScreenSaver.passwd_dialog*background: #E5E5E5",
+"XScreenSaver.passwd_dialog*Command.background: #D9D9D9",
+"XScreenSaver.passwd_dialog*Text*background: #FFFFFF",
+"XScreenSaver.passwd_dialog*roger.foreground: #CD0000",
+"XScreenSaver.passwd_dialog*roger.background: #FFFFFF",
"*demo_dialog*viewport.width: 400",
"*demo_dialog*viewport.height: 200",
"*Form.borderWidth: 0",
"*resources_dialog*buttonbox.fade.label: Fade Colormap",
"*resources_dialog*buttonbox.unfade.label: Unfade Colormap",
"*resources_dialog*buttonbox.lock.label: Require Password",
-"*resources_dialog*done.label: Done",
+"*resources_dialog*done.label: OK",
"*resources_dialog*cancel.label: Cancel",
"*passwd_dialog*label1.label: XScreenSaver %s",
"*passwd_dialog*label2.label: This display is locked.",
"*passwd_dialog*label3.label: Please type %s's password to unlock it.",
-"*passwd_dialog*ok.label: Done",
+"*passwd_dialog*ok.label: OK",
"*passwd_dialog*cancel.label: Cancel",
"*passwd_dialog*passwd_form*label.label: Enter password:",
"*passwd_dialog*Dialog.label: Enter password:",
"*passwd_dialog*passwd_form*Text.width: 200",
"*passwd_dialog*roger.width: 150",
"*passwd_dialog*roger.height: 150",
-"*passwd_dialog*roger.foreground: red3",
-"*passwd_dialog*roger.background: white",
"*passwd_dialog*roger.borderWidth: 1",
"XScreenSaver.pointerPollTime: 5",
"XScreenSaver.initialDelay: 0",
/* demo.c --- implements the interactive demo-mode and options dialogs.
- * xscreensaver, Copyright (c) 1993-1997 Jamie Zawinski <jwz@netscape.com>
+ * xscreensaver, Copyright (c) 1993-1998 Jamie Zawinski <jwz@netscape.com>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#endif /* HAVE_ATHENA */
+ monitor_power_on (si);
pop_up_dialog_box(demo_dialog, demo_form,
/* for debugging -- don't ask */
(si->prefs.debug_p ? 69 : 0) +
set_toggle_button_state (unfade_toggle, res.unfade);
set_toggle_button_state (lock_toggle, res.lock_p);
+ monitor_power_on (si);
pop_up_dialog_box (resources_dialog, resources_form,
/* for debugging -- don't ask */
(si->prefs.debug_p ? 69 : 0) +
{
saver_preferences *p = &si->prefs;
si->dbox_up_p = True;
+ monitor_power_on (si);
raise_window (si, True, False, False);
make_screenhack_dialog (si);
while (si->demo_mode_p)
XMapRaised (dpy, XtWindow (passwd_dialog));
#endif
+ monitor_power_on (si);
#ifdef HAVE_ATHENA
pop_up_athena_dialog_box (parent, passwd_text, passwd_dialog,
passwd_form, 2);
extern saver_info *global_si_kludge; /* I hate C so much... */
-static void hack_environment (saver_screen_info *ssi);
+static void hack_subproc_environment (saver_screen_info *ssi);
static void
case 0:
close (ConnectionNumber (si->dpy)); /* close display fd */
nice_subproc (p->nice_inferior); /* change process priority */
- hack_environment (ssi); /* set $DISPLAY */
+ hack_subproc_environment (ssi); /* set $DISPLAY */
exec_screenhack (si, hack); /* this does not return */
abort();
break;
spawn_screenhack (saver_info *si, Bool first_time_p)
{
int i;
+
+ if (!monitor_powered_on_p (si))
+ {
+ if (si->prefs.verbose_p)
+ printf ("%s: server reports that monitor has powered down; "
+ "not launching a new hack.\n", progname);
+ return;
+ }
+
for (i = 0; i < si->nscreens; i++)
{
saver_screen_info *ssi = &si->screens[i];
}
static void
-hack_environment (saver_screen_info *ssi)
+hack_subproc_environment (saver_screen_info *ssi)
{
/* Store $DISPLAY into the environment, so that the $DISPLAY variable that
the spawned processes inherit is correct. First, it must be on the same
#endif /* HAVE_PUTENV */
}
+
+void
+hack_environment (saver_info *si)
+{
+#if defined(HAVE_PUTENV) && defined(DEFAULT_PATH_PREFIX)
+ static const char *def_path = DEFAULT_PATH_PREFIX;
+ if (def_path && *def_path)
+ {
+ const char *opath = getenv("PATH");
+ char *npath = (char *) malloc(strlen(def_path) + strlen(opath) + 20);
+ strcpy (npath, "PATH=");
+ strcat (npath, def_path);
+ strcat (npath, ":");
+ strcat (npath, opath);
+
+ if (putenv (npath))
+ abort ();
+ }
+#endif /* HAVE_PUTENV && DEFAULT_PATH_PREFIX */
+}
+
+
\f
/* Change the uid/gid of the screensaver process, so that it is safe for it
to run setuid root (which it needs to do on some systems to read the
#endif /* DEBUG_TIMERS */
raise_window (si, True, True, running_p);
+
+ if (!monitor_powered_on_p (si))
+ {
+ if (si->prefs.verbose_p)
+ printf ("%s: server reports that monitor has powered down; "
+ "killing running hacks.\n", progname);
+ kill_screenhack (si);
+ }
}
}
}
saver_preferences *p = &si->prefs;
int i;
+ monitor_power_on (si);
+
store_activate_time (si, True);
reset_watchdog_timer (si, False);
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "15-Jun-98 (2.21)" "X Version 11"
+.TH XScreenSaver 1 "21-Jun-98 (2.23)" "X Version 11"
.SH NAME
xscreensaver-command - control a running xscreensaver process
.SH SYNOPSIS
#ifdef NO_LOCKING
si->locking_disabled_p = True;
si->nolock_reason = "not compiled with locking support";
-#else
+#else /* !NO_LOCKING */
si->locking_disabled_p = False;
-#ifdef SCO
+# ifdef SCO
set_auth_parameters(argc, argv);
-#endif
+# endif /* SCO */
if (! lock_init (argc, argv)) /* before hack_uid() for proper permissions */
{
si->locking_disabled_p = True;
si->nolock_reason = "error getting password";
}
-#endif
+#endif /* !NO_LOCKING */
#ifndef NO_SETUID
hack_uid (si);
-#endif
+#endif /* NO_SETUID */
progclass = "XScreenSaver";
if (ensure_no_screensaver_running (si->dpy, si->screens[i].screen))
exit (1);
+ hack_environment (si);
+
si->demo_mode_p = initial_demo_mode_p;
srandom ((int) time ((time_t *) 0));
extern Bool query_sgi_saver_extension (saver_info *);
#endif
+/* Display Power Management System (DPMS) interface. */
+extern Bool monitor_powered_on_p (saver_info *si);
+extern void monitor_power_on (saver_info *si);
+
/* =======================================================================
blanking
subprocs
======================================================================= */
+extern void hack_environment (saver_info *si);
extern void init_sigchld (void);
extern void spawn_screenhack (saver_info *si, Bool first_time_p);
extern void kill_screenhack (saver_info *si);
.if n .sp 1
.if t .sp .5
..
-.TH XScreenSaver 1 "15-Jun-98 (2.21)" "X Version 11"
+.TH XScreenSaver 1 "21-Jun-98 (2.23)" "X Version 11"
.SH NAME
xscreensaver - graphics hack and screen locker, launched when the user is idle
.SH SYNOPSIS
You can control a running screensaver process by using the
.BR xscreensaver\-command (1)
program (which see.)
+.SH POWER MANAGEMENT
+Modern X servers contain support to power down the monitor after an idle
+period. If the monitor has powered down, then \fIxscreensaver\fP will
+notice this, and will not waste CPU by drawing graphics demos on a black
+screen. An attempt will also be made to explicitly power the monitor
+back up as soon as user activity is detected.
+
+If your X server supports power management, then
+.BR xset (1)
+will accept a \fBdpms\fP option. So, if you wanted \fIxscreensaver\fP
+to activate after 5 minutes, but you wanted your monitor to power down
+after one hour (3600 seconds) you would do this:
+.EX
+xset dpms 3600
+.EE
+See the man page for the
+.BR xset (1)
+program for details. (Note that power management requires both software
+support in the X server, and hardware support in the monitor itself.)
.SH USING XDM(1)
You can run \fIxscreensaver\fP from your xdm session, so that the
screensaver will run even when nobody is logged in on the console.
.RS 4
.TP 3
\fB1: Switch off VUE's locker\fP
-Do this by turning off ``\fIScreen Saver and Screen Lock\fP'' in the
-Screen section of the Style Manager.
+Open the ``\fIStyle Manager\fP'' and select ``\fIScreen\fP.''
+Turn off ``\fIScreen Saver and Screen Lock\fP'' option.
+.TP 3
+\fB2: Make sure you have a Session\fP
+Next, go to the Style Manager's, ``\fIStartup\fP'' page.
+Click on ``\fISet Home Session\fP'' to create a session, then
+on ``\fIReturn to Home Session\fP'' to select this session each
+time you log in.
.TP 3
-\fB2: Edit vue.session\fP
+\fB3: Edit vue.session\fP
Edit the file \fI~/.vue/sessions/home/vue.session\fP and add to it
the line
.EX
.TP 3
\fB1. Create ~/.mwmrc (or ~/.twmrc or ...)\fP
If you don't have a \fI~/.mwmrc\fP file (or, on SGIs, a \fI~/.4Dwmrc\fP file;
-or, with TWM, a \fI~/.twmrc\fP file) then create one by making a copy of
+or, with twm, a \fI~/.twmrc\fP file) then create one by making a copy of
the \fI/usr/lib/X11/system.mwmrc\fP
file (or \fI/usr/lib/X11/twm/system.twmrc\fP, and so on.)
.TP 3
.BR X (1),
.BR xscreensaver\-command (1),
.BR xdm (1),
+.BR xset (1),
.BR ant (1),
.BR atlantis (1),
.BR attraction (1),
#endif /* HAVE_SGI_SAVER_EXTENSION */
\f
-/* Figuring out what the appropriate XSetScreenSaver() paramters are
+/* Figuring out what the appropriate XSetScreenSaver() parameters are
(one wouldn't expect this to be rocket science.)
*/
/* Turn off the server builtin saver if it is now running. */
XForceScreenSaver (si->dpy, ScreenSaverReset);
}
+
+\f
+/* Display Power Management System (DPMS.)
+
+ On XFree86 systems, "man xset" reports:
+
+ -dpms The -dpms option disables DPMS (Energy Star) features.
+ +dpms The +dpms option enables DPMS (Energy Star) features.
+
+ dpms flags...
+ The dpms option allows the DPMS (Energy Star)
+ parameters to be set. The option can take up to three
+ numerical values, or the `force' flag followed by a
+ DPMS state. The `force' flags forces the server to
+ immediately switch to the DPMS state specified. The
+ DPMS state can be one of `standby', `suspend', or
+ `off'. When numerical values are given, they set the
+ inactivity period before the three modes are activated.
+ The first value given is for the `standby' mode, the
+ second is for the `suspend' mode, and the third is for
+ the `off' mode. Setting these values implicitly
+ enables the DPMS features. A value of zero disables a
+ particular mode.
+
+ However, note that the implementation is more than a little bogus,
+ in that there is code in /usr/X11R6/lib/libXdpms.a to implement all
+ the usual server-extension-querying utilities -- but there are no
+ prototypes in any header file! Thus, the prototypes here. (The
+ stuff in X11/extensions/dpms.h and X11/extensions/dpmsstr.h define
+ the raw X protcol, they don't define the API to libXdpms.a.)
+ */
+
+#ifdef HAVE_DPMS_EXTENSION
+
+#include <X11/Xproto.h> /* for CARD16 */
+#include <X11/extensions/dpms.h>
+#include <X11/extensions/dpmsstr.h>
+
+extern Bool DPMSQueryExtension (Display *dpy, int *event_ret, int *error_ret);
+extern Bool DPMSCapable (Display *dpy);
+extern Status DPMSForceLevel (Display *dpy, CARD16 level);
+extern Status DPMSInfo (Display *dpy, CARD16 *power_level, BOOL *state);
+
+#if 0 /* others we don't use */
+extern Status DPMSGetVersion (Display *dpy, int *major_ret, int *minor_ret);
+extern Status DPMSSetTimeouts (Display *dpy,
+ CARD16 standby, CARD16 suspend, CARD16 off);
+extern Bool DPMSGetTimeouts (Display *dpy,
+ CARD16 *standby, CARD16 *suspend, CARD16 *off);
+extern Status DPMSEnable (Display *dpy);
+extern Status DPMSDisable (Display *dpy);
+#endif /* 0 */
+
+
+Bool
+monitor_powered_on_p (saver_info *si)
+{
+ Bool result;
+ int event_number, error_number;
+ BOOL onoff = False;
+ CARD16 state;
+
+ if (!DPMSQueryExtension(si->dpy, &event_number, &error_number))
+ /* Server doesn't know -- assume the monitor is on. */
+ result = True;
+
+ else if (!DPMSCapable(si->dpy))
+ /* Server says the monitor doesn't do power management -- so it's on. */
+ result = True;
+
+ else
+ {
+ DPMSInfo(si->dpy, &state, &onoff);
+ if (!onoff)
+ /* Server says DPMS is disabled -- so the monitor is on. */
+ result = True;
+ else
+ switch (state) {
+ case DPMSModeOn: result = True; break; /* really on */
+ case DPMSModeStandby: result = False; break; /* kinda off */
+ case DPMSModeSuspend: result = False; break; /* pretty off */
+ case DPMSModeOff: result = False; break; /* really off */
+ default: result = True; break; /* protocol error? */
+ }
+ }
+
+ return result;
+}
+
+void
+monitor_power_on (saver_info *si)
+{
+ if (!monitor_powered_on_p (si))
+ {
+ DPMSForceLevel(si->dpy, DPMSModeOn);
+ XSync(si->dpy, False);
+ if (!monitor_powered_on_p (si))
+ fprintf (stderr,
+ "%s: DPMSForceLevel(dpy, DPMSModeOn) did not power the monitor on?\n",
+ progname);
+ }
+}
+
+#else /* !HAVE_DPMS_EXTENSION */
+
+Bool
+monitor_powered_on_p (saver_info *si)
+{
+ return True;
+}
+
+void
+monitor_power_on (saver_info *si)
+{
+ return;
+}
+
+#endif /* !HAVE_DPMS_EXTENSION */
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_DIRS = @INSTALL_DIRS@
HACKDIR = @HACKDIR@
X_CFLAGS = @X_CFLAGS@
X_PRE_LIBS = @X_PRE_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
+# Note: see comment in ../driver/Makefile.in for explanation of X_LIBS, etc.
+#
HACK_PRE = $(LIBS) $(X_LIBS) $(X_PRE_LIBS)
HACK_POST = -lXt -lX11 -lXext $(X_EXTRA_LIBS) -lm
HACK_LIBS = $(HACK_PRE) @HACK_LIBS@ $(HACK_POST)
rd-bomb.c coral.c mountain.c triangle.c lissie.c worm.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
+ truchet.c bsod.c crystal.c discrete.c
OBJS = attraction.o blitspin.o bouboule.o braid.o bubbles.o \
bubbles-default.o decayscreen.o deco.o drift.o flag.o \
rd-bomb.o coral.o mountain.o triangle.o lissie.o worm.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
+ truchet.o bsod.o crystal.o discrete.o
EXES = attraction blitspin bouboule braid bubbles decayscreen deco \
drift flag flame forest vines galaxy grav greynetic halo \
slip sphere spiral strange swirl xroger goop starfish munch \
fadeplot rd-bomb coral mountain triangle lissie worm rotor \
ant xjack xlyap jigsaw cynosure moire2 flow epicycle \
- interference truchet bsod
+ interference truchet bsod crystal discrete
HACK_OBJS_1 = $(UTILS_BIN)/resources.o $(UTILS_BIN)/visual.o \
$(UTILS_BIN)/usleep.o $(UTILS_BIN)/yarandom.o @XMU_OBJS@
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
install-program:
- @if [ ! -d $(HACKDIR) ]; then mkdir $(HACKDIR) ; fi ; \
- for program in $(EXES); do \
+ @exes="$(EXES)" ; \
+ if [ ! -d $(HACKDIR) ]; then $(INSTALL_DIRS) $(HACKDIR) ; fi ; \
+ for program in $$exes; do \
echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
$(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
done
install-man:
- @if [ ! -d $(mandir) ]; then mkdir $(mandir) ; fi ; \
- if [ ! -d $(man1dir) ]; then mkdir $(man1dir) ; fi ; \
- men="$(MEN)" ; \
+ @men="$(MEN)" ; \
+ if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
flow: flow.o $(XLOCK_OBJS)
$(CC_HACK) -o $@ $@.o $(XLOCK_OBJS) $(HACK_LIBS)
+discrete: discrete.o $(XLOCK_OBJS) $(ERASE)
+ $(CC_HACK) -o $@ $@.o $(XLOCK_OBJS) $(ERASE) $(HACK_LIBS)
+
+crystal: crystal.o $(XLOCK_OBJS)
+ $(CC_HACK) -o $@ $@.o $(XLOCK_OBJS) $(HACK_LIBS)
+
##############################################################################
#
bsod.o: $(UTILS_SRC)/visual.h
bsod.o: $(srcdir)/images/amiga.xpm
bsod.o: $(srcdir)/images/mac.xbm
+crystal.o: $(srcdir)/xlockmore.h
+crystal.o: ../config.h
+crystal.o: $(srcdir)/xlockmoreI.h
+crystal.o: $(srcdir)/screenhack.h
+crystal.o: $(UTILS_SRC)/yarandom.h
+crystal.o: $(UTILS_SRC)/usleep.h
+crystal.o: $(UTILS_SRC)/resources.h
+crystal.o: $(UTILS_SRC)/hsv.h
+crystal.o: $(UTILS_SRC)/colors.h
+crystal.o: $(UTILS_SRC)/grabscreen.h
+crystal.o: $(UTILS_SRC)/visual.h
+discrete.o: $(srcdir)/xlockmore.h
+discrete.o: ../config.h
+discrete.o: $(srcdir)/xlockmoreI.h
+discrete.o: $(srcdir)/screenhack.h
+discrete.o: $(UTILS_SRC)/yarandom.h
+discrete.o: $(UTILS_SRC)/usleep.h
+discrete.o: $(UTILS_SRC)/resources.h
+discrete.o: $(UTILS_SRC)/hsv.h
+discrete.o: $(UTILS_SRC)/colors.h
+discrete.o: $(UTILS_SRC)/grabscreen.h
+discrete.o: $(UTILS_SRC)/visual.h
+discrete.o: $(UTILS_SRC)/erase.h
char *progclass = "Attraction";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*mode: balls",
"*points: 0",
"*size: 0",
char *progclass = "BlitSpin";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 500000",
"*delay2: 500000",
"*bitmap: (default)",
static void
draw_string (Display *dpy, Window window, GC gc, XGCValues *gcv,
- XFontStruct *font, int win_width, int win_height,
+ XFontStruct *font,
+ int xoff, int yoff,
+ int win_width, int win_height,
const char *string, int delay)
{
int x, y;
x = (win_width - (width * char_width)) / 2;
y = (win_height - (height * line_height)) / 2;
- if (x < char_width) x = char_width;
- if (y < line_height) y = line_height;
+ if (x < 0) x = 2;
+ if (y < 0) y = 2;
+
+ x += xoff;
+ y += yoff;
se = s = string;
while (1)
XEvent event;
int q = seconds * 4;
int mask = KeyPressMask|ButtonPressMask;
- while (q > 0)
+ do
{
XSync(dpy, False);
if (XCheckMaskEvent(dpy, mask, &event))
;
return True;
}
- q--;
- usleep(250000);
+ if (q > 0)
+ {
+ q--;
+ usleep(250000);
+ }
}
+ while (q > 0);
+
return False;
}
gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
if (w95p)
- draw_string(dpy, window, gc, &gcv, font, xgwa.width, xgwa.height, w95, 0);
+ draw_string(dpy, window, gc, &gcv, font,
+ 0, 0, xgwa.width, xgwa.height, w95, 0);
else
- draw_string(dpy, window, gc, &gcv, font, 10, 10, wnt, 750);
+ draw_string(dpy, window, gc, &gcv, font, 0, 0, 10, 10, wnt, 750);
XFreeGC(dpy, gc);
XSync(dpy, False);
}
XFillRectangle(dpy, window, gc2, 0, 0, xgwa.width, height);
- draw_string(dpy, window, gc, &gcv, font, xgwa.width, height, string, 0);
+ draw_string(dpy, window, gc, &gcv, font, 0, 0, xgwa.width, height, string,0);
{
GC gca = gc;
gcv.background,
xgwa.depth);
- draw_string(dpy, window, gc, &gcv, font, xgwa.width, xgwa.height + offset,
- string, 0);
+ draw_string(dpy, window, gc, &gcv, font, 0, 0,
+ xgwa.width, xgwa.height + offset, string, 0);
for(i = 0; i < 2; i++)
{
XFreeFont(dpy, font);
}
+static void
+macsbug (Display *dpy, Window window, int delay)
+{
+ XGCValues gcv;
+ XWindowAttributes xgwa;
+ char *fontname;
+ const char *def_font = "fixed";
+ XFontStruct *font;
+ GC gc, gc2;
+
+ int char_width, line_height;
+ int col_right, row_top, row_bottom, page_right, page_bottom, body_top;
+ int xoff, yoff;
+
+ const char *left = (" SP \n"
+ " 04EB0A58 \n"
+ "58 00010000\n"
+ "5C 00010000\n"
+ " ........\n"
+ "60 00000000\n"
+ "64 000004EB\n"
+ " ........\n"
+ "68 0000027F\n"
+ "6C 2D980035\n"
+ " ....-..5\n"
+ "70 00000054\n"
+ "74 0173003E\n"
+ " ...T.s.>\n"
+ "78 04EBDA76\n"
+ "7C 04EBDA8E\n"
+ " .S.L.a.U\n"
+ "80 00000000\n"
+ "84 000004EB\n"
+ " ........\n"
+ "88 00010000\n"
+ "8C 00010000\n"
+ " ...{3..S\n"
+ "\n"
+ "\n"
+ " CurApName \n"
+ " Finder \n"
+ "\n"
+ " 32-bit VM \n"
+ "SR Smxnzvc0\n"
+ "D0 04EC0062\n"
+ "D1 00000053\n"
+ "D2 FFFF0100\n"
+ "D3 00010000\n"
+ "D4 00010000\n"
+ "D5 04EBDA76\n"
+ "D6 04EBDA8E\n"
+ "D7 00000001\n"
+ "\n"
+ "A0 04EBDA76\n"
+ "A1 04EBDA8E\n"
+ "A2 A0A00060\n"
+ "A3 027F2D98\n"
+ "A4 027F2E58\n"
+ "A5 04EC04F0\n"
+ "A6 04EB0A86\n"
+ "A7 04EB0A58");
+ const char *bottom = (" _A09D\n"
+ " +00884 40843714 #$0700,SR "
+ " ; A973 | A973\n"
+ " +00886 40843765 *+$0400 "
+ " | 4A1F\n"
+ " +00888 40843718 $0004(A7),([0,A7[)"
+ " ; 04E8D0AE | 66B8");
+ const char *body = ("Bus Error at 4BF6D6CC\n"
+ "while reading word from 4BF6D6CC in User data space\n"
+ " Unable to access that address\n"
+ " PC: 2A0DE3E6\n"
+ " Frame Type: B008");
+ const char *s;
+ int body_lines = 1;
+
+ for (s = body; *s; s++) if (*s == '\n') body_lines++;
+
+ XGetWindowAttributes (dpy, window, &xgwa);
+
+ fontname = get_string_resource ((xgwa.height > 850
+ ? "macsbug.font3"
+ : (xgwa.height > 700
+ ? "macsbug.font2"
+ : "macsbug.font")),
+ "MacsBug.Font");
+ if (!fontname || !*fontname) fontname = (char *)def_font;
+ font = XLoadQueryFont (dpy, fontname);
+ if (!font) font = XLoadQueryFont (dpy, def_font);
+ if (!font) exit(-1);
+ if (fontname && fontname != def_font)
+ free (fontname);
+
+ gcv.font = font->fid;
+ gcv.foreground = get_pixel_resource("macsbug.foreground",
+ "MacsBug.Foreground",
+ dpy, xgwa.colormap);
+ gcv.background = get_pixel_resource("macsbug.background",
+ "MacsBug.Background",
+ dpy, xgwa.colormap);
+
+ gc = XCreateGC(dpy, window, GCFont|GCForeground|GCBackground, &gcv);
+
+ gcv.foreground = gcv.background;
+ gc2 = XCreateGC(dpy, window, GCForeground, &gcv);
+
+ XSetWindowBackground(dpy, window,
+ get_pixel_resource("macsbug.borderColor",
+ "MacsBug.BorderColor",
+ dpy, xgwa.colormap));
+ XClearWindow(dpy, window);
+
+ char_width = (font->per_char
+ ? font->per_char['n'-font->min_char_or_byte2].width
+ : font->min_bounds.width);
+ line_height = font->ascent + font->descent + 1;
+
+ col_right = char_width * 12;
+ page_bottom = line_height * 47;
+
+ if (page_bottom > xgwa.height) page_bottom = xgwa.height;
+
+ row_bottom = page_bottom - line_height;
+ row_top = row_bottom - (line_height * 4);
+ page_right = col_right + (char_width * 88);
+ body_top = row_top - (line_height * body_lines);
+
+ page_bottom += 2;
+ row_bottom += 2;
+ body_top -= 4;
+
+ xoff = (xgwa.width - page_right) / 2;
+ yoff = (xgwa.height - page_bottom) / 2;
+ if (xoff < 0) xoff = 0;
+ if (yoff < 0) yoff = 0;
+
+ XFillRectangle(dpy, window, gc2, xoff, yoff, page_right, page_bottom);
+
+ draw_string(dpy, window, gc, &gcv, font, xoff, yoff, 10, 10, left, 0);
+ draw_string(dpy, window, gc, &gcv, font, xoff+col_right, yoff+row_top,
+ 10, 10, bottom, 0);
+ draw_string(dpy, window, gc, &gcv, font,
+ xoff + col_right + char_width, yoff + body_top, 10, 10, body, 0);
+
+ XFillRectangle(dpy, window, gc, xoff + col_right, yoff, 2, page_bottom);
+ XDrawLine(dpy, window, gc,
+ xoff+col_right, yoff+row_top, xoff+page_right, yoff+row_top);
+ XDrawLine(dpy, window, gc,
+ xoff+col_right, yoff+row_bottom, xoff+page_right, yoff+row_bottom);
+ XDrawRectangle(dpy, window, gc, xoff, yoff, page_right, page_bottom);
+
+ while (delay > 0)
+ {
+ XDrawLine(dpy, window, gc,
+ xoff+col_right+(char_width/2)+2, yoff+row_bottom+3,
+ xoff+col_right+(char_width/2)+2, yoff+page_bottom-3);
+ XSync(dpy, False);
+ usleep(666666L);
+ XDrawLine(dpy, window, gc2,
+ xoff+col_right+(char_width/2)+2, yoff+row_bottom+3,
+ xoff+col_right+(char_width/2)+2, yoff+page_bottom-3);
+ XSync(dpy, False);
+ usleep(333333L);
+ if (bsod_sleep(dpy, 0))
+ break;
+ delay--;
+ }
+
+ XFreeGC(dpy, gc);
+ XFreeGC(dpy, gc2);
+ XClearWindow(dpy, window);
+ XFreeFont(dpy, font);
+}
+
+
\f
char *progclass = "BSOD";
char *defaults [] = {
- "*delay: 30",
-
- "BSOD.Windows.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
- "BSOD.Windows.font2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
- "BSOD.Windows.foreground: White",
- "BSOD.Windows.background: Blue",
-
- "BSOD.Amiga.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
- "BSOD.Amiga.font2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
- "BSOD.Amiga.foreground: Red",
- "BSOD.Amiga.background: Black",
- "BSOD.Amiga.background2: White",
-
- "BSOD.Mac.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
- "BSOD.Mac.foreground: PaleTurquoise1",
- "BSOD.Mac.background: Black",
+ "*delay: 30",
+
+ ".Windows.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".Windows.font2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
+ ".Windows.foreground: White",
+ ".Windows.background: Blue",
+
+ ".Amiga.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".Amiga.font2: -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
+ ".Amiga.foreground: Red",
+ ".Amiga.background: Black",
+ ".Amiga.background2: White",
+
+ ".Mac.font: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".Mac.foreground: PaleTurquoise1",
+ ".Mac.background: Black",
+
+ ".MacsBug.font: -*-courier-medium-r-*-*-*-100-*-*-m-*-*-*",
+ ".MacsBug.font2: -*-courier-bold-r-*-*-*-120-*-*-m-*-*-*",
+ ".MacsBug.font3: -*-courier-bold-r-*-*-*-140-*-*-m-*-*-*",
+ ".MacsBug.foreground: Black",
+ ".MacsBug.background: White",
+ ".MacsBug.borderColor: #AAAAAA",
0
};
while (1)
{
- while (i == j) i = random() % 4;
+ while (i == j) i = random() % 5;
j = i;
switch (i)
case 1: windows(dpy, window, delay, False); break;
case 2: amiga(dpy, window, delay); break;
case 3: mac(dpy, window, delay); break;
+ case 4: macsbug(dpy, window, delay); break;
default: abort(); break;
}
XSync (dpy, True);
char *progclass = "Bubbles";
char *defaults [] = {
- "Bubbles.background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*simple: false",
"*broken: false",
"*delay: 800",
$ 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]) CORAL.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]) DECO.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DISCRETE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DRIFT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) EPICYCLE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) 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]) CORAL.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]) DECO.C
+$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DISCRETE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) DRIFT.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) EPICYCLE.C
$ CC/DECC/PREFIX=ALL/DEFINE=(VMS,HAVE_CONFIG_H,STANDALONE)/INCL=([],[-],[-.UTILS]) FADEPLOT.C
char *progclass = "Coral";
char *defaults[] = {
- "Coral.background: black",
- "Coral.foreground: white",
- "*density: 25",
- "*seeds: 20", /* too many for 640x480, too few for 1280x1024 */
- "*delay: 5",
- "*delay2: 1000",
- 0
+ ".background: black",
+ ".foreground: white",
+ "*density: 25",
+ "*seeds: 20", /* too many for 640x480, too few for 1280x1024 */
+ "*delay: 5",
+ "*delay2: 1000",
+ 0
};
XrmOptionDescRec options[] = {
--- /dev/null
+/* -*- Mode: C; tab-width: 4 -*- */
+/* crystal --- polygons moving according to plane group rules */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)crystal.c 4.07 97/11/24 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1997 by Jouk Jansen <joukj@crys.chem.uva.nl>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind. The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof. In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * The author should like to be notified if changes have been made to the
+ * routine. Response will only be guaranteed when a VMS version of the
+ * program is available.
+ *
+ * A moving polygon-mode. The polygons obey 2D-planegroup symmetry.
+ *
+ * Revision History:
+ * 24-Feb-98: added option centre which turns on/off forcing the centre of
+ * the screen to be used
+ * added option maxsize which forces the dimensions to be chasen
+ * in such ua way that the largest possible part of the screen is
+ * used
+ * When only one unit cell is drawn, it is chosen at random
+ * 18-Feb-98: added support for negative numbers with -nx and -ny meaning
+ * "random" choice with geiven maximum
+ * added +/-grid option. If -cell is specified this option
+ * determines if one or all unit cells are drawn.
+ * -batchcount is now a parameter for all the objects on the screen
+ * instead of the number of "unique" objects
+ * The maximum size of the objects now scales with the part
+ * of the screen used.
+ * fixed "size" problem. Now very small non-vissable objects
+ * are not allowed
+ * 13-Feb-98: randomized the unit cell size
+ * runtime options -/+cell (turn on/off unit cell drawing)
+ * -nx num (number of translational symmetries in x-direction
+ * -ny num (idem y-direction but ignored for square and
+ * hexagonal space groups
+ * i.e. try xlock -mode crystal -nx 3 -ny 2
+ * Fullrandom overrules the -/+cell option.
+ * 05-Feb-98: Revision + bug repairs
+ * shows unit cell
+ * use part of the screen for unit cell
+ * in hexagonal and square groups a&b axis forced to be equal
+ * cell angle for oblique groups randomly chosen between 60 and 120
+ * bugs solved: planegroups with cell angles <> 90.0 now work properly
+ * 19-Sep-97: Added remaining hexagonal groups
+ * 12-Jun-97: Created
+ */
+
+#ifdef STANDALONE
+# define PROGCLASS "Crystal"
+# define HACK_INIT init_crystal
+# define HACK_DRAW draw_crystal
+# define crystal_opts xlockmore_opts
+# define DEFAULTS "*delay: 60000 \n" \
+ "*count: -500 \n" \
+ "*cycles: 200 \n" \
+ "*size: -15 \n" \
+ "*ncolors: 200 \n" \
+ "*fullrandom: True \n" \
+ "*verbose: False \n"
+# include "xlockmore.h" /* in xscreensaver distribution */
+#else /* STANDALONE */
+# include "xlock.h" /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+#define DEF_CELL "True" /* Draw unit cell */
+#define DEF_GRID "False" /* Draw unit all cell if DEF_CELL is True */
+#define DEF_NX "-3" /* number of unit cells in x-direction */
+#define DEF_NX1 1 /* number of unit cells in x-direction */
+#define DEF_NY "-3" /* number of unit cells in y-direction */
+#define DEF_NY1 1 /* number of unit cells in y-direction */
+#define DEF_CENTRE "False"
+#define DEF_MAXSIZE "False"
+
+#define min(a,b) ((a) <= (b) ? (a) : (b))
+
+static int nx, ny;
+
+static Bool unit_cell, grid_cell, centre, maxsize;
+
+static XrmOptionDescRec opts[] =
+{
+ {"-nx", "crystal.nx", XrmoptionSepArg, (caddr_t) NULL},
+ {"-ny", "crystal.ny", XrmoptionSepArg, (caddr_t) NULL},
+ {"-centre", ".crystal.centre", XrmoptionNoArg, (caddr_t) "on"},
+ {"+centre", ".crystal.centre", XrmoptionNoArg, (caddr_t) "off"},
+ {"-maxsize", ".crystal.maxsize", XrmoptionNoArg, (caddr_t) "on"},
+ {"+maxsize", ".crystal.maxsize", XrmoptionNoArg, (caddr_t) "off"},
+ {"-cell", ".crystal.cell", XrmoptionNoArg, (caddr_t) "on"},
+ {"+cell", ".crystal.cell", XrmoptionNoArg, (caddr_t) "off"},
+ {"-grid", ".crystal.grid", XrmoptionNoArg, (caddr_t) "on"},
+ {"+grid", ".crystal.grid", XrmoptionNoArg, (caddr_t) "off"}
+};
+
+static argtype vars[] =
+{
+ {(caddr_t *) & nx, "nx", "nx", DEF_NX, t_Int},
+ {(caddr_t *) & ny, "ny", "ny", DEF_NY, t_Int},
+ {(caddr_t *) & centre, "centre", "Centre", DEF_CENTRE, t_Bool},
+ {(caddr_t *) & maxsize, "maxsize", "Maxsize", DEF_MAXSIZE, t_Bool},
+ {(caddr_t *) & unit_cell, "cell", "Cell", DEF_CELL, t_Bool},
+ {(caddr_t *) & grid_cell, "grid", "Grid", DEF_GRID, t_Bool}
+};
+static OptionStruct desc[] =
+{
+ {"-nx num", "Number of unit cells in x-direction"},
+ {"-ny num", "Number of unit cells in y-direction"},
+ {"-/+centre", "turn on/off cenetering on screen"},
+ {"-/+maxsize", "turn on/off use of maximum part of screen"},
+ {"-/+cell", "turn on/off drawing of unit cell"},
+ {"-/+grid", "turn on/off drawing of grid of unit cells (if -cell is on)"}
+};
+
+ModeSpecOpt crystal_opts =
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
+
+#ifdef USE_MODULES
+ModStruct crystal_description =
+{"crystal", "init_crystal", "draw_crystal", "release_crystal",
+ "refresh_crystal", "init_crystal", NULL, &crystal_opts,
+ 60000, -40, 200, -15, 64, 1.0, "",
+ "Shows polygons in 2D plane groups", 0, NULL};
+
+#endif
+
+#define DEF_NUM_ATOM 10
+
+#define DEF_SIZ_ATOM 10
+
+#define PI_RAD (M_PI / 180.0)
+
+static Bool centro[17] =
+{
+ False,
+ True,
+ False,
+ False,
+ False,
+ True,
+ True,
+ True,
+ True,
+ True,
+ True,
+ True,
+ False,
+ False,
+ False,
+ True,
+ True
+};
+
+static Bool primitive[17] =
+{
+ True,
+ True,
+ True,
+ True,
+ False,
+ True,
+ True,
+ True,
+ False,
+ True,
+ True,
+ True,
+ True,
+ True,
+ True,
+ True,
+ True
+};
+
+static short numops[34] =
+{
+ 1, 0,
+ 1, 0,
+ 9, 7,
+ 2, 0,
+ 9, 7,
+ 9, 7,
+ 4, 2,
+ 5, 3,
+ 9, 7,
+ 8, 6,
+ 10, 6,
+ 8, 4,
+ 16, 13,
+ 19, 13,
+ 16, 10,
+ 19, 13,
+ 19, 13
+};
+
+static short operation[114] =
+{
+ 1, 0, 0, 1, 0, 0,
+ -1, 0, 0, 1, 0, 1,
+ -1, 0, 0, 1, 1, 0,
+ 1, 0, 0, 1, 0, 0,
+ -1, 0, 0, 1, 1, 1,
+ 1, 0, 0, 1, 1, 1,
+ 0, -1, 1, 0, 0, 0,
+ 1, 0, 0, 1, 0, 0,
+ -1, 0, 0, 1, 0, 0,
+ 0, 1, 1, 0, 0, 0,
+ -1, 0, -1, 1, 0, 0,
+ 1, -1, 0, -1, 0, 0,
+ 0, 1, 1, 0, 0, 0,
+ 0, -1, 1, -1, 0, 0,
+ -1, 1, -1, 0, 0, 0,
+ 1, 0, 0, 1, 0, 0,
+ 0, -1, -1, 0, 0, 0,
+ -1, 1, 0, 1, 0, 0,
+ 1, 0, 1, -1, 0, 0
+};
+
+typedef struct {
+ unsigned long colour;
+ int x0, y0, velocity[2];
+ float angle, velocity_a;
+ int num_point, at_type, size_at;
+ XPoint xy[5];
+} crystalatom;
+
+typedef struct {
+ Bool painted;
+ int win_width, win_height, num_atom;
+ int planegroup, a, b, offset_w, offset_h, nx, ny;
+ float gamma;
+ crystalatom *atom;
+ GC gc;
+ Bool unit_cell, grid_cell;
+} crystalstruct;
+
+static crystalstruct *crystals = NULL;
+
+static void
+trans_coor(XPoint * xyp, XPoint * new_xyp, int num_points,
+ float gamma)
+{
+ int i;
+
+ for (i = 0; i <= num_points; i++) {
+ new_xyp[i].x = xyp[i].x +
+ (int) (xyp[i].y * sin((gamma - 90.0) * PI_RAD));
+ new_xyp[i].y = (int) (xyp[i].y / cos((gamma - 90.0) * PI_RAD));
+ }
+}
+
+static void
+trans_coor_back(XPoint * xyp, XPoint * new_xyp,
+ int num_points, float gamma, int offset_w, int offset_h)
+{
+ int i;
+
+ for (i = 0; i <= num_points; i++) {
+ new_xyp[i].y = (int) (xyp[i].y * cos((gamma - 90) * PI_RAD)) +
+ offset_h;
+ new_xyp[i].x = xyp[i].x - (int) (xyp[i].y * sin((gamma - 90.0)
+ * PI_RAD)) + offset_w;
+ }
+}
+
+static void
+crystal_setupatom(crystalatom * atom0, float gamma)
+{
+ XPoint xy[5];
+ int x0, y0;
+
+ y0 = (int) (atom0->y0 * cos((gamma - 90) * PI_RAD));
+ x0 = atom0->x0 - (int) (atom0->y0 * sin((gamma - 90.0) * PI_RAD));
+ switch (atom0->at_type) {
+ case 0: /* rectangles */
+ xy[0].x = x0 + (int) (2 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (atom0->size_at * sin(atom0->angle));
+ xy[0].y = y0 + (int) (atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (2 * atom0->size_at * sin(atom0->angle));
+ xy[1].x = x0 + (int) (2 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (atom0->size_at * sin(atom0->angle));
+ xy[1].y = y0 - (int) (atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (2 * atom0->size_at * sin(atom0->angle));
+ xy[2].x = x0 - (int) (2 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (atom0->size_at * sin(atom0->angle));
+ xy[2].y = y0 - (int) (atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (2 * atom0->size_at * sin(atom0->angle));
+ xy[3].x = x0 - (int) (2 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (atom0->size_at * sin(atom0->angle));
+ xy[3].y = y0 + (int) (atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (2 * atom0->size_at *
+ sin(atom0->angle));
+ xy[4].x = xy[0].x;
+ xy[4].y = xy[0].y;
+ trans_coor(xy, atom0->xy, 4, gamma);
+ return;
+ case 1: /* squares */
+ xy[0].x = x0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[0].y = y0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[1].x = x0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[1].y = y0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[2].x = x0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[2].y = y0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[3].x = x0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[3].y = y0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[4].x = xy[0].x;
+ xy[4].y = xy[0].y;
+ trans_coor(xy, atom0->xy, 4, gamma);
+ return;
+ case 2: /* triangles */
+ xy[0].x = x0 + (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[0].y = y0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle));
+ xy[1].x = x0 + (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[1].y = y0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[2].x = x0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) -
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[2].y = y0 - (int) (1.5 * atom0->size_at *
+ cos(atom0->angle)) +
+ (int) (1.5 * atom0->size_at *
+ sin(atom0->angle));
+ xy[3].x = xy[0].x;
+ xy[3].y = xy[0].y;
+ trans_coor(xy, atom0->xy, 3, gamma);
+ return;
+ }
+}
+
+static void
+crystal_drawatom(ModeInfo * mi, crystalatom * atom0)
+{
+ crystalstruct *cryst;
+ Display *display = MI_DISPLAY(mi);
+ Window window = MI_WINDOW(mi);
+ int j, k, l, m;
+
+ cryst = &crystals[MI_SCREEN(mi)];
+ for (j = numops[2 * cryst->planegroup + 1];
+ j < numops[2 * cryst->planegroup]; j++) {
+ XPoint xy[5], new_xy[5];
+ XPoint xy_1[5];
+ int xtrans, ytrans;
+
+ xtrans = operation[j * 6] * atom0->x0 + operation[j * 6 + 1] *
+ atom0->y0 + (int) (operation[j * 6 + 4] * cryst->a /
+ 2.0);
+ ytrans = operation[j * 6 + 2] * atom0->x0 + operation[j * 6 +
+ 3] * atom0->y0 + (int) (operation[j * 6 + 5] *
+ cryst->b / 2.0);
+ if (xtrans < 0) {
+ if (xtrans < -cryst->a)
+ xtrans = 2 * cryst->a;
+ else
+ xtrans = cryst->a;
+ } else if (xtrans >= cryst->a)
+ xtrans = -cryst->a;
+ else
+ xtrans = 0;
+ if (ytrans < 0)
+ ytrans = cryst->b;
+ else if (ytrans >= cryst->b)
+ ytrans = -cryst->b;
+ else
+ ytrans = 0;
+ for (k = 0; k < atom0->num_point; k++) {
+ xy[k].x = operation[j * 6] * atom0->xy[k].x +
+ operation[j * 6 + 1] *
+ atom0->xy[k].y + (int) (operation[j * 6 + 4] *
+ cryst->a / 2.0) +
+ xtrans;
+ xy[k].y = operation[j * 6 + 2] * atom0->xy[k].x +
+ operation[j * 6 + 3] *
+ atom0->xy[k].y + (int) (operation[j * 6 + 5] *
+ cryst->b / 2.0) +
+ ytrans;
+ }
+ xy[atom0->num_point].x = xy[0].x;
+ xy[atom0->num_point].y = xy[0].y;
+ for (l = 0; l < cryst->nx; l++) {
+ for (m = 0; m < cryst->ny; m++) {
+
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy_1[k].x = xy[k].x + l * cryst->a;
+ xy_1[k].y = xy[k].y + m * cryst->b;
+ }
+ trans_coor_back(xy_1, new_xy, atom0->num_point,
+ cryst->gamma, cryst->offset_w, cryst->offset_h);
+ XFillPolygon(display, window, cryst->gc, new_xy,
+ atom0->num_point, Convex, CoordModeOrigin);
+ }
+ }
+ if (centro[cryst->planegroup] == True) {
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy[k].x = cryst->a - xy[k].x;
+ xy[k].y = cryst->b - xy[k].y;
+ }
+ for (l = 0; l < cryst->nx; l++) {
+ for (m = 0; m < cryst->ny; m++) {
+
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy_1[k].x = xy[k].x + l * cryst->a;
+ xy_1[k].y = xy[k].y + m * cryst->b;
+ }
+ trans_coor_back(xy_1, new_xy, atom0->num_point,
+ cryst->gamma, cryst->offset_w, cryst->offset_h);
+ XFillPolygon(display, window, cryst->gc,
+ new_xy,
+ atom0->num_point, Convex,
+ CoordModeOrigin);
+ }
+ }
+ }
+ if (primitive[cryst->planegroup] == False) {
+ if (xy[atom0->num_point].x >= (int) (cryst->a / 2.0))
+ xtrans = (int) (-cryst->a / 2.0);
+ else
+ xtrans = (int) (cryst->a / 2.0);
+ if (xy[atom0->num_point].y >= (int) (cryst->b / 2.0))
+ ytrans = (int) (-cryst->b / 2.0);
+ else
+ ytrans = (int) (cryst->b / 2.0);
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy[k].x = xy[k].x + xtrans;
+ xy[k].y = xy[k].y + ytrans;
+ }
+ for (l = 0; l < cryst->nx; l++) {
+ for (m = 0; m < cryst->ny; m++) {
+
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy_1[k].x = xy[k].x + l * cryst->a;
+ xy_1[k].y = xy[k].y + m * cryst->b;
+ }
+ trans_coor_back(xy_1, new_xy, atom0->num_point,
+ cryst->gamma, cryst->offset_w, cryst->offset_h);
+ XFillPolygon(display, window, cryst->gc,
+ new_xy,
+ atom0->num_point, Convex,
+ CoordModeOrigin);
+ }
+ }
+ if (centro[cryst->planegroup] == True) {
+ XPoint xy1[5];
+
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy1[k].x = cryst->a - xy[k].x;
+ xy1[k].y = cryst->b - xy[k].y;
+ }
+ for (l = 0; l < cryst->nx; l++) {
+ for (m = 0; m < cryst->ny; m++) {
+
+ for (k = 0; k <= atom0->num_point; k++) {
+ xy_1[k].x = xy1[k].x + l * cryst->a;
+ xy_1[k].y = xy1[k].y + m * cryst->b;
+ }
+ trans_coor_back(xy_1, new_xy, atom0->num_point,
+ cryst->gamma, cryst->offset_w, cryst->offset_h);
+ XFillPolygon(display, window,
+ cryst->gc,
+ new_xy, atom0->num_point,
+ Convex, CoordModeOrigin);
+ }
+ }
+ }
+ }
+ }
+}
+
+void
+draw_crystal(ModeInfo * mi)
+{
+ Display *display = MI_DISPLAY(mi);
+ crystalstruct *cryst = &crystals[MI_SCREEN(mi)];
+ int i;
+
+ cryst->painted = True;
+ XSetFunction(display, cryst->gc, GXxor);
+ for (i = 0; i < cryst->num_atom; i++) {
+ crystalatom *atom0;
+
+ atom0 = &cryst->atom[i];
+ XSetForeground(display, cryst->gc, atom0->colour);
+ crystal_drawatom(mi, atom0);
+ atom0->velocity[0] += NRAND(3) - 1;
+ atom0->velocity[0] = MAX(-20, MIN(20, atom0->velocity[0]));
+ atom0->velocity[1] += NRAND(3) - 1;
+ atom0->velocity[1] = MAX(-20, MIN(20, atom0->velocity[1]));
+ atom0->x0 += atom0->velocity[0];
+ /*if (cryst->gamma == 90.0) { */
+ if (atom0->x0 < 0)
+ atom0->x0 += cryst->a;
+ else if (atom0->x0 >= cryst->a)
+ atom0->x0 -= cryst->a;
+ atom0->y0 += atom0->velocity[1];
+ if (atom0->y0 < 0)
+ atom0->y0 += cryst->b;
+ else if (atom0->y0 >= cryst->b)
+ atom0->y0 -= cryst->b;
+ /*} */
+ atom0->velocity_a += ((float) NRAND(1001) - 500.0) / 2000.0;
+ atom0->angle += atom0->velocity_a;
+ crystal_setupatom(atom0, cryst->gamma);
+ crystal_drawatom(mi, atom0);
+ }
+ XSetFunction(display, cryst->gc, GXcopy);
+}
+
+void
+refresh_crystal(ModeInfo * mi)
+{
+ Display *display = MI_DISPLAY(mi);
+ Window window = MI_WINDOW(mi);
+ crystalstruct *cryst = &crystals[MI_SCREEN(mi)];
+ int i;
+
+ if (!cryst->painted)
+ return;
+ MI_CLEARWINDOW(mi);
+ XSetFunction(display, cryst->gc, GXxor);
+
+ if (cryst->unit_cell) {
+ if (MI_NPIXELS(mi) > 2)
+ XSetForeground(display, cryst->gc, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+ else
+ XSetForeground(display, cryst->gc, MI_BLACK_PIXEL(mi));
+ if (cryst->grid_cell) {
+ int inx, iny;
+
+ XDrawLine(display, window, cryst->gc, cryst->offset_w,
+ cryst->offset_h, cryst->offset_w + cryst->nx * cryst->a,
+ cryst->offset_h);
+ XDrawLine(display, window, cryst->gc, cryst->offset_w,
+ cryst->offset_h, (int) (cryst->offset_w - cryst->ny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (cryst->ny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ inx = cryst->nx;
+ for (iny = 1; iny <= cryst->ny; iny++) {
+ XDrawLine(display, window, cryst->gc,
+ (int) (cryst->offset_w +
+ inx * cryst->a - (int) (iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD))),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+ PI_RAD)) + cryst->offset_h,
+ (int) (cryst->offset_w - iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) +
+ cryst->offset_h);
+ }
+ iny = cryst->ny;
+ for (inx = 1; inx <= cryst->nx; inx++) {
+ XDrawLine(display, window, cryst->gc,
+ (int) (cryst->offset_w +
+ inx * cryst->a - (int) (iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD))),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + inx * cryst->a, cryst->offset_h);
+ }
+ } else {
+ int inx, iny;
+
+ inx = NRAND(cryst->nx);
+ iny = NRAND(cryst->ny);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ }
+ }
+ for (i = 0; i < cryst->num_atom; i++) {
+ crystalatom *atom0;
+
+ atom0 = &cryst->atom[i];
+ XSetForeground(display, cryst->gc, atom0->colour);
+ crystal_drawatom(mi, atom0);
+ }
+ XSetFunction(display, cryst->gc, GXcopy);
+}
+
+void
+release_crystal(ModeInfo * mi)
+{
+ Display *display = MI_DISPLAY(mi);
+
+ if (crystals != NULL) {
+ int screen;
+
+ for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+ crystalstruct *cryst = &crystals[screen];
+
+ if (cryst->gc != NULL)
+ XFreeGC(display, cryst->gc);
+ if (cryst->atom != NULL)
+ (void) free((void *) cryst->atom);
+ }
+ (void) free((void *) crystals);
+ crystals = NULL;
+ }
+}
+
+void
+init_crystal(ModeInfo * mi)
+{
+ Display *display = MI_DISPLAY(mi);
+ Window window = MI_WINDOW(mi);
+ crystalstruct *cryst;
+ int i, max_atoms, size_atom, neqv;
+ int cell_min;
+
+#define MIN_CELL 200
+
+/* initialize */
+ if (crystals == NULL) {
+ if ((crystals = (crystalstruct *) calloc(MI_NUM_SCREENS(mi),
+ sizeof (crystalstruct))) == NULL)
+ return;
+ }
+ cryst = &crystals[MI_SCREEN(mi)];
+
+ if (!cryst->gc) {
+ if ((cryst->gc = XCreateGC(display, MI_WINDOW(mi),
+ (unsigned long) 0, (XGCValues *) NULL)) == None)
+ return;
+ }
+/* Clear Display */
+ MI_CLEARWINDOW(mi);
+ cryst->painted = False;
+ XSetFunction(display, cryst->gc, GXxor);
+
+/*Set up crystal data */
+ if (MI_IS_FULLRANDOM(mi)) {
+ if (LRAND() & 1)
+ cryst->unit_cell = True;
+ else
+ cryst->unit_cell = False;
+ } else
+ cryst->unit_cell = unit_cell;
+ if (cryst->unit_cell) {
+ if (MI_IS_FULLRANDOM(mi)) {
+ if (LRAND() & 1)
+ cryst->grid_cell = True;
+ else
+ cryst->grid_cell = False;
+ } else
+ cryst->grid_cell = grid_cell;
+ }
+ cryst->win_width = MI_WIDTH(mi);
+ cryst->win_height = MI_HEIGHT(mi);
+ cell_min = min(cryst->win_width / 2 + 1, MIN_CELL);
+ cell_min = min(cell_min, cryst->win_height / 2 + 1);
+ cryst->planegroup = NRAND(17);
+ if (MI_IS_VERBOSE(mi))
+ (void) fprintf(stdout, "Selected plane group no %d\n",
+ cryst->planegroup + 1);
+ if (cryst->planegroup > 11)
+ cryst->gamma = 120.0;
+ else if (cryst->planegroup < 2)
+ cryst->gamma = 60.0 + NRAND(60);
+ else
+ cryst->gamma = 90.0;
+ neqv = numops[2 * cryst->planegroup] - numops[2 * cryst->planegroup + 1];
+ if (centro[cryst->planegroup] == True)
+ neqv = 2 * neqv;
+ if (primitive[cryst->planegroup] == False)
+ neqv = 2 * neqv;
+
+
+ if (nx > 0)
+ cryst->nx = nx;
+ else if (nx < 0)
+ cryst->nx = NRAND(-nx) + 1;
+ else
+ cryst->nx = DEF_NX1;
+ if (cryst->planegroup > 8)
+ cryst->ny = cryst->nx;
+ else if (ny > 0)
+ cryst->ny = ny;
+ else if (ny < 0)
+ cryst->ny = NRAND(-ny) + 1;
+ else
+ cryst->ny = DEF_NY1;
+ neqv = neqv * cryst->nx * cryst->ny;
+
+ cryst->num_atom = MI_COUNT(mi);
+ max_atoms = MI_COUNT(mi);
+ if (cryst->num_atom == 0) {
+ cryst->num_atom = DEF_NUM_ATOM;
+ max_atoms = DEF_NUM_ATOM;
+ } else if (cryst->num_atom < 0) {
+ max_atoms = -cryst->num_atom;
+ cryst->num_atom = NRAND(-cryst->num_atom) + 1;
+ }
+ if (neqv > 1)
+ cryst->num_atom = cryst->num_atom / neqv + 1;
+
+ if (cryst->atom == NULL)
+ cryst->atom = (crystalatom *) calloc(max_atoms, sizeof (
+ crystalatom));
+
+ if (maxsize) {
+ if (cryst->planegroup < 13) {
+ cryst->gamma = 90.0;
+ cryst->offset_w = 0;
+ cryst->offset_h = 0;
+ if (cryst->planegroup < 10) {
+ cryst->b = cryst->win_height;
+ cryst->a = cryst->win_width;
+ } else {
+ cryst->b = min(cryst->win_height, cryst->win_width);
+ cryst->a = cryst->b;
+ }
+ } else {
+ cryst->gamma = 120.0;
+ cryst->a = (int) (cryst->win_width * 2.0 / 3.0);
+ cryst->b = cryst->a;
+ cryst->offset_h = (int) (cryst->b * 0.25 *
+ cos((cryst->gamma - 90) * PI_RAD));
+ cryst->offset_w = (int) (cryst->b * 0.5);
+ }
+ } else {
+ cryst->offset_w = -1;
+ while (cryst->offset_w < 4 || (int) (cryst->offset_w - cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD)) < 4) {
+ cryst->b = NRAND((int) (cryst->win_height / (cos((cryst->gamma - 90) *
+ PI_RAD))) - cell_min) + cell_min;
+ if (cryst->planegroup > 8)
+ cryst->a = cryst->b;
+ else
+ cryst->a = NRAND(cryst->win_width - cell_min) + cell_min;
+ cryst->offset_w = (int) ((cryst->win_width - (cryst->a - cryst->b *
+ sin((cryst->gamma - 90) *
+ PI_RAD))) / 2.0);
+ }
+ cryst->offset_h = (int) ((cryst->win_height - cryst->b * cos((
+ cryst->gamma - 90) * PI_RAD)) / 2.0);
+ if (!centre) {
+ if (cryst->offset_h > 0)
+ cryst->offset_h = NRAND(2 * cryst->offset_h);
+ cryst->offset_w = (int) (cryst->win_width - cryst->a -
+ cryst->b *
+ fabs(sin((cryst->gamma - 90) * PI_RAD)));
+ if (cryst->gamma > 90.0) {
+ if (cryst->offset_w > 0)
+ cryst->offset_w = NRAND(cryst->offset_w) +
+ cryst->b * sin((cryst->gamma - 90) * PI_RAD);
+ else
+ cryst->offset_w = (int) (cryst->b * sin((cryst->gamma - 90) *
+ PI_RAD));
+ } else if (cryst->offset_w > 0)
+ cryst->offset_w = NRAND(cryst->offset_w);
+ else
+ cryst->offset_w = 0;
+ }
+ }
+
+ size_atom = min((int) ((float) (cryst->a) / 40.) + 1,
+ (int) ((float) (cryst->b) / 40.) + 1);
+ if (MI_SIZE(mi) < size_atom) {
+ if (MI_SIZE(mi) < -size_atom)
+ size_atom = -size_atom;
+ else
+ size_atom = MI_SIZE(mi);
+ }
+ cryst->a = cryst->a / cryst->nx;
+ cryst->b = cryst->b / cryst->ny;
+ if (cryst->unit_cell) {
+ if (MI_NPIXELS(mi) > 2)
+ XSetForeground(display, cryst->gc, MI_PIXEL(mi, NRAND(MI_NPIXELS(mi))));
+ else
+ XSetForeground(display, cryst->gc, MI_BLACK_PIXEL(mi));
+ if (cryst->grid_cell) {
+ int inx, iny;
+
+ XDrawLine(display, window, cryst->gc, cryst->offset_w,
+ cryst->offset_h, cryst->offset_w + cryst->nx * cryst->a,
+ cryst->offset_h);
+ XDrawLine(display, window, cryst->gc, cryst->offset_w,
+ cryst->offset_h, (int) (cryst->offset_w - cryst->ny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (cryst->ny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ inx = cryst->nx;
+ for (iny = 1; iny <= cryst->ny; iny++) {
+ XDrawLine(display, window, cryst->gc,
+ (int) (cryst->offset_w +
+ inx * cryst->a - (int) (iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD))),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) *
+ PI_RAD)) + cryst->offset_h,
+ (int) (cryst->offset_w - iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) +
+ cryst->offset_h);
+ }
+ iny = cryst->ny;
+ for (inx = 1; inx <= cryst->nx; inx++) {
+ XDrawLine(display, window, cryst->gc,
+ (int) (cryst->offset_w +
+ inx * cryst->a - (int) (iny * cryst->b *
+ sin((cryst->gamma - 90) * PI_RAD))),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + inx * cryst->a, cryst->offset_h);
+ }
+ } else {
+ int inx, iny;
+
+ inx = NRAND(cryst->nx);
+ iny = NRAND(cryst->ny);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) (iny * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) (iny * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ XDrawLine(display, window, cryst->gc,
+ cryst->offset_w + inx * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h,
+ cryst->offset_w + (inx + 1) * cryst->a - (int) ((iny + 1) * cryst->b * sin((cryst->gamma - 90) * PI_RAD)),
+ (int) ((iny + 1) * cryst->b * cos((cryst->gamma - 90) * PI_RAD)) + cryst->offset_h);
+ }
+ }
+ for (i = 0; i < cryst->num_atom; i++) {
+ crystalatom *atom0;
+
+ atom0 = &cryst->atom[i];
+ if (MI_NPIXELS(mi) > 2)
+ atom0->colour = MI_PIXEL(mi, NRAND(MI_NPIXELS(mi)));
+ else
+ atom0->colour = 1; /*Xor'red so WHITE may not be appropriate */
+ XSetForeground(display, cryst->gc, atom0->colour);
+ atom0->x0 = NRAND(cryst->a);
+ atom0->y0 = NRAND(cryst->b);
+ atom0->velocity[0] = NRAND(7) - 3;
+ atom0->velocity[1] = NRAND(7) - 3;
+ atom0->velocity_a = (NRAND(7) - 3) * PI_RAD;
+ atom0->angle = NRAND(90) * PI_RAD;
+ atom0->at_type = NRAND(3);
+ if (size_atom == 0)
+ atom0->size_at = DEF_SIZ_ATOM;
+ else if (size_atom > 0)
+ atom0->size_at = size_atom;
+ else
+ atom0->size_at = NRAND(-size_atom) + 1;
+ atom0->size_at++;
+ if (atom0->at_type == 2)
+ atom0->num_point = 3;
+ else
+ atom0->num_point = 4;
+ crystal_setupatom(atom0, cryst->gamma);
+ crystal_drawatom(mi, atom0);
+ }
+ XSetFunction(display, cryst->gc, GXcopy);
+}
char *progclass = "Cynosure";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 500000",
"*colors: 128",
"*iterations: 100",
char *progclass = "Deco";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*maxDepth: 12",
"*minWidth: 20",
"*minHeight: 20",
--- /dev/null
+/* -*- Mode: C; tab-width: 4 -*- */
+/* discrete --- chaotic mappings */
+
+#if !defined( lint ) && !defined( SABER )
+static const char sccsid[] = "@(#)discrete.c 4.10 98/04/24 xlockmore";
+
+#endif
+
+/*-
+ * Copyright (c) 1996 by Tim Auckland <Tim.Auckland@Sun.COM>
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * This file is provided AS IS with no warranties of any kind. The author
+ * shall have no liability with respect to the infringement of copyrights,
+ * trade secrets or any patents by this file or any part thereof. In no
+ * event will the author be liable for any lost revenue or profits or
+ * other special, indirect and consequential damages.
+ *
+ * "discrete" shows a number of fractals based on the "discrete map"
+ * type of dynamical systems. They include a different way of looking
+ * at the HOPALONG system, an inverse julia-set iteration, the "Standard
+ * Map" and the "Bird in a Thornbush" fractal.
+ *
+ * Revision History:
+ * 31-Jul-97: Ported to xlockmore-4
+ * 08-Aug-96: Adapted from hop.c Copyright (c) 1991 by Patrick J. Naughton.
+ */
+
+#ifdef STANDALONE
+# define PROGCLASS "Discrete"
+# define HACK_INIT init_discrete
+# define HACK_DRAW draw_discrete
+# define discrete_opts xlockmore_opts
+# define SMOOTH_COLORS
+# define BRIGHT_COLORS
+# define DEFAULTS "*delay: 1000 \n" \
+ "*count: 4096 \n" \
+ "*cycles: 2500 \n" \
+ "*ncolors: 100 \n"
+
+# include "xlockmore.h" /* in xscreensaver distribution */
+# include "erase.h"
+
+#else /* STANDALONE */
+# include "xlock.h" /* in xlockmore distribution */
+#endif /* STANDALONE */
+
+ModeSpecOpt discrete_opts =
+{0, NULL, 0, NULL, NULL};
+
+#ifdef USE_MODULES
+ModStruct discrete_description =
+{"discrete", "init_discrete", "draw_discrete", "release_discrete",
+ "refresh_discrete", "init_discrete", NULL, &discrete_opts,
+ 1000, 4096, 2500, 1, 64, 1.0, "",
+ "Shows various discrete maps", 0, NULL};
+
+#endif
+
+enum ftypes {
+ SQRT, BIRDIE, STANDARD, TRIG, CUBIC, HENON, AILUJ, HSHOE, DELOG
+};
+
+/*#define TEST STANDARD */
+
+#define BIASES 18
+static int bias[BIASES] =
+{
+ STANDARD, STANDARD, STANDARD, STANDARD,
+ SQRT, SQRT, SQRT, SQRT,
+ BIRDIE, BIRDIE, BIRDIE,
+ AILUJ, AILUJ, AILUJ,
+ TRIG, TRIG,
+ CUBIC,
+ HENON,
+};
+
+typedef struct {
+ int maxx;
+ int maxy; /* max of the screen */
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double i;
+ double j; /* discrete parameters */
+ double ic;
+ double jc;
+ double is;
+ double js;
+ int inc;
+ int pix;
+ enum ftypes op;
+ int count;
+ XPoint *pointBuffer; /* pointer for XDrawPoints */
+} discretestruct;
+
+static discretestruct *discretes = NULL;
+
+void
+init_discrete(ModeInfo * mi)
+{
+ double range;
+ discretestruct *hp;
+
+ if (discretes == NULL) {
+ if ((discretes =
+ (discretestruct *) calloc(MI_NUM_SCREENS(mi),
+ sizeof (discretestruct))) == NULL)
+ return;
+ }
+ hp = &discretes[MI_SCREEN(mi)];
+
+
+ hp->maxx = MI_WIDTH(mi);
+ hp->maxy = MI_HEIGHT(mi);
+#ifdef TEST
+ hp->op = TEST;
+#else
+ hp->op = bias[LRAND() % BIASES];
+#endif
+ switch (hp->op) {
+ case HSHOE:
+ hp->ic = 0;
+ hp->jc = 0;
+ hp->is = hp->maxx / (4);
+ hp->js = hp->maxy / (4);
+ hp->a = 0.5;
+ hp->b = 0.5;
+ hp->c = 0.2;
+ hp->d = -1.25;
+ hp->e = 1;
+ hp->i = hp->j = 0.0;
+ break;
+ case DELOG:
+ hp->ic = 0.5;
+ hp->jc = 0.3;
+ hp->is = hp->maxx / 1.5;
+ hp->js = hp->maxy / 1.5;
+ hp->a = 2.176399;
+ hp->i = hp->j = 0.01;
+ break;
+ case HENON:
+ hp->jc = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.4;
+ hp->ic = 1.3 * (1 - (hp->jc * hp->jc) / (0.4 * 0.4));
+ hp->is = hp->maxx;
+ hp->js = hp->maxy * 1.5;
+ hp->a = 1;
+ hp->b = 1.4;
+ hp->c = 0.3;
+ hp->i = hp->j = 0;
+ break;
+ case SQRT:
+ hp->ic = 0;
+ hp->jc = 0;
+ hp->is = 1;
+ hp->js = 1;
+ range = sqrt((double) hp->maxx * 2 * hp->maxx * 2 +
+ (double) hp->maxy * 2 * hp->maxy * 2) /
+ (10.0 + LRAND() % 10);
+
+ hp->a = (LRAND() / MAXRAND) * range - range / 2.0;
+ hp->b = (LRAND() / MAXRAND) * range - range / 2.0;
+ hp->c = (LRAND() / MAXRAND) * range - range / 2.0;
+ if (!(LRAND() % 2))
+ hp->c = 0.0;
+ hp->i = hp->j = 0.0;
+ break;
+ case STANDARD:
+ hp->ic = M_PI;
+ hp->jc = M_PI;
+ hp->is = hp->maxx / (M_PI * 2);
+ hp->js = hp->maxy / (M_PI * 2);
+ hp->a = 0; /* decay */
+ hp->b = (LRAND() / MAXRAND) * 2.0;
+ hp->c = 0;
+ hp->i = M_PI;
+ hp->j = M_PI;
+ break;
+ case BIRDIE:
+ hp->ic = 0;
+ hp->jc = 0;
+ hp->is = hp->maxx / 2;
+ hp->js = hp->maxy / 2;
+ hp->a = 1.99 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.2;
+ hp->b = 0;
+ hp->c = 0.8 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.1;
+ hp->i = hp->j = 0;
+ break;
+ case TRIG:
+ hp->a = 5;
+ hp->b = 0.5 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.3;
+ hp->ic = hp->a;
+ hp->jc = 0;
+ hp->is = hp->maxx / (hp->b * 20);
+ hp->js = hp->maxy / (hp->b * 20);
+ hp->i = hp->j = 0;
+ break;
+ case CUBIC:
+ hp->a = 2.77;
+ hp->b = 0.1 + ((LRAND() / MAXRAND) * 2.0 - 1.0) * 0.1;
+ hp->ic = 0;
+ hp->jc = 0;
+ hp->is = hp->maxx / 4;
+ hp->js = hp->maxy / 4;
+ hp->i = hp->j = 0.1;
+ break;
+ case AILUJ:
+ {
+ int i;
+ double x, y, xn, yn;
+
+ hp->ic = 0;
+ hp->jc = 0;
+ hp->is = hp->maxx / 4;
+ hp->js = hp->maxx / 4;
+ do {
+ hp->a = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 1.5 - 0.5;
+ hp->b = ((LRAND() / MAXRAND) * 2.0 - 1.0) * 1.5;
+ x = y = 0;
+#define MAXITER 10
+ for (i = 0; i < MAXITER && x * x + y * y < 13; i++) { /* 'Brot calc */
+ xn = x * x - y * y + hp->a;
+ yn = 2 * x * y + hp->b;
+ x = xn;
+ y = yn;
+ }
+ } while (i < MAXITER); /* wait for a connected set */
+ hp->i = hp->j = 0.1;
+ break;
+ }
+ }
+ hp->pix = 0;
+ hp->inc = 0;
+
+ if (hp->pointBuffer == NULL)
+ hp->pointBuffer = (XPoint *) malloc(MI_COUNT(mi) * sizeof (XPoint));
+
+ /* Clear the background. */
+ MI_CLEARWINDOW(mi);
+
+ hp->count = 0;
+}
+
+
+void
+draw_discrete(ModeInfo * mi)
+{
+ Display *dsp = MI_DISPLAY(mi);
+ Window win = MI_WINDOW(mi);
+ double oldj, oldi;
+ int batchcount = MI_COUNT(mi);
+ int cycles = MI_CYCLES(mi);
+ int k;
+ XPoint *xp;
+ GC gc = MI_GC(mi);
+ discretestruct *hp = &discretes[MI_SCREEN(mi)];
+
+ k = batchcount;
+ xp = hp->pointBuffer;
+
+ hp->inc++;
+
+ if (MI_NPIXELS(mi) > 2) {
+ XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix));
+ if (++hp->pix >= MI_NPIXELS(mi))
+ hp->pix = 0;
+ }
+ while (k--) {
+ oldj = hp->j;
+ oldi = hp->i;
+ switch (hp->op) {
+ case HSHOE:
+ {
+ int i;
+
+#if 0
+ if (!k) {
+ XSetForeground(dsp, gc, MI_BLACK_PIXEL(mi));
+ XFillRectangle(dsp, win, gc, 0, 0, hp->maxx, hp->maxy);
+ XSetForeground(dsp, gc, MI_PIXEL(mi, hp->pix));
+ } else
+#endif
+#define HD
+#ifdef HD
+ if (k < batchcount / 4) {
+ hp->i = ((double) k / batchcount) * 8 - 1;
+ hp->j = 1;
+ } else if (k < batchcount / 2) {
+ hp->i = 1;
+ hp->j = 3 - ((double) k / batchcount) * 8;
+ } else if (k < 3 * batchcount / 4) {
+ hp->i = 5 - ((double) k / batchcount) * 8;
+ hp->j = -1;
+ } else {
+ hp->i = -1;
+ hp->j = ((double) k / batchcount) * 8 - 7;
+ }
+ for (i = 1; i < (hp->inc % 15); i++) {
+ oldj = hp->j;
+ oldi = hp->i;
+#endif
+ hp->i = (hp->a * oldi + hp->b) * oldj;
+ hp->j = (hp->e - hp->d + hp->c * oldi) * oldj * oldj - hp->c * oldi + hp->d;
+#ifdef HD
+ }
+#endif
+ break;
+ }
+ case DELOG:
+ hp->j = oldi;
+ hp->i = hp->a * oldi * (1 - oldj);
+ break;
+ case HENON:
+ hp->i = oldj + hp->a - hp->b * oldi * oldi;
+ hp->j = hp->c * oldi;
+ break;
+ case SQRT:
+ if (k) {
+ hp->j = hp->a + hp->i;
+ hp->i = -oldj + (hp->i < 0
+ ? sqrt(fabs(hp->b * (hp->i - hp->c)))
+ : -sqrt(fabs(hp->b * (hp->i - hp->c))));
+ } else {
+ static int s = 1;
+
+ hp->i = s * hp->inc * hp->maxx / cycles / 2;
+ hp->j = hp->a + hp->i;
+ s = -s;
+ }
+ break;
+ case STANDARD:
+ if (k) {
+ hp->j = (1 - hp->a) * oldj + hp->b * sin(oldi) + hp->a * hp->c;
+ hp->j = fmod(hp->j + 2 * M_PI, 2 * M_PI);
+ hp->i = oldi + hp->j;
+ hp->i = fmod(hp->i + 2 * M_PI, 2 * M_PI);
+ } else {
+ static int s = 1;
+
+ hp->j = M_PI + fmod(s * hp->inc * 2 * M_PI / (cycles - 0.5), M_PI);
+ hp->i = M_PI;
+ s = -s;
+ }
+ break;
+ case BIRDIE:
+ hp->j = oldi;
+ hp->i = (1 - hp->c) * cos(M_PI * hp->a * oldj) + hp->c * hp->b;
+ hp->b = oldj;
+ break;
+ case TRIG:
+ {
+ double r2 = oldi * oldi + oldj * oldj;
+
+ hp->i = hp->a + hp->b * (oldi * cos(r2) - oldj * sin(r2));
+ hp->j = hp->b * (oldj * cos(r2) + oldi * sin(r2));
+ }
+ break;
+ case CUBIC:
+ hp->i = oldj;
+ hp->j = hp->a * oldj - oldj * oldj * oldj - hp->b * oldi;
+ break;
+ case AILUJ:
+ hp->i = ((LRAND() < MAXRAND / 2) ? -1 : 1) *
+ sqrt(((oldi - hp->a) +
+ sqrt((oldi - hp->a) * (oldi - hp->a) + (oldj - hp->b) * (oldj - hp->b))) / 2);
+ hp->j = (oldj - hp->b) / (2 * hp->i);
+ break;
+ }
+ xp->x = hp->maxx / 2 + (int) ((hp->i - hp->ic) * hp->is);
+ xp->y = hp->maxy / 2 - (int) ((hp->j - hp->jc) * hp->js);
+ xp++;
+ }
+ XDrawPoints(dsp, win, gc, hp->pointBuffer, batchcount, CoordModeOrigin);
+ if (++hp->count > cycles) {
+#ifdef STANDALONE
+ erase_full_window(MI_DISPLAY(mi), MI_WINDOW(mi));
+#endif /* STANDALONE */
+ init_discrete(mi);
+ }
+}
+
+void
+release_discrete(ModeInfo * mi)
+{
+ if (discretes != NULL) {
+ int screen;
+
+ for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
+ discretestruct *hp = &discretes[screen];
+
+ if (hp->pointBuffer != NULL)
+ (void) free((void *) hp->pointBuffer);
+ }
+ (void) free((void *) discretes);
+ discretes = NULL;
+ }
+}
+
+void
+refresh_discrete(ModeInfo * mi)
+{
+ MI_CLEARWINDOW(mi);
+}
* to get pleasing figures.
*/
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*colors: 100",
"*color0: red",
"*delay: 1000",
char *progclass = "Flame";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*colors: 64",
"*iterations: 25",
"*delay: 50000",
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_DIRS = @INSTALL_DIRS@
HACKDIR = @HACKDIR@
X_CFLAGS = @X_CFLAGS@
X_PRE_LIBS = @X_PRE_LIBS@
X_EXTRA_LIBS = @X_EXTRA_LIBS@
+# Note: see comment in ../driver/Makefile.in for explanation of X_LIBS, etc.
+#
HACK_LIBS = $(LIBS) $(X_LIBS) $(X_PRE_LIBS) @GL_LIBS@ @HACK_LIBS@ \
-lXt -lX11 -lXext $(X_EXTRA_LIBS) -lm
install-program:
@exes="$(EXES)" ; \
+ if [ ! -d $(HACKDIR) ]; then $(INSTALL_DIRS) $(HACKDIR) ; fi ; \
for program in $$exes; do \
echo $(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
$(INSTALL_PROGRAM) $$program $(HACKDIR)/$$program ; \
install-man:
@men="$(MEN)" ; \
+ if [ ! -d $(man1dir) ]; then $(INSTALL_DIRS) $(man1dir) ; fi ; \
for man in $$men; do \
instname=`echo $$man | sed 's/\.man$$/\.$(mansuffix)/'` ; \
echo $(INSTALL_DATA) $(srcdir)/$$man $(man1dir)/$$instname ; \
# close. This excludes dependencies on files in /usr/include, etc. It tries
# to include only dependencies on files which are themselves a part of this
# package.
-distdepend:
+distdepend::
@echo updating dependencies in `pwd`/Makefile.in... ; \
$(DEPEND) -w 0 -f - \
-s '# DO NOT DELETE: updated by make distdepend' $(DEPEND_FLAGS) -- \
char *progclass = "Goop";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 12000",
"*transparent: true",
"*additive: true",
char *progclass = "Greynetic";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 0",
0
};
char *progclass = "Halo";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*colorMode: random",
"*colors: 100",
"*cycle: true",
char *progclass = "Helix";
char *defaults [] = {
- "*background: black",
+ ".background: black",
"*delay: 5",
0
};
char *progclass = "Hypercube";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*color0: red",
"*color1: orange",
"*color2: yellow",
char *progclass = "Imsmap";
char *defaults [] = {
- "*background: black",
- "*foreground: black",
+ ".background: black",
+ ".foreground: black",
"*mode: random",
"*ncolors: 50",
"*iterations: 7",
char *progclass = "Jigsaw";
char *defaults [] = {
- "*background: Black",
- "*foreground: Gray40",
+ ".background: Black",
+ ".foreground: Gray40",
"*delay: 70000",
"*delay2: 5",
0
char *progclass = "Kaleidescope";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*color_mode: nice",
"*symmetry: 11",
"*ntrails: 100",
* DESCRIPTION Bilinear interpolation for morphing line shapes.
*
* WRITTEN BY Sverre H. Huseby Glenn T. Lines
- * Maridalsvn. 122, leil 101 Frysjavn. 3, 5. etg.
- * N-0461 Oslo N-0883 Oslo
+ * Kurvn. 30 Østgaardsgt. 5
+ * N-0495 Oslo N-0474 Oslo
* Norway Norway
*
- * Phone: +47 22 71 99 08 Phone: +47 22 23 71 99
- * E-mail: sverrehu@ifi.uio.no E-mail: gtl@si.sintef.no
+ * Phone: +47 901 63 579 Phone: +47 22 04 67 28
+ * E-mail: sverrehu@online.no E-mail: gtl@si.sintef.no
+ * URL: http://home.sol.no/~sverrehu/
*
* The original idea, and the bilinear interpolation
* mathematics used, emerged in the head of the wise
- * Glenn Terje Lines.
+ * Glenn T. Lines.
*
- * MODIFICATIONS march 1995
+ * MODIFICATIONS june 1998 (shh)
+ * * Minor code cleanup.
+ *
+ * march 1997 (shh)
+ * * Added -mailfile option to allow checking for
+ * new mail while the screensaver is active.
+ *
+ * january 1997 (shh)
+ * * Some code reformatting.
+ * * Added possibility to use float arithmetic.
+ * * Added -figtype option.
+ * * Made color blue default.
+ *
+ * december 1995 (jwz)
+ * * Function headers converted from ANSI to K&R.
+ * * Added posibility for random number of steps, and
+ * made this the default.
+ *
+ * march 1995 (shh)
* * Converted from an MS-Windows program to X Window.
*
**************************************************************************/
* *
**************************************************************************/
-/* Define MARGINS to make some space around the figure */
-#define MARGINS /**/
+/* define MARGINS to make some space around the figure. */
+#define MARGINS
+
+/* define USE_FLOAT to avoid using integer calculations in
+ createPoints. integer calculation is supposed to be faster, but it
+ won't work for displays larger than 2048x2048 or so pixels. */
+#undef USE_FLOAT
#define MAXFIGS 20
#define TWO_PI (2.0 * M_PI)
#define RND(x) (random() % (x))
+
+#define FT_OPEN 1
+#define FT_CLOSED 2
+#define FT_ALL (FT_OPEN | FT_CLOSED)
+
static int
- cFig = 0, /* Number of figure arrays. */
- cPoint, /* Number of points in each array. */
- nWork, /* Current work array number. */
- nFrom, /* Current from array number. */
- nTo; /* Current to array number. */
-static long
- delay; /* usecs to wait between updates. */
+ numFigs = 0, /* number of figure arrays. */
+ numPoints, /* number of points in each array. */
+ nWork, /* current work array number. */
+ nFrom, /* current from array number. */
+ nTo, /* current to array number. */
+ figType;
+static long delay; /* usecs to wait between updates. */
static XPoint
- *aWork[2], /* Working arrays. */
- *a[MAXFIGS], /* The figure arrays. */
- *aTmp, /* Used as source when interrupting morph */
- *aPrev, /* Previous points displayed. */
- *aCurr, /* The current points displayed. */
- *aFrom, /* Figure converting from. */
- *aTo; /* Figure converting to. */
-static double
- gam,
- maxGamma = 1.0,
- delta_gam;
-static GC
- gcDraw, gcClear;
-static Display
- *dpy;
-static Window
- window;
+ *aWork[2], /* working arrays. */
+ *a[MAXFIGS], /* the figure arrays. */
+ *aTmp, /* used as source when interrupting morph */
+ *aPrev, /* previous points displayed. */
+ *aCurr, /* the current points displayed. */
+ *aFrom, /* figure converting from. */
+ *aTo; /* figure converting to. */
+static int scrWidth, scrHeight;
+static double currGamma, maxGamma = 1.0, deltaGamma;
+static GC gcDraw, gcClear;
+static Display *dpy;
+static Window window;
char *progclass = "LMorph";
char *defaults [] = {
- "LMorph.background: black",
- "LMorph.foreground: green",
+ ".background: black",
+ ".foreground: blue",
"*points: 150",
"*steps: 0",
"*delay: 50000",
+ "*figtype: all",
0
};
XrmOptionDescRec options [] = {
- { "-points", ".points", XrmoptionSepArg, 0 },
- { "-steps", ".steps", XrmoptionSepArg, 0 },
- { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-points", ".points", XrmoptionSepArg, 0 },
+ { "-steps", ".steps", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { "-figtype", ".figtype", XrmoptionSepArg, 0 },
{ 0, 0, 0, 0 }
};
+int options_size = (sizeof (options) / sizeof (options[0]));
+
/**************************************************************************
return ret;
}
-
-
-static double frnd (void)
-{
- /*
- * Hm. for some reason the second line (using RAND_MAX) didn't
- * work on some machines, so I always use the first.
- */
-#ifndef dont_use_RAND_MAX
- return (double) (random() & 0x7FFF) / 0x7FFF;
-#else /* RAND_MAX */
- return ((double) random()) / RAND_MAX;
-#endif /* RAND_MAX */
-}
-
-
-
-static void initPointArrays (void)
+static void
+initPointArrays(void)
{
- XWindowAttributes wa;
int q, w,
- mx, my, /* Max screen coordinates. */
- mp, /* Max point number. */
+ mx, my, /* max screen coordinates. */
+ mp, /* max point number. */
s, rx, ry,
marginx, marginy;
double scalex, scaley;
- XGetWindowAttributes(dpy, window, &wa);
- mx = wa.width - 1;
- my = wa.height - 1;
- mp = cPoint - 1;
-
- aWork[0] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- aWork[1] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- aTmp = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
-
-
- /*
- * Figure 0
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- s = cPoint / 4;
- for (q = 0; q < s; q++) {
- a[cFig][q].x = ((double) q / s) * mx;
- a[cFig][q].y = 0;
- a[cFig][s + q].x = mx;
- a[cFig][s + q].y = ((double) q / s) * my;
- a[cFig][2 * s + q].x = mx - ((double) q / s) * mx;
- a[cFig][2 * s + q].y = my;
- a[cFig][3 * s + q].x = 0;
- a[cFig][3 * s + q].y = my - ((double) q / s) * my;
- }
- for (q = 4 * s; q < cPoint; q++)
- a[cFig][q].x = a[cFig][q].y = 0;
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 1
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = ((double) q / cPoint) * mx;
- a[cFig][q].y = (1.0 - sin(((double) q / mp) * TWO_PI)) * my / 2.0;
- }
- ++cFig;
-
- /*
- * Figure 2
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + rx * sin(1 * TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * cos(3 * TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 3
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * sin(3 * TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * cos(1 * TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 4
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * (1 - 0.1 * frnd())
- * sin(TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * (1 - 0.1 * frnd())
- * cos(TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 5
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * (0.8 - 0.2 * sin(30 * TWO_PI * q / mp))
- * sin(TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * (0.8 - 0.2 * sin(30 * TWO_PI * q / mp))
- * cos(TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 6
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * sin(TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * cos(TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 7
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + rx * cos(TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * sin(TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 8
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = ((double) q / mp) * mx;
- a[cFig][q].y = (1.0 - cos(((double) q / mp) * 3 * TWO_PI)) * my / 2.0;
- }
- ++cFig;
-
- /*
- * Figure 9
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + rx * sin(2 * TWO_PI * (double) q / mp);
- a[cFig][q].y = my / 2 + ry * cos(3 * TWO_PI * (double) q / mp);
- }
- a[cFig][mp].x = a[cFig][0].x;
- a[cFig][mp].y = a[cFig][0].y;
- ++cFig;
-
- /*
- * Figure 10
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * sin(5 * TWO_PI * (double) q / mp)
- * ((double) q / mp);
- a[cFig][q].y = my / 2 + ry * cos(5 * TWO_PI * (double) q / mp)
- * ((double) q / mp);
- }
- ++cFig;
-
- /*
- * Figure 11
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- rx = mx / 2;
- ry = my / 2;
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = mx / 2 + ry * sin(6 * TWO_PI * (double) q / mp)
- * ((double) q / mp);
- a[cFig][q].y = my / 2 - ry * cos(6 * TWO_PI * (double) q / mp)
- * ((double) q / mp);
+ mx = scrWidth - 1;
+ my = scrHeight - 1;
+ mp = numPoints - 1;
+
+ aWork[0] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ aWork[1] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ aTmp = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+
+ if (figType & FT_CLOSED) {
+ /* rectangle */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ s = numPoints / 4;
+ for (q = 0; q < s; q++) {
+ a[numFigs][q].x = ((double) q / s) * mx;
+ a[numFigs][q].y = 0;
+ a[numFigs][s + q].x = mx;
+ a[numFigs][s + q].y = ((double) q / s) * my;
+ a[numFigs][2 * s + q].x = mx - ((double) q / s) * mx;
+ a[numFigs][2 * s + q].y = my;
+ a[numFigs][3 * s + q].x = 0;
+ a[numFigs][3 * s + q].y = my - ((double) q / s) * my;
+ }
+ for (q = 4 * s; q < numPoints; q++)
+ a[numFigs][q].x = a[numFigs][q].y = 0;
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + rx * sin(1 * TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * cos(3 * TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + ry * sin(3 * TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * cos(1 * TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + ry
+ * (0.8 - 0.2 * sin(30 * TWO_PI * q / mp))
+ * sin(TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry
+ * (0.8 - 0.2 * sin(30 * TWO_PI * q / mp))
+ * cos(TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + ry * sin(TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * cos(TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + rx * cos(TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * sin(TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + rx * sin(2 * TWO_PI * (double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * cos(3 * TWO_PI * (double) q / mp);
+ }
+ a[numFigs][mp].x = a[numFigs][0].x;
+ a[numFigs][mp].y = a[numFigs][0].y;
+ ++numFigs;
}
- ++cFig;
-
- /*
- * Figure 12
- */
- a[cFig] = (XPoint *) xmalloc(cPoint * sizeof(XPoint));
- for (q = 0; q < cPoint; q++) {
- a[cFig][q].x = ((double) q / mp) * mx;
- a[cFig][q].y = (1.0 - sin(((double) q / mp) * 5 * TWO_PI)) * my / 2.0;
+
+ if (figType & FT_OPEN) {
+ /* sine wave, one period */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = ((double) q / numPoints) * mx;
+ a[numFigs][q].y = (1.0 - sin(((double) q / mp) * TWO_PI))
+ * my / 2.0;
+ }
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = ((double) q / mp) * mx;
+ a[numFigs][q].y = (1.0 - cos(((double) q / mp) * 3 * TWO_PI))
+ * my / 2.0;
+ }
+ ++numFigs;
+
+ /* spiral, one endpoint at bottom */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + ry * sin(5 * TWO_PI * (double) q / mp)
+ * ((double) q / mp);
+ a[numFigs][q].y = my / 2 + ry * cos(5 * TWO_PI * (double) q / mp)
+ * ((double) q / mp);
+ }
+ ++numFigs;
+
+ /* spiral, one endpoint at top */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ rx = mx / 2;
+ ry = my / 2;
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = mx / 2 + ry * sin(6 * TWO_PI * (double) q / mp)
+ * ((double) q / mp);
+ a[numFigs][q].y = my / 2 - ry * cos(6 * TWO_PI * (double) q / mp)
+ * ((double) q / mp);
+ }
+ ++numFigs;
+
+ /* */
+ a[numFigs] = (XPoint *) xmalloc(numPoints * sizeof(XPoint));
+ for (q = 0; q < numPoints; q++) {
+ a[numFigs][q].x = ((double) q / mp) * mx;
+ a[numFigs][q].y = (1.0 - sin(((double) q / mp) * 5 * TWO_PI))
+ * my / 2.0;
+ }
+ ++numFigs;
}
- ++cFig;
#ifdef MARGINS
- /*
- * Make some space around the figures.
- */
+ /* make some space around the figures. */
marginx = (mx + 1) / 10;
marginy = (my + 1) / 10;
scalex = (double) ((mx + 1) - 2.0 * marginx) / (mx + 1.0);
scaley = (double) ((my + 1) - 2.0 * marginy) / (my + 1.0);
- for (q = 0; q < cFig; q++)
- for (w = 0; w < cPoint; w++) {
+ for (q = 0; q < numFigs; q++)
+ for (w = 0; w < numPoints; w++) {
a[q][w].x = marginx + a[q][w].x * scalex;
a[q][w].y = marginy + a[q][w].y * scaley;
}
#endif
}
-
-
-static void createPoints (void)
-{
- int q;
- XPoint *pa = aCurr, *pa1 = aFrom, *pa2 = aTo;
- long lg, l1g;
-
-
- lg = 8192L * gam, l1g = 8192L * (1.0 - gam);
- for (q = 0; q < cPoint; q++) {
- pa->x = (short) ((l1g * pa1->x + lg * pa2->x) / 8192L);
- pa->y = (short) ((l1g * pa1->y + lg * pa2->y) / 8192L);
- ++pa;
- ++pa1;
- ++pa2;
- }
-}
-
-
-static void drawImage (void)
-{
- register int q;
- XPoint *old0, *old1, *new0, *new1;
-
- /*
- * Problem: update the window without too much flickering. I do
- * this by handling each linesegment separately. First remove a
- * line, then draw the new line. The problem is that this leaves
- * small black pixels on the figure. To fix this, I draw the
- * entire figure using XDrawLines() afterwards.
- */
- if (aPrev) {
- old0 = aPrev;
- old1 = aPrev + 1;
- new0 = aCurr;
- new1 = aCurr + 1;
- for (q = cPoint - 1; q; q--) {
- XDrawLine(dpy, window, gcClear,
- old0->x, old0->y, old1->x, old1->y);
- XDrawLine(dpy, window, gcDraw,
- new0->x, new0->y, new1->x, new1->y);
- ++old0;
- ++old1;
- ++new0;
- ++new1;
- }
- }
- XDrawLines(dpy, window, gcDraw, aCurr, cPoint, CoordModeOrigin);
- XFlush(dpy);
-}
-
-static void initLMorph (void)
+static void
+initLMorph(void)
{
int steps;
XGCValues gcv;
XWindowAttributes wa;
Colormap cmap;
+ char *ft;
- cPoint = get_integer_resource("points", "Integer");
+ numPoints = get_integer_resource("points", "Integer");
steps = get_integer_resource("steps", "Integer");
delay = get_integer_resource("delay", "Integer");
+ ft = get_string_resource("figtype", "String");
+
+ if (strcmp(ft, "all") == 0)
+ figType = FT_ALL;
+ else if (strcmp(ft, "open") == 0)
+ figType = FT_OPEN;
+ else if (strcmp(ft, "closed") == 0)
+ figType = FT_CLOSED;
+ else {
+ fprintf(stderr, "figtype should be `all', `open' or `closed'.\n");
+ figType = FT_ALL;
+ }
if (steps <= 0)
steps = (random() % 400) + 100;
- delta_gam = 1.0 / steps;
+ deltaGamma = 1.0 / steps;
XGetWindowAttributes(dpy, window, &wa);
+ scrWidth = wa.width;
+ scrHeight = wa.height;
cmap = wa.colormap;
gcv.foreground = get_pixel_resource("foreground", "Foreground", dpy, cmap);
gcDraw = XCreateGC(dpy, window, GCForeground, &gcv);
gcClear = XCreateGC(dpy, window, GCForeground, &gcv);
XClearWindow(dpy, window);
+ srandom(time(NULL));
initPointArrays();
aCurr = aWork[nWork = 0];
aPrev = NULL;
- gam = 2.0;
- nTo = RND(cFig);
+ currGamma = maxGamma + 1.0; /* force creation of new figure at startup */
+ nTo = RND(numFigs);
- {
+ { /* jwz for version 2.11 */
int width = random() % 10;
int style = LineSolid;
int cap = (width > 1 ? CapRound : CapButt);
XSetLineAttributes(dpy, gcDraw, width, style, cap, join);
XSetLineAttributes(dpy, gcClear, width, style, cap, join);
}
+}
+
+/* 55% of execution time */
+static void
+createPoints(void)
+{
+ int q;
+ XPoint *pa = aCurr, *pa1 = aFrom, *pa2 = aTo;
+#ifdef USE_FLOAT
+ float fg, f1g;
+#else
+ long lg, l1g;
+#endif
+
+#ifdef USE_FLOAT
+ fg = currGamma;
+ f1g = 1.0 - currGamma;
+#else
+ lg = 8192L * currGamma;
+ l1g = 8192L * (1.0 - currGamma);
+#endif
+ for (q = numPoints; q; q--) {
+#ifdef USE_FLOAT
+ pa->x = (short) (f1g * pa1->x + fg * pa2->x);
+ pa->y = (short) (f1g * pa1->y + fg * pa2->y);
+#else
+ pa->x = (short) ((l1g * pa1->x + lg * pa2->x) / 8192L);
+ pa->y = (short) ((l1g * pa1->y + lg * pa2->y) / 8192L);
+#endif
+ ++pa;
+ ++pa1;
+ ++pa2;
+ }
+}
+
+/* 36% of execution time */
+static void
+drawImage(void)
+{
+ int q;
+ XPoint *old0, *old1, *new0, *new1;
+
+ /* Problem: update the window without too much flickering. I do
+ * this by handling each linesegment separately. First remove a
+ * line, then draw the new line. The problem is that this leaves
+ * small black pixels on the figure. To fix this, I draw the
+ * entire figure using XDrawLines() afterwards. */
+ if (aPrev) {
+ old0 = aPrev;
+ old1 = aPrev + 1;
+ new0 = aCurr;
+ new1 = aCurr + 1;
+ for (q = numPoints - 1; q; q--) {
+ XDrawLine(dpy, window, gcClear,
+ old0->x, old0->y, old1->x, old1->y);
+ XDrawLine(dpy, window, gcDraw,
+ new0->x, new0->y, new1->x, new1->y);
+ ++old0;
+ ++old1;
+ ++new0;
+ ++new1;
+ }
+ }
+ XDrawLines(dpy, window, gcDraw, aCurr, numPoints, CoordModeOrigin);
+ XFlush(dpy);
}
-static void animateLMorph (void)
+/* neglectible % of execution time */
+static void
+animateLMorph(void)
{
- if (gam > maxGamma) {
- gam = 0.0;
+ if (currGamma > maxGamma) {
+ currGamma = 0.0;
if (maxGamma == 1.0) {
nFrom = nTo;
aFrom = a[nFrom];
} else {
- memcpy(aTmp, aCurr, cPoint * sizeof(XPoint));
+ memcpy(aTmp, aCurr, numPoints * sizeof(XPoint));
aFrom = aTmp;
nFrom = -1;
}
do {
- nTo = RND(cFig);
+ nTo = RND(numFigs);
} while (nTo == nFrom);
aTo = a[nTo];
if (RND(2)) {
- /*
- * Reverse the array to get more variation.
- */
+ /* reverse the array to get more variation. */
int i1, i2;
XPoint p;
- for (i1 = 0, i2 = cPoint - 1; i1 < cPoint / 2; i1++, i2--) {
+ for (i1 = 0, i2 = numPoints - 1; i1 < numPoints / 2; i1++, i2--) {
p = aTo[i1];
aTo[i1] = aTo[i2];
aTo[i2] = p;
}
}
- /*
- * It may be nice to interrupt the next run.
- */
- if (RND(3) > 0)
- maxGamma = 0.1 + 0.7 * (RND(1001) / 1000.0);
+ /* occationally interrupt the next run. */
+ if (RND(4) == 0)
+ maxGamma = 0.1 + 0.7 * (RND(1001) / 1000.0); /* partial run */
else
- maxGamma = 1.0;
+ maxGamma = 1.0; /* full run */
}
createPoints();
aPrev = aCurr;
aCurr = aWork[nWork ^= 1];
- gam += delta_gam;
+ currGamma += deltaGamma;
}
lmorph \- morphing lines
.SH SYNOPSIS
.B lmorph
-[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-points \fIint\fP] [\-steps \fIint\fP] [\-delay \fIusecs\fP]
+[\-display \fIhost:display.screen\fP] [\-foreground \fIcolor\fP] [\-background \fIcolor\fP] [\-window] [\-root] [\-mono] [\-install] [\-visual \fIvisual\fP] [\-points \fIint\fP] [\-steps \fIint\fP] [\-delay \fIusecs\fP] [\-figtype \fItype\fP]
.SH DESCRIPTION
The \fIlmorph\fP program morphs between simple linedrawings using bilinear
interpolation.
.B \-delay \fImicroseconds\fP
How much of a delay should be introduced between steps of the animation.
Default 50000.
+.TP 8
+.B \-figtype \fItype\fP
+Limit the figures to only open or closed figures. Possible types are
+"all" (default), "open" and "closed".
.SH ENVIRONMENT
.PP
.TP 8
.BR X (1),
.BR xscreensaver (1)
.SH AUTHOR
-Sverre H. Huseby <sverrehu@ifi.uio.no> and Glenn T. Lines <gtl@si.sintef.no>,
+Sverre H. Huseby <sverrehu@online.no> and Glenn T. Lines <gtl@si.sintef.no>,
built on top of the screen saver routines by Jamie Zawinski <jwz@netscape.com>.
char *progclass = "Maze";
char *defaults[] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*gridSize: 0",
"*solveDelay: 5000",
"*preDelay: 2000000",
char *progclass = "Moire";
char *defaults [] = {
- "*background: blue",
- "*foreground: red",
+ ".background: blue",
+ ".foreground: red",
"*random: true",
"*delay: 5",
"*ncolors: 64",
char *progclass = "Moire2";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 50000",
"*thickness: 0",
"*colors: 150",
char *progclass = "Munch";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 5000",
"*hold: 100000",
"*clear: 50",
char *progclass = "Noseguy";
char *defaults [] = {
- "*background: black",
- "*foreground: gray80",
+ ".background: black",
+ ".foreground: gray80",
#ifndef VMS
"*mode: program",
#else
* should be dark.
*/
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 5",
"*fadedelay: 200000",
"*maxlines: 1000",
char *progclass = "Pyro";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*count: 100",
"*frequency: 30",
"*scatter: 20",
char *progclass = "Qix";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*count: 1",
"*segments: 50",
"*poly: 2",
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*width: 0", /* tried to use -1 but it complained */
"*height: 0",
"*epoch: 40000",
char *progclass = "Rocks";
char *defaults [] = {
- "*background: Black",
- "*foreground: #E9967A",
+ ".background: Black",
+ ".foreground: #E9967A",
"*colors: 5",
"*count: 100",
"*delay: 50000",
char *progclass = "Rorschach";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*xsymmetry: true",
"*ysymmetry: false",
"*iterations: 4000",
};
static char *default_defaults[] = {
- "*root: false",
+ ".root: false",
"*geometry: 600x480", /* this should be .geometry, but nooooo... */
"*mono: false",
"*installColormap: false",
def_defaults_size * sizeof(*defaults));
memcpy (merged_defaults + def_defaults_size, defaults,
(defaults_size + 1) * sizeof(*defaults));
+
+ /* This totally sucks. Xt should behave like this by default.
+ If the string in `defaults' looks like ".foo", change that
+ to "Progclass.foo".
+ */
+ {
+ char **s;
+ for (s = merged_defaults; *s; s++)
+ if (**s == '.')
+ {
+ const char *oldr = *s;
+ char *newr = (char *) malloc(strlen(oldr) + strlen(progclass) + 3);
+ strcpy (newr, progclass);
+ strcat (newr, oldr);
+ *s = newr;
+ }
+ }
}
\f
"*visualID: Best",
#endif
- "SlidePuzzle.background: Black",
- "SlidePuzzle.foreground: Gray",
+ ".background: Black",
+ ".foreground: Gray",
"*gridSize: 70",
"*pixelIncrement: 10",
"*internalBorderWidth: 4",
char *progclass = "Starfish";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*delay: 10000",
"*cycleDelay: 100000",
"*thickness: 0", /* pixels, 0 = random */
char *progclass = "XJack";
char *defaults [] = {
- "*background: black",
- "*foreground: #00EE00",
+ ".background: black",
+ ".foreground: #00EE00",
"XJack.font: -*-courier-medium-r-*-*-*-240-*-*-m-*-*-*",
"*delay: 50000",
0
#define MI_COUNT(MI) (MI_BATCHCOUNT((MI)))
#define MI_BLACK_PIXEL(MI) (MI_WIN_BLACK_PIXEL(MI))
#define MI_WHITE_PIXEL(MI) (MI_WIN_WHITE_PIXEL(MI))
+#define MI_IS_FULLRANDOM(MI) (MI_WIN_IS_FULLRANDOM(MI))
+#define MI_IS_VERBOSE(MI) (MI_WIN_IS_VERBOSE(MI))
#define MI_CLEARWINDOW(mi) XClearWindow(MI_DISPLAY(mi), MI_WINDOW(mi))
char *progclass = "XLyap";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*randomize: false",
"*builtin: -1",
"*minColor: 1",
char *progclass = "XRoger";
char *defaults [] = {
- "XRoger.background: black",
- "XRoger.foreground: red",
+ ".background: black",
+ ".foreground: red",
"*delay: 5",
0
};
$ bsod :== $'mydir'bsod
$ bubbles :== $'mydir'bubbles
$ coral :== $'mydir'coral
+$ crystal :== $'mydir'crystal
$ cynosure :== $'mydir'cynosure
$ decayscreen :== $'mydir'decayscreen
$ deco :== $'mydir'deco
+$ discrete :== $'mydir'discrete
$ drift :== $'mydir'drift
$ epicycle :== $'mydir'epicycle
$ fadeplot :== $'mydir'fadeplot
static const char screensaver_id[] =
- "@(#)xscreensaver 2.21, by Jamie Zawinski (jwz@netscape.com)";
+ "@(#)xscreensaver 2.23, by Jamie Zawinski (jwz@netscape.com)";
Begin3
Title: xscreensaver
-Version: 2.21
-Entered-date: 15JUN98
+Version: 2.23
+Entered-date: 21JUN98
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.
Author: jwz@netscape.com (Jamie Zawinski)
Maintained-by: jwz@netscape.com (Jamie Zawinski)
Primary-site: ftp.x.org /contrib/applications/
- 805K xscreensaver-2.21.tar.gz
- 21K xscreensaver.README
+ 819K xscreensaver-2.23.tar.gz
+ 22K xscreensaver.README
1K xscreensaver.lsm
Alternate-site: sunsite.unc.edu /pub/Linux/X11/screensavers/
- 805K xscreensaver-2.21.tar.gz
- 21K xscreensaver.README
+ 819K xscreensaver-2.23.tar.gz
+ 22K xscreensaver.README
1K xscreensaver.lsm
Platforms: Linux, Irix, SunOS, Solaris, HPUX, AIX, FreeBSD, NetBSD,
BSDI, SCO, OSF1, Ultrix, VMS.